comparison lisp/mail/supercite.el @ 58952:5c34e026a96e

(sc-cite-frame-alist): Doc fix. (sc-cite-region, sc-uncite-region, sc-recite-region): Fix previous change to handle not alist as a symbol, but a citation frame as a symbol that represents a variable name.
author Juri Linkov <juri@jurta.org>
date Tue, 14 Dec 2004 00:53:05 +0000
parents 9a25f0f7fd26
children 480134f8cd16 fb79180b618d
comparison
equal deleted inserted replaced
58951:c7ebd794182b 58952:5c34e026a96e
144 (INFOKEY ((REGEXP . FRAME) 144 (INFOKEY ((REGEXP . FRAME)
145 (REGEXP . FRAME) 145 (REGEXP . FRAME)
146 (...))) 146 (...)))
147 147
148 Where INFOKEY is a key for `sc-mail-field', REGEXP is a regular 148 Where INFOKEY is a key for `sc-mail-field', REGEXP is a regular
149 expression to match against the INFOKEY's value. FRAME is a citation 149 expression to match against the INFOKEY's value. FRAME is
150 frame, or a variable containing a citation frame." 150 a citation frame, or a symbol that represents the name of
151 a variable whose value is a citation frame."
151 :type '(repeat (list symbol (repeat (cons regexp 152 :type '(repeat (list symbol (repeat (cons regexp
152 (choice (repeat (repeat sexp)) 153 (choice (repeat (repeat sexp))
153 symbol))))) 154 symbol)))))
154 :group 'supercite-frames) 155 :group 'supercite-frames)
155 156
1432 1433
1433 When called interactively, the optional arg INTERACTIVE is non-nil, 1434 When called interactively, the optional arg INTERACTIVE is non-nil,
1434 and that means call `sc-select-attribution' too." 1435 and that means call `sc-select-attribution' too."
1435 (interactive "r\nP\np") 1436 (interactive "r\nP\np")
1436 (undo-boundary) 1437 (undo-boundary)
1437 (let ((frame (or (sc-scan-info-alist 1438 (let ((frame (sc-scan-info-alist sc-cite-frame-alist))
1438 (if (symbolp sc-cite-frame-alist)
1439 (symbol-value sc-cite-frame-alist)
1440 sc-cite-frame-alist))
1441 sc-default-cite-frame))
1442 (sc-confirm-always-p (if confirm-p t sc-confirm-always-p))) 1439 (sc-confirm-always-p (if confirm-p t sc-confirm-always-p)))
1440 (if (and frame (symbolp frame))
1441 (setq frame (symbol-value frame)))
1442 (or frame (setq frame sc-default-cite-frame))
1443 (run-hooks 'sc-pre-cite-hook) 1443 (run-hooks 'sc-pre-cite-hook)
1444 (if interactive 1444 (if interactive
1445 (sc-select-attribution)) 1445 (sc-select-attribution))
1446 (regi-interpret frame start end))) 1446 (regi-interpret frame start end)))
1447 1447
1448 (defun sc-uncite-region (start end) 1448 (defun sc-uncite-region (start end)
1449 "Uncite a region delineated by START and END. 1449 "Uncite a region delineated by START and END.
1450 First runs `sc-pre-uncite-hook'." 1450 First runs `sc-pre-uncite-hook'."
1451 (interactive "r") 1451 (interactive "r")
1452 (undo-boundary) 1452 (undo-boundary)
1453 (let ((frame (or (sc-scan-info-alist 1453 (let ((frame (sc-scan-info-alist sc-uncite-frame-alist)))
1454 (if (symbolp sc-uncite-frame-alist) 1454 (if (and frame (symbolp frame))
1455 (symbol-value sc-uncite-frame-alist) 1455 (setq frame (symbol-value frame)))
1456 sc-uncite-frame-alist)) 1456 (or frame (setq frame sc-default-uncite-frame))
1457 sc-default-uncite-frame)))
1458 (run-hooks 'sc-pre-uncite-hook) 1457 (run-hooks 'sc-pre-uncite-hook)
1459 (regi-interpret frame start end))) 1458 (regi-interpret frame start end)))
1460 1459
1461 (defun sc-recite-region (start end) 1460 (defun sc-recite-region (start end)
1462 "Recite a region delineated by START and END. 1461 "Recite a region delineated by START and END.
1463 First runs `sc-pre-recite-hook'." 1462 First runs `sc-pre-recite-hook'."
1464 (interactive "r") 1463 (interactive "r")
1465 (let ((sc-confirm-always-p t)) 1464 (let ((sc-confirm-always-p t))
1466 (sc-select-attribution)) 1465 (sc-select-attribution))
1467 (undo-boundary) 1466 (undo-boundary)
1468 (let ((frame (or (sc-scan-info-alist 1467 (let ((frame (sc-scan-info-alist sc-recite-frame-alist)))
1469 (if (symbolp sc-recite-frame-alist) 1468 (if (and frame (symbolp frame))
1470 (symbol-value sc-recite-frame-alist) 1469 (setq frame (symbol-value frame)))
1471 sc-recite-frame-alist)) 1470 (or frame (setq frame sc-default-recite-frame))
1472 sc-default-recite-frame)))
1473 (run-hooks 'sc-pre-recite-hook) 1471 (run-hooks 'sc-pre-recite-hook)
1474 (regi-interpret frame start end))) 1472 (regi-interpret frame start end)))
1475 1473
1476 1474
1477 ;; ====================================================================== 1475 ;; ======================================================================