commit 3b1c646202ec715d6a1d8e6c127eaad14d81b6d4 (HEAD, refs/remotes/origin/master) Author: Stefan Kangas Date: Wed Mar 31 08:25:24 2021 +0200 Use lexical-binding in scroll-all.el * lisp/scroll-all.el: Use lexical-binding. (scroll-all-scroll-down-all, scroll-all-scroll-up-all) (scroll-all-page-down-all, scroll-all-page-up-all) (scroll-all-beginning-of-buffer-all) (scroll-all-end-of-buffer-all): Doc fixes. diff --git a/lisp/scroll-all.el b/lisp/scroll-all.el index 25b245e4b6..8ba0cc9e03 100644 --- a/lisp/scroll-all.el +++ b/lisp/scroll-all.el @@ -1,4 +1,4 @@ -;;; scroll-all.el --- scroll all buffers together minor mode +;;; scroll-all.el --- scroll all buffers together minor mode -*- lexical-binding: t -*- ;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc. @@ -47,38 +47,41 @@ (condition-case nil (funcall func arg) ;; Ignore beginning- or end-of-buffer error in other windows. - (error nil) - ) + (error nil)) (other-window 1) (setq count (1+ count)))))) (defun scroll-all-scroll-down-all (arg) - "Scroll down in all visible windows." + "Scroll down ARG lines in all visible windows." (interactive "p") (scroll-all-function-all 'next-line arg)) (defun scroll-all-scroll-up-all (arg) - "Scroll up in all visible windows." + "Scroll up ARG lines in all visible windows." (interactive "p") (scroll-all-function-all 'previous-line arg)) (defun scroll-all-page-down-all (arg) - "Page down in all visible windows." + "Page down in all visible windows. +ARG is like in `scroll-up'." (interactive "P") (scroll-all-function-all 'scroll-up arg)) (defun scroll-all-page-up-all (arg) - "Page up in all visible windows." + "Page up in all visible windows. +ARG is like in `scroll-down'." (interactive "P") (scroll-all-function-all 'scroll-down arg)) (defun scroll-all-beginning-of-buffer-all (arg) - "Go to the beginning of the buffer in all visible windows." + "Go to the beginning of the buffer in all visible windows. +ARG is like in `beginning-of-buffer'." (interactive "P") (scroll-all-function-all 'beginning-of-buffer arg)) (defun scroll-all-end-of-buffer-all (arg) - "Go to the end of the buffer in all visible windows." + "Go to the end of the buffer in all visible windows. +ARG is like in `end-of-buffer'." (interactive "P") (scroll-all-function-all 'end-of-buffer arg)) commit 99026711d74eb59e2c6ad12163f6862bb5b39517 Author: Stefan Kangas Date: Wed Mar 31 08:05:58 2021 +0200 * lisp/dynamic-setting.el: Use lexical-binding. diff --git a/lisp/dynamic-setting.el b/lisp/dynamic-setting.el index d6952ed59f..39d2a1d1e2 100644 --- a/lisp/dynamic-setting.el +++ b/lisp/dynamic-setting.el @@ -1,4 +1,4 @@ -;;; dynamic-setting.el --- Support dynamic changes +;;; dynamic-setting.el --- Support dynamic changes -*- lexical-binding: t -*- ;; Copyright (C) 2009-2021 Free Software Foundation, Inc. @@ -91,4 +91,4 @@ Changes can be ((eq type 'tool-bar-style) (force-mode-line-update t))))) (define-key special-event-map [config-changed-event] - 'dynamic-setting-handle-config-changed-event) + #'dynamic-setting-handle-config-changed-event) commit 8ac31329572ba65c68c5b87a4d6fff2a9c323b4b Author: Luke Lee Date: Wed Mar 31 11:22:47 2021 +0800 Fix incorrect regular expression for more general text replacements. * lisp/progmodes/hideif.el (hif-evaluate-macro): fix regexp to trim off leading/trailing spaces, but not within. diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index 6f1a8781b4..0d9b4b7a36 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el @@ -1600,7 +1600,7 @@ not be expanded." (result (funcall hide-ifdef-evaluator expr)) (exprstring (replace-regexp-in-string ;; Trim off leading/trailing whites - "^[ \t]*\\([^ \t]+\\)[ \t]*" "\\1" + "^[ \t]*\\|[ \t]*$" "" (replace-regexp-in-string "\\(//.*\\)" "" ; Trim off end-of-line comments (buffer-substring-no-properties start end))))) commit 571c261525f2e50e4d843b360e3c04b451b24e07 Author: Stefan Kangas Date: Wed Mar 31 01:42:16 2021 +0200 Use lexical-binding in chistory.el * lisp/chistory.el: Use lexical-binding. Remove redundant :group args. (command-history-mode-map): Quote function symbols as such. diff --git a/lisp/chistory.el b/lisp/chistory.el index 589b5b5feb..95c1b49cd8 100644 --- a/lisp/chistory.el +++ b/lisp/chistory.el @@ -1,4 +1,4 @@ -;;; chistory.el --- list command history +;;; chistory.el --- list command history -*- lexical-binding: t -*- ;; Copyright (C) 1985, 2001-2021 Free Software Foundation, Inc. @@ -71,8 +71,7 @@ If that function is given a list whose car is an element of this list, then it will return non-nil (indicating the list should be discarded from the history). Initially, all commands related to the command history are discarded." - :type '(repeat symbol) - :group 'chistory) + :type '(repeat symbol)) (defvar list-command-history-filter 'default-command-history-filter "Predicate to test which commands should be excluded from the history listing. @@ -90,8 +89,7 @@ from the command history." (defcustom list-command-history-max 32 "If non-nil, maximum length of the listing produced by `list-command-history'." - :type '(choice integer (const nil)) - :group 'chistory) + :type '(choice integer (const nil))) ;;;###autoload (defun list-command-history () @@ -127,10 +125,10 @@ The buffer is left in Command History mode." (let ((map (make-sparse-keymap))) (set-keymap-parent map (make-composed-keymap lisp-mode-shared-map special-mode-map)) - (define-key map "x" 'command-history-repeat) - (define-key map "\n" 'next-line) - (define-key map "\r" 'next-line) - (define-key map "\177" 'previous-line) + (define-key map "x" #'command-history-repeat) + (define-key map "\n" #'next-line) + (define-key map "\r" #'next-line) + (define-key map "\177" #'previous-line) map) "Keymap for `command-history-mode'.") @@ -145,8 +143,7 @@ Keybindings: (defcustom command-history-hook nil "If non-nil, its value is called on entry to `command-history-mode'." - :type 'hook - :group 'chistory) + :type 'hook) (defun command-history-revert (_ignore-auto _noconfirm) (list-command-history)) @@ -165,7 +162,7 @@ The buffer for that command is the previous current buffer." ;;;###autoload (defun command-history () - "Examine commands from `command-history' in a buffer. + "Examine commands from variable `command-history' in a buffer. The number of commands listed is controlled by `list-command-history-max'. The command history is filtered by `list-command-history-filter' if non-nil. Use \\\\[command-history-repeat] to repeat the command on the current line. commit 20f2488dbff62a0d0b2f491751b978559dba9861 Author: Stefan Kangas Date: Wed Mar 31 01:23:29 2021 +0200 * lisp/ebuff-menu.el: Use lexical-binding. diff --git a/lisp/ebuff-menu.el b/lisp/ebuff-menu.el index fb73b2d178..7fecf1a504 100644 --- a/lisp/ebuff-menu.el +++ b/lisp/ebuff-menu.el @@ -1,4 +1,4 @@ -;;; ebuff-menu.el --- electric-buffer-list mode +;;; ebuff-menu.el --- electric-buffer-list mode -*- lexical-binding: t -*- ;; Copyright (C) 1985-1986, 1994, 2001-2021 Free Software Foundation, ;; Inc. @@ -34,55 +34,53 @@ (defvar electric-buffer-menu-mode-map (let ((map (make-keymap))) - (fillarray (car (cdr map)) 'Electric-buffer-menu-undefined) + (fillarray (car (cdr map)) #'Electric-buffer-menu-undefined) (define-key map "\e" nil) - (define-key map "\C-z" 'suspend-frame) - (define-key map "v" 'Electric-buffer-menu-mode-view-buffer) - (define-key map (char-to-string help-char) 'Helper-help) - (define-key map "?" 'Helper-describe-bindings) + (define-key map "\C-z" #'suspend-frame) + (define-key map "v" #'Electric-buffer-menu-mode-view-buffer) + (define-key map (char-to-string help-char) #'Helper-help) + (define-key map "?" #'Helper-describe-bindings) (define-key map "\C-c" nil) - (define-key map "\C-c\C-c" 'Electric-buffer-menu-quit) - (define-key map "\C-]" 'Electric-buffer-menu-quit) - (define-key map "q" 'Electric-buffer-menu-quit) - (define-key map " " 'Electric-buffer-menu-select) - (define-key map "\C-m" 'Electric-buffer-menu-select) - (define-key map "\C-l" 'recenter) - (define-key map "s" 'Buffer-menu-save) - (define-key map "d" 'Buffer-menu-delete) - (define-key map "k" 'Buffer-menu-delete) - (define-key map "\C-d" 'Buffer-menu-delete-backwards) - ;; (define-key map "\C-k" 'Buffer-menu-delete) - (define-key map "\177" 'Buffer-menu-backup-unmark) - (define-key map "~" 'Buffer-menu-not-modified) - (define-key map "u" 'Buffer-menu-unmark) - (define-key map "\M-\177" 'Buffer-menu-unmark-all-buffers) - (define-key map "U" 'Buffer-menu-unmark-all) - (let ((i ?0)) - (while (<= i ?9) - (define-key map (char-to-string i) 'digit-argument) - (define-key map (concat "\e" (char-to-string i)) 'digit-argument) - (setq i (1+ i)))) - (define-key map "-" 'negative-argument) - (define-key map "\e-" 'negative-argument) - (define-key map "m" 'Buffer-menu-mark) - (define-key map "\C-u" 'universal-argument) - (define-key map "\C-p" 'previous-line) - (define-key map "\C-n" 'next-line) - (define-key map "p" 'previous-line) - (define-key map "n" 'next-line) - (define-key map "\C-v" 'scroll-up-command) - (define-key map "\ev" 'scroll-down-command) - (define-key map ">" 'scroll-right) - (define-key map "<" 'scroll-left) - (define-key map "\e\C-v" 'scroll-other-window) - (define-key map "\e>" 'end-of-buffer) - (define-key map "\e<" 'beginning-of-buffer) + (define-key map "\C-c\C-c" #'Electric-buffer-menu-quit) + (define-key map "\C-]" #'Electric-buffer-menu-quit) + (define-key map "q" #'Electric-buffer-menu-quit) + (define-key map " " #'Electric-buffer-menu-select) + (define-key map "\C-m" #'Electric-buffer-menu-select) + (define-key map "\C-l" #'recenter) + (define-key map "s" #'Buffer-menu-save) + (define-key map "d" #'Buffer-menu-delete) + (define-key map "k" #'Buffer-menu-delete) + (define-key map "\C-d" #'Buffer-menu-delete-backwards) + ;; (define-key map "\C-k" #'Buffer-menu-delete) + (define-key map "\177" #'Buffer-menu-backup-unmark) + (define-key map "~" #'Buffer-menu-not-modified) + (define-key map "u" #'Buffer-menu-unmark) + (define-key map "\M-\177" #'Buffer-menu-unmark-all-buffers) + (define-key map "U" #'Buffer-menu-unmark-all) + (dotimes (i 10) + (define-key map (char-to-string i) #'digit-argument) + (define-key map (concat "\e" (char-to-string i)) #'digit-argument)) + (define-key map "-" #'negative-argument) + (define-key map "\e-" #'negative-argument) + (define-key map "m" #'Buffer-menu-mark) + (define-key map "\C-u" #'universal-argument) + (define-key map "\C-p" #'previous-line) + (define-key map "\C-n" #'next-line) + (define-key map "p" #'previous-line) + (define-key map "n" #'next-line) + (define-key map "\C-v" #'scroll-up-command) + (define-key map "\ev" #'scroll-down-command) + (define-key map ">" #'scroll-right) + (define-key map "<" #'scroll-left) + (define-key map "\e\C-v" #'scroll-other-window) + (define-key map "\e>" #'end-of-buffer) + (define-key map "\e<" #'beginning-of-buffer) (define-key map "\e\e" nil) - (define-key map "\e\e\e" 'Electric-buffer-menu-quit) + (define-key map "\e\e\e" #'Electric-buffer-menu-quit) ;; This binding prevents the "escape => ESC" function-key-map mapping from ;; kicking in! - ;; (define-key map [escape escape escape] 'Electric-buffer-menu-quit) - (define-key map [mouse-2] 'Electric-buffer-menu-mouse-select) + ;; (define-key map [escape escape escape] #'Electric-buffer-menu-quit) + (define-key map [mouse-2] #'Electric-buffer-menu-mouse-select) map)) (put 'Electric-buffer-menu-quit :advertised-binding "\C-c\C-c") @@ -205,7 +203,7 @@ See the documentation of `electric-buffer-list' for details." (setq-local Helper-return-blurb "return to buffer editing")) (define-obsolete-function-alias 'Electric-buffer-menu-mode - 'electric-buffer-menu-mode "24.3") + #'electric-buffer-menu-mode "24.3") ;; generally the same as Buffer-menu-mode-map ;; (except we don't indirect to global-map) commit 051f791f9eb39154d01a97eb2df2dc7028aa9a86 Author: Stefan Kangas Date: Wed Mar 31 01:11:21 2021 +0200 Use lexical-binding in double.el * lisp/double.el: Use lexical-binding. Remove redundant :group args. diff --git a/lisp/double.el b/lisp/double.el index 7bc8d92e60..f9227a8bbd 100644 --- a/lisp/double.el +++ b/lisp/double.el @@ -1,4 +1,4 @@ -;;; double.el --- support for keyboard remapping with double clicking +;;; double.el --- support for keyboard remapping with double clicking -*- lexical-binding: t -*- ;; Copyright (C) 1994, 1997-1998, 2001-2021 Free Software Foundation, ;; Inc. @@ -67,7 +67,6 @@ Each entry is a list with three elements: 1. The key activating the translation. 2. The string to be inserted when the key is pressed once. 3. The string to be inserted when the key is pressed twice." - :group 'double :type '(repeat (list (character :tag "Key") (string :tag "Once") (string :tag "Twice")))) @@ -76,7 +75,6 @@ Each entry is a list with three elements: "Non-nil means that Double mode mapping only works for prefix keys. That is, for any key `X' in `double-map', `X' alone will be mapped but not `C-u X' or `ESC X' since the X is not the prefix key." - :group 'double :type 'boolean) ;;; Read Event commit 995d1d9995ec2ae5d174aeac5404c174d4162748 Author: Stefan Kangas Date: Wed Mar 31 00:58:18 2021 +0200 Use lexical-binding in dirtrack.el * lisp/dirtrack.el: Use lexical-binding. Remove redundant group args. diff --git a/lisp/dirtrack.el b/lisp/dirtrack.el index 795f1dd660..7f76ef6653 100644 --- a/lisp/dirtrack.el +++ b/lisp/dirtrack.el @@ -1,4 +1,4 @@ -;;; dirtrack.el --- Directory Tracking by watching the prompt +;;; dirtrack.el --- Directory Tracking by watching the prompt -*- lexical-binding: t -*- ;; Copyright (C) 1996, 2001-2021 Free Software Foundation, Inc. @@ -77,7 +77,7 @@ ;; Running under tcsh: ;; (setq-default dirtrack-list '("^%E \\([^ ]+\\)" 1)) ;; -;; It might be worth mentioning in your file that emacs sources start up +;; It might be worth mentioning in your file that Emacs sources start up ;; files of the form: ~/.emacs_ where is the name of the ;; shell. So for example, I have the following in ~/.emacs_tcsh: ;; @@ -123,7 +123,6 @@ "List for directory tracking. First item is a regexp that describes where to find the path in a prompt. Second is a number, the regexp group to match." - :group 'dirtrack :type '(sexp (regexp :tag "Prompt Expression") (integer :tag "Regexp Group")) :version "24.1") @@ -132,12 +131,10 @@ Second is a number, the regexp group to match." (defcustom dirtrack-debug nil "If non-nil, the function `dirtrack' will report debugging info." - :group 'dirtrack :type 'boolean) (defcustom dirtrack-debug-buffer "*Directory Tracking Log*" "Buffer in which to write directory tracking debug information." - :group 'dirtrack :type 'string) (defcustom dirtrack-directory-function @@ -145,19 +142,16 @@ Second is a number, the regexp group to match." 'dirtrack-windows-directory-function 'file-name-as-directory) "Function to apply to the prompt directory for comparison purposes." - :group 'dirtrack :type 'function) (defcustom dirtrack-canonicalize-function (if (memq system-type '(ms-dos windows-nt cygwin)) 'downcase 'identity) "Function to apply to the default directory for comparison purposes." - :group 'dirtrack :type 'function) (defcustom dirtrack-directory-change-hook nil "Hook that is called when a directory change is made." - :group 'dirtrack :type 'hook) commit d47db03829e273422705a08f42ebad576402e3d5 Author: Stefan Kangas Date: Wed Mar 31 00:07:03 2021 +0200 * lisp/progmodes/cwarn.el: Use lexical-binding. diff --git a/lisp/progmodes/cwarn.el b/lisp/progmodes/cwarn.el index 63b344bea1..7fd592fb2e 100644 --- a/lisp/progmodes/cwarn.el +++ b/lisp/progmodes/cwarn.el @@ -1,4 +1,4 @@ -;;; cwarn.el --- highlight suspicious C and C++ constructions +;;; cwarn.el --- highlight suspicious C and C++ constructions -*- lexical-binding: t -*- ;; Copyright (C) 1999-2021 Free Software Foundation, Inc. commit 63608efe7eec4a0c53d2de7308e8b5f17318f7b5 Author: Stefan Kangas Date: Tue Mar 30 23:44:48 2021 +0200 Remove redundant #' before lambda in cedet * lisp/cedet/mode-local.el (mode-local-map-mode-buffers) (mode-local--activate-bindings, mode-local--deactivate-bindings) (setq-mode-local, describe-mode-local-bindings-in-mode): * lisp/cedet/semantic.el (semantic-repeat-parse-whole-stream): * lisp/cedet/semantic/bovine/c.el (semantic-c-describe-environment): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-get-ebrowse-structure): * lisp/cedet/semantic/db-global.el (semanticdb-enable-gnu-global-databases): * lisp/cedet/semantic/edit.el (semantic-changes-in-region): * lisp/cedet/semantic/fw.el (semantic-install-function-overrides): * lisp/cedet/semantic/grammar.el (semantic-grammar-ASSOC) (semantic-grammar-tag-symbols, semantic-grammar-keywords) (semantic--grammar-macros-regexp-1) (semantic-format-tag-summarize): * lisp/cedet/semantic/idle.el (semantic-idle-core-handler) (semantic-idle-work-core-handler): * lisp/cedet/semantic/imenu.el (semantic-imenu-semanticdb-hook): * lisp/cedet/semantic/java.el (semantic-java-doc-keywords-map) (semantic-java-doc-setup): * lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-save-table) (semantic-lex-spp-macros): * lisp/cedet/semantic/lex.el (semantic-lex-map-symbols) (semantic-lex-keywords, semantic-lex-types): * lisp/cedet/semantic/util-modes.el (semantic-toggle-minor-mode-globally): * lisp/cedet/semantic/wisent/comp.el (wisent-defcontext) (wisent-automaton-lisp-form): * lisp/cedet/semantic/wisent/grammar.el (wisent-grammar-assocs) (wisent-grammar-terminals): Remove redundant #' before lambda. diff --git a/lisp/cedet/mode-local.el b/lisp/cedet/mode-local.el index 4218b23c17..247f78ecff 100644 --- a/lisp/cedet/mode-local.el +++ b/lisp/cedet/mode-local.el @@ -91,13 +91,13 @@ MODES can be a symbol or a list of symbols. FUNCTION does not have arguments." (or (listp modes) (setq modes (list modes))) (mode-local-map-file-buffers - function #'(lambda () - (let ((mm (mode-local-equivalent-mode-p major-mode)) - (ans nil)) - (while (and (not ans) mm) - (setq ans (memq (car mm) modes) - mm (cdr mm)) ) - ans)))) + function (lambda () + (let ((mm (mode-local-equivalent-mode-p major-mode)) + (ans nil)) + (while (and (not ans) mm) + (setq ans (memq (car mm) modes) + mm (cdr mm)) ) + ans)))) ;;; Hook machinery ;; @@ -323,14 +323,14 @@ Elements are (SYMBOL . PREVIOUS-VALUE), describing one variable." (dolist (mode modes) (when (setq table (get mode 'mode-local-symbol-table)) (mapatoms - #'(lambda (var) - (when (get var 'mode-variable-flag) - (let ((v (intern (symbol-name var)))) - ;; Save the current buffer-local value of the - ;; mode-local variable. - (and (local-variable-p v (current-buffer)) - (push (cons v (symbol-value v)) old-locals)) - (set (make-local-variable v) (symbol-value var))))) + (lambda (var) + (when (get var 'mode-variable-flag) + (let ((v (intern (symbol-name var)))) + ;; Save the current buffer-local value of the + ;; mode-local variable. + (and (local-variable-p v (current-buffer)) + (push (cons v (symbol-value v)) old-locals)) + (set (make-local-variable v) (symbol-value var))))) table))) old-locals))) @@ -348,9 +348,9 @@ If MODE is not specified it defaults to current `major-mode'." (while mode (when (setq table (get mode 'mode-local-symbol-table)) (mapatoms - #'(lambda (var) - (when (get var 'mode-variable-flag) - (kill-local-variable (intern (symbol-name var))))) + (lambda (var) + (when (get var 'mode-variable-flag) + (kill-local-variable (intern (symbol-name var))))) table)) (setq mode (get-mode-local-parent mode))))) @@ -428,7 +428,7 @@ Return the value of the last VAL." ;; Save mode bindings (mode-local-bind (list ,@bl) '(mode-variable-flag t) ',mode) ;; Assign to local variables in all existing buffers in MODE - (mode-local-map-mode-buffers #'(lambda () ,@sl) ',mode) + (mode-local-map-mode-buffers (lambda () ,@sl) ',mode) ;; Return the last value ,tmp) ))) @@ -893,7 +893,7 @@ invoked interactively." (interactive (list (completing-read "Mode: " obarray - #'(lambda (s) (get s 'mode-local-symbol-table)) + (lambda (s) (get s 'mode-local-symbol-table)) t (symbol-name major-mode)))) (when (setq mode (intern-soft mode)) (mode-local-describe-bindings-1 mode (called-interactively-p 'any)))) diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el index 15388f08d6..fb443fa4a3 100644 --- a/lisp/cedet/semantic.el +++ b/lisp/cedet/semantic.el @@ -678,15 +678,15 @@ This function returns semantic tags without overlays." (if tag (if (car tag) (setq tag (mapcar - #'(lambda (tag) - ;; Set the 'reparse-symbol property to - ;; NONTERM unless it was already setup - ;; by a tag expander - (or (semantic--tag-get-property - tag 'reparse-symbol) - (semantic--tag-put-property - tag 'reparse-symbol nonterm)) - tag) + (lambda (tag) + ;; Set the 'reparse-symbol property to + ;; NONTERM unless it was already setup + ;; by a tag expander + (or (semantic--tag-get-property + tag 'reparse-symbol) + (semantic--tag-put-property + tag 'reparse-symbol nonterm)) + tag) (semantic--tag-expand tag)) result (append result tag)) ;; No error in this case, a purposeful nil means don't diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el index 5712f9b6df..e7ecb61513 100644 --- a/lisp/cedet/semantic/bovine/c.el +++ b/lisp/cedet/semantic/bovine/c.el @@ -2244,8 +2244,8 @@ actually in their parent which is not accessible.") (if (obarrayp semantic-lex-spp-project-macro-symbol-obarray) (let ((macros nil)) (mapatoms - #'(lambda (symbol) - (setq macros (cons symbol macros))) + (lambda (symbol) + (setq macros (cons symbol macros))) semantic-lex-spp-project-macro-symbol-obarray) (dolist (S macros) (princ " ") diff --git a/lisp/cedet/semantic/db-ebrowse.el b/lisp/cedet/semantic/db-ebrowse.el index db37512de3..efdf3dfa47 100644 --- a/lisp/cedet/semantic/db-ebrowse.el +++ b/lisp/cedet/semantic/db-ebrowse.el @@ -274,7 +274,7 @@ For instance: /home//.semanticdb/!usr!include!BROWSE" (insert-file-contents B) (let ((ans nil) (efcn (symbol-function 'ebrowse-show-progress))) - (fset 'ebrowse-show-progress #'(lambda (&rest _junk) nil)) + (fset 'ebrowse-show-progress (lambda (&rest _junk) nil)) (unwind-protect ;; Protect against errors w/ ebrowse (setq ans (list B (ebrowse-read))) ;; These items must always happen diff --git a/lisp/cedet/semantic/db-global.el b/lisp/cedet/semantic/db-global.el index 6bdc7b3f75..fad24485ed 100644 --- a/lisp/cedet/semantic/db-global.el +++ b/lisp/cedet/semantic/db-global.el @@ -56,7 +56,7 @@ values." (interactive (list (completing-read "Enable in Mode: " obarray - #'(lambda (s) (get s 'mode-local-symbol-table)) + (lambda (s) (get s 'mode-local-symbol-table)) t (symbol-name major-mode)))) ;; First, make sure the version is ok. diff --git a/lisp/cedet/semantic/edit.el b/lisp/cedet/semantic/edit.el index 0cca156454..b2e56360cf 100644 --- a/lisp/cedet/semantic/edit.el +++ b/lisp/cedet/semantic/edit.el @@ -154,8 +154,8 @@ Optional argument BUFFER is the buffer to search for changes in." (when (overlay-get (car ol) 'semantic-change) (setq ret (cons (car ol) ret))) (setq ol (cdr ol))) - (sort ret #'(lambda (a b) (< (overlay-start a) - (overlay-start b))))))) + (sort ret (lambda (a b) (< (overlay-start a) + (overlay-start b))))))) (defun semantic-edits-change-function-handle-changes (start end _length) "Run whenever a buffer controlled by `semantic-mode' change. diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el index 2a3b0f5fb7..4ad70ff7c6 100644 --- a/lisp/cedet/semantic/fw.el +++ b/lisp/cedet/semantic/fw.el @@ -270,11 +270,11 @@ later installation should be done in MODE hook." (mode-local-bind ;; Add the semantic- prefix to OVERLOAD short names. (mapcar - #'(lambda (e) - (let ((name (symbol-name (car e)))) - (if (string-match "^semantic-" name) - e - (cons (intern (format "semantic-%s" name)) (cdr e))))) + (lambda (e) + (let ((name (symbol-name (car e)))) + (if (string-match "^semantic-" name) + e + (cons (intern (format "semantic-%s" name)) (cdr e))))) overrides) (list 'constant-flag (not transient) 'override-flag t))) diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el index ce30603bf8..dba289fdd7 100644 --- a/lisp/cedet/semantic/grammar.el +++ b/lisp/cedet/semantic/grammar.el @@ -140,12 +140,12 @@ It ignores whitespaces, newlines and comments." ARGS are ASSOC's key value list." (let ((key t)) `(semantic-tag-make-plist - ,@(mapcar #'(lambda (i) - (prog1 - (if key - (list 'quote i) - i) - (setq key (not key)))) + ,@(mapcar (lambda (i) + (prog1 + (if key + (list 'quote i) + i) + (setq key (not key)))) args)))) (defsubst semantic-grammar-quote-p (sym) @@ -190,11 +190,11 @@ That is tag names plus names defined in tag attribute `:rest'." class (current-buffer)))) (apply #'append (mapcar - #'(lambda (tag) - (mapcar - #'intern - (cons (semantic-tag-name tag) - (semantic-tag-get-attribute tag :rest)))) + (lambda (tag) + (mapcar + #'intern + (cons (semantic-tag-name tag) + (semantic-tag-get-attribute tag :rest)))) tags)))) (defsubst semantic-grammar-item-text (item) @@ -295,9 +295,9 @@ foo.by it is foo-by." That is an alist of (VALUE . TOKEN) where VALUE is the string value of the keyword and TOKEN is the terminal symbol identifying the keyword." (mapcar - #'(lambda (key) - (cons (semantic-tag-get-attribute key :value) - (intern (semantic-tag-name key)))) + (lambda (key) + (cons (semantic-tag-get-attribute key :value) + (intern (semantic-tag-name key)))) (semantic-find-tags-by-class 'keyword (current-buffer)))) (defun semantic-grammar-keyword-properties (keywords) @@ -1063,7 +1063,7 @@ See also the variable `semantic-grammar-file-regexp'." (setq semantic--grammar-macros-regexp-1 (concat "(\\s-*" (regexp-opt - (mapcar #'(lambda (e) (symbol-name (car e))) + (mapcar (lambda (e) (symbol-name (car e))) semantic-grammar-macros) t) "\\>")) @@ -1856,11 +1856,11 @@ Optional argument COLOR determines if color is added to the text." (setq label "Keyword: ") (let (summary) (semantic--find-tags-by-function - #'(lambda (put) - (unless summary - (setq summary (cdr (assoc "summary" - (semantic-tag-get-attribute - put :value)))))) + (lambda (put) + (unless summary + (setq summary (cdr (assoc "summary" + (semantic-tag-get-attribute + put :value)))))) ;; Get `put' tag with TAG name. (semantic-find-tags-by-name-regexp (regexp-quote (semantic-tag-name tag)) diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el index b6633d7ee5..420a457b0e 100644 --- a/lisp/cedet/semantic/idle.el +++ b/lisp/cedet/semantic/idle.el @@ -216,9 +216,9 @@ And also manages services that depend on tag values." (let* ((inhibit-quit nil) (buffers (delq (current-buffer) (delq nil - (mapcar #'(lambda (b) - (and (buffer-file-name b) - b)) + (mapcar (lambda (b) + (and (buffer-file-name b) + b)) (buffer-list))))) ;; safe ;; This safe is not used, but could be. others @@ -356,9 +356,9 @@ Uses `semantic-idle-work-for-on-buffer' to do the work." (cb (current-buffer)) (buffers (delq (current-buffer) (delq nil - (mapcar #'(lambda (b) - (and (buffer-file-name b) - b)) + (mapcar (lambda (b) + (and (buffer-file-name b) + b)) (buffer-list))))) safe) ;; errbuf ;; First, handle long tasks in the current buffer. diff --git a/lisp/cedet/semantic/imenu.el b/lisp/cedet/semantic/imenu.el index 2c5f10a2c3..a5db85bb51 100644 --- a/lisp/cedet/semantic/imenu.el +++ b/lisp/cedet/semantic/imenu.el @@ -429,12 +429,12 @@ Optional argument PARENT is a tag parent of STREAM." Clears all imenu menus that may be depending on the database." (require 'semantic/db-mode) (semantic-map-buffers - #'(lambda () - ;; Set up semanticdb environment if enabled. - (if (semanticdb-minor-mode-p) - (semanticdb-semantic-init-hook-fcn)) - ;; Clear imenu cache to redraw the imenu. - (semantic-imenu-flush-fcn)))) + (lambda () + ;; Set up semanticdb environment if enabled. + (if (semanticdb-minor-mode-p) + (semanticdb-semantic-init-hook-fcn)) + ;; Clear imenu cache to redraw the imenu. + (semantic-imenu-flush-fcn)))) (add-hook 'semanticdb-mode-hook #'semantic-imenu-semanticdb-hook) diff --git a/lisp/cedet/semantic/java.el b/lisp/cedet/semantic/java.el index 8cadffa09b..f48b835fe3 100644 --- a/lisp/cedet/semantic/java.el +++ b/lisp/cedet/semantic/java.el @@ -395,11 +395,11 @@ receives two arguments: the javadoc keyword and its associated removed from the result list." (delq nil (mapcar - #'(lambda (k) - (let* ((tag (semantic-java-doc-tag k)) - (plist (semantic-lex-keyword-get tag 'javadoc))) - (if (or (not property) (plist-get plist property)) - (funcall fun k plist)))) + (lambda (k) + (let* ((tag (semantic-java-doc-tag k)) + (plist (semantic-lex-keyword-get tag 'javadoc))) + (if (or (not property) (plist-get plist property)) + (funcall fun k plist)))) semantic-java-doc-line-tags))) @@ -417,59 +417,59 @@ removed from the result list." (or semantic-java-doc-with-name-tags (setq semantic-java-doc-with-name-tags (semantic-java-doc-keywords-map - #'(lambda (k _p) k) + (lambda (k _p) k) 'with-name))) (or semantic-java-doc-with-ref-tags (setq semantic-java-doc-with-ref-tags (semantic-java-doc-keywords-map - #'(lambda (k _p) k) + (lambda (k _p) k) 'with-ref))) (or semantic-java-doc-extra-type-tags (setq semantic-java-doc-extra-type-tags (semantic-java-doc-keywords-map - #'(lambda (k p) - (if (memq 'type (plist-get p 'usage)) - k)) + (lambda (k p) + (if (memq 'type (plist-get p 'usage)) + k)) 'opt))) (or semantic-java-doc-extra-function-tags (setq semantic-java-doc-extra-function-tags (semantic-java-doc-keywords-map - #'(lambda (k p) - (if (memq 'function (plist-get p 'usage)) - k)) + (lambda (k p) + (if (memq 'function (plist-get p 'usage)) + k)) 'opt))) (or semantic-java-doc-extra-variable-tags (setq semantic-java-doc-extra-variable-tags (semantic-java-doc-keywords-map - #'(lambda (k p) - (if (memq 'variable (plist-get p 'usage)) - k)) + (lambda (k p) + (if (memq 'variable (plist-get p 'usage)) + k)) 'opt))) (or semantic-java-doc-type-tags (setq semantic-java-doc-type-tags (semantic-java-doc-keywords-map - #'(lambda (k p) - (if (memq 'type (plist-get p 'usage)) - k))))) + (lambda (k p) + (if (memq 'type (plist-get p 'usage)) + k))))) (or semantic-java-doc-function-tags (setq semantic-java-doc-function-tags (semantic-java-doc-keywords-map - #'(lambda (k p) - (if (memq 'function (plist-get p 'usage)) - k))))) + (lambda (k p) + (if (memq 'function (plist-get p 'usage)) + k))))) (or semantic-java-doc-variable-tags (setq semantic-java-doc-variable-tags (semantic-java-doc-keywords-map - #'(lambda (k p) - (if (memq 'variable (plist-get p 'usage)) - k))))) + (lambda (k p) + (if (memq 'variable (plist-get p 'usage)) + k))))) ) diff --git a/lisp/cedet/semantic/lex-spp.el b/lisp/cedet/semantic/lex-spp.el index 0b24bd2dc4..8073640a8b 100644 --- a/lisp/cedet/semantic/lex-spp.el +++ b/lisp/cedet/semantic/lex-spp.el @@ -278,10 +278,10 @@ The return list is meant to be saved in a semanticdb table." (let (macros) (when (obarrayp semantic-lex-spp-dynamic-macro-symbol-obarray) (mapatoms - #'(lambda (symbol) - (setq macros (cons (cons (symbol-name symbol) - (symbol-value symbol)) - macros))) + (lambda (symbol) + (setq macros (cons (cons (symbol-name symbol) + (symbol-value symbol)) + macros))) semantic-lex-spp-dynamic-macro-symbol-obarray)) macros)) @@ -291,18 +291,18 @@ The value of each symbol is the replacement stream." (let (macros) (when (obarrayp semantic-lex-spp-macro-symbol-obarray) (mapatoms - #'(lambda (symbol) - (setq macros (cons symbol macros))) + (lambda (symbol) + (setq macros (cons symbol macros))) semantic-lex-spp-macro-symbol-obarray)) (when (obarrayp semantic-lex-spp-project-macro-symbol-obarray) (mapatoms - #'(lambda (symbol) - (setq macros (cons symbol macros))) + (lambda (symbol) + (setq macros (cons symbol macros))) semantic-lex-spp-project-macro-symbol-obarray)) (when (obarrayp semantic-lex-spp-dynamic-macro-symbol-obarray) (mapatoms - #'(lambda (symbol) - (setq macros (cons symbol macros))) + (lambda (symbol) + (setq macros (cons symbol macros))) semantic-lex-spp-dynamic-macro-symbol-obarray)) macros)) diff --git a/lisp/cedet/semantic/lex.el b/lisp/cedet/semantic/lex.el index 121e5c333f..69f20deeb7 100644 --- a/lisp/cedet/semantic/lex.el +++ b/lisp/cedet/semantic/lex.el @@ -192,9 +192,9 @@ If optional PROPERTY is non-nil, call FUN only on every symbol which as a PROPERTY value. FUN receives a symbol as argument." (if (obarrayp table) (mapatoms - #'(lambda (symbol) - (if (or (null property) (get symbol property)) - (funcall fun symbol))) + (lambda (symbol) + (if (or (null property) (get symbol property)) + (funcall fun symbol))) table))) ;;; Lexical keyword table handling. @@ -286,7 +286,7 @@ If optional PROPERTY is non-nil, return only keywords which have a PROPERTY set." (let (keywords) (semantic-lex-map-keywords - #'(lambda (symbol) (setq keywords (cons symbol keywords))) + (lambda (symbol) (setq keywords (cons symbol keywords))) property) keywords)) @@ -462,7 +462,7 @@ If optional PROPERTY is non-nil, return only type symbols which have PROPERTY set." (let (types) (semantic-lex-map-types - #'(lambda (symbol) (setq types (cons symbol types))) + (lambda (symbol) (setq types (cons symbol types))) property) types)) diff --git a/lisp/cedet/semantic/util-modes.el b/lisp/cedet/semantic/util-modes.el index a02d5667ef..106862837a 100644 --- a/lisp/cedet/semantic/util-modes.el +++ b/lisp/cedet/semantic/util-modes.el @@ -162,7 +162,7 @@ too an interactive function used to toggle the mode." ;; Update the minor mode format. (semantic-mode-line-update) ;; Then turn MODE on or off in every Semantic enabled buffer. - (semantic-map-buffers #'(lambda () (funcall mode arg)))) + (semantic-map-buffers (lambda () (funcall mode arg)))) ;;;; ;;;; Minor mode to highlight areas that a user edits. diff --git a/lisp/cedet/semantic/wisent/comp.el b/lisp/cedet/semantic/wisent/comp.el index 3c7cc286b2..b96fa400d9 100644 --- a/lisp/cedet/semantic/wisent/comp.el +++ b/lisp/cedet/semantic/wisent/comp.el @@ -66,7 +66,7 @@ "Define a context NAME that will bind variables VARS." (declare (indent 1)) (let* ((context (wisent-context-name name)) - (declarations (mapcar #'(lambda (v) (list 'defvar v)) vars))) + (declarations (mapcar (lambda (v) (list 'defvar v)) vars))) `(progn ,@declarations (eval-when-compile @@ -3485,11 +3485,11 @@ See also `wisent-compile-grammar' for more details on AUTOMATON." ;; in local variable OBN. ,@(let (obcode) (mapatoms - #'(lambda (s) - (setq obcode - (cons `(fset (intern ,(symbol-name s) ,obn) - #',(symbol-function s)) - obcode))) + (lambda (s) + (setq obcode + (cons `(fset (intern ,(symbol-name s) ,obn) + #',(symbol-function s)) + obcode))) obv) obcode) ;; Generate code to create the automaton. @@ -3501,18 +3501,18 @@ See also `wisent-compile-grammar' for more details on AUTOMATON." ,@(mapcar ;; Use name `st' rather than `state' since `state' is ;; defined as dynbound in `semantic-actions' context above :-( ! - #'(lambda (st) ;; for each state - `(list - ,@(mapcar - #'(lambda (tr) ;; for each transition - (let ((k (car tr)) ; token - (a (cdr tr))) ; action - (if (and (symbolp a) - (intern-soft (symbol-name a) obv)) - `(cons ,(if (symbolp k) `(quote ,k) k) - (intern-soft ,(symbol-name a) ,obn)) - `(quote ,tr)))) - st))) + (lambda (st) ;; for each state + `(list + ,@(mapcar + (lambda (tr) ;; for each transition + (let ((k (car tr)) ; token + (a (cdr tr))) ; action + (if (and (symbolp a) + (intern-soft (symbol-name a) obv)) + `(cons ,(if (symbolp k) `(quote ,k) k) + (intern-soft ,(symbol-name a) ,obn)) + `(quote ,tr)))) + st))) (aref automaton 0))) ;; The code of the goto table is unchanged. ,(aref automaton 1) diff --git a/lisp/cedet/semantic/wisent/grammar.el b/lisp/cedet/semantic/wisent/grammar.el index 819ebd5dad..465d472003 100644 --- a/lisp/cedet/semantic/wisent/grammar.el +++ b/lisp/cedet/semantic/wisent/grammar.el @@ -198,10 +198,10 @@ See also the function `wisent-skip-token'." (defun wisent-grammar-assocs () "Return associativity and precedence level definitions." (mapcar - #'(lambda (tag) - (cons (intern (semantic-tag-name tag)) - (mapcar #'semantic-grammar-item-value - (semantic-tag-get-attribute tag :value)))) + (lambda (tag) + (cons (intern (semantic-tag-name tag)) + (mapcar #'semantic-grammar-item-value + (semantic-tag-get-attribute tag :value)))) (semantic-find-tags-by-class 'assoc (current-buffer)))) (defun wisent-grammar-terminals () @@ -209,14 +209,14 @@ See also the function `wisent-skip-token'." Keep order of declaration in the WY file without duplicates." (let (terms) (mapc - #'(lambda (tag) - (mapcar #'(lambda (name) - (add-to-list 'terms (intern name))) - (cons (semantic-tag-name tag) - (semantic-tag-get-attribute tag :rest)))) + (lambda (tag) + (mapcar (lambda (name) + (add-to-list 'terms (intern name))) + (cons (semantic-tag-name tag) + (semantic-tag-get-attribute tag :rest)))) (semantic--find-tags-by-function - #'(lambda (tag) - (memq (semantic-tag-class tag) '(token keyword))) + (lambda (tag) + (memq (semantic-tag-class tag) '(token keyword))) (current-buffer))) (nreverse terms))) commit 3c00496baa5f2017a58ab43dcafeebe7a92658e1 Author: Stefan Kangas Date: Tue Mar 30 23:26:42 2021 +0200 Delete Emacs 19 compat code in foldout.el * lisp/foldout.el (foldout-hide-flag): (foldout-show-flag): Delete Emacs 19 compat code and make obsolete. (foldout-exit-fold): Don't use above obsolete variable. diff --git a/lisp/foldout.el b/lisp/foldout.el index 2de49d2839..3419d7f598 100644 --- a/lisp/foldout.el +++ b/lisp/foldout.el @@ -230,14 +230,6 @@ An end marker of nil means the fold ends after (point-max).") (setcdr outl-entry (nconc foldout-entry (cdr outl-entry))) )) -;; outline-flag-region has different `flag' values in outline.el and -;; noutline.el for hiding and showing text. - -(defconst foldout-hide-flag - (if (featurep 'noutline) t ?\^M)) - -(defconst foldout-show-flag - (if (featurep 'noutline) nil ?\n)) (defun foldout-zoom-subtree (&optional exposure) @@ -364,8 +356,7 @@ exited and text is left visible." ;; make sure the next heading is exposed (if end-marker - (outline-flag-region end-of-subtree beginning-of-heading - foldout-show-flag))) + (outline-flag-region end-of-subtree beginning-of-heading nil))) ;; zap the markers so they don't slow down editing (set-marker start-marker nil) @@ -551,6 +542,14 @@ Valid modifiers are shift, control, meta, alt, hyper and super.") (define-key outline-minor-mode-map mouse-3 'foldout-mouse-hide-or-exit) )) +;; Obsolete. + +(defconst foldout-hide-flag t) +(make-obsolete-variable 'foldout-hide-flag nil "28.1") + +(defconst foldout-show-flag nil) +(make-obsolete-variable 'foldout-show-flag nil "28.1") + (provide 'foldout) ;;; foldout.el ends here commit d3aac3b34cc730b8a30ede34b0c77864f8f5a4b5 Author: Stefan Kangas Date: Tue Mar 30 23:09:14 2021 +0200 Use lexical-binding in lpr.el and add rudimentary tests * lisp/lpr.el: Use lexical-binding. Remove redundant :group args. (print-region-function): Declare MS-Windows specific function. * test/lisp/lpr-tests.el: New file. diff --git a/lisp/lpr.el b/lisp/lpr.el index 012d251892..29a0fd8d72 100644 --- a/lisp/lpr.el +++ b/lisp/lpr.el @@ -1,4 +1,4 @@ -;;; lpr.el --- print Emacs buffer on line printer +;;; lpr.el --- print Emacs buffer on line printer -*- lexical-binding: t -*- ;; Copyright (C) 1985, 1988, 1992, 1994, 2001-2021 Free Software ;; Foundation, Inc. @@ -39,12 +39,10 @@ (memq system-type '(usg-unix-v hpux)) "Non-nil if running on a system type that uses the \"lp\" command.") - (defgroup lpr nil "Print Emacs buffer on line printer." :group 'text) - ;;;###autoload (defcustom printer-name (and (eq system-type 'ms-dos) "PRN") @@ -65,8 +63,7 @@ file. If you want to discard the printed output, set this to \"NUL\"." :tag "Printer Name" (const :tag "Default" nil) ;; could use string but then we lose completion for files. - (file :tag "Name")) - :group 'lpr) + (file :tag "Name"))) ;;;###autoload (defcustom lpr-switches nil @@ -74,16 +71,14 @@ file. If you want to discard the printed output, set this to \"NUL\"." It is recommended to set `printer-name' instead of including an explicit switch on this list. See `lpr-command'." - :type '(repeat (string :tag "Argument")) - :group 'lpr) + :type '(repeat (string :tag "Argument"))) (defcustom lpr-add-switches (memq system-type '(berkeley-unix gnu/linux)) "Non-nil means construct `-T' and `-J' options for the printer program. These are made assuming that the program is `lpr'; if you are using some other incompatible printer program, this variable should be nil." - :type 'boolean - :group 'lpr) + :type 'boolean) (defcustom lpr-printer-switch (if lpr-lp-system @@ -94,8 +89,7 @@ This switch is used in conjunction with `printer-name'." :type '(choice :menu-tag "Printer Name Switch" :tag "Printer Name Switch" (const :tag "None" nil) - (string :tag "Printer Switch")) - :group 'lpr) + (string :tag "Printer Switch"))) ;;;###autoload (defcustom lpr-command @@ -116,8 +110,7 @@ Windows NT and Novell Netware respectively) are handled specially, using `printer-name' as the destination for output; any other program is treated like `lpr' except that an explicit filename is given as the last argument." - :type 'string - :group 'lpr) + :type 'string) ;; Default is nil, because that enables us to use pr -f ;; which is more reliable than pr with no args, which is what lpr -p does. @@ -127,22 +120,21 @@ If nil, we run `lpr-page-header-program' to make page headings and print the result." :type '(choice (const nil) (string :tag "Single argument") - (repeat :tag "Multiple arguments" (string :tag "Argument"))) - :group 'lpr) + (repeat :tag "Multiple arguments" (string :tag "Argument")))) (defcustom print-region-function (if (memq system-type '(ms-dos windows-nt)) - #'w32-direct-print-region-function + (progn + (declare-function w32-direct-print-region-function "w32-fns") + #'w32-direct-print-region-function) #'call-process-region) "Function to call to print the region on a printer. See definition of `print-region-1' for calling conventions." - :type 'function - :group 'lpr) + :type 'function) (defcustom lpr-page-header-program "pr" "Name of program for adding page headers to a file." - :type 'string - :group 'lpr) + :type 'string) ;; Berkeley systems support -F, and GNU pr supports both -f and -F, ;; So it looks like -F is a better default. @@ -151,8 +143,7 @@ See definition of `print-region-1' for calling conventions." If `%s' appears in any of the strings, it is substituted by the page title. Note that for correct quoting, `%s' should normally be a separate element. The variable `lpr-page-header-program' specifies the program to use." - :type '(repeat string) - :group 'lpr) + :type '(repeat string)) ;;;###autoload (defun lpr-buffer () @@ -248,7 +239,7 @@ for further customization of the printer command." nil ;; Run a separate program to get page headers. (let ((new-coords (print-region-new-buffer start end))) - (apply 'call-process-region (car new-coords) (cdr new-coords) + (apply #'call-process-region (car new-coords) (cdr new-coords) lpr-page-header-program t t nil (mapcar (lambda (e) (format e name)) lpr-page-header-switches))) @@ -270,7 +261,7 @@ for further customization of the printer command." (let ((retval (let ((tempbuf (current-buffer))) (with-current-buffer buf - (apply (or print-region-function 'call-process-region) + (apply (or print-region-function #'call-process-region) start end lpr-command nil tempbuf nil (nconc (and name lpr-add-switches diff --git a/test/lisp/lpr-tests.el b/test/lisp/lpr-tests.el new file mode 100644 index 0000000000..bc31982a11 --- /dev/null +++ b/test/lisp/lpr-tests.el @@ -0,0 +1,41 @@ +;;; lpr-tests.el --- Tests for lpr.el -*- lexical-binding: t -*- + +;; Copyright (C) 2021 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;;; Code: + +(require 'ert) +(require 'lpr) + +(ert-deftest lpr-test-printify-region () + (with-temp-buffer + (insert "foo\^@-\^h\^k\^n-\^_\177bar") + (printify-region (point-min) (point-max)) + (should (equal (buffer-string) "foo\\^@-\\^H\\^K\\^N-\\^_\\7fbar")))) + +(ert-deftest lpr-test-lpr-eval-switch () + (should (equal (lpr-eval-switch "foo") "foo")) + (should (equal (lpr-eval-switch (lambda () "foo")) "foo")) + (let ((v "foo")) + (should (equal (lpr-eval-switch v) "foo"))) + (should (equal (lpr-eval-switch (list #'identity "foo")) "foo")) + (should (equal (lpr-eval-switch 1) nil))) + +;;; lpr-tests.el ends here commit 4f3c9df047c3741160d717ad647d8754f3f01dcf Author: Stefan Kangas Date: Tue Mar 30 18:56:02 2021 +0200 Use lexical-binding in echistory.el * lisp/echistory.el: Use lexical-binding. (electric-history-map): Quote function symbols as such. (Electric-history-undefined): Use command substitutions. diff --git a/lisp/echistory.el b/lisp/echistory.el index 8f787e7fa1..15679b13d5 100644 --- a/lisp/echistory.el +++ b/lisp/echistory.el @@ -1,4 +1,4 @@ -;;; echistory.el --- Electric Command History Mode +;;; echistory.el --- Electric Command History Mode -*- lexical-binding: t -*- ;; Copyright (C) 1985, 2001-2021 Free Software Foundation, Inc. @@ -44,44 +44,43 @@ With prefix arg NOCONFIRM, execute current line as-is without editing." (defvar electric-history-map (let ((map (make-sparse-keymap))) - (define-key map [t] 'Electric-history-undefined) + (define-key map [t] #'Electric-history-undefined) (define-key map "\e" (make-sparse-keymap)) - (define-key map [?\e t] 'Electric-history-undefined) - (define-key map "\C-u" 'universal-argument) - (define-key map " " 'Electric-command-history-redo-expression) - (define-key map "!" 'Electric-command-history-redo-expression) - (define-key map "\e\C-x" 'eval-sexp) - (define-key map "\e\C-d" 'down-list) - (define-key map "\e\C-u" 'backward-up-list) - (define-key map "\e\C-b" 'backward-sexp) - (define-key map "\e\C-f" 'forward-sexp) - (define-key map "\e\C-a" 'beginning-of-defun) - (define-key map "\e\C-e" 'end-of-defun) - (define-key map "\e\C-n" 'forward-list) - (define-key map "\e\C-p" 'backward-list) - (define-key map "q" 'Electric-history-quit) + (define-key map [?\e t] #'Electric-history-undefined) + (define-key map "\C-u" #'universal-argument) + (define-key map " " #'Electric-command-history-redo-expression) + (define-key map "!" #'Electric-command-history-redo-expression) + (define-key map "\e\C-d" #'down-list) + (define-key map "\e\C-u" #'backward-up-list) + (define-key map "\e\C-b" #'backward-sexp) + (define-key map "\e\C-f" #'forward-sexp) + (define-key map "\e\C-a" #'beginning-of-defun) + (define-key map "\e\C-e" #'end-of-defun) + (define-key map "\e\C-n" #'forward-list) + (define-key map "\e\C-p" #'backward-list) + (define-key map "q" #'Electric-history-quit) (define-key map "\C-c" nil) - (define-key map "\C-c\C-c" 'Electric-history-quit) - (define-key map "\C-]" 'Electric-history-quit) - (define-key map "\C-z" 'suspend-frame) - (define-key map (char-to-string help-char) 'Helper-help) - (define-key map "?" 'Helper-describe-bindings) - (define-key map "\e>" 'end-of-buffer) - (define-key map "\e<" 'beginning-of-buffer) - (define-key map "\n" 'next-line) - (define-key map "\r" 'next-line) - (define-key map "\177" 'previous-line) - (define-key map "\C-n" 'next-line) - (define-key map "\C-p" 'previous-line) - (define-key map "\ev" 'scroll-down) - (define-key map "\C-v" 'scroll-up) - (define-key map [home] 'beginning-of-buffer) - (define-key map [down] 'next-line) - (define-key map [up] 'previous-line) - (define-key map [prior] 'scroll-down) - (define-key map [next] 'scroll-up) - (define-key map "\C-l" 'recenter) - (define-key map "\e\C-v" 'scroll-other-window) + (define-key map "\C-c\C-c" #'Electric-history-quit) + (define-key map "\C-]" #'Electric-history-quit) + (define-key map "\C-z" #'suspend-frame) + (define-key map (char-to-string help-char) #'Helper-help) + (define-key map "?" #'Helper-describe-bindings) + (define-key map "\e>" #'end-of-buffer) + (define-key map "\e<" #'beginning-of-buffer) + (define-key map "\n" #'next-line) + (define-key map "\r" #'next-line) + (define-key map "\177" #'previous-line) + (define-key map "\C-n" #'next-line) + (define-key map "\C-p" #'previous-line) + (define-key map "\ev" #'scroll-down) + (define-key map "\C-v" #'scroll-up) + (define-key map [home] #'beginning-of-buffer) + (define-key map [down] #'next-line) + (define-key map [up] #'previous-line) + (define-key map [prior] #'scroll-down) + (define-key map [next] #'scroll-up) + (define-key map "\C-l" #'recenter) + (define-key map "\e\C-v" #'scroll-other-window) map) "Keymap for Electric Command History mode.") @@ -141,7 +140,9 @@ The Command History listing is recomputed each time this mode is invoked." (defun Electric-history-undefined () (interactive) (ding) - (message "%s" (substitute-command-keys "Type \\[Helper-help] for help, ? for commands, C-c C-c to quit, Space to execute")) + (message "%s" (substitute-command-keys "Type \\[Helper-help] for help, \ +\\[Helper-describe-bindings] for commands, \\[Electric-history-quit] to quit, \ +\\[Electric-command-history-redo-expression] to execute")) (sit-for 4)) (defun Electric-history-quit () commit 49cbf2392ba51c2ebd866b062dbf7908c595466f Author: Stefan Kangas Date: Tue Mar 30 15:46:57 2021 +0200 Delete empty "History" sections * lisp/bs.el: * lisp/calendar/timeclock.el: * lisp/cedet/semantic/bovine/grammar.el: * lisp/cedet/semantic/grammar.el: * lisp/cedet/semantic/wisent.el: * lisp/cedet/semantic/wisent/comp.el: * lisp/cedet/semantic/wisent/java-tags.el: * lisp/cedet/semantic/wisent/wisent.el: * lisp/erc/erc.el: * lisp/net/newst-treeview.el: * lisp/recentf.el: * lisp/ruler-mode.el: * lisp/textmodes/remember.el: * lisp/thumbs.el: * lisp/tree-widget.el: * lisp/vc/vc-hg.el: Delete empty "History" sections. * lisp/cedet/semantic/grammar.el (semantic-grammar-header-template): Don't add "History" section to generated file. diff --git a/lisp/bs.el b/lisp/bs.el index 9ed0ee5f0a..154e3599f3 100644 --- a/lisp/bs.el +++ b/lisp/bs.el @@ -120,8 +120,6 @@ ;; can cycle through all file buffers and *scratch* although your current ;; configuration perhaps is "files" which ignores buffer *scratch*. -;;; History: - ;;; Code: ;; ---------------------------------------------------------------------- diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index 0bbaa1e1ed..4a4b65d374 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -69,8 +69,6 @@ ;; your average working time, and will make sure that the various ;; display functions return the correct value. -;;; History: - ;;; Code: (require 'cl-lib) diff --git a/lisp/cedet/semantic/bovine/grammar.el b/lisp/cedet/semantic/bovine/grammar.el index e3df7b12ab..a5b9873445 100644 --- a/lisp/cedet/semantic/bovine/grammar.el +++ b/lisp/cedet/semantic/bovine/grammar.el @@ -25,9 +25,8 @@ ;; ;; Major mode for editing Bovine's input grammar (.by) files. -;;; History: - ;;; Code: + (require 'semantic) (require 'semantic/grammar) (require 'semantic/find) diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el index 8d8faac9c4..ce30603bf8 100644 --- a/lisp/cedet/semantic/grammar.el +++ b/lisp/cedet/semantic/grammar.el @@ -23,9 +23,6 @@ ;; ;; Major mode framework for editing Semantic's input grammar files. -;;; History: -;; - ;;; Code: (require 'semantic) @@ -600,9 +597,6 @@ Typically a DEFINE expression should look like this: ;; PLEASE DO NOT MANUALLY EDIT THIS FILE! It is automatically ;; generated from the grammar file " gram ". -;;; History: -;; - ;;; Code: (require 'semantic/lex) diff --git a/lisp/cedet/semantic/wisent.el b/lisp/cedet/semantic/wisent.el index f498e7edcc..f5f381d407 100644 --- a/lisp/cedet/semantic/wisent.el +++ b/lisp/cedet/semantic/wisent.el @@ -22,13 +22,10 @@ ;; along with GNU Emacs. If not, see . ;;; Commentary: -;; + ;; Here are functions necessary to use the Wisent LALR parser from ;; Semantic environment. -;;; History: -;; - ;;; Code: (require 'semantic) diff --git a/lisp/cedet/semantic/wisent/comp.el b/lisp/cedet/semantic/wisent/comp.el index 6addc134ed..3c7cc286b2 100644 --- a/lisp/cedet/semantic/wisent/comp.el +++ b/lisp/cedet/semantic/wisent/comp.el @@ -35,9 +35,6 @@ ;; ;; For more details on Wisent itself read the Wisent manual. -;;; History: -;; - ;;; Code: (require 'semantic/wisent) (eval-when-compile (require 'cl-lib)) diff --git a/lisp/cedet/semantic/wisent/java-tags.el b/lisp/cedet/semantic/wisent/java-tags.el index b4a87be62a..90dd40c51a 100644 --- a/lisp/cedet/semantic/wisent/java-tags.el +++ b/lisp/cedet/semantic/wisent/java-tags.el @@ -24,9 +24,6 @@ ;;; Commentary: ;; -;;; History: -;; - ;;; Code: (require 'semantic/wisent) diff --git a/lisp/cedet/semantic/wisent/wisent.el b/lisp/cedet/semantic/wisent/wisent.el index d205c0e604..62d99ef697 100644 --- a/lisp/cedet/semantic/wisent/wisent.el +++ b/lisp/cedet/semantic/wisent/wisent.el @@ -34,9 +34,6 @@ ;; ;; For more details on Wisent itself read the Wisent manual. -;;; History: -;; - ;;; Code: (defgroup wisent nil diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index b6dea95bb2..2f6e48dce1 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -50,9 +50,6 @@ ;; After you are connected to a server, you can use C-h m or have a look at ;; the ERC menu. -;;; History: -;; - ;;; Code: (load "erc-loaddefs" nil t) diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el index 29c92d52dd..d524e6dd17 100644 --- a/lisp/net/newst-treeview.el +++ b/lisp/net/newst-treeview.el @@ -30,10 +30,6 @@ ;; See newsticker.el -;; ====================================================================== -;;; History: -;; - ;; ====================================================================== ;;; Code: (require 'cl-lib) diff --git a/lisp/recentf.el b/lisp/recentf.el index 48b8e2b671..c819397a33 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -33,9 +33,6 @@ ;; To enable this package, add the following to your .emacs: ;; (recentf-mode 1) -;;; History: -;; - ;;; Code: (require 'tree-widget) (require 'timer) diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el index fc9196caf9..11226fda02 100644 --- a/lisp/ruler-mode.el +++ b/lisp/ruler-mode.el @@ -100,10 +100,7 @@ ;; To automatically display the ruler in specific major modes use: ;; ;; (add-hook '-hook 'ruler-mode) -;; -;;; History: -;; ;;; Code: (eval-when-compile diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el index b731c12442..3affb46201 100644 --- a/lisp/textmodes/remember.el +++ b/lisp/textmodes/remember.el @@ -176,8 +176,6 @@ ;; ;; 2003.08.12 Sacha's birthday -;;; History: - ;;; Code: (defconst remember-version "2.0" diff --git a/lisp/thumbs.el b/lisp/thumbs.el index 3e7c9124e2..5710b8c353 100644 --- a/lisp/thumbs.el +++ b/lisp/thumbs.el @@ -51,9 +51,6 @@ ;; In thumbs-mode, pressing on an image will bring you in image view ;; mode for that image. C-h m will give you a list of available keybinding. -;;; History: -;; - ;;; Code: (require 'dired) diff --git a/lisp/tree-widget.el b/lisp/tree-widget.el index 44b29bffe8..d40a628b99 100644 --- a/lisp/tree-widget.el +++ b/lisp/tree-widget.el @@ -110,10 +110,8 @@ ;; `tree-widget-themes-directory', and `tree-widget-theme' options for ;; more details. -;;; History: -;; - ;;; Code: + (require 'wid-edit) ;;; Customization diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 9faed10f38..2bc6ae3524 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -97,9 +97,6 @@ ;; without even using `hg' (this way even if you don't have `hg' installed, ;; Emacs is able to tell you this file is under mercurial's control). -;;; History: -;; - ;;; Code: (require 'cl-lib) commit 4ed75f9fcbd99041a7dd70a7818939033cd17098 Author: Stefan Kangas Date: Tue Mar 30 15:16:28 2021 +0200 Use lexical-binding in follow.el * lisp/follow.el: Use lexical-binding. (follow-mode-map, follow-debug-message): Quote function symbols as such. (follow-pos-visible-in-window-p): Remove unused variable 'last'. (follow-move-to-window-line): Remove unused variable 'middle-window'. diff --git a/lisp/follow.el b/lisp/follow.el index 56f06b11d3..dde140d0fd 100644 --- a/lisp/follow.el +++ b/lisp/follow.el @@ -1,4 +1,4 @@ -;;; follow.el --- synchronize windows showing the same buffer +;;; follow.el --- synchronize windows showing the same buffer -*- lexical-binding: t -*- ;; Copyright (C) 1995-1997, 1999, 2001-2021 Free Software Foundation, ;; Inc. @@ -234,17 +234,17 @@ After that, changing the prefix key requires manipulating keymaps." (defvar follow-mode-map (let ((mainmap (make-sparse-keymap)) (map (make-sparse-keymap))) - (define-key map "\C-v" 'follow-scroll-up) - (define-key map "\M-v" 'follow-scroll-down) - (define-key map "v" 'follow-scroll-down) - (define-key map "1" 'follow-delete-other-windows-and-split) - (define-key map "b" 'follow-switch-to-buffer) - (define-key map "\C-b" 'follow-switch-to-buffer-all) - (define-key map "\C-l" 'follow-recenter) - (define-key map "<" 'follow-first-window) - (define-key map ">" 'follow-last-window) - (define-key map "n" 'follow-next-window) - (define-key map "p" 'follow-previous-window) + (define-key map "\C-v" #'follow-scroll-up) + (define-key map "\M-v" #'follow-scroll-down) + (define-key map "v" #'follow-scroll-down) + (define-key map "1" #'follow-delete-other-windows-and-split) + (define-key map "b" #'follow-switch-to-buffer) + (define-key map "\C-b" #'follow-switch-to-buffer-all) + (define-key map "\C-l" #'follow-recenter) + (define-key map "<" #'follow-first-window) + (define-key map ">" #'follow-last-window) + (define-key map "n" #'follow-next-window) + (define-key map "p" #'follow-previous-window) (define-key mainmap follow-mode-prefix map) @@ -253,13 +253,13 @@ After that, changing the prefix key requires manipulating keymaps." ;; could be enhanced in Follow mode. End-of-buffer is a special ;; case since it is very simple to define and it greatly enhances ;; the look and feel of Follow mode.) - (define-key mainmap [remap end-of-buffer] 'follow-end-of-buffer) + (define-key mainmap [remap end-of-buffer] #'follow-end-of-buffer) - (define-key mainmap [remap scroll-bar-toolkit-scroll] 'follow-scroll-bar-toolkit-scroll) - (define-key mainmap [remap scroll-bar-drag] 'follow-scroll-bar-drag) - (define-key mainmap [remap scroll-bar-scroll-up] 'follow-scroll-bar-scroll-up) - (define-key mainmap [remap scroll-bar-scroll-down] 'follow-scroll-bar-scroll-down) - (define-key mainmap [remap mwheel-scroll] 'follow-mwheel-scroll) + (define-key mainmap [remap scroll-bar-toolkit-scroll] #'follow-scroll-bar-toolkit-scroll) + (define-key mainmap [remap scroll-bar-drag] #'follow-scroll-bar-drag) + (define-key mainmap [remap scroll-bar-scroll-up] #'follow-scroll-bar-scroll-up) + (define-key mainmap [remap scroll-bar-scroll-down] #'follow-scroll-bar-scroll-down) + (define-key mainmap [remap mwheel-scroll] #'follow-mwheel-scroll) mainmap) "Minor mode keymap for Follow mode.") @@ -368,7 +368,7 @@ This is typically set by explicit scrolling commands.") (defsubst follow-debug-message (&rest args) "Like `message', but only active when `follow-debug' is non-nil." (if (and (boundp 'follow-debug) follow-debug) - (apply 'message args))) + (apply #'message args))) ;;; Cache @@ -1694,8 +1694,7 @@ omitted if the character after POS is fully visible; otherwise, RTOP and RBOT are the number of pixels off-window at the top and bottom of the screen line (\"row\") containing POS, ROWH is the visible height of that row, and VPOS is the row number \(zero-based)." - (let* ((windows (follow-all-followers window)) - (last (car (last windows)))) + (let* ((windows (follow-all-followers window))) (when follow-start-end-invalid (follow-redisplay windows (car windows))) (let* ((cache (follow-windows-start-end windows)) @@ -1723,7 +1722,7 @@ zero means top of the first window in the group, negative means (start-end (follow-windows-start-end windows)) (rev-start-end (reverse start-end)) (lines 0) - middle-window elt count) + elt count) (select-window (cond ((null arg) commit c2e90d11190fea8e9c32fcd6bc9e4a88b3cbf0de Author: Mattias Engdegard Date: Tue Mar 30 07:54:41 2021 -0400 lisp/progmodes/verilog-mode.el internal code cleanup. * lisp/progmodes/verilog-mode.el (verilog-at-close-struct-p): Internal code cleanup. diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index 8ba3483bcc..a7f72950b1 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -9,7 +9,7 @@ ;; Keywords: languages ;; The "Version" is the date followed by the decimal rendition of the Git ;; commit hex. -;; Version: 2021.03.29.215531170 +;; Version: 2021.03.30.243771231 ;; Yoni Rabkin contacted the maintainer of this ;; file on 19/3/2008, and the maintainer agreed that when a bug is @@ -124,7 +124,7 @@ ;; ;; This variable will always hold the version number of the mode -(defconst verilog-mode-version "2021-03-29-cd8bea2-vpo-GNU" +(defconst verilog-mode-version "2021-03-30-e87a75f-vpo-GNU" "Version of this Verilog mode.") (defconst verilog-mode-release-emacs t "If non-nil, this version of Verilog mode was released with Emacs itself.") @@ -6650,14 +6650,9 @@ Return >0 for nested struct." (defun verilog-at-close-struct-p () "If at the } that closes a struct, return true." - (if (and - (equal (char-after) ?\}) - (verilog-in-struct-p)) - ;; true - (save-excursion - (if (looking-at "}\\(?:\\s-*\\w+\\s-*\\(\\s-*\\,\\s-*\\w+\\)*\\)?;") 1)) - ;; false - nil)) + (and (equal (char-after) ?\}) + (verilog-in-struct-p) + (looking-at "}\\(?:\\s-*\\w+\\s-*\\(?:,\\s-*\\w+\\s-*\\)*\\)?;"))) (defun verilog-parenthesis-depth () "Return non zero if in parenthetical-expression."