diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-03-11 14:32:42 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-03-11 14:32:42 -0500 |
commit | d9c94e93b7013d575aeb2a8e8077564a80b04f7c (patch) | |
tree | 0eb0b9d2c5263c1d6a1665e17774b846a802405a /lisp/mail/supercite.el | |
parent | b90c658492a2548f183bf072be50f4a57a2b5f0b (diff) | |
download | emacs-d9c94e93b7013d575aeb2a8e8077564a80b04f7c.tar.gz |
* lisp/mail/: Use lexical-binding
Remove some redundant `:group` args as well.
* lisp/mail/supercite.el: Use lexical-binding.
(completer-disable): Declare var.
(sc-set-variable): Don't rely on dynbind to access `help` variable.
* lisp/mail/mail-extr.el: Use lexical-binding.
(mail-extract-address-components): Avoid use of dynamic scoping to
refer to local vars.
* lisp/mail/mailabbrev.el: Use lexical-binding.
(mail-abbrev-make-syntax-table): Rename `_` variable to `syntax-_`.
* lisp/mail/mailheader.el: Use lexical-binding.
(headers): Don't declare as dynbound globally.
(mail-header-set, mail-header-merge): Declare `headers` as dynbound
locally, instead. Mark those functions as obsolete.
(mail-header-format): Use `alist-get` instead of `mail-header`.
* lisp/mail/binhex.el (binhex-decode-region-external): Remove always-nil
var `firstline`.
* lisp/mail/emacsbug.el: Use lexical-binding.
(report-emacs-bug): Remove always-nil var `message-end-point`.
* lisp/mail/rmail-spam-filter.el: Use lexical-binding.
(bbdb/mail_auto_create_p): Declare variable.
* lisp/mail/rmail.el (rmail-get-new-mail): Remove always-nil var
`delete-files`.
* lisp/mail/rmailout.el: Use lexical-binding.
(rmail-output-read-file-name): Remove unused var `err`.
(rmail-convert-to-babyl-format): Remove unused var `count`.
(rmail-output-as-mbox): Remove unused vars `from` and `date`.
* lisp/mail/rmailsort.el: Use lexical-binding.
(rmail-sort-messages): Remove unused var `msginfo`.
* lisp/mail/rfc822.el: Use lexical-binding.
* lisp/mail/rmailedit.el: Use lexical-binding.
* lisp/mail/mailclient.el: Use lexical-binding.
* lisp/mail/blessmail.el: Use lexical-binding.
* lisp/mail/mail-hist.el: Use lexical-binding.
* lisp/mail/rmailkwd.el: Use lexical-binding.
* lisp/mail/rmailmsc.el: Use lexical-binding.
* lisp/mail/uce.el: Use lexical-binding.
* lisp/mail/unrmail.el: Use lexical-binding.
Diffstat (limited to 'lisp/mail/supercite.el')
-rw-r--r-- | lisp/mail/supercite.el | 102 |
1 files changed, 52 insertions, 50 deletions
diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el index 99ac41dd9ba..dc1c641052b 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'. @@ -1150,7 +1152,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 +1595,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 +1769,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 +1785,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) |