summaryrefslogtreecommitdiff
path: root/lisp/mail/supercite.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mail/supercite.el')
-rw-r--r--lisp/mail/supercite.el104
1 files changed, 54 insertions, 50 deletions
diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el
index 99ac41dd9ba..d545b0c3f15 100644
--- a/lisp/mail/supercite.el
+++ b/lisp/mail/supercite.el
@@ -1,4 +1,4 @@
-;;; supercite.el --- minor mode for citing mail and news replies
+;;; supercite.el --- minor mode for citing mail and news replies -*- lexical-binding: t; -*-
;; Copyright (C) 1993, 1997, 2001-2021 Free Software Foundation, Inc.
@@ -527,71 +527,71 @@ string."
(defvar sc-T-keymap
(let ((map (make-sparse-keymap)))
- (define-key map "a" 'sc-S-preferred-attribution-list)
- (define-key map "b" 'sc-T-mail-nuke-blank-lines)
- (define-key map "c" 'sc-T-confirm-always)
- (define-key map "d" 'sc-T-downcase)
- (define-key map "e" 'sc-T-electric-references)
- (define-key map "f" 'sc-T-auto-fill-region)
- (define-key map "h" 'sc-T-describe)
- (define-key map "l" 'sc-S-cite-region-limit)
- (define-key map "n" 'sc-S-mail-nuke-mail-headers)
- (define-key map "N" 'sc-S-mail-header-nuke-list)
- (define-key map "o" 'sc-T-electric-circular)
- (define-key map "p" 'sc-S-preferred-header-style)
- (define-key map "s" 'sc-T-nested-citation)
- (define-key map "u" 'sc-T-use-only-preferences)
- (define-key map "w" 'sc-T-fixup-whitespace)
- (define-key map "?" 'sc-T-describe)
+ (define-key map "a" #'sc-S-preferred-attribution-list)
+ (define-key map "b" #'sc-T-mail-nuke-blank-lines)
+ (define-key map "c" #'sc-T-confirm-always)
+ (define-key map "d" #'sc-T-downcase)
+ (define-key map "e" #'sc-T-electric-references)
+ (define-key map "f" #'sc-T-auto-fill-region)
+ (define-key map "h" #'sc-T-describe)
+ (define-key map "l" #'sc-S-cite-region-limit)
+ (define-key map "n" #'sc-S-mail-nuke-mail-headers)
+ (define-key map "N" #'sc-S-mail-header-nuke-list)
+ (define-key map "o" #'sc-T-electric-circular)
+ (define-key map "p" #'sc-S-preferred-header-style)
+ (define-key map "s" #'sc-T-nested-citation)
+ (define-key map "u" #'sc-T-use-only-preferences)
+ (define-key map "w" #'sc-T-fixup-whitespace)
+ (define-key map "?" #'sc-T-describe)
map)
"Keymap for sub-keymap of setting and toggling functions.")
(defvar sc-mode-map
(let ((map (make-sparse-keymap)))
- (define-key map "c" 'sc-cite-region)
- (define-key map "f" 'sc-mail-field-query)
- (define-key map "g" 'sc-mail-process-headers)
- (define-key map "h" 'sc-describe)
- (define-key map "i" 'sc-insert-citation)
- (define-key map "o" 'sc-open-line)
- (define-key map "r" 'sc-recite-region)
- (define-key map "\C-p" 'sc-raw-mode-toggle)
- (define-key map "u" 'sc-uncite-region)
- (define-key map "w" 'sc-insert-reference)
- (define-key map "\C-t" sc-T-keymap)
- (define-key map "?" 'sc-describe)
+ (define-key map "c" #'sc-cite-region)
+ (define-key map "f" #'sc-mail-field-query)
+ (define-key map "g" #'sc-mail-process-headers)
+ (define-key map "h" #'sc-describe)
+ (define-key map "i" #'sc-insert-citation)
+ (define-key map "o" #'sc-open-line)
+ (define-key map "r" #'sc-recite-region)
+ (define-key map "\C-p" #'sc-raw-mode-toggle)
+ (define-key map "u" #'sc-uncite-region)
+ (define-key map "w" #'sc-insert-reference)
+ (define-key map "\C-t" sc-T-keymap)
+ (define-key map "?" #'sc-describe)
map)
"Keymap for Supercite quasi-mode.")
(defvar sc-electric-mode-map
(let ((map (make-sparse-keymap)))
- (define-key map "p" 'sc-eref-prev)
- (define-key map "n" 'sc-eref-next)
- (define-key map "s" 'sc-eref-setn)
- (define-key map "j" 'sc-eref-jump)
- (define-key map "x" 'sc-eref-abort)
- (define-key map "q" 'sc-eref-abort)
- (define-key map "\r" 'sc-eref-exit)
- (define-key map "\n" 'sc-eref-exit)
- (define-key map "g" 'sc-eref-goto)
- (define-key map "?" 'describe-mode)
- (define-key map "\C-h" 'describe-mode)
- (define-key map [f1] 'describe-mode)
- (define-key map [help] 'describe-mode)
+ (define-key map "p" #'sc-eref-prev)
+ (define-key map "n" #'sc-eref-next)
+ (define-key map "s" #'sc-eref-setn)
+ (define-key map "j" #'sc-eref-jump)
+ (define-key map "x" #'sc-eref-abort)
+ (define-key map "q" #'sc-eref-abort)
+ (define-key map "\r" #'sc-eref-exit)
+ (define-key map "\n" #'sc-eref-exit)
+ (define-key map "g" #'sc-eref-goto)
+ (define-key map "?" #'describe-mode)
+ (define-key map "\C-h" #'describe-mode)
+ (define-key map [f1] #'describe-mode)
+ (define-key map [help] #'describe-mode)
map)
"Keymap for `sc-electric-mode' electric references mode.")
(defvar sc-minibuffer-local-completion-map
(let ((map (copy-keymap minibuffer-local-completion-map)))
- (define-key map "\C-t" 'sc-toggle-fn)
- (define-key map " " 'self-insert-command)
+ (define-key map "\C-t" #'sc-toggle-fn)
+ (define-key map " " #'self-insert-command)
map)
"Keymap for minibuffer confirmation of attribution strings.")
(defvar sc-minibuffer-local-map
(let ((map (copy-keymap minibuffer-local-map)))
- (define-key map "\C-t" 'sc-toggle-fn)
+ (define-key map "\C-t" #'sc-toggle-fn)
map)
"Keymap for minibuffer confirmation of attribution strings.")
@@ -1109,6 +1109,8 @@ Only used during confirmation."
(setq sc-attrib-or-cite (not sc-attrib-or-cite))
(throw 'sc-reconfirm t))
+(defvar completer-disable) ;; From some `completer.el' package.
+
(defun sc-select-attribution ()
"Select an attribution from `sc-attributions'.
@@ -1126,6 +1128,8 @@ selection but before querying is performed. During
auto-selected citation string and the variable `attribution' is bound
to the auto-selected attribution string."
(run-hooks 'sc-attribs-preselect-hook)
+ (with-suppressed-warnings ((lexical citation attribution))
+ (defvar citation) (defvar attribution))
(let ((query-p sc-confirm-always-p)
attribution citation
(attriblist sc-preferred-attribution-list))
@@ -1150,7 +1154,7 @@ to the auto-selected attribution string."
(setq attribution attrib
attriblist nil))
((listp attrib)
- (setq attribution (eval attrib))
+ (setq attribution (eval attrib t))
(if (stringp attribution)
(setq attriblist nil)
(setq attribution nil
@@ -1593,7 +1597,7 @@ error occurs."
(let ((ref (nth sc-eref-style sc-rewrite-header-list)))
(condition-case err
(progn
- (eval ref)
+ (eval ref t)
(let ((lines (count-lines (point-min) (point-max))))
(or nomsg (message "Ref header %d [%d line%s]: %s"
sc-eref-style lines
@@ -1767,8 +1771,7 @@ querying you by typing `C-h'. Note that the format is changed
slightly from that used by `set-variable' -- the current value is
printed just after the variable's name instead of at the bottom of the
help window."
- (let* ((minibuffer-help-form '(funcall myhelp))
- (myhelp
+ (let* ((myhelp
(lambda ()
(with-output-to-temp-buffer "*Help*"
(prin1 var)
@@ -1784,7 +1787,8 @@ help window."
1))
(with-current-buffer standard-output
(help-mode))
- nil))))
+ nil)))
+ (minibuffer-help-form `(funcall #',myhelp)))
(set var (eval-minibuffer (format "Set %s to value: " var)))))
(defmacro sc-toggle-symbol (rootname)