comparison lisp/mail/supercite.el @ 57933:59c9a776a021

(sc-cite-region): Don't use interactive-p. Add arg INTERACTIVE. (sc-version): Don't use interactive-p. Rename arg to MESSAGE.
author Richard M. Stallman <rms@gnu.org>
date Thu, 04 Nov 2004 10:14:47 +0000
parents a5b6e1d4a842
children 56323d9f97e3 cb7f41387eb3
comparison
equal deleted inserted replaced
57932:93792c00945b 57933:59c9a776a021
1422 (insert (or prefix sc-default-attribution)) 1422 (insert (or prefix sc-default-attribution))
1423 (sc-fill-if-different prefix)) 1423 (sc-fill-if-different prefix))
1424 nil) 1424 nil)
1425 1425
1426 ;; interactive functions 1426 ;; interactive functions
1427 (defun sc-cite-region (start end &optional confirm-p) 1427 (defun sc-cite-region (start end &optional confirm-p interactive)
1428 "Cite a region delineated by START and END. 1428 "Cite a region delineated by START and END.
1429 If optional CONFIRM-P is non-nil, the attribution is confirmed before 1429 If optional CONFIRM-P is non-nil, the attribution is confirmed before
1430 its use in the citation string. This function first runs 1430 its use in the citation string. This function first runs
1431 `sc-pre-cite-hook'." 1431 `sc-pre-cite-hook'.
1432 (interactive "r\nP") 1432
1433 When called interactively, the optional arg INTERACTIVE is non-nil,
1434 and that means call `sc-select-attribution' too."
1435 (interactive "r\nP\np")
1433 (undo-boundary) 1436 (undo-boundary)
1434 (let ((frame (or (sc-scan-info-alist sc-cite-frame-alist) 1437 (let ((frame (or (sc-scan-info-alist sc-cite-frame-alist)
1435 sc-default-cite-frame)) 1438 sc-default-cite-frame))
1436 (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)))
1437 (run-hooks 'sc-pre-cite-hook) 1440 (run-hooks 'sc-pre-cite-hook)
1438 (if (interactive-p) 1441 (if interactive
1439 (sc-select-attribution)) 1442 (sc-select-attribution))
1440 (regi-interpret frame start end))) 1443 (regi-interpret frame start end)))
1441 1444
1442 (defun sc-uncite-region (start end) 1445 (defun sc-uncite-region (start end)
1443 "Uncite a region delineated by START and END. 1446 "Uncite a region delineated by START and END.
1976 (looking-at "^[ \t]*$") 1979 (looking-at "^[ \t]*$")
1977 (consp arg)) 1980 (consp arg))
1978 (insert (sc-mail-field "sc-citation")) 1981 (insert (sc-mail-field "sc-citation"))
1979 (error "Line is already cited")))) 1982 (error "Line is already cited"))))
1980 1983
1981 (defun sc-version (arg) 1984 (defun sc-version (message)
1982 "Echo the current version of Supercite in the minibuffer. 1985 "Echo the current version of Supercite in the minibuffer.
1983 With \\[universal-argument] (universal-argument), or if run non-interactively, 1986 If MESSAGE is non-nil (interactively, with no prefix argument),
1984 inserts the version string in the current buffer instead." 1987 inserts the version string in the current buffer instead."
1985 (interactive "P") 1988 (interactive (not current-prefix-arg))
1986 (let ((verstr (format "Using Supercite.el %s" sc-version))) 1989 (let ((verstr (format "Using Supercite.el %s" sc-version)))
1987 (if (or (consp arg) 1990 (if message
1988 (not (interactive-p))) 1991 (message verstr)
1989 (insert "`sc-version' says: " verstr) 1992 (insert "`sc-version' says: " verstr))))
1990 (message verstr))))
1991 1993
1992 (defun sc-describe () 1994 (defun sc-describe ()
1993 " 1995 "
1994 Supercite is a package which provides a flexible mechanism for citing 1996 Supercite is a package which provides a flexible mechanism for citing
1995 email and news replies. Please see the associated texinfo file for 1997 email and news replies. Please see the associated texinfo file for