From 97992a342be65cd448dd115e75686d269734bf68 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 31 Mar 2021 11:37:35 +0200 Subject: [PATCH 01/75] ; * lisp/net/tramp-sh.el (tramp-sh-gio-monitor-process-filter): ; Instrument for emba. --- lisp/net/tramp-sh.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 1764f2ef03f..c2dab64d5bf 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3750,6 +3750,8 @@ Fall back to normal file name handler if no Tramp handler exists." ;; Determine monitor name. (unless (tramp-connection-property-p proc "gio-file-monitor") + (when (getenv "EMACS_EMBA_CI") + (message "%s" string)) (cond ;; We have seen this only on cygwin gio, which uses the ;; GPollFileMonitor. From f236b516b6041384ccb439aa8674c412cb785f42 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 31 Mar 2021 12:59:11 +0200 Subject: [PATCH 02/75] Use lexical-binding in progmodes/inf-lisp.el * lisp/progmodes/inf-lisp.el: Use lexical-binding. Doc fixes. (inferior-lisp-mode-map, lisp-mode-map) (inferior-lisp-install-letter-bindings): Quote function symbols as such. (inferior-lisp-menu, lisp-compile-string, lisp-eval-string) (lisp-show-variable-documentation): Doc fixes. --- lisp/progmodes/inf-lisp.el | 110 ++++++++++++++++++------------------- 1 file changed, 54 insertions(+), 56 deletions(-) diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el index af6ccce3d62..1ee54673d74 100644 --- a/lisp/progmodes/inf-lisp.el +++ b/lisp/progmodes/inf-lisp.el @@ -1,7 +1,6 @@ -;;; inf-lisp.el --- an inferior-lisp mode +;;; inf-lisp.el --- an inferior-lisp mode -*- lexical-binding: t -*- -;; Copyright (C) 1988, 1993-1994, 2001-2021 Free Software Foundation, -;; Inc. +;; Copyright (C) 1988-2021 Free Software Foundation, Inc. ;; Author: Olin Shivers ;; Keywords: processes, lisp @@ -23,13 +22,13 @@ ;;; Commentary: -;; Hacked from tea.el by Olin Shivers (shivers@cs.cmu.edu). 8/88 +;; Hacked from tea.el by Olin Shivers (shivers@cs.cmu.edu). 8/88 ;; This file defines a lisp-in-a-buffer package (inferior-lisp mode) ;; built on top of comint mode. This version is more featureful, ;; robust, and uniform than the Emacs 18 version. The key bindings are ;; also more compatible with the bindings of Hemlock and Zwei (the -;; Lisp Machine emacs). +;; Lisp Machine Emacs). ;; Since this mode is built on top of the general command-interpreter-in- ;; a-buffer mode (comint mode), it shares a common base functionality, @@ -40,19 +39,19 @@ ;; the hooks available for customizing it, see the file comint.el. ;; For further information on inferior-lisp mode, see the comments below. -;; Needs fixin: +;; Needs fixing: ;; The load-file/compile-file default mechanism could be smarter -- it ;; doesn't know about the relationship between filename extensions and -;; whether the file is source or executable. If you compile foo.lisp +;; whether the file is source or executable. If you compile foo.lisp ;; with compile-file, then the next load-file should use foo.bin for -;; the default, not foo.lisp. This is tricky to do right, particularly +;; the default, not foo.lisp. This is tricky to do right, particularly ;; because the extension for executable files varies so much (.o, .bin, ;; .lbin, .mo, .vo, .ao, ...). ;; ;; It would be nice if inferior-lisp (and inferior scheme, T, ...) modes ;; had a verbose minor mode wherein sending or compiling defuns, etc. ;; would be reflected in the transcript with suitable comments, e.g. -;; ";;; redefining fact". Several ways to do this. Which is right? +;; ";;; redefining fact". Several ways to do this. Which is right? ;; ;; When sending text from a source file to a subprocess, the process-mark can ;; move off the window, so you can lose sight of the process interactions. @@ -81,19 +80,19 @@ mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword (defvar inferior-lisp-mode-map (let ((map (copy-keymap comint-mode-map))) (set-keymap-parent map lisp-mode-shared-map) - (define-key map "\C-x\C-e" 'lisp-eval-last-sexp) - (define-key map "\C-c\C-l" 'lisp-load-file) - (define-key map "\C-c\C-k" 'lisp-compile-file) - (define-key map "\C-c\C-a" 'lisp-show-arglist) - (define-key map "\C-c\C-d" 'lisp-describe-sym) - (define-key map "\C-c\C-f" 'lisp-show-function-documentation) - (define-key map "\C-c\C-v" 'lisp-show-variable-documentation) + (define-key map "\C-x\C-e" #'lisp-eval-last-sexp) + (define-key map "\C-c\C-l" #'lisp-load-file) + (define-key map "\C-c\C-k" #'lisp-compile-file) + (define-key map "\C-c\C-a" #'lisp-show-arglist) + (define-key map "\C-c\C-d" #'lisp-describe-sym) + (define-key map "\C-c\C-f" #'lisp-show-function-documentation) + (define-key map "\C-c\C-v" #'lisp-show-variable-documentation) map)) (easy-menu-define inferior-lisp-menu inferior-lisp-mode-map - "Inferior Lisp Menu" + "Inferior Lisp Menu." '("Inf-Lisp" ["Eval Last Sexp" lisp-eval-last-sexp t] "--" @@ -107,20 +106,20 @@ mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword ;;; These commands augment Lisp mode, so you can process Lisp code in ;;; the source files. -(define-key lisp-mode-map "\M-\C-x" 'lisp-eval-defun) ; GNU convention -(define-key lisp-mode-map "\C-x\C-e" 'lisp-eval-last-sexp) ; GNU convention -(define-key lisp-mode-map "\C-c\C-e" 'lisp-eval-defun) -(define-key lisp-mode-map "\C-c\C-r" 'lisp-eval-region) -(define-key lisp-mode-map "\C-c\C-n" 'lisp-eval-form-and-next) -(define-key lisp-mode-map "\C-c\C-p" 'lisp-eval-paragraph) -(define-key lisp-mode-map "\C-c\C-c" 'lisp-compile-defun) -(define-key lisp-mode-map "\C-c\C-z" 'switch-to-lisp) -(define-key lisp-mode-map "\C-c\C-l" 'lisp-load-file) -(define-key lisp-mode-map "\C-c\C-k" 'lisp-compile-file) ; "kompile" file -(define-key lisp-mode-map "\C-c\C-a" 'lisp-show-arglist) -(define-key lisp-mode-map "\C-c\C-d" 'lisp-describe-sym) -(define-key lisp-mode-map "\C-c\C-f" 'lisp-show-function-documentation) -(define-key lisp-mode-map "\C-c\C-v" 'lisp-show-variable-documentation) +(define-key lisp-mode-map "\M-\C-x" #'lisp-eval-defun) ; GNU convention +(define-key lisp-mode-map "\C-x\C-e" #'lisp-eval-last-sexp) ; GNU convention +(define-key lisp-mode-map "\C-c\C-e" #'lisp-eval-defun) +(define-key lisp-mode-map "\C-c\C-r" #'lisp-eval-region) +(define-key lisp-mode-map "\C-c\C-n" #'lisp-eval-form-and-next) +(define-key lisp-mode-map "\C-c\C-p" #'lisp-eval-paragraph) +(define-key lisp-mode-map "\C-c\C-c" #'lisp-compile-defun) +(define-key lisp-mode-map "\C-c\C-z" #'switch-to-lisp) +(define-key lisp-mode-map "\C-c\C-l" #'lisp-load-file) +(define-key lisp-mode-map "\C-c\C-k" #'lisp-compile-file) ; "kompile" file +(define-key lisp-mode-map "\C-c\C-a" #'lisp-show-arglist) +(define-key lisp-mode-map "\C-c\C-d" #'lisp-describe-sym) +(define-key lisp-mode-map "\C-c\C-f" #'lisp-show-function-documentation) +(define-key lisp-mode-map "\C-c\C-v" #'lisp-show-variable-documentation) ;; This function exists for backwards compatibility. @@ -133,24 +132,23 @@ mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword ;;; (with-eval-after-load 'inf-lisp 'inferior-lisp-install-letter-bindings) ;;;You can modify this function to install just the bindings you want." (defun inferior-lisp-install-letter-bindings () - (define-key lisp-mode-map "\C-ce" 'lisp-eval-defun-and-go) - (define-key lisp-mode-map "\C-cr" 'lisp-eval-region-and-go) - (define-key lisp-mode-map "\C-cc" 'lisp-compile-defun-and-go) - (define-key lisp-mode-map "\C-cz" 'switch-to-lisp) - (define-key lisp-mode-map "\C-cl" 'lisp-load-file) - (define-key lisp-mode-map "\C-ck" 'lisp-compile-file) - (define-key lisp-mode-map "\C-ca" 'lisp-show-arglist) - (define-key lisp-mode-map "\C-cd" 'lisp-describe-sym) - (define-key lisp-mode-map "\C-cf" 'lisp-show-function-documentation) - (define-key lisp-mode-map "\C-cv" 'lisp-show-variable-documentation) + (define-key lisp-mode-map "\C-ce" #'lisp-eval-defun-and-go) + (define-key lisp-mode-map "\C-cr" #'lisp-eval-region-and-go) + (define-key lisp-mode-map "\C-cc" #'lisp-compile-defun-and-go) + (define-key lisp-mode-map "\C-cz" #'switch-to-lisp) + (define-key lisp-mode-map "\C-cl" #'lisp-load-file) + (define-key lisp-mode-map "\C-ck" #'lisp-compile-file) + (define-key lisp-mode-map "\C-ca" #'lisp-show-arglist) + (define-key lisp-mode-map "\C-cd" #'lisp-describe-sym) + (define-key lisp-mode-map "\C-cf" #'lisp-show-function-documentation) + (define-key lisp-mode-map "\C-cv" #'lisp-show-variable-documentation) - (define-key inferior-lisp-mode-map "\C-cl" 'lisp-load-file) - (define-key inferior-lisp-mode-map "\C-ck" 'lisp-compile-file) - (define-key inferior-lisp-mode-map "\C-ca" 'lisp-show-arglist) - (define-key inferior-lisp-mode-map "\C-cd" 'lisp-describe-sym) - (define-key inferior-lisp-mode-map "\C-cf" 'lisp-show-function-documentation) - (define-key inferior-lisp-mode-map "\C-cv" - 'lisp-show-variable-documentation)) + (define-key inferior-lisp-mode-map "\C-cl" #'lisp-load-file) + (define-key inferior-lisp-mode-map "\C-ck" #'lisp-compile-file) + (define-key inferior-lisp-mode-map "\C-ca" #'lisp-show-arglist) + (define-key inferior-lisp-mode-map "\C-cd" #'lisp-describe-sym) + (define-key inferior-lisp-mode-map "\C-cf" #'lisp-show-function-documentation) + (define-key inferior-lisp-mode-map "\C-cv" #'lisp-show-variable-documentation)) (defcustom inferior-lisp-program "lisp" "Program name for invoking an inferior Lisp in Inferior Lisp mode." @@ -181,7 +179,7 @@ franz: \"^\\\\(->\\\\|<[0-9]*>:\\\\) *\" kcl: \"^>+ *\"" :type 'regexp) -(defvar inferior-lisp-buffer nil "*The current inferior-lisp process buffer. +(defvar inferior-lisp-buffer nil "*The current `inferior-lisp' process buffer. MULTIPLE PROCESS SUPPORT =========================================================================== @@ -326,18 +324,18 @@ Prefix argument means switch to the Lisp buffer afterwards." (if and-go (switch-to-lisp t))) (defun lisp-compile-string (string) - "Send the string to the inferior Lisp process to be compiled and executed." + "Send STRING to the inferior Lisp process to be compiled and executed." (comint-send-string (inferior-lisp-proc) (format "(funcall (compile nil (lambda () %s)))\n" string))) (defun lisp-eval-string (string) - "Send the string to the inferior Lisp process to be executed." + "Send STRING to the inferior Lisp process to be executed." (comint-send-string (inferior-lisp-proc) (concat string "\n"))) (defun lisp-do-defun (do-string do-region) "Send the current defun to the inferior Lisp process. -The actually processing is done by `do-string' and `do-region' +The actually processing is done by DO-STRING and DO-REGION which determine whether the code is compiled before evaluation. DEFVAR forms reset the variables to the init values." (save-excursion @@ -460,7 +458,7 @@ With argument, positions cursor at end of buffer." ;;; (interactive "r") ;;; (save-excursion ;;; (goto-char start) (end-of-defun) (beginning-of-defun) ; error check -;;; (if (< (point) start) (error "region begins in middle of defun")) +;;; (if (< (point) start) (error "Region begins in middle of defun")) ;;; (goto-char start) ;;; (let ((s start)) ;;; (end-of-defun) @@ -591,7 +589,7 @@ See variable `lisp-function-doc-command'." (format lisp-function-doc-command fn))) (defun lisp-show-variable-documentation (var) - "Send a command to the inferior Lisp to give documentation for function FN. + "Send a command to the inferior Lisp to give documentation for variable VAR. See variable `lisp-var-doc-command'." (interactive (lisp-symprompt "Variable doc" (lisp-var-at-pt))) (comint-proc-query (inferior-lisp-proc) (format lisp-var-doc-command var))) @@ -620,8 +618,8 @@ See variable `lisp-describe-sym-command'." (error "No Lisp subprocess; see variable `inferior-lisp-buffer'")))) -;;; Do the user's customization... -;;;=============================== +;; Obsolete. + (defvar inferior-lisp-load-hook nil "This hook is run when the library `inf-lisp' is loaded.") (make-obsolete-variable 'inferior-lisp-load-hook From 0f5bd3b7fa01a53bd170da90e556827f3e7f21bb Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 31 Mar 2021 21:09:55 +0200 Subject: [PATCH 03/75] * lisp/net/tramp-sh.el (tramp-sh-gio-monitor-process-filter): Make assumption for emba. --- lisp/net/tramp-sh.el | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index c2dab64d5bf..6440e577a9b 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3740,6 +3740,8 @@ Fall back to normal file name handler if no Tramp handler exists." "changes done" "changes-done-hint" string) string (tramp-compat-string-replace "renamed to" "moved" string)) + (when (getenv "EMACS_EMBA_CI") + (message "%s" string)) (catch 'doesnt-work ;; https://bugs.launchpad.net/bugs/1742946 @@ -3750,15 +3752,18 @@ Fall back to normal file name handler if no Tramp handler exists." ;; Determine monitor name. (unless (tramp-connection-property-p proc "gio-file-monitor") - (when (getenv "EMACS_EMBA_CI") - (message "%s" string)) (cond - ;; We have seen this only on cygwin gio, which uses the - ;; GPollFileMonitor. + ;; We have seen this on cygwin gio and on emba. Let's make some assumptions. ((string-match "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string) - (tramp-set-connection-property - proc "gio-file-monitor" 'GPollFileMonitor)) + (cond + ((getenv "EMACS_EMBA_CI") + (tramp-set-connection-property + proc "gio-file-monitor" 'GInotifyMonitor)) + ((eq system-type 'cygwin) + (tramp-set-connection-property + proc "gio-file-monitor" 'GPollFileMonitor)) + (t (tramp-error proc 'file-error "Cannot determine gio monitor")))) ;; TODO: What happens, if several monitor names are reported? ((string-match "\ Supported arguments for GIO_USE_FILE_MONITOR environment variable: From ed320ebe2859530254f28d481cd164e1553fe607 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 31 Mar 2021 21:12:09 +0200 Subject: [PATCH 04/75] ; Fix last change --- lisp/net/tramp-sh.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 6440e577a9b..73e0807dbc1 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3759,7 +3759,7 @@ Fall back to normal file name handler if no Tramp handler exists." (cond ((getenv "EMACS_EMBA_CI") (tramp-set-connection-property - proc "gio-file-monitor" 'GInotifyMonitor)) + proc "gio-file-monitor" 'GInotifyFileMonitor)) ((eq system-type 'cygwin) (tramp-set-connection-property proc "gio-file-monitor" 'GPollFileMonitor)) From c1ce0747630e3a2b54c48ac4d00b0ab96454e646 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 31 Mar 2021 18:15:28 -0400 Subject: [PATCH 05/75] * lisp/progmodes/dcl-mode.el: Use lexical-binding (dcl-guess-option-value, dcl-save-local-variable) (dcl-save-nondefault-options): Strength-reduce `eval` to `symbol-value`. --- lisp/progmodes/dcl-mode.el | 51 +++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/lisp/progmodes/dcl-mode.el b/lisp/progmodes/dcl-mode.el index 14eefdca1e6..7107ae6ea19 100644 --- a/lisp/progmodes/dcl-mode.el +++ b/lisp/progmodes/dcl-mode.el @@ -1,4 +1,4 @@ -;;; dcl-mode.el --- major mode for editing DCL command files +;;; dcl-mode.el --- major mode for editing DCL command files -*- lexical-binding: t; -*- ;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc. @@ -270,22 +270,22 @@ See `imenu-generic-expression' for details." (defvar dcl-mode-map (let ((map (make-sparse-keymap))) - (define-key map "\e\n" 'dcl-split-line) - (define-key map "\e\t" 'tempo-complete-tag) - (define-key map "\e^" 'dcl-delete-indentation) - (define-key map "\em" 'dcl-back-to-indentation) - (define-key map "\ee" 'dcl-forward-command) - (define-key map "\ea" 'dcl-backward-command) - (define-key map "\e\C-q" 'dcl-indent-command) - (define-key map "\t" 'dcl-tab) - (define-key map ":" 'dcl-electric-character) - (define-key map "F" 'dcl-electric-character) - (define-key map "f" 'dcl-electric-character) - (define-key map "E" 'dcl-electric-character) - (define-key map "e" 'dcl-electric-character) - (define-key map "\C-c\C-o" 'dcl-set-option) - (define-key map "\C-c\C-f" 'tempo-forward-mark) - (define-key map "\C-c\C-b" 'tempo-backward-mark) + (define-key map "\e\n" #'dcl-split-line) + (define-key map "\e\t" #'tempo-complete-tag) + (define-key map "\e^" #'dcl-delete-indentation) + (define-key map "\em" #'dcl-back-to-indentation) + (define-key map "\ee" #'dcl-forward-command) + (define-key map "\ea" #'dcl-backward-command) + (define-key map "\e\C-q" #'dcl-indent-command) + (define-key map "\t" #'dcl-tab) + (define-key map ":" #'dcl-electric-character) + (define-key map "F" #'dcl-electric-character) + (define-key map "f" #'dcl-electric-character) + (define-key map "E" #'dcl-electric-character) + (define-key map "e" #'dcl-electric-character) + (define-key map "\C-c\C-o" #'dcl-set-option) + (define-key map "\C-c\C-f" #'tempo-forward-mark) + (define-key map "\C-c\C-b" #'tempo-backward-mark) map) "Keymap used in DCL-mode buffers.") @@ -533,7 +533,7 @@ $ There is some minimal font-lock support (see vars `dcl-font-lock-defaults' and `dcl-font-lock-keywords')." - (setq-local indent-line-function 'dcl-indent-line) + (setq-local indent-line-function #'dcl-indent-line) (setq-local comment-start "!") (setq-local comment-end "") (setq-local comment-multi-line nil) @@ -547,7 +547,7 @@ There is some minimal font-lock support (see vars (setq imenu-generic-expression dcl-imenu-generic-expression) (setq imenu-case-fold-search t) - (setq imenu-create-index-function 'dcl-imenu-create-index-function) + (setq imenu-create-index-function #'dcl-imenu-create-index-function) (make-local-variable 'dcl-comment-line-regexp) (make-local-variable 'dcl-block-begin-regexp) @@ -1391,7 +1391,7 @@ regexps in `dcl-electric-reindent-regexps'." (let ((case-fold-search t)) ;; There must be a better way than (memq t ...). ;; (apply 'or ...) didn't work - (if (memq t (mapcar 'dcl-was-looking-at dcl-electric-reindent-regexps)) + (if (memq t (mapcar #'dcl-was-looking-at dcl-electric-reindent-regexps)) (dcl-indent-line))))) @@ -1567,7 +1567,7 @@ Must return a string." ((fboundp action) (funcall action option-assoc)) ((eq action 'toggle) - (not (eval option))) + (not (symbol-value option))) ((eq action 'curval) (cond ((or (stringp (symbol-value option)) (numberp (symbol-value option))) @@ -1735,7 +1735,7 @@ Set or update the value of VAR in the current buffers (setq continue nil) (beginning-of-line) (insert (concat prefix-string (symbol-name var) ": " - (prin1-to-string (eval var)) " " + (prin1-to-string (symbol-value var)) " " suffix-string "\n"))) ;; Is it the variable we are looking for? (if (eq var found-var) @@ -1748,7 +1748,7 @@ Set or update the value of VAR in the current buffers (delete-region (point) (progn (read (current-buffer)) (point))) (insert " ") - (prin1 (eval var) (current-buffer)) + (prin1 (symbol-value var) (current-buffer)) (skip-chars-backward "\n") (skip-chars-forward " \t") (or (if suffix (looking-at suffix) (eolp)) @@ -1781,7 +1781,7 @@ Set or update the value of VAR in the current buffers (concat " " comment-end)))))) (insert (concat def-prefix "Local variables:" def-suffix "\n")) (insert (concat def-prefix (symbol-name var) ": " - (prin1-to-string (eval var)) def-suffix "\n")) + (prin1-to-string (symbol-value var)) def-suffix "\n")) (insert (concat def-prefix "end:" def-suffix))) ))) @@ -1815,7 +1815,8 @@ still be present in the `Local Variables:' section with its old value." (option-name (symbol-name option))) (if (and (string-equal "dcl-" (substring option-name 0 4)) - (not (equal (default-value option) (eval option)))) + (not (equal (default-value option) + (symbol-value option)))) (dcl-save-local-variable option "$! ")))) dcl-option-alist)) From ad5322fcea3f53c121bcd3e8bce797a14304752e Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 31 Mar 2021 18:27:14 -0400 Subject: [PATCH 06/75] * lisp/forms.el: Use lexical-binding. Remove redundant `:group` args (forms--process-format-list, forms--debug): Strength-reduce `eval` to `symbol-value`. --- lisp/forms.el | 82 ++++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 46 deletions(-) diff --git a/lisp/forms.el b/lisp/forms.el index 62c4288869a..8696aea98ee 100644 --- a/lisp/forms.el +++ b/lisp/forms.el @@ -1,7 +1,6 @@ -;;; forms.el --- Forms mode: edit a file as a form to fill in +;;; forms.el --- Forms mode: edit a file as a form to fill in -*- lexical-binding: t; -*- -;; Copyright (C) 1991, 1994-1997, 2001-2021 Free Software Foundation, -;; Inc. +;; Copyright (C) 1991-2021 Free Software Foundation, Inc. ;; Author: Johan Vromans @@ -298,7 +297,6 @@ (defcustom forms-mode-hook nil "Hook run upon entering Forms mode." - :group 'forms :type 'hook) ;;; Mandatory variables - must be set by evaluating the control file. @@ -316,7 +314,6 @@ (defcustom forms-check-number-of-fields t "If non-nil, warn about records with wrong number of fields." - :group 'forms :type 'boolean) (defvar forms-field-sep "\t" @@ -332,13 +329,11 @@ If not nil: use this character to separate multi-line fields (default C-k).") (defcustom forms-forms-scroll nil "Non-nil means replace scroll-up/down commands in Forms mode. The replacement commands performs forms-next/prev-record." - :group 'forms :type 'boolean) (defcustom forms-forms-jump nil "Non-nil means redefine beginning/end-of-buffer in Forms mode. The replacement commands performs forms-first/last-record." - :group 'forms :type 'boolean) (defvar forms-read-file-filter nil @@ -363,23 +358,19 @@ The contents may NOT be modified.") (defcustom forms-use-text-properties t "Non-nil means to use text properties. " - :group 'forms :type 'boolean) (defcustom forms-insert-after nil "Non-nil means: inserts of new records go after current record. Also, initial position is at last record." - :group 'forms :type 'boolean) (defcustom forms-ro-face 'default "The face (a symbol) that is used to display read-only text on the screen." - :group 'forms :type 'face) (defcustom forms-rw-face 'region "The face (a symbol) that is used to display read-write text on the screen." - :group 'forms :type 'face) ;;; Internal variables. @@ -767,7 +758,7 @@ Commands: Equivalent keys in read-only mode: ;; If it is a symbol, eval it first. (if (and (symbolp el) (boundp el)) - (setq el (eval el))) + (setq el (symbol-value el))) (cond @@ -1261,35 +1252,35 @@ Commands: Equivalent keys in read-only mode: ;; `forms-mode-map' is always accessible via \C-c prefix. (setq forms-mode-map (make-keymap)) - (define-key forms-mode-map "\t" 'forms-next-field) - (define-key forms-mode-map "\C-k" 'forms-delete-record) - (define-key forms-mode-map "\C-q" 'forms-toggle-read-only) - (define-key forms-mode-map "\C-o" 'forms-insert-record) - (define-key forms-mode-map "\C-l" 'forms-jump-record) - (define-key forms-mode-map "\C-n" 'forms-next-record) - (define-key forms-mode-map "\C-p" 'forms-prev-record) - (define-key forms-mode-map "\C-r" 'forms-search-backward) - (define-key forms-mode-map "\C-s" 'forms-search-forward) - (define-key forms-mode-map "\C-x" 'forms-exit) - (define-key forms-mode-map "<" 'forms-first-record) - (define-key forms-mode-map ">" 'forms-last-record) - (define-key forms-mode-map "\C-?" 'forms-prev-record) + (define-key forms-mode-map "\t" #'forms-next-field) + (define-key forms-mode-map "\C-k" #'forms-delete-record) + (define-key forms-mode-map "\C-q" #'forms-toggle-read-only) + (define-key forms-mode-map "\C-o" #'forms-insert-record) + (define-key forms-mode-map "\C-l" #'forms-jump-record) + (define-key forms-mode-map "\C-n" #'forms-next-record) + (define-key forms-mode-map "\C-p" #'forms-prev-record) + (define-key forms-mode-map "\C-r" #'forms-search-backward) + (define-key forms-mode-map "\C-s" #'forms-search-forward) + (define-key forms-mode-map "\C-x" #'forms-exit) + (define-key forms-mode-map "<" #'forms-first-record) + (define-key forms-mode-map ">" #'forms-last-record) + (define-key forms-mode-map "\C-?" #'forms-prev-record) ;; `forms-mode-ro-map' replaces the local map when in read-only mode. (setq forms-mode-ro-map (make-keymap)) (suppress-keymap forms-mode-ro-map) (define-key forms-mode-ro-map "\C-c" forms-mode-map) - (define-key forms-mode-ro-map "q" 'forms-toggle-read-only) - (define-key forms-mode-ro-map "l" 'forms-jump-record) - (define-key forms-mode-ro-map "n" 'forms-next-record) - (define-key forms-mode-ro-map "p" 'forms-prev-record) - (define-key forms-mode-ro-map "r" 'forms-search-backward) - (define-key forms-mode-ro-map "s" 'forms-search-forward) - (define-key forms-mode-ro-map "x" 'forms-exit) - (define-key forms-mode-ro-map "<" 'forms-first-record) - (define-key forms-mode-ro-map ">" 'forms-last-record) - (define-key forms-mode-ro-map "?" 'describe-mode) - (define-key forms-mode-ro-map " " 'forms-next-record) + (define-key forms-mode-ro-map "q" #'forms-toggle-read-only) + (define-key forms-mode-ro-map "l" #'forms-jump-record) + (define-key forms-mode-ro-map "n" #'forms-next-record) + (define-key forms-mode-ro-map "p" #'forms-prev-record) + (define-key forms-mode-ro-map "r" #'forms-search-backward) + (define-key forms-mode-ro-map "s" #'forms-search-forward) + (define-key forms-mode-ro-map "x" #'forms-exit) + (define-key forms-mode-ro-map "<" #'forms-first-record) + (define-key forms-mode-ro-map ">" #'forms-last-record) + (define-key forms-mode-ro-map "?" #'describe-mode) + (define-key forms-mode-ro-map " " #'forms-next-record) (forms--mode-commands1 forms-mode-ro-map) (forms--mode-menu-ro forms-mode-ro-map) @@ -1395,13 +1386,13 @@ Commands: Equivalent keys in read-only mode: (defun forms--mode-commands1 (map) "Helper routine to define keys." - (define-key map "\t" 'forms-next-field) - (define-key map [S-tab] 'forms-prev-field) - (define-key map [next] 'forms-next-record) - (define-key map [prior] 'forms-prev-record) - (define-key map [begin] 'forms-first-record) - (define-key map [last] 'forms-last-record) - (define-key map [backtab] 'forms-prev-field) + (define-key map "\t" #'forms-next-field) + (define-key map [S-tab] #'forms-prev-field) + (define-key map [next] #'forms-next-record) + (define-key map [prior] #'forms-prev-record) + (define-key map [begin] #'forms-first-record) + (define-key map [last] #'forms-last-record) + (define-key map [backtab] #'forms-prev-field) ) ;;; Changed functions @@ -2034,8 +2025,7 @@ Usage: (setq forms-number-of-fields (defcustom forms--debug nil "If non-nil, enable Forms mode debugging." - :type 'boolean - :group 'forms) + :type 'boolean) (defun forms--debug (&rest args) "Internal debugging routine." @@ -2046,7 +2036,7 @@ Usage: (setq forms-number-of-fields (if (stringp el) el (concat (prin1-to-string el) " = " (if (boundp el) - (prin1-to-string (eval el)) + (prin1-to-string (symbol-value el)) "") "\n" (if (fboundp el) From 4f595cca575f6065f5b866402810a673c7fdf38d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 31 Mar 2021 18:39:52 -0400 Subject: [PATCH 07/75] * lisp/strokes.el: Use lexical-binding. Remove redundant `:group` args (strokes-char-table): Move initialization into declaration. --- lisp/strokes.el | 166 +++++++++++++++++++++++------------------------- 1 file changed, 80 insertions(+), 86 deletions(-) diff --git a/lisp/strokes.el b/lisp/strokes.el index 55f2ae8cc47..4b682e99feb 100644 --- a/lisp/strokes.el +++ b/lisp/strokes.el @@ -1,4 +1,4 @@ -;;; strokes.el --- control Emacs through mouse strokes +;;; strokes.el --- control Emacs through mouse strokes -*- lexical-binding: t; -*- ;; Copyright (C) 1997, 2000-2021 Free Software Foundation, Inc. @@ -216,14 +216,12 @@ static char * stroke_xpm[] = { (defcustom strokes-lighter " Strokes" "Mode line identifier for Strokes mode." - :type 'string - :group 'strokes) + :type 'string) (defcustom strokes-character ?@ "Character used when drawing strokes in the strokes buffer. \(The default is `@', which works well.)" - :type 'character - :group 'strokes) + :type 'character) (defcustom strokes-minimum-match-score 1000 "Minimum score for a stroke to be considered a possible match. @@ -239,8 +237,7 @@ then you can set `strokes-minimum-match-score' to something that works for you. The only purpose of this variable is to insure that if you do a bogus stroke that really doesn't match any of the predefined ones, then strokes should NOT pick the one that came closest." - :type 'integer - :group 'strokes) + :type 'integer) (defcustom strokes-grid-resolution 9 "Integer defining dimensions of the stroke grid. @@ -256,14 +253,12 @@ WARNING: Changing the value of this variable will gravely affect the figure out what it should be based on your needs and on how quick the particular platform(s) you're operating on, and only then start programming in your custom strokes." - :type 'integer - :group 'strokes) + :type 'integer) (defcustom strokes-file (locate-user-emacs-file "strokes" ".strokes") "File containing saved strokes for Strokes mode." :version "24.4" ; added locate-user-emacs-file - :type 'file - :group 'strokes) + :type 'file) (defvar strokes-buffer-name " *strokes*" "The name of the buffer that the strokes take place in.") @@ -273,8 +268,7 @@ WARNING: Changing the value of this variable will gravely affect the If nil, strokes will be read the same, however the user will not be able to see the strokes. This be helpful for people who don't like the delay in switching to the strokes buffer." - :type 'boolean - :group 'strokes) + :type 'boolean) ;;; internal variables... @@ -1044,7 +1038,7 @@ o Strokes are a bit computer-dependent in that they depend somewhat on (help-mode) (help-print-return-message))) -(define-obsolete-function-alias 'strokes-report-bug 'report-emacs-bug "24.1") +(define-obsolete-function-alias 'strokes-report-bug #'report-emacs-bug "24.1") (defun strokes-window-configuration-changed-p () "Non-nil if the `strokes-window-configuration' frame properties changed. @@ -1379,8 +1373,8 @@ If STROKES-MAP is not given, `strokes-global-map' will be used instead." (defvar strokes-mode-map (let ((map (make-sparse-keymap))) - (define-key map [(shift down-mouse-2)] 'strokes-do-stroke) - (define-key map [(meta down-mouse-2)] 'strokes-do-complex-stroke) + (define-key map [(shift down-mouse-2)] #'strokes-do-stroke) + (define-key map [(meta down-mouse-2)] #'strokes-do-complex-stroke) map)) ;;;###autoload @@ -1399,8 +1393,7 @@ Encode/decode your strokes with \\[strokes-encode-buffer], \\[strokes-decode-buffer]. \\{strokes-mode-map}" - nil strokes-lighter strokes-mode-map - :group 'strokes :global t + nil strokes-lighter strokes-mode-map :global t (cond ((not (display-mouse-p)) (error "Can't use Strokes without a mouse")) (strokes-mode ; turn on strokes @@ -1408,15 +1401,15 @@ Encode/decode your strokes with \\[strokes-encode-buffer], (null strokes-global-map) (strokes-load-user-strokes)) (add-hook 'kill-emacs-query-functions - 'strokes-prompt-user-save-strokes) + #'strokes-prompt-user-save-strokes) (add-hook 'select-frame-hook - 'strokes-update-window-configuration) + #'strokes-update-window-configuration) (strokes-update-window-configuration)) (t ; turn off strokes (if (get-buffer strokes-buffer-name) (kill-buffer (get-buffer strokes-buffer-name))) (remove-hook 'select-frame-hook - 'strokes-update-window-configuration)))) + #'strokes-update-window-configuration)))) ;;;; strokes-xpm stuff (later may be separate)... @@ -1426,74 +1419,75 @@ Encode/decode your strokes with \\[strokes-encode-buffer], (defface strokes-char '((t (:background "lightgray"))) "Face for strokes characters." - :version "21.1" - :group 'strokes) + :version "21.1") (put 'strokes 'char-table-extra-slots 0) -(defconst strokes-char-table (make-char-table 'strokes) ; +(defconst strokes-char-table + (let ((ct (make-char-table 'strokes))) ; + (aset ct ?0 0) + (aset ct ?1 1) + (aset ct ?2 2) + (aset ct ?3 3) + (aset ct ?4 4) + (aset ct ?5 5) + (aset ct ?6 6) + (aset ct ?7 7) + (aset ct ?8 8) + (aset ct ?9 9) + (aset ct ?a 10) + (aset ct ?b 11) + (aset ct ?c 12) + (aset ct ?d 13) + (aset ct ?e 14) + (aset ct ?f 15) + (aset ct ?g 16) + (aset ct ?h 17) + (aset ct ?i 18) + (aset ct ?j 19) + (aset ct ?k 20) + (aset ct ?l 21) + (aset ct ?m 22) + (aset ct ?n 23) + (aset ct ?o 24) + (aset ct ?p 25) + (aset ct ?q 26) + (aset ct ?r 27) + (aset ct ?s 28) + (aset ct ?t 29) + (aset ct ?u 30) + (aset ct ?v 31) + (aset ct ?w 32) + (aset ct ?x 33) + (aset ct ?y 34) + (aset ct ?z 35) + (aset ct ?A 36) + (aset ct ?B 37) + (aset ct ?C 38) + (aset ct ?D 39) + (aset ct ?E 40) + (aset ct ?F 41) + (aset ct ?G 42) + (aset ct ?H 43) + (aset ct ?I 44) + (aset ct ?J 45) + (aset ct ?K 46) + (aset ct ?L 47) + (aset ct ?M 48) + (aset ct ?N 49) + (aset ct ?O 50) + (aset ct ?P 51) + (aset ct ?Q 52) + (aset ct ?R 53) + (aset ct ?S 54) + (aset ct ?T 55) + (aset ct ?U 56) + (aset ct ?V 57) + (aset ct ?W 58) + (aset ct ?X 59) + (aset ct ?Y 60) + (aset ct ?Z 61) + ct) "The table which stores values for the character keys.") -(aset strokes-char-table ?0 0) -(aset strokes-char-table ?1 1) -(aset strokes-char-table ?2 2) -(aset strokes-char-table ?3 3) -(aset strokes-char-table ?4 4) -(aset strokes-char-table ?5 5) -(aset strokes-char-table ?6 6) -(aset strokes-char-table ?7 7) -(aset strokes-char-table ?8 8) -(aset strokes-char-table ?9 9) -(aset strokes-char-table ?a 10) -(aset strokes-char-table ?b 11) -(aset strokes-char-table ?c 12) -(aset strokes-char-table ?d 13) -(aset strokes-char-table ?e 14) -(aset strokes-char-table ?f 15) -(aset strokes-char-table ?g 16) -(aset strokes-char-table ?h 17) -(aset strokes-char-table ?i 18) -(aset strokes-char-table ?j 19) -(aset strokes-char-table ?k 20) -(aset strokes-char-table ?l 21) -(aset strokes-char-table ?m 22) -(aset strokes-char-table ?n 23) -(aset strokes-char-table ?o 24) -(aset strokes-char-table ?p 25) -(aset strokes-char-table ?q 26) -(aset strokes-char-table ?r 27) -(aset strokes-char-table ?s 28) -(aset strokes-char-table ?t 29) -(aset strokes-char-table ?u 30) -(aset strokes-char-table ?v 31) -(aset strokes-char-table ?w 32) -(aset strokes-char-table ?x 33) -(aset strokes-char-table ?y 34) -(aset strokes-char-table ?z 35) -(aset strokes-char-table ?A 36) -(aset strokes-char-table ?B 37) -(aset strokes-char-table ?C 38) -(aset strokes-char-table ?D 39) -(aset strokes-char-table ?E 40) -(aset strokes-char-table ?F 41) -(aset strokes-char-table ?G 42) -(aset strokes-char-table ?H 43) -(aset strokes-char-table ?I 44) -(aset strokes-char-table ?J 45) -(aset strokes-char-table ?K 46) -(aset strokes-char-table ?L 47) -(aset strokes-char-table ?M 48) -(aset strokes-char-table ?N 49) -(aset strokes-char-table ?O 50) -(aset strokes-char-table ?P 51) -(aset strokes-char-table ?Q 52) -(aset strokes-char-table ?R 53) -(aset strokes-char-table ?S 54) -(aset strokes-char-table ?T 55) -(aset strokes-char-table ?U 56) -(aset strokes-char-table ?V 57) -(aset strokes-char-table ?W 58) -(aset strokes-char-table ?X 59) -(aset strokes-char-table ?Y 60) -(aset strokes-char-table ?Z 61) (defconst strokes-base64-chars ;; I wanted to make this a vector of individual like (vector ?0 From c59dedcdf17530d22931ec6c8f92215971af09ba Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 31 Mar 2021 18:17:15 +0200 Subject: [PATCH 08/75] Use emacs-version instead of obsolete version variables * lisp/calendar/icalendar.el (icalendar-version): * lisp/dframe.el (dframe-version): * lisp/emacs-lisp/checkdoc.el (checkdoc-version): * lisp/emulation/edt.el (edt-version): * lisp/international/mule.el (mule-version): * lisp/linum.el (linum-version): * lisp/play/bubbles.el (bubbles-version): * lisp/textmodes/remember.el (remember-version): * lisp/url/url-vars.el (url-version): * lisp/woman.el (woman-version): Use emacs-version instead of obsolete version variables. --- lisp/calendar/icalendar.el | 9 +++++---- lisp/dframe.el | 2 +- lisp/emacs-lisp/checkdoc.el | 9 ++++++--- lisp/emulation/edt.el | 6 +++--- lisp/international/mule.el | 2 +- lisp/linum.el | 6 +++--- lisp/play/bubbles.el | 8 +++++--- lisp/textmodes/remember.el | 9 +++++---- lisp/url/url-vars.el | 9 +++++---- lisp/woman.el | 8 +++++--- 10 files changed, 39 insertions(+), 29 deletions(-) diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el index d9cd21e3cd2..04b525efc8a 100644 --- a/lisp/calendar/icalendar.el +++ b/lisp/calendar/icalendar.el @@ -105,10 +105,6 @@ ;;; Code: -(defconst icalendar-version "0.19" - "Version number of icalendar.el.") -(make-obsolete-variable 'icalendar-version nil "28.1") - ;; ====================================================================== ;; Customizables ;; ====================================================================== @@ -2557,6 +2553,11 @@ the entry." (or (icalendar--get-event-property event 'URL) "") (or (icalendar--get-event-property event 'CLASS) ""))) +;; Obsolete + +(defconst icalendar-version "0.19" "Version number of icalendar.el.") +(make-obsolete-variable 'icalendar-version 'emacs-version "28.1") + (provide 'icalendar) ;;; icalendar.el ends here diff --git a/lisp/dframe.el b/lisp/dframe.el index e61d2ea0581..f4208f3755a 100644 --- a/lisp/dframe.el +++ b/lisp/dframe.el @@ -828,7 +828,7 @@ the mode-line." (defvar dframe-version "1.3" "The current version of the dedicated frame library.") -(make-obsolete-variable 'dframe-version nil "28.1") +(make-obsolete-variable 'dframe-version 'emacs-version "28.1") (provide 'dframe) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 62851660c66..96b16f7ed45 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -160,9 +160,6 @@ ;; not specifically docstring related. Would this even be useful? ;;; Code: -(defvar checkdoc-version "0.6.2" - "Release version of checkdoc you are currently running.") -(make-obsolete-variable 'checkdoc-version nil "28.1") (require 'cl-lib) (require 'help-mode) ;; for help-xref-info-regexp @@ -2709,6 +2706,12 @@ function called to create the messages." (custom-add-option 'emacs-lisp-mode-hook 'checkdoc-minor-mode) +;; Obsolete + +(defvar checkdoc-version "0.6.2" + "Release version of checkdoc you are currently running.") +(make-obsolete-variable 'checkdoc-version 'emacs-version "28.1") + (provide 'checkdoc) ;;; checkdoc.el ends here diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el index 50979c4dbb3..f11afb1d02d 100644 --- a/lisp/emulation/edt.el +++ b/lisp/emulation/edt.el @@ -178,9 +178,6 @@ (defvar edt-user-global-map) (defvar rect-start-point) -(defconst edt-version "4.0" "EDT Emulation version number.") -(make-obsolete-variable 'edt-version nil "28.1") - ;;; ;;; User Configurable Variables ;;; @@ -2533,6 +2530,9 @@ G-C-\\: Split Window | FNDNXT | Yank | CUT | (set-frame-width nil 132) (message "Terminal width 132")) +(defconst edt-version "4.0" "EDT Emulation version number.") +(make-obsolete-variable 'edt-version 'emacs-version "28.1") + (provide 'edt) ;;; edt.el ends here diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 52e743e6f3d..83cbb44c4db 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -32,7 +32,7 @@ (defconst mule-version "6.0 (HANACHIRUSATO)" "\ Version number and name of this version of MULE (multilingual environment).") -(make-obsolete-variable 'mule-version nil "28.1") +(make-obsolete-variable 'mule-version 'emacs-version "28.1") (defconst mule-version-date "2003.9.1" "\ Distribution date of this version of MULE (multilingual environment).") diff --git a/lisp/linum.el b/lisp/linum.el index f9761d22c6e..b0281d366cd 100644 --- a/lisp/linum.el +++ b/lisp/linum.el @@ -31,9 +31,6 @@ ;;; Code: -(defconst linum-version "0.9x") -(make-obsolete-variable 'linum-version nil "28.1") - (defvar-local linum-overlays nil "Overlays used in this buffer.") (defvar-local linum-available nil "Overlays available for reuse.") (defvar linum-before-numbering-hook nil @@ -244,6 +241,9 @@ Linum mode is a buffer-local minor mode." ;; continue standard unloading nil) +(defconst linum-version "0.9x") +(make-obsolete-variable 'linum-version 'emacs-version "28.1") + (provide 'linum) ;;; linum.el ends here diff --git a/lisp/play/bubbles.el b/lisp/play/bubbles.el index 50f65a1215e..e695a75e083 100644 --- a/lisp/play/bubbles.el +++ b/lisp/play/bubbles.el @@ -72,9 +72,6 @@ ;;; Code: -(defconst bubbles-version "0.5" "Version number of bubbles.el.") -(make-obsolete-variable 'bubbles-version nil "28.1") - (require 'gamegrid) ;; User options @@ -1405,6 +1402,11 @@ Return t if new char is non-empty." (forward-char 1))) (put-text-property (point-min) (point-max) 'pointer 'arrow))))) +;; Obsolete. + +(defconst bubbles-version "0.5" "Version number of bubbles.el.") +(make-obsolete-variable 'bubbles-version 'emacs-version "28.1") + (provide 'bubbles) ;;; bubbles.el ends here diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el index 3affb462011..cd76bf80f19 100644 --- a/lisp/textmodes/remember.el +++ b/lisp/textmodes/remember.el @@ -178,10 +178,6 @@ ;;; Code: -(defconst remember-version "2.0" - "This version of remember.") -(make-obsolete-variable 'remember-version nil "28.1") - (defgroup remember nil "A mode to remember information." :group 'data) @@ -671,6 +667,11 @@ is non-nil, bury it and return nil; otherwise return t." nil) t)) +;; Obsolete + +(defconst remember-version "2.0" "This version of remember.") +(make-obsolete-variable 'remember-version 'emacs-version "28.1") + (provide 'remember) ;;; remember.el ends here diff --git a/lisp/url/url-vars.el b/lisp/url/url-vars.el index 8c836f8f64d..2aa2e7912f5 100644 --- a/lisp/url/url-vars.el +++ b/lisp/url/url-vars.el @@ -22,10 +22,6 @@ ;;; Code: -(defconst url-version "Emacs" - "Version number of URL package.") -(make-obsolete-variable 'url-version nil "28.1") - (defgroup url nil "Uniform Resource Locator tool." :version "22.1" @@ -427,6 +423,11 @@ Should be one of: This should be set, e.g. by mail user agents rendering HTML to avoid `bugs' which call home.") +;; Obsolete + +(defconst url-version "Emacs" "Version number of URL package.") +(make-obsolete-variable 'url-version 'emacs-version "28.1") + (provide 'url-vars) ;;; url-vars.el ends here diff --git a/lisp/woman.el b/lisp/woman.el index 505fdb4c9e1..d9aa573d27b 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -390,9 +390,6 @@ (eval-when-compile (require 'cl-lib)) -(defvar woman-version "0.551 (beta)" "WoMan version information.") -(make-obsolete-variable 'woman-version nil "28.1") - (require 'man) (define-button-type 'WoMan-xref-man-page :supertype 'Man-abstract-xref-man-page @@ -4580,6 +4577,11 @@ logging the message." (bookmark-default-handler `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bookmark))))) +;; Obsolete. + +(defvar woman-version "0.551 (beta)" "WoMan version information.") +(make-obsolete-variable 'woman-version 'emacs-version "28.1") + (provide 'woman) ;;; woman.el ends here From 168d2628b233337a1fbf90d05dbcc3fa39f771e7 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 1 Apr 2021 01:26:52 +0200 Subject: [PATCH 09/75] Use lexical-binding in avoid.el * lisp/avoid.el: Use lexical-binding. Remove redundant :group args. (mouse-avoidance-fancy): Quote function symbol as such. --- lisp/avoid.el | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/lisp/avoid.el b/lisp/avoid.el index 3b3848e20d1..d3afecf8cc2 100644 --- a/lisp/avoid.el +++ b/lisp/avoid.el @@ -1,4 +1,4 @@ -;;; avoid.el --- make mouse pointer stay out of the way of editing +;;; avoid.el --- make mouse pointer stay out of the way of editing -*- lexical-binding: t -*- ;; Copyright (C) 1993-1994, 2000-2021 Free Software Foundation, Inc. @@ -80,7 +80,6 @@ use either \\[customize] or \\[mouse-avoidance-mode]." :initialize 'custom-initialize-default :type '(choice (const :tag "none" nil) (const banish) (const jump) (const animate) (const exile) (const proteus)) - :group 'avoid :require 'avoid :version "20.3") @@ -89,25 +88,21 @@ use either \\[customize] or \\[mouse-avoidance-mode]." "Average distance that mouse will be moved when approached by cursor. Only applies in Mouse Avoidance mode `jump' and its derivatives. For best results make this larger than `mouse-avoidance-threshold'." - :type 'integer - :group 'avoid) + :type 'integer) (defcustom mouse-avoidance-nudge-var 10 "Variability of `mouse-avoidance-nudge-dist' (which see)." - :type 'integer - :group 'avoid) + :type 'integer) (defcustom mouse-avoidance-animation-delay .01 "Delay between animation steps, in seconds." - :type 'number - :group 'avoid) + :type 'number) (defcustom mouse-avoidance-threshold 5 "Mouse-pointer's flight distance. If the cursor gets closer than this, the mouse pointer will move away. Only applies in Mouse Avoidance modes `animate' and `jump'." - :type 'integer - :group 'avoid) + :type 'integer) (defcustom mouse-avoidance-banish-position '((frame-or-window . frame) (side . right) @@ -380,7 +375,7 @@ redefine this function to suit your own tastes." (mouse-avoidance-nudge-mouse) (if (not (eq (selected-frame) (car old-pos))) ;; This should never happen. - (apply 'set-mouse-position old-pos))))) + (apply #'set-mouse-position old-pos))))) ;;;###autoload (defun mouse-avoidance-mode (&optional mode) From 41f37c8c828a1c023acc91026a3d0dc76e0c1cd3 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 1 Apr 2021 10:23:21 +0200 Subject: [PATCH 10/75] Remove redundant #' before lambda in Gnus * lisp/gnus/gnus-group.el (gnus-group-list-cached) (gnus-group-list-dormant, gnus-group-list-ticked): * lisp/gnus/gnus-registry.el (gnus-registry-remove-extra-data): * lisp/gnus/gnus-score.el (gnus-score-edit-file-at-point): * lisp/gnus/gnus-sum.el (gnus-fetch-headers): * lisp/gnus/mm-partial.el (mm-inline-partial): * lisp/gnus/nnselect.el (nnselect-uncompress-artlist) (numbers-by-group, nnselect-request-expire-articles) (nnselect-request-update-info, nnselect-request-thread): * lisp/gnus/nnvirtual.el (nnvirtual-request-expire-articles): * lisp/gnus/spam-stat.el (spam-stat-score-buffer): Remove redundant #' before lambda. --- lisp/gnus/gnus-group.el | 38 ++++++++++----------- lisp/gnus/gnus-registry.el | 6 ++-- lisp/gnus/gnus-score.el | 4 +-- lisp/gnus/gnus-sum.el | 6 ++-- lisp/gnus/mm-partial.el | 16 ++++----- lisp/gnus/nnselect.el | 68 +++++++++++++++++++------------------- lisp/gnus/nnvirtual.el | 6 ++-- lisp/gnus/spam-stat.el | 2 +- 8 files changed, 73 insertions(+), 73 deletions(-) diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 909391b6b0c..423b180408a 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -4697,20 +4697,20 @@ This command may read the active file." (gnus-cache-open)) (funcall gnus-group-prepare-function (or level gnus-level-subscribed) - #'(lambda (info) - (let ((marks (gnus-info-marks info))) - (assq 'cache marks))) + (lambda (info) + (let ((marks (gnus-info-marks info))) + (assq 'cache marks))) lowest - #'(lambda (group) - (or (gethash group - gnus-cache-active-hashtb) - ;; Cache active file might use "." - ;; instead of ":". - (gethash - (mapconcat #'identity - (split-string group ":") - ".") - gnus-cache-active-hashtb)))) + (lambda (group) + (or (gethash group + gnus-cache-active-hashtb) + ;; Cache active file might use "." + ;; instead of ":". + (gethash + (mapconcat #'identity + (split-string group ":") + ".") + gnus-cache-active-hashtb)))) (goto-char (point-min)) (gnus-group-position-point)) @@ -4728,9 +4728,9 @@ This command may read the active file." (gnus-cache-open)) (funcall gnus-group-prepare-function (or level gnus-level-subscribed) - #'(lambda (info) - (let ((marks (gnus-info-marks info))) - (assq 'dormant marks))) + (lambda (info) + (let ((marks (gnus-info-marks info))) + (assq 'dormant marks))) lowest 'ignore) (goto-char (point-min)) @@ -4750,9 +4750,9 @@ This command may read the active file." (gnus-cache-open)) (funcall gnus-group-prepare-function (or level gnus-level-subscribed) - #'(lambda (info) - (let ((marks (gnus-info-marks info))) - (assq 'tick marks))) + (lambda (info) + (let ((marks (gnus-info-marks info))) + (assq 'tick marks))) lowest 'ignore) (goto-char (point-min)) diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index e3b9c196186..6ac646fbeac 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el @@ -1290,9 +1290,9 @@ from your existing entries." (registry-reindex db) (cl-loop for k being the hash-keys of (oref db data) using (hash-value v) - do (let ((newv (delq nil (mapcar #'(lambda (entry) - (unless (member (car entry) extra) - entry)) + do (let ((newv (delq nil (mapcar (lambda (entry) + (unless (member (car entry) extra) + entry)) v)))) (registry-delete db (list k) nil) (gnus-registry-insert db k newv))) diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index ce64dcef041..f40da9e9c4c 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -1182,8 +1182,8 @@ If FORMAT, also format the current score file." (when (consp rule) ;; the rule exists (setq rule (if (symbolp (car rule)) (format "(%S)" (car rule)) - (mapconcat #'(lambda (obj) - (regexp-quote (format "%S" obj))) + (mapconcat (lambda (obj) + (regexp-quote (format "%S" obj))) rule sep))) (goto-char (point-min)) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index c30f9a5f350..ac9317ef4e2 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -5676,9 +5676,9 @@ or a straight list of headers." (or dependencies (with-current-buffer gnus-summary-buffer gnus-newsgroup-dependencies)))) - (delq nil (mapcar #'(lambda (header) - (gnus-dependencies-add-header - header dependencies force-new)) + (delq nil (mapcar (lambda (header) + (gnus-dependencies-add-header + header dependencies force-new)) gnus-headers-retrieved-by))))) (gnus-message 7 "Fetching headers for %s...done" gnus-newsgroup-name))) diff --git a/lisp/gnus/mm-partial.el b/lisp/gnus/mm-partial.el index 0c25c8f8bcd..0c628055acb 100644 --- a/lisp/gnus/mm-partial.el +++ b/lisp/gnus/mm-partial.el @@ -72,14 +72,14 @@ If NO-DISPLAY is nil, display it. Otherwise, do nothing after replacing." id (with-current-buffer gnus-summary-buffer (gnus-summary-article-number)))) - #'(lambda (a b) - (let ((anumber (string-to-number - (cdr (assq 'number - (cdr (mm-handle-type a)))))) - (bnumber (string-to-number - (cdr (assq 'number - (cdr (mm-handle-type b))))))) - (< anumber bnumber))))) + (lambda (a b) + (let ((anumber (string-to-number + (cdr (assq 'number + (cdr (mm-handle-type a)))))) + (bnumber (string-to-number + (cdr (assq 'number + (cdr (mm-handle-type b))))))) + (< anumber bnumber))))) (setq gnus-article-mime-handles (mm-merge-handles gnus-article-mime-handles phandles)) (with-current-buffer (generate-new-buffer " *mm*") diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index 1daa8aa673b..e314e1d8d10 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -100,8 +100,8 @@ (setq selection (vconcat (cl-map 'vector - #'(lambda (art) - (vector artgroup art artrsv)) + (lambda (art) + (vector artgroup art artrsv)) (gnus-uncompress-sequence artseq)) selection))) selection))) @@ -211,12 +211,12 @@ as `(keyfunc member)' and the corresponding element is just #'nnselect-article-group #'nnselect-article-number)) ((eq ,type 'tuple) (nnselect-categorize ,articles - #'(lambda (elem) - (nnselect-article-group (car elem))) - #'(lambda (elem) - (cons (nnselect-article-number - (car elem)) - (cdr elem))))) + (lambda (elem) + (nnselect-article-group (car elem))) + (lambda (elem) + (cons (nnselect-article-number + (car elem)) + (cdr elem))))) (t (nnselect-categorize ,articles #'nnselect-article-group @@ -464,8 +464,8 @@ If this variable is nil, or if the provided function returns nil, (error "Group %s does not support article expiration" artgroup)) (unless (gnus-check-server (gnus-find-method-for-group artgroup)) (error "Couldn't open server for group %s" artgroup)) - (push (mapcar #'(lambda (art) - (car (rassq art artids))) + (push (mapcar (lambda (art) + (car (rassq art artids))) (let ((nnimap-expunge 'immediately)) (gnus-request-expire-articles artlist artgroup force))) @@ -549,8 +549,8 @@ If this variable is nil, or if the provided function returns nil, (gnus-add-to-range (gnus-info-read info) (delq nil (mapcar - #'(lambda (art) - (unless (memq (cdr art) unread) (car art))) + (lambda (art) + (unless (memq (cdr art) unread) (car art))) artids)))) (pcase-dolist (`(,type . ,mark-list) marks) (let ((mark-type (gnus-article-mark-to-type type)) new) @@ -560,19 +560,19 @@ If this variable is nil, or if the provided function returns nil, (cond ((eq mark-type 'tuple) (mapcar - #'(lambda (id) - (let (mark) - (when - (setq mark (assq (cdr id) mark-list)) - (cons (car id) (cdr mark))))) + (lambda (id) + (let (mark) + (when + (setq mark (assq (cdr id) mark-list)) + (cons (car id) (cdr mark))))) artids)) (t (setq mark-list (gnus-uncompress-range mark-list)) (mapcar - #'(lambda (id) - (when (memq (cdr id) mark-list) - (car id))) artids))))) + (lambda (id) + (when (memq (cdr id) mark-list) + (car id))) artids))))) (let ((previous (alist-get type newmarks))) (if previous (nconc previous new) @@ -607,8 +607,8 @@ If this variable is nil, or if the provided function returns nil, (let ((thread (gnus-id-to-thread (mail-header-id header)))) (when thread - (cl-some #'(lambda (x) - (when (and x (> x 0)) x)) + (cl-some (lambda (x) + (when (and x (> x 0)) x)) (gnus-articles-in-thread thread))))))))) ;; Check if search-based thread referral is permitted, and ;; available. @@ -642,15 +642,15 @@ If this variable is nil, or if the provided function returns nil, old-arts seq headers) (mapc - #'(lambda (article) - (if - (setq seq - (cl-position article - gnus-newsgroup-selection :test 'equal)) - (push (1+ seq) old-arts) - (setq gnus-newsgroup-selection - (vconcat gnus-newsgroup-selection (vector article))) - (cl-incf last))) + (lambda (article) + (if + (setq seq + (cl-position article + gnus-newsgroup-selection :test 'equal)) + (push (1+ seq) old-arts) + (setq gnus-newsgroup-selection + (vconcat gnus-newsgroup-selection (vector article))) + (cl-incf last))) new-nnselect-artlist) (setq headers (gnus-fetch-headers @@ -671,9 +671,9 @@ If this variable is nil, or if the provided function returns nil, (when (setq new-marks (delq nil (mapcar - #'(lambda (art) - (when (memq (cdr art) marked) - (car art))) + (lambda (art) + (when (memq (cdr art) marked) + (car art))) artids))) (nconc (symbol-value diff --git a/lisp/gnus/nnvirtual.el b/lisp/gnus/nnvirtual.el index b3b701e4126..03a0ff296f2 100644 --- a/lisp/gnus/nnvirtual.el +++ b/lisp/gnus/nnvirtual.el @@ -362,9 +362,9 @@ It is computed from the marks of individual component groups.") (dolist (group nnvirtual-component-groups) (setq unexpired (nconc unexpired (mapcar - #'(lambda (article) - (nnvirtual-reverse-map-article - group article)) + (lambda (article) + (nnvirtual-reverse-map-article + group article)) (gnus-uncompress-range (gnus-group-expire-articles-1 group)))))) (sort (delq nil unexpired) #'<))) diff --git a/lisp/gnus/spam-stat.el b/lisp/gnus/spam-stat.el index 3e804ecb4bb..ab9be0da890 100644 --- a/lisp/gnus/spam-stat.el +++ b/lisp/gnus/spam-stat.el @@ -492,7 +492,7 @@ Add user supplied modifications if supplied." (let* ((probs (mapcar #'cadr spam-stat-score-data)) (prod (apply #'* probs)) (score0 - (/ prod (+ prod (apply #'* (mapcar #'(lambda (x) (- 1 x)) + (/ prod (+ prod (apply #'* (mapcar (lambda (x) (- 1 x)) probs))))) (score1s (condition-case nil From 1f790dfe90d914e02182fc4abab6623d9c966ff6 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 1 Apr 2021 10:34:39 +0200 Subject: [PATCH 11/75] Use lexical-binding in isearchb.el * lisp/isearchb.el: Use lexical-binding. Remove redundant :group args. --- lisp/isearchb.el | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lisp/isearchb.el b/lisp/isearchb.el index 3713879e3b6..67020b76ecb 100644 --- a/lisp/isearchb.el +++ b/lisp/isearchb.el @@ -1,4 +1,4 @@ -;;; isearchb --- a marriage between iswitchb and isearch +;;; isearchb.el --- a marriage between iswitchb and isearch -*- lexical-binding: t -*- ;; Copyright (C) 2004-2021 Free Software Foundation, Inc. @@ -89,13 +89,11 @@ "Number of idle seconds before isearchb turns itself off. If nil, don't use a timeout." :type '(choice (integer :tag "Seconds") - (const :tag "Disable" nil)) - :group 'isearchb) + (const :tag "Disable" nil))) (defcustom isearchb-show-completions t "If non-nil, show possible completions in the minibuffer." - :type 'boolean - :group 'isearchb) + :type 'boolean) (defvar isearchb-start-buffer nil) (defvar isearchb-last-buffer nil) From 4582c96828d6386ab6a6a6b2a7147a810c8ba474 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 1 Apr 2021 11:07:06 +0200 Subject: [PATCH 12/75] Use lexical-binding in epg-config.el and add tests * lisp/epg-config.el: Use lexical-binding. (epg-find-configuration): Improve error message. * test/lisp/epg-config-tests.el: New file. --- lisp/epg-config.el | 6 +++-- test/lisp/epg-config-tests.el | 47 +++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 test/lisp/epg-config-tests.el diff --git a/lisp/epg-config.el b/lisp/epg-config.el index 59d097c91f0..d32c8c897c7 100644 --- a/lisp/epg-config.el +++ b/lisp/epg-config.el @@ -1,4 +1,4 @@ -;;; epg-config.el --- configuration of the EasyPG Library +;;; epg-config.el --- configuration of the EasyPG Library -*- lexical-binding: t -*- ;; Copyright (C) 2006-2021 Free Software Foundation, Inc. @@ -21,6 +21,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: ;;; Prelude @@ -157,7 +159,7 @@ version requirement is met." (setq program-alist epg-config--program-alist)) (let ((entry (assq protocol program-alist))) (unless entry - (error "Unknown protocol %S" protocol)) + (error "Unknown protocol `%S'" protocol)) (cl-destructuring-bind (symbol . alist) (cdr entry) (let ((constructor diff --git a/test/lisp/epg-config-tests.el b/test/lisp/epg-config-tests.el new file mode 100644 index 00000000000..fba61e573c3 --- /dev/null +++ b/test/lisp/epg-config-tests.el @@ -0,0 +1,47 @@ +;;; epg-config-tests.el --- Test suite for epg.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 'epg-config) + +(ert-deftest epg-config-test-epg-find-configuration () + (skip-unless (executable-find "gpg2")) + (should (assq 'version (epg-find-configuration 'OpenPGP)))) + +(ert-deftest epg-config-test-epg-find-configuration/unknown-protocol () + (should-error (epg-find-configuration 'does-not-exist))) + +(ert-deftest epg-config-test-epg-check-configuration () + (should (epg-check-configuration '((version . "1.0")) "0.9")) + (should (epg-check-configuration '((version . "1.0")) "1.0")) + (should-error (epg-check-configuration '((version . "1.0")) "1.1")) + (should-error (epg-check-configuration '((version . "1.0")) 'foo)) + (should-error (epg-check-configuration '((version . "1.0")) "foo"))) + +(ert-deftest epg-config-test-epg-required-version-p () + (skip-unless (executable-find "gpg2")) + (should (epg-required-version-p 'OpenPGP "1.0"))) + +(provide 'epg-config-tests) + +;;; epg-config-tests.el ends here From 12d2fd6037a87241f0966427f5788eb939c37c53 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 1 Apr 2021 15:57:55 +0300 Subject: [PATCH 13/75] Fix 'extraclean' targets * GNUmakefile: Add description of 'extraclean'. * Makefile.in (extraclean_dirs): Add lwlib. * lwlib/Makefile.in (clean mostlyclean extraclean): Add 'extraclean' target. * lisp/Makefile.in (extraclean): Remove ${loaddefs}, not just ${LOADDEFS}. Delete all backup and autosave files. --- GNUmakefile | 2 ++ Makefile.in | 2 +- lisp/Makefile.in | 4 +++- lwlib/Makefile.in | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index f27163840b7..c8d4832aab1 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -50,6 +50,8 @@ help: @echo "make distclean -- delete all build and configuration files," @echo " leave only files included in source distribution" @echo "make maintainer-clean -- delete almost everything that can be regenerated" + @echo "make extraclean -- like maintainer-clean, and also all generated files," + @echo " backup files and autosave files" @echo "make bootstrap -- delete all compiled files to force a new bootstrap" @echo " from a clean slate, then build in the normal way" @echo "make uninstall -- remove files installed by 'make install'" diff --git a/Makefile.in b/Makefile.in index 4fa7c9ed5f1..f3ba50c55ed 100644 --- a/Makefile.in +++ b/Makefile.in @@ -923,7 +923,7 @@ maintainer-clean: bootstrap-clean $(maintainer_clean_dirs:=_maintainer-clean) ### Note that we abuse this in some subdirectories (eg leim), ### to delete some generated files that are slow to rebuild. extraclean_dirs = ${NTDIR} lib-src src leim \ - admin/charsets admin/grammars admin/unidata lisp lib + admin/charsets admin/grammars admin/unidata lisp lib lwlib $(foreach dir,$(extraclean_dirs),$(eval $(call submake_template,$(dir),extraclean))) diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 8ea28415585..d62c2cfbbed 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -449,8 +449,10 @@ maintainer-clean: distclean bootstrap-clean rm -f TAGS extraclean: bootstrap-clean distclean - -for file in $(LOADDEFS); do rm -f $${file}~; done + -for file in $(loaddefs); do rm -f $${file}~; done -rm -f $(lisp)/loaddefs.el~ + -find $(lisp) -name '*~' $(FIND_DELETE) + -find $(lisp) -name '#*' $(FIND_DELETE) .PHONY: check-declare diff --git a/lwlib/Makefile.in b/lwlib/Makefile.in index fb0ae0e1c21..ce77789db89 100644 --- a/lwlib/Makefile.in +++ b/lwlib/Makefile.in @@ -93,9 +93,9 @@ globals_h = ../src/globals.h $(globals_h): $(MAKE) -C ../src globals.h -.PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean +.PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean extraclean -clean mostlyclean: +clean mostlyclean extraclean: rm -f ./*.o liblw.a \#* $(DEPDIR)/* distclean: clean From 5bf7c6ce4eb9fb9d35d960636266a5cc36b648c0 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 1 Apr 2021 15:59:28 +0300 Subject: [PATCH 14/75] GNUmakefile: Fix last change. --- GNUmakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index c8d4832aab1..0e01b808a0f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -50,8 +50,8 @@ help: @echo "make distclean -- delete all build and configuration files," @echo " leave only files included in source distribution" @echo "make maintainer-clean -- delete almost everything that can be regenerated" - @echo "make extraclean -- like maintainer-clean, and also all generated files," - @echo " backup files and autosave files" + @echo "make extraclean -- like maintainer-clean, and also delete all generated" + @echo " files, backup files and autosave files" @echo "make bootstrap -- delete all compiled files to force a new bootstrap" @echo " from a clean slate, then build in the normal way" @echo "make uninstall -- remove files installed by 'make install'" From 84519cdbda3fdb2351a95fe9e70d1ee74d982081 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 1 Apr 2021 06:26:57 -0700 Subject: [PATCH 15/75] ; Auto-commit of loaddefs files. --- lisp/ldefs-boot.el | 301 +++++++++++++++++++++++++-------------------- 1 file changed, 168 insertions(+), 133 deletions(-) diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index c9210c62514..412751bf450 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -477,31 +477,31 @@ With value nil, inhibit any automatic allout-mode activation.") (custom-autoload 'allout-auto-activation "allout" nil) -(put 'allout-use-hanging-indents 'safe-local-variable 'booleanp) +(put 'allout-use-hanging-indents 'safe-local-variable #'booleanp) (put 'allout-reindent-bodies 'safe-local-variable (lambda (x) (memq x '(nil t text force)))) -(put 'allout-show-bodies 'safe-local-variable 'booleanp) +(put 'allout-show-bodies 'safe-local-variable #'booleanp) -(put 'allout-header-prefix 'safe-local-variable 'stringp) +(put 'allout-header-prefix 'safe-local-variable #'stringp) -(put 'allout-primary-bullet 'safe-local-variable 'stringp) +(put 'allout-primary-bullet 'safe-local-variable #'stringp) -(put 'allout-plain-bullets-string 'safe-local-variable 'stringp) +(put 'allout-plain-bullets-string 'safe-local-variable #'stringp) -(put 'allout-distinctive-bullets-string 'safe-local-variable 'stringp) +(put 'allout-distinctive-bullets-string 'safe-local-variable #'stringp) (put 'allout-use-mode-specific-leader 'safe-local-variable (lambda (x) (or (memq x '(t nil allout-mode-leaders comment-start)) (stringp x)))) -(put 'allout-old-style-prefixes 'safe-local-variable 'booleanp) +(put 'allout-old-style-prefixes 'safe-local-variable #'booleanp) -(put 'allout-stylish-prefixes 'safe-local-variable 'booleanp) +(put 'allout-stylish-prefixes 'safe-local-variable #'booleanp) -(put 'allout-numbered-bullet 'safe-local-variable 'string-or-null-p) +(put 'allout-numbered-bullet 'safe-local-variable #'string-or-null-p) -(put 'allout-file-xref-bullet 'safe-local-variable 'string-or-null-p) +(put 'allout-file-xref-bullet 'safe-local-variable #'string-or-null-p) -(put 'allout-presentation-padding 'safe-local-variable 'integerp) +(put 'allout-presentation-padding 'safe-local-variable #'integerp) (put 'allout-layout 'safe-local-variable (lambda (x) (or (numberp x) (listp x) (memq x '(: * + -))))) @@ -784,7 +784,7 @@ OPEN: A TOPIC that is not CLOSED, though its OFFSPRING or BODY may be. \(fn &optional ARG)" t nil) -(defalias 'outlinify-sticky 'outlineify-sticky) +(defalias 'outlinify-sticky #'outlineify-sticky) (autoload 'outlineify-sticky "allout" "\ Activate outline mode and establish file var so it is started subsequently. @@ -827,7 +827,7 @@ See `allout-widgets-mode' for allout widgets mode features.") (custom-autoload 'allout-widgets-auto-activation "allout-widgets" nil) -(put 'allout-widgets-mode-inhibit 'safe-local-variable 'booleanp) +(put 'allout-widgets-mode-inhibit 'safe-local-variable #'booleanp) (autoload 'allout-widgets-mode "allout-widgets" "\ Toggle Allout Widgets mode. @@ -1161,11 +1161,11 @@ Returns list of symbols and documentation found. (autoload 'archive-mode "arc-mode" "\ Major mode for viewing an archive file in a dired-like way. You can move around using the usual cursor motion commands. -Letters no longer insert themselves. -Type `e' to pull a file out of the archive and into its own buffer; +Letters no longer insert themselves.\\ +Type \\[archive-extract] to pull a file out of the archive and into its own buffer; or click mouse-2 on the file's line in the archive mode buffer. -If you edit a sub-file of this archive (as with the `e' command) and +If you edit a sub-file of this archive (as with the \\[archive-extract] command) and save it, the contents of that buffer will be saved back into the archive. @@ -1539,7 +1539,7 @@ ENTRY is the name of a password-store entry. The key used to retrieve the password is the symbol `secret'. The convention used as the format for a password-store file is -the following (see http://www.passwordstore.org/#organization): +the following (see https://www.passwordstore.org/#organization): secret key1: value1 @@ -1995,6 +1995,20 @@ seconds. ;;;;;; 0 0)) ;;; Generated autoloads from emacs-lisp/benchmark.el +(autoload 'benchmark-call "benchmark" "\ +Measure the run time of calling FUNC a number REPETITIONS of times. +The result is a list (TIME GC GCTIME) +where TIME is the total time it took, in seconds. +GCTIME is the amount of time that was spent in the GC +and GC is the number of times the GC was called. + +REPETITIONS can also be a floating point number, in which case it +specifies a minimum number of seconds that the benchmark execution +should take. In that case the return value is prepended with the +number of repetitions actually used. + +\(fn FUNC &optional REPETITIONS)" nil nil) + (autoload 'benchmark-run "benchmark" "\ Time execution of FORMS. If REPETITIONS is supplied as a number, run FORMS that many times, @@ -2024,6 +2038,8 @@ Interactively, REPETITIONS is taken from the prefix arg, and the command prompts for the form to benchmark. For non-interactive use see also `benchmark-run' and `benchmark-run-compiled'. +FORM can also be a function in which case we measure the time it takes +to call it without any argument. \(fn REPETITIONS FORM)" t nil) @@ -2035,7 +2051,7 @@ The return value is the value of the final form in BODY. (function-put 'benchmark-progn 'lisp-indent-function '0) -(register-definition-prefixes "benchmark" '("benchmark-elapse")) +(register-definition-prefixes "benchmark" '("benchmark-")) ;;;*** @@ -4794,7 +4810,7 @@ element to judge if that element should be excluded from the list. The buffer is left in Command History mode." t nil) (autoload 'command-history "chistory" "\ -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. @@ -4892,8 +4908,12 @@ all methods of NAME have to use the same set of arguments for dispatch. Each dispatch argument and TYPE are specified in ARGS where the corresponding formal argument appears as (VAR TYPE) rather than just VAR. -The optional second argument QUALIFIER is a specifier that -modifies how the method is combined with other methods, including: +The optional EXTRA element, on the form `:extra STRING', allows +you to add more methods for the same specializers and qualifiers. +These are distinguished by STRING. + +The optional argument QUALIFIER is a specifier that modifies how +the method is combined with other methods, including: :before - Method will be called before the primary :after - Method will be called after the primary :around - Method will be called around everything else @@ -4910,9 +4930,9 @@ method to be applicable. The set of acceptable TYPEs (also called \"specializers\") is defined \(and can be extended) by the various methods of `cl-generic-generalizers'. -\(fn NAME [QUALIFIER] ARGS &rest [DOCSTRING] BODY)" nil t) +\(fn NAME [EXTRA] [QUALIFIER] ARGS &rest [DOCSTRING] BODY)" nil t) -(function-put 'cl-defmethod 'doc-string-elt '3) +(function-put 'cl-defmethod 'doc-string-elt 'cl--defmethod-doc-pos) (function-put 'cl-defmethod 'lisp-indent-function 'defun) @@ -6769,6 +6789,8 @@ If the HANDLER returns a `dbus-error', it is propagated as return message. \(fn EVENT)" t nil) +(function-put 'dbus-handle-event 'completion-predicate #'ignore) + (autoload 'dbus-monitor "dbus" "\ Invoke `dbus-register-monitor' interactively, and switch to the buffer. BUS is either a Lisp keyword, `:system' or `:session', or a @@ -10614,7 +10636,7 @@ be invoked for the values of the other parameters. \(fn &key (SERVER (erc-compute-server)) (PORT (erc-compute-port)) (NICK (erc-compute-nick)) PASSWORD (FULL-NAME (erc-compute-full-name)))" t nil) -(defalias 'erc-select 'erc) +(defalias 'erc-select #'erc) (autoload 'erc-tls "erc" "\ Interactively select TLS connection parameters and run ERC. @@ -10737,7 +10759,7 @@ and how to display message. \(fn SELECTOR &optional OUTPUT-BUFFER-NAME MESSAGE-FN)" t nil) -(defalias 'ert 'ert-run-tests-interactively) +(defalias 'ert #'ert-run-tests-interactively) (autoload 'ert-describe-test "ert" "\ Display the documentation for TEST-OR-TEST-NAME (a symbol or ert-test). @@ -11946,6 +11968,13 @@ Besides the choice of face, it is the same as `buffer-face-mode'. (register-definition-prefixes "face-remap" '("buffer-face-mode-" "face-" "internal-lisp-face-attributes" "text-scale-")) +;;;*** + +;;;### (autoloads nil "facemenu" "facemenu.el" (0 0 0 0)) +;;; Generated autoloads from facemenu.el + +(register-definition-prefixes "facemenu" '("facemenu-" "list-colors-")) + ;;;*** ;;;### (autoloads nil "faceup" "emacs-lisp/faceup.el" (0 0 0 0)) @@ -12212,6 +12241,8 @@ Otherwise, signal a `file-notify-error'. \(fn OBJECT)" t nil) +(function-put 'file-notify-handle-event 'completion-predicate #'ignore) + (register-definition-prefixes "filenotify" '("file-notify-")) ;;;*** @@ -12711,7 +12742,6 @@ Change the filter on a `find-lisp-find-dired' buffer to REGEXP. ;;;### (autoloads nil "finder" "finder.el" (0 0 0 0)) ;;; Generated autoloads from finder.el -(push (purecopy '(finder 1 0)) package--builtin-versions) (autoload 'finder-list-keywords "finder" "\ Display descriptions of the keywords in the Finder buffer." t nil) @@ -12780,7 +12810,7 @@ lines. (autoload 'flymake-log "flymake" "\ Log, at level LEVEL, the message MSG formatted with ARGS. LEVEL is passed to `display-warning', which is used to display -the warning. If this form is included in a byte-compiled file, +the warning. If this form is included in a file, the generated warning contains an indication of the file that generated it. @@ -14390,15 +14420,15 @@ If FORCE is non-nil, replace the old ones. Minor mode for providing mailing-list commands. If called interactively, toggle `Gnus-Mailing-List mode'. If the -prefix argument is positive, enable the mode, and if it is zero -or negative, disable the mode. +prefix argument is positive, enable the mode, and if it is zero or +negative, disable the mode. -If called from Lisp, toggle the mode if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. -Disable the mode if ARG is a negative number. +If called from Lisp, toggle the mode if ARG is `toggle'. Enable the +mode if ARG is nil, omitted, or is a positive number. Disable the +mode if ARG is a negative number. -The mode's hook is called both when the mode is enabled and when -it is disabled. +The mode's hook is called both when the mode is enabled and when it is +disabled. \\{gnus-mailing-list-mode-map} @@ -16840,7 +16870,7 @@ buffers which are visiting a file. (autoload 'ibuffer "ibuffer" "\ Begin using Ibuffer to edit a list of buffers. -Type `h' after entering ibuffer for more information. +Type \\\\[describe-mode] after entering ibuffer for more information. All arguments are optional. OTHER-WINDOW-P says to use another window. @@ -17126,7 +17156,7 @@ The main features of this mode are Use \\[idlwave-fill-paragraph] to refill a paragraph inside a comment. The indentation of the second line of the paragraph relative to the first will be retained. Use - \\[idlwave-auto-fill-mode] to toggle auto-fill mode for these + \\[auto-fill-mode] to toggle auto-fill mode for these comments. When the variable `idlwave-fill-comment-line-only' is nil, code can also be auto-filled and auto-indented. @@ -18592,25 +18622,6 @@ See Info node `(elisp)Defining Functions' for more details. (register-definition-prefixes "inline" '("inline-")) -;;;*** - -;;;### (autoloads nil "inversion" "cedet/inversion.el" (0 0 0 0)) -;;; Generated autoloads from cedet/inversion.el -(push (purecopy '(inversion 1 3)) package--builtin-versions) - -(autoload 'inversion-require-emacs "inversion" "\ -Declare that you need either EMACS-VER, XEMACS-VER or SXEMACS-ver. -Only checks one based on which kind of Emacs is being run. - -This function is obsolete; do this instead: - (when (version<= \"28.1\" emacs-version) ...) - -\(fn EMACS-VER XEMACS-VER SXEMACS-VER)" nil nil) - -(make-obsolete 'inversion-require-emacs 'nil '"28.1") - -(register-definition-prefixes "inversion" '("inversion-")) - ;;;*** ;;;### (autoloads nil "isearch-x" "international/isearch-x.el" (0 @@ -19540,13 +19551,13 @@ A major mode to edit GNU ld script files ;;;;;; (0 0 0 0)) ;;; Generated autoloads from textmodes/less-css-mode.el -(put 'less-css-compile-at-save 'safe-local-variable 'booleanp) +(put 'less-css-compile-at-save 'safe-local-variable #'booleanp) (put 'less-css-lessc-options 'safe-local-variable t) -(put 'less-css-output-directory 'safe-local-variable 'stringp) +(put 'less-css-output-directory 'safe-local-variable #'stringp) -(put 'less-css-input-file-name 'safe-local-variable 'stringp) +(put 'less-css-input-file-name 'safe-local-variable #'stringp) (add-to-list 'auto-mode-alist '("\\.less\\'" . less-css-mode)) (autoload 'less-css-mode "less-css-mode" "\ @@ -20535,7 +20546,7 @@ Default bookmark handler for Man buffers. ;;;### (autoloads nil "map" "emacs-lisp/map.el" (0 0 0 0)) ;;; Generated autoloads from emacs-lisp/map.el -(push (purecopy '(map 2 1)) package--builtin-versions) +(push (purecopy '(map 3 0)) package--builtin-versions) (register-definition-prefixes "map" '("map-")) @@ -22087,6 +22098,32 @@ QUALITY can be: ;;;### (autoloads nil "mwheel" "mwheel.el" (0 0 0 0)) ;;; Generated autoloads from mwheel.el +(defcustom mouse-wheel-mode t "\ +Non-nil if Mouse-Wheel mode is enabled. +See the `mouse-wheel-mode' command +for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `mouse-wheel-mode'." :set #'custom-set-minor-mode :initialize 'custom-initialize-delay :group 'mouse :type 'boolean) + +(custom-autoload 'mouse-wheel-mode "mwheel" nil) + +(autoload 'mouse-wheel-mode "mwheel" "\ +Toggle mouse wheel support (Mouse Wheel mode). + +If called interactively, toggle `Mouse-Wheel mode'. If the prefix +argument is positive, enable the mode, and if it is zero or negative, +disable the mode. + +If called from Lisp, toggle the mode if ARG is `toggle'. Enable the +mode if ARG is nil, omitted, or is a positive number. Disable the +mode if ARG is a negative number. + +The mode's hook is called both when the mode is enabled and when it is +disabled. + +\(fn &optional ARG)" t nil) + (register-definition-prefixes "mwheel" '("mouse-wheel-" "mwheel-")) ;;;*** @@ -22347,7 +22384,7 @@ gnutls-boot (as returned by `gnutls-boot-parameters'). \(fn NAME BUFFER HOST SERVICE &rest PARAMETERS)" nil nil) -(defalias 'open-protocol-stream 'open-network-stream) +(define-obsolete-function-alias 'open-protocol-stream #'open-network-stream "26.1") (register-definition-prefixes "network-stream" '("network-stream-")) @@ -24041,6 +24078,8 @@ Turning on outline mode calls the value of `text-mode-hook' and then of `outline-mode-hook', if they are non-nil. \(fn)" t nil) +(put 'outline-minor-mode-cycle 'safe-local-variable 'booleanp) +(put 'outline-minor-mode-highlight 'safe-local-variable 'booleanp) (autoload 'outline-minor-mode "outline" "\ Toggle Outline minor mode. @@ -24186,7 +24225,11 @@ directory. (autoload 'package-install-selected-packages "package" "\ Ensure packages in `package-selected-packages' are installed. -If some packages are not installed propose to install them." t nil) +If some packages are not installed, propose to install them. +If optional argument NOCONFIRM is non-nil, don't ask for +confirmation to install packages. + +\(fn &optional NOCONFIRM)" t nil) (autoload 'package-reinstall "package" "\ Reinstall package PKG. @@ -25898,6 +25941,13 @@ Save the result in `project-list-file' if the list of projects has changed. \(fn PR)" nil nil) +(autoload 'project-remove-known-project "project" "\ +Remove directory PROJECT-ROOT from the project list. +PROJECT-ROOT is the root directory of a known project listed in +the project list. + +\(fn PROJECT-ROOT)" t nil) + (autoload 'project-known-project-roots "project" "\ Return the list of root directories of all known projects." nil nil) @@ -25906,19 +25956,6 @@ Execute an extended command in project root." t nil) (function-put 'project-execute-extended-command 'interactive-only 'command-execute) -(defvar project-switch-commands '((project-find-file "Find file") (project-find-regexp "Find regexp") (project-dired "Dired") (project-vc-dir "VC-Dir") (project-eshell "Eshell")) "\ -Alist mapping commands to descriptions. -Used by `project-switch-project' to construct a dispatch menu of -commands available upon \"switching\" to another project. - -Each element is of the form (COMMAND LABEL &optional KEY) where -COMMAND is the command to run when KEY is pressed. LABEL is used -to distinguish the menu entries in the dispatch menu. If KEY is -absent, COMMAND must be bound in `project-prefix-map', and the -key is looked up in that map.") - -(custom-autoload 'project-switch-commands "project" t) - (autoload 'project-switch-project "project" "\ \"Switch\" to another project by running an Emacs command. The available commands are presented as a dispatch menu @@ -26495,7 +26532,7 @@ Add one translation rule, KEY to TRANSLATION, in the current Quail package. KEY is a string meaning a sequence of keystrokes to be translated. TRANSLATION is a character, a string, a vector, a Quail map, a function, or a cons. -It it is a character, it is the sole translation of KEY. +If it is a character, it is the sole translation of KEY. If it is a string, each character is a candidate for the translation. If it is a vector, each element (string or character) is a candidate for the translation. @@ -28351,24 +28388,7 @@ For more details, see Info node `(elisp) Extending Rx'. (function-put 'rx-define 'lisp-indent-function 'defun) -(autoload 'rx--pcase-macroexpander "rx" "\ -A pattern that matches strings against `rx' REGEXPS in sexp form. -REGEXPS are interpreted as in `rx'. The pattern matches any -string that is a match for REGEXPS, as if by `string-match'. - -In addition to the usual `rx' syntax, REGEXPS can contain the -following constructs: - - (let REF RX...) binds the symbol REF to a submatch that matches - the regular expressions RX. REF is bound in - CODE to the string of the submatch or nil, but - can also be used in `backref'. - (backref REF) matches whatever the submatch REF matched. - REF can be a number, as usual, or a name - introduced by a previous (let REF ...) - construct. - -\(fn &rest REGEXPS)" nil nil) +(eval-and-compile (defun rx--pcase-macroexpander (&rest regexps) "A pattern that matches strings against `rx' REGEXPS in sexp form.\nREGEXPS are interpreted as in `rx'. The pattern matches any\nstring that is a match for REGEXPS, as if by `string-match'.\n\nIn addition to the usual `rx' syntax, REGEXPS can contain the\nfollowing constructs:\n\n (let REF RX...) binds the symbol REF to a submatch that matches\n the regular expressions RX. REF is bound in\n CODE to the string of the submatch or nil, but\n can also be used in `backref'.\n (backref REF) matches whatever the submatch REF matched.\n REF can be a number, as usual, or a name\n introduced by a previous (let REF ...)\n construct." (let* ((rx--pcase-vars nil) (regexp (rx--to-expr (rx--pcase-transform (cons 'seq regexps)))) (nvars (length rx--pcase-vars))) `(and (pred stringp) ,(if (zerop nvars) `(pred (string-match ,regexp)) `(app (lambda (s) (and (string-match ,regexp s) ,(rx--reduce-right (lambda (a b) `(cons ,a ,b)) (mapcar (lambda (i) `(match-string ,i s)) (number-sequence 1 nvars))))) ,(list '\` (rx--reduce-right #'cons (mapcar (lambda (name) (list '\, name)) (reverse rx--pcase-vars)))))))))) (define-symbol-prop 'rx--pcase-macroexpander 'edebug-form-spec 'nil) @@ -28861,14 +28881,6 @@ Major mode for editing Bovine grammars. (register-definition-prefixes "semantic/grammar" '("semantic-")) -;;;*** - -;;;### (autoloads nil "semantic/grammar-wy" "cedet/semantic/grammar-wy.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/semantic/grammar-wy.el - -(register-definition-prefixes "semantic/grammar-wy" '("semantic-grammar-wy--")) - ;;;*** ;;;### (autoloads nil "semantic/java" "cedet/semantic/java.el" (0 @@ -29500,7 +29512,7 @@ or Edit/Text Properties/Face commands. Pages can have named points and can link other points to them with see also somename. In the same way see also URL where URL is a filename relative to current -directory, or absolute as in `http://www.cs.indiana.edu/elisp/w3/docs.html'. +directory, or absolute as in `https://www.cs.indiana.edu/elisp/w3/docs.html'. Images in many formats can be inlined with . @@ -31249,7 +31261,7 @@ Major-mode for writing SRecode macros. \(fn)" t nil) -(defalias 'srt-mode 'srecode-template-mode) +(defalias 'srt-mode #'srecode-template-mode) (register-definition-prefixes "srecode/srt-mode" '("semantic-" "srecode-")) @@ -31811,7 +31823,7 @@ Move the point under the table as shown below. +--------------+------+--------------------------------+ -!- -Type M-x table-insert-row instead of \\[table-insert-row-column]. \\[table-insert-row-column] does not work +Type \\[table-insert-row] instead of \\[table-insert-row-column]. \\[table-insert-row-column] does not work when the point is outside of the table. This insertion at outside of the table effectively appends a row at the end. @@ -32108,11 +32120,11 @@ HTML: URL `https://www.w3.org' LaTeX: - URL `http://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/Tables.html' + URL `https://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/Tables.html' CALS (DocBook DTD): - URL `http://www.oasis-open.org/html/a502.htm' - URL `http://www.oreilly.com/catalog/docbook/chapter/book/table.html#AEN114751' + URL `https://www.oasis-open.org/html/a502.htm' + URL `https://www.oreilly.com/catalog/docbook/chapter/book/table.html#AEN114751' \(fn LANGUAGE &optional DEST-BUFFER CAPTION)" t nil) @@ -32320,12 +32332,12 @@ Connect to the Emacs talk group from the current X display or tty frame." t nil) (autoload 'tar-mode "tar-mode" "\ Major mode for viewing a tar file as a dired-like listing of its contents. You can move around using the usual cursor motion commands. -Letters no longer insert themselves. -Type `e' to pull a file out of the tar file and into its own buffer; +Letters no longer insert themselves.\\ +Type \\[tar-extract] to pull a file out of the tar file and into its own buffer; or click mouse-2 on the file's line in the Tar mode buffer. -Type `c' to copy an entry from the tar file into another file on disk. +Type \\[tar-copy] to copy an entry from the tar file into another file on disk. -If you edit a sub-file of this archive (as with the `e' command) and +If you edit a sub-file of this archive (as with the \\[tar-extract] command) and save it with \\[save-buffer], the contents of that buffer will be saved back into the tar-file buffer; in this way you can edit a file inside of a tar archive without extracting it and re-archiving it. @@ -32679,11 +32691,11 @@ says which mode to use. \(fn)" t nil) -(defalias 'TeX-mode 'tex-mode) +(defalias 'TeX-mode #'tex-mode) -(defalias 'plain-TeX-mode 'plain-tex-mode) +(defalias 'plain-TeX-mode #'plain-tex-mode) -(defalias 'LaTeX-mode 'latex-mode) +(defalias 'LaTeX-mode #'latex-mode) (autoload 'plain-tex-mode "tex-mode" "\ Major mode for editing files of input for plain TeX. @@ -33339,7 +33351,11 @@ point. \(fn &optional FORMAT HERE)" t nil) (autoload 'emacs-init-time "time" "\ -Return a string giving the duration of the Emacs initialization." t nil) +Return a string giving the duration of the Emacs initialization. +FORMAT is a string to format the result, using `format'. If nil, +the default format \"%f seconds\" is used. + +\(fn &optional FORMAT)" t nil) (register-definition-prefixes "time" '("display-time-" "legacy-style-world-list" "time--display-world-list" "world-clock-" "zoneinfo-style-world-list")) @@ -34023,6 +34039,13 @@ Add archive file name handler to `file-name-handler-alist'." (when tramp-archive (register-definition-prefixes "tramp-ftp" '("tramp-")) +;;;*** + +;;;### (autoloads nil "tramp-fuse" "net/tramp-fuse.el" (0 0 0 0)) +;;; Generated autoloads from net/tramp-fuse.el + +(register-definition-prefixes "tramp-fuse" '("tramp-fuse-")) + ;;;*** ;;;### (autoloads nil "tramp-gvfs" "net/tramp-gvfs.el" (0 0 0 0)) @@ -34060,6 +34083,13 @@ Add archive file name handler to `file-name-handler-alist'." (when tramp-archive (register-definition-prefixes "tramp-smb" '("tramp-smb-")) +;;;*** + +;;;### (autoloads nil "tramp-sshfs" "net/tramp-sshfs.el" (0 0 0 0)) +;;; Generated autoloads from net/tramp-sshfs.el + +(register-definition-prefixes "tramp-sshfs" '("tramp-sshfs-")) + ;;;*** ;;;### (autoloads nil "tramp-sudoedit" "net/tramp-sudoedit.el" (0 @@ -34134,8 +34164,8 @@ resumed later. ;;;;;; 0 0)) ;;; Generated autoloads from textmodes/two-column.el (autoload '2C-command "two-column" () t 'keymap) - (global-set-key "\C-x6" '2C-command) - (global-set-key [f2] '2C-command) + (global-set-key "\C-x6" #'2C-command) + (global-set-key [f2] #'2C-command) (autoload '2C-two-columns "two-column" "\ Split current window vertically for two-column editing. @@ -35240,7 +35270,12 @@ The buffer in question is current when this function is called. \(fn FILENAME)" nil nil) -(register-definition-prefixes "userlock" '("ask-user-about-" "file-" "userlock--check-content-unchanged")) +(autoload 'userlock--handle-unlock-error "userlock" "\ +Report an ERROR that occurred while unlocking a file. + +\(fn ERROR)" nil nil) + +(register-definition-prefixes "userlock" '("ask-user-about-" "file-" "userlock--")) ;;;*** @@ -36027,7 +36062,7 @@ Key bindings: ;;;### (autoloads nil "verilog-mode" "progmodes/verilog-mode.el" ;;;;;; (0 0 0 0)) ;;; Generated autoloads from progmodes/verilog-mode.el -(push (purecopy '(verilog-mode 2021 2 2 263931197)) package--builtin-versions) +(push (purecopy '(verilog-mode 2021 3 30 243771231)) package--builtin-versions) (autoload 'verilog-mode "verilog-mode" "\ Major mode for editing Verilog code. @@ -36782,7 +36817,7 @@ Don't change this variable directly, you must change it by one of the functions that enable or disable view mode.") (autoload 'kill-buffer-if-not-modified "view" "\ -Like `kill-buffer', but does nothing if the buffer is modified. +Like `kill-buffer', but does nothing if buffer BUF is modified. \(fn BUF)" nil nil) @@ -36848,7 +36883,7 @@ file: Users may suspend viewing in order to modify the buffer. Exiting View mode will then discard the user's edits. Setting EXIT-ACTION to `kill-buffer-if-not-modified' avoids this. -This function does not enable View mode if the buffer's major-mode +This function does not enable View mode if the buffer's major mode has a `special' mode-class, because such modes usually have their own View-like bindings. @@ -36870,7 +36905,7 @@ Optional argument EXIT-ACTION is either nil or a function with buffer as argument. This function is called when finished viewing buffer. Use this argument instead of explicitly setting `view-exit-action'. -This function does not enable View mode if the buffer's major-mode +This function does not enable View mode if the buffer's major mode has a `special' mode-class, because such modes usually have their own View-like bindings. @@ -36892,7 +36927,7 @@ Optional argument EXIT-ACTION is either nil or a function with buffer as argument. This function is called when finished viewing buffer. Use this argument instead of explicitly setting `view-exit-action'. -This function does not enable View mode if the buffer's major-mode +This function does not enable View mode if the buffer's major mode has a `special' mode-class, because such modes usually have their own View-like bindings. @@ -38341,15 +38376,15 @@ Zone out, completely." t nil) ;;;;;; "cedet/semantic/db-typecache.el" "cedet/semantic/db.el" "cedet/semantic/debug.el" ;;;;;; "cedet/semantic/decorate/include.el" "cedet/semantic/decorate/mode.el" ;;;;;; "cedet/semantic/dep.el" "cedet/semantic/doc.el" "cedet/semantic/edit.el" -;;;;;; "cedet/semantic/find.el" "cedet/semantic/format.el" "cedet/semantic/html.el" -;;;;;; "cedet/semantic/ia-sb.el" "cedet/semantic/ia.el" "cedet/semantic/idle.el" -;;;;;; "cedet/semantic/imenu.el" "cedet/semantic/lex-spp.el" "cedet/semantic/lex.el" -;;;;;; "cedet/semantic/mru-bookmark.el" "cedet/semantic/scope.el" -;;;;;; "cedet/semantic/senator.el" "cedet/semantic/sort.el" "cedet/semantic/symref.el" -;;;;;; "cedet/semantic/symref/cscope.el" "cedet/semantic/symref/global.el" -;;;;;; "cedet/semantic/symref/grep.el" "cedet/semantic/symref/idutils.el" -;;;;;; "cedet/semantic/symref/list.el" "cedet/semantic/tag-file.el" -;;;;;; "cedet/semantic/tag-ls.el" "cedet/semantic/tag-write.el" +;;;;;; "cedet/semantic/find.el" "cedet/semantic/format.el" "cedet/semantic/grammar-wy.el" +;;;;;; "cedet/semantic/html.el" "cedet/semantic/ia-sb.el" "cedet/semantic/ia.el" +;;;;;; "cedet/semantic/idle.el" "cedet/semantic/imenu.el" "cedet/semantic/lex-spp.el" +;;;;;; "cedet/semantic/lex.el" "cedet/semantic/mru-bookmark.el" +;;;;;; "cedet/semantic/scope.el" "cedet/semantic/senator.el" "cedet/semantic/sort.el" +;;;;;; "cedet/semantic/symref.el" "cedet/semantic/symref/cscope.el" +;;;;;; "cedet/semantic/symref/global.el" "cedet/semantic/symref/grep.el" +;;;;;; "cedet/semantic/symref/idutils.el" "cedet/semantic/symref/list.el" +;;;;;; "cedet/semantic/tag-file.el" "cedet/semantic/tag-ls.el" "cedet/semantic/tag-write.el" ;;;;;; "cedet/semantic/tag.el" "cedet/semantic/texi.el" "cedet/semantic/util-modes.el" ;;;;;; "cedet/semantic/wisent/java-tags.el" "cedet/semantic/wisent/javascript.el" ;;;;;; "cedet/semantic/wisent/javat-wy.el" "cedet/semantic/wisent/js-wy.el" @@ -38381,7 +38416,7 @@ Zone out, completely." t nil) ;;;;;; "eshell/em-ls.el" "eshell/em-pred.el" "eshell/em-prompt.el" ;;;;;; "eshell/em-rebind.el" "eshell/em-script.el" "eshell/em-smart.el" ;;;;;; "eshell/em-term.el" "eshell/em-tramp.el" "eshell/em-unix.el" -;;;;;; "eshell/em-xtra.el" "facemenu.el" "faces.el" "files.el" "font-core.el" +;;;;;; "eshell/em-xtra.el" "faces.el" "files.el" "font-core.el" ;;;;;; "font-lock.el" "format.el" "frame.el" "help.el" "hfy-cmap.el" ;;;;;; "ibuf-ext.el" "indent.el" "international/characters.el" "international/charprop.el" ;;;;;; "international/charscript.el" "international/cp51932.el" From 8129998deb54c3621dd715c79694725c74630e67 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 1 Apr 2021 15:23:01 +0200 Subject: [PATCH 16/75] Remove redundant #' before lambda in international/*.el * lisp/international/characters.el: (use-cjk-char-width-table, update-glyphless-char-display): * lisp/international/fontset.el (build-default-fontset-data) (generate-fontset-menu): * lisp/international/latin1-disp.el (latin1-display-reset): * lisp/international/mule-cmds.el (select-safe-coding-system-interactively): * lisp/international/mule-diag.el (sort-listed-character-sets) (font-show-log): * lisp/international/mule.el (char-displayable-p): * lisp/international/quail.el (quail-keyboard-layout-type) (quail-update-translation, quail-find-key): * lisp/international/titdic-cnv.el (tsang-quick-converter) (ziranma-converter): Remove redundant #' before lambda. --- lisp/international/characters.el | 60 +++++++++++++++---------------- lisp/international/fontset.el | 48 ++++++++++++------------- lisp/international/latin1-disp.el | 4 +-- lisp/international/mule-cmds.el | 48 ++++++++++++------------- lisp/international/mule-diag.el | 16 ++++----- lisp/international/mule.el | 26 +++++++------- lisp/international/quail.el | 32 ++++++++--------- lisp/international/titdic-cnv.el | 26 +++++++------- 8 files changed, 130 insertions(+), 130 deletions(-) diff --git a/lisp/international/characters.el b/lisp/international/characters.el index c643f66cbb0..97bf31acfc3 100644 --- a/lisp/international/characters.el +++ b/lisp/international/characters.el @@ -484,9 +484,9 @@ with L, LRE, or LRO Unicode bidi character type.") (progn (modify-syntax-entry chars syntax) (modify-category-entry chars category)) - (mapc #'(lambda (x) - (modify-syntax-entry x syntax) - (modify-category-entry x category)) + (mapc (lambda (x) + (modify-syntax-entry x syntax) + (modify-category-entry x category)) chars))))) ;; Bidi categories @@ -1390,8 +1390,8 @@ with L, LRE, or LRO Unicode bidi character type.") (dolist (charset-info (nthcdr 2 slot)) (let ((charset (car charset-info))) (dolist (code-range (cdr charset-info)) - (map-charset-chars #'(lambda (range _arg) - (set-char-table-range table range 2)) + (map-charset-chars (lambda (range _arg) + (set-char-table-range table range 2)) charset nil (car code-range) (cdr code-range))))) (optimize-char-table table) @@ -1417,8 +1417,8 @@ Setup char-width-table appropriate for non-CJK language environment." (require 'charscript)) (map-charset-chars - #'(lambda (range _ignore) - (set-char-table-range char-script-table range 'tibetan)) + (lambda (range _ignore) + (set-char-table-range char-script-table range 'tibetan)) 'tibetan) @@ -1426,14 +1426,14 @@ Setup char-width-table appropriate for non-CJK language environment." (when (setq unicode-category-table (unicode-property-table-internal 'general-category)) - (map-char-table #'(lambda (key val) - (if val - (cond ((or (and (/= (aref (symbol-name val) 0) ?M) - (/= (aref (symbol-name val) 0) ?C)) - (eq val 'Zs)) - (modify-category-entry key ?.)) - ((eq val 'Mn) - (modify-category-entry key ?^))))) + (map-char-table (lambda (key val) + (if val + (cond ((or (and (/= (aref (symbol-name val) 0) ?M) + (/= (aref (symbol-name val) 0) ?C)) + (eq val 'Zs)) + (modify-category-entry key ?.)) + ((eq val 'Mn) + (modify-category-entry key ?^))))) unicode-category-table)) (optimize-char-table (standard-category-table)) @@ -1524,21 +1524,21 @@ option `glyphless-char-display'." ((eq target 'format-control) (when unicode-category-table (map-char-table - #'(lambda (char category) - (if (eq category 'Cf) - (let ((this-method method) - from to) - (if (consp char) - (setq from (car char) to (cdr char)) - (setq from char to char)) - (while (<= from to) - (when (/= from #xAD) - (if (eq method 'acronym) - (setq this-method - (aref char-acronym-table from))) - (set-char-table-range glyphless-char-display - from this-method)) - (setq from (1+ from)))))) + (lambda (char category) + (if (eq category 'Cf) + (let ((this-method method) + from to) + (if (consp char) + (setq from (car char) to (cdr char)) + (setq from char to char)) + (while (<= from to) + (when (/= from #xAD) + (if (eq method 'acronym) + (setq this-method + (aref char-acronym-table from))) + (set-char-table-range glyphless-char-display + from this-method)) + (setq from (1+ from)))))) unicode-category-table))) ((eq target 'no-font) (set-char-table-extra-slot glyphless-char-display 0 method)) diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index 8f0f263dcce..3deaff96774 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -497,37 +497,37 @@ (:registry "iso10646-1")))) (cjk-table (make-char-table nil)) (script-coverage - #'(lambda (script) - (let ((coverage)) - (map-char-table - #'(lambda (range val) - (when (eq val script) - (if (consp range) - (setq range (cons (car range) (cdr range)))) - (push range coverage))) - char-script-table) - coverage))) + (lambda (script) + (let ((coverage)) + (map-char-table + (lambda (range val) + (when (eq val script) + (if (consp range) + (setq range (cons (car range) (cdr range)))) + (push range coverage))) + char-script-table) + coverage))) (data (list (vconcat (mapcar 'car cjk)))) (i 0)) (dolist (elt cjk) (let ((mask (ash 1 i))) (map-charset-chars - #'(lambda (range _arg) - (let ((from (car range)) (to (cdr range))) - (if (< to #x110000) - (while (<= from to) - (or (memq (aref char-script-table from) - '(kana hangul han cjk-misc)) - (aset cjk-table from - (logior (or (aref cjk-table from) 0) mask))) - (setq from (1+ from)))))) + (lambda (range _arg) + (let ((from (car range)) (to (cdr range))) + (if (< to #x110000) + (while (<= from to) + (or (memq (aref char-script-table from) + '(kana hangul han cjk-misc)) + (aset cjk-table from + (logior (or (aref cjk-table from) 0) mask))) + (setq from (1+ from)))))) (nth 1 elt) nil (nth 2 elt) (nth 3 elt))) (setq i (1+ i))) (map-char-table - #'(lambda (range val) - (if (consp range) - (setq range (cons (car range) (cdr range)))) - (push (cons range val) data)) + (lambda (range val) + (if (consp range) + (setq range (cons (car range) (cdr range)))) + (push (cons range val) data)) cjk-table) (dolist (script scripts) (dolist (range (funcall script-coverage (car script))) @@ -1227,7 +1227,7 @@ Done when `mouse-set-font' is called." (string-match "fontset-auto[0-9]+$" fontset) (push (list (fontset-plain-name fontset) fontset) l))) (cons "Fontset" - (sort l #'(lambda (x y) (string< (car x) (car y))))))) + (sort l (lambda (x y) (string< (car x) (car y))))))) (declare-function query-fontset "fontset.c" (pattern &optional regexpp)) diff --git a/lisp/international/latin1-disp.el b/lisp/international/latin1-disp.el index 4b6ef9833e5..b3d6a635b1c 100644 --- a/lisp/international/latin1-disp.el +++ b/lisp/international/latin1-disp.el @@ -186,8 +186,8 @@ character set." 'arabic-iso8859-6 (car (remq 'ascii (get-language-info language 'charset)))))) - (map-charset-chars #'(lambda (range _arg) - (standard-display-default (car range) (cdr range))) + (map-charset-chars (lambda (range _arg) + (standard-display-default (car range) (cdr range))) charset)) (sit-for 0)) diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index bf0df6f971d..578d97bcc0a 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -679,18 +679,18 @@ DEFAULT is the coding system to use by default in the query." ;; ((CODING (POS . CHAR) (POS . CHAR) ...) ...) (if unsafe (setq unsafe - (mapcar #'(lambda (coding) - (cons coding - (if (stringp from) - (mapcar #'(lambda (pos) - (cons pos (aref from pos))) - (unencodable-char-position - 0 (length from) coding - 11 from)) - (mapcar #'(lambda (pos) - (cons pos (char-after pos))) - (unencodable-char-position - from to coding 11))))) + (mapcar (lambda (coding) + (cons coding + (if (stringp from) + (mapcar (lambda (pos) + (cons pos (aref from pos))) + (unencodable-char-position + 0 (length from) coding + 11 from)) + (mapcar (lambda (pos) + (cons pos (char-after pos))) + (unencodable-char-position + from to coding 11))))) unsafe))) (setq codings (sanitize-coding-system-list codings)) @@ -744,19 +744,19 @@ e.g., for sending an email message.\n ") (insert (format " %s cannot encode these:" (car coding))) (let ((i 0) (func1 - #'(lambda (bufname pos) - (when (buffer-live-p (get-buffer bufname)) - (pop-to-buffer bufname) - (goto-char pos)))) + (lambda (bufname pos) + (when (buffer-live-p (get-buffer bufname)) + (pop-to-buffer bufname) + (goto-char pos)))) (func2 - #'(lambda (bufname pos coding) - (when (buffer-live-p (get-buffer bufname)) - (pop-to-buffer bufname) - (if (< (point) pos) - (goto-char pos) - (forward-char 1) - (search-unencodable-char coding) - (forward-char -1)))))) + (lambda (bufname pos coding) + (when (buffer-live-p (get-buffer bufname)) + (pop-to-buffer bufname) + (if (< (point) pos) + (goto-char pos) + (forward-char 1) + (search-unencodable-char coding) + (forward-char -1)))))) (dolist (elt (cdr coding)) (insert " ") (if (stringp from) diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el index a0063c8dbb6..2d3cd25b4a4 100644 --- a/lisp/international/mule-diag.el +++ b/lisp/international/mule-diag.el @@ -45,8 +45,8 @@ (define-button-type 'sort-listed-character-sets 'help-echo (purecopy "mouse-2, RET: sort on this column") 'face 'bold - 'action #'(lambda (button) - (sort-listed-character-sets (button-get button 'sort-key)))) + 'action (lambda (button) + (sort-listed-character-sets (button-get button 'sort-key)))) (define-button-type 'list-charset-chars :supertype 'help-xref @@ -1172,12 +1172,12 @@ The default is 20. If LIMIT is negative, do not limit the listing." (if (or (vectorp elt) (listp elt)) (let ((i 0)) (catch 'tag - (mapc #'(lambda (x) - (setq i (1+ i)) - (when (= i limit) - (insert " ...\n") - (throw 'tag nil)) - (insert (format " %s\n" x))) + (mapc (lambda (x) + (setq i (1+ i)) + (when (= i limit) + (insert " ...\n") + (throw 'tag nil)) + (insert (format " %s\n" x))) elt))) (insert (format " %s\n" elt))))))) diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 83cbb44c4db..a6fccff3c9a 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -490,27 +490,27 @@ per-character basis, this may not be accurate." (cond ((listp cs-list) (catch 'tag - (mapc #'(lambda (charset) - (if (encode-char char charset) - (throw 'tag charset))) + (mapc (lambda (charset) + (if (encode-char char charset) + (throw 'tag charset))) cs-list) nil)) ((eq cs-list 'iso-2022) (catch 'tag2 - (mapc #'(lambda (charset) - (if (and (plist-get (charset-plist charset) - :iso-final-char) - (encode-char char charset)) - (throw 'tag2 charset))) + (mapc (lambda (charset) + (if (and (plist-get (charset-plist charset) + :iso-final-char) + (encode-char char charset)) + (throw 'tag2 charset))) charset-list) nil)) ((eq cs-list 'emacs-mule) (catch 'tag3 - (mapc #'(lambda (charset) - (if (and (plist-get (charset-plist charset) - :emacs-mule-id) - (encode-char char charset)) - (throw 'tag3 charset))) + (mapc (lambda (charset) + (if (and (plist-get (charset-plist charset) + :emacs-mule-id) + (encode-char char charset)) + (throw 'tag3 charset))) charset-list) nil))))))))))) diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 87a905045d4..fff06deee88 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -728,9 +728,9 @@ Available types are listed in the variable `quail-keyboard-layout-alist'." :type (cons 'choice (mapcar (lambda (elt) (list 'const (car elt))) quail-keyboard-layout-alist)) - :set #'(lambda (symbol value) - (quail-update-keyboard-layout value) - (set symbol value))) + :set (lambda (symbol value) + (quail-update-keyboard-layout value) + (set symbol value))) ;;;###autoload (defun quail-set-keyboard-layout (kbd-type) @@ -1571,12 +1571,12 @@ with more keys." (let (char) (if (stringp quail-current-str) (catch 'tag - (mapc #'(lambda (ch) - (when (/= (unibyte-char-to-multibyte - (multibyte-char-to-unibyte ch)) - ch) - (setq char ch) - (throw 'tag nil))) + (mapc (lambda (ch) + (when (/= (unibyte-char-to-multibyte + (multibyte-char-to-unibyte ch)) + ch) + (setq char ch) + (throw 'tag nil))) quail-current-str)) (if (/= (unibyte-char-to-multibyte (multibyte-char-to-unibyte quail-current-str)) @@ -2827,19 +2827,19 @@ If CHAR is an ASCII character and can be input by typing itself, return t." (key-list nil)) (if (consp decode-map) (let ((str (string char))) - (mapc #'(lambda (elt) - (if (string= str (car elt)) - (setq key-list (cons (cdr elt) key-list)))) + (mapc (lambda (elt) + (if (string= str (car elt)) + (setq key-list (cons (cdr elt) key-list)))) (cdr decode-map))) (let ((key-head (aref decode-map char))) (if (stringp key-head) (setq key-list (quail-find-key1 (quail-lookup-key key-head nil t) key-head char nil)) - (mapc #'(lambda (elt) - (setq key-list - (quail-find-key1 - (quail-lookup-key elt nil t) elt char key-list))) + (mapc (lambda (elt) + (setq key-list + (quail-find-key1 + (quail-lookup-key elt nil t) elt char key-list))) key-head)))) (or key-list (and (< char 128) diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el index 64d66443760..ccb4c8390bb 100644 --- a/lisp/international/titdic-cnv.el +++ b/lisp/international/titdic-cnv.el @@ -781,7 +781,7 @@ To get complete usage, invoke \"emacs -batch -f batch-titdic-convert -h\"." (if val (setq trans (concat val trans))) (puthash key trans table) (forward-line 1))) - (maphash #'(lambda (key val) (setq dic (cons (cons key val) dic))) + (maphash (lambda (key val) (setq dic (cons (cons key val) dic))) table))) (setq dic (sort dic (lambda (x y) (string< (car x ) (car y))))) (dolist (elt dic) @@ -931,18 +931,18 @@ method `chinese-tonepy' with which you must specify tones by digits (if val (setq trans (vconcat val trans))) (puthash key trans table) (forward-line 1)) - (maphash #'(lambda (key trans) - (let ((len (length trans)) - i) - (if (and (= len 1) (= (length (aref trans 0)) 1)) - (setq trans (aref trans 0)) - (setq i 0) - (while (and (< i len) - (= (length (aref trans i)) 1)) - (setq i (1+ i))) - (if (= i len) - (setq trans (mapconcat #'identity trans ""))))) - (setq dic (cons (cons key trans) dic))) + (maphash (lambda (key trans) + (let ((len (length trans)) + i) + (if (and (= len 1) (= (length (aref trans 0)) 1)) + (setq trans (aref trans 0)) + (setq i 0) + (while (and (< i len) + (= (length (aref trans i)) 1)) + (setq i (1+ i))) + (if (= i len) + (setq trans (mapconcat #'identity trans ""))))) + (setq dic (cons (cons key trans) dic))) table))) (setq dic (sort dic (lambda (x y) (string< (car x) (car y))))) (goto-char (point-max)) From 4a538c4861370d629920b66a7cdcbb78ecb13830 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 1 Apr 2021 16:24:12 +0200 Subject: [PATCH 17/75] Remove redundant #' before lambda in progmodes/*.el * lisp/progmodes/cc-styles.el (c-set-offset): * lisp/progmodes/ebnf-yac.el (ebnf-yac-token-table): * lisp/progmodes/ebnf2ps.el (ebnf-format-float, ebnf-map-name): * lisp/progmodes/grep.el (lgrep, rgrep-default-command): * lisp/progmodes/inf-lisp.el: * lisp/progmodes/octave.el (octave-lookfor): * lisp/progmodes/python.el (python-pdbtrack-tracking-finish): Remove redundant #' before lambda. --- lisp/progmodes/cc-styles.el | 4 ++-- lisp/progmodes/ebnf-yac.el | 8 ++++---- lisp/progmodes/ebnf2ps.el | 8 ++++---- lisp/progmodes/grep.el | 28 ++++++++++++++-------------- lisp/progmodes/inf-lisp.el | 2 +- lisp/progmodes/octave.el | 4 ++-- lisp/progmodes/python.el | 8 ++++---- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index aec259f1b38..29cbe54c3bd 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el @@ -476,8 +476,8 @@ and exists only for compatibility reasons." (if current-prefix-arg " or add" "") ": ") (mapcar - #'(lambda (langelem) - (cons (format "%s" (car langelem)) nil)) + (lambda (langelem) + (cons (format "%s" (car langelem)) nil)) (get 'c-offsets-alist 'c-stylevar-fallback)) nil (not current-prefix-arg) ;; initial contents tries to be the last element diff --git a/lisp/progmodes/ebnf-yac.el b/lisp/progmodes/ebnf-yac.el index 5abf1debb15..816cc432d1b 100644 --- a/lisp/progmodes/ebnf-yac.el +++ b/lisp/progmodes/ebnf-yac.el @@ -271,13 +271,13 @@ (let ((table (make-vector 256 'error))) ;; upper & lower case letters: (mapc - #'(lambda (char) - (aset table char 'non-terminal)) + (lambda (char) + (aset table char 'non-terminal)) "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") ;; printable characters: (mapc - #'(lambda (char) - (aset table char 'character)) + (lambda (char) + (aset table char 'character)) "!#$&()*+-.0123456789=?@[\\]^_`~") ;; Override space characters: (aset table ?\n 'space) ; [NL] linefeed diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el index 7092d2c1d1f..a00440d898c 100644 --- a/lisp/progmodes/ebnf2ps.el +++ b/lisp/progmodes/ebnf2ps.el @@ -4398,8 +4398,8 @@ end (defun ebnf-format-float (&rest floats) (mapconcat - #'(lambda (float) - (format ebnf-format-float float)) + (lambda (float) + (format ebnf-format-float float)) floats " ")) @@ -4959,8 +4959,8 @@ killed after process termination." (defvar ebnf-map-name (let ((map (make-vector 256 ?\_))) - (mapc #'(lambda (char) - (aset map char char)) + (mapc (lambda (char) + (aset map char char)) (concat "#$%&+-.0123456789=?@~" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz")) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 8c9a1b53b1b..e9fbcbbfcd0 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -1134,13 +1134,13 @@ command before it's run." (and grep-find-ignored-files (concat " --exclude=" (mapconcat - #'(lambda (ignore) - (cond ((stringp ignore) - (shell-quote-argument ignore)) - ((consp ignore) - (and (funcall (car ignore) dir) - (shell-quote-argument - (cdr ignore)))))) + (lambda (ignore) + (cond ((stringp ignore) + (shell-quote-argument ignore)) + ((consp ignore) + (and (funcall (car ignore) dir) + (shell-quote-argument + (cdr ignore)))))) grep-find-ignored-files " --exclude="))) (and (eq grep-use-directories-skip t) @@ -1274,13 +1274,13 @@ command before it's run." ;; we should use shell-quote-argument here " -name " (mapconcat - #'(lambda (ignore) - (cond ((stringp ignore) - (shell-quote-argument ignore)) - ((consp ignore) - (and (funcall (car ignore) dir) - (shell-quote-argument - (cdr ignore)))))) + (lambda (ignore) + (cond ((stringp ignore) + (shell-quote-argument ignore)) + ((consp ignore) + (and (funcall (car ignore) dir) + (shell-quote-argument + (cdr ignore)))))) grep-find-ignored-files " -o -name ") " " diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el index 1ee54673d74..0a72ae96bba 100644 --- a/lisp/progmodes/inf-lisp.el +++ b/lisp/progmodes/inf-lisp.el @@ -442,7 +442,7 @@ With argument, positions cursor at end of buffer." ;;; (let ((name-start (point))) ;;; (forward-sexp 1) ;;; (process-send-string "inferior-lisp" -;;; (format "(compile '%s #'(lambda " +;;; (format "(compile '%s (lambda " ;;; (buffer-substring name-start ;;; (point))))) ;;; (let ((body-start (point))) diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 196f2de3440..a1a5192ee1f 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -1769,8 +1769,8 @@ sentence." (insert "\nRetry with ") (insert-text-button "'-all'" 'follow-link t - 'action #'(lambda (_b) - (octave-lookfor str '-all))) + 'action (lambda (_b) + (octave-lookfor str '-all))) (insert ".\n")) (octave-help-mode))))) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index afb96974b17..e5c15d148f8 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -241,8 +241,8 @@ ;; 2) Add the following hook in your .emacs: ;; (add-hook 'python-mode-hook -;; #'(lambda () -;; (define-key python-mode-map "\C-m" 'newline-and-indent))) +;; (lambda () +;; (define-key python-mode-map "\C-m" 'newline-and-indent))) ;; I'd recommend the first one since you'll get the same behavior for ;; all modes out-of-the-box. @@ -3976,8 +3976,8 @@ Returns the tracked buffer." "Finish tracking." (python-pdbtrack-unset-tracked-buffer) (when python-pdbtrack-kill-buffers - (mapc #'(lambda (buffer) - (ignore-errors (kill-buffer buffer))) + (mapc (lambda (buffer) + (ignore-errors (kill-buffer buffer))) python-pdbtrack-buffers-to-kill)) (setq python-pdbtrack-buffers-to-kill nil)) From 33f00364cf86d90c37b958ee4676ea7f581fff99 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 1 Apr 2021 19:55:32 +0200 Subject: [PATCH 18/75] Use lexical-binding in executable.el and add tests * lisp/progmodes/executable.el: Use lexical-binding. * test/lisp/progmodes/executable-tests.el: New file. --- lisp/progmodes/executable.el | 2 +- test/lisp/progmodes/executable-tests.el | 54 +++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 test/lisp/progmodes/executable-tests.el diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el index 85e9b4bb882..0d8b09c33c1 100644 --- a/lisp/progmodes/executable.el +++ b/lisp/progmodes/executable.el @@ -1,4 +1,4 @@ -;;; executable.el --- base functionality for executable interpreter scripts +;;; executable.el --- base functionality for executable interpreter scripts -*- lexical-binding: t -*- ;; Copyright (C) 1994-1996, 2000-2021 Free Software Foundation, Inc. diff --git a/test/lisp/progmodes/executable-tests.el b/test/lisp/progmodes/executable-tests.el new file mode 100644 index 00000000000..e3531912014 --- /dev/null +++ b/test/lisp/progmodes/executable-tests.el @@ -0,0 +1,54 @@ +;;; executable-tests.el --- Tests for executable.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: + +;; This file is part of ERT, the Emacs Lisp Regression Testing tool. +;; See ert.el or the texinfo manual for more details. + +;;; Code: + +(require 'ert) +(require 'executable) + +(ert-deftest executable-tests-set-magic () + (with-temp-buffer + (insert "#!/foo/bar") + (executable-set-magic "/bin/bash" nil t t) + (should (equal (buffer-string) "#!/bin/bash")))) + +(ert-deftest executable-tests-set-magic/with-argument () + (with-temp-buffer + (insert "#!/foo/bar") + (executable-set-magic "/bin/bash" "--norc" t t) + (should (equal (buffer-string) "#!/bin/bash --norc")))) + +(ert-deftest executable-tests-set-magic/executable-insert-nil () + (let ((executable-insert nil)) + (with-temp-buffer + (insert "#!/foo/bar") + (executable-set-magic "/bin/bash" nil t nil) + (should (equal (buffer-string) "#!/foo/bar")))) + (let ((executable-insert nil)) + (with-temp-buffer + (insert "#!/foo/bar") + (executable-set-magic "/bin/bash" nil t t) + (should (equal (buffer-string) "#!/bin/bash"))))) + +;;; executable-tests.el ends here From a5125f98b8e977abfcef74ddd7720ccb63328560 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 1 Apr 2021 19:57:05 +0200 Subject: [PATCH 19/75] ; Remove spurious comment in last commit --- test/lisp/progmodes/executable-tests.el | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/lisp/progmodes/executable-tests.el b/test/lisp/progmodes/executable-tests.el index e3531912014..4f0fa699f72 100644 --- a/test/lisp/progmodes/executable-tests.el +++ b/test/lisp/progmodes/executable-tests.el @@ -19,9 +19,6 @@ ;;; Commentary: -;; This file is part of ERT, the Emacs Lisp Regression Testing tool. -;; See ert.el or the texinfo manual for more details. - ;;; Code: (require 'ert) From e5b8d071e0066a2bab28744f21d58ac422793381 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 1 Apr 2021 22:04:21 +0200 Subject: [PATCH 20/75] Remove redundant #' before lambda in {mail,net,url}/*.el * lisp/mail/mail-extr.el: * lisp/mail/rmail.el (rmail-start-mail): * lisp/net/gnutls.el (gnutls-boot-parameters): * lisp/net/imap.el (imap-starttls-open): * lisp/net/pop3.el (pop3-list): * lisp/url/url-cookie.el (url-cookie-save-interval): * lisp/url/url-history.el (url-history-save-interval) (url-history-track): * lisp/url/url-mailto.el (url-mailto): Remove redundant #' before lambda. --- lisp/mail/mail-extr.el | 4 ++-- lisp/mail/rmail.el | 6 +++--- lisp/net/gnutls.el | 4 ++-- lisp/net/imap.el | 6 +++--- lisp/net/pop3.el | 6 +++--- lisp/url/url-cookie.el | 8 ++++---- lisp/url/url-history.el | 16 ++++++++-------- lisp/url/url-mailto.el | 4 ++-- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lisp/mail/mail-extr.el b/lisp/mail/mail-extr.el index 7fbdfefc461..88fb0866856 100644 --- a/lisp/mail/mail-extr.el +++ b/lisp/mail/mail-extr.el @@ -2236,13 +2236,13 @@ place. It affects how `mail-extract-address-components' works." ;(let ((all nil)) -; (mapatoms #'(lambda (x) +; (mapatoms (lambda (x) ; (if (and (boundp x) ; (string-match "^mail-extr-" (symbol-name x))) ; (setq all (cons x all))))) ; (setq all (sort all #'string-lessp)) ; (cons 'setq -; (apply 'nconc (mapcar #'(lambda (x) +; (apply 'nconc (mapcar (lambda (x) ; (list x (symbol-value x))) ; all)))) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index c7960f85043..455ae7feefc 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -3671,9 +3671,9 @@ If BUFFER is not swapped, yank out of its message viewer buffer." (push (cons "cc" cc) other-headers) (push (cons "in-reply-to" in-reply-to) other-headers) (setq other-headers - (mapcar #'(lambda (elt) - (cons (car elt) (if (stringp (cdr elt)) - (rfc2047-decode-string (cdr elt))))) + (mapcar (lambda (elt) + (cons (car elt) (if (stringp (cdr elt)) + (rfc2047-decode-string (cdr elt))))) other-headers)) (if (stringp to) (setq to (rfc2047-decode-string to))) (if (stringp in-reply-to) diff --git a/lisp/net/gnutls.el b/lisp/net/gnutls.el index 683abaaa04a..43dd9dc15cd 100644 --- a/lisp/net/gnutls.el +++ b/lisp/net/gnutls.el @@ -336,8 +336,8 @@ defaults to GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT." t) ;; if a list, look for hostname matches ((listp gnutls-verify-error) - (cadr (cl-find-if #'(lambda (x) - (string-match (car x) hostname)) + (cadr (cl-find-if (lambda (x) + (string-match (car x) hostname)) gnutls-verify-error))) ;; else it's nil (t nil)))) diff --git a/lisp/net/imap.el b/lisp/net/imap.el index 052ef292957..d29584e55bd 100644 --- a/lisp/net/imap.el +++ b/lisp/net/imap.el @@ -737,9 +737,9 @@ sure of changing the value of `foo'." :end-of-command "\r\n" :success "^1 OK " :starttls-function - #'(lambda (capabilities) - (when (string-match-p "STARTTLS" capabilities) - "1 STARTTLS\r\n")))) + (lambda (capabilities) + (when (string-match-p "STARTTLS" capabilities) + "1 STARTTLS\r\n")))) done) (when process (imap-log buffer) diff --git a/lisp/net/pop3.el b/lisp/net/pop3.el index dcac36f2a4a..cb49f75c81d 100644 --- a/lisp/net/pop3.el +++ b/lisp/net/pop3.el @@ -725,9 +725,9 @@ Otherwise, return the size of the message-id MSG." (setq pop3-read-point (point-marker)) (goto-char (match-beginning 0)) (setq end (point-marker)) - (mapcar #'(lambda (s) (let ((split (split-string s " "))) - (cons (string-to-number (nth 0 split)) - (string-to-number (nth 1 split))))) + (mapcar (lambda (s) (let ((split (split-string s " "))) + (cons (string-to-number (nth 0 split)) + (string-to-number (nth 1 split))))) (split-string (buffer-substring start end) "\r\n" t))))))) (defun pop3-retr (process msg crashbuf) diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el index 27f4f88cb89..60388df2554 100644 --- a/lisp/url/url-cookie.el +++ b/lisp/url/url-cookie.el @@ -358,10 +358,10 @@ i.e. 1970-1-1) are loaded as expiring one year from now instead." Default is 1 hour. Note that if you change this variable outside of the `customize' interface after `url-do-setup' has been run, you need to run the `url-cookie-setup-save-timer' function manually." - :set #'(lambda (var val) - (set-default var val) - (if (bound-and-true-p url-setup-done) - (url-cookie-setup-save-timer))) + :set (lambda (var val) + (set-default var val) + (if (bound-and-true-p url-setup-done) + (url-cookie-setup-save-timer))) :type 'integer :group 'url-cookie) diff --git a/lisp/url/url-history.el b/lisp/url/url-history.el index 10238a46607..5dd1f099136 100644 --- a/lisp/url/url-history.el +++ b/lisp/url/url-history.el @@ -38,10 +38,10 @@ If non-nil, the URL package will keep track of all the URLs visited. If set to t, then the list is saved to disk at the end of each Emacs session." - :set #'(lambda (var val) - (set-default var val) - (and (bound-and-true-p url-setup-done) - (url-history-setup-save-timer))) + :set (lambda (var val) + (set-default var val) + (and (bound-and-true-p url-setup-done) + (url-history-setup-save-timer))) :type '(choice (const :tag "off" nil) (const :tag "on" t) (other :tag "within session" session)) @@ -59,10 +59,10 @@ is parsed at startup and used to provide URL completion." Default is 1 hour. Note that if you change this variable outside of the `customize' interface after `url-do-setup' has been run, you need to run the `url-history-setup-save-timer' function manually." - :set #'(lambda (var val) - (set-default var val) - (if (bound-and-true-p url-setup-done) - (url-history-setup-save-timer))) + :set (lambda (var val) + (set-default var val) + (if (bound-and-true-p url-setup-done) + (url-history-setup-save-timer))) :type 'integer :group 'url-history) diff --git a/lisp/url/url-mailto.el b/lisp/url/url-mailto.el index 72884c07cc9..c6901d99200 100644 --- a/lisp/url/url-mailto.el +++ b/lisp/url/url-mailto.el @@ -104,8 +104,8 @@ (or (search-forward (concat "\n" mail-header-separator "\n") nil t) (goto-char (point-max))) (insert (mapconcat - #'(lambda (string) - (replace-regexp-in-string "\r\n" "\n" string)) + (lambda (string) + (replace-regexp-in-string "\r\n" "\n" string)) (cdar args) "\n"))) (url-mail-goto-field (caar args)) ;; (setq func (intern-soft (concat "mail-" (caar args)))) From cf1ac9d830ed03b3b0ce3a88988c81ffa34de13f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 1 Apr 2021 17:23:55 -0400 Subject: [PATCH 21/75] * lisp/progmodes/dcl-mode.el: Clarify what is meant by DCL --- lisp/progmodes/dcl-mode.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/dcl-mode.el b/lisp/progmodes/dcl-mode.el index 7107ae6ea19..ed024f24344 100644 --- a/lisp/progmodes/dcl-mode.el +++ b/lisp/progmodes/dcl-mode.el @@ -23,9 +23,11 @@ ;;; Commentary: -;; DCL mode is a package for editing DCL command files. It helps you -;; indent lines, add leading `$' and trailing `-', move around in the -;; code and insert lexical functions. +;; DCL mode is a package for editing +;; [DCL](https://en.wikipedia.org/wiki/DIGITAL_Command_Language) +;; command files. +;; It helps you indent lines, add leading `$' and trailing `-', move +;; around in the code and insert lexical functions. ;; ;; Type `C-h m' when you are editing a .COM file to get more ;; information about this mode. From 0c8ea6be09d4f88ec345c0d55d8edb672cdfd653 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 1 Apr 2021 18:16:52 -0400 Subject: [PATCH 22/75] * lisp/progmodes/cfengine.el: Use lexical-binding --- lisp/progmodes/cfengine.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el index 472788d18e5..4649e506541 100644 --- a/lisp/progmodes/cfengine.el +++ b/lisp/progmodes/cfengine.el @@ -1,4 +1,4 @@ -;;; cfengine.el --- mode for editing Cfengine files +;;; cfengine.el --- mode for editing Cfengine files -*- lexical-binding: t; -*- ;; Copyright (C) 2001-2021 Free Software Foundation, Inc. @@ -1440,7 +1440,7 @@ to the action header." (cfengine3-mode) (cfengine2-mode))) -(defalias 'cfengine-mode 'cfengine3-mode) +(defalias 'cfengine-mode #'cfengine3-mode) (provide 'cfengine3) (provide 'cfengine) From 4798dc0c51381f36cd45160640c4f55a7792750b Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Fri, 2 Apr 2021 01:24:57 +0300 Subject: [PATCH 23/75] Fix C-u project-find-regexp's default dir * lisp/progmodes/project.el (project-find-regexp): Default read-directory-name to the current default-directory when called with C-u (bug#47012). --- lisp/progmodes/project.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 4101962f06a..3dd11118ea1 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -732,13 +732,14 @@ requires quoting, e.g. `\\[quoted-insert]'." (interactive (list (project--read-regexp))) (require 'xref) (require 'grep) - (let* ((pr (project-current t)) + (let* ((caller-dir default-directory) + (pr (project-current t)) (default-directory (project-root pr)) (files (if (not current-prefix-arg) (project-files pr) (let ((dir (read-directory-name "Base directory: " - nil default-directory t))) + caller-dir nil t))) (project--files-in-directory dir nil (grep-read-files regexp)))))) From a789d8a3a08879521b8630e7131cea039520e3de Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 2 Apr 2021 11:25:05 +0300 Subject: [PATCH 24/75] * lisp/progmodes/xref.el: Change xref-file-name-display and xref-match face. * lisp/progmodes/xref.el (xref-file-name-display): Change the default value to 'project-relative' (bug#47012). (xref-match): Inherit from 'match'. --- lisp/progmodes/xref.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index ea52befec57..cada1f11092 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -103,7 +103,7 @@ This is typically the filename.") ;;;; Commonly needed location classes are defined here: -(defcustom xref-file-name-display 'abs +(defcustom xref-file-name-display 'project-relative "Style of file name display in *xref* buffers. If the value is the symbol `abs', the default, show the file names @@ -521,7 +521,7 @@ If SELECT is non-nil, select the target window." "Face for displaying line numbers in the xref buffer." :version "27.1") -(defface xref-match '((t :inherit highlight)) +(defface xref-match '((t :inherit match)) "Face used to highlight matches in the xref buffer." :version "27.1") From dcc3212809d7cbcfe3cb0be291c132c75aedb7af Mon Sep 17 00:00:00 2001 From: Arash Esbati Date: Tue, 30 Mar 2021 19:59:15 +0200 Subject: [PATCH 25/75] Delete XEmacs-only definition * lisp/textmodes/reftex-vars.el (reftex-label-regexps): Remove XEmacs compat code. --- lisp/textmodes/reftex-vars.el | 98 +++++++++++++++++------------------ 1 file changed, 47 insertions(+), 51 deletions(-) diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index a65772da1a4..0d6bfb5d860 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el @@ -888,50 +888,46 @@ DOWNCASE t: Downcase words before using them." (string :tag "")) (option (boolean :tag "Downcase words ")))) -(if (featurep 'xemacs) - ;; XEmacs 21.5 doesn't have explicitly numbered matching groups, - ;; so this list mustn't get any more items. - (defconst reftex-label-regexps '("\\\\label{\\([^}]*\\)}")) - (defcustom reftex-label-regexps - `(;; Normal \\label{foo} labels - "\\\\label{\\(?1:[^}]*\\)}" - ;; keyvals [..., label = {foo}, ...] forms used by ctable, - ;; listings, breqn, ... - ,(concat - ;; Make sure we search only for optional arguments of - ;; environments/macros and don't match any other [. ctable - ;; provides a macro called \ctable, beamer/breqn/listings have - ;; environments. Start with a backslash and a group for names - "\\\\\\(?:" - ;; begin, optional spaces and opening brace - "begin[[:space:]]*{" - ;; Build a regexp for env names - (regexp-opt '("lstlisting" "dmath" "dseries" "dgroup" - "darray" "frame")) - ;; closing brace, optional spaces - "}[[:space:]]*" - ;; Now for macros - "\\|" - ;; Build a regexp for macro names; currently only \ctable - (regexp-opt '("ctable")) - ;; Close the group for names - "\\)" - ;; Match the opening [ and the following chars - "\\[[^][]*" - ;; Allow nested levels of chars enclosed in braces - "\\(?:{[^}{]*" - "\\(?:{[^}{]*" - "\\(?:{[^}{]*}[^}{]*\\)*" - "}[^}{]*\\)*" - "}[^][]*\\)*" - ;; Match the label key - "\\ Date: Fri, 2 Apr 2021 09:40:22 -0400 Subject: [PATCH 26/75] * doc/misc/reftex.texi: Remove outdated instructions (Building and Installing, Installation with make) (Installation by Hand, Loading @RefTeX{}): Delete sections. (Entering @RefTeX{} Mode): Merge into its parent. (AUCTeX): Point to GNU ELPA for installation. (Problems and Work-Arounds): Remove XEmacs-specific item. --- doc/misc/reftex.texi | 85 ++------------------------------------------ 1 file changed, 3 insertions(+), 82 deletions(-) diff --git a/doc/misc/reftex.texi b/doc/misc/reftex.texi index 599252fabf7..f1074d3d143 100644 --- a/doc/misc/reftex.texi +++ b/doc/misc/reftex.texi @@ -254,73 +254,6 @@ version 20.2. It has also been bundled and pre-installed with XEmacs plug-in package which is available from the @value{XEMACSFTP}. See the XEmacs 21.x documentation on package installation for details. -Users of earlier Emacs distributions (including Emacs 19) or people -craving for new features and bugs can get a copy of the @RefTeX{} -distribution from the maintainer's web page. @xref{Imprint}, for more -information. The following instructions will guide you through the -process of installing such a distribution. - -@subsection Building and Installing - -Note: Currently installation is supported for Emacs only. XEmacs users -might want to refer to the @RefTeX{} package available through the -package system of XEmacs. - -@subsubheading Installation with make - -In order to install RefTeX, unpack the distribution and edit the header -of the Makefile. Basically, you need to change the path specifications -for Emacs Lisp files and info files. Also, enter the name of your Emacs -executable (usually either @samp{emacs} or @samp{xemacs}). - -Then, type - -@example -make -make install -@end example - -to compile and install the code and documentation. - -Per default @RefTeX{} is installed in its own subdirectory which might -not be on your load path. In this case, add it to load path with a -command like the following, replacing the sample directory with the one -where @RefTeX{} is installed in your case. - -@example -(add-to-list 'load-path "/path/to/reftex") -@end example - -Put this command into your init file before other @RefTeX{}-related -settings. - -@subsubheading Installation by Hand - -If you want to get your hands dirty, there is also the possibility to -install by manually copying files. - -@enumerate a -@item -Copy the reftex*.el lisp files to a directory on your load path. Make -sure that no old copy of @RefTeX{} shadows these files. -@item -Byte compile the files. The sequence of compiling should be: -reftex-var.el, reftex.el, and then all the others. -@item -Copy the info file reftex.info to the info directory. -@end enumerate - -@subsection Loading @RefTeX{} - -In order to make the most important functions for entering @RefTeX{} -mode available add the following line to your init file. - -@example -(require 'reftex) -@end example - -@subsection Entering @RefTeX{} Mode - @findex turn-on-reftex @findex reftex-mode @vindex LaTeX-mode-hook @@ -3259,9 +3192,9 @@ with the @kbd{g} key. To get this behavior, use instead @AUCTeX{} is without doubt the best major mode for editing @TeX{} and @LaTeX{} files with Emacs (@pxref{Top,AUCTeX,,auctex, The AUCTeX User Manual}). -If @AUCTeX{} is not part of your Emacs distribution, you can get -it@footnote{XEmacs 21.x users may want to install the corresponding -XEmacs package.} by FTP from the @value{AUCTEXSITE}. +You can get it from its home page at @value{AUCTEXSITE}, but since +it is available from GNU ELPA, you can simply install it from @kbd{M-x +list-packages}. @menu * AUCTeX-RefTeX Interface:: How both packages work together @@ -3610,18 +3543,6 @@ as a label of type @code{?p}. Argument count for this macro starts only after the @samp{@{step+@}}, also when specifying how to get context. -@item -@b{Idle timers in XEmacs}@* -@cindex Idle timer restart -@vindex reftex-use-itimer-in-xemacs -In XEmacs, idle timer restart does not work reliably after fast -keystrokes. Therefore @RefTeX{} currently uses the post command -hook to start the timer used for automatic crossref information. When -this bug gets fixed, a real idle timer can be requested with -@lisp -(setq reftex-use-itimer-in-xemacs t) -@end lisp - @item @b{Viper mode}@* @cindex Viper mode From b281d0aefac3592ff60d974648c1cc871c243d80 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 2 Apr 2021 13:22:16 +0200 Subject: [PATCH 27/75] Remove redundant #' before lambda in textmodes/*.el * lisp/textmodes/fill.el: * lisp/textmodes/ispell.el (ispell-find-enchant-dictionaries): * lisp/textmodes/rst.el (rst-re, rst-Ado-position) (rst-Hdr-member-ado, rst-mode-abbrev-table) (rst-preferred-adornments, rst-new-preferred-hdr) (rst-classify-adornment, rst-ttl-at-point, rst-hdr-hierarchy) (rst-all-ttls-with-level, rst-get-previous-hdr) (rst-adjust-region, rst-preferred-bullets, rst-find-begs) (rst-straighten-bullets-region, rst-stn-containing-point) (rst-toc-update, rst-forward-section, rst-shift-region) (rst-enumerate-region, rst-bullet-list-region) (rst-line-block-region, rst-forward-indented-block): Remove redundant #' before lambda. --- lisp/textmodes/fill.el | 12 +- lisp/textmodes/ispell.el | 6 +- lisp/textmodes/rst.el | 332 +++++++++++++++++++-------------------- 3 files changed, 175 insertions(+), 175 deletions(-) diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index cb5027a9763..61514d6761b 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -412,12 +412,12 @@ and `fill-nobreak-invisible'." ;; Register `kinsoku' for scripts HAN, KANA, BOPOMOFO, and CJK-MISC. ;; Also tell that they don't use space between words. (map-char-table - #'(lambda (key val) - (when (memq val '(han kana bopomofo cjk-misc)) - (set-char-table-range fill-find-break-point-function-table - key 'kinsoku) - (set-char-table-range fill-nospace-between-words-table - key t))) + (lambda (key val) + (when (memq val '(han kana bopomofo cjk-misc)) + (set-char-table-range fill-find-break-point-function-table + key 'kinsoku) + (set-char-table-range fill-nospace-between-words-table + key t))) char-script-table) ;; Do the same thing also for full width characters and half ;; width kana variants. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index cee578fc4b8..eb521134dc4 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1207,9 +1207,9 @@ If LANG is omitted, get the extra word characters for the default language." (split-string (ispell--call-enchant-lsmod "-list-dicts") " ([^)]+)\n" t)) (found - (mapcar #'(lambda (lang) - `(,lang "[[:alpha:]]" "[^[:alpha:]]" - ,(ispell--get-extra-word-characters lang) t nil nil utf-8)) + (mapcar (lambda (lang) + `(,lang "[[:alpha:]]" "[^[:alpha:]]" + ,(ispell--get-extra-word-characters lang) t nil nil utf-8)) dictionaries))) ;; Merge into FOUND any elements from the standard ispell-dictionary-base-alist ;; which have no element in FOUND at all. diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index ce156370d57..56cca840047 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -554,30 +554,30 @@ After interpretation of ARGS the results are concatenated as for `:seq'." (apply #'concat (mapcar - #'(lambda (re) - (cond - ((stringp re) - re) - ((symbolp re) - (cadr (assoc re rst-re-alist))) - ((characterp re) - (regexp-quote (char-to-string re))) - ((listp re) - (let ((nested - (mapcar #'rst-re (cdr re)))) - (cond - ((eq (car re) :seq) - (mapconcat #'identity nested "")) - ((eq (car re) :shy) - (concat "\\(?:" (mapconcat #'identity nested "") "\\)")) - ((eq (car re) :grp) - (concat "\\(" (mapconcat #'identity nested "") "\\)")) - ((eq (car re) :alt) - (concat "\\(?:" (mapconcat #'identity nested "\\|") "\\)")) - (t - (error "Unknown list car: %s" (car re)))))) - (t - (error "Unknown object type for building regex: %s" re)))) + (lambda (re) + (cond + ((stringp re) + re) + ((symbolp re) + (cadr (assoc re rst-re-alist))) + ((characterp re) + (regexp-quote (char-to-string re))) + ((listp re) + (let ((nested + (mapcar #'rst-re (cdr re)))) + (cond + ((eq (car re) :seq) + (mapconcat #'identity nested "")) + ((eq (car re) :shy) + (concat "\\(?:" (mapconcat #'identity nested "") "\\)")) + ((eq (car re) :grp) + (concat "\\(" (mapconcat #'identity nested "") "\\)")) + ((eq (car re) :alt) + (concat "\\(?:" (mapconcat #'identity nested "\\|") "\\)")) + (t + (error "Unknown list car: %s" (car re)))))) + (t + (error "Unknown object type for building regex: %s" re)))) args))) ;; FIXME: Remove circular dependency between `rst-re' and `rst-re-alist'. @@ -709,8 +709,8 @@ Return CHAR if so or signal an error otherwise." ;; testcover: ok. "Return position of SELF in ADOS or nil." (cl-check-type self rst-Ado) - (cl-position-if #'(lambda (e) - (rst-Ado-equal self e)) + (cl-position-if (lambda (e) + (rst-Ado-equal self e)) ados)) @@ -814,8 +814,8 @@ Return ADO if so or signal an error otherwise." "Return sublist of HDRS whose car's adornment equals that of SELF or nil." (cl-check-type self rst-Hdr) (let ((ado (rst-Hdr-ado self))) - (cl-member-if #'(lambda (hdr) - (rst-Ado-equal ado (rst-Hdr-ado hdr))) + (cl-member-if (lambda (hdr) + (rst-Ado-equal ado (rst-Hdr-ado hdr))) hdrs))) (defun rst-Hdr-ado-map (selves) @@ -1277,8 +1277,8 @@ This inherits from Text mode.") ;; Abbrevs. (define-abbrev-table 'rst-mode-abbrev-table - (mapcar #'(lambda (x) - (append x '(nil 0 system))) + (mapcar (lambda (x) + (append x '(nil 0 system))) '(("contents" ".. contents::\n..\n ") ("con" ".. contents::\n..\n ") ("cont" "[...]") @@ -1501,9 +1501,9 @@ file." :type `(repeat (group :tag "Adornment specification" (choice :tag "Adornment character" - ,@(mapcar #'(lambda (char) - (list 'const - :tag (char-to-string char) char)) + ,@(mapcar (lambda (char) + (list 'const + :tag (char-to-string char) char)) rst-adornment-chars)) (radio :tag "Adornment type" (const :tag "Overline and underline" over-and-under) @@ -1540,8 +1540,8 @@ search starts after this entry. Return nil if no new preferred ;; Start searching after the level of the previous adornment. (cdr (rst-Hdr-member-ado prev (rst-Hdr-preferred-adornments)))) (rst-Hdr-preferred-adornments)))) - (cl-find-if #'(lambda (cand) - (not (rst-Hdr-member-ado cand seen))) + (cl-find-if (lambda (cand) + (not (rst-Hdr-member-ado cand seen))) candidates))) (defun rst-update-section (hdr) @@ -1620,55 +1620,55 @@ returned." (ttl-blw ; Title found below starting here. (rst-forward-line-looking-at +1 'ttl-beg-1 - #'(lambda (mtcd) - (when mtcd - (setq txt-blw (match-string-no-properties 1)) - (point))))) + (lambda (mtcd) + (when mtcd + (setq txt-blw (match-string-no-properties 1)) + (point))))) txt-abv (ttl-abv ; Title found above starting here. (rst-forward-line-looking-at -1 'ttl-beg-1 - #'(lambda (mtcd) - (when mtcd - (setq txt-abv (match-string-no-properties 1)) - (point))))) + (lambda (mtcd) + (when mtcd + (setq txt-abv (match-string-no-properties 1)) + (point))))) (und-fnd ; Matching underline found starting here. (and ttl-blw (rst-forward-line-looking-at +2 (list ado-re 'lin-end) - #'(lambda (mtcd) - (when mtcd - (point)))))) + (lambda (mtcd) + (when mtcd + (point)))))) (ovr-fnd ; Matching overline found starting here. (and ttl-abv (rst-forward-line-looking-at -2 (list ado-re 'lin-end) - #'(lambda (mtcd) - (when mtcd - (point)))))) + (lambda (mtcd) + (when mtcd + (point)))))) (und-wng ; Wrong underline found starting here. (and ttl-blw (not und-fnd) (rst-forward-line-looking-at +2 'ado-beg-2-1 - #'(lambda (mtcd) - (when mtcd - (point)))))) + (lambda (mtcd) + (when mtcd + (point)))))) (ovr-wng ; Wrong overline found starting here. (and ttl-abv (not ovr-fnd) (rst-forward-line-looking-at -2 'ado-beg-2-1 - #'(lambda (mtcd) - (when (and - mtcd - ;; An adornment above may be a legal - ;; adornment for the line above - consider it - ;; a wrong overline only when it is equally - ;; long. - (equal - (length (match-string-no-properties 1)) - (length adornment))) - (point))))))) + (lambda (mtcd) + (when (and + mtcd + ;; An adornment above may be a legal + ;; adornment for the line above - consider it + ;; a wrong overline only when it is equally + ;; long. + (equal + (length (match-string-no-properties 1)) + (length adornment))) + (point))))))) (cond ((and nxt-emp prv-emp) ;; A transition. @@ -1708,11 +1708,11 @@ a section header or nil if no title line is found." (rst-forward-line-strict 0)) (let* (cnd-beg ; Beginning of a title candidate. cnd-txt ; Text of a title candidate. - (cnd-fun #'(lambda (mtcd) ; Function setting title candidate data. - (when mtcd - (setq cnd-beg (match-beginning 0)) - (setq cnd-txt (match-string-no-properties 1)) - t))) + (cnd-fun (lambda (mtcd) ; Function setting title candidate data. + (when mtcd + (setq cnd-beg (match-beginning 0)) + (setq cnd-txt (match-string-no-properties 1)) + t))) ttl) (cond ((looking-at (rst-re 'ado-beg-2-1)) @@ -1728,10 +1728,10 @@ a section header or nil if no title line is found." ;; Title line found - check for a following underline. (setq ttl (rst-forward-line-looking-at 1 'ado-beg-2-1 - #'(lambda (mtcd) - (when mtcd - (rst-classify-adornment - (match-string-no-properties 0) (match-end 0)))))) + (lambda (mtcd) + (when mtcd + (rst-classify-adornment + (match-string-no-properties 0) (match-end 0)))))) ;; Title candidate found if no valid adornment found. (funcall cnd-fun (not ttl)))) (cond @@ -1827,15 +1827,15 @@ given." (ignore-ttl (if ignore-position (cl-find-if - #'(lambda (ttl) - (equal (rst-Ttl-contains ttl ignore-position) 0)) + (lambda (ttl) + (equal (rst-Ttl-contains ttl ignore-position) 0)) all-ttls))) (really-ignore (if ignore-ttl (<= (cl-count-if - #'(lambda (ttl) - (rst-Ado-equal (rst-Ttl-ado ignore-ttl) - (rst-Ttl-ado ttl))) + (lambda (ttl) + (rst-Ado-equal (rst-Ttl-ado ignore-ttl) + (rst-Ttl-ado ttl))) all-ttls) 1))) (real-ttls (delq (if really-ignore ignore-ttl) all-ttls))) @@ -1859,14 +1859,14 @@ given." Return a list of (`rst-Ttl' . LEVEL) with ascending line number." (let ((hier (rst-Hdr-ado-map (rst-hdr-hierarchy)))) (mapcar - #'(lambda (ttl) - (cons ttl (rst-Ado-position (rst-Ttl-ado ttl) hier))) + (lambda (ttl) + (cons ttl (rst-Ado-position (rst-Ttl-ado ttl) hier))) (rst-all-ttls)))) (defun rst-get-previous-hdr () "Return the `rst-Hdr' before point or nil if none." - (let ((prev (cl-find-if #'(lambda (ttl) - (< (rst-Ttl-contains ttl (point)) 0)) + (let ((prev (cl-find-if (lambda (ttl) + (< (rst-Ttl-contains ttl (point)) 0)) (rst-all-ttls) :from-end t))) (and prev (rst-Ttl-hdr prev)))) @@ -2169,19 +2169,19 @@ hierarchy is similar to that used by `rst-adjust-section'." (let* ((beg (region-beginning)) (end (region-end)) (ttls-reg (cl-remove-if-not - #'(lambda (ttl) - (and - (>= (rst-Ttl-contains ttl beg) 0) - (< (rst-Ttl-contains ttl end) 0))) + (lambda (ttl) + (and + (>= (rst-Ttl-contains ttl beg) 0) + (< (rst-Ttl-contains ttl end) 0))) (rst-all-ttls)))) (save-excursion ;; Apply modifications. (rst-destructuring-dolist ((marker &rest hdr &aux (hier (rst-hdr-hierarchy))) - (mapcar #'(lambda (ttl) - (cons (copy-marker (rst-Ttl-get-title-beginning ttl)) - (rst-Ttl-hdr ttl))) + (mapcar (lambda (ttl) + (cons (copy-marker (rst-Ttl-get-title-beginning ttl)) + (rst-Ttl-hdr ttl))) ttls-reg)) (set-marker (goto-char marker) nil) @@ -2391,9 +2391,9 @@ also arranged by `rst-insert-list-new-tag'." "List of favorite bullets." :group 'rst :type `(repeat - (choice ,@(mapcar #'(lambda (char) - (list 'const - :tag (char-to-string char) char)) + (choice ,@(mapcar (lambda (char) + (list 'const + :tag (char-to-string char) char)) rst-bullets))) :package-version '(rst . "1.1.0")) @@ -2517,13 +2517,13 @@ ordered by POINT." (looking-at (rst-re rst-re-beg)) ; Start found (not (rst-forward-line-looking-at -1 'lin-end - #'(lambda (mtcd) ; Previous line exists and is... - (and - (not mtcd) ; non-empty, - (<= (current-indentation) clm) ; less indented - (not (and (= (current-indentation) clm) + (lambda (mtcd) ; Previous line exists and is... + (and + (not mtcd) ; non-empty, + (<= (current-indentation) clm) ; less indented + (not (and (= (current-indentation) clm) ; not a beg at same level. - (looking-at (rst-re rst-re-beg))))))))) + (looking-at (rst-re rst-re-beg))))))))) (back-to-indentation) (push (cons (point) clm) r))) (1value ; At least one line is moved in this loop. @@ -2553,8 +2553,8 @@ modified." ((bullet _clm &rest pnts) ;; Zip preferred bullets and sorted columns associating a bullet ;; with a column and all the points this column is found. - (cl-mapcar #'(lambda (bullet clm2pnt) - (cons bullet clm2pnt)) + (cl-mapcar (lambda (bullet clm2pnt) + (cons bullet clm2pnt)) rst-preferred-bullets (sort clm2pnts #'car-less-than-car))) ;; Replace the bullets by the preferred ones. @@ -2614,8 +2614,8 @@ section headers at all." (when (>= point (rst-Stn-get-title-beginning stn)) ;; Point may be in this section or a child. (let ((in-child (cl-find-if - #'(lambda (child) - (>= point (rst-Stn-get-title-beginning child))) + (lambda (child) + (>= point (rst-Stn-get-title-beginning child))) (rst-Stn-children stn) :from-end t))) (if in-child @@ -2829,18 +2829,18 @@ file-write hook to always make it up-to-date automatically." (and beg (rst-forward-line-looking-at 1 'lin-end - #'(lambda (mtcd) - (unless mtcd - (rst-apply-indented-blocks - (point) (point-max) (current-indentation) - #'(lambda (count _in-first _in-sub in-super in-empty - _relind) - (cond - ((or (> count 1) in-super)) - ((not in-empty) - (setq fnd (line-end-position)) - nil))))) - t))) + (lambda (mtcd) + (unless mtcd + (rst-apply-indented-blocks + (point) (point-max) (current-indentation) + (lambda (count _in-first _in-sub in-super in-empty + _relind) + (cond + ((or (> count 1) in-super)) + ((not in-empty) + (setq fnd (line-end-position)) + nil))))) + t))) (when fnd (delete-region beg fnd)) (goto-char beg) @@ -3024,14 +3024,14 @@ direction." (contained nil) ; Title contains point (or is after point otherwise). (found (or (cl-position-if ;; Find a title containing or after point. - #'(lambda (ttl) - (let ((cmp (rst-Ttl-contains ttl pnt))) - (cond - ((= cmp 0) ; Title contains point. - (setq contained t) - t) - ((> cmp 0) ; Title after point. - t)))) + (lambda (ttl) + (let ((cmp (rst-Ttl-contains ttl pnt))) + (cond + ((= cmp 0) ; Title contains point. + (setq contained t) + t) + ((> cmp 0) ; Title after point. + t)))) ttls) ;; Point after all titles. count)) @@ -3290,8 +3290,8 @@ remove all indentation (CNT = 0). A tab is taken from the text above. If no suitable tab is found `rst-indent-width' is used." (interactive "r\np") (let ((tabs (sort (rst-compute-tabs beg) - #'(lambda (x y) - (<= x y)))) + (lambda (x y) + (<= x y)))) (leftmostcol (rst-find-leftmost-column beg end))) (when (or (> leftmostcol 0) (> cnt 0)) ;; Apply the indent. @@ -3306,8 +3306,8 @@ above. If no suitable tab is found `rst-indent-width' is used." (dir (cl-signum cnt)) ; Direction to take. (abs (abs cnt)) ; Absolute number of steps to take. ;; Get the position of the first tab beyond leftmostcol. - (fnd (cl-position-if #'(lambda (elt) - (funcall cmp elt leftmostcol)) + (fnd (cl-position-if (lambda (elt) + (funcall cmp elt leftmostcol)) tabs)) ;; Virtual position of tab. (pos (+ (or fnd len) (1- abs))) @@ -3492,20 +3492,20 @@ do all lines instead of just paragraphs." (indent "")) (rst-apply-indented-blocks beg end (rst-find-leftmost-column beg end) - #'(lambda (count in-first in-sub in-super in-empty _relind) - (cond - (in-empty) - (in-super) - ((zerop count)) - (in-sub - (insert indent)) - ((or in-first all) - (let ((tag (format "%d. " (cl-incf enum)))) - (setq indent (make-string (length tag) ? )) - (insert tag))) - (t - (insert indent))) - nil)))) + (lambda (count in-first in-sub in-super in-empty _relind) + (cond + (in-empty) + (in-super) + ((zerop count)) + (in-sub + (insert indent)) + ((or in-first all) + (let ((tag (format "%d. " (cl-incf enum)))) + (setq indent (make-string (length tag) ? )) + (insert tag))) + (t + (insert indent))) + nil)))) ;; FIXME: Does not deal with deeper indentation - although ;; `rst-apply-indented-blocks' could. @@ -3520,18 +3520,18 @@ do all lines instead of just paragraphs." (indent (make-string (length bul) ? ))) (rst-apply-indented-blocks beg end (rst-find-leftmost-column beg end) - #'(lambda (count in-first in-sub in-super in-empty _relind) - (cond - (in-empty) - (in-super) - ((zerop count)) - (in-sub - (insert indent)) - ((or in-first all) - (insert bul)) - (t - (insert indent))) - nil)))) + (lambda (count in-first in-sub in-super in-empty _relind) + (cond + (in-empty) + (in-super) + ((zerop count)) + (in-sub + (insert indent)) + ((or in-first all) + (insert bul)) + (t + (insert indent))) + nil)))) ;; FIXME: Does not deal with a varying number of digits appropriately. ;; FIXME: Does not deal with multiple levels independently. @@ -3561,11 +3561,11 @@ Region is from BEG to END. With WITH-EMPTY prefix empty lines too." (let ((ind (rst-find-leftmost-column beg end))) (rst-apply-indented-blocks beg end ind - #'(lambda (_count _in-first _in-sub in-super in-empty _relind) - (when (and (not in-super) (or with-empty (not in-empty))) - (move-to-column ind t) - (insert "| ")) - nil)))) + (lambda (_count _in-first _in-sub in-super in-empty _relind) + (when (and (not in-super) (or with-empty (not in-empty))) + (move-to-column ind t) + (insert "| ")) + nil)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -4085,16 +4085,16 @@ end of the buffer) return nil and do not move point." (setq fnd (rst-apply-indented-blocks (line-beginning-position 2) ; Skip the current line (or limit (point-max)) (or column (current-column)) - #'(lambda (_count _in-first _in-sub in-super in-empty _relind) - (cond - (in-empty - (setq candidate (or candidate (line-beginning-position))) - nil) - (in-super - (or candidate (line-beginning-position))) - (t ; Non-empty, same or more indented line. - (setq candidate nil) - nil))))) + (lambda (_count _in-first _in-sub in-super in-empty _relind) + (cond + (in-empty + (setq candidate (or candidate (line-beginning-position))) + nil) + (in-super + (or candidate (line-beginning-position))) + (t ; Non-empty, same or more indented line. + (setq candidate nil) + nil))))) (when fnd (goto-char fnd)))) From b65a1cfed7371e27130db9e9a05f8e656ee77c6f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 2 Apr 2021 16:33:01 +0200 Subject: [PATCH 28/75] * doc/misc/woman.texi (Introduction): Remove reference to old Emacs. --- doc/misc/woman.texi | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/misc/woman.texi b/doc/misc/woman.texi index 4470afcad20..33b3a33f0f4 100644 --- a/doc/misc/woman.texi +++ b/doc/misc/woman.texi @@ -105,11 +105,9 @@ Mile End Road, London E1 4NS, UK @chapter Introduction @cindex introduction -This version of WoMan should run with GNU Emacs 20.3 or later on any -platform. It has not been tested, and may not run, with any other -version of Emacs. It was developed primarily on various versions of -Microsoft Windows, but has also been tested on MS-DOS, and various -versions of UNIX and GNU/Linux. +WoMan was developed primarily on various versions of Microsoft +Windows, but has also been tested on MS-DOS, and various versions of +UNIX and GNU/Linux. WoMan is distributed with GNU Emacs. From 74a86c1acf951da7451c3c8a1cd6ec277f782d41 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 2 Apr 2021 19:32:32 +0200 Subject: [PATCH 29/75] Remove references to very old versions of Emacs from eintr * doc/lispintro/emacs-lisp-intro.texi (Making Errors) (Void Function, Void Variable, Wrong Type of Argument, debug) (debug-on-entry): Remove commented out references to Emacs 20 or earlier. * doc/lispintro/emacs-lisp-intro.texi (what-line) (print-elements-of-list, debug, X Axis Tic Marks): Don't call version 22 or earlier a "recent" version of Emacs. --- doc/lispintro/emacs-lisp-intro.texi | 96 ++++------------------------- 1 file changed, 12 insertions(+), 84 deletions(-) diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 5b15a456ff0..fade4096e38 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -1364,19 +1364,6 @@ C-e}: (this is an unquoted list) @end smallexample -@ignore -@noindent -What you see depends on which version of Emacs you are running. GNU -Emacs version 22 provides more information than version 20 and before. -First, the more recent result of generating an error; then the -earlier, version 20 result. - -@need 1250 -@noindent -In GNU Emacs version 22, a @file{*Backtrace*} window will open up and -you will see the following in it: -@end ignore - A @file{*Backtrace*} window will open up and you should see the following in it: @@ -1838,19 +1825,6 @@ Debugger entered--Lisp error: (void-function fill-column) (Remember, to quit the debugger and make the debugger window go away, type @kbd{q} in the @file{*Backtrace*} buffer.) -@ignore -@need 800 -In GNU Emacs 20 and before, you will produce an error message that says: - -@smallexample -Symbol's function definition is void:@: fill-column -@end smallexample - -@noindent -(The message will go away as soon as you move the cursor or type -another key.) -@end ignore - @node Void Variable @subsection Error Message for a Symbol Without a Value @cindex Symbol without value error @@ -1907,18 +1881,6 @@ Since @code{+} does not have a value bound to it, just the function definition, the error message reported that the symbol's value as a variable was void. -@ignore -@need 800 -In GNU Emacs version 20 and before, your error message will say: - -@example -Symbol's value as variable is void:@: + -@end example - -@noindent -The meaning is the same as in GNU Emacs 22. -@end ignore - @node Arguments @section Arguments @cindex Arguments @@ -2197,19 +2159,6 @@ addition had been passed the correct type of object, the value passed would have been a number, such as 37, rather than a symbol like @code{hello}. But then you would not have got the error message. -@ignore -@need 1250 -In GNU Emacs version 20 and before, the echo area displays an error -message that says: - -@smallexample -Wrong type argument:@: number-or-marker-p, hello -@end smallexample - -This says, in different words, the same as the top line of the -@file{*Backtrace*} buffer. -@end ignore - @node message @subsection The @code{message} Function @findex message @@ -6663,9 +6612,9 @@ original text of the function: @end group @end smallexample -(In recent versions of GNU Emacs, the @code{what-line} function has +(In modern versions of GNU Emacs, the @code{what-line} function has been expanded to tell you your line number in a narrowed buffer as -well as your line number in a widened buffer. The recent version is +well as your line number in a widened buffer. The modern version is more complex than the version shown here. If you feel adventurous, you might want to look at it after figuring out how this version works. You will probably need to use @kbd{C-h f} @@ -10392,9 +10341,8 @@ echo area: @code{^Jgazelle^J^Jgiraffe^J^Jlion^J^Jtiger^Jnil}, in which each @samp{^J} stands for a newline.) @need 1500 -In a recent instance of GNU Emacs, you can evaluate these expressions -directly in the Info buffer, and the echo area will grow to show the -results. +You can evaluate these expressions directly in the Info buffer, and +the echo area will grow to show the results. @smallexample @group @@ -18104,8 +18052,7 @@ argument of 4: @end smallexample @noindent -In a recent GNU Emacs, you will create and enter a @file{*Backtrace*} -buffer that says: +This will create and enter a @file{*Backtrace*} buffer that says: @noindent @smallexample @@ -18139,25 +18086,12 @@ In practice, for a bug as simple as this, the Lisp error line will tell you what you need to know to correct the definition. The function @code{1=} is void. -@ignore -@need 800 -In GNU Emacs 20 and before, you will see: - -@smallexample -Symbol's function definition is void:@: 1= -@end smallexample - -@noindent -which has the same meaning as the @file{*Backtrace*} buffer line in -version 21. -@end ignore - However, suppose you are not quite certain what is going on? You can read the complete backtrace. -In this case, you need to run a recent GNU Emacs, which automatically -starts the debugger that puts you in the @file{*Backtrace*} buffer; or -else, you need to start the debugger manually as described below. +Emacs automatically starts the debugger that puts you in the +@file{*Backtrace*} buffer. You can also start the debugger manually +as described below. Read the @file{*Backtrace*} buffer from the bottom up; it tells you what Emacs did that led to the error. Emacs made an interactive call @@ -18197,14 +18131,8 @@ then run your test again. @section @code{debug-on-entry} @findex debug-on-entry -A recent GNU Emacs starts the debugger automatically when your -function has an error. - -@ignore -GNU Emacs version 20 and before did not; it simply -presented you with an error message. You had to start the debugger -manually. -@end ignore +Emacs starts the debugger automatically when your function has an +error. Incidentally, you can start the debugger manually for all versions of Emacs; the advantage is that the debugger runs even if you do not have @@ -20079,8 +20007,8 @@ the tic marks themselves and their spacing: @code{defvar}. The @code{boundp} predicate checks whether it has already been set; @code{boundp} returns @code{nil} if it has not. If @code{graph-blank} were unbound and we did not use this conditional -construction, in a recent GNU Emacs, we would enter the debugger and -see an error message saying @samp{@w{Debugger entered--Lisp error:} +construction, we would enter the debugger and see an error message +saying @samp{@w{Debugger entered--Lisp error:} @w{(void-variable graph-blank)}}.) @need 1200 From 5c7766ed1072c5748776e56d6f27a6a9504648d3 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 3 Apr 2021 00:50:55 +0200 Subject: [PATCH 30/75] Use lexical-binding in recentf.el * lisp/recentf.el: Use lexical-binding. Doc fix. (recentf-save-file): Strength reduce 'eval' to 'symbol-value'. (recentf-trunc-list): Make into obsolete function alias for 'seq-take'. Update callers. (recentf-show-file-shortcuts-flag): Doc fix. (recentf-menu-elements, recentf-make-menu-items) (recentf-make-menu-item, recentf-dialog-mode-map) (recentf-dialog, recentf-open-files-item) (recentf-open-files-items, recentf-open-files) (recentf-load-list): Quote function symbols as such. (recentf-relative-filter, recentf-file-name-nondir): Remove redundant #' before lambda. --- lisp/recentf.el | 108 ++++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/lisp/recentf.el b/lisp/recentf.el index c819397a33d..9ae059a70dd 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -1,4 +1,4 @@ -;;; recentf.el --- setup a menu of recently opened files +;;; recentf.el --- setup a menu of recently opened files -*- lexical-binding: t -*- ;; Copyright (C) 1999-2021 Free Software Foundation, Inc. @@ -24,16 +24,21 @@ ;;; Commentary: ;; This package maintains a menu for visiting files that were operated -;; on recently. When enabled a new "Open Recent" sub menu is +;; on recently. When enabled a new "Open Recent" submenu is ;; displayed in the "File" menu. The recent files list is -;; automatically saved across Emacs sessions. You can customize the -;; number of recent files displayed, the location of the menu and -;; others options (see the source code for details). +;; automatically saved across Emacs sessions. -;; To enable this package, add the following to your .emacs: -;; (recentf-mode 1) +;; You can customize the number of recent files displayed, the +;; location of the menu and others options. Type: +;; +;; M-x customize-group RET recentf RET + +;; To enable this package, add this line to your Init file: +;; +;; (recentf-mode 1) ;;; Code: + (require 'tree-widget) (require 'timer) @@ -73,7 +78,7 @@ See the command `recentf-save-list'." :type 'file :initialize 'custom-initialize-default :set (lambda (symbol value) - (let ((oldvalue (eval symbol))) + (let ((oldvalue (symbol-value symbol))) (custom-set-default symbol value) (and (not (equal value oldvalue)) recentf-mode @@ -292,7 +297,7 @@ They are successively passed a file name to transform it." (function :tag "Other function"))))) (defcustom recentf-show-file-shortcuts-flag t - "Whether to show \"[N]\" for the Nth item up to 10. + "Non-nil means to show \"[N]\" for the Nth item up to 10. If non-nil, `recentf-open-files' will show labels for keys that can be used as shortcuts to open the Nth file." :group 'recentf @@ -327,15 +332,6 @@ Ignore case if `recentf-case-fold-search' is non-nil." (setq list (cdr list))) list) -(defsubst recentf-trunc-list (l n) - "Return from L the list of its first N elements." - (let (nl) - (while (and l (> n 0)) - (setq nl (cons (car l) nl) - n (1- n) - l (cdr l))) - (nreverse nl))) - (defun recentf-dump-variable (variable &optional limit) "Insert a \"(setq VARIABLE value)\" in the current buffer. When the value of VARIABLE is a list, optional argument LIMIT @@ -345,7 +341,7 @@ the full list." (if (atom value) (insert (format "\n(setq %S '%S)\n" variable value)) (when (and (integerp limit) (> limit 0)) - (setq value (recentf-trunc-list value limit))) + (setq value (seq-take value limit))) (insert (format "\n(setq %S\n '(" variable)) (dolist (e value) (insert (format "\n %S" e))) @@ -516,7 +512,7 @@ filter function this variable is reset to nil.") (defsubst recentf-elements (n) "Return a list of the first N elements of the recent list." - (recentf-trunc-list recentf-list n)) + (seq-take recentf-list n)) (defsubst recentf-make-menu-element (menu-item menu-value) "Create a new menu-element. @@ -556,7 +552,7 @@ This a menu element (FILE . FILE)." (defsubst recentf-menu-elements (n) "Return a list of the first N default menu elements from the recent list. See also `recentf-make-default-menu-element'." - (mapcar 'recentf-make-default-menu-element + (mapcar #'recentf-make-default-menu-element (recentf-elements n))) (defun recentf-apply-menu-filter (filter l) @@ -597,7 +593,7 @@ This is a menu filter function which ignores the MENU argument." (let* ((recentf-menu-shortcuts 0) (file-items (condition-case err - (mapcar 'recentf-make-menu-item + (mapcar #'recentf-make-menu-item (recentf-apply-menu-filter recentf-menu-filter (recentf-menu-elements recentf-max-menu-items))) @@ -639,7 +635,7 @@ Return nil if file NAME is not one of the ten more recent." (let ((item (recentf-menu-element-item elt)) (value (recentf-menu-element-value elt))) (if (recentf-sub-menu-element-p elt) - (cons item (mapcar 'recentf-make-menu-item value)) + (cons item (mapcar #'recentf-make-menu-item value)) (let ((k (and (< recentf-menu-shortcuts 10) (recentf-menu-value-shortcut value)))) (vector item @@ -764,12 +760,12 @@ This filter combines the `recentf-sort-basenames-descending' and (defun recentf-relative-filter (l) "Filter the list of menu-elements L to show relative filenames. Filenames are relative to the `default-directory'." - (mapcar #'(lambda (menu-element) - (let* ((ful (recentf-menu-element-value menu-element)) - (rel (file-relative-name ful default-directory))) - (if (string-match "^\\.\\." rel) - menu-element - (recentf-make-menu-element rel ful)))) + (mapcar (lambda (menu-element) + (let* ((ful (recentf-menu-element-value menu-element)) + (rel (file-relative-name ful default-directory))) + (if (string-match "^\\.\\." rel) + menu-element + (recentf-make-menu-element rel ful)))) l)) ;;; Rule based menu filters @@ -941,10 +937,10 @@ Rules obey `recentf-arrange-rules' format." This simplified version of `recentf-show-basenames' does not handle duplicates. It is used by `recentf-arrange-by-dir' as its `recentf-arrange-by-rule-subfilter'." - (mapcar #'(lambda (e) - (recentf-make-menu-element - (file-name-nondirectory (recentf-menu-element-value e)) - (recentf-menu-element-value e))) + (mapcar (lambda (e) + (recentf-make-menu-element + (file-name-nondirectory (recentf-menu-element-value e)) + (recentf-menu-element-value e))) l)) (defun recentf-dir-rule (file) @@ -997,15 +993,15 @@ Filtering of L is delegated to the selected filter in the menu." (list `("Show files" ,@(mapcar - #'(lambda (f) - `[,(cdr f) - (setq recentf-filter-changer-current ',(car f)) - ;;:active t - :style radio ;;radio Don't work with GTK :-( - :selected (eq recentf-filter-changer-current - ',(car f)) - ;;:help ,(cdr f) - ]) + (lambda (f) + `[,(cdr f) + (setq recentf-filter-changer-current ',(car f)) + ;;:active t + :style radio ;;radio Don't work with GTK :-( + :selected (eq recentf-filter-changer-current + ',(car f)) + ;;:help ,(cdr f) + ]) recentf-filter-changer-alist)))) (recentf-apply-menu-filter recentf-filter-changer-current l))) @@ -1062,9 +1058,9 @@ Go to the beginning of buffer if not found." (defvar recentf-dialog-mode-map (let ((km (copy-keymap recentf--shortcuts-keymap))) (set-keymap-parent km widget-keymap) - (define-key km "q" 'recentf-cancel-dialog) - (define-key km "n" 'next-line) - (define-key km "p" 'previous-line) + (define-key km "q" #'recentf-cancel-dialog) + (define-key km "n" #'next-line) + (define-key km "p" #'previous-line) km) "Keymap used in recentf dialogs.") @@ -1083,8 +1079,8 @@ Go to the beginning of buffer if not found." ;; Cleanup buffer (let ((inhibit-read-only t) (ol (overlay-lists))) - (mapc 'delete-overlay (car ol)) - (mapc 'delete-overlay (cdr ol)) + (mapc #'delete-overlay (car ol)) + (mapc #'delete-overlay (cdr ol)) (erase-buffer)) (recentf-dialog-mode) ,@forms @@ -1178,7 +1174,7 @@ IGNORE other arguments." :node (item :tag ,(car menu-element) :sample-face bold :format "%{%t%}:\n") - ,@(mapcar 'recentf-open-files-item + ,@(mapcar #'recentf-open-files-item (cdr menu-element))) ;; Represent a single file with a link widget `(link :tag ,(car menu-element) @@ -1193,8 +1189,8 @@ IGNORE other arguments." (defun recentf-open-files-items (files) "Return a list of widgets to display FILES in a dialog buffer." (setq-local recentf--files-with-key - (recentf-trunc-list files 10)) - (mapcar 'recentf-open-files-item + (seq-take files 10)) + (mapcar #'recentf-open-files-item (append ;; When requested group the files with shortcuts together ;; at the top of the list. @@ -1202,12 +1198,12 @@ IGNORE other arguments." (setq files (nthcdr 10 files)) (recentf-apply-menu-filter 'recentf-show-digit-shortcut-filter - (mapcar 'recentf-make-default-menu-element + (mapcar #'recentf-make-default-menu-element recentf--files-with-key))) ;; Then the other files. (recentf-apply-menu-filter recentf-menu-filter - (mapcar 'recentf-make-default-menu-element + (mapcar #'recentf-make-default-menu-element files))))) (defun recentf-open-files (&optional files buffer-name) @@ -1228,7 +1224,7 @@ use for the dialog. It defaults to \"*`recentf-menu-title'*\"." (format-message "Click on Cancel or type `q' to cancel.\n")) ;; Use a L&F that looks like the recentf menu. (tree-widget-set-theme "folder") - (apply 'widget-create + (apply #'widget-create `(group :indent 2 :format "\n%v\n" @@ -1310,7 +1306,7 @@ empty `file-name-history' with the recent list." (load-file file) (and recentf-initialize-file-name-history (not file-name-history) - (setq file-name-history (mapcar 'abbreviate-file-name + (setq file-name-history (mapcar #'abbreviate-file-name recentf-list)))))) (defun recentf-cleanup () @@ -1377,6 +1373,10 @@ buffers you switch to a lot, you can say something like the following: ;; continue standard unloading nil) +;; Obsolete. + +(define-obsolete-function-alias 'recentf-trunc-list #'seq-take "28.1") + (provide 'recentf) (run-hooks 'recentf-load-hook) From 0b613c90a5fcbcc483f09d909cb77e7d0c8fb31e Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 2 Apr 2021 19:51:41 -0400 Subject: [PATCH 31/75] * lisp/progmodes/simula.el: Use lexical-binding (simula-tab-always-indent): Mark as obsolete. (simula-mode-map): Don't bind TAB. (simula-indent-command): Mark as obsolete. (hilit-set-mode-patterns): Remove obsolete support for hilit19. (simula-mode-syntax-table): Move initialization code into the declaration. --- lisp/progmodes/simula.el | 99 +++++++++++++++------------------------- 1 file changed, 36 insertions(+), 63 deletions(-) diff --git a/lisp/progmodes/simula.el b/lisp/progmodes/simula.el index f92f4468098..7c0de9fc359 100644 --- a/lisp/progmodes/simula.el +++ b/lisp/progmodes/simula.el @@ -1,4 +1,4 @@ -;;; simula.el --- SIMULA 87 code editing commands for Emacs +;;; simula.el --- SIMULA 87 code editing commands for Emacs -*- lexical-binding: t; -*- ;; Copyright (C) 1992, 1994, 1996, 2001-2021 Free Software Foundation, ;; Inc. @@ -52,6 +52,7 @@ the run of whitespace at the beginning of the line.") Otherwise TAB indents only when point is within the run of whitespace at the beginning of the line." :type 'boolean) +(make-obsolete-variable 'simula-tab-always-indent 'tab-always-indent "28.1") (defconst simula-indent-level-default 3 "Indentation of SIMULA statements with respect to containing block.") @@ -148,7 +149,24 @@ Please note that the standard definitions are required for SIMULA mode to function correctly." :type '(choice file (const nil))) -(defvar simula-mode-syntax-table nil +(defvar simula-mode-syntax-table + (let ((st (copy-syntax-table (standard-syntax-table)))) + (modify-syntax-entry ?! "<" st) + (modify-syntax-entry ?$ "." st) + (modify-syntax-entry ?% "< b" st) + (modify-syntax-entry ?\n "> b" st) + (modify-syntax-entry ?' "\"" st) + (modify-syntax-entry ?\( "()" st) + (modify-syntax-entry ?\) ")(" st) + (modify-syntax-entry ?\; ">" st) + (modify-syntax-entry ?\[ "." st) + (modify-syntax-entry ?\\ "." st) + (modify-syntax-entry ?\] "." st) + (modify-syntax-entry ?_ "_" st) + (modify-syntax-entry ?\| "." st) + (modify-syntax-entry ?\{ "." st) + (modify-syntax-entry ?\} "." st) + st) "Syntax table in SIMULA mode buffers.") (defconst simula-syntax-propertize-function @@ -237,39 +255,20 @@ for SIMULA mode to function correctly." ["Forward Statement" simula-next-statement t] ["Backward Up Level" simula-backward-up-level t] ["Forward Down Statement" simula-forward-down-level t]) - "Lucid Emacs menu for SIMULA mode.") - -(if simula-mode-syntax-table - () - (setq simula-mode-syntax-table (copy-syntax-table (standard-syntax-table))) - (modify-syntax-entry ?! "<" simula-mode-syntax-table) - (modify-syntax-entry ?$ "." simula-mode-syntax-table) - (modify-syntax-entry ?% "< b" simula-mode-syntax-table) - (modify-syntax-entry ?\n "> b" simula-mode-syntax-table) - (modify-syntax-entry ?' "\"" simula-mode-syntax-table) - (modify-syntax-entry ?\( "()" simula-mode-syntax-table) - (modify-syntax-entry ?\) ")(" simula-mode-syntax-table) - (modify-syntax-entry ?\; ">" simula-mode-syntax-table) - (modify-syntax-entry ?\[ "." simula-mode-syntax-table) - (modify-syntax-entry ?\\ "." simula-mode-syntax-table) - (modify-syntax-entry ?\] "." simula-mode-syntax-table) - (modify-syntax-entry ?_ "_" simula-mode-syntax-table) - (modify-syntax-entry ?\| "." simula-mode-syntax-table) - (modify-syntax-entry ?\{ "." simula-mode-syntax-table) - (modify-syntax-entry ?\} "." simula-mode-syntax-table)) + "Emacs menu for SIMULA mode.") (defvar simula-mode-map (let ((map (make-sparse-keymap))) - (define-key map "\C-c\C-u" 'simula-backward-up-level) - (define-key map "\C-c\C-p" 'simula-previous-statement) - (define-key map "\C-c\C-d" 'simula-forward-down-level) - (define-key map "\C-c\C-n" 'simula-next-statement) - ;; (define-key map "\C-c\C-g" 'simula-goto-definition) - ;; (define-key map "\C-c\C-h" 'simula-standard-help) - (define-key map "\177" 'backward-delete-char-untabify) - (define-key map ":" 'simula-electric-label) - (define-key map "\e\C-q" 'simula-indent-exp) - (define-key map "\t" 'simula-indent-command) + (define-key map "\C-c\C-u" #'simula-backward-up-level) + (define-key map "\C-c\C-p" #'simula-previous-statement) + (define-key map "\C-c\C-d" #'simula-forward-down-level) + (define-key map "\C-c\C-n" #'simula-next-statement) + ;; (define-key map "\C-c\C-g" #'simula-goto-definition) + ;; (define-key map "\C-c\C-h" #'simula-standard-help) + (define-key map "\177" #'backward-delete-char-untabify) + (define-key map ":" #'simula-electric-label) + (define-key map "\e\C-q" #'simula-indent-exp) + ;; (define-key map "\t" #'simula-indent-command) map) "Keymap used in `simula-mode'.") @@ -285,8 +284,8 @@ for SIMULA mode to function correctly." ["Previous Statement" simula-previous-statement :enable (not (bobp))] "---" - ["Indent Line" simula-indent-command - :enable (not buffer-read-only)] + ;; ["Indent Line" simula-indent-command + ;; :enable (not buffer-read-only)] ["Indent Expression" simula-indent-exp :enable (not buffer-read-only)])) @@ -295,9 +294,6 @@ for SIMULA mode to function correctly." "Major mode for editing SIMULA code. \\{simula-mode-map} Variables controlling indentation style: - `simula-tab-always-indent' - Non-nil means TAB in SIMULA mode should always reindent the current line, - regardless of where in the line point is when the TAB command is used. `simula-indent-level' Indentation of SIMULA statements with respect to containing block. `simula-substatement-offset' @@ -335,7 +331,7 @@ with no arguments, if that value is non-nil." ;; (setq-local end-comment-column 75) (setq-local paragraph-start "[ \t]*$\\|\f") (setq-local paragraph-separate paragraph-start) - (setq-local indent-line-function 'simula-indent-line) + (setq-local indent-line-function #'simula-indent-line) (setq-local comment-start "! ") (setq-local comment-end " ;") (setq-local comment-start-skip "!+ *") @@ -415,6 +411,7 @@ A numeric argument, regardless of its value, means indent rigidly all the lines of the SIMULA statement after point so that this line becomes properly indented. The relative indentation among the lines of the statement are preserved." + (declare (obsolete indent-for-tab-command "28.1")) (interactive "P") (let ((case-fold-search t)) (if (or whole-exp simula-tab-always-indent @@ -1564,30 +1561,6 @@ If not nil and not t, move to limit of search and return nil." (simula-install-standard-abbrevs)) ;; Hilit mode support. -(when (fboundp 'hilit-set-mode-patterns) - (when (and (boundp 'hilit-patterns-alist) - (not (assoc 'simula-mode hilit-patterns-alist))) - (hilit-set-mode-patterns - 'simula-mode - '( - ("^%\\([ \t\f].*\\)?$" nil comment) - ("^%include\\>" nil include) - ("\"[^\"\n]*\"\\|'.'\\|'![0-9]+!'" nil string) - ((regexp-opt '("ACTIVATE" "AFTER" "AND" "ARRAY" "AT" "BEFORE" - "BEGIN" "BOOLEAN" "CHARACTER" "CLASS" "DELAY" - "DO" "ELSE" "END" "EQ" "EQV" "EXTERNAL" "FALSE" - "FOR" "GE" "GO" "GOTO" "GT" "HIDDEN" "IF" "IMP" - "IN" "INNER" "INSPECT" "INTEGER" "IS" "LABEL" - "LE" "LONG" "LT" "NAME" "NE" "NEW" "NONE" "NOT" - "NOTEXT" "OR" "OTHERWISE" "PRIOR" "PROCEDURE" - "PROTECTED" "QUA" "REACTIVATE" "REAL" "REF" - "SHORT" "STEP" "SWITCH" "TEXT" "THEN" "THIS" - "TO" "TRUE" "UNTIL" "VALUE" "VIRTUAL" "WHEN" - "WHILE") - 'words) - nil keyword) - ("!\\|\\" ";" comment)) - nil 'case-insensitive))) ;; obsolete @@ -1598,7 +1571,7 @@ If not nil and not t, move to limit of search and return nil." "24.4") (define-obsolete-function-alias 'simula-submit-bug-report - 'report-emacs-bug "24.4") + #'report-emacs-bug "24.4") (defun simula-popup-menu (_e) "Pops up the SIMULA menu." From be9e3c48fab335c9084e472acef2065f41d20969 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 3 Apr 2021 01:06:56 +0200 Subject: [PATCH 32/75] Remove redundant #' before lambda in eshell/*.el * lisp/eshell/em-dirs.el (eshell-dirs-initialize): * lisp/eshell/em-pred.el (eshell-predicate-alist) (eshell-modifier-alist): * lisp/eshell/em-script.el (eshell-script-initialize): * lisp/eshell/eshell.el (eshell-command): Remove redundant #' before lambda. --- lisp/eshell/em-dirs.el | 8 +++--- lisp/eshell/em-pred.el | 58 ++++++++++++++++++++-------------------- lisp/eshell/em-script.el | 10 +++---- lisp/eshell/eshell.el | 6 ++--- 4 files changed, 41 insertions(+), 41 deletions(-) diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el index c702ee192a6..c04a1a67d58 100644 --- a/lisp/eshell/em-dirs.el +++ b/lisp/eshell/em-dirs.el @@ -199,10 +199,10 @@ Thus, this does not include the current directory.") (when eshell-cd-on-directory (setq-local eshell-interpreter-alist - (cons (cons #'(lambda (file _args) - (eshell-lone-directory-p file)) - 'eshell-dirs-substitute-cd) - eshell-interpreter-alist))) + (cons (cons (lambda (file _args) + (eshell-lone-directory-p file)) + 'eshell-dirs-substitute-cd) + eshell-interpreter-alist))) (add-hook 'eshell-parse-argument-hook #'eshell-parse-user-reference nil t) diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el index aecc8bb4e0a..b0a7544bdab 100644 --- a/lisp/eshell/em-pred.el +++ b/lisp/eshell/em-pred.el @@ -85,18 +85,18 @@ ordinary strings." (?s . (eshell-pred-file-mode #o4000)) ; setuid (?S . (eshell-pred-file-mode #o2000)) ; setgid (?t . (eshell-pred-file-mode #o1000)) ; sticky bit - (?U . #'(lambda (file) ; owned by effective uid - (if (file-exists-p file) - (= (file-attribute-user-id (file-attributes file)) - (user-uid))))) - ;; (?G . #'(lambda (file) ; owned by effective gid - ;; (if (file-exists-p file) - ;; (= (file-attribute-user-id (file-attributes file)) - ;; (user-uid))))) - (?* . #'(lambda (file) - (and (file-regular-p file) - (not (file-symlink-p file)) - (file-executable-p file)))) + (?U . (lambda (file) ; owned by effective uid + (if (file-exists-p file) + (= (file-attribute-user-id (file-attributes file)) + (user-uid))))) + ;; (?G . (lambda (file) ; owned by effective gid + ;; (if (file-exists-p file) + ;; (= (file-attribute-user-id (file-attributes file)) + ;; (user-uid))))) + (?* . (lambda (file) + (and (file-regular-p file) + (not (file-symlink-p file)) + (file-executable-p file)))) (?l . (eshell-pred-file-links)) (?u . (eshell-pred-user-or-group ?u "user" 2 'eshell-user-id)) (?g . (eshell-pred-user-or-group ?g "group" 3 'eshell-group-id)) @@ -114,25 +114,25 @@ The format of each entry is (put 'eshell-predicate-alist 'risky-local-variable t) (defcustom eshell-modifier-alist - '((?E . #'(lambda (lst) - (mapcar - (lambda (str) - (eshell-stringify - (car (eshell-parse-argument str)))) - lst))) - (?L . #'(lambda (lst) (mapcar 'downcase lst))) - (?U . #'(lambda (lst) (mapcar 'upcase lst))) - (?C . #'(lambda (lst) (mapcar 'capitalize lst))) - (?h . #'(lambda (lst) (mapcar 'file-name-directory lst))) + '((?E . (lambda (lst) + (mapcar + (lambda (str) + (eshell-stringify + (car (eshell-parse-argument str)))) + lst))) + (?L . (lambda (lst) (mapcar #'downcase lst))) + (?U . (lambda (lst) (mapcar #'upcase lst))) + (?C . (lambda (lst) (mapcar #'capitalize lst))) + (?h . (lambda (lst) (mapcar #'file-name-directory lst))) (?i . (eshell-include-members)) (?x . (eshell-include-members t)) - (?r . #'(lambda (lst) (mapcar 'file-name-sans-extension lst))) - (?e . #'(lambda (lst) (mapcar 'file-name-extension lst))) - (?t . #'(lambda (lst) (mapcar 'file-name-nondirectory lst))) - (?q . #'(lambda (lst) (mapcar 'eshell-escape-arg lst))) - (?u . #'(lambda (lst) (eshell-uniquify-list lst))) - (?o . #'(lambda (lst) (sort lst 'string-lessp))) - (?O . #'(lambda (lst) (nreverse (sort lst 'string-lessp)))) + (?r . (lambda (lst) (mapcar #'file-name-sans-extension lst))) + (?e . (lambda (lst) (mapcar #'file-name-extension lst))) + (?t . (lambda (lst) (mapcar #'file-name-nondirectory lst))) + (?q . (lambda (lst) (mapcar #'eshell-escape-arg lst))) + (?u . (lambda (lst) (eshell-uniquify-list lst))) + (?o . (lambda (lst) (sort lst #'string-lessp))) + (?O . (lambda (lst) (nreverse (sort lst #'string-lessp)))) (?j . (eshell-join-members)) (?S . (eshell-split-members)) (?R . 'reverse) diff --git a/lisp/eshell/em-script.el b/lisp/eshell/em-script.el index aecc48610f7..658ea085c95 100644 --- a/lisp/eshell/em-script.el +++ b/lisp/eshell/em-script.el @@ -59,11 +59,11 @@ This includes when running `eshell-command'." (defun eshell-script-initialize () ;Called from `eshell-mode' via intern-soft! "Initialize the script parsing code." (setq-local eshell-interpreter-alist - (cons (cons #'(lambda (file _args) - (string= (file-name-nondirectory file) - "eshell")) - 'eshell/source) - eshell-interpreter-alist)) + (cons (cons (lambda (file _args) + (string= (file-name-nondirectory file) + "eshell")) + 'eshell/source) + eshell-interpreter-alist)) (setq-local eshell-complex-commands (append '("source" ".") eshell-complex-commands)) ;; these two variables are changed through usage, but we don't want diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el index 3aaf2fb78aa..101ac860346 100644 --- a/lisp/eshell/eshell.el +++ b/lisp/eshell/eshell.el @@ -294,9 +294,9 @@ With prefix ARG, insert output into the current buffer at point." (setq arg current-prefix-arg)) (let ((eshell-non-interactive-p t)) ;; Enable `eshell-mode' only in this minibuffer. - (minibuffer-with-setup-hook #'(lambda () - (eshell-mode) - (eshell-command-mode +1)) + (minibuffer-with-setup-hook (lambda () + (eshell-mode) + (eshell-command-mode +1)) (unless command (setq command (read-from-minibuffer "Emacs shell command: ")) (if (eshell-using-module 'eshell-hist) From cd5dfa086d204c01791bfdcdf9fe1215c4bf1e42 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 3 Apr 2021 01:21:32 +0200 Subject: [PATCH 33/75] Replace two functions with seq-subseq * lisp/emacs-lisp/seq.el (seq-subseq): Add autoload cookie. * lisp/eshell/esh-util.el (eshell-sublist): Redefine using seq-subseq and make obsolete. Update callers. * lisp/wid-edit.el (widget-sublist): Redefine as obsolete function alias for seq-subseq. Update callers. --- lisp/emacs-lisp/seq.el | 1 + lisp/eshell/em-hist.el | 2 +- lisp/eshell/esh-util.el | 20 ++++++++------------ lisp/wid-edit.el | 19 +++++-------------- 4 files changed, 15 insertions(+), 27 deletions(-) diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 2b8807faad5..f2f7d677e88 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -147,6 +147,7 @@ the sequence, and its index within the sequence." "Return a shallow copy of SEQUENCE." (copy-sequence sequence)) +;;;###autoload (cl-defgeneric seq-subseq (sequence start &optional end) "Return the sequence of elements of SEQUENCE from START to END. END is exclusive. diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index b7b1778ebb1..e559f5b39fe 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el @@ -758,7 +758,7 @@ matched." (setq nth (eshell-hist-word-reference nth))) (unless (numberp mth) (setq mth (eshell-hist-word-reference mth))) - (cons (mapconcat #'identity (eshell-sublist textargs nth mth) " ") + (cons (mapconcat #'identity (seq-subseq textargs nth (1+ mth)) " ") end)))) (defun eshell-hist-parse-modifier (hist reference) diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index 8ef1ac9c345..1dcbed3d961 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -223,18 +223,6 @@ then quoting is done by a backslash, rather than a doubled delimiter." (string-to-number string) string)))))) -(defun eshell-sublist (l &optional n m) - "Return from LIST the N to M elements. -If N or M is nil, it means the end of the list." - (let ((a (copy-sequence l))) - (if (and m (consp (nthcdr m a))) - (setcdr (nthcdr m a) nil)) - (if n - (setq a (nthcdr n a)) - (setq n (1- (length a)) - a (last a))) - a)) - (defvar-local eshell-path-env (getenv "PATH") "Content of $PATH. It might be different from \(getenv \"PATH\"), when @@ -710,9 +698,17 @@ gid format. Valid values are `string' and `integer', defaulting to ; (or result ; (file-attributes filename)))) +;; Obsolete. + (define-obsolete-function-alias 'eshell-copy-tree #'copy-tree "28.1") (define-obsolete-function-alias 'eshell-user-name #'user-login-name "28.1") +(defun eshell-sublist (l &optional n m) + "Return from LIST the N to M elements. +If N or M is nil, it means the end of the list." + (declare (obsolete seq-subseq "28.1")) + (seq-subseq l n (1+ m))) + (provide 'esh-util) ;;; esh-util.el ends here diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index e71290c7ef9..51c6b49e6df 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -1878,20 +1878,9 @@ as the argument to `documentation-property'." (let ((value (widget-get widget :value))) (and (listp value) (<= (length value) (length vals)) - (let ((head (widget-sublist vals 0 (length value)))) + (let ((head (seq-subseq vals 0 (length value)))) (and (equal head value) - (cons head (widget-sublist vals (length value)))))))) - -(defun widget-sublist (list start &optional end) - "Return the sublist of LIST from START to END. -If END is omitted, it defaults to the length of LIST." - (if (> start 0) (setq list (nthcdr start list))) - (if end - (unless (<= end start) - (setq list (copy-sequence list)) - (setcdr (nthcdr (- end start 1) list) nil) - list) - (copy-sequence list))) + (cons head (seq-subseq vals (length value)))))))) (defun widget-item-action (widget &optional event) ;; Just notify itself. @@ -4117,7 +4106,9 @@ is inline." (setq help-echo (funcall help-echo widget))) (if help-echo (message "%s" (eval help-echo))))) -;;; The End: +;;; Obsolete. + +(define-obsolete-function-alias 'widget-sublist #'seq-subseq "28.1") (provide 'wid-edit) From d73229c48ec2d18e5ee67a9739a9a4e7d424fccc Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 3 Apr 2021 04:25:59 +0200 Subject: [PATCH 34/75] * lisp/pixel-scroll.el: Use lexical-binding. --- lisp/pixel-scroll.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 68dc0fb94b3..78b8259b395 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -1,4 +1,4 @@ -;;; pixel-scroll.el --- Scroll a line smoothly +;;; pixel-scroll.el --- Scroll a line smoothly -*- lexical-binding: t -*- ;; Copyright (C) 2017-2021 Free Software Foundation, Inc. ;; Author: Tak Kunihiro @@ -124,7 +124,7 @@ This is an alternative of `scroll-up'. Scope moves downward." (or arg (setq arg 1)) (if (pixel-scroll-in-rush-p) (scroll-up arg) - (dotimes (ii arg) ; move scope downward + (dotimes (_ arg) ; move scope downward (let ((amt (if pixel-resolution-fine-flag (if (integerp pixel-resolution-fine-flag) pixel-resolution-fine-flag @@ -145,7 +145,7 @@ This is and alternative of `scroll-down'. Scope moves upward." (or arg (setq arg 1)) (if (pixel-scroll-in-rush-p) (scroll-down arg) - (dotimes (ii arg) + (dotimes (_ arg) (let ((amt (if pixel-resolution-fine-flag (if (integerp pixel-resolution-fine-flag) pixel-resolution-fine-flag @@ -244,7 +244,7 @@ that was scrolled." (dst (* line height)) ; goal @25 @25 @92 (delta (- dst src))) ; pixels to be scrolled 25 17 4 (pixel--whistlestop-pixel-up (1- delta)) ; until one less @24 @24 @91 - (dotimes (ii line) + (dotimes (_ line) ;; On horizontal scrolling, move cursor. (when (> (window-hscroll) 0) (vertical-motion 1)) From 860bc0db1cdf4ec58299013074edb3a3925f9dce Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 3 Apr 2021 12:26:14 +0200 Subject: [PATCH 35/75] * test/lisp/filenotify-tests.el (file-notify--test-timeout): Change timing. ; * lisp/net/tramp-sh.el (tramp-sh-gio-monitor-process-filter): ; Remove test message. --- lisp/net/tramp-sh.el | 2 -- test/lisp/filenotify-tests.el | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 73e0807dbc1..255314a99ea 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3740,8 +3740,6 @@ Fall back to normal file name handler if no Tramp handler exists." "changes done" "changes-done-hint" string) string (tramp-compat-string-replace "renamed to" "moved" string)) - (when (getenv "EMACS_EMBA_CI") - (message "%s" string)) (catch 'doesnt-work ;; https://bugs.launchpad.net/bugs/1742946 diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index 4a2f1f9a676..cca8aeb97d4 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -117,8 +117,8 @@ There are different timeouts for local and remote file notification libraries." (defun file-notify--test-timeout () "Timeout to wait for arriving a bunch of events, in seconds." (cond + ((file-remote-p temporary-file-directory) 20) ((eq system-type 'cygwin) 10) - ((file-remote-p temporary-file-directory) 6) ((string-equal (file-notify--test-library) "w32notify") 4) (t 3))) From d47706c552eb8a8cd8caff03622201fcd78639c8 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 3 Apr 2021 12:13:52 +0200 Subject: [PATCH 36/75] ; Remove some redundant installation instructions --- lisp/textmodes/artist.el | 7 ------- lisp/vc/vc-git.el | 8 -------- lisp/vc/vc-hg.el | 2 -- 3 files changed, 17 deletions(-) diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index dc45a7306d8..22ade15921d 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -106,13 +106,6 @@ ;; If you add a new drawing mode, send it to me, and I would gladly ;; include in the next release! -;;; Installation: - -;; To use artist, put this in your .emacs: -;; -;; (autoload 'artist-mode "artist" "Enter artist-mode" t) - - ;;; Requirements: ;; Artist requires the `rect' package (which comes with Emacs) to be diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index fda8605c679..e37c09df7c2 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -27,14 +27,6 @@ ;; system. ;; -;;; Installation: - -;; To install: put this file on the load-path and add Git to the list -;; of supported backends in `vc-handled-backends'; the following line, -;; placed in your init file, will accomplish this: -;; -;; (add-to-list 'vc-handled-backends 'Git) - ;;; Todo: ;; - check if more functions could use vc-git-command instead ;; of start-process. diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 2bc6ae3524b..a054a7c3176 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -30,8 +30,6 @@ ;;; Bugs: -;;; Installation: - ;;; Todo: ;; 1) Implement the rest of the vc interface. See the comment at the From 4eca3bd8df9a1092d322eb6af7108a3ea27c21b1 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 3 Apr 2021 18:25:27 +0200 Subject: [PATCH 37/75] * lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory): Fix code finding //DIRED//. --- lisp/net/tramp-sh.el | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 255314a99ea..c3e1745d2f2 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2584,12 +2584,9 @@ The method used must be an out-of-band method." (save-restriction (narrow-to-region beg-marker end-marker) ;; Check for "--dired" output. - (forward-line -2) - (when (looking-at-p "//SUBDIRED//") - (forward-line -1)) - (when (looking-at "//DIRED//\\s-+") - (let ((beg (match-end 0)) - (end (point-at-eol))) + (when (re-search-backward "^//DIRED//\\s-+\\(.+\\)$" nil 'noerror) + (let ((beg (match-beginning 1)) + (end (match-end 0))) ;; Now read the numeric positions of file names. (goto-char beg) (while (< (point) end) @@ -2599,7 +2596,7 @@ The method used must be an out-of-band method." ;; End is followed by \n or by " -> ". (put-text-property start end 'dired-filename t)))))) ;; Remove trailing lines. - (goto-char (point-at-bol)) + (beginning-of-line) (while (looking-at "//") (forward-line 1) (delete-region (match-beginning 0) (point)))) From ebc2b78c8bffc40f3bc863d333dccc0b26def3b4 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 3 Apr 2021 14:15:43 -0400 Subject: [PATCH 38/75] * lisp/vcursor.el: Use lexical-binding Remove redundant `:group` args. (vcursor): Remove unused var declaration. --- lisp/vcursor.el | 276 +++++++++++++++++++++++------------------------- 1 file changed, 135 insertions(+), 141 deletions(-) diff --git a/lisp/vcursor.el b/lisp/vcursor.el index 595a25381ab..e219dc2d1a5 100644 --- a/lisp/vcursor.el +++ b/lisp/vcursor.el @@ -1,4 +1,4 @@ -;;; vcursor.el --- manipulate an alternative ("virtual") cursor +;;; vcursor.el --- manipulate an alternative ("virtual") cursor -*- lexical-binding: t; -*- ;; Copyright (C) 1994, 1996, 1998, 2001-2021 Free Software Foundation, ;; Inc. @@ -27,24 +27,24 @@ ;; Latest changes ;; ============== ;; -;; - *IMPORTANT* vcursor-key-bindings is now nil by default, to avoid +;; - *IMPORTANT* `vcursor-key-bindings' is now nil by default, to avoid ;; side-effects when the package is loaded. This means no keys are ;; bound by default. Use customize to change it to t to restore ;; the old behavior. (If you do it by hand in .emacs, it ;; must come before vcursor is loaded.) ;; - You can alter the main variables and the vcursor face via ;; M-x customize: go to the Editing group and find Vcursor. -;; - vcursor-auto-disable can now be 'copy (actually any value not nil +;; - `vcursor-auto-disable' can now be 'copy (actually any value not nil ;; or t), which means that copying from the vcursor will be turned ;; off after any operation not involving the vcursor, but the ;; vcursor itself will be left alone. ;; - works on dumb terminals ;; - new keymap vcursor-map for binding to a prefix key -;; - vcursor-compare-windows substantially improved -;; - vcursor-execute-{key,command} much better about using the +;; - `vcursor-compare-windows' substantially improved +;; - `vcursor-execute-{key,command}' much better about using the ;; right keymaps and arranging for the correct windows to be used -;; - vcursor-window-funcall can call functions interactively -;; - vcursor-interpret-input for special effects +;; - `vcursor-window-funcall' can call functions interactively +;; - `vcursor-interpret-input' for special effects ;; ;; Introduction ;; ============ @@ -326,21 +326,18 @@ (defface vcursor '((((class color)) (:foreground "blue" :background "cyan" :underline t)) (t (:inverse-video t :underline t))) - "Face for the virtual cursor." - :group 'vcursor) + "Face for the virtual cursor.") (defcustom vcursor-auto-disable nil "If non-nil, disable the virtual cursor after use. Any non-vcursor command will force `vcursor-disable' to be called. If non-nil but not t, just make sure copying is toggled off, but don't disable the vcursor." - :type '(choice (const t) (const nil) (const copy)) - :group 'vcursor) + :type '(choice (const t) (const nil) (const copy))) (defcustom vcursor-modifiers (list 'control 'shift) "A list of modifiers that are used to define vcursor key bindings." - :type '(repeat symbol) - :group 'vcursor) + :type '(repeat symbol)) ;; Needed for defcustom, must be up here (defun vcursor-cs-binding (base &optional meta) @@ -349,112 +346,114 @@ disable the vcursor." (cons 'meta key) key)))) +;; (defvar vcursor) + (defun vcursor-bind-keys (var value) "Alter the value of the variable VAR to VALUE, binding keys as required. VAR is usually `vcursor-key-bindings'. Normally this function is called on loading vcursor and from the customize package." (set var value) (cond - ((not value));; don't set any key bindings + ((not value)) ;; Don't set any key bindings. ((or (eq value 'oemacs) (and (eq value t) (fboundp 'oemacs-version))) - (global-set-key [C-f1] 'vcursor-toggle-copy) - (global-set-key [C-f2] 'vcursor-copy) - (global-set-key [C-f3] 'vcursor-copy-word) - (global-set-key [C-f4] 'vcursor-copy-line) + (global-set-key [C-f1] #'vcursor-toggle-copy) + (global-set-key [C-f2] #'vcursor-copy) + (global-set-key [C-f3] #'vcursor-copy-word) + (global-set-key [C-f4] #'vcursor-copy-line) - (global-set-key [S-f1] 'vcursor-disable) - (global-set-key [S-f2] 'vcursor-other-window) - (global-set-key [S-f3] 'vcursor-goto) - (global-set-key [S-f4] 'vcursor-swap-point) + (global-set-key [S-f1] #'vcursor-disable) + (global-set-key [S-f2] #'vcursor-other-window) + (global-set-key [S-f3] #'vcursor-goto) + (global-set-key [S-f4] #'vcursor-swap-point) - (global-set-key [C-f5] 'vcursor-backward-char) - (global-set-key [C-f6] 'vcursor-previous-line) - (global-set-key [C-f7] 'vcursor-next-line) - (global-set-key [C-f8] 'vcursor-forward-char) + (global-set-key [C-f5] #'vcursor-backward-char) + (global-set-key [C-f6] #'vcursor-previous-line) + (global-set-key [C-f7] #'vcursor-next-line) + (global-set-key [C-f8] #'vcursor-forward-char) - (global-set-key [M-f5] 'vcursor-beginning-of-line) - (global-set-key [M-f6] 'vcursor-backward-word) - (global-set-key [M-f6] 'vcursor-forward-word) - (global-set-key [M-f8] 'vcursor-end-of-line) + (global-set-key [M-f5] #'vcursor-beginning-of-line) + (global-set-key [M-f6] #'vcursor-backward-word) + (global-set-key [M-f6] #'vcursor-forward-word) + (global-set-key [M-f8] #'vcursor-end-of-line) - (global-set-key [S-f5] 'vcursor-beginning-of-buffer) - (global-set-key [S-f6] 'vcursor-scroll-down) - (global-set-key [S-f7] 'vcursor-scroll-up) - (global-set-key [S-f8] 'vcursor-end-of-buffer) + (global-set-key [S-f5] #'vcursor-beginning-of-buffer) + (global-set-key [S-f6] #'vcursor-scroll-down) + (global-set-key [S-f7] #'vcursor-scroll-up) + (global-set-key [S-f8] #'vcursor-end-of-buffer) - (global-set-key [C-f9] 'vcursor-isearch-forward) + (global-set-key [C-f9] #'vcursor-isearch-forward) - (global-set-key [S-f9] 'vcursor-execute-key) - (global-set-key [S-f10] 'vcursor-execute-command) + (global-set-key [S-f9] #'vcursor-execute-key) + (global-set-key [S-f10] #'vcursor-execute-command) -;;; Partial dictionary of Oemacs key sequences for you to roll your own, -;;; e.g C-S-up: (global-set-key "\M-[\C-f\M-\C-m" 'vcursor-previous-line) -;;; Sequence: Sends: -;;; "\M-[\C-f\M-\C-m" C-S-up -;;; "\M-[\C-f\M-\C-q" C-S-down -;;; "\M-[\C-fs" C-S-left -;;; "\M-[\C-ft" C-S-right -;;; -;;; "\M-[\C-fw" C-S-home -;;; "\M-[\C-b\C-o" S-tab -;;; "\M-[\C-f\M-\C-r" C-S-insert -;;; "\M-[\C-fu" C-S-end -;;; "\M-[\C-f\M-\C-s" C-S-delete -;;; "\M-[\C-f\M-\C-d" C-S-prior -;;; "\M-[\C-fv" C-S-next -;;; -;;; "\M-[\C-f^" C-S-f1 -;;; "\M-[\C-f_" C-S-f2 -;;; "\M-[\C-f`" C-S-f3 -;;; "\M-[\C-fa" C-S-f4 -;;; "\M-[\C-fb" C-S-f5 -;;; "\M-[\C-fc" C-S-f6 -;;; "\M-[\C-fd" C-S-f7 -;;; "\M-[\C-fe" C-S-f8 -;;; "\M-[\C-ff" C-S-f9 -;;; "\M-[\C-fg" C-S-f10 + ;; Partial dictionary of Oemacs key sequences for you to roll your own, + ;; e.g C-S-up: (global-set-key "\M-[\C-f\M-\C-m" 'vcursor-previous-line) + ;; Sequence: Sends: + ;; "\M-[\C-f\M-\C-m" C-S-up + ;; "\M-[\C-f\M-\C-q" C-S-down + ;; "\M-[\C-fs" C-S-left + ;; "\M-[\C-ft" C-S-right + ;; + ;; "\M-[\C-fw" C-S-home + ;; "\M-[\C-b\C-o" S-tab + ;; "\M-[\C-f\M-\C-r" C-S-insert + ;; "\M-[\C-fu" C-S-end + ;; "\M-[\C-f\M-\C-s" C-S-delete + ;; "\M-[\C-f\M-\C-d" C-S-prior + ;; "\M-[\C-fv" C-S-next + ;; + ;; "\M-[\C-f^" C-S-f1 + ;; "\M-[\C-f_" C-S-f2 + ;; "\M-[\C-f`" C-S-f3 + ;; "\M-[\C-fa" C-S-f4 + ;; "\M-[\C-fb" C-S-f5 + ;; "\M-[\C-fc" C-S-f6 + ;; "\M-[\C-fd" C-S-f7 + ;; "\M-[\C-fe" C-S-f8 + ;; "\M-[\C-ff" C-S-f9 + ;; "\M-[\C-fg" C-S-f10 ) (t - (global-set-key (vcursor-cs-binding "up") 'vcursor-previous-line) - (global-set-key (vcursor-cs-binding "down") 'vcursor-next-line) - (global-set-key (vcursor-cs-binding "left") 'vcursor-backward-char) - (global-set-key (vcursor-cs-binding "right") 'vcursor-forward-char) + (global-set-key (vcursor-cs-binding "up") #'vcursor-previous-line) + (global-set-key (vcursor-cs-binding "down") #'vcursor-next-line) + (global-set-key (vcursor-cs-binding "left") #'vcursor-backward-char) + (global-set-key (vcursor-cs-binding "right") #'vcursor-forward-char) - (global-set-key (vcursor-cs-binding "return") 'vcursor-disable) - (global-set-key (vcursor-cs-binding "insert") 'vcursor-copy) - (global-set-key (vcursor-cs-binding "delete") 'vcursor-copy-word) - (global-set-key (vcursor-cs-binding "remove") 'vcursor-copy-word) - (global-set-key (vcursor-cs-binding "tab") 'vcursor-toggle-copy) - (global-set-key (vcursor-cs-binding "backtab") 'vcursor-toggle-copy) - (global-set-key (vcursor-cs-binding "home") 'vcursor-beginning-of-buffer) - (global-set-key (vcursor-cs-binding "up" t) 'vcursor-beginning-of-buffer) - (global-set-key (vcursor-cs-binding "end") 'vcursor-end-of-buffer) - (global-set-key (vcursor-cs-binding "down" t) 'vcursor-end-of-buffer) - (global-set-key (vcursor-cs-binding "prior") 'vcursor-scroll-down) - (global-set-key (vcursor-cs-binding "next") 'vcursor-scroll-up) + (global-set-key (vcursor-cs-binding "return") #'vcursor-disable) + (global-set-key (vcursor-cs-binding "insert") #'vcursor-copy) + (global-set-key (vcursor-cs-binding "delete") #'vcursor-copy-word) + (global-set-key (vcursor-cs-binding "remove") #'vcursor-copy-word) + (global-set-key (vcursor-cs-binding "tab") #'vcursor-toggle-copy) + (global-set-key (vcursor-cs-binding "backtab") #'vcursor-toggle-copy) + (global-set-key (vcursor-cs-binding "home") #'vcursor-beginning-of-buffer) + (global-set-key (vcursor-cs-binding "up" t) #'vcursor-beginning-of-buffer) + (global-set-key (vcursor-cs-binding "end") #'vcursor-end-of-buffer) + (global-set-key (vcursor-cs-binding "down" t) #'vcursor-end-of-buffer) + (global-set-key (vcursor-cs-binding "prior") #'vcursor-scroll-down) + (global-set-key (vcursor-cs-binding "next") #'vcursor-scroll-up) - (global-set-key (vcursor-cs-binding "f6") 'vcursor-other-window) - (global-set-key (vcursor-cs-binding "f7") 'vcursor-goto) + (global-set-key (vcursor-cs-binding "f6") #'vcursor-other-window) + (global-set-key (vcursor-cs-binding "f7") #'vcursor-goto) (global-set-key (vcursor-cs-binding "select") - 'vcursor-swap-point) ; DEC keyboards - (global-set-key (vcursor-cs-binding "tab" t) 'vcursor-swap-point) + #'vcursor-swap-point) ; DEC keyboards + (global-set-key (vcursor-cs-binding "tab" t) #'vcursor-swap-point) (global-set-key (vcursor-cs-binding "find") - 'vcursor-isearch-forward) ; DEC keyboards - (global-set-key (vcursor-cs-binding "f8") 'vcursor-isearch-forward) + #'vcursor-isearch-forward) ; DEC keyboards + (global-set-key (vcursor-cs-binding "f8") #'vcursor-isearch-forward) - (global-set-key (vcursor-cs-binding "left" t) 'vcursor-beginning-of-line) - (global-set-key (vcursor-cs-binding "right" t) 'vcursor-end-of-line) + (global-set-key (vcursor-cs-binding "left" t) #'vcursor-beginning-of-line) + (global-set-key (vcursor-cs-binding "right" t) #'vcursor-end-of-line) - (global-set-key (vcursor-cs-binding "prior" t) 'vcursor-backward-word) - (global-set-key (vcursor-cs-binding "next" t) 'vcursor-forward-word) + (global-set-key (vcursor-cs-binding "prior" t) #'vcursor-backward-word) + (global-set-key (vcursor-cs-binding "next" t) #'vcursor-forward-word) - (global-set-key (vcursor-cs-binding "return" t) 'vcursor-copy-line) + (global-set-key (vcursor-cs-binding "return" t) #'vcursor-copy-line) - (global-set-key (vcursor-cs-binding "f9") 'vcursor-execute-key) - (global-set-key (vcursor-cs-binding "f10") 'vcursor-execute-command) + (global-set-key (vcursor-cs-binding "f9") #'vcursor-execute-key) + (global-set-key (vcursor-cs-binding "f10") #'vcursor-execute-command) ))) (defcustom vcursor-key-bindings nil @@ -465,8 +464,7 @@ define any key bindings. Default is nil." :type '(choice (const t) (const nil) (const xterm) (const oemacs)) - :group 'vcursor - :set 'vcursor-bind-keys + :set #'vcursor-bind-keys :version "20.3") (defcustom vcursor-interpret-input nil @@ -475,13 +473,11 @@ This will cause text insertion to be much slower. Note that no special interpretation of strings is done: \"\C-x\" is a string of four characters. The default is simply to copy strings." :type 'boolean - :group 'vcursor :version "20.3") (defcustom vcursor-string "**>" "String used to show the vcursor position on dumb terminals." :type 'string - :group 'vcursor :version "20.3") (defvar vcursor-overlay nil @@ -501,42 +497,41 @@ scrolling set this. It is used by the `vcursor-auto-disable' code.") (defcustom vcursor-copy-flag nil "Non-nil means moving vcursor should copy characters moved over to point." - :type 'boolean - :group 'vcursor) + :type 'boolean) (defvar vcursor-temp-goal-column nil "Keeps track of temporary goal columns for the virtual cursor.") (defvar vcursor-map (let ((map (make-sparse-keymap))) - (define-key map "t" 'vcursor-use-vcursor-map) + (define-key map "t" #'vcursor-use-vcursor-map) - (define-key map "\C-p" 'vcursor-previous-line) - (define-key map "\C-n" 'vcursor-next-line) - (define-key map "\C-b" 'vcursor-backward-char) - (define-key map "\C-f" 'vcursor-forward-char) + (define-key map "\C-p" #'vcursor-previous-line) + (define-key map "\C-n" #'vcursor-next-line) + (define-key map "\C-b" #'vcursor-backward-char) + (define-key map "\C-f" #'vcursor-forward-char) - (define-key map "\r" 'vcursor-disable) - (define-key map " " 'vcursor-copy) - (define-key map "\C-y" 'vcursor-copy-word) - (define-key map "\C-i" 'vcursor-toggle-copy) - (define-key map "<" 'vcursor-beginning-of-buffer) - (define-key map ">" 'vcursor-end-of-buffer) - (define-key map "\M-v" 'vcursor-scroll-down) - (define-key map "\C-v" 'vcursor-scroll-up) - (define-key map "o" 'vcursor-other-window) - (define-key map "g" 'vcursor-goto) - (define-key map "x" 'vcursor-swap-point) - (define-key map "\C-s" 'vcursor-isearch-forward) - (define-key map "\C-r" 'vcursor-isearch-backward) - (define-key map "\C-a" 'vcursor-beginning-of-line) - (define-key map "\C-e" 'vcursor-end-of-line) - (define-key map "\M-w" 'vcursor-forward-word) - (define-key map "\M-b" 'vcursor-backward-word) - (define-key map "\M-l" 'vcursor-copy-line) - (define-key map "c" 'vcursor-compare-windows) - (define-key map "k" 'vcursor-execute-key) - (define-key map "\M-x" 'vcursor-execute-command) + (define-key map "\r" #'vcursor-disable) + (define-key map " " #'vcursor-copy) + (define-key map "\C-y" #'vcursor-copy-word) + (define-key map "\C-i" #'vcursor-toggle-copy) + (define-key map "<" #'vcursor-beginning-of-buffer) + (define-key map ">" #'vcursor-end-of-buffer) + (define-key map "\M-v" #'vcursor-scroll-down) + (define-key map "\C-v" #'vcursor-scroll-up) + (define-key map "o" #'vcursor-other-window) + (define-key map "g" #'vcursor-goto) + (define-key map "x" #'vcursor-swap-point) + (define-key map "\C-s" #'vcursor-isearch-forward) + (define-key map "\C-r" #'vcursor-isearch-backward) + (define-key map "\C-a" #'vcursor-beginning-of-line) + (define-key map "\C-e" #'vcursor-end-of-line) + (define-key map "\M-w" #'vcursor-forward-word) + (define-key map "\M-b" #'vcursor-backward-word) + (define-key map "\M-l" #'vcursor-copy-line) + (define-key map "c" #'vcursor-compare-windows) + (define-key map "k" #'vcursor-execute-key) + (define-key map "\M-x" #'vcursor-execute-command) map) "Keymap for vcursor command.") ;; This seems unused, but it was done as part of define-prefix-command, @@ -611,7 +606,8 @@ Set `vcursor-window' to the returned value as a side effect." (cond (winok) ; choice 2 ((and vcursor-window ; choice 3 - (not (eq thiswin vcursor-window))) vcursor-window) + (not (eq thiswin vcursor-window))) + vcursor-window) (winbuf) ; choice 4 (new-win (display-buffer (current-buffer) t)) ; choice 5 (t nil))))))) ; default (choice 6) @@ -719,16 +715,14 @@ not be visible otherwise, display it in another window." The vcursor will always appear in an unselected window." (interactive "P") - (vcursor-window-funcall 'scroll-up n) -) + (vcursor-window-funcall #'scroll-up n)) (defun vcursor-scroll-down (&optional n) "Scroll down the vcursor window ARG lines or near full screen if none. The vcursor will always appear in an unselected window." (interactive "P") - (vcursor-window-funcall 'scroll-down n) - ) + (vcursor-window-funcall #'scroll-down n)) (defun vcursor-isearch-forward (&optional rep norecurs) "Perform forward incremental search in the virtual cursor window. @@ -736,7 +730,7 @@ The virtual cursor is moved to the resulting point; the ordinary cursor stays where it was." (interactive "P") - (vcursor-window-funcall 'isearch-forward rep norecurs) + (vcursor-window-funcall #'isearch-forward rep norecurs) ) (defun vcursor-isearch-backward (&optional rep norecurs) @@ -745,7 +739,7 @@ The virtual cursor is moved to the resulting point; the ordinary cursor stays where it was." (interactive "P") - (vcursor-window-funcall 'isearch-backward rep norecurs) + (vcursor-window-funcall #'isearch-backward rep norecurs) ) (defun vcursor-window-funcall (func &rest args) @@ -891,7 +885,7 @@ A prefix argument, if any, means ignore changes in whitespace. The variable `compare-windows-whitespace' controls how whitespace is skipped. If `compare-ignore-case' is non-nil, changes in case are also ignored." (interactive "P") - ;; (vcursor-window-funcall 'compare-windows arg) + ;; (vcursor-window-funcall #'compare-windows arg) (require 'compare-w) (let* (p1 p2 maxp1 maxp2 b1 b2 w2 success @@ -1005,32 +999,32 @@ If `compare-ignore-case' is non-nil, changes in case are also ignored." (defun vcursor-forward-char (arg) "Move the virtual cursor forward ARG characters." (interactive "p") - (vcursor-relative-move 'forward-char arg) + (vcursor-relative-move #'forward-char arg) ) (defun vcursor-backward-char (arg) "Move the virtual cursor backward ARG characters." (interactive "p") - (vcursor-relative-move 'backward-char arg) + (vcursor-relative-move #'backward-char arg) ) (defun vcursor-forward-word (arg) "Move the virtual cursor forward ARG words." (interactive "p") - (vcursor-relative-move 'forward-word arg) + (vcursor-relative-move #'forward-word arg) ) (defun vcursor-backward-word (arg) "Move the virtual cursor backward ARG words." (interactive "p") - (vcursor-relative-move 'backward-word arg) + (vcursor-relative-move #'backward-word arg) ) (defun vcursor-beginning-of-line (arg) "Move the virtual cursor to beginning of its current line. ARG is as for `beginning-of-line'." (interactive "P") - (vcursor-relative-move 'beginning-of-line + (vcursor-relative-move #'beginning-of-line (if arg (prefix-numeric-value arg))) ) @@ -1038,7 +1032,7 @@ ARG is as for `beginning-of-line'." "Move the virtual cursor to end of its current line. ARG is as for `end-of-line'." (interactive "P") - (vcursor-relative-move 'end-of-line + (vcursor-relative-move #'end-of-line (if arg (prefix-numeric-value arg))) ) @@ -1110,7 +1104,7 @@ is called interactively, so prefix argument etc. are usable." (defun vcursor-copy-word (arg) "Copy ARG words from the virtual cursor position to point." (interactive "p") - (vcursor-copy (vcursor-get-char-count 'forward-word arg)) + (vcursor-copy (vcursor-get-char-count #'forward-word arg)) ) (defun vcursor-copy-line (arg) @@ -1123,7 +1117,7 @@ line is treated like ordinary characters." (interactive "P") (let* ((num (prefix-numeric-value arg)) - (count (vcursor-get-char-count 'end-of-line num))) + (count (vcursor-get-char-count #'end-of-line num))) (vcursor-copy (if (or (= count 0) arg) (1+ count) count))) ) @@ -1136,7 +1130,7 @@ line is treated like ordinary characters." (setq vcursor-last-command nil) ) -(add-hook 'post-command-hook 'vcursor-post-command) +(add-hook 'post-command-hook #'vcursor-post-command) (provide 'vcursor) From b0d095b2cdff7b43ab3866a2d541d18e359a4125 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 3 Apr 2021 21:53:06 +0200 Subject: [PATCH 39/75] Add SVG icons for customize buffers * etc/images/checkbox-mixed.svg: * etc/images/checked.svg: * etc/images/down.svg: * etc/images/left.svg: * etc/images/radio-checked.svg: * etc/images/radio-mixed.svg: * etc/images/radio.svg: * etc/images/right.svg: * etc/images/unchecked.svg: * etc/images/up.svg: New files from the Adwaita Icon Theme (made by the GNOME project). The background color was changed from gray to none to use the same colors as the current face instead. (Bug#47074) * etc/images/README: Add license information for the above new files. * lisp/wid-edit.el (widget-image-conversion): Prefer SVG if it exists. (radio-button): Rename radio buttons to "radio-checked" and "radio". These files did not exist before. --- etc/images/README | 27 +++++++++++++++++++++++ etc/images/checkbox-mixed.svg | 6 ++++++ etc/images/checked.svg | 6 ++++++ etc/images/down.svg | 40 +++++++++++++++++++++++++++++++++++ etc/images/left.svg | 40 +++++++++++++++++++++++++++++++++++ etc/images/radio-checked.svg | 6 ++++++ etc/images/radio-mixed.svg | 6 ++++++ etc/images/radio.svg | 3 +++ etc/images/right.svg | 40 +++++++++++++++++++++++++++++++++++ etc/images/unchecked.svg | 3 +++ etc/images/up.svg | 40 +++++++++++++++++++++++++++++++++++ lisp/wid-edit.el | 6 +++--- 12 files changed, 220 insertions(+), 3 deletions(-) create mode 100644 etc/images/checkbox-mixed.svg create mode 100644 etc/images/checked.svg create mode 100644 etc/images/down.svg create mode 100644 etc/images/left.svg create mode 100644 etc/images/radio-checked.svg create mode 100644 etc/images/radio-mixed.svg create mode 100644 etc/images/radio.svg create mode 100644 etc/images/right.svg create mode 100644 etc/images/unchecked.svg create mode 100644 etc/images/up.svg diff --git a/etc/images/README b/etc/images/README index 00aac4f510a..9bbe796cc95 100644 --- a/etc/images/README +++ b/etc/images/README @@ -104,3 +104,30 @@ same conditions. The *.pbm files were generally converted from *.xpm by running GIMP or ImageMagick's 'convert'. + + +* The following icons are from the Adwaita Icon Theme (made by the +GNOME project). They are not part of Emacs, but are distributed and +used by Emacs. They are licensed under either the GNU LGPL v3 or the +Creative Commons Attribution-Share Alike 3.0 United States License. + +To view a copy of the CC-BY-SA licence, visit +http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative +Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA. + +For more information see the adwaita-icon-theme repository at: + + https://gitlab.gnome.org/GNOME/adwaita-icon-theme + +Emacs images and their source in the Adwaita/scalable directory: + + checked.svg ui/checkbox-checked-symbolic.svg + unchecked.svg ui/checkbox-symbolic.svg + checkbox-mixed.svg ui/checkbox-mixed-symbolic.svg + radio.svg ui/radio-symbolic.svg + radio-mixed.svg ui/radio-mixed-symbolic.svg + radio-checked.svg ui/radio-checked-symbolic.svg + down.svg ui/pan-down-symbolic.svg + left.svg ui/pan-start-symbolic.svg + right.svg ui/pan-end-symbolic.svg + up.svg ui/pan-up-symbolic.svg diff --git a/etc/images/checkbox-mixed.svg b/etc/images/checkbox-mixed.svg new file mode 100644 index 00000000000..13bccaa7ce1 --- /dev/null +++ b/etc/images/checkbox-mixed.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/etc/images/checked.svg b/etc/images/checked.svg new file mode 100644 index 00000000000..6fefd5569ef --- /dev/null +++ b/etc/images/checked.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/etc/images/down.svg b/etc/images/down.svg new file mode 100644 index 00000000000..e2760427d73 --- /dev/null +++ b/etc/images/down.svg @@ -0,0 +1,40 @@ + + + + + + + + + + image/svg+xml + + Gnome Symbolic Icons + + + + + + + + + + + + + Gnome Symbolic Icons + + + + + + + + + + + + + + + diff --git a/etc/images/left.svg b/etc/images/left.svg new file mode 100644 index 00000000000..d6429bc4109 --- /dev/null +++ b/etc/images/left.svg @@ -0,0 +1,40 @@ + + + + + + + + + + image/svg+xml + + Gnome Symbolic Icons + + + + + + + + + + + + + Gnome Symbolic Icons + + + + + + + + + + + + + + + diff --git a/etc/images/radio-checked.svg b/etc/images/radio-checked.svg new file mode 100644 index 00000000000..db711841cf0 --- /dev/null +++ b/etc/images/radio-checked.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/etc/images/radio-mixed.svg b/etc/images/radio-mixed.svg new file mode 100644 index 00000000000..5a8be0cf657 --- /dev/null +++ b/etc/images/radio-mixed.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/etc/images/radio.svg b/etc/images/radio.svg new file mode 100644 index 00000000000..0d649c99cd4 --- /dev/null +++ b/etc/images/radio.svg @@ -0,0 +1,3 @@ + + + diff --git a/etc/images/right.svg b/etc/images/right.svg new file mode 100644 index 00000000000..d58cd364359 --- /dev/null +++ b/etc/images/right.svg @@ -0,0 +1,40 @@ + + + + + + + + + + image/svg+xml + + Gnome Symbolic Icons + + + + + + + + + + + + + Gnome Symbolic Icons + + + + + + + + + + + + + + + diff --git a/etc/images/unchecked.svg b/etc/images/unchecked.svg new file mode 100644 index 00000000000..18cd25b43fd --- /dev/null +++ b/etc/images/unchecked.svg @@ -0,0 +1,3 @@ + + + diff --git a/etc/images/up.svg b/etc/images/up.svg new file mode 100644 index 00000000000..9e1a245be74 --- /dev/null +++ b/etc/images/up.svg @@ -0,0 +1,40 @@ + + + + + + + + + + image/svg+xml + + Gnome Symbolic Icons + + + + + + + + + + + + + Gnome Symbolic Icons + + + + + + + + + + + + + + + diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 51c6b49e6df..49baab69199 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -750,7 +750,7 @@ automatically." :type 'boolean) (defcustom widget-image-conversion - '((xpm ".xpm") (gif ".gif") (png ".png") (jpeg ".jpg" ".jpeg") + '((svg ".svg") (xpm ".xpm") (gif ".gif") (png ".png") (jpeg ".jpg" ".jpeg") (xbm ".xbm")) "Conversion alist from image formats to file name suffixes." :group 'widgets @@ -2564,9 +2564,9 @@ Return an alist of (TYPE MATCH)." :button-suffix "" :button-prefix "" :on "(*)" - :on-glyph "radio1" + :on-glyph "radio-checked" :off "( )" - :off-glyph "radio0") + :off-glyph "radio") (defun widget-radio-button-notify (widget _child &optional event) ;; Tell daddy. From 4e1f92feb3a861f93b7a285715d03be930b41b91 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Wed, 24 Mar 2021 22:50:03 +0000 Subject: [PATCH 40/75] Implement frame-scale-factor * src/frame.c (Fframe_scale_factor): New function. (syms_of_frame): Add frame-scale-factor. * src/frame.h: Add FRAME_SCALE_FACTOR. * src/image.c: Move FRAME_SCALE_FACTOR to frame.h. --- src/frame.c | 12 ++++++++++++ src/frame.h | 7 +++++++ src/image.c | 8 -------- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/frame.c b/src/frame.c index 66ae4943ba2..784a079bffe 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3744,6 +3744,17 @@ window state change flag is reset. */) return (FRAME_WINDOW_STATE_CHANGE (f) = !NILP (arg)) ? Qt : Qnil; } +DEFUN ("frame-scale-factor", Fframe_scale_factor, Sframe_scale_factor, + 0, 1, 0, + doc: /* Return FRAMEs scale factor. +The scale factor is the amount a logical pixel size must be multiplied +to find the real number of pixels. */) + (Lisp_Object frame) +{ + struct frame *f = decode_live_frame (frame); + + return (make_float (FRAME_SCALE_FACTOR (f))); +} /*********************************************************************** Frame Parameters @@ -6457,6 +6468,7 @@ iconify the top level frame instead. */); defsubr (&Sframe_pointer_visible_p); defsubr (&Sframe_window_state_change); defsubr (&Sset_frame_window_state_change); + defsubr (&Sframe_scale_factor); #ifdef HAVE_WINDOW_SYSTEM defsubr (&Sx_get_resource); diff --git a/src/frame.h b/src/frame.h index 9ddcb4c6810..9963112036f 100644 --- a/src/frame.h +++ b/src/frame.h @@ -907,6 +907,13 @@ default_pixels_per_inch_y (void) (WINDOWP (f->minibuffer_window) \ && XFRAME (XWINDOW (f->minibuffer_window)->frame) == f) +/* Scale factor of frame F. */ +#if defined HAVE_NS +# define FRAME_SCALE_FACTOR(f) (FRAME_NS_P (f) ? ns_frame_scale_factor (f) : 1) +#else +# define FRAME_SCALE_FACTOR(f) 1; +#endif + /* Pixel width of frame F. */ #define FRAME_PIXEL_WIDTH(f) ((f)->pixel_width) diff --git a/src/image.c b/src/image.c index b85418c690d..774b7e14ea9 100644 --- a/src/image.c +++ b/src/image.c @@ -135,14 +135,6 @@ typedef struct ns_bitmap_record Bitmap_Record; # define COLOR_TABLE_SUPPORT 1 #endif -#ifdef HAVE_RSVG -#if defined HAVE_NS -# define FRAME_SCALE_FACTOR(f) ns_frame_scale_factor (f) -#else -# define FRAME_SCALE_FACTOR(f) 1; -#endif -#endif - static void image_disable_image (struct frame *, struct image *); static void image_edge_detection (struct frame *, struct image *, Lisp_Object, Lisp_Object); From 40842f67afb2931de6789237a49570f99b70404f Mon Sep 17 00:00:00 2001 From: Alan Third Date: Thu, 1 Apr 2021 23:23:19 +0100 Subject: [PATCH 41/75] Fix NSTRACE failure * src/nsterm.m ([EmacsSurface getContext]): Remove unneeded '@' symbol. --- src/nsterm.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nsterm.m b/src/nsterm.m index bf175bbd188..a6501100ca9 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -9790,7 +9790,7 @@ nswindow_orderedIndex_sort (id w1, id w2, void *c) IOSurfaceRef surface = NULL; NSTRACE ("[EmacsSurface getContextWithSize:]"); - NSTRACE_MSG (@"IOSurface count: %lu", [cache count] + (lastSurface ? 1 : 0)); + NSTRACE_MSG ("IOSurface count: %lu", [cache count] + (lastSurface ? 1 : 0)); for (id object in cache) { From 1fdbeffe3a65cb23abb43a4ea59df9553c9246f9 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Sun, 28 Mar 2021 17:52:57 +0100 Subject: [PATCH 42/75] Set CSS for SVG files * src/dispextern.h (struct image): Add font details required for the CSS. * src/image.c (free_image): Free the font family string. (search_image_cache): (uncache_image): Make image caching understand the font details. (lookup_image): Handle the font details when generating the image and looking up the cache. (svg_css_length_to_pixels): Handle 'em' when we know the font size. (svg_load_image): Generate the CSS and apply it to the SVG. (enum svg_keyword_index): (svg_format): (syms_of_image): Add ':css' attribute. * doc/lispref/display.texi (SVG Images): Add details of new svg image attributes. --- doc/lispref/display.texi | 22 +++++++++++ etc/NEWS | 9 +++++ src/dispextern.h | 5 +++ src/image.c | 84 +++++++++++++++++++++++++++++++++------- 4 files changed, 105 insertions(+), 15 deletions(-) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 2e1b4a6b669..68d7e827d26 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -5751,6 +5751,28 @@ Cropping is performed after scaling but before rotation. @cindex SVG images SVG (Scalable Vector Graphics) is an XML format for specifying images. +SVG images support the following additional image descriptor +properties: + +@table @code +@item :foreground @var{foreground} +@var{foreground}, if non-@code{nil}, should be a string specifying a +color, which is used as the image's foreground color. If the value is +@code{nil}, it defaults to the faces's foreground color. + +@item :background @var{background} +@var{background}, if non-@code{nil}, should be a string specifying a +color, which is used as the image's background color if the image +supports transparency. If the value is @code{nil}, it defaults to the +faces's background color. + +@item :css @var{css} +@var{css}, if non-@code{nil}, should be a string specifying the CSS to +override the default CSS used when generating the image. +@end table + +@subsubheading SVG library + If your Emacs build has SVG support, you can create and manipulate these images with the following functions from the @file{svg.el} library. diff --git a/etc/NEWS b/etc/NEWS index 2d66a93474a..c93e2e7044e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1511,6 +1511,15 @@ This controls whether to use smoothing or not for an image. Values include nil (no smoothing), t (do smoothing) or a predicate function that's called with the image object and should return nil/t. ++++ +*** SVG images now support user stylesheets. +The ':css' image attribute can be used to override the default CSS +stylesheet for an image. The default sets 'font-family' and +'font-size' to match the current face, so an image with 'height="1em"' +will match the font size in use where it is embedded. + +This feature relies on librsvg 2.48 or above being available. + ** EWW +++ diff --git a/src/dispextern.h b/src/dispextern.h index f4e872644db..a2ebd04f235 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3066,6 +3066,11 @@ struct image is created. */ unsigned long face_foreground, face_background; + /* Details of the font, only really relevant for types like SVG that + allow us to draw text. */ + int face_font_size; + char *face_font_family; + /* True if this image has a `transparent' background -- that is, is uses an image mask. The accessor macro for this is `IMAGE_BACKGROUND_TRANSPARENT'. */ diff --git a/src/image.c b/src/image.c index 774b7e14ea9..13bd503e535 100644 --- a/src/image.c +++ b/src/image.c @@ -1199,6 +1199,7 @@ free_image (struct frame *f, struct image *img) /* Free resources, then free IMG. */ img->type->free_img (f, img); + xfree (img->face_font_family); xfree (img); } } @@ -1597,7 +1598,7 @@ make_image_cache (void) static struct image * search_image_cache (struct frame *f, Lisp_Object spec, EMACS_UINT hash, unsigned long foreground, unsigned long background, - bool ignore_colors) + int font_size, char *font_family, bool ignore_colors) { struct image *img; struct image_cache *c = FRAME_IMAGE_CACHE (f); @@ -1621,7 +1622,10 @@ search_image_cache (struct frame *f, Lisp_Object spec, EMACS_UINT hash, if (img->hash == hash && !NILP (Fequal (img->spec, spec)) && (ignore_colors || (img->face_foreground == foreground - && img->face_background == background))) + && img->face_background == background + && img->face_font_size == font_size + && (font_family + &&!strcmp (font_family, img->face_font_family))))) break; return img; } @@ -1639,7 +1643,7 @@ uncache_image (struct frame *f, Lisp_Object spec) can have multiple copies of an image with the same spec. We want to remove them all to ensure the user doesn't see an old version of the image when the face changes. */ - while ((img = search_image_cache (f, spec, hash, 0, 0, true))) + while ((img = search_image_cache (f, spec, hash, 0, 0, 0, NULL, true))) { free_image (f, img); /* As display glyphs may still be referring to the image ID, we @@ -2411,6 +2415,8 @@ lookup_image (struct frame *f, Lisp_Object spec, int face_id) struct face *face = FACE_FROM_ID (f, face_id); unsigned long foreground = FACE_COLOR_TO_PIXEL (face->foreground, f); unsigned long background = FACE_COLOR_TO_PIXEL (face->background, f); + int font_size = face->font->pixel_size; + char *font_family = SSDATA (face->lface[LFACE_FAMILY_INDEX]); /* F must be a window-system frame, and SPEC must be a valid image specification. */ @@ -2419,7 +2425,8 @@ lookup_image (struct frame *f, Lisp_Object spec, int face_id) /* Look up SPEC in the hash table of the image cache. */ hash = sxhash (spec); - img = search_image_cache (f, spec, hash, foreground, background, false); + img = search_image_cache (f, spec, hash, foreground, background, + font_size, font_family, false); if (img && img->load_failed_p) { free_image (f, img); @@ -2434,6 +2441,9 @@ lookup_image (struct frame *f, Lisp_Object spec, int face_id) cache_image (f, img); img->face_foreground = foreground; img->face_background = background; + img->face_font_size = font_size; + img->face_font_family = malloc (strlen (font_family) + 1); + strcpy (img->face_font_family, font_family); img->load_failed_p = ! img->type->load_img (f, img); /* If we can't load the image, and we don't have a width and @@ -9532,6 +9542,7 @@ enum svg_keyword_index SVG_DATA, SVG_FILE, SVG_BASE_URI, + SVG_CSS, SVG_ASCENT, SVG_MARGIN, SVG_RELIEF, @@ -9552,6 +9563,7 @@ static const struct image_keyword svg_format[SVG_LAST] = {":data", IMAGE_STRING_VALUE, 0}, {":file", IMAGE_STRING_VALUE, 0}, {":base-uri", IMAGE_STRING_VALUE, 0}, + {":css", IMAGE_STRING_VALUE, 0}, {":ascent", IMAGE_ASCENT_VALUE, 0}, {":margin", IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR, 0}, {":relief", IMAGE_INTEGER_VALUE, 0}, @@ -9838,7 +9850,7 @@ svg_load (struct frame *f, struct image *img) #if LIBRSVG_CHECK_VERSION (2, 46, 0) static double -svg_css_length_to_pixels (RsvgLength length, double dpi) +svg_css_length_to_pixels (RsvgLength length, double dpi, int font_size) { double value = length.length; @@ -9866,9 +9878,16 @@ svg_css_length_to_pixels (RsvgLength length, double dpi) case RSVG_UNIT_IN: value *= dpi; break; +#if LIBRSVG_CHECK_VERSION (2, 48, 0) + /* We don't know exactly what font size is used on older librsvg + versions. */ + case RSVG_UNIT_EM: + value *= font_size; + break; +#endif default: - /* Probably one of em, ex, or %. We can't know what the pixel - value is without more information. */ + /* Probably ex or %. We can't know what the pixel value is + without more information. */ value = 0; } @@ -9923,6 +9942,27 @@ svg_load_image (struct frame *f, struct image *img, char *contents, rsvg_handle_set_dpi_x_y (rsvg_handle, FRAME_DISPLAY_INFO (f)->resx, FRAME_DISPLAY_INFO (f)->resy); + +#if LIBRSVG_CHECK_VERSION (2, 48, 0) + char *css; + Lisp_Object lcss = image_spec_value (img->spec, QCcss, NULL); + if (!STRINGP (lcss)) + { + /* Generate the CSS for the SVG image. */ + char *css_spec = "svg{font-family:\"%s\";font-size:%4dpx}"; + int css_len = strlen (css_spec) + strlen (img->face_font_family); + css = xmalloc (css_len); + snprintf (css, css_len, css_spec, img->face_font_family, img->face_font_size); + rsvg_handle_set_stylesheet (rsvg_handle, css, strlen (css), NULL); + } + else + { + css = xmalloc (SBYTES (lcss) + 1); + strncpy (css, SSDATA (lcss), SBYTES (lcss)); + *(css + SBYTES (lcss) + 1) = 0; + } +#endif + #else /* Make a handle to a new rsvg object. */ rsvg_handle = rsvg_handle_new (); @@ -9965,20 +10005,20 @@ svg_load_image (struct frame *f, struct image *img, char *contents, if (has_width && has_height) { /* Success! We can use these values directly. */ - viewbox_width = svg_css_length_to_pixels (iwidth, dpi); - viewbox_height = svg_css_length_to_pixels (iheight, dpi); + viewbox_width = svg_css_length_to_pixels (iwidth, dpi, img->face_font_size); + viewbox_height = svg_css_length_to_pixels (iheight, dpi, img->face_font_size); } else if (has_width && has_viewbox) { - viewbox_width = svg_css_length_to_pixels (iwidth, dpi); - viewbox_height = svg_css_length_to_pixels (iwidth, dpi) - * viewbox.width / viewbox.height; + viewbox_width = svg_css_length_to_pixels (iwidth, dpi, img->face_font_size); + viewbox_height = svg_css_length_to_pixels (iwidth, dpi, img->face_font_size) + * viewbox.height / viewbox.width; } else if (has_height && has_viewbox) { - viewbox_height = svg_css_length_to_pixels (iheight, dpi); - viewbox_width = svg_css_length_to_pixels (iheight, dpi) - * viewbox.height / viewbox.width; + viewbox_height = svg_css_length_to_pixels (iheight, dpi, img->face_font_size); + viewbox_width = svg_css_length_to_pixels (iheight, dpi, img->face_font_size) + * viewbox.width / viewbox.height; } else if (has_viewbox) { @@ -10099,6 +10139,10 @@ svg_load_image (struct frame *f, struct image *img, char *contents, rsvg_handle_set_dpi_x_y (rsvg_handle, FRAME_DISPLAY_INFO (f)->resx, FRAME_DISPLAY_INFO (f)->resy); + +#if LIBRSVG_CHECK_VERSION (2, 48, 0) + rsvg_handle_set_stylesheet (rsvg_handle, css, strlen (css), NULL); +#endif #else /* Make a handle to a new rsvg object. */ rsvg_handle = rsvg_handle_new (); @@ -10132,6 +10176,11 @@ svg_load_image (struct frame *f, struct image *img, char *contents, g_object_unref (rsvg_handle); xfree (wrapped_contents); +#if LIBRSVG_CHECK_VERSION (2, 48, 0) + if (!STRINGP (lcss)) + xfree (css); +#endif + /* Extract some meta data from the svg handle. */ width = gdk_pixbuf_get_width (pixbuf); height = gdk_pixbuf_get_height (pixbuf); @@ -10202,6 +10251,10 @@ svg_load_image (struct frame *f, struct image *img, char *contents, g_object_unref (rsvg_handle); if (wrapped_contents) xfree (wrapped_contents); +#if LIBRSVG_CHECK_VERSION (2, 48, 0) + if (css && !STRINGP (lcss)) + xfree (css); +#endif /* FIXME: Use error->message so the user knows what is the actual problem with the image. */ image_error ("Error parsing SVG image `%s'", img->spec); @@ -10793,6 +10846,7 @@ non-numeric, there is no explicit limit on the size of images. */); #if defined (HAVE_RSVG) DEFSYM (Qsvg, "svg"); DEFSYM (QCbase_uri, ":base-uri"); + DEFSYM (QCcss, ":css"); add_image_type (Qsvg); #ifdef HAVE_NTGUI /* Other libraries used directly by svg code. */ From 0689a4ac508a213f29c11ed6230596885d42f89b Mon Sep 17 00:00:00 2001 From: Alan Third Date: Sat, 3 Apr 2021 23:23:54 +0100 Subject: [PATCH 43/75] Make new SVG widgets match character height (bug#47074) * etc/images/checkbox-mixed.svg: * etc/images/checked.svg: * etc/images/radio-checked.svg: * etc/images/radio-mixed.svg: * etc/images/radio.svg: * etc/images/unchecked.svg: Use viewBox and set height to 1em. --- etc/images/checkbox-mixed.svg | 2 +- etc/images/checked.svg | 2 +- etc/images/radio-checked.svg | 2 +- etc/images/radio-mixed.svg | 2 +- etc/images/radio.svg | 2 +- etc/images/unchecked.svg | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/etc/images/checkbox-mixed.svg b/etc/images/checkbox-mixed.svg index 13bccaa7ce1..647a0ccf9b4 100644 --- a/etc/images/checkbox-mixed.svg +++ b/etc/images/checkbox-mixed.svg @@ -1,4 +1,4 @@ - + diff --git a/etc/images/checked.svg b/etc/images/checked.svg index 6fefd5569ef..b84dde1c3a5 100644 --- a/etc/images/checked.svg +++ b/etc/images/checked.svg @@ -1,4 +1,4 @@ - + diff --git a/etc/images/radio-checked.svg b/etc/images/radio-checked.svg index db711841cf0..5354324c34a 100644 --- a/etc/images/radio-checked.svg +++ b/etc/images/radio-checked.svg @@ -1,4 +1,4 @@ - + diff --git a/etc/images/radio-mixed.svg b/etc/images/radio-mixed.svg index 5a8be0cf657..e2a6fcae57d 100644 --- a/etc/images/radio-mixed.svg +++ b/etc/images/radio-mixed.svg @@ -1,4 +1,4 @@ - + diff --git a/etc/images/radio.svg b/etc/images/radio.svg index 0d649c99cd4..2593a78610e 100644 --- a/etc/images/radio.svg +++ b/etc/images/radio.svg @@ -1,3 +1,3 @@ - + diff --git a/etc/images/unchecked.svg b/etc/images/unchecked.svg index 18cd25b43fd..7cc15162201 100644 --- a/etc/images/unchecked.svg +++ b/etc/images/unchecked.svg @@ -1,3 +1,3 @@ - + From 55c768f3ea7da76328641c2db9aa922564b0a1f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0=2E=20G=C3=B6ktu=C4=9F=20Kayaalp?= Date: Sun, 4 Apr 2021 04:14:29 +0200 Subject: [PATCH 44/75] Fix build error in frame.h on non-NS * src/frame.h (FRAME_SCALE_FACTOR): Fix syntax of macro in previous change. --- src/frame.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frame.h b/src/frame.h index 9963112036f..0fd95e4dd3c 100644 --- a/src/frame.h +++ b/src/frame.h @@ -911,7 +911,7 @@ default_pixels_per_inch_y (void) #if defined HAVE_NS # define FRAME_SCALE_FACTOR(f) (FRAME_NS_P (f) ? ns_frame_scale_factor (f) : 1) #else -# define FRAME_SCALE_FACTOR(f) 1; +# define FRAME_SCALE_FACTOR(f) 1 #endif /* Pixel width of frame F. */ From 69158a19956656c52208cbe8c11134eeed8ca867 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 4 Apr 2021 09:41:44 +0300 Subject: [PATCH 45/75] Fix recent changes regarding frame-scale-factor * src/frame.c (Fframe_scale_factor): Make more robust and avoid compiler warning while at that. Doc fix. --- src/frame.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frame.c b/src/frame.c index 784a079bffe..bbdc3b55992 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3747,13 +3747,13 @@ window state change flag is reset. */) DEFUN ("frame-scale-factor", Fframe_scale_factor, Sframe_scale_factor, 0, 1, 0, doc: /* Return FRAMEs scale factor. -The scale factor is the amount a logical pixel size must be multiplied -to find the real number of pixels. */) +The scale factor is the amount by which a logical pixel size must be +multiplied to find the real number of pixels. */) (Lisp_Object frame) { struct frame *f = decode_live_frame (frame); - return (make_float (FRAME_SCALE_FACTOR (f))); + return (make_float (f ? FRAME_SCALE_FACTOR (f) : 1)); } /*********************************************************************** From 44ed8f6555288f00b982f21e68ac5a51372279de Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 4 Apr 2021 10:10:00 +0300 Subject: [PATCH 46/75] Fix unexec compilation * src/pdumper.c (thaw_hash_tables): Now conditioned by HAVE_PDUMPER. (init_pdumper_once): No-op unless HAVE_PDUMPER. Reported by Nikolay Kudryavtsev . --- src/pdumper.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pdumper.c b/src/pdumper.c index fdd9b3bacb4..d32a147a3c2 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -5463,9 +5463,6 @@ Value is nil if this session was not started using a dump file.*/) Fcons (Qdump_file_name, dump_fn)); } -#endif /* HAVE_PDUMPER */ - - static void thaw_hash_tables (void) { @@ -5474,10 +5471,15 @@ thaw_hash_tables (void) hash_table_thaw (AREF (hash_tables, i)); } +#endif /* HAVE_PDUMPER */ + + void init_pdumper_once (void) { +#ifdef HAVE_PDUMPER pdumper_do_now_and_after_load (thaw_hash_tables); +#endif } void From 841b11ed0d534d707f54160f8c7efe3b883eb3ed Mon Sep 17 00:00:00 2001 From: Alan Third Date: Sun, 4 Apr 2021 11:25:49 +0100 Subject: [PATCH 47/75] Fix warnings in image.c * src/image.c (svg_load_image): Fix types and move declaration of 'css' to the top of the function. --- src/image.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/image.c b/src/image.c index 13bd503e535..08e937e501f 100644 --- a/src/image.c +++ b/src/image.c @@ -9917,6 +9917,10 @@ svg_load_image (struct frame *f, struct image *img, char *contents, char *wrapped_contents = NULL; ptrdiff_t wrapped_size; +#if LIBRSVG_CHECK_VERSION (2, 48, 0) + char *css = NULL; +#endif + #if ! GLIB_CHECK_VERSION (2, 36, 0) /* g_type_init is a glib function that must be called prior to using gnome type library functions (obsolete since 2.36.0). */ @@ -9944,16 +9948,15 @@ svg_load_image (struct frame *f, struct image *img, char *contents, FRAME_DISPLAY_INFO (f)->resy); #if LIBRSVG_CHECK_VERSION (2, 48, 0) - char *css; Lisp_Object lcss = image_spec_value (img->spec, QCcss, NULL); if (!STRINGP (lcss)) { /* Generate the CSS for the SVG image. */ - char *css_spec = "svg{font-family:\"%s\";font-size:%4dpx}"; + const char *css_spec = "svg{font-family:\"%s\";font-size:%4dpx}"; int css_len = strlen (css_spec) + strlen (img->face_font_family); css = xmalloc (css_len); snprintf (css, css_len, css_spec, img->face_font_family, img->face_font_size); - rsvg_handle_set_stylesheet (rsvg_handle, css, strlen (css), NULL); + rsvg_handle_set_stylesheet (rsvg_handle, (guint8 *)css, strlen (css), NULL); } else { @@ -10141,7 +10144,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents, FRAME_DISPLAY_INFO (f)->resy); #if LIBRSVG_CHECK_VERSION (2, 48, 0) - rsvg_handle_set_stylesheet (rsvg_handle, css, strlen (css), NULL); + rsvg_handle_set_stylesheet (rsvg_handle, (guint8 *)css, strlen (css), NULL); #endif #else /* Make a handle to a new rsvg object. */ From 4865ded5516a6e6705136c5b87466f864925ff96 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 4 Apr 2021 13:06:33 +0200 Subject: [PATCH 48/75] Remove redundant #' before lambda in tests * test/lisp/electric-tests.el (save-electric-modes) (inhibit-in-mismatched-string-inside-ruby-comments) (inhibit-in-mismatched-string-inside-c-comments, js-mode-braces) (js-mode-braces-with-layout) (js-mode-braces-with-layout-and-indent, autowrapping-1) (autowrapping-2, autowrapping-3, autowrapping-4, autowrapping-5) (autowrapping-6, autowrapping-7): * test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-relative-to-project-root): * test/src/thread-tests.el (threads-signal-early) (threads-signal-main-thread): Remove redundant #' before lambda. --- test/lisp/electric-tests.el | 90 +++++++++++++++---------------- test/lisp/progmodes/xref-tests.el | 2 +- test/src/thread-tests.el | 6 +-- 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el index 44b3d8b672f..235c02f8e8b 100644 --- a/test/lisp/electric-tests.el +++ b/test/lisp/electric-tests.el @@ -47,7 +47,7 @@ (defmacro save-electric-modes (&rest body) (declare (indent defun) (debug t)) - `(call-with-saved-electric-modes #'(lambda () ,@body))) + `(call-with-saved-electric-modes (lambda () ,@body))) (defun electric-pair-test-for (fixture where char expected-string expected-point mode bindings @@ -359,7 +359,7 @@ baz\"\"" # \" # baz\"\"" - :fixture-fn #'(lambda () (goto-char (point-min)) (search-forward "bar"))) + :fixture-fn (lambda () (goto-char (point-min)) (search-forward "bar"))) (define-electric-pair-test inhibit-in-mismatched-string-inside-c-comments "foo\"\"/* @@ -378,7 +378,7 @@ baz\"\"" \" \" \" */baz\"\"" - :fixture-fn #'(lambda () (goto-char (point-min)) (search-forward "bar"))) + :fixture-fn (lambda () (goto-char (point-min)) (search-forward "bar"))) ;;; More quotes, but now don't bind `electric-pair-text-syntax-table' @@ -520,8 +520,8 @@ baz\"\"" (define-electric-pair-test js-mode-braces "" "{" :expected-string "{}" :expected-point 2 :modes '(js-mode) - :fixture-fn #'(lambda () - (electric-pair-mode 1))) + :fixture-fn (lambda () + (electric-pair-mode 1))) (define-electric-pair-test js-mode-braces-with-layout @@ -529,29 +529,29 @@ baz\"\"" :modes '(js-mode) :test-in-comments nil :test-in-strings nil - :fixture-fn #'(lambda () - (electric-layout-mode 1) - (electric-pair-mode 1))) + :fixture-fn (lambda () + (electric-layout-mode 1) + (electric-pair-mode 1))) (define-electric-pair-test js-mode-braces-with-layout-and-indent "" "{" :expected-string "{\n \n}" :expected-point 7 :modes '(js-mode) :test-in-comments nil :test-in-strings nil - :fixture-fn #'(lambda () - (electric-pair-mode 1) - (electric-indent-mode 1) - (electric-layout-mode 1))) + :fixture-fn (lambda () + (electric-pair-mode 1) + (electric-indent-mode 1) + (electric-layout-mode 1))) (define-electric-pair-test js-mode-braces-with-layout-and-indent "" "{" :expected-string "{\n \n}" :expected-point 7 :modes '(js-mode) :test-in-comments nil :test-in-strings nil - :fixture-fn #'(lambda () - (electric-pair-mode 1) - (electric-indent-mode 1) - (electric-layout-mode 1))) + :fixture-fn (lambda () + (electric-pair-mode 1) + (electric-indent-mode 1) + (electric-layout-mode 1))) ;;; Backspacing @@ -606,55 +606,55 @@ baz\"\"" ;;; (define-electric-pair-test autowrapping-1 "foo" "(" :expected-string "(foo)" :expected-point 2 - :fixture-fn #'(lambda () - (electric-pair-mode 1) - (mark-sexp 1))) + :fixture-fn (lambda () + (electric-pair-mode 1) + (mark-sexp 1))) (define-electric-pair-test autowrapping-2 "foo" ")" :expected-string "(foo)" :expected-point 6 - :fixture-fn #'(lambda () - (electric-pair-mode 1) - (mark-sexp 1))) + :fixture-fn (lambda () + (electric-pair-mode 1) + (mark-sexp 1))) (define-electric-pair-test autowrapping-3 "foo" ")" :expected-string "(foo)" :expected-point 6 - :fixture-fn #'(lambda () - (electric-pair-mode 1) - (goto-char (point-max)) - (skip-chars-backward "\"") - (mark-sexp -1))) + :fixture-fn (lambda () + (electric-pair-mode 1) + (goto-char (point-max)) + (skip-chars-backward "\"") + (mark-sexp -1))) (define-electric-pair-test autowrapping-4 "foo" "(" :expected-string "(foo)" :expected-point 2 - :fixture-fn #'(lambda () - (electric-pair-mode 1) - (goto-char (point-max)) - (skip-chars-backward "\"") - (mark-sexp -1))) + :fixture-fn (lambda () + (electric-pair-mode 1) + (goto-char (point-max)) + (skip-chars-backward "\"") + (mark-sexp -1))) (define-electric-pair-test autowrapping-5 "foo" "\"" :expected-string "\"foo\"" :expected-point 2 - :fixture-fn #'(lambda () - (electric-pair-mode 1) - (mark-sexp 1))) + :fixture-fn (lambda () + (electric-pair-mode 1) + (mark-sexp 1))) (define-electric-pair-test autowrapping-6 "foo" "\"" :expected-string "\"foo\"" :expected-point 6 - :fixture-fn #'(lambda () - (electric-pair-mode 1) - (goto-char (point-max)) - (skip-chars-backward "\"") - (mark-sexp -1))) + :fixture-fn (lambda () + (electric-pair-mode 1) + (goto-char (point-max)) + (skip-chars-backward "\"") + (mark-sexp -1))) (define-electric-pair-test autowrapping-7 "foo" "\"" :expected-string "``foo''" :expected-point 8 :modes '(tex-mode) :test-in-comments nil - :fixture-fn #'(lambda () - (electric-pair-mode 1) - (goto-char (point-max)) - (skip-chars-backward "\"") - (mark-sexp -1))) + :fixture-fn (lambda () + (electric-pair-mode 1) + (goto-char (point-max)) + (skip-chars-backward "\"") + (mark-sexp -1))) ;;; Electric quotes diff --git a/test/lisp/progmodes/xref-tests.el b/test/lisp/progmodes/xref-tests.el index 9982c32d41d..c25bbd94775 100644 --- a/test/lisp/progmodes/xref-tests.el +++ b/test/lisp/progmodes/xref-tests.el @@ -143,7 +143,7 @@ (let* ((data-parent-dir (file-name-directory (directory-file-name xref-tests--data-dir))) (project-find-functions - #'(lambda (_) (cons 'transient data-parent-dir))) + (lambda (_) (cons 'transient data-parent-dir))) (xref-file-name-display 'project-relative) ;; Some older BSD find versions can produce '//' in the output. (expected (list diff --git a/test/src/thread-tests.el b/test/src/thread-tests.el index f14d2426ef0..0e1ca76fd9c 100644 --- a/test/src/thread-tests.el +++ b/test/src/thread-tests.el @@ -315,8 +315,8 @@ "Test signaling a thread as soon as it is started by the OS." (skip-unless (featurep 'threads)) (let ((thread - (make-thread #'(lambda () - (while t (thread-yield)))))) + (make-thread (lambda () + (while t (thread-yield)))))) (thread-signal thread 'error nil) (sit-for 1) (should-not (thread-live-p thread)) @@ -331,7 +331,7 @@ (let (buffer-read-only) (erase-buffer)) (let ((thread - (make-thread #'(lambda () (thread-signal main-thread 'error nil))))) + (make-thread (lambda () (thread-signal main-thread 'error nil))))) (while (thread-live-p thread) (thread-yield)) (read-event nil nil 0.1) From 523fb9b5503a7ecdb8e79e2e0269b901f6a6f233 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 4 Apr 2021 13:23:40 +0200 Subject: [PATCH 49/75] Use lexical-binding in hilit-chg.el * lisp/hilit-chg.el: Use lexical-binding. Remove redundant :group args. Doc and formatting fixes. (highlight-changes-mode, highlight-changes-visible-mode): Use keyword arguments. (hilit-chg-display-changes, highlight-changes-rotate-faces): Quote function symbols as such. (hilit-x, hilit-y, hilit-e): Define variables on top-level to silence the byte-compiler. (highlight-markup-buffers): Improve message format. --- lisp/hilit-chg.el | 117 +++++++++++++++++----------------------------- 1 file changed, 43 insertions(+), 74 deletions(-) diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el index 89a1a9108c4..3c3c4073986 100644 --- a/lisp/hilit-chg.el +++ b/lisp/hilit-chg.el @@ -1,4 +1,4 @@ -;;; hilit-chg.el --- minor mode displaying buffer changes with special face +;;; hilit-chg.el --- minor mode displaying buffer changes with special face -*- lexical-binding: t -*- ;; Copyright (C) 1998, 2000-2021 Free Software Foundation, Inc. @@ -68,8 +68,7 @@ ;; (defun my-highlight-changes-mode-hook () ;; (if highlight-changes-mode ;; (add-hook 'write-file-functions 'highlight-changes-rotate-faces nil t) -;; (remove-hook 'write-file-functions 'highlight-changes-rotate-faces t) -;; )) +;; (remove-hook 'write-file-functions 'highlight-changes-rotate-faces t))) ;; Automatically enabling Highlight Changes mode @@ -114,16 +113,16 @@ ;; Possible bindings: -;; (global-set-key '[C-right] 'highlight-changes-next-change) -;; (global-set-key '[C-left] 'highlight-changes-previous-change) +;; (global-set-key '[C-right] #'highlight-changes-next-change) +;; (global-set-key '[C-left] #'highlight-changes-previous-change) ;; ;; Other interactive functions (that could be bound if desired): -;; highlight-changes-mode -;; highlight-changes-toggle-visibility -;; highlight-changes-remove-highlight -;; highlight-compare-with-file -;; highlight-compare-buffers -;; highlight-changes-rotate-faces +;; `highlight-changes-mode' +;; `highlight-changes-toggle-visibility' +;; `highlight-changes-remove-highlight' +;; `highlight-compare-with-file' +;; `highlight-compare-buffers' +;; `highlight-changes-rotate-faces' ;;; Bugs: @@ -179,7 +178,6 @@ :version "20.4" :group 'faces) - ;; Face information: How the changes appear. ;; Defaults for face: red foreground, no change to background, @@ -192,22 +190,20 @@ '((((min-colors 88) (class color)) (:foreground "red1")) (((class color)) (:foreground "red" )) (t (:inverse-video t))) - "Face used for highlighting changes." - :group 'highlight-changes) + "Face used for highlighting changes.") ;; This looks pretty ugly, actually. Maybe the underline should be removed. (defface highlight-changes-delete '((((min-colors 88) (class color)) (:foreground "red1" :underline t)) (((class color)) (:foreground "red" :underline t)) (t (:inverse-video t))) - "Face used for highlighting deletions." - :group 'highlight-changes) + "Face used for highlighting deletions.") ;; A (not very good) default list of colors to rotate through. (defcustom highlight-changes-colors (if (eq (frame-parameter nil 'background-mode) 'light) ;; defaults for light background: - '( "magenta" "blue" "darkgreen" "chocolate" "sienna4" "NavyBlue") + '("magenta" "blue" "darkgreen" "chocolate" "sienna4" "NavyBlue") ;; defaults for dark background: '("yellow" "magenta" "blue" "maroon" "firebrick" "green4" "DarkOrchid")) "Colors used by `highlight-changes-rotate-faces'. @@ -218,8 +214,7 @@ This list is used if `highlight-changes-face-list' is nil, otherwise that variable overrides this list. If you only care about foreground colors then use this, if you want fancier faces then set `highlight-changes-face-list'." - :type '(repeat color) - :group 'highlight-changes) + :type '(repeat color)) ;; When you invoke highlight-changes-mode, should highlight-changes-visible-mode ;; be on or off? @@ -230,8 +225,7 @@ colors then use this, if you want fancier faces then set This controls the initial value of `highlight-changes-visible-mode'. When a buffer is in Highlight Changes mode the function `highlight-changes-visible-mode' is used to toggle the mode on or off." - :type 'boolean - :group 'highlight-changes) + :type 'boolean) ;; These are the strings displayed in the mode-line for the minor mode: @@ -240,16 +234,14 @@ When a buffer is in Highlight Changes mode the function This should be set to nil if no indication is desired, or to a string with a leading space." :type '(choice string - (const :tag "None" nil)) - :group 'highlight-changes) + (const :tag "None" nil))) (defcustom highlight-changes-invisible-string " -Chg" "The string used when in Highlight Changes mode and changes are hidden. This should be set to nil if no indication is desired, or to a string with a leading space." :type '(choice string - (const :tag "None" nil)) - :group 'highlight-changes) + (const :tag "None" nil))) (defcustom highlight-changes-global-modes t "Determine whether a buffer is suitable for global Highlight Changes mode. @@ -279,9 +271,7 @@ modes only." (repeat :tag "Modes" :inline t (symbol :tag "mode"))) (function :menu-tag "determined by function" :value buffer-file-name) - (const :tag "none" nil) - ) - :group 'highlight-changes) + (const :tag "none" nil))) (defcustom highlight-changes-global-changes-existing-buffers nil "If non-nil, toggling global Highlight Changes mode affects existing buffers. @@ -290,8 +280,7 @@ created). However, if `highlight-changes-global-changes-existing-buffers' is non-nil, then turning on `global-highlight-changes-mode' will turn on Highlight Changes mode in suitable buffers, and turning the mode off will remove it from existing buffers." - :type 'boolean - :group 'highlight-changes) + :type 'boolean) ;; These are for internal use. @@ -320,9 +309,7 @@ through various faces. \\[highlight-compare-with-file] - mark text as changed by comparing this buffer with the contents of a file \\[highlight-compare-buffers] highlights differences between two buffers." - nil ;; init-value - hilit-chg-string ;; lighter - nil ;; keymap + :lighter hilit-chg-string (if (or (display-color-p) (and (fboundp 'x-display-grayscale-p) (x-display-grayscale-p))) (progn @@ -352,13 +339,8 @@ The default value can be customized with variable `highlight-changes-visibility-initial-state'. This command does not itself set Highlight Changes mode." - - t ;; init-value - nil ;; lighter - nil ;; keymap - - (hilit-chg-update) - ) + :init-value t + (hilit-chg-update)) (defun hilit-chg-cust-fix-changes-face-list (w _wc &optional event) @@ -371,12 +353,10 @@ This command does not itself set Highlight Changes mode." ;; faces are saved but not to the actual list itself. (let ((old-list (widget-value w))) (if (member 'default old-list) - (let - ((p (reverse old-list)) + (let ((p (reverse old-list)) (n (length old-list)) new-name old-name - (new-list nil) - ) + (new-list nil)) (while p (setq old-name (car p)) (setq new-name (intern (format "highlight-changes-%d" n))) @@ -396,9 +376,7 @@ This command does not itself set Highlight Changes mode." (if (equal new-list (widget-value w)) nil ;; (message "notify: no change!") (widget-value-set w new-list) - (widget-setup) - ) - ) + (widget-setup))) ;; (message "notify: no default here!") )) (let ((parent (widget-get w :parent))) @@ -417,10 +395,8 @@ Otherwise, this list will be constructed when needed from :type '(choice (repeat :notify hilit-chg-cust-fix-changes-face-list - face ) - (const :tag "Derive from highlight-changes-colors" nil) - ) - :group 'highlight-changes) + face) + (const :tag "Derive from highlight-changes-colors" nil))) (defun hilit-chg-map-changes (func &optional start-position end-position) @@ -446,7 +422,7 @@ An overlay from BEG to END containing a change face is added from the information in the text property of type `hilit-chg'. This is the opposite of `hilit-chg-hide-changes'." - (hilit-chg-map-changes 'hilit-chg-make-ov beg end)) + (hilit-chg-map-changes #'hilit-chg-make-ov beg end)) (defun hilit-chg-make-ov (prop start end) @@ -467,8 +443,7 @@ This is the opposite of `hilit-chg-hide-changes'." (overlay-put ov 'evaporate t) ;; We set the change property so we can tell this is one ;; of our overlays (so we don't delete someone else's). - (overlay-put ov 'hilit-chg t) - ) + (overlay-put ov 'hilit-chg t)) (error "hilit-chg-make-ov: no face for prop: %s" prop)))) (defun hilit-chg-hide-changes (&optional beg end) @@ -726,7 +701,7 @@ this, eval the following in the buffer to be saved: ;; remove our existing overlays (hilit-chg-hide-changes) ;; for each change text property, increment it - (hilit-chg-map-changes 'hilit-chg-bump-change) + (hilit-chg-map-changes #'hilit-chg-bump-change) ;; and display them (hilit-chg-display-changes)) (unless modified @@ -759,7 +734,7 @@ is non-nil." (buf-b-read-only (with-current-buffer buf-b buffer-read-only)) temp-a temp-b) (if (and file-a bufa-modified) - (if (y-or-n-p (format "Save buffer %s? " buf-a)) + (if (y-or-n-p (format "Save buffer %s? " buf-a)) (with-current-buffer buf-a (save-buffer) (setq bufa-modified (buffer-modified-p buf-a))) @@ -768,7 +743,7 @@ is non-nil." (setq temp-a (setq file-a (ediff-make-temp-file buf-a nil)))) (if (and file-b bufb-modified) - (if (y-or-n-p (format "Save buffer %s? " buf-b)) + (if (y-or-n-p (format "Save buffer %s? " buf-b)) (with-current-buffer buf-b (save-buffer) (setq bufb-modified (buffer-modified-p buf-b))) @@ -809,12 +784,11 @@ is non-nil." (if temp-a (delete-file temp-a)) (if temp-b - (delete-file temp-b))) - )) + (delete-file temp-b))))) ;;;###autoload (defun highlight-compare-buffers (buf-a buf-b) -"Compare two buffers and highlight the differences. + "Compare two buffers and highlight the differences. The default is the current buffer and the one in the next window. @@ -835,8 +809,7 @@ changes are made, so \\[highlight-changes-next-change] and (window-buffer (next-window)) t)))) (let ((file-a (buffer-file-name buf-a)) (file-b (buffer-file-name buf-b))) - (highlight-markup-buffers buf-a file-a buf-b file-b) - )) + (highlight-markup-buffers buf-a file-a buf-b file-b))) ;;;###autoload (defun highlight-compare-with-file (file-b) @@ -876,9 +849,11 @@ changes are made, so \\[highlight-changes-next-change] and (find-file-noselect file-b)))) (highlight-markup-buffers buf-a file-a buf-b file-b (not existing-buf)) (unless existing-buf - (kill-buffer buf-b)) - )) + (kill-buffer buf-b)))) +(defvar hilit-x) ; placate the byte-compiler +(defvar hilit-y) +(defvar hilit-e) (defun hilit-chg-get-diff-info (buf-a file-a buf-b file-b) ;; hilit-e,x,y are set by function hilit-chg-get-diff-list-hk. @@ -886,8 +861,7 @@ changes are made, so \\[highlight-changes-next-change] and (ediff-setup buf-a file-a buf-b file-b nil nil ; buf-c file-C '(hilit-chg-get-diff-list-hk) - (list (cons 'ediff-job-name 'something)) - ) + (list (cons 'ediff-job-name 'something))) (ediff-with-current-buffer hilit-e (ediff-really-quit nil)) (list hilit-x hilit-y))) @@ -895,9 +869,6 @@ changes are made, so \\[highlight-changes-next-change] and (defun hilit-chg-get-diff-list-hk () ;; hilit-e/x/y are dynamically bound by hilit-chg-get-diff-info ;; which calls this function as a hook. - (defvar hilit-x) ; placate the byte-compiler - (defvar hilit-y) - (defvar hilit-e) (setq hilit-e (current-buffer)) (let ((n 0) extent p va vb a b) (setq hilit-x nil hilit-y nil) @@ -931,7 +902,7 @@ changes are made, so \\[highlight-changes-next-change] and (setq extent (list (overlay-start (car p)) (overlay-end (car p)))) (setq p (cdr p)) - (setq hilit-y (append hilit-y (list extent) ))) + (setq hilit-y (append hilit-y (list extent)))) (setq n (1+ n)));; while ;; ediff-quit doesn't work here. ;; No point in returning a value, since this is a hook function. @@ -961,8 +932,7 @@ This is called when `global-highlight-changes-mode' is turned on." (and (not (string-match "^[ *]" (buffer-name))) (buffer-file-name)))) - (highlight-changes-mode 1)) - )) + (highlight-changes-mode 1)))) ;;;; Desktop support. @@ -985,8 +955,7 @@ This is called when `global-highlight-changes-mode' is turned on." ;; (message "--- hilit-chg-debug-show ---") ;; (hilit-chg-map-changes (lambda (prop start end) ;; (message "%d-%d: %s" start end prop)) -;; beg end -;; )) +;; beg end)) ;; ;; ================== end of debug =============== From c3cd3fb0513d543f763e47093ec9a283eb6e97d0 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 4 Apr 2021 14:53:20 +0300 Subject: [PATCH 50/75] Fix MS-Windows build * src/image.c: (init_svg_functions) [WINDOWSNT]: Define and load rsvg_handle_set_stylesheet from the DLL for librsvg > 2.48. (lookup_image): Use xmalloc. --- src/image.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/image.c b/src/image.c index 08e937e501f..6fe0b23f730 100644 --- a/src/image.c +++ b/src/image.c @@ -2442,7 +2442,7 @@ lookup_image (struct frame *f, Lisp_Object spec, int face_id) img->face_foreground = foreground; img->face_background = background; img->face_font_size = font_size; - img->face_font_family = malloc (strlen (font_family) + 1); + img->face_font_family = xmalloc (strlen (font_family) + 1); strcpy (img->face_font_family, font_family); img->load_failed_p = ! img->type->load_img (f, img); @@ -9647,6 +9647,11 @@ DEF_DLL_FN (gboolean, rsvg_handle_get_geometry_for_layer, (RsvgHandle *, const char *, const RsvgRectangle *, RsvgRectangle *, RsvgRectangle *, GError **)); # endif + +# if LIBRSVG_CHECK_VERSION (2, 48, 0) +DEF_DLL_FN (gboolean, rsvg_handle_set_stylesheet, + (RsvgHandle *, const guint8 *, gsize, GError **)); +# endif DEF_DLL_FN (void, rsvg_handle_get_dimensions, (RsvgHandle *, RsvgDimensionData *)); DEF_DLL_FN (GdkPixbuf *, rsvg_handle_get_pixbuf, (RsvgHandle *)); @@ -9699,6 +9704,9 @@ init_svg_functions (void) #if LIBRSVG_CHECK_VERSION (2, 46, 0) LOAD_DLL_FN (library, rsvg_handle_get_intrinsic_dimensions); LOAD_DLL_FN (library, rsvg_handle_get_geometry_for_layer); +#endif +#if LIBRSVG_CHECK_VERSION (2, 48, 0) + LOAD_DLL_FN (library, rsvg_handle_set_stylesheet); #endif LOAD_DLL_FN (library, rsvg_handle_get_dimensions); LOAD_DLL_FN (library, rsvg_handle_get_pixbuf); @@ -9740,6 +9748,9 @@ init_svg_functions (void) # undef rsvg_handle_get_geometry_for_layer # endif # undef rsvg_handle_get_dimensions +# if LIBRSVG_CHECK_VERSION (2, 48, 0) +# undef rsvg_handle_set_stylesheet +# endif # undef rsvg_handle_get_pixbuf # if LIBRSVG_CHECK_VERSION (2, 32, 0) # undef g_file_new_for_path @@ -9773,6 +9784,9 @@ init_svg_functions (void) fn_rsvg_handle_get_geometry_for_layer # endif # define rsvg_handle_get_dimensions fn_rsvg_handle_get_dimensions +# if LIBRSVG_CHECK_VERSION (2, 48, 0) +# define rsvg_handle_set_stylesheet fn_rsvg_handle_set_stylesheet +# endif # define rsvg_handle_get_pixbuf fn_rsvg_handle_get_pixbuf # if LIBRSVG_CHECK_VERSION (2, 32, 0) # define g_file_new_for_path fn_g_file_new_for_path From 6a80632c3f8041e61186b1c85d9a33f1cb862ea5 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 4 Apr 2021 14:06:40 +0200 Subject: [PATCH 51/75] * test/lisp/filenotify-tests.el (file-notify--test-timeout): Change timing on emba. --- test/lisp/filenotify-tests.el | 1 + 1 file changed, 1 insertion(+) diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index cca8aeb97d4..13350b24422 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -119,6 +119,7 @@ There are different timeouts for local and remote file notification libraries." (cond ((file-remote-p temporary-file-directory) 20) ((eq system-type 'cygwin) 10) + ((getenv "EMACS_EMBA_CI") 10) ((string-equal (file-notify--test-library) "w32notify") 4) (t 3))) From dd5ba88afbb63f54603cc632fc55993c04531a85 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Sun, 4 Apr 2021 14:08:48 +0100 Subject: [PATCH 52/75] Work around librsvg bug (bug#47074) Librsvg <= 2.40 has restrictions on how certain numbers can be run together in path elements which do not match the SVG spec. * etc/images/checkbox-mixed.svg: * etc/images/checked.svg: * etc/images/radio-checked.svg: * etc/images/unchecked.svg: Separate problem numbers. * etc/images/radio-mixed.svg: Separate problem numbers and color and font-weight data. --- etc/images/checkbox-mixed.svg | 4 ++-- etc/images/checked.svg | 2 +- etc/images/radio-checked.svg | 4 ++-- etc/images/radio-mixed.svg | 4 ++-- etc/images/unchecked.svg | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/etc/images/checkbox-mixed.svg b/etc/images/checkbox-mixed.svg index 647a0ccf9b4..6e46b803c81 100644 --- a/etc/images/checkbox-mixed.svg +++ b/etc/images/checkbox-mixed.svg @@ -1,6 +1,6 @@ - - + + diff --git a/etc/images/checked.svg b/etc/images/checked.svg index b84dde1c3a5..4cbdef04f25 100644 --- a/etc/images/checked.svg +++ b/etc/images/checked.svg @@ -1,6 +1,6 @@ - + diff --git a/etc/images/radio-checked.svg b/etc/images/radio-checked.svg index 5354324c34a..8950b447a0b 100644 --- a/etc/images/radio-checked.svg +++ b/etc/images/radio-checked.svg @@ -1,6 +1,6 @@ - - + + diff --git a/etc/images/radio-mixed.svg b/etc/images/radio-mixed.svg index e2a6fcae57d..1b3bfa78e9d 100644 --- a/etc/images/radio-mixed.svg +++ b/etc/images/radio-mixed.svg @@ -1,6 +1,6 @@ - + - + diff --git a/etc/images/unchecked.svg b/etc/images/unchecked.svg index 7cc15162201..09bab8de95b 100644 --- a/etc/images/unchecked.svg +++ b/etc/images/unchecked.svg @@ -1,3 +1,3 @@ - + From dd1aa7bc4ca6c1df1713ccac7c66e681d8444c21 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 4 Apr 2021 09:19:24 -0700 Subject: [PATCH 53/75] Make maintainer-clean delete generated files, as per standards These are generated files that were once kept in the repository. When they were removed from the repository, as a half-way measure they were only deleted by "extraclean", but this was never necessary and was not a proper use of that rule. * admin/charsets/Makefile.in (gen-clean): New phony target. (maintainer-clean): Delete generated files. * admin/grammars/Makefile.in (gen-clean): New phony target. (maintainer-clean): Delete generated files. * admin/unidata/Makefile.in (gen-clean): New phony target. (maintainer-clean): Delete generated files. * leim/Makefile.in (gen-clean): New phony target. (maintainer-clean): Delete generated files. * GNUmakefile: Doc fix. --- GNUmakefile | 4 ++-- Makefile.in | 2 -- admin/charsets/Makefile.in | 12 +++++++----- admin/grammars/Makefile.in | 19 +++++++++++-------- admin/unidata/Makefile.in | 16 ++++++++-------- leim/Makefile.in | 14 +++++++++----- 6 files changed, 37 insertions(+), 30 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 0e01b808a0f..5155487de28 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -50,8 +50,8 @@ help: @echo "make distclean -- delete all build and configuration files," @echo " leave only files included in source distribution" @echo "make maintainer-clean -- delete almost everything that can be regenerated" - @echo "make extraclean -- like maintainer-clean, and also delete all generated" - @echo " files, backup files and autosave files" + @echo "make extraclean -- like maintainer-clean, and also delete" + @echo " backup and autosave files" @echo "make bootstrap -- delete all compiled files to force a new bootstrap" @echo " from a clean slate, then build in the normal way" @echo "make uninstall -- remove files installed by 'make install'" diff --git a/Makefile.in b/Makefile.in index f3ba50c55ed..638548370c3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -48,8 +48,6 @@ # # make extraclean # Still more severe - delete backup and autosave files, too. -# Also generated files that do not normally change and can be slow -# to rebuild (eg leim/ja-dic). # # make bootstrap # Removes all the compiled files to force a new bootstrap from a diff --git a/admin/charsets/Makefile.in b/admin/charsets/Makefile.in index 1fe029984b8..00424843bc4 100644 --- a/admin/charsets/Makefile.in +++ b/admin/charsets/Makefile.in @@ -297,17 +297,19 @@ ${charsetdir}/%.map: ${GLIBC_CHARMAPS}/%.gz ${mapconv} ${compact} ${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x/' GLIBC-1 ${compact} > $@ -.PHONY: clean bootstrap-clean distclean maintainer-clean extraclean +.PHONY: clean bootstrap-clean distclean maintainer-clean extraclean gen-clean clean: +## IMO this should also run gen-clean. bootstrap-clean: clean distclean: clean rm -f Makefile -maintainer-clean: distclean - -## Do not remove these files, even in a bootstrap. They rarely change. -extraclean: +gen-clean: rm -f ${CHARSETS} ${SED_SCRIPT} ${TRANS_TABLE} ${srcdir}/charsets.stamp + +maintainer-clean: gen-clean distclean + +extraclean: maintainer-clean diff --git a/admin/grammars/Makefile.in b/admin/grammars/Makefile.in index aa09d9edf94..1573eb3bde9 100644 --- a/admin/grammars/Makefile.in +++ b/admin/grammars/Makefile.in @@ -51,7 +51,7 @@ BOVINE = \ ## FIXME Should include this one too: ## ${cedetdir}/semantic/grammar-wy.el ## but semantic/grammar.el (which is what we use to generate grammar-wy.el) -## requires it! +## requires it! https://debbugs.gnu.org/16008 WISENT = \ ${wisentdir}/javat-wy.el \ ${wisentdir}/js-wy.el \ @@ -68,6 +68,8 @@ bovine: ${BOVINE} wisent: ${WISENT} +## TODO add dependencies on semantic/{bovine,wisent}/grammar.el + ## c-by.el, make-by.el. ${bovinedir}/%-by.el: ${srcdir}/%.by $(AM_V_GEN)[ ! -f "$@" ] || chmod +w "$@" @@ -96,19 +98,20 @@ ${cedetdir}/srecode/srt-wy.el: ${srcdir}/srecode-template.wy $(AM_V_at)${make_wisent} -o "$@" $< -.PHONY: distclean bootstrap-clean maintainer-clean extraclean +.PHONY: distclean bootstrap-clean maintainer-clean extraclean gen-clean distclean: rm -f Makefile -## Perhaps this should do what extraclean (qv) does. +## IMO this should run gen-clean. bootstrap-clean: -maintainer-clean: distclean - -## We do not normally delete the generated files, even in bootstrap. -## Creating them does not take long, so we could easily change this. -extraclean: +gen-clean: rm -f ${ALL} +maintainer-clean: gen-clean distclean + +extraclean: maintainer-clean + + # Makefile.in ends here diff --git a/admin/unidata/Makefile.in b/admin/unidata/Makefile.in index 183569fb9b6..b7a927d1919 100644 --- a/admin/unidata/Makefile.in +++ b/admin/unidata/Makefile.in @@ -85,26 +85,26 @@ ${unidir}/charscript.el: ${srcdir}/Blocks.txt ${blocks} $(AM_V_GEN)$(AWK) -f ${blocks} < $< > $@ -.PHONY: clean bootstrap-clean distclean maintainer-clean extraclean +.PHONY: clean bootstrap-clean distclean maintainer-clean extraclean gen-clean clean: rm -f ${srcdir}/*.elc unidata.txt +## IMO this should also run gen-clean. bootstrap-clean: clean distclean: clean rm -f Makefile -maintainer-clean: distclean - -## Do not remove these files, even in a bootstrap, because they rarely -## change and it slows down bootstrap (a tiny bit). -## Cf leim/ja-dic (which is much slower). - ## macuvs.h is a generated file, but it's also checked in because ## macOS builds would need to do a headless bootstrap without it, ## which is currently awkward. To avoid changing checked-in files ## from a make target, we don't delete it here. -extraclean: distclean +gen-clean: rm -f ${unidir}/charscript.el* rm -f ${unifiles} ${unidir}/charprop.el +## ref: https://lists.gnu.org/r/emacs-devel/2013-11/msg01029.html + +maintainer-clean: gen-clean distclean + +extraclean: maintainer-clean diff --git a/leim/Makefile.in b/leim/Makefile.in index c2f9cf5ab5f..2646abcfff9 100644 --- a/leim/Makefile.in +++ b/leim/Makefile.in @@ -137,19 +137,23 @@ ${srcdir}/../lisp/language/pinyin.el: ${srcdir}/MISC-DIC/pinyin.map $(AM_V_GEN)${RUN_EMACS} -l titdic-cnv -f pinyin-convert $< $@ -.PHONY: bootstrap-clean distclean maintainer-clean extraclean +.PHONY: bootstrap-clean distclean maintainer-clean extraclean gen-clean +## Perhaps this should run gen-clean. bootstrap-clean: rm -f ${TIT_MISC} ${leimdir}/leim-list.el distclean: rm -f Makefile -maintainer-clean: distclean bootstrap-clean +maintainer-clean: gen-clean distclean -## We do not delete ja-dic, even in a bootstrap, because it rarely -## changes and is slow to regenerate. -extraclean: bootstrap-clean +## ja-dic rarely changes and is slow to regenerate, and tends to be a +## bottleneck in parallel builds. +gen-clean: + rm -f ${TIT_MISC} ${leimdir}/leim-list.el rm -rf ${leimdir}/ja-dic +extraclean: maintainer-clean + ### Makefile.in ends here From c967f55a01c54c60802d1f5dff47f54541d6157a Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 4 Apr 2021 21:35:56 +0200 Subject: [PATCH 54/75] Work around issue with (setq Man-notify-method 'aggressive) * lisp/man.el (Man-bgproc-sentinel): Check that the window still exists before trying to select it (bug#38164). --- lisp/man.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/man.el b/lisp/man.el index abb9bbad8fd..9b941a2b3d2 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1503,7 +1503,9 @@ manpage command." (quit-restore-window (get-buffer-window Man-buffer t) 'kill) ;; Ensure that we end up in the correct window. - (select-window (old-selected-window))) + (let ((old-window (old-selected-window))) + (when (window-live-p old-window) + (select-window old-window)))) (kill-buffer Man-buffer))) (when message From 3ad98bbae793e8a69f37785737c188d9b489897e Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 4 Apr 2021 21:47:38 +0200 Subject: [PATCH 55/75] Clarify the doc string of insert-image * lisp/image.el (insert-image): Mention the effect of a whitespace image (bug#47240). --- lisp/image.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/image.el b/lisp/image.el index b802c1c906f..610d020aab5 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -603,12 +603,16 @@ means display it in the right marginal area." (defun insert-image (image &optional string area slice) "Insert IMAGE into current buffer at point. IMAGE is displayed by inserting STRING into the current buffer -with a `display' property whose value is the image. STRING -defaults to a single space if you omit it. +with a `display' property whose value is the image. + +STRING defaults to a single space if you omit it, which means +that the inserted image will behave as whitespace syntactically. + AREA is where to display the image. AREA nil or omitted means display it in the text area, a value of `left-margin' means display it in the left marginal area, a value of `right-margin' means display it in the right marginal area. + SLICE specifies slice of IMAGE to insert. SLICE nil or omitted means insert whole image. SLICE is a list (X Y WIDTH HEIGHT) specifying the X and Y positions and WIDTH and HEIGHT of image area From 258a17855becd8ab914a9bcf063e43801e704781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20J=C3=B6rg?= Date: Sun, 4 Apr 2021 22:19:01 +0200 Subject: [PATCH 56/75] cperl-mode: Don't reposition the window when writing messages * lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): Avoid printing messages while point is off-screen (Bug#47549). --- lisp/progmodes/cperl-mode.el | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 7612f8d284a..7878e91096c 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -3608,7 +3608,8 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', ;; 1+6+2+1+1+6+1+1+1=20 extra () before this: "\\|" "\\\\\\(['`\"($]\\)") ; BACKWACKED something-hairy - "")))) + ""))) + warning-message) (unwind-protect (progn (save-excursion @@ -3671,7 +3672,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', (looking-at "\\(cut\\|end\\)\\>")) (if (or (nth 3 state) (nth 4 state) ignore-max) nil ; Doing a chunk only - (message "=cut is not preceded by a POD section") + (setq warning-message "=cut is not preceded by a POD section") (or (car err-l) (setcar err-l (point)))) (beginning-of-line) @@ -3686,7 +3687,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', (goto-char b) (if (re-search-forward "\n=\\(cut\\|end\\)\\>" stop-point 'toend) (progn - (message "=cut is not preceded by an empty line") + (setq warning-message "=cut is not preceded by an empty line") (setq b1 t) (or (car err-l) (setcar err-l b)))))) (beginning-of-line 2) ; An empty line after =cut is not POD! @@ -3829,7 +3830,8 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', (progn ; Pretend we matched at the end (goto-char (point-max)) (re-search-forward "\\'") - (message "End of here-document `%s' not found." tag) + (setq warning-message + (format "End of here-document `%s' not found." tag)) (or (car err-l) (setcar err-l b)))) (if cperl-pod-here-fontify (progn @@ -3906,7 +3908,8 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', 'face font-lock-string-face) (cperl-commentify (point) (+ (point) 2) nil) (cperl-put-do-not-fontify (point) (+ (point) 2) t)) - (message "End of format `%s' not found." name) + (setq warning-message + (format "End of format `%s' not found." name)) (or (car err-l) (setcar err-l b))) (forward-line) (if (> (point) max) @@ -4426,8 +4429,9 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', REx-subgr-end argument) ; continue (setq argument nil))) (and argument - (message "Couldn't find end of charclass in a REx, pos=%s" - REx-subgr-start)) + (setq warning-message + (format "Couldn't find end of charclass in a REx, pos=%s" + REx-subgr-start))) (setq argument (1- (point))) (goto-char REx-subgr-end) (cperl-highlight-charclass @@ -4483,7 +4487,8 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', (setq qtag "Can't find })"))) (progn (goto-char (1- e)) - (message "%s" qtag)) + (setq warning-message + (format "%s" qtag))) (cperl-postpone-fontification (1- tag) (1- (point)) 'face font-lock-variable-name-face) @@ -4512,9 +4517,9 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', ;; (1- e) 'toend) (search-forward ")" (1- e) 'toend) ;;) - (message - "Couldn't find end of (?#...)-comment in a REx, pos=%s" - REx-subgr-start)))) + (setq warning-message + (format "Couldn't find end of (?#...)-comment in a REx, pos=%s" + REx-subgr-start))))) (if (>= (point) e) (goto-char (1- e))) (cond @@ -4592,8 +4597,8 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', (if (> (point) stop-point) (progn (if end - (message "Garbage after __END__/__DATA__ ignored") - (message "Unbalanced syntax found while scanning") + (setq warning-message "Garbage after __END__/__DATA__ ignored") + (setq warning-message "Unbalanced syntax found while scanning") (or (car err-l) (setcar err-l b))) (goto-char stop-point)))) (setq cperl-syntax-state (cons state-point state) @@ -4612,6 +4617,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', ;; cperl-mode-syntax-table. ;; (set-syntax-table cperl-mode-syntax-table) ) + (when warning-message (message warning-message)) (list (car err-l) overshoot))) (defun cperl-find-pods-heres-region (min max) From 9cb3db0bade2ea43bad9cadc7864887c09bc7cd0 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 4 Apr 2021 16:57:55 -0700 Subject: [PATCH 57/75] Regenerate semantic grammars if the generating code changes * admin/grammars/Makefile.in (emacs): Set load-prefer-newer. (grammar_bovine, grammar_wisent): New variables. (${bovinedir}/%-by.el, ${bovinedir}/scm-by.el) (${cedetdir}/semantic/%-wy.el, ${wisentdir}/%-wy.el) (${wisentdir}/javat-wy.el, ${cedetdir}/srecode/srt-wy.el): Depend on the source file for the generating function. * lisp/cedet/semantic/bovine/grammar.el (bovine--make-parser-1): * lisp/cedet/semantic/wisent/grammar.el (wisent--make-parser-1): Force generation of the output file. The previous "is the output newer than the input" failed to account for changes in the generation code itself. Force so we can let make figure it out. --- admin/grammars/Makefile.in | 20 ++++++++++---------- lisp/cedet/semantic/bovine/grammar.el | 2 +- lisp/cedet/semantic/wisent/grammar.el | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/admin/grammars/Makefile.in b/admin/grammars/Makefile.in index 1573eb3bde9..35ce55461f3 100644 --- a/admin/grammars/Makefile.in +++ b/admin/grammars/Makefile.in @@ -34,7 +34,7 @@ top_builddir = @top_builddir@ unexport EMACSDATA EMACSDOC EMACSPATH EMACS = ${top_builddir}/src/emacs -emacs = EMACSLOADPATH= "${EMACS}" -batch --no-site-file --no-site-lisp +emacs = EMACSLOADPATH= "${EMACS}" -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' make_bovine = ${emacs} -l semantic/bovine/grammar -f bovine-batch-make-parser make_wisent = ${emacs} -l semantic/wisent/grammar -f wisent-batch-make-parser @@ -43,6 +43,9 @@ cedetdir = ${top_srcdir}/lisp/cedet bovinedir = ${cedetdir}/semantic/bovine wisentdir = ${cedetdir}/semantic/wisent +grammar_bovine = ${bovinedir}/grammar.el +grammar_wisent = ${wisentdir}/grammar.el + BOVINE = \ ${bovinedir}/c-by.el \ ${bovinedir}/make-by.el \ @@ -68,36 +71,33 @@ bovine: ${BOVINE} wisent: ${WISENT} -## TODO add dependencies on semantic/{bovine,wisent}/grammar.el - ## c-by.el, make-by.el. -${bovinedir}/%-by.el: ${srcdir}/%.by +${bovinedir}/%-by.el: ${srcdir}/%.by ${grammar_bovine} $(AM_V_GEN)[ ! -f "$@" ] || chmod +w "$@" $(AM_V_at)${make_bovine} -o "$@" $< -${bovinedir}/scm-by.el: ${srcdir}/scheme.by +${bovinedir}/scm-by.el: ${srcdir}/scheme.by ${grammar_bovine} $(AM_V_GEN)[ ! -f "$@" ] || chmod +w "$@" $(AM_V_at)${make_bovine} -o "$@" $< ## grammar-wy.el -${cedetdir}/semantic/%-wy.el: ${srcdir}/%.wy +${cedetdir}/semantic/%-wy.el: ${srcdir}/%.wy ${grammar_wisent} $(AM_V_GEN)[ ! -f "$@" ] || chmod +w "$@" $(AM_V_at)${make_wisent} -o "$@" $< ## js-wy.el, python-wy.el -${wisentdir}/%-wy.el: ${srcdir}/%.wy +${wisentdir}/%-wy.el: ${srcdir}/%.wy ${grammar_wisent} $(AM_V_GEN)[ ! -f "$@" ] || chmod +w "$@" $(AM_V_at)${make_wisent} -o "$@" $< -${wisentdir}/javat-wy.el: ${srcdir}/java-tags.wy +${wisentdir}/javat-wy.el: ${srcdir}/java-tags.wy ${grammar_wisent} $(AM_V_GEN)[ ! -f "$@" ] || chmod +w "$@" $(AM_V_at)${make_wisent} -o "$@" $< -${cedetdir}/srecode/srt-wy.el: ${srcdir}/srecode-template.wy +${cedetdir}/srecode/srt-wy.el: ${srcdir}/srecode-template.wy ${grammar_wisent} $(AM_V_GEN)[ ! -f "$@" ] || chmod +w "$@" $(AM_V_at)${make_wisent} -o "$@" $< - .PHONY: distclean bootstrap-clean maintainer-clean extraclean gen-clean distclean: diff --git a/lisp/cedet/semantic/bovine/grammar.el b/lisp/cedet/semantic/bovine/grammar.el index a5b9873445e..a2717d711fe 100644 --- a/lisp/cedet/semantic/bovine/grammar.el +++ b/lisp/cedet/semantic/bovine/grammar.el @@ -475,7 +475,7 @@ Menu items are appended to the common grammar menu.") (with-current-buffer (find-file-noselect infile) (setq infile buffer-file-name) (if outdir (setq default-directory outdir)) - (semantic-grammar-create-package nil t)) + (semantic-grammar-create-package t t)) (error (message "%s" (error-message-string err)) nil))) lang filename copyright-end) (when (and packagename diff --git a/lisp/cedet/semantic/wisent/grammar.el b/lisp/cedet/semantic/wisent/grammar.el index 465d4720031..c5e4554082e 100644 --- a/lisp/cedet/semantic/wisent/grammar.el +++ b/lisp/cedet/semantic/wisent/grammar.el @@ -477,7 +477,7 @@ Menu items are appended to the common grammar menu.") (condition-case err (with-current-buffer (find-file-noselect infile) (if outdir (setq default-directory outdir)) - (semantic-grammar-create-package nil t)) + (semantic-grammar-create-package t t)) (error (message "%s" (error-message-string err)) nil))) output-data) (when (setq output-data (assoc packagename wisent-make-parsers--parser-file-name)) From a86edac26b6648c19cb8e278125978b31f3a093a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 4 Apr 2021 17:11:47 -0700 Subject: [PATCH 58/75] Regenerate texi-from-org if ox-texinfo.el changes * doc/misc/Makefile.in (top_srcdir): New, set by configure. (emacs): Set load-prefer-newer. (org_template): Make output depend on ox-texinfo.el. --- doc/misc/Makefile.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in index 63d4bf0337f..ae960fe769d 100644 --- a/doc/misc/Makefile.in +++ b/doc/misc/Makefile.in @@ -22,7 +22,7 @@ SHELL = @SHELL@ # Where to find the source code. $(srcdir) will be the doc/misc subdirectory # of the source tree. This is set by configure's '--srcdir' option. srcdir=@srcdir@ - +top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ ## Where the output files go. @@ -235,14 +235,14 @@ ${buildinfodir}/tramp.info tramp.html: ${srcdir}/trampver.texi abs_top_builddir = @abs_top_builddir@ EMACS = ${abs_top_builddir}/src/emacs -emacs = "${EMACS}" -batch --no-site-file --no-site-lisp +emacs = "${EMACS}" -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' # Generated .texi files go in srcdir so they can be included in the # release tarfile along with the others. # Work in srcdir (and use abs_top_builddir) so that +setupfile and # things like org-setup's "version" macro work. Sigh. define org_template - $(1:.org=.texi): $(1) + $(1:.org=.texi): $(1) ${top_srcdir}/lisp/org/ox-texinfo.el $${AM_V_GEN}cd "$${srcdir}" && $${emacs} -l ox-texinfo \ -f org-texinfo-export-to-texinfo-batch $$(notdir $$<) $$(notdir $$@) endef From a44d423a5aaf97790ce95350a38590fbb17b3220 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 4 Apr 2021 17:24:27 -0700 Subject: [PATCH 59/75] * doc/misc/Makefile.in (echo-sources): Make it not the first target. --- doc/misc/Makefile.in | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in index ae960fe769d..7982c0dc5ae 100644 --- a/doc/misc/Makefile.in +++ b/doc/misc/Makefile.in @@ -100,10 +100,6 @@ texi_sources = $(addsuffix .texi,${TARGETS}) texi_notgen = $(filter-out $(notdir ${TEXI_FROM_ORG}),${texi_sources}) texi_and_org = $(notdir ${ORG_SRC}) ${texi_notgen} SOURCES = $(sort ${texi_and_org}) -.PHONY: echo-sources -## Used by the top-level Makefile. -echo-sources: - @echo ${SOURCES} DVI_TARGETS = $(TARGETS:=.dvi) HTML_TARGETS = $(TARGETS:=.html) @@ -122,7 +118,7 @@ ENVADD = $(AM_V_GEN)TEXINPUTS="$(srcdir):$(emacsdir):$(TEXINPUTS)" \ gfdl = ${srcdir}/doclicense.texi style = ${emacsdir}/docstyle.texi -.PHONY: info dvi html pdf ps echo-info $(INFO_TARGETS) +.PHONY: info dvi html pdf ps echo-info echo-sources $(INFO_TARGETS) ## Prevent implicit rule triggering for foo.info. .SUFFIXES: @@ -138,6 +134,9 @@ echo-info: @echo "$(INFO_INSTALL) " | \ sed -e 's|[^ ]*/||g' -e 's/\.info//g' -e "s/ */.info /g" +echo-sources: + @echo ${SOURCES} + dvi: $(DVI_TARGETS) html: $(HTML_TARGETS) From 1733fa0cab766bd3d2c725b31bc1e51d9b41ead7 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 5 Apr 2021 00:10:57 +0200 Subject: [PATCH 60/75] * etc/NEWS: Add entry for new SVG icons in customize. --- etc/NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index c93e2e7044e..1421efcaa07 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1056,6 +1056,10 @@ the commands 'customize', 'customize-group', 'customize-apropos' and To customize obsolete user options, use 'customize-option' or 'customize-saved'. +*** New SVG icons for checkboxes and arrows. +They will be used automatically instead of the old icons. If Emacs is +built without SVG support, the old icons will be used instead. + ** Edebug *** Obsoletions From e9c3d040bcfab5908e6deb7330038f36ce95bc93 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 5 Apr 2021 01:35:18 +0200 Subject: [PATCH 61/75] * lisp/htmlfontify.el (hfy-triplet-regex): Use rx. --- lisp/htmlfontify.el | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index 0c8d5348247..550083d0e28 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -523,13 +523,10 @@ therefore no longer care about) will be invalid at any time.\n (defvar hfy-tmpfont-stack nil "An alist of derived fonts resulting from overlays.") -(defconst hfy-hex-regex "[[:xdigit:]]") - (defconst hfy-triplet-regex - (concat - "\\(" hfy-hex-regex hfy-hex-regex "\\)" - "\\(" hfy-hex-regex hfy-hex-regex "\\)" - "\\(" hfy-hex-regex hfy-hex-regex "\\)")) + (rx (group xdigit xdigit) + (group xdigit xdigit) + (group xdigit xdigit))) (defun hfy-interq (set-a set-b) "Return the intersection (using `eq') of two lists SET-A and SET-B." From 46b8d7087c8270c92d6a3b94e811de5e3cc99701 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 5 Apr 2021 01:38:48 +0200 Subject: [PATCH 62/75] Make ediff-copy-list alias obsolete * lisp/vc/ediff-mult.el (ediff-intersect-directories) (ediff-get-directory-files-under-revision): Don't use above obsolete alias. * lisp/vc/ediff-util.el (ediff-copy-list): Make alias obsolete. --- lisp/vc/ediff-mult.el | 6 +++--- lisp/vc/ediff-util.el | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lisp/vc/ediff-mult.el b/lisp/vc/ediff-mult.el index 49b2890a160..8e88b60a0bd 100644 --- a/lisp/vc/ediff-mult.el +++ b/lisp/vc/ediff-mult.el @@ -620,7 +620,7 @@ behavior." (setq common (ediff-intersection common lis3 #'string=))) ;; copying is needed because sort sorts via side effects - (setq common (sort (ediff-copy-list common) 'string-lessp)) + (setq common (sort (copy-sequence common) #'string-lessp)) ;; compute difference list (setq difflist (ediff-set-difference @@ -631,7 +631,7 @@ behavior." #'string=) difflist (delete "." difflist) ;; copying is needed because sort sorts via side effects - difflist (sort (ediff-copy-list (delete ".." difflist)) + difflist (sort (copy-sequence (delete ".." difflist)) #'string-lessp)) (setq difflist (mapcar (lambda (elt) (cons elt 1)) difflist)) @@ -729,7 +729,7 @@ behavior." ) ;; copying is needed because sort sorts via side effects - (setq common (sort (ediff-copy-list common) 'string-lessp)) + (setq common (sort (copy-sequence common) #'string-lessp)) ;; return result (cons diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index fc6dcf68a43..b538216f45c 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -4188,8 +4188,7 @@ Mail anyway? (y or n) ") (cdr result))) (define-obsolete-function-alias 'ediff-add-to-history #'add-to-history "27.1") - -(defalias 'ediff-copy-list 'copy-sequence) +(define-obsolete-function-alias 'ediff-copy-list #'copy-sequence "28.1") ;; don't report error if version control package wasn't found From 1760029b092724271f9527543dbd9830b377704f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 5 Apr 2021 01:13:54 +0200 Subject: [PATCH 63/75] Replace local intersection functions with seq-intersection * lisp/doc-view.el (doc-view-intersection): * lisp/gnus/gnus-range.el (gnus-intersection): * lisp/htmlfontify.el (hfy-interq): * lisp/loadhist.el (file-set-intersect): * lisp/mail/smtpmail.el (smtpmail-intersection): Make obsolete in favor of seq-intersection. Update all callers. * lisp/url/url-dav.el (url-intersection): Redefine as obsolete function alias for seq-intersection. Update callers. * lisp/mpc.el (mpc-intersection, mpc-cmd-list, mpc-reorder): Use seq-intersection. --- lisp/doc-view.el | 13 +++++++------ lisp/gnus/gnus-art.el | 5 +++-- lisp/gnus/gnus-range.el | 8 ++------ lisp/gnus/gnus-uu.el | 2 +- lisp/gnus/nndiary.el | 2 +- lisp/htmlfontify.el | 20 ++++++++++---------- lisp/loadhist.el | 15 ++++++++------- lisp/mail/smtpmail.el | 18 +++++++++--------- lisp/mpc.el | 14 ++++++-------- lisp/net/newst-backend.el | 1 + lisp/url/url-dav.el | 17 ++++------------- 11 files changed, 52 insertions(+), 63 deletions(-) diff --git a/lisp/doc-view.el b/lisp/doc-view.el index cef09009d95..0ae22934b2c 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1802,11 +1802,6 @@ If BACKWARD is non-nil, jump to the previous match." (remove-overlays (point-min) (point-max) 'doc-view t) (if (consp image-mode-winprops-alist) (setq image-mode-winprops-alist nil))) -(defun doc-view-intersection (l1 l2) - (let ((l ())) - (dolist (x l1) (if (memq x l2) (push x l))) - l)) - (defun doc-view-set-doc-type () "Figure out the current document type (`doc-view-doc-type')." (let ((name-types @@ -1841,7 +1836,7 @@ If BACKWARD is non-nil, jump to the previous match." ((looking-at "AT&TFORM") '(djvu)))))) (setq-local doc-view-doc-type - (car (or (doc-view-intersection name-types content-types) + (car (or (nreverse (seq-intersection name-types content-types #'eq)) (when (and name-types content-types) (error "Conflicting types: name says %s but content says %s" name-types content-types)) @@ -2146,6 +2141,12 @@ See the command `doc-view-mode' for more information on this mode." (add-hook 'bookmark-after-jump-hook show-fn-sym) (bookmark-default-handler bmk))) +;; Obsolete. + +(defun doc-view-intersection (l1 l2) + (declare (obsolete seq-intersection "28.1")) + (nreverse (seq-intersection l1 l2 #'eq))) + (provide 'doc-view) ;; Local Variables: diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index c1071c1c68c..d989a4d5bb5 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -6648,9 +6648,10 @@ not have a face in `gnus-article-boring-faces'." (catch 'only-boring (while (re-search-forward "\\b\\w\\w" nil t) (forward-char -1) - (when (not (gnus-intersection + (when (not (seq-intersection (gnus-faces-at (point)) - (symbol-value 'gnus-article-boring-faces))) + (symbol-value 'gnus-article-boring-faces) + #'eq)) (throw 'only-boring nil))) (throw 'only-boring t)))))) diff --git a/lisp/gnus/gnus-range.el b/lisp/gnus/gnus-range.el index 6cc60cb49b3..456209f3d9a 100644 --- a/lisp/gnus/gnus-range.el +++ b/lisp/gnus/gnus-range.el @@ -179,12 +179,8 @@ Both lists have to be sorted over <." ;;;###autoload (defun gnus-intersection (list1 list2) - (let ((result nil)) - (while list2 - (when (memq (car list2) list1) - (setq result (cons (car list2) result))) - (setq list2 (cdr list2))) - result)) + (declare (obsolete seq-intersection "28.1")) + (nreverse (seq-intersection list1 list2 #'eq))) ;;;###autoload (defun gnus-sorted-intersection (list1 list2) diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el index bd9a1a33ec3..5cbe8495d31 100644 --- a/lisp/gnus/gnus-uu.el +++ b/lisp/gnus/gnus-uu.el @@ -578,7 +578,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." (defun gnus-new-processable (unmarkp articles) (if unmarkp - (gnus-intersection gnus-newsgroup-processable articles) + (nreverse (seq-intersection gnus-newsgroup-processable articles #'eq)) (gnus-set-difference articles gnus-newsgroup-processable))) (defun gnus-uu-mark-by-regexp (regexp &optional unmark) diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el index 15003fabcd2..adf4427523f 100644 --- a/lisp/gnus/nndiary.el +++ b/lisp/gnus/nndiary.el @@ -558,7 +558,7 @@ all. This may very well take some time.") (nnmail-activate 'nndiary) ;; Articles not listed in active-articles are already gone, ;; so don't try to expire them. - (setq articles (gnus-intersection articles active-articles)) + (setq articles (nreverse (seq-intersection articles active-articles #'eq))) (while articles (setq article (nndiary-article-to-file (setq number (pop articles)))) (if (and (nndiary-deletable-article-p group number) diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index 550083d0e28..b453061388f 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -528,15 +528,6 @@ therefore no longer care about) will be invalid at any time.\n (group xdigit xdigit) (group xdigit xdigit))) -(defun hfy-interq (set-a set-b) - "Return the intersection (using `eq') of two lists SET-A and SET-B." - (let ((sa set-a) (interq nil) (elt nil)) - (while sa - (setq elt (car sa) - sa (cdr sa)) - (if (memq elt set-b) (setq interq (cons elt interq)))) - interq)) - (defun hfy-color-vals (color) "Where COLOR is a color name or #XXXXXX style triplet, return a list of three (16 bit) rgb values for said color.\n @@ -884,7 +875,9 @@ See also `hfy-display-class' for details of valid values for CLASS." (setq score 0) (ignore "t match")) ((not (cdr (assq key face-class))) ;Neither good nor bad. nil (ignore "non match, non collision")) - ((setq x (hfy-interq val (cdr (assq key face-class)))) + ((setq x (nreverse + (seq-intersection val (cdr (assq key face-class)) + #'eq))) (setq score (+ score (length x))) (ignore "intersection")) (t ;; nope. @@ -2352,6 +2345,13 @@ You may also want to set `hfy-page-header' and `hfy-page-footer'." (let ((file (hfy-initfile))) (load file 'NOERROR nil nil) )) +;; Obsolete. + +(defun hfy-interq (set-a set-b) + "Return the intersection (using `eq') of two lists SET-A and SET-B." + (declare (obsolete seq-intersection "28.1")) + (nreverse (seq-intersection set-a set-b #'eq))) + (provide 'htmlfontify) ;;; htmlfontify.el ends here diff --git a/lisp/loadhist.el b/lisp/loadhist.el index a60d6b29095..59c002d3078 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el @@ -82,12 +82,6 @@ A library name is equivalent to the file name that `load-library' would load." (when (eq (car-safe x) 'require) (push (cdr x) requires))))) -(defsubst file-set-intersect (p q) - "Return the set intersection of two lists." - (let (ret) - (dolist (x p ret) - (when (memq x q) (push x ret))))) - (defun file-dependents (file) "Return the list of loaded libraries that depend on FILE. This can include FILE itself. @@ -97,7 +91,7 @@ A library name is equivalent to the file name that `load-library' would load." (dependents nil)) (dolist (x load-history dependents) (when (and (stringp (car x)) - (file-set-intersect provides (file-requires (car x)))) + (seq-intersection provides (file-requires (car x)) #'eq)) (push (car x) dependents))))) (defun read-feature (prompt &optional loaded-p) @@ -322,6 +316,13 @@ something strange, such as redefining an Emacs function." ;; Don't return load-history, it is not useful. nil) +;; Obsolete. + +(defsubst file-set-intersect (p q) + "Return the set intersection of two lists." + (declare (obsolete seq-intersection "28.1")) + (nreverse (seq-intersection p q #'eq))) + (provide 'loadhist) ;;; loadhist.el ends here diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index ac5e8c3b6fb..ab58aa455e9 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -489,13 +489,6 @@ for `smtpmail-try-auth-method'.") recipient (concat recipient "@" smtpmail-sendto-domain))) -(defun smtpmail-intersection (list1 list2) - (let ((result nil)) - (dolist (el2 list2) - (when (memq el2 list1) - (push el2 result))) - (nreverse result))) - (defun smtpmail-command-or-throw (process string &optional code) (let (ret) (smtpmail-send-command process string) @@ -512,9 +505,10 @@ for `smtpmail-try-auth-method'.") (if port (format "%s" port) "smtp")) - (let* ((mechs (smtpmail-intersection + (let* ((mechs (seq-intersection + smtpmail-auth-supported (cdr-safe (assoc 'auth supported-extensions)) - smtpmail-auth-supported)) + #'eq)) (auth-source-creation-prompts '((user . "SMTP user name for %h: ") (secret . "SMTP password for %u@%h: "))) @@ -1087,6 +1081,12 @@ many continuation lines." (while (and (looking-at "^[ \t].*\n") (< (point) header-end)) (replace-match "")))))) +;; Obsolete. + +(defun smtpmail-intersection (list1 list2) + (declare (obsolete seq-intersection "28.1")) + (seq-intersection list2 list1 #'eq)) + (provide 'smtpmail) ;;; smtpmail.el ends here diff --git a/lisp/mpc.el b/lisp/mpc.el index 827f8aacdd6..315d8c0626d 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el @@ -129,12 +129,10 @@ "Return L1 after removing all elements not found in L2. If SELECTFUN is non-nil, elements aren't compared directly, but instead they are passed through SELECTFUN before comparison." - (let ((res ())) - (if selectfun (setq l2 (mapcar selectfun l2))) - (dolist (elem l1) - (when (member (if selectfun (funcall selectfun elem) elem) l2) - (push elem res))) - (nreverse res))) + (when selectfun + (setq l1 (mapcar selectfun l1)) + (setq l2 (mapcar selectfun l2))) + (seq-intersection l1 l2)) (defun mpc-event-set-point (event) (condition-case nil (posn-set-point (event-end event)) @@ -698,7 +696,7 @@ The songs are returned as alists." (let* ((osongs (mpc-cmd-find other-tag value)) (ofiles (mpc-assq-all 'file (apply 'append osongs))) (plfiles (mpc-assq-all 'file (apply 'append plsongs)))) - (when (mpc-intersection plfiles ofiles) + (when (seq-intersection plfiles ofiles) (push pl pls))))))) pls)) @@ -1669,7 +1667,7 @@ Return non-nil if a selection was deactivated." (mpc-cmd-list mpc-tag (car cst) val)) (cdr cst))))) (setq active - (if (listp active) (mpc-intersection active vals) vals)))) + (if (listp active) (seq-intersection active vals) vals)))) (when (listp active) ;; Remove the selections if they are all in conflict with diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el index 1d3a5e0f7da..e623dab26df 100644 --- a/lisp/net/newst-backend.el +++ b/lisp/net/newst-backend.el @@ -1680,6 +1680,7 @@ Sat, 07 Sep 2002 00:00:01 GMT nil)))) nil)) +;; FIXME: Can this be replaced by seq-intersection? (defun newsticker--lists-intersect-p (list1 list2) "Return t if LIST1 and LIST2 share elements." (let ((result nil)) diff --git a/lisp/url/url-dav.el b/lisp/url/url-dav.el index edb1c1de9fc..192b1ac4f41 100644 --- a/lisp/url/url-dav.el +++ b/lisp/url/url-dav.el @@ -43,22 +43,11 @@ (defvar url-http-response-status) (defvar url-http-end-of-headers) -(defun url-intersection (l1 l2) - "Return a list of the elements occurring in both of the lists L1 and L2." - (if (null l2) - l2 - (let (result) - (while l1 - (if (member (car l1) l2) - (setq result (cons (pop l1) result)) - (pop l1))) - (nreverse result)))) - ;;;###autoload (defun url-dav-supported-p (url) "Return WebDAV protocol version supported by URL. Returns nil if WebDAV is not supported." - (url-intersection url-dav-supported-protocols + (seq-intersection url-dav-supported-protocols (plist-get (url-http-options url) 'dav))) (defun url-dav-node-text (node) @@ -910,7 +899,9 @@ Returns nil if URL contains no name starting with FILE." t))) -;;; Miscellaneous stuff. +;;; Obsolete. + +(define-obsolete-function-alias 'url-intersection #'seq-intersection "28.1") (provide 'url-dav) From ac81c5c8fd1d38b845a203c83685a5e849489ee0 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 5 Apr 2021 01:58:50 +0200 Subject: [PATCH 64/75] Remove code commented out since 1995 from ediff-util.el * lisp/vc/ediff-util.el (ediff-load-hook): Remove code commented out since the file was added in 1995. --- lisp/vc/ediff-util.el | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index b538216f45c..1c784908702 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -4190,10 +4190,6 @@ Mail anyway? (y or n) ") (define-obsolete-function-alias 'ediff-add-to-history #'add-to-history "27.1") (define-obsolete-function-alias 'ediff-copy-list #'copy-sequence "28.1") - -;; don't report error if version control package wasn't found -;;(ediff-load-version-control 'silent) - (run-hooks 'ediff-load-hook) ;;; ediff-util.el ends here From 6060d53b3e8aa1cdc642b477a42a7b769c676598 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 5 Apr 2021 12:45:10 +0200 Subject: [PATCH 65/75] * test/infra/Dockerfile.emba (emacs-gnustep): Do not run parallel make. --- test/infra/Dockerfile.emba | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba index 30a58971340..19c83a8016f 100644 --- a/test/infra/Dockerfile.emba +++ b/test/infra/Dockerfile.emba @@ -68,5 +68,5 @@ COPY . /checkout WORKDIR /checkout RUN ./autogen.sh autoconf RUN ./configure --with-ns -RUN make -j4 bootstrap +RUN make bootstrap RUN make -j4 From 257caab1d0bea17fb9bfb5a9e2c782cf96a7d052 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 5 Apr 2021 14:17:02 +0200 Subject: [PATCH 66/75] Obsolete local list functions in shadowfile.el * lisp/shadowfile.el (shadow-union): Make obsolete in favour of cl-union. Update callers. (shadow-find): Make into obsolete function alias for seq-find. Update callers. (cl-lib): Remove unnecessary require. --- lisp/shadowfile.el | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index a4f0eba4449..7fe3ed2f9bd 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el @@ -73,7 +73,6 @@ ;;; Code: -(require 'cl-lib) (require 'tramp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -172,20 +171,6 @@ created by `shadow-define-regexp-group'.") ;;; Syntactic sugar; General list and string manipulation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defun shadow-union (a b) - "Add members of list A to list B if not equal to items already in B." - (if (null a) - b - (if (member (car a) b) - (shadow-union (cdr a) b) - (shadow-union (cdr a) (cons (car a) b))))) - -(defun shadow-find (func list) - "If FUNC applied to some element of LIST is non-nil, return first such element." - (while (and list (not (funcall func (car list)))) - (setq list (cdr list))) - (car list)) - (defun shadow-regexp-superquote (string) "Like `regexp-quote', but includes the \\` and \\'. This makes sure regexp matches nothing but STRING." @@ -226,7 +211,7 @@ information defining the cluster. For interactive use, call (defun shadow-get-cluster (name) "Return cluster named NAME, or nil." - (shadow-find + (seq-find (lambda (x) (string-equal (shadow-cluster-name x) name)) shadow-clusters)) @@ -252,7 +237,7 @@ information defining the cluster. For interactive use, call (defun shadow-site-cluster (site) "Given a SITE, return cluster it is in, or nil." (or (shadow-get-cluster (shadow-site-name site)) - (shadow-find + (seq-find (lambda (x) (string-match (shadow-cluster-regexp x) (shadow-name-site site))) shadow-clusters))) @@ -653,7 +638,7 @@ Consider them as regular expressions if third arg REGEXP is true." shadows shadow-files-to-copy (with-output-to-string (backtrace)))) (when shadows (setq shadow-files-to-copy - (shadow-union shadows shadow-files-to-copy)) + (cl-union shadows shadow-files-to-copy :test #'equal)) (when (not shadow-inhibit-message) (message "%s" (substitute-command-keys "Use \\[shadow-copy-files] to update shadows.")) @@ -839,6 +824,17 @@ look for files that have been changed and need to be copied to other systems." ;; continue standard unloading nil) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Obsolete +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun shadow-union (a b) + "Add members of list A to list B if not equal to items already in B." + (declare (obsolete cl-union "28.1")) + (cl-union a b :test #'equal)) + +(define-obsolete-function-alias 'shadow-find #'seq-find "28.1") + (provide 'shadowfile) ;;; shadowfile.el ends here From 20f7fa691b7c2859b96550d9ccb326bf394e160d Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 5 Apr 2021 14:24:00 +0200 Subject: [PATCH 67/75] Obsolete local set difference functions in favor of seq-difference * lisp/emacs-lisp/seq.el (seq-difference): Add autoload cookie. * lisp/gnus/gnus-range.el (gnus-set-difference): * lisp/gnus/spam.el (spam-set-difference): Make obsolete in favor of seq-difference. Update callers. --- lisp/emacs-lisp/seq.el | 1 + lisp/gnus/gnus-cite.el | 4 ++-- lisp/gnus/gnus-range.el | 9 ++------- lisp/gnus/gnus-sum.el | 5 +++-- lisp/gnus/gnus-uu.el | 2 +- lisp/gnus/nnimap.el | 10 ++++++---- lisp/gnus/spam.el | 14 +++----------- 7 files changed, 18 insertions(+), 27 deletions(-) diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index f2f7d677e88..7aa5684cfd1 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -468,6 +468,7 @@ Equality is defined by TESTFN if non-nil or by `equal' if nil." (seq-reverse sequence1) '())) +;;;###autoload (cl-defgeneric seq-difference (sequence1 sequence2 &optional testfn) "Return a list of the elements that appear in SEQUENCE1 but not in SEQUENCE2. Equality is defined by TESTFN if non-nil or by `equal' if nil." diff --git a/lisp/gnus/gnus-cite.el b/lisp/gnus/gnus-cite.el index 1f564f192b0..4249b50b9ff 100644 --- a/lisp/gnus/gnus-cite.el +++ b/lisp/gnus/gnus-cite.el @@ -839,7 +839,7 @@ See also the documentation for `gnus-article-highlight-citation'." (setq current (car loop) loop (cdr loop)) (setcdr current - (gnus-set-difference (cdr current) numbers))))))))) + (seq-difference (cdr current) numbers #'eq))))))))) (defun gnus-cite-parse-attributions () (let (al-alist) @@ -999,7 +999,7 @@ See also the documentation for `gnus-article-highlight-citation'." loop (cdr loop)) (if (eq current best) () - (setcdr current (gnus-set-difference (cdr current) numbers)) + (setcdr current (seq-difference (cdr current) numbers #'eq)) (when (null (cdr current)) (setq gnus-cite-loose-prefix-alist (delq current gnus-cite-loose-prefix-alist) diff --git a/lisp/gnus/gnus-range.el b/lisp/gnus/gnus-range.el index 456209f3d9a..7d12ae9fdcc 100644 --- a/lisp/gnus/gnus-range.el +++ b/lisp/gnus/gnus-range.el @@ -42,13 +42,8 @@ If RANGE is a single range, return (RANGE). Otherwise, return RANGE." (defun gnus-set-difference (list1 list2) "Return a list of elements of LIST1 that do not appear in LIST2." - (let ((hash2 (make-hash-table :test 'eq)) - (result nil)) - (dolist (elt list2) (puthash elt t hash2)) - (dolist (elt list1) - (unless (gethash elt hash2) - (setq result (cons elt result)))) - (nreverse result))) + (declare (obsolete seq-difference "28.1")) + (seq-difference list1 list2 #'eq)) (defun gnus-range-nconcat (&rest ranges) "Return a range comprising all the RANGES, which are pre-sorted. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index ac9317ef4e2..eeb5ac851ae 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -8569,8 +8569,9 @@ If UNREPLIED (the prefix), limit to unreplied articles." (interactive "P" gnus-summary-mode) (if unreplied (gnus-summary-limit - (gnus-set-difference gnus-newsgroup-articles - gnus-newsgroup-replied)) + (seq-difference gnus-newsgroup-articles + gnus-newsgroup-replied + #'eq)) (gnus-summary-limit gnus-newsgroup-replied)) (gnus-summary-position-point)) diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el index 5cbe8495d31..ceb2ebcdcb1 100644 --- a/lisp/gnus/gnus-uu.el +++ b/lisp/gnus/gnus-uu.el @@ -579,7 +579,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." (defun gnus-new-processable (unmarkp articles) (if unmarkp (nreverse (seq-intersection gnus-newsgroup-processable articles #'eq)) - (gnus-set-difference articles gnus-newsgroup-processable))) + (seq-difference articles gnus-newsgroup-processable #'eq))) (defun gnus-uu-mark-by-regexp (regexp &optional unmark) "Set the process mark on articles whose subjects match REGEXP. diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index f06959f65d9..8990b2bebeb 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -1614,13 +1614,15 @@ If LIMIT, first try to limit the search to the N last articles." (setq start-article 1)) (let* ((unread (gnus-compress-sequence - (gnus-set-difference - (gnus-set-difference + (seq-difference + (seq-difference existing (gnus-sorted-union (cdr (assoc '%Seen flags)) - (cdr (assoc '%Deleted flags)))) - (cdr (assoc '%Flagged flags))))) + (cdr (assoc '%Deleted flags))) + #'eq) + (cdr (assoc '%Flagged flags)) + #'eq))) (read (gnus-range-difference (cons start-article high) unread))) (when (> start-article 1) diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el index d00f0a60b66..3f978918b9a 100644 --- a/lisp/gnus/spam.el +++ b/lisp/gnus/spam.el @@ -710,16 +710,8 @@ finds ham or spam.") (defun spam-set-difference (list1 list2) "Return a set difference of LIST1 and LIST2. When either list is nil, the other is returned." - (if (and list1 list2) - ;; we have two non-nil lists - (progn - (dolist (item (append list1 list2)) - (when (and (memq item list1) (memq item list2)) - (setq list1 (delq item list1)) - (setq list2 (delq item list2)))) - (append list1 list2)) - ;; if either of the lists was nil, return the other one - (if list1 list1 list2))) + (declare (obsolete seq-difference "28.1")) + (seq-difference list1 list2 #'eq)) (defun spam-group-ham-mark-p (group mark &optional spam) "Checks if MARK is considered a ham mark in GROUP." @@ -1327,7 +1319,7 @@ In the case of mover backends, checks the setting of (new-articles (spam-list-articles gnus-newsgroup-articles classification)) - (changed-articles (spam-set-difference new-articles old-articles))) + (changed-articles (seq-difference new-articles old-articles #'eq))) ;; now that we have the changed articles, we go through the processors (dolist (backend (spam-backend-list)) (let (unregister-list) From 6686a31591d2d22a4d1c7b6e68a618823186c48e Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 5 Apr 2021 15:14:19 +0200 Subject: [PATCH 68/75] Remove local uniquify functions in favour of seq-uniq * lisp/emacs-lisp/seq.el (seq-uniq): Add autoload cookie. * lisp/pcomplete.el: (pcomplete-uniquify-list): Use seq-uniq. * lisp/eshell/esh-util.el (eshell-uniqify-list) (eshell-uniquify-list): * lisp/nxml/rng-util.el (rng-uniquify-equal): * lisp/progmodes/idlwave.el (idlwave-uniquify): * lisp/textmodes/artist.el (artist-uniq): Make into obsolete function aliases for seq-uniq. Update callers. * lisp/nxml/rng-util.el (rng-uniquify-eq): Make obsolete in favor of seq-uniq. Update callers. --- lisp/emacs-lisp/seq.el | 1 + lisp/eshell/em-pred.el | 2 +- lisp/eshell/esh-util.el | 16 ++-------------- lisp/nxml/rng-loc.el | 2 +- lisp/nxml/rng-match.el | 2 +- lisp/nxml/rng-nxml.el | 2 +- lisp/nxml/rng-util.el | 28 ++++++++-------------------- lisp/pcomplete.el | 15 +++------------ lisp/progmodes/idlwave.el | 12 +++--------- lisp/textmodes/artist.el | 14 ++------------ 10 files changed, 23 insertions(+), 71 deletions(-) diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 7aa5684cfd1..6c15463ad52 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -431,6 +431,7 @@ Equality is defined by TESTFN if non-nil or by `equal' if nil." (setq index (1+ index))) nil))) +;;;###autoload (cl-defgeneric seq-uniq (sequence &optional testfn) "Return a list of the elements of SEQUENCE with duplicates removed. TESTFN is used to compare elements, or `equal' if TESTFN is nil." diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el index b0a7544bdab..0780d6ee83a 100644 --- a/lisp/eshell/em-pred.el +++ b/lisp/eshell/em-pred.el @@ -130,7 +130,7 @@ The format of each entry is (?e . (lambda (lst) (mapcar #'file-name-extension lst))) (?t . (lambda (lst) (mapcar #'file-name-nondirectory lst))) (?q . (lambda (lst) (mapcar #'eshell-escape-arg lst))) - (?u . (lambda (lst) (eshell-uniquify-list lst))) + (?u . (lambda (lst) (seq-uniq lst))) (?o . (lambda (lst) (sort lst #'string-lessp))) (?O . (lambda (lst) (nreverse (sort lst #'string-lessp)))) (?j . (eshell-join-members)) diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index 1dcbed3d961..a48f62654d5 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -291,20 +291,6 @@ Prepend remote identification of `default-directory', if any." (define-obsolete-function-alias 'eshell-flatten-list #'flatten-tree "27.1") -(defun eshell-uniquify-list (l) - "Remove occurring multiples in L. You probably want to sort first." - (let ((m l)) - (while m - (while (and (cdr m) - (string= (car m) - (cadr m))) - (setcdr m (cddr m))) - (setq m (cdr m)))) - l) -(define-obsolete-function-alias - 'eshell-uniqify-list - 'eshell-uniquify-list "27.1") - (defun eshell-stringify (object) "Convert OBJECT into a string value." (cond @@ -700,6 +686,8 @@ gid format. Valid values are `string' and `integer', defaulting to ;; Obsolete. +(define-obsolete-function-alias 'eshell-uniquify-list #'seq-uniq "28.1") +(define-obsolete-function-alias 'eshell-uniqify-list #'seq-uniq "28.1") (define-obsolete-function-alias 'eshell-copy-tree #'copy-tree "28.1") (define-obsolete-function-alias 'eshell-user-name #'user-login-name "28.1") diff --git a/lisp/nxml/rng-loc.el b/lisp/nxml/rng-loc.el index d5a608d6ff2..a38da794226 100644 --- a/lisp/nxml/rng-loc.el +++ b/lisp/nxml/rng-loc.el @@ -182,7 +182,7 @@ If TYPE-ID is non-nil, then locate the schema for this TYPE-ID." (while files (setq type-ids (rng-possible-type-ids-using (car files) type-ids)) (setq files (cdr files))) - (rng-uniquify-equal (sort type-ids 'string<)))) + (seq-uniq (sort type-ids 'string<)))) (defun rng-locate-schema-file-using (files) "Locate a schema using the schema locating files FILES. diff --git a/lisp/nxml/rng-match.el b/lisp/nxml/rng-match.el index 4fc6727d0e6..7a2739c0616 100644 --- a/lisp/nxml/rng-match.el +++ b/lisp/nxml/rng-match.el @@ -472,7 +472,7 @@ list is nullable and whose cdr is the normalized list." (cons nullable (if sorted head - (rng-uniquify-eq (sort head 'rng-compare-ipattern)))))) + (seq-uniq (sort head 'rng-compare-ipattern) #'eq))))) (defun rng-compare-ipattern (p1 p2) (< (rng--ipattern-index p1) diff --git a/lisp/nxml/rng-nxml.el b/lisp/nxml/rng-nxml.el index 7ea6fb2e49d..33768a46c94 100644 --- a/lisp/nxml/rng-nxml.el +++ b/lisp/nxml/rng-nxml.el @@ -522,7 +522,7 @@ set `xmltok-dtd'. Returns the position of the end of the token." (unless attribute-flag (setcdr ns-prefixes (cons nil (cdr ns-prefixes)))))) (setq iter (cdr iter))) - (rng-uniquify-equal + (seq-uniq (sort (apply #'append (cons extra-strings (mapcar (lambda (name) diff --git a/lisp/nxml/rng-util.el b/lisp/nxml/rng-util.el index a20e95086cb..67e2ee9f1e3 100644 --- a/lisp/nxml/rng-util.el +++ b/lisp/nxml/rng-util.el @@ -36,26 +36,6 @@ (defconst rng-builtin-datatypes-uri (rng-make-datatypes-uri "")) -(defun rng-uniquify-eq (list) - "Destructively remove `eq' duplicates from LIST." - (and list - (let ((head list)) - (while (cdr head) - (if (eq (car head) (cadr head)) - (setcdr head (cddr head))) - (setq head (cdr head))) - list))) - -(defun rng-uniquify-equal (list) - "Destructively remove `equal' duplicates from LIST." - (and list - (let ((head list)) - (while (cdr head) - (if (equal (car head) (cadr head)) - (setcdr head (cddr head))) - (setq head (cdr head))) - list))) - (defun rng-blank-p (str) (string-match "\\`[ \t\n\r]*\\'" str)) (defun rng-substq (new old list) @@ -104,6 +84,14 @@ LIST is not modified." (define-error 'rng-error nil) +;; Obsolete. + +(defun rng-uniquify-eq (list) + (declare (obsolete seq-uniq "28.1")) + (seq-uniq list #'eq)) + +(define-obsolete-function-alias 'rng-uniquify-equal #'seq-uniq "28.1") + (provide 'rng-util) ;;; rng-util.el ends here diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index b648ecf0986..bffdcaa2de0 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -1260,18 +1260,9 @@ If specific documentation can't be given, be generic." (defun pcomplete-uniquify-list (l) "Sort and remove multiples in L." - (setq l (sort l 'string-lessp)) - (let ((m l)) - (while m - (while (and (cdr m) - (string= (car m) - (cadr m))) - (setcdr m (cddr m))) - (setq m (cdr m)))) - l) -(define-obsolete-function-alias - 'pcomplete-uniqify-list - 'pcomplete-uniquify-list "27.1") + (setq l (sort l #'string-lessp)) + (seq-uniq l)) +(define-obsolete-function-alias 'pcomplete-uniqify-list #'pcomplete-uniquify-list "27.1") (defun pcomplete-process-result (cmd &rest args) "Call CMD using `call-process' and return the simplest result." diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index f53f3f3b995..75f2016fc24 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -7601,15 +7601,6 @@ associated TAG, if any." (put-text-property (match-beginning 0) (match-end 0) 'face 'font-lock-string-face)))))) -(defun idlwave-uniquify (list) - (let ((ht (make-hash-table :size (length list) :test 'equal))) - (delq nil - (mapcar (lambda (x) - (unless (gethash x ht) - (puthash x t ht) - x)) - list)))) - (defun idlwave-after-successful-completion (type slash &optional verify) "Add `=' or `(' after successful completion of keyword and function. Restore the pre-completion window configuration if possible." @@ -9101,6 +9092,9 @@ This function was written since `list-abbrevs' looks terrible for IDLWAVE mode." ;; Run the hook (run-hooks 'idlwave-load-hook) +;; Obsolete. +(define-obsolete-function-alias 'idlwave-uniquify #'seq-uniq "28.1") + (provide 'idlwave) ;;; idlwave.el ends here diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index 22ade15921d..fbb9d2174fd 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -1753,13 +1753,6 @@ info-variant-part." "Call function FN with ARGS, if FN is not nil." `(if ,fn (funcall ,fn ,@args))) -(defun artist-uniq (l) - "Remove consecutive duplicates in list L. Comparison is done with `equal'." - (cond ((null l) nil) - ((null (cdr l)) l) ; only one element in list - ((equal (car l) (car (cdr l))) (artist-uniq (cdr l))) ; first 2 equal - (t (cons (car l) (artist-uniq (cdr l)))))) ; first 2 are different - (defun artist-string-split (str r) "Split string STR at occurrences of regexp R, returning a list of strings." (let ((res nil) @@ -2761,7 +2754,7 @@ to append to the end of the list, when doing free-hand drawing)." Also, the `artist-key-poly-point-list' is reversed." (setq artist-key-poly-point-list - (artist-uniq artist-key-poly-point-list)) + (seq-uniq artist-key-poly-point-list)) (if (>= (length artist-key-poly-point-list) 2) @@ -5372,10 +5365,7 @@ The event, EV, is the mouse event." (concat "Hello Tomas,\n\n" "I have a nice bug report on Artist for you! Here it is:"))))) - -;; -;; Now provide this minor mode -;; +(define-obsolete-function-alias 'artist-uniq #'seq-uniq "28.1") (provide 'artist) From 6a8935a1531b8b64777bf357ed65a2ae69eade9e Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 5 Apr 2021 15:15:31 +0200 Subject: [PATCH 69/75] * lisp/pcomplete.el: Remove aliases commented out for 20 years. --- lisp/pcomplete.el | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index bffdcaa2de0..64acc416c23 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -1311,18 +1311,6 @@ If specific documentation can't be given, be generic." (pcomplete-read-hosts pcomplete-hosts-file 'pcomplete--host-name-cache 'pcomplete--host-name-cache-timestamp))) -;; create a set of aliases which allow completion functions to be not -;; quite so verbose - -;;; jww (1999-10-20): are these a good idea? -;; (defalias 'pc-here 'pcomplete-here) -;; (defalias 'pc-test 'pcomplete-test) -;; (defalias 'pc-opt 'pcomplete-opt) -;; (defalias 'pc-match 'pcomplete-match) -;; (defalias 'pc-match-string 'pcomplete-match-string) -;; (defalias 'pc-match-beginning 'pcomplete-match-beginning) -;; (defalias 'pc-match-end 'pcomplete-match-end) - (provide 'pcomplete) ;;; pcomplete.el ends here From 0342354c155728f8d55005bd34a66e1ab3179cc7 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 5 Apr 2021 15:51:08 +0200 Subject: [PATCH 70/75] * lisp/shadowfile.el (cl-lib): Revert removing require. --- lisp/shadowfile.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index 7fe3ed2f9bd..a03965cf6c7 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el @@ -73,6 +73,7 @@ ;;; Code: +(require 'cl-lib) (require 'tramp) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; From 81940e9c0eddf64b1699341e8a35ef556e1593f8 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 5 Apr 2021 17:28:05 +0200 Subject: [PATCH 71/75] Remove redundant #' before lambda in calc/*.el * lisp/calc/calc-alg.el (math-defsimplify): * lisp/calc/calc-ext.el (math-defintegral, math-defintegral-2): * lisp/calc/calc-prog.el (math-do-arg-check): Remove redundant #' before lambda. --- lisp/calc/calc-alg.el | 12 ++++++------ lisp/calc/calc-ext.el | 22 +++++++++++----------- lisp/calc/calc-prog.el | 12 ++++++------ 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lisp/calc/calc-alg.el b/lisp/calc/calc-alg.el index 1327cf0a39b..162026d092b 100644 --- a/lisp/calc/calc-alg.el +++ b/lisp/calc/calc-alg.el @@ -444,12 +444,12 @@ Code can refer to the expression to simplify via lexical variable `expr' and should return the simplified expression to use (or nil)." (declare (indent 1) (debug (sexp body))) (cons 'progn - (mapcar #'(lambda (func) - `(put ',func 'math-simplify - (nconc - (get ',func 'math-simplify) - (list - #'(lambda (expr) ,@code))))) + (mapcar (lambda (func) + `(put ',func 'math-simplify + (nconc + (get ',func 'math-simplify) + (list + (lambda (expr) ,@code))))) (if (symbolp funcs) (list funcs) funcs)))) (math-defsimplify (+ -) diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 24781ed6c86..e85ecf03906 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -2784,23 +2784,23 @@ If X is not an error form, return 1." (declare (indent 1) (debug (sexp body))) (setq math-integral-cache nil) (cons 'progn - (mapcar #'(lambda (func) - `(put ',func 'math-integral - (nconc - (get ',func 'math-integral) - (list - #'(lambda (u) ,@code))))) + (mapcar (lambda (func) + `(put ',func 'math-integral + (nconc + (get ',func 'math-integral) + (list + (lambda (u) ,@code))))) (if (symbolp funcs) (list funcs) funcs)))) (defmacro math-defintegral-2 (funcs &rest code) (declare (indent 1) (debug (sexp body))) (setq math-integral-cache nil) (cons 'progn - (mapcar #'(lambda (func) - `(put ',func 'math-integral-2 - (nconc - (get ',func 'math-integral-2) - (list #'(lambda (u v) ,@code))))) + (mapcar (lambda (func) + `(put ',func 'math-integral-2 + (nconc + (get ',func 'math-integral-2) + (list (lambda (u v) ,@code))))) (if (symbolp funcs) (list funcs) funcs)))) (defvar var-IntegAfterRules 'calc-IntegAfterRules) diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index dd221457f83..4e27d7671e2 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -1881,9 +1881,9 @@ Redefine the corresponding command." (if (fboundp (setq chk (intern (concat "math-" qual-name)))) (append rest (if is-rest - `((mapcar #'(lambda (x) - (or (,chk x) - (math-reject-arg x ',qual))) + `((mapcar (lambda (x) + (or (,chk x) + (math-reject-arg x ',qual))) ,var)) `((or (,chk ,var) (math-reject-arg ,var ',qual))))) @@ -1894,9 +1894,9 @@ Redefine the corresponding command." qual-name 1)))))) (append rest (if is-rest - `((mapcar #'(lambda (x) - (and (,chk x) - (math-reject-arg x ',qual))) + `((mapcar (lambda (x) + (and (,chk x) + (math-reject-arg x ',qual))) ,var)) `((and (,chk ,var) From d2edc29db6278deb20bc04c878757eeee2029086 Mon Sep 17 00:00:00 2001 From: Utkarsh Singh Date: Mon, 5 Apr 2021 18:09:41 +0200 Subject: [PATCH 72/75] Fix cd to directories called "eshell" in eshell * lisp/eshell/em-script.el (eshell-script-initialize): Allow changing directory to directories called "eshell" (bug#47547). Copyright-paperwork-exempt: yes --- lisp/eshell/em-script.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/eshell/em-script.el b/lisp/eshell/em-script.el index 658ea085c95..1f08e891919 100644 --- a/lisp/eshell/em-script.el +++ b/lisp/eshell/em-script.el @@ -60,8 +60,9 @@ This includes when running `eshell-command'." "Initialize the script parsing code." (setq-local eshell-interpreter-alist (cons (cons (lambda (file _args) - (string= (file-name-nondirectory file) - "eshell")) + (and (file-regular-p file) + (string= (file-name-nondirectory file) + "eshell"))) 'eshell/source) eshell-interpreter-alist)) (setq-local eshell-complex-commands From 20669c1b929699670869afa40ee6d407ccb42848 Mon Sep 17 00:00:00 2001 From: Lin Sun Date: Mon, 5 Apr 2021 18:12:14 +0200 Subject: [PATCH 73/75] Don't call `image-toggle-display-text' when toggling *lisp/image-mode.el (image-mode-to-text): Do not call the image-toggle-display-text twice when toggle image display (bug#47521). --- lisp/image-mode.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 2de16cb6afd..f4ff35f9c41 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -732,8 +732,9 @@ displays an image file as text." (setq image-type previous-image-type) ;; Enable image minor mode with `C-c C-c'. (image-minor-mode 1) - ;; Show the image file as text. - (image-toggle-display-text))) + (unless (image-get-display-property) + ;; Show the image file as text. + (image-toggle-display-text)))) (defun image-mode-as-hex () "Set a non-image mode as major mode in combination with image minor mode. From ddc4bba41387fdc7caef874f65d1ac78d12305e7 Mon Sep 17 00:00:00 2001 From: Dario Gjorgjevski Date: Mon, 5 Apr 2021 18:15:16 +0200 Subject: [PATCH 74/75] Do not search the global keymap in project--keymap-prompt * lisp/progmodes/project.el: (project--keymap-prompt) Pass project--keymap-prompt as a list to where-is-internal so that the global keymap is not searched at all (bug#47501). --- lisp/progmodes/project.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 3dd11118ea1..910f70db03c 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1322,7 +1322,7 @@ are legal even if they aren't listed in the dispatch menu." key tmp))) (let ((key (if key (vector key) - (where-is-internal cmd project-prefix-map t)))) + (where-is-internal cmd (list project-prefix-map) t)))) (format "[%s] %s" (propertize (key-description key) 'face 'bold) label))) From 14d295871a93c37a33d558ec4e8d49a93b787d8e Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 5 Apr 2021 19:37:30 +0200 Subject: [PATCH 75/75] Use powershell for Tramp on MS Windows * lisp/net/tramp-sh.el (tramp-use-ssh-controlmaster-options): Nil on MS Windows. (tramp-connection-properties): Add "encoding-shell". (tramp-maybe-open-connection): Use it. Change exit handling. (tramp-actions-before-shell): Add `tramp-no-job-control-regexp'. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-no-job-control-regexp): New defcustom. (tramp-get-debug-buffer): Set coding system. --- lisp/net/tramp-sh.el | 37 ++++++++++++++++++++++--------------- lisp/net/tramp.el | 25 ++++++++++++++++++------- 2 files changed, 40 insertions(+), 22 deletions(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index c3e1745d2f2..499bf8abe41 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -103,12 +103,12 @@ detected as prompt when being sent on echoing hosts, therefore.") (defconst tramp-end-of-heredoc (md5 tramp-end-of-output) "String used to recognize end of heredoc strings.") -(defcustom tramp-use-ssh-controlmaster-options t +(defcustom tramp-use-ssh-controlmaster-options (not (eq system-type 'windows-nt)) "Whether to use `tramp-ssh-controlmaster-options'. Set it to nil, if you use Control* or Proxy* options in your ssh configuration." :group 'tramp - :version "24.4" + :version "28.1" :type 'boolean) (defvar tramp-ssh-controlmaster-options nil @@ -389,7 +389,14 @@ The string is used in `tramp-methods'.") (regexp-opt '("rcp" "remcp" "rsh" "telnet" "nc" "krlogin" "fcp")) "\\'") - nil ,(user-login-name)))) + nil ,(user-login-name))) + + ;; MS Windows Openssh client does not cooperate well with cmdproxy. + (when-let ((encoding-shell + (and (eq system-type 'windows-nt) (executable-find "powershell")))) + (add-to-list 'tramp-connection-properties + `(,(regexp-opt '("/sshx:" "/scpx:")) + "encoding-shell" ,encoding-shell)))) ;;;###tramp-autoload (defconst tramp-completion-function-alist-rsh @@ -484,6 +491,7 @@ shell from reading its init file." '((tramp-login-prompt-regexp tramp-action-login) (tramp-password-prompt-regexp tramp-action-password) (tramp-wrong-passwd-regexp tramp-action-permission-denied) + (tramp-no-job-control-regexp tramp-action-permission-denied) (shell-prompt-pattern tramp-action-succeed) (tramp-shell-prompt-pattern tramp-action-succeed) (tramp-yesno-prompt-regexp tramp-action-yesno) @@ -4857,8 +4865,6 @@ connection if a previous connection has died for some reason." (setenv "HISTSIZE" "0")))) (setenv "PROMPT_COMMAND") (setenv "PS1" tramp-initial-end-of-output) - (unless (stringp tramp-encoding-shell) - (tramp-error vec 'file-error "`tramp-encoding-shell' not set")) (let* ((current-host tramp-system-name) (target-alist (tramp-compute-multi-hops vec)) ;; We will apply `tramp-ssh-controlmaster-options' @@ -4870,17 +4876,23 @@ connection if a previous connection has died for some reason." ;; W32 systems. (process-coding-system-alist nil) (coding-system-for-read nil) - (extra-args (tramp-get-sh-extra-args tramp-encoding-shell)) + (encoding-shell + (tramp-get-connection-property + vec "encoding-shell" tramp-encoding-shell)) + (extra-args (tramp-get-sh-extra-args encoding-shell)) ;; This must be done in order to avoid our file ;; name handler. (p (let ((default-directory (tramp-compat-temporary-file-directory))) + (unless (stringp encoding-shell) + (tramp-error + vec 'file-error "`tramp-encoding-shell' not set")) (apply #'start-process (tramp-get-connection-name vec) (tramp-get-connection-buffer vec) (append - (list tramp-encoding-shell) + (list encoding-shell) (and extra-args (split-string extra-args)) (and tramp-encoding-command-interactive (list tramp-encoding-command-interactive))))))) @@ -4899,8 +4911,7 @@ connection if a previous connection has died for some reason." ;; Check whether process is alive. (tramp-barf-if-no-shell-prompt - p 10 - "Couldn't find local shell prompt for %s" tramp-encoding-shell) + p 10 "Couldn't find local shell prompt for %s" encoding-shell) ;; Now do all the connections as specified. (while target-alist @@ -4974,12 +4985,8 @@ connection if a previous connection has died for some reason." ?h (or l-host "") ?u (or l-user "") ?p (or l-port "") ?c (format-spec options (format-spec-make ?t tmpfile)) ?l (concat remote-shell " " extra-args " -i")) - ;; Local shell could be a Windows COMSPEC. It - ;; doesn't know the ";" syntax, but we must - ;; exit always for `start-file-process'. It - ;; could also be a restricted shell, which does - ;; not allow "exec". - (when r-shell '("&&" "exit" "||" "exit"))) + ;; A restricted shell does not allow "exec". + (when r-shell '("; exit"))) " ")) ;; Send the command. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 8141f026f74..99955b54598 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -354,12 +354,13 @@ Notes: All these arguments can be overwritten by connection properties. See Info node `(tramp) Predefined connection information'. -When using `su' or `sudo' the phrase \"open connection to a remote -host\" sounds strange, but it is used nevertheless, for consistency. -No connection is opened to a remote host, but `su' or `sudo' is -started on the local host. You should specify a remote host -`localhost' or the name of the local host. Another host name is -useful only in combination with `tramp-default-proxies-alist'.") +When using `su', `sudo' or `doas' the phrase \"open connection to +a remote host\" sounds strange, but it is used nevertheless, for +consistency. No connection is opened to a remote host, but `su', +`sudo' or `doas' is started on the local host. You should +specify a remote host `localhost' or the name of the local host. +Another host name is useful only in combination with +`tramp-default-proxies-alist'.") (defcustom tramp-default-method ;; An external copy method seems to be preferred, because it performs @@ -690,6 +691,15 @@ The regexp should match at end of buffer." :version "27.1" :type 'regexp) +;; Powershell requires "ssh -t -t" for terminal emulation. If it +;; doesn't fit, there is an error. +(defcustom tramp-no-job-control-regexp + (regexp-quote "Thus no job control in this shell.") + "Regular expression matching powershell's job control message. +The regexp should match at end of buffer." + :version "28.1" + :type 'regexp) + (defcustom tramp-operation-not-permitted-regexp (concat "\\(" "preserving times.*" "\\|" "set mode" "\\)" ":\\s-*" (regexp-opt '("Operation not permitted") t)) @@ -1808,6 +1818,7 @@ The outline level is equal to the verbosity of the Tramp message." "Get the debug buffer for VEC." (with-current-buffer (get-buffer-create (tramp-debug-buffer-name vec)) (when (bobp) + (set-buffer-file-coding-system 'utf-8) (setq buffer-undo-list t) ;; Activate `outline-mode'. This runs `text-mode-hook' and ;; `outline-mode-hook'. We must prevent that local processes @@ -1848,7 +1859,7 @@ ARGUMENTS to actually emit the message (if applicable)." (when (bobp) (insert (format - ";; Emacs: %s Tramp: %s -*- mode: outline; -*-" + ";; Emacs: %s Tramp: %s -*- mode: outline; coding: utf-8; -*-" emacs-version tramp-version)) (when (>= tramp-verbose 10) (let ((tramp-verbose 0))