commit 91432f1ec55e125541d5e206402a72dfdef88ed8 (HEAD, refs/remotes/origin/master) Author: Juri Linkov Date: Thu Dec 10 10:28:32 2020 +0200 Allow creating a new tab from the minibuffer (bug#45072) * lisp/tab-bar.el (tab-bar-new-tab-to): Select the original window when selected window is the minibuffer. diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 2604955224..1327bde908 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -762,6 +762,8 @@ After the tab is created, the hooks in (from-tab (tab-bar--tab))) (when tab-bar-new-tab-choice + (when (minibuffer-selected-window) + (select-window (minibuffer-selected-window))) (delete-other-windows) ;; Create a new window to get rid of old window parameters ;; (e.g. prev/next buffers) of old window. commit 4f352ad6f1759ae6dcff6ba43847273491bf9c30 Author: Dmitry Gutov Date: Thu Dec 10 02:31:39 2020 +0200 Valentin Gatien-Baron * lisp/vc/vc-hg.el (vc-hg-working-revision): Use 'hg log -T' instead of 'hg parent' (bug#36534). Copyright-paperwork-exempt: yes diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index e7f67e90ee..c8a80d75ec 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -276,13 +276,12 @@ If `ask', you will be prompted for a branch type." ((eq state ?C) 'up-to-date) ;; Older mercurial versions use this. (t 'up-to-date)))))) -(defun vc-hg-working-revision (file) +(defun vc-hg-working-revision (_file) "Hg-specific version of `vc-working-revision'." - (or (ignore-errors - (with-output-to-string - (vc-hg-command standard-output 0 file - "parent" "--template" "{rev}"))) - "0")) + (ignore-errors + (with-output-to-string + (vc-hg-command standard-output 0 nil + "log" "-r" "." "--template" "{rev}")))) (defcustom vc-hg-symbolic-revision-styles '(builtin-active-bookmark commit ddf55400dc70a394ecb0547f588f08c95ab8541a Author: Stefan Kangas Date: Wed Dec 9 22:40:31 2020 +0100 Fix thinko in my previous commit * lisp/pcomplete.el (pcomplete-comint-setup): Fix thinko in my previous commit. This was not a quoted symbol but a variable, and therefore cannot use setq-local. diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 4b31d157f6..1f3327435e 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -742,8 +742,8 @@ this is `comint-dynamic-complete-functions'." #'pcomplete-parse-comint-arguments) (add-hook 'completion-at-point-functions #'pcomplete-completions-at-point nil 'local) - (setq-local completef-sym - (copy-sequence (symbol-value completef-sym))) + (set (make-local-variable completef-sym) + (copy-sequence (symbol-value completef-sym))) (let* ((funs (symbol-value completef-sym)) (elem (or (memq 'comint-filename-completion funs) (memq 'shell-filename-completion funs) commit 1047f80f1c609aa1ce47bf9b294240fb9adf4b24 Author: Dmitry Gutov Date: Wed Dec 9 23:37:53 2020 +0200 * lisp/progmodes/xref.el: Bump the version. diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 7255079e87..6e99e9d8ac 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1,7 +1,7 @@ ;;; xref.el --- Cross-referencing commands -*-lexical-binding:t-*- ;; Copyright (C) 2014-2020 Free Software Foundation, Inc. -;; Version: 1.0.3 +;; Version: 1.0.4 ;; Package-Requires: ((emacs "26.3")) ;; This is a GNU ELPA :core package. Avoid functionality that is not commit 1729883c988d8893ef3e1ed0d26f52e150cd1b8f Author: Stefan Kangas Date: Wed Dec 9 22:24:43 2020 +0100 ; Fix typo in my previous commit * lisp/pcomplete.el (pcomplete-comint-setup): Fix typo. diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index a24df93a82..4b31d157f6 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -742,7 +742,7 @@ this is `comint-dynamic-complete-functions'." #'pcomplete-parse-comint-arguments) (add-hook 'completion-at-point-functions #'pcomplete-completions-at-point nil 'local) - (setq-local ompletef-sym + (setq-local completef-sym (copy-sequence (symbol-value completef-sym))) (let* ((funs (symbol-value completef-sym)) (elem (or (memq 'comint-filename-completion funs) commit 5af6a87d51fd5008c05876616c665679ffd0a597 Author: Dmitry Gutov Date: Wed Dec 9 22:56:12 2020 +0200 Allow specifying the project to switch to programmatically * lisp/progmodes/project.el (project-switch-project): Allow specifying the project to switch to programmatically (bug#45134). diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 449eadc3de..98ad41487a 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1275,13 +1275,15 @@ the menu entries in the dispatch menu.") " ")) ;;;###autoload -(defun project-switch-project () +(defun project-switch-project (dir) "\"Switch\" to another project by running an Emacs command. The available commands are presented as a dispatch menu -made from `project-switch-commands'." - (interactive) - (let ((dir (project-prompt-project-dir)) - (choice nil)) +made from `project-switch-commands'. + +When called in a program, it will use the project corresponding +to directory DIR." + (interactive (list (project-prompt-project-dir))) + (let ((choice nil)) (while (not choice) (setq choice (assq (read-event (project--keymap-prompt)) project-switch-commands))) commit ea8ff97536905ebc9157dd2194aaf68a17099b81 Author: Dmitry Gutov Date: Wed Dec 9 21:42:19 2020 +0200 Add missing defcustom keywords to new variables * lisp/progmodes/xref.el (xref-search-program-alist) (xref-search-program): Add :version and :package-version. diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 389b7cf247..7255079e87 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1355,7 +1355,9 @@ The template should have the following fields: for the regexp itself (in Extended format)" :type '(repeat (cons (symbol :tag "Program identifier") - (string :tag "Command template")))) + (string :tag "Command template"))) + :version "28.1" + :package-version '(xref . "1.0.4")) (defcustom xref-search-program 'grep "The program to use for regexp search inside files. @@ -1364,7 +1366,9 @@ This must reference a corresponding entry in `xref-search-program-alist'." :type `(choice (const :tag "Use Grep" grep) (const :tag "Use ripgrep" ripgrep) - (symbol :tag "User defined"))) + (symbol :tag "User defined")) + :version "28.1" + :package-version '(xref . "1.0.4")) ;;;###autoload (defun xref-matches-in-files (regexp files) commit 7f42cab82cf7aa5435400a03007ffb85590b39e5 Author: Lars Ingebrigtsen Date: Wed Dec 9 20:40:03 2020 +0100 Clarify `scroll-preserve-screen-position' doc string * src/window.c (syms_of_window): Clarify the doc string (bug#7910). diff --git a/src/window.c b/src/window.c index 5df3e37fbe..8e75e460b2 100644 --- a/src/window.c +++ b/src/window.c @@ -8246,11 +8246,17 @@ is displayed in the `mode-line' face. */); DEFVAR_LISP ("scroll-preserve-screen-position", Vscroll_preserve_screen_position, doc: /* Controls if scroll commands move point to keep its screen position unchanged. + A value of nil means point does not keep its screen position except at the scroll margin or window boundary respectively. + A value of t means point keeps its screen position if the scroll command moved it vertically out of the window, e.g. when scrolling -by full screens. +by full screens. If point is within `next-screen-context-lines' lines +from the edges of the window, point will typically not keep its screen +position when doing commands like `scroll-up-command'/`scroll-down-command' +and the like. + Any other value means point always keeps its screen position. Scroll commands should have the `scroll-command' property on their symbols to be controlled by this variable. */); commit b71be20eaff7b3b13c67515e7919d36ecbd7b22b Author: Juri Linkov Date: Wed Dec 9 21:30:47 2020 +0200 Remove isearch-input-method-local-p and always set buffer-local input-method * lisp/isearch.el (isearch-input-method-local-p): Remove defvar. (isearch-mode): Don't set isearch-input-method-local-p. Set buffer-local input-method-function to nil. (isearch-done): When isearch-input-method-function is still non-nil, set the buffer-local value of input-method-function. (Bug#45005) * lisp/international/isearch-x.el (isearch-toggle-specified-input-method) (isearch-toggle-input-method, isearch-transient-input-method): Don't set isearch-input-method-local-p to t. Set buffer-local input-method-function to nil. * lisp/language/korea-util.el (isearch-toggle-korean-input-method) (isearch-hangul-switch-symbol-ksc, isearch-hangul-switch-hanja): Don't set isearch-input-method-local-p to t. Set buffer-local input-method-function to nil. diff --git a/lisp/international/isearch-x.el b/lisp/international/isearch-x.el index f50f86a035..867a3d8697 100644 --- a/lisp/international/isearch-x.el +++ b/lisp/international/isearch-x.el @@ -35,9 +35,8 @@ (interactive) (let ((overriding-terminal-local-map nil)) (toggle-input-method t)) - (setq isearch-input-method-function input-method-function - isearch-input-method-local-p t) - (setq input-method-function nil) + (setq isearch-input-method-function input-method-function) + (setq-local input-method-function nil) (isearch-update)) ;;;###autoload @@ -46,9 +45,8 @@ (interactive) (let ((overriding-terminal-local-map nil)) (toggle-input-method)) - (setq isearch-input-method-function input-method-function - isearch-input-method-local-p t) - (setq input-method-function nil) + (setq isearch-input-method-function input-method-function) + (setq-local input-method-function nil) (isearch-update)) ;;;###autoload @@ -57,9 +55,8 @@ (interactive) (let ((overriding-terminal-local-map nil)) (activate-transient-input-method)) - (setq isearch-input-method-function input-method-function - isearch-input-method-local-p t) - (setq input-method-function nil) + (setq isearch-input-method-function input-method-function) + (setq-local input-method-function nil) (isearch-update)) (defvar isearch-minibuffer-local-map diff --git a/lisp/isearch.el b/lisp/isearch.el index a0aa250c4b..0d5c480c8d 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -965,10 +965,6 @@ Each element is an `isearch--state' struct where the slots are ;; The value of input-method-function when isearch is invoked. (defvar isearch-input-method-function nil) -;; A flag to tell if input-method-function is locally bound when -;; isearch is invoked. -(defvar isearch-input-method-local-p nil) - (defvar isearch--saved-overriding-local-map nil) ;; Minor-mode-alist changes - kind of redundant with the @@ -1238,7 +1234,6 @@ used to set the value of `isearch-regexp-function'." search-ring-yank-pointer nil isearch-opened-overlays nil isearch-input-method-function input-method-function - isearch-input-method-local-p (local-variable-p 'input-method-function) regexp-search-ring-yank-pointer nil isearch-pre-scroll-point nil @@ -1259,9 +1254,7 @@ used to set the value of `isearch-regexp-function'." ;; We must bypass input method while reading key. When a user type ;; printable character, appropriate input method is turned on in ;; minibuffer to read multibyte characters. - (or isearch-input-method-local-p - (make-local-variable 'input-method-function)) - (setq input-method-function nil) + (setq-local input-method-function nil) (looking-at "") (setq isearch-window-configuration @@ -1418,8 +1411,8 @@ NOPUSH is t and EDIT is t." (set-window-group-start (selected-window) found-start t)))) (setq isearch-mode nil) - (if isearch-input-method-local-p - (setq input-method-function isearch-input-method-function) + (if isearch-input-method-function + (setq-local input-method-function isearch-input-method-function) (kill-local-variable 'input-method-function)) (if isearch-tool-bar-old-map diff --git a/lisp/language/korea-util.el b/lisp/language/korea-util.el index 3821785da7..36e1d20a22 100644 --- a/lisp/language/korea-util.el +++ b/lisp/language/korea-util.el @@ -70,27 +70,24 @@ (interactive) (let ((overriding-terminal-local-map nil)) (toggle-korean-input-method)) - (setq isearch-input-method-function input-method-function - isearch-input-method-local-p t) - (setq input-method-function nil) + (setq isearch-input-method-function input-method-function) + (setq-local input-method-function nil) (isearch-update)) (defun isearch-hangul-switch-symbol-ksc () (interactive) (let ((overriding-terminal-local-map nil)) (quail-hangul-switch-symbol-ksc)) - (setq isearch-input-method-function input-method-function - isearch-input-method-local-p t) - (setq input-method-function nil) + (setq isearch-input-method-function input-method-function) + (setq-local input-method-function nil) (isearch-update)) (defun isearch-hangul-switch-hanja () (interactive) (let ((overriding-terminal-local-map nil)) (quail-hangul-switch-hanja)) - (setq isearch-input-method-function input-method-function - isearch-input-method-local-p t) - (setq input-method-function nil) + (setq isearch-input-method-function input-method-function) + (setq-local input-method-function nil) (isearch-update)) ;; Information for setting and exiting Korean environment. commit 303f0a19cc6b819dd4dc750aa278ca8563d3b64b Author: Juri Linkov Date: Wed Dec 9 21:16:03 2020 +0200 Support highlighting of ripgrep output (bug#44983) * etc/grep.txt: Add ripgrep samples. * lisp/progmodes/grep.el (grep-match-regexp): Highlight ripgrep matches too. (grep-regexp-alist): Remove $ to highlight ripgrep binary file matches. diff --git a/etc/grep.txt b/etc/grep.txt index 19a3b4b47b..3dc4aac3c8 100644 --- a/etc/grep.txt +++ b/etc/grep.txt @@ -85,6 +85,12 @@ git --no-pager grep -inH -p -e "org-element-map" lisp/org/org.el=20969=(defun org-fill-paragraph (&optional justify) lisp/org/org.el:21047: (org-element-map +* ripgrep + +rg -nH --color always --no-heading -e grep-match-regexp +lisp/progmodes/grep.el:608: (while (re-search-forward grep-match-regexp end 1) +Binary file emacs.info matches (found "\u{0}" byte around offset 2222525) + * unknown greps grep -nH -e "xyzxyz" ../info/* diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 7c8acedaf3..5dc99cc7e9 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -100,7 +100,7 @@ To change the default value, use \\[customize] or call the function :set #'grep-apply-setting :version "22.1") -(defcustom grep-match-regexp "\033\\[0?1;31m\\(.*?\\)\033\\[[0-9]*m" +(defcustom grep-match-regexp "\033\\[\\(?:0?1;\\)?31m\\(.*?\\)\033\\[[0-9]*m" "Regular expression matching grep markers to highlight. It matches SGR ANSI escape sequences which are emitted by grep to color its output. This variable is used in `grep-filter'." @@ -412,7 +412,7 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies (- mend beg)))))) nil nil (3 '(face nil display ":"))) - ("^Binary file \\(.+\\) matches$" 1 nil nil 0 1)) + ("^Binary file \\(.+\\) matches" 1 nil nil 0 1)) "Regexp used to match grep hits. See `compilation-error-regexp-alist' for format details.") diff --git a/test/README b/test/README index d0da89d1c2..3365f18cf7 100644 --- a/test/README +++ b/test/README @@ -113,7 +113,8 @@ $EMACS_HYDRA_CI indicates the hydra environment, and $EMACS_EMBA_CI indicates the emba environment, respectively. -(Also, see etc/compilation.txt for compilation mode font lock tests.) +(Also, see etc/compilation.txt for compilation mode font lock tests +and etc/grep.txt for grep mode font lock tests.) This file is part of GNU Emacs. commit ef5e0785aee978c55abaecf44ba63867ff3598c4 Author: Mattias Engdegård Date: Sun Dec 6 16:22:09 2020 +0100 Stricter gradle-kotlin message pattern * lisp/progmodes/compile.el (compilation-error-regexp-alist-alist): Rule 'gradle-kotlin': don't be more forgiving than necessary; we know exactly what the output looks like (see https://github.com/JetBrains/kotlin/commit/\ ffe8ae3840d7b9bdc82170c8181031f05ced68bd) and there is no reason to risk mismatches or expensive backtracking (bug#18109). Recognise 'info' level messages. Convert to rx. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 310b332fa8..d2293151c7 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -241,11 +241,20 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) ;; GradleStyleMessagerRenderer.kt in kotlin sources, see ;; https://youtrack.jetbrains.com/issue/KT-34683). (gradle-kotlin - ,(concat - "^\\(?:\\(w\\)\\|.\\): *" ;type - "\\(\\(?:[A-Za-z]:\\)?[^:\n]+\\): *" ;file - "(\\([0-9]+\\), *\\([0-9]+\\))") ;line, column - 2 3 4 (1)) + ,(rx bol + (| (group "w") ; 1: warning + (group (in "iv")) ; 2: info + "e") ; error + ": " + (group ; 3: file + (? (in "A-Za-z") ":") + (+ (not (in "\n:")))) + ": (" + (group (+ digit)) ; 4: line + ", " + (group (+ digit)) ; 5: column + "): ") + 3 4 5 (1 . 2)) (iar "^\"\\(.*\\)\",\\([0-9]+\\)\\s-+\\(?:Error\\|Warnin\\(g\\)\\)\\[[0-9]+\\]:" commit 3052cbb07875ca523c318048530eebf80eb2c48f Author: Lars Ingebrigtsen Date: Wed Dec 9 18:42:36 2020 +0100 Include the keymap in the gud-mode doc string * lisp/progmodes/gud.el (gud-mode): Add the gud keymap to the end of the doc string for easier access (bug#31406). diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index cee0961013..134c2fc5c9 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -2566,7 +2566,11 @@ You may use the `gud-def' macro in the initialization hook to define other commands. Other commands for interacting with the debugger process are inherited from -comint mode, which see." +`comint-mode', which see. + +Commands: + +\\{gud-mode-map}" (setq mode-line-process '(":%s")) (define-key (current-local-map) "\C-c\C-l" 'gud-refresh) (setq-local gud-last-frame nil) commit 28b61da99f89b3771f5581077dfe6179987e3a2f Author: Lars Ingebrigtsen Date: Wed Dec 9 18:36:41 2020 +0100 `pdb' doc string clarification * lisp/progmodes/gud.el (pdb): Mention that this command is for debugging Python scripts. diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 279a70b0d7..cee0961013 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -1683,7 +1683,7 @@ and source-file directory for your debugger." ;;;###autoload (defun pdb (command-line) - "Run COMMAND-LINE in the `*gud-FILE*' buffer. + "Run COMMAND-LINE in the `*gud-FILE*' buffer to debug Python programs. COMMAND-LINE should include the pdb executable name (`gud-pdb-command-name') and the file to be debugged. commit e2c08dbf7b213e69b23f1938aa37b26f2c207926 Merge: 4adc79641f 809b22d18d Author: Glenn Morris Date: Wed Dec 9 08:50:12 2020 -0800 ; Merge from origin/emacs-27 The following commit was skipped: 809b22d18d (origin/emacs-27) Fix crash (segfault) in etags on generat... commit 4adc79641f92177b6ec3b6e74e1fa0c2d81a4ba3 Merge: 72f064fffd c0b3e38d7c Author: Glenn Morris Date: Wed Dec 9 08:50:12 2020 -0800 Merge from origin/emacs-27 c0b3e38d7c Update publicsuffix.txt from upstream 3fe6cea6e0 * lisp/vc/vc.el: Update args of backend API calls in the h... commit 72f064fffd621bbda6cd636066957d98805f0431 Merge: 3721cc5886 a40be60ec8 Author: Glenn Morris Date: Wed Dec 9 08:50:12 2020 -0800 ; Merge from origin/emacs-27 The following commit was skipped: a40be60ec8 Backport Handle read-char-from-minibuffer and y-or-n-p fro... commit 3721cc58865673e3dd66a9d7a23d3b629432f077 Merge: 05dfbd0667 32090a3de4 Author: Glenn Morris Date: Wed Dec 9 08:50:12 2020 -0800 Merge from origin/emacs-27 32090a3de4 Improve documentation of streams in batch mode 34feded008 Support ks_c_5601-1987 encoding da00a6f317 Fix Xaw widget text disappearing when built with cairo (bu... 6916e7954a Improve documentation of 'ps-print-color-p' 6663b2f211 ; * lisp/simple.el (move-beginning-of-line): Doc fix. a4dd03ebe9 ; * src/charset.c (Fmap_charset_chars): Doc fix. d86cc3ffcb ; * src/chartab.c, src/lisp.h: Fix typos in comments. commit 05dfbd0667bea8102a8daa7ea8894848178307ea Author: Lars Ingebrigtsen Date: Wed Dec 9 17:35:59 2020 +0100 Fix mark-defun in fortran-mode * lisp/progmodes/fortran.el (fortran-beginning-of-subprogram): Make mark-defun work (bug#33208). diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index 3a0274c609..90eda441fb 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -1218,25 +1218,31 @@ Auto-indent does not happen if a numeric ARG is used." ;; Note that unlike the latter, we don't have to worry about nested ;; subprograms (?). ;; FIXME push-mark? -(defun fortran-beginning-of-subprogram () - "Move point to the beginning of the current Fortran subprogram." +(defun fortran-beginning-of-subprogram (&optional arg) + "Move point to the beginning of the current Fortran subprogram. +If ARG is negative, go to the beginning of the next instead." (interactive) - (let ((case-fold-search t)) - ;; If called already at the start of subprogram, go to the previous. - (beginning-of-line (if (bolp) 0 1)) - (save-match-data - (or (looking-at fortran-start-prog-re) - ;; This leaves us at bob if before the first subprogram. - (eq (fortran-previous-statement) 'first-statement) - (if (or (catch 'ok - (while (re-search-backward fortran-end-prog-re nil 'move) - (if (fortran-check-end-prog-re) (throw 'ok t)))) - ;; If the search failed, must be at bob. - ;; First code line is the start of the subprogram. - ;; FIXME use a more rigorous test, cf fortran-next-statement? - ;; Though that needs to handle continuations too. - (not (looking-at "^\\([ \t]*[0-9]\\|[ \t]+[^!#]\\)"))) - (fortran-next-statement)))))) + (if (and arg + (< arg 0)) + (progn + (fortran-end-of-subprogram) + (fortran-beginning-of-subprogram)) + (let ((case-fold-search t)) + ;; If called already at the start of subprogram, go to the previous. + (beginning-of-line (if (bolp) 0 1)) + (save-match-data + (or (looking-at fortran-start-prog-re) + ;; This leaves us at bob if before the first subprogram. + (eq (fortran-previous-statement) 'first-statement) + (if (or (catch 'ok + (while (re-search-backward fortran-end-prog-re nil 'move) + (if (fortran-check-end-prog-re) (throw 'ok t)))) + ;; If the search failed, must be at bob. + ;; First code line is the start of the subprogram. + ;; FIXME use a more rigorous test, cf fortran-next-statement? + ;; Though that needs to handle continuations too. + (not (looking-at "^\\([ \t]*[0-9]\\|[ \t]+[^!#]\\)"))) + (fortran-next-statement))))))) ;; This is simpler than f-beginning-of-s because the end of a ;; subprogram is never implicit. commit 7b9f6ee5e0a2a5470d62b297773807844378688e Author: Eli Zaretskii Date: Wed Dec 9 18:13:35 2020 +0200 Improve predictability of 'scroll-preserve-screen-position' * src/window.c (window_scroll_pixel_based): Compute the new window-start more precisely when 'scroll-preserve-screen-position' is non-nil. (Bug#8355) diff --git a/src/window.c b/src/window.c index 6cd3122b43..5df3e37fbe 100644 --- a/src/window.c +++ b/src/window.c @@ -5669,7 +5669,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, bool noerror) if (whole) { ptrdiff_t start_pos = IT_CHARPOS (it); - int dy = frame_line_height; + int flh = frame_line_height; int ht = window_box_height (w); int nscls = sanitize_next_screen_context_lines (); /* In the below we divide the window box height by the frame's @@ -5677,14 +5677,37 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, bool noerror) box is not an integral multiple of the line height. This is important to ensure we get back to the same position when scrolling up, then down. */ - dy = n * max (dy, (ht / dy - nscls) * dy); + int dy = n * max (flh, (ht / flh - nscls) * flh); + int goal_y; + void *it_data; /* Note that move_it_vertically always moves the iterator to the start of a line. So, if the last line doesn't have a newline, we would end up at the start of the line ending at ZV. */ if (dy <= 0) { + goal_y = it.current_y - dy; move_it_vertically_backward (&it, -dy); + /* Extra precision for people who want us to preserve the + screen position of the cursor: effectively round DY to the + nearest screen line, instead of rounding to zero; the latter + causes point to move by one line after C-v followed by M-v, + if the buffer has lines of different height. */ + if (!NILP (Vscroll_preserve_screen_position) + && it.current_y - goal_y > 0.5 * flh) + { + it_data = bidi_shelve_cache (); + struct it it2 = it; + + move_it_by_lines (&it, -1); + if (it.current_y < goal_y - 0.5 * flh) + { + it = it2; + bidi_unshelve_cache (it_data, false); + } + else + bidi_unshelve_cache (it_data, true); + } /* Ensure we actually do move, e.g. in case we are currently looking at an image that is taller that the window height. */ while (start_pos == IT_CHARPOS (it) @@ -5693,8 +5716,25 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, bool noerror) } else if (dy > 0) { - move_it_to (&it, ZV, -1, it.current_y + dy, -1, - MOVE_TO_POS | MOVE_TO_Y); + goal_y = it.current_y + dy; + move_it_to (&it, ZV, -1, goal_y, -1, MOVE_TO_POS | MOVE_TO_Y); + /* See the comment above, for the reasons of this + extra-precision. */ + if (!NILP (Vscroll_preserve_screen_position) + && goal_y - it.current_y > 0.5 * flh) + { + it_data = bidi_shelve_cache (); + struct it it2 = it; + + move_it_by_lines (&it, 1); + if (it.current_y > goal_y + 0.5 * flh) + { + it = it2; + bidi_unshelve_cache (it_data, false); + } + else + bidi_unshelve_cache (it_data, true); + } /* Ensure we actually do move, e.g. in case we are currently looking at an image that is taller that the window height. */ while (start_pos == IT_CHARPOS (it) commit e6c0447781be9b91c11ca083dbea7934a897f509 Merge: b3d21dcd72 4a423ffb3b Author: Eli Zaretskii Date: Wed Dec 9 17:18:01 2020 +0200 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs commit b3d21dcd72fdd05b7884b206813e80127dcac9fe Author: Eli Zaretskii Date: Wed Dec 9 17:17:09 2020 +0200 Update docs of 'defvar' and 'defface' * doc/lispref/display.texi (Defining Faces): * doc/lispref/variables.texi (Defining Variables): Update the descriptions of 'defvar' and 'defface' per recent changes in 'eval-last-sexp'. (Bug#45125) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index f86baf5936..ed26ae8808 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -2632,10 +2632,12 @@ appearance of @var{face} will again be determined by its default face spec. @cindex @code{eval-defun}, and @code{defface} forms +@cindex @code{eval-last-sexp}, and @code{defface} forms As an exception, if you evaluate a @code{defface} form with -@kbd{C-M-x} in Emacs Lisp mode (@code{eval-defun}), a special feature -of @code{eval-defun} overrides any custom face specs on the face, -causing the face to reflect exactly what the @code{defface} says. +@kbd{C-M-x} (@code{eval-defun}) or with @kbd{C-x C-e} +(@code{eval-last-sexp}) in Emacs Lisp mode, a special feature of these +commands overrides any custom face specs on the face, causing the face +to reflect exactly what the @code{defface} says. The @var{spec} argument is a @dfn{face spec}, which states how the face should appear on different kinds of terminals. It should be an diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 095ea9dce2..b9ff074738 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -481,10 +481,12 @@ form occurs in a @code{let} form with lexical binding enabled), then effect until its binding construct exits. @xref{Variable Scoping}. @cindex @code{eval-defun}, and @code{defvar} forms -When you evaluate a top-level @code{defvar} form with @kbd{C-M-x} in -Emacs Lisp mode (@code{eval-defun}), a special feature of -@code{eval-defun} arranges to set the variable unconditionally, without -testing whether its value is void. +@cindex @code{eval-last-sexp}, and @code{defvar} forms +When you evaluate a top-level @code{defvar} form with @kbd{C-M-x} +(@code{eval-defun}) or with @kbd{C-x C-e} (@code{eval-last-sexp}) in +Emacs Lisp mode, a special feature of these two commands arranges to +set the variable unconditionally, without testing whether its value is +void. If the @var{doc-string} argument is supplied, it specifies the documentation string for the variable (stored in the symbol's commit 4a423ffb3b1ff2a1be6d98ad022f9743bba967f7 Author: Lars Ingebrigtsen Date: Wed Dec 9 16:07:50 2020 +0100 Fix info mode fontification of built-in (*note Built-ins::) * lisp/info.el (Info-fontify-node): Don't interpret things like "built-in" as being the word "in" (bug#34661). diff --git a/lisp/info.el b/lisp/info.el index c3684deb96..203f5db96d 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -4790,10 +4790,10 @@ first line or header line, and for breadcrumb links.") ;; an end of sentence (skip-syntax-backward " (")) (setq other-tag - (cond ((save-match-data (looking-back "\\ Date: Tue Dec 8 21:22:34 2020 +0100 Fix crash (segfault) in etags on generating tags for Erlang files * lib-src/etags.c: Set allocated and lastlen to zero, after freeing last ptr in Erlang_functions to prevent dereferencing NULL pointer (bug#45122). Copyright-paperwork-exempt: yes (cherry picked from commit 2d8f0364fcd1d5dad2b82dd3a9af870b03854547) diff --git a/lib-src/etags.c b/lib-src/etags.c index f761a7b7c3..502f90920d 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -6062,6 +6062,7 @@ Erlang_functions (FILE *inf) { free (last); last = NULL; + allocated = lastlen = 0; } } else commit beebd2a85eeab5b977ca2de8ad32784f9d8bdd51 Author: Mattias Engdegård Date: Wed Dec 9 13:27:16 2020 +0100 Recognise ß properly as a lower-case letter (bug#11309) ß was incorrectly treated as a caseless character and thus not matched by the regexp [[:lower:]] (or, in case-folding mode, [[:upper:]]). The reason is that the upcase table maps it to itself, which can be remedied by mapping it to ẞ (U+7838) instead. Doing so does not affect upcasing since the special-uppercase property maps it to SS. * lisp/international/characters.el (tbl): Map ß to ẞ in the upcase table. * test/src/regex-emacs-tests.el (regexp-eszett): Uncomment previously failing tests. Add checks to make sure that case transformations remain valid. diff --git a/lisp/international/characters.el b/lisp/international/characters.el index 0b6920cf18..5f610ddf67 100644 --- a/lisp/international/characters.el +++ b/lisp/international/characters.el @@ -759,7 +759,14 @@ with L, LRE, or LRO Unicode bidi character type.") (funcall map-unicode-property 'uppercase (lambda (lc uc) (aset up lc uc) (aset up uc uc))) (funcall map-unicode-property 'lowercase - (lambda (uc lc) (aset down uc lc) (aset down lc lc)))))) + (lambda (uc lc) (aset down uc lc) (aset down lc lc))) + + ;; Override the Unicode uppercase property for ß, since we are + ;; using our case tables for determining the case of a + ;; character (see uppercasep and lowercasep in buffer.h). + ;; The special-uppercase property of ß ensures that it is + ;; still upcased to SS per the usual convention. + (aset up ?ß ?ẞ)))) ;; Clear out the extra slots so that they will be recomputed from the main ;; (downcase) table and upcase table. Since we’re side-stepping the usual diff --git a/test/src/regex-emacs-tests.el b/test/src/regex-emacs-tests.el index 576630aa5a..34d4067db4 100644 --- a/test/src/regex-emacs-tests.el +++ b/test/src/regex-emacs-tests.el @@ -834,6 +834,13 @@ This evaluates the TESTS test cases from glibc." (ert-deftest regexp-eszett () "Test matching of ß and ẞ." + ;; Sanity checks. + (should (equal (upcase "ß") "SS")) + (should (equal (downcase "ß") "ß")) + (should (equal (capitalize "ß") "Ss")) ; undeutsch... + (should (equal (upcase "ẞ") "ẞ")) + (should (equal (downcase "ẞ") "ß")) + (should (equal (capitalize "ẞ") "ẞ")) ;; ß is a lower-case letter (Ll); ẞ is an upper-case letter (Lu). (let ((case-fold-search nil)) (should (equal (string-match "ß" "ß") 0)) @@ -842,8 +849,8 @@ This evaluates the TESTS test cases from glibc." (should (equal (string-match "ẞ" "ẞ") 0)) (should (equal (string-match "[[:alpha:]]" "ß") 0)) ;; bug#11309 - ;;(should (equal (string-match "[[:lower:]]" "ß") 0)) - ;;(should (equal (string-match "[[:upper:]]" "ß") nil)) + (should (equal (string-match "[[:lower:]]" "ß") 0)) + (should (equal (string-match "[[:upper:]]" "ß") nil)) (should (equal (string-match "[[:alpha:]]" "ẞ") 0)) (should (equal (string-match "[[:lower:]]" "ẞ") nil)) (should (equal (string-match "[[:upper:]]" "ẞ") 0))) @@ -854,8 +861,8 @@ This evaluates the TESTS test cases from glibc." (should (equal (string-match "ẞ" "ẞ") 0)) (should (equal (string-match "[[:alpha:]]" "ß") 0)) ;; bug#11309 - ;;(should (equal (string-match "[[:lower:]]" "ß") 0)) - ;;(should (equal (string-match "[[:upper:]]" "ß") 0)) + (should (equal (string-match "[[:lower:]]" "ß") 0)) + (should (equal (string-match "[[:upper:]]" "ß") 0)) (should (equal (string-match "[[:alpha:]]" "ẞ") 0)) (should (equal (string-match "[[:lower:]]" "ẞ") 0)) (should (equal (string-match "[[:upper:]]" "ẞ") 0)))) commit 445ab5cce95aee4cd5fee8ef67c2ee24c1c8850a Author: Lars Ingebrigtsen Date: Wed Dec 9 14:52:49 2020 +0100 cl-pushnew manual clarification * doc/misc/cl.texi (Modify Macros): Don't claim that cl-pushnew uses eql. (Lists as Sets): Mention that eql is the default comparison function. diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 084edd11b2..742be28fe3 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -1097,10 +1097,9 @@ by @var{x} if specified. @defmac cl-pushnew x place @t{&key :test :test-not :key} This macro inserts @var{x} at the front of the list stored in -@var{place}, but only if @var{x} was not @code{eql} to any -existing element of the list. The optional keyword arguments -are interpreted in the same way as for @code{cl-adjoin}. -@xref{Lists as Sets}. +@var{place}, but only if @var{x} isn't present in the list already. +The optional keyword arguments are interpreted in the same way as for +@code{cl-adjoin}. @xref{Lists as Sets}. @end defmac @defmac cl-shiftf place@dots{} newvalue @@ -3796,8 +3795,10 @@ This is a destructive version of @code{cl-sublis}. @section Lists as Sets @noindent -These functions perform operations on lists that represent sets -of elements. +These functions perform operations on lists that represent sets of +elements. All these functions (unless otherwise specified) default to +using @code{eql} as the test function, but that can be modified by the +@code{:test} parameter. @defun cl-member item list @t{&key :test :test-not :key} This function searches @var{list} for an element matching @var{item}. commit c47e6aa1f48fc4417588cef55d96b4e9c1b3fead Author: Lars Ingebrigtsen Date: Wed Dec 9 14:51:48 2020 +0100 cl-defmethod doc string clarification * lisp/emacs-lisp/cl-generic.el (cl-defmethod): Clarify the doc string, and give an example (bug#42322). diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el index 02da07daaf..b37b05b9a3 100644 --- a/lisp/emacs-lisp/cl-generic.el +++ b/lisp/emacs-lisp/cl-generic.el @@ -410,8 +410,18 @@ the specializer used will be the one returned by BODY." ;;;###autoload (defmacro cl-defmethod (name args &rest body) "Define a new method for generic function NAME. -I.e. it defines the implementation of NAME to use for invocations where the -values of the dispatch arguments match the specified TYPEs. +This it defines an implementation of NAME to use for invocations +of specific types of arguments. + +ARGS is a list of dispatch arguments (see `cl-defun'), but where +each variable element is either just a single variable name VAR, +or a list on the form (VAR TYPE). + +For instance: + + (cl-defmethod foo (bar (format-string string) &optional zot) + (format format-string bar)) + The dispatch arguments have to be among the mandatory arguments, and 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 commit b8dbb2bb7317da4c21b62e33329e21ec65af3755 Author: Lars Ingebrigtsen Date: Wed Dec 9 14:18:28 2020 +0100 Clarify the default-boundp doc string * src/data.c (Fdefault_boundp): Doc string clarification (bug#44141). diff --git a/src/data.c b/src/data.c index 384c259220..76bacf7e13 100644 --- a/src/data.c +++ b/src/data.c @@ -1639,8 +1639,9 @@ default_value (Lisp_Object symbol) DEFUN ("default-boundp", Fdefault_boundp, Sdefault_boundp, 1, 1, 0, doc: /* Return t if SYMBOL has a non-void default value. -This is the value that is seen in buffers that do not have their own values -for this variable. */) +A variable may have a buffer-local or a `let'-bound local value. This +function says whether the variable has a non-void value outside of the +current context. Also see `default-value'. */) (Lisp_Object symbol) { register Lisp_Object value; commit c9c8d98446f7cd4c9e0eb7394c7f9039965932c7 Author: Lars Ingebrigtsen Date: Wed Dec 9 13:50:06 2020 +0100 Make ediff offer to create files it's inferring * lisp/vc/ediff-ptch.el (ediff-fixup-patch-map): Offer to create the inferred file name (if it doesn't exist) (bug#8009). This allows applying a patch that creates a file. diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el index 08640fcece..580d48880b 100644 --- a/lisp/vc/ediff-ptch.el +++ b/lisp/vc/ediff-ptch.el @@ -465,6 +465,9 @@ are two possible targets for this %spatch. However, these files do not exist." file1 file2 (if multi-patch-p "multi-" "")))) (princ " \nPlease enter an alternative patch target ...\n")) + (when (and (string= file1 file2) + (y-or-n-p (format "Create %s?" file1))) + (write-region (point-min) (point-min) file1)) (let ((directory t) target) (while directory commit 2782d1e1a1d8945f0efe54091035f1a967f63f44 Author: Michael Albinus Date: Wed Dec 9 14:49:58 2020 +0100 Improve tests for gio file notifications * .gitlab-ci.yml (test-filenotify-gio): Call "make -k". * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch): Set connection property "gio-file-monitor". * lisp/net/tramp-sh.el (tramp-get-remote-gio-file-monitor): New defun. (tramp-sh-handle-file-notify-add-watch): Use it. * test/lisp/filenotify-tests.el (file-notify--test-read-event): Simplify. (file-notify--test-monitor): Handle also remote "gio monitor". (file-notify-test03-events, file-notify-test04-autorevert) (file-notify-test05-file-validity, file-notify-test08-backup) (file-notify-test09-watched-file-in-watched-dir): Handle GKqueueFileMonitor. diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f4e08d59dd..bab2573c88 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -91,7 +91,7 @@ test-filenotify-gio: - ./autogen.sh autoconf - ./configure --without-makeinfo --with-file-notification=gfile - make bootstrap - - make -C test autorevert-tests filenotify-tests + - make -k -C test autorevert-tests filenotify-tests test-gnustep: stage: test diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index c2028c4908..1722c53be0 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1434,6 +1434,9 @@ If FILE-SYSTEM is non-nil, return file system attributes." (unless (process-live-p p) (tramp-error p 'file-notify-error "Monitoring not supported for `%s'" file-name)) + ;; Set "gio-file-monitor" property. We believe, that "gio + ;; monitor" uses polling when applied for mounted files. + (tramp-set-connection-property p "gio-file-monitor" 'GPollFileMonitor) p)))) (defun tramp-gvfs-monitor-process-filter (proc string) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 79a7feae46..98537a100f 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3834,6 +3834,10 @@ Fall back to normal file name handler if no Tramp handler exists." (unless (process-live-p p) (tramp-error p 'file-notify-error "Monitoring not supported for `%s'" file-name)) + ;; Set "gio-file-monitor" property if needed. + (when (string-equal (file-name-nondirectory command) "gio") + (tramp-set-connection-property + p "gio-file-monitor" (tramp-get-remote-gio-file-monitor v))) p)))) (defun tramp-sh-gio-monitor-process-filter (proc string) @@ -5753,6 +5757,30 @@ This command is returned only if `delete-by-moving-to-trash' is non-nil." (tramp-message vec 5 "Finding a suitable `gio-monitor' command") (tramp-find-executable vec "gio" (tramp-get-remote-path vec) t t))) +(defun tramp-get-remote-gio-file-monitor (vec) + "Determine remote GFileMonitor." + (with-tramp-connection-property vec "gio-file-monitor" + (with-current-buffer (tramp-get-connection-buffer vec) + (tramp-message vec 5 "Finding the used GFileMonitor") + (when-let ((gio (tramp-get-remote-gio-monitor vec))) + ;; Search for the used FileMonitor. There is no known way to + ;; get this information directly from gio, so we check for + ;; linked libraries of libgio. + (when (tramp-send-command-and-check vec (concat "ldd " gio)) + (goto-char (point-min)) + (when (re-search-forward "\\S-+/libgio\\S-+") + (when (tramp-send-command-and-check + vec (concat "strings " (match-string 0))) + (goto-char (point-min)) + (re-search-forward + (format + "^%s$" + (regexp-opt + '("GFamFileMonitor" "GFenFileMonitor" + "GInotifyFileMonitor" "GKqueueFileMonitor"))) + nil 'noerror) + (intern (match-string 0))))))))) + (defun tramp-get-remote-gvfs-monitor-dir (vec) "Determine remote `gvfs-monitor-dir' command." (with-tramp-connection-property vec "gvfs-monitor-dir" diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index 268c3185bc..25017dd326 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -108,11 +108,8 @@ There are different timeouts for local and remote file notification libraries." ;; gio/gpollfilemonitor.c declares POLL_TIME_SECS 5. So we must ;; wait at least this time in the GPollFileMonitor case. A ;; similar timeout seems to be needed in the GFamFileMonitor case, - ;; at least on Cygwin. - ((and (string-equal (file-notify--test-library) "gfilenotify") - (memq (file-notify--test-monitor) - '(GFamFileMonitor GPollFileMonitor))) - 7) + ;; at least on cygwin. + ((memq (file-notify--test-monitor) '(GFamFileMonitor GPollFileMonitor)) 7) ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe") 1) ((file-remote-p temporary-file-directory) 0.1) (t 0.01)))) @@ -264,13 +261,19 @@ This returns only for the local case and gfilenotify; otherwise it is nil. ;; We cache the result, because after `file-notify-rm-watch', ;; `gfile-monitor-name' does not return a proper result anymore. ;; But we still need this information. - (unless (file-remote-p temporary-file-directory) - (or (cdr (assq file-notify--test-desc file-notify--test-monitors)) - (when (functionp 'gfile-monitor-name) - (add-to-list 'file-notify--test-monitors - (cons file-notify--test-desc - (gfile-monitor-name file-notify--test-desc))) - (cdr (assq file-notify--test-desc file-notify--test-monitors)))))) + ;; So far, we know the monitors GFamFileMonitor, GFenFileMonitor, + ;; GInotifyFileMonitor, GKqueueFileMonitor and GPollFileMonitor. + (or (cdr (assq file-notify--test-desc file-notify--test-monitors)) + (progn + (add-to-list + 'file-notify--test-monitors + (cons file-notify--test-desc + (if (file-remote-p temporary-file-directory) + (tramp-get-connection-property + file-notify--test-desc "gio-file-monitor" nil) + (and (functionp 'gfile-monitor-name) + (gfile-monitor-name file-notify--test-desc))))) + (cdr (assq file-notify--test-desc file-notify--test-monitors))))) (defmacro file-notify--deftest-remote (test docstring &optional unstable) "Define ert `TEST-remote' for remote files. @@ -457,7 +460,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'." (unwind-protect ;; Check, that removing watch descriptors out of order do not - ;; harm. This fails on Cygwin because of timing issues unless a + ;; harm. This fails on cygwin because of timing issues unless a ;; long `sit-for' is added before the call to ;; `file-notify--test-read-event'. (unless (eq system-type 'cygwin) @@ -631,13 +634,15 @@ delivered." (cond ;; gvfs-monitor-dir on cygwin does not detect the ;; `created' event reliably. - ((string-equal - (file-notify--test-library) "gvfs-monitor-dir.exe") + ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe") '((deleted stopped) (created deleted stopped))) ;; cygwin does not raise a `changed' event. ((eq system-type 'cygwin) '(created deleted stopped)) + ;; GKqueueFileMonitor does not report the `changed' event. + ((equal (file-notify--test-monitor) 'GKqueueFileMonitor) + '(created deleted stopped)) (t '(created changed deleted stopped))) (write-region "another text" nil file-notify--test-tmpfile nil 'no-message) @@ -668,6 +673,9 @@ delivered." ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe") '((deleted stopped) (changed deleted stopped))) + ;; GKqueueFileMonitor does not report the `changed' event. + ((equal (file-notify--test-monitor) 'GKqueueFileMonitor) + '(deleted stopped)) ;; There could be one or two `changed' events. (t '((changed deleted stopped) (changed changed deleted stopped)))) @@ -718,6 +726,9 @@ delivered." '(created deleted stopped)) ((string-equal (file-notify--test-library) "kqueue") '(created changed deleted stopped)) + ;; GKqueueFileMonitor does not report the `changed' event. + ((equal (file-notify--test-monitor) 'GKqueueFileMonitor) + '(created deleted deleted stopped)) (t '(created changed deleted deleted stopped))) (write-region "any text" nil file-notify--test-tmpfile nil 'no-message) @@ -767,6 +778,9 @@ delivered." ;; directory are not detected. ((getenv "EMACS_EMBA_CI") '(created changed created changed deleted deleted)) + ;; GKqueueFileMonitor does not report the `changed' event. + ((equal (file-notify--test-monitor) 'GKqueueFileMonitor) + '(created created deleted deleted deleted stopped)) (t '(created changed created changed deleted deleted deleted stopped))) (write-region @@ -823,6 +837,9 @@ delivered." '(created created deleted deleted stopped)) ((string-equal (file-notify--test-library) "kqueue") '(created changed renamed deleted stopped)) + ;; GKqueueFileMonitor does not report the `changed' event. + ((equal (file-notify--test-monitor) 'GKqueueFileMonitor) + '(created renamed deleted deleted stopped)) (t '(created changed renamed deleted deleted stopped))) (write-region "any text" nil file-notify--test-tmpfile nil 'no-message) @@ -859,6 +876,8 @@ delivered." ((string-equal (file-notify--test-library) "w32notify") '((changed changed) (changed changed changed changed))) + ;; GKqueueFileMonitor does not report the `attribute-changed' event. + ((equal (file-notify--test-monitor) 'GKqueueFileMonitor) nil) ;; For kqueue and in the remote case, `write-region' ;; raises also an `attribute-changed' event. ((or (string-equal (file-notify--test-library) "kqueue") @@ -925,6 +944,10 @@ delivered." ;; timeouts. (setq file-notify--test-desc auto-revert-notify-watch-descriptor) + ;; GKqueueFileMonitor does not report the `changed' event. + (skip-unless + (not (equal (file-notify--test-monitor) 'GKqueueFileMonitor))) + ;; Check, that file notification has been used. (should auto-revert-mode) (should auto-revert-use-notify) @@ -956,7 +979,7 @@ delivered." ;; Modify file. We wait for two seconds, in order to ;; have another timestamp. One second seems to be too - ;; short. And Cygwin sporadically requires more than two. + ;; short. And cygwin sporadically requires more than two. (ert-with-message-capture captured-messages (let ((inhibit-message t)) (sleep-for (if (eq system-type 'cygwin) 3 2)) @@ -1028,6 +1051,9 @@ delivered." ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe") '((deleted stopped) (changed deleted stopped))) + ;; GKqueueFileMonitor does not report the `changed' event. + ((equal (file-notify--test-monitor) 'GKqueueFileMonitor) + '(deleted stopped)) ;; There could be one or two `changed' events. (t '((changed deleted stopped) (changed changed deleted stopped)))) @@ -1077,6 +1103,9 @@ delivered." '(created deleted stopped)) ((string-equal (file-notify--test-library) "kqueue") '(created changed deleted stopped)) + ;; GKqueueFileMonitor does not report the `changed' event. + ((equal (file-notify--test-monitor) 'GKqueueFileMonitor) + '(created deleted deleted stopped)) (t '(created changed deleted deleted stopped))) (write-region "any text" nil file-notify--test-tmpfile nil 'no-message) @@ -1254,9 +1283,12 @@ delivered." '(change) #'file-notify--test-event-handler))) (should (file-notify-valid-p file-notify--test-desc)) (file-notify--test-with-actions - ;; There could be one or two `changed' events. - '((changed) - (changed changed)) + (cond + ;; GKqueueFileMonitor does not report the `changed' event. + ((equal (file-notify--test-monitor) 'GKqueueFileMonitor) nil) + ;; There could be one or two `changed' events. + (t '((changed) + (changed changed)))) ;; There shouldn't be any problem, because the file is kept. (with-temp-buffer (let ((buffer-file-name file-notify--test-tmpfile) @@ -1294,6 +1326,9 @@ delivered." ;; On cygwin we only get the `changed' event. ((eq system-type 'cygwin) '(changed)) + ;; GKqueueFileMonitor does not report the `changed' event. + ((equal (file-notify--test-monitor) 'GKqueueFileMonitor) + '(renamed created)) (t '(renamed created changed))) ;; The file is renamed when creating a backup. It shall ;; still be watched. @@ -1391,7 +1426,12 @@ the file watch." (make-list (/ n 2) 'changed) ;; Just the directory monitor. (make-list (/ n 2) 'created) - (make-list (/ n 2) 'changed))) + (make-list (/ n 2) 'changed)) + (append + '(:random) + ;; Just the directory monitor. GKqueueFileMonitor + ;; does not report the `changed' event. + (make-list (/ n 2) 'created))) (dotimes (i n) (file-notify--test-read-event) (if (zerop (mod i 2)) commit 45630ca6c839719dfc92583de5e606abba4b5718 Author: Lars Ingebrigtsen Date: Wed Dec 9 13:17:06 2020 +0100 Filter revoked keys when saving files * lisp/epa-file.el (epa-file-write-region): Use it to select a non-revoked key (bug#22359). * lisp/epg.el (epg--filter-revoked-keys): New function. diff --git a/lisp/epa-file.el b/lisp/epa-file.el index 7fd4178474..21dc1ebaff 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -309,7 +309,8 @@ encryption is used." If no one is selected, symmetric encryption will be performed. " recipients) (if epa-file-encrypt-to - (epg-list-keys context recipients))))) + (epg--filter-revoked-keys + (epg-list-keys context recipients)))))) (error (epa-display-error context) (if (setq entry (assoc file epa-file-passphrase-alist)) diff --git a/lisp/epg.el b/lisp/epg.el index 920b85398f..b27e2c638c 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -1382,6 +1382,13 @@ NAME is either a string or a list of strings." (setq pointer (cdr pointer))) keys)) +(defun epg--filter-revoked-keys (keys) + (seq-remove (lambda (key) + (seq-find (lambda (user) + (eq (epg-user-id-validity user) 'revoked)) + (epg-key-user-id-list key))) + keys)) + (defun epg--args-from-sig-notations (notations) (apply #'nconc (mapcar commit c50c0a19e3c5478050dba547752105a8e16f3a49 Author: Stefan Kangas Date: Wed Dec 9 09:44:38 2020 +0100 Prefer setq-local in most files * lisp/apropos.el (apropos-print): * lisp/buff-menu.el (Buffer-menu-mode): * lisp/calc/calc.el (calc-trail-buffer): * lisp/chistory.el (command-history-mode): * lisp/dabbrev.el: * lisp/dframe.el (dframe-frame-mode): * lisp/doc-view.el (doc-view-presentation-mode): * lisp/ebuff-menu.el (electric-buffer-menu-mode) (electric-buffer-update-highlight): * lisp/edmacro.el (edit-kbd-macro): * lisp/face-remap.el (buffer-face-set, buffer-face-toggle): * lisp/files.el: (find-file-noselect-1, hack-local-variables-confirm) (set-visited-file-name, revert-buffer--default): * lisp/filesets.el (filesets-spawn-external-viewer): * lisp/find-dired.el (find-dired): * lisp/find-lisp.el (find-lisp-find-dired-internal): * lisp/finder.el (finder-mode): * lisp/font-core.el (font-lock-default-function): * lisp/format.el (format-annotate-function): * lisp/help-fns.el (describe-variable): * lisp/help-mode.el (help-mode): * lisp/icomplete.el (icomplete-minibuffer-setup) (icomplete--in-region-setup): * lisp/ido.el (ido-completion-help, ido-tidy): * lisp/international/robin.el (robin-activate): * lisp/leim/quail/hangul.el (hangul-input-method-activate): * lisp/leim/quail/uni-input.el (ucs-input-activate): * lisp/man.el (Man-mode): * lisp/master.el (master-set-slave): * lisp/minibuffer.el (minibuffer-completion-help) (read-file-name-default): * lisp/outline.el (outline-minor-mode): * lisp/pcomplete.el (pcomplete-comint-setup): * lisp/proced.el (proced-mode): * lisp/recentf.el (recentf-edit-list, recentf-open-files-items): * lisp/replace.el (occur-1): * lisp/reveal.el (reveal-mode): * lisp/ruler-mode.el (ruler--save-header-line-format): * lisp/scroll-lock.el (scroll-lock-mode): * lisp/startup.el (normal-top-level, normal-splash-screen): * lisp/strokes.el (strokes-list-strokes): * lisp/thumbs.el (thumbs-insert-image, thumbs-show-thumbs-list): * lisp/tree-widget.el (tree-widget-set-theme): * lisp/window.el (read-buffer-to-switch): * lisp/xwidget.el (xwidget-webkit-begin-edit-textarea): Prefer setq-local. diff --git a/lisp/apropos.el b/lisp/apropos.el index 595db1d2f8..97314cc489 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -1225,8 +1225,8 @@ as a heading." (apropos-print-doc 6 'apropos-face t) (apropos-print-doc 5 'apropos-widget t) (apropos-print-doc 4 'apropos-plist nil)) - (set (make-local-variable 'truncate-partial-width-windows) t) - (set (make-local-variable 'truncate-lines) t)))) + (setq-local truncate-partial-width-windows t) + (setq-local truncate-lines t)))) (prog1 apropos-accumulator (setq apropos-accumulator ()))) ; permit gc diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index d06ba28787..5392519d71 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el @@ -269,8 +269,8 @@ In Buffer Menu mode, the following commands are defined: \\[revert-buffer] Update the list of buffers. \\[Buffer-menu-toggle-files-only] Toggle whether the menu displays only file buffers. \\[Buffer-menu-bury] Bury the buffer listed on this line." - (set (make-local-variable 'buffer-stale-function) - (lambda (&optional _noconfirm) 'fast)) + (setq-local buffer-stale-function + (lambda (&optional _noconfirm) 'fast)) (add-hook 'tabulated-list-revert-hook 'list-buffers--refresh nil t)) (defun buffer-menu (&optional arg) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 9d869f359b..bb02281111 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -2100,7 +2100,7 @@ the United States." (set-buffer calc-trail-buffer) (unless (derived-mode-p 'calc-trail-mode) (calc-trail-mode) - (set (make-local-variable 'calc-main-buffer) buf))))) + (setq-local calc-main-buffer buf))))) (or (and calc-trail-pointer (eq (marker-buffer calc-trail-pointer) calc-trail-buffer)) (with-current-buffer calc-trail-buffer diff --git a/lisp/chistory.el b/lisp/chistory.el index c9aa927b94..98443bfa88 100644 --- a/lisp/chistory.el +++ b/lisp/chistory.el @@ -140,7 +140,7 @@ The buffer is left in Command History mode." Keybindings: \\{command-history-mode-map}" (lisp-mode-variables nil) - (set (make-local-variable 'revert-buffer-function) 'command-history-revert) + (setq-local revert-buffer-function 'command-history-revert) (set-syntax-table emacs-lisp-mode-syntax-table)) (defcustom command-history-hook nil diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el index a9df031421..c8bb749eb3 100644 --- a/lisp/dabbrev.el +++ b/lisp/dabbrev.el @@ -45,7 +45,7 @@ ;; dabbrev-case-replace nil t ;; ;; Set the variables you want special for your mode like this: -;; (set (make-local-variable 'dabbrev-case-replace) nil) +;; (setq-local dabbrev-case-replace nil) ;; Then you don't interfere with other modes. ;; ;; If your mode handles buffers that refers to other buffers @@ -59,10 +59,10 @@ ;; Example for GNUS (when we write a reply, we want dabbrev to look in ;; the article for expansion): -;; (set (make-local-variable 'dabbrev-friend-buffer-function) -;; (lambda (buffer) -;; (with-current-buffer buffer -;; (memq major-mode '(news-reply-mode gnus-article-mode))))) +;; (setq-local dabbrev-friend-buffer-function +;; (lambda (buffer) +;; (with-current-buffer buffer +;; (memq major-mode '(news-reply-mode gnus-article-mode))))) ;; Known bugs and limitations. diff --git a/lisp/dframe.el b/lisp/dframe.el index 417477be27..31e571410b 100644 --- a/lisp/dframe.el +++ b/lisp/dframe.el @@ -280,7 +280,7 @@ CREATE-HOOK is a hook to run after creating a frame." ;; Enable mouse tracking in emacs (if dframe-track-mouse-function - (set (make-local-variable 'track-mouse) t)) ;this could be messy. + (setq-local track-mouse t)) ;this could be messy. ;; Override `temp-buffer-show-hook' so that help and such ;; put their stuff into a frame other than our own. @@ -290,10 +290,8 @@ CREATE-HOOK is a hook to run after creating a frame." ;; FIXME: Doesn't this get us into an inf-loop when the ;; `temp-buffer-show-function' runs `temp-buffer-show-hook' ;; (as is normally the case)? - (progn (make-local-variable 'temp-buffer-show-hook) - (setq temp-buffer-show-hook temp-buffer-show-function))) - (make-local-variable 'temp-buffer-show-function) - (setq temp-buffer-show-function 'dframe-temp-buffer-show-function) + (setq-local temp-buffer-show-hook temp-buffer-show-function)) + (setq-local temp-buffer-show-function 'dframe-temp-buffer-show-function) ;; If this buffer is killed, we must make sure that we destroy ;; the frame the dedicated window is in. (add-hook 'kill-buffer-hook (lambda () diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 9997c1ae7b..f7a7be96b3 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -2055,7 +2055,7 @@ See the command `doc-view-mode' for more information on this mode." :init-value nil :keymap doc-view-presentation-mode-map (if doc-view-presentation-mode (progn - (set (make-local-variable 'mode-line-format) nil) + (setq-local mode-line-format nil) (doc-view-fit-page-to-window) ;; (doc-view-convert-all-pages) ) diff --git a/lisp/ebuff-menu.el b/lisp/ebuff-menu.el index 079fce88de..cf7b28a1e8 100644 --- a/lisp/ebuff-menu.el +++ b/lisp/ebuff-menu.el @@ -202,8 +202,7 @@ Electric Buffer Menu mode is a minor mode which is automatically enabled and disabled by the \\[electric-buffer-list] command. See the documentation of `electric-buffer-list' for details." (setq mode-line-buffer-identification "Electric Buffer List") - (set (make-local-variable 'Helper-return-blurb) - "return to buffer editing")) + (setq-local Helper-return-blurb "return to buffer editing")) (define-obsolete-function-alias 'Electric-buffer-menu-mode 'electric-buffer-menu-mode "24.3") @@ -270,8 +269,8 @@ Return to Electric Buffer Menu when done." (when (derived-mode-p 'electric-buffer-menu-mode) ;; Make sure we have an overlay to use. (or electric-buffer-overlay - (set (make-local-variable 'electric-buffer-overlay) - (make-overlay (point) (point)))) + (setq-local electric-buffer-overlay + (make-overlay (point) (point)))) (move-overlay electric-buffer-overlay (line-beginning-position) (line-end-position)) diff --git a/lisp/edmacro.el b/lisp/edmacro.el index 44cf5aad38..8ff766cee9 100644 --- a/lisp/edmacro.el +++ b/lisp/edmacro.el @@ -151,9 +151,9 @@ With a prefix argument, format the macro in a more concise way." (setq buffer-read-only nil) (setq major-mode 'edmacro-mode) (setq mode-name "Edit Macro") - (set (make-local-variable 'edmacro-original-buffer) oldbuf) - (set (make-local-variable 'edmacro-finish-hook) finish-hook) - (set (make-local-variable 'edmacro-store-hook) store-hook) + (setq-local edmacro-original-buffer oldbuf) + (setq-local edmacro-finish-hook finish-hook) + (setq-local edmacro-store-hook store-hook) (erase-buffer) (insert ";; Keyboard Macro Editor. Press C-c C-c to finish; " "press C-x k RET to cancel.\n") diff --git a/lisp/face-remap.el b/lisp/face-remap.el index 4ccd463aff..13bbb5284a 100644 --- a/lisp/face-remap.el +++ b/lisp/face-remap.el @@ -446,7 +446,7 @@ local, and sets it to FACE." (setq specs (car specs))) (if (null specs) (buffer-face-mode 0) - (set (make-local-variable 'buffer-face-mode-face) specs) + (setq-local buffer-face-mode-face specs) (buffer-face-mode t))) ;;;###autoload @@ -470,7 +470,7 @@ buffer local, and set it to SPECS." (if (or (null specs) (and buffer-face-mode (equal buffer-face-mode-face specs))) (buffer-face-mode 0) - (set (make-local-variable 'buffer-face-mode-face) specs) + (setq-local buffer-face-mode-face specs) (buffer-face-mode t))) (defun buffer-face-mode-invoke (specs arg &optional interactive) diff --git a/lisp/files.el b/lisp/files.el index 2cf77d5d7e..a89d39e784 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -597,7 +597,7 @@ settings being applied, but still respect file-local ones.") ;; This is an odd variable IMO. ;; You might wonder why it is needed, when we could just do: -;; (set (make-local-variable 'enable-local-variables) nil) +;; (setq-local enable-local-variables nil) ;; These two are not precisely the same. ;; Setting this variable does not cause -*- mode settings to be ;; ignored, whereas setting enable-local-variables does. @@ -2419,9 +2419,7 @@ Do you want to revisit the file normally now? "))) ;; this is a permanent local, the major mode won't eliminate it. (and backup-enable-predicate (not (funcall backup-enable-predicate buffer-file-name)) - (progn - (make-local-variable 'backup-inhibited) - (setq backup-inhibited t))) + (setq-local backup-inhibited t)) (if rawfile (progn (set-buffer-multibyte nil) @@ -3520,7 +3518,7 @@ n -- to ignore the local variables list.") (let ((print-escape-newlines t)) (prin1 (cdr elt) buf)) (insert "\n")) - (set (make-local-variable 'cursor-type) nil) + (setq-local cursor-type nil) (set-buffer-modified-p nil) (goto-char (point-min))) @@ -4492,9 +4490,7 @@ the old visited file has been renamed to the new name FILENAME." (and buffer-file-name backup-enable-predicate (not (funcall backup-enable-predicate buffer-file-name)) - (progn - (make-local-variable 'backup-inhibited) - (setq backup-inhibited t))) + (setq-local backup-inhibited t)) (let ((oauto buffer-auto-save-file-name)) (cond ((null filename) (setq buffer-auto-save-file-name nil)) @@ -6219,7 +6215,7 @@ Non-file buffers need a custom function." ;; Run after-revert-hook as it was before we reverted. (setq-default revert-buffer-internal-hook global-hook) (if local-hook - (set (make-local-variable 'revert-buffer-internal-hook) + (setq-local revert-buffer-internal-hook local-hook) (kill-local-variable 'revert-buffer-internal-hook)) (run-hooks 'revert-buffer-internal-hook)) diff --git a/lisp/filesets.el b/lisp/filesets.el index 883871c4d8..62dc5a54d5 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -1336,8 +1336,7 @@ Use the viewer defined in EV-ENTRY (a valid element of (progn (switch-to-buffer (format "Filesets: %s %s" vwr file)) (insert output) - (make-local-variable 'filesets-output-buffer-flag) - (setq filesets-output-buffer-flag t) + (setq-local filesets-output-buffer-flag t) (set-visited-file-name file t) (when oh (run-hooks 'oh)) diff --git a/lisp/find-dired.el b/lisp/find-dired.el index 18330d821c..d2b82bdd51 100644 --- a/lisp/find-dired.el +++ b/lisp/find-dired.el @@ -223,11 +223,10 @@ it finishes, type \\[kill-find]." (set-keymap-parent map (current-local-map)) (define-key map "\C-c\C-k" 'kill-find) (use-local-map map)) - (make-local-variable 'dired-sort-inhibit) - (setq dired-sort-inhibit t) - (set (make-local-variable 'revert-buffer-function) - `(lambda (ignore-auto noconfirm) - (find-dired ,dir ,find-args))) + (setq-local dired-sort-inhibit t) + (setq-local revert-buffer-function + `(lambda (ignore-auto noconfirm) + (find-dired ,dir ,find-args))) ;; Set subdir-alist so that Tree Dired will work: (if (fboundp 'dired-simple-subdir-alist) ;; will work even with nested dired format (dired-nstd.el,v 1.15 @@ -235,9 +234,9 @@ it finishes, type \\[kill-find]." (dired-simple-subdir-alist) ;; else we have an ancient tree dired (or classic dired, where ;; this does no harm) - (set (make-local-variable 'dired-subdir-alist) - (list (cons default-directory (point-min-marker))))) - (set (make-local-variable 'dired-subdir-switches) find-ls-subdir-switches) + (setq-local dired-subdir-alist + (list (cons default-directory (point-min-marker))))) + (setq-local dired-subdir-switches find-ls-subdir-switches) (setq buffer-read-only nil) ;; Subdir headlerline must come first because the first marker in ;; subdir-alist points there. diff --git a/lisp/find-lisp.el b/lisp/find-lisp.el index c1be5ff403..44a2e6d737 100644 --- a/lisp/find-lisp.el +++ b/lisp/find-lisp.el @@ -212,21 +212,17 @@ It is a function which takes two arguments, the directory and its parent." (use-local-map (append (make-sparse-keymap) (current-local-map))) - (make-local-variable 'find-lisp-file-predicate) - (setq find-lisp-file-predicate file-predicate) - (make-local-variable 'find-lisp-directory-predicate) - (setq find-lisp-directory-predicate directory-predicate) - (make-local-variable 'find-lisp-regexp) - (setq find-lisp-regexp regexp) - - (make-local-variable 'revert-buffer-function) - (setq revert-buffer-function - (lambda (_ignore1 _ignore2) - (find-lisp-insert-directory - default-directory - find-lisp-file-predicate - find-lisp-directory-predicate - 'ignore))) + (setq-local find-lisp-file-predicate file-predicate) + (setq-local find-lisp-directory-predicate directory-predicate) + (setq-local find-lisp-regexp regexp) + + (setq-local revert-buffer-function + (lambda (_ignore1 _ignore2) + (find-lisp-insert-directory + default-directory + find-lisp-file-predicate + find-lisp-directory-predicate + 'ignore))) ;; Set subdir-alist so that Tree Dired will work: (if (fboundp 'dired-simple-subdir-alist) @@ -235,8 +231,8 @@ It is a function which takes two arguments, the directory and its parent." (dired-simple-subdir-alist) ;; else we have an ancient tree dired (or classic dired, where ;; this does no harm) - (set (make-local-variable 'dired-subdir-alist) - (list (cons default-directory (point-min-marker))))) + (setq-local dired-subdir-alist + (list (cons default-directory (point-min-marker))))) (find-lisp-insert-directory dir file-predicate directory-predicate 'ignore) (goto-char (point-min)) diff --git a/lisp/finder.el b/lisp/finder.el index a59a185cc9..98859f6a39 100644 --- a/lisp/finder.el +++ b/lisp/finder.el @@ -448,7 +448,7 @@ FILE should be in a form suitable for passing to `locate-library'." :syntax-table finder-mode-syntax-table (setq buffer-read-only t buffer-undo-list t) - (set (make-local-variable 'finder-headmark) nil)) + (setq-local finder-headmark nil)) (defun finder-summary () "Summarize basic Finder commands." diff --git a/lisp/font-core.el b/lisp/font-core.el index 098253eb16..1b15d8cd30 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el @@ -160,8 +160,8 @@ this function onto `change-major-mode-hook'." (defun font-lock-default-function (mode) ;; Turn on Font Lock mode. (when mode - (set (make-local-variable 'char-property-alias-alist) - (copy-tree char-property-alias-alist)) + (setq-local char-property-alias-alist + (copy-tree char-property-alias-alist)) ;; Add `font-lock-face' as an alias for the `face' property. (let ((elt (assq 'face char-property-alias-alist))) (if elt @@ -171,8 +171,8 @@ this function onto `change-major-mode-hook'." ;; Turn off Font Lock mode. (unless mode ;; Remove `font-lock-face' as an alias for the `face' property. - (set (make-local-variable 'char-property-alias-alist) - (copy-tree char-property-alias-alist)) + (setq-local char-property-alias-alist + (copy-tree char-property-alias-alist)) (let ((elt (assq 'face char-property-alias-alist))) (when elt (setcdr elt (remq 'font-lock-face (cdr elt))) diff --git a/lisp/format.el b/lisp/format.el index 905ca2d9ec..16456eb587 100644 --- a/lisp/format.el +++ b/lisp/format.el @@ -237,9 +237,8 @@ For most purposes, consider using `format-encode-region' instead." ;; delete the buffer once the write is done, but do ;; it after running to-fn so it doesn't affect ;; write-region calls in to-fn. - (set (make-local-variable - 'write-region-post-annotation-function) - 'kill-buffer))) + (setq-local write-region-post-annotation-function + #'kill-buffer))) nil) ;; Otherwise just call function, it will return annotations. (funcall to-fn from to orig-buf))))) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 1c55d0ed79..043c79f390 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1137,8 +1137,7 @@ it is displayed along with the global value." (when (looking-at "value is") (replace-match "")) (save-excursion (insert "\n\nValue:") - (set (make-local-variable 'help-button-cache) - (point-marker))) + (setq-local help-button-cache (point-marker))) (insert "value is shown ") (insert-button "below" 'action help-button-cache diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 732e6cc28d..025a67016b 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -319,10 +319,10 @@ The format is (FUNCTION ARGS...).") Entry to this mode runs the normal hook `help-mode-hook'. Commands: \\{help-mode-map}" - (set (make-local-variable 'revert-buffer-function) - 'help-mode-revert-buffer) - (set (make-local-variable 'bookmark-make-record-function) - 'help-bookmark-make-record)) + (setq-local revert-buffer-function + #'help-mode-revert-buffer) + (setq-local bookmark-make-record-function + #'help-bookmark-make-record)) ;;;###autoload (defun help-mode-setup () diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 676917b9da..0fdacd0a3c 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -441,7 +441,7 @@ Conditions are: "Run in minibuffer on activation to establish incremental completion. Usually run by inclusion in `minibuffer-setup-hook'." (when (and icomplete-mode (icomplete-simple-completing-p)) - (set (make-local-variable 'completion-show-inline-help) nil) + (setq-local completion-show-inline-help nil) (use-local-map (make-composed-keymap icomplete-minibuffer-map (current-local-map))) (add-hook 'pre-command-hook #'icomplete-pre-command-hook nil t) @@ -464,7 +464,7 @@ Usually run by inclusion in `minibuffer-setup-hook'." (when (and completion-in-region-mode icomplete-mode (icomplete-simple-completing-p)) (setq icomplete--in-region-buffer (current-buffer)) - (set (make-local-variable 'completion-show-inline-help) nil) + (setq-local completion-show-inline-help nil) (let ((tem (assq 'completion-in-region-mode minor-mode-overriding-map-alist))) (unless (memq icomplete-minibuffer-map (cdr tem)) diff --git a/lisp/ido.el b/lisp/ido.el index c83b700e65..5758d3fdea 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -3966,7 +3966,7 @@ If `ido-change-word-sub' cannot be found in WORD, return nil." (boundp 'ido-completion-buffer-full)) (set-window-start win (point-min)) (with-no-warnings - (set (make-local-variable 'ido-completion-buffer-full) t)) + (setq-local ido-completion-buffer-full t)) (setq full-list t display-it t)) (scroll-other-window)) @@ -4810,8 +4810,7 @@ Modified from `icomplete-completions'." (delete-region ido-eoinput (point-max)))) ;; Reestablish the local variable 'cause minibuffer-setup is weird: - (make-local-variable 'ido-eoinput) - (setq ido-eoinput 1)))) + (setq-local ido-eoinput 1)))) (defun ido-summary-buffers-to-end () ;; Move the summaries to the end of the buffer list. diff --git a/lisp/international/robin.el b/lisp/international/robin.el index 94d2bf1808..16cac07c77 100644 --- a/lisp/international/robin.el +++ b/lisp/international/robin.el @@ -424,8 +424,7 @@ While this input method is active, the variable (add-hook 'minibuffer-exit-hook 'robin-exit-from-minibuffer)) (run-hooks 'input-method-activate-hook 'robin-activate-hook) - (set (make-local-variable 'input-method-function) - 'robin-input-method))) + (setq-local input-method-function 'robin-input-method))) (define-obsolete-variable-alias 'robin-inactivate-hook diff --git a/lisp/leim/quail/hangul.el b/lisp/leim/quail/hangul.el index b8562556ef..16f8de9cfb 100644 --- a/lisp/leim/quail/hangul.el +++ b/lisp/leim/quail/hangul.el @@ -525,7 +525,7 @@ HELP-TEXT is a text set in `hangul-input-method-help-text'." (quail-delete-overlays) (if (eq (selected-window) (minibuffer-window)) (add-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer)) - (set (make-local-variable 'input-method-function) func)) + (setq-local input-method-function func)) (defun hangul-input-method-deactivate () "Deactivate the current Hangul input method." diff --git a/lisp/leim/quail/uni-input.el b/lisp/leim/quail/uni-input.el index 6f1fbcc9e5..bee73d8e74 100644 --- a/lisp/leim/quail/uni-input.el +++ b/lisp/leim/quail/uni-input.el @@ -105,8 +105,7 @@ While this input method is active, the variable (quail-delete-overlays) (if (eq (selected-window) (minibuffer-window)) (add-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer)) - (set (make-local-variable 'input-method-function) - 'ucs-input-method))) + (setq-local input-method-function 'ucs-input-method))) (defun ucs-input-deactivate () "Deactivate UCS input method." diff --git a/lisp/man.el b/lisp/man.el index 991b1bb60e..8430201c56 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1583,10 +1583,10 @@ The following key bindings are currently in effect in the buffer: (auto-fill-mode -1) (setq imenu-generic-expression (list (list nil Man-heading-regexp 0))) (imenu-add-to-menubar man-imenu-title) - (set (make-local-variable 'outline-regexp) Man-heading-regexp) - (set (make-local-variable 'outline-level) (lambda () 1)) - (set (make-local-variable 'bookmark-make-record-function) - 'Man-bookmark-make-record) + (setq-local outline-regexp Man-heading-regexp) + (setq-local outline-level (lambda () 1)) + (setq-local bookmark-make-record-function + #'Man-bookmark-make-record) (add-hook 'window-state-change-functions #'Man--window-state-change nil t)) (defun Man-build-section-list () diff --git a/lisp/master.el b/lisp/master.el index 32556a535f..88baa1f821 100644 --- a/lisp/master.el +++ b/lisp/master.el @@ -96,8 +96,7 @@ yourself the value of `master-of' by calling `master-show-slave'." "Makes BUFFER the slave of the current buffer. Use \\[master-mode] to toggle control of the slave buffer." (interactive "bSlave: ") - (make-local-variable 'master-of) - (setq master-of buffer) + (setq-local master-of buffer) (run-hooks 'master-set-slave-hook)) (defun master-show-slave () diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index d44d896822..456193d52e 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2067,14 +2067,14 @@ variables.") (funcall aff-fun completions))) (with-current-buffer standard-output - (set (make-local-variable 'completion-base-position) + (setq-local completion-base-position (list (+ start base-size) ;; FIXME: We should pay attention to completion ;; boundaries here, but currently ;; completion-all-completions does not give us the ;; necessary information. end)) - (set (make-local-variable 'completion-list-insert-choice-function) + (setq-local completion-list-insert-choice-function (let ((ctable minibuffer-completion-table) (cpred minibuffer-completion-predicate) (cprops completion-extra-properties)) @@ -2866,7 +2866,7 @@ See `read-file-name' for the meaning of the arguments." ;; On the first request on `M-n' fill ;; `minibuffer-default' with a list of defaults ;; relevant for file-name reading. - (set (make-local-variable 'minibuffer-default-add-function) + (setq-local minibuffer-default-add-function (lambda () (with-current-buffer (window-buffer (minibuffer-selected-window)) diff --git a/lisp/outline.el b/lisp/outline.el index 9b11b86b9d..85f9de4e1b 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -318,7 +318,7 @@ See the command `outline-mode' for more information on this mode." (add-hook 'change-major-mode-hook (lambda () (outline-minor-mode -1)) nil t) - (set (make-local-variable 'line-move-ignore-invisible) t) + (setq-local line-move-ignore-invisible t) ;; Cause use of ellipses for invisible text. (add-to-invisibility-spec '(outline . t))) (setq line-move-ignore-invisible nil) diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index a744165e0d..a24df93a82 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -738,12 +738,12 @@ user actually typed in." COMPLETEF-SYM should be the symbol where the dynamic-complete-functions are kept. For comint mode itself, this is `comint-dynamic-complete-functions'." - (set (make-local-variable 'pcomplete-parse-arguments-function) - #'pcomplete-parse-comint-arguments) + (setq-local pcomplete-parse-arguments-function + #'pcomplete-parse-comint-arguments) (add-hook 'completion-at-point-functions #'pcomplete-completions-at-point nil 'local) - (set (make-local-variable completef-sym) - (copy-sequence (symbol-value completef-sym))) + (setq-local ompletef-sym + (copy-sequence (symbol-value completef-sym))) (let* ((funs (symbol-value completef-sym)) (elem (or (memq 'comint-filename-completion funs) (memq 'shell-filename-completion funs) diff --git a/lisp/proced.el b/lisp/proced.el index 203d70331c..5d4318d81f 100644 --- a/lisp/proced.el +++ b/lisp/proced.el @@ -664,9 +664,9 @@ After displaying or updating a Proced buffer, Proced runs the normal hook truncate-lines t header-line-format '(:eval (proced-header-line))) (add-hook 'post-command-hook #'force-mode-line-update nil t) ;; FIXME: Why? - (set (make-local-variable 'revert-buffer-function) #'proced-revert) - (set (make-local-variable 'font-lock-defaults) - '(proced-font-lock-keywords t nil nil beginning-of-line)) + (setq-local revert-buffer-function #'proced-revert) + (setq-local font-lock-defaults + '(proced-font-lock-keywords t nil nil beginning-of-line)) (if (and (not proced-auto-update-timer) proced-auto-update-interval) (setq proced-auto-update-timer (run-at-time t proced-auto-update-interval diff --git a/lisp/recentf.el b/lisp/recentf.el index 61c39de12b..746363728b 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -1127,7 +1127,7 @@ IGNORE arguments." (unless recentf-list (error "The list of recent files is empty")) (recentf-dialog (format "*%s - Edit list*" recentf-menu-title) - (set (make-local-variable 'recentf-edit-list) nil) + (setq-local recentf-edit-list nil) (widget-insert (format-message "Click on OK to delete selected files from the recent list. @@ -1196,8 +1196,8 @@ IGNORE other arguments." (defun recentf-open-files-items (files) "Return a list of widgets to display FILES in a dialog buffer." - (set (make-local-variable 'recentf--files-with-key) - (recentf-trunc-list files 10)) + (setq-local recentf--files-with-key + (recentf-trunc-list files 10)) (mapcar 'recentf-open-files-item (append ;; When requested group the files with shortcuts together diff --git a/lisp/replace.el b/lisp/replace.el index 3a2ab1d24c..5ebc549301 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1706,7 +1706,7 @@ See also `multi-occur'." (buffer-undo-list t) (occur--final-pos nil)) (erase-buffer) - (set (make-local-variable 'occur-highlight-regexp) regexp) + (setq-local occur-highlight-regexp regexp) (let ((count (if (stringp nlines) ;; Treat nlines as a regexp to collect. diff --git a/lisp/reveal.el b/lisp/reveal.el index f9e3864634..b4558e1beb 100644 --- a/lisp/reveal.el +++ b/lisp/reveal.el @@ -233,7 +233,7 @@ Also see the `reveal-auto-hide' variable." :keymap reveal-mode-map (if reveal-mode (progn - (set (make-local-variable 'search-invisible) t) + (setq-local search-invisible t) (add-hook 'post-command-hook 'reveal-post-command nil t)) (kill-local-variable 'search-invisible) (remove-hook 'post-command-hook 'reveal-post-command t))) diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el index 82e6178da1..d97abca9ee 100644 --- a/lisp/ruler-mode.el +++ b/lisp/ruler-mode.el @@ -584,8 +584,8 @@ format first." (when (and (not ruler-mode) (local-variable-p 'header-line-format) (not (local-variable-p 'ruler-mode-header-line-format-old))) - (set (make-local-variable 'ruler-mode-header-line-format-old) - header-line-format)) + (setq-local ruler-mode-header-line-format-old + header-line-format)) (setq header-line-format ruler-mode-header-line-format)) ;;;###autoload diff --git a/lisp/scroll-lock.el b/lisp/scroll-lock.el index f20ea1bcc8..31808be437 100644 --- a/lisp/scroll-lock.el +++ b/lisp/scroll-lock.el @@ -64,7 +64,7 @@ MS-Windows systems if `w32-scroll-lock-modifier' is non-nil." (progn (setq scroll-lock-preserve-screen-pos-save scroll-preserve-screen-position) - (set (make-local-variable 'scroll-preserve-screen-position) 'always)) + (setq-local scroll-preserve-screen-position 'always)) (setq scroll-preserve-screen-position scroll-lock-preserve-screen-pos-save))) diff --git a/lisp/startup.el b/lisp/startup.el index 9f67dfde12..b652977798 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -633,7 +633,7 @@ It is the default value of the variable `top-level'." (with-current-buffer "*Messages*" (messages-buffer-mode) ;; Make it easy to do like "tail -f". - (set (make-local-variable 'window-point-insertion-type) t) + (setq-local window-point-insertion-type t) ;; Give *Messages* the same default-directory as *scratch*, ;; just to keep things predictable. (setq default-directory (or dir (expand-file-name "~/"))))) @@ -1999,7 +1999,7 @@ splash screen in another window." (setq buffer-read-only nil) (erase-buffer) (setq default-directory command-line-default-directory) - (set (make-local-variable 'tab-width) 8) + (setq-local tab-width 8) (if pure-space-overflow (insert pure-space-overflow-message)) diff --git a/lisp/strokes.el b/lisp/strokes.el index 11bc07a29c..044872068f 100644 --- a/lisp/strokes.el +++ b/lisp/strokes.el @@ -1231,8 +1231,8 @@ the stroke as a character in some language." ;; mode-popup-menu edit-strokes-menu) ; what about extent-specific stuff? ;; (and (featurep 'menubar) ;; current-menubar -;; (set (make-local-variable 'current-menubar) -;; (copy-sequence current-menubar)) +;; (setq-local current-menubar +;; (copy-sequence current-menubar)) ;; (add-submenu nil edit-strokes-menu))) ;;(let ((map edit-strokes-mode-map)) @@ -1363,13 +1363,13 @@ If STROKES-MAP is not given, `strokes-global-map' will be used instead." finally do (unless (eobp) (kill-region (1+ (point)) (point-max)))) (view-buffer "*Strokes List*" nil) - (set (make-local-variable 'view-mode-map) - (let ((map (copy-keymap view-mode-map))) - (define-key map "q" `(lambda () - (interactive) - (View-quit) - (set-window-configuration ,config))) - map)) + (setq-local view-mode-map + (let ((map (copy-keymap view-mode-map))) + (define-key map "q" `(lambda () + (interactive) + (View-quit) + (set-window-configuration ,config))) + map)) (goto-char (point-min)))) (defun strokes-alphabetic-lessp (stroke1 stroke2) diff --git a/lisp/thumbs.el b/lisp/thumbs.el index 3aa7ff0836..93b7c08d62 100644 --- a/lisp/thumbs.el +++ b/lisp/thumbs.el @@ -347,8 +347,7 @@ If MARKED is non-nil, the image is marked." :conversion ,(if marked 'disabled) :margin ,thumbs-margin))) (insert-image i) - (set (make-local-variable 'thumbs-current-image-size) - (image-size i t)))) + (setq-local thumbs-current-image-size (image-size i t)))) (defun thumbs-insert-thumb (img &optional marked) "Insert the thumbnail for IMG at point. @@ -387,7 +386,7 @@ If MARKED is non-nil, the image is marked." (if dir (setq default-directory dir)) (thumbs-do-thumbs-insertion list) (goto-char (point-min)) - (set (make-local-variable 'thumbs-current-dir) default-directory))) + (setq-local thumbs-current-dir default-directory))) ;;;###autoload (defun thumbs-show-from-dir (dir &optional reg same-window) diff --git a/lisp/tree-widget.el b/lisp/tree-widget.el index 45d3f28ea0..e8a71a38df 100644 --- a/lisp/tree-widget.el +++ b/lisp/tree-widget.el @@ -260,10 +260,9 @@ Typically it should contain something like this: \\='(:ascent center :mask (heuristic t)))" (or name (setq name (or tree-widget-theme "default"))) (unless (string-equal name (tree-widget-theme-name)) - (set (make-local-variable 'tree-widget--theme) - (make-vector 4 nil)) - (tree-widget-set-parent-theme name) - (tree-widget-set-parent-theme "default"))) + (setq-local tree-widget--theme (make-vector 4 nil)) + (tree-widget-set-parent-theme name) + (tree-widget-set-parent-theme "default"))) (defun tree-widget--locate-sub-directory (name path) "Locate all occurrences of the sub-directory NAME in PATH. diff --git a/lisp/window.el b/lisp/window.el index daa5c67df8..67c3992c3f 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8390,9 +8390,9 @@ from the list of completions and default values." ;; here manually. (if (and (boundp 'icomplete-with-completion-tables) (listp icomplete-with-completion-tables)) - (set (make-local-variable 'icomplete-with-completion-tables) - (cons rbts-completion-table - icomplete-with-completion-tables)))) + (setq-local icomplete-with-completion-tables + (cons rbts-completion-table + icomplete-with-completion-tables)))) (read-buffer prompt (other-buffer (current-buffer)) (confirm-nonexistent-file-or-buffer))))) diff --git a/lisp/xwidget.el b/lisp/xwidget.el index caf57ae43f..9d502d772b 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -451,7 +451,7 @@ function findactiveelement(doc){ XW is the xwidget identifier, TEXT is retrieved from the webkit." (switch-to-buffer (generate-new-buffer "textarea")) - (set (make-local-variable 'xwidget-xwbl) xw) + (setq-local xwidget-xwbl xw) (insert text)) (defun xwidget-webkit-end-edit-textarea () commit 4489531b1ed87111f0848c81c93a7e2c6bcc1323 Author: Stefan Kangas Date: Wed Dec 9 09:18:04 2020 +0100 Prefer setq-local in dired extensions * lisp/dired-aux.el (dired-diff, dired-compare-directories) (dired-do-create-files, dired-isearch-filenames): * lisp/dired-x.el (dired-virtual, dired-vm): * lisp/wdired.el (wdired-change-to-wdired-mode) (wdired-change-to-dired-mode, wdired-preprocess-perms): diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 26155190d4..0f68b47073 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -259,7 +259,7 @@ the string of command switches used as the third argument of `diff'." (list (minibuffer-with-setup-hook (lambda () - (set (make-local-variable 'minibuffer-default-add-function) nil) + (setq-local minibuffer-default-add-function nil) (setq minibuffer-default defaults)) (read-file-name (format-prompt "Diff %s with" default current) target-dir default t)) @@ -334,7 +334,7 @@ only in the active region if `dired-mark-region' is non-nil." (defaults (dired-dwim-target-defaults nil target-dir))) (minibuffer-with-setup-hook (lambda () - (set (make-local-variable 'minibuffer-default-add-function) nil) + (setq-local minibuffer-default-add-function nil) (setq minibuffer-default defaults)) (read-directory-name (format "Compare %s with: " (dired-current-directory)) @@ -2049,7 +2049,7 @@ Optional arg HOW-TO determines how to treat the target. (target (expand-file-name ; fluid variable inside dired-create-files (minibuffer-with-setup-hook (lambda () - (set (make-local-variable 'minibuffer-default-add-function) nil) + (setq-local minibuffer-default-add-function nil) (setq minibuffer-default defaults)) (dired-mark-read-file-name (format "%s %%s %s: " @@ -3013,14 +3013,14 @@ is part of a file name (i.e., has the text property `dired-filename')." (defun dired-isearch-filenames () "Search for a string using Isearch only in file names in the Dired buffer." (interactive) - (set (make-local-variable 'dired-isearch-filenames) t) + (setq-local dired-isearch-filenames t) (isearch-forward nil t)) ;;;###autoload (defun dired-isearch-filenames-regexp () "Search for a regexp using Isearch only in file names in the Dired buffer." (interactive) - (set (make-local-variable 'dired-isearch-filenames) t) + (setq-local dired-isearch-filenames t) (isearch-forward-regexp nil t)) diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 55077e7188..75e4f46624 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -636,7 +636,7 @@ you can relist single subdirs using \\[dired-do-redisplay]." (dired-mode dirname (or switches dired-listing-switches)) (setq mode-name "Virtual Dired" revert-buffer-function 'dired-virtual-revert) - (set (make-local-variable 'dired-subdir-alist) nil) + (setq-local dired-subdir-alist nil) (dired-build-subdir-alist) (goto-char (point-min)) (dired-initial-position dirname)) @@ -1226,7 +1226,7 @@ Otherwise obeys the value of `dired-vm-read-only-folders'." (and dired-vm-read-only-folders (not (file-writable-p fil))))) ;; So that pressing `v' inside VM does prompt within current directory: - (set (make-local-variable 'vm-folder-directory) dir))) + (setq-local vm-folder-directory dir))) (defun dired-rmail () "Run RMAIL on this file." diff --git a/lisp/wdired.el b/lisp/wdired.el index ebe1961394..b7dd4ee949 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -242,12 +242,12 @@ See `wdired-mode'." (interactive) (unless (derived-mode-p 'dired-mode) (error "Not a Dired buffer")) - (set (make-local-variable 'wdired-old-content) - (buffer-substring (point-min) (point-max))) - (set (make-local-variable 'wdired-old-marks) - (dired-remember-marks (point-min) (point-max))) - (set (make-local-variable 'wdired-old-point) (point)) - (set (make-local-variable 'query-replace-skip-read-only) t) + (setq-local wdired-old-content + (buffer-substring (point-min) (point-max))) + (setq-local wdired-old-marks + (dired-remember-marks (point-min) (point-max))) + (setq-local wdired-old-point (point)) + (setq-local query-replace-skip-read-only t) (add-function :after-while (local 'isearch-filter-predicate) #'wdired-isearch-filter-read-only) (use-local-map wdired-mode-map) @@ -390,7 +390,7 @@ non-nil means return old filename." (dired-advertise) (remove-hook 'kill-buffer-hook 'wdired-check-kill-buffer t) (remove-hook 'after-change-functions 'wdired--restore-properties t) - (set (make-local-variable 'revert-buffer-function) 'dired-revert)) + (setq-local revert-buffer-function 'dired-revert)) (defun wdired-abort-changes () @@ -834,7 +834,7 @@ Like original function but it skips read-only words." ;; original name and permissions as a property (defun wdired-preprocess-perms () (let ((inhibit-read-only t)) - (set (make-local-variable 'wdired-col-perm) nil) + (setq-local wdired-col-perm nil) (save-excursion (goto-char (point-min)) (while (not (eobp)) commit c0b3e38d7ce92a09e84b5bd570e92fdf2074618a Author: Stefan Kangas Date: Wed Dec 9 11:52:59 2020 +0100 Update publicsuffix.txt from upstream * etc/publicsuffix.txt: Update from https://publicsuffix.org/list/public_suffix_list.dat dated 2020-11-30 21:57:25 UTC. diff --git a/etc/publicsuffix.txt b/etc/publicsuffix.txt index bcde6728b5..1ede2b929a 100644 --- a/etc/publicsuffix.txt +++ b/etc/publicsuffix.txt @@ -1152,7 +1152,7 @@ gov.gr // gs : https://en.wikipedia.org/wiki/.gs gs -// gt : http://www.gt/politicas_de_registro.html +// gt : https://www.gt/sitio/registration_policy.php?lang=en gt com.gt edu.gt @@ -4703,6 +4703,7 @@ nl // Norid geographical second level domains : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-b/ // Norid category second level domains : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-c/ // Norid category second-level domains managed by parties other than Norid : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-d/ +// RSS feed: https://teknisk.norid.no/en/feed/ no // Norid category second level domains : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-c/ fhs.no @@ -7110,7 +7111,7 @@ org.zw // newGTLDs -// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2020-10-08T17:45:32Z +// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2020-11-30T20:26:10Z // This list is auto-generated, don't edit it manually. // aaa : 2015-02-26 American Automobile Association, Inc. aaa @@ -7328,7 +7329,7 @@ author // auto : 2014-11-13 XYZ.COM LLC auto -// autos : 2014-01-09 DERAutos, LLC +// autos : 2014-01-09 XYZ.COM LLC autos // avianca : 2015-01-08 Avianca Holdings S.A. @@ -7337,7 +7338,7 @@ avianca // aws : 2015-06-25 Amazon Registry Services, Inc. aws -// axa : 2013-12-19 AXA SA +// axa : 2013-12-19 AXA Group Operations SAS axa // azure : 2014-12-18 Microsoft Corporation @@ -7478,7 +7479,7 @@ bmw // bnpparibas : 2014-05-29 BNP Paribas bnpparibas -// boats : 2014-12-04 DERBoats, LLC +// boats : 2014-12-04 XYZ.COM LLC boats // boehringer : 2015-07-09 Boehringer Ingelheim International GmbH @@ -7517,7 +7518,7 @@ bot // boutique : 2013-11-14 Binky Moon, LLC boutique -// box : 2015-11-12 .BOX INC. +// box : 2015-11-12 Intercap Registry Inc. box // bradesco : 2014-12-18 Banco Bradesco S.A. @@ -8501,7 +8502,7 @@ homedepot // homegoods : 2015-07-16 The TJX Companies, Inc. homegoods -// homes : 2014-01-09 DERHomes, LLC +// homes : 2014-01-09 XYZ.COM LLC homes // homesense : 2015-07-16 The TJX Companies, Inc. @@ -8651,9 +8652,6 @@ java // jcb : 2014-11-20 JCB Co., Ltd. jcb -// jcp : 2015-04-23 JCP Media, Inc. -jcp - // jeep : 2015-07-30 FCA US LLC. jeep @@ -9077,7 +9075,7 @@ moscow // moto : 2015-06-04 Motorola Trademark Holdings, LLC moto -// motorcycles : 2014-01-09 DERMotorcycles, LLC +// motorcycles : 2014-01-09 XYZ.COM LLC motorcycles // mov : 2014-01-30 Charleston Road Registry Inc. @@ -9242,7 +9240,7 @@ one // ong : 2014-03-06 Public Interest Registry ong -// onl : 2013-09-16 I-Registry Ltd. +// onl : 2013-09-16 iRegistry GmbH onl // online : 2015-01-15 DotOnline Inc. @@ -9539,7 +9537,7 @@ reviews // rexroth : 2015-06-18 Robert Bosch GMBH rexroth -// rich : 2013-11-21 I-Registry Ltd. +// rich : 2013-11-21 iRegistry GmbH rich // richardli : 2015-05-14 Pacific Century Asset Management (HK) Limited @@ -9758,9 +9756,6 @@ show // showtime : 2015-08-06 CBS Domains Inc. showtime -// shriram : 2014-01-23 Shriram Capital Ltd. -shriram - // silk : 2015-06-25 Amazon Registry Services, Inc. silk @@ -10073,7 +10068,7 @@ travelers // travelersinsurance : 2015-03-26 Travelers TLD, LLC travelersinsurance -// trust : 2014-10-16 NCC Group Domain Services, Inc. +// trust : 2014-10-16 UNR Corp. trust // trv : 2015-03-26 Travelers TLD, LLC @@ -10595,7 +10590,7 @@ vermögensberatung // xyz : 2013-12-05 XYZ.COM LLC xyz -// yachts : 2014-01-09 DERYachts, LLC +// yachts : 2014-01-09 XYZ.COM LLC yachts // yahoo : 2015-04-02 Yahoo! Domain Services Inc. @@ -10680,12 +10675,6 @@ barsy.ca // Submitted by Werner Kaltofen kasserver.com -// Algorithmia, Inc. : algorithmia.com -// Submitted by Eli Perelman -*.algorithmia.com -!teams.algorithmia.com -!test.algorithmia.com - // Altervista: https://www.altervista.org // Submitted by Carlo Cannas altervista.org @@ -10868,6 +10857,10 @@ bnr.la // Submitted by Paul Crowder blackbaudcdn.net +// Blatech : http://www.blatech.net +// Submitted by Luke Bratch +of.je + // Boomla : https://boomla.com // Submitted by Tibor Halter boomla.net @@ -10981,10 +10974,6 @@ c.la // Submitted by B. Blechschmidt certmgr.org -// Citrix : https://citrix.com -// Submitted by Alex Stoddard -xenapponazure.com - // Civilized Discourse Construction Kit, Inc. : https://www.discourse.org/ // Submitted by Rishabh Nambiar & Michael Brown discourse.group @@ -11073,10 +11062,6 @@ cloudns.pro cloudns.pw cloudns.us -// Cloudeity Inc : https://cloudeity.com -// Submitted by Stefan Dimitrov -cloudeity.net - // CNPY : https://cnpy.gdn // Submitted by Angelo Gladding cnpy.gdn @@ -11537,6 +11522,10 @@ ddnss.org definima.net definima.io +// DigitalOcean : https://digitalocean.com/ +// Submitted by Braxton Huggins +ondigitalocean.app + // dnstrace.pro : https://dnstrace.pro/ // Submitted by Chris Partridge bci.dnstrace.pro @@ -11802,6 +11791,10 @@ ukco.me // submitted by Koen Van Isterdael mydobiss.com +// FH Muenster : https://www.fh-muenster.de +// Submitted by Robin Naundorf +fh-muenster.io + // Filegear Inc. : https://www.filegear.com // Submitted by Jason Zhu filegear.me @@ -11872,6 +11865,7 @@ usercontent.jp gentapps.com gentlentapis.com lab.ms +cdn-edges.net // GitHub, Inc. // Submitted by Patrick Toomey @@ -11931,9 +11925,10 @@ pagespeedmobilizer.com publishproxy.com withgoogle.com withyoutube.com -cloudfunctions.net +*.gateway.dev cloud.goog translate.goog +cloudfunctions.net blogspot.ae blogspot.al @@ -12056,6 +12051,10 @@ ravendb.me development.run ravendb.run +// Hong Kong Productivity Council: https://www.hkpc.org/ +// Submitted by SECaaS Team +secaas.hk + // HOSTBIP REGISTRY : https://www.hostbip.com/ // Submitted by Atanunu Igbunuroghene bpl.biz @@ -12165,7 +12164,7 @@ iserv.dev // Submitted by Yuji Minagawa iobb.net -//Jelastic, Inc. : https://jelastic.com/ +// Jelastic, Inc. : https://jelastic.com/ // Submited by Ihor Kolodyuk mel.cloudlets.com.au cloud.interhostsolutions.be @@ -12180,6 +12179,9 @@ jele.cloud it1.eur.aruba.jenv-aruba.cloud it1.jenv-aruba.cloud it1-eur.jenv-arubabiz.cloud +oxa.cloud +tn.oxa.cloud +uk.oxa.cloud primetel.cloud uk.primetel.cloud ca.reclaim.cloud @@ -12250,6 +12252,7 @@ jelastic.regruhosting.ru enscaled.sg jele.site jelastic.team +orangecloud.tn j.layershift.co.uk phx.enscaled.us mircloud.us @@ -12327,10 +12330,6 @@ co.technology // Submitted by Greg Holland app.lmpm.com -// Linki Tools UG : https://linki.tools -// Submitted by Paulo Matos -linkitools.space - // linkyard ldt: https://www.linkyard.ch/ // Submitted by Mario Siegenthaler linkyard.cloud @@ -12369,7 +12368,6 @@ swidnik.pl // Lug.org.uk : https://lug.org.uk // Submitted by Jon Spriggs -uklugs.org glug.org.uk lug.org.uk lugs.org.uk @@ -12446,11 +12444,17 @@ eu.meteorapp.com co.pl // Microsoft Corporation : http://microsoft.com -// Submitted by Mostafa Elzeiny +// Submitted by Mitch Webster *.azurecontainer.io azurewebsites.net azure-mobile.net cloudapp.net +azurestaticapps.net +centralus.azurestaticapps.net +eastasia.azurestaticapps.net +eastus2.azurestaticapps.net +westeurope.azurestaticapps.net +westus2.azurestaticapps.net // minion.systems : http://minion.systems // Submitted by Robert Böttinger @@ -12492,19 +12496,22 @@ cust.retrosnub.co.uk ui.nabu.casa // Names.of.London : https://names.of.london/ -// Submitted by James Stevens or +// Submitted by James Stevens or pony.club of.fashion -on.fashion -of.football in.london of.london +from.marketing +with.marketing for.men +repair.men and.mom for.mom for.one +under.one for.sale -of.work +that.win +from.work to.work // NCTU.ME : https://nctu.me/ @@ -12824,6 +12831,12 @@ mypep.link // Submitted by Kenneth Van Alstyne perspecta.cloud +// PE Ulyanov Kirill Sergeevich : https://airy.host +// Submitted by Kirill Ulyanov +lk3.ru +ra-ru.ru +zsew.ru + // Planet-Work : https://www.planet-work.com/ // Submitted by Frédéric VANNIÈRE on-web.fr @@ -12885,6 +12898,10 @@ byen.site // Submitted by Kor Nielsen pubtls.org +// QOTO, Org. +// Submitted by Jeffrey Phillips Freeman +qoto.io + // Qualifio : https://qualifio.com/ // Submitted by Xavier De Cock qualifioapp.com @@ -12970,7 +12987,6 @@ hzc.io // Revitalised Limited : http://www.revitalised.co.uk // Submitted by Jack Price wellbeingzone.eu -ptplus.fit wellbeingzone.co.uk // Rochester Institute of Technology : http://www.rit.edu/ @@ -13344,7 +13360,7 @@ wafflecell.com // Submitted by Fajar Sodik idnblogger.com indowapblog.com -bloghp.id +bloger.id wblog.id wbq.me fastblog.net commit be4d6b043fa79e2d9a9911ca1c48bdcc84e3bba9 Author: Mattias Engdegård Date: Tue Dec 8 12:47:58 2020 +0100 Fix [:upper:] and [:lower:] for Unicode characters (bug#11309) * src/regex-emacs.c (execute_charset): Add canon_table argument to allow expression of a correct predicate for [:upper:] and [:lower:]. (mutually_exclusive_p, re_match_2_internal): Pass extra argument. * test/src/regex-emacs-tests.el (regexp-case-fold, regexp-eszett): New tests. Parts of regexp-eszett still fail and are commented out. diff --git a/src/regex-emacs.c b/src/regex-emacs.c index 971a5f6374..904ca0c7b9 100644 --- a/src/regex-emacs.c +++ b/src/regex-emacs.c @@ -3575,9 +3575,11 @@ skip_noops (re_char *p, re_char *pend) opcode. When the function finishes, *PP will be advanced past that opcode. C is character to test (possibly after translations) and CORIG is original character (i.e. without any translations). UNIBYTE denotes whether c is - unibyte or multibyte character. */ + unibyte or multibyte character. + CANON_TABLE is the canonicalisation table for case folding or Qnil. */ static bool -execute_charset (re_char **pp, int c, int corig, bool unibyte) +execute_charset (re_char **pp, int c, int corig, bool unibyte, + Lisp_Object canon_table) { eassume (0 <= c && 0 <= corig); re_char *p = *pp, *rtp = NULL; @@ -3617,11 +3619,9 @@ execute_charset (re_char **pp, int c, int corig, bool unibyte) (class_bits & BIT_BLANK && ISBLANK (c)) || (class_bits & BIT_WORD && ISWORD (c)) || ((class_bits & BIT_UPPER) && - (ISUPPER (c) || (corig != c && - c == downcase (corig) && ISLOWER (c)))) || + (ISUPPER (corig) || (!NILP (canon_table) && ISLOWER (corig)))) || ((class_bits & BIT_LOWER) && - (ISLOWER (c) || (corig != c && - c == upcase (corig) && ISUPPER(c)))) || + (ISLOWER (corig) || (!NILP (canon_table) && ISUPPER (corig)))) || (class_bits & BIT_PUNCT && ISPUNCT (c)) || (class_bits & BIT_GRAPH && ISGRAPH (c)) || (class_bits & BIT_PRINT && ISPRINT (c))) @@ -3696,7 +3696,8 @@ mutually_exclusive_p (struct re_pattern_buffer *bufp, re_char *p1, else if ((re_opcode_t) *p1 == charset || (re_opcode_t) *p1 == charset_not) { - if (!execute_charset (&p1, c, c, !multibyte || ASCII_CHAR_P (c))) + if (!execute_charset (&p1, c, c, !multibyte || ASCII_CHAR_P (c), + Qnil)) { DEBUG_PRINT (" No match => fast loop.\n"); return true; @@ -4367,7 +4368,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, } p -= 1; - if (!execute_charset (&p, c, corig, unibyte_char)) + if (!execute_charset (&p, c, corig, unibyte_char, translate)) goto fail; d += len; diff --git a/test/src/regex-emacs-tests.el b/test/src/regex-emacs-tests.el index f9372e37b1..576630aa5a 100644 --- a/test/src/regex-emacs-tests.el +++ b/test/src/regex-emacs-tests.el @@ -803,4 +803,61 @@ This evaluates the TESTS test cases from glibc." (should-not (string-match "å" "\xe5")) (should-not (string-match "[å]" "\xe5"))) +(ert-deftest regexp-case-fold () + "Test case-sensitive and case-insensitive matching." + (let ((case-fold-search nil)) + (should (equal (string-match "aB" "ABaB") 2)) + (should (equal (string-match "åÄ" "ÅäåäÅÄåÄ") 6)) + (should (equal (string-match "λΛ" "lΛλλΛ") 3)) + (should (equal (string-match "шШ" "zШшшШ") 3)) + (should (equal (string-match "[[:alpha:]]+" ".3aBåÄßλΛшШ中﷽") 2)) + (should (equal (match-end 0) 12)) + (should (equal (string-match "[[:alnum:]]+" ".3aBåÄßλΛшШ中﷽") 1)) + (should (equal (match-end 0) 12)) + (should (equal (string-match "[[:upper:]]+" ".3aåλшBÄΛШ中﷽") 6)) + (should (equal (match-end 0) 10)) + (should (equal (string-match "[[:lower:]]+" ".3BÄΛШaåλш中﷽") 6)) + (should (equal (match-end 0) 10))) + (let ((case-fold-search t)) + (should (equal (string-match "aB" "ABaB") 0)) + (should (equal (string-match "åÄ" "ÅäåäÅÄåÄ") 0)) + (should (equal (string-match "λΛ" "lΛλλΛ") 1)) + (should (equal (string-match "шШ" "zШшшШ") 1)) + (should (equal (string-match "[[:alpha:]]+" ".3aBåÄßλΛшШ中﷽") 2)) + (should (equal (match-end 0) 12)) + (should (equal (string-match "[[:alnum:]]+" ".3aBåÄßλΛшШ中﷽") 1)) + (should (equal (match-end 0) 12)) + (should (equal (string-match "[[:upper:]]+" ".3aåλшBÄΛШ中﷽") 2)) + (should (equal (match-end 0) 10)) + (should (equal (string-match "[[:lower:]]+" ".3BÄΛШaåλш中﷽") 2)) + (should (equal (match-end 0) 10)))) + +(ert-deftest regexp-eszett () + "Test matching of ß and ẞ." + ;; ß is a lower-case letter (Ll); ẞ is an upper-case letter (Lu). + (let ((case-fold-search nil)) + (should (equal (string-match "ß" "ß") 0)) + (should (equal (string-match "ß" "ẞ") nil)) + (should (equal (string-match "ẞ" "ß") nil)) + (should (equal (string-match "ẞ" "ẞ") 0)) + (should (equal (string-match "[[:alpha:]]" "ß") 0)) + ;; bug#11309 + ;;(should (equal (string-match "[[:lower:]]" "ß") 0)) + ;;(should (equal (string-match "[[:upper:]]" "ß") nil)) + (should (equal (string-match "[[:alpha:]]" "ẞ") 0)) + (should (equal (string-match "[[:lower:]]" "ẞ") nil)) + (should (equal (string-match "[[:upper:]]" "ẞ") 0))) + (let ((case-fold-search t)) + (should (equal (string-match "ß" "ß") 0)) + (should (equal (string-match "ß" "ẞ") 0)) + (should (equal (string-match "ẞ" "ß") 0)) + (should (equal (string-match "ẞ" "ẞ") 0)) + (should (equal (string-match "[[:alpha:]]" "ß") 0)) + ;; bug#11309 + ;;(should (equal (string-match "[[:lower:]]" "ß") 0)) + ;;(should (equal (string-match "[[:upper:]]" "ß") 0)) + (should (equal (string-match "[[:alpha:]]" "ẞ") 0)) + (should (equal (string-match "[[:lower:]]" "ẞ") 0)) + (should (equal (string-match "[[:upper:]]" "ẞ") 0)))) + ;;; regex-emacs-tests.el ends here commit 22caab8bacf76ae439f8b647218b37334bfd87bd Author: Stefan Kangas Date: Wed Dec 9 08:34:35 2020 +0100 Prefer setq-local in some remaining progmodes * lisp/progmodes/dcl-mode.el (dcl-mode): * lisp/progmodes/hideif.el (hide-ifdef-mode) (hide-ifdef-toggle-shadowing): * lisp/progmodes/ps-mode.el (ps-mode, ps-run-mode): * lisp/progmodes/xscheme.el (xscheme-start) (local-set-scheme-interaction-buffer, scheme-interaction-mode): Prefer setq-local. diff --git a/lisp/progmodes/dcl-mode.el b/lisp/progmodes/dcl-mode.el index ca45795adc..9bafd7aa42 100644 --- a/lisp/progmodes/dcl-mode.el +++ b/lisp/progmodes/dcl-mode.el @@ -588,17 +588,17 @@ $ There is some minimal font-lock support (see vars `dcl-font-lock-defaults' and `dcl-font-lock-keywords')." - (set (make-local-variable 'indent-line-function) 'dcl-indent-line) - (set (make-local-variable 'comment-start) "!") - (set (make-local-variable 'comment-end) "") - (set (make-local-variable 'comment-multi-line) nil) + (setq-local indent-line-function 'dcl-indent-line) + (setq-local comment-start "!") + (setq-local comment-end "") + (setq-local comment-multi-line nil) ;; This used to be "^\\$[ \t]*![ \t]*" which looks more correct. ;; The drawback was that you couldn't make empty comment lines by pressing ;; C-M-j repeatedly - only the first line became a comment line. ;; This version has the drawback that the "$" can be anywhere in the line, ;; and something inappropriate might be interpreted as a comment. - (set (make-local-variable 'comment-start-skip) "\\$[ \t]*![ \t]*") + (setq-local comment-start-skip "\\$[ \t]*![ \t]*") (if (boundp 'imenu-generic-expression) (progn (setq imenu-generic-expression dcl-imenu-generic-expression) @@ -619,7 +619,7 @@ There is some minimal font-lock support (see vars (make-local-variable 'dcl-electric-reindent-regexps) ;; font lock - (set (make-local-variable 'font-lock-defaults) dcl-font-lock-defaults) + (setq-local font-lock-defaults dcl-font-lock-defaults) (tempo-use-tag-list 'dcl-tempo-tags)) diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index 25e75235aa..7cbc9708fc 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el @@ -302,17 +302,17 @@ Several variables affect how the hiding is done: ;; We can still simulate the behavior of older hideif versions (i.e. ;; `hide-ifdef-env' being buffer local) by clearing this variable ;; (C-c @ C) every time before hiding current buffer. -;; (set (make-local-variable 'hide-ifdef-env) +;; (setq-local hide-ifdef-env ;; (default-value 'hide-ifdef-env)) (set 'hide-ifdef-env (default-value 'hide-ifdef-env)) ;; Some C/C++ headers might have other ways to prevent reinclusion and ;; thus would like `hide-ifdef-expand-reinclusion-protection' to be nil. - (set (make-local-variable 'hide-ifdef-expand-reinclusion-protection) - (default-value 'hide-ifdef-expand-reinclusion-protection)) - (set (make-local-variable 'hide-ifdef-hiding) - (default-value 'hide-ifdef-hiding)) - (set (make-local-variable 'hif-outside-read-only) buffer-read-only) - (set (make-local-variable 'line-move-ignore-invisible) t) + (setq-local hide-ifdef-expand-reinclusion-protection + (default-value 'hide-ifdef-expand-reinclusion-protection)) + (setq-local hide-ifdef-hiding + (default-value 'hide-ifdef-hiding)) + (setq-local hif-outside-read-only buffer-read-only) + (setq-local line-move-ignore-invisible t) (add-hook 'change-major-mode-hook (lambda () (hide-ifdef-mode -1)) nil t) @@ -1792,7 +1792,7 @@ It does not do the work that's pointless to redo on a recursive entry." (defun hide-ifdef-toggle-shadowing () "Toggle shadowing." (interactive) - (set (make-local-variable 'hide-ifdef-shadow) (not hide-ifdef-shadow)) + (setq-local hide-ifdef-shadow (not hide-ifdef-shadow)) (message "Shadowing %s" (if hide-ifdef-shadow "ON" "OFF")) (save-restriction (widen) diff --git a/lisp/progmodes/ps-mode.el b/lisp/progmodes/ps-mode.el index 6db7a14a24..bcf7bfdefc 100644 --- a/lisp/progmodes/ps-mode.el +++ b/lisp/progmodes/ps-mode.el @@ -501,18 +501,18 @@ point to the corresponding spot in the PostScript window, if input to the interpreter was sent from that window. Typing \\\\[ps-run-goto-error] when the cursor is at the number has the same effect." (setq-local syntax-propertize-function #'ps-mode-syntax-propertize) - (set (make-local-variable 'font-lock-defaults) - '((ps-mode-font-lock-keywords - ps-mode-font-lock-keywords-1 - ps-mode-font-lock-keywords-2 - ps-mode-font-lock-keywords-3) - nil)) + (setq-local font-lock-defaults + '((ps-mode-font-lock-keywords + ps-mode-font-lock-keywords-1 + ps-mode-font-lock-keywords-2 + ps-mode-font-lock-keywords-3) + nil)) (smie-setup nil #'ps-mode-smie-rules) (setq-local electric-indent-chars (append '(?> ?\] ?\}) electric-indent-chars)) - (set (make-local-variable 'comment-start) "%") + (setq-local comment-start "%") ;; NOTE: `\' has a special meaning in strings only - (set (make-local-variable 'comment-start-skip) "%+[ \t]*") + (setq-local comment-start-skip "%+[ \t]*") ;; enable doc-view-minor-mode => C-c C-c starts viewing the current ps file ;; with doc-view-mode. (doc-view-minor-mode 1)) @@ -910,11 +910,11 @@ plus the usually uncoded characters inserted on positions 1 through 28." (define-derived-mode ps-run-mode comint-mode "Interactive PS" "Major mode in interactive PostScript window. This mode is invoked from `ps-mode' and should not be called directly." - (set (make-local-variable 'font-lock-defaults) - '((ps-run-font-lock-keywords - ps-run-font-lock-keywords-1 - ps-run-font-lock-keywords-2) - t)) + (setq-local font-lock-defaults + '((ps-run-font-lock-keywords + ps-run-font-lock-keywords-1 + ps-run-font-lock-keywords-2) + t)) (setq mode-line-process '(":%s"))) (defun ps-run-running () diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el index c6997862f7..cdbafbaf89 100644 --- a/lisp/progmodes/xscheme.el +++ b/lisp/progmodes/xscheme.el @@ -173,7 +173,7 @@ With argument, asks for a command line." (setq-default xscheme-process-command-line command-line) (switch-to-buffer (xscheme-start-process command-line process-name buffer-name)) - (set (make-local-variable 'xscheme-process-command-line) command-line)) + (setq-local xscheme-process-command-line command-line)) (defun xscheme-read-command-line (arg) (let ((default @@ -264,11 +264,11 @@ With argument, asks for a command line." xscheme-buffer-name t))) (let ((process-name (verify-xscheme-buffer buffer-name t))) - (set (make-local-variable 'xscheme-buffer-name) buffer-name) - (set (make-local-variable 'xscheme-process-name) process-name) - (set (make-local-variable 'xscheme-runlight) - (with-current-buffer buffer-name - xscheme-runlight)))) + (setq-local xscheme-buffer-name buffer-name) + (setq-local xscheme-process-name process-name) + (setq-local xscheme-runlight + (with-current-buffer buffer-name + xscheme-runlight)))) (defun local-clear-scheme-interaction-buffer () "Make the current buffer use the default scheme interaction buffer." @@ -375,10 +375,10 @@ Entry to this mode runs `scheme-mode-hook' and then (kill-all-local-variables) (make-local-variable 'xscheme-runlight-string) (make-local-variable 'xscheme-runlight) - (set (make-local-variable 'xscheme-previous-mode) previous-mode) + (setq-local xscheme-previous-mode previous-mode) (let ((buffer (current-buffer))) - (set (make-local-variable 'xscheme-buffer-name) (buffer-name buffer)) - (set (make-local-variable 'xscheme-last-input-end) (make-marker)) + (setq-local xscheme-buffer-name (buffer-name buffer)) + (setq-local xscheme-last-input-end (make-marker)) (let ((process (get-buffer-process buffer))) (when process (setq-local xscheme-process-name (process-name process)) commit dbc044e5f772cdb55433cb7757975defeadba44e Author: Stefan Kangas Date: Wed Dec 9 08:30:09 2020 +0100 Prefer setq-local in gdb-mi.el * lisp/progmodes/gdb-mi.el (gdb--check-interpreter, gdb) (gdb-init-buffer, gdb-get-buffer-create, gdb-threads-mode) (gdb-memory-mode, gdb-disassembly-mode, gdb-frames-mode): Prefer setq-local. diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 903005610d..4c248f771c 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -744,7 +744,7 @@ NOARG must be t when this macro is used outside `gud-def'." ;; Use the old gud-gbd filter, not because it works, but because it ;; will properly display GDB's answers rather than hanging waiting for ;; answers that aren't coming. - (set (make-local-variable 'gud-marker-filter) #'gud-gdb-marker-filter)) + (setq-local gud-marker-filter #'gud-gdb-marker-filter)) (funcall filter proc string))) (defvar gdb-control-level 0) @@ -831,8 +831,8 @@ detailed description of this mode. (let ((proc (get-buffer-process gud-comint-buffer))) (add-function :around (process-filter proc) #'gdb--check-interpreter)) - (set (make-local-variable 'gud-minor-mode) 'gdbmi) - (set (make-local-variable 'gdb-control-level) 0) + (setq-local gud-minor-mode 'gdbmi) + (setq-local gdb-control-level 0) (setq comint-input-sender 'gdb-send) (when (ring-empty-p comint-input-ring) ; cf shell-mode (let ((hfile (expand-file-name (or (getenv "GDBHISTFILE") @@ -861,9 +861,9 @@ detailed description of this mode. (and (stringp hsize) (integerp (setq hsize (string-to-number hsize))) (> hsize 0) - (set (make-local-variable 'comint-input-ring-size) hsize)) + (setq-local comint-input-ring-size hsize)) (if (stringp hfile) - (set (make-local-variable 'comint-input-ring-file-name) hfile)) + (setq-local comint-input-ring-file-name hfile)) (comint-read-input-ring t))) (gud-def gud-tbreak "tbreak %f:%l" "\C-t" "Set temporary breakpoint at current line.") @@ -966,8 +966,7 @@ detailed description of this mode. (define-key gud-minor-mode-map [left-margin C-mouse-3] 'gdb-mouse-jump) - (set (make-local-variable 'gud-gdb-completion-function) - 'gud-gdbmi-completions) + (setq-local gud-gdb-completion-function 'gud-gdbmi-completions) (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point nil 'local) @@ -1141,8 +1140,8 @@ no input, and GDB is waiting for input." (lambda () (gdb-tooltip-print expr))))))) (defun gdb-init-buffer () - (set (make-local-variable 'gud-minor-mode) 'gdbmi) - (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) + (setq-local gud-minor-mode 'gdbmi) + (setq-local tool-bar-map gud-tool-bar-map) (when gud-tooltip-mode (make-local-variable 'gdb-define-alist) (gdb-create-define-alist) @@ -1558,10 +1557,10 @@ this trigger is subscribed to `gdb-buf-publisher' and called with (when mode (funcall mode)) (setq gdb-buffer-type buffer-type) (when thread - (set (make-local-variable 'gdb-thread-number) thread)) - (set (make-local-variable 'gud-minor-mode) - (buffer-local-value 'gud-minor-mode gud-comint-buffer)) - (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) + (setq-local gdb-thread-number thread)) + (setq-local gud-minor-mode + (buffer-local-value 'gud-minor-mode gud-comint-buffer)) + (setq-local tool-bar-map gud-tool-bar-map) (rename-buffer (funcall (gdb-rules-name-maker rules))) (when trigger (gdb-add-subscriber gdb-buf-publisher @@ -3364,8 +3363,7 @@ corresponding to the mode line clicked." (setq gdb-thread-position (make-marker)) (add-to-list 'overlay-arrow-variable-list 'gdb-thread-position) (setq header-line-format gdb-threads-header) - (set (make-local-variable 'font-lock-defaults) - '(gdb-threads-font-lock-keywords)) + (setq-local font-lock-defaults '(gdb-threads-font-lock-keywords)) 'gdb-invalidate-threads) (defun gdb-thread-list-handler-custom () @@ -3920,8 +3918,7 @@ DOC is an optional documentation string." (define-derived-mode gdb-memory-mode gdb-parent-mode "Memory" "Major mode for examining memory." (setq header-line-format gdb-memory-header) - (set (make-local-variable 'font-lock-defaults) - '(gdb-memory-font-lock-keywords)) + (setq-local font-lock-defaults '(gdb-memory-font-lock-keywords)) 'gdb-invalidate-memory) (defun gdb-memory-buffer-name () @@ -4013,9 +4010,8 @@ DOC is an optional documentation string." ;; TODO Rename overlay variable for disassembly mode (add-to-list 'overlay-arrow-variable-list 'gdb-disassembly-position) (setq fringes-outside-margins t) - (set (make-local-variable 'gdb-disassembly-position) (make-marker)) - (set (make-local-variable 'font-lock-defaults) - '(gdb-disassembly-font-lock-keywords)) + (setq-local gdb-disassembly-position (make-marker)) + (setq-local font-lock-defaults '(gdb-disassembly-font-lock-keywords)) 'gdb-invalidate-disassembly) (defun gdb-disassembly-handler-custom () @@ -4222,8 +4218,7 @@ member." (setq gdb-stack-position (make-marker)) (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position) (setq truncate-lines t) ;; Make it easier to see overlay arrow. - (set (make-local-variable 'font-lock-defaults) - '(gdb-frames-font-lock-keywords)) + (setq-local font-lock-defaults '(gdb-frames-font-lock-keywords)) 'gdb-invalidate-frames) (defun gdb-select-frame (&optional event) commit 7ebd7ba174800f26170c2e01209f849b90073fd8 Author: Stefan Kangas Date: Wed Dec 9 08:29:03 2020 +0100 Prefer setq-local in etags.el * lisp/progmodes/etags.el (initialize-new-tags-table) (etags-recognize-tags-table, tags-recognize-empty-tags-table): Prefer setq-local. diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 104d889b8b..aadfb8150c 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -258,9 +258,9 @@ One argument, the tag info returned by `snarf-tag-function'.") Return non-nil if it is a valid tags table, and in that case, also make the tags table state variables buffer-local and set them to nil." - (set (make-local-variable 'tags-table-files) nil) - (set (make-local-variable 'tags-completion-table) nil) - (set (make-local-variable 'tags-included-tables) nil) + (setq-local tags-table-files nil) + (setq-local tags-completion-table nil) + (setq-local tags-included-tables nil) ;; We used to initialize find-tag-marker-ring and tags-location-ring ;; here, to new empty rings. But that is wrong, because those ;; are global. @@ -1234,34 +1234,29 @@ error message." "If `etags-verify-tags-table', make buffer-local format variables. If current buffer is a valid etags TAGS file, then give it buffer-local values of tags table format variables." - (and (etags-verify-tags-table) - ;; It is annoying to flash messages on the screen briefly, - ;; and this message is not useful. -- rms - ;; (message "%s is an `etags' TAGS file" buffer-file-name) - (mapc (lambda (elt) (set (make-local-variable (car elt)) (cdr elt))) - '((file-of-tag-function . etags-file-of-tag) - (tags-table-files-function . etags-tags-table-files) - (tags-completion-table-function . etags-tags-completion-table) - (snarf-tag-function . etags-snarf-tag) - (goto-tag-location-function . etags-goto-tag-location) - (find-tag-regexp-search-function . re-search-forward) - (find-tag-regexp-tag-order . (tag-re-match-p)) - (find-tag-regexp-next-line-after-failure-p . t) - (find-tag-search-function . search-forward) - (find-tag-tag-order . (tag-exact-file-name-match-p - tag-file-name-match-p - tag-exact-match-p - tag-implicit-name-match-p - tag-symbol-match-p - tag-word-match-p - tag-partial-file-name-match-p - tag-any-match-p)) - (find-tag-next-line-after-failure-p . nil) - (list-tags-function . etags-list-tags) - (tags-apropos-function . etags-tags-apropos) - (tags-included-tables-function . etags-tags-included-tables) - (verify-tags-table-function . etags-verify-tags-table) - )))) + (when (etags-verify-tags-table) + (setq-local file-of-tag-function 'etags-file-of-tag) + (setq-local tags-table-files-function 'etags-tags-table-files) + (setq-local tags-completion-table-function 'etags-tags-completion-table) + (setq-local snarf-tag-function 'etags-snarf-tag) + (setq-local goto-tag-location-function 'etags-goto-tag-location) + (setq-local find-tag-regexp-search-function 're-search-forward) + (setq-local find-tag-regexp-tag-order '(tag-re-match-p)) + (setq-local find-tag-regexp-next-line-after-failure-p t) + (setq-local find-tag-search-function 'search-forward) + (setq-local find-tag-tag-order '(tag-exact-file-name-match-p + tag-file-name-match-p + tag-exact-match-p + tag-implicit-name-match-p + tag-symbol-match-p + tag-word-match-p + tag-partial-file-name-match-p + tag-any-match-p)) + (setq-local find-tag-next-line-after-failure-p nil) + (setq-local list-tags-function 'etags-list-tags) + (setq-local tags-apropos-function 'etags-tags-apropos) + (setq-local tags-included-tables-function 'etags-tags-included-tables) + (setq-local verify-tags-table-function 'etags-verify-tags-table))) (defun etags-verify-tags-table () "Return non-nil if the current buffer is a valid etags TAGS file." @@ -1593,16 +1588,16 @@ hits the start of file." "Return non-nil if current buffer is empty. If empty, make buffer-local values of the tags table format variables that do nothing." - (and (zerop (buffer-size)) - (mapc (lambda (sym) (set (make-local-variable sym) 'ignore)) - '(tags-table-files-function - tags-completion-table-function - find-tag-regexp-search-function - find-tag-search-function - tags-apropos-function - tags-included-tables-function)) - (set (make-local-variable 'verify-tags-table-function) - (lambda () (zerop (buffer-size)))))) + (when (zerop (buffer-size)) + (setq-local tags-table-files-function #'ignore) + (setq-local tags-completion-table-function #'ignore) + (setq-local find-tag-regexp-search-function #'ignore) + (setq-local find-tag-search-function #'ignore) + (setq-local tags-apropos-function #'ignore) + (setq-local tags-included-tables-function #'ignore) + (setq-local verify-tags-table-function + (lambda () (zerop (buffer-size)))))) + ;; Match qualifier functions for tagnames. ;; These functions assume the etags file format defined in etc/ETAGS.EBNF. commit dc0295c563069ffacfbe01b87baa7701887999c3 Author: Stefan Kangas Date: Wed Dec 9 08:21:05 2020 +0100 Prefer setq-local in cfengine.el * lisp/progmodes/cfengine.el (cfengine-common-settings) (cfengine3-mode, cfengine2-mode): Prefer setq-local. diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el index a8fe485b70..6e915440f9 100644 --- a/lisp/progmodes/cfengine.el +++ b/lisp/progmodes/cfengine.el @@ -1314,19 +1314,19 @@ see. Use it by enabling `eldoc-mode'." (append bounds (list (cdr flist)))))) (defun cfengine-common-settings () - (set (make-local-variable 'syntax-propertize-function) - ;; In the main syntax-table, \ is marked as a punctuation, because - ;; of its use in DOS-style directory separators. Here we try to - ;; recognize the cases where \ is used as an escape inside strings. - (syntax-propertize-rules ("\\(\\(?:\\\\\\)+\\)\"" (1 "\\")))) - (set (make-local-variable 'parens-require-spaces) nil) - (set (make-local-variable 'comment-start) "# ") - (set (make-local-variable 'comment-start-skip) - "\\(\\(?:^\\|[^\\\n]\\)\\(?:\\\\\\\\\\)*\\)#+[ \t]*") + (setq-local syntax-propertize-function + ;; In the main syntax-table, \ is marked as a punctuation, because + ;; of its use in DOS-style directory separators. Here we try to + ;; recognize the cases where \ is used as an escape inside strings. + (syntax-propertize-rules ("\\(\\(?:\\\\\\)+\\)\"" (1 "\\")))) + (setq-local parens-require-spaces nil) + (setq-local comment-start "# ") + (setq-local comment-start-skip + "\\(\\(?:^\\|[^\\\n]\\)\\(?:\\\\\\\\\\)*\\)#+[ \t]*") ;; Like Lisp mode. Without this, we lose with, say, ;; `backward-up-list' when there's an unbalanced quote in a ;; preceding comment. - (set (make-local-variable 'parse-sexp-ignore-comments) t)) + (setq-local parse-sexp-ignore-comments t)) (defun cfengine-common-syntax (table) ;; The syntax defaults seem OK to give reasonable word movement. @@ -1374,7 +1374,7 @@ to the action header." (cfengine-common-settings) (cfengine-common-syntax cfengine3-mode-syntax-table) - (set (make-local-variable 'indent-line-function) #'cfengine3-indent-line) + (setq-local indent-line-function #'cfengine3-indent-line) (setq font-lock-defaults '(cfengine3-font-lock-keywords @@ -1384,11 +1384,11 @@ to the action header." ;; `compile-command' is almost never a `make' call with CFEngine so ;; we override it (when cfengine-cf-promises - (set (make-local-variable 'compile-command) - (concat cfengine-cf-promises - " -f " - (when buffer-file-name - (shell-quote-argument buffer-file-name))))) + (setq-local compile-command + (concat cfengine-cf-promises + " -f " + (when buffer-file-name + (shell-quote-argument buffer-file-name))))) (add-hook 'eldoc-documentation-functions #'cfengine3-documentation-function nil t) @@ -1418,20 +1418,18 @@ to the action header." ;; should avoid potential confusion in some cases. (modify-syntax-entry ?\` "\"" cfengine2-mode-syntax-table) - (set (make-local-variable 'indent-line-function) #'cfengine2-indent-line) - (set (make-local-variable 'outline-regexp) "[ \t]*\\(\\sw\\|\\s_\\)+:+") - (set (make-local-variable 'outline-level) #'cfengine2-outline-level) - (set (make-local-variable 'fill-paragraph-function) - #'cfengine-fill-paragraph) + (setq-local indent-line-function #'cfengine2-indent-line) + (setq-local outline-regexp "[ \t]*\\(\\sw\\|\\s_\\)+:+") + (setq-local outline-level #'cfengine2-outline-level) + (setq-local fill-paragraph-function #'cfengine-fill-paragraph) (define-abbrev-table 'cfengine2-mode-abbrev-table cfengine-mode-abbrevs) (setq font-lock-defaults '(cfengine2-font-lock-keywords nil nil nil beginning-of-line)) ;; Fixme: set the args of functions in evaluated classes to string ;; syntax, and then obey syntax properties. (setq imenu-generic-expression cfengine2-imenu-expression) - (set (make-local-variable 'beginning-of-defun-function) - #'cfengine2-beginning-of-defun) - (set (make-local-variable 'end-of-defun-function) #'cfengine2-end-of-defun)) + (setq-local beginning-of-defun-function #'cfengine2-beginning-of-defun) + (setq-local end-of-defun-function #'cfengine2-end-of-defun)) ;;;###autoload (defun cfengine-auto-mode () commit 3d6498cbf11a4cb651d256035e9ab0ee5278c44a Author: Stefan Kangas Date: Wed Dec 9 08:13:41 2020 +0100 Prefer setq-local in sql.el * lisp/progmodes/sql.el (sql--oracle-show-reserved-words) (sql-product-font-lock, sql-list-all, sql-mode) (sql-interactive-mode, sql-product-interactive): Prefer setq-local. diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 0e1ced8ed0..78f8577ef9 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -1724,7 +1724,7 @@ to add functions and PL/SQL keywords.") "ORDER BY 2 DESC, 3 DESC, 4 DESC, 5 DESC, 6 DESC, 1;") nil nil) (with-current-buffer b - (set (make-local-variable 'sql-product) 'oracle) + (setq-local sql-product 'oracle) (sql-product-font-lock t nil) (font-lock-mode +1))))) @@ -2811,7 +2811,7 @@ configured." ((syntax-alist (sql-product-font-lock-syntax-alist))) ;; Get the product-specific keywords. - (set (make-local-variable 'sql-mode-font-lock-keywords) + (setq-local sql-mode-font-lock-keywords (append (unless (eq sql-product 'ansi) (sql-get-product-feature sql-product :font-lock)) @@ -2823,7 +2823,7 @@ configured." ;; Setup font-lock. Force re-parsing of `font-lock-defaults'. (kill-local-variable 'font-lock-set-defaults) - (set (make-local-variable 'font-lock-defaults) + (setq-local font-lock-defaults (list 'sql-mode-font-lock-keywords keywords-only t syntax-alist)) @@ -4133,8 +4133,8 @@ details or extends the listing to include other schemas objects." (sql-execute-feature sqlbuf "*List All*" :list-all enhanced nil) (with-current-buffer sqlbuf ;; Contains the name of database objects - (set (make-local-variable 'sql-contains-names) t) - (set (make-local-variable 'sql-buffer) sqlbuf)))) + (setq-local sql-contains-names t) + (setq-local sql-buffer sqlbuf)))) (defun sql-list-table (name &optional enhanced) "List the details of a database table named NAME. @@ -4189,7 +4189,7 @@ must tell Emacs. Here's how to do that in your init file: (easy-menu-add sql-mode-menu)) ;; (smie-setup sql-smie-grammar #'sql-smie-rules) - (set (make-local-variable 'comment-start) "--") + (setq-local comment-start "--") ;; Make each buffer in sql-mode remember the "current" SQLi buffer. (make-local-variable 'sql-buffer) ;; Add imenu support for sql-mode. Note that imenu-generic-expression @@ -4199,12 +4199,12 @@ must tell Emacs. Here's how to do that in your init file: imenu-case-fold-search t) ;; Make `sql-send-paragraph' work on paragraphs that contain indented ;; lines. - (set (make-local-variable 'paragraph-separate) "[\f]*$") - (set (make-local-variable 'paragraph-start) "[\n\f]") + (setq-local paragraph-separate "[\f]*$") + (setq-local paragraph-start "[\n\f]") ;; Abbrevs (setq-local abbrev-all-caps 1) ;; Contains the name of database objects - (set (make-local-variable 'sql-contains-names) t) + (setq-local sql-contains-names t) (setq-local syntax-propertize-function (syntax-propertize-rules ;; Handle escaped apostrophes within strings. @@ -4303,9 +4303,8 @@ you entered, right above the output it created. :after-hook (sql--adjust-interactive-setup) ;; Get the `sql-product' for this interactive session. - (set (make-local-variable 'sql-product) - (or sql-interactive-product - sql-product)) + (setq-local sql-product (or sql-interactive-product + sql-product)) ;; Setup the mode. (setq mode-name @@ -4322,7 +4321,7 @@ you entered, right above the output it created. (sql-product-font-lock t nil) ;; Enable commenting and uncommenting of the region. - (set (make-local-variable 'comment-start) "--") + (setq-local comment-start "--") ;; Abbreviation table init and case-insensitive. It is not activated ;; by default. (setq local-abbrev-table sql-mode-abbrev-table) @@ -4331,27 +4330,27 @@ you entered, right above the output it created. (let ((proc (get-buffer-process (current-buffer)))) (when proc (set-process-sentinel proc #'sql-stop))) ;; Save the connection and login params - (set (make-local-variable 'sql-user) sql-user) - (set (make-local-variable 'sql-database) sql-database) - (set (make-local-variable 'sql-server) sql-server) - (set (make-local-variable 'sql-port) sql-port) - (set (make-local-variable 'sql-connection) sql-connection) + (setq-local sql-user sql-user) + (setq-local sql-database sql-database) + (setq-local sql-server sql-server) + (setq-local sql-port sql-port) + (setq-local sql-connection sql-connection) (setq-default sql-connection nil) ;; Contains the name of database objects - (set (make-local-variable 'sql-contains-names) t) + (setq-local sql-contains-names t) ;; Keep track of existing object names - (set (make-local-variable 'sql-completion-object) nil) - (set (make-local-variable 'sql-completion-column) nil) + (setq-local sql-completion-object nil) + (setq-local sql-completion-column nil) ;; Create a useful name for renaming this buffer later. - (set (make-local-variable 'sql-alternate-buffer-name) - (sql-make-alternate-buffer-name)) + (setq-local sql-alternate-buffer-name + (sql-make-alternate-buffer-name)) ;; User stuff. Initialize before the hook. - (set (make-local-variable 'sql-prompt-regexp) - (or (sql-get-product-feature sql-product :prompt-regexp) "^")) - (set (make-local-variable 'sql-prompt-length) - (sql-get-product-feature sql-product :prompt-length)) - (set (make-local-variable 'sql-prompt-cont-regexp) - (sql-get-product-feature sql-product :prompt-cont-regexp)) + (setq-local sql-prompt-regexp + (or (sql-get-product-feature sql-product :prompt-regexp) "^")) + (setq-local sql-prompt-length + (sql-get-product-feature sql-product :prompt-length)) + (setq-local sql-prompt-cont-regexp + (sql-get-product-feature sql-product :prompt-cont-regexp)) (make-local-variable 'sql-output-newline-count) (make-local-variable 'sql-preoutput-hold) (add-hook 'comint-preoutput-filter-functions @@ -4369,7 +4368,7 @@ you entered, right above the output it created. sql-prompt-regexp)) (setq left-margin (or sql-prompt-length 0)) ;; Install input sender - (set (make-local-variable 'comint-input-sender) #'sql-input-sender) + (setq-local comint-input-sender #'sql-input-sender) ;; People wanting a different history file for each ;; buffer/process/client/whatever can change separator and file-name ;; on the sql-interactive-mode-hook. @@ -4650,8 +4649,7 @@ the call to \\[sql-product-interactive] with ;; Set the new buffer name (setq new-sqli-buffer (current-buffer)) - (set (make-local-variable 'sql-buffer) - (buffer-name new-sqli-buffer)) + (setq-local sql-buffer (buffer-name new-sqli-buffer)) ;; Set `sql-buffer' in the start buffer (with-current-buffer start-buffer commit ec42ff31156a41b4087c4be9ee10702392b66c23 Author: Stefan Kangas Date: Wed Dec 9 08:09:56 2020 +0100 Prefer setq-local in font-lock.el * lisp/font-lock.el: (font-lock-add-keywords, font-lock-turn-on-thing-lock) (font-lock-fontify-syntactic-keywords-region) (font-lock-set-defaults): Prefer setq-local. diff --git a/lisp/font-lock.el b/lisp/font-lock.el index e708e69bd5..0e771e8e0a 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -152,8 +152,8 @@ ;; ;; (add-hook 'foo-mode-hook ;; (lambda () -;; (set (make-local-variable 'font-lock-defaults) -;; '(foo-font-lock-keywords t)))) +;; (setq-local font-lock-defaults +;; '(foo-font-lock-keywords t)))) ;;;; Adding Font Lock support for modes: @@ -173,8 +173,8 @@ ;; ;; and within `bar-mode' there could be: ;; -;; (set (make-local-variable 'font-lock-defaults) -;; '(bar-font-lock-keywords nil t)) +;; (setq-local font-lock-defaults +;; '(bar-font-lock-keywords nil t)) ;; What is fontification for? You might say, "It's to make my code look nice." ;; I think it should be for adding information in the form of cues. These cues @@ -733,7 +733,7 @@ see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types', ;; font-lock-mode it only enabled the font-core.el part, not the ;; font-lock-mode-internal. Try again. (font-lock-mode -1) - (set (make-local-variable 'font-lock-defaults) '(nil t)) + (setq-local font-lock-defaults '(nil t)) (font-lock-mode 1)) ;; Otherwise set or add the keywords now. ;; This is a no-op if it has been done already in this buffer @@ -933,18 +933,15 @@ The value of this variable is used when Font Lock mode is turned on." ;; Prepare for jit-lock (remove-hook 'after-change-functions #'font-lock-after-change-function t) - (set (make-local-variable 'font-lock-flush-function) - #'jit-lock-refontify) - (set (make-local-variable 'font-lock-ensure-function) - #'jit-lock-fontify-now) + (setq-local font-lock-flush-function #'jit-lock-refontify) + (setq-local font-lock-ensure-function #'jit-lock-fontify-now) ;; Prevent font-lock-fontify-buffer from fontifying eagerly the whole ;; buffer. This is important for things like CWarn mode which ;; adds/removes a few keywords and does a refontify (which takes ages on ;; large files). - (set (make-local-variable 'font-lock-fontify-buffer-function) - #'jit-lock-refontify) + (setq-local font-lock-fontify-buffer-function #'jit-lock-refontify) ;; Don't fontify eagerly (and don't abort if the buffer is large). - (set (make-local-variable 'font-lock-fontified) t) + (setq-local font-lock-fontified t) ;; Use jit-lock. (jit-lock-register #'font-lock-fontify-region (not font-lock-keywords-only)) @@ -1558,7 +1555,7 @@ START should be at the beginning of a line." (unless parse-sexp-lookup-properties ;; We wouldn't go through so much trouble if we didn't intend to use those ;; properties, would we? - (set (make-local-variable 'parse-sexp-lookup-properties) t)) + (setq-local parse-sexp-lookup-properties t)) ;; If `font-lock-syntactic-keywords' is a symbol, get the real keywords. (when (symbolp font-lock-syntactic-keywords) (setq font-lock-syntactic-keywords (font-lock-eval-keywords @@ -1942,8 +1939,8 @@ Sets various variables using `font-lock-defaults' and (set (make-local-variable (car x)) (cdr x))) ;; Set up `font-lock-keywords' last because its value might depend ;; on other settings. - (set (make-local-variable 'font-lock-keywords) - (font-lock-eval-keywords keywords)) + (setq-local font-lock-keywords + (font-lock-eval-keywords keywords)) ;; Local fontification? (while local (font-lock-add-keywords nil (car (car local)) (cdr (car local))) commit 4248d603efdaa878c95ed26f2ea7d62c9e925c5c Author: Stefan Kangas Date: Wed Dec 9 07:58:55 2020 +0100 * lisp/progmodes/sql.el: Remove redundant URL. diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 0bf9a517aa..0e1ced8ed0 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -6,7 +6,6 @@ ;; Maintainer: Michael Mauger ;; Version: 3.6 ;; Keywords: comm languages processes -;; URL: https://savannah.gnu.org/projects/emacs/ ;; This file is part of GNU Emacs. commit 2581beba6580e0928cd5076b3437ff27d6da0131 Author: Basil L. Contovounesios Date: Wed Dec 9 00:54:34 2020 +0000 Make abbrev-tests.el more deterministic * test/lisp/abbrev-tests.el (abbrev--table-symbols-test): Don't rely on order of symbols in obarray. diff --git a/test/lisp/abbrev-tests.el b/test/lisp/abbrev-tests.el index aaf1d4a5b5..288ea1ae98 100644 --- a/test/lisp/abbrev-tests.el +++ b/test/lisp/abbrev-tests.el @@ -69,8 +69,9 @@ (define-abbrev ert-test-abbrevs "sys" "system abbrev" nil :system t) (should (equal (mapcar #'symbol-name (abbrev--table-symbols 'ert-test-abbrevs)) '("a-e-t"))) - (should (equal (mapcar #'symbol-name (abbrev--table-symbols 'ert-test-abbrevs t)) - '("a-e-t" "sys"))))) + (let ((syms (abbrev--table-symbols 'ert-test-abbrevs t))) + (should (equal (sort (mapcar #'symbol-name syms) #'string<) + '("a-e-t" "sys")))))) (ert-deftest abbrev-table-get-put-test () (let ((table (make-abbrev-table))) commit 85acde2ab5c2327c8f70ea3c284f26de4a44128b Author: Lars Ingebrigtsen Date: Wed Dec 9 01:10:04 2020 +0100 Make uncache_image slightly more efficient * src/image.c (uncache_image): Extremely minor speed-up: Only compute the hash once. diff --git a/src/image.c b/src/image.c index 846f2d1a5b..522a4cf7c0 100644 --- a/src/image.c +++ b/src/image.c @@ -1633,12 +1633,13 @@ static void uncache_image (struct frame *f, Lisp_Object spec) { struct image *img; + EMACS_UINT hash = sxhash (spec); /* Because the background colors are based on the current face, we 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, sxhash (spec), 0, 0, true))) + while ((img = search_image_cache (f, spec, hash, 0, 0, true))) { free_image (f, img); /* As display glyphs may still be referring to the image ID, we commit 02ec247fcc053ef7b33b550a9ddc60cbb1d158f0 Author: Stefan Monnier Date: Tue Dec 8 18:54:52 2020 -0500 * src/fns.c: Remove left over include diff --git a/src/fns.c b/src/fns.c index 23d24ef4db..e9b6a96f34 100644 --- a/src/fns.c +++ b/src/fns.c @@ -18,7 +18,6 @@ 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 . */ -#include #include #include commit ac341cd629cfcf7e6e15321f8b53100cc6c0507f Author: Lars Ingebrigtsen Date: Wed Dec 9 00:42:06 2020 +0100 Restore Emacs 27 image cache semantics * src/image.c (equal_lists): Remove. (search_image_cache): Use Fequal instead of equal_lists. Benchmarking shows no measurable time difference, and this restores the cache semantics from Emacs 27 (where file names didn't have to be EQ for the cache to be used). diff --git a/src/image.c b/src/image.c index 5eb4132295..846f2d1a5b 100644 --- a/src/image.c +++ b/src/image.c @@ -1592,17 +1592,6 @@ make_image_cache (void) return c; } -/* Compare two lists (one of which must be proper), comparing each - element with `eq'. */ -static bool -equal_lists (Lisp_Object a, Lisp_Object b) -{ - while (CONSP (a) && CONSP (b) && EQ (XCAR (a), XCAR (b))) - a = XCDR (a), b = XCDR (b); - - return EQ (a, b); -} - /* Find an image matching SPEC in the cache, and return it. If no image is found, return NULL. */ static struct image * @@ -1630,7 +1619,7 @@ search_image_cache (struct frame *f, Lisp_Object spec, EMACS_UINT hash, for (img = c->buckets[i]; img; img = img->next) if (img->hash == hash - && equal_lists (img->spec, spec) + && !NILP (Fequal (img->spec, spec)) && (ignore_colors || (img->face_foreground == foreground && img->face_background == background))) break; commit 67a9ecb4890872c288bda26e954e9c7629d709da Author: João Távora Date: Tue Dec 8 23:40:13 2020 +0000 Remove interactive spec from internal eldoc--format-doc-buffer Per bug#43609. * lisp/emacs-lisp/eldoc.el (eldoc--format-doc-buffer): Remove useless interactive spec. diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index d81060ef16..6a97684103 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -467,7 +467,6 @@ This holds the results of the last documentation request." (defun eldoc--format-doc-buffer (docs) "Ensure DOCS are displayed in an *eldoc* buffer." - (interactive (list t)) (with-current-buffer (if (buffer-live-p eldoc--doc-buffer) eldoc--doc-buffer (setq eldoc--doc-buffer commit be0f2de179235980b5409d5e77577207b93a4f12 Author: Stefan Monnier Date: Tue Dec 8 18:08:54 2020 -0500 * src/fns.c (hash_string): Speed up on large strings diff --git a/src/fns.c b/src/fns.c index e4c9acc316..23d24ef4db 100644 --- a/src/fns.c +++ b/src/fns.c @@ -18,6 +18,7 @@ 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 . */ +#include #include #include @@ -4525,18 +4526,40 @@ sweep_weak_table (struct Lisp_Hash_Table *h, bool remove_entries_p) EMACS_UINT hash_string (char const *ptr, ptrdiff_t len) { - char const *p = ptr; - char const *end = p + len; - unsigned char c; - EMACS_UINT hash = 0; - - while (p != end) + if (len < 16) { - c = *p++; - hash = sxhash_combine (hash, c); + char const *p = ptr; + char const *end = p + len; + EMACS_UINT hash = len; + + while (p < end) + { + unsigned char c = *p++; + hash = sxhash_combine (hash, c); + } + + return hash; } + else + { + EMACS_UINT const *p = (EMACS_UINT const *) ptr; + EMACS_UINT const *end = (EMACS_UINT const *) (ptr + len); + EMACS_UINT hash = len; + /* At most 8 steps. We could reuse SXHASH_MAX_LEN, of course, + * but dividing by 8 is cheaper. */ + ptrdiff_t step = max (1, (end - p) >> 3); + + /* Beware: `end` might be unaligned, so `p < end` is not always the same + * as `p <= end - 1`. */ + while (p <= end - 1) + { + EMACS_UINT c = *p; + p += step; + hash = sxhash_combine (hash, c); + } - return hash; + return hash; + } } /* Return a hash for string PTR which has length LEN. The hash commit ca50519900de956fbd2ea8200127792003cb7c98 Author: Lars Ingebrigtsen Date: Tue Dec 8 23:41:24 2020 +0100 term.el comment update * lisp/term.el: Fix wrong command name in the comments (bug#7041). diff --git a/lisp/term.el b/lisp/term.el index 545185064d..2e69af0735 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -264,7 +264,7 @@ ;; M-p term-previous-input Cycle backwards in input history ;; M-n term-next-input Cycle forwards ;; M-r term-previous-matching-input Previous input matching a regexp -;; M-s comint-next-matching-input Next input that matches +;; M-s term-next-matching-input Next input that matches ;; return term-send-input ;; C-c C-a term-bol Beginning of line; skip prompt. ;; C-d term-delchar-or-maybe-eof Delete char unless at end of buff. commit 2d8f0364fcd1d5dad2b82dd3a9af870b03854547 Author: Serge Tupchii Date: Tue Dec 8 21:22:34 2020 +0100 Fix crash (segfault) in etags on generating tags for Erlang files * lib-src/etags.c: Set allocated and lastlen to zero, after freeing last ptr in Erlang_functions to prevent dereferencing NULL pointer (bug#45122). Copyright-paperwork-exempt: yes diff --git a/lib-src/etags.c b/lib-src/etags.c index 4315771a49..a1c6837e88 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -6063,6 +6063,7 @@ Erlang_functions (FILE *inf) { free (last); last = NULL; + allocated = lastlen = 0; } } else commit 1fb099ceb0269e8e74bd0f8dc98eb1da156becbd Author: Lars Ingebrigtsen Date: Tue Dec 8 18:22:47 2020 +0100 Make rcirc nick renaming heed nickname max lengths * lisp/net/rcirc.el (rcirc-server-parameters): New variable (bug#6795). (rcirc-connect): Set it. (rcirc-handler-433): Use the length from the server. (rcirc-handler-005): Collect server data. (rcirc-server-parameter-value): New utility function. (rcirc--make-new-nick): New function. diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 63e6eedb20..c4b68f1be4 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -416,6 +416,9 @@ will be killed." (defvar rcirc-server-buffer nil "The server buffer associated with this channel buffer.") +(defvar rcirc-server-parameters nil + "List of parameters received from the server.") + (defvar rcirc-target nil "The channel or user associated with this buffer.") @@ -586,6 +589,7 @@ If ARG is non-nil, instead prompt for connection parameters." (setq-local rcirc-user-disconnect nil) (setq-local rcirc-user-authenticated nil) (setq-local rcirc-connecting t) + (setq-local rcirc-server-parameters nil) (add-hook 'auto-save-hook 'rcirc-log-write) @@ -2873,9 +2877,28 @@ Not in rfc1459.txt" (defun rcirc-handler-433 (process sender args text) "ERR_NICKNAMEINUSE" (rcirc-handler-generic process "433" sender args text) - (let* ((new-nick (concat (cadr args) "`"))) - (with-rcirc-process-buffer process - (rcirc-cmd-nick new-nick nil process)))) + (with-rcirc-process-buffer process + (let* ((length (string-to-number + (or (rcirc-server-parameter-value 'nicklen) + "16")))) + (rcirc-cmd-nick (rcirc--make-new-nick (cadr args) length) nil process)))) + +(defun rcirc--make-new-nick (nick length) + ;; If we already have some ` chars at the end, then shorten the + ;; non-` bit of the name. + (when (= (length nick) length) + (setq nick (replace-regexp-in-string "[^`]\\(`+\\)\\'" "\\1" nick))) + (concat + (if (>= (length nick) length) + (substring nick 0 (1- length)) + nick) + "`")) + +(defun rcirc-handler-005 (process sender args text) + "ERR_NICKNAMEINUSE" + (rcirc-handler-generic process "005" sender args text) + (with-rcirc-process-buffer process + (setq rcirc-server-parameters (append rcirc-server-parameters args)))) (defun rcirc-authenticate () "Send authentication to process associated with current buffer. @@ -3072,6 +3095,13 @@ Passwords are stored in `rcirc-authinfo' (which see)." (>= (point) rcirc-prompt-end-marker)) +(defun rcirc-server-parameter-value (parameter) + (cl-loop for elem in rcirc-server-parameters + for setting = (split-string elem "=") + when (and (= (length setting) 2) + (string-equal (downcase (car setting)) parameter)) + return (cadr setting))) + (provide 'rcirc) ;;; rcirc.el ends here diff --git a/test/lisp/net/rcirc-tests.el b/test/lisp/net/rcirc-tests.el index 285926af9d..cbd1c2be83 100644 --- a/test/lisp/net/rcirc-tests.el +++ b/test/lisp/net/rcirc-tests.el @@ -51,4 +51,16 @@ "MODE #cchan +kl :a:b" nil "MODE" '("#cchan" "+kl" "a:b"))) +(ert-deftest rcirc-rename-nicks () + (should (equal (rcirc--make-new-nick "foo" 16) + "foo`")) + (should (equal (rcirc--make-new-nick "123456789012345" 16) + "123456789012345`")) + (should (equal (rcirc--make-new-nick "1234567890123456" 16) + "123456789012345`")) + (should (equal (rcirc--make-new-nick "123456789012345`" 16) + "12345678901234``")) + (should (equal (rcirc--make-new-nick "123456789012````" 16) + "12345678901`````"))) + ;;; rcirc-tests.el ends here commit ef711b1556f83c9aa841fec9927672245408fc9c Author: Lars Ingebrigtsen Date: Tue Dec 8 17:57:10 2020 +0100 Make hexl scrolling commands work more like the normal ones * lisp/hexl.el (hexl-scroll-down): (hexl-scroll-up): Heed `next-screen-context-lines' (bug#7031). diff --git a/etc/NEWS b/etc/NEWS index f2fd9fb138..83fe7a349e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1370,6 +1370,12 @@ This new command (bound to 'C-c C-l') regenerates the current hunk. ** Miscellaneous +--- +*** 'hexl-mode' scrolling commands now heed 'next-screen-context-lines'. +Previously, 'hexl-scroll-down' and 'hexl-scroll-up' would scroll +up/down an entire window, but they now work more like the standard +scrolling commands. + --- *** Errors in 'kill-emacs-hook' no longer prevent Emacs from shutting down. If a function in that hook signals an error in an interactive Emacs, diff --git a/lisp/hexl.el b/lisp/hexl.el index fa514a5400..1fe9aad66d 100644 --- a/lisp/hexl.el +++ b/lisp/hexl.el @@ -724,7 +724,8 @@ With prefix arg N, puts point N bytes of the way from the true beginning." (setq arg (if (null arg) (- (window-height) 1 - (if ruler-mode 1 0)) + (if ruler-mode 1 0) + next-screen-context-lines) (prefix-numeric-value arg))) (hexl-scroll-up (- arg))) @@ -735,7 +736,8 @@ If there's no byte at the target address, move to the first or last line." (setq arg (if (null arg) (- (window-height) 1 - (if ruler-mode 1 0)) + (if ruler-mode 1 0) + next-screen-context-lines) (prefix-numeric-value arg))) (let* ((movement (* arg 16)) (address (hexl-current-address)) commit 3440bd0d53233f6345bfa4260444c01e352834ad Author: Lars Ingebrigtsen Date: Tue Dec 8 17:48:40 2020 +0100 Fix scrolling in hexl-mode when ruler-mode is on * lisp/hexl.el (hexl-scroll-down): (hexl-scroll-up): Take ruler-mode into account when computing the number of lines (bug#7031). These commands would previously jump one line too many by default, skipping one line. diff --git a/lisp/hexl.el b/lisp/hexl.el index 5d813c410c..fa514a5400 100644 --- a/lisp/hexl.el +++ b/lisp/hexl.el @@ -722,7 +722,9 @@ With prefix arg N, puts point N bytes of the way from the true beginning." "Scroll hexl buffer window upward ARG lines; or near full window if no ARG." (interactive "P") (setq arg (if (null arg) - (1- (window-height)) + (- (window-height) + 1 + (if ruler-mode 1 0)) (prefix-numeric-value arg))) (hexl-scroll-up (- arg))) @@ -731,7 +733,9 @@ With prefix arg N, puts point N bytes of the way from the true beginning." If there's no byte at the target address, move to the first or last line." (interactive "P") (setq arg (if (null arg) - (1- (window-height)) + (- (window-height) + 1 + (if ruler-mode 1 0)) (prefix-numeric-value arg))) (let* ((movement (* arg 16)) (address (hexl-current-address)) commit 26b198cef987dc087994c8ce8bf852c4a37dbca0 Author: Eli Zaretskii Date: Tue Dec 8 18:43:09 2020 +0200 Improve documentation of 'backtrace-on-error-noninteractive' * src/eval.c (syms_of_eval) : Format the doc string according to conventions. * etc/NEWS: Improve formatting and wording of the entry describing 'backtrace-on-error-noninteractive. diff --git a/etc/NEWS b/etc/NEWS index d796a4cdbc..f2fd9fb138 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -192,10 +192,10 @@ have been replaced with "chat.freenode.net" throughout Emacs. These functions return the connection local value of the respective variables. This can be used for remote hosts. -** Emacs now prints a backtrace when signaling an error in batch mode. This -makes debugging Emacs Lisp scripts run in batch mode easier. If you -want to disable this behavior, set 'backtrace-on-error-noninteractive' -to nil. +** Emacs now prints a backtrace when signaling an error in batch mode. +This makes debugging Emacs Lisp scripts run in batch mode easier. To +get back the old behavior, set the new variable +'backtrace-on-error-noninteractive' to a nil value. * Editing Changes in Emacs 28.1 diff --git a/src/eval.c b/src/eval.c index 1351d283c5..e2d70aaa0e 100644 --- a/src/eval.c +++ b/src/eval.c @@ -4267,8 +4267,10 @@ still determine whether to handle the particular condition. */); DEFVAR_BOOL ("backtrace-on-error-noninteractive", backtrace_on_error_noninteractive, - doc: /* If non-nil and Emacs is running noninteractively, -print a backtrace on encountering an unhandled error. */); + doc: /* Non-nil means print backtrace on error in batch mode. +If this is nil, errors in batch mode will just print the error +message upon encountering an unhandled error, without showing +the Lisp backtrace. */); backtrace_on_error_noninteractive = true; /* The value of num_nonmacro_input_events as of the last time we commit 38c9b0bbdd1c95dc34af4aaf27183fd27aba1c9e Author: Lars Ingebrigtsen Date: Tue Dec 8 17:15:41 2020 +0100 Make the history traversal functions in coming more regular * lisp/comint.el (comint-previous-matching-input): Allow restoring the input on wraps (bug#7885). (comint-previous-matching-input-from-input): Restore input on wraps. diff --git a/lisp/comint.el b/lisp/comint.el index 2873416c5f..628a93ddf9 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1224,7 +1224,7 @@ Moves relative to START, or `comint-input-ring-index'." (process-mark (get-buffer-process (current-buffer)))) (point-max))) -(defun comint-previous-matching-input (regexp n) +(defun comint-previous-matching-input (regexp n &optional restore) "Search backwards through input history for match for REGEXP. \(Previous history elements are earlier commands.) With prefix argument N, search for Nth previous match. @@ -1235,16 +1235,24 @@ If N is negative, find the next or Nth next match." ;; Has a match been found? (if (null pos) (user-error "Not found") - ;; If leaving the edit line, save partial input - (if (null comint-input-ring-index) ;not yet on ring - (setq comint-stored-incomplete-input - (funcall comint-get-old-input))) - (setq comint-input-ring-index pos) - (unless isearch-mode - (let ((message-log-max nil)) ; Do not write to *Messages*. - (message "History item: %d" (1+ pos)))) - (comint-delete-input) - (insert (ring-ref comint-input-ring pos))))) + (if (and comint-input-ring-index + restore + (or (and (< n 0) + (< comint-input-ring-index pos)) + (and (> n 0) + (> comint-input-ring-index pos)))) + ;; We have a wrap; restore contents. + (comint-restore-input) + ;; If leaving the edit line, save partial input + (if (null comint-input-ring-index) ;not yet on ring + (setq comint-stored-incomplete-input + (funcall comint-get-old-input))) + (setq comint-input-ring-index pos) + (unless isearch-mode + (let ((message-log-max nil)) ; Do not write to *Messages*. + (message "History item: %d" (1+ pos)))) + (comint-delete-input) + (insert (ring-ref comint-input-ring pos)))))) (defun comint-next-matching-input (regexp n) "Search forwards through input history for match for REGEXP. @@ -1272,7 +1280,7 @@ If N is negative, search forwards for the -Nth following match." comint-input-ring-index nil)) (comint-previous-matching-input (concat "^" (regexp-quote comint-matching-input-from-input-string)) - n) + n t) (when (eq comint-move-point-for-matching-input 'after-input) (goto-char opoint)))) commit db9549d0ddb65f01591208a052561e198b1ba9e5 Author: Boruch Baum Date: Tue Dec 8 14:38:44 2020 +0100 Make table-fixed-width-mode work again * lisp/textmodes/table.el (table--update-cell): Make table-fixed-width-mode work (bug#18183). diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 984cc08de8..e42615e515 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el @@ -4073,10 +4073,12 @@ cache buffer into the designated cell in the table buffer." (set-buffer table-cell-buffer) (let ((cache-buffer (get-buffer-create table-cache-buffer-name)) (org-coord (table--get-coordinate)) + (fixed table-fixed-width-mode) (in-cell (equal (table--cell-to-coord (table--probe-cell)) (cons table-cell-info-lu-coordinate table-cell-info-rb-coordinate))) rectangle) (set-buffer cache-buffer) + (setq-local table-fixed-width-mode fixed) (setq rectangle (extract-rectangle 1 commit 06168c124d67a331c9e4b95d807531f697c320dc Author: Lars Ingebrigtsen Date: Tue Dec 8 14:20:10 2020 +0100 Use the proper face for the Gnus mode line id * lisp/gnus/gnus-sum.el (gnus-set-mode-line): * lisp/gnus/gnus-group.el (gnus-group-set-mode-line): Use the mode-line-buffer-id face on the buffer id. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index a0f27c1937..24534a1b66 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -1745,7 +1745,8 @@ already. If INFO-UNCHANGED is non-nil, dribble buffer is not updated." (prog1 (setq mode-line-buffer-identification (gnus-mode-line-buffer-identification - (list mode-string))) + (list (propertize mode-string + 'face 'mode-line-buffer-id)))) (set-buffer-modified-p modified)))))) (defun gnus-group-group-name () diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 8c826e88c7..9432eefcb4 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -6254,7 +6254,9 @@ If WHERE is `summary', the summary mode line format will be used." mode-string (- max-len 3) nil nil t))))) ;; Update the mode line. (setq mode-line-buffer-identification - (gnus-mode-line-buffer-identification (list mode-string))) + (gnus-mode-line-buffer-identification + (list (propertize mode-string + 'face 'mode-line-buffer-id)))) (set-buffer-modified-p t)))) (defun gnus-create-xref-hashtb (from-newsgroup headers unreads) commit fbb9dd3e82163c24c0660322ca914612462e0050 Author: Lars Ingebrigtsen Date: Tue Dec 8 14:17:36 2020 +0100 Simplify gnus-mode-line-buffer-identification * lisp/gnus/gnus.el (gnus-mode-line-image-cache): Remove. (gnus-mode-line-buffer-identification): Use the find-image cache. diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 2edda5f1fe..abe7b1ae76 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -309,34 +309,29 @@ be set in `.emacs' instead." :group 'gnus-start :type 'boolean) -(defvar gnus-mode-line-image-cache t) - -(eval-and-compile - (if (fboundp 'find-image) - (defun gnus-mode-line-buffer-identification (line) - (let ((str (car-safe line)) - (load-path (append (mm-image-load-path) load-path))) - (if (and (display-graphic-p) - (stringp str) - (string-match "^Gnus:" str)) - (progn (add-text-properties - 0 5 - (list 'display - (if (eq t gnus-mode-line-image-cache) - (setq gnus-mode-line-image-cache - (find-image - '((:type xpm :file "gnus-pointer.xpm" - :ascent center) - (:type xbm :file "gnus-pointer.xbm" - :ascent center)))) - gnus-mode-line-image-cache) - 'help-echo (format - "This is %s, %s." - gnus-version (gnus-emacs-version))) - str) - (list str)) - line))) - (defalias 'gnus-mode-line-buffer-identification 'identity))) +(defun gnus-mode-line-buffer-identification (line) + (let ((str (car-safe line))) + (if (or (not (fboundp 'find-image)) + (not (display-graphic-p)) + (not (stringp str)) + (not (string-match "^Gnus:" str))) + line + (let ((load-path (append (mm-image-load-path) load-path))) + ;; Add the Gnus logo. + (add-text-properties + 0 5 + (list 'display + (find-image + '((:type xpm :file "gnus-pointer.xpm" + :ascent center) + (:type xbm :file "gnus-pointer.xbm" + :ascent center)) + t) + 'help-echo (format + "This is %s, %s." + gnus-version (gnus-emacs-version))) + str) + (list str))))) ;; We define these group faces here to avoid the display ;; update forced when creating new faces. commit ab4b90723e4664cefef8400e678419e04728b8c2 Author: Lars Ingebrigtsen Date: Tue Dec 8 13:57:44 2020 +0100 Cache toolbar icon data paths * lisp/image.el (find-image): Add an optional CACHE parameter. (find-image--cache): New variable. * lisp/tool-bar.el (tool-bar--image-expression): Use cached data to avoid looking up the image files on each refresh. diff --git a/lisp/image.el b/lisp/image.el index 9ebb603086..023d64fc4e 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -679,8 +679,10 @@ BUFFER nil or omitted means use the current buffer." (setq path (cdr path))) (if found filename))) +(defvar find-image--cache (make-hash-table :test #'equal)) + ;;;###autoload -(defun find-image (specs) +(defun find-image (specs &optional cache) "Find an image, choosing one of a list of image specifications. SPECS is a list of image specifications. @@ -695,26 +697,33 @@ is supported, and FILE exists, is used to construct the image specification to be returned. Return nil if no specification is satisfied. +If CACHE is non-nil, results are cached and returned on subsequent calls. + The image is looked for in `image-load-path'. Image files should not be larger than specified by `max-image-size'." - (let (image) - (while (and specs (null image)) - (let* ((spec (car specs)) - (type (plist-get spec :type)) - (data (plist-get spec :data)) - (file (plist-get spec :file)) - found) - (when (image-type-available-p type) - (cond ((stringp file) - (if (setq found (image-search-load-path file)) - (setq image - (cons 'image (plist-put (copy-sequence spec) - :file found))))) - ((not (null data)) - (setq image (cons 'image spec))))) - (setq specs (cdr specs)))) - image)) + (or (and cache + (gethash specs find-image--cache)) + (let ((orig-specs specs) + image) + (while (and specs (null image)) + (let* ((spec (car specs)) + (type (plist-get spec :type)) + (data (plist-get spec :data)) + (file (plist-get spec :file)) + found) + (when (image-type-available-p type) + (cond ((stringp file) + (if (setq found (image-search-load-path file)) + (setq image + (cons 'image (plist-put (copy-sequence spec) + :file found))))) + ((not (null data)) + (setq image (cons 'image spec))))) + (setq specs (cdr specs)))) + (when cache + (setf (gethash orig-specs find-image--cache) image)) + image))) ;;;###autoload diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el index 8456216430..37f42be3f4 100644 --- a/lisp/tool-bar.el +++ b/lisp/tool-bar.el @@ -159,7 +159,8 @@ To define items in any other map, use `tool-bar-local-item'." ((< (display-color-cells) 256) ',(list xpm-lo-spec xpm-spec pbm-spec xbm-spec)) (t - ',(list xpm-spec pbm-spec xbm-spec)))))) + ',(list xpm-spec pbm-spec xbm-spec))) + t))) ;;;###autoload (defun tool-bar-local-item (icon def key map &rest props) commit 19c0afd0adea40dadc4f21c00482cfff9e868399 Author: Stefan Kangas Date: Tue Dec 8 11:21:13 2020 +0100 ; * lisp/timezone.el: Fix typo in lexical-binding cookie. Reported by Xu Chunyang . diff --git a/lisp/timezone.el b/lisp/timezone.el index 8ba70f17fd..1b5e4226e2 100644 --- a/lisp/timezone.el +++ b/lisp/timezone.el @@ -1,4 +1,4 @@ -;;; timezone.el --- time zone package for GNU Emacs -- lexical-binding: t -*- +;;; timezone.el --- time zone package for GNU Emacs -*- lexical-binding: t -*- ;; Copyright (C) 1990-1993, 1996, 1999, 2001-2020 Free Software ;; Foundation, Inc. commit bdf8dd25e658eb5b1921f5e386eac0a0285707fc Author: Stefan Kangas Date: Mon Dec 7 16:56:15 2020 +0100 Prefer setq-local in grep.el * lisp/progmodes/grep.el (grep-process-setup, grep-mode): Prefer setq-local. diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index dafba22f77..7c8acedaf3 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -568,8 +568,7 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." ;; GREP_COLORS is used in GNU grep 2.5.2 and later versions (setenv "GREP_COLORS" "mt=01;31:fn=:ln=:bn=:se=:sl=:cx=:ne")) (setq-local grep-num-matches-found 0) - (set (make-local-variable 'compilation-exit-message-function) - #'grep-exit-message) + (setq-local compilation-exit-message-function #'grep-exit-message) (run-hooks 'grep-setup-hook)) (defun grep-exit-message (status code msg) @@ -880,22 +879,22 @@ The value depends on `grep-command', `grep-template', (define-compilation-mode grep-mode "Grep" "Sets `grep-last-buffer' and `compilation-window-height'." (setq grep-last-buffer (current-buffer)) - (set (make-local-variable 'tool-bar-map) grep-mode-tool-bar-map) - (set (make-local-variable 'compilation-error-face) - grep-hit-face) - (set (make-local-variable 'compilation-error-regexp-alist) - grep-regexp-alist) - (set (make-local-variable 'compilation-mode-line-errors) - grep-mode-line-matches) + (setq-local tool-bar-map grep-mode-tool-bar-map) + (setq-local compilation-error-face + grep-hit-face) + (setq-local compilation-error-regexp-alist + grep-regexp-alist) + (setq-local compilation-mode-line-errors + grep-mode-line-matches) ;; compilation-directory-matcher can't be nil, so we set it to a regexp that ;; can never match. - (set (make-local-variable 'compilation-directory-matcher) - (list regexp-unmatchable)) - (set (make-local-variable 'compilation-process-setup-function) - #'grep-process-setup) - (set (make-local-variable 'compilation-disable-input) t) - (set (make-local-variable 'compilation-error-screen-columns) - grep-error-screen-columns) + (setq-local compilation-directory-matcher + (list regexp-unmatchable)) + (setq-local compilation-process-setup-function + #'grep-process-setup) + (setq-local compilation-disable-input t) + (setq-local compilation-error-screen-columns + grep-error-screen-columns) (add-hook 'compilation-filter-hook #'grep-filter nil t)) (defun grep--save-buffers () commit afe1605939a538b05ff0ad2f1c861ce857eb463f Author: Stefan Kangas Date: Mon Dec 7 16:54:12 2020 +0100 Prefer setq-local in meta-mode.el * lisp/progmodes/meta-mode.el (meta-common-mode, metafont-mode) (metapost-mode): Prefer setq-local. diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el index 87c20a2ee0..e15ec72181 100644 --- a/lisp/progmodes/meta-mode.el +++ b/lisp/progmodes/meta-mode.el @@ -919,57 +919,55 @@ The environment marked is the one that contains point or follows point." (define-derived-mode meta-common-mode prog-mode "-Meta-common-" "Common initialization for Metafont or MetaPost mode." :abbrev-table meta-mode-abbrev-table - (set (make-local-variable 'paragraph-start) - (concat page-delimiter "\\|$")) - (set (make-local-variable 'paragraph-separate) - (concat page-delimiter "\\|$")) + (setq-local paragraph-start (concat page-delimiter "\\|$")) + (setq-local paragraph-separate (concat page-delimiter "\\|$")) - (set (make-local-variable 'paragraph-ignore-fill-prefix) t) + (setq-local paragraph-ignore-fill-prefix t) - (set (make-local-variable 'comment-start-skip) "%+[ \t\f]*") - (set (make-local-variable 'comment-start) "%") - (set (make-local-variable 'comment-end) "") - (set (make-local-variable 'comment-multi-line) nil) + (setq-local comment-start-skip "%+[ \t\f]*") + (setq-local comment-start "%") + (setq-local comment-end "") + (setq-local comment-multi-line nil) ;; We use `back-to-indentation' but \f is no indentation sign. (modify-syntax-entry ?\f "_ ") - (set (make-local-variable 'parse-sexp-ignore-comments) t) + (setq-local parse-sexp-ignore-comments t) (add-hook 'completion-at-point-functions #'meta-completions-at-point nil t) - (set (make-local-variable 'comment-indent-function) #'meta-comment-indent) - (set (make-local-variable 'indent-line-function) #'meta-indent-line) + (setq-local comment-indent-function #'meta-comment-indent) + (setq-local indent-line-function #'meta-indent-line) ;; No need to define a mode-specific 'indent-region-function. ;; Simply use the generic 'indent-region and 'comment-region. ;; Set defaults for font-lock mode. - (set (make-local-variable 'font-lock-defaults) - '(meta-font-lock-keywords - nil nil ((?_ . "w")) nil - (font-lock-comment-start-regexp . "%")))) + (setq-local font-lock-defaults + '(meta-font-lock-keywords + nil nil ((?_ . "w")) nil + (font-lock-comment-start-regexp . "%")))) ;;;###autoload (define-derived-mode metafont-mode meta-common-mode "Metafont" "Major mode for editing Metafont sources." ;; Set defaults for completion function. - (set (make-local-variable 'meta-symbol-list) nil) - (set (make-local-variable 'meta-symbol-changed) nil) + (setq-local meta-symbol-list nil) + (setq-local meta-symbol-changed nil) (apply 'meta-add-symbols metafont-symbol-list) - (set (make-local-variable 'meta-complete-list) - (list (list "\\<\\(\\sw+\\)" 1 'meta-symbol-list) - (list "" 'ispell-complete-word)))) + (setq-local meta-complete-list + (list (list "\\<\\(\\sw+\\)" 1 'meta-symbol-list) + (list "" 'ispell-complete-word)))) ;;;###autoload (define-derived-mode metapost-mode meta-common-mode "MetaPost" "Major mode for editing MetaPost sources." ;; Set defaults for completion function. - (set (make-local-variable 'meta-symbol-list) nil) - (set (make-local-variable 'meta-symbol-changed) nil) + (setq-local meta-symbol-list nil) + (setq-local meta-symbol-changed nil) (apply 'meta-add-symbols metapost-symbol-list) - (set (make-local-variable 'meta-complete-list) - (list (list "\\<\\(\\sw+\\)" 1 'meta-symbol-list) - (list "" 'ispell-complete-word)))) + (setq-local meta-complete-list + (list (list "\\<\\(\\sw+\\)" 1 'meta-symbol-list) + (list "" 'ispell-complete-word)))) ;;; Just in case ... commit f33ce525b1788ae9f99269ca2eaec19319a0e6c1 Author: Stefan Kangas Date: Mon Dec 7 16:51:52 2020 +0100 Prefer setq-local in compile.el * lisp/progmodes/compile.el (compile-command, compilation-start) (compilation-mode, compilation-setup, compilation-filter) (compilation-forget-errors): Prefer setq-local. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 1b7e1b9dac..310b332fa8 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -807,7 +807,7 @@ You might also use mode hooks to specify it in certain modes, like this: (lambda () (unless (or (file-exists-p \"makefile\") (file-exists-p \"Makefile\")) - (set (make-local-variable \\='compile-command) + (setq-local compile-command (concat \"make -k \" (if buffer-file-name (shell-quote-argument @@ -1839,14 +1839,13 @@ Returns the compilation buffer created." ;; default-directory' can't be used reliably for that because it may be ;; affected by the special handling of "cd ...;". ;; NB: must be done after (funcall mode) as that resets local variables - (set (make-local-variable 'compilation-directory) thisdir) - (set (make-local-variable 'compilation-environment) thisenv) + (setq-local compilation-directory thisdir) + (setq-local compilation-environment thisenv) (if highlight-regexp - (set (make-local-variable 'compilation-highlight-regexp) - highlight-regexp)) + (setq-local compilation-highlight-regexp highlight-regexp)) (if (or compilation-auto-jump-to-first-error (eq compilation-scroll-output 'first-error)) - (set (make-local-variable 'compilation-auto-jump-to-next) t)) + (setq-local compilation-auto-jump-to-next t)) ;; Output a mode setter, for saving and later reloading this buffer. (insert "-*- mode: " name-of-mode "; default-directory: " @@ -1872,10 +1871,9 @@ Returns the compilation buffer created." (comint-term-environment)) (list (format "INSIDE_EMACS=%s,compile" emacs-version)) (copy-sequence process-environment)))) - (set (make-local-variable 'compilation-arguments) - (list command mode name-function highlight-regexp)) - (set (make-local-variable 'revert-buffer-function) - 'compilation-revert-buffer) + (setq-local compilation-arguments + (list command mode name-function highlight-regexp)) + (setq-local revert-buffer-function 'compilation-revert-buffer) (and outwin ;; Forcing the window-start overrides the usual redisplay ;; feature of bringing point into view, so setting the @@ -2180,20 +2178,19 @@ Runs `compilation-mode-hook' with `run-mode-hooks' (which see). (kill-all-local-variables) (use-local-map compilation-mode-map) ;; Let windows scroll along with the output. - (set (make-local-variable 'window-point-insertion-type) t) - (set (make-local-variable 'tool-bar-map) compilation-mode-tool-bar-map) + (setq-local window-point-insertion-type t) + (setq-local tool-bar-map compilation-mode-tool-bar-map) (setq major-mode 'compilation-mode ; FIXME: Use define-derived-mode. mode-name (or name-of-mode "Compilation")) - (set (make-local-variable 'page-delimiter) - compilation-page-delimiter) - ;; (set (make-local-variable 'compilation-buffer-modtime) nil) + (setq-local page-delimiter compilation-page-delimiter) + ;; (setq-local compilation-buffer-modtime nil) (compilation-setup) ;; Turn off deferred fontifications in the compilation buffer, if ;; the user turned them on globally. This is because idle timers ;; aren't re-run after receiving input from a subprocess, so the ;; buffer is left unfontified after the compilation exits, until ;; some other input event happens. - (set (make-local-variable 'jit-lock-defer-time) nil) + (setq-local jit-lock-defer-time nil) (setq buffer-read-only t) (run-mode-hooks 'compilation-mode-hook)) @@ -2263,7 +2260,7 @@ Optional argument MINOR indicates this is called from (setq-local compilation-num-errors-found 0) (setq-local compilation-num-warnings-found 0) (setq-local compilation-num-infos-found 0) - (set (make-local-variable 'overlay-arrow-string) "") + (setq-local overlay-arrow-string "") (setq next-error-overlay-arrow-position nil) (add-hook 'kill-buffer-hook (lambda () (setq next-error-overlay-arrow-position nil)) nil t) @@ -2271,10 +2268,10 @@ Optional argument MINOR indicates this is called from ;; with the next-error function in simple.el, and it's only ;; coincidentally named similarly to compilation-next-error. (setq next-error-function 'compilation-next-error-function) - (set (make-local-variable 'comint-file-name-prefix) - (or (file-remote-p default-directory) "")) - (set (make-local-variable 'compilation-locs) - (make-hash-table :test 'equal :weakness 'value)) + (setq-local comint-file-name-prefix + (or (file-remote-p default-directory) "")) + (setq-local compilation-locs + (make-hash-table :test 'equal :weakness 'value)) ;; It's generally preferable to use after-change-functions since they ;; can be subject to combine-after-change-calls, but if we do that, we risk ;; running our hook after font-lock, resulting in incorrect refontification. @@ -2412,8 +2409,7 @@ and runs `compilation-filter-hook'." (set-marker (process-mark proc) (point)) ;; Update the number of errors in compilation-mode-line-errors (compilation--ensure-parse (point)) - ;; (set (make-local-variable 'compilation-buffer-modtime) - ;; (current-time)) + ;; (setq-local compilation-buffer-modtime (current-time)) (run-hooks 'compilation-filter-hook)) (goto-char pos) (narrow-to-region min max) @@ -3167,9 +3163,9 @@ TRUE-DIRNAME is the `file-truename' of DIRNAME, if given." ;; Again, since this command is used in buffers that contain several ;; compilations, to set the beginning of "this compilation", it's a good ;; place to reset compilation-auto-jump-to-next. - (set (make-local-variable 'compilation-auto-jump-to-next) - (or compilation-auto-jump-to-first-error - (eq compilation-scroll-output 'first-error)))) + (setq-local compilation-auto-jump-to-next + (or compilation-auto-jump-to-first-error + (eq compilation-scroll-output 'first-error)))) (provide 'compile) commit 1c75ca109d94b4a0edfe553d435ede16b9c41c02 Author: Stefan Kangas Date: Tue Dec 8 09:19:51 2020 +0100 * admin/nt/dist-build/build-dep-zips.py: Remove unused import. diff --git a/admin/nt/dist-build/build-dep-zips.py b/admin/nt/dist-build/build-dep-zips.py index 7047d28346..bc5f65f085 100755 --- a/admin/nt/dist-build/build-dep-zips.py +++ b/admin/nt/dist-build/build-dep-zips.py @@ -18,7 +18,6 @@ ## along with GNU Emacs. If not, see . import argparse import multiprocessing as mp -import glob import os import shutil import re commit 3b20c0331693e915a3d52d1b99c570d9816db015 Author: Stefan Kangas Date: Tue Dec 8 08:57:22 2020 +0100 Prefer setq-local in tests * test/lisp/allout-tests.el (allout-test-resumption-prior-value-resumed) (allout-test-resumption-multiple-holds) (allout-test-resumption-unbinding): * test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el (faceup-test-mode): * test/lisp/epg-tests.el (with-epg-tests): * test/src/data-tests.el (binding-test-buffer-A): Prefer setq-local. diff --git a/test/lisp/allout-tests.el b/test/lisp/allout-tests.el index f7cd6db9cd..c979d085c8 100644 --- a/test/lisp/allout-tests.el +++ b/test/lisp/allout-tests.el @@ -74,7 +74,7 @@ "Ensure that prior local value is resumed." (with-temp-buffer (allout-tests-obliterate-variable 'allout-tests-locally-true) - (set (make-local-variable 'allout-tests-locally-true) t) + (setq-local allout-tests-locally-true t) (cl-assert (not (default-boundp 'allout-tests-locally-true)) nil (concat "Test setup mistake -- variable supposed to" " not have global binding, but it does.")) @@ -98,7 +98,7 @@ (allout-tests-obliterate-variable 'allout-tests-globally-true) (setq allout-tests-globally-true t) (allout-tests-obliterate-variable 'allout-tests-locally-true) - (set (make-local-variable 'allout-tests-locally-true) t) + (setq-local allout-tests-locally-true t) (allout-add-resumptions '(allout-tests-globally-unbound t) '(allout-tests-globally-true nil) '(allout-tests-locally-true nil)) @@ -135,7 +135,7 @@ (allout-tests-obliterate-variable 'allout-tests-globally-true) (setq allout-tests-globally-true t) (allout-tests-obliterate-variable 'allout-tests-locally-true) - (set (make-local-variable 'allout-tests-locally-true) t) + (setq-local allout-tests-locally-true t) (allout-add-resumptions '(allout-tests-globally-unbound t) '(allout-tests-globally-true nil) '(allout-tests-locally-true nil)) diff --git a/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el b/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el index c77f2dc499..6e9d50fc38 100644 --- a/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el +++ b/test/lisp/emacs-lisp/faceup-resources/faceup-test-mode.el @@ -67,8 +67,8 @@ If `prog-mode' is defined, inherit from it." (faceup-test-define-prog-mode faceup-test-mode "faceup-test" "Dummy major mode for testing `faceup', a test system for font-lock." - (set (make-local-variable 'syntax-propertize-function) - #'faceup-test-syntax-propertize) + (setq-local syntax-propertize-function + #'faceup-test-syntax-propertize) (setq font-lock-defaults '(faceup-test-font-lock-keywords nil))) (provide 'faceup-test-mode) diff --git a/test/lisp/epg-tests.el b/test/lisp/epg-tests.el index c9c92f529b..87d19e8b29 100644 --- a/test/lisp/epg-tests.el +++ b/test/lisp/epg-tests.el @@ -96,8 +96,7 @@ context (ert-resource-file "seckey.asc"))) (with-temp-buffer - (make-local-variable 'epg-tests-context) - (setq epg-tests-context context) + (setq-local epg-tests-context context) ,@body)) (when (file-directory-p epg-tests-home-directory) (delete-directory epg-tests-home-directory t))))) diff --git a/test/src/data-tests.el b/test/src/data-tests.el index 1312683c84..c5fc3eaa11 100644 --- a/test/src/data-tests.el +++ b/test/src/data-tests.el @@ -324,7 +324,7 @@ comparing the subr with a much slower lisp implementation." (defvar binding-test-some-local 'some) (with-current-buffer binding-test-buffer-A - (set (make-local-variable 'binding-test-some-local) 'local)) + (setq-local binding-test-some-local 'local)) (ert-deftest binding-test-manual () "A test case from the elisp manual." commit 9e7b93f2da8ef3676fb9923278ee1e721dfc17d9 Author: Stefan Kangas Date: Tue Dec 8 08:52:57 2020 +0100 Prefer setq-local in term.el * lisp/term.el (term-mode, term-exec, term-emulate-terminal) (term-process-pager): Prefer setq-local. diff --git a/lisp/term.el b/lisp/term.el index 34dc2870f2..545185064d 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -1005,12 +1005,12 @@ Entry to this mode runs the hooks on `term-mode-hook'." ;; we do not want indent to sneak in any tabs (setq indent-tabs-mode nil) (setq buffer-display-table term-display-table) - (set (make-local-variable 'term-home-marker) (copy-marker 0)) - (set (make-local-variable 'term-height) (floor (window-screen-lines))) - (set (make-local-variable 'term-width) (window-max-chars-per-line)) - (set (make-local-variable 'term-last-input-start) (make-marker)) - (set (make-local-variable 'term-last-input-end) (make-marker)) - (set (make-local-variable 'term-last-input-match) "") + (setq-local term-home-marker (copy-marker 0)) + (setq-local term-height (floor (window-screen-lines))) + (setq-local term-width (window-max-chars-per-line)) + (setq-local term-last-input-start (make-marker)) + (setq-local term-last-input-end (make-marker)) + (setq-local term-last-input-match "") ;; These local variables are set to their local values: (make-local-variable 'term-saved-home-marker) @@ -1028,9 +1028,9 @@ Entry to this mode runs the hooks on `term-mode-hook'." ;; a properly configured ange-ftp, I've decided to be conservative ;; and put them in. -mm - (set (make-local-variable 'term-ansi-at-host) (system-name)) - (set (make-local-variable 'term-ansi-at-dir) default-directory) - (set (make-local-variable 'term-ansi-at-message) nil) + (setq-local term-ansi-at-host (system-name)) + (setq-local term-ansi-at-dir default-directory) + (setq-local term-ansi-at-message nil) ;; For user tracking purposes -mm (make-local-variable 'ange-ftp-default-user) @@ -1073,15 +1073,15 @@ Entry to this mode runs the hooks on `term-mode-hook'." (make-local-variable 'term-scroll-to-bottom-on-output) (make-local-variable 'term-scroll-show-maximum-output) (make-local-variable 'term-ptyp) - (set (make-local-variable 'term-vertical-motion) 'vertical-motion) - (set (make-local-variable 'term-pending-delete-marker) (make-marker)) + (setq-local term-vertical-motion 'vertical-motion) + (setq-local term-pending-delete-marker (make-marker)) (make-local-variable 'term-current-face) (term-ansi-reset) - (set (make-local-variable 'term-pending-frame) nil) + (setq-local term-pending-frame nil) ;; Cua-mode's keybindings interfere with the term keybindings, disable it. - (set (make-local-variable 'cua-mode) nil) + (setq-local cua-mode nil) - (set (make-local-variable 'font-lock-defaults) '(nil t)) + (setq-local font-lock-defaults '(nil t)) (add-function :filter-return (local 'filter-buffer-substring-function) @@ -1423,8 +1423,7 @@ buffer. The hook `term-exec-hook' is run after each exec." (when proc (delete-process proc))) ;; Crank up a new process (let ((proc (term-exec-1 name buffer command switches))) - (make-local-variable 'term-ptyp) - (setq term-ptyp process-connection-type) ; t if pty, nil if pipe. + (setq-local term-ptyp process-connection-type) ; t if pty, nil if pipe. ;; Jump to the end, and set the process mark. (goto-char (point-max)) (set-marker (process-mark proc) (point)) @@ -3067,8 +3066,7 @@ See `term-prompt-regexp'." (aset term-terminal-undecoded-bytes 0 ?\r)) (goto-char (point-max))) ;; FIXME: Use (add-function :override (process-filter proc) - (make-local-variable 'term-pager-old-filter) - (setq term-pager-old-filter (process-filter proc)) + (setq-local term-pager-old-filter (process-filter proc)) ;; FIXME: Where is `term-pager-filter' set to a function?! (set-process-filter proc term-pager-filter) (setq i str-length)) @@ -3537,8 +3535,7 @@ The top-most line is line 0." ;; (stop-process process)) (setq term-pager-old-local-map (current-local-map)) (use-local-map term-pager-break-map) - (make-local-variable 'term-old-mode-line-format) - (setq term-old-mode-line-format mode-line-format) + (setq-local term-old-mode-line-format mode-line-format) (setq mode-line-format (list "-- **MORE** " mode-line-buffer-identification commit 095a41ed896304c668bf98eae7e472e237fe49be Author: Stefan Kangas Date: Tue Dec 8 08:50:54 2020 +0100 Prefer setq-local in shell.el * lisp/shell.el (shell-completion-vars, shell-mode): Prefer setq-local. diff --git a/lisp/shell.el b/lisp/shell.el index 5fed6513b9..5cc9a189c7 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -471,32 +471,32 @@ Shell buffers. It implements `shell-completion-execonly' for (defun shell-completion-vars () "Setup completion vars for `shell-mode' and `read-shell-command'." - (set (make-local-variable 'comint-completion-fignore) - shell-completion-fignore) - (set (make-local-variable 'comint-delimiter-argument-list) - shell-delimiter-argument-list) - (set (make-local-variable 'comint-file-name-chars) shell-file-name-chars) - (set (make-local-variable 'comint-file-name-quote-list) - shell-file-name-quote-list) - (set (make-local-variable 'comint-file-name-prefix) - (or (file-remote-p default-directory) "")) - (set (make-local-variable 'comint-dynamic-complete-functions) - shell-dynamic-complete-functions) + (setq-local comint-completion-fignore + shell-completion-fignore) + (setq-local comint-delimiter-argument-list + shell-delimiter-argument-list) + (setq-local comint-file-name-chars shell-file-name-chars) + (setq-local comint-file-name-quote-list + shell-file-name-quote-list) + (setq-local comint-file-name-prefix + (or (file-remote-p default-directory) "")) + (setq-local comint-dynamic-complete-functions + shell-dynamic-complete-functions) (setq-local comint-unquote-function #'shell--unquote-argument) (setq-local comint-requote-function #'shell--requote-argument) - (set (make-local-variable 'pcomplete-parse-arguments-function) - #'shell--parse-pcomplete-arguments) - (set (make-local-variable 'pcomplete-termination-string) - (cond ((not comint-completion-addsuffix) "") - ((stringp comint-completion-addsuffix) - comint-completion-addsuffix) - ((not (consp comint-completion-addsuffix)) " ") - (t (cdr comint-completion-addsuffix)))) - (set (make-local-variable 'pcomplete-command-completion-function) - #'shell-command-completion-function) + (setq-local pcomplete-parse-arguments-function + #'shell--parse-pcomplete-arguments) + (setq-local pcomplete-termination-string + (cond ((not comint-completion-addsuffix) "") + ((stringp comint-completion-addsuffix) + comint-completion-addsuffix) + ((not (consp comint-completion-addsuffix)) " ") + (t (cdr comint-completion-addsuffix)))) + (setq-local pcomplete-command-completion-function + #'shell-command-completion-function) ;; Don't use pcomplete's defaulting mechanism, rely on ;; shell-dynamic-complete-functions instead. - (set (make-local-variable 'pcomplete-default-completion-function) #'ignore) + (setq-local pcomplete-default-completion-function #'ignore) (setq-local comint-input-autoexpand shell-input-autoexpand) ;; Not needed in shell-mode because it's inherited from comint-mode, but ;; placed here for read-shell-command. @@ -596,7 +596,7 @@ buffer." (and (stringp hsize) (integerp (setq hsize (string-to-number hsize))) (> hsize 0) - (set (make-local-variable 'comint-input-ring-size) hsize)) + (setq-local comint-input-ring-size hsize)) (setq comint-input-ring-file-name (concat remote commit db001f8dab605d2dc1512ecada78745d67e7eb46 Author: Stefan Kangas Date: Tue Dec 8 08:36:28 2020 +0100 Prefer setq-local in speedbar.el * lisp/speedbar.el (speedbar-frame-mode, speedbar-mode) (speedbar-add-localized-speedbar-support): Prefer setq-local. diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 34687805b5..e2cfe9861a 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -979,10 +979,9 @@ supported at a time. (speedbar-set-timer dframe-update-speed) ) ;; Frame modifications - (set (make-local-variable 'dframe-delete-frame-function) - 'speedbar-handle-delete-frame) + (setq-local dframe-delete-frame-function 'speedbar-handle-delete-frame) ;; hscroll - (set (make-local-variable 'auto-hscroll-mode) nil) + (setq-local auto-hscroll-mode nil) ;; reset the selection variable (setq speedbar-last-selected-file nil)) @@ -1075,9 +1074,8 @@ in the selected file. (save-excursion (setq font-lock-keywords nil) ;; no font-locking please (setq truncate-lines t) - (make-local-variable 'frame-title-format) - (setq frame-title-format "Speedbar" - case-fold-search nil + (setq-local frame-title-format "Speedbar") + (setq case-fold-search nil buffer-read-only t) (speedbar-set-mode-line-format) ;; Add in our dframe hooks. @@ -1814,16 +1812,13 @@ of the special mode functions." (setq v (intern-soft (concat ms "-speedbar-key-map"))) (if (not v) nil ;; don't add special keymap - (make-local-variable 'speedbar-special-mode-key-map) - (setq speedbar-special-mode-key-map - (symbol-value v))) + (setq-local speedbar-special-mode-key-map + (symbol-value v))) (setq v (intern-soft (concat ms "-speedbar-menu-items"))) (if (not v) nil ;; don't add special menus - (make-local-variable 'speedbar-easymenu-definition-special) - (setq speedbar-easymenu-definition-special - (symbol-value v))) - ))))))) + (setq-local speedbar-easymenu-definition-special + (symbol-value v)))))))))) (defun speedbar-remove-localized-speedbar-support (buffer) "Remove any traces that BUFFER supports speedbar in a specialized way." commit 6614b67d9ed6ad1ad467fe9e5b27f566612a5015 Author: Stefan Kangas Date: Tue Dec 8 08:27:20 2020 +0100 Prefer setq-local in newcomment.el * lisp/newcomment.el (comment-inline-offset) (comment-normalize-vars): Prefer setq-local. diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 3eb158dc2c..5d318bbd2e 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -304,7 +304,7 @@ This is useful when style-conventions require a certain minimal offset. Python's PEP8 for example recommends two spaces, so you could do: \(add-hook \\='python-mode-hook - (lambda () (set (make-local-variable \\='comment-inline-offset) 2))) + (lambda () (setq-local comment-inline-offset 2))) See `comment-padding' for whole-line comments." :version "24.3" @@ -361,21 +361,21 @@ function should first call this function explicitly." (let ((cs (read-string "No comment syntax is defined. Use: "))) (if (zerop (length cs)) (error "No comment syntax defined") - (set (make-local-variable 'comment-start) cs) - (set (make-local-variable 'comment-start-skip) cs)))) + (setq-local comment-start cs) + (setq-local comment-start-skip cs)))) ;; comment-use-syntax (when (eq comment-use-syntax 'undecided) - (set (make-local-variable 'comment-use-syntax) - (let ((st (syntax-table)) - (cs comment-start) - (ce (if (string= "" comment-end) "\n" comment-end))) - ;; Try to skip over a comment using forward-comment - ;; to see if the syntax tables properly recognize it. - (with-temp-buffer - (set-syntax-table st) - (insert cs " hello " ce) - (goto-char (point-min)) - (and (forward-comment 1) (eobp)))))) + (setq-local comment-use-syntax + (let ((st (syntax-table)) + (cs comment-start) + (ce (if (string= "" comment-end) "\n" comment-end))) + ;; Try to skip over a comment using forward-comment + ;; to see if the syntax tables properly recognize it. + (with-temp-buffer + (set-syntax-table st) + (insert cs " hello " ce) + (goto-char (point-min)) + (and (forward-comment 1) (eobp)))))) ;; comment-padding (unless comment-padding (setq comment-padding 0)) (when (integerp comment-padding) @@ -385,9 +385,9 @@ function should first call this function explicitly." ;;(setq comment-end (comment-string-strip comment-end nil t)) ;; comment-continue (unless (or comment-continue (string= comment-end "")) - (set (make-local-variable 'comment-continue) - (concat (if (string-match "\\S-\\S-" comment-start) " " "|") - (substring comment-start 1))) + (setq-local comment-continue + (concat (if (string-match "\\S-\\S-" comment-start) " " "|") + (substring comment-start 1))) ;; Hasn't been necessary yet. ;; (unless (string-match comment-start-skip comment-continue) ;; (kill-local-variable 'comment-continue)) @@ -396,29 +396,29 @@ function should first call this function explicitly." (unless (and comment-start-skip ;; In case comment-start has changed since last time. (string-match comment-start-skip comment-start)) - (set (make-local-variable 'comment-start-skip) - (concat (unless (eq comment-use-syntax t) - ;; `syntax-ppss' will detect escaping. - "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)") - "\\(?:\\s<+\\|" - (regexp-quote (comment-string-strip comment-start t t)) - ;; Let's not allow any \s- but only [ \t] since \n - ;; might be both a comment-end marker and \s-. - "+\\)[ \t]*"))) + (setq-local comment-start-skip + (concat (unless (eq comment-use-syntax t) + ;; `syntax-ppss' will detect escaping. + "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)") + "\\(?:\\s<+\\|" + (regexp-quote (comment-string-strip comment-start t t)) + ;; Let's not allow any \s- but only [ \t] since \n + ;; might be both a comment-end marker and \s-. + "+\\)[ \t]*"))) (unless (and comment-end-skip ;; In case comment-end has changed since last time. (string-match comment-end-skip (if (string= "" comment-end) "\n" comment-end))) (let ((ce (if (string= "" comment-end) "\n" (comment-string-strip comment-end t t)))) - (set (make-local-variable 'comment-end-skip) - ;; We use [ \t] rather than \s- because we don't want to - ;; remove ^L in C mode when uncommenting. - (concat "[ \t]*\\(\\s>" (if comment-quote-nested "" "+") - "\\|" (regexp-quote (substring ce 0 1)) - (if (and comment-quote-nested (<= (length ce) 1)) "" "+") - (regexp-quote (substring ce 1)) - "\\)")))))) + (setq-local comment-end-skip + ;; We use [ \t] rather than \s- because we don't want to + ;; remove ^L in C mode when uncommenting. + (concat "[ \t]*\\(\\s>" (if comment-quote-nested "" "+") + "\\|" (regexp-quote (substring ce 0 1)) + (if (and comment-quote-nested (<= (length ce) 1)) "" "+") + (regexp-quote (substring ce 1)) + "\\)")))))) (defun comment-quote-re (str unp) (concat (regexp-quote (substring str 0 1)) commit 07b317cb4cd31686247732f7e9e51c4370009a0e Author: Stefan Kangas Date: Tue Dec 8 08:25:19 2020 +0100 * lisp/locate.el (locate, locate-mode): Prefer setq-local. diff --git a/lisp/locate.el b/lisp/locate.el index 44a67ab484..14fd260803 100644 --- a/lisp/locate.el +++ b/lisp/locate.el @@ -319,9 +319,9 @@ then `locate-post-command-hook'." (erase-buffer) (setq locate-current-filter filter) - (set (make-local-variable 'locate-local-search) search-string) - (set (make-local-variable 'locate-local-filter) filter) - (set (make-local-variable 'locate-local-prompt) run-locate-command) + (setq-local locate-local-search search-string) + (setq-local locate-local-filter filter) + (setq-local locate-local-prompt run-locate-command) (if run-locate-command (shell-command search-string locate-buffer-name) @@ -467,8 +467,8 @@ do not work in subdirectories. buffer-read-only t) (add-to-invisibility-spec '(dired . t)) (dired-alist-add-1 default-directory (point-min-marker)) - (set (make-local-variable 'dired-directory) "/") - (set (make-local-variable 'dired-subdir-switches) locate-ls-subdir-switches) + (setq-local dired-directory "/") + (setq-local dired-subdir-switches locate-ls-subdir-switches) (setq dired-switches-alist nil) ;; This should support both Unix and Windoze style names (setq-local directory-listing-before-filename-regexp commit 0d6fca30937c91b64c5626b5ea1ef4629de3c1eb Author: Stefan Kangas Date: Tue Dec 8 08:20:40 2020 +0100 * lisp/array.el (array-mode): Prefer setq-local. diff --git a/lisp/array.el b/lisp/array.el index 0d1ac74432..0ad565b5bc 100644 --- a/lisp/array.el +++ b/lisp/array.el @@ -863,25 +863,25 @@ Entering array mode calls the function `array-mode-hook'." (make-local-variable 'array-row) (make-local-variable 'array-column) (make-local-variable 'array-copy-string) - (set (make-local-variable 'array-respect-tabs) nil) - (set (make-local-variable 'array-max-row) - (read-number "Number of array rows: ")) - (set (make-local-variable 'array-max-column) - (read-number "Number of array columns: ")) - (set (make-local-variable 'array-columns-per-line) - (read-number "Array columns per line: ")) - (set (make-local-variable 'array-field-width) - (read-number "Field width: ")) - (set (make-local-variable 'array-rows-numbered) - (y-or-n-p "Rows numbered? ")) - (set (make-local-variable 'array-line-length) - (* array-field-width array-columns-per-line)) - (set (make-local-variable 'array-lines-per-row) - (+ (floor (1- array-max-column) array-columns-per-line) - (if array-rows-numbered 2 1))) + (setq-local array-respect-tabs nil) + (setq-local array-max-row + (read-number "Number of array rows: ")) + (setq-local array-max-column + (read-number "Number of array columns: ")) + (setq-local array-columns-per-line + (read-number "Array columns per line: ")) + (setq-local array-field-width + (read-number "Field width: ")) + (setq-local array-rows-numbered + (y-or-n-p "Rows numbered? ")) + (setq-local array-line-length + (* array-field-width array-columns-per-line)) + (setq-local array-lines-per-row + (+ (floor (1- array-max-column) array-columns-per-line) + (if array-rows-numbered 2 1))) (message "") (force-mode-line-update) - (set (make-local-variable 'truncate-lines) t) + (setq-local truncate-lines t) (setq overwrite-mode 'overwrite-mode-textual)) commit 478368ad4fe43b02b8a7e91c7dbec1ac1afc4d68 Author: Stefan Kangas Date: Tue Dec 8 08:18:59 2020 +0100 Prefer setq-local in simple.el * lisp/simple.el (read-extended-command, goto-history-element) (minibuffer-history-isearch-setup, read-shell-command) (visual-line-mode, completion-setup-function, read-only-mode) (visible-mode): Prefer setq-local. diff --git a/lisp/simple.el b/lisp/simple.el index 3c4f756230..dd271b0b5d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1922,7 +1922,7 @@ to get different commands to edit and resubmit." (setq execute-extended-command--last-typed (minibuffer-contents))) nil 'local) - (set (make-local-variable 'minibuffer-default-add-function) + (setq-local minibuffer-default-add-function (lambda () ;; Get a command name at point in the original buffer ;; to propose it after M-n. @@ -2372,10 +2372,10 @@ negative number -N means the Nth entry of \"future history.\"" (unless (memq last-command '(next-history-element previous-history-element)) (let ((prompt-end (minibuffer-prompt-end))) - (set (make-local-variable 'minibuffer-temporary-goal-position) - (cond ((<= (point) prompt-end) prompt-end) - ((eobp) nil) - (t (point)))))) + (setq-local minibuffer-temporary-goal-position + (cond ((<= (point) prompt-end) prompt-end) + ((eobp) nil) + (t (point)))))) (goto-char (point-max)) (delete-minibuffer-contents) (setq minibuffer-history-position nabs) @@ -2548,14 +2548,14 @@ Return 0 if current buffer is not a minibuffer." (defun minibuffer-history-isearch-setup () "Set up a minibuffer for using isearch to search the minibuffer history. Intended to be added to `minibuffer-setup-hook'." - (set (make-local-variable 'isearch-search-fun-function) - 'minibuffer-history-isearch-search) - (set (make-local-variable 'isearch-message-function) - 'minibuffer-history-isearch-message) - (set (make-local-variable 'isearch-wrap-function) - 'minibuffer-history-isearch-wrap) - (set (make-local-variable 'isearch-push-state-function) - 'minibuffer-history-isearch-push-state) + (setq-local isearch-search-fun-function + #'minibuffer-history-isearch-search) + (setq-local isearch-message-function + #'minibuffer-history-isearch-message) + (setq-local isearch-wrap-function + #'minibuffer-history-isearch-wrap) + (setq-local isearch-push-state-function + #'minibuffer-history-isearch-push-state) (add-hook 'isearch-mode-end-hook 'minibuffer-history-isearch-end nil t)) (defun minibuffer-history-isearch-end () @@ -3585,8 +3585,8 @@ to `shell-command-history'." (minibuffer-with-setup-hook (lambda () (shell-completion-vars) - (set (make-local-variable 'minibuffer-default-add-function) - 'minibuffer-default-add-shell-commands)) + (setq-local minibuffer-default-add-function + #'minibuffer-default-add-shell-commands)) (apply #'read-from-minibuffer prompt initial-contents minibuffer-local-shell-command-map nil @@ -7431,8 +7431,8 @@ Mode' for details." (if (local-variable-p var) (push (cons var (symbol-value var)) visual-line--saved-state)))) - (set (make-local-variable 'line-move-visual) t) - (set (make-local-variable 'truncate-partial-width-windows) nil) + (setq-local line-move-visual t) + (setq-local truncate-partial-width-windows nil) (setq truncate-lines nil word-wrap t fringe-indicator-alist @@ -8825,10 +8825,9 @@ Called from `temp-buffer-show-hook'." (let ((base-position completion-base-position) (insert-fun completion-list-insert-choice-function)) (completion-list-mode) - (set (make-local-variable 'completion-base-position) base-position) - (set (make-local-variable 'completion-list-insert-choice-function) - insert-fun)) - (set (make-local-variable 'completion-reference-buffer) mainbuf) + (setq-local completion-base-position base-position) + (setq-local completion-list-insert-choice-function insert-fun)) + (setq-local completion-reference-buffer mainbuf) (if base-dir (setq default-directory base-dir)) (when completion-tab-width (setq tab-width completion-tab-width)) @@ -9288,8 +9287,7 @@ to a non-nil value." (cond ((and (not buffer-read-only) view-mode) (View-exit-and-edit) - (make-local-variable 'view-read-only) - (setq view-read-only t)) ; Must leave view mode. + (setq-local view-read-only t)) ; Must leave view mode. ((and buffer-read-only view-read-only ;; If view-mode is already active, `view-mode-enter' is a nop. (not view-mode) @@ -9307,8 +9305,8 @@ and setting it to nil." (setq buffer-invisibility-spec vis-mode-saved-buffer-invisibility-spec) (kill-local-variable 'vis-mode-saved-buffer-invisibility-spec)) (when visible-mode - (set (make-local-variable 'vis-mode-saved-buffer-invisibility-spec) - buffer-invisibility-spec) + (setq-local vis-mode-saved-buffer-invisibility-spec + buffer-invisibility-spec) (setq buffer-invisibility-spec nil))) (defvar messages-buffer-mode-map commit 0155bd0fdb166c97a2ce76cc5bc64fd195a676d3 Author: Philipp Stephani Date: Mon Dec 7 21:41:40 2020 +0100 Fix bug in how ERT invokes its debugger. The debugger needs to receive a list of the error symbol and data; cf. the documentation of the `debugger' variable. This bug manifested itself in ERT forms such as (should (integerp (ert-fail "Boo"))), which resulted in an incorrect condition object. Note that forms such as (should (ert-fail "Boo")) weren't affected because they wouldn't use the `ert--should-signal-hook'. * test/emacs-lisp/ert.el (ert--should-signal-hook): Call debugger with the right arguments. * test/lisp/emacs-lisp/ert-tests.el (ert-test-fail-inside-should): Add unit test. diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 5f29c2665a..25237feae2 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -274,7 +274,7 @@ DATA is displayed to the user and should state the reason for skipping." It should only be stopped when ran from inside ert--run-test-internal." (when (and (not (symbolp debugger)) ; only run on anonymous debugger (memq error-symbol '(ert-test-failed ert-test-skipped))) - (funcall debugger 'error data))) + (funcall debugger 'error (list error-symbol data)))) (defun ert--special-operator-p (thing) "Return non-nil if THING is a symbol naming a special operator." diff --git a/test/lisp/emacs-lisp/ert-tests.el b/test/lisp/emacs-lisp/ert-tests.el index 1f54c8d07e..a0c56be0cb 100644 --- a/test/lisp/emacs-lisp/ert-tests.el +++ b/test/lisp/emacs-lisp/ert-tests.el @@ -806,6 +806,16 @@ This macro is used to test if macroexpansion in `should' works." :expected-result :failed ;; FIXME! Bug#11218 (should-not (with-demoted-errors (error "Foo")))) +(ert-deftest ert-test-fail-inside-should () + "Check that `ert-fail' inside `should' works correctly." + (let ((result (ert-run-test + (make-ert-test + :name 'test-1 + :body (lambda () (should (integerp (ert-fail "Boo")))))))) + (should (ert-test-failed-p result)) + (should (equal (ert-test-failed-condition result) + '(ert-test-failed ("Boo")))))) + (provide 'ert-tests) commit 0c330bed24ef045732a1bfe61d20ed8328dd0b28 Author: Lars Ingebrigtsen Date: Mon Dec 7 18:53:55 2020 +0100 Avoid problems when calling desktop-read twice * lisp/desktop.el (desktop-read): Don't reload the desktop file if it's already been loaded, because the later query may lead to desktop-dirname being set to nil (bug#9765). diff --git a/lisp/desktop.el b/lisp/desktop.el index 7a7f1d07c9..4be330375d 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -1222,7 +1222,13 @@ This function is a no-op when Emacs is running in batch mode. It returns t if a desktop file was loaded, nil otherwise. \n(fn DIRNAME)" (interactive "i\nP") - (unless noninteractive + (if (or noninteractive + (and (desktop-owner) + (= (desktop-owner) (emacs-pid)))) + (message "Not reloading the desktop%s" + (if noninteractive + "" + "; already loaded")) (setq desktop-dirname (file-name-as-directory (expand-file-name commit 8b1693f689bff0ccacdd3ec8326a0860b8bc604e Author: Lars Ingebrigtsen Date: Mon Dec 7 17:26:49 2020 +0100 Make previous Fkill_emacs change safer * src/emacs.c (Fkill_emacs): Don't run `kill-emacs-hook' if it's nil. diff --git a/src/emacs.c b/src/emacs.c index fe09c446c3..2a32083ba1 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2365,10 +2365,13 @@ all of which are called before Emacs is actually killed. */ /* Fsignal calls emacs_abort () if it sees that waiting_for_input is set. */ waiting_for_input = 0; - if (noninteractive) - safe_run_hooks (Qkill_emacs_hook); - else - call1 (Qrun_hook_query_error_with_timeout, Qkill_emacs_hook); + if (!NILP (find_symbol_value (Qkill_emacs_hook))) + { + if (noninteractive) + safe_run_hooks (Qkill_emacs_hook); + else + call1 (Qrun_hook_query_error_with_timeout, Qkill_emacs_hook); + } #ifdef HAVE_X_WINDOWS /* Transfer any clipboards we own to the clipboard manager. */ commit 1537a8c86351e3225dcf30dc9402de1a5675fdca Author: Basil L. Contovounesios Date: Mon Dec 7 16:06:14 2020 +0000 ; Fix recent typos/wording in NEWS and server.el diff --git a/etc/NEWS b/etc/NEWS index c80325cb24..d796a4cdbc 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1371,11 +1371,10 @@ This new command (bound to 'C-c C-l') regenerates the current hunk. ** Miscellaneous --- -*** Errors in 'kill-emacs-hook' no longer prevents Emacs from shutting down. +*** Errors in 'kill-emacs-hook' no longer prevent Emacs from shutting down. If a function in that hook signals an error in an interactive Emacs, -the user will be prompted whether to continue or not. If the user -doesn't answer within five seconds, Emacs will continue shutting down -anyway. +the user will be prompted on whether to continue. If the user doesn't +answer within five seconds, Emacs will continue shutting down anyway. --- *** iso-transl is now preloaded. diff --git a/lisp/server.el b/lisp/server.el index 651f801a23..cd55d66a97 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -269,8 +269,8 @@ the \"-f\" switch otherwise." :version "23.1") (defcustom server-client-instructions t - "If non-nil, output instructions on how to exit the client on connection. -If non, no messaging is done." + "If non-nil, display instructions on how to exit the client on connection. +If nil, no instructions are displayed." :version "28.1" :type 'boolean) commit 6e0080e755b460adc7a1fda74e26f83cb342b6dc Author: Daniel Martín Date: Mon Dec 7 17:01:35 2020 +0100 Add commands xref-next-group and xref-prev-group * lisp/progmodes/xref.el (xref-next-group): New command that navigates to the first item of the next xref group (typically a file). (xref-prev-group): New command that navigates to the first item of the next xref group (typically a file). (xref--xref-buffer-mode-map): Bound the new commands to 'N' and 'P', respectively. * doc/emacs/maintaining.texi (Xref Commands): Document the new commands in the Emacs manual. * etc/NEWS: Announce them (bug#45089). diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 1f10b68b8a..aa4513e317 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -2199,12 +2199,22 @@ Display the reference on the current line. Move to the next reference and display it in the other window (@code{xref-next-line}). +@item N +@findex xref-next-group +Move to the first reference of the next reference group and display it +in the other window (@code{xref-next-group}). + @item p @itemx , @findex xref-prev-line Move to the previous reference and display it in the other window (@code{xref-prev-line}). +@item P +@findex xref-prev-group +Move to the first reference of the previous reference group and +display it in the other window (@code{xref-prev-group}). + @item C-o @findex xref-show-location-at-point Display the reference on the current line in the other window diff --git a/etc/NEWS b/etc/NEWS index 49d66cc449..c80325cb24 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1205,6 +1205,11 @@ So far Grep and ripgrep are supported. ripgrep seems to offer better performance in certain cases, in particular for case-insensitive searches. ++++ +*** New commands 'xref-prev-group' and 'xref-next-group'. +These commands are bound respectively to 'P' and 'N', and navigate to +the first item of the previous or next group in the "*xref*" buffer. + ** json.el --- diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 9f5fc57142..389b7cf247 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -593,6 +593,25 @@ SELECT is `quit', also quit the *xref* window." (xref--search-property 'xref-item t) (xref-show-location-at-point)) +(defun xref-next-group () + "Move to the first item of the next xref group and display its source." + (interactive) + (xref--search-property 'xref-group) + (xref--search-property 'xref-item) + (xref-show-location-at-point)) + +(defun xref-prev-group () + "Move to the first item of the previous xref group and display its source." + (interactive) + ;; Search for the xref group of the current item, provided that the + ;; point is not already in an xref group. + (unless (plist-member (text-properties-at (point)) 'xref-group) + (xref--search-property 'xref-group t)) + ;; Search for the previous xref group. + (xref--search-property 'xref-group t) + (xref--search-property 'xref-item) + (xref-show-location-at-point)) + (defun xref--item-at-point () (save-excursion (back-to-indentation) @@ -738,6 +757,8 @@ references displayed in the current *xref* buffer." (let ((map (make-sparse-keymap))) (define-key map (kbd "n") #'xref-next-line) (define-key map (kbd "p") #'xref-prev-line) + (define-key map (kbd "N") #'xref-next-group) + (define-key map (kbd "P") #'xref-prev-group) (define-key map (kbd "r") #'xref-query-replace-in-results) (define-key map (kbd "RET") #'xref-goto-xref) (define-key map (kbd "TAB") #'xref-quit-and-goto-xref) commit 13651833c73b78e509a47ab38b8c5a60134f04fc Author: Alyssa Ross Date: Mon Dec 7 16:57:31 2020 +0100 Only use the comint environment in comint-derived modes * lisp/progmodes/compile.el (compilation-start): Only use the comint environment in comint-derived modes (bug#45095). Copyright-paperwork-exempt: yes diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 787f5d5ef3..1b7e1b9dac 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1868,7 +1868,8 @@ Returns the compilation buffer created." (let ((process-environment (append compilation-environment - (comint-term-environment) + (and (derived-mode-p 'comint-mode) + (comint-term-environment)) (list (format "INSIDE_EMACS=%s,compile" emacs-version)) (copy-sequence process-environment)))) (set (make-local-variable 'compilation-arguments) commit 60cf0aa21ce618a7d2620a01977232dbe5c9c924 Author: Stefan Kangas Date: Mon Dec 7 16:45:46 2020 +0100 Prefer setq-local in calendar/*.el * lisp/calendar/calendar.el (calendar-mode): * lisp/calendar/diary-lib.el (diary-list-entries, diary-mode): (diary-fancy-display-mode): Prefer setq-local. diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index de9b1f3ff5..d262b60779 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -1788,7 +1788,7 @@ For a complete description, see the info node `Calendar/Diary'. (setq buffer-read-only t buffer-undo-list t indent-tabs-mode nil) - (set (make-local-variable 'scroll-margin) 0) ; bug#10379 + (setq-local scroll-margin 0) ; bug#10379 (calendar-update-mode-line) (make-local-variable 'calendar-mark-ring) (make-local-variable 'displayed-month) ; month in middle of window diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index fbc13f59b2..bf1e8ebf9d 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -839,7 +839,7 @@ LIST-ONLY is non-nil, in which case it just returns the list." (goto-char (point-min)) (unless list-only (let ((ol (make-overlay (point-min) (point-max) nil t nil))) - (set (make-local-variable 'diary-selective-display) t) + (setq-local diary-selective-display t) (overlay-put ol 'invisible 'diary) (overlay-put ol 'evaporate t))) (dotimes (_ number) @@ -2381,10 +2381,9 @@ return a font-lock pattern matching array of MONTHS and marking SYMBOL." ;;;###autoload (define-derived-mode diary-mode fundamental-mode "Diary" "Major mode for editing the diary file." - (set (make-local-variable 'font-lock-defaults) - '(diary-font-lock-keywords t)) - (set (make-local-variable 'comment-start) diary-comment-start) - (set (make-local-variable 'comment-end) diary-comment-end) + (setq-local font-lock-defaults '(diary-font-lock-keywords t)) + (setq-local comment-start diary-comment-start) + (setq-local comment-end diary-comment-end) (add-to-invisibility-spec '(diary . nil)) (add-hook 'after-save-hook #'diary-redraw-calendar nil t) ;; In case the file was modified externally, refresh the calendar @@ -2465,13 +2464,13 @@ Fontify the region between BEG and END, quietly unless VERBOSE is non-nil." (define-derived-mode diary-fancy-display-mode special-mode "Diary" "Major mode used while displaying diary entries using Fancy Display." - (set (make-local-variable 'font-lock-defaults) - '(diary-fancy-font-lock-keywords - t nil nil nil - (font-lock-fontify-region-function - . diary-fancy-font-lock-fontify-region-function))) - (set (make-local-variable 'minor-mode-overriding-map-alist) - (list (cons t diary-fancy-overriding-map))) + (setq-local font-lock-defaults + '(diary-fancy-font-lock-keywords + t nil nil nil + (font-lock-fontify-region-function + . diary-fancy-font-lock-fontify-region-function))) + (setq-local minor-mode-overriding-map-alist + (list (cons t diary-fancy-overriding-map))) (view-mode 1)) ;; Following code from Dave Love . commit d174a2bb23e9a4a47bcc6d6558bae8cbf81d4e46 Author: Stefan Kangas Date: Mon Dec 7 16:27:50 2020 +0100 Prefer setq-local in gnus/*.el * lisp/gnus/gnus-agent.el (gnus-agent-mode) (gnus-agent-get-undownloaded-list, gnus-agent-open-history): * lisp/gnus/gnus-art.el (gnus-article-setup-highlight-words) (gnus-article-mode, gnus-article-setup-buffer, defsubst) (gnus-article-describe-bindings, gnus-article-edit-mode): * lisp/gnus/gnus-cus.el (gnus-custom-mode, gnus-group-customize) (gnus-score-customize, gnus-agent-customize-category): * lisp/gnus/gnus-group.el (gnus-group-make-tool-bar): * lisp/gnus/gnus-msg.el (gnus-setup-message) (gnus-summary-news-other-window, gnus-configure-posting-styles): * lisp/gnus/gnus-salt.el (gnus-pick-mode, gnus-binary-mode): * lisp/gnus/gnus-score.el (gnus-score-edit-current-scores) (gnus-score-edit-file): * lisp/gnus/gnus-srvr.el (gnus-server-mode): * lisp/gnus/gnus-start.el (gnus-no-server-1) (gnus-dribble-read-file, gnus-save-newsrc-file) (gnus-gnus-to-newsrc-format): * lisp/gnus/gnus-sum.el (gnus-summary-make-tool-bar) (gnus-summary-mode, gnus-summary-setup-buffer) (gnus-select-newsgroup, gnus-summary-edit-article) (gnus-summary-setup-default-charset): * lisp/gnus/gnus-topic.el (gnus-topic-mode): * lisp/gnus/gnus-undo.el (gnus-undo-mode): * lisp/gnus/gnus.el (gnus-simplify-mode-line): * lisp/gnus/message.el (message-cite-reply-position) (message-cite-style, message-mode, message-setup-fill-variables): * lisp/gnus/mm-view.el (mm-display-inline-fontify): * lisp/gnus/mml.el (mml-mode): * lisp/gnus/nndiary.el (nndiary-open-nov): * lisp/gnus/nnfolder.el (nnfolder-save-buffer) (nnfolder-open-nov): * lisp/gnus/nnheader.el (nnheader-init-server-buffer): * lisp/gnus/nnimap.el (nnimap-make-process-buffer): * lisp/gnus/nnml.el (nnml-get-nov-buffer): Prefer setq-local. diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index 053e7ea1f6..d6802a35d0 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el @@ -454,7 +454,7 @@ manipulated as follows: (symbol-name major-mode)) (match-string 1 (symbol-name major-mode)))) (mode (intern (format "gnus-agent-%s-mode" buffer)))) - (set (make-local-variable 'gnus-agent-mode) t) + (setq-local gnus-agent-mode t) (set mode nil) (set (make-local-variable mode) t) ;; Set up the menu. @@ -1056,8 +1056,8 @@ article's mark is toggled." (defun gnus-agent-get-undownloaded-list () "Construct list of articles that have not been downloaded." (let ((gnus-command-method (gnus-find-method-for-group gnus-newsgroup-name))) - (when (set (make-local-variable 'gnus-newsgroup-agentized) - (gnus-agent-method-p gnus-command-method)) + (when (setq-local gnus-newsgroup-agentized + (gnus-agent-method-p gnus-command-method)) (let* ((alist (gnus-agent-load-alist gnus-newsgroup-name)) (headers (sort (mapcar (lambda (h) (mail-header-number h)) @@ -1440,7 +1440,7 @@ downloaded into the agent." (let ((file (gnus-agent-lib-file "history"))) (when (file-exists-p file) (nnheader-insert-file-contents file)) - (set (make-local-variable 'gnus-agent-file-name) file)))) + (setq-local gnus-agent-file-name file)))) (defun gnus-agent-close-history () (when (gnus-buffer-live-p gnus-agent-current-history) diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 7f594c9c36..5b50bcbbe1 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -3850,8 +3850,7 @@ This format is defined by the `gnus-article-time-format' variable." (unless gnus-article-emphasis-alist (let ((name (and gnus-newsgroup-name (gnus-group-real-name gnus-newsgroup-name)))) - (make-local-variable 'gnus-article-emphasis-alist) - (setq gnus-article-emphasis-alist + (setq-local gnus-article-emphasis-alist (nconc (let ((alist gnus-group-highlight-words-alist) elem highlight) (while (setq elem (pop alist)) @@ -4495,10 +4494,10 @@ commands: (when (gnus-visual-p 'article-menu 'menu) (gnus-article-make-menu-bar) (when gnus-summary-tool-bar-map - (set (make-local-variable 'tool-bar-map) gnus-summary-tool-bar-map))) + (setq-local tool-bar-map gnus-summary-tool-bar-map))) (gnus-update-format-specifications nil 'article-mode) - (set (make-local-variable 'page-delimiter) gnus-page-delimiter) - (set (make-local-variable 'gnus-page-broken) nil) + (setq-local page-delimiter gnus-page-delimiter) + (setq-local gnus-page-broken nil) (make-local-variable 'gnus-article-current-summary) (make-local-variable 'gnus-article-mime-handles) (make-local-variable 'gnus-article-decoded-p) @@ -4507,13 +4506,12 @@ commands: (make-local-variable 'gnus-article-image-alist) (make-local-variable 'gnus-article-charset) (make-local-variable 'gnus-article-ignored-charsets) - (set (make-local-variable 'bookmark-make-record-function) - 'gnus-summary-bookmark-make-record) + (setq-local bookmark-make-record-function 'gnus-summary-bookmark-make-record) ;; Prevent Emacs from displaying non-break space with ;; `nobreak-space' face. - (set (make-local-variable 'nobreak-char-display) nil) + (setq-local nobreak-char-display nil) ;; Enable `gnus-article-remove-images' to delete images shr.el renders. - (set (make-local-variable 'shr-put-image-function) 'gnus-shr-put-image) + (setq-local shr-put-image-function 'gnus-shr-put-image) (unless gnus-article-show-cursor (setq cursor-in-non-selected-windows nil)) (gnus-set-default-directory) @@ -4557,7 +4555,7 @@ commands: t))) (let ((summary gnus-summary-buffer)) (with-current-buffer name - (set (make-local-variable 'gnus-article-edit-mode) nil) + (setq-local gnus-article-edit-mode nil) (gnus-article-stop-animations) (when gnus-article-mime-handles (mm-destroy-parts gnus-article-mime-handles) @@ -4568,14 +4566,14 @@ commands: (setq buffer-read-only t) (unless (derived-mode-p 'gnus-article-mode) (gnus-article-mode)) - (set (make-local-variable 'gnus-summary-buffer) summary) + (setq-local gnus-summary-buffer summary) (setq truncate-lines gnus-article-truncate-lines) (current-buffer))) (let ((summary gnus-summary-buffer)) (with-current-buffer (gnus-get-buffer-create name) (gnus-article-mode) (setq truncate-lines gnus-article-truncate-lines) - (set (make-local-variable 'gnus-summary-buffer) summary) + (setq-local gnus-summary-buffer summary) (gnus-summary-set-local-parameters gnus-newsgroup-name) (when article-lapsed-timer (gnus-stop-date-timer)) @@ -5036,7 +5034,7 @@ and `gnus-mime-delete-part', and not provided at run-time normally." (setq gnus-article-mime-handles nil) (let ((mbl1 mml-buffer-list)) (setq mml-buffer-list mbl) - (set (make-local-variable 'mml-buffer-list) mbl1)) + (setq-local mml-buffer-list mbl1)) (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t))) `(lambda (no-highlight) (let ((mail-parse-charset (or gnus-article-charset @@ -6902,8 +6900,8 @@ then we display only bindings that start with that prefix." (setq draft gnus-draft-mode))) (with-temp-buffer (use-local-map keymap) - (set (make-local-variable 'gnus-agent-summary-mode) agent) - (set (make-local-variable 'gnus-draft-mode) draft) + (setq-local gnus-agent-summary-mode agent) + (setq-local gnus-draft-mode draft) (describe-bindings prefix)) (let ((item `((lambda (prefix) (with-current-buffer ,(current-buffer) @@ -7247,10 +7245,9 @@ This is an extended text-mode. \\{gnus-article-edit-mode-map}" (make-local-variable 'gnus-article-edit-done-function) (make-local-variable 'gnus-prev-winconf) - (set (make-local-variable 'font-lock-defaults) - '(message-font-lock-keywords t)) - (set (make-local-variable 'mail-header-separator) "") - (set (make-local-variable 'gnus-article-edit-mode) t) + (setq-local font-lock-defaults '(message-font-lock-keywords t)) + (setq-local mail-header-separator "") + (setq-local gnus-article-edit-mode t) (mml-mode) (setq buffer-read-only nil) (buffer-enable-undo) diff --git a/lisp/gnus/gnus-cus.el b/lisp/gnus/gnus-cus.el index f0c4d07ca9..d832d0ebae 100644 --- a/lisp/gnus/gnus-cus.el +++ b/lisp/gnus/gnus-cus.el @@ -49,18 +49,15 @@ if that value is non-nil." ;; Emacs stuff: (when (and (facep 'custom-button-face) (facep 'custom-button-pressed-face)) - (set (make-local-variable 'widget-button-face) - 'custom-button-face) - (set (make-local-variable 'widget-button-pressed-face) - 'custom-button-pressed-face) - (set (make-local-variable 'widget-mouse-face) - 'custom-button-pressed-face)) + (setq-local widget-button-face 'custom-button-face) + (setq-local widget-button-pressed-face 'custom-button-pressed-face) + (setq-local widget-mouse-face 'custom-button-pressed-face)) (when (and (boundp 'custom-raised-buttons) (symbol-value 'custom-raised-buttons)) - (set (make-local-variable 'widget-push-button-prefix) "") - (set (make-local-variable 'widget-push-button-suffix) "") - (set (make-local-variable 'widget-link-prefix) "") - (set (make-local-variable 'widget-link-suffix) ""))) + (setq-local widget-push-button-prefix "") + (setq-local widget-push-button-suffix "") + (setq-local widget-link-prefix "") + (setq-local widget-link-suffix ""))) ;;; Group Customization: @@ -380,10 +377,8 @@ category.")) (gnus-kill-buffer "*Gnus Customize*") (switch-to-buffer (gnus-get-buffer-create "*Gnus Customize*")) (gnus-custom-mode) - (make-local-variable 'gnus-custom-group) - (setq gnus-custom-group group) - (make-local-variable 'gnus-custom-topic) - (setq gnus-custom-topic topic) + (setq-local gnus-custom-group group) + (setq-local gnus-custom-topic topic) (buffer-disable-undo) (widget-insert "Customize the ") (if group @@ -848,8 +843,7 @@ This can be changed using the `\\[gnus-score-change-score-file]' command." (kill-buffer (gnus-get-buffer-create "*Gnus Customize*")) (switch-to-buffer (gnus-get-buffer-create "*Gnus Customize*")) (gnus-custom-mode) - (make-local-variable 'gnus-custom-score-alist) - (setq gnus-custom-score-alist scores) + (setq-local gnus-custom-score-alist scores) (widget-insert "Customize the ") (widget-create 'info-link :help-echo "Push me to learn more." @@ -867,8 +861,7 @@ Check the [ ] for the entries you want to apply to this score file, then edit the value to suit your taste. Don't forget to mark the checkbox, if you do all your changes will be lost. ") (widget-insert "\n\n") - (make-local-variable 'gnus-custom-scores) - (setq gnus-custom-scores + (setq-local gnus-custom-scores (widget-create 'group :value scores `(checklist :inline t @@ -1052,10 +1045,9 @@ articles in the thread. "\n Note: Empty fields default to the customizable global\ variables.\n\n") - (set (make-local-variable 'gnus-agent-cat-name) - name)) + (setq-local gnus-agent-cat-name name)) - (set (make-local-variable 'category-fields) nil) + (setq-local category-fields nil) (gnus-agent-cat-prepare-category-field agent-predicate) (gnus-agent-cat-prepare-category-field agent-score) diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 73fda66fb6..a0f27c1937 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -1098,7 +1098,7 @@ When FORCE, rebuild the tool bar." gnus-group-tool-bar-zap-list 'gnus-group-mode-map))) (if map - (set (make-local-variable 'tool-bar-map) map)))) + (setq-local tool-bar-map map)))) gnus-group-tool-bar-map) (define-derived-mode gnus-group-mode gnus-mode "Group" diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 465871eafb..3733babfe0 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -464,8 +464,7 @@ only affect the Gcc copy, but not the original message." (gnus-inews-add-send-actions ,winconf ,buffer ,oarticle ,config ,yanked ,winconf-name) (setq gnus-message-buffer (current-buffer)) - (set (make-local-variable 'gnus-message-group-art) - (cons ,group ,article)) + (setq-local gnus-message-group-art (cons ,group ,article)) ;; Enable highlighting of different citation levels (when gnus-message-highlight-citation (gnus-message-citation-mode 1)) @@ -473,7 +472,7 @@ only affect the Gcc copy, but not the original message." (if (eq major-mode 'message-mode) (let ((mbl1 mml-buffer-list)) (setq mml-buffer-list mbl) ;; Global value - (set (make-local-variable 'mml-buffer-list) mbl1);; Local value + (setq-local mml-buffer-list mbl1) ;; Local value (add-hook 'change-major-mode-hook 'mml-destroy-buffers nil t) (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)) (mml-destroy-buffers) @@ -724,10 +723,10 @@ network. The corresponding back end must have a `request-post' method." (gnus-setup-message 'message (progn (message-news (gnus-group-real-name gnus-newsgroup-name)) - (set (make-local-variable 'gnus-discouraged-post-methods) - (remove - (car (gnus-find-method-for-group gnus-newsgroup-name)) - gnus-discouraged-post-methods))))))))) + (setq-local gnus-discouraged-post-methods + (remove + (car (gnus-find-method-for-group gnus-newsgroup-name)) + gnus-discouraged-post-methods))))))))) (defun gnus-summary-post-news (&optional arg) "Start composing a message. Post to the current group by default. @@ -1926,8 +1925,8 @@ this is a reply." (message-goto-body) (insert ,(cdr result))))) ((eq 'signature (car result)) - (set (make-local-variable 'message-signature) nil) - (set (make-local-variable 'message-signature-file) nil) + (setq-local message-signature nil) + (setq-local message-signature-file nil) (if (not (cdr result)) 'ignore `(lambda () @@ -1953,8 +1952,8 @@ this is a reply." (when (or name address) (add-hook 'message-setup-hook `(lambda () - (set (make-local-variable 'user-mail-address) - ,(or (cdr address) user-mail-address)) + (setq-local user-mail-address + ,(or (cdr address) user-mail-address)) (let ((user-full-name ,(or (cdr name) (user-full-name))) (user-mail-address ,(or (cdr address) user-mail-address))) diff --git a/lisp/gnus/gnus-salt.el b/lisp/gnus/gnus-salt.el index 8d58cd59e4..f19678a634 100644 --- a/lisp/gnus/gnus-salt.el +++ b/lisp/gnus/gnus-salt.el @@ -106,7 +106,7 @@ It accepts the same format specs that `gnus-summary-line-format' does." (remove-hook 'gnus-message-setup-hook 'gnus-pick-setup-message)) (t ;; Make sure that we don't select any articles upon group entry. - (set (make-local-variable 'gnus-auto-select-first) nil) + (setq-local gnus-auto-select-first nil) ;; Change line format. (setq gnus-summary-line-format gnus-summary-pick-line-format) (setq gnus-summary-line-format-spec nil) @@ -114,7 +114,7 @@ It accepts the same format specs that `gnus-summary-line-format' does." (gnus-update-summary-mark-positions) ;; FIXME: a buffer-local minor mode adding globally to a hook?? (add-hook 'gnus-message-setup-hook 'gnus-pick-setup-message) - (set (make-local-variable 'gnus-summary-goto-unread) 'never) + (setq-local gnus-summary-goto-unread 'never) ;; Set up the menu. (when (gnus-visual-p 'pick-menu 'menu) (gnus-pick-make-menu-bar))))) @@ -333,10 +333,8 @@ This must be bound to a button-down mouse event." ((not (derived-mode-p 'gnus-summary-mode)) (setq gnus-binary-mode nil)) (gnus-binary-mode ;; Make sure that we don't select any articles upon group entry. - (make-local-variable 'gnus-auto-select-first) - (setq gnus-auto-select-first nil) - (make-local-variable 'gnus-summary-display-article-function) - (setq gnus-summary-display-article-function 'gnus-binary-display-article) + (setq-local gnus-auto-select-first nil) + (setq-local gnus-summary-display-article-function 'gnus-binary-display-article) ;; Set up the menu. (when (gnus-visual-p 'binary-menu 'menu) (gnus-binary-make-menu-bar))))) diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index 2e3abe7832..94f2cc310f 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -1117,8 +1117,7 @@ EXTRA is the possible non-standard header." (gnus-configure-windows 'edit-score) (gnus-score-mode) (setq gnus-score-edit-exit-function 'gnus-score-edit-done) - (make-local-variable 'gnus-prev-winconf) - (setq gnus-prev-winconf winconf)) + (setq-local gnus-prev-winconf winconf)) (gnus-message 4 "%s" (substitute-command-keys "\\\\[gnus-score-edit-exit] to save edits")))) @@ -1145,8 +1144,7 @@ EXTRA is the possible non-standard header." (gnus-configure-windows 'edit-score) (gnus-score-mode) (setq gnus-score-edit-exit-function 'gnus-score-edit-done) - (make-local-variable 'gnus-prev-winconf) - (setq gnus-prev-winconf winconf)) + (setq-local gnus-prev-winconf winconf)) (gnus-message 4 "%s" (substitute-command-keys "\\\\[gnus-score-edit-exit] to save edits"))) diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el index 6beb543e5a..ba15f1a04c 100644 --- a/lisp/gnus/gnus-srvr.el +++ b/lisp/gnus/gnus-srvr.el @@ -262,8 +262,7 @@ The following commands are available: (setq mode-line-process nil) (buffer-disable-undo) (setq truncate-lines t) - (set (make-local-variable 'font-lock-defaults) - '(gnus-server-font-lock-keywords t))) + (setq-local font-lock-defaults '(gnus-server-font-lock-keywords t))) (defun gnus-server-insert-server-line (name method) diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 615f8dfa87..d15fc8217a 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -741,8 +741,7 @@ of an NNTP server to use. As opposed to \\[gnus], this command will not connect to the local server." (let ((val (or arg (1- gnus-level-default-subscribed)))) (gnus val t child) - (make-local-variable 'gnus-group-use-permanent-levels) - (setq gnus-group-use-permanent-levels val))) + (setq-local gnus-group-use-permanent-levels val))) (defun gnus-1 (&optional arg dont-connect child) "Read network news. @@ -875,13 +874,13 @@ If REGEXP is given, lines that match it will be deleted." (with-current-buffer (setq gnus-dribble-buffer (gnus-get-buffer-create (file-name-nondirectory dribble-file))) - (set (make-local-variable 'file-precious-flag) t) + (setq-local file-precious-flag t) (setq buffer-save-without-query t) (erase-buffer) (setq buffer-file-name dribble-file) ;; The buffer may be shrunk a lot when deleting old entries. ;; It caused the auto-saving to stop. - (set (make-local-variable 'auto-save-include-big-deletions) t) + (setq-local auto-save-include-big-deletions t) (auto-save-mode t) (buffer-disable-undo) (bury-buffer (current-buffer)) @@ -2763,8 +2762,7 @@ values from `gnus-newsrc-hashtb', and write a new value of ;; Save .newsrc.eld. (set-buffer (gnus-get-buffer-create " *Gnus-newsrc*")) - (make-local-variable 'version-control) - (setq version-control gnus-backup-startup-file) + (setq-local version-control gnus-backup-startup-file) (setq buffer-file-name (concat gnus-current-startup-file ".eld")) (setq default-directory (file-name-directory buffer-file-name)) @@ -2973,8 +2971,7 @@ SPECIFIC-VARIABLES, or those in `gnus-variable-list'." (when ranges (insert ","))))) (insert "\n"))) - (make-local-variable 'version-control) - (setq version-control 'never) + (setq-local version-control 'never) ;; It has been reported that sometime the modtime on the .newsrc ;; file seems to be off. We really do want to overwrite it, so ;; we clear the modtime here before saving. It's a bit odd, diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 469fa36fb7..8c826e88c7 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -3038,7 +3038,7 @@ When FORCE, rebuild the tool bar." ;; Need to set `gnus-summary-tool-bar-map' because `gnus-article-mode' ;; uses its value. (setq gnus-summary-tool-bar-map map)))) - (set (make-local-variable 'tool-bar-map) gnus-summary-tool-bar-map)) + (setq-local tool-bar-map gnus-summary-tool-bar-map)) (defun gnus-make-score-map (type) "Make a summary score map of type TYPE." @@ -3174,8 +3174,8 @@ The following commands are available: (make-local-variable 'gnus-original-article-buffer) (add-hook 'pre-command-hook #'gnus-set-global-variables nil t) (mm-enable-multibyte) - (set (make-local-variable 'bookmark-make-record-function) - #'gnus-summary-bookmark-make-record)) + (setq-local bookmark-make-record-function + #'gnus-summary-bookmark-make-record)) (defun gnus-summary-make-local-variables () "Make all the local summary buffer variables." @@ -3547,7 +3547,7 @@ Returns non-nil if the setup was successful." (let ((gnus-summary-mode-group group)) (gnus-summary-mode)) (when (gnus-group-quit-config group) - (set (make-local-variable 'gnus-single-article-buffer) nil)) + (setq-local gnus-single-article-buffer nil)) (turn-on-gnus-mailing-list-mode) ;; These functions don't currently depend on GROUP, but might in ;; the future. @@ -5670,8 +5670,8 @@ If SELECT-ARTICLES, only select those articles from GROUP." articles fetched-articles cached) (unless (gnus-check-server - (set (make-local-variable 'gnus-current-select-method) - (gnus-find-method-for-group group))) + (setq-local gnus-current-select-method + (gnus-find-method-for-group group))) (error "Couldn't open server")) (or (and entry (not (eq (car entry) t))) ; Either it's active... @@ -10638,7 +10638,7 @@ groups." (mime-to-mml current-handles)) (let ((mbl1 mml-buffer-list)) (setq mml-buffer-list mbl) - (set (make-local-variable 'mml-buffer-list) mbl1)) + (setq-local mml-buffer-list mbl1)) (add-hook 'kill-buffer-hook #'mml-destroy-buffers t t)))) `(lambda (no-highlight) (let ((mail-parse-charset ',gnus-newsgroup-charset) @@ -12846,8 +12846,7 @@ UNREAD is a sorted list." (and gnus-newsgroup-name (gnus-parameter-charset gnus-newsgroup-name)) gnus-default-charset)) - (set (make-local-variable 'gnus-newsgroup-ignored-charsets) - ignored-charsets)))) + (setq-local gnus-newsgroup-ignored-charsets ignored-charsets)))) ;;; ;;; Mime Commands diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el index c913002f70..75de1e031c 100644 --- a/lisp/gnus/gnus-topic.el +++ b/lisp/gnus/gnus-topic.el @@ -1129,18 +1129,17 @@ articles in the topic and its subtopics." (gnus-topic-make-menu-bar)) (gnus-set-format 'topic t) (add-hook 'gnus-group-catchup-group-hook 'gnus-topic-update-topic) - (set (make-local-variable 'gnus-group-prepare-function) - 'gnus-group-prepare-topics) - (set (make-local-variable 'gnus-group-get-parameter-function) - 'gnus-group-topic-parameters) - (set (make-local-variable 'gnus-group-goto-next-group-function) - 'gnus-topic-goto-next-group) - (set (make-local-variable 'gnus-group-indentation-function) - 'gnus-topic-group-indentation) - (set (make-local-variable 'gnus-group-update-group-function) - 'gnus-topic-update-topics-containing-group) - (set (make-local-variable 'gnus-group-sort-alist-function) - 'gnus-group-sort-topic) + (setq-local gnus-group-prepare-function + 'gnus-group-prepare-topics) + (setq-local gnus-group-get-parameter-function + 'gnus-group-topic-parameters) + (setq-local gnus-group-goto-next-group-function + 'gnus-topic-goto-next-group) + (setq-local gnus-group-indentation-function + 'gnus-topic-group-indentation) + (setq-local gnus-group-update-group-function + 'gnus-topic-update-topics-containing-group) + (setq-local gnus-group-sort-alist-function 'gnus-group-sort-topic) (setq gnus-group-change-level-function 'gnus-topic-change-level) (setq gnus-goto-missing-group-function 'gnus-topic-goto-missing-group) (add-hook 'gnus-check-bogus-groups-hook 'gnus-topic-clean-alist diff --git a/lisp/gnus/gnus-undo.el b/lisp/gnus/gnus-undo.el index 3f2b5768db..a852f20109 100644 --- a/lisp/gnus/gnus-undo.el +++ b/lisp/gnus/gnus-undo.el @@ -100,8 +100,8 @@ \\{gnus-undo-mode-map}" :keymap gnus-undo-mode-map - (set (make-local-variable 'gnus-undo-actions) nil) - (set (make-local-variable 'gnus-undo-boundary) t) + (setq-local gnus-undo-actions nil) + (setq-local gnus-undo-boundary t) (when gnus-undo-mode ;; Set up the menu. (when (gnus-visual-p 'undo-menu 'menu) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index c1cfddc87b..2edda5f1fe 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -3175,8 +3175,7 @@ that that variable is buffer-local to the summary buffers." "Make mode lines a bit simpler." (setq mode-line-modified "--") (when (listp mode-line-format) - (make-local-variable 'mode-line-format) - (setq mode-line-format (copy-sequence mode-line-format)) + (setq-local mode-line-format (copy-sequence mode-line-format)) (when (equal (nth 3 mode-line-format) " ") (setcar (nthcdr 3 mode-line-format) " ")))) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 2ab3eb6212..b6c1c0b071 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -1155,7 +1155,7 @@ Note: Many newsgroups frown upon nontraditional reply styles. You probably want to set this variable only for specific groups, e.g. using `gnus-posting-styles': - (eval (set (make-local-variable \\='message-cite-reply-position) \\='above))" + (eval (setq-local message-cite-reply-position \\='above))" :version "24.1" :type '(choice (const :tag "Reply inline" traditional) (const :tag "Reply above" above) @@ -1172,7 +1172,7 @@ Presets to impersonate popular mail agents are found in the message-cite-style-* variables. This variable is intended for use in `gnus-posting-styles', such as: - ((posting-from-work-p) (eval (set (make-local-variable \\='message-cite-style) message-cite-style-outlook)))" + ((posting-from-work-p) (eval (setq-local message-cite-style message-cite-style-outlook)))" :version "24.1" :group 'message-insertion :type '(choice (const :tag "Do not override variables" :value nil) @@ -3078,44 +3078,43 @@ See also `message-forbidden-properties'." Like `text-mode', but with these additional commands: \\{message-mode-map}" - (set (make-local-variable 'message-reply-buffer) nil) - (set (make-local-variable 'message-inserted-headers) nil) - (set (make-local-variable 'message-send-actions) nil) - (set (make-local-variable 'message-return-action) nil) - (set (make-local-variable 'message-exit-actions) nil) - (set (make-local-variable 'message-kill-actions) nil) - (set (make-local-variable 'message-postpone-actions) nil) - (set (make-local-variable 'message-draft-article) nil) + (setq-local message-reply-buffer nil) + (setq-local message-inserted-headers nil) + (setq-local message-send-actions nil) + (setq-local message-return-action nil) + (setq-local message-exit-actions nil) + (setq-local message-kill-actions nil) + (setq-local message-postpone-actions nil) + (setq-local message-draft-article nil) (setq buffer-offer-save t) - (set (make-local-variable 'facemenu-add-face-function) + (setq-local facemenu-add-face-function (lambda (face end) (let ((face-fun (cdr (assq face message-face-alist)))) (if face-fun (funcall face-fun (point) end) (error "Face %s not configured for %s mode" face mode-name))) "")) - (set (make-local-variable 'facemenu-remove-face-function) t) - (set (make-local-variable 'message-reply-headers) nil) + (setq-local facemenu-remove-face-function t) + (setq-local message-reply-headers nil) (make-local-variable 'message-newsreader) (make-local-variable 'message-mailer) (make-local-variable 'message-post-method) - (set (make-local-variable 'message-sent-message-via) nil) - (set (make-local-variable 'message-checksum) nil) - (set (make-local-variable 'message-mime-part) 0) + (setq-local message-sent-message-via nil) + (setq-local message-checksum nil) + (setq-local message-mime-part 0) (message-setup-fill-variables) (when message-fill-column (setq fill-column message-fill-column) (turn-on-auto-fill)) ;; Allow using comment commands to add/remove quoting. - ;; (set (make-local-variable 'comment-start) message-yank-prefix) + ;; (setq-local comment-start message-yank-prefix) (when message-yank-prefix - (set (make-local-variable 'comment-start) message-yank-prefix) - (set (make-local-variable 'comment-start-skip) - (concat "^" (regexp-quote message-yank-prefix) "[ \t]*"))) - (set (make-local-variable 'font-lock-defaults) - '(message-font-lock-keywords t)) + (setq-local comment-start message-yank-prefix) + (setq-local comment-start-skip + (concat "^" (regexp-quote message-yank-prefix) "[ \t]*"))) + (setq-local font-lock-defaults '(message-font-lock-keywords t)) (if (boundp 'tool-bar-map) - (set (make-local-variable 'tool-bar-map) (message-make-tool-bar))) + (setq-local tool-bar-map (message-make-tool-bar))) ;; Mmmm... Forbidden properties... (add-hook 'after-change-functions #'message-strip-forbidden-properties nil 'local) @@ -3134,45 +3133,41 @@ Like `text-mode', but with these additional commands: ;; Don't enable multibyte on an indirect buffer. Maybe enabling ;; multibyte is not necessary at all. -- zsh (mm-enable-multibyte)) - (set (make-local-variable 'indent-tabs-mode) nil) ;No tabs for indentation. + (setq-local indent-tabs-mode nil) ; No tabs for indentation. (mml-mode) ;; Syntactic fontification. Helps `show-paren-mode', ;; `electric-pair-mode', and C-M-* navigation by syntactically ;; excluding citations and other artifacts. ;; - (set (make-local-variable 'syntax-propertize-function) 'message--syntax-propertize) - (set (make-local-variable 'parse-sexp-ignore-comments) t) + (setq-local syntax-propertize-function 'message--syntax-propertize) + (setq-local parse-sexp-ignore-comments t) (setq-local message-encoded-mail-cache nil)) (defun message-setup-fill-variables () "Setup message fill variables." - (set (make-local-variable 'fill-paragraph-function) - 'message-fill-paragraph) - (make-local-variable 'paragraph-separate) - (make-local-variable 'paragraph-start) - (make-local-variable 'adaptive-fill-regexp) + (setq-local fill-paragraph-function 'message-fill-paragraph) (make-local-variable 'adaptive-fill-first-line-regexp) (let ((quote-prefix-regexp ;; User should change message-cite-prefix-regexp if ;; message-yank-prefix is set to an abnormal value. (concat "\\(" message-cite-prefix-regexp "\\)[ \t]*"))) - (setq paragraph-start - (concat - (regexp-quote mail-header-separator) "$\\|" - "[ \t]*$\\|" ; blank lines - "-- $\\|" ; signature delimiter - "---+$\\|" ; delimiters for forwarded messages - page-delimiter "$\\|" ; spoiler warnings - ".*wrote:$\\|" ; attribution lines - quote-prefix-regexp "$\\|" ; empty lines in quoted text - ; mml tags - "<#!*/?\\(multipart\\|part\\|external\\|mml\\|secure\\)")) - (setq paragraph-separate paragraph-start) - (setq adaptive-fill-regexp - (concat quote-prefix-regexp "\\|" adaptive-fill-regexp)) - (setq adaptive-fill-first-line-regexp - (concat quote-prefix-regexp "\\|" - adaptive-fill-first-line-regexp))) + (setq-local paragraph-start + (concat + (regexp-quote mail-header-separator) "$\\|" + "[ \t]*$\\|" ; blank lines + "-- $\\|" ; signature delimiter + "---+$\\|" ; delimiters for forwarded messages + page-delimiter "$\\|" ; spoiler warnings + ".*wrote:$\\|" ; attribution lines + quote-prefix-regexp "$\\|" ; empty lines in quoted text + ; mml tags + "<#!*/?\\(multipart\\|part\\|external\\|mml\\|secure\\)")) + (setq-local paragraph-separate paragraph-start) + (setq-local adaptive-fill-regexp + (concat quote-prefix-regexp "\\|" adaptive-fill-regexp)) + (setq-local adaptive-fill-first-line-regexp + (concat quote-prefix-regexp "\\|" + adaptive-fill-first-line-regexp))) (setq-local auto-fill-inhibit-regexp nil) (setq-local normal-auto-fill-function 'message-do-auto-fill)) diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index ca61001091..015bc79f45 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el @@ -486,7 +486,7 @@ If MODE is not set, try to find mode automatically." ;; support modes, but now that we use font-lock-ensure, support modes ;; aren't a problem any more. So we could probably get rid of this ;; setting now, but it seems harmless and potentially still useful. - (set (make-local-variable 'font-lock-mode-hook) nil) + (setq-local font-lock-mode-hook nil) (setq buffer-file-name (mm-handle-filename handle)) (with-demoted-errors (if mode diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index 067396fc2a..47dcb54562 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el @@ -1266,8 +1266,8 @@ See Info node `(emacs-mime)Composing'. :lighter " MML" :keymap mml-mode-map (when mml-mode (when (boundp 'dnd-protocol-alist) - (set (make-local-variable 'dnd-protocol-alist) - (append mml-dnd-protocol-alist dnd-protocol-alist))))) + (setq-local dnd-protocol-alist + (append mml-dnd-protocol-alist dnd-protocol-alist))))) ;;; ;;; Helper functions for reading MIME stuff from the minibuffer and diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el index ccd1774499..ef52070412 100644 --- a/lisp/gnus/nndiary.el +++ b/lisp/gnus/nndiary.el @@ -1002,10 +1002,10 @@ all. This may very well take some time.") (let ((buffer (gnus-get-buffer-create (format " *nndiary overview %s*" group)))) (with-current-buffer buffer - (set (make-local-variable 'nndiary-nov-buffer-file-name) - (expand-file-name - nndiary-nov-file-name - (nnmail-group-pathname group nndiary-directory))) + (setq-local nndiary-nov-buffer-file-name + (expand-file-name + nndiary-nov-file-name + (nnmail-group-pathname group nndiary-directory))) (erase-buffer) (when (file-exists-p nndiary-nov-buffer-file-name) (nnheader-insert-file-contents nndiary-nov-buffer-file-name))) diff --git a/lisp/gnus/nnfolder.el b/lisp/gnus/nnfolder.el index 6ff99056d8..b7bfd9afd0 100644 --- a/lisp/gnus/nnfolder.el +++ b/lisp/gnus/nnfolder.el @@ -1083,7 +1083,7 @@ This command does not work if you use short group names." (let ((coding-system-for-write (or nnfolder-file-coding-system-for-write nnfolder-file-coding-system))) - (set (make-local-variable 'copyright-update) nil) + (setq-local copyright-update nil) (save-buffer))) (unless (or gnus-nov-is-evil nnfolder-nov-is-evil) (nnfolder-save-nov)))) @@ -1098,8 +1098,8 @@ This command does not work if you use short group names." (or (cdr (assoc group nnfolder-nov-buffer-alist)) (let ((buffer (gnus-get-buffer-create (format " *nnfolder overview %s*" group)))) (with-current-buffer buffer - (set (make-local-variable 'nnfolder-nov-buffer-file-name) - (nnfolder-group-nov-pathname group)) + (setq-local nnfolder-nov-buffer-file-name + (nnfolder-group-nov-pathname group)) (erase-buffer) (when (file-exists-p nnfolder-nov-buffer-file-name) (nnheader-insert-file-contents nnfolder-nov-buffer-file-name))) diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el index 2952e20928..c97622114d 100644 --- a/lisp/gnus/nnheader.el +++ b/lisp/gnus/nnheader.el @@ -568,7 +568,7 @@ the line could be found." (mm-enable-multibyte) (kill-all-local-variables) (setq case-fold-search t) ;Should ignore case. - (set (make-local-variable 'nntp-process-response) nil) + (setq-local nntp-process-response nil) t)) ;;; Various functions the backends use. diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index c8b700ebcc..61693a08b9 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -376,10 +376,10 @@ during splitting, which may be slow." (mm-disable-multibyte) (buffer-disable-undo) (gnus-add-buffer) - (set (make-local-variable 'after-change-functions) nil) ;FIXME: Why? - (set (make-local-variable 'nnimap-object) - (make-nnimap :server (nnoo-current-server 'nnimap) - :initial-resync 0)) + (setq-local after-change-functions nil) ;FIXME: Why? + (setq-local nnimap-object + (make-nnimap :server (nnoo-current-server 'nnimap) + :initial-resync 0)) (push (list buffer (current-buffer)) nnimap-connection-alist) (push (current-buffer) nnimap-process-buffers) (current-buffer))) diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el index ad608b6575..c648e3aae7 100644 --- a/lisp/gnus/nnml.el +++ b/lisp/gnus/nnml.el @@ -778,8 +778,8 @@ article number. This function is called narrowed to an article." group))) (file-name-coding-system nnmail-pathname-coding-system)) (with-current-buffer buffer - (set (make-local-variable 'nnml-nov-buffer-file-name) - (nnmail-group-pathname group nnml-directory nnml-nov-file-name)) + (setq-local nnml-nov-buffer-file-name + (nnmail-group-pathname group nnml-directory nnml-nov-file-name)) (erase-buffer) (when (and (not incrementalp) (file-exists-p nnml-nov-buffer-file-name)) commit 3ee94cc7bb657f0d3186d344fb1236b50edd5f69 Author: Lars Ingebrigtsen Date: Mon Dec 7 16:36:09 2020 +0100 Insert skeletons at the correct point * lisp/skeleton.el (skeleton-read): Don't insert the skeleton at an arbitrary point if the user moves around (bug#17752). diff --git a/lisp/skeleton.el b/lisp/skeleton.el index 6e2c10d971..5578a937d7 100644 --- a/lisp/skeleton.el +++ b/lisp/skeleton.el @@ -312,10 +312,15 @@ automatically, and you are prompted to fill in the variable parts."))) (save-excursion (insert "\n"))) (unwind-protect (setq prompt (cond ((stringp prompt) - (read-string (format prompt skeleton-subprompt) - (setq initial-input - (or initial-input - (symbol-value 'input))))) + ;; The user may issue commands to move + ;; around (like `C-M-v'). Ensure that we + ;; insert the skeleton at the correct + ;; (initial) point. + (save-excursion + (read-string (format prompt skeleton-subprompt) + (setq initial-input + (or initial-input + (symbol-value 'input)))))) ((functionp prompt) (funcall prompt)) (t (eval prompt)))) commit b218c8b6b587d4f0629cbe81bf2dba95d07844d0 Author: Lars Ingebrigtsen Date: Mon Dec 7 15:40:23 2020 +0100 Allow shutting down Emacs even if there are errors in kill-emacs-hook * lisp/subr.el (run-hook-query-error-with-timeout): New function (bug#28542). * src/emacs.c (Fkill_emacs): Use it to allow exiting Emacs even if there are errors in kill-emacs-hook. (syms_of_emacs): Define the symbol. diff --git a/etc/NEWS b/etc/NEWS index 34f7d30c84..49d66cc449 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1365,6 +1365,13 @@ This new command (bound to 'C-c C-l') regenerates the current hunk. ** Miscellaneous +--- +*** Errors in 'kill-emacs-hook' no longer prevents Emacs from shutting down. +If a function in that hook signals an error in an interactive Emacs, +the user will be prompted whether to continue or not. If the user +doesn't answer within five seconds, Emacs will continue shutting down +anyway. + --- *** iso-transl is now preloaded. This means that keystrokes like 'Alt-[' are defined by default, diff --git a/lisp/subr.el b/lisp/subr.el index 2236e93484..c28807f694 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -5909,4 +5909,22 @@ returned list are in the same order as in TREE. (defconst regexp-unmatchable "\\`a\\`" "Standard regexp guaranteed not to match any string at all.") +(defun run-hook-query-error-with-timeout (hook) + "Run HOOK, catching errors, and querying the user about whether to continue. +If a function in HOOK signals an error, the user will be prompted +whether to continue or not. If the user doesn't respond, +evaluation will continue if the user doesn't respond within five +seconds." + (run-hook-wrapped + hook + (lambda (fun) + (condition-case err + (funcall fun) + (error + (unless (y-or-n-p-with-timeout (format "Error %s; continue?" err) + 5 t) + (error err)))) + ;; Continue running. + nil))) + ;;; subr.el ends here diff --git a/src/emacs.c b/src/emacs.c index d1b010ec7f..fe09c446c3 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2368,7 +2368,7 @@ all of which are called before Emacs is actually killed. */ if (noninteractive) safe_run_hooks (Qkill_emacs_hook); else - run_hook (Qkill_emacs_hook); + call1 (Qrun_hook_query_error_with_timeout, Qkill_emacs_hook); #ifdef HAVE_X_WINDOWS /* Transfer any clipboards we own to the clipboard manager. */ @@ -2890,6 +2890,8 @@ syms_of_emacs (void) DEFSYM (Qrisky_local_variable, "risky-local-variable"); DEFSYM (Qkill_emacs, "kill-emacs"); DEFSYM (Qkill_emacs_hook, "kill-emacs-hook"); + DEFSYM (Qrun_hook_query_error_with_timeout, + "run-hook-query-error-with-timeout"); #ifdef HAVE_UNEXEC defsubr (&Sdump_emacs); commit 9cef8fc8cdb5e6e18c9cf617eed3808d67ca340e Author: Lars Ingebrigtsen Date: Mon Dec 7 14:29:46 2020 +0100 Ensure that new emacsclient frames has focus * lisp/server.el (server-execute): Focus the frame here... (server-switch-buffer): Instead of here (bug#15469). This ensures that the frame has focus if Emacs is querying the user about something when opening a file (for instance "Revert from file?"). diff --git a/lisp/server.el b/lisp/server.el index b1b27e33b2..651f801a23 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -1334,6 +1334,8 @@ The following commands are accepted by the client: ;; inhibit-quit flag, which is good since `commands' (as well as ;; find-file-noselect via the major-mode) can run arbitrary code, ;; including code that needs to wait. + (when (and frame server-raise-frame) + (select-frame-set-input-focus frame)) (with-local-quit (condition-case err (let ((buffers (server-visit-files files proc nowait))) @@ -1686,9 +1688,7 @@ be a cons cell (LINENUMBER . COLUMNNUMBER)." (switch-to-buffer next-buffer)) ;; After all the above, we might still have ended up with ;; a minibuffer/dedicated-window (if there's no other). - (error (pop-to-buffer next-buffer))))))) - (when server-raise-frame - (select-frame-set-input-focus (window-frame))))) + (error (pop-to-buffer next-buffer))))))))) ;;;###autoload (defun server-save-buffers-kill-terminal (arg) commit ff5a3c74fc45c80f2c8c272f259dbba84b7c3f66 Author: Lars Ingebrigtsen Date: Mon Dec 7 13:53:24 2020 +0100 Allow inhibiting the instructions on how to close emacsclient frames * doc/emacs/misc.texi (Invoking emacsclient): Document it. * lisp/server.el (server-client-instructions): New variable. (server-execute): Use it. diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 5b5134b7c3..e0341a4991 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -1893,6 +1893,12 @@ with @kbd{C-x #}. But @kbd{C-x #} is the way to tell window or a frame, @kbd{C-x #} always displays the next server buffer in that window or in that frame. +@vindex server-client-instructions + When @command{emacsclient} connects, the server will normally output +a message that says how to exit the client frame. If +@code{server-client-instructions} is set to @code{nil}, this message +is inhibited. + @node emacsclient Options @subsection @code{emacsclient} Options @cindex @code{emacsclient} options diff --git a/etc/NEWS b/etc/NEWS index a30355f20d..34f7d30c84 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -287,6 +287,14 @@ the buffer cycles the whole buffer between "only top-level headings", * Changes in Specialized Modes and Packages in Emacs 28.1 +** Emacs Server + ++++ +*** New user option 'server-client-instructions'. +When emacsclient connects, Emacs will (by default) output a message +about how to exit the client frame. If 'server-client-instructions' +is set to nil, this message is inhibited. + ** Python mode *** 'C-c C-r' can now be used on arbitrary regions. diff --git a/lisp/server.el b/lisp/server.el index 2fd94552dd..b1b27e33b2 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -268,6 +268,12 @@ the \"-f\" switch otherwise." :type 'string :version "23.1") +(defcustom server-client-instructions t + "If non-nil, output instructions on how to exit the client on connection. +If non, no messaging is done." + :version "28.1" + :type 'boolean) + ;; We do not use `temporary-file-directory' here, because emacsclient ;; does not read the init file. (defvar server-socket-dir @@ -1360,8 +1366,10 @@ The following commands are accepted by the client: nil) ((and frame (null buffers)) (run-hooks 'server-after-make-frame-hook) - (message "%s" (substitute-command-keys - "When done with this frame, type \\[delete-frame]"))) + (when server-client-instructions + (message "%s" + (substitute-command-keys + "When done with this frame, type \\[delete-frame]")))) ((not (null buffers)) (run-hooks 'server-after-make-frame-hook) (server-switch-buffer @@ -1372,9 +1380,11 @@ The following commands are accepted by the client: ;; where it may be displayed. (plist-get (process-plist proc) 'frame)) (run-hooks 'server-switch-hook) - (unless nowait - (message "%s" (substitute-command-keys - "When done with a buffer, type \\[server-edit]"))))) + (when (and (not nowait) + server-client-instructions) + (message "%s" + (substitute-command-keys + "When done with a buffer, type \\[server-edit]"))))) (when (and frame (null tty-name)) (server-unselect-display frame))) ((quit error) commit 78017a6e598ed7663aa04bd19c426f16bbc05006 Author: Illia Ostapyshyn Date: Mon Dec 7 13:36:34 2020 +0100 Allow using newer versions of Gnuplot from calc again * lisp/calc/calc-graph.el (calc-graph-plot): Don't use the "time" abbreviation for "timestamp" (bug#39232) -- it's no longer valid after https://github.com/gnuplot/gnuplot/commit/b979b5371bc1c18bf8f5bd756e7c1fb54dafd8cc Copyright-paperwork-exempt: yes diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el index 829fa44ca4..b694a826ce 100644 --- a/lisp/calc/calc-graph.el +++ b/lisp/calc/calc-graph.el @@ -351,7 +351,7 @@ (if (>= ver 3) (insert "set surface\nset nocontour\n" "set " (if calc-graph-is-splot "" "no") "parametric\n" - "set notime\nset border\nset ztics\nset zeroaxis\n" + "set notimestamp\nset border\nset ztics\nset zeroaxis\n" "set view 60,30,1,1\nset offsets 0,0,0,0\n")) (setq samples-pos (point)) (insert "\n\n" str)) commit e74f60fde0bcaa1b6b0ac3bbd83f39421f13c6b3 Author: Lars Ingebrigtsen Date: Sun Dec 6 19:25:43 2020 +0100 Fix file name quoting problems in tex-mode * lisp/textmodes/tex-mode.el (tex--quote-spec): New function (bug#14286). (tex-format-cmd): Use it. (tex-compile): Don't quote the file names, because we're using `file-exists-p' and friends on the results later, and that fails on systems where everything is quoted, and on file names that need quoting. diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 37ab11ad89..59238452a4 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -2331,9 +2331,14 @@ FILE is typically the output DVI or PDF file." :version "23.1" :group 'tex-run) +(defun tex--quote-spec (fspec) + (cl-loop for (char . file) in fspec + collect (cons char (shell-quote-argument file)))) + (defun tex-format-cmd (format fspec) "Like `format-spec' but adds user-specified args to the command. Only applies the FSPEC to the args part of FORMAT." + (setq fspec (tex--quote-spec fspec)) (if (not (string-match "\\([^ /\\]+\\) " format)) (format-spec format fspec) (let* ((prefix (substring format 0 (match-beginning 0))) @@ -2430,8 +2435,8 @@ Only applies the FSPEC to the args part of FORMAT." (prog1 (file-name-directory (expand-file-name file)) (setq file (file-name-nondirectory file)))) (root (file-name-sans-extension file)) - (fspec (list (cons ?r (shell-quote-argument root)) - (cons ?f (shell-quote-argument file)))) + (fspec (list (cons ?r root) + (cons ?f file))) (default (tex-compile-default fspec))) (list default-directory (completing-read commit 3568ff084c29588be6412f94bc0d031846beb664 Author: Lars Ingebrigtsen Date: Sun Dec 6 13:45:31 2020 +0100 Clarify icomplete-show-matches-on-no-input doc string * lisp/icomplete.el (icomplete-show-matches-on-no-input): Clarify doc string (bug#19031), suggested by Andrii Kolomoiets. diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 4e546807b7..676917b9da 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -75,7 +75,7 @@ everything preceding the ~/ is discarded so the interactive selection process starts again from the user's $HOME.") (defcustom icomplete-show-matches-on-no-input nil - "When non-nil, show completions when first prompting for input. + "When non-nil, show completions when the minibuffer is empty. This also means that if you traverse the list of completions with commands like `C-.' and just hit RET without typing any characters, the match under point will be chosen instead of the commit de7a741c7bb16b4d445e0517d9c51aba605d2215 Author: Lars Ingebrigtsen Date: Sun Dec 6 13:43:47 2020 +0100 Revert "Clarify icomplete-show-matches-on-no-input doc string" This reverts commit f352c57972d24464a42ea3e65dc8ac07d8e0517c. The new explanation of what icomplete does is wrong. diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 9c1470812a..4e546807b7 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -75,12 +75,7 @@ everything preceding the ~/ is discarded so the interactive selection process starts again from the user's $HOME.") (defcustom icomplete-show-matches-on-no-input nil - "If nil, don't wait for completions before showing the prompt. -Instead, when there's no input, completions may be displayed -asynchronously later, when the completions have been computed. - -If non-nil, always compute the completions first. - + "When non-nil, show completions when first prompting for input. This also means that if you traverse the list of completions with commands like `C-.' and just hit RET without typing any characters, the match under point will be chosen instead of the commit d6d871a1a266421f1c47df57bde5b0da54dfe352 Author: Mattias Engdegård Date: Mon Dec 7 10:15:59 2020 +0100 Calc: simplify integer log2 and power of 2 We have bignums and fast primitives now; no caches are needed. * lisp/calc/calc-bin.el (math-power-of-2-cache) (math-big-power-of-2-cache): Remove. (math-power-of-2, math-integer-log2): Simplify. (calcFunc-ash): Don't call math-power-of-2 with negative argument. diff --git a/lisp/calc/calc-bin.el b/lisp/calc/calc-bin.el index e3b1013b9a..6d93587234 100644 --- a/lisp/calc/calc-bin.el +++ b/lisp/calc/calc-bin.el @@ -199,48 +199,16 @@ (message "Omitting leading zeros on integers")))) -(defvar math-power-of-2-cache (list 1 2 4 8 16 32 64 128 256 512 1024)) -(defvar math-big-power-of-2-cache nil) (defun math-power-of-2 (n) ; [I I] [Public] - (if (and (natnump n) (<= n 100)) - (or (nth n math-power-of-2-cache) - (let* ((i (length math-power-of-2-cache)) - (val (nth (1- i) math-power-of-2-cache))) - (while (<= i n) - (setq val (math-mul val 2) - math-power-of-2-cache (nconc math-power-of-2-cache - (list val)) - i (1+ i))) - val)) - (let ((found (assq n math-big-power-of-2-cache))) - (if found - (cdr found) - (let ((po2 (math-ipow 2 n))) - (setq math-big-power-of-2-cache - (cons (cons n po2) math-big-power-of-2-cache)) - po2))))) + (if (natnump n) + (ash 1 n) + (error "argument must be a natural number"))) (defun math-integer-log2 (n) ; [I I] [Public] - (let ((i 0) - (p math-power-of-2-cache) - val) - (while (and p (< (setq val (car p)) n)) - (setq p (cdr p) - i (1+ i))) - (if p - (and (equal val n) - i) - (while (< - (prog1 - (setq val (math-mul val 2)) - (setq math-power-of-2-cache (nconc math-power-of-2-cache - (list val)))) - n) - (setq i (1+ i))) - (and (equal val n) - i)))) - - + (and (natnump n) + (not (zerop n)) + (zerop (logand n (1- n))) + (logb n))) ;;; Bitwise operations. @@ -404,7 +372,7 @@ (math-clip (calcFunc-ash a n (- w)) w) (if (Math-integer-negp a) (setq a (math-clip a w))) - (let ((two-to-sizem1 (math-power-of-2 (1- w))) + (let ((two-to-sizem1 (and (not (zerop w)) (math-power-of-2 (1- w)))) (sh (calcFunc-lsh a n w))) (cond ((or (zerop w) (zerop (logand a two-to-sizem1))) commit 5d04ee50853adbcb45c5f7bc980ee06a7eb23e5e Author: Mattias Engdegård Date: Mon Dec 7 10:12:00 2020 +0100 * doc/misc/calc.texi (Predefined Units): Prune outdated kg text. diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 6a6f585ce2..1fa13e98b3 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -28047,13 +28047,7 @@ defined as the distance that light will travel in a vacuum in vacuum is exactly 299792458 m/s. Many other units have been redefined in terms of fundamental physical processes; a second, for example, is currently defined as 9192631770 periods of a certain -radiation related to the cesium-133 atom. The only SI unit that is not -based on a fundamental physical process (although there are efforts to -change this) is the kilogram, which was originally defined as the mass -of one liter of water, but is now defined as the mass of the -international prototype of the kilogram (IPK), a cylinder of platinum-iridium -kept at the Bureau international des poids et mesures in Sèvres, -France. (There are several copies of the IPK throughout the world.) +radiation related to the cesium-133 atom. The British imperial units, once defined in terms of physical objects, were redefined in 1963 in terms of SI units. The US customary units, which were the same as British units until the British imperial system commit 2d989e81b730061397501033f355cbb300894573 Author: Philipp Stephani Date: Mon Dec 7 11:57:17 2020 +0100 Unbreak a few unit tests that rely on lack of backtraces * test/lisp/emacs-lisp/gv-tests.el (gv-dont-define-expander-in-file) (gv-dont-define-expander-other-file): * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-with-default-config): Suppress backtraces in batch mode to unbreak unit tests. diff --git a/test/lisp/emacs-lisp/edebug-tests.el b/test/lisp/emacs-lisp/edebug-tests.el index 8aae26a1ac..2c340c4440 100644 --- a/test/lisp/emacs-lisp/edebug-tests.el +++ b/test/lisp/emacs-lisp/edebug-tests.el @@ -97,7 +97,10 @@ back to the top level.") ;; sit-on interferes with keyboard macros. (edebug-sit-on-break nil) - (edebug-continue-kbd-macro t)) + (edebug-continue-kbd-macro t) + + ;; don't print backtraces, otherwise error messages don't match + (backtrace-on-error-noninteractive nil)) ,@body)) (defmacro edebug-tests-with-normal-env (&rest body) diff --git a/test/lisp/emacs-lisp/gv-tests.el b/test/lisp/emacs-lisp/gv-tests.el index 29e4273b47..8fc6b51469 100644 --- a/test/lisp/emacs-lisp/gv-tests.el +++ b/test/lisp/emacs-lisp/gv-tests.el @@ -83,7 +83,10 @@ (with-temp-buffer (call-process (concat invocation-directory invocation-name) nil '(t t) nil - "-Q" "-batch" "--eval" (prin1-to-string `(byte-compile-file ,el)) + "-Q" "-batch" + "--eval" (prin1-to-string + `(let ((backtrace-on-error-noninteractive nil)) + (byte-compile-file ,el))) "-l" elc) (should (equal (buffer-string) "Symbol's function definition is void: \\(setf\\ gv-test-foo\\)\n"))))) @@ -133,8 +136,10 @@ "-Q" "-batch" "--eval" (prin1-to-string `(byte-compile-file ,el)) "-l" elc "--eval" - (prin1-to-string '(progn (setf (gv-test-foo gv-test-pair) 99) - (message "%d" (car gv-test-pair))))) + (prin1-to-string + '(let ((backtrace-on-error-noninteractive nil)) + (setf (gv-test-foo gv-test-pair) 99) + (message "%d" (car gv-test-pair))))) (should (string-match "\\`Symbol.s function definition is void: \\\\(setf\\\\ gv-test-foo\\\\)\n\\'" (buffer-string)))))) commit 3970f4ac405516ad3d1aba5079c0754ec1dc5da1 Author: Philipp Stephani Date: Mon Dec 7 11:55:29 2020 +0100 Add new variable to selectively suppress backtraces in batch mode. * src/eval.c (syms_of_eval): Define new variable 'backtrace-on-error-noninteractive' to selectively enable backtrace printing in batch mode. (signal_or_quit): Use it. * etc/NEWS: Document new variable. * test/src/eval-tests.el (eval-tests/backtrace-in-batch-mode/inhibit): New unit test. diff --git a/etc/NEWS b/etc/NEWS index 8390c82c98..a30355f20d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -193,7 +193,9 @@ These functions return the connection local value of the respective variables. This can be used for remote hosts. ** Emacs now prints a backtrace when signaling an error in batch mode. This -makes debugging Emacs Lisp scripts run in batch mode easier. +makes debugging Emacs Lisp scripts run in batch mode easier. If you +want to disable this behavior, set 'backtrace-on-error-noninteractive' +to nil. * Editing Changes in Emacs 28.1 diff --git a/src/eval.c b/src/eval.c index 18df484aac..1351d283c5 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1735,7 +1735,8 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object data, bool keyboard_quit) debugging. Make sure to use `debug' unconditionally to not interfere with ERT or other packages that install custom debuggers. */ if (!debugger_called && !NILP (error_symbol) - && (NILP (clause) || EQ (h->tag_or_ch, Qerror)) && noninteractive) + && (NILP (clause) || EQ (h->tag_or_ch, Qerror)) && noninteractive + && backtrace_on_error_noninteractive) { ptrdiff_t count = SPECPDL_INDEX (); specbind (Vdebugger, Qdebug); @@ -4264,6 +4265,12 @@ Note that `debug-on-error', `debug-on-quit' and friends still determine whether to handle the particular condition. */); Vdebug_on_signal = Qnil; + DEFVAR_BOOL ("backtrace-on-error-noninteractive", + backtrace_on_error_noninteractive, + doc: /* If non-nil and Emacs is running noninteractively, +print a backtrace on encountering an unhandled error. */); + backtrace_on_error_noninteractive = true; + /* The value of num_nonmacro_input_events as of the last time we started to enter the debugger. If we decide to enter the debugger again when this is still equal to num_nonmacro_input_events, then we diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el index 4125573dc6..297db81f5a 100644 --- a/test/src/eval-tests.el +++ b/test/src/eval-tests.el @@ -195,6 +195,23 @@ expressions works for identifiers starting with period." (search-forward " foo()") (search-forward " normal-top-level()"))))) +(ert-deftest eval-tests/backtrace-in-batch-mode/inhibit () + (let ((emacs (expand-file-name invocation-name invocation-directory))) + (skip-unless (file-executable-p emacs)) + (with-temp-buffer + (let ((status (call-process + emacs nil t nil + "--quick" "--batch" + (concat "--eval=" + (prin1-to-string + '(progn + (defun foo () (error "Boo")) + (let ((backtrace-on-error-noninteractive nil)) + (foo)))))))) + (should (natnump status)) + (should-not (eql status 0))) + (should (equal (string-trim (buffer-string)) "Boo"))))) + (ert-deftest eval-tests/backtrace-in-batch-mode/demoted-errors () (let ((emacs (expand-file-name invocation-name invocation-directory))) (skip-unless (file-executable-p emacs)) commit 2187b805d1621e187b38e029e64c1f49c881737a Author: Stefan Kangas Date: Mon Dec 7 11:19:15 2020 +0100 * lisp/ielm.el (inferior-emacs-lisp-mode): Prefer setq-local. diff --git a/lisp/ielm.el b/lisp/ielm.el index 91d025dd5d..b958389ea5 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -529,8 +529,8 @@ Customized bindings may be defined in `ielm-map', which currently contains: :syntax-table emacs-lisp-mode-syntax-table (setq comint-prompt-regexp (concat "^" (regexp-quote ielm-prompt))) - (set (make-local-variable 'paragraph-separate) "\\'") - (set (make-local-variable 'paragraph-start) comint-prompt-regexp) + (setq-local paragraph-separate "\\'") + (setq-local paragraph-start comint-prompt-regexp) (setq comint-input-sender 'ielm-input-sender) (setq comint-process-echoes nil) (dolist (f '(elisp-completion-at-point @@ -541,28 +541,28 @@ Customized bindings may be defined in `ielm-map', which currently contains: #'elisp-eldoc-var-docstring nil t) (add-hook 'eldoc-documentation-functions #'elisp-eldoc-funcall nil t) - (set (make-local-variable 'ielm-prompt-internal) ielm-prompt) - (set (make-local-variable 'comint-prompt-read-only) ielm-prompt-read-only) + (setq-local ielm-prompt-internal ielm-prompt) + (setq-local comint-prompt-read-only ielm-prompt-read-only) (setq comint-get-old-input 'ielm-get-old-input) - (set (make-local-variable 'comint-completion-addsuffix) '("/" . "")) + (setq-local comint-completion-addsuffix '("/" . "")) (setq mode-line-process '(":%s on " (:eval (buffer-name ielm-working-buffer)))) ;; Useful for `hs-minor-mode'. (setq-local comment-start ";") (setq-local comment-use-syntax t) (setq-local lexical-binding t) - (set (make-local-variable 'indent-line-function) #'ielm-indent-line) - (set (make-local-variable 'ielm-working-buffer) (current-buffer)) - (set (make-local-variable 'fill-paragraph-function) #'lisp-fill-paragraph) + (setq-local indent-line-function #'ielm-indent-line) + (setq-local ielm-working-buffer (current-buffer)) + (setq-local fill-paragraph-function #'lisp-fill-paragraph) ;; Value holders - (set (make-local-variable '*) nil) - (set (make-local-variable '**) nil) - (set (make-local-variable '***) nil) - (set (make-local-variable 'ielm-match-data) nil) + (setq-local * nil) + (setq-local ** nil) + (setq-local *** nil) + (setq-local ielm-match-data nil) ;; font-lock support - (set (make-local-variable 'font-lock-defaults) + (setq-local font-lock-defaults '(ielm-font-lock-keywords nil nil ((?: . "w") (?- . "w") (?* . "w")))) ;; A dummy process to keep comint happy. It will never get any input @@ -577,7 +577,7 @@ Customized bindings may be defined in `ielm-map', which currently contains: ;; Lisp output can include raw characters that confuse comint's ;; carriage control code. - (set (make-local-variable 'comint-inhibit-carriage-motion) t) + (setq-local comint-inhibit-carriage-motion t) ;; Add a silly header (insert ielm-header) commit 6e0cac17b5624230a0c136346b35d35ebddb838a Author: Stefan Kangas Date: Mon Dec 7 11:16:37 2020 +0100 * lisp/ibuffer.el (ibuffer, ibuffer-mode): Prefer setq-local. diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 00ba868d78..7269af3fe0 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -2464,7 +2464,7 @@ FORMATS is the value to use for `ibuffer-formats'. (require 'ibuf-ext) (setq ibuffer-filter-groups filter-groups)) (when formats - (set (make-local-variable 'ibuffer-formats) formats)) + (setq-local ibuffer-formats formats)) (ibuffer-update nil) ;; Skip the group name by default. (ibuffer-forward-line 0 t) @@ -2683,7 +2683,7 @@ You may rearrange filter groups by using the usual pair `\\[ibuffer-kill-line]' and `\\[ibuffer-yank]'. Yanked groups will be inserted before the group at point." ;; Include state info next to the mode name. - (set (make-local-variable 'mode-line-process) + (setq-local mode-line-process '(" by " (ibuffer-sorting-mode (:eval (symbol-name ibuffer-sorting-mode)) "view time") @@ -2712,28 +2712,27 @@ will be inserted before the group at point." (setq show-trailing-whitespace nil) ;; disable `show-paren-mode' buffer-locally (if (bound-and-true-p show-paren-mode) - (set (make-local-variable 'show-paren-mode) nil)) - (set (make-local-variable 'revert-buffer-function) - #'ibuffer-update) - (set (make-local-variable 'ibuffer-sorting-mode) - ibuffer-default-sorting-mode) - (set (make-local-variable 'ibuffer-sorting-reversep) - ibuffer-default-sorting-reversep) - (set (make-local-variable 'ibuffer-shrink-to-minimum-size) - ibuffer-default-shrink-to-minimum-size) - (set (make-local-variable 'ibuffer-display-maybe-show-predicates) - ibuffer-default-display-maybe-show-predicates) - (set (make-local-variable 'ibuffer-filtering-qualifiers) nil) - (set (make-local-variable 'ibuffer-filter-groups) nil) - (set (make-local-variable 'ibuffer-filter-group-kill-ring) nil) - (set (make-local-variable 'ibuffer-hidden-filter-groups) nil) - (set (make-local-variable 'ibuffer-compiled-formats) nil) - (set (make-local-variable 'ibuffer-cached-formats) nil) - (set (make-local-variable 'ibuffer-cached-eliding-string) nil) - (set (make-local-variable 'ibuffer-current-format) nil) - (set (make-local-variable 'ibuffer-did-modification) nil) - (set (make-local-variable 'ibuffer-tmp-hide-regexps) nil) - (set (make-local-variable 'ibuffer-tmp-show-regexps) nil) + (setq-local show-paren-mode nil)) + (setq-local revert-buffer-function #'ibuffer-update) + (setq-local ibuffer-sorting-mode + ibuffer-default-sorting-mode) + (setq-local ibuffer-sorting-reversep + ibuffer-default-sorting-reversep) + (setq-local ibuffer-shrink-to-minimum-size + ibuffer-default-shrink-to-minimum-size) + (setq-local ibuffer-display-maybe-show-predicates + ibuffer-default-display-maybe-show-predicates) + (setq-local ibuffer-filtering-qualifiers nil) + (setq-local ibuffer-filter-groups nil) + (setq-local ibuffer-filter-group-kill-ring nil) + (setq-local ibuffer-hidden-filter-groups nil) + (setq-local ibuffer-compiled-formats nil) + (setq-local ibuffer-cached-formats nil) + (setq-local ibuffer-cached-eliding-string nil) + (setq-local ibuffer-current-format nil) + (setq-local ibuffer-did-modification nil) + (setq-local ibuffer-tmp-hide-regexps nil) + (setq-local ibuffer-tmp-show-regexps nil) (define-key ibuffer-mode-map [menu-bar edit] 'undefined) (define-key ibuffer-mode-map [menu-bar operate] (cons "Operate" ibuffer-mode-operate-map)) (ibuffer-update-format) commit 8a42354b0a00e47e13fa4068d99afef0e05da25e Author: Stefan Kangas Date: Mon Dec 7 11:14:22 2020 +0100 Prefer setq-local in whitespace.el * lisp/whitespace.el (whitespace-turn-on, whitespace-color-on): Prefer setq-local. diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 02ee7bcf7f..814f3e5a5f 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -1986,13 +1986,13 @@ resultant list will be returned." ;; prepare local hooks (add-hook 'write-file-functions 'whitespace-write-file-hook nil t) ;; create whitespace local buffer environment - (set (make-local-variable 'whitespace-font-lock-keywords) nil) - (set (make-local-variable 'whitespace-display-table) nil) - (set (make-local-variable 'whitespace-display-table-was-local) nil) - (set (make-local-variable 'whitespace-active-style) - (if (listp whitespace-style) - whitespace-style - (list whitespace-style))) + (setq-local whitespace-font-lock-keywords nil) + (setq-local whitespace-display-table nil) + (setq-local whitespace-display-table-was-local nil) + (setq-local whitespace-active-style + (if (listp whitespace-style) + whitespace-style + (list whitespace-style))) ;; turn on whitespace (when whitespace-active-style (whitespace-color-on) @@ -2034,19 +2034,14 @@ resultant list will be returned." "Turn on color visualization." (when (whitespace-style-face-p) ;; save current point and refontify when necessary - (set (make-local-variable 'whitespace-point) - (point)) + (setq-local whitespace-point (point)) (setq whitespace-point--used (let ((ol (make-overlay (point) (point) nil nil t))) (delete-overlay ol) ol)) - (set (make-local-variable 'whitespace-font-lock-refontify) - 0) - (set (make-local-variable 'whitespace-bob-marker) - (point-min-marker)) - (set (make-local-variable 'whitespace-eob-marker) - (point-max-marker)) - (set (make-local-variable 'whitespace-buffer-changed) - nil) + (setq-local whitespace-font-lock-refontify 0) + (setq-local whitespace-bob-marker (point-min-marker)) + (setq-local whitespace-eob-marker (point-max-marker)) + (setq-local whitespace-buffer-changed nil) (add-hook 'post-command-hook #'whitespace-post-command-hook nil t) (add-hook 'before-change-functions #'whitespace-buffer-changed nil t) ;; Add whitespace-mode color into font lock. commit 737d22f2953f680aa223f7ef1e55c91ffa6d9ec6 Author: Stefan Kangas Date: Mon Dec 7 11:10:22 2020 +0100 Prefer setq-local in tar-mode.el * lisp/tar-mode.el (tar-summarize-buffer, tar-mode, tar-extract): Prefer setq-local. diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el index d460c8a4f7..608d997863 100644 --- a/lisp/tar-mode.el +++ b/lisp/tar-mode.el @@ -588,7 +588,7 @@ For instance, if mode is #o700, then it produces `rwx------'." (setq pos (tar-header-data-end descriptor)) (progress-reporter-update progress-reporter pos))) - (set (make-local-variable 'tar-parse-info) (nreverse result)) + (setq-local tar-parse-info (nreverse result)) ;; A tar file should end with a block or two of nulls, ;; but let's not get a fatal error if it doesn't. (if (null descriptor) @@ -718,21 +718,21 @@ See also: variables `tar-update-datestamp' and `tar-anal-blocksize'. (file-writable-p buffer-file-name) (setq buffer-read-only nil)) ; undo what `special-mode' did (make-local-variable 'tar-parse-info) - (set (make-local-variable 'require-final-newline) nil) ; binary data, dude... - (set (make-local-variable 'local-enable-local-variables) nil) - (set (make-local-variable 'next-line-add-newlines) nil) - (set (make-local-variable 'tar-file-name-coding-system) - (or file-name-coding-system - default-file-name-coding-system - locale-coding-system)) + (setq-local require-final-newline nil) ; binary data, dude... + (setq-local local-enable-local-variables nil) + (setq-local next-line-add-newlines nil) + (setq-local tar-file-name-coding-system + (or file-name-coding-system + default-file-name-coding-system + locale-coding-system)) ;; Prevent loss of data when saving the file. - (set (make-local-variable 'file-precious-flag) t) + (setq-local file-precious-flag t) (buffer-disable-undo) (widen) ;; Now move the Tar data into an auxiliary buffer, so we can use the main ;; buffer for the summary. (cl-assert (not (tar-data-swapped-p))) - (set (make-local-variable 'revert-buffer-function) #'tar-mode-revert) + (setq-local revert-buffer-function #'tar-mode-revert) ;; We started using write-contents-functions, but this hook is not ;; used during auto-save, so we now use ;; write-region-annotate-functions which hooks at a lower-level. @@ -741,10 +741,10 @@ See also: variables `tar-update-datestamp' and `tar-anal-blocksize'. (add-hook 'change-major-mode-hook #'tar-change-major-mode-hook nil t) ;; Tar data is made of bytes, not chars. (set-buffer-multibyte nil) ;Hopefully a no-op. - (set (make-local-variable 'tar-data-buffer) - (generate-new-buffer (format " *tar-data %s*" - (file-name-nondirectory - (or buffer-file-name (buffer-name)))))) + (setq-local tar-data-buffer (generate-new-buffer + (format " *tar-data %s*" + (file-name-nondirectory + (or buffer-file-name (buffer-name)))))) (condition-case err (progn (tar-swap-data) @@ -1004,8 +1004,8 @@ return nil. Otherwise point is returned." default-directory)) (set-buffer-modified-p nil) (normal-mode) ; pick a mode. - (set (make-local-variable 'tar-superior-buffer) tar-buffer) - (set (make-local-variable 'tar-superior-descriptor) descriptor) + (setq-local tar-superior-buffer tar-buffer) + (setq-local tar-superior-descriptor descriptor) (setq buffer-read-only read-only-p) (tar-subfile-mode 1))) (cond commit 69f039bf6d89893f5d3da0de9e5f07d4923bccda Author: Stefan Kangas Date: Mon Dec 7 11:07:10 2020 +0100 Prefer setq-local in tcl.el * lisp/progmodes/tcl.el (tcl-mode, inferior-tcl-mode, inferior-tcl): (tcl-auto-fill-mode, tcl-guess-application): Prefer setq-local. diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index ff3fb9657d..dbf6684b0e 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el @@ -616,41 +616,39 @@ Turning on Tcl mode runs `tcl-mode-hook'. Read the documentation for `tcl-mode-hook' to see what kinds of interesting hook functions already exist." (unless (and (boundp 'filladapt-mode) filladapt-mode) - (set (make-local-variable 'paragraph-ignore-fill-prefix) t)) + (setq-local paragraph-ignore-fill-prefix t)) - (set (make-local-variable 'indent-line-function) #'tcl-indent-line) - (set (make-local-variable 'comment-indent-function) #'tcl-comment-indent) + (setq-local indent-line-function #'tcl-indent-line) + (setq-local comment-indent-function #'tcl-comment-indent) ;; Tcl doesn't require a final newline. - ;; (make-local-variable 'require-final-newline) - ;; (setq require-final-newline t) + ;; (setq-local require-final-newline t) - (set (make-local-variable 'comment-start) "# ") - (set (make-local-variable 'comment-start-skip) - "\\(\\(^\\|[;{[]\\)\\s-*\\)#+ *") - (set (make-local-variable 'comment-end) "") + (setq-local comment-start "# ") + (setq-local comment-start-skip + "\\(\\(^\\|[;{[]\\)\\s-*\\)#+ *") + (setq-local comment-end "") - (set (make-local-variable 'outline-regexp) ".") - (set (make-local-variable 'outline-level) 'tcl-outline-level) + (setq-local outline-regexp ".") + (setq-local outline-level 'tcl-outline-level) - (set (make-local-variable 'font-lock-defaults) - '(tcl-font-lock-keywords nil nil nil beginning-of-defun)) - (set (make-local-variable 'syntax-propertize-function) - tcl-syntax-propertize-function) + (setq-local font-lock-defaults + '(tcl-font-lock-keywords nil nil nil beginning-of-defun)) + (setq-local syntax-propertize-function + tcl-syntax-propertize-function) (add-hook 'syntax-propertize-extend-region-functions #'syntax-propertize-multiline 'append 'local) - (set (make-local-variable 'imenu-generic-expression) - tcl-imenu-generic-expression) + (setq-local imenu-generic-expression tcl-imenu-generic-expression) ;; Settings for new dabbrev code. - (set (make-local-variable 'dabbrev-case-fold-search) nil) - (set (make-local-variable 'dabbrev-case-replace) nil) - (set (make-local-variable 'dabbrev-abbrev-skip-leading-regexp) "[$!]") - (set (make-local-variable 'dabbrev-abbrev-char-regexp) "\\sw\\|\\s_") - - (set (make-local-variable 'parse-sexp-ignore-comments) t) - (set (make-local-variable 'defun-prompt-regexp) tcl-omit-ws-regexp) - (set (make-local-variable 'add-log-current-defun-function) + (setq-local dabbrev-case-fold-search nil) + (setq-local dabbrev-case-replace nil) + (setq-local dabbrev-abbrev-skip-leading-regexp "[$!]") + (setq-local dabbrev-abbrev-char-regexp "\\sw\\|\\s_") + + (setq-local parse-sexp-ignore-comments t) + (setq-local defun-prompt-regexp tcl-omit-ws-regexp) + (setq-local add-log-current-defun-function #'tcl-add-log-defun) (setq-local beginning-of-defun-function #'tcl-beginning-of-defun-function) @@ -1201,14 +1199,14 @@ Variables controlling Inferior Tcl mode: The following commands are available: \\{inferior-tcl-mode-map}" - (set (make-local-variable 'comint-prompt-regexp) - (or tcl-prompt-regexp - (concat "^" (regexp-quote tcl-application) ">"))) + (setq-local comint-prompt-regexp + (or tcl-prompt-regexp + (concat "^" (regexp-quote tcl-application) ">"))) (setq mode-line-process '(": %s")) (setq local-abbrev-table tcl-mode-abbrev-table) (set-syntax-table tcl-mode-syntax-table) - (set (make-local-variable 'defun-prompt-regexp) tcl-omit-ws-regexp) - (set (make-local-variable 'inferior-tcl-delete-prompt-marker) (make-marker)) + (setq-local defun-prompt-regexp tcl-omit-ws-regexp) + (setq-local inferior-tcl-delete-prompt-marker (make-marker)) (set-process-filter (get-buffer-process (current-buffer)) 'tcl-filter)) ;;;###autoload @@ -1229,7 +1227,7 @@ See documentation for function `inferior-tcl-mode' for more information." (unless (process-tty-name (inferior-tcl-proc)) (tcl-send-string (inferior-tcl-proc) "set ::tcl_interactive 1; concat\n"))) - (set (make-local-variable 'tcl-application) cmd) + (setq-local tcl-application cmd) (setq inferior-tcl-buffer "*inferior-tcl*") (pop-to-buffer "*inferior-tcl*")) @@ -1493,7 +1491,7 @@ Prefix argument means switch to the Tcl buffer afterwards." (interactive "P") (auto-fill-mode arg) (if auto-fill-function - (set (make-local-variable 'comment-auto-fill-only-comments) t) + (setq-local comment-auto-fill-only-comments t) (kill-local-variable 'comment-auto-fill-only-comments))) (defun tcl-electric-hash (&optional count) @@ -1574,7 +1572,7 @@ The first line is assumed to look like \"#!.../program ...\"." (save-excursion (goto-char (point-min)) (if (looking-at "#![^ \t]*/\\([^ \t\n/]+\\)\\([ \t]\\|$\\)") - (set (make-local-variable 'tcl-application) (match-string 1))))) + (setq-local tcl-application (match-string 1))))) (defun tcl-popup-menu (_e) "XEmacs menu support." commit 09b040cb58224cc1e57ab52b429a5b9309094766 Author: Michael Albinus Date: Mon Dec 7 10:38:24 2020 +0100 * lisp/net/tramp.el (tramp-read-passwd): Use connection-local `auth-sources'. * lisp/net/tramp-adb.el (tramp-adb-maybe-open-connection): * lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-maybe-open-connection): * lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection): Move setting of connection-local variables up. diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 4947d161f3..f6e89339b6 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -1260,6 +1260,9 @@ connection if a previous connection has died for some reason." (process-put p 'adjust-window-size-function #'ignore) (set-process-query-on-exit-flag p nil) + ;; Set connection-local variables. + (tramp-set-connection-local-variables vec) + ;; Change prompt. (tramp-set-connection-property p "prompt" (regexp-quote (format "///%s#$" prompt))) @@ -1312,9 +1315,6 @@ connection if a previous connection has died for some reason." (tramp-error vec 'file-error "Cannot switch to user `%s'" user))) - ;; Set connection-local variables. - (tramp-set-connection-local-variables vec) - ;; Mark it as connected. (tramp-set-connection-property p "connected" t))))))) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index f3d03d0fb0..c2028c4908 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -2112,7 +2112,10 @@ connection if a previous connection has died for some reason." :buffer (tramp-get-connection-buffer vec) :server t :host 'local :service t :noquery t))) (process-put p 'vector vec) - (set-process-query-on-exit-flag p nil))) + (set-process-query-on-exit-flag p nil) + + ;; Set connection-local variables. + (tramp-set-connection-local-variables vec))) (unless (tramp-gvfs-connection-mounted-p vec) (let ((method (tramp-file-name-method vec)) @@ -2216,9 +2219,6 @@ connection if a previous connection has died for some reason." (and (functionp tramp-password-save-function) (funcall tramp-password-save-function))) - ;; Set connection-local variables. - (tramp-set-connection-local-variables vec) - ;; Mark it as connected. (tramp-set-connection-property (tramp-get-connection-process vec) "connected" t))))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 137f0857f7..79a7feae46 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -5030,6 +5030,9 @@ connection if a previous connection has died for some reason." (tramp-message vec 6 "%s" (string-join (process-command p) " ")) + ;; Set connection-local variables. + (tramp-set-connection-local-variables vec) + ;; Check whether process is alive. (tramp-barf-if-no-shell-prompt p 10 @@ -5139,9 +5142,6 @@ connection if a previous connection has died for some reason." (setq options "" target-alist (cdr target-alist))) - ;; Set connection-local variables. - (tramp-set-connection-local-variables vec) - ;; Activate session timeout. (when (tramp-get-connection-property p "session-timeout" nil) (run-at-time diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index e521371332..83c1b58a30 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -2040,6 +2040,9 @@ If ARGUMENT is non-nil, use it as argument for (process-put p 'adjust-window-size-function #'ignore) (set-process-query-on-exit-flag p nil) + ;; Set connection-local variables. + (tramp-set-connection-local-variables vec) + (condition-case err (let ((inhibit-message t)) ;; Play login scenario. @@ -2073,9 +2076,6 @@ If ARGUMENT is non-nil, use it as argument for (tramp-set-connection-property p "smb-share" share) (tramp-set-connection-property p "chunksize" 1) - ;; Set connection-local variables. - (tramp-set-connection-local-variables vec) - ;; Mark it as connected. (tramp-set-connection-property p "connected" t)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index b3853aa3d6..6750a7ff4c 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -5210,6 +5210,8 @@ Invokes `password-read' if available, `read-passwd' else." (tramp-check-for-regexp proc tramp-password-prompt-regexp) (format "%s for %s " (capitalize (match-string 1)) key)))) (auth-source-creation-prompts `((secret . ,pw-prompt))) + ;; Use connection-local value. + (auth-sources (with-current-buffer (process-buffer proc) auth-sources)) ;; We suspend the timers while reading the password. (stimers (with-timeout-suspend)) auth-info auth-passwd) @@ -5250,7 +5252,7 @@ Invokes `password-read' if available, `read-passwd' else." (setq auth-passwd (funcall auth-passwd))) auth-passwd) - ;; Try the password cache. + ;; Try the password cache. Exists since Emacs 26.1. (progn (setq auth-passwd (password-read pw-prompt key) tramp-password-save-function commit 300c581370073fbaad025465edc39bcbfe5e7c81 Author: Stefan Monnier Date: Sun Dec 6 22:18:48 2020 -0500 * lisp/emacs-lisp/lisp-mode.el: Give paren syntax to [...] in lisp-data-mode (lisp-data-mode-syntax-table): Rename from lisp--mode-syntax-table. Adjust all users. Set [...] to have paren syntax. (lisp-data-mode): Don't set `lisp-syntax` arg any more * lisp/progmodes/elisp-mode.el (emacs-lisp-mode-syntax-table): Don't bother setting [...] to have paren syntax any more. * lisp/progmodes/inf-lisp.el (inferior-lisp-mode): Don't use `lisp-syntax` arg of lisp-mode-variables any more. diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 081ef8d441..e477ef1700 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -38,7 +38,7 @@ (define-abbrev-table 'lisp-mode-abbrev-table () "Abbrev table for Lisp mode.") -(defvar lisp--mode-syntax-table +(defvar lisp-data-mode-syntax-table (let ((table (make-syntax-table)) (i 0)) (while (< i ?0) @@ -77,11 +77,13 @@ (modify-syntax-entry ?\\ "\\ " table) (modify-syntax-entry ?\( "() " table) (modify-syntax-entry ?\) ")( " table) + (modify-syntax-entry ?\[ "(]" table) + (modify-syntax-entry ?\] ")[" table) table) "Parent syntax table used in Lisp modes.") (defvar lisp-mode-syntax-table - (let ((table (make-syntax-table lisp--mode-syntax-table))) + (let ((table (make-syntax-table lisp-data-mode-syntax-table))) (modify-syntax-entry ?\[ "_ " table) (modify-syntax-entry ?\] "_ " table) (modify-syntax-entry ?# "' 14" table) @@ -669,7 +671,7 @@ font-lock keywords will not be case sensitive." (define-derived-mode lisp-data-mode prog-mode "Lisp-Data" "Major mode for buffers holding data written in Lisp syntax." :group 'lisp - (lisp-mode-variables t t nil) + (lisp-mode-variables nil t nil) (setq-local electric-quote-string t) (setq imenu-case-fold-search nil)) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 12788eacf1..fa360a8f3f 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -38,9 +38,10 @@ It has `lisp-mode-abbrev-table' as its parent." :parents (list lisp-mode-abbrev-table)) (defvar emacs-lisp-mode-syntax-table - (let ((table (make-syntax-table lisp--mode-syntax-table))) - (modify-syntax-entry ?\[ "(] " table) - (modify-syntax-entry ?\] ")[ " table) + (let ((table (make-syntax-table lisp-data-mode-syntax-table))) + ;; These are redundant, now. + ;;(modify-syntax-entry ?\[ "(] " table) + ;;(modify-syntax-entry ?\] ")[ " table) table) "Syntax table used in `emacs-lisp-mode'.") diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el index 59db646ff3..93d5d0fbcc 100644 --- a/lisp/progmodes/inf-lisp.el +++ b/lisp/progmodes/inf-lisp.el @@ -124,9 +124,9 @@ mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword (define-key lisp-mode-map "\C-c\C-v" 'lisp-show-variable-documentation) -;;; This function exists for backwards compatibility. -;;; Previous versions of this package bound commands to C-c -;;; bindings, which is not allowed by the Emacs standard. +;; This function exists for backwards compatibility. +;; Previous versions of this package bound commands to C-c +;; bindings, which is not allowed by the Emacs standard. ;;; "This function binds many inferior-lisp commands to C-c bindings, ;;;where they are more accessible. C-c bindings are reserved for the @@ -274,7 +274,8 @@ If you accidentally suspend your process, use \\[comint-continue-subjob] to continue it." (setq comint-prompt-regexp inferior-lisp-prompt) (setq mode-line-process '(":%s")) - (lisp-mode-variables t) + (lisp-mode-variables) + (set-syntax-table lisp-mode-syntax-table) (setq comint-get-old-input (function lisp-get-old-input)) (setq comint-input-filter (function lisp-input-filter))) commit c13b4fa61e7ae9ce5baa05496243f632f26bcd9a Author: Mattias Engdegård Date: Sun Dec 6 23:35:09 2020 +0100 Remove Calc bignum remnants * lisp/calc/calc-macs.el (Math-natnum-lessp): * lisp/calc/calc-ext.el (math-norm-bignum, math-compare-bignum): * lisp/calc/calc-math.el (math-zerop-bignum) (math-scale-bignum-digit-size): Remove. * lisp/calc/calc-bin.el (math-integer-log2, calcFunc-rot, math-clip): * lisp/calc/calc-comb.el (math-prime-test, calcFunc-prfac) (calcFunc-totient, calcFunc-moebius): * lisp/calc/calc-ext.el (math-gcd): * lisp/calc/calc-funcs.el (calcFunc-betaB): * lisp/calc/calc-math.el (math-nth-root-int-iter, calcFunc-ilog): Replace Math-natnum-lessp with <. diff --git a/lisp/calc/calc-bin.el b/lisp/calc/calc-bin.el index 60dd17e5ed..e3b1013b9a 100644 --- a/lisp/calc/calc-bin.el +++ b/lisp/calc/calc-bin.el @@ -224,13 +224,13 @@ (let ((i 0) (p math-power-of-2-cache) val) - (while (and p (Math-natnum-lessp (setq val (car p)) n)) + (while (and p (< (setq val (car p)) n)) (setq p (cdr p) i (1+ i))) (if p (and (equal val n) i) - (while (Math-natnum-lessp + (while (< (prog1 (setq val (math-mul val 2)) (setq math-power-of-2-cache (nconc math-power-of-2-cache @@ -438,7 +438,7 @@ (if (Math-integer-negp a) (setq a (math-clip a w))) (cond ((or (Math-integer-negp n) - (not (Math-natnum-lessp n w))) + (>= n w)) (calcFunc-rot a (math-mod n w) w)) (t (math-add (calcFunc-lsh a (- n w) w) @@ -455,7 +455,7 @@ (math-reject-arg a 'integerp)) ((< (or w (setq w calc-word-size)) 0) (setq a (math-clip a (- w))) - (if (Math-natnum-lessp a (math-power-of-2 (- -1 w))) + (if (< a (math-power-of-2 (- -1 w))) a (math-sub a (math-power-of-2 (- w))))) ((math-zerop w) diff --git a/lisp/calc/calc-comb.el b/lisp/calc/calc-comb.el index 5aeb8cba0d..0f6c40a663 100644 --- a/lisp/calc/calc-comb.el +++ b/lisp/calc/calc-comb.el @@ -815,7 +815,7 @@ (error "Argument must be an integer")) ((Math-integer-negp n) '(nil)) - ((Math-natnum-lessp n 8000000) + ((< n 8000000) (let ((i -1) v) (while (and (> (% n (setq v (aref math-primes-table (setq i (1+ i))))) @@ -913,7 +913,7 @@ (if (Math-messy-integerp n) (setq n (math-trunc n))) (if (Math-natnump n) - (if (Math-natnum-lessp 2 n) + (if (< 2 n) (let (factors res p (i 0)) (while (and (not (eq n 1)) (< i (length math-primes-table))) @@ -927,7 +927,7 @@ (setq factors (nconc factors (list p)) n (car res))) (or (eq n 1) - (Math-natnum-lessp p (car res)) + (< p (car res)) (setq factors (nconc factors (list n)) n 1)) (setq i (1+ i))) @@ -946,7 +946,7 @@ (if (Math-messy-integerp n) (setq n (math-trunc n))) (if (Math-natnump n) - (if (Math-natnum-lessp n 2) + (if (< n 2) (if (Math-negp n) (calcFunc-totient (math-abs n)) n) @@ -969,7 +969,7 @@ (if (Math-messy-integerp n) (setq n (math-trunc n))) (if (and (Math-natnump n) (not (eq n 0))) - (if (Math-natnum-lessp n 2) + (if (< n 2) (if (Math-negp n) (calcFunc-moebius (math-abs n)) 1) diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 4877fa6e08..7984c8bbaa 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -2417,17 +2417,6 @@ If X is not an error form, return 1." (mapcar #'math-normalize (cdr a)))))) -;;; Normalize a bignum digit list by trimming high-end zeros. [L l] -(defun math-norm-bignum (a) - (let ((digs a) (last nil)) - (while digs - (or (eq (car digs) 0) (setq last digs)) - (setq digs (cdr digs))) - (and last - (progn - (setcdr last nil) - a)))) - ;;; Return 0 for zero, -1 for negative, 1 for positive. [S n] [Public] (defun calcFunc-sign (a &optional x) (let ((signs (math-possible-signs a))) @@ -2542,23 +2531,6 @@ If X is not an error form, return 1." 0 2)))) -;;; Compare two bignum digit lists, return -1 for AB. -(defun math-compare-bignum (a b) ; [S l l] - (let ((res 0)) - (while (and a b) - (if (< (car a) (car b)) - (setq res -1) - (if (> (car a) (car b)) - (setq res 1))) - (setq a (cdr a) - b (cdr b))) - (if a - (progn - (while (eq (car a) 0) (setq a (cdr a))) - (if a 1 res)) - (while (eq (car b) 0) (setq b (cdr b))) - (if b -1 res)))) - (defun math-compare-lists (a b) (cond ((null a) (null b)) ((null b) nil) @@ -2685,7 +2657,7 @@ If X is not an error form, return 1." (if (Math-integer-negp a) (setq a (math-neg a))) (if (Math-integer-negp b) (setq b (math-neg b))) (let (c) - (if (Math-natnum-lessp a b) + (if (< a b) (setq c b b a a c)) (while (and (consp a) (not (eq b 0))) (setq c b diff --git a/lisp/calc/calc-funcs.el b/lisp/calc/calc-funcs.el index 9ee86e755e..fd544f9719 100644 --- a/lisp/calc/calc-funcs.el +++ b/lisp/calc/calc-funcs.el @@ -410,7 +410,7 @@ ((and (math-num-integerp b) (if (math-negp b) (math-reject-arg b 'range) - (Math-natnum-lessp (setq b (math-trunc b)) 20))) + (< (setq b (math-trunc b)) 20))) (and calc-symbolic-mode (or (math-floatp a) (math-floatp b)) (math-inexact-result)) (math-mul @@ -427,7 +427,7 @@ ((and (math-num-integerp a) (if (math-negp a) (math-reject-arg a 'range) - (Math-natnum-lessp (setq a (math-trunc a)) 20))) + (< (setq a (math-trunc a)) 20))) (math-sub (or math-current-beta-value (calcFunc-beta a b)) (calcFunc-betaB (math-sub 1 x) b a))) (t diff --git a/lisp/calc/calc-macs.el b/lisp/calc/calc-macs.el index 06ef3ef055..a15095e375 100644 --- a/lisp/calc/calc-macs.el +++ b/lisp/calc/calc-macs.el @@ -29,7 +29,6 @@ (declare-function math-looks-negp "calc-misc" (a)) (declare-function math-posp "calc-misc" (a)) (declare-function math-compare "calc-ext" (a b)) -(declare-function math-compare-bignum "calc-ext" (a b)) (defmacro calc-wrapper (&rest body) @@ -174,13 +173,6 @@ (eq (nth 1 a) b) (= (nth 2 a) 0)))) -(defsubst Math-natnum-lessp (a b) - (if (consp a) - (and (consp b) - (= (math-compare-bignum (cdr a) (cdr b)) -1)) - (or (consp b) - (< a b)))) - (provide 'calc-macs) ;;; calc-macs.el ends here diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el index 46172d1b7f..1d0d94e992 100644 --- a/lisp/calc/calc-math.el +++ b/lisp/calc/calc-math.el @@ -370,18 +370,6 @@ If this can't be done, return NIL." (math-isqrt (math-floor a)) (math-floor (math-sqrt a)))) -(defun math-zerop-bignum (a) - (and (eq (car a) 0) - (progn - (while (eq (car (setq a (cdr a))) 0)) - (null a)))) - -(defun math-scale-bignum-digit-size (a n) ; [L L S] - (while (> n 0) - (setq a (cons 0 a) - n (1- n))) - a) - ;;; Compute the square root of a number. ;;; [T N] if possible, else [F N] if possible, else [C N]. [Public] (defun math-sqrt (a) @@ -666,7 +654,7 @@ If this can't be done, return NIL." (let* ((q (math-idivmod a (math-ipow guess (1- math-nri-n)))) (s (math-add (car q) (math-mul (1- math-nri-n) guess))) (g2 (math-idivmod s math-nri-n))) - (if (Math-natnum-lessp (car g2) guess) + (if (< (car g2) guess) (math-nth-root-int-iter a (car g2)) (cons (and (equal (car g2) guess) (eq (cdr q) 0) @@ -1615,7 +1603,7 @@ If this can't be done, return NIL." (math-natnump b) (not (eq b 0))) (if (eq b 1) (math-reject-arg x "*Logarithm base one") - (if (Math-natnum-lessp x b) + (if (< x b) 0 (cdr (math-integer-log x b)))) (math-floor (calcFunc-log x b)))) commit f13ae2bb955bfbf8946bf3c9eab8693c8af4287d Author: Juri Linkov Date: Sun Dec 6 23:19:23 2020 +0200 * lisp/vc/vc-git.el: Update args of backend API calls in the header comments https://lists.gnu.org/archive/html/emacs-devel/2020-12/msg00283.html diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 0da4509670..84c964e7f5 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -72,7 +72,7 @@ ;; by git, so it's probably ;; not a good idea. ;; - merge-news (file) see `merge-file' -;; - mark-resolved (file) OK +;; - mark-resolved (files) OK ;; - steal-lock (file &optional revision) NOT NEEDED ;; HISTORY FUNCTIONS ;; * print-log (files buffer &optional shortlog start-revision limit) OK commit 3fe6cea6e0e1d75fae91037077adf8eb40c9b040 Author: Juri Linkov Date: Sun Dec 6 23:18:13 2020 +0200 * lisp/vc/vc.el: Update args of backend API calls in the header comments https://lists.gnu.org/archive/html/emacs-devel/2020-12/msg00283.html diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index fe66641316..d0fb794e01 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -201,7 +201,7 @@ ;; ;; STATE-CHANGING FUNCTIONS ;; -;; * create-repo (backend) +;; * create-repo () ;; ;; Create an empty repository in the current directory and initialize ;; it so VC mode can add files to it. For file-oriented systems, this @@ -275,7 +275,7 @@ ;; If FILE is in the `added' state it should be returned to the ;; `unregistered' state. ;; -;; - merge-file (file rev1 rev2) +;; - merge-file (file &optional rev1 rev2) ;; ;; Merge the changes between REV1 and REV2 into the current working ;; file (for non-distributed VCS). It is expected that with an @@ -333,19 +333,19 @@ ;; the case). Not all backends support this. At present, this is ;; only ever used with LIMIT = 1 (by vc-annotate-show-log-revision-at-line). ;; -;; * log-outgoing (backend remote-location) +;; * log-outgoing (buffer remote-location) ;; ;; Insert in BUFFER the revision log for the changes that will be ;; sent when performing a push operation to REMOTE-LOCATION. ;; -;; * log-incoming (backend remote-location) +;; * log-incoming (buffer remote-location) ;; ;; Insert in BUFFER the revision log for the changes that will be ;; received when performing a pull operation from REMOTE-LOCATION. ;; -;; - log-search (pattern) +;; - log-search (buffer pattern) ;; -;; Search for PATTERN in the revision log. +;; Search for PATTERN in the revision log and output results into BUFFER. ;; ;; - log-view-mode () ;; @@ -478,7 +478,7 @@ ;; ;; Return the root of the VC controlled hierarchy for file. ;; -;; - ignore (file &optional directory) +;; - ignore (file &optional directory remove) ;; ;; Ignore FILE under DIRECTORY (default is 'default-directory'). ;; FILE is a file wildcard relative to DIRECTORY. @@ -487,7 +487,7 @@ ;; When called from Lisp code, if DIRECTORY is non-nil, the ;; repository to use will be deduced by DIRECTORY. ;; -;; - ignore-completion-table +;; - ignore-completion-table (directory) ;; ;; Return the completion table for files ignored by the current ;; version control system, e.g., the entries in `.gitignore' and commit a40be60ec89d0eb75cd1e48793f85433de0d3e45 Author: Juri Linkov Date: Sun Dec 6 23:12:13 2020 +0200 Backport Handle read-char-from-minibuffer and y-or-n-p from pre-command-hook * lisp/subr.el (read-char-from-minibuffer-insert-char) (read-char-from-minibuffer-insert-other, y-or-n-p-insert-y) (y-or-n-p-insert-n, y-or-n-p-insert-other): Check for 'minibufferp' before executing the body. (read-char-from-minibuffer, y-or-n-p): Let-bind this-command before calling read-from-minibuffer. (Bug#45029) ; Do not merge to master. diff --git a/lisp/subr.el b/lisp/subr.el index d5cf7fb003..9081de55c7 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2697,20 +2697,22 @@ floating point support." "Insert the character you type in the minibuffer and exit. Discard all previous input before inserting and exiting the minibuffer." (interactive) - (delete-minibuffer-contents) - (insert last-command-event) - (exit-minibuffer)) + (when (minibufferp) + (delete-minibuffer-contents) + (insert last-command-event) + (exit-minibuffer))) (defun read-char-from-minibuffer-insert-other () "Handle inserting of a character other than allowed. Display an error on trying to insert a disallowed character. Also discard all previous input in the minibuffer." (interactive) - (delete-minibuffer-contents) - (ding) - (discard-input) - (minibuffer-message "Wrong answer") - (sit-for 2)) + (when (minibufferp) + (delete-minibuffer-contents) + (ding) + (discard-input) + (minibuffer-message "Wrong answer") + (sit-for 2))) (defvar empty-history) @@ -2737,6 +2739,8 @@ history." map) read-char-from-minibuffer-map-hash)) read-char-from-minibuffer-map)) + ;; Protect this-command when called from pre-command-hook (bug#45029) + (this-command this-command) (result (read-from-minibuffer prompt nil map nil (or history 'empty-history))) @@ -2791,28 +2795,31 @@ history." "Insert the answer \"y\" and exit the minibuffer of `y-or-n-p'. Discard all previous input before inserting and exiting the minibuffer." (interactive) - (delete-minibuffer-contents) - (insert "y") - (exit-minibuffer)) + (when (minibufferp) + (delete-minibuffer-contents) + (insert "y") + (exit-minibuffer))) (defun y-or-n-p-insert-n () "Insert the answer \"n\" and exit the minibuffer of `y-or-n-p'. Discard all previous input before inserting and exiting the minibuffer." (interactive) - (delete-minibuffer-contents) - (insert "n") - (exit-minibuffer)) + (when (minibufferp) + (delete-minibuffer-contents) + (insert "n") + (exit-minibuffer))) (defun y-or-n-p-insert-other () "Handle inserting of other answers in the minibuffer of `y-or-n-p'. Display an error on trying to insert a disallowed character. Also discard all previous input in the minibuffer." (interactive) - (delete-minibuffer-contents) - (ding) - (discard-input) - (minibuffer-message "Please answer y or n") - (sit-for 2)) + (when (minibufferp) + (delete-minibuffer-contents) + (ding) + (discard-input) + (minibuffer-message "Please answer y or n") + (sit-for 2))) (defvar empty-history) @@ -2865,6 +2872,8 @@ is nil and `use-dialog-box' is non-nil." (setq prompt (funcall padded prompt)) (let* ((empty-history '()) (enable-recursive-minibuffers t) + ;; Protect this-command when called from pre-command-hook (bug#45029) + (this-command this-command) (str (read-from-minibuffer prompt nil (make-composed-keymap y-or-n-p-map query-replace-map) commit 5204c7420b2e4dd2080c33796c987d67e44f5597 Author: Juri Linkov Date: Sun Dec 6 23:07:36 2020 +0200 Handle calling read-char-from-minibuffer and y-or-n-p from pre-command-hook * lisp/subr.el (read-char-from-minibuffer-insert-char) (read-char-from-minibuffer-insert-other, y-or-n-p-insert-y) (y-or-n-p-insert-n, y-or-n-p-insert-other): Check for 'minibufferp' before executing the body. (read-char-from-minibuffer, y-or-n-p): Let-bind this-command before calling read-from-minibuffer. (Bug#45029) diff --git a/lisp/subr.el b/lisp/subr.el index cf41f77f2d..2236e93484 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2745,20 +2745,22 @@ floating point support." "Insert the character you type in the minibuffer and exit. Discard all previous input before inserting and exiting the minibuffer." (interactive) - (delete-minibuffer-contents) - (insert last-command-event) - (exit-minibuffer)) + (when (minibufferp) + (delete-minibuffer-contents) + (insert last-command-event) + (exit-minibuffer))) (defun read-char-from-minibuffer-insert-other () "Handle inserting of a character other than allowed. Display an error on trying to insert a disallowed character. Also discard all previous input in the minibuffer." (interactive) - (delete-minibuffer-contents) - (ding) - (discard-input) - (minibuffer-message "Wrong answer") - (sit-for 2)) + (when (minibufferp) + (delete-minibuffer-contents) + (ding) + (discard-input) + (minibuffer-message "Wrong answer") + (sit-for 2))) (defvar empty-history) @@ -2802,6 +2804,8 @@ There is no need to explicitly add `help-char' to CHARS; map read-char-from-minibuffer-map-hash) map)) read-char-from-minibuffer-map)) + ;; Protect this-command when called from pre-command-hook (bug#45029) + (this-command this-command) (result (read-from-minibuffer prompt nil map nil (or history 'empty-history))) @@ -2856,28 +2860,31 @@ There is no need to explicitly add `help-char' to CHARS; "Insert the answer \"y\" and exit the minibuffer of `y-or-n-p'. Discard all previous input before inserting and exiting the minibuffer." (interactive) - (delete-minibuffer-contents) - (insert "y") - (exit-minibuffer)) + (when (minibufferp) + (delete-minibuffer-contents) + (insert "y") + (exit-minibuffer))) (defun y-or-n-p-insert-n () "Insert the answer \"n\" and exit the minibuffer of `y-or-n-p'. Discard all previous input before inserting and exiting the minibuffer." (interactive) - (delete-minibuffer-contents) - (insert "n") - (exit-minibuffer)) + (when (minibufferp) + (delete-minibuffer-contents) + (insert "n") + (exit-minibuffer))) (defun y-or-n-p-insert-other () "Handle inserting of other answers in the minibuffer of `y-or-n-p'. Display an error on trying to insert a disallowed character. Also discard all previous input in the minibuffer." (interactive) - (delete-minibuffer-contents) - (ding) - (discard-input) - (minibuffer-message "Please answer y or n") - (sit-for 2)) + (when (minibufferp) + (delete-minibuffer-contents) + (ding) + (discard-input) + (minibuffer-message "Please answer y or n") + (sit-for 2))) (defvar empty-history) @@ -2955,6 +2962,8 @@ is nil and `use-dialog-box' is non-nil." (let ((help-form msg)) ; lexically bound msg (help-form-show))))) map)) + ;; Protect this-command when called from pre-command-hook (bug#45029) + (this-command this-command) (str (read-from-minibuffer prompt nil keymap nil (or y-or-n-p-history-variable 'empty-history)))) commit 40e11743ca3803bdc2c6c612f35ab695efb3eb8b Author: Philipp Stephani Date: Sun Nov 29 14:24:57 2020 +0100 Print a backtrace on unhandled errors in batch mode (Bug#44942). * src/eval.c (signal_or_quit): Print a backtrace in batch mode if no error handler was found. * test/src/eval-tests.el (eval-tests/backtrace-in-batch-mode) (eval-tests/backtrace-in-batch-mode/demoted-errors): New unit tests. * etc/NEWS: Document change. diff --git a/etc/NEWS b/etc/NEWS index 525ed8b36e..8390c82c98 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -192,6 +192,9 @@ have been replaced with "chat.freenode.net" throughout Emacs. These functions return the connection local value of the respective variables. This can be used for remote hosts. +** Emacs now prints a backtrace when signaling an error in batch mode. This +makes debugging Emacs Lisp scripts run in batch mode easier. + * Editing Changes in Emacs 28.1 diff --git a/src/eval.c b/src/eval.c index d9a424b57a..18df484aac 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1709,6 +1709,7 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object data, bool keyboard_quit) break; } + bool debugger_called = false; if (/* Don't run the debugger for a memory-full error. (There is no room in memory to do that!) */ !NILP (error_symbol) @@ -1722,7 +1723,7 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object data, bool keyboard_quit) if requested". */ || EQ (h->tag_or_ch, Qerror))) { - bool debugger_called + debugger_called = maybe_call_debugger (conditions, error_symbol, data); /* We can't return values to code which signaled an error, but we can continue code which has signaled a quit. */ @@ -1730,6 +1731,18 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object data, bool keyboard_quit) return Qnil; } + /* If we're in batch mode, print a backtrace unconditionally to help with + debugging. Make sure to use `debug' unconditionally to not interfere with + ERT or other packages that install custom debuggers. */ + if (!debugger_called && !NILP (error_symbol) + && (NILP (clause) || EQ (h->tag_or_ch, Qerror)) && noninteractive) + { + ptrdiff_t count = SPECPDL_INDEX (); + specbind (Vdebugger, Qdebug); + call_debugger (list2 (Qerror, Fcons (error_symbol, data))); + unbind_to (count, Qnil); + } + if (!NILP (clause)) { Lisp_Object unwind_data diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el index 074f5be1ef..4125573dc6 100644 --- a/test/src/eval-tests.el +++ b/test/src/eval-tests.el @@ -27,6 +27,7 @@ (require 'ert) (eval-when-compile (require 'cl-lib)) +(require 'subr-x) (ert-deftest eval-tests--bug24673 () "Check that Bug#24673 has been fixed." @@ -176,4 +177,36 @@ in Common Lisp). Instead, make sure substitution in backquote expressions works for identifiers starting with period." (should (equal (let ((.x 'identity)) (eval `(,.x 'ok))) 'ok))) +(ert-deftest eval-tests/backtrace-in-batch-mode () + (let ((emacs (expand-file-name invocation-name invocation-directory))) + (skip-unless (file-executable-p emacs)) + (with-temp-buffer + (let ((status (call-process emacs nil t nil + "--quick" "--batch" + (concat "--eval=" + (prin1-to-string + '(progn + (defun foo () (error "Boo")) + (foo))))))) + (should (natnump status)) + (should-not (eql status 0))) + (goto-char (point-min)) + (ert-info ((concat "Process output:\n" (buffer-string))) + (search-forward " foo()") + (search-forward " normal-top-level()"))))) + +(ert-deftest eval-tests/backtrace-in-batch-mode/demoted-errors () + (let ((emacs (expand-file-name invocation-name invocation-directory))) + (skip-unless (file-executable-p emacs)) + (with-temp-buffer + (should (eql 0 (call-process emacs nil t nil + "--quick" "--batch" + (concat "--eval=" + (prin1-to-string + '(with-demoted-errors "Error: %S" + (error "Boo"))))))) + (goto-char (point-min)) + (should (equal (string-trim (buffer-string)) + "Error: (error \"Boo\")"))))) + ;;; eval-tests.el ends here commit 87a9fc6dcd8e364c9ae27da27fee439dc41c2e25 Author: Eli Zaretskii Date: Sun Dec 6 17:43:18 2020 +0200 Improve error message text of "C-x C-SPC" * lisp/simple.el (pop-global-mark): Mention the buffer name in the error message. Suggested by T.V Raman . diff --git a/lisp/simple.el b/lisp/simple.el index d73bc6b068..3c4f756230 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -6426,7 +6426,8 @@ for it.") (<= position (point-max))) (if widen-automatically (widen) - (error "Global mark position is outside accessible part of buffer"))) + (error "Global mark position is outside accessible part of buffer %s" + (buffer-name buffer)))) (goto-char position) (switch-to-buffer buffer))) commit 32090a3de4a32867aafeb905e5b134c72ec74175 Author: Eli Zaretskii Date: Sun Dec 6 15:54:37 2020 +0200 Improve documentation of streams in batch mode * doc/lispref/os.texi (Batch Mode): * doc/lispref/streams.texi (Input Streams, Output Streams): Better documentation of I/O streams in batch mode, with more cross-references. diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index b31ab87ff1..dad5d9966f 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -2609,14 +2609,14 @@ calls @var{function} with no arguments, or @samp{--eval=@var{form}}. Any Lisp program output that would normally go to the echo area, either using @code{message}, or using @code{prin1}, etc., with -@code{t} as the stream, goes instead to Emacs's standard descriptors -when in batch mode: @code{message} writes to the standard error -descriptor, while @code{prin1} and other print functions write to the -standard output. Similarly, input that would normally come from the -minibuffer is read from the standard input descriptor. Thus, Emacs -behaves much like a noninteractive application program. (The echo -area output that Emacs itself normally generates, such as command -echoing, is suppressed entirely.) +@code{t} as the stream (@pxref{Output Streams}), goes instead to +Emacs's standard descriptors when in batch mode: @code{message} writes +to the standard error descriptor, while @code{prin1} and other print +functions write to the standard output. Similarly, input that would +normally come from the minibuffer is read from the standard input +descriptor. Thus, Emacs behaves much like a noninteractive +application program. (The echo area output that Emacs itself normally +generates, such as command echoing, is suppressed entirely.) Non-ASCII text written to the standard output or error descriptors is by default encoded using @code{locale-coding-system} (@pxref{Locales}) diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi index 2cd61ad04f..f27eb0a19a 100644 --- a/doc/lispref/streams.texi +++ b/doc/lispref/streams.texi @@ -123,13 +123,13 @@ came from. In this case, it makes no difference what value @code{t} used as a stream means that the input is read from the minibuffer. In fact, the minibuffer is invoked once and the text given by the user is made into a string that is then used as the -input stream. If Emacs is running in batch mode, standard input is used -instead of the minibuffer. For example, +input stream. If Emacs is running in batch mode (@pxref{Batch Mode}), +standard input is used instead of the minibuffer. For example, @example (message "%s" (read t)) @end example -will read a Lisp expression from standard input and print the result -to standard output. +will in batch mode read a Lisp expression from standard input and +print the result to standard output. @item @code{nil} @cindex @code{nil} input stream @@ -392,13 +392,15 @@ is responsible for storing the characters wherever you want to put them. @item @code{t} @cindex @code{t} output stream -The output characters are displayed in the echo area. +The output characters are displayed in the echo area. If Emacs is +running in batch mode (@pxref{Batch Mode}), the output is written to +the standard output descriptor instead. @item @code{nil} @cindex @code{nil} output stream -@code{nil} specified as an output stream means to use the value of -@code{standard-output} instead; that value is the @dfn{default output -stream}, and must not be @code{nil}. +@code{nil} specified as an output stream means to use the value of the +@code{standard-output} variable instead; that value is the +@dfn{default output stream}, and must not be @code{nil}. @item @var{symbol} A symbol as output stream is equivalent to the symbol's function commit 2bd76cc107b415ccdebdfad3a2fad71e2adbaa51 Author: Michael Albinus Date: Sun Dec 6 14:24:13 2020 +0100 Make Tramp scripts more unique and robust * lisp/net/tramp-sh.el (tramp-uudecode, tramp-perl-file-truename) (tramp-perl-file-name-all-completions) (tramp-perl-file-attributes) (tramp-perl-directory-files-and-attributes) (tramp-perl-encode-with-module, tramp-perl-decode-with-module) (tramp-perl-encode, tramp-perl-decode, tramp-perl-pack) (tramp-perl-unpack, tramp-hexdump-encode, tramp-awk-encode) (tramp-hexdump-awk-encode, tramp-od-encode, tramp-od-awk-encode) (tramp-awk-decode): Use format specifiers supported by `tramp-expand-script'. Adapt docstring. (tramp-vc-registered-read-file-names): Adapt docstring. (tramp-sh-handle-file-local-copy): Let-bind local `default-directory'. (tramp-expand-script): New defun. (tramp-maybe-send-script, tramp-find-inline-encoding): Use it. (tramp-local-coding-commands): Simplify. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 1ce6542d1a..137f0857f7 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -480,7 +480,7 @@ The string is used in `tramp-methods'.") ;; Solaris: /usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin ;; GNU/Linux (Debian, Suse, RHEL): /bin:/usr/bin ;; FreeBSD, DragonFly: /usr/bin:/bin:/usr/sbin:/sbin: - beware trailing ":"! -;; Darwin: /usr/bin:/bin:/usr/sbin:/sbin +;; FreeBSD 12.1, Darwin: /usr/bin:/bin:/usr/sbin:/sbin ;; IRIX64: /usr/bin ;; QNAP QTS: --- ;; Hydra: /run/current-system/sw/bin:/bin:/usr/bin @@ -595,10 +595,12 @@ rm -f %t" "Shell function to implement `uudecode' to standard output. Many systems support `uudecode -o /dev/stdout' or `uudecode -o -' for this or `uudecode -p', but some systems don't, and for them -we have this shell function.") +we have this shell function. +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") (defconst tramp-perl-file-truename - "%s -e ' + "%p -e ' use File::Spec; use Cwd \"realpath\"; @@ -633,14 +635,14 @@ if (!$result) { $result =~ s/\"/\\\\\"/g; print \"\\\"$result\\\"\\n\"; -' \"$1\" 2>/dev/null" +' \"$1\" %n" "Perl script to produce output suitable for use with `file-truename' on the remote file system. -Escape sequence %s is replaced with name of Perl binary. -This string is passed to `format', so percent characters need to be doubled.") +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") (defconst tramp-perl-file-name-all-completions - "%s -e ' + "%p -e ' opendir(d, $ARGV[0]) || die(\"$ARGV[0]: $!\\nfail\\n\"); @files = readdir(d); closedir(d); foreach $f (@files) { @@ -652,11 +654,11 @@ foreach $f (@files) { } } print \"ok\\n\" -' \"$1\" 2>/dev/null" +' \"$1\" %n" "Perl script to produce output suitable for use with -`file-name-all-completions' on the remote file system. Escape -sequence %s is replaced with name of Perl binary. This string is -passed to `format', so percent characters need to be doubled.") +`file-name-all-completions' on the remote file system. +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") ;; Perl script to implement `file-attributes' in a Lisp `read'able ;; output. If you are hacking on this, note that you get *no* output @@ -665,7 +667,7 @@ passed to `format', so percent characters need to be doubled.") ;; The device number is returned as "-1", because there will be a virtual ;; device number set in `tramp-sh-handle-file-attributes'. (defconst tramp-perl-file-attributes - "%s -e ' + "%p -e ' @stat = lstat($ARGV[0]); if (!@stat) { print \"nil\\n\"; @@ -702,14 +704,14 @@ printf( $stat[7], $stat[2], $stat[1] -);' \"$1\" \"$2\" 2>/dev/null" +);' \"$1\" \"$2\" %n" "Perl script to produce output suitable for use with `file-attributes' on the remote file system. -Escape sequence %s is replaced with name of Perl binary. -This string is passed to `format', so percent characters need to be doubled.") +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") (defconst tramp-perl-directory-files-and-attributes - "%s -e ' + "%p -e ' chdir($ARGV[0]) or printf(\"\\\"Cannot change to $ARGV[0]: $''!''\\\"\\n\"), exit(); opendir(DIR,\".\") or printf(\"\\\"Cannot open directory $ARGV[0]: $''!''\\\"\\n\"), exit(); @list = readdir(DIR); @@ -754,31 +756,31 @@ for($i = 0; $i < $n; $i++) $stat[2], $stat[1]); } -printf(\")\\n\");' \"$1\" \"$2\" 2>/dev/null" +printf(\")\\n\");' \"$1\" \"$2\" %n" "Perl script implementing `directory-files-and-attributes' as Lisp `read'able output. -Escape sequence %s is replaced with name of Perl binary. -This string is passed to `format', so percent characters need to be doubled.") +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") ;; These two use base64 encoding. (defconst tramp-perl-encode-with-module - "%s -MMIME::Base64 -0777 -ne 'print encode_base64($_)' %n" + "%p -MMIME::Base64 -0777 -ne 'print encode_base64($_)' %n" "Perl program to use for encoding a file. -Escape sequence %s is replaced with name of Perl binary. -This string is passed to `format', so percent characters need to be doubled. This implementation requires the MIME::Base64 Perl module to be installed -on the remote host.") +on the remote host. +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") (defconst tramp-perl-decode-with-module - "%s -MMIME::Base64 -0777 -ne 'print decode_base64($_)' %n" + "%p -MMIME::Base64 -0777 -ne 'print decode_base64($_)' %n" "Perl program to use for decoding a file. -Escape sequence %s is replaced with name of Perl binary. -This string is passed to `format', so percent characters need to be doubled. This implementation requires the MIME::Base64 Perl module to be installed -on the remote host.") +on the remote host. +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") (defconst tramp-perl-encode - "%s -e ' + "%p -e ' # This script contributed by Juanma Barranquero . # Copyright (C) 2002-2020 Free Software Foundation, Inc. use strict; @@ -813,11 +815,11 @@ while (read STDIN, $data, 54) { qq(\\n); }' %n" "Perl program to use for encoding a file. -Escape sequence %s is replaced with name of Perl binary. -This string is passed to `format', so percent characters need to be doubled.") +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") (defconst tramp-perl-decode - "%s -e ' + "%p -e ' # This script contributed by Juanma Barranquero . # Copyright (C) 2002-2020 Free Software Foundation, Inc. use strict; @@ -857,22 +859,25 @@ while (my $data = ) { last if $finished; }' %n" "Perl program to use for decoding a file. -Escape sequence %s is replaced with name of Perl binary. -This string is passed to `format', so percent characters need to be doubled.") +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") (defconst tramp-perl-pack - "%s -e 'binmode STDIN; binmode STDOUT; print pack(q{u*}, join q{}, <>)'" + "%p -e 'binmode STDIN; binmode STDOUT; print pack(q{u*}, join q{}, <>)' %n" "Perl program to use for encoding a file. -Escape sequence %s is replaced with name of Perl binary.") +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") (defconst tramp-perl-unpack - "%s -e 'binmode STDIN; binmode STDOUT; print unpack(q{u*}, join q{}, <>)'" + "%p -e 'binmode STDIN; binmode STDOUT; print unpack(q{u*}, join q{}, <>)' %n" "Perl program to use for decoding a file. -Escape sequence %s is replaced with name of Perl binary.") +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") (defconst tramp-hexdump-encode "%h -v -e '16/1 \" %%02x\" \"\\n\"'" "`hexdump' program to use for encoding a file. -This string is passed to `format', so percent characters need to be doubled.") +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") (defconst tramp-awk-encode "%a '\\ @@ -906,21 +911,24 @@ END { printf tail }'" "`awk' program to use for encoding a file. -This string is passed to `format', so percent characters need to be doubled.") +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") (defconst tramp-hexdump-awk-encode (format "%s | %s" tramp-hexdump-encode tramp-awk-encode) "`hexdump' / `awk' pipe to use for encoding a file. -This string is passed to `format', so percent characters need to be doubled.") +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") (defconst tramp-od-encode "%o -v -t x1 -A n" "`od' program to use for encoding a file. -This string is passed to `format', so percent characters need to be doubled.") +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") -(defconst tramp-od-awk-encode - (format "%s | %s" tramp-od-encode tramp-awk-encode) +(defconst tramp-od-awk-encode (format "%s | %s" tramp-od-encode tramp-awk-encode) "`od' / `awk' pipe to use for encoding a file. -This string is passed to `format', so percent characters need to be doubled.") +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") (defconst tramp-awk-decode "%a '\\ @@ -946,7 +954,8 @@ BEGIN { } }'" "Awk program to use for decoding a file. -This string is passed to `format', so percent characters need to be doubled.") +Format specifiers are replaced by `tramp-expand-script', percent +characters need to be doubled.") (defconst tramp-vc-registered-read-file-names "echo \"(\" @@ -968,7 +977,8 @@ echo \")\"" It must be send formatted with two strings; the tests for file existence, and file readability. Input shall be read via here-document, otherwise the command could exceed maximum length -of command line.") +of command line. +Format specifiers \"%s\" are replaced before the script is used.") ;; New handlers should be added here. ;;;###tramp-autoload @@ -3296,7 +3306,9 @@ implementation will be used." ;; correctly. Unset `file-name-handler-alist'. ;; Otherwise, epa-file gets confused. (let (file-name-handler-alist - (coding-system-for-write 'binary)) + (coding-system-for-write 'binary) + (default-directory + (tramp-compat-temporary-file-directory))) (with-temp-file tmpfile (set-buffer-multibyte nil) (insert-buffer-substring (tramp-get-buffer v)) @@ -3994,6 +4006,51 @@ Fall back to normal file name handler if no Tramp handler exists." ;;; Internal Functions: +(defun tramp-expand-script (vec script) + "Expand SCRIPT with remote files or commands. +\"%a\", \"%h\", \"%o\" and \"%p\" format specifiers are replaced +by the respective `awk', `hexdump', `od' and `perl' commands. +\"%n\" is replaced by \"2>/dev/null\", and \"%t\" is replaced by +a temporary file name. +If VEC is nil, the respective local commands are used. +If there is a format specifier which cannot be expanded, this +function returns nil." + (if (not (string-match-p "\\(^\\|[^%]\\)%[ahnopt]" script)) + script + (catch 'wont-work + (let ((awk (when (string-match-p "\\(^\\|[^%]\\)%a" script) + (or + (if vec (tramp-get-remote-awk vec) (executable-find "awk")) + (throw 'wont-work nil)))) + (hdmp (when (string-match-p "\\(^\\|[^%]\\)%h" script) + (or + (if vec (tramp-get-remote-hexdump vec) + (executable-find "hexdump")) + (throw 'wont-work nil)))) + (dev (when (string-match-p "\\(^\\|[^%]\\)%n" script) + (or + (if vec (concat "2>" (tramp-get-remote-null-device vec)) + (if (eq system-type 'windows-nt) "" + (concat "2>" null-device))) + (throw 'wont-work nil)))) + (od (when (string-match-p "\\(^\\|[^%]\\)%o" script) + (or (if vec (tramp-get-remote-od vec) (executable-find "od")) + (throw 'wont-work nil)))) + (perl (when (string-match-p "\\(^\\|[^%]\\)%p" script) + (or + (if vec + (tramp-get-remote-perl vec) (executable-find "perl")) + (throw 'wont-work nil)))) + (tmp (when (string-match-p "\\(^\\|[^%]\\)%t" script) + (or + (if vec + (tramp-file-local-name (tramp-make-tramp-temp-name vec)) + (tramp-compat-make-temp-name)) + (throw 'wont-work nil))))) + (format-spec + script + (format-spec-make ?a awk ?h hdmp ?n dev ?o od ?p perl ?t tmp)))))) + (defun tramp-maybe-send-script (vec script name) "Define in remote shell function NAME implemented as SCRIPT. Only send the definition if it has not already been done." @@ -4008,14 +4065,15 @@ Only send the definition if it has not already been done." ;; could result in unwanted command expansion. Avoid this. (setq script (tramp-compat-string-replace (make-string 1 ?\t) (make-string 8 ? ) script)) - ;; The script could contain a call of Perl. This is masked with `%s'. - (when (and (string-match-p "%s" script) - (not (tramp-get-remote-perl vec))) - (tramp-error vec 'file-error "No Perl available on remote host")) + ;; Expand format specifiers. + (unless (setq script (tramp-expand-script vec script)) + (tramp-error + vec 'file-error + (format "Script %s is not applicable on remote host" name))) + ;; Send it. (tramp-barf-unless-okay vec - (format "%s () {\n%s\n}" - name (format script (tramp-get-remote-perl vec))) + (format "%s () {\n%s\n}" name script) "Script %s sending failed" name) (tramp-set-connection-property (tramp-get-connection-process vec) "scripts" (cons name scripts)))))) @@ -4523,7 +4581,7 @@ process to set up. VEC specifies the connection." (defconst tramp-local-coding-commands `((b64 base64-encode-region base64-decode-region) (uu tramp-uuencode-region uudecode-decode-region) - (pack ,(format tramp-perl-pack "perl") ,(format tramp-perl-unpack "perl"))) + (pack ,tramp-perl-pack ,tramp-perl-unpack)) "List of local coding commands for inline transfer. Each item is a list that looks like this: @@ -4613,6 +4671,8 @@ Goes through the list `tramp-local-coding-commands' and vec 5 "Checking local encoding function `%s'" loc-enc) (tramp-message vec 5 "Checking local encoding command `%s' for sanity" loc-enc) + (unless (stringp (setq loc-enc (tramp-expand-script nil loc-enc))) + (throw 'wont-work-local nil)) (unless (zerop (tramp-call-local-coding-command loc-enc nil nil)) (throw 'wont-work-local nil))) (if (not (stringp loc-dec)) @@ -4620,6 +4680,8 @@ Goes through the list `tramp-local-coding-commands' and vec 5 "Checking local decoding function `%s'" loc-dec) (tramp-message vec 5 "Checking local decoding command `%s' for sanity" loc-dec) + (unless (stringp (setq loc-dec (tramp-expand-script nil loc-dec))) + (throw 'wont-work-local nil)) (unless (zerop (tramp-call-local-coding-command loc-dec nil nil)) (throw 'wont-work-local nil))) ;; Search for remote coding commands with the same format @@ -4647,35 +4709,8 @@ Goes through the list `tramp-local-coding-commands' and (unless (stringp rem-enc) (let ((name (symbol-name rem-enc)) (value (symbol-value rem-enc))) - ;; Check if remote perl exists when necessary. - (and (string-match-p "perl" name) - (not (tramp-get-remote-perl vec)) - (throw 'wont-work-remote nil)) - ;; Check if remote awk exists when necessary. - (and (string-match-p "\\(^\\|[^%]\\)%a" value) - (not (tramp-get-remote-awk vec)) - (throw 'wont-work-remote nil)) - ;; Check if remote hexdump exists when necessary. - (and (string-match-p "\\(^\\|[^%]\\)%h" value) - (not (tramp-get-remote-hexdump vec)) - (throw 'wont-work-remote nil)) - ;; Check if remote od exists when necessary. - (and (string-match-p "\\(^\\|[^%]\\)%o" value) - (not (tramp-get-remote-od vec)) - (throw 'wont-work-remote nil)) (while (string-match "-" name) (setq name (replace-match "_" nil t name))) - (when (string-match-p "\\(^\\|[^%]\\)%[aho]" value) - (setq value - (format-spec - value - (format-spec-make - ?a (tramp-get-remote-awk vec) - ?h (tramp-get-remote-hexdump vec) - ?n (concat - "2>" (tramp-get-remote-null-device vec)) - ?o (tramp-get-remote-od vec))) - value (tramp-compat-string-replace "%" "%%" value))) (tramp-maybe-send-script vec value name) (setq rem-enc name))) (tramp-message @@ -4690,28 +4725,9 @@ Goes through the list `tramp-local-coding-commands' and (unless (stringp rem-dec) (let ((name (symbol-name rem-dec)) - (value (symbol-value rem-dec)) - tmpfile) + (value (symbol-value rem-dec))) (while (string-match "-" name) (setq name (replace-match "_" nil t name))) - (when (string-match-p "\\(^\\|[^%]\\)%[aho]" value) - (setq value - (format-spec - value - (format-spec-make - ?a (tramp-get-remote-awk vec) - ?h (tramp-get-remote-hexdump vec) - ?n (concat - "2>" (tramp-get-remote-null-device vec)) - ?o (tramp-get-remote-od vec))) - value (tramp-compat-string-replace "%" "%%" value))) - (when (string-match-p "\\(^\\|[^%]\\)%t" value) - (setq tmpfile (tramp-make-tramp-temp-name vec) - value - (format-spec - value - (format-spec-make - ?t (tramp-file-local-name tmpfile))))) (tramp-maybe-send-script vec value name) (setq rem-dec name))) (tramp-message commit 75a91a0bb5236b049a5ea07488da5721ec5a3214 Author: Mattias Engdegård Date: Sun Dec 6 11:07:33 2020 +0100 Unicode integrals in Calc * lisp/calc/calccomp.el (math-compose-integ): Use Unicode integral signs when available instead of a crude ASCII approximation, with a shorter stem to save space. diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el index e4f6e989ec..0631eb48f9 100644 --- a/lisp/calc/calccomp.el +++ b/lisp/calc/calccomp.el @@ -1054,17 +1054,36 @@ (nth 1 a)) 185)) (calc-language 'flat) (low (and (nth 3 a) (math-compose-expr (nth 3 a) 0))) - (high (and (nth 4 a) (math-compose-expr (nth 4 a) 0)))) + (high (and (nth 4 a) (math-compose-expr (nth 4 a) 0))) + ;; Check if we have Unicode integral top/bottom parts. + (fancy (and (char-displayable-p ?⌠) + (char-displayable-p ?⌡))) + ;; If we do, find the most suitable middle part. + (fancy-stem (cond ((not fancy)) + ;; U+23AE INTEGRAL EXTENSION + ((char-displayable-p ?⎮) "⎮ ") + ;; U+2502 BOX DRAWINGS LIGHT VERTICAL + ((char-displayable-p ?│) "│ ") + ;; U+007C VERTICAL LINE + (t "| ")))) (list 'horiz (if parens "(" "") - (append (list 'vcent (if high 3 2)) - (and high (list (list 'horiz " " high))) - '(" /" - " | " - " | " - " | " - "/ ") - (and low (list (list 'horiz low " ")))) + (append (list 'vcent (if fancy + (if high 2 1) + (if high 3 2))) + (and high (list (if fancy + (list 'horiz high " ") + (list 'horiz " " high)))) + (if fancy + (list "⌠ " fancy-stem "⌡ ") + '(" /" + " | " + " | " + " | " + "/ ")) + (and low (list (if fancy + (list 'horiz low " ") + (list 'horiz low " "))))) expr (if over "" commit e84a1ffde9047c1ca0acb9abcd6d31e3bfba457d Author: Basil L. Contovounesios Date: Sat Dec 5 15:28:35 2020 +0000 Avoid modifying nnimap user option in spam.el * lisp/gnus/nnimap.el (nnimap--split-download-body): New variable. (nnimap-fetch-inbox): Use it in conjunction with nnimap-split-download-body. * lisp/gnus/spam.el: Don't load nnimap.el at compile time for a dynamic variable. (spam-setup-widening): Rather than unconditionally set user option nnimap-split-download-body, set nnimap--split-download-body to a unique non-nil value only if the variable was nil (bug#44981). (spam-teardown-widening): New function that undoes this if nnimap--split-download-body still holds the unique value. (spam-unload-hook): Call spam-teardown-widening to revert any change to the value of nnimap--split-download-body. diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index a860333066..c8b700ebcc 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -157,6 +157,9 @@ during splitting, which may be slow." :version "28.1" :type 'boolean) +(defvar nnimap--split-download-body nil + "Like `nnimap-split-download-body', but for internal use.") + (defvar nnimap-process nil) (defvar nnimap-status-string "") @@ -2108,7 +2111,8 @@ Return the server's response to the SELECT or EXAMINE command." "BODY.PEEK" "RFC822.PEEK")) (cond - (nnimap-split-download-body + ((or nnimap-split-download-body + nnimap--split-download-body) "[]") ((nnimap-ver4-p) "[HEADER]") diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el index 27e559d383..e74aef3efe 100644 --- a/lisp/gnus/spam.el +++ b/lisp/gnus/spam.el @@ -44,12 +44,9 @@ ;;; for the definitions of group content classification and spam processors (require 'gnus) -(eval-when-compile (require 'hashcash)) - -;; for nnimap-split-download-body -(eval-when-compile (require 'nnimap)) - -(eval-when-compile (require 'cl-lib)) +(eval-when-compile + (require 'cl-lib) + (require 'hashcash)) ;; autoload query-dig (autoload 'query-dig "dig") @@ -1228,10 +1225,20 @@ Will not return a nil score." ;;{{{ set up widening, processor checks -;;; set up IMAP widening if it's necessary +(defconst spam--widened (list ()) + "Unique value identifying changes to `nnimap--split-download-body'.") + (defun spam-setup-widening () - (when (spam-widening-needed-p) - (setq nnimap-split-download-body t))) + "Set up IMAP widening if it's necessary." + (and (boundp 'nnimap--split-download-body) + (not nnimap--split-download-body) + (spam-widening-needed-p) + (setq nnimap--split-download-body spam--widened))) + +(defun spam-teardown-widening () + "Tear down IMAP widening." + (when (eq (bound-and-true-p nnimap--split-download-body) spam--widened) + (setq nnimap--split-download-body nil))) (defun spam-widening-needed-p (&optional force-symbols) (let (found) @@ -2865,6 +2872,7 @@ installed through `spam-necessary-extra-headers'." (defun spam-unload-hook () "Uninstall the spam.el hooks." (interactive) + (spam-teardown-widening) (remove-hook 'gnus-save-newsrc-hook 'spam-maybe-spam-stat-save) (remove-hook 'gnus-get-top-new-news-hook 'spam-maybe-spam-stat-load) (remove-hook 'gnus-startup-hook 'spam-maybe-spam-stat-load) commit 61497defb42e84a7ca32774a0ac16b30789f91d8 Author: Stefan Kangas Date: Sun Dec 6 10:34:14 2020 +0100 ; * lisp/subr.el (interactive-p): Note to not remove in a hurry. diff --git a/lisp/subr.el b/lisp/subr.el index 4b75268c04..cf41f77f2d 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -5258,6 +5258,8 @@ use `called-interactively-p'. To test whether a function can be called interactively, use `commandp'." + ;; Kept around for now. See discussion at: + ;; https://lists.gnu.org/r/emacs-devel/2020-08/msg00564.html (declare (obsolete called-interactively-p "23.2")) (called-interactively-p 'interactive)) commit ba02ac89e6c69f220f15ef967500378cd1ded683 Author: Stefan Kangas Date: Sun Dec 6 10:06:33 2020 +0100 ; * lisp/gnus/spam.el (spam-setup-widening): Silence byte-compiler. diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el index 96a7da2313..27e559d383 100644 --- a/lisp/gnus/spam.el +++ b/lisp/gnus/spam.el @@ -46,7 +46,7 @@ (eval-when-compile (require 'hashcash)) -;; for nnimap-split-download-body-default +;; for nnimap-split-download-body (eval-when-compile (require 'nnimap)) (eval-when-compile (require 'cl-lib)) @@ -1231,7 +1231,7 @@ Will not return a nil score." ;;; set up IMAP widening if it's necessary (defun spam-setup-widening () (when (spam-widening-needed-p) - (setq nnimap-split-download-body-default t))) + (setq nnimap-split-download-body t))) (defun spam-widening-needed-p (&optional force-symbols) (let (found) commit e5c06669b89bd005ec2e5c17f307dbe128019f25 Author: Stefan Kangas Date: Sun Dec 6 08:57:54 2020 +0100 Prefer setq-local in several progmodes * lisp/progmodes/executable.el (executable-interpret): * lisp/progmodes/f90.el (f90-mode): * lisp/progmodes/flymake-cc.el (flymake-cc--make-diagnostics): * lisp/progmodes/fortran.el (fortran-mode): * lisp/progmodes/gud.el (gud-gdb, sdb, dbx, xdb, perldb, pdb) (jdb, gud-mode, gud-common-init, gdb-script-mode) (gud-tooltip-activate-mouse-motions): * lisp/progmodes/hideshow.el (hs-minor-mode): * lisp/progmodes/icon.el (icon-mode): * lisp/progmodes/ld-script.el (ld-script-mode): * lisp/progmodes/mixal-mode.el (mixal-mode): * lisp/progmodes/modula2.el (m2-mode): * lisp/progmodes/simula.el (simula-mode): * lisp/progmodes/subword.el (subword-setup-buffer): * lisp/progmodes/which-func.el (which-function): Prefer setq-local. diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el index bae2bb6640..cc7280921a 100644 --- a/lisp/progmodes/executable.el +++ b/lisp/progmodes/executable.el @@ -197,7 +197,7 @@ command to find the next error. The buffer is also in `comint-mode' and buffer-file-name)))) (require 'compile) (save-some-buffers (not compilation-ask-about-save)) - (set (make-local-variable 'executable-command) command) + (setq-local executable-command command) (let ((compilation-error-regexp-alist executable-error-regexp-alist)) (compilation-start command t (lambda (_x) "*interpretation*")))) diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index 1fbbc892c0..3c5c29bd8d 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -1179,29 +1179,26 @@ Turning on F90 mode calls the value of the variable `f90-mode-hook' with no args, if that value is non-nil." :group 'f90 :abbrev-table f90-mode-abbrev-table - (set (make-local-variable 'indent-line-function) 'f90-indent-line) - (set (make-local-variable 'indent-region-function) 'f90-indent-region) - (set (make-local-variable 'comment-start) "!") - (set (make-local-variable 'comment-start-skip) "!+ *") - (set (make-local-variable 'comment-indent-function) 'f90-comment-indent) - (set (make-local-variable 'abbrev-all-caps) t) - (set (make-local-variable 'normal-auto-fill-function) 'f90-do-auto-fill) + (setq-local indent-line-function #'f90-indent-line) + (setq-local indent-region-function #'f90-indent-region) + (setq-local comment-start "!") + (setq-local comment-start-skip "!+ *") + (setq-local comment-indent-function 'f90-comment-indent) + (setq-local abbrev-all-caps t) + (setq-local normal-auto-fill-function #'f90-do-auto-fill) (setq indent-tabs-mode nil) ; auto buffer local - (set (make-local-variable 'fill-paragraph-function) 'f90-fill-paragraph) - (set (make-local-variable 'font-lock-defaults) - '((f90-font-lock-keywords f90-font-lock-keywords-1 - f90-font-lock-keywords-2 - f90-font-lock-keywords-3 - f90-font-lock-keywords-4) - nil t)) - (set (make-local-variable 'imenu-case-fold-search) t) - (set (make-local-variable 'imenu-generic-expression) - f90-imenu-generic-expression) - (set (make-local-variable 'beginning-of-defun-function) - 'f90-beginning-of-subprogram) - (set (make-local-variable 'end-of-defun-function) 'f90-end-of-subprogram) - (set (make-local-variable 'add-log-current-defun-function) - #'f90-current-defun)) + (setq-local fill-paragraph-function #'f90-fill-paragraph) + (setq-local font-lock-defaults + '((f90-font-lock-keywords f90-font-lock-keywords-1 + f90-font-lock-keywords-2 + f90-font-lock-keywords-3 + f90-font-lock-keywords-4) + nil t)) + (setq-local imenu-case-fold-search t) + (setq-local imenu-generic-expression f90-imenu-generic-expression) + (setq-local beginning-of-defun-function #'f90-beginning-of-subprogram) + (setq-local end-of-defun-function #'f90-end-of-subprogram) + (setq-local add-log-current-defun-function #'f90-current-defun)) ;; Inline-functions. diff --git a/lisp/progmodes/flymake-cc.el b/lisp/progmodes/flymake-cc.el index d1985b4f77..19cef855c5 100644 --- a/lisp/progmodes/flymake-cc.el +++ b/lisp/progmodes/flymake-cc.el @@ -50,7 +50,7 @@ SOURCE." ;; TODO: if you can understand it, use `compilation-mode's regexps ;; or even some of its machinery here. ;; - ;; (set (make-local-variable 'compilation-locs) + ;; (setq-local compilation-locs ;; (make-hash-table :test 'equal :weakness 'value)) ;; (compilation-parse-errors (point-min) (point-max) ;; 'gnu 'gcc-include) diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index d84c379565..3a0274c609 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -861,36 +861,34 @@ with no args, if that value is non-nil." :group 'fortran :syntax-table fortran-mode-syntax-table :abbrev-table fortran-mode-abbrev-table - (set (make-local-variable 'indent-line-function) 'fortran-indent-line) - (set (make-local-variable 'indent-region-function) + (setq-local indent-line-function 'fortran-indent-line) + (setq-local indent-region-function (lambda (start end) (let (fortran-blink-matching-if ; avoid blinking delay indent-region-function) (indent-region start end nil)))) - (set (make-local-variable 'require-final-newline) mode-require-final-newline) + (setq-local require-final-newline mode-require-final-newline) ;; The syntax tables don't understand the column-0 comment-markers. - (set (make-local-variable 'comment-use-syntax) nil) - (set (make-local-variable 'comment-padding) "$$$") - (set (make-local-variable 'comment-start) fortran-comment-line-start) - (set (make-local-variable 'comment-start-skip) + (setq-local comment-use-syntax nil) + (setq-local comment-padding "$$$") + (setq-local comment-start fortran-comment-line-start) + (setq-local comment-start-skip ;; We can't reuse `fortran-comment-line-start-skip' directly because ;; it contains backrefs whereas we need submatch-1 to end at the ;; beginning of the comment delimiter. ;; (concat "\\(\\)\\(![ \t]*\\|" fortran-comment-line-start-skip "\\)") "\\(\\)\\(?:^[CcDd*]\\|!\\)\\(?:\\([^ \t\n]\\)\\2+\\)?[ \t]*") - (set (make-local-variable 'comment-indent-function) 'fortran-comment-indent) - (set (make-local-variable 'comment-region-function) 'fortran-comment-region) - (set (make-local-variable 'uncomment-region-function) - 'fortran-uncomment-region) - (set (make-local-variable 'comment-insert-comment-function) - 'fortran-indent-comment) - (set (make-local-variable 'abbrev-all-caps) t) - (set (make-local-variable 'normal-auto-fill-function) 'fortran-auto-fill) - (set (make-local-variable 'indent-tabs-mode) (fortran-analyze-file-format)) + (setq-local comment-indent-function 'fortran-comment-indent) + (setq-local comment-region-function 'fortran-comment-region) + (setq-local uncomment-region-function 'fortran-uncomment-region) + (setq-local comment-insert-comment-function 'fortran-indent-comment) + (setq-local abbrev-all-caps t) + (setq-local normal-auto-fill-function 'fortran-auto-fill) + (setq-local indent-tabs-mode (fortran-analyze-file-format)) (setq mode-line-process '(indent-tabs-mode fortran-tab-mode-string)) - (set (make-local-variable 'fill-column) fortran-line-length) - (set (make-local-variable 'fill-paragraph-function) 'fortran-fill-paragraph) - (set (make-local-variable 'font-lock-defaults) + (setq-local fill-column fortran-line-length) + (setq-local fill-paragraph-function 'fortran-fill-paragraph) + (setq-local font-lock-defaults '((fortran-font-lock-keywords fortran-font-lock-keywords-1 fortran-font-lock-keywords-2 @@ -898,20 +896,19 @@ with no args, if that value is non-nil." fortran-font-lock-keywords-4) nil t ((?/ . "$/") ("_$" . "w")) fortran-beginning-of-subprogram)) - (set (make-local-variable 'syntax-propertize-function) + (setq-local syntax-propertize-function (fortran-make-syntax-propertize-function fortran-line-length)) - (set (make-local-variable 'imenu-case-fold-search) t) - (set (make-local-variable 'imenu-generic-expression) - fortran-imenu-generic-expression) - (set (make-local-variable 'imenu-syntax-alist) '(("_$" . "w"))) - (set (make-local-variable 'beginning-of-defun-function) - #'fortran-beginning-of-subprogram) - (set (make-local-variable 'end-of-defun-function) - #'fortran-end-of-subprogram) - (set (make-local-variable 'add-log-current-defun-function) - #'fortran-current-defun) - (set (make-local-variable 'dabbrev-case-fold-search) 'case-fold-search) - (set (make-local-variable 'gud-find-expr-function) 'fortran-gud-find-expr) + (setq-local imenu-case-fold-search t) + (setq-local imenu-generic-expression fortran-imenu-generic-expression) + (setq-local imenu-syntax-alist '(("_$" . "w"))) + (setq-local beginning-of-defun-function + #'fortran-beginning-of-subprogram) + (setq-local end-of-defun-function + #'fortran-end-of-subprogram) + (setq-local add-log-current-defun-function + #'fortran-current-defun) + (setq-local dabbrev-case-fold-search 'case-fold-search) + (setq-local gud-find-expr-function 'fortran-gud-find-expr) (add-hook 'hack-local-variables-hook 'fortran-hack-local-variables nil t)) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 81021bc64f..279a70b0d7 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -758,7 +758,7 @@ the buffer in which this command was invoked." "Multiple debugging requires restarting in text command mode")) (gud-common-init command-line nil 'gud-gdb-marker-filter) - (set (make-local-variable 'gud-minor-mode) 'gdb) + (setq-local gud-minor-mode 'gdb) (gud-def gud-break "break %f:%l" "\C-b" "Set breakpoint at current line.") (gud-def gud-tbreak "tbreak %f:%l" "\C-t" @@ -788,7 +788,7 @@ the buffer in which this command was invoked." (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point nil 'local) - (set (make-local-variable 'gud-gdb-completion-function) 'gud-gdb-completions) + (setq-local gud-gdb-completion-function 'gud-gdb-completions) (local-set-key "\C-i" 'completion-at-point) (setq comint-prompt-regexp "^(.*gdb[+]?) *") @@ -1044,7 +1044,7 @@ and source-file directory for your debugger." (error "The sdb support requires a valid tags table to work")) (gud-common-init command-line nil 'gud-sdb-marker-filter 'gud-sdb-find-file) - (set (make-local-variable 'gud-minor-mode) 'sdb) + (setq-local gud-minor-mode 'sdb) (gud-def gud-break "%l b" "\C-b" "Set breakpoint at current line.") (gud-def gud-tbreak "%l c" "\C-t" "Set temporary breakpoint at current line.") @@ -1323,7 +1323,7 @@ and source-file directory for your debugger." (gud-common-init command-line 'gud-dbx-massage-args 'gud-dbx-marker-filter))) - (set (make-local-variable 'gud-minor-mode) 'dbx) + (setq-local gud-minor-mode 'dbx) (cond (gud-mips-p @@ -1424,7 +1424,7 @@ directories if your program contains sources from more than one directory." (gud-common-init command-line 'gud-xdb-massage-args 'gud-xdb-marker-filter) - (set (make-local-variable 'gud-minor-mode) 'xdb) + (setq-local gud-minor-mode 'xdb) (gud-def gud-break "b %f:%l" "\C-b" "Set breakpoint at current line.") (gud-def gud-tbreak "b %f:%l\\t" "\C-t" @@ -1578,7 +1578,7 @@ and source-file directory for your debugger." (gud-common-init command-line 'gud-perldb-massage-args 'gud-perldb-marker-filter) - (set (make-local-variable 'gud-minor-mode) 'perldb) + (setq-local gud-minor-mode 'perldb) (gud-def gud-break "b %l" "\C-b" "Set breakpoint at current line.") (gud-def gud-remove "B %l" "\C-d" "Remove breakpoint at current line") @@ -1696,7 +1696,7 @@ directory and source-file directory for your debugger." (list (gud-query-cmdline 'pdb))) (gud-common-init command-line nil 'gud-pdb-marker-filter) - (set (make-local-variable 'gud-minor-mode) 'pdb) + (setq-local gud-minor-mode 'pdb) (gud-def gud-break "break %d%f:%l" "\C-b" "Set breakpoint at current line.") (gud-def gud-remove "clear %d%f:%l" "\C-d" "Remove breakpoint at current line") @@ -2418,7 +2418,7 @@ gud, see `gud-mode'." (gud-common-init command-line 'gud-jdb-massage-args 'gud-jdb-marker-filter) - (set (make-local-variable 'gud-minor-mode) 'jdb) + (setq-local gud-minor-mode 'jdb) ;; If a -classpath option was provided, set gud-jdb-classpath (if gud-jdb-classpath-string @@ -2569,14 +2569,14 @@ Other commands for interacting with the debugger process are inherited from comint mode, which see." (setq mode-line-process '(":%s")) (define-key (current-local-map) "\C-c\C-l" 'gud-refresh) - (set (make-local-variable 'gud-last-frame) nil) + (setq-local gud-last-frame nil) (if (boundp 'tool-bar-map) ; not --without-x (setq-local tool-bar-map gud-tool-bar-map)) (make-local-variable 'comint-prompt-regexp) ;; Don't put repeated commands in command history many times. - (set (make-local-variable 'comint-input-ignoredups) t) + (setq-local comint-input-ignoredups t) (make-local-variable 'paragraph-start) - (set (make-local-variable 'gud-delete-prompt-marker) (make-marker)) + (setq-local gud-delete-prompt-marker (make-marker)) (add-hook 'kill-buffer-hook 'gud-kill-buffer-hook nil t)) (defcustom gud-chdir-before-run t @@ -2649,10 +2649,10 @@ comint mode, which see." (if massage-args (funcall massage-args file args) args)) ;; Since comint clobbered the mode, we don't set it until now. (gud-mode) - (set (make-local-variable 'gud-target-name) + (setq-local gud-target-name (and file-word (file-name-nondirectory file)))) - (set (make-local-variable 'gud-marker-filter) marker-filter) - (if find-file (set (make-local-variable 'gud-find-file) find-file)) + (setq-local gud-marker-filter marker-filter) + (if find-file (setq-local gud-find-file find-file)) (setq gud-last-last-frame nil) (set-process-filter (get-buffer-process (current-buffer)) 'gud-filter) @@ -3348,23 +3348,23 @@ Treats actions as defuns." ;;;###autoload (define-derived-mode gdb-script-mode prog-mode "GDB-Script" "Major mode for editing GDB scripts." - (set (make-local-variable 'comment-start) "#") - (set (make-local-variable 'comment-start-skip) "#+\\s-*") - (set (make-local-variable 'outline-regexp) "[ \t]") - (set (make-local-variable 'imenu-generic-expression) - '((nil "^define[ \t]+\\(\\w+\\)" 1))) - (set (make-local-variable 'indent-line-function) 'gdb-script-indent-line) - (set (make-local-variable 'beginning-of-defun-function) - #'gdb-script-beginning-of-defun) - (set (make-local-variable 'end-of-defun-function) - #'gdb-script-end-of-defun) - (set (make-local-variable 'font-lock-defaults) - '(gdb-script-font-lock-keywords nil nil ((?_ . "w")) nil - (font-lock-syntactic-face-function - . gdb-script-font-lock-syntactic-face))) + (setq-local comment-start "#") + (setq-local comment-start-skip "#+\\s-*") + (setq-local outline-regexp "[ \t]") + (setq-local imenu-generic-expression + '((nil "^define[ \t]+\\(\\w+\\)" 1))) + (setq-local indent-line-function 'gdb-script-indent-line) + (setq-local beginning-of-defun-function + #'gdb-script-beginning-of-defun) + (setq-local end-of-defun-function + #'gdb-script-end-of-defun) + (setq-local font-lock-defaults + '(gdb-script-font-lock-keywords nil nil ((?_ . "w")) nil + (font-lock-syntactic-face-function + . gdb-script-font-lock-syntactic-face))) ;; Recognize docstrings. - (set (make-local-variable 'syntax-propertize-function) - gdb-script-syntax-propertize-function) + (setq-local syntax-propertize-function + gdb-script-syntax-propertize-function) (add-hook 'syntax-propertize-extend-region-functions #'syntax-propertize-multiline 'append 'local)) @@ -3471,8 +3471,8 @@ only tooltips in the buffer containing the overlay arrow." ACTIVATEP non-nil means activate mouse motion events." (if activatep (progn - (set (make-local-variable 'gud-tooltip-mouse-motions-active) t) - (set (make-local-variable 'track-mouse) t)) + (setq-local gud-tooltip-mouse-motions-active t) + (setq-local track-mouse t)) (when gud-tooltip-mouse-motions-active (kill-local-variable 'gud-tooltip-mouse-motions-active) (kill-local-variable 'track-mouse)))) diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 4dee72c737..c882b7bc52 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -948,7 +948,7 @@ Key bindings: (add-hook 'change-major-mode-hook #'turn-off-hideshow nil t) - (set (make-local-variable 'line-move-ignore-invisible) t) + (setq-local line-move-ignore-invisible t) (add-to-invisibility-spec '(hs . t))) (remove-from-invisibility-spec '(hs . t)) ;; hs-show-all does nothing unless h-m-m is non-nil. diff --git a/lisp/progmodes/icon.el b/lisp/progmodes/icon.el index bb43215c33..dd0ee952a2 100644 --- a/lisp/progmodes/icon.el +++ b/lisp/progmodes/icon.el @@ -163,25 +163,24 @@ Variables controlling indentation style: Turning on Icon mode calls the value of the variable `icon-mode-hook' with no args, if that value is non-nil." :abbrev-table icon-mode-abbrev-table - (set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter)) - (set (make-local-variable 'paragraph-separate) paragraph-start) - (set (make-local-variable 'indent-line-function) #'icon-indent-line) - (set (make-local-variable 'comment-start) "# ") - (set (make-local-variable 'comment-end) "") - (set (make-local-variable 'comment-start-skip) "# *") - (set (make-local-variable 'comment-indent-function) 'icon-comment-indent) - (set (make-local-variable 'indent-line-function) 'icon-indent-line) + (setq-local paragraph-start (concat "$\\|" page-delimiter)) + (setq-local paragraph-separate paragraph-start) + (setq-local indent-line-function #'icon-indent-line) + (setq-local comment-start "# ") + (setq-local comment-end "") + (setq-local comment-start-skip "# *") + (setq-local comment-indent-function 'icon-comment-indent) + (setq-local indent-line-function 'icon-indent-line) ;; font-lock support - (set (make-local-variable 'font-lock-defaults) - '((icon-font-lock-keywords - icon-font-lock-keywords-1 icon-font-lock-keywords-2) - nil nil ((?_ . "w")) beginning-of-defun - ;; Obsoleted by Emacs 19.35 parse-partial-sexp's COMMENTSTOP. - ;;(font-lock-comment-start-regexp . "#") - (font-lock-mark-block-function . mark-defun))) + (setq-local font-lock-defaults + '((icon-font-lock-keywords + icon-font-lock-keywords-1 icon-font-lock-keywords-2) + nil nil ((?_ . "w")) beginning-of-defun + ;; Obsoleted by Emacs 19.35 parse-partial-sexp's COMMENTSTOP. + ;;(font-lock-comment-start-regexp . "#") + (font-lock-mark-block-function . mark-defun))) ;; imenu support - (set (make-local-variable 'imenu-generic-expression) - icon-imenu-generic-expression) + (setq-local imenu-generic-expression icon-imenu-generic-expression) ;; hideshow support ;; we start from the assertion that `hs-special-modes-alist' is autoloaded. (unless (assq 'icon-mode hs-special-modes-alist) diff --git a/lisp/progmodes/ld-script.el b/lisp/progmodes/ld-script.el index b17f255ba6..656af69d42 100644 --- a/lisp/progmodes/ld-script.el +++ b/lisp/progmodes/ld-script.el @@ -173,10 +173,9 @@ ;;;###autoload (define-derived-mode ld-script-mode prog-mode "LD-Script" "A major mode to edit GNU ld script files" - (set (make-local-variable 'comment-start) "/* ") - (set (make-local-variable 'comment-end) " */") - (set (make-local-variable 'font-lock-defaults) - '(ld-script-font-lock-keywords nil))) + (setq-local comment-start "/* ") + (setq-local comment-end " */") + (setq-local font-lock-defaults '(ld-script-font-lock-keywords nil))) (provide 'ld-script) diff --git a/lisp/progmodes/mixal-mode.el b/lisp/progmodes/mixal-mode.el index b9f60598f6..1f88e87c65 100644 --- a/lisp/progmodes/mixal-mode.el +++ b/lisp/progmodes/mixal-mode.el @@ -1141,18 +1141,18 @@ Assumes that file has been compiled with debugging support." ;;;###autoload (define-derived-mode mixal-mode prog-mode "mixal" "Major mode for the mixal asm language." - (set (make-local-variable 'comment-start) "*") - (set (make-local-variable 'comment-start-skip) "^\\*[ \t]*") - (set (make-local-variable 'font-lock-defaults) - '(mixal-font-lock-keywords)) - (set (make-local-variable 'syntax-propertize-function) - mixal-syntax-propertize-function) + (setq-local comment-start "*") + (setq-local comment-start-skip "^\\*[ \t]*") + (setq-local font-lock-defaults + '(mixal-font-lock-keywords)) + (setq-local syntax-propertize-function + mixal-syntax-propertize-function) ;; might add an indent function in the future - ;; (set (make-local-variable 'indent-line-function) 'mixal-indent-line) - (set (make-local-variable 'compile-command) - (concat "mixasm " - (if buffer-file-name - (shell-quote-argument buffer-file-name))))) + ;; (setq-local indent-line-function 'mixal-indent-line) + (setq-local compile-command + (concat "mixasm " + (if buffer-file-name + (shell-quote-argument buffer-file-name))))) (provide 'mixal-mode) diff --git a/lisp/progmodes/modula2.el b/lisp/progmodes/modula2.el index aa412304c5..a77a4e2b21 100644 --- a/lisp/progmodes/modula2.el +++ b/lisp/progmodes/modula2.el @@ -308,14 +308,14 @@ followed by the first character of the construct. `m2-indent' controls the number of spaces for each indentation. `m2-compile-command' holds the command to compile a Modula-2 program. `m2-link-command' holds the command to link a Modula-2 program." - (set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter)) - (set (make-local-variable 'paragraph-separate) paragraph-start) - (set (make-local-variable 'paragraph-ignore-fill-prefix) t) - (set (make-local-variable 'comment-start) "(* ") - (set (make-local-variable 'comment-end) " *)") - (set (make-local-variable 'comment-start-skip) "\\(?:(\\*+\\|//+\\) *") - (set (make-local-variable 'parse-sexp-ignore-comments) t) - (set (make-local-variable 'font-lock-defaults) + (setq-local paragraph-start (concat "$\\|" page-delimiter)) + (setq-local paragraph-separate paragraph-start) + (setq-local paragraph-ignore-fill-prefix t) + (setq-local comment-start "(* ") + (setq-local comment-end " *)") + (setq-local comment-start-skip "\\(?:(\\*+\\|//+\\) *") + (setq-local parse-sexp-ignore-comments t) + (setq-local font-lock-defaults '((m3-font-lock-keywords m3-font-lock-keywords-1 m3-font-lock-keywords-2) nil nil ((?_ . "w") (?. . "w") (?< . ". 1") (?> . ". 4")) nil diff --git a/lisp/progmodes/simula.el b/lisp/progmodes/simula.el index be3edfdc6e..44d4a9ca44 100644 --- a/lisp/progmodes/simula.el +++ b/lisp/progmodes/simula.el @@ -365,22 +365,22 @@ Variables controlling indentation style: Turning on SIMULA mode calls the value of the variable simula-mode-hook with no arguments, if that value is non-nil." - (set (make-local-variable 'comment-column) 40) - ;; (set (make-local-variable 'end-comment-column) 75) - (set (make-local-variable 'paragraph-start) "[ \t]*$\\|\f") - (set (make-local-variable 'paragraph-separate) paragraph-start) - (set (make-local-variable 'indent-line-function) 'simula-indent-line) - (set (make-local-variable 'comment-start) "! ") - (set (make-local-variable 'comment-end) " ;") - (set (make-local-variable 'comment-start-skip) "!+ *") - (set (make-local-variable 'parse-sexp-ignore-comments) nil) - (set (make-local-variable 'comment-multi-line) t) - (set (make-local-variable 'font-lock-defaults) - '((simula-font-lock-keywords simula-font-lock-keywords-1 - simula-font-lock-keywords-2 simula-font-lock-keywords-3) - nil t ((?_ . "w")))) - (set (make-local-variable 'syntax-propertize-function) - simula-syntax-propertize-function) + (setq-local comment-column 40) + ;; (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 comment-start "! ") + (setq-local comment-end " ;") + (setq-local comment-start-skip "!+ *") + (setq-local parse-sexp-ignore-comments nil) + (setq-local comment-multi-line t) + (setq-local font-lock-defaults + '((simula-font-lock-keywords simula-font-lock-keywords-1 + simula-font-lock-keywords-2 simula-font-lock-keywords-3) + nil t ((?_ . "w")))) + (setq-local syntax-propertize-function + simula-syntax-propertize-function) (abbrev-mode 1)) (defun simula-indent-exp () diff --git a/lisp/progmodes/subword.el b/lisp/progmodes/subword.el index 0f2c9431f6..b0df90995b 100644 --- a/lisp/progmodes/subword.el +++ b/lisp/progmodes/subword.el @@ -332,7 +332,7 @@ as parts of words: e.g., in `superword-mode', searching subwords in order to avoid unwanted reentrancy.") (defun subword-setup-buffer () - (set (make-local-variable 'find-word-boundary-function-table) + (setq-local find-word-boundary-function-table (if (or subword-mode superword-mode) subword-find-word-boundary-function-table subword-empty-char-table))) diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 266f40abba..a524bbaa22 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el @@ -293,7 +293,7 @@ If no function name is found, return nil." (null which-function-imenu-failed)) (ignore-errors (imenu--make-index-alist t)) (unless imenu--index-alist - (set (make-local-variable 'which-function-imenu-failed) t))) + (setq-local which-function-imenu-failed t))) ;; If we have an index alist, use it. (when (and (null name) (boundp 'imenu--index-alist) imenu--index-alist) commit 34feded008e524149d45dc33e5fc7b2cc5cb2014 Author: Eli Zaretskii Date: Sun Dec 6 10:01:20 2020 +0200 Support ks_c_5601-1987 encoding * lisp/language/korean.el (ks_c_5601-1987): Define as an alias for 'korean-iso-8bit. (It is sometimes used in email messages.) diff --git a/lisp/language/korean.el b/lisp/language/korean.el index 210d0fabaf..426d2ac3d8 100644 --- a/lisp/language/korean.el +++ b/lisp/language/korean.el @@ -42,6 +42,7 @@ (define-coding-system-alias 'euc-kr 'korean-iso-8bit) (define-coding-system-alias 'euc-korea 'korean-iso-8bit) +(define-coding-system-alias 'ks_c_5601-1987 'korean-iso-8bit) (define-coding-system 'iso-2022-kr "ISO 2022 based 7-bit encoding for Korean KSC5601 (MIME:ISO-2022-KR)." commit 79d287c7b51758542798985e6b1c7b24b0038619 Author: Stefan Kangas Date: Sun Dec 6 08:54:50 2020 +0100 Prefer setq-local in emulation/*.el * lisp/emulation/edt.el (edt-select-mode): * lisp/emulation/viper-cmd.el (viper-refresh-mode-line): (viper-minibuffer-setup-sentinel): * lisp/emulation/viper.el (viper-comint-mode-hook): Prefer setq-local. diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el index b29ad7702e..f61de9208d 100644 --- a/lisp/emulation/edt.el +++ b/lisp/emulation/edt.el @@ -788,7 +788,7 @@ Argument NUM is the number of lines to delete." In select mode, selected text is highlighted." (if arg (progn - (set (make-local-variable 'edt-select-mode) 'edt-select-mode-current) + (setq-local edt-select-mode 'edt-select-mode-current) (setq rect-start-point (window-point))) (progn (kill-local-variable 'edt-select-mode))) diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index dd7648c2b7..938ebb1522 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -474,7 +474,7 @@ ;; Modifies mode-line-buffer-identification. (defun viper-refresh-mode-line () - (set (make-local-variable 'viper-mode-string) + (setq-local viper-mode-string (cond ((eq viper-current-state 'emacs-state) viper-emacs-state-id) ((eq viper-current-state 'vi-state) viper-vi-state-id) ((eq viper-current-state 'replace-state) viper-replace-state-id) @@ -1865,14 +1865,10 @@ Undo previous insertion and inserts new." ;; minibuffer and vice versa. Otherwise, command arguments will affect ;; minibuffer ops and insertions from the minibuffer will change those in ;; the normal buffers - (make-local-variable 'viper-d-com) - (make-local-variable 'viper-last-insertion) - (make-local-variable 'viper-command-ring) - (setq viper-d-com nil - viper-last-insertion nil - viper-command-ring nil) - (funcall hook) - )) + (setq-local viper-d-com nil) + (setq-local viper-last-insertion nil) + (setq-local viper-command-ring nil) + (funcall hook))) ;; This is a temp hook that uses free variables viper--init-message and viper-initial. ;; A dirty feature, but it is the simplest way to have it do the right thing. diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 59ca6298eb..851092819c 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -617,7 +617,7 @@ This startup message appears whenever you load Viper, unless you type `y' now." ;; This hook designed to enable Vi-style editing in comint-based modes." (defun viper-comint-mode-hook () - (set (make-local-variable 'require-final-newline) nil) + (setq-local require-final-newline nil) (setq viper-ex-style-editing nil viper-ex-style-motion nil) (viper-change-state-to-insert)) commit 7c113c344e19faece88e6be1bf55376d6f35cfb2 Author: Stefan Kangas Date: Sun Dec 6 08:50:51 2020 +0100 Prefer setq-local in url/*.el * lisp/url/url-cookie.el (url-cookie-write-file): * lisp/url/url-http.el (url-http-parse-headers): * lisp/url/url-util.el (url-extract-mime-headers): Prefer setq-local. diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el index bee3a6b85e..e185a7914f 100644 --- a/lisp/url/url-cookie.el +++ b/lisp/url/url-cookie.el @@ -162,7 +162,7 @@ i.e. 1970-1-1) are loaded as expiring one year from now instead." ";; version-control: never\n" ";; no-byte-compile: t\n" ";; End:\n") - (set (make-local-variable 'version-control) 'never) + (setq-local version-control 'never) (write-file fname)) (setq url-cookies-changed-since-last-save nil)))) diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index 75330d3327..1271b9b96f 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -741,12 +741,12 @@ should be shown to the user." ;; without changing the API. Instead url-retrieve should ;; either simply not return the "destination" buffer, or it ;; should take an optional `dest-buf' argument. - (set (make-local-variable 'url-redirect-buffer) - (url-retrieve-internal - redirect-uri url-callback-function - url-callback-arguments - (url-silent url-current-object) - (not (url-use-cookies url-current-object)))) + (setq-local url-redirect-buffer + (url-retrieve-internal + redirect-uri url-callback-function + url-callback-arguments + (url-silent url-current-object) + (not (url-use-cookies url-current-object)))) (url-mark-buffer-as-dead buffer)) ;; We hit url-max-redirections, so issue an error and ;; stop redirecting. diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index 0a7e7e205e..bd9543bbe7 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el @@ -574,8 +574,8 @@ Has a preference for looking backward when not directly on a symbol." (save-excursion (goto-char (point-min)) (unless url-current-mime-headers - (set (make-local-variable 'url-current-mime-headers) - (mail-header-extract))))) + (setq-local url-current-mime-headers + (mail-header-extract))))) (defun url-make-private-file (file) "Make FILE only readable and writable by the current user. commit da00a6f31770b6f3eced6b87c49d89ec33c1e1ab Author: YAMAMOTO Mitsuharu Date: Sun Dec 6 14:21:35 2020 +0900 Fix Xaw widget text disappearing when built with cairo (bug#43418) * lwlib/lwlib-utils.c (crxft_font_open_name): Use FcFontMatch to get a pattern to pass to cairo_ft_font_face_create_for_pattern. diff --git a/lwlib/lwlib-utils.c b/lwlib/lwlib-utils.c index f15cb603a8..2b3aa55c3e 100644 --- a/lwlib/lwlib-utils.c +++ b/lwlib/lwlib-utils.c @@ -148,6 +148,7 @@ XftFont * crxft_font_open_name (Display *dpy, int screen, const char *name) { XftFont *pub = NULL; + FcPattern *match = NULL; FcPattern *pattern = FcNameParse ((FcChar8 *) name); if (pattern) { @@ -162,12 +163,18 @@ crxft_font_open_name (Display *dpy, int screen, const char *name) FcPatternAddDouble (pattern, FC_DPI, dpi); } FcDefaultSubstitute (pattern); + FcResult result; + match = FcFontMatch (NULL, pattern, &result); + FcPatternDestroy (pattern); + } + if (match) + { cairo_font_face_t *font_face - = cairo_ft_font_face_create_for_pattern (pattern); + = cairo_ft_font_face_create_for_pattern (match); if (font_face) { double pixel_size; - if ((FcPatternGetDouble (pattern, FC_PIXEL_SIZE, 0, &pixel_size) + if ((FcPatternGetDouble (match, FC_PIXEL_SIZE, 0, &pixel_size) != FcResultMatch) || pixel_size < 1) pixel_size = 10; @@ -177,7 +184,7 @@ crxft_font_open_name (Display *dpy, int screen, const char *name) cairo_matrix_init_scale (&font_matrix, pixel_size, pixel_size); cairo_matrix_init_identity (&ctm); cairo_font_options_t *options = cairo_font_options_create (); - cairo_ft_font_options_substitute (options, pattern); + cairo_ft_font_options_substitute (options, match); pub->scaled_font = cairo_scaled_font_create (font_face, &font_matrix, &ctm, options); cairo_font_face_destroy (font_face); @@ -190,7 +197,7 @@ crxft_font_open_name (Display *dpy, int screen, const char *name) pub->height = lround (extents.height); pub->max_advance_width = lround (extents.max_x_advance); } - FcPatternDestroy (pattern); + FcPatternDestroy (match); } if (pub && pub->height <= 0) { commit fc54c835181eb88a748d2fd49b7a4c78b9fe82ee Author: Stefan Monnier Date: Sat Dec 5 10:41:03 2020 -0500 * lisp/progmodes/perl-mode.el: Fix handling of s'foo'bar' (perl-syntax-propertize-function): Don't put a syntax-property on regexp-op delimiters if they're already handled correctly by the normal syntax tables. (perl-syntax-propertize-special-constructs): Mark the middle quote of s'foo'bar' as punctuation. * test/manual/indent/perl.perl: Add new test cases. diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index bb19436cda..fd8a51b5a5 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -299,12 +299,21 @@ ;; $a = "foo y \"toto\" bar" where we'd end up changing the ;; syntax of the backslash and hence de-escaping the embedded ;; double quote. - (put-text-property (match-beginning 3) (match-end 3) - 'syntax-table - (if (assoc (char-after (match-beginning 3)) - perl-quote-like-pairs) - (string-to-syntax "|") - (string-to-syntax "\""))) + (let* ((b3 (match-beginning 3)) + (c (char-after b3))) + (put-text-property + b3 (match-end 3) 'syntax-table + (cond + ((assoc c perl-quote-like-pairs) + (string-to-syntax "|")) + ;; If the separator is a normal quote and the operation + ;; only takes a single arg, then there's nothing + ;; special to do. + ((and (memq c '(?\" ?\')) + (memq (char-after (match-beginning 2)) '(?m ?q))) + nil) + (t + (string-to-syntax "\""))))) (perl-syntax-propertize-special-constructs end)))))) ;; Here documents. ((concat @@ -379,7 +388,8 @@ (put-text-property (1- (point)) (point) 'syntax-table (string-to-syntax "> c")))))) ((or (null (setq char (nth 3 state))) - (and (characterp char) (eq (char-syntax (nth 3 state)) ?\"))) + (and (characterp char) + (null (get-text-property (nth 8 state) 'syntax-table)))) ;; Normal text, or comment, or docstring, or normal string. nil) ((eq (nth 3 state) ?\n) @@ -400,6 +410,7 @@ (point))) '("tr" "s" "y")))) (close (cdr (assq char perl-quote-like-pairs))) + (middle nil) (st (perl-quote-syntax-table char))) (when (with-syntax-table st (if close @@ -430,6 +441,7 @@ ;; In the case of s{...}{...}, we only handle the ;; first part here and the next below. (when (and twoargs (not close)) + (setq middle (point)) (nth 8 (parse-partial-sexp (point) limit nil nil state 'syntax-table))))))) @@ -437,11 +449,14 @@ (when (eq (char-before (1- (point))) ?$) (put-text-property (- (point) 2) (1- (point)) 'syntax-table '(1))) - (put-text-property (1- (point)) (point) - 'syntax-table - (if close - (string-to-syntax "|") - (string-to-syntax "\""))) + (if (and middle (memq char '(?\" ?\'))) + (put-text-property (1- middle) middle + 'syntax-table '(1)) + (put-text-property (1- (point)) (point) + 'syntax-table + (if close + (string-to-syntax "|") + (string-to-syntax "\"")))) ;; If we have two args with a non-self-paired starter (e.g. ;; s{...}{...}) we're right after the first arg, so we still have to ;; handle the second part. diff --git a/test/manual/indent/perl.perl b/test/manual/indent/perl.perl index 853aec4924..6ec04303b4 100755 --- a/test/manual/indent/perl.perl +++ b/test/manual/indent/perl.perl @@ -81,3 +81,17 @@ END # A "y|abc|def|" shouldn't interfere when inside a string! $toto = " x \" string\""; $toto = " y \" string\""; # This is not the `y' operator! + + +# Tricky cases from Harald Jörg +$_ = "abcabc\n"; +s:abc:def:g; # FIXME: the initial s is fontified like a label, and indented + +s'def'ghi'g; # The middle ' should not end the quoting. +s"ghi"ijk"g; # The middle ' should not end the quoting. + +s#ijk#lmn#g; # This is a regular expression sustitution. + +s #lmn#opq#g; # FIXME: this should be a comment starting with "#lmn" + /lmn/rst/g; # and this is the actual regular expression +print; # prints "rstrst\n" commit dc39c66d3bb6b1db6af0519659ff154bf6d8a5d1 Author: Stefan Kangas Date: Sat Dec 5 11:53:19 2020 +0100 ; * lisp/play/doctor.el (make-doctor-variables): Fix indentation. diff --git a/lisp/play/doctor.el b/lisp/play/doctor.el index 1549eb7d96..8fc207da35 100644 --- a/lisp/play/doctor.el +++ b/lisp/play/doctor.el @@ -146,380 +146,380 @@ reads the sentence before point, and prints the Doctor's answer." (defun make-doctor-variables () (setq-local doctor--typos - (mapcar (lambda (x) - (put (car x) 'doctor-correction (cadr x)) - (put (cadr x) 'doctor-expansion (car (cddr x))) - (car x)) - '((theyll they\'ll (they will)) - (theyre they\'re (they are)) - (hes he\'s (he is)) - (he7s he\'s (he is)) - (im i\'m (you are)) - (i7m i\'m (you are)) - (isa is\ a (is a)) - (thier their (their)) - (dont don\'t (do not)) - (don7t don\'t (do not)) - (you7re you\'re (i am)) - (you7ve you\'ve (i have)) - (you7ll you\'ll (i will))))) + (mapcar (lambda (x) + (put (car x) 'doctor-correction (cadr x)) + (put (cadr x) 'doctor-expansion (car (cddr x))) + (car x)) + '((theyll they\'ll (they will)) + (theyre they\'re (they are)) + (hes he\'s (he is)) + (he7s he\'s (he is)) + (im i\'m (you are)) + (i7m i\'m (you are)) + (isa is\ a (is a)) + (thier their (their)) + (dont don\'t (do not)) + (don7t don\'t (do not)) + (you7re you\'re (i am)) + (you7ve you\'ve (i have)) + (you7ll you\'ll (i will))))) (setq-local doctor-sent nil) (setq-local doctor-found nil) (setq-local doctor-owner nil) (setq-local doctor--history nil) (setq-local doctor--inter '((well\,) - (hmmm \.\.\.\ so\,) - (so) - (\.\.\.and) - (then))) + (hmmm \.\.\.\ so\,) + (so) + (\.\.\.and) + (then))) (setq-local doctor--continue '((continue) - (proceed) - (go on) - (keep going))) + (proceed) + (go on) + (keep going))) (setq-local doctor--relation - '((your relationship with) - (something you remember about) - (your feelings toward) - (some experiences you have had with) - (how you feel about))) + '((your relationship with) + (something you remember about) + (your feelings toward) + (some experiences you have had with) + (how you feel about))) (setq-local doctor--fears - '(((doc$ doctor--whysay) you are (doc$ doctor--afraidof) (doc// doctor--feared) \?) - (you seem terrified by (doc// doctor--feared) \.) - (when did you first feel (doc$ doctor--afraidof) (doc// doctor--feared) \?))) + '(((doc$ doctor--whysay) you are (doc$ doctor--afraidof) (doc// doctor--feared) \?) + (you seem terrified by (doc// doctor--feared) \.) + (when did you first feel (doc$ doctor--afraidof) (doc// doctor--feared) \?))) (setq-local doctor--sure '((sure) - (positive) - (certain) - (absolutely sure))) + (positive) + (certain) + (absolutely sure))) (setq-local doctor--afraidof '((afraid of) - (frightened by) - (scared of))) + (frightened by) + (scared of))) (setq-local doctor--areyou '((are you) - (have you been) - (have you been))) + (have you been) + (have you been))) (setq-local doctor--isrelated - '((has something to do with) - (is related to) - (could be the reason for) - (is caused by) - (is because of))) + '((has something to do with) + (is related to) + (could be the reason for) + (is caused by) + (is because of))) (setq-local doctor--arerelated '((have something to do with) - (are related to) - (could have caused) - (could be the reason for) - (are caused by) - (are because of))) + (are related to) + (could have caused) + (could be the reason for) + (are caused by) + (are because of))) (setq-local doctor--moods - '(((doc$ doctor--areyou) (doc// doctor-found) often \?) - (what causes you to be (doc// doctor-found) \?) - ((doc$ doctor--whysay) you are (doc// doctor-found) \?))) + '(((doc$ doctor--areyou) (doc// doctor-found) often \?) + (what causes you to be (doc// doctor-found) \?) + ((doc$ doctor--whysay) you are (doc// doctor-found) \?))) (setq-local doctor--maybe '((maybe) - (perhaps) - (possibly))) + (perhaps) + (possibly))) (setq-local doctor--whatwhen '((what happened when) - (what would happen if))) + (what would happen if))) (setq-local doctor--hello '((how do you do \?) - (hello \.) - (howdy!) - (hello \.) - (hi \.) - (hi there \.))) + (hello \.) + (howdy!) + (hello \.) + (hi \.) + (hi there \.))) (setq-local doctor--drnk - '((do you drink a lot of (doc// doctor-found) \?) - (do you get drunk often \?) - ((doc$ doctor--describe) your drinking habits \.))) + '((do you drink a lot of (doc// doctor-found) \?) + (do you get drunk often \?) + ((doc$ doctor--describe) your drinking habits \.))) (setq-local doctor--drugs - '((do you use (doc// doctor-found) often \?) - ((doc$ doctor--areyou) addicted to (doc// doctor-found) \?) - (do you realize that drugs can be very harmful \?) - ((doc$ doctor--maybe) you should try to quit using (doc// doctor-found) \.))) + '((do you use (doc// doctor-found) often \?) + ((doc$ doctor--areyou) addicted to (doc// doctor-found) \?) + (do you realize that drugs can be very harmful \?) + ((doc$ doctor--maybe) you should try to quit using (doc// doctor-found) \.))) (setq-local doctor--whywant - '(((doc$ doctor--whysay) (doc// doctor-subj) might (doc$ doctor--want) (doc// doctor-obj) \?) - (how does it feel to want \?) - (why should (doc// doctor-subj) get (doc// doctor-obj) \?) - (when did (doc// doctor-subj) first (doc$ doctor--want) (doc// doctor-obj) \?) - ((doc$ doctor--areyou) obsessed with (doc// doctor-obj) \?) - (why should i give (doc// doctor-obj) to (doc// doctor-subj) \?) - (have you ever gotten (doc// doctor-obj) \?))) + '(((doc$ doctor--whysay) (doc// doctor-subj) might (doc$ doctor--want) (doc// doctor-obj) \?) + (how does it feel to want \?) + (why should (doc// doctor-subj) get (doc// doctor-obj) \?) + (when did (doc// doctor-subj) first (doc$ doctor--want) (doc// doctor-obj) \?) + ((doc$ doctor--areyou) obsessed with (doc// doctor-obj) \?) + (why should i give (doc// doctor-obj) to (doc// doctor-subj) \?) + (have you ever gotten (doc// doctor-obj) \?))) (setq-local doctor--canyou - '((of course i can \.) - (why should i \?) - (what makes you think i would even want to \?) - (i am the doctor\, i can do anything i damn please \.) - (not really\, it\'s not up to me \.) - (depends\, how important is it \?) - (i could\, but i don\'t think it would be a wise thing to do \.) - (can you \?) - (maybe i can\, maybe i can\'t \.\.\.) - (i don\'t think i should do that \.))) + '((of course i can \.) + (why should i \?) + (what makes you think i would even want to \?) + (i am the doctor\, i can do anything i damn please \.) + (not really\, it\'s not up to me \.) + (depends\, how important is it \?) + (i could\, but i don\'t think it would be a wise thing to do \.) + (can you \?) + (maybe i can\, maybe i can\'t \.\.\.) + (i don\'t think i should do that \.))) (setq-local doctor--want '((want) (desire) (wish) (want) (hope))) (setq-local doctor--shortlst - '((can you elaborate on that \?) - ((doc$ doctor--please) continue \.) - (go on\, don\'t be afraid \.) - (i need a little more detail please \.) - (you\'re being a bit brief\, (doc$ doctor--please) go into detail \.) - (can you be more explicit \?) - (and \?) - ((doc$ doctor--please) go into more detail \?) - (you aren\'t being very talkative today\!) - (is that all there is to it \?) - (why must you respond so briefly \?))) + '((can you elaborate on that \?) + ((doc$ doctor--please) continue \.) + (go on\, don\'t be afraid \.) + (i need a little more detail please \.) + (you\'re being a bit brief\, (doc$ doctor--please) go into detail \.) + (can you be more explicit \?) + (and \?) + ((doc$ doctor--please) go into more detail \?) + (you aren\'t being very talkative today\!) + (is that all there is to it \?) + (why must you respond so briefly \?))) (setq-local doctor--famlst - '((tell me (doc$ doctor--something) about (doc// doctor-owner) family \.) - (you seem to dwell on (doc// doctor-owner) family \.) - ((doc$ doctor--areyou) hung up on (doc// doctor-owner) family \?))) + '((tell me (doc$ doctor--something) about (doc// doctor-owner) family \.) + (you seem to dwell on (doc// doctor-owner) family \.) + ((doc$ doctor--areyou) hung up on (doc// doctor-owner) family \?))) (setq-local doctor--huhlst - '(((doc$ doctor--whysay) (doc// doctor-sent) \?) - (is it because of (doc$ doctor--things) that you say (doc// doctor-sent) \?))) + '(((doc$ doctor--whysay) (doc// doctor-sent) \?) + (is it because of (doc$ doctor--things) that you say (doc// doctor-sent) \?))) (setq-local doctor--longhuhlst - '(((doc$ doctor--whysay) that \?) - (i don\'t understand \.) - ((doc$ doctor--thlst)) - ((doc$ doctor--areyou) (doc$ doctor--afraidof) that \?))) + '(((doc$ doctor--whysay) that \?) + (i don\'t understand \.) + ((doc$ doctor--thlst)) + ((doc$ doctor--areyou) (doc$ doctor--afraidof) that \?))) (setq-local doctor--feelings-about '((feelings about) - (apprehensions toward) - (thoughts on) - (emotions toward))) + (apprehensions toward) + (thoughts on) + (emotions toward))) (setq-local doctor--random-adjective - '((vivid) - (emotionally stimulating) - (exciting) - (boring) - (interesting) - (recent) - (random) ; how can we omit this? - (unusual) - (shocking) - (embarrassing))) + '((vivid) + (emotionally stimulating) + (exciting) + (boring) + (interesting) + (recent) + (random) ; how can we omit this? + (unusual) + (shocking) + (embarrassing))) (setq-local doctor--whysay '((why do you say) - (what makes you believe) - (are you sure that) - (do you really think) - (what makes you think))) + (what makes you believe) + (are you sure that) + (do you really think) + (what makes you think))) (setq-local doctor--isee '((i see \.\.\.) - (yes\,) - (i understand \.) - (oh \.) )) + (yes\,) + (i understand \.) + (oh \.) )) (setq-local doctor--please '((please\,) - (i would appreciate it if you would) - (perhaps you could) - (please\,) - (would you please) - (why don\'t you) - (could you))) + (i would appreciate it if you would) + (perhaps you could) + (please\,) + (would you please) + (why don\'t you) + (could you))) (setq-local doctor--bye - '((my secretary will send you a bill \.) - (bye bye \.) - (see ya \.) - (ok\, talk to you some other time \.) - (talk to you later \.) - (ok\, have fun \.) - (ciao \.))) + '((my secretary will send you a bill \.) + (bye bye \.) + (see ya \.) + (ok\, talk to you some other time \.) + (talk to you later \.) + (ok\, have fun \.) + (ciao \.))) (setq-local doctor--something '((something) - (more) - (how you feel))) + (more) + (how you feel))) (setq-local doctor--thing '((your life) - (your sex life))) + (your sex life))) (setq-local doctor--things '((your plans) - (the people you hang around with) - (problems at school) - (any hobbies you have) - (hangups you have) - (your inhibitions) - (some problems in your childhood) - (some problems at home))) + (the people you hang around with) + (problems at school) + (any hobbies you have) + (hangups you have) + (your inhibitions) + (some problems in your childhood) + (some problems at home))) (setq-local doctor--describe '((describe) - (tell me about) - (talk about) - (discuss) - (tell me more about) - (elaborate on))) + (tell me about) + (talk about) + (discuss) + (tell me more about) + (elaborate on))) (setq-local doctor--ibelieve - '((i believe) (i think) (i have a feeling) (it seems to me that) - (it looks like))) + '((i believe) (i think) (i have a feeling) (it seems to me that) + (it looks like))) (setq-local doctor--problems '((problems) - (inhibitions) - (hangups) - (difficulties) - (anxieties) - (frustrations))) + (inhibitions) + (hangups) + (difficulties) + (anxieties) + (frustrations))) (setq-local doctor--bother '((does it bother you that) - (are you annoyed that) - (did you ever regret) - (are you sorry) - (are you satisfied with the fact that))) + (are you annoyed that) + (did you ever regret) + (are you sorry) + (are you satisfied with the fact that))) (setq-local doctor--machlst - '((you have your mind on (doc// doctor-found) \, it seems \.) - (you think too much about (doc// doctor-found) \.) - (you should try taking your mind off of (doc// doctor-found)\.) - (are you a computer hacker \?))) + '((you have your mind on (doc// doctor-found) \, it seems \.) + (you think too much about (doc// doctor-found) \.) + (you should try taking your mind off of (doc// doctor-found)\.) + (are you a computer hacker \?))) (setq-local doctor--qlist - '((what do you think \?) - (i\'ll ask the questions\, if you don\'t mind!) - (i could ask the same thing myself \.) - ((doc$ doctor--please) allow me to do the questioning \.) - (i have asked myself that question many times \.) - ((doc$ doctor--please) try to answer that question yourself \.))) + '((what do you think \?) + (i\'ll ask the questions\, if you don\'t mind!) + (i could ask the same thing myself \.) + ((doc$ doctor--please) allow me to do the questioning \.) + (i have asked myself that question many times \.) + ((doc$ doctor--please) try to answer that question yourself \.))) (setq-local doctor--foullst - '(((doc$ doctor--please) watch your tongue!) - ((doc$ doctor--please) avoid such unwholesome thoughts \.) - ((doc$ doctor--please) get your mind out of the gutter \.) - (such lewdness is not appreciated \.))) + '(((doc$ doctor--please) watch your tongue!) + ((doc$ doctor--please) avoid such unwholesome thoughts \.) + ((doc$ doctor--please) get your mind out of the gutter \.) + (such lewdness is not appreciated \.))) (setq-local doctor--deathlst - '((this is not a healthy way of thinking \.) - ((doc$ doctor--bother) you\, too\, may die someday \?) - (i am worried by your obsession with this topic!) - (did you watch a lot of crime and violence on television as a child \?))) + '((this is not a healthy way of thinking \.) + ((doc$ doctor--bother) you\, too\, may die someday \?) + (i am worried by your obsession with this topic!) + (did you watch a lot of crime and violence on television as a child \?))) (setq-local doctor--sexlst - '(((doc$ doctor--areyou) (doc$ doctor--afraidof) sex \?) - ((doc$ doctor--describe) (doc$ doctor--something) about your sexual history \.) - ((doc$ doctor--please) (doc$ doctor--describe) your sex life \.\.\.) - ((doc$ doctor--describe) your (doc$ doctor--feelings-about) your sexual partner \.) - ((doc$ doctor--describe) your most (doc$ doctor--random-adjective) sexual experience \.) - ((doc$ doctor--areyou) satisfied with (doc// doctor--lover) \.\.\. \?))) + '(((doc$ doctor--areyou) (doc$ doctor--afraidof) sex \?) + ((doc$ doctor--describe) (doc$ doctor--something) about your sexual history \.) + ((doc$ doctor--please) (doc$ doctor--describe) your sex life \.\.\.) + ((doc$ doctor--describe) your (doc$ doctor--feelings-about) your sexual partner \.) + ((doc$ doctor--describe) your most (doc$ doctor--random-adjective) sexual experience \.) + ((doc$ doctor--areyou) satisfied with (doc// doctor--lover) \.\.\. \?))) (setq-local doctor--neglst '((why not \?) - ((doc$ doctor--bother) i ask that \?) - (why not \?) - (why not \?) - (how come \?) - ((doc$ doctor--bother) i ask that \?))) + ((doc$ doctor--bother) i ask that \?) + (why not \?) + (why not \?) + (how come \?) + ((doc$ doctor--bother) i ask that \?))) (setq-local doctor--beclst - '((is it because (doc// doctor-sent) that you came to me \?) - ((doc$ doctor--bother) (doc// doctor-sent) \?) - (when did you first know that (doc// doctor-sent) \?) - (is the fact that (doc// doctor-sent) the real reason \?) - (does the fact that (doc// doctor-sent) explain anything else \?) - ((doc$ doctor--areyou) (doc$ doctor--sure) (doc// doctor-sent) \? ))) + '((is it because (doc// doctor-sent) that you came to me \?) + ((doc$ doctor--bother) (doc// doctor-sent) \?) + (when did you first know that (doc// doctor-sent) \?) + (is the fact that (doc// doctor-sent) the real reason \?) + (does the fact that (doc// doctor-sent) explain anything else \?) + ((doc$ doctor--areyou) (doc$ doctor--sure) (doc// doctor-sent) \? ))) (setq-local doctor--shortbeclst - '(((doc$ doctor--bother) i ask you that \?) - (that\'s not much of an answer!) - ((doc$ doctor--inter) why won\'t you talk about it \?) - (speak up!) - ((doc$ doctor--areyou) (doc$ doctor--afraidof) talking about it \?) - (don\'t be (doc$ doctor--afraidof) elaborating \.) - ((doc$ doctor--please) go into more detail \.))) + '(((doc$ doctor--bother) i ask you that \?) + (that\'s not much of an answer!) + ((doc$ doctor--inter) why won\'t you talk about it \?) + (speak up!) + ((doc$ doctor--areyou) (doc$ doctor--afraidof) talking about it \?) + (don\'t be (doc$ doctor--afraidof) elaborating \.) + ((doc$ doctor--please) go into more detail \.))) (setq-local doctor--thlst - '(((doc$ doctor--maybe) (doc$ doctor--thing) (doc$ doctor--isrelated) this \.) - ((doc$ doctor--maybe) (doc$ doctor--things) (doc$ doctor--arerelated) this \.) - (is it because of (doc$ doctor--things) that you are going through all this \?) - (how do you reconcile (doc$ doctor--things) \? ) - ((doc$ doctor--maybe) this (doc$ doctor--isrelated) (doc$ doctor--things) \?))) + '(((doc$ doctor--maybe) (doc$ doctor--thing) (doc$ doctor--isrelated) this \.) + ((doc$ doctor--maybe) (doc$ doctor--things) (doc$ doctor--arerelated) this \.) + (is it because of (doc$ doctor--things) that you are going through all this \?) + (how do you reconcile (doc$ doctor--things) \? ) + ((doc$ doctor--maybe) this (doc$ doctor--isrelated) (doc$ doctor--things) \?))) (setq-local doctor--remlst - '((earlier you said (doc$ doctor--history) \?) - (you mentioned that (doc$ doctor--history) \?) - ((doc$ doctor--whysay) (doc$ doctor--history) \? ))) + '((earlier you said (doc$ doctor--history) \?) + (you mentioned that (doc$ doctor--history) \?) + ((doc$ doctor--whysay) (doc$ doctor--history) \? ))) (setq-local doctor--toklst - '((is this how you relax \?) - (how long have you been smoking grass \?) - ((doc$ doctor--areyou) (doc$ doctor--afraidof) of being drawn to using harder stuff \?))) + '((is this how you relax \?) + (how long have you been smoking grass \?) + ((doc$ doctor--areyou) (doc$ doctor--afraidof) of being drawn to using harder stuff \?))) (setq-local doctor--states - '((do you get (doc// doctor-found) often \?) - (do you enjoy being (doc// doctor-found) \?) - (what makes you (doc// doctor-found) \?) - (how often (doc$ doctor--areyou) (doc// doctor-found) \?) - (when were you last (doc// doctor-found) \?))) + '((do you get (doc// doctor-found) often \?) + (do you enjoy being (doc// doctor-found) \?) + (what makes you (doc// doctor-found) \?) + (how often (doc$ doctor--areyou) (doc// doctor-found) \?) + (when were you last (doc// doctor-found) \?))) (setq-local doctor--replist '((i . (you)) - (my . (your)) - (me . (you)) - (you . (me)) - (your . (my)) - (mine . (yours)) - (yours . (mine)) - (our . (your)) - (ours . (yours)) - (we . (you)) - (dunno . (do not know)) - ;; (yes . ()) - (no\, . ()) - (yes\, . ()) - (ya . (i)) - (aint . (am not)) - (wanna . (want to)) - (gimme . (give me)) - (gotta . (have to)) - (gonna . (going to)) - (never . (not ever)) - (doesn\'t . (does not)) - (don\'t . (do not)) - (aren\'t . (are not)) - (isn\'t . (is not)) - (won\'t . (will not)) - (can\'t . (cannot)) - (haven\'t . (have not)) - (i\'m . (you are)) - (ourselves . (yourselves)) - (myself . (yourself)) - (yourself . (myself)) - (you\'re . (i am)) - (you\'ve . (i have)) - (i\'ve . (you have)) - (i\'ll . (you will)) - (you\'ll . (i shall)) - (i\'d . (you would)) - (you\'d . (i would)) - (here . (there)) - (please . ()) - (eh\, . ()) - (eh . ()) - (oh\, . ()) - (oh . ()) - (shouldn\'t . (should not)) - (wouldn\'t . (would not)) - (won\'t . (will not)) - (hasn\'t . (has not)))) + (my . (your)) + (me . (you)) + (you . (me)) + (your . (my)) + (mine . (yours)) + (yours . (mine)) + (our . (your)) + (ours . (yours)) + (we . (you)) + (dunno . (do not know)) + ;; (yes . ()) + (no\, . ()) + (yes\, . ()) + (ya . (i)) + (aint . (am not)) + (wanna . (want to)) + (gimme . (give me)) + (gotta . (have to)) + (gonna . (going to)) + (never . (not ever)) + (doesn\'t . (does not)) + (don\'t . (do not)) + (aren\'t . (are not)) + (isn\'t . (is not)) + (won\'t . (will not)) + (can\'t . (cannot)) + (haven\'t . (have not)) + (i\'m . (you are)) + (ourselves . (yourselves)) + (myself . (yourself)) + (yourself . (myself)) + (you\'re . (i am)) + (you\'ve . (i have)) + (i\'ve . (you have)) + (i\'ll . (you will)) + (you\'ll . (i shall)) + (i\'d . (you would)) + (you\'d . (i would)) + (here . (there)) + (please . ()) + (eh\, . ()) + (eh . ()) + (oh\, . ()) + (oh . ()) + (shouldn\'t . (should not)) + (wouldn\'t . (would not)) + (won\'t . (will not)) + (hasn\'t . (has not)))) (setq-local doctor--stallmanlst - '(((doc$ doctor--describe) your (doc$ doctor--feelings-about) him \.) - ((doc$ doctor--areyou) a friend of Stallman \?) - ((doc$ doctor--bother) Stallman is (doc$ doctor--random-adjective) \?) - ((doc$ doctor--ibelieve) you are (doc$ doctor--afraidof) him \.))) + '(((doc$ doctor--describe) your (doc$ doctor--feelings-about) him \.) + ((doc$ doctor--areyou) a friend of Stallman \?) + ((doc$ doctor--bother) Stallman is (doc$ doctor--random-adjective) \?) + ((doc$ doctor--ibelieve) you are (doc$ doctor--afraidof) him \.))) (setq-local doctor--schoollst - '(((doc$ doctor--describe) your (doc// doctor-found) \.) - ((doc$ doctor--bother) your grades could (doc$ doctor--improve) \?) - ((doc$ doctor--areyou) (doc$ doctor--afraidof) (doc// doctor-found) \?) - ((doc$ doctor--maybe) this (doc$ doctor--isrelated) to your attitude \.) - ((doc$ doctor--areyou) absent often \?) - ((doc$ doctor--maybe) you should study (doc$ doctor--something) \.))) + '(((doc$ doctor--describe) your (doc// doctor-found) \.) + ((doc$ doctor--bother) your grades could (doc$ doctor--improve) \?) + ((doc$ doctor--areyou) (doc$ doctor--afraidof) (doc// doctor-found) \?) + ((doc$ doctor--maybe) this (doc$ doctor--isrelated) to your attitude \.) + ((doc$ doctor--areyou) absent often \?) + ((doc$ doctor--maybe) you should study (doc$ doctor--something) \.))) (setq-local doctor--improve - '((improve) (be better) (be improved) (be higher))) + '((improve) (be better) (be improved) (be higher))) (setq-local doctor--elizalst - '(((doc$ doctor--areyou) (doc$ doctor--sure) \?) - ((doc$ doctor--ibelieve) you have (doc$ doctor--problems) with (doc// doctor-found) \.) - ((doc$ doctor--whysay) (doc// doctor-sent) \?))) + '(((doc$ doctor--areyou) (doc$ doctor--sure) \?) + ((doc$ doctor--ibelieve) you have (doc$ doctor--problems) with (doc// doctor-found) \.) + ((doc$ doctor--whysay) (doc// doctor-sent) \?))) (setq-local doctor--sportslst - '((tell me (doc$ doctor--something) about (doc// doctor-found) \.) - ((doc$ doctor--describe) (doc$ doctor--relation) (doc// doctor-found) \.) - (do you find (doc// doctor-found) (doc$ doctor--random-adjective) \?))) + '((tell me (doc$ doctor--something) about (doc// doctor-found) \.) + ((doc$ doctor--describe) (doc$ doctor--relation) (doc// doctor-found) \.) + (do you find (doc// doctor-found) (doc$ doctor--random-adjective) \?))) (setq-local doctor--mathlst - '(((doc$ doctor--describe) (doc$ doctor--something) about math \.) - ((doc$ doctor--maybe) your (doc$ doctor--problems) (doc$ doctor--arerelated) (doc// doctor-found) \.) - (i don\'t know much (doc// doctor-found) \, but (doc$ doctor--continue) - anyway \.))) + '(((doc$ doctor--describe) (doc$ doctor--something) about math \.) + ((doc$ doctor--maybe) your (doc$ doctor--problems) (doc$ doctor--arerelated) (doc// doctor-found) \.) + (i don\'t know much (doc// doctor-found) \, but (doc$ doctor--continue) + anyway \.))) (setq-local doctor--zippylst - '(((doc$ doctor--areyou) Zippy \?) - ((doc$ doctor--ibelieve) you have some serious (doc$ doctor--problems) \.) - ((doc$ doctor--bother) you are a pinhead \?))) + '(((doc$ doctor--areyou) Zippy \?) + ((doc$ doctor--ibelieve) you have some serious (doc$ doctor--problems) \.) + ((doc$ doctor--bother) you are a pinhead \?))) (setq-local doctor--chatlst - '(((doc$ doctor--maybe) we could chat \.) - ((doc$ doctor--please) (doc$ doctor--describe) (doc$ doctor--something) about chat mode \.) - ((doc$ doctor--bother) our discussion is so (doc$ doctor--random-adjective) \?))) + '(((doc$ doctor--maybe) we could chat \.) + ((doc$ doctor--please) (doc$ doctor--describe) (doc$ doctor--something) about chat mode \.) + ((doc$ doctor--bother) our discussion is so (doc$ doctor--random-adjective) \?))) (setq-local doctor--abuselst - '(((doc$ doctor--please) try to be less abusive \.) - ((doc$ doctor--describe) why you call me (doc// doctor-found) \.) - (i\'ve had enough of you!))) + '(((doc$ doctor--please) try to be less abusive \.) + ((doc$ doctor--describe) why you call me (doc// doctor-found) \.) + (i\'ve had enough of you!))) (setq-local doctor--abusewords - '(boring bozo clown clumsy cretin dumb dummy - fool foolish gnerd gnurd idiot jerk - lose loser louse lousy luse luser - moron nerd nurd oaf oafish reek - stink stupid tool toolish twit)) + '(boring bozo clown clumsy cretin dumb dummy + fool foolish gnerd gnurd idiot jerk + lose loser louse lousy luse luser + moron nerd nurd oaf oafish reek + stink stupid tool toolish twit)) (setq-local doctor--howareyoulst - '((how are you) (hows it going) (hows it going eh) - (how\'s it going) (how\'s it going eh) (how goes it) - (whats up) (whats new) (what\'s up) (what\'s new) - (howre you) (how\'re you) (how\'s everything) - (how is everything) (how do you do) - (how\'s it hanging) (que pasa) - (how are you doing) (what do you say))) + '((how are you) (hows it going) (hows it going eh) + (how\'s it going) (how\'s it going eh) (how goes it) + (whats up) (whats new) (what\'s up) (what\'s new) + (howre you) (how\'re you) (how\'s everything) + (how is everything) (how do you do) + (how\'s it hanging) (que pasa) + (how are you doing) (what do you say))) (setq-local doctor--whereoutp '(huh remem rthing)) (setq-local doctor-subj nil) (setq-local doctor-verb nil) commit a77f5abd98a9765875a08edca8f90f644ae2f982 Author: Stefan Kangas Date: Sat Dec 5 11:53:11 2020 +0100 Prefer setq-local in play/*.el * lisp/play/decipher.el (decipher-mode): * lisp/play/doctor.el (make-doctor-variables): * lisp/play/dunnet.el (dun-mode): * lisp/play/gomoku.el (gomoku-mode): Prefer setq-local. diff --git a/lisp/play/decipher.el b/lisp/play/decipher.el index 7a7f96c3bc..674ddce6c9 100644 --- a/lisp/play/decipher.el +++ b/lisp/play/decipher.el @@ -292,8 +292,8 @@ The most useful commands are: (set-syntax-table decipher-mode-syntax-table) (unless (= (point-min) (point-max)) (decipher-read-alphabet)) - (set (make-local-variable 'font-lock-defaults) - '(decipher-font-lock-keywords t)) + (setq-local font-lock-defaults + '(decipher-font-lock-keywords t)) ;; Make the buffer writable when we exit Decipher mode: (add-hook 'change-major-mode-hook (lambda () (setq buffer-read-only nil diff --git a/lisp/play/doctor.el b/lisp/play/doctor.el index a6f9288185..1549eb7d96 100644 --- a/lisp/play/doctor.el +++ b/lisp/play/doctor.el @@ -145,7 +145,7 @@ reads the sentence before point, and prints the Doctor's answer." (insert "\n")) (defun make-doctor-variables () - (set (make-local-variable 'doctor--typos) + (setq-local doctor--typos (mapcar (lambda (x) (put (car x) 'doctor-correction (cadr x)) (put (cadr x) 'doctor-expansion (car (cddr x))) @@ -163,76 +163,76 @@ reads the sentence before point, and prints the Doctor's answer." (you7re you\'re (i am)) (you7ve you\'ve (i have)) (you7ll you\'ll (i will))))) - (set (make-local-variable 'doctor-sent) nil) - (set (make-local-variable 'doctor-found) nil) - (set (make-local-variable 'doctor-owner) nil) - (set (make-local-variable 'doctor--history) nil) - (set (make-local-variable 'doctor--inter) '((well\,) + (setq-local doctor-sent nil) + (setq-local doctor-found nil) + (setq-local doctor-owner nil) + (setq-local doctor--history nil) + (setq-local doctor--inter '((well\,) (hmmm \.\.\.\ so\,) (so) (\.\.\.and) (then))) - (set (make-local-variable 'doctor--continue) '((continue) + (setq-local doctor--continue '((continue) (proceed) (go on) (keep going))) - (set (make-local-variable 'doctor--relation) + (setq-local doctor--relation '((your relationship with) (something you remember about) (your feelings toward) (some experiences you have had with) (how you feel about))) - (set (make-local-variable 'doctor--fears) + (setq-local doctor--fears '(((doc$ doctor--whysay) you are (doc$ doctor--afraidof) (doc// doctor--feared) \?) (you seem terrified by (doc// doctor--feared) \.) (when did you first feel (doc$ doctor--afraidof) (doc// doctor--feared) \?))) - (set (make-local-variable 'doctor--sure) '((sure) + (setq-local doctor--sure '((sure) (positive) (certain) (absolutely sure))) - (set (make-local-variable 'doctor--afraidof) '((afraid of) + (setq-local doctor--afraidof '((afraid of) (frightened by) (scared of))) - (set (make-local-variable 'doctor--areyou) '((are you) + (setq-local doctor--areyou '((are you) (have you been) (have you been))) - (set (make-local-variable 'doctor--isrelated) + (setq-local doctor--isrelated '((has something to do with) (is related to) (could be the reason for) (is caused by) (is because of))) - (set (make-local-variable 'doctor--arerelated) '((have something to do with) + (setq-local doctor--arerelated '((have something to do with) (are related to) (could have caused) (could be the reason for) (are caused by) (are because of))) - (set (make-local-variable 'doctor--moods) + (setq-local doctor--moods '(((doc$ doctor--areyou) (doc// doctor-found) often \?) (what causes you to be (doc// doctor-found) \?) ((doc$ doctor--whysay) you are (doc// doctor-found) \?))) - (set (make-local-variable 'doctor--maybe) '((maybe) + (setq-local doctor--maybe '((maybe) (perhaps) (possibly))) - (set (make-local-variable 'doctor--whatwhen) '((what happened when) + (setq-local doctor--whatwhen '((what happened when) (what would happen if))) - (set (make-local-variable 'doctor--hello) '((how do you do \?) + (setq-local doctor--hello '((how do you do \?) (hello \.) (howdy!) (hello \.) (hi \.) (hi there \.))) - (set (make-local-variable 'doctor--drnk) + (setq-local doctor--drnk '((do you drink a lot of (doc// doctor-found) \?) (do you get drunk often \?) ((doc$ doctor--describe) your drinking habits \.))) - (set (make-local-variable 'doctor--drugs) + (setq-local doctor--drugs '((do you use (doc// doctor-found) often \?) ((doc$ doctor--areyou) addicted to (doc// doctor-found) \?) (do you realize that drugs can be very harmful \?) ((doc$ doctor--maybe) you should try to quit using (doc// doctor-found) \.))) - (set (make-local-variable 'doctor--whywant) + (setq-local doctor--whywant '(((doc$ doctor--whysay) (doc// doctor-subj) might (doc$ doctor--want) (doc// doctor-obj) \?) (how does it feel to want \?) (why should (doc// doctor-subj) get (doc// doctor-obj) \?) @@ -240,7 +240,7 @@ reads the sentence before point, and prints the Doctor's answer." ((doc$ doctor--areyou) obsessed with (doc// doctor-obj) \?) (why should i give (doc// doctor-obj) to (doc// doctor-subj) \?) (have you ever gotten (doc// doctor-obj) \?))) - (set (make-local-variable 'doctor--canyou) + (setq-local doctor--canyou '((of course i can \.) (why should i \?) (what makes you think i would even want to \?) @@ -251,8 +251,8 @@ reads the sentence before point, and prints the Doctor's answer." (can you \?) (maybe i can\, maybe i can\'t \.\.\.) (i don\'t think i should do that \.))) - (set (make-local-variable 'doctor--want) '((want) (desire) (wish) (want) (hope))) - (set (make-local-variable 'doctor--shortlst) + (setq-local doctor--want '((want) (desire) (wish) (want) (hope))) + (setq-local doctor--shortlst '((can you elaborate on that \?) ((doc$ doctor--please) continue \.) (go on\, don\'t be afraid \.) @@ -264,23 +264,23 @@ reads the sentence before point, and prints the Doctor's answer." (you aren\'t being very talkative today\!) (is that all there is to it \?) (why must you respond so briefly \?))) - (set (make-local-variable 'doctor--famlst) + (setq-local doctor--famlst '((tell me (doc$ doctor--something) about (doc// doctor-owner) family \.) (you seem to dwell on (doc// doctor-owner) family \.) ((doc$ doctor--areyou) hung up on (doc// doctor-owner) family \?))) - (set (make-local-variable 'doctor--huhlst) + (setq-local doctor--huhlst '(((doc$ doctor--whysay) (doc// doctor-sent) \?) (is it because of (doc$ doctor--things) that you say (doc// doctor-sent) \?))) - (set (make-local-variable 'doctor--longhuhlst) + (setq-local doctor--longhuhlst '(((doc$ doctor--whysay) that \?) (i don\'t understand \.) ((doc$ doctor--thlst)) ((doc$ doctor--areyou) (doc$ doctor--afraidof) that \?))) - (set (make-local-variable 'doctor--feelings-about) '((feelings about) + (setq-local doctor--feelings-about '((feelings about) (apprehensions toward) (thoughts on) (emotions toward))) - (set (make-local-variable 'doctor--random-adjective) + (setq-local doctor--random-adjective '((vivid) (emotionally stimulating) (exciting) @@ -291,23 +291,23 @@ reads the sentence before point, and prints the Doctor's answer." (unusual) (shocking) (embarrassing))) - (set (make-local-variable 'doctor--whysay) '((why do you say) + (setq-local doctor--whysay '((why do you say) (what makes you believe) (are you sure that) (do you really think) (what makes you think))) - (set (make-local-variable 'doctor--isee) '((i see \.\.\.) + (setq-local doctor--isee '((i see \.\.\.) (yes\,) (i understand \.) (oh \.) )) - (set (make-local-variable 'doctor--please) '((please\,) + (setq-local doctor--please '((please\,) (i would appreciate it if you would) (perhaps you could) (please\,) (would you please) (why don\'t you) (could you))) - (set (make-local-variable 'doctor--bye) + (setq-local doctor--bye '((my secretary will send you a bill \.) (bye bye \.) (see ya \.) @@ -315,12 +315,12 @@ reads the sentence before point, and prints the Doctor's answer." (talk to you later \.) (ok\, have fun \.) (ciao \.))) - (set (make-local-variable 'doctor--something) '((something) + (setq-local doctor--something '((something) (more) (how you feel))) - (set (make-local-variable 'doctor--thing) '((your life) + (setq-local doctor--thing '((your life) (your sex life))) - (set (make-local-variable 'doctor--things) '((your plans) + (setq-local doctor--things '((your plans) (the people you hang around with) (problems at school) (any hobbies you have) @@ -328,69 +328,69 @@ reads the sentence before point, and prints the Doctor's answer." (your inhibitions) (some problems in your childhood) (some problems at home))) - (set (make-local-variable 'doctor--describe) '((describe) + (setq-local doctor--describe '((describe) (tell me about) (talk about) (discuss) (tell me more about) (elaborate on))) - (set (make-local-variable 'doctor--ibelieve) + (setq-local doctor--ibelieve '((i believe) (i think) (i have a feeling) (it seems to me that) (it looks like))) - (set (make-local-variable 'doctor--problems) '((problems) + (setq-local doctor--problems '((problems) (inhibitions) (hangups) (difficulties) (anxieties) (frustrations))) - (set (make-local-variable 'doctor--bother) '((does it bother you that) + (setq-local doctor--bother '((does it bother you that) (are you annoyed that) (did you ever regret) (are you sorry) (are you satisfied with the fact that))) - (set (make-local-variable 'doctor--machlst) + (setq-local doctor--machlst '((you have your mind on (doc// doctor-found) \, it seems \.) (you think too much about (doc// doctor-found) \.) (you should try taking your mind off of (doc// doctor-found)\.) (are you a computer hacker \?))) - (set (make-local-variable 'doctor--qlist) + (setq-local doctor--qlist '((what do you think \?) (i\'ll ask the questions\, if you don\'t mind!) (i could ask the same thing myself \.) ((doc$ doctor--please) allow me to do the questioning \.) (i have asked myself that question many times \.) ((doc$ doctor--please) try to answer that question yourself \.))) - (set (make-local-variable 'doctor--foullst) + (setq-local doctor--foullst '(((doc$ doctor--please) watch your tongue!) ((doc$ doctor--please) avoid such unwholesome thoughts \.) ((doc$ doctor--please) get your mind out of the gutter \.) (such lewdness is not appreciated \.))) - (set (make-local-variable 'doctor--deathlst) + (setq-local doctor--deathlst '((this is not a healthy way of thinking \.) ((doc$ doctor--bother) you\, too\, may die someday \?) (i am worried by your obsession with this topic!) (did you watch a lot of crime and violence on television as a child \?))) - (set (make-local-variable 'doctor--sexlst) + (setq-local doctor--sexlst '(((doc$ doctor--areyou) (doc$ doctor--afraidof) sex \?) ((doc$ doctor--describe) (doc$ doctor--something) about your sexual history \.) ((doc$ doctor--please) (doc$ doctor--describe) your sex life \.\.\.) ((doc$ doctor--describe) your (doc$ doctor--feelings-about) your sexual partner \.) ((doc$ doctor--describe) your most (doc$ doctor--random-adjective) sexual experience \.) ((doc$ doctor--areyou) satisfied with (doc// doctor--lover) \.\.\. \?))) - (set (make-local-variable 'doctor--neglst) '((why not \?) + (setq-local doctor--neglst '((why not \?) ((doc$ doctor--bother) i ask that \?) (why not \?) (why not \?) (how come \?) ((doc$ doctor--bother) i ask that \?))) - (set (make-local-variable 'doctor--beclst) + (setq-local doctor--beclst '((is it because (doc// doctor-sent) that you came to me \?) ((doc$ doctor--bother) (doc// doctor-sent) \?) (when did you first know that (doc// doctor-sent) \?) (is the fact that (doc// doctor-sent) the real reason \?) (does the fact that (doc// doctor-sent) explain anything else \?) ((doc$ doctor--areyou) (doc$ doctor--sure) (doc// doctor-sent) \? ))) - (set (make-local-variable 'doctor--shortbeclst) + (setq-local doctor--shortbeclst '(((doc$ doctor--bother) i ask you that \?) (that\'s not much of an answer!) ((doc$ doctor--inter) why won\'t you talk about it \?) @@ -398,27 +398,27 @@ reads the sentence before point, and prints the Doctor's answer." ((doc$ doctor--areyou) (doc$ doctor--afraidof) talking about it \?) (don\'t be (doc$ doctor--afraidof) elaborating \.) ((doc$ doctor--please) go into more detail \.))) - (set (make-local-variable 'doctor--thlst) + (setq-local doctor--thlst '(((doc$ doctor--maybe) (doc$ doctor--thing) (doc$ doctor--isrelated) this \.) ((doc$ doctor--maybe) (doc$ doctor--things) (doc$ doctor--arerelated) this \.) (is it because of (doc$ doctor--things) that you are going through all this \?) (how do you reconcile (doc$ doctor--things) \? ) ((doc$ doctor--maybe) this (doc$ doctor--isrelated) (doc$ doctor--things) \?))) - (set (make-local-variable 'doctor--remlst) + (setq-local doctor--remlst '((earlier you said (doc$ doctor--history) \?) (you mentioned that (doc$ doctor--history) \?) ((doc$ doctor--whysay) (doc$ doctor--history) \? ))) - (set (make-local-variable 'doctor--toklst) + (setq-local doctor--toklst '((is this how you relax \?) (how long have you been smoking grass \?) ((doc$ doctor--areyou) (doc$ doctor--afraidof) of being drawn to using harder stuff \?))) - (set (make-local-variable 'doctor--states) + (setq-local doctor--states '((do you get (doc// doctor-found) often \?) (do you enjoy being (doc// doctor-found) \?) (what makes you (doc// doctor-found) \?) (how often (doc$ doctor--areyou) (doc// doctor-found) \?) (when were you last (doc// doctor-found) \?))) - (set (make-local-variable 'doctor--replist) '((i . (you)) + (setq-local doctor--replist '((i . (you)) (my . (your)) (me . (you)) (you . (me)) @@ -467,52 +467,52 @@ reads the sentence before point, and prints the Doctor's answer." (wouldn\'t . (would not)) (won\'t . (will not)) (hasn\'t . (has not)))) - (set (make-local-variable 'doctor--stallmanlst) + (setq-local doctor--stallmanlst '(((doc$ doctor--describe) your (doc$ doctor--feelings-about) him \.) ((doc$ doctor--areyou) a friend of Stallman \?) ((doc$ doctor--bother) Stallman is (doc$ doctor--random-adjective) \?) ((doc$ doctor--ibelieve) you are (doc$ doctor--afraidof) him \.))) - (set (make-local-variable 'doctor--schoollst) + (setq-local doctor--schoollst '(((doc$ doctor--describe) your (doc// doctor-found) \.) ((doc$ doctor--bother) your grades could (doc$ doctor--improve) \?) ((doc$ doctor--areyou) (doc$ doctor--afraidof) (doc// doctor-found) \?) ((doc$ doctor--maybe) this (doc$ doctor--isrelated) to your attitude \.) ((doc$ doctor--areyou) absent often \?) ((doc$ doctor--maybe) you should study (doc$ doctor--something) \.))) - (set (make-local-variable 'doctor--improve) + (setq-local doctor--improve '((improve) (be better) (be improved) (be higher))) - (set (make-local-variable 'doctor--elizalst) + (setq-local doctor--elizalst '(((doc$ doctor--areyou) (doc$ doctor--sure) \?) ((doc$ doctor--ibelieve) you have (doc$ doctor--problems) with (doc// doctor-found) \.) ((doc$ doctor--whysay) (doc// doctor-sent) \?))) - (set (make-local-variable 'doctor--sportslst) + (setq-local doctor--sportslst '((tell me (doc$ doctor--something) about (doc// doctor-found) \.) ((doc$ doctor--describe) (doc$ doctor--relation) (doc// doctor-found) \.) (do you find (doc// doctor-found) (doc$ doctor--random-adjective) \?))) - (set (make-local-variable 'doctor--mathlst) + (setq-local doctor--mathlst '(((doc$ doctor--describe) (doc$ doctor--something) about math \.) ((doc$ doctor--maybe) your (doc$ doctor--problems) (doc$ doctor--arerelated) (doc// doctor-found) \.) (i don\'t know much (doc// doctor-found) \, but (doc$ doctor--continue) anyway \.))) - (set (make-local-variable 'doctor--zippylst) + (setq-local doctor--zippylst '(((doc$ doctor--areyou) Zippy \?) ((doc$ doctor--ibelieve) you have some serious (doc$ doctor--problems) \.) ((doc$ doctor--bother) you are a pinhead \?))) - (set (make-local-variable 'doctor--chatlst) + (setq-local doctor--chatlst '(((doc$ doctor--maybe) we could chat \.) ((doc$ doctor--please) (doc$ doctor--describe) (doc$ doctor--something) about chat mode \.) ((doc$ doctor--bother) our discussion is so (doc$ doctor--random-adjective) \?))) - (set (make-local-variable 'doctor--abuselst) + (setq-local doctor--abuselst '(((doc$ doctor--please) try to be less abusive \.) ((doc$ doctor--describe) why you call me (doc// doctor-found) \.) (i\'ve had enough of you!))) - (set (make-local-variable 'doctor--abusewords) + (setq-local doctor--abusewords '(boring bozo clown clumsy cretin dumb dummy fool foolish gnerd gnurd idiot jerk lose loser louse lousy luse luser moron nerd nurd oaf oafish reek stink stupid tool toolish twit)) - (set (make-local-variable 'doctor--howareyoulst) + (setq-local doctor--howareyoulst '((how are you) (hows it going) (hows it going eh) (how\'s it going) (how\'s it going eh) (how goes it) (whats up) (whats new) (what\'s up) (what\'s new) @@ -520,24 +520,24 @@ reads the sentence before point, and prints the Doctor's answer." (how is everything) (how do you do) (how\'s it hanging) (que pasa) (how are you doing) (what do you say))) - (set (make-local-variable 'doctor--whereoutp) '(huh remem rthing)) - (set (make-local-variable 'doctor-subj) nil) - (set (make-local-variable 'doctor-verb) nil) - (set (make-local-variable 'doctor-obj) nil) - (set (make-local-variable 'doctor--feared) nil) - (set (make-local-variable 'doctor--repetitive-shortness) '(0 . 0)) - (set (make-local-variable 'doctor--**mad**) nil) - (set (make-local-variable 'doctor--rms-flag) nil) - (set (make-local-variable 'doctor--eliza-flag) nil) - (set (make-local-variable 'doctor--zippy-flag) nil) - (set (make-local-variable 'doctor--suicide-flag) nil) - (set (make-local-variable 'doctor--lover) '(your partner)) - (set (make-local-variable 'doctor--bak) nil) - (set (make-local-variable 'doctor--lincount) 0) - (set (make-local-variable 'doctor--*print-upcase*) nil) - (set (make-local-variable 'doctor--*print-space*) nil) - (set (make-local-variable 'doctor--howdyflag) nil) - (set (make-local-variable 'doctor-object) nil)) + (setq-local doctor--whereoutp '(huh remem rthing)) + (setq-local doctor-subj nil) + (setq-local doctor-verb nil) + (setq-local doctor-obj nil) + (setq-local doctor--feared nil) + (setq-local doctor--repetitive-shortness '(0 . 0)) + (setq-local doctor--**mad** nil) + (setq-local doctor--rms-flag nil) + (setq-local doctor--eliza-flag nil) + (setq-local doctor--zippy-flag nil) + (setq-local doctor--suicide-flag nil) + (setq-local doctor--lover '(your partner)) + (setq-local doctor--bak nil) + (setq-local doctor--lincount 0) + (setq-local doctor--*print-upcase* nil) + (setq-local doctor--*print-space* nil) + (setq-local doctor--howdyflag nil) + (setq-local doctor-object nil)) ;; Define equivalence classes of words that get treated alike. diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el index eb3805d669..1df28a0f37 100644 --- a/lisp/play/dunnet.el +++ b/lisp/play/dunnet.el @@ -1144,8 +1144,7 @@ treasures for points?" "4" "four") (define-derived-mode dun-mode text-mode "Dungeon" "Major mode for running dunnet." - (make-local-variable 'scroll-step) - (setq scroll-step 2)) + (setq-local scroll-step 2)) (defun dun-parse (_arg) "Function called when return is pressed in interactive mode to parse line." diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el index 403398672b..8ede82a6b9 100644 --- a/lisp/play/gomoku.el +++ b/lisp/play/gomoku.el @@ -195,9 +195,8 @@ You play by moving the cursor over the square you choose and hitting \\[gomoku-h Other useful commands:\n \\{gomoku-mode-map}" (gomoku-display-statistics) - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults '(gomoku-font-lock-keywords t) - buffer-read-only t) + (setq-local font-lock-defaults '(gomoku-font-lock-keywords t)) + (setq buffer-read-only t) (add-hook 'post-command-hook #'gomoku--intangible nil t)) ;;; commit e5a18efd3d96a942c6d6bdc04d0d431165f3138a Author: Basil L. Contovounesios Date: Sat Dec 5 10:39:55 2020 +0000 Fix last change to shell-command * lisp/simple.el: Specify comint-term-environment arglist in function declaration. (shell-command): Load shell.el before calling comint-term-environment; otherwise it is undefined. Allow async-shell-command-width to take precedence over the COLUMNS value returned by comint-term-environment. (Bug#45034) diff --git a/lisp/simple.el b/lisp/simple.el index 4356e40d4f..d73bc6b068 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3786,7 +3786,7 @@ a shell (with its need to quote arguments)." (shell-command command output-buffer error-buffer)) (declare-function comint-output-filter "comint" (process string)) -(declare-function comint-term-environment "comint") +(declare-function comint-term-environment "comint" ()) (defun shell-command (command &optional output-buffer error-buffer) "Execute string COMMAND in inferior shell; display output, if any. @@ -3965,18 +3965,19 @@ impose the use of a shell (with its need to quote arguments)." (with-current-buffer buffer (shell-command-save-pos-or-erase) (setq default-directory directory) - (let ((process-environment + (require 'shell) + (let ((process-environment (append - (comint-term-environment) (and (natnump async-shell-command-width) (list (format "COLUMNS=%d" async-shell-command-width))) + (comint-term-environment) process-environment))) (setq proc (start-process-shell-command "Shell" buffer command))) (setq mode-line-process '(":%s")) - (require 'shell) (shell-mode) + (shell-mode) (set-process-sentinel proc #'shell-command-sentinel) ;; Use the comint filter for proper handling of ;; carriage motion (see comint-inhibit-carriage-motion). commit 6916e7954ab5de5e2dc7b25f165a63396d0e70a0 Author: Eli Zaretskii Date: Sat Dec 5 12:19:27 2020 +0200 Improve documentation of 'ps-print-color-p' * doc/emacs/misc.texi (PostScript Variables): Improve and clarify the description of 'ps-print-color-p'. (Bug#44962) diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 2f02c70251..5f700367ad 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -2252,13 +2252,18 @@ off. @vindex ps-print-color-p If your printer doesn't support colors, you should turn off color processing by setting @code{ps-print-color-p} to @code{nil}. By -default, if the display supports colors, Emacs produces hardcopy output -with color information; on black-and-white printers, colors are emulated -with shades of gray. This might produce illegible output, even if your -screen colors only use shades of gray. - - Alternatively, you can set @code{ps-print-color-p} to @code{black-white} to -print colors on black/white printers. +default, if the display supports colors, Emacs produces hardcopy +output with color information; on black-and-white printers, colors are +emulated with shades of gray. This might produce barely-readable or +even illegible output, even if your screen colors only use shades of +gray. + +@vindex ps-black-white-faces + Alternatively, you can set @code{ps-print-color-p} to @code{black-white} +to have colors display better on black/white printers. This works by +using information in @code{ps-black-white-faces} to express colors by +customizable list of shades of gray, augmented by bold and italic +face attributes. @vindex ps-use-face-background By default, PostScript printing ignores the background colors of the commit f254c8b5f3df13bdee246fd9217870fa74dceea6 Author: Stefan Kangas Date: Sat Dec 5 10:54:14 2020 +0100 Prefer setq-local in mail/*.el * lisp/mail/emacsbug.el (report-emacs-bug): * lisp/mail/rfc822.el (rfc822-addresses): * lisp/mail/rmail.el (rmail-perm-variables, rmail-show-message-1): * lisp/mail/rmailedit.el (rmail-edit-mode): (rmail-edit-current-message, rmail-cease-edit): * lisp/mail/rmailsum.el (rmail-new-summary-1, rmail-summary-mode): (rmail-summary-update-highlight): * lisp/mail/sendmail.el (mail-mode): Prefer setq-local. diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index d524b26f1b..5ad1b9821f 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -241,12 +241,12 @@ Already submitted bugs can be found in the Emacs bug tracker: ;; that report-emacs-bug-orig-text remains valid. (Bug#5178) (message-sort-headers) ;; Stop message-mode stealing the properties we will add. - (set (make-local-variable 'message-strip-special-text-properties) nil) + (setq-local message-strip-special-text-properties nil) ;; Make sure we default to the From: address as envelope when sending ;; through sendmail. FIXME: Why? (when (and (not (message--sendmail-envelope-from)) (message-bogus-recipient-p (message-make-address))) - (set (make-local-variable 'message-sendmail-envelope-from) 'header))) + (setq-local message-sendmail-envelope-from 'header))) (rfc822-goto-eoh) (forward-line 1) ;; Move the mail signature to the proper place. @@ -381,9 +381,8 @@ usually do not have translators for other languages.\n\n"))) (add-hook report-emacs-bug-send-hook 'report-emacs-bug-hook nil t)) (goto-char (point-max)) (skip-chars-backward " \t\n") - (make-local-variable 'report-emacs-bug-orig-text) - (setq report-emacs-bug-orig-text - (buffer-substring-no-properties (point-min) (point))) + (setq-local report-emacs-bug-orig-text + (buffer-substring-no-properties (point-min) (point))) (goto-char user-point))) (defun emacs-bug--system-description () diff --git a/lisp/mail/rfc822.el b/lisp/mail/rfc822.el index 4572f27faf..70480d4ede 100644 --- a/lisp/mail/rfc822.el +++ b/lisp/mail/rfc822.el @@ -279,8 +279,7 @@ (let ((buf (generate-new-buffer " rfc822"))) (unwind-protect (with-current-buffer buf - (make-local-variable 'case-fold-search) - (setq case-fold-search nil) ;For speed(?) + (setq-local case-fold-search nil) ;For speed(?) (insert header-text) ;; unfold continuation lines (goto-char (point-min)) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 2c972ee7aa..63d992d271 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -1431,27 +1431,23 @@ If so restore the actual mbox message collection." (defun rmail-perm-variables () (make-local-variable 'rmail-last-regexp) (make-local-variable 'rmail-deleted-vector) - (make-local-variable 'rmail-buffer) - (make-local-variable 'rmail-was-converted) - (setq rmail-was-converted nil) - (make-local-variable 'rmail-seriously-modified) - (setq rmail-seriously-modified nil) - (setq rmail-buffer (current-buffer)) + (setq-local rmail-was-converted nil) + (setq-local rmail-seriously-modified nil) + (setq-local rmail-buffer (current-buffer)) (set-buffer-multibyte nil) (with-current-buffer (setq rmail-view-buffer (rmail-generate-viewer-buffer)) (setq buffer-undo-list t) ;; Note that this does not erase the buffer. Should it? ;; It depends on how this is called. If somehow called with the ;; rmail buffers swapped, it would erase the message collection. - (set (make-local-variable 'rmail-overlay-list) nil) + (setq-local rmail-overlay-list nil) (set-buffer-multibyte t) ;; Force C-x C-s write Unix EOLs. (set-buffer-file-coding-system 'undecided-unix)) (make-local-variable 'rmail-summary-buffer) (make-local-variable 'rmail-summary-vector) (make-local-variable 'rmail-current-message) - (make-local-variable 'rmail-total-messages) - (setq rmail-total-messages 0) + (setq-local rmail-total-messages 0) (make-local-variable 'rmail-message-vector) (make-local-variable 'rmail-msgref-vector) (make-local-variable 'rmail-inbox-list) @@ -1466,39 +1462,30 @@ If so restore the actual mbox message collection." ;; FIXME expand-file-name? (concat rmail-spool-directory (user-login-name))))))) - (set (make-local-variable 'tool-bar-map) rmail-tool-bar-map)) + (setq-local tool-bar-map rmail-tool-bar-map)) ;; Set up the non-permanent locals associated with Rmail mode. (defun rmail-variables () ;; Turn off undo. We turn it back on in rmail-edit. (setq buffer-undo-list t) ;; Don't let a local variables list in a message cause confusion. - (make-local-variable 'local-enable-local-variables) - (setq local-enable-local-variables nil) + (setq-local local-enable-local-variables nil) ;; Don't turn off auto-saving based on the size of the buffer ;; because that code does not understand buffer-swapping. - (make-local-variable 'auto-save-include-big-deletions) - (setq auto-save-include-big-deletions t) - (make-local-variable 'revert-buffer-function) - (setq revert-buffer-function 'rmail-revert) - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults - '(rmail-font-lock-keywords - t t nil nil - (font-lock-maximum-size . nil) - (font-lock-dont-widen . t) - (font-lock-inhibit-thing-lock . (lazy-lock-mode fast-lock-mode)))) - (make-local-variable 'require-final-newline) - (setq require-final-newline nil) - (make-local-variable 'version-control) - (setq version-control 'never) + (setq-local auto-save-include-big-deletions t) + (setq-local revert-buffer-function 'rmail-revert) + (setq-local font-lock-defaults + '(rmail-font-lock-keywords + t t nil nil + (font-lock-maximum-size . nil) + (font-lock-dont-widen . t) + (font-lock-inhibit-thing-lock . (lazy-lock-mode fast-lock-mode)))) + (setq-local require-final-newline nil) + (setq-local version-control 'never) (add-hook 'kill-buffer-hook #'rmail-mode-kill-summary nil t) - (make-local-variable 'file-precious-flag) - (setq file-precious-flag t) - (make-local-variable 'desktop-save-buffer) - (setq desktop-save-buffer t) - (make-local-variable 'save-buffer-coding-system) - (setq save-buffer-coding-system 'no-conversion) + (setq-local file-precious-flag t) + (setq-local desktop-save-buffer t) + (setq-local save-buffer-coding-system 'no-conversion) (setq next-error-move-function 'rmail-next-error-move)) ;; Handle M-x revert-buffer done in an rmail-mode buffer. @@ -2787,7 +2774,7 @@ The current mail message becomes the message displayed." ;; rmail-header-style based on the binding in effect when ;; this function is called; `rmail-toggle-header' can ;; inspect this value to determine how to toggle. - (set (make-local-variable 'rmail-header-style) header-style) + (setq-local rmail-header-style header-style) ;; In case viewing the previous message sets the paragraph ;; direction non-nil, we reset it here to allow independent ;; dynamic determination of paragraph direction in every @@ -2798,7 +2785,7 @@ The current mail message becomes the message displayed." (re-search-forward "mime-version: 1.0" nil t)) (let ((rmail-buffer mbox-buf) (rmail-view-buffer view-buf)) - (set (make-local-variable 'rmail-mime-decoded) t) + (setq-local rmail-mime-decoded t) (funcall rmail-show-mime-function)) (setq body-start (search-forward "\n\n" nil t)) (narrow-to-region beg (point)) diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el index 3026283a08..72a5603ddc 100644 --- a/lisp/mail/rmailedit.el +++ b/lisp/mail/rmailedit.el @@ -66,8 +66,7 @@ This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'. (setq mode-line-modified (default-value 'mode-line-modified)) ;; Don't turn off auto-saving based on the size of the buffer ;; because that code does not understand buffer-swapping. - (make-local-variable 'auto-save-include-big-deletions) - (setq auto-save-include-big-deletions t) + (setq-local auto-save-include-big-deletions t) ;; If someone uses C-x C-s, don't clobber the rmail file (bug#2625). (add-hook 'write-region-annotate-functions 'rmail-write-region-annotate nil t) @@ -98,10 +97,9 @@ This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'. (if (zerop rmail-total-messages) (error "No messages in this buffer")) (rmail-modify-format) - (make-local-variable 'rmail-old-pruned) - (setq rmail-old-pruned (rmail-msg-is-pruned)) + (setq-local rmail-old-pruned (rmail-msg-is-pruned)) (rmail-edit-mode) - (set (make-local-variable 'rmail-old-mime-state) + (setq-local rmail-old-mime-state (and rmail-enable-mime ;; If you use something else, you are on your own. (eq rmail-mime-feature 'rmailmm) @@ -125,13 +123,11 @@ This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'. (goto-char (point-min)) ;; t = decoded; raw = raw. (aref (aref (rmail-mime-entity-display entity) 0) 0))))) - (make-local-variable 'rmail-old-text) - (setq rmail-old-text - (save-restriction - (widen) - (buffer-substring (point-min) (point-max)))) - (make-local-variable 'rmail-old-headers) - (setq rmail-old-headers (rmail-edit-headers-alist t)) + (setq-local rmail-old-text + (save-restriction + (widen) + (buffer-substring (point-min) (point-max)))) + (setq-local rmail-old-headers (rmail-edit-headers-alist t)) (setq buffer-read-only nil) (setq buffer-undo-list nil) ;; Whether the buffer is initially marked as modified or not @@ -209,7 +205,7 @@ This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'. (kill-all-local-variables) (rmail-mode-1) (if (boundp 'tool-bar-map) - (set (make-local-variable 'tool-bar-map) rmail-tool-bar-map)) + (setq-local tool-bar-map rmail-tool-bar-map)) (setq buffer-undo-list t) (rmail-variables)) ;; If text has really changed, mark message as edited. diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index 521659b7eb..a085e0bc4f 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -532,8 +532,7 @@ message." ;; Set up the rest of its state and local variables. (setq buffer-read-only t) (rmail-summary-mode) - (make-local-variable 'minor-mode-alist) - (setq minor-mode-alist (list (list t (concat ": " description)))) + (setq-local minor-mode-alist (list (list t (concat ": " description)))) (setq rmail-buffer rbuf rmail-summary-redo redo rmail-total-messages total))) @@ -1089,13 +1088,10 @@ Commands for sorting the summary: (set-syntax-table text-mode-syntax-table) (make-local-variable 'rmail-buffer) (make-local-variable 'rmail-total-messages) - (make-local-variable 'rmail-current-message) - (setq rmail-current-message nil) - (make-local-variable 'rmail-summary-redo) - (setq rmail-summary-redo nil) + (setq-local rmail-current-message nil) + (setq-local rmail-summary-redo nil) (make-local-variable 'revert-buffer-function) - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults '(rmail-summary-font-lock-keywords t)) + (setq-local font-lock-defaults '(rmail-summary-font-lock-keywords t)) (rmail-summary-enable)) ;; Summary features need to be disabled during edit mode. @@ -1288,8 +1284,7 @@ Returns non-nil if message N was found." ;; Make sure we have an overlay to use. (or rmail-summary-overlay (progn - (make-local-variable 'rmail-summary-overlay) - (setq rmail-summary-overlay (make-overlay (point) (point))) + (setq-local rmail-summary-overlay (make-overlay (point) (point))) (overlay-put rmail-summary-overlay 'rmail-summary t))) ;; If this message is in the summary, use the overlay to highlight it. ;; Otherwise, don't highlight anything. diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 7610939e57..02a852f19b 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -691,29 +691,25 @@ Turning on Mail mode runs the normal hooks `text-mode-hook' and (make-local-variable 'mail-reply-action) (make-local-variable 'mail-send-actions) (make-local-variable 'mail-return-action) - (make-local-variable 'mail-encode-mml) - (setq mail-encode-mml nil) + (setq-local mail-encode-mml nil) (setq buffer-offer-save t) - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults '(mail-font-lock-keywords t t)) + (setq-local font-lock-defaults '(mail-font-lock-keywords t t)) (make-local-variable 'paragraph-separate) (setq-local normal-auto-fill-function #'mail-mode-auto-fill) (setq-local fill-paragraph-function #'mail-mode-fill-paragraph) ;; Allow using comment commands to add/remove quoting (this only does ;; anything if mail-yank-prefix is set to a non-nil value). - (set (make-local-variable 'comment-start) mail-yank-prefix) + (setq-local comment-start mail-yank-prefix) (if mail-yank-prefix - (set (make-local-variable 'comment-start-skip) - (concat "^" (regexp-quote mail-yank-prefix) "[ \t]*"))) - (make-local-variable 'adaptive-fill-regexp) + (setq-local comment-start-skip + (concat "^" (regexp-quote mail-yank-prefix) "[ \t]*"))) ;; Also update the paragraph-separate entry if you change this. - (setq adaptive-fill-regexp - (concat "[ \t]*[-[:alnum:]]+>+[ \t]*\\|" - adaptive-fill-regexp)) - (make-local-variable 'adaptive-fill-first-line-regexp) - (setq adaptive-fill-first-line-regexp - (concat "[ \t]*[-[:alnum:]]*>+[ \t]*\\|" - adaptive-fill-first-line-regexp)) + (setq-local adaptive-fill-regexp + (concat "[ \t]*[-[:alnum:]]+>+[ \t]*\\|" + adaptive-fill-regexp)) + (setq-local adaptive-fill-first-line-regexp + (concat "[ \t]*[-[:alnum:]]*>+[ \t]*\\|" + adaptive-fill-first-line-regexp)) (add-hook 'completion-at-point-functions #'mail-completion-at-point-function nil 'local) ;; `-- ' precedes the signature. `-----' appears at the start of the commit 6663b2f21145ca614b403e89a7097394f913cdb4 Author: Eli Zaretskii Date: Sat Dec 5 11:00:05 2020 +0200 ; * lisp/simple.el (move-beginning-of-line): Doc fix. diff --git a/lisp/simple.el b/lisp/simple.el index 3ea00d44a0..2286279ec0 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -6866,6 +6866,12 @@ rests." \(If there's an image in the line, this disregards newlines that are part of the text that the image rests on.) +When moving from position that has no `field' property, this +command doesn't enter text which has non-nil `field' property. +In particular, when invoked in the minibuffer, the command will +stop short of entering the text of the minibuffer prompt. +See `inhibit-field-text-motion' for how to inhibit this. + With argument ARG not nil or 1, move forward ARG - 1 lines first. If point reaches the beginning or end of buffer, it stops there. \(But if the buffer doesn't end in a newline, it stops at the commit 5ef30fbf11c3ee0ff1c30061dab554b9bd3ce841 Author: Stefan Kangas Date: Sat Dec 5 08:58:12 2020 +0100 Prefer setq-local in vc/*.el * lisp/vc/add-log.el (find-change-log, change-log-mode): * lisp/vc/cvs-status.el (cvs-status-mode): * lisp/vc/diff-mode.el (diff-restrict-view, diff-find-file-name): (diff-mode, diff-setup-whitespace, diff-apply-hunk): * lisp/vc/diff.el (diff-no-select): * lisp/vc/ediff-util.el (ediff-setup): * lisp/vc/log-edit.el (log-edit, log-edit-mode): * lisp/vc/log-view.el (log-view-mode): * lisp/vc/pcvs.el (cvs-temp-buffer, cvs-make-cvs-buffer): (cvs-update-filter, cvs-mode, cvs-mode-commit) (cvs-mode-edit-log, cvs-vc-command-advice): * lisp/vc/smerge-mode.el (smerge-match-conflict): (smerge-ediff, smerge-mode): * lisp/vc/vc-annotate.el (vc-annotate-mode): (vc-annotate, vc-annotate-display): * lisp/vc/vc-bzr.el (vc-bzr-log-view-mode): * lisp/vc/vc-dir.el (vc-dir-mode): * lisp/vc/vc-dispatcher.el (vc-setup-buffer): (vc-compilation-mode, vc-start-logentry): * lisp/vc/vc-git.el (vc-git-log-view-mode): * lisp/vc/vc-hg.el (vc-hg-log-view-mode): * lisp/vc/vc-hooks.el (vc-refresh-state): * lisp/vc/vc-mtn.el (vc-mtn-log-view-mode): * lisp/vc/vc-svn.el (vc-svn-log-view-mode): * lisp/vc/vc.el (vc-register, vc-diff-internal): (vc-find-revision-save, vc-find-revision-no-save): (vc-log-internal-common, vc-region-history): Prefer setq-local. diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el index 54bb356978..e177a5a57d 100644 --- a/lisp/vc/add-log.el +++ b/lisp/vc/add-log.el @@ -779,7 +779,7 @@ Optional arg BUFFER-FILE overrides `buffer-file-name'." found))))))) (if root (setq file-name (expand-file-name cbase root)))))) ;; Make a local variable in this buffer so we needn't search again. - (set (make-local-variable 'change-log-default-name) file-name)) + (setq-local change-log-default-name file-name)) file-name) (defun add-log-file-name (buffer-file log-file) @@ -1134,40 +1134,40 @@ Runs `change-log-mode-hook'. indent-tabs-mode t tab-width 8 show-trailing-whitespace t) - (set (make-local-variable 'fill-forward-paragraph-function) - 'change-log-fill-forward-paragraph) - (set (make-local-variable 'comment-start) nil) + (setq-local fill-forward-paragraph-function + 'change-log-fill-forward-paragraph) + (setq-local comment-start nil) ;; Make sure we call `change-log-indent' when filling. - (set (make-local-variable 'fill-indent-according-to-mode) t) + (setq-local fill-indent-according-to-mode t) ;; Avoid that filling leaves behind a single "*" on a line. (add-hook 'fill-nobreak-predicate (lambda () (looking-back "^\\s *\\*\\s *" (line-beginning-position))) nil t) - (set (make-local-variable 'indent-line-function) 'change-log-indent) - (set (make-local-variable 'tab-always-indent) nil) - (set (make-local-variable 'copyright-at-end-flag) t) + (setq-local indent-line-function 'change-log-indent) + (setq-local tab-always-indent nil) + (setq-local copyright-at-end-flag t) ;; We really do want "^" in paragraph-start below: it is only the ;; lines that begin at column 0 (despite the left-margin of 8) that ;; we are looking for. Adding `* ' allows eliding the blank line ;; between entries for different files. - (set (make-local-variable 'paragraph-start) "\\s *$\\|\f\\|^\\<") - (set (make-local-variable 'paragraph-separate) paragraph-start) + (setq-local paragraph-start "\\s *$\\|\f\\|^\\<") + (setq-local paragraph-separate paragraph-start) ;; Match null string on the date-line so that the date-line ;; is grouped with what follows. - (set (make-local-variable 'page-delimiter) "^\\<\\|^\f") - (set (make-local-variable 'version-control) 'never) - (set (make-local-variable 'smerge-resolve-function) - 'change-log-resolve-conflict) - (set (make-local-variable 'adaptive-fill-regexp) "\\s *") - (set (make-local-variable 'font-lock-defaults) - '(change-log-font-lock-keywords t nil nil backward-paragraph)) - (set (make-local-variable 'multi-isearch-next-buffer-function) - 'change-log-next-buffer) - (set (make-local-variable 'beginning-of-defun-function) - 'change-log-beginning-of-defun) - (set (make-local-variable 'end-of-defun-function) - 'change-log-end-of-defun) + (setq-local page-delimiter "^\\<\\|^\f") + (setq-local version-control 'never) + (setq-local smerge-resolve-function + 'change-log-resolve-conflict) + (setq-local adaptive-fill-regexp "\\s *") + (setq-local font-lock-defaults + '(change-log-font-lock-keywords t nil nil backward-paragraph)) + (setq-local multi-isearch-next-buffer-function + 'change-log-next-buffer) + (setq-local beginning-of-defun-function + 'change-log-beginning-of-defun) + (setq-local end-of-defun-function + 'change-log-end-of-defun) ;; next-error function glue (setq next-error-function 'change-log-next-error)) diff --git a/lisp/vc/cvs-status.el b/lisp/vc/cvs-status.el index 6192b934cb..093c17b8cc 100644 --- a/lisp/vc/cvs-status.el +++ b/lisp/vc/cvs-status.el @@ -92,8 +92,8 @@ ;;;###autoload (define-derived-mode cvs-status-mode fundamental-mode "CVS-Status" "Mode used for cvs status output." - (set (make-local-variable 'font-lock-defaults) cvs-status-font-lock-defaults) - (set (make-local-variable 'cvs-minor-wrap-function) 'cvs-status-minor-wrap)) + (setq-local font-lock-defaults cvs-status-font-lock-defaults) + (setq-local cvs-minor-wrap-function #'cvs-status-minor-wrap)) ;; Define cvs-status-next and cvs-status-prev (easy-mmode-define-navigation cvs-status cvs-status-entry-leader-re "entry") diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 51f4180316..bf83601083 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -741,7 +741,7 @@ If the prefix ARG is given, restrict the view to the current file instead." (interactive "P") (apply 'narrow-to-region (if arg (diff-bounds-of-file) (diff-bounds-of-hunk))) - (set (make-local-variable 'diff-narrowed-to) (if arg 'file 'hunk))) + (setq-local diff-narrowed-to (if arg 'file 'hunk))) (defun diff--some-hunks-p () (save-excursion @@ -969,8 +969,8 @@ Non-nil NOPROMPT means to prefer returning nil than to prompt the user. PREFIX is only used internally: don't use it." (unless (equal diff-remembered-defdir default-directory) ;; Flush diff-remembered-files-alist if the default-directory is changed. - (set (make-local-variable 'diff-remembered-defdir) default-directory) - (set (make-local-variable 'diff-remembered-files-alist) nil)) + (setq-local diff-remembered-defdir default-directory) + (setq-local diff-remembered-files-alist nil)) (save-excursion (save-restriction (widen) @@ -1016,8 +1016,8 @@ PREFIX is only used internally: don't use it." (read-file-name (format "Use file %s: " file) (file-name-directory file) file t (file-name-nondirectory file))) - (set (make-local-variable 'diff-remembered-files-alist) - (cons (cons fs file) diff-remembered-files-alist)) + (setq-local diff-remembered-files-alist + (cons (cons fs file) diff-remembered-files-alist)) file))))))) @@ -1475,27 +1475,25 @@ a diff with \\[diff-reverse-direction]. \\{diff-mode-map}" - (set (make-local-variable 'font-lock-defaults) diff-font-lock-defaults) + (setq-local font-lock-defaults diff-font-lock-defaults) (add-hook 'font-lock-mode-hook #'diff--font-lock-cleanup nil 'local) - (set (make-local-variable 'outline-regexp) diff-outline-regexp) - (set (make-local-variable 'imenu-generic-expression) - diff-imenu-generic-expression) + (setq-local outline-regexp diff-outline-regexp) + (setq-local imenu-generic-expression + diff-imenu-generic-expression) ;; These are not perfect. They would be better done separately for ;; context diffs and unidiffs. - ;; (set (make-local-variable 'paragraph-start) + ;; (setq-local paragraph-start ;; (concat "@@ " ; unidiff hunk ;; "\\|\\*\\*\\* " ; context diff hunk or file start ;; "\\|--- [^\t]+\t")) ; context or unidiff file ;; ; start (first or second line) - ;; (set (make-local-variable 'paragraph-separate) paragraph-start) - ;; (set (make-local-variable 'page-delimiter) "--- [^\t]+\t") + ;; (setq-local paragraph-separate paragraph-start) + ;; (setq-local page-delimiter "--- [^\t]+\t") ;; compile support - (set (make-local-variable 'next-error-function) #'diff-next-error) + (setq-local next-error-function #'diff-next-error) - (set (make-local-variable 'beginning-of-defun-function) - #'diff-beginning-of-file-and-junk) - (set (make-local-variable 'end-of-defun-function) - #'diff-end-of-file) + (setq-local beginning-of-defun-function #'diff-beginning-of-file-and-junk) + (setq-local end-of-defun-function #'diff-end-of-file) (diff-setup-whitespace) @@ -1517,10 +1515,9 @@ a diff with \\[diff-reverse-direction]. (delq ro-bind minor-mode-overriding-map-alist))) nil t)) ;; add-log support - (set (make-local-variable 'add-log-current-defun-function) - #'diff-current-defun) - (set (make-local-variable 'add-log-buffer-file-name-function) - (lambda () (diff-find-file-name nil 'noprompt))) + (setq-local add-log-current-defun-function #'diff-current-defun) + (setq-local add-log-buffer-file-name-function + (lambda () (diff-find-file-name nil 'noprompt))) (add-function :filter-return (local 'filter-buffer-substring-function) #'diff--filter-substring) (unless buffer-file-name @@ -1552,7 +1549,7 @@ a diff with \\[diff-reverse-direction]. This sets `whitespace-style' and `whitespace-trailing-regexp' so that Whitespace mode shows trailing whitespace problems on the modified lines of the diff." - (set (make-local-variable 'whitespace-style) '(face trailing)) + (setq-local whitespace-style '(face trailing)) (let ((style (save-excursion (goto-char (point-min)) ;; FIXME: For buffers filled from async processes, this search @@ -1560,10 +1557,10 @@ modified lines of the diff." (when (re-search-forward diff-hunk-header-re nil t) (goto-char (match-beginning 0)) (diff-hunk-style))))) - (set (make-local-variable 'whitespace-trailing-regexp) - (if (eq style 'context) - "^[-+!] .*?\\([\t ]+\\)$" - "^[-+!<>].*?\\([\t ]+\\)$")))) + (setq-local whitespace-trailing-regexp + (if (eq style 'context) + "^[-+!] .*?\\([\t ]+\\)$" + "^[-+!<>].*?\\([\t ]+\\)$")))) (defun diff-delete-if-empty () ;; An empty diff file means there's no more diffs to integrate, so we @@ -1936,10 +1933,10 @@ With a prefix argument, REVERSE the hunk." (and buffer-file-name (backup-file-name-p buffer-file-name) (not diff-apply-hunk-to-backup-file) - (not (set (make-local-variable 'diff-apply-hunk-to-backup-file) - (yes-or-no-p (format "Really apply this hunk to %s? " - (file-name-nondirectory - buffer-file-name))))))) + (not (setq-local diff-apply-hunk-to-backup-file + (yes-or-no-p (format "Really apply this hunk to %s? " + (file-name-nondirectory + buffer-file-name))))))) (error "%s" (substitute-command-keys (format "Use %s\\[diff-apply-hunk] to apply it to the other file" diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el index b7f17bf3c7..e43801a1a0 100644 --- a/lisp/vc/diff.el +++ b/lisp/vc/diff.el @@ -190,9 +190,9 @@ returns the buffer used." (erase-buffer)) (buffer-enable-undo (current-buffer)) (diff-mode) - (set (make-local-variable 'revert-buffer-function) - (lambda (_ignore-auto _noconfirm) - (diff-no-select old new switches no-async (current-buffer)))) + (setq-local revert-buffer-function + (lambda (_ignore-auto _noconfirm) + (diff-no-select old new switches no-async (current-buffer)))) (setq default-directory thisdir) (setq diff-default-directory default-directory) (let ((inhibit-read-only t)) diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index e28d8574b1..73c39b6519 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -275,8 +275,7 @@ to invocation.") (make-local-variable 'ediff-window-setup-function) (make-local-variable 'ediff-keep-variants) - (make-local-variable 'window-min-height) - (setq window-min-height 2) + (setq-local window-min-height 2) ;; unwrap set up parameters passed as argument (while setup-parameters diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index 1c69bdf413..feafe5f5f0 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -463,16 +463,16 @@ done. Otherwise, it uses the current buffer." (if mode (funcall mode) (log-edit-mode)) - (set (make-local-variable 'log-edit-callback) callback) + (setq-local log-edit-callback callback) (if (listp params) (dolist (crt params) (set (make-local-variable (car crt)) (cdr crt))) ;; For backward compatibility with log-edit up to version 22.2 ;; accept non-list PARAMS to mean `log-edit-list'. - (set (make-local-variable 'log-edit-listfun) params)) + (setq-local log-edit-listfun params)) - (if buffer (set (make-local-variable 'log-edit-parent-buffer) parent)) - (set (make-local-variable 'log-edit-initial-files) (log-edit-files)) + (if buffer (setq-local log-edit-parent-buffer parent)) + (setq-local log-edit-initial-files (log-edit-files)) (when setup (erase-buffer) (run-hooks 'log-edit-hook)) @@ -489,8 +489,7 @@ the package from which this is used might also provide additional commands (under C-x v for VC, for example). \\{log-edit-mode-map}" - (set (make-local-variable 'font-lock-defaults) - '(log-edit-font-lock-keywords t)) + (setq-local font-lock-defaults '(log-edit-font-lock-keywords t)) (setq-local jit-lock-contextually t) ;For the "first line is summary". (setq-local fill-paragraph-function #'log-edit-fill-entry) (make-local-variable 'log-edit-comment-ring-index) diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el index e7b6eea807..87e662ce1c 100644 --- a/lisp/vc/log-view.el +++ b/lisp/vc/log-view.el @@ -265,12 +265,10 @@ The match group number 1 should match the revision number itself.") (define-derived-mode log-view-mode special-mode "Log-View" "Major mode for browsing CVS log output." (setq buffer-read-only t) - (set (make-local-variable 'font-lock-defaults) log-view-font-lock-defaults) - (set (make-local-variable 'beginning-of-defun-function) - 'log-view-beginning-of-defun) - (set (make-local-variable 'end-of-defun-function) - 'log-view-end-of-defun) - (set (make-local-variable 'cvs-minor-wrap-function) 'log-view-minor-wrap) + (setq-local font-lock-defaults log-view-font-lock-defaults) + (setq-local beginning-of-defun-function #'log-view-beginning-of-defun) + (setq-local end-of-defun-function #'log-view-end-of-defun) + (setq-local cvs-minor-wrap-function #'log-view-minor-wrap) (hack-dir-local-variables-non-file-buffer)) ;;;; diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el index 1e4343cc6b..0fd5ceed56 100644 --- a/lisp/vc/pcvs.el +++ b/lisp/vc/pcvs.el @@ -356,10 +356,10 @@ from the current buffer." ((and (bufferp cvs-temp-buffer) (buffer-live-p cvs-temp-buffer)) cvs-temp-buffer) (t - (set (make-local-variable 'cvs-temp-buffer) - (cvs-get-buffer-create - (eval cvs-temp-buffer-name `((dir . ,dir))) - 'noreuse)))))) + (setq-local cvs-temp-buffer + (cvs-get-buffer-create + (eval cvs-temp-buffer-name `((dir . ,dir))) + 'noreuse)))))) ;; Handle the potential pre-existing process. (let ((proc (get-buffer-process buf))) @@ -381,7 +381,7 @@ from the current buffer." (unless nosetup (save-excursion (display-buffer buf))) ;; FIXME: this doesn't do the right thing if the user later on ;; does a `find-file-other-window' and `scroll-other-window' - (set (make-local-variable 'other-window-scroll-buffer) buf)) + (setq-local other-window-scroll-buffer buf)) (add-to-list 'cvs-temp-buffers buf) @@ -393,13 +393,13 @@ from the current buffer." ;; a very large and unwanted undo record. (buffer-disable-undo) (erase-buffer)) - (set (make-local-variable 'cvs-buffer) cvs-buf) + (setq-local cvs-buffer cvs-buf) ;;(cvs-minor-mode 1) (let ((lbd list-buffers-directory)) (if (fboundp mode) (funcall mode) (fundamental-mode)) (when lbd (setq list-buffers-directory lbd))) (cvs-minor-mode 1) - ;;(set (make-local-variable 'cvs-buffer) cvs-buf) + ;;(setq-local cvs-buffer cvs-buf) (if normal (buffer-enable-undo) (setq buffer-read-only t) @@ -466,10 +466,10 @@ If non-nil, NEW means to create a new buffer no matter what." "\n") (setq buffer-read-only t) (cvs-mode) - (set (make-local-variable 'list-buffers-directory) buffer-name) - ;;(set (make-local-variable 'cvs-temp-buffer) (cvs-temp-buffer)) + (setq-local list-buffers-directory buffer-name) + ;;(setq-local cvs-temp-buffer (cvs-temp-buffer)) (let ((cookies (ewoc-create 'cvs-fileinfo-pp "\n\n" "\n" t))) - (set (make-local-variable 'cvs-cookies) cookies) + (setq-local cvs-cookies cookies) (add-hook 'kill-buffer-hook (lambda () (ignore-errors (kill-buffer cvs-temp-buffer))) @@ -1103,7 +1103,7 @@ for a lock file. If so, it inserts a message cookie in the *cvs* buffer." (let ((msg (match-string 1)) (lock (match-string 2))) (with-current-buffer cvs-buffer - (set (make-local-variable 'cvs-lock-file) lock) + (setq-local cvs-lock-file lock) ;; display the lock situation in the *cvs* buffer: (ewoc-enter-last cvs-cookies @@ -1146,8 +1146,8 @@ Full documentation is in the Texinfo file." (if buffer-file-name (error "Use M-x cvs-quickdir to get a *cvs* buffer")) (buffer-disable-undo) - ;;(set (make-local-variable 'goal-column) cvs-cursor-column) - (set (make-local-variable 'revert-buffer-function) 'cvs-mode-revert-buffer) + ;;(setq-local goal-column cvs-cursor-column) + (setq-local revert-buffer-function 'cvs-mode-revert-buffer) (setq truncate-lines t) (cvs-prefix-make-local 'cvs-branch-prefix) (cvs-prefix-make-local 'cvs-secondary-branch-prefix) @@ -1464,7 +1464,7 @@ The POSTPROC specified there (typically `log-edit') is then called, (funcall setupfun 'cvs-do-commit setup '((log-edit-listfun . cvs-commit-filelist) (log-edit-diff-function . cvs-mode-diff)) buf) - (set (make-local-variable 'cvs-minor-wrap-function) 'cvs-commit-minor-wrap) + (setq-local cvs-minor-wrap-function 'cvs-commit-minor-wrap) (run-hooks 'cvs-mode-commit-hook))) (defun cvs-commit-minor-wrap (_buf f) @@ -1525,15 +1525,14 @@ This is best called from a `log-view-mode' buffer." (with-current-buffer buf ;; Set the filename before, so log-edit can correctly setup its ;; log-edit-initial-files variable. - (set (make-local-variable 'cvs-edit-log-files) (list file))) + (setq-local cvs-edit-log-files (list file))) (funcall setupfun 'cvs-do-edit-log nil '((log-edit-listfun . cvs-edit-log-filelist) (log-edit-diff-function . cvs-mode-diff)) buf) (when text (erase-buffer) (insert text)) - (set (make-local-variable 'cvs-edit-log-revision) rev) - (set (make-local-variable 'cvs-minor-wrap-function) - 'cvs-edit-log-minor-wrap) + (setq-local cvs-edit-log-revision rev) + (setq-local cvs-minor-wrap-function 'cvs-edit-log-minor-wrap) ;; (run-hooks 'cvs-mode-commit-hook) )) @@ -2396,7 +2395,7 @@ The exact behavior is determined also by `cvs-dired-use-hook'." (string-prefix-p default-directory dir)) (let ((subdir (substring dir (length default-directory)))) (set-buffer buffer) - (set (make-local-variable 'cvs-buffer) cvs-buf) + (setq-local cvs-buffer cvs-buf) ;; `cvs -q add file' produces no useful output :-( (when (and (equal (car flags) "add") (goto-char (point-min)) diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el index fe7724d902..13f875b192 100644 --- a/lisp/vc/smerge-mode.el +++ b/lisp/vc/smerge-mode.el @@ -827,7 +827,7 @@ An error is raised if not inside a conflict." ((re-search-backward smerge-base-re start t) ;; a 3-parts conflict - (set (make-local-variable 'smerge-conflict-style) 'diff3-A) + (setq-local smerge-conflict-style 'diff3-A) (setq base-end upper-end) (setq upper-end (match-beginning 0)) (setq base-start (match-end 0))) @@ -835,7 +835,7 @@ An error is raised if not inside a conflict." ((string= filename (file-name-nondirectory (or buffer-file-name ""))) ;; a 2-parts conflict - (set (make-local-variable 'smerge-conflict-style) 'diff3-E)) + (setq-local smerge-conflict-style 'diff3-E)) ((and (not base-start) (or (eq smerge-conflict-style 'diff3-A) @@ -1350,8 +1350,8 @@ buffer names." ;; Ediff is now set up, and we are in the control buffer. ;; Do a few further adjustments and take precautions for exit. - (set (make-local-variable 'smerge-ediff-windows) config) - (set (make-local-variable 'smerge-ediff-buf) buf) + (setq-local smerge-ediff-windows config) + (setq-local smerge-ediff-buf buf) (add-hook 'ediff-quit-hook (lambda () (let ((buffer-A ediff-buffer-A) @@ -1422,11 +1422,11 @@ with a \\[universal-argument] prefix, makes up a 3-way conflict." (font-lock-fontify-region (match-beginning 0) (match-end 0) nil))))) (if (string-match (regexp-quote smerge-parsep-re) paragraph-separate) (unless smerge-mode - (set (make-local-variable 'paragraph-separate) - (replace-match "" t t paragraph-separate))) + (setq-local paragraph-separate + (replace-match "" t t paragraph-separate))) (when smerge-mode - (set (make-local-variable 'paragraph-separate) - (concat smerge-parsep-re paragraph-separate)))) + (setq-local paragraph-separate + (concat smerge-parsep-re paragraph-separate)))) (unless smerge-mode (smerge-remove-props (point-min) (point-max)))) diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el index 5198bccf84..43d43e9c64 100644 --- a/lisp/vc/vc-annotate.el +++ b/lisp/vc/vc-annotate.el @@ -208,9 +208,8 @@ menu items." ;; it will become a list, to avoid initial annotations being invisible. (add-to-invisibility-spec 'foo) (remove-from-invisibility-spec 'foo) - (set (make-local-variable 'truncate-lines) t) - (set (make-local-variable 'font-lock-defaults) - '(vc-annotate-font-lock-keywords t)) + (setq-local truncate-lines t) + (setq-local font-lock-defaults '(vc-annotate-font-lock-keywords t)) (hack-dir-local-variables-non-file-buffer)) (defun vc-annotate-toggle-annotation-visibility () @@ -449,11 +448,10 @@ should be applied to the background or to the foreground." (with-current-buffer temp-buffer-name (unless (equal major-mode 'vc-annotate-mode) (vc-annotate-mode)) - (set (make-local-variable 'vc-annotate-backend) backend) - (set (make-local-variable 'vc-annotate-parent-file) file) - (set (make-local-variable 'vc-annotate-parent-rev) rev) - (set (make-local-variable 'vc-annotate-parent-display-mode) - display-mode)))) + (setq-local vc-annotate-backend backend) + (setq-local vc-annotate-parent-file file) + (setq-local vc-annotate-parent-rev rev) + (setq-local vc-annotate-parent-display-mode display-mode)))) (with-current-buffer temp-buffer-name (vc-run-delayed @@ -702,10 +700,10 @@ or OFFSET if present." RATIO is the expansion that should be applied to `vc-annotate-color-map'. The annotations are relative to the current time, unless overridden by OFFSET." (when (/= ratio 1.0) - (set (make-local-variable 'vc-annotate-color-map) + (setq-local vc-annotate-color-map (mapcar (lambda (elem) (cons (* (car elem) ratio) (cdr elem))) vc-annotate-color-map))) - (set (make-local-variable 'vc-annotate-offset) offset) + (setq-local vc-annotate-offset offset) (font-lock-mode 1)) (defun vc-annotate-lines (limit) diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index e2d0ca69a2..5eee7f6327 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -701,18 +701,18 @@ or a superior directory.") (define-derived-mode vc-bzr-log-view-mode log-view-mode "Bzr-Log-View" (remove-hook 'log-view-mode-hook 'vc-bzr-log-view-mode) ;Deactivate the hack. (require 'add-log) - (set (make-local-variable 'log-view-per-file-logs) nil) - (set (make-local-variable 'log-view-file-re) regexp-unmatchable) - (set (make-local-variable 'log-view-message-re) + (setq-local log-view-per-file-logs nil) + (setq-local log-view-file-re regexp-unmatchable) + (setq-local log-view-message-re (if (eq vc-log-view-type 'short) "^ *\\([0-9.]+\\): \\(.*?\\)[ \t]+\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)\\( \\[merge\\]\\)?" "^ *\\(?:revno: \\([0-9.]+\\)\\|merged: .+\\)")) ;; Allow expanding short log entries (when (eq vc-log-view-type 'short) (setq truncate-lines t) - (set (make-local-variable 'log-view-expanded-log-entry-function) - 'vc-bzr-expanded-log-entry)) - (set (make-local-variable 'log-view-font-lock-keywords) + (setq-local log-view-expanded-log-entry-function + 'vc-bzr-expanded-log-entry)) + (setq-local log-view-font-lock-keywords ;; log-view-font-lock-keywords is careful to use the buffer-local ;; value of log-view-message-re only since Emacs-23. (if (eq vc-log-view-type 'short) diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index cdf8ab984e..f576fcfb9f 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -1103,19 +1103,17 @@ commands act on the child files of that directory that are displayed in the *vc-dir* buffer. \\{vc-dir-mode-map}" - (set (make-local-variable 'vc-dir-backend) use-vc-backend) - (set (make-local-variable 'desktop-save-buffer) - 'vc-dir-desktop-buffer-misc-data) + (setq-local vc-dir-backend use-vc-backend) + (setq-local desktop-save-buffer 'vc-dir-desktop-buffer-misc-data) (setq-local bookmark-make-record-function #'vc-dir-bookmark-make-record) (setq buffer-read-only t) (when (boundp 'tool-bar-map) - (set (make-local-variable 'tool-bar-map) vc-dir-tool-bar-map)) + (setq-local tool-bar-map vc-dir-tool-bar-map)) (let ((buffer-read-only nil)) (erase-buffer) - (set (make-local-variable 'vc-dir-process-buffer) nil) - (set (make-local-variable 'vc-ewoc) (ewoc-create #'vc-dir-printer)) - (set (make-local-variable 'revert-buffer-function) - 'vc-dir-revert-buffer-function) + (setq-local vc-dir-process-buffer nil) + (setq-local vc-ewoc (ewoc-create #'vc-dir-printer)) + (setq-local revert-buffer-function 'vc-dir-revert-buffer-function) (setq list-buffers-directory (expand-file-name "*vc-dir*" default-directory)) (add-to-list 'vc-dir-buffers (current-buffer)) ;; Make sure that if the directory buffer is killed, the update diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 932b9158f2..4cc6fddd7b 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -179,9 +179,9 @@ Another is that undo information is not kept." ;; want any of its output to appear from now on. (when oldproc (delete-process oldproc))) (kill-all-local-variables) - (set (make-local-variable 'vc-parent-buffer) camefrom) - (set (make-local-variable 'vc-parent-buffer-name) - (concat " from " (buffer-name camefrom))) + (setq-local vc-parent-buffer camefrom) + (setq-local vc-parent-buffer-name + (concat " from " (buffer-name camefrom))) (setq default-directory olddir) (let ((buffer-undo-list t) (inhibit-read-only t)) @@ -411,8 +411,8 @@ Display the buffer in some window, but don't select it." (symbol-value error-regexp-alist)))) (let ((compilation-error-regexp-alist error-regexp-alist)) (compilation-mode)) - (set (make-local-variable 'compilation-error-regexp-alist) - error-regexp-alist))) + (setq-local compilation-error-regexp-alist + error-regexp-alist))) (declare-function vc-dir-refresh "vc-dir" ()) @@ -678,14 +678,14 @@ BACKEND, if non-nil, specifies a VC backend for the Log Edit buffer." (if (and comment (not initial-contents)) (set-buffer (get-buffer-create logbuf)) (pop-to-buffer (get-buffer-create logbuf))) - (set (make-local-variable 'vc-parent-buffer) parent) - (set (make-local-variable 'vc-parent-buffer-name) - (concat " from " (buffer-name vc-parent-buffer))) + (setq-local vc-parent-buffer parent) + (setq-local vc-parent-buffer-name + (concat " from " (buffer-name vc-parent-buffer))) (vc-log-edit files mode backend) (make-local-variable 'vc-log-after-operation-hook) (when after-hook (setq vc-log-after-operation-hook after-hook)) - (set (make-local-variable 'vc-log-operation) action) + (setq-local vc-log-operation action) (when comment (erase-buffer) (when (stringp comment) (insert comment))) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 91554bb6d8..0da4509670 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1242,18 +1242,18 @@ log entries." (define-derived-mode vc-git-log-view-mode log-view-mode "Git-Log-View" (require 'add-log) ;; We need the faces add-log. ;; Don't have file markers, so use impossible regexp. - (set (make-local-variable 'log-view-file-re) regexp-unmatchable) - (set (make-local-variable 'log-view-per-file-logs) nil) - (set (make-local-variable 'log-view-message-re) - (if (not (memq vc-log-view-type '(long log-search with-diff))) - (cadr vc-git-root-log-format) - "^commit +\\([0-9a-z]+\\)")) + (setq-local log-view-file-re regexp-unmatchable) + (setq-local log-view-per-file-logs nil) + (setq-local log-view-message-re + (if (not (memq vc-log-view-type '(long log-search with-diff))) + (cadr vc-git-root-log-format) + "^commit +\\([0-9a-z]+\\)")) ;; Allow expanding short log entries. (when (memq vc-log-view-type '(short log-outgoing log-incoming mergebase)) (setq truncate-lines t) - (set (make-local-variable 'log-view-expanded-log-entry-function) - 'vc-git-expanded-log-entry)) - (set (make-local-variable 'log-view-font-lock-keywords) + (setq-local log-view-expanded-log-entry-function + 'vc-git-expanded-log-entry)) + (setq-local log-view-font-lock-keywords (if (not (memq vc-log-view-type '(long log-search with-diff))) (list (cons (nth 1 vc-git-root-log-format) (nth 2 vc-git-root-log-format))) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 67e129044c..e7f67e90ee 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -464,19 +464,19 @@ If LIMIT is non-nil, show no more than this many entries." (define-derived-mode vc-hg-log-view-mode log-view-mode "Hg-Log-View" (require 'add-log) ;; we need the add-log faces - (set (make-local-variable 'log-view-file-re) regexp-unmatchable) - (set (make-local-variable 'log-view-per-file-logs) nil) - (set (make-local-variable 'log-view-message-re) - (if (eq vc-log-view-type 'short) - (cadr vc-hg-root-log-format) - "^changeset:[ \t]*\\([0-9]+\\):\\(.+\\)")) - (set (make-local-variable 'tab-width) 2) + (setq-local log-view-file-re regexp-unmatchable) + (setq-local log-view-per-file-logs nil) + (setq-local log-view-message-re + (if (eq vc-log-view-type 'short) + (cadr vc-hg-root-log-format) + "^changeset:[ \t]*\\([0-9]+\\):\\(.+\\)")) + (setq-local tab-width 2) ;; Allow expanding short log entries (when (eq vc-log-view-type 'short) (setq truncate-lines t) - (set (make-local-variable 'log-view-expanded-log-entry-function) - 'vc-hg-expanded-log-entry)) - (set (make-local-variable 'log-view-font-lock-keywords) + (setq-local log-view-expanded-log-entry-function + 'vc-hg-expanded-log-entry)) + (setq-local log-view-font-lock-keywords (if (eq vc-log-view-type 'short) (list (cons (nth 1 vc-hg-root-log-format) (nth 2 vc-hg-root-log-format))) diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index f09ceddcb3..07bec8e087 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -814,7 +814,7 @@ In the latter case, VC mode is deactivated for this buffer." (unless vc-make-backup-files ;; Use this variable, not make-backup-files, ;; because this is for things that depend on the file name. - (set (make-local-variable 'backup-inhibited) t))) + (setq-local backup-inhibited t))) ((let* ((truename (and buffer-file-truename (expand-file-name buffer-file-truename))) (link-type (and truename diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el index 3c26ffc0e5..7797d19432 100644 --- a/lisp/vc/vc-mtn.el +++ b/lisp/vc/vc-mtn.el @@ -239,14 +239,14 @@ If LIMIT is non-nil, show no more than this many entries." (define-derived-mode vc-mtn-log-view-mode log-view-mode "Mtn-Log-View" ;; Don't match anything. - (set (make-local-variable 'log-view-file-re) regexp-unmatchable) - (set (make-local-variable 'log-view-per-file-logs) nil) + (setq-local log-view-file-re regexp-unmatchable) + (setq-local log-view-per-file-logs nil) ;; TODO: Use a more precise regexp than "[ |/]+" to avoid false positives ;; in the ChangeLog text. - (set (make-local-variable 'log-view-message-re) - "^[ |/]+Revision: \\([0-9a-f]+\\)") + (setq-local log-view-message-re + "^[ |/]+Revision: \\([0-9a-f]+\\)") (require 'add-log) ;For change-log faces. - (set (make-local-variable 'log-view-font-lock-keywords) + (setq-local log-view-font-lock-keywords (append log-view-font-lock-keywords '(("^[ |]+Author: \\(.*\\)" (1 'change-log-email)) ("^[ |]+Date: \\(.*\\)" (1 'change-log-date)))))) diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 06dd09490d..5ea2a41fe1 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -548,7 +548,7 @@ or svn+ssh://." (define-derived-mode vc-svn-log-view-mode log-view-mode "SVN-Log-View" (require 'add-log) - (set (make-local-variable 'log-view-per-file-logs) nil)) + (setq-local log-view-per-file-logs nil)) (autoload 'vc-setup-buffer "vc-dispatcher") diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 1a246119a6..f268f912fe 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1411,8 +1411,7 @@ first backend that could register the file is used." ;; the buffers visiting files affected by this `vc-register', not ;; in the current-buffer. ;; (unless vc-make-backup-files - ;; (make-local-variable 'backup-inhibited) - ;; (setq backup-inhibited t)) + ;; (setq-local backup-inhibited t)) (vc-resynch-buffer file t t)) files) @@ -1779,11 +1778,11 @@ Return t if the buffer had changes, nil otherwise." (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 buffer async) (set-buffer buffer) (diff-mode) - (set (make-local-variable 'diff-vc-backend) (car vc-fileset)) - (set (make-local-variable 'diff-vc-revisions) (list rev1 rev2)) - (set (make-local-variable 'revert-buffer-function) - (lambda (_ignore-auto _noconfirm) - (vc-diff-internal async vc-fileset rev1 rev2 verbose))) + (setq-local diff-vc-backend (car vc-fileset)) + (setq-local diff-vc-revisions (list rev1 rev2)) + (setq-local revert-buffer-function + (lambda (_ignore-auto _noconfirm) + (vc-diff-internal async vc-fileset rev1 rev2 verbose))) ;; Make the *vc-diff* buffer read only, the diff-mode key ;; bindings are nicer for read only buffers. pcl-cvs does the ;; same thing. @@ -2118,7 +2117,7 @@ Saves the buffer to the file." (with-current-buffer result-buf ;; Set the parent buffer so that things like ;; C-x v g, C-x v l, ... etc work. - (set (make-local-variable 'vc-parent-buffer) filebuf)) + (setq-local vc-parent-buffer filebuf)) result-buf))) (defun vc-find-revision-no-save (file revision &optional backend buffer) @@ -2165,7 +2164,7 @@ Unlike `vc-find-revision-save', doesn't save the buffer to the file." (get-file-buffer filename) (find-file-noselect filename)))) (with-current-buffer result-buf - (set (make-local-variable 'vc-parent-buffer) filebuf)) + (setq-local vc-parent-buffer filebuf)) result-buf))) ;; Header-insertion code @@ -2466,7 +2465,7 @@ earlier revisions. Show up to LIMIT entries (non-nil means unlimited)." rev-buff-func) (let (retval (buffer (get-buffer-create buffer-name))) (with-current-buffer buffer - (set (make-local-variable 'vc-log-view-type) type)) + (setq-local vc-log-view-type type)) (setq retval (funcall backend-func backend buffer-name type files)) (with-current-buffer buffer (let ((inhibit-read-only t)) @@ -2478,10 +2477,9 @@ earlier revisions. Show up to LIMIT entries (non-nil means unlimited)." backend 'region-history-mode)) 'region-history-mode 'log-view-mode)) - (set (make-local-variable 'log-view-vc-backend) backend) - (set (make-local-variable 'log-view-vc-fileset) files) - (set (make-local-variable 'revert-buffer-function) - rev-buff-func))) + (setq-local log-view-vc-backend backend) + (setq-local log-view-vc-fileset files) + (setq-local revert-buffer-function rev-buff-func))) ;; Display after setting up major-mode, so display-buffer-alist can know ;; the major-mode. (pop-to-buffer buffer) @@ -2679,13 +2677,13 @@ mark." (vc-call region-history file buf lfrom lto) (with-current-buffer buf (vc-call-backend backend 'region-history-mode) - (set (make-local-variable 'log-view-vc-backend) backend) - (set (make-local-variable 'log-view-vc-fileset) (list file)) - (set (make-local-variable 'revert-buffer-function) - (lambda (_ignore-auto _noconfirm) - (with-current-buffer buf - (let ((inhibit-read-only t)) (erase-buffer))) - (vc-call region-history file buf lfrom lto)))) + (setq-local log-view-vc-backend backend) + (setq-local log-view-vc-fileset (list file)) + (setq-local revert-buffer-function + (lambda (_ignore-auto _noconfirm) + (with-current-buffer buf + (let ((inhibit-read-only t)) (erase-buffer))) + (vc-call region-history file buf lfrom lto)))) (display-buffer buf))) ;;;###autoload commit c86dc8d4888bc0c5d56016c14c134123ec623072 Author: Dmitry Gutov Date: Sat Dec 5 02:57:46 2020 +0200 Always show the summary * lisp/progmodes/xref.el (xref--show-defs-minibuffer): Always show the summary (at least for now). diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index a78fed282c..9f5fc57142 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -947,24 +947,21 @@ local keymap that binds `RET' to `xref-quit-and-goto-xref'." (cl-loop for ((group . xrefs) . more1) on xref-alist do - (let ((show-summary (> (length xrefs) 1))) - (cl-loop for (xref . more2) on xrefs do - (with-slots (summary location) xref - (let* ((line (xref-location-line location)) - (line-fmt - (if line - (format #("%d:" 0 2 (face xref-line-number)) - line) - "")) - (group-fmt - (propertize - (substring group group-prefix-length) - 'face 'xref-file-header)) - (candidate - (if show-summary - (format "%s:%s%s" group-fmt line-fmt summary) - (format "%s" group-fmt)))) - (push (cons candidate xref) xref-alist-with-line-info)))))) + (cl-loop for (xref . more2) on xrefs do + (with-slots (summary location) xref + (let* ((line (xref-location-line location)) + (line-fmt + (if line + (format #("%d:" 0 2 (face xref-line-number)) + line) + "")) + (group-fmt + (propertize + (substring group group-prefix-length) + 'face 'xref-file-header)) + (candidate + (format "%s:%s%s" group-fmt line-fmt summary))) + (push (cons candidate xref) xref-alist-with-line-info))))) (setq xref (if (not (cdr xrefs)) (car xrefs) commit 940bb6e984e80a933af80984556bebb31d2cdfd3 Author: Dmitry Gutov Date: Sat Dec 5 02:52:39 2020 +0200 Fontify the group and the line number * lisp/progmodes/xref.el (xref--show-defs-minibuffer): Fontify the group and the line number. diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index e304a7beae..a78fed282c 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -951,8 +951,15 @@ local keymap that binds `RET' to `xref-quit-and-goto-xref'." (cl-loop for (xref . more2) on xrefs do (with-slots (summary location) xref (let* ((line (xref-location-line location)) - (line-fmt (if line (format "%s:" line) "")) - (group-fmt (substring group group-prefix-length)) + (line-fmt + (if line + (format #("%d:" 0 2 (face xref-line-number)) + line) + "")) + (group-fmt + (propertize + (substring group group-prefix-length) + 'face 'xref-file-header)) (candidate (if show-summary (format "%s:%s%s" group-fmt line-fmt summary) commit 2945fe74a9fcb09c5fa832ae678d0d7f0b2bb448 Author: Dmitry Gutov Date: Sat Dec 5 02:36:04 2020 +0200 Hide the common parent directory, if any * lisp/progmodes/xref.el (xref--show-defs-minibuffer): Hide the common parent directory, if any. diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 363d118cf7..e304a7beae 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -935,7 +935,15 @@ local keymap that binds `RET' to `xref-quit-and-goto-xref'." (let* ((xrefs (funcall fetcher)) (xref-alist (xref--analyze xrefs)) xref-alist-with-line-info - xref) + xref + (group-prefix-length + ;; FIXME: Groups are not always file names, but they often + ;; are. At least this shouldn't make the other kinds of + ;; groups look worse. + (let ((common-prefix (try-completion "" xref-alist))) + (if (> (length common-prefix) 0) + (length (file-name-directory common-prefix)) + 0)))) (cl-loop for ((group . xrefs) . more1) on xref-alist do @@ -944,10 +952,11 @@ local keymap that binds `RET' to `xref-quit-and-goto-xref'." (with-slots (summary location) xref (let* ((line (xref-location-line location)) (line-fmt (if line (format "%s:" line) "")) + (group-fmt (substring group group-prefix-length)) (candidate (if show-summary - (format "%s:%s%s" group line-fmt summary) - (format "%s" group)))) + (format "%s:%s%s" group-fmt line-fmt summary) + (format "%s" group-fmt)))) (push (cons candidate xref) xref-alist-with-line-info)))))) (setq xref (if (not (cdr xrefs)) commit 469f0a65167d004ddbd7b9634c29f42079ebe963 Author: William Xu Date: Sat Dec 5 02:14:32 2020 +0200 xref--show-defs-minibuffer: new "show definitions" UI * lisp/progmodes/xref.el (xref--show-defs-minibuffer): New function to use as xref-show-definitions-function (https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg00824.html). diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index ca14f6ae6c..363d118cf7 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -931,6 +931,33 @@ local keymap that binds `RET' to `xref-quit-and-goto-xref'." '(display-buffer-in-direction . ((direction . below)))) (current-buffer)))))) +(defun xref--show-defs-minibuffer (fetcher alist) + (let* ((xrefs (funcall fetcher)) + (xref-alist (xref--analyze xrefs)) + xref-alist-with-line-info + xref) + + (cl-loop for ((group . xrefs) . more1) on xref-alist + do + (let ((show-summary (> (length xrefs) 1))) + (cl-loop for (xref . more2) on xrefs do + (with-slots (summary location) xref + (let* ((line (xref-location-line location)) + (line-fmt (if line (format "%s:" line) "")) + (candidate + (if show-summary + (format "%s:%s%s" group line-fmt summary) + (format "%s" group)))) + (push (cons candidate xref) xref-alist-with-line-info)))))) + + (setq xref (if (not (cdr xrefs)) + (car xrefs) + (cdr (assoc (completing-read "Jump to definition: " + (reverse xref-alist-with-line-info)) + xref-alist-with-line-info)))) + + (xref-pop-to-location xref (assoc-default 'display-action alist)))) + (defcustom xref-show-xrefs-function 'xref--show-xref-buffer "Function to display a list of search results. commit 39915c708435cefd1c3eaddeec54d3b365d36515 Author: Spencer Baugh Date: Sun Nov 22 00:08:28 2020 -0500 * src/alloc.c (Fgarbage_collect_maybe): New function diff --git a/etc/NEWS b/etc/NEWS index 7f18f12946..525ed8b36e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1828,6 +1828,8 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el. * Lisp Changes in Emacs 28.1 +** New function `garbage-collect-maybe` to trigger GC early + --- ** 'defvar' detects the error of defining a variable currently lexically bound. Such mixes are always signs that the outer lexical binding was an diff --git a/src/alloc.c b/src/alloc.c index 34f822e589..5d2d5bc4ad 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -6209,6 +6209,30 @@ For further details, see Info node `(elisp)Garbage Collection'. */) return CALLMANY (Flist, total); } +DEFUN ("garbage-collect-maybe", Fgarbage_collect_maybe, +Sgarbage_collect_maybe, 1, 1, "", + doc: /* Call `garbage-collect' if enough allocation happened. +FACTOR determines what "enough" means here: +If FACTOR is a positive number N, it means to run GC if more than +1/Nth of the allocations needed to trigger automatic allocation took +place. +Therefore, as N gets higher, this is more likely to perform a GC. +Returns non-nil if GC happened, and nil otherwise. */) + (Lisp_Object factor) +{ + CHECK_FIXNAT (factor); + EMACS_INT fact = XFIXNAT (factor); + + EMACS_INT since_gc = gc_threshold - consing_until_gc; + if (fact >= 1 && since_gc > gc_threshold / fact) + { + garbage_collect (); + return Qt; + } + else + return Qnil; +} + /* Mark Lisp objects in glyph matrix MATRIX. Currently the only interesting objects referenced from glyphs are strings. */ @@ -7553,6 +7577,7 @@ N should be nonnegative. */); defsubr (&Smake_finalizer); defsubr (&Spurecopy); defsubr (&Sgarbage_collect); + defsubr (&Sgarbage_collect_maybe); defsubr (&Smemory_info); defsubr (&Smemory_use_counts); #ifdef GNU_LINUX diff --git a/src/lisp.h b/src/lisp.h index 9901f80b51..416c9b0cac 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3798,6 +3798,7 @@ flush_stack_call_func (void (*func) (void *arg), void *arg) extern void garbage_collect (void); extern void maybe_garbage_collect (void); +extern bool maybe_garbage_collect_eagerly (EMACS_INT factor); extern const char *pending_malloc_warning; extern Lisp_Object zero_vector; extern EMACS_INT consing_until_gc; commit 27af17b9ee61cf3b08be179055dabb8c684e4da2 Author: Dmitry Gutov Date: Fri Dec 4 23:22:22 2020 +0200 Improve docstrings * lisp/progmodes/xref.el (xref-search-program-alist) (xref-search-program): Improve docstrings. diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index ccd5e1ae8b..ca14f6ae6c 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1286,8 +1286,9 @@ IGNORES is a list of glob patterns for files to ignore." Program identifier should be a symbol, named after the search program. The command template must be a shell command (or usually a -pipeline) that will search the list of files which will be piped -from stdin. The template should have following fields: +pipeline) that will search the files based on the list of file +names that is piped from stdin, separated by null characters. +The template should have the following fields: for extra arguments such as -i and --color for the regexp itself (in Extended format)" @@ -1296,7 +1297,7 @@ from stdin. The template should have following fields: (string :tag "Command template")))) (defcustom xref-search-program 'grep - "The program to use to search inside files. + "The program to use for regexp search inside files. This must reference a corresponding entry in `xref-search-program-alist'." :type `(choice commit 335018f663fa76abadd8e5ea7c267ae3eb3cd059 Author: Roland Winkler Date: Fri Dec 4 14:00:49 2020 -0600 * lisp/textmodes/bibtex.el: Use user-error. diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index cb0b95bc20..0a0a58244d 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -1739,7 +1739,7 @@ BibTeX field as necessary." ;; It can be confusing if non-editing commands try to ;; modify the buffer. (if buffer-read-only - (error "Comma missing at buffer position %s" (point))) + (user-error "Comma missing at buffer position %s" (point))) (insert ",") (forward-char -1) ;; Now try again. @@ -2263,7 +2263,7 @@ On success return bounds, nil otherwise. Do not move point." (>= (bibtex-end-of-field bounds) (point))) bounds) ((not noerr) - (error "Can't find enclosing BibTeX field")))))) + (user-error "Can't find enclosing BibTeX field")))))) (defun bibtex-beginning-first-field (&optional beg) "Move point to beginning of first field. @@ -2275,7 +2275,7 @@ Optional arg BEG is beginning of entry." (defun bibtex-insert-kill (n &optional comma) "Reinsert the Nth stretch of killed BibTeX text (field or entry). Optional arg COMMA is as in `bibtex-enclosing-field'." - (unless bibtex-last-kill-command (error "BibTeX kill ring is empty")) + (unless bibtex-last-kill-command (user-error "BibTeX kill ring is empty")) (let ((fun (lambda (kryp kr) ; adapted from `current-kill' (car (set kryp (nthcdr (mod (- n (length (symbol-value kryp))) (length kr)) @@ -2354,7 +2354,7 @@ Formats current entry according to variable `bibtex-entry-format'." ;; identify entry type (goto-char (point-min)) (or (re-search-forward bibtex-entry-type nil t) - (error "Not inside a BibTeX entry")) + (user-error "Not inside a BibTeX entry")) (let* ((beg-type (1+ (match-beginning 0))) (end-type (match-end 0)) (entry-list (assoc-string (buffer-substring-no-properties @@ -2564,7 +2564,7 @@ Formats current entry according to variable `bibtex-entry-format'." (memq 'required-fields format) (assoc-string field-name req-field-list t)) (setq error-field-name field-name) - (error "Mandatory field `%s' is empty" field-name)) + (user-error "Mandatory field `%s' is empty" field-name)) ;; unify case of field name (when (memq 'unify-case format) @@ -2595,20 +2595,20 @@ Formats current entry according to variable `bibtex-entry-format'." ;; we have deleted by now. Nonetheless we can ;; move point on this empty field. (setq error-field-name (car fname)) - (error "Mandatory field `%s' is missing" - (car fname))))) + (user-error "Mandatory field `%s' is missing" + (car fname))))) (dotimes (idx num-alt) (cond ((= 0 (aref alt-found idx)) (setq error-field-name (car (last (aref alt-fields idx)))) - (error "Alternative mandatory field `%s' is missing" - (aref alt-expect idx))) + (user-error "Alternative mandatory field `%s' is missing" + (aref alt-expect idx))) ((< 1 (aref alt-found idx)) (setq error-field-name (car (last (aref alt-fields idx)))) - (error "Alternative fields `%s' are defined %s times" - (aref alt-expect idx) - (length (aref alt-fields idx)))))))) + (user-error "Alternative fields `%s' are defined %s times" + (aref alt-expect idx) + (length (aref alt-fields idx)))))))) ;; update comma after last field (if (memq 'last-comma format) @@ -2754,7 +2754,8 @@ and `bibtex-autokey-names-stretch'." ;; name is of the form "First Middle Last" or "Last" ;; --> take the last token (match-string 1 fullname)) - (t (error "Name `%s' is incorrectly formed" fullname))))) + (t (user-error "Name `%s' is incorrectly formed" + fullname))))) (funcall bibtex-autokey-name-case-convert-function (bibtex-autokey-abbrev name bibtex-autokey-name-length)))) @@ -3052,15 +3053,15 @@ Use `bibtex-predefined-strings' and BibTeX files `bibtex-string-files'." (if (file-name-absolute-p filename) (if (file-readable-p filename) (push filename string-files) - (error "BibTeX strings file %s not found" filename)) + (user-error "BibTeX strings file %s not found" filename)) (dolist (dir dirlist) (when (file-readable-p (setq fullfilename (expand-file-name filename dir))) (push fullfilename string-files) (setq found t))) (unless found - (error "File %s not in paths defined via bibtex-string-file-path" - filename)))) + (user-error "File %s not in paths defined via bibtex-string-file-path" + filename)))) ;; parse string files (dolist (filename string-files) (with-temp-buffer @@ -3135,11 +3136,11 @@ does not use `bibtex-mode'." (push expanded-file-name file-list) (setq found t))) (unless found - (error "File `%s' not in paths defined via bibtex-file-path" - file)))))) + (user-error "File `%s' not in paths defined via bibtex-file-path" + file)))))) (dolist (file file-list) (unless (file-readable-p file) - (error "BibTeX file `%s' not found" file))) + (user-error "BibTeX file `%s' not found" file))) ;; expand dir-list (dolist (dir dir-list) (setq file-list @@ -3216,7 +3217,7 @@ that is generated by calling `bibtex-url'." (bibtex-beginning-of-entry) (if (looking-at bibtex-entry-maybe-empty-head) (kill-new (message "%s" (funcall bibtex-summary-function))) - (error "No entry found"))))) + (user-error "No entry found"))))) (defun bibtex-summary () "Return summary of current BibTeX entry. @@ -3248,7 +3249,7 @@ Used as default value of `bibtex-summary-function'." `((" " . ,names) (" " . ,year) (": " . ,title) (", " . ,journal) (" " . ,volume) (":" . ,pages)) "")) - (error "Entry not found"))) + (user-error "Entry not found"))) (defun bibtex-pop (arg direction) "Fill current field from the ARGth same field's text in DIRECTION. @@ -3282,8 +3283,8 @@ Generic function used by `bibtex-pop-previous' and `bibtex-pop-next'." (goto-char (bibtex-end-of-field bounds)) (setq failure t)))) (if failure - (error "No %s matching BibTeX field" - (if (eq direction 'previous) "previous" "next")) + (user-error "No %s matching BibTeX field" + (if (eq direction 'previous) "previous" "next")) ;; Found a matching field. Remember boundaries. (let ((new-text (bibtex-text-in-field-bounds bounds)) (nbeg (copy-marker (bibtex-start-of-field bounds))) @@ -3499,7 +3500,7 @@ if that value is non-nil. entry-alist) (if (boundp var) (setq entry-alist (symbol-value var)) - (error "BibTeX dialect `%s' undefined" dialect)) + (user-error "BibTeX dialect `%s' undefined" dialect)) (if (not (consp (nth 1 (car entry-alist)))) ;; new format entry-alist @@ -3553,8 +3554,8 @@ LOCAL is t for interactive calls." bibtex-dialect)))) (if (boundp var) (symbol-value var) - (error "Field types for BibTeX dialect `%s' undefined" - bibtex-dialect)))) + (user-error "Field types for BibTeX dialect `%s' undefined" + bibtex-dialect)))) (funcall setfun 'bibtex-entry-type (concat "@[ \t]*\\(?:" (regexp-opt (mapcar #'car bibtex-entry-alist)) "\\)")) @@ -3625,7 +3626,7 @@ and `bibtex-user-optional-fields'." (let ((e-list (assoc-string entry-type bibtex-entry-alist t)) required optional) (unless e-list - (error "Fields for BibTeX entry type %s not defined" entry-type)) + (user-error "Fields for BibTeX entry type %s not defined" entry-type)) (if (member-ignore-case entry-type bibtex-include-OPTcrossref) (setq required (nth 2 e-list) optional (append (nth 3 e-list) (nth 4 e-list))) @@ -3656,7 +3657,7 @@ is non-nil." (bibtex-read-key (format "%s key: " entry-type)))) (field-list (bibtex-field-list entry-type))) (unless (bibtex-prepare-new-entry (list key nil entry-type)) - (error "Entry with key `%s' already exists" key)) + (user-error "Entry with key `%s' already exists" key)) (indent-to-column bibtex-entry-offset) (insert "@" entry-type (bibtex-entry-left-delimiter)) (if key (insert key)) @@ -3868,7 +3869,7 @@ INIT is surrounded by field delimiters, unless NODELIM is non-nil." (let ((init (nth 2 field))) (if (not init) (setq init "") (if (functionp init) (setq init (funcall init))) - (unless (stringp init) (error "`%s' is not a string" init))) + (unless (stringp init) (user-error "`%s' is not a string" init))) ;; NODELIM is required by `bibtex-insert-kill' (if nodelim (insert init) (insert (bibtex-field-left-delimiter) init @@ -3906,7 +3907,7 @@ Return the new location of point." (goto-char (bibtex-end-of-string bounds))) ((looking-at bibtex-any-valid-entry-type) ;; Parsing of entry failed - (error "Syntactically incorrect BibTeX entry starts here")) + (user-error "Syntactically incorrect BibTeX entry starts here")) (t (if (called-interactively-p 'interactive) (message "Not on a known BibTeX entry.")) (goto-char pnt))) @@ -3981,7 +3982,7 @@ If mark is active count entries in region, if not in whole buffer." (if bounds (ispell-region (bibtex-start-of-text-in-field bounds) (bibtex-end-of-text-in-field bounds)) - (error "No abstract in entry")))) + (user-error "No abstract in entry")))) (defun bibtex-narrow-to-entry () "Narrow buffer to current BibTeX entry." @@ -4098,7 +4099,7 @@ for a crossref key, t otherwise." (let* ((pnt (point)) (_ (bibtex-beginning-of-entry)) (end (cdr (bibtex-valid-entry t))) - (_ (unless end (error "Not inside valid entry"))) + (_ (unless end (user-error "Not inside valid entry"))) (beg (match-end 0)) ; set by `bibtex-valid-entry' (bounds (bibtex-search-forward-field "\\(OPT\\)?crossref" end)) case-fold-search best temp crossref-key) @@ -4138,7 +4139,7 @@ for a crossref key, t otherwise." (bibtex-reposition-window pos) (beginning-of-line) (if (and eqb (> pnt pos) (not noerror)) - (error "The referencing entry must precede the crossrefed entry!")))) + (user-error "The referencing entry must precede the crossrefed entry")))) ;; `bibtex-search-crossref' is called noninteractively during ;; clean-up of an entry. Then it is not possible to check ;; whether the current entry and the crossrefed entry have @@ -4559,7 +4560,7 @@ interactive calls." (if (memq (preceding-char) '(?} ?\")) (forward-char -1))) (if help (bibtex-print-help-message (car bounds)))) - ((not noerror) (error "Not on BibTeX field"))))) + ((not noerror) (user-error "Not on BibTeX field"))))) (defun bibtex-find-text-internal (&optional noerror subfield comma) "Find text part of current BibTeX field or entry head. @@ -4635,8 +4636,8 @@ Optional arg COMMA is as in `bibtex-enclosing-field'." (cond ((not failure) (list name start-text end-text end string-const)) ((and no-sub (not noerror)) - (error "Not on text part of BibTeX field")) - ((not noerror) (error "Not on BibTeX field")))))) + (user-error "Not on text part of BibTeX field")) + ((not noerror) (user-error "Not on BibTeX field")))))) (defun bibtex-remove-OPT-or-ALT (&optional comma) "Remove the string starting optional/alternative fields. @@ -4774,7 +4775,7 @@ The sequence of kills wraps around, so that after the oldest one comes the newest one." (interactive "*p") (unless (eq last-command 'bibtex-yank) - (error "Previous command was not a BibTeX yank")) + (user-error "Previous command was not a BibTeX yank")) (setq this-command 'bibtex-yank) (let ((inhibit-read-only t) key) ;; point is at end of yanked entry @@ -4832,12 +4833,12 @@ At end of the cleaning process, the functions in (let ((case-fold-search t) (start (bibtex-beginning-of-entry)) (_ (or (looking-at bibtex-any-entry-maybe-empty-head) - (error "Not inside a BibTeX entry"))) + (user-error "Not inside a BibTeX entry"))) (entry-type (bibtex-type-in-head)) (key (bibtex-key-in-head))) (cond ((bibtex-string= entry-type "preamble") ;; (bibtex-format-preamble) - (error "No clean up of @Preamble entries")) + (user-error "No clean up of @Preamble entries")) ((bibtex-string= entry-type "string") (setq entry-type 'string)) ;; (bibtex-format-string) @@ -4887,11 +4888,11 @@ At end of the cleaning process, the functions in (setq error (or (/= (point) start) (bibtex-search-entry key nil end)))) (if error - (error "New inserted entry yields duplicate key")) + (user-error "New inserted entry yields duplicate key")) (dolist (buffer (bibtex-initialize)) (with-current-buffer buffer (if (cdr (assoc-string key bibtex-reference-keys)) - (error "Duplicate key in %s" (buffer-file-name))))) + (user-error "Duplicate key in %s" (buffer-file-name))))) ;; Only update `bibtex-strings' and `bibtex-reference-keys' ;; if they have been built already. @@ -5193,7 +5194,7 @@ entries from minibuffer." bibtex-maintain-sorted-entries)) endpos) (unless (bibtex-prepare-new-entry (list key nil "String")) - (error "Entry with key `%s' already exists" key)) + (user-error "Entry with key `%s' already exists" key)) (if (zerop (length key)) (setq key nil)) (indent-to-column bibtex-entry-offset) (insert "@String" commit 81fe928a769d9a63078aa1144335c204a2541595 Author: Stefan Kangas Date: Fri Dec 4 19:12:12 2020 +0100 Prefer setq-local in emacs-lisp/*.el * lisp/emacs-lisp/chart.el (chart-mode): * lisp/emacs-lisp/copyright.el (copyright-update): * lisp/emacs-lisp/eieio-custom.el (eieio-customize-object): * lisp/emacs-lisp/elint.el (elint-update-env, elint-init-form): * lisp/emacs-lisp/ert.el (ert--results-update-ewoc-hf): (ert--setup-results-buffer): * lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables): * lisp/emacs-lisp/pp.el (pp-display-expression): * lisp/emacs-lisp/re-builder.el (reb-mode, reb-restart-font-lock): * lisp/emacs-lisp/shadow.el (load-path-shadows-mode): * lisp/emacs-lisp/smie.el (smie-setup): * lisp/emacs-lisp/syntax.el (syntax-propertize): * lisp/emacs-lisp/trace.el (trace-make-advice): Prefer setq-local. diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el index 177710038a..c1c6e3bf0f 100644 --- a/lisp/emacs-lisp/chart.el +++ b/lisp/emacs-lisp/chart.el @@ -120,7 +120,7 @@ too much in text characters anyways.") (define-derived-mode chart-mode special-mode "Chart" "Define a mode in Emacs for displaying a chart." (buffer-disable-undo) - (set (make-local-variable 'font-lock-global-modes) nil) + (setq-local font-lock-global-modes nil) (font-lock-mode -1) ;Isn't it off already? --Stef ) diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index 9828ca63eb..edeeb03c32 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -256,7 +256,7 @@ interactively." (match-string-no-properties 1) copyright-current-gpl-version))))) (replace-match copyright-current-gpl-version t t nil 1)))) - (set (make-local-variable 'copyright-update) nil))) + (setq-local copyright-update nil))) ;; If a write-file-hook returns non-nil, the file is presumed to be written. nil)) diff --git a/lisp/emacs-lisp/eieio-custom.el b/lisp/emacs-lisp/eieio-custom.el index 3a9d8672e4..c1378cbeb7 100644 --- a/lisp/emacs-lisp/eieio-custom.el +++ b/lisp/emacs-lisp/eieio-custom.el @@ -365,8 +365,7 @@ These groups are specified with the `:group' slot flag." (widget-insert "\n\n") (widget-insert "Edit object " (eieio-object-name obj) "\n\n") ;; Create the widget editing the object. - (make-local-variable 'eieio-wo) - (setq eieio-wo (eieio-custom-widget-insert obj :eieio-group g)) + (setq-local eieio-wo (eieio-custom-widget-insert obj :eieio-group g)) ;;Now generate the apply buttons (widget-insert "\n") (eieio-custom-object-apply-reset obj) @@ -375,10 +374,8 @@ These groups are specified with the `:group' slot flag." ;;(widget-minor-mode) (goto-char (point-min)) (widget-forward 3) - (make-local-variable 'eieio-co) - (setq eieio-co obj) - (make-local-variable 'eieio-cog) - (setq eieio-cog g))) + (setq-local eieio-co obj) + (setq-local eieio-cog g))) (cl-defmethod eieio-custom-object-apply-reset ((_obj eieio-default-superclass)) "Insert an Apply and Reset button into the object editor. diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el index e2cffedd45..ef97c8279d 100644 --- a/lisp/emacs-lisp/elint.el +++ b/lisp/emacs-lisp/elint.el @@ -355,15 +355,14 @@ Returns the forms." ;; Env is up to date elint-buffer-forms ;; Remake env - (set (make-local-variable 'elint-buffer-forms) (elint-get-top-forms)) - (set (make-local-variable 'elint-features) nil) - (set (make-local-variable 'elint-buffer-env) - (elint-init-env elint-buffer-forms)) + (setq-local elint-buffer-forms (elint-get-top-forms)) + (setq-local elint-features nil) + (setq-local elint-buffer-env (elint-init-env elint-buffer-forms)) (if elint-preloaded-env ;; FIXME: This doesn't do anything! Should we setq the result to ;; elint-buffer-env? (elint-env-add-env elint-preloaded-env elint-buffer-env)) - (set (make-local-variable 'elint-last-env-time) (buffer-modified-tick)) + (setq-local elint-last-env-time (buffer-modified-tick)) elint-buffer-forms)) (defun elint-get-top-forms () @@ -456,8 +455,8 @@ Return nil if there are no more forms, t otherwise." (= 4 (length form)) (eq (car-safe (cadr form)) 'quote) (equal (nth 2 form) '(quote error-conditions))) - (set (make-local-variable 'elint-extra-errors) - (cons (cadr (cadr form)) elint-extra-errors))) + (setq-local elint-extra-errors + (cons (cadr (cadr form)) elint-extra-errors))) ((eq (car form) 'provide) (add-to-list 'elint-features (eval (cadr form)))) ;; Import variable definitions diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index e5ac1d1f1c..5f29c2665a 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -1802,8 +1802,8 @@ Also sets `ert--results-progress-bar-button-begin'." ;; `progress-bar-button-begin' will be the right position ;; even in the results buffer. (with-current-buffer results-buffer - (set (make-local-variable 'ert--results-progress-bar-button-begin) - progress-bar-button-begin)))) + (setq-local ert--results-progress-bar-button-begin + progress-bar-button-begin)))) (insert "\n\n") (buffer-string)) ;; footer @@ -1979,15 +1979,15 @@ BUFFER-NAME, if non-nil, is the buffer name to use." ;; from ert-results-mode to ert-results-mode when ;; font-lock-mode turns itself off in change-major-mode-hook.) (erase-buffer) - (set (make-local-variable 'font-lock-function) - 'ert--results-font-lock-function) + (setq-local font-lock-function + 'ert--results-font-lock-function) (let ((ewoc (ewoc-create 'ert--print-test-for-ewoc nil nil t))) - (set (make-local-variable 'ert--results-ewoc) ewoc) - (set (make-local-variable 'ert--results-stats) stats) - (set (make-local-variable 'ert--results-progress-bar-string) - (make-string (ert-stats-total stats) - (ert-char-for-test-result nil t))) - (set (make-local-variable 'ert--results-listener) listener) + (setq-local ert--results-ewoc ewoc) + (setq-local ert--results-stats stats) + (setq-local ert--results-progress-bar-string + (make-string (ert-stats-total stats) + (ert-char-for-test-result nil t))) + (setq-local ert--results-listener listener) (cl-loop for test across (ert--stats-tests stats) do (ewoc-enter-last ewoc (make-ert--ewoc-entry :test test diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index cc40af7a41..081ef8d441 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -634,7 +634,7 @@ font-lock keywords will not be case sensitive." ;; and should make no difference for explicit fill ;; because lisp-fill-paragraph should do the job. ;; I believe that newcomment's auto-fill code properly deals with it -stef - ;;(set (make-local-variable 'adaptive-fill-mode) nil) + ;;(setq-local adaptive-fill-mode nil) (setq-local indent-line-function 'lisp-indent-line) (setq-local indent-region-function 'lisp-indent-region) (setq-local comment-indent-function #'lisp-comment-indent) diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index 458f803ffe..de7d2020ea 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -118,7 +118,7 @@ after OUT-BUFFER-NAME." (with-current-buffer standard-output (emacs-lisp-mode) (setq buffer-read-only nil) - (set (make-local-variable 'font-lock-verbose) nil))))) + (setq-local font-lock-verbose nil))))) ;;;###autoload (defun pp-eval-expression (expression) diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index 78ae3a8c1e..ffbf3b4b4d 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -271,7 +271,7 @@ Except for Lisp syntax this is the same as `reb-regexp'.") (define-derived-mode reb-mode nil "RE Builder" "Major mode for interactively building Regular Expressions." - (set (make-local-variable 'blink-matching-paren) nil) + (setq-local blink-matching-paren nil) (reb-mode-common)) (defvar reb-lisp-mode-map @@ -832,8 +832,8 @@ If SUBEXP is non-nil mark only the corresponding sub-expressions." (let ((font-lock-is-on font-lock-mode)) (font-lock-mode -1) (kill-local-variable 'font-lock-set-defaults) - ;;(set (make-local-variable 'reb-re-syntax) 'string) - ;;(set (make-local-variable 'reb-re-syntax) 'rx) + ;;(setq-local reb-re-syntax 'string) + ;;(setq-local reb-re-syntax 'rx) (setq font-lock-defaults (cond ((memq reb-re-syntax '(read string)) diff --git a/lisp/emacs-lisp/shadow.el b/lisp/emacs-lisp/shadow.el index f1863869dd..68f58f69f7 100644 --- a/lisp/emacs-lisp/shadow.el +++ b/lisp/emacs-lisp/shadow.el @@ -177,8 +177,8 @@ See the documentation for `list-load-path-shadows' for further information." (define-derived-mode load-path-shadows-mode fundamental-mode "LP-Shadows" "Major mode for load-path shadows buffer." - (set (make-local-variable 'font-lock-defaults) - '((load-path-shadows-font-lock-keywords))) + (setq-local font-lock-defaults + '((load-path-shadows-font-lock-keywords))) (setq buffer-undo-list t buffer-read-only t)) diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index 1b700afd12..355dd0f49e 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el @@ -1891,9 +1891,9 @@ KEYWORDS are additional arguments, which can use the following keywords: (v (pop keywords))) (pcase k (:forward-token - (set (make-local-variable 'smie-forward-token-function) v)) + (setq-local smie-forward-token-function v)) (:backward-token - (set (make-local-variable 'smie-backward-token-function) v)) + (setq-local smie-backward-token-function v)) (_ (message "smie-setup: ignoring unknown keyword %s" k))))) (let ((ca (cdr (assq :smie-closer-alist grammar)))) (when ca diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index 62f1b16d75..e35f9d89de 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el @@ -353,7 +353,7 @@ set by `syntax-propertize'") (setq syntax-propertize--done (max (point-max) pos)) ;; (message "Needs to syntax-propertize from %s to %s" ;; syntax-propertize--done pos) - (set (make-local-variable 'parse-sexp-lookup-properties) t) + (setq-local parse-sexp-lookup-properties t) (when (< syntax-propertize--done (point-min)) ;; *Usually* syntax-propertize is called via syntax-ppss which ;; takes care of adding syntax-ppss-flush-cache to b-c-f, but this diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el index 627305689c..28e964ec4c 100644 --- a/lisp/emacs-lisp/trace.el +++ b/lisp/emacs-lisp/trace.el @@ -225,7 +225,7 @@ be printed along with the arguments in the trace." (ctx (funcall context))) (unless inhibit-trace (with-current-buffer trace-buffer - (set (make-local-variable 'window-point-insertion-type) t) + (setq-local window-point-insertion-type t) (unless background (trace--display-buffer trace-buffer)) (goto-char (point-max)) ;; Insert a separator from previous trace output: commit f0db9ae2139c4a437a9bc08b44d94dbdb3d39c6c Author: Stefan Kangas Date: Fri Dec 4 18:43:06 2020 +0100 Prefer setq-local in net/*.el * lisp/net/ange-ftp.el (ange-ftp-process-handle-line): (internal-ange-ftp-mode): * lisp/net/imap.el (imap-fetch-safe): * lisp/net/net-utils.el (net-utils-mode): (nslookup-mode, network-connection-mode-setup): * lisp/net/newst-plainview.el (newsticker-mode): (newsticker-buffer-update): * lisp/net/newst-treeview.el (newsticker--treeview-item-show): (newsticker-treeview-mode): * lisp/net/rlogin.el (rlogin): * lisp/net/secrets.el (secrets-mode): * lisp/net/sieve-mode.el (sieve-mode): * lisp/net/sieve.el (sieve-setup-buffer, sieve-open-server): * lisp/net/snmp-mode.el (snmp-common-mode, snmp-mode, snmpv2-mode): * lisp/net/telnet.el (telnet-mode): * lisp/net/tramp.el (tramp-get-debug-buffer): Prefer setq-local. diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index e0c162df57..c627e1a088 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -1556,7 +1556,7 @@ good, skip, fatal, or unknown." ;; This looks like an error, but we have to keep reading the output ;; to see if it was fixed or not. E.g. it may indicate that IPv6 ;; failed, but maybe a subsequent IPv4 fallback succeeded. - (set (make-local-variable 'ange-ftp-pending-error-line) line) + (setq-local ange-ftp-pending-error-line line) t) ((string-match ange-ftp-fatal-msgs line) (delete-process proc) @@ -1970,30 +1970,24 @@ on the gateway machine to do the FTP instead." "Major mode for interacting with the FTP process. \\{comint-mode-map}" - (make-local-variable 'ange-ftp-process-string) - (setq ange-ftp-process-string "") + (setq-local ange-ftp-process-string "") (make-local-variable 'ange-ftp-process-busy) (make-local-variable 'ange-ftp-process-result) (make-local-variable 'ange-ftp-process-msg) (make-local-variable 'ange-ftp-process-multi-skip) - (make-local-variable 'ange-ftp-process-result-line) (make-local-variable 'ange-ftp-process-continue) - (make-local-variable 'ange-ftp-hash-mark-count) (make-local-variable 'ange-ftp-binary-hash-mark-size) (make-local-variable 'ange-ftp-ascii-hash-mark-size) (make-local-variable 'ange-ftp-hash-mark-unit) - (make-local-variable 'ange-ftp-xfer-size) (make-local-variable 'ange-ftp-last-percent) - (setq ange-ftp-hash-mark-count 0) - (setq ange-ftp-xfer-size 0) - (setq ange-ftp-process-result-line "") + (setq-local ange-ftp-hash-mark-count 0) + (setq-local ange-ftp-xfer-size 0) + (setq-local ange-ftp-process-result-line "") (setq comint-prompt-regexp "^ftp> ") - (make-local-variable 'comint-password-prompt-regexp) ;; This is a regexp that can't match anything. ;; ange-ftp has its own ways of handling passwords. - (setq comint-password-prompt-regexp regexp-unmatchable) - (make-local-variable 'paragraph-start) - (setq paragraph-start comint-prompt-regexp)) + (setq-local comint-password-prompt-regexp regexp-unmatchable) + (setq-local paragraph-start comint-prompt-regexp)) (defcustom ange-ftp-raw-login nil "Use raw FTP commands for login, if account password is not nil. @@ -3662,7 +3656,7 @@ so return the size on the remote host exactly. See RFC 3659." ;; (set-process-sentinel proc 'ange-ftp-copy-file-locally-sentinel) ;; (set-process-query-on-exit-flag proc nil) ;; (with-current-buffer (process-buffer proc) -;; (set (make-local-variable 'copy-cont) cont)))) +;; (setq-local copy-cont cont)))) ;; ;; (defun ange-ftp-copy-file-locally-sentinel (proc status) ;; (with-current-buffer (process-buffer proc) diff --git a/lisp/net/imap.el b/lisp/net/imap.el index 22b5908400..0394f0efea 100644 --- a/lisp/net/imap.el +++ b/lisp/net/imap.el @@ -1726,8 +1726,7 @@ See `imap-enable-exchange-bug-workaround'." (string-match "The specified message set is invalid" (cadr data))) (with-current-buffer (or buffer (current-buffer)) - (set (make-local-variable 'imap-enable-exchange-bug-workaround) - t) + (setq-local imap-enable-exchange-bug-workaround t) (imap-fetch (cdr uids) props receive nouidfetch)) (signal (car data) (cdr data)))))) diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el index 8777fe4bf4..994a0bf9ab 100644 --- a/lisp/net/net-utils.el +++ b/lisp/net/net-utils.el @@ -307,8 +307,8 @@ This variable is only used if the variable (define-derived-mode net-utils-mode special-mode "NetworkUtil" "Major mode for interacting with an external network utility." - (set (make-local-variable 'font-lock-defaults) - '((net-utils-font-lock-keywords))) + (setq-local font-lock-defaults + '((net-utils-font-lock-keywords))) (setq-local revert-buffer-function #'net-utils--revert-function)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -624,9 +624,8 @@ This command uses `nslookup-program' to look up DNS records." ;; Using a derived mode gives us keymaps, hooks, etc. (define-derived-mode nslookup-mode comint-mode "Nslookup" "Major mode for interacting with the nslookup program." - (set - (make-local-variable 'font-lock-defaults) - '((nslookup-font-lock-keywords))) + (setq-local font-lock-defaults + '((nslookup-font-lock-keywords))) (setq comint-prompt-regexp nslookup-prompt-regexp) (setq comint-input-autoexpand t)) @@ -971,10 +970,8 @@ The port is deduced from `network-connection-service-alist'." "Major mode for interacting with the network-connection program.") (defun network-connection-mode-setup (host service) - (make-local-variable 'network-connection-host) - (setq network-connection-host host) - (make-local-variable 'network-connection-service) - (setq network-connection-service service)) + (setq-local network-connection-host host) + (setq-local network-connection-service service)) ;;;###autoload (defun network-connection-to-service (host service) diff --git a/lisp/net/newst-plainview.el b/lisp/net/newst-plainview.el index d4c53b13d8..98f55a7f52 100644 --- a/lisp/net/newst-plainview.el +++ b/lisp/net/newst-plainview.el @@ -445,17 +445,17 @@ images." "NewsTicker" "Viewing news feeds in Emacs." (if (boundp 'tool-bar-map) - (set (make-local-variable 'tool-bar-map) - newsticker--plainview-tool-bar-map)) - (set (make-local-variable 'imenu-sort-function) nil) - (set (make-local-variable 'scroll-conservatively) 999) + (setq-local tool-bar-map + newsticker--plainview-tool-bar-map)) + (setq-local imenu-sort-function nil) + (setq-local scroll-conservatively 999) (setq imenu-create-index-function 'newsticker--imenu-create-index) (setq imenu-default-goto-function 'newsticker--imenu-goto) (setq buffer-read-only t) (auto-fill-mode -1) ;; turn auto-fill off! (font-lock-mode -1) ;; turn off font-lock!! - (set (make-local-variable 'font-lock-defaults) nil) - (set (make-local-variable 'line-move-ignore-invisible) t) + (setq-local font-lock-defaults nil) + (setq-local line-move-ignore-invisible t) (setq mode-line-format (list "-" 'mode-line-mule-info @@ -533,7 +533,7 @@ Unless FORCE is t this is done only if necessary, i.e. when the (set-buffer-file-coding-system 'utf-8) (if newsticker-use-full-width - (set (make-local-variable 'fill-column) (1- (window-width)))) + (setq-local fill-column (1- (window-width)))) (newsticker--buffer-insert-all-items) ;; FIXME: needed for methods buffer in ecb diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el index ff8a447c7c..30db1a3d9f 100644 --- a/lisp/net/newst-treeview.el +++ b/lisp/net/newst-treeview.el @@ -719,9 +719,8 @@ for the button." (window-width (newsticker--treeview-item-window)) fill-column)))) (if newsticker-use-full-width - (set (make-local-variable 'fill-column) wwidth)) - (set (make-local-variable 'fill-column) (min fill-column - wwidth))) + (setq-local fill-column wwidth)) + (setq-local fill-column (min fill-column wwidth))) (let ((desc (newsticker--desc item))) (insert "\n" (or desc "[No Description]"))) (set-marker marker1 (1+ (point-min))) @@ -2024,8 +2023,8 @@ Return t if groups have changed, nil otherwise." "Major mode for Newsticker Treeview. \\{newsticker-treeview-mode-map}" (if (boundp 'tool-bar-map) - (set (make-local-variable 'tool-bar-map) - newsticker-treeview-tool-bar-map)) + (setq-local tool-bar-map + newsticker-treeview-tool-bar-map)) (setq buffer-read-only t truncate-lines t)) diff --git a/lisp/net/rlogin.el b/lisp/net/rlogin.el index 766d6449a3..6c960a1f1a 100644 --- a/lisp/net/rlogin.el +++ b/lisp/net/rlogin.el @@ -208,10 +208,8 @@ variable." (unless (comint-check-proc buffer-name) (comint-exec buffer buffer-name rlogin-program nil args) (rlogin-mode) - (make-local-variable 'rlogin-host) - (setq rlogin-host host) - (make-local-variable 'rlogin-remote-user) - (setq rlogin-remote-user user) + (setq-local rlogin-host host) + (setq-local rlogin-remote-user user) (ignore-errors (cond ((eq rlogin-directory-tracking-mode t) ;; Do this here, rather than calling the tracking mode diff --git a/lisp/net/secrets.el b/lisp/net/secrets.el index f98ded4b0c..e8ef185817 100644 --- a/lisp/net/secrets.el +++ b/lisp/net/secrets.el @@ -792,8 +792,8 @@ In this mode, widgets represent the search results. \\{secrets-mode-map}" (setq buffer-undo-list t) - (set (make-local-variable 'revert-buffer-function) - #'secrets-show-collections) + (setq-local revert-buffer-function + #'secrets-show-collections) ;; When we toggle, we must set temporary widgets. (add-hook 'tree-widget-after-toggle-functions #'secrets-tree-widget-after-toggle-function nil t)) diff --git a/lisp/net/sieve-mode.el b/lisp/net/sieve-mode.el index 05e9747e74..b3d511c286 100644 --- a/lisp/net/sieve-mode.el +++ b/lisp/net/sieve-mode.el @@ -185,16 +185,15 @@ inherits from C mode's and it has the same variables for customizing indentation. It has its own abbrev table and its own syntax table. Turning on Sieve mode runs `sieve-mode-hook'." - (set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter)) - (set (make-local-variable 'paragraph-separate) paragraph-start) - (set (make-local-variable 'comment-start) "#") - (set (make-local-variable 'comment-end) "") - ;;(set (make-local-variable 'comment-start-skip) "\\(^\\|\\s-\\);?#+ *") - (set (make-local-variable 'comment-start-skip) "#+ *") - (set (make-local-variable 'syntax-propertize-function) - #'sieve-syntax-propertize) - (set (make-local-variable 'font-lock-defaults) - '(sieve-font-lock-keywords nil nil ((?_ . "w")))) + (setq-local paragraph-start (concat "$\\|" page-delimiter)) + (setq-local paragraph-separate paragraph-start) + (setq-local comment-start "#") + (setq-local comment-end "") + ;; (setq-local comment-start-skip "\\(^\\|\\s-\\);?#+ *") + (setq-local comment-start-skip "#+ *") + (setq-local syntax-propertize-function #'sieve-syntax-propertize) + (setq-local font-lock-defaults + '(sieve-font-lock-keywords nil nil ((?_ . "w")))) (easy-menu-add-item nil nil sieve-mode-menu)) (provide 'sieve-mode) diff --git a/lisp/net/sieve.el b/lisp/net/sieve.el index 75bb4e242e..ae96134a18 100644 --- a/lisp/net/sieve.el +++ b/lisp/net/sieve.el @@ -272,8 +272,7 @@ Used to bracket operations which move point in the sieve-buffer." (let* ((port (or port sieve-manage-default-port)) (header (format "Server : %s:%s\n\n" server port))) (insert header)) - (set (make-local-variable 'sieve-buffer-header-end) - (point-max))) + (setq-local sieve-buffer-header-end (point-max))) (defun sieve-script-at-point (&optional pos) "Return name of sieve script at point POS, or nil." @@ -304,8 +303,8 @@ Used to bracket operations which move point in the sieve-buffer." "Open SERVER (on PORT) and authenticate." (with-current-buffer (or ;; open server - (set (make-local-variable 'sieve-manage-buffer) - (sieve-manage-open server port)) + (setq-local sieve-manage-buffer + (sieve-manage-open server port)) (error "Error opening server %s" server)) (sieve-manage-authenticate))) diff --git a/lisp/net/snmp-mode.el b/lisp/net/snmp-mode.el index 76d9ced58a..df0fd1d80f 100644 --- a/lisp/net/snmp-mode.el +++ b/lisp/net/snmp-mode.el @@ -304,46 +304,34 @@ This is used during Tempo template completion." (setq local-abbrev-table abbrev) ;; Set up paragraphs (?) - (make-local-variable 'paragraph-start) - (setq paragraph-start (concat "$\\|" page-delimiter)) - (make-local-variable 'paragraph-separate) - (setq paragraph-separate paragraph-start) - (make-local-variable 'paragraph-ignore-fill-prefix) - (setq paragraph-ignore-fill-prefix t) + (setq-local paragraph-start (concat "$\\|" page-delimiter)) + (setq-local paragraph-separate paragraph-start) + (setq-local paragraph-ignore-fill-prefix t) ;; Set up comments - (make-local-variable 'comment-start) - (setq comment-start "-- ") - (make-local-variable 'comment-start-skip) - (setq comment-start-skip "--+[ \t]*") - (make-local-variable 'comment-column) - (setq comment-column 40) - (make-local-variable 'parse-sexp-ignore-comments) - (setq parse-sexp-ignore-comments t) + (setq-local comment-start "-- ") + (setq-local comment-start-skip "--+[ \t]*") + (setq-local comment-column 40) + (setq-local parse-sexp-ignore-comments t) ;; Set up indentation (if snmp-special-indent - (set (make-local-variable 'indent-line-function) 'snmp-indent-line)) - (set (make-local-variable 'tab-always-indent) snmp-tab-always-indent) + (setq-local indent-line-function 'snmp-indent-line)) + (setq-local tab-always-indent snmp-tab-always-indent) ;; Font Lock - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults (cons font-keywords '(nil nil ((?- . "w 1234"))))) + (setq-local font-lock-defaults (cons font-keywords '(nil nil ((?- . "w 1234"))))) ;; Imenu - (make-local-variable 'imenu-create-index-function) - (setq imenu-create-index-function imenu-index) + (setq-local imenu-create-index-function imenu-index) ;; Tempo (tempo-use-tag-list tempo-tags) - (make-local-variable 'tempo-match-finder) - (setq tempo-match-finder "\\b\\(.+\\)\\=") - (make-local-variable 'tempo-interactive) - (setq tempo-interactive t) + (setq-local tempo-match-finder "\\b\\(.+\\)\\=") + (setq-local tempo-interactive t) ;; Miscellaneous customization - (make-local-variable 'require-final-newline) - (setq require-final-newline mode-require-final-newline)) + (setq-local require-final-newline mode-require-final-newline)) ;; SNMPv1 MIB Editing Mode. @@ -370,14 +358,11 @@ Turning on snmp-mode runs the hooks in `snmp-common-mode-hook', then 'snmp-tempo-tags) ;; Completion lists - (make-local-variable 'snmp-mode-syntax-list) - (setq snmp-mode-syntax-list (append snmp-rfc1155-types - snmp-rfc1213-types - snmp-mode-syntax-list)) - (make-local-variable 'snmp-mode-access-list) - (setq snmp-mode-access-list snmp-rfc1155-access) - (make-local-variable 'snmp-mode-status-list) - (setq snmp-mode-status-list snmp-rfc1212-status) + (setq-local snmp-mode-syntax-list (append snmp-rfc1155-types + snmp-rfc1213-types + snmp-mode-syntax-list)) + (setq-local snmp-mode-access-list snmp-rfc1155-access) + (setq-local snmp-mode-status-list snmp-rfc1212-status) ;; Run hooks (run-mode-hooks 'snmp-common-mode-hook 'snmp-mode-hook)) @@ -405,14 +390,11 @@ then `snmpv2-mode-hook'." 'snmpv2-tempo-tags) ;; Completion lists - (make-local-variable 'snmp-mode-syntax-list) - (setq snmp-mode-syntax-list (append snmp-rfc1902-types - snmp-rfc1903-types - snmp-mode-syntax-list)) - (make-local-variable 'snmp-mode-access-list) - (setq snmp-mode-access-list snmp-rfc1902-access) - (make-local-variable 'snmp-mode-status-list) - (setq snmp-mode-status-list snmp-rfc1902-status) + (setq-local snmp-mode-syntax-list (append snmp-rfc1902-types + snmp-rfc1903-types + snmp-mode-syntax-list)) + (setq-local snmp-mode-access-list snmp-rfc1902-access) + (setq-local snmp-mode-status-list snmp-rfc1902-status) ;; Run hooks (run-mode-hooks 'snmp-common-mode-hook 'snmpv2-mode-hook)) diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el index 29c415e6a6..872c9f634e 100644 --- a/lisp/net/telnet.el +++ b/lisp/net/telnet.el @@ -253,9 +253,9 @@ There is a variable `telnet-interrupt-string' which is the character sent to try to stop execution of a job on the remote host. Data is sent to the remote host when RET is typed." (setq-local revert-buffer-function 'telnet-revert-buffer) - (set (make-local-variable 'window-point-insertion-type) t) - (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern) - (set (make-local-variable 'comint-use-prompt-regexp) t)) + (setq-local window-point-insertion-type t) + (setq-local comint-prompt-regexp telnet-prompt-pattern) + (setq-local comint-use-prompt-regexp t)) ;;;###autoload (defun rsh (host) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index c367182057..b3853aa3d6 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1740,10 +1740,10 @@ The outline level is equal to the verbosity of the Tramp message." ;; in the traces. (let ((default-directory (tramp-compat-temporary-file-directory))) (outline-mode)) - (set (make-local-variable 'outline-level) 'tramp-debug-outline-level) - (set (make-local-variable 'font-lock-keywords) - `(t (eval ,tramp-debug-font-lock-keywords) - ,(eval tramp-debug-font-lock-keywords))) + (setq-local outline-level 'tramp-debug-outline-level) + (setq-local font-lock-keywords + `(t (eval ,tramp-debug-font-lock-keywords) + ,(eval tramp-debug-font-lock-keywords))) ;; Do not edit the debug buffer. (use-local-map special-mode-map)) (current-buffer))) commit 7bdc40e8d10488745355376981793a4d1e823f19 Author: Mattias Engdegård Date: Fri Dec 4 18:37:21 2020 +0100 Speed up match-substitute-replacement * lisp/subr.el (match-substitute-replacement): Use match-data--translate. * src/search.c (Fmatch_data__translate): Remove string restriction. * test/lisp/subr-tests.el (subr-match-substitute-replacement): New test. diff --git a/lisp/subr.el b/lisp/subr.el index 0b92a4f9b5..4b75268c04 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4259,11 +4259,7 @@ Optional FIXEDCASE, LITERAL, STRING and SUBEXP have the same meaning as for `replace-match'." (let ((match (match-string 0 string))) (save-match-data - (set-match-data (mapcar (lambda (x) - (if (numberp x) - (- x (match-beginning 0)) - x)) - (match-data t))) + (match-data--translate (- (match-beginning 0))) (replace-match replacement fixedcase literal match subexp)))) diff --git a/src/search.c b/src/search.c index 4eb634a3c0..50d82fd289 100644 --- a/src/search.c +++ b/src/search.c @@ -3033,12 +3033,12 @@ If optional arg RESEAT is non-nil, make markers on LIST point nowhere. */) DEFUN ("match-data--translate", Fmatch_data__translate, Smatch_data__translate, 1, 1, 0, - doc: /* Add N to all string positions in the match data. Internal. */) + doc: /* Add N to all positions in the match data. Internal. */) (Lisp_Object n) { CHECK_FIXNUM (n); EMACS_INT delta = XFIXNUM (n); - if (EQ (last_thing_searched, Qt)) /* String match data only. */ + if (!NILP (last_thing_searched)) for (ptrdiff_t i = 0; i < search_regs.num_regs; i++) if (search_regs.start[i] >= 0) { diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 019441d9a3..e275e4b1c8 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -551,6 +551,30 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350." (should (equal (replace-regexp-in-string "\\`\\|x" "z" "--xx--") "z--zz--"))) +(ert-deftest subr-match-substitute-replacement () + (with-temp-buffer + (insert "Alpha Beta Gamma Delta Epsilon") + (goto-char (point-min)) + (re-search-forward "B\\(..\\)a") + (should (equal (match-substitute-replacement "carrot") + "Carrot")) + (should (equal (match-substitute-replacement "<\\&>") + "")) + (should (equal (match-substitute-replacement "m\\1a") + "Meta")) + (should (equal (match-substitute-replacement "ernin" nil nil nil 1) + "Bernina"))) + (let ((s "Tau Beta Gamma Delta Epsilon")) + (string-match "B\\(..\\)a" s) + (should (equal (match-substitute-replacement "carrot" nil nil s) + "Carrot")) + (should (equal (match-substitute-replacement "<\\&>" nil nil s) + "")) + (should (equal (match-substitute-replacement "m\\1a" nil nil s) + "Meta")) + (should (equal (match-substitute-replacement "ernin" nil nil s 1) + "Bernina")))) + (ert-deftest subr-tests--change-group-33341 () (with-temp-buffer (buffer-enable-undo) commit a5fa79d50e6e6182fef0a6dc526ac272e87e2c02 Author: Stefan Kangas Date: Fri Dec 4 17:55:46 2020 +0100 Prefer setq-local in cedet * lisp/cedet/data-debug.el (data-debug-mode): * lisp/cedet/ede/custom.el (ede-customize-project): * lisp/cedet/ede/project-am.el (project-am-load-makefile): * lisp/cedet/mode-local.el (mode-local--activate-bindings): * lisp/cedet/semantic.el (semantic--set-buffer-cache): * lisp/cedet/semantic/analyze/debug.el (semantic-analyzer-debug-add-buttons): * lisp/cedet/semantic/grammar.el (semantic-grammar-mode): * lisp/cedet/semantic/senator.el (senator-search-set-tag-class-filter): (senator-isearch-mode-hook): * lisp/cedet/semantic/symref/list.el (semantic-symref-produce-list-on-results) (semantic-symref-results-mode): * lisp/cedet/semantic/util-modes.el (semantic-stickyfunc-mode): * lisp/cedet/semantic/wisent/python.el (wisent-python-default-setup): * lisp/cedet/srecode/srt-mode.el (srecode-template-mode): Prefer setq-local. diff --git a/lisp/cedet/data-debug.el b/lisp/cedet/data-debug.el index 54b9024ebe..8037c310f4 100644 --- a/lisp/cedet/data-debug.el +++ b/lisp/cedet/data-debug.el @@ -881,9 +881,8 @@ If PARENT is non-nil, it is somehow related as a parent to thing." (setq-local comment-start-skip "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") (buffer-disable-undo) - (set (make-local-variable 'font-lock-global-modes) nil) - (font-lock-mode -1) - ) + (setq-local font-lock-global-modes nil) + (font-lock-mode -1)) ;;;###autoload (defun data-debug-new-buffer (name) diff --git a/lisp/cedet/ede/custom.el b/lisp/cedet/ede/custom.el index 18621ad5f1..63d8b025c6 100644 --- a/lisp/cedet/ede/custom.el +++ b/lisp/cedet/ede/custom.el @@ -50,8 +50,7 @@ (let* ((ov (oref (ede-current-project) local-variables)) (cp (ede-current-project))) (ede-customize cp) - (make-local-variable 'eieio-ede-old-variables) - (setq eieio-ede-old-variables ov))) + (setq-local eieio-ede-old-variables ov))) ;;;###autoload (defalias 'customize-project 'ede-customize-project) diff --git a/lisp/cedet/ede/project-am.el b/lisp/cedet/ede/project-am.el index 61dc8a1fc6..9bd3babdf4 100644 --- a/lisp/cedet/ede/project-am.el +++ b/lisp/cedet/ede/project-am.el @@ -493,8 +493,7 @@ This is used when subprojects are made in named subdirectories." :file fn))) (oset ampf directory (file-name-directory fn)) (oset ampf configureoutputfiles cof) - (make-local-variable 'ede-object) - (setq ede-object ampf) + (setq-local ede-object ampf) ;; Move the rescan after we set ede-object to prevent recursion (project-rescan ampf) ampf)))) diff --git a/lisp/cedet/mode-local.el b/lisp/cedet/mode-local.el index a1aea30c20..b965496cf4 100644 --- a/lisp/cedet/mode-local.el +++ b/lisp/cedet/mode-local.el @@ -314,7 +314,7 @@ Elements are (SYMBOL . PREVIOUS-VALUE), describing one variable." ;; Do the normal thing. (let (modes table old-locals) (unless mode - (set (make-local-variable 'mode-local--init-mode) major-mode) + (setq-local mode-local--init-mode major-mode) (setq mode major-mode)) ;; Get MODE's parents & MODE in the right order. (while mode diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el index 1be0e33c5f..805582ce5e 100644 --- a/lisp/cedet/semantic.el +++ b/lisp/cedet/semantic.el @@ -495,8 +495,7 @@ is requested." (setq semantic--buffer-cache tagtable semantic-unmatched-syntax-cache-check nil) ;; This is specific to the bovine parser. - (set (make-local-variable 'semantic-bovinate-nonterminal-check-obarray) - nil) + (setq-local semantic-bovinate-nonterminal-check-obarray nil) (semantic-parse-tree-set-up-to-date) (add-hook 'after-change-functions 'semantic-change-function nil t) (run-hook-with-args 'semantic-after-toplevel-cache-change-hook diff --git a/lisp/cedet/semantic/analyze/debug.el b/lisp/cedet/semantic/analyze/debug.el index 6ea54a200c..db5b096033 100644 --- a/lisp/cedet/semantic/analyze/debug.el +++ b/lisp/cedet/semantic/analyze/debug.el @@ -590,7 +590,7 @@ Look for key expressions, and add push-buttons near them." (with-current-buffer "*Help*" (let ((inhibit-read-only t)) (goto-char (point-min)) - (set (make-local-variable 'semantic-analyzer-debug-orig) orig-buffer) + (setq-local semantic-analyzer-debug-orig orig-buffer) ;; First, add do-in buttons to recommendations. (while (re-search-forward "^\\s-*M-x \\(\\(\\w\\|\\s_\\)+\\) " nil t) (let ((fcn (match-string 1))) diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el index b7670ef44b..d3379462f4 100644 --- a/lisp/cedet/semantic/grammar.el +++ b/lisp/cedet/semantic/grammar.el @@ -1303,28 +1303,25 @@ the change bounds to encompass the whole nonterminal tag." "Initialize a buffer for editing Semantic grammars. \\{semantic-grammar-mode-map}" - (set (make-local-variable 'parse-sexp-ignore-comments) t) - (set (make-local-variable 'comment-start) ";;") + (setq-local parse-sexp-ignore-comments t) + (setq-local comment-start ";;") ;; Look within the line for a ; following an even number of backslashes ;; after either a non-backslash or the line beginning. - (set (make-local-variable 'comment-start-skip) - "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") - (set (make-local-variable 'indent-line-function) - 'semantic-grammar-indent) - (set (make-local-variable 'fill-paragraph-function) - 'lisp-fill-paragraph) - (set (make-local-variable 'font-lock-multiline) - 'undecided) - (set (make-local-variable 'font-lock-defaults) - '((semantic-grammar-mode-keywords - semantic-grammar-mode-keywords-1 - semantic-grammar-mode-keywords-2 - semantic-grammar-mode-keywords-3) - nil ;; perform string/comment fontification - nil ;; keywords are case sensitive. - ;; This puts _ & - as a word constituent, - ;; simplifying our keywords significantly - ((?_ . "w") (?- . "w")))) + (setq-local comment-start-skip + "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") + (setq-local indent-line-function #'semantic-grammar-indent) + (setq-local fill-paragraph-function #'lisp-fill-paragraph) + (setq-local font-lock-multiline 'undecided) + (setq-local font-lock-defaults + '((semantic-grammar-mode-keywords + semantic-grammar-mode-keywords-1 + semantic-grammar-mode-keywords-2 + semantic-grammar-mode-keywords-3) + nil ;; perform string/comment fontification + nil ;; keywords are case sensitive. + ;; This puts _ & - as a word constituent, + ;; simplifying our keywords significantly + ((?_ . "w") (?- . "w")))) ;; Setup Semantic to parse grammar (semantic-grammar-wy--install-parser) (setq semantic-lex-comment-regex ";;" @@ -1338,16 +1335,14 @@ the change bounds to encompass the whole nonterminal tag." (nonterminal . "Nonterminal") (rule . "Rule") )) - (set (make-local-variable 'semantic-format-face-alist) - '( - (code . default) - (keyword . font-lock-keyword-face) - (token . font-lock-type-face) - (nonterminal . font-lock-function-name-face) - (rule . default) - )) - (set (make-local-variable 'semantic-stickyfunc-sticky-classes) - '(nonterminal)) + (setq-local semantic-format-face-alist + '((code . default) + (keyword . font-lock-keyword-face) + (token . font-lock-type-face) + (nonterminal . font-lock-function-name-face) + (rule . default))) + (setq-local semantic-stickyfunc-sticky-classes + '(nonterminal)) ;; Before each change, clear the cached regexp used to highlight ;; macros local in this grammar. (add-hook 'before-change-functions diff --git a/lisp/cedet/semantic/senator.el b/lisp/cedet/semantic/senator.el index e594232353..49c1933508 100644 --- a/lisp/cedet/semantic/senator.el +++ b/lisp/cedet/semantic/senator.el @@ -472,9 +472,9 @@ filters in `senator-search-tag-filter-functions' remain active." (if classes (let ((tag (make-symbol "tag")) (names (mapconcat 'symbol-name classes "', `"))) - (set (make-local-variable 'senator--search-filter) - `(lambda (,tag) - (memq (semantic-tag-class ,tag) ',classes))) + (setq-local senator--search-filter + `(lambda (,tag) + (memq (semantic-tag-class ,tag) ',classes))) (add-hook 'senator-search-tag-filter-functions senator--search-filter nil t) (message "Limit search to `%s' tags" names)) @@ -857,17 +857,17 @@ Use a senator search function when semantic isearch mode is enabled." ;; senator one. (when (and (local-variable-p 'isearch-search-fun-function) (not (local-variable-p 'senator-old-isearch-search-fun))) - (set (make-local-variable 'senator-old-isearch-search-fun) - isearch-search-fun-function)) - (set (make-local-variable 'isearch-search-fun-function) - 'senator-isearch-search-fun)) + (setq-local senator-old-isearch-search-fun + isearch-search-fun-function)) + (setq-local isearch-search-fun-function + 'senator-isearch-search-fun)) ;; When `senator-isearch-semantic-mode' is off restore the ;; previous `isearch-search-fun-function'. (when (eq isearch-search-fun-function 'senator-isearch-search-fun) (if (local-variable-p 'senator-old-isearch-search-fun) (progn - (set (make-local-variable 'isearch-search-fun-function) - senator-old-isearch-search-fun) + (setq-local isearch-search-fun-function + senator-old-isearch-search-fun) (kill-local-variable 'senator-old-isearch-search-fun)) (kill-local-variable 'isearch-search-fun-function))))) diff --git a/lisp/cedet/semantic/symref/list.el b/lisp/cedet/semantic/symref/list.el index fc7f9dbcb6..d64d4dd38c 100644 --- a/lisp/cedet/semantic/symref/list.el +++ b/lisp/cedet/semantic/symref/list.el @@ -176,7 +176,7 @@ Display the references in `semantic-symref-results-mode'." (switch-to-buffer-other-window buff) (set-buffer buff) (semantic-symref-results-mode) - (set (make-local-variable 'semantic-symref-current-results) res) + (setq-local semantic-symref-current-results res) (semantic-symref-results-dump res) (goto-char (point-min)))) @@ -184,7 +184,7 @@ Display the references in `semantic-symref-results-mode'." "Major-mode for displaying Semantic Symbol Reference results." (buffer-disable-undo) ;; FIXME: Why bother turning off font-lock? - (set (make-local-variable 'font-lock-global-modes) nil) + (setq-local font-lock-global-modes nil) (font-lock-mode -1)) (defcustom semantic-symref-results-summary-function 'semantic-format-tag-prototype diff --git a/lisp/cedet/semantic/util-modes.el b/lisp/cedet/semantic/util-modes.el index 24df009856..776c6b1894 100644 --- a/lisp/cedet/semantic/util-modes.el +++ b/lisp/cedet/semantic/util-modes.el @@ -701,8 +701,8 @@ non-nil if the minor mode is enabled." (when (and (local-variable-p 'header-line-format (current-buffer)) (not (eq header-line-format semantic-stickyfunc-header-line-format))) - (set (make-local-variable 'semantic-stickyfunc-old-hlf) - header-line-format)) + (setq-local semantic-stickyfunc-old-hlf + header-line-format)) (setq header-line-format semantic-stickyfunc-header-line-format)) ;; Disable sticky func mode ;; Restore previous buffer local value of header line format if diff --git a/lisp/cedet/semantic/wisent/python.el b/lisp/cedet/semantic/wisent/python.el index 4e3519260a..66d21f7314 100644 --- a/lisp/cedet/semantic/wisent/python.el +++ b/lisp/cedet/semantic/wisent/python.el @@ -503,10 +503,10 @@ Shortens `code' tags, but passes through for others." (defun wisent-python-default-setup () "Setup buffer for parse." (wisent-python-wy--install-parser) - (set (make-local-variable 'parse-sexp-ignore-comments) t) + (setq-local parse-sexp-ignore-comments t) ;; Give python modes the possibility to overwrite this: (if (not comment-start-skip) - (set (make-local-variable 'comment-start-skip) "#+\\s-*")) + (setq-local comment-start-skip "#+\\s-*")) (setq ;; Character used to separation a parent/child relationship semantic-type-relation-separator-character '(".") diff --git a/lisp/cedet/srecode/srt-mode.el b/lisp/cedet/srecode/srt-mode.el index 4c1e030fce..d82da40de8 100644 --- a/lisp/cedet/srecode/srt-mode.el +++ b/lisp/cedet/srecode/srt-mode.el @@ -191,18 +191,18 @@ we can tell font lock about them.") (define-derived-mode srecode-template-mode fundamental-mode "SRecode" ;; FIXME: Shouldn't it derive from prog-mode? "Major-mode for writing SRecode macros." - (set (make-local-variable 'comment-start) ";;") - (set (make-local-variable 'comment-end) "") - (set (make-local-variable 'parse-sexp-ignore-comments) t) - (set (make-local-variable 'comment-start-skip) - "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") - (set (make-local-variable 'font-lock-defaults) - '(srecode-font-lock-keywords - nil ;; perform string/comment fontification - nil ;; keywords are case sensitive. - ;; This puts _ & - as a word constituent, - ;; simplifying our keywords significantly - ((?_ . "w") (?- . "w"))))) + (setq-local comment-start ";;") + (setq-local comment-end "") + (setq-local parse-sexp-ignore-comments t) + (setq-local comment-start-skip + "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") + (setq-local font-lock-defaults + '(srecode-font-lock-keywords + nil ;; perform string/comment fontification + nil ;; keywords are case sensitive. + ;; This puts _ & - as a word constituent, + ;; simplifying our keywords significantly + ((?_ . "w") (?- . "w"))))) ;;;###autoload (defalias 'srt-mode 'srecode-template-mode) commit e6320b11f07c269982dfd0cbf016dec4452daf6d Author: Stefan Kangas Date: Fri Dec 4 16:00:12 2020 +0100 Prefer setq-local in most of textmodes/*.el * lisp/textmodes/artist.el (artist-mode-init): * lisp/textmodes/bibtex.el (bibtex-mode): * lisp/textmodes/dns-mode.el (dns-mode): * lisp/textmodes/enriched.el (enriched-mode): * lisp/textmodes/ispell.el (ispell-buffer-local-parsing): * lisp/textmodes/nroff-mode.el (nroff-mode): * lisp/textmodes/picture.el (picture-mode): * lisp/textmodes/refill.el (refill-mode): * lisp/textmodes/two-column.el (2C-split): Prefer setq-local. diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index 90e8d360c1..cc2eaf1e4e 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -1413,32 +1413,20 @@ Keymap summary (aset artist-replacement-table ?\t ?\s) (aset artist-replacement-table 0 ?\s) ;; More setup - (make-local-variable 'artist-key-is-drawing) - (make-local-variable 'artist-key-endpoint1) - (make-local-variable 'artist-key-poly-point-list) - (make-local-variable 'artist-key-shape) - (make-local-variable 'artist-key-draw-how) - (make-local-variable 'artist-popup-menu-table) - (make-local-variable 'artist-key-compl-table) - (make-local-variable 'artist-prev-next-op-alist) - (make-local-variable 'artist-rb-save-data) - (make-local-variable 'artist-arrow-point-1) - (make-local-variable 'artist-arrow-point-2) - (setq artist-key-is-drawing nil) - (setq artist-key-endpoint1 nil) - (setq artist-key-poly-point-list nil) - (setq artist-key-shape nil) - (setq artist-popup-menu-table (artist-compute-popup-menu-table artist-mt)) - (setq artist-key-compl-table (artist-compute-key-compl-table artist-mt)) - (setq artist-prev-next-op-alist - (artist-make-prev-next-op-alist artist-key-compl-table)) - (setq artist-rb-save-data (make-vector 7 0)) - (setq artist-arrow-point-1 nil) - (setq artist-arrow-point-2 nil) - (make-local-variable 'next-line-add-newlines) - (setq next-line-add-newlines t) - (setq artist-key-draw-how - (artist-go-get-draw-how-from-symbol artist-curr-go)) + (setq-local artist-key-is-drawing nil) + (setq-local artist-key-endpoint1 nil) + (setq-local artist-key-poly-point-list nil) + (setq-local artist-key-shape nil) + (setq-local artist-popup-menu-table (artist-compute-popup-menu-table artist-mt)) + (setq-local artist-key-compl-table (artist-compute-key-compl-table artist-mt)) + (setq-local artist-prev-next-op-alist + (artist-make-prev-next-op-alist artist-key-compl-table)) + (setq-local artist-rb-save-data (make-vector 7 0)) + (setq-local artist-arrow-point-1 nil) + (setq-local artist-arrow-point-2 nil) + (setq-local next-line-add-newlines t) + (setq-local artist-key-draw-how + (artist-go-get-draw-how-from-symbol artist-curr-go)) (if (and artist-picture-compatibility (not (eq major-mode 'picture-mode))) (progn (picture-mode) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 77fc6990d9..cb0b95bc20 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -3457,38 +3457,38 @@ if that value is non-nil. (setq bibtex-parse-idle-timer (run-with-idle-timer bibtex-parse-keys-timeout t 'bibtex-parse-buffers-stealthily))) - (set (make-local-variable 'paragraph-start) "[ \f\n\t]*$") - (set (make-local-variable 'comment-column) 0) - (set (make-local-variable 'defun-prompt-regexp) "^[ \t]*@[[:alnum:]]+[ \t]*") - (set (make-local-variable 'outline-regexp) "[ \t]*@") - (set (make-local-variable 'fill-paragraph-function) #'bibtex-fill-field) - (set (make-local-variable 'font-lock-defaults) - '(bibtex-font-lock-keywords - nil t ((?$ . "\"") - ;; Mathematical expressions should be fontified as strings - (?\" . ".") - ;; Quotes are field delimiters and quote-delimited - ;; entries should be fontified in the same way as - ;; brace-delimited ones - ) - nil - (font-lock-extra-managed-props . (category)) - (font-lock-mark-block-function - . (lambda () - (set-mark (bibtex-end-of-entry)) - (bibtex-beginning-of-entry))))) - (set (make-local-variable 'syntax-propertize-function) - (syntax-propertize-via-font-lock - bibtex-font-lock-syntactic-keywords)) + (setq-local paragraph-start "[ \f\n\t]*$") + (setq-local comment-column 0) + (setq-local defun-prompt-regexp "^[ \t]*@[[:alnum:]]+[ \t]*") + (setq-local outline-regexp "[ \t]*@") + (setq-local fill-paragraph-function #'bibtex-fill-field) + (setq-local font-lock-defaults + '(bibtex-font-lock-keywords + nil t ((?$ . "\"") + ;; Mathematical expressions should be fontified as strings + (?\" . ".") + ;; Quotes are field delimiters and quote-delimited + ;; entries should be fontified in the same way as + ;; brace-delimited ones + ) + nil + (font-lock-extra-managed-props . (category)) + (font-lock-mark-block-function + . (lambda () + (set-mark (bibtex-end-of-entry)) + (bibtex-beginning-of-entry))))) + (setq-local syntax-propertize-function + (syntax-propertize-via-font-lock + bibtex-font-lock-syntactic-keywords)) (let ((fun (lambda () (bibtex-set-dialect) - (set (make-local-variable 'comment-start) bibtex-comment-start) - (set (make-local-variable 'comment-start-skip) - (concat (regexp-quote bibtex-comment-start) "\\>[ \t]*")) - (set (make-local-variable 'fill-prefix) - (make-string (+ bibtex-entry-offset - bibtex-contline-indentation) - ?\s))))) + (setq-local comment-start bibtex-comment-start) + (setq-local comment-start-skip + (concat (regexp-quote bibtex-comment-start) "\\>[ \t]*")) + (setq-local fill-prefix + (make-string (+ bibtex-entry-offset + bibtex-contline-indentation) + ?\s))))) (if (and buffer-file-name enable-local-variables) (add-hook 'hack-local-variables-hook fun nil t) (funcall fun)))) @@ -4014,15 +4014,15 @@ of the head of the entry found. Return nil if no entry found." (defun bibtex-init-sort-entry-class-alist () "Initialize `bibtex-sort-entry-class-alist' (buffer-local)." (unless (local-variable-p 'bibtex-sort-entry-class-alist) - (set (make-local-variable 'bibtex-sort-entry-class-alist) - (let ((i -1) alist) - (dolist (class bibtex-sort-entry-class) - (setq i (1+ i)) - (dolist (entry class) - ;; All entry types should be downcase (for ease of comparison). - (push (cons (if (stringp entry) (downcase entry) entry) i) - alist))) - alist)))) + (setq-local bibtex-sort-entry-class-alist + (let ((i -1) alist) + (dolist (class bibtex-sort-entry-class) + (setq i (1+ i)) + (dolist (entry class) + ;; All entry types should be downcase (for ease of comparison). + (push (cons (if (stringp entry) (downcase entry) entry) i) + alist))) + alist)))) (defun bibtex-lessp (index1 index2) "Predicate for sorting BibTeX entries with indices INDEX1 and INDEX2. diff --git a/lisp/textmodes/dns-mode.el b/lisp/textmodes/dns-mode.el index 712955e84d..dd28cb8f9a 100644 --- a/lisp/textmodes/dns-mode.el +++ b/lisp/textmodes/dns-mode.el @@ -178,11 +178,11 @@ variables for customizing indentation. It has its own abbrev table and its own syntax table. Turning on DNS mode runs `dns-mode-hook'." - (set (make-local-variable 'comment-start) ";") - (set (make-local-variable 'comment-end) "") - (set (make-local-variable 'comment-start-skip) ";+ *") - (set (make-local-variable 'font-lock-defaults) - '(dns-mode-font-lock-keywords nil nil ((?_ . "w")))) + (setq-local comment-start ";") + (setq-local comment-end "") + (setq-local comment-start-skip ";+ *") + (setq-local font-lock-defaults + '(dns-mode-font-lock-keywords nil nil ((?_ . "w")))) (add-hook 'before-save-hook 'dns-mode-soa-maybe-increment-serial nil t)) diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el index 1656f3cb5f..919e09076d 100644 --- a/lisp/textmodes/enriched.el +++ b/lisp/textmodes/enriched.el @@ -247,9 +247,8 @@ Commands: (list 'buffer-display-table buffer-display-table 'default-text-properties default-text-properties 'use-hard-newlines use-hard-newlines)) - (make-local-variable 'enriched-default-text-properties-local-flag) - (setq enriched-default-text-properties-local-flag - (local-variable-p 'default-text-properties)) + (setq-local enriched-default-text-properties-local-flag + (local-variable-p 'default-text-properties)) (make-local-variable 'default-text-properties) (setq buffer-display-table enriched-display-table) (use-hard-newlines 1 (if enriched-rerun-flag 'never nil)) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 14de77cd54..ba7f36da76 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -4098,7 +4098,7 @@ Includes LaTeX/Nroff modes and extended character mode." (progn (ispell-send-string "+\n") ; set ispell mode to tex (if (not (eq ispell-parser 'tex)) - (set (make-local-variable 'ispell-parser) 'tex))) + (setq-local ispell-parser 'tex))) (ispell-send-string "-\n")) ; set mode to normal (nroff) ;; If needed, test for SGML & HTML modes and set a buffer local nil/t value. (if (and ispell-skip-html (not (eq ispell-skip-html t))) diff --git a/lisp/textmodes/nroff-mode.el b/lisp/textmodes/nroff-mode.el index bb2582cf7a..2d7ab13f48 100644 --- a/lisp/textmodes/nroff-mode.el +++ b/lisp/textmodes/nroff-mode.el @@ -134,35 +134,32 @@ Turning on Nroff mode runs `text-mode-hook', then `nroff-mode-hook'. Also, try `nroff-electric-mode', for automatically inserting closing requests for requests that are used in matched pairs." - (set (make-local-variable 'font-lock-defaults) - ;; SYNTAX-BEGIN is set to backward-paragraph to avoid slow-down - ;; near the end of large buffers due to searching to buffer's - ;; beginning. - '(nroff-font-lock-keywords nil t nil backward-paragraph)) - (set (make-local-variable 'outline-regexp) "\\.H[ ]+[1-7]+ ") - (set (make-local-variable 'outline-level) 'nroff-outline-level) + (setq-local font-lock-defaults + ;; SYNTAX-BEGIN is set to backward-paragraph to avoid slow-down + ;; near the end of large buffers due to searching to buffer's + ;; beginning. + '(nroff-font-lock-keywords nil t nil backward-paragraph)) + (setq-local outline-regexp "\\.H[ ]+[1-7]+ ") + (setq-local outline-level 'nroff-outline-level) ;; now define a bunch of variables for use by commands in this mode - (set (make-local-variable 'page-delimiter) "^\\.\\(bp\\|SK\\|OP\\)") - (set (make-local-variable 'paragraph-start) - (concat "[.']\\|" paragraph-start)) - (set (make-local-variable 'paragraph-separate) - (concat "[.']\\|" paragraph-separate)) + (setq-local page-delimiter "^\\.\\(bp\\|SK\\|OP\\)") + (setq-local paragraph-start (concat "[.']\\|" paragraph-start)) + (setq-local paragraph-separate (concat "[.']\\|" paragraph-separate)) ;; Don't auto-fill directive lines starting . or ' since they normally ;; have to be one line. But do auto-fill comments .\" .\# and '''. ;; Comment directives (those starting . or ') are [.'][ \t]*\\[#"] ;; or ''', and this regexp is everything except those. So [.'] ;; followed by not backslash and not ' or followed by backslash but ;; then not # or " - (set (make-local-variable 'auto-fill-inhibit-regexp) - "[.'][ \t]*\\([^ \t\\']\\|\\\\[^#\"]\\)") + (setq-local auto-fill-inhibit-regexp + "[.'][ \t]*\\([^ \t\\']\\|\\\\[^#\"]\\)") ;; comment syntax added by mit-erl!gildea 18 Apr 86 - (set (make-local-variable 'comment-start) "\\\" ") - (set (make-local-variable 'comment-start-skip) "\\\\[\"#][ \t]*") - (set (make-local-variable 'comment-column) 24) - (set (make-local-variable 'comment-indent-function) 'nroff-comment-indent) - (set (make-local-variable 'comment-insert-comment-function) - 'nroff-insert-comment-function) - (set (make-local-variable 'imenu-generic-expression) nroff-imenu-expression)) + (setq-local comment-start "\\\" ") + (setq-local comment-start-skip "\\\\[\"#][ \t]*") + (setq-local comment-column 24) + (setq-local comment-indent-function #'nroff-comment-indent) + (setq-local comment-insert-comment-function #'nroff-insert-comment-function) + (setq-local imenu-generic-expression nroff-imenu-expression)) (defun nroff-outline-level () (save-excursion diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el index 5216812b58..9cf61c6c5e 100644 --- a/lisp/textmodes/picture.el +++ b/lisp/textmodes/picture.el @@ -764,18 +764,17 @@ they are not by default assigned to keys." (interactive) (if (eq major-mode 'picture-mode) (error "You are already editing a picture") - (set (make-local-variable 'picture-mode-old-local-map) (current-local-map)) + (setq-local picture-mode-old-local-map (current-local-map)) (use-local-map picture-mode-map) - (set (make-local-variable 'picture-mode-old-mode-name) mode-name) - (set (make-local-variable 'picture-mode-old-major-mode) major-mode) + (setq-local picture-mode-old-mode-name mode-name) + (setq-local picture-mode-old-major-mode major-mode) (setq major-mode 'picture-mode) - (set (make-local-variable 'picture-killed-rectangle) nil) - (set (make-local-variable 'tab-stop-list) (default-value 'tab-stop-list)) - (set (make-local-variable 'picture-tab-chars) - (default-value 'picture-tab-chars)) + (setq-local picture-killed-rectangle nil) + (setq-local tab-stop-list (default-value 'tab-stop-list)) + (setq-local picture-tab-chars (default-value 'picture-tab-chars)) (make-local-variable 'picture-vertical-step) (make-local-variable 'picture-horizontal-step) - (set (make-local-variable 'picture-mode-old-truncate-lines) truncate-lines) + (setq-local picture-mode-old-truncate-lines truncate-lines) (setq truncate-lines t) (picture-set-motion 0 1) diff --git a/lisp/textmodes/refill.el b/lisp/textmodes/refill.el index a83e6b3758..139221fae3 100644 --- a/lisp/textmodes/refill.el +++ b/lisp/textmodes/refill.el @@ -237,16 +237,14 @@ For true \"word wrap\" behavior, use `visual-line-mode' instead." (add-hook 'after-change-functions 'refill-after-change-function nil t) (add-hook 'post-command-hook 'refill-post-command-function nil t) (add-hook 'pre-command-hook 'refill-pre-command-function nil t) - (set (make-local-variable 'refill-saved-state) - (mapcar (lambda (s) (cons s (symbol-value s))) - '(fill-paragraph-function auto-fill-function))) + (setq-local refill-saved-state + (mapcar (lambda (s) (cons s (symbol-value s))) + '(fill-paragraph-function auto-fill-function))) ;; This provides the test for recursive paragraph filling. - (set (make-local-variable 'fill-paragraph-function) - 'refill-fill-paragraph) + (setq-local fill-paragraph-function #'refill-fill-paragraph) ;; When using justification, doing DEL on 2 spaces should remove ;; both, otherwise, the subsequent refill will undo the DEL. - (set (make-local-variable 'backward-delete-char-untabify-method) - 'hungry) + (setq-local backward-delete-char-untabify-method 'hungry) (setq refill-ignorable-overlay (make-overlay 1 1 nil nil t)) (overlay-put refill-ignorable-overlay 'modification-hooks '(refill-adjust-ignorable-overlay)) diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el index e75ff7a810..227e2dffd8 100644 --- a/lisp/textmodes/two-column.el +++ b/lisp/textmodes/two-column.el @@ -388,9 +388,8 @@ First column's text sSs Second column's text (backward-char arg) (setq chars (buffer-substring (point) point)) (skip-chars-forward " \t" point) - (make-local-variable '2C-separator) - (setq 2C-separator (buffer-substring (point) point) - 2C-window-width (+ (fringe-columns 'left) + (setq-local 2C-separator (buffer-substring (point) point)) + (setq 2C-window-width (+ (fringe-columns 'left) (fringe-columns 'right) (scroll-bar-columns 'left) (scroll-bar-columns 'right) commit 190a6853708ab22072437f6ebd93beb3ec1a9ce6 Author: Eli Zaretskii Date: Fri Dec 4 16:47:49 2020 +0200 Don't abort when terminated by SIGINT in -batch * src/xdisp.c (clear_message_stack): New function. * src/emacs.c (terminate_due_to_signal): Call clear_message_stack when we are being shut down by SIGINT under -batch. * src/lisp.h (clear_message_stack): Add prototype. diff --git a/src/emacs.c b/src/emacs.c index 172e460769..d1b010ec7f 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -386,7 +386,14 @@ terminate_due_to_signal (int sig, int backtrace_limit) totally_unblock_input (); if (sig == SIGTERM || sig == SIGHUP || sig == SIGINT) - Fkill_emacs (make_fixnum (sig)); + { + /* Avoid abort in shut_down_emacs if we were interrupted + by SIGINT in noninteractive usage, as in that case we + don't care about the message stack. */ + if (sig == SIGINT && noninteractive) + clear_message_stack (); + Fkill_emacs (make_fixnum (sig)); + } shut_down_emacs (sig, Qnil); emacs_backtrace (backtrace_limit); diff --git a/src/lisp.h b/src/lisp.h index a95913c4ef..9901f80b51 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3715,6 +3715,7 @@ extern Lisp_Object echo_area_buffer[2]; extern void add_to_log (char const *, ...); extern void vadd_to_log (char const *, va_list); extern void check_message_stack (void); +extern void clear_message_stack (void); extern void setup_echo_area_for_printing (bool); extern bool push_message (void); extern void pop_message_unwind (void); diff --git a/src/xdisp.c b/src/xdisp.c index 76ef420a36..ed1d4761b9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -11929,8 +11929,8 @@ pop_message_unwind (void) /* Check that Vmessage_stack is nil. Called from emacs.c when Emacs - exits. If the stack is not empty, we have a missing pop_message - somewhere. */ + exits. If the stack is not empty, we have a missing + pop_message_unwind somewhere. */ void check_message_stack (void) @@ -11939,6 +11939,11 @@ check_message_stack (void) emacs_abort (); } +void +clear_message_stack (void) +{ + Vmessage_stack = Qnil; +} /* Truncate to NCHARS what will be displayed in the echo area the next time we display it---but don't redisplay it now. */ commit f2bd536d36a89dac2a70c6a706d851ff73bcc40f Author: Lars Ingebrigtsen Date: Fri Dec 4 12:15:26 2020 +0100 Make custom-data saving atomic * lisp/cus-edit.el (custom-save-all): Do the custom saves as an atomic change group, to avoid writing invalid data if something goes wrong (or the user hits `C-g') in the middle (bug#18633). diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index a00cb17e29..3a36cb0237 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -4717,8 +4717,9 @@ if only the first line of the docstring is shown.")) (let ((inhibit-read-only t) (print-length nil) (print-level nil)) - (custom-save-variables) - (custom-save-faces)) + (atomic-change-group + (custom-save-variables) + (custom-save-faces))) (let ((file-precious-flag t)) (save-buffer)) (if old-buffer commit 1052707230d3d3b3723eefa6dede7542a4ef28bd Author: Lars Ingebrigtsen Date: Fri Dec 4 11:46:47 2020 +0100 Allow viper-save-setting to save numerical settings * lisp/emulation/viper-util.el (viper-save-setting): Allow saving numerical settings (bug#18928). diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index 9da493d74b..208a2ee986 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el @@ -596,7 +596,7 @@ Otherwise return the normal value." (defun viper-save-setting (var message file &optional erase-msg) (let* ((var-name (symbol-name var)) (var-val (if (boundp var) (eval var))) - (regexp (format "^[^;]*%s[ \t\n]*[a-zA-Z---_']*[ \t\n)]" var-name)) + (regexp (format "^[^;]*%s[ \t\n]*[a-zA-Z0-9---_']*[ \t\n)]" var-name)) (buf (find-file-noselect (substitute-in-file-name file))) ) (message "%s" (or message "")) commit f352c57972d24464a42ea3e65dc8ac07d8e0517c Author: Lars Ingebrigtsen Date: Fri Dec 4 11:33:56 2020 +0100 Clarify icomplete-show-matches-on-no-input doc string * lisp/icomplete.el (icomplete-show-matches-on-no-input): Clarify the meaning of the variable (bug#19031). diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 4e546807b7..9c1470812a 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -75,7 +75,12 @@ everything preceding the ~/ is discarded so the interactive selection process starts again from the user's $HOME.") (defcustom icomplete-show-matches-on-no-input nil - "When non-nil, show completions when first prompting for input. + "If nil, don't wait for completions before showing the prompt. +Instead, when there's no input, completions may be displayed +asynchronously later, when the completions have been computed. + +If non-nil, always compute the completions first. + This also means that if you traverse the list of completions with commands like `C-.' and just hit RET without typing any characters, the match under point will be chosen instead of the commit b3d315efc210d47b22791dd938e6354bcb0f089c Author: Stefan Kangas Date: Fri Dec 4 11:14:26 2020 +0100 Prefer setq-local in erc * lisp/erc/erc-goodies.el (erc-imenu-setup): * lisp/erc/erc-list.el (erc-list-install-322-handler, erc-cmd-LIST): * lisp/erc/erc-pcomplete.el (pcomplete-erc-setup): * lisp/erc/erc.el (erc-mode, erc-update-mode-line-buffer): Prefer setq-local. diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index a475f0a177..350eb89b66 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el @@ -35,8 +35,7 @@ (defun erc-imenu-setup () "Setup Imenu support in an ERC buffer." - (set (make-local-variable 'imenu-create-index-function) - 'erc-create-imenu-index)) + (setq-local imenu-create-index-function #'erc-create-imenu-index)) (add-hook 'erc-mode-hook 'erc-imenu-setup) (autoload 'erc-create-imenu-index "erc-imenu" "Imenu index creation function") diff --git a/lisp/erc/erc-list.el b/lisp/erc/erc-list.el index 036d7733ed..ae7c2e5f2f 100644 --- a/lisp/erc/erc-list.el +++ b/lisp/erc/erc-list.el @@ -188,15 +188,15 @@ (lambda (_proc _parsed) (remove-hook 'erc-server-322-functions 'erc-list-handle-322 t))) ;; Find the list buffer, empty it, and display it. - (set (make-local-variable 'erc-list-buffer) - (get-buffer-create (concat "*Channels of " - erc-server-announced-name - "*"))) + (setq-local erc-list-buffer + (get-buffer-create (concat "*Channels of " + erc-server-announced-name + "*"))) (with-current-buffer erc-list-buffer (erc-list-menu-mode) (setq buffer-read-only nil) (erase-buffer) - (set (make-local-variable 'erc-list-server-buffer) server-buffer) + (setq-local erc-list-server-buffer server-buffer) (setq buffer-read-only t)) (pop-to-buffer erc-list-buffer)) t) @@ -211,7 +211,7 @@ should usually be one or more channels, separated by commas. Please note that this function only works with IRC servers which conform to RFC and send the LIST header (#321) at start of list transmission." (erc-with-server-buffer - (set (make-local-variable 'erc-list-last-argument) line) + (setq-local erc-list-last-argument line) (erc-once-with-server-event 321 (let ((buf (current-buffer))) diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el index f8b7e13be0..c4932f2bde 100644 --- a/lisp/erc/erc-pcomplete.el +++ b/lisp/erc/erc-pcomplete.el @@ -89,18 +89,16 @@ for use on `completion-at-point-function'." (defun pcomplete-erc-setup () "Setup `erc-mode' to use pcomplete." - (set (make-local-variable 'pcomplete-ignore-case) - t) - (set (make-local-variable 'pcomplete-use-paring) - nil) - (set (make-local-variable 'pcomplete-parse-arguments-function) - 'pcomplete-erc-parse-arguments) - (set (make-local-variable 'pcomplete-command-completion-function) - 'pcomplete/erc-mode/complete-command) - (set (make-local-variable 'pcomplete-command-name-function) - 'pcomplete-erc-command-name) - (set (make-local-variable 'pcomplete-default-completion-function) - (lambda () (pcomplete-here (pcomplete-erc-nicks))))) + (setq-local pcomplete-ignore-case t) + (setq-local pcomplete-use-paring nil) + (setq-local pcomplete-parse-arguments-function + #'pcomplete-erc-parse-arguments) + (setq-local pcomplete-command-completion-function + #'pcomplete/erc-mode/complete-command) + (setq-local pcomplete-command-name-function + #'pcomplete-erc-command-name) + (setq-local pcomplete-default-completion-function + (lambda () (pcomplete-here (pcomplete-erc-nicks))))) ;;; Programmable completion logic diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 94ea0de7ee..d0b511dc0a 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -1488,12 +1488,12 @@ Defaults to the server buffer." (define-derived-mode erc-mode fundamental-mode "ERC" "Major mode for Emacs IRC." (setq local-abbrev-table erc-mode-abbrev-table) - (set (make-local-variable 'next-line-add-newlines) nil) + (setq-local next-line-add-newlines nil) (setq line-move-ignore-invisible t) - (set (make-local-variable 'paragraph-separate) - (concat "\C-l\\|\\(^" (regexp-quote (erc-prompt)) "\\)")) - (set (make-local-variable 'paragraph-start) - (concat "\\(" (regexp-quote (erc-prompt)) "\\)")) + (setq-local paragraph-separate + (concat "\C-l\\|\\(^" (regexp-quote (erc-prompt)) "\\)")) + (setq-local paragraph-start + (concat "\\(" (regexp-quote (erc-prompt)) "\\)")) (setq-local completion-ignore-case t) (add-hook 'completion-at-point-functions 'erc-complete-word-at-point nil t)) @@ -6493,8 +6493,7 @@ if `erc-away' is non-nil." (format-spec erc-header-line-format spec) nil))) (cond (erc-header-line-uses-tabbar-p - (set (make-local-variable 'tabbar--local-hlf) - header-line-format) + (setq-local tabbar--local-hlf header-line-format) (kill-local-variable 'header-line-format)) ((null header) (setq header-line-format nil)) commit cbfce827ace4c410a2eed50c8d8c763721925b7e Author: Alyssa Ross Date: Fri Dec 4 11:06:48 2020 +0100 Make shell-command use comint settings * lisp/simple.el (shell-command): Use the term environment from comint, so that comint settings are used for commands like `async-shell-command', too (bug#45034). Copyright-paperwork-exempt: yes diff --git a/lisp/simple.el b/lisp/simple.el index 7d0c229cad..4356e40d4f 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3786,6 +3786,7 @@ a shell (with its need to quote arguments)." (shell-command command output-buffer error-buffer)) (declare-function comint-output-filter "comint" (process string)) +(declare-function comint-term-environment "comint") (defun shell-command (command &optional output-buffer error-buffer) "Execute string COMMAND in inferior shell; display output, if any. @@ -3965,10 +3966,13 @@ impose the use of a shell (with its need to quote arguments)." (shell-command-save-pos-or-erase) (setq default-directory directory) (let ((process-environment - (if (natnump async-shell-command-width) - (cons (format "COLUMNS=%d" async-shell-command-width) - process-environment) - process-environment))) + (append + (comint-term-environment) + (and (natnump async-shell-command-width) + (list + (format "COLUMNS=%d" + async-shell-command-width))) + process-environment))) (setq proc (start-process-shell-command "Shell" buffer command))) (setq mode-line-process '(":%s")) commit 3df49612c66416102eddcb030001b86920da9c17 Author: Stefan Kangas Date: Fri Dec 4 10:57:04 2020 +0100 * lisp/eshell/esh-mode.el (eshell-mode): Remove XEmacs compat code. diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index e2ec7101f3..81d0ec249c 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -325,10 +325,8 @@ and the hook `eshell-exit-hook'." (setq auto-fill-function nil) ;; always display everything from a return value - (if (boundp 'print-length) - (setq-local print-length nil)) - (if (boundp 'print-level) - (setq-local print-level nil)) + (setq-local print-length nil) + (setq-local print-level nil) ;; set require-final-newline to nil; otherwise, all redirected ;; output will end with a newline, whether or not the source commit 78cdf4c7627e0ce857bb6c6ebbca183e18762c21 Author: Stefan Kangas Date: Fri Dec 4 10:55:50 2020 +0100 Prefer setq-local in eshell * lisp/eshell/em-cmpl.el (eshell-cmpl-initialize): * lisp/eshell/em-dirs.el (eshell-dirs-initialize): * lisp/eshell/em-glob.el (eshell-glob-initialize, eshell-glob-regexp): * lisp/eshell/em-hist.el (eshell-hist-initialize): * lisp/eshell/em-prompt.el (eshell-prompt-initialize): * lisp/eshell/em-rebind.el (eshell-rebind-initialize) (eshell-setup-input-keymap): * lisp/eshell/em-script.el (eshell-script-initialize): * lisp/eshell/em-smart.el (eshell-smart-initialize): * lisp/eshell/em-term.el (eshell-term-initialize, eshell-exec-visual): * lisp/eshell/em-tramp.el (eshell-tramp-initialize): * lisp/eshell/em-unix.el (eshell-unix-initialize, eshell/diff): * lisp/eshell/esh-arg.el (eshell-arg-initialize): * lisp/eshell/esh-cmd.el (eshell-cmd-initialize): * lisp/eshell/esh-io.el (eshell-get-target): * lisp/eshell/esh-mode.el (eshell-mode): * lisp/eshell/esh-var.el (eshell-var-initialize): Prefer setq-local. diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el index 53a0cda354..d0d7aff772 100644 --- a/lisp/eshell/em-cmpl.el +++ b/lisp/eshell/em-cmpl.el @@ -267,48 +267,48 @@ to writing a completion function." (defun eshell-cmpl-initialize () ;Called from `eshell-mode' via intern-soft! "Initialize the completions module." - (set (make-local-variable 'pcomplete-command-completion-function) - eshell-command-completion-function) - (set (make-local-variable 'pcomplete-command-name-function) - eshell-cmpl-command-name-function) - (set (make-local-variable 'pcomplete-default-completion-function) - eshell-default-completion-function) - (set (make-local-variable 'pcomplete-parse-arguments-function) - 'eshell-complete-parse-arguments) - (set (make-local-variable 'pcomplete-file-ignore) - eshell-cmpl-file-ignore) - (set (make-local-variable 'pcomplete-dir-ignore) - eshell-cmpl-dir-ignore) - (set (make-local-variable 'pcomplete-ignore-case) - eshell-cmpl-ignore-case) - (set (make-local-variable 'pcomplete-autolist) - eshell-cmpl-autolist) + (setq-local pcomplete-command-completion-function + eshell-command-completion-function) + (setq-local pcomplete-command-name-function + eshell-cmpl-command-name-function) + (setq-local pcomplete-default-completion-function + eshell-default-completion-function) + (setq-local pcomplete-parse-arguments-function + 'eshell-complete-parse-arguments) + (setq-local pcomplete-file-ignore + eshell-cmpl-file-ignore) + (setq-local pcomplete-dir-ignore + eshell-cmpl-dir-ignore) + (setq-local pcomplete-ignore-case + eshell-cmpl-ignore-case) + (setq-local pcomplete-autolist + eshell-cmpl-autolist) (if (boundp 'pcomplete-suffix-list) - (set (make-local-variable 'pcomplete-suffix-list) - eshell-cmpl-suffix-list)) - (set (make-local-variable 'pcomplete-recexact) - eshell-cmpl-recexact) - (set (make-local-variable 'pcomplete-man-function) - eshell-cmpl-man-function) - (set (make-local-variable 'pcomplete-compare-entry-function) - eshell-cmpl-compare-entry-function) - (set (make-local-variable 'pcomplete-expand-before-complete) - eshell-cmpl-expand-before-complete) - (set (make-local-variable 'pcomplete-cycle-completions) - eshell-cmpl-cycle-completions) - (set (make-local-variable 'pcomplete-cycle-cutoff-length) - eshell-cmpl-cycle-cutoff-length) - (set (make-local-variable 'pcomplete-restore-window-delay) - eshell-cmpl-restore-window-delay) - (set (make-local-variable 'pcomplete-use-paring) - eshell-cmpl-use-paring) + (setq-local pcomplete-suffix-list + eshell-cmpl-suffix-list)) + (setq-local pcomplete-recexact + eshell-cmpl-recexact) + (setq-local pcomplete-man-function + eshell-cmpl-man-function) + (setq-local pcomplete-compare-entry-function + eshell-cmpl-compare-entry-function) + (setq-local pcomplete-expand-before-complete + eshell-cmpl-expand-before-complete) + (setq-local pcomplete-cycle-completions + eshell-cmpl-cycle-completions) + (setq-local pcomplete-cycle-cutoff-length + eshell-cmpl-cycle-cutoff-length) + (setq-local pcomplete-restore-window-delay + eshell-cmpl-restore-window-delay) + (setq-local pcomplete-use-paring + eshell-cmpl-use-paring) ;; `comint-file-name-quote-list' should only be set after all the ;; load-hooks for any other extension modules have been run, which ;; is true at the time `eshell-mode-hook' is run (add-hook 'eshell-mode-hook (lambda () - (set (make-local-variable 'comint-file-name-quote-list) - eshell-special-chars-outside-quoting)) + (setq-local comint-file-name-quote-list + eshell-special-chars-outside-quoting)) nil t) (add-hook 'pcomplete-quote-arg-hook #'eshell-quote-backslash nil t) (add-hook 'completion-at-point-functions diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el index b4ed3794ad..c0c2539025 100644 --- a/lisp/eshell/em-dirs.el +++ b/lisp/eshell/em-dirs.el @@ -175,8 +175,7 @@ Thus, this does not include the current directory.") (defun eshell-dirs-initialize () ;Called from `eshell-mode' via intern-soft! "Initialize the builtin functions for Eshell." - (make-local-variable 'eshell-variable-aliases-list) - (setq eshell-variable-aliases-list + (setq-local eshell-variable-aliases-list (append eshell-variable-aliases-list `(("-" ,(lambda (indices) @@ -199,8 +198,7 @@ Thus, this does not include the current directory.") t)))) (when eshell-cd-on-directory - (make-local-variable 'eshell-interpreter-alist) - (setq eshell-interpreter-alist + (setq-local eshell-interpreter-alist (cons (cons #'(lambda (file _args) (eshell-lone-directory-p file)) 'eshell-dirs-substitute-cd) diff --git a/lisp/eshell/em-glob.el b/lisp/eshell/em-glob.el index a32a6abe29..9ae2dd94ec 100644 --- a/lisp/eshell/em-glob.el +++ b/lisp/eshell/em-glob.el @@ -129,7 +129,7 @@ This option slows down recursive glob processing by quite a bit." "Initialize the extended globbing code." ;; it's important that `eshell-glob-chars-list' come first (when (boundp 'eshell-special-chars-outside-quoting) - (set (make-local-variable 'eshell-special-chars-outside-quoting) + (setq-local eshell-special-chars-outside-quoting (append eshell-glob-chars-list eshell-special-chars-outside-quoting))) (add-hook 'eshell-parse-argument-hook 'eshell-parse-glob-chars t t) (add-hook 'eshell-pre-rewrite-command-hook @@ -205,7 +205,7 @@ resulting regular expression." regexp) (while (string-match (or eshell-glob-chars-regexp - (set (make-local-variable 'eshell-glob-chars-regexp) + (setq-local eshell-glob-chars-regexp (format "[%s]+" (apply 'string eshell-glob-chars-list)))) pattern matched-in-pattern) (let* ((op-begin (match-beginning 0)) diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index c27e450376..490b8b679c 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el @@ -243,11 +243,10 @@ Returns nil if INPUT is prepended by blank space, otherwise non-nil." (if (and (eshell-using-module 'eshell-rebind) (not eshell-non-interactive-p)) (let ((rebind-alist eshell-rebind-keys-alist)) - (make-local-variable 'eshell-rebind-keys-alist) - (setq eshell-rebind-keys-alist + (setq-local eshell-rebind-keys-alist (append rebind-alist eshell-hist-rebind-keys-alist)) - (set (make-local-variable 'search-invisible) t) - (set (make-local-variable 'search-exit-option) t) + (setq-local search-invisible t) + (setq-local search-exit-option t) (add-hook 'isearch-mode-hook (lambda () (if (>= (point) eshell-last-output-end) @@ -278,8 +277,8 @@ Returns nil if INPUT is prepended by blank space, otherwise non-nil." (make-local-variable 'eshell-save-history-index) (if (minibuffer-window-active-p (selected-window)) - (set (make-local-variable 'eshell-save-history-on-exit) nil) - (set (make-local-variable 'eshell-history-ring) nil) + (setq-local eshell-save-history-on-exit nil) + (setq-local eshell-history-ring nil) (if eshell-history-file-name (eshell-read-history nil t)) diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el index dcee1e7a98..c6afc5a240 100644 --- a/lisp/eshell/em-prompt.el +++ b/lisp/eshell/em-prompt.el @@ -117,10 +117,9 @@ arriving, or after." (make-local-variable 'eshell-prompt-regexp) (if eshell-prompt-regexp - (set (make-local-variable 'paragraph-start) eshell-prompt-regexp)) + (setq-local paragraph-start eshell-prompt-regexp)) - (set (make-local-variable 'eshell-skip-prompt-function) - 'eshell-skip-prompt) + (setq-local eshell-skip-prompt-function #'eshell-skip-prompt) (eshell-prompt-mode))) (defun eshell-emit-prompt () diff --git a/lisp/eshell/em-rebind.el b/lisp/eshell/em-rebind.el index 7991c63177..ab10211687 100644 --- a/lisp/eshell/em-rebind.el +++ b/lisp/eshell/em-rebind.el @@ -163,7 +163,7 @@ This is default behavior of shells like bash." (add-hook 'pre-command-hook 'eshell-save-previous-point nil t) (make-local-variable 'overriding-local-map) (add-hook 'post-command-hook 'eshell-rebind-input-map nil t) - (set (make-local-variable 'eshell-lock-keymap) nil) + (setq-local eshell-lock-keymap nil) (eshell-rebind-mode))) (defun eshell-lock-local-map (&optional arg) @@ -219,8 +219,7 @@ lock it at that." (defun eshell-setup-input-keymap () "Setup the input keymap to be used during input editing." - (make-local-variable 'eshell-input-keymap) - (setq eshell-input-keymap (make-sparse-keymap)) + (setq-local eshell-input-keymap (make-sparse-keymap)) (set-keymap-parent eshell-input-keymap eshell-mode-map) (let ((bindings eshell-rebind-keys-alist)) (while bindings diff --git a/lisp/eshell/em-script.el b/lisp/eshell/em-script.el index 5c2f145f59..857ae6a475 100644 --- a/lisp/eshell/em-script.el +++ b/lisp/eshell/em-script.el @@ -58,15 +58,13 @@ This includes when running `eshell-command'." (defun eshell-script-initialize () ;Called from `eshell-mode' via intern-soft! "Initialize the script parsing code." - (make-local-variable 'eshell-interpreter-alist) - (setq eshell-interpreter-alist + (setq-local eshell-interpreter-alist (cons (cons #'(lambda (file _args) (string= (file-name-nondirectory file) "eshell")) 'eshell/source) eshell-interpreter-alist)) - (make-local-variable 'eshell-complex-commands) - (setq eshell-complex-commands + (setq-local eshell-complex-commands (append '("source" ".") eshell-complex-commands)) ;; these two variables are changed through usage, but we don't want ;; to ruin it for other modules diff --git a/lisp/eshell/em-smart.el b/lisp/eshell/em-smart.el index a28bb1d641..8bc88f2f4b 100644 --- a/lisp/eshell/em-smart.el +++ b/lisp/eshell/em-smart.el @@ -170,9 +170,9 @@ The options are `begin', `after' or `end'." (unless eshell-non-interactive-p ;; override a few variables, since they would interfere with the ;; smart display functionality. - (set (make-local-variable 'eshell-scroll-to-bottom-on-output) nil) - (set (make-local-variable 'eshell-scroll-to-bottom-on-input) nil) - (set (make-local-variable 'eshell-scroll-show-maximum-output) t) + (setq-local eshell-scroll-to-bottom-on-output nil) + (setq-local eshell-scroll-to-bottom-on-input nil) + (setq-local eshell-scroll-show-maximum-output t) (add-hook 'window-scroll-functions 'eshell-smart-scroll-window nil t) (add-hook 'window-configuration-change-hook 'eshell-refresh-windows) diff --git a/lisp/eshell/em-term.el b/lisp/eshell/em-term.el index f52b3cda73..be91cf7977 100644 --- a/lisp/eshell/em-term.el +++ b/lisp/eshell/em-term.el @@ -143,8 +143,7 @@ behavior for short-lived processes, see bug#18108." (defun eshell-term-initialize () ;Called from `eshell-mode' via intern-soft! "Initialize the `term' interface code." - (make-local-variable 'eshell-interpreter-alist) - (setq eshell-interpreter-alist + (setq-local eshell-interpreter-alist (cons (cons #'eshell-visual-command-p 'eshell-exec-visual) eshell-interpreter-alist))) @@ -179,9 +178,8 @@ allowed." (save-current-buffer (switch-to-buffer term-buf) (term-mode) - (set (make-local-variable 'term-term-name) eshell-term-name) - (make-local-variable 'eshell-parent-buffer) - (setq eshell-parent-buffer eshell-buf) + (setq-local term-term-name eshell-term-name) + (setq-local eshell-parent-buffer eshell-buf) (term-exec term-buf program program nil args) (let ((proc (get-buffer-process term-buf))) (if (and proc (eq 'run (process-status proc))) diff --git a/lisp/eshell/em-tramp.el b/lisp/eshell/em-tramp.el index 01f7038e46..c2d3c3edce 100644 --- a/lisp/eshell/em-tramp.el +++ b/lisp/eshell/em-tramp.el @@ -51,10 +51,9 @@ (when (eshell-using-module 'eshell-cmpl) (add-hook 'pcomplete-try-first-hook 'eshell-complete-host-reference nil t)) - (make-local-variable 'eshell-complex-commands) - (setq eshell-complex-commands - (append '("su" "sudo") - eshell-complex-commands))) + (setq-local eshell-complex-commands + (append '("su" "sudo") + eshell-complex-commands))) (autoload 'eshell-parse-command "esh-cmd") diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index c66f307bfe..2d6bd32b5a 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -144,8 +144,7 @@ Otherwise, Emacs will attempt to use rsh to invoke du on the remote machine." (when (eshell-using-module 'eshell-cmpl) (add-hook 'pcomplete-try-first-hook 'eshell-complete-host-reference nil t)) - (make-local-variable 'eshell-complex-commands) - (setq eshell-complex-commands + (setq-local eshell-complex-commands (append '("grep" "egrep" "fgrep" "agrep" "glimpse" "locate" "cat" "time" "cp" "mv" "make" "du" "diff") eshell-complex-commands))) @@ -1008,7 +1007,7 @@ Show wall-clock time elapsed during execution of COMMAND.") (lambda (buff _msg) (with-current-buffer buff (diff-mode) - (set (make-local-variable 'eshell-diff-window-config) config) + (setq-local eshell-diff-window-config config) (local-set-key [?q] #'eshell-diff-quit) (if (fboundp 'turn-on-font-lock-if-enabled) (turn-on-font-lock-if-enabled)) diff --git a/lisp/eshell/esh-arg.el b/lisp/eshell/esh-arg.el index aefda64768..cecb6f7918 100644 --- a/lisp/eshell/esh-arg.el +++ b/lisp/eshell/esh-arg.el @@ -168,8 +168,8 @@ treated as a literal character." (defun eshell-arg-initialize () ;Called from `eshell-mode' via intern-soft! "Initialize the argument parsing code." (eshell-arg-mode) - (set (make-local-variable 'eshell-inside-quote-regexp) nil) - (set (make-local-variable 'eshell-outside-quote-regexp) nil)) + (setq-local eshell-inside-quote-regexp nil) + (setq-local eshell-outside-quote-regexp nil)) (defun eshell-insert-buffer-name (buffer-name) "Insert BUFFER-NAME into the current buffer at point." diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index 68b34837a2..81124413a4 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -290,12 +290,12 @@ otherwise t.") (defun eshell-cmd-initialize () ;Called from `eshell-mode' via intern-soft! "Initialize the Eshell command processing module." - (set (make-local-variable 'eshell-current-command) nil) - (set (make-local-variable 'eshell-command-name) nil) - (set (make-local-variable 'eshell-command-arguments) nil) - (set (make-local-variable 'eshell-last-arguments) nil) - (set (make-local-variable 'eshell-last-command-name) nil) - (set (make-local-variable 'eshell-last-async-proc) nil) + (setq-local eshell-current-command nil) + (setq-local eshell-command-name nil) + (setq-local eshell-command-arguments nil) + (setq-local eshell-last-arguments nil) + (setq-local eshell-last-command-name nil) + (setq-local eshell-last-async-proc nil) (add-hook 'eshell-kill-hook #'eshell-resume-command nil t) diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el index b0443a4ace..de41fccc1f 100644 --- a/lisp/eshell/esh-io.el +++ b/lisp/eshell/esh-io.el @@ -344,8 +344,8 @@ it defaults to `insert'." (if buffer-file-read-only (error "Cannot write to read-only file `%s'" target)) (setq buffer-read-only nil) - (set (make-local-variable 'eshell-output-file-buffer) - (if (eq exists buf) 0 t)) + (setq-local eshell-output-file-buffer + (if (eq exists buf) 0 t)) (cond ((eq mode 'overwrite) (erase-buffer)) ((eq mode 'append) diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index a80c2fc60d..e2ec7101f3 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -312,45 +312,40 @@ and the hook `eshell-exit-hook'." (if mode-line-elt (setcar mode-line-elt 'eshell-command-running-string)))) - (set (make-local-variable 'bookmark-make-record-function) - 'eshell-bookmark-make-record) + (setq-local bookmark-make-record-function #'eshell-bookmark-make-record) (setq local-abbrev-table eshell-mode-abbrev-table) - (set (make-local-variable 'list-buffers-directory) - (expand-file-name default-directory)) + (setq-local list-buffers-directory (expand-file-name default-directory)) ;; always set the tab width to 8 in Eshell buffers, since external ;; commands which do their own formatting almost always expect this - (set (make-local-variable 'tab-width) 8) + (setq-local tab-width 8) ;; don't ever use auto-fill in Eshell buffers (setq auto-fill-function nil) ;; always display everything from a return value (if (boundp 'print-length) - (set (make-local-variable 'print-length) nil)) + (setq-local print-length nil)) (if (boundp 'print-level) - (set (make-local-variable 'print-level) nil)) + (setq-local print-level nil)) ;; set require-final-newline to nil; otherwise, all redirected ;; output will end with a newline, whether or not the source ;; indicated it! - (set (make-local-variable 'require-final-newline) nil) + (setq-local require-final-newline nil) - (set (make-local-variable 'max-lisp-eval-depth) - (max 3000 max-lisp-eval-depth)) - (set (make-local-variable 'max-specpdl-size) - (max 6000 max-lisp-eval-depth)) + (setq-local max-lisp-eval-depth (max 3000 max-lisp-eval-depth)) + (setq-local max-specpdl-size (max 6000 max-lisp-eval-depth)) - (set (make-local-variable 'eshell-last-input-start) (point-marker)) - (set (make-local-variable 'eshell-last-input-end) (point-marker)) - (set (make-local-variable 'eshell-last-output-start) (point-marker)) - (set (make-local-variable 'eshell-last-output-end) (point-marker)) - (set (make-local-variable 'eshell-last-output-block-begin) (point)) + (setq-local eshell-last-input-start (point-marker)) + (setq-local eshell-last-input-end (point-marker)) + (setq-local eshell-last-output-start (point-marker)) + (setq-local eshell-last-output-end (point-marker)) + (setq-local eshell-last-output-block-begin (point)) (let ((modules-list (copy-sequence eshell-modules-list))) - (make-local-variable 'eshell-modules-list) - (setq eshell-modules-list modules-list)) + (setq-local eshell-modules-list modules-list)) ;; This is to avoid making the paragraph base direction ;; right-to-left if the first word just happens to start with a @@ -391,7 +386,7 @@ and the hook `eshell-exit-hook'." (add-hook 'pre-command-hook #'eshell-preinput-scroll-to-bottom t t)) (when eshell-scroll-show-maximum-output - (set (make-local-variable 'scroll-conservatively) 1000)) + (setq-local scroll-conservatively 1000)) (when eshell-status-in-mode-line (add-hook 'eshell-pre-command-hook #'eshell-command-started nil t) diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 7a80cd8687..9aea5430ad 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -227,12 +227,11 @@ environment of created subprocesses." ;; Break the association with our parent's environment. Otherwise, ;; changing a variable will affect all of Emacs. (unless eshell-modify-global-environment - (set (make-local-variable 'process-environment) - (eshell-copy-environment))) + (setq-local process-environment (eshell-copy-environment))) - (set (make-local-variable 'eshell-special-chars-inside-quoting) + (setq-local eshell-special-chars-inside-quoting (append eshell-special-chars-inside-quoting '(?$))) - (set (make-local-variable 'eshell-special-chars-outside-quoting) + (setq-local eshell-special-chars-outside-quoting (append eshell-special-chars-outside-quoting '(?$))) (add-hook 'eshell-parse-argument-hook #'eshell-interpolate-variable t t) commit f365eb2e055c05e8dbd76aca6b6d10b0a888d5da Author: Lars Ingebrigtsen Date: Fri Dec 4 10:46:34 2020 +0100 Preload iso-trans.el * lisp/loadup.el ("international/iso-transl"): Load by default so that we get `Alt-' bindings (bug#21310). * lisp/international/iso-transl.el: Remove autoloads and some comments. diff --git a/etc/NEWS b/etc/NEWS index 81f1fe3c1a..7f18f12946 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1352,6 +1352,12 @@ This new command (bound to 'C-c C-l') regenerates the current hunk. ** Miscellaneous +--- +*** iso-transl is now preloaded. +This means that keystrokes like 'Alt-[' are defined by default, +instead of only becoming available after doing (for instance) +'C-x 8 '. + *** New user option 'completions-detailed'. When non-nil, some commands like 'describe-symbol' show more detailed completions with more information in completion prefix and suffix. diff --git a/lisp/international/iso-transl.el b/lisp/international/iso-transl.el index bde989d41d..39fd75ea51 100644 --- a/lisp/international/iso-transl.el +++ b/lisp/international/iso-transl.el @@ -30,22 +30,12 @@ ;; A-umlaut as `C-x 8 " A' or `Alt-" A' (if you have an Alt key) or ;; `umlaut A' (if you have an umlaut/diaeresis key). -;; C-x 8 is set up to autoload this package, -;; but Alt keys and dead accent keys are only defined -;; once you have loaded the package. It is nontrivial -;; to make all of the Alt keys autoload, and it is not clear -;; that the dead accent keys SHOULD autoload this package. - ;; This package supports all characters defined by ISO 8859-1, along ;; with a few other ISO 10646 characters commonly used in English and ;; basic math. ;;; Code: -;;; Provide some binding for startup: -;;;###autoload (define-key key-translation-map "\C-x8" 'iso-transl-ctl-x-8-map) -;;;###autoload (autoload 'iso-transl-ctl-x-8-map "iso-transl" "Keymap for C-x 8 prefix." t 'keymap) - (defvar iso-transl-dead-key-alist '((?\' . mute-acute) (?\` . mute-grave) diff --git a/lisp/loadup.el b/lisp/loadup.el index 4b711eed06..d3c8664bbc 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -351,6 +351,7 @@ (load "cus-start") ;Late to reduce customize-rogue (needs loaddefs.el anyway) (if (not (eq system-type 'ms-dos)) (load "tooltip")) +(load "international/iso-transl") ; Binds Alt-[ and friends. ;; This file doesn't exist when building a development version of Emacs ;; from the repository. It is generated just after temacs is built. commit db26a844816ad524fa4326f6a62382b930926340 Author: Dmitry Gutov Date: Fri Dec 4 04:46:52 2020 +0200 ; Fix line number sorting diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 2a478099f8..ccd5e1ae8b 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1279,7 +1279,7 @@ IGNORES is a list of glob patterns for files to ignore." ;; without the '| sort ...' part if GNU sort is not available on ;; your system and/or stable ordering is not important to you. ;; Note#2: '!*/' is there to filter out dirs (e.g. submodules). - "xargs -0 rg -nH --no-messages -g '!*/' -e | sort -t: -k1 -k2n" + "xargs -0 rg -nH --no-messages -g '!*/' -e | sort -t: -k1,1 -k2n,2" )) "Associative list mapping program identifiers to command templates. commit 5e22c5f90eb858933536f678915d199e6df6bdc8 Author: Dmitry Gutov Date: Fri Dec 4 03:54:14 2020 +0200 ; Expand on the NEWS entry diff --git a/etc/NEWS b/etc/NEWS index 051adf32ef..81f1fe3c1a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1187,8 +1187,10 @@ project's root directory, respectively. So typing 'C-u RET' in the "*xref*" buffer quits its window before navigating to the selected location. -*** New option xref-search-program. -So far Grep and ripgrep are supported. +*** New options xref-search-program and xref-search-program-alist. +So far Grep and ripgrep are supported. ripgrep seems to offer better +performance in certain cases, in particular for case-insensitive +searches. ** json.el commit f2a3d6e28d81dc2890e99afd550b59ff01fac5d9 Author: Dmitry Gutov Date: Fri Dec 4 03:37:10 2020 +0200 Support using ripgrep in project-find-regexp and friends Performance results vary here. Some projects and search terms don't see much of a change, but for some (including Emacs sources checkout and case-insensitive search) the switch to ripgrep shows ~2-3x speed improvement. Another piece of anecdata here: https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00802.html * lisp/progmodes/xref.el (xref-search-program-alist) (xref-search-program): New user options. (xref-matches-in-files): Use them. diff --git a/etc/NEWS b/etc/NEWS index c9da296278..051adf32ef 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1187,6 +1187,9 @@ project's root directory, respectively. So typing 'C-u RET' in the "*xref*" buffer quits its window before navigating to the selected location. +*** New option xref-search-program. +So far Grep and ripgrep are supported. + ** json.el --- diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index e1dd6e56bb..2a478099f8 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1262,12 +1262,56 @@ IGNORES is a list of glob patterns for files to ignore." (declare-function tramp-tramp-file-p "tramp") (declare-function tramp-file-local-name "tramp") +;; TODO: Experiment with 'xargs -P4' (or any other number). +;; This speeds up either command, even more than rg's '-j4' does. +;; Ripgrep gets jumbled output, though, even with --line-buffered. +;; But Grep seems to be stable. Even without --line-buffered. +(defcustom xref-search-program-alist + '((grep + . + ;; '-s' because 'git ls-files' can output broken symlinks. + "xargs -0 grep -snHE -e ") + (ripgrep + . + ;; Note: by default, ripgrep's output order is non-deterministic + ;; (https://github.com/BurntSushi/ripgrep/issues/152) + ;; because it does the search in parallel. You can use the template + ;; without the '| sort ...' part if GNU sort is not available on + ;; your system and/or stable ordering is not important to you. + ;; Note#2: '!*/' is there to filter out dirs (e.g. submodules). + "xargs -0 rg -nH --no-messages -g '!*/' -e | sort -t: -k1 -k2n" + )) + "Associative list mapping program identifiers to command templates. + +Program identifier should be a symbol, named after the search program. + +The command template must be a shell command (or usually a +pipeline) that will search the list of files which will be piped +from stdin. The template should have following fields: + + for extra arguments such as -i and --color + for the regexp itself (in Extended format)" + :type '(repeat + (cons (symbol :tag "Program identifier") + (string :tag "Command template")))) + +(defcustom xref-search-program 'grep + "The program to use to search inside files. + +This must reference a corresponding entry in `xref-search-program-alist'." + :type `(choice + (const :tag "Use Grep" grep) + (const :tag "Use ripgrep" ripgrep) + (symbol :tag "User defined"))) + ;;;###autoload (defun xref-matches-in-files (regexp files) "Find all matches for REGEXP in FILES. Return a list of xref values. FILES must be a list of absolute file names." (cl-assert (consp files)) + (require 'grep) + (defvar grep-highlight-matches) (pcase-let* ((output (get-buffer-create " *project grep output*")) (`(,grep-re ,file-group ,line-group . ,_) (car grep-regexp-alist)) @@ -1277,13 +1321,17 @@ FILES must be a list of absolute file names." ;; first file is remote, they all are, and on the same host. (dir (file-name-directory (car files))) (remote-id (file-remote-p dir)) - ;; 'git ls-files' can output broken symlinks. - (command (format "xargs -0 grep %s -snHE -e %s" - (if (and case-fold-search - (isearch-no-upper-case-p regexp t)) - "-i" - "") - (shell-quote-argument (xref--regexp-to-extended regexp))))) + ;; The 'auto' default would be fine too, but ripgrep can't handle + ;; the options we pass in that case. + (grep-highlight-matches nil) + (command (grep-expand-template (cdr + (or + (assoc + xref-search-program + xref-search-program-alist) + (user-error "Unknown search program `%s'" + xref-search-program))) + (xref--regexp-to-extended regexp)))) (when remote-id (require 'tramp) (setq files (mapcar commit 25df2375dbe8b8da98957876437b9b9a5c56b860 Author: Basil L. Contovounesios Date: Thu Dec 3 18:36:42 2020 +0000 ; Fix last change * lisp/gnus/nnimap.el (nnimap-split-download-body-default): Declare obsolete varalias before its referent. (nnimap-split-download-body): Add :version tag. (Bug#44981) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index e7f9451986..a860333066 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -146,16 +146,17 @@ textual parts.") :version "24.4" :group 'nnimap) +(define-obsolete-variable-alias + 'nnimap-split-download-body-default 'nnimap-split-download-body + "28.1") + (defcustom nnimap-split-download-body nil "If non-nil, make message bodies available for consideration during splitting. This requires downloading the full message from the IMAP server during splitting, which may be slow." + :version "28.1" :type 'boolean) -(define-obsolete-variable-alias - 'nnimap-split-download-body-default 'nnimap-split-download-body - "28.1") - (defvar nnimap-process nil) (defvar nnimap-status-string "") commit cff2f895c2e55161486a8011288171daae9ecccc Author: Eric Abrahamsen Date: Wed Dec 2 15:52:25 2020 -0800 Restore nnimap-split-download-body as a customization option * lisp/gnus/nnimap.el (nnimap-split-download-body): And add an obsolete alias for `nnimap-split-download-body-default'. (nnimap-fetch-inbox): Check the value of the option, not the variable. * doc/misc/gnus.texi (Client-Side IMAP Splitting): Move the primary documentation of this option to this section. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 81ce13945c..4aa07ce388 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -14521,6 +14521,14 @@ The default is @samp{(%Deleted %Seen)}. @end table +@vindex nnimap-split-download-body +By default, the nnimap back end only retrieves the message headers; +the option @code{nnimap-split-download-body} (which is a regular +customization option, not a server variable) tells it to retrieve the +message bodies as well. We don't set this by default because it will +slow @acronym{IMAP} down, and that is not an appropriate decision to +make on behalf of the user. + Here's a complete example @code{nnimap} backend with a client-side ``fancy'' splitting method: @@ -24622,13 +24630,7 @@ the value @samp{spam} means @samp{nnimap+your-server:spam}. The value Note for IMAP users: if you use the @code{spam-check-bogofilter}, @code{spam-check-ifile}, and @code{spam-check-stat} spam back ends, you should also set the variable @code{nnimap-split-download-body} to -@code{t}. These spam back ends are most useful when they can ``scan'' -the full message body. By default, the nnimap back end only retrieves -the message headers; @code{nnimap-split-download-body} tells it to -retrieve the message bodies as well. We don't set this by default -because it will slow @acronym{IMAP} down, and that is not an -appropriate decision to make on behalf of the user. @xref{Client-Side -IMAP Splitting}. +@code{t}. @xref{Client-Side IMAP Splitting}. You have to specify one or more spam back ends for @code{spam-split} to use, by setting the @code{spam-use-*} variables. @xref{Spam Back diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 7984998d21..e7f9451986 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -146,13 +146,20 @@ textual parts.") :version "24.4" :group 'nnimap) +(defcustom nnimap-split-download-body nil + "If non-nil, make message bodies available for consideration during splitting. +This requires downloading the full message from the IMAP server +during splitting, which may be slow." + :type 'boolean) + +(define-obsolete-variable-alias + 'nnimap-split-download-body-default 'nnimap-split-download-body + "28.1") + (defvar nnimap-process nil) (defvar nnimap-status-string "") -(defvar nnimap-split-download-body-default nil - "Internal variable with default value for `nnimap-split-download-body'.") - (defvar nnimap-keepalive-timer nil) (defvar nnimap-process-buffers nil) @@ -2100,7 +2107,7 @@ Return the server's response to the SELECT or EXAMINE command." "BODY.PEEK" "RFC822.PEEK")) (cond - (nnimap-split-download-body-default + (nnimap-split-download-body "[]") ((nnimap-ver4-p) "[HEADER]") commit 6ecec6096697729491ba141e7650ad69de5f034e Author: Basil L. Contovounesios Date: Fri Apr 17 10:27:36 2020 +0100 Define explicit-shell-file-name only in shell.el For discussion, see the following thread: https://lists.gnu.org/r/emacs-devel/2020-04/msg00880.html * doc/emacs/cmdargs.texi (General Variables): Mention shell-file-name in relation to SHELL. * doc/emacs/misc.texi (Interactive Shell): Move index entry for SHELL environment variable from here, where it is not mentioned... (Single Shell): ...to here, where it is discussed along with shell-file-name. * lisp/dired.el (dired-insert-directory): Use shell-file-name instead of explicit-shell-file-name when a shell is implicitly requested. * lisp/obsolete/terminal.el (explicit-shell-file-name): * lisp/term.el (explicit-shell-file-name): Remove duplicate defcustoms and load lisp/shell.el instead. (Bug#40679) * lisp/shell.el (explicit-shell-file-name): Clarify docstring. (shell): Simplify. diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 3dd1fe9a30..a828eee076 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi @@ -654,7 +654,8 @@ Used by the Gnus package. @item SHELL @vindex SHELL@r{, environment variable} The name of an interpreter used to parse and execute programs run from -inside Emacs. +inside Emacs. This is used to initialize the variable +@code{shell-file-name} (@pxref{Single Shell}). @item SMTPSERVER @vindex SMTPSERVER@r{, environment variable} The name of the outgoing mail server. This is used to initialize the diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 4865ee1751..5b5134b7c3 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -810,6 +810,7 @@ to @command{gpg}. This will output the list of keys to the buffer whose name is the value of @code{shell-command-buffer-name}. @vindex shell-file-name +@cindex @env{SHELL} environment variable The above commands use the shell specified by the variable @code{shell-file-name}. Its default value is determined by the @env{SHELL} environment variable when Emacs is started. If the file @@ -889,7 +890,6 @@ Subshells in different buffers run independently and in parallel. @vindex explicit-shell-file-name @cindex environment variables for subshells @cindex @env{ESHELL} environment variable -@cindex @env{SHELL} environment variable To specify the shell file name used by @kbd{M-x shell}, customize the variable @code{explicit-shell-file-name}. If this is @code{nil} (the default), Emacs uses the environment variable @env{ESHELL} if it diff --git a/lisp/dired.el b/lisp/dired.el index 08b19a0225..30b9f5b8fa 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1509,8 +1509,7 @@ see `dired-use-ls-dired' for more details.") (script (format "ls %s %s" switches (cdr dir-wildcard))) (remotep (file-remote-p dir)) (sh (or (and remotep "/bin/sh") - (and (bound-and-true-p explicit-shell-file-name) - (executable-find explicit-shell-file-name)) + (executable-find shell-file-name) (executable-find "sh"))) (switch (if remotep "-c" shell-command-switch))) ;; Enable globstar diff --git a/lisp/obsolete/terminal.el b/lisp/obsolete/terminal.el index 6ee53af648..3d73c030c3 100644 --- a/lisp/obsolete/terminal.el +++ b/lisp/obsolete/terminal.el @@ -44,6 +44,7 @@ ;;>> more-processing enabled. (require 'ehelp) +(require 'shell) (defgroup terminal nil "Terminal emulator for Emacs." @@ -1056,12 +1057,6 @@ move to start of new line, clear to end of line." ;; This used to have `new' in it, but that loses outside BSD ;; and it's apparently not needed in BSD. -(defcustom explicit-shell-file-name nil - "If non-nil, is file name to use for explicitly requested inferior shell." - :type '(choice (const :tag "None" nil) - file) - :group 'terminal) - ;;;###autoload (defun terminal-emulator (buffer program args &optional width height) "Under a display-terminal emulator in BUFFER, run PROGRAM on arguments ARGS. diff --git a/lisp/shell.el b/lisp/shell.el index 51937cdeef..5fed6513b9 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -265,10 +265,11 @@ see the function `dirtrack-mode'." :group 'shell-directories) (defcustom explicit-shell-file-name nil - "If non-nil, is file name to use for explicitly requested inferior shell. -When nil, such interactive shell sessions fallback to using either -the shell specified in $ESHELL or in `shell-file-name'." - :type '(choice (const :tag "None" nil) file) + "If non-nil, the file name to use for explicitly requested inferior shells. +When nil, such interactive shell sessions fall back to using the +shell specified in either the environment variable \"ESHELL\" or +`shell-file-name'." + :type '(choice (const :tag "Default" nil) file) :group 'shell) ;; Note: There are no explicit references to the variable `explicit-csh-args'. @@ -748,16 +749,15 @@ Make the shell buffer the current buffer, and return it. (with-connection-local-variables ;; On remote hosts, the local `shell-file-name' might be useless. - (when (file-remote-p default-directory) - (if (and (called-interactively-p 'any) + (when (and (file-remote-p default-directory) + (called-interactively-p 'any) (null explicit-shell-file-name) (null (getenv "ESHELL"))) - (set (make-local-variable 'explicit-shell-file-name) - (file-local-name - (expand-file-name - (read-file-name - "Remote shell path: " default-directory shell-file-name - t shell-file-name)))))) + (setq-local explicit-shell-file-name + (file-local-name + (expand-file-name + (read-file-name "Remote shell path: " default-directory + shell-file-name t shell-file-name))))) ;; Rain or shine, BUFFER must be current by now. (unless (comint-check-proc buffer) diff --git a/lisp/term.el b/lisp/term.el index 148d7a7c28..34dc2870f2 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -299,17 +299,13 @@ ;; so it is important to increase it if there are protocol-relevant changes. (defconst term-protocol-version "0.96") -(eval-when-compile (require 'ange-ftp)) -(eval-when-compile (require 'cl-lib)) -(require 'ring) -(require 'ehelp) +(eval-when-compile + (require 'ange-ftp) + (require 'cl-lib)) (require 'comint) ; Password regexp. - -(declare-function ring-empty-p "ring" (ring)) -(declare-function ring-ref "ring" (ring index)) -(declare-function ring-insert-at-beginning "ring" (ring item)) -(declare-function ring-length "ring" (ring)) -(declare-function ring-insert "ring" (ring item)) +(require 'ehelp) +(require 'ring) +(require 'shell) (defgroup term nil "General command interpreter in a window." @@ -393,11 +389,6 @@ by moving term-home-marker. It is set to t if there is a (defvar-local term-line-mode-buffer-read-only nil "The `buffer-read-only' state to set in `term-line-mode'.") -(defcustom explicit-shell-file-name nil - "If non-nil, is file name to use for explicitly requested inferior shell." - :type '(choice (const nil) file) - :group 'term) - (defvar term-prompt-regexp "^" "Regexp to recognize prompts in the inferior process. Defaults to \"^\", the null string at BOL. commit 55300e6cdc9b33b52cf17fe64a8ffbb6dce7ae8f Author: Stefan Kangas Date: Thu Dec 3 17:08:28 2020 +0100 Add tests for several byte-compiler warnings * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp/warn-autoload-not-on-top-level\.el) (bytecomp/warn-callargs\.el) (bytecomp/warn-defcustom-nogroup\.el) (bytecomp/warn-defcustom-notype\.el) (bytecomp/warn-defvar-lacks-prefix\.el) (bytecomp/warn-format\.el) (bytecomp/warn-lambda-malformed-interactive-spec\.el) (bytecomp/warn-make-variable-buffer-local\.el) (bytecomp/warn-redefine-defun-as-macro\.el) (bytecomp/warn-redefine-defun\.el) (bytecomp/warn-redefine-macro-as-defun\.el) (bytecomp/warn-save-excursion\.el) (bytecomp/warn-variable-let-bind-constant\.el) (bytecomp/warn-variable-let-bind-nonvariable\.el) (bytecomp/warn-variable-set-constant\.el) (bytecomp/warn-variable-set-nonvariable\.el): New tests. * test/lisp/emacs-lisp/bytecomp-resources/warn-autoload-not-on-top-level.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-callargs.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-defcustom-nogroup.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-defcustom-notype.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-defvar-lacks-prefix.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-format.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-lambda-malformed-interactive-spec.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-make-variable-buffer-local.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-defun-as-macro.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-defun.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-macro-as-defun.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-save-excursion.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-variable-let-bind-constant.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-variable-let-bind-nonvariable.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-constant.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el: * test/lisp/emacs-lisp/bytecomp-tests.el: New files. diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-autoload-not-on-top-level.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-autoload-not-on-top-level.el new file mode 100644 index 0000000000..f193130c6c --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-autoload-not-on-top-level.el @@ -0,0 +1,3 @@ +;;; -*- lexical-binding: t -*- +(defun foo () + (autoload 'bar "baz" nil nil 'macro)) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-callargs.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-callargs.el new file mode 100644 index 0000000000..687add380b --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-callargs.el @@ -0,0 +1,5 @@ +;;; -*- lexical-binding: t -*- +(defun foo (_x) + nil) +(defun bar () + (foo 1 2)) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-defcustom-nogroup.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-defcustom-nogroup.el new file mode 100644 index 0000000000..a67d4f041f --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-defcustom-nogroup.el @@ -0,0 +1,3 @@ +;;; -*- lexical-binding: t -*- +(defcustom foo nil + :type 'boolean) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-defcustom-notype.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-defcustom-notype.el new file mode 100644 index 0000000000..c15ab9b192 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-defcustom-notype.el @@ -0,0 +1,3 @@ +;;; -*- lexical-binding: t -*- +(defcustom foo nil + :group 'emacs) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-defvar-lacks-prefix.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-defvar-lacks-prefix.el new file mode 100644 index 0000000000..9f3cbb9890 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-defvar-lacks-prefix.el @@ -0,0 +1,2 @@ +;;; -*- lexical-binding: t -*- +(defvar foo nil) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-format.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-format.el new file mode 100644 index 0000000000..a1902bc03b --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-format.el @@ -0,0 +1,2 @@ +;;; -*- lexical-binding: t -*- +(message "%s" 1 2) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-lambda-malformed-interactive-spec.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-lambda-malformed-interactive-spec.el new file mode 100644 index 0000000000..6bd902705e --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-lambda-malformed-interactive-spec.el @@ -0,0 +1,4 @@ +;;; -*- lexical-binding: t -*- +(defun foo () + (interactive "foo" "bar") + nil) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-make-variable-buffer-local.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-make-variable-buffer-local.el new file mode 100644 index 0000000000..aa1e6c0463 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-make-variable-buffer-local.el @@ -0,0 +1,4 @@ +;;; -*- lexical-binding: t -*- +(defvar foobar) +(defun foo () + (make-variable-buffer-local 'foobar)) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-defun-as-macro.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-defun-as-macro.el new file mode 100644 index 0000000000..6bd239b659 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-defun-as-macro.el @@ -0,0 +1,3 @@ +;;; -*- lexical-binding: t -*- +(defun foo () nil) +(defmacro foo () t) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-defun.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-defun.el new file mode 100644 index 0000000000..53e4c0ac8d --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-defun.el @@ -0,0 +1,3 @@ +;;; -*- lexical-binding: t -*- +(defun foo () nil) +(defun foo () t) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-macro-as-defun.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-macro-as-defun.el new file mode 100644 index 0000000000..f71ae44561 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-redefine-macro-as-defun.el @@ -0,0 +1,3 @@ +;;; -*- lexical-binding: t -*- +(defmacro foo () t) +(defun foo () nil) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-save-excursion.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-save-excursion.el new file mode 100644 index 0000000000..3818545719 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-save-excursion.el @@ -0,0 +1,5 @@ +;;; -*- lexical-binding: t -*- +(defun foo () + (save-excursion + (set-buffer (current-buffer)) + nil)) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-let-bind-constant.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-let-bind-constant.el new file mode 100644 index 0000000000..cc1fb57257 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-let-bind-constant.el @@ -0,0 +1,3 @@ +;;; -*- lexical-binding: t -*- +(defun foo () + (let ((t 1)) t)) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-let-bind-nonvariable.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-let-bind-nonvariable.el new file mode 100644 index 0000000000..dde2dcee6e --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-let-bind-nonvariable.el @@ -0,0 +1,3 @@ +;;; -*- lexical-binding: t -*- +(defun foo () + (let (('t 1)) t)) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-constant.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-constant.el new file mode 100644 index 0000000000..2fc0680cfa --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-constant.el @@ -0,0 +1,3 @@ +;;; -*- lexical-binding: t -*- +(defun foo () + (setq t nil)) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el new file mode 100644 index 0000000000..0c76c4d388 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el @@ -0,0 +1,3 @@ +;;; -*- lexical-binding: t -*- +(defun foo () + (set '(a) nil)) diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index 7ed9021736..8fa4d278f1 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -567,12 +567,39 @@ Subtests signal errors if something goes wrong." (bytecomp--define-warning-file-test "error-lexical-var-with-symbol-value.el" "symbol-value.*lexical var") +(bytecomp--define-warning-file-test "warn-autoload-not-on-top-level.el" + "compiler ignores.*autoload.*") + +(bytecomp--define-warning-file-test "warn-callargs.el" + "with 2 arguments, but accepts only 1") + +(bytecomp--define-warning-file-test "warn-defcustom-nogroup.el" + "fails to specify containing group") + +(bytecomp--define-warning-file-test "warn-defcustom-notype.el" + "fails to specify type") + +(bytecomp--define-warning-file-test "warn-defvar-lacks-prefix.el" + "var.*foo.*lacks a prefix") + +(bytecomp--define-warning-file-test "warn-format.el" + "called with 2 args to fill 1 format field") + (bytecomp--define-warning-file-test "warn-free-setq.el" "free.*foo") (bytecomp--define-warning-file-test "warn-free-variable-reference.el" "free.*bar") +(bytecomp--define-warning-file-test "warn-make-variable-buffer-local.el" + "make-variable-buffer-local.*not called at toplevel") + +(bytecomp--define-warning-file-test "warn-interactive-only.el" + "next-line.*interactive use only.*forward-line") + +(bytecomp--define-warning-file-test "warn-lambda-malformed-interactive-spec.el" + "malformed interactive spec") + (bytecomp--define-warning-file-test "warn-obsolete-defun.el" "foo-obsolete.*obsolete function.*99.99") @@ -588,8 +615,29 @@ Subtests signal errors if something goes wrong." (bytecomp--define-warning-file-test "warn-obsolete-variable.el" "bytecomp--tests-obs.*obsolete.*99.99") -(bytecomp--define-warning-file-test "warn-interactive-only.el" - "next-line.*interactive use only.*forward-line") +(bytecomp--define-warning-file-test "warn-redefine-defun-as-macro.el" + "as both function and macro") + +(bytecomp--define-warning-file-test "warn-redefine-macro-as-defun.el" + "as both function and macro") + +(bytecomp--define-warning-file-test "warn-redefine-defun.el" + "defined multiple") + +(bytecomp--define-warning-file-test "warn-save-excursion.el" + "with-current.*rather than save-excursion") + +(bytecomp--define-warning-file-test "warn-variable-let-bind-constant.el" + "let-bind constant") + +(bytecomp--define-warning-file-test "warn-variable-let-bind-nonvariable.el" + "let-bind nonvariable") + +(bytecomp--define-warning-file-test "warn-variable-set-constant.el" + "variable reference to constant") + +(bytecomp--define-warning-file-test "warn-variable-set-nonvariable.el" + "variable reference to nonvariable") ;;;; Macro expansion. commit 805d82197f050d1aba8fb796e604c55ce3d6333a Author: Basil L. Contovounesios Date: Mon Nov 16 14:40:57 2020 +0000 Avoid spamming view-mode-enter help message By default, entering view-mode echoes a usage message. This is particularly helpful with non-nil view-read-only, to notify the user that view-mode has been enabled. It is less useful and more spammy, however, if view-mode is (possibly inadvertently) entered from some non-interactive code running in the background, such as when a major mode is enabled in a temporary buffer for text formatting purposes (bug#44629). * lisp/jsonrpc.el (jsonrpc-events-buffer, initialize-instance): Use buffer-read-only in place of read-only-mode for non-interactive use. * lisp/view.el (view-mode-enter): Inhibit help message if either view-inhibit-help-message is non-nil, or view-mode-enter was called from an interactive command. Suggested by João Távora . diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index 0b3394080c..1aebeae5e1 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -138,18 +138,15 @@ immediately." (defun jsonrpc-events-buffer (connection) "Get or create JSONRPC events buffer for CONNECTION." - (let* ((probe (jsonrpc--events-buffer connection)) - (buffer (or (and (buffer-live-p probe) - probe) - (let ((buffer (get-buffer-create - (format "*%s events*" - (jsonrpc-name connection))))) - (with-current-buffer buffer - (buffer-disable-undo) - (read-only-mode t) - (setf (jsonrpc--events-buffer connection) buffer)) - buffer)))) - buffer)) + (let ((probe (jsonrpc--events-buffer connection))) + (if (buffer-live-p probe) + probe + (with-current-buffer + (get-buffer-create (format "*%s events*" (jsonrpc-name connection))) + (buffer-disable-undo) + (setq buffer-read-only t) + (setf (jsonrpc--events-buffer connection) + (current-buffer)))))) (defun jsonrpc-forget-pending-continuations (connection) "Stop waiting for responses from the current JSONRPC CONNECTION." @@ -406,7 +403,7 @@ connection object, called when the process dies .") (ignore-errors (kill-buffer hidden-name)) (rename-buffer hidden-name) (process-put proc 'jsonrpc-stderr (current-buffer)) - (read-only-mode t)))) + (setq buffer-read-only t)))) (setf (jsonrpc--process conn) proc) (set-process-buffer proc (get-buffer-create (format " *%s output*" name))) (set-process-filter proc #'jsonrpc--process-filter) @@ -414,7 +411,9 @@ connection object, called when the process dies .") (with-current-buffer (process-buffer proc) (buffer-disable-undo) (set-marker (process-mark proc) (point-min)) - (let ((inhibit-read-only t)) (erase-buffer) (read-only-mode t))) + (let ((inhibit-read-only t)) + (erase-buffer)) + (setq buffer-read-only t)) (process-put proc 'jsonrpc-connection conn))) (cl-defmethod jsonrpc-connection-send ((connection jsonrpc-process-connection) diff --git a/lisp/view.el b/lisp/view.el index 204e28c2a2..6f576f8c04 100644 --- a/lisp/view.el +++ b/lisp/view.el @@ -88,7 +88,9 @@ the selected window is considered for restoring." :group 'view) (defcustom view-inhibit-help-message nil - "Non-nil inhibits the help message shown upon entering View mode." + "Non-nil inhibits the help message shown upon entering View mode. +This setting takes effect only when View mode is entered via an +interactive command; otherwise the help message is not shown." :type 'boolean :group 'view :version "22.1") @@ -559,7 +561,10 @@ This function runs the normal hook `view-mode-hook'." (unless view-mode (view-mode 1) - (unless view-inhibit-help-message + (when (and (not view-inhibit-help-message) + ;; Avoid spamming the echo area if `view-mode' is entered + ;; non-interactively, e.g., in a temporary buffer (bug#44629). + this-command) (message "%s" (substitute-command-keys "\ View mode: type \\[help-command] for help, \\[describe-mode] for commands, \\[View-quit] to quit."))))) commit 62fa6d19b3a43296119131fa3d3bad1704b6884c Author: Michael Albinus Date: Thu Dec 3 15:58:40 2020 +0100 Fix auto-revert-test07-auto-revert-several-buffers * test/lisp/autorevert-tests.el (auto-revert-test07-auto-revert-several-buffers): Adapt times values. diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el index f59a847e35..84f87003fc 100644 --- a/test/lisp/autorevert-tests.el +++ b/test/lisp/autorevert-tests.el @@ -589,7 +589,7 @@ This expects `auto-revert--messages' to be bound by ;; (with-auto-revert-test (let ((auto-revert-use-notify t) (tmpfile (make-temp-file "auto-revert-test")) - (times '(60 30 15)) + (times '(120 60 30 15)) (num-buffers 10) require-final-newline buffers) commit a4c27ceb50daea3488517cc729350e734484649f Author: Spencer Baugh Date: Thu Dec 3 15:57:20 2020 +0100 Improve performance of auto-revert-notify-add-watch * lisp/autorevert.el (auto-revert-notify-add-watch): Do not search for buffers registered with the same file name, this is not necessary. (Bug#44638) diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 046ea2b5d6..d5bb75c2f1 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -650,30 +650,15 @@ will use an up-to-date value of `auto-revert-interval'." (string-match auto-revert-notify-exclude-dir-regexp (expand-file-name default-directory)) (file-symlink-p (or buffer-file-name default-directory))) - ;; Check, whether this has been activated already. (let ((file (if buffer-file-name (expand-file-name buffer-file-name default-directory) (expand-file-name default-directory)))) - (maphash - (lambda (key _value) - (when (and - (file-notify-valid-p key) - (equal (file-notify--watch-absolute-filename - (gethash key file-notify-descriptors)) - (directory-file-name file)) - (equal (file-notify--watch-callback - (gethash key file-notify-descriptors)) - 'auto-revert-notify-handler)) - (setq auto-revert-notify-watch-descriptor key))) - auto-revert--buffers-by-watch-descriptor) - ;; Create a new watch if needed. - (unless auto-revert-notify-watch-descriptor - (setq auto-revert-notify-watch-descriptor - (ignore-errors - (file-notify-add-watch - file - (if buffer-file-name '(change attribute-change) '(change)) - 'auto-revert-notify-handler)))) + (setq auto-revert-notify-watch-descriptor + (ignore-errors + (file-notify-add-watch + file + (if buffer-file-name '(change attribute-change) '(change)) + 'auto-revert-notify-handler)))) (when auto-revert-notify-watch-descriptor (setq auto-revert-notify-modified-p t) (puthash @@ -682,7 +667,7 @@ will use an up-to-date value of `auto-revert-interval'." (gethash auto-revert-notify-watch-descriptor auto-revert--buffers-by-watch-descriptor)) auto-revert--buffers-by-watch-descriptor) - (add-hook 'kill-buffer-hook #'auto-revert-notify-rm-watch nil t))))) + (add-hook 'kill-buffer-hook #'auto-revert-notify-rm-watch nil t)))) ;; If we have file notifications, we want to update the auto-revert buffers ;; immediately when a notification occurs. Since file updates can happen very commit 9b2e5b230156fa871f48fd5788e76dd9d33c059c Author: Stefan Kangas Date: Wed Dec 2 15:56:54 2020 +0100 Remove redundant requires of 'help' * lisp/emacs-lisp/advice.el (ad-read-advised-function): * lisp/emacs-lisp/ert.el: * lisp/facemenu.el: Don't require 'help'; it is preloaded since version 18.59. diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index 948443fc18..c8a6676b66 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -1840,8 +1840,7 @@ function at point for which PREDICATE returns non-nil)." (or default ;; Prefer func name at point, if it's an advised function etc. (let ((function (progn - (require 'help) - (function-called-at-point)))) + (function-called-at-point)))) (and function (member (symbol-name function) ad-advised-functions) (or (null predicate) diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 7442a247f9..e5ac1d1f1c 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -63,7 +63,6 @@ (require 'easymenu) (require 'ewoc) (require 'find-func) -(require 'help) (require 'pp) ;;; UI customization options. diff --git a/lisp/facemenu.el b/lisp/facemenu.el index e7f3f7bb03..cdff4b8f3e 100644 --- a/lisp/facemenu.el +++ b/lisp/facemenu.el @@ -85,9 +85,6 @@ ;;; Code: -(eval-when-compile - (require 'help)) - ;; Global bindings: (define-key global-map [C-down-mouse-2] 'facemenu-menu) (define-key global-map "\M-o" 'facemenu-keymap) commit fddf68cd81002817bde016578db6bf0e4b11717f Author: Stefan Kangas Date: Wed Dec 2 15:49:56 2020 +0100 Remove redundant requires of 'button' * lisp/apropos.el: * lisp/emacs-lisp/cl-print.el: * lisp/emacs-lisp/debug.el: * lisp/emacs-lisp/ert.el: * lisp/emacs-lisp/shadow.el: * lisp/facemenu.el: * lisp/help-mode.el: * lisp/man.el: * lisp/progmodes/etags.el: * lisp/textmodes/bibtex.el: * lisp/woman.el: Don't require 'button'; it is preloaded since version 23.1. diff --git a/lisp/apropos.el b/lisp/apropos.el index 9debdfb19c..595db1d2f8 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -56,8 +56,6 @@ ;;; Code: -(require 'button) - (defgroup apropos nil "Apropos commands for users and programmers." :group 'help diff --git a/lisp/emacs-lisp/cl-print.el b/lisp/emacs-lisp/cl-print.el index 1043cf7b17..0375c57f77 100644 --- a/lisp/emacs-lisp/cl-print.el +++ b/lisp/emacs-lisp/cl-print.el @@ -33,8 +33,6 @@ ;;; Code: -(require 'button) - (defvar cl-print-readably nil "If non-nil, try and make sure the result can be `read'.") diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 0e4135b253..11ef836563 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -29,7 +29,6 @@ (require 'cl-lib) (require 'backtrace) -(require 'button) (defgroup debugger nil "Debuggers and related commands for Emacs." diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index baa04f2c6a..7442a247f9 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -58,7 +58,6 @@ ;;; Code: (require 'cl-lib) -(require 'button) (require 'debug) (require 'backtrace) (require 'easymenu) diff --git a/lisp/emacs-lisp/shadow.el b/lisp/emacs-lisp/shadow.el index dd614dd792..f1863869dd 100644 --- a/lisp/emacs-lisp/shadow.el +++ b/lisp/emacs-lisp/shadow.el @@ -183,7 +183,6 @@ See the documentation for `list-load-path-shadows' for further information." buffer-read-only t)) ;; TODO use text-properties instead, a la dired. -(require 'button) (define-button-type 'load-path-shadows-find-file 'follow-link t ;; 'face 'default diff --git a/lisp/facemenu.el b/lisp/facemenu.el index 3ed4b54d22..e7f3f7bb03 100644 --- a/lisp/facemenu.el +++ b/lisp/facemenu.el @@ -86,8 +86,7 @@ ;;; Code: (eval-when-compile - (require 'help) - (require 'button)) + (require 'help)) ;; Global bindings: (define-key global-map [C-down-mouse-2] 'facemenu-menu) diff --git a/lisp/help-mode.el b/lisp/help-mode.el index f0770fb660..732e6cc28d 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -29,7 +29,6 @@ ;;; Code: -(require 'button) (require 'cl-lib) (eval-when-compile (require 'easymenu)) diff --git a/lisp/man.el b/lisp/man.el index 07af5ea0ff..991b1bb60e 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -90,7 +90,6 @@ (require 'ansi-color) (require 'cl-lib) -(require 'button) (defgroup man nil "Browse UNIX manual pages." diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 8879726ad5..104d889b8b 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -34,7 +34,6 @@ ;; prefixes but somewhere within the name. (require 'ring) -(require 'button) (require 'xref) (require 'fileloop) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 4dc68c4004..77fc6990d9 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -40,8 +40,6 @@ ;;; Code: -(require 'button) - ;; User Options: diff --git a/lisp/woman.el b/lisp/woman.el index 96ae7fe579..33a6a0dfbd 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -404,7 +404,6 @@ (make-obsolete-variable 'woman-version nil "28.1") (require 'man) -(require 'button) (define-button-type 'WoMan-xref-man-page :supertype 'Man-abstract-xref-man-page 'func (lambda (arg) commit 4b25ffd3b8ffb854c2458efc4914829ead9a0f79 Author: Lars Ingebrigtsen Date: Thu Dec 3 11:18:45 2020 +0100 Fix "grep foo bar" in eshell * lisp/eshell/em-unix.el (eshell-grep): Use the -H switch so that we always get the file name, so that `M-x next-error' and friends work (bug#22330). diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 153000438e..c66f307bfe 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -754,7 +754,7 @@ external command." (eshell-stringify-list (flatten-tree args))) " ")) - (cmd (format "%s -n %s" + (cmd (format "%s -nH %s" (pcase command ("egrep" "grep -E") ("fgrep" "grep -F") commit 6422750b4f8cbc7d1da49b72873deeb18390e379 Author: Lars Ingebrigtsen Date: Thu Dec 3 11:11:46 2020 +0100 Don't make grep arguments invisible in eshell * lisp/eshell/em-unix.el (eshell-grep): There doesn't seem to be any reason why parts of the command should be invisible, so don't do that. diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 18818648bc..153000438e 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -754,15 +754,12 @@ external command." (eshell-stringify-list (flatten-tree args))) " ")) - (cmd (progn - (set-text-properties 0 (length args) - '(invisible t) args) - (format "%s -n %s" - (pcase command - ("egrep" "grep -E") - ("fgrep" "grep -F") - (x x)) - args))) + (cmd (format "%s -n %s" + (pcase command + ("egrep" "grep -E") + ("fgrep" "grep -F") + (x x)) + args)) compilation-scroll-output) (grep cmd))))) commit 3e6eccc175489bec69bcdb0adc9ab12090116b79 Author: Lars Ingebrigtsen Date: Thu Dec 3 10:21:15 2020 +0100 Recompute error positions in python-shell-send-region * lisp/progmodes/python.el (python-shell-send-region): Recompute line positions when evaluating (bug#22934). diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 091456aa89..e9c3b3986a 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3197,6 +3197,8 @@ the python shell: (line-beginning-position) (line-end-position)))) (buffer-substring-no-properties (point-min) (point-max))))) +(declare-function compilation-forget-errors "compile") + (defun python-shell-send-region (start end &optional send-main msg no-cookie) "Send the region delimited by START and END to inferior Python process. @@ -3214,6 +3216,10 @@ process running; defaults to t when called interactively." (original-string (buffer-substring-no-properties start end)) (_ (string-match "\\`\n*\\(.*\\)" original-string))) (message "Sent: %s..." (match-string 1 original-string)) + ;; Recalculate positions to avoid landing on the wrong line if + ;; lines have been removed/added. + (with-current-buffer (process-buffer process) + (compilation-forget-errors)) (python-shell-send-string string process))) (defun python-shell-send-statement (&optional send-main msg) commit 4594d6f59a0f0c229ded9874a38ae5acf9fe5647 Author: Stefan Kangas Date: Thu Dec 3 09:50:58 2020 +0100 Remove redundant requires of 'custom' * lisp/emacs-lisp/eieio-custom.el: * lisp/htmlfontify.el: * lisp/mwheel.el: * lisp/net/eudc-vars.el: * lisp/net/ldap.el: * lisp/net/tramp-ftp.el: * lisp/net/tramp-gvfs.el: * lisp/progmodes/cwarn.el: * lisp/progmodes/sql.el: * lisp/savehist.el: * lisp/textmodes/reftex.el: * lisp/wid-browse.el: Don't require 'custom'; it is preloaded since version 20.1. diff --git a/lisp/emacs-lisp/eieio-custom.el b/lisp/emacs-lisp/eieio-custom.el index e26dc9e9a9..3a9d8672e4 100644 --- a/lisp/emacs-lisp/eieio-custom.el +++ b/lisp/emacs-lisp/eieio-custom.el @@ -33,7 +33,6 @@ (require 'eieio) (require 'widget) (require 'wid-edit) -(require 'custom) ;;; Compatibility diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index 4977e08c3d..c9ede657f5 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -78,8 +78,6 @@ ;;; Code: (eval-when-compile (require 'cl-lib)) -(require 'custom) -;; (`defgroup' `defcustom') (require 'cus-edit) (require 'htmlfontify-loaddefs) diff --git a/lisp/mwheel.el b/lisp/mwheel.el index 1d9fe68075..9fd050fea5 100644 --- a/lisp/mwheel.el +++ b/lisp/mwheel.el @@ -37,7 +37,6 @@ ;; 'mwheel-down', but I cannot find a way to do this very easily (or ;; portably), so for now I just live with it. -(require 'custom) (require 'timer) (defvar mouse-wheel-mode) diff --git a/lisp/net/eudc-vars.el b/lisp/net/eudc-vars.el index bb1474b8b5..2306d7b99a 100644 --- a/lisp/net/eudc-vars.el +++ b/lisp/net/eudc-vars.el @@ -27,8 +27,6 @@ ;;; Code: -(require 'custom) - ;;{{{ EUDC Main Custom Group (defgroup eudc nil diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el index 5639d52f81..0016af292e 100644 --- a/lisp/net/ldap.el +++ b/lisp/net/ldap.el @@ -33,7 +33,6 @@ ;;; Code: -(require 'custom) (require 'password-cache) (autoload 'auth-source-search "auth-source") diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el index 996a92454f..329a490c7a 100644 --- a/lisp/net/tramp-ftp.el +++ b/lisp/net/tramp-ftp.el @@ -31,7 +31,6 @@ (require 'tramp) ;; Pacify byte-compiler. -(eval-when-compile (require 'custom)) (defvar ange-ftp-ftp-name-arg) (defvar ange-ftp-ftp-name-res) (defvar ange-ftp-name-format) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 7970488b40..f3d03d0fb0 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -108,8 +108,6 @@ (require 'url-util) ;; Pacify byte-compiler. -(eval-when-compile (require 'custom)) - (declare-function zeroconf-init "zeroconf") (declare-function zeroconf-list-service-types "zeroconf") (declare-function zeroconf-list-services "zeroconf") diff --git a/lisp/progmodes/cwarn.el b/lisp/progmodes/cwarn.el index 0571739344..b09a2ed786 100644 --- a/lisp/progmodes/cwarn.el +++ b/lisp/progmodes/cwarn.el @@ -104,7 +104,6 @@ ;;{{{ Dependencies -(require 'custom) (require 'cc-mode) ;;}}} diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 22099394ff..0bf9a517aa 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -232,7 +232,6 @@ (require 'cl-lib) (require 'comint) -(require 'custom) (require 'thingatpt) (require 'view) (eval-when-compile (require 'subr-x)) ; string-empty-p diff --git a/lisp/savehist.el b/lisp/savehist.el index 5d20239d17..8931e83243 100644 --- a/lisp/savehist.el +++ b/lisp/savehist.el @@ -47,8 +47,6 @@ ;;; Code: -(require 'custom) - ;; User variables (defgroup savehist nil diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index 29ebab5f9b..b1fa79ae2a 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el @@ -51,10 +51,6 @@ ;;; Code: (eval-when-compile (require 'cl-lib)) - -;; Stuff that needs to be there when we use defcustom -(require 'custom) - (require 'easymenu) (defvar reftex-tables-dirty t diff --git a/lisp/wid-browse.el b/lisp/wid-browse.el index f5c3d486f4..bc2e3c4c12 100644 --- a/lisp/wid-browse.el +++ b/lisp/wid-browse.el @@ -28,7 +28,6 @@ ;;; Code: (require 'easymenu) -(require 'custom) (require 'wid-edit) (defgroup widget-browse nil commit cf90856946827d6a5c87c6e79e312fdd0becf899 Author: Stefan Kangas Date: Thu Dec 3 08:51:15 2020 +0100 Remove redundant requires of 'font-core' * lisp/ibuffer.el: * test/lisp/erc/erc-track-tests.el: Don't require 'font-core'; it is preloaded since version 22.1. diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 8ff3b56c5e..00ba868d78 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -48,7 +48,6 @@ (require 'ibuf-macs) (require 'dired)) -(require 'font-core) (require 'seq) (require 'ibuffer-loaddefs) diff --git a/test/lisp/erc/erc-track-tests.el b/test/lisp/erc/erc-track-tests.el index 457f08cb73..41240947bc 100644 --- a/test/lisp/erc/erc-track-tests.el +++ b/test/lisp/erc/erc-track-tests.el @@ -24,7 +24,6 @@ (require 'ert) (require 'erc-track) -(require 'font-core) (ert-deftest erc-track--shorten-aggressive-nil () "Test non-aggressive erc track buffer name shortening." commit 0a4aa2894297c0fd9e735328bbb60b427e0ba5d4 Author: Stefan Kangas Date: Thu Dec 3 08:50:14 2020 +0100 Remove redundant requires of 'font-lock' * lisp/cedet/data-debug.el: * lisp/hi-lock.el: * lisp/htmlfontify.el: * lisp/org/org.el: * lisp/progmodes/cperl-mode.el: * lisp/progmodes/cwarn.el: Don't require 'font-lock'; it is preloaded since version 22.1. diff --git a/lisp/cedet/data-debug.el b/lisp/cedet/data-debug.el index 44cce389cb..54b9024ebe 100644 --- a/lisp/cedet/data-debug.el +++ b/lisp/cedet/data-debug.el @@ -42,7 +42,6 @@ ;; (data-debug-show-stuff stuff "myStuff")) ;; stuff)) -(require 'font-lock) (require 'ring) ;;; Code: diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index 536a1af846..51887b702c 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -87,8 +87,6 @@ ;;; Code: -(require 'font-lock) - (defgroup hi-lock nil "Interactively add and remove font-lock patterns for highlighting text." :link '(custom-manual "(emacs)Highlight Interactively") diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index 6a2ed3aee9..4977e08c3d 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -80,8 +80,6 @@ (eval-when-compile (require 'cl-lib)) (require 'custom) ;; (`defgroup' `defcustom') -(require 'font-lock) -;; (`font-lock-fontify-region') (require 'cus-edit) (require 'htmlfontify-loaddefs) diff --git a/lisp/org/org.el b/lisp/org/org.el index de7dded158..5dc9fa9d8d 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -5004,8 +5004,6 @@ the rounding returns a past time." ;;;; Font-Lock stuff, including the activators -(require 'font-lock) - (defconst org-match-sexp-depth 3 "Number of stacked braces for sub/superscript matching.") diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 20b2360258..48f0a34880 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -5457,7 +5457,6 @@ indentation and initial hashes. Behaves usually outside of comment." (defun cperl-init-faces () (condition-case errs (progn - (require 'font-lock) (let (t-font-lock-keywords t-font-lock-keywords-1 font-lock-anchored) (setq font-lock-anchored t) (setq diff --git a/lisp/progmodes/cwarn.el b/lisp/progmodes/cwarn.el index 6e84f4f1bc..0571739344 100644 --- a/lisp/progmodes/cwarn.el +++ b/lisp/progmodes/cwarn.el @@ -105,7 +105,6 @@ ;;{{{ Dependencies (require 'custom) -(require 'font-lock) (require 'cc-mode) ;;}}} commit a3b596d02ec802f6215af8f552b29cceea6f7eeb Author: Roland Winkler Date: Wed Dec 2 15:08:25 2020 -0600 bibtex-autokey-get-year: Allow both a year or date field. * lisp/textmodes/bibtex.el (bibtex-text-in-field): Allow arg field to be a list of fields. (bibtex-autokey-get-year): Look for year and date field. Allow the extended date format used by biblatex. diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 38fea32d2e..4dc68c4004 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -1940,18 +1940,22 @@ If `bibtex-expand-strings' is non-nil, also expand BibTeX strings." (bibtex-end-of-text-in-field bounds)))) (defun bibtex-text-in-field (field &optional follow-crossref) - "Get content of field FIELD of current BibTeX entry. -Return nil if not found. + "Return content of field FIELD of current BibTeX entry or nil if not found. +FIELD may also be a list of fields that are tried in order. If optional arg FOLLOW-CROSSREF is non-nil, follow crossref." (save-excursion - (let* ((end (if follow-crossref (bibtex-end-of-entry) t)) - (beg (bibtex-beginning-of-entry)) ; move point - (bounds (bibtex-search-forward-field field end))) + (let ((end (if (and (not follow-crossref) (stringp field)) + t ; try to minimize parsing + (bibtex-end-of-entry))) + bounds) + (bibtex-beginning-of-entry) ; move point + (let ((field (if (stringp field) (list field) field))) + (while (and field (not bounds)) + (setq bounds (bibtex-search-forward-field (pop field) end)))) (cond (bounds (bibtex-text-in-field-bounds bounds t)) ((and follow-crossref - (progn (goto-char beg) - (setq bounds (bibtex-search-forward-field - "\\(OPT\\)?crossref" end)))) + (setq bounds (bibtex-search-forward-field + "\\(OPT\\)?crossref" end))) (let ((crossref-field (bibtex-text-in-field-bounds bounds t))) (if (bibtex-search-crossref crossref-field) ;; Do not pass FOLLOW-CROSSREF because we want @@ -2689,6 +2693,7 @@ is returned unchanged." (defun bibtex-autokey-get-field (field &optional change-list) "Get content of BibTeX field FIELD. Return empty string if not found. +FIELD may also be a list of fields that are tried in order. Optional arg CHANGE-LIST is a list of substitution patterns that is applied to the content of FIELD. It is an alist with pairs \(OLD-REGEXP . NEW-STRING)." @@ -2757,7 +2762,10 @@ and `bibtex-autokey-names-stretch'." (defun bibtex-autokey-get-year () "Return year field contents as a string obeying `bibtex-autokey-year-length'." - (let ((yearfield (bibtex-autokey-get-field "year"))) + (let ((yearfield (bibtex-autokey-get-field '("year" "date")))) + ;; biblatex date field has format yyyy-mm-dd + (if (< 4 (length yearfield)) + (setq yearfield (substring yearfield 0 4))) (substring yearfield (max 0 (- (length yearfield) bibtex-autokey-year-length))))) @@ -3627,7 +3635,7 @@ and `bibtex-user-optional-fields'." optional (nth 4 e-list))) (if bibtex-include-OPTkey (push (list "key" - "Used for reference key creation if author and editor fields are missing" + "Crossref key" (if (or (stringp bibtex-include-OPTkey) (functionp bibtex-include-OPTkey)) bibtex-include-OPTkey)) commit 40f42945ed1ee76c16ee4c58c7f37a412a3aa407 Author: Roland Winkler Date: Wed Dec 2 13:51:35 2020 -0600 bibtex-mode: do not fail when local variables are disabled * lisp/textmodes/bibtex.el (bibtex-mode): Check if enable-local-variables is non-nil (bug#37957). diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index a6c5f637f3..38fea32d2e 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -3483,7 +3483,7 @@ if that value is non-nil. (make-string (+ bibtex-entry-offset bibtex-contline-indentation) ?\s))))) - (if buffer-file-name + (if (and buffer-file-name enable-local-variables) (add-hook 'hack-local-variables-hook fun nil t) (funcall fun)))) commit d9167d940ac9d0504cc38a044c7cba897c103eaf Author: Roland Winkler Date: Wed Dec 2 12:33:08 2020 -0600 Allow bibtex-contline-indentation as file-local variable. * lisp/textmodes/bibtex.el (bibtex-contline-indentation) (bibtex-comment-start, bibtex-entry-offset, bibtex-text-indentation): Add :safe attribute. (bibtex-mode): Allow these variables as file-local variables (bug#44618 and bug#44647). diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 001941f96c..a6c5f637f3 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -902,7 +902,8 @@ If nil prefix OPT is always removed." (defcustom bibtex-comment-start "@Comment" "String starting a BibTeX comment." :group 'bibtex - :type 'string) + :type 'string + :safe #'stringp) (defcustom bibtex-add-entry-hook nil "List of functions to call when BibTeX entry has been inserted." @@ -1231,7 +1232,8 @@ and must return a string (the key to use)." "Offset for BibTeX entries. Added to the value of all other variables which determine columns." :group 'bibtex - :type 'integer) + :type 'integer + :safe #'integerp) (defcustom bibtex-field-indentation 2 "Starting column for the name part in BibTeX fields." @@ -1244,13 +1246,15 @@ Added to the value of all other variables which determine columns." "Starting column for the text part in BibTeX fields. Should be equal to the space needed for the longest name part." :group 'bibtex - :type 'integer) + :type 'integer + :safe #'integerp) (defcustom bibtex-contline-indentation (+ bibtex-text-indentation 1) "Starting column for continuation lines of BibTeX fields." :group 'bibtex - :type 'integer) + :type 'integer + :safe #'integerp) (defcustom bibtex-align-at-equal-sign nil "If non-nil, align fields at equal sign instead of field text. @@ -2954,7 +2958,7 @@ for parsing BibTeX keys. If parsing fails, try to set this variable to nil." (1+ (match-beginning 3)) (1- (match-end 3))))) (unless (assoc key crossref-keys) (push (list key) crossref-keys)))) - ;; We have probably have a non-bibtex file. + ;; We probably have a non-bibtex file. ((not (match-beginning bibtex-type-in-head)) (throw 'userkey nil)) ;; only keys of known entries @@ -3448,15 +3452,10 @@ if that value is non-nil. bibtex-parse-keys-timeout t 'bibtex-parse-buffers-stealthily))) (set (make-local-variable 'paragraph-start) "[ \f\n\t]*$") - (set (make-local-variable 'comment-start) bibtex-comment-start) - (set (make-local-variable 'comment-start-skip) - (concat (regexp-quote bibtex-comment-start) "\\>[ \t]*")) (set (make-local-variable 'comment-column) 0) (set (make-local-variable 'defun-prompt-regexp) "^[ \t]*@[[:alnum:]]+[ \t]*") (set (make-local-variable 'outline-regexp) "[ \t]*@") (set (make-local-variable 'fill-paragraph-function) #'bibtex-fill-field) - (set (make-local-variable 'fill-prefix) - (make-string (+ bibtex-entry-offset bibtex-contline-indentation) ?\s)) (set (make-local-variable 'font-lock-defaults) '(bibtex-font-lock-keywords nil t ((?$ . "\"") @@ -3475,9 +3474,18 @@ if that value is non-nil. (set (make-local-variable 'syntax-propertize-function) (syntax-propertize-via-font-lock bibtex-font-lock-syntactic-keywords)) - (bibtex-set-dialect nil t) - ;; Allow `bibtex-dialect' as a file-local variable. - (add-hook 'hack-local-variables-hook #'bibtex-set-dialect nil t)) + (let ((fun (lambda () + (bibtex-set-dialect) + (set (make-local-variable 'comment-start) bibtex-comment-start) + (set (make-local-variable 'comment-start-skip) + (concat (regexp-quote bibtex-comment-start) "\\>[ \t]*")) + (set (make-local-variable 'fill-prefix) + (make-string (+ bibtex-entry-offset + bibtex-contline-indentation) + ?\s))))) + (if buffer-file-name + (add-hook 'hack-local-variables-hook fun nil t) + (funcall fun)))) (defun bibtex-entry-alist (dialect) "Return entry-alist for DIALECT." commit 1b2547de23ef6bcab9ec791878178f5ade99bd19 Author: Stefan Kangas Date: Wed Dec 2 15:43:26 2020 +0100 Remove redundant requires of faces * lisp/htmlfontify.el: * lisp/term/ns-win.el: * lisp/term/w32-win.el: * lisp/term/x-win.el: * test/lisp/faces-tests.el: Don't require 'faces'; it is preloaded since version 19.34. diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index fcd4df037a..6a2ed3aee9 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -78,8 +78,6 @@ ;;; Code: (eval-when-compile (require 'cl-lib)) -(require 'faces) -;; (`facep' `face-attr-construct' `x-color-values' `color-values' `face-name') (require 'custom) ;; (`defgroup' `defcustom') (require 'font-lock) diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el index 8273c067f8..99cead9923 100644 --- a/lisp/term/ns-win.el +++ b/lisp/term/ns-win.el @@ -47,7 +47,6 @@ ;; Documentation-purposes only: actually loaded in loadup.el. (require 'frame) (require 'mouse) -(require 'faces) (require 'menu-bar) (require 'fontset) (require 'dnd) diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index 7a15537186..824848dd55 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el @@ -72,7 +72,6 @@ (require 'frame) (require 'mouse) (require 'scroll-bar) -(require 'faces) (require 'select) (require 'menu-bar) (require 'dnd) diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 42a6f4030e..6069272604 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -75,7 +75,6 @@ (require 'frame) (require 'mouse) (require 'scroll-bar) -(require 'faces) (require 'select) (require 'menu-bar) (require 'fontset) diff --git a/test/lisp/faces-tests.el b/test/lisp/faces-tests.el index b19cef5dec..bdd18a5ac5 100644 --- a/test/lisp/faces-tests.el +++ b/test/lisp/faces-tests.el @@ -24,7 +24,6 @@ (require 'ert) (require 'ert-x) -(require 'faces) (defgroup faces--test nil "" :group 'faces--test) commit 77ee32c034a1a381d302af0cb54eede7a4dbec60 Author: Stefan Kangas Date: Wed Dec 2 18:20:46 2020 +0100 Remove redundant requires of env * lisp/eshell/esh-var.el: * lisp/man.el: Don't require 'env'; it is preloaded since version 20.1. diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index f91fb89412..7a80cd8687 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -113,7 +113,6 @@ (require 'esh-io) (require 'pcomplete) -(require 'env) (require 'ring) (defgroup eshell-var nil diff --git a/lisp/man.el b/lisp/man.el index bd55d7eff0..07af5ea0ff 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1109,7 +1109,6 @@ Return the buffer in which the manpage will appear." (buffer (get-buffer bufname))) (if buffer (Man-notify-when-ready buffer) - (require 'env) (message "Invoking %s %s in the background" manual-program man-args) (setq buffer (generate-new-buffer bufname)) (with-current-buffer buffer commit a4dd03ebe918ebc9cfbbec70d8c8910fae822b42 Author: Eli Zaretskii Date: Wed Dec 2 18:25:10 2020 +0200 ; * src/charset.c (Fmap_charset_chars): Doc fix. diff --git a/src/charset.c b/src/charset.c index 2771b0ba2a..719518642c 100644 --- a/src/charset.c +++ b/src/charset.c @@ -800,7 +800,9 @@ RANGE is a cons (FROM . TO), where FROM and TO indicate a range of characters contained in CHARSET. The optional 4th and 5th arguments FROM-CODE and TO-CODE specify the -range of code points (in CHARSET) of target characters. */) +range of code points (in CHARSET) of target characters. Note that +these are not character codes, but code points in CHARSET; for the +difference see `decode-char' and `list-charset-chars'. */) (Lisp_Object function, Lisp_Object charset, Lisp_Object arg, Lisp_Object from_code, Lisp_Object to_code) { struct charset *cs; commit d86cc3ffcb348e6cf2c01182455387e39e1daaf9 Author: Eli Zaretskii Date: Wed Dec 2 18:07:54 2020 +0200 ; * src/chartab.c, src/lisp.h: Fix typos in comments. diff --git a/src/chartab.c b/src/chartab.c index 04205ac103..a39ffa756e 100644 --- a/src/chartab.c +++ b/src/chartab.c @@ -1000,10 +1000,10 @@ map_sub_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object), "mapping table" or a "deunifier table" of a certain charset. If CHARSET is not NULL (this is the case that `map-charset-chars' - is called with non-nil FROM-CODE and TO-CODE), it is a charset who - owns TABLE, and the function is called only on a character in the + is called with non-nil FROM-CODE and TO-CODE), it is a charset that + owns TABLE, and the function is called only for characters in the range FROM and TO. FROM and TO are not character codes, but code - points of a character in CHARSET. + points of characters in CHARSET (see 'decode-char'). This function is called in these two cases: diff --git a/src/lisp.h b/src/lisp.h index 92294ac1d3..39fbf12f95 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1927,16 +1927,17 @@ memclear (void *p, ptrdiff_t nbytes) /* True iff C is an ASCII character. */ #define ASCII_CHAR_P(c) UNSIGNED_CMP (c, <, 0x80) -/* A char-table is a kind of vectorlike, with contents are like a - vector but with a few other slots. For some purposes, it makes - sense to handle a char-table with type struct Lisp_Vector. An - element of a char table can be any Lisp objects, but if it is a sub - char-table, we treat it a table that contains information of a - specific range of characters. A sub char-table is like a vector but - with two integer fields between the header and Lisp data, which means +/* A char-table is a kind of vectorlike, with contents like a vector, + but with a few additional slots. For some purposes, it makes sense + to handle a char-table as type 'struct Lisp_Vector'. An element of + a char-table can be any Lisp object, but if it is a sub-char-table, + we treat it as a table that contains information of a specific + range of characters. A sub-char-table is like a vector, but with + two integer fields between the header and Lisp data, which means that it has to be marked with some precautions (see mark_char_table - in alloc.c). A sub char-table appears only in an element of a char-table, - and there's no way to access it directly from Emacs Lisp program. */ + in alloc.c). A sub-char-table appears only in an element of a + char-table, and there's no way to access it directly from a Lisp + program. */ enum CHARTAB_SIZE_BITS { @@ -1956,11 +1957,11 @@ struct Lisp_Char_Table contents, and extras slots. */ union vectorlike_header header; - /* This holds a default value, - which is used whenever the value for a specific character is nil. */ + /* This holds the default value, which is used whenever the value + for a specific character is nil. */ Lisp_Object defalt; - /* This points to another char table, which we inherit from when the + /* This points to another char table, from which we inherit when the value for a specific character is nil. The `defalt' slot takes precedence over this. */ Lisp_Object parent; @@ -1969,8 +1970,8 @@ struct Lisp_Char_Table meant for. */ Lisp_Object purpose; - /* The bottom sub char-table for characters of the range 0..127. It - is nil if none of ASCII character has a specific value. */ + /* The bottom sub char-table for characters in the range 0..127. It + is nil if no ASCII character has a specific value. */ Lisp_Object ascii; Lisp_Object contents[(1 << CHARTAB_SIZE_BITS_0)]; @@ -2045,7 +2046,7 @@ CHAR_TABLE_REF_ASCII (Lisp_Object ct, ptrdiff_t idx) } /* Almost equivalent to Faref (CT, IDX) with optimization for ASCII - characters. Do not check validity of CT. */ + characters. Does not check validity of CT. */ INLINE Lisp_Object CHAR_TABLE_REF (Lisp_Object ct, int idx) { @@ -2055,7 +2056,7 @@ CHAR_TABLE_REF (Lisp_Object ct, int idx) } /* Equivalent to Faset (CT, IDX, VAL) with optimization for ASCII and - 8-bit European characters. Do not check validity of CT. */ + 8-bit European characters. Does not check validity of CT. */ INLINE void CHAR_TABLE_SET (Lisp_Object ct, int idx, Lisp_Object val) { commit eff6f0c7f123a79d376f5b06c3a946efb797bb03 Author: Roland Winkler Date: Wed Dec 2 09:47:14 2020 -0600 Allow bibtex-unify-case-function as file-local variable * lisp/textmodes/bibtex.el (bibtex-unify-case-function): Renamed from bibtex-unify-case-convert. Add :safe attribute. * etc/NEWS: Update accordingly. diff --git a/etc/NEWS b/etc/NEWS index 5408ea996f..c9da296278 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1355,7 +1355,7 @@ completions with more information in completion prefix and suffix. *** User option 'completions-format' supports a new value 'one-column'. --- -*** New user option 'bibtex-unify-case-convert'. +*** New user option 'bibtex-unify-case-function'. This new option allows the user to customize how case is converted when unifying entries. diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index c9e21e58f6..001941f96c 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -88,16 +88,6 @@ If this is a function, call it to generate the initial field text." (const :tag "Default" t)) :risky t) -(defcustom bibtex-unify-case-convert #'identity - "Function called when unifying case on entry and field names. -It is called with one argument, the entry or field name." - :version "28.1" - :type '(choice (const :tag "Same case as in `bibtex-field-alist'" identity) - (const :tag "Downcase" downcase) - (const :tag "Capitalize" capitalize) - (const :tag "Upcase" upcase) - (function :tag "Conversion function"))) - (defcustom bibtex-user-optional-fields '(("annote" "Personal annotation (ignored)")) "List of optional fields the user wants to have always present. @@ -133,7 +123,7 @@ last-comma Add or delete comma on end of last field in entry, delimiters Change delimiters according to variables `bibtex-field-delimiters' and `bibtex-entry-delimiters'. unify-case Change case of entry and field names according to - `bibtex-unify-case-convert'. + `bibtex-unify-case-function'. braces Enclose parts of field entries by braces according to `bibtex-field-braces-alist'. strings Replace parts of field entries by string constants @@ -193,6 +183,17 @@ Space characters in REGEXP will be replaced by \"[ \\t\\n]+\"." (regexp :tag "From regexp") (regexp :tag "To string constant")))) +(defcustom bibtex-unify-case-function #'identity + "Function for unifying case of entry and field names. +It is called with one argument, the entry or field name." + :version "28.1" + :type '(choice (const :tag "Same case as in `bibtex-field-alist'" identity) + (const :tag "Downcase" downcase) + (const :tag "Capitalize" capitalize) + (const :tag "Upcase" upcase) + (function :tag "Conversion function")) + :safe (lambda (x) (memq x '(upcase downcase capitalize identity)))) + (defcustom bibtex-clean-entry-hook nil "List of functions to call when entry has been cleaned. Functions are called with point inside the cleaned entry, and the buffer @@ -2357,7 +2358,7 @@ Formats current entry according to variable `bibtex-entry-format'." ;; unify case of entry type (when (memq 'unify-case format) (delete-region beg-type end-type) - (insert (funcall bibtex-unify-case-convert (car entry-list)))) + (insert (funcall bibtex-unify-case-function (car entry-list)))) ;; update left entry delimiter (when (memq 'delimiters format) @@ -2566,7 +2567,7 @@ Formats current entry according to variable `bibtex-entry-format'." (curname (buffer-substring beg-name end-name))) (delete-region beg-name end-name) (goto-char beg-name) - (insert (funcall bibtex-unify-case-convert + (insert (funcall bibtex-unify-case-function (or fname curname))))) ;; update point commit 9f462496ae06dae5e97ec5c68254c88365b850c0 Author: Michael Albinus Date: Wed Dec 2 16:09:20 2020 +0100 Add test to autorevert-tests.el * test/lisp/autorevert-tests.el (auto-revert--wait-for-revert): Handle `auto-revert--messages' being nil. (auto-revert-test07-auto-revert-several-buffers): New test. diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el index 9ebf137f87..f59a847e35 100644 --- a/test/lisp/autorevert-tests.el +++ b/test/lisp/autorevert-tests.el @@ -132,7 +132,7 @@ This expects `auto-revert--messages' to be bound by (null (string-match (format-message "Reverting buffer `%s'\\." (buffer-name buffer)) - auto-revert--messages))) + (or auto-revert--messages "")))) (if (with-current-buffer buffer auto-revert-use-notify) (read-event nil nil 0.05) (sleep-for 0.05))))) @@ -583,6 +583,89 @@ This expects `auto-revert--messages' to be bound by (auto-revert--deftest-remote auto-revert-test06-write-file "Test `write-file' in `auto-revert-mode' for remote buffers.") +;; This is inspired by Bug#44638. +(ert-deftest auto-revert-test07-auto-revert-several-buffers () + "Check autorevert for several buffers visiting the same file." + ;; (with-auto-revert-test + (let ((auto-revert-use-notify t) + (tmpfile (make-temp-file "auto-revert-test")) + (times '(60 30 15)) + (num-buffers 10) + require-final-newline buffers) + + (unwind-protect + ;; Check indirect buffers. + (ert-with-message-capture auto-revert--messages + (auto-revert-tests--write-file "any text" tmpfile (pop times)) + (push (find-file-noselect tmpfile) buffers) + (with-current-buffer (car buffers) + (should (string-equal (buffer-string) "any text")) + ;; `buffer-stale--default-function' checks for + ;; `verify-visited-file-modtime'. We must ensure that + ;; it returns nil. + (auto-revert-mode 1) + (should auto-revert-mode)) + + (dotimes (i num-buffers) + (add-to-list + 'buffers + (make-indirect-buffer + (car buffers) (format "%s-%d" (buffer-file-name (car buffers)) i) 'clone) + 'append)) + (dolist (buf buffers) + (with-current-buffer buf + (should (string-equal (buffer-string) "any text")) + (should auto-revert-mode))) + + (auto-revert-tests--write-file "another text" tmpfile (pop times)) + ;; Check, that the buffer has been reverted. + (auto-revert--wait-for-revert (car buffers)) + (dolist (buf buffers) + (with-current-buffer buf + (should (string-equal (buffer-string) "another text"))))) + + ;; Exit. + (ignore-errors + (dolist (buf buffers) + (with-current-buffer buf (set-buffer-modified-p nil)) + (kill-buffer buf))) + (setq buffers nil) + (ignore-errors (delete-file tmpfile))) + + ;; Check direct buffers. + (unwind-protect + (ert-with-message-capture auto-revert--messages + (auto-revert-tests--write-file "any text" tmpfile (pop times)) + + (dotimes (i num-buffers) + (add-to-list + 'buffers + (generate-new-buffer (format "%s-%d" (file-name-nondirectory tmpfile) i)) + 'append)) + (dolist (buf buffers) + (with-current-buffer buf + (insert-file-contents tmpfile 'visit) + (should (string-equal (buffer-string) "any text")) + (auto-revert-mode 1) + (should auto-revert-mode))) + + (auto-revert-tests--write-file "another text" tmpfile (pop times)) + ;; Check, that the buffers have been reverted. + (dolist (buf buffers) + (auto-revert--wait-for-revert buf) + (with-current-buffer buf + (should (string-equal (buffer-string) "another text"))))) + + ;; Exit. + (ignore-errors + (dolist (buf buffers) + (with-current-buffer buf (set-buffer-modified-p nil)) + (kill-buffer buf))) + (ignore-errors (delete-file tmpfile)))));) + +(auto-revert--deftest-remote auto-revert-test07-auto-revert-several-buffers + "Check autorevert for several buffers visiting the same remote file.") + (defun auto-revert-test-all (&optional interactive) "Run all tests for \\[auto-revert]." (interactive "p") commit 17d9d90ec2affdd816047ce33d84117482b9cbe0 Author: Stefan Kangas Date: Wed Dec 2 11:29:26 2020 +0100 Improve sectioning in bytecomp-tests.el * test/lisp/emacs-lisp/bytecomp-tests.el: Add section comments. (test-eager-load-macro-expansion) (test-eager-load-macro-expansion-eval-and-compile): Move definitions. diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index d9052da543..7ed9021736 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -490,6 +490,9 @@ Subtests signal errors if something goes wrong." (defun def () (m)))) (should (equal (funcall 'def) 4))) + +;;;; Warnings. + (ert-deftest bytecomp-tests--warnings () (with-current-buffer (get-buffer-create "*Compile-Log*") (let ((inhibit-read-only t)) (erase-buffer))) @@ -537,16 +540,6 @@ Subtests signal errors if something goes wrong." (bytecomp--with-warning-test "foo.*lacks a prefix" '(defvar foo nil))) -(ert-deftest test-eager-load-macro-expansion () - (test-byte-comp-compile-and-load nil - '(progn (defmacro abc (arg) 1) (defun def () (abc 2)))) - (should (equal (funcall 'def) 1))) - -(ert-deftest test-eager-load-macro-expansion-eval-and-compile () - (test-byte-comp-compile-and-load nil - '(eval-and-compile (defmacro abc (arg) -1) (defun def () (abc 2)))) - (should (equal (funcall 'def) -1))) - (defmacro bytecomp--define-warning-file-test (file re-warning &optional reverse) `(ert-deftest ,(intern (format "bytecomp/%s" file)) () :expected-result ,(if reverse :failed :passed) @@ -598,6 +591,19 @@ Subtests signal errors if something goes wrong." (bytecomp--define-warning-file-test "warn-interactive-only.el" "next-line.*interactive use only.*forward-line") + +;;;; Macro expansion. + +(ert-deftest test-eager-load-macro-expansion () + (test-byte-comp-compile-and-load nil + '(progn (defmacro abc (arg) 1) (defun def () (abc 2)))) + (should (equal (funcall 'def) 1))) + +(ert-deftest test-eager-load-macro-expansion-eval-and-compile () + (test-byte-comp-compile-and-load nil + '(eval-and-compile (defmacro abc (arg) -1) (defun def () (abc 2)))) + (should (equal (funcall 'def) -1))) + (ert-deftest test-eager-load-macro-expansion-eval-when-compile () ;; Make sure we interpret eval-when-compile forms properly. CLISP ;; and SBCL interpreter eval-when-compile (well, the CL equivalent) commit b7c43b85fa01896a4b500e8e4406cd1066d6bb92 Author: Stefan Kangas Date: Wed Dec 2 13:03:49 2020 +0100 * lisp/play/dunnet.el: Remove Emacs 18 compat code. diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el index 8a69f9decf..eb3805d669 100644 --- a/lisp/play/dunnet.el +++ b/lisp/play/dunnet.el @@ -2351,15 +2351,10 @@ for a moment, then straighten yourself up.\n") (define-key dun-mode-map "\r" 'dun-parse) (defvar dungeon-batch-map (make-keymap)) -(if (string= (substring emacs-version 0 2) "18") - (let (n) - (setq n 32) - (while (< 0 (setq n (- n 1))) - (aset dungeon-batch-map n 'dungeon-nil))) - (let (n) - (setq n 32) - (while (< 0 (setq n (- n 1))) - (aset (car (cdr dungeon-batch-map)) n 'dungeon-nil)))) +(let (n) + (setq n 32) + (while (< 0 (setq n (- n 1))) + (aset (car (cdr dungeon-batch-map)) n 'dungeon-nil))) (define-key dungeon-batch-map "\r" 'exit-minibuffer) (define-key dungeon-batch-map "\n" 'exit-minibuffer) commit 0c6318bc3b0fdd2edd149b3dadf1d57a5964c086 Author: Stefan Kangas Date: Wed Dec 2 12:58:42 2020 +0100 Make variable cperl-version obsolete * lisp/progmodes/cperl-mode.el (cperl-menu): Remove CPerl version menu entry. (cperl-version): Make obsolete. diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 53f21530ef..20b2360258 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1247,11 +1247,7 @@ versions of Emacs." ["Speed" (describe-variable 'cperl-speed) t] ["Praise" (describe-variable 'cperl-praise) t] ["Faces" (describe-variable 'cperl-tips-faces) t] - ["CPerl mode" (describe-function 'cperl-mode) t] - ["CPerl version" - (message "The version of master-file for this CPerl is %s-Emacs" - cperl-version) - t])))) + ["CPerl mode" (describe-function 'cperl-mode) t])))) (error nil)) (autoload 'c-macro-expand "cmacexp" @@ -8523,6 +8519,7 @@ do extra unwind via `cperl-unwind-to-safe'." (string-match ":\\s *\\([0-9.]+\\)" v) (substring v (match-beginning 1) (match-end 1))) "Version of IZ-supported CPerl package this file is based on.") +(make-obsolete-variable 'cperl-version 'emacs-version "28.1") (defvar cperl-do-not-fontify 'fontified "Text property which inhibits refontification.") commit 187e7ae200f37a6c66f092cf52cd3b0916eb00f5 Author: Stefan Kangas Date: Wed Dec 2 12:55:22 2020 +0100 Remove some Emacs 19 compat code from cperl-mode * lisp/progmodes/cperl-mode.el (cperl-put-do-not-fontify): Remove Emacs 19 compat code. (cperl-do-not-fontify): Make obsolete. diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index dd36c68c87..53f21530ef 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -931,19 +931,12 @@ In regular expressions (including character classes): (defun cperl-putback-char (c) ; Emacs 19 (push c unread-command-events)) ; Avoid undefined warning -(defvar cperl-do-not-fontify - ;; FIXME: This is not doing what it claims! - (if (string< emacs-version "19.30") - 'fontified - 'lazy-lock) - "Text property which inhibits refontification.") - (defsubst cperl-put-do-not-fontify (from to &optional post) ;; If POST, do not do it with postponed fontification (if (and post cperl-syntaxify-by-font-lock) nil (put-text-property (max (point-min) (1- from)) - to cperl-do-not-fontify t))) + to 'fontified t))) (defcustom cperl-mode-hook nil "Hook run by CPerl mode." @@ -8531,6 +8524,10 @@ do extra unwind via `cperl-unwind-to-safe'." (substring v (match-beginning 1) (match-end 1))) "Version of IZ-supported CPerl package this file is based on.") +(defvar cperl-do-not-fontify 'fontified + "Text property which inhibits refontification.") +(make-obsolete-variable 'cperl-do-not-fontify nil "28.1") + (provide 'cperl-mode) ;;; cperl-mode.el ends here commit fd578af5476745bd052e606c33d158e874bbba7a Author: Stefan Kangas Date: Wed Dec 2 12:50:05 2020 +0100 Remove some references to fast-lock and lazy-lock * lisp/htmlfontify.el (hfy-copy-and-fontify-file): * lisp/progmodes/antlr-mode.el: Remove some references to obsolete libraries fast-lock and lazy-lock. diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index ed2cd26f0d..fcd4df037a 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -1857,9 +1857,7 @@ Hardly bombproof, but good enough in the context in which it is being used." adding an extension of `hfy-extn'. Fontification is actually done by `htmlfontify-buffer'. If the buffer is not fontified, just copy it." ;;(message "hfy-copy-and-fontify-file");;DBUG - (let (;;(fast-lock-minimum-size hfy-fast-lock-save) - ;;(font-lock-support-mode 'fast-lock-mode) - ;;(window-system (or window-system 'htmlfontify)) + (let (;;(window-system (or window-system 'htmlfontify)) (target nil) (source nil) (html nil)) diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index dc727aa375..2d86f8843e 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el @@ -75,8 +75,8 @@ ;; (add-hook 'speedbar-load-hook ; would be too late in antlr-mode.el ;; (lambda () (speedbar-add-supported-extension ".g"))) -;; I strongly recommend to use font-lock with a support mode like fast-lock, -;; lazy-lock or better jit-lock (Emacs-21.1+) / lazy-shot (XEmacs). +;; I strongly recommend to use font-lock with a support mode like +;; jit-lock (Emacs) / lazy-shot (XEmacs). ;; To customize, use menu item "Antlr" -> "Customize Antlr". commit ca006807bf17fea558b179102ac28c0f1f46a3fb Author: Lars Ingebrigtsen Date: Wed Dec 2 13:07:40 2020 +0100 Fix alignment of declaractions of arrays * lisp/align.el (align-rules-list): Align variable declarations like char *foo[], too (bug#23370). diff --git a/lisp/align.el b/lisp/align.el index b2cab1c1b2..a11d834b82 100644 --- a/lisp/align.el +++ b/lisp/align.el @@ -412,7 +412,7 @@ The possible settings for `align-region-separate' are: (c-variable-declaration (regexp . ,(concat "[*&0-9A-Za-z_]>?[&*]*\\(\\s-+[*&]*\\)" - "[A-Za-z_][0-9A-Za-z:_]*\\s-*\\(\\()\\|" + "[A-Za-z_][][0-9A-Za-z:_]*\\s-*\\(\\()\\|" "=[^=\n].*\\|(.*)\\|\\(\\[.*\\]\\)*\\)" "\\s-*[;,]\\|)\\s-*$\\)")) (group . 1) commit 3ebd17d04f4af07ede0ec3297e6ffaaede17cc88 Author: Michael Albinus Date: Wed Dec 2 12:50:20 2020 +0100 * INSTALL: Add the installation command of development packages for FreeBSD. Recipe contributed by Joseph Mingrone . diff --git a/INSTALL b/INSTALL index 5909e8c9fc..324ef60c69 100644 --- a/INSTALL +++ b/INSTALL @@ -113,6 +113,7 @@ sections if you need to. make help + ADDITIONAL DISTRIBUTION FILES * Complex Text Layout support libraries @@ -222,6 +223,8 @@ like 'apt-get build-dep emacs' (on older systems, replace 'emacs' with eg 'emacs25'). On Red Hat-based systems, the corresponding command is 'dnf builddep emacs' (on older systems, use 'yum-builddep' instead). +On FreeBSD, the command is 'pkg install -y `pkg rquery %dn emacs-devel`'. + DETAILED BUILDING AND INSTALLATION: commit 4bb554cf24b0947b15a94d4c2190a718f631e75d Author: Lars Ingebrigtsen Date: Wed Dec 2 12:26:04 2020 +0100 Add tests for xsd-regexp diff --git a/test/lisp/nxml/xsd-regexp-tests.el b/test/lisp/nxml/xsd-regexp-tests.el new file mode 100644 index 0000000000..4c0b3b1a3b --- /dev/null +++ b/test/lisp/nxml/xsd-regexp-tests.el @@ -0,0 +1,30 @@ +;;; xsd-regexp-tests.el --- Test NXML Mode -*- lexical-binding: t; -*- + +;; Copyright (C) 2019-2020 Free Software Foundation, Inc. + +;; 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 . + +;;; Code: + +(require 'ert) +(require 'xsd-regexp) + +(ert-deftest xsdre-matches () + (should (equal (string-match (xsdre-translate "\\p{Pd}") "a-b") 1)) + ;; this fails: + (should (equal (string-match (xsdre-translate "\\p{P}") "a-b") 1))) + +(provide 'xsd-regexp-tests) + +;;; xsd-regexp-tests.el ends here commit b31e7c51d604eecef0602cf2e3c0cf469db3edc9 Author: Lars Ingebrigtsen Date: Wed Dec 2 12:23:13 2020 +0100 Fix xsdre-range-list-to-char-alternative problem with {P} * lisp/nxml/xsd-regexp.el (xsdre-range-list-to-char-alternative): Make (string-match (xsdre-translate "\\p{P}") "a-b") work (bug#24093) -- the "forbidden" characters don't have to be the first elements in a range. diff --git a/lisp/nxml/xsd-regexp.el b/lisp/nxml/xsd-regexp.el index 622ba91199..3ce59b7556 100644 --- a/lisp/nxml/xsd-regexp.el +++ b/lisp/nxml/xsd-regexp.el @@ -387,9 +387,15 @@ consisting of a single char alternative delimited with []." ((eq first ?-) (setq hyphen t) (setq first (1+ first))) + ((eq last ?-) + (setq hyphen t) + (setq last (1- last))) ((eq first ?\]) (setq close-bracket t) - (setq first (1+ first)))) + (setq first (1+ first))) + ((eq last ?\]) + (setq close-bracket t) + (setq last (1- last)))) (<= first last))) (when (<= first last) (setq chars commit bf43bcbed81ba0fa4376bcd6568279fa3c519c3a Author: Lars Ingebrigtsen Date: Wed Dec 2 11:16:30 2020 +0100 Fix the message-fetch-field doc string * lisp/gnus/message.el (message-fetch-field): Improve the doc string (bug#44991). diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 288ccc494c..2ab3eb6212 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -2090,14 +2090,21 @@ is used by default." (goto-char (point-min)) (looking-at message-unix-mail-delimiter)))) -(defun message-fetch-field (header &optional not-all) - "The same as `mail-fetch-field', only remove all newlines. +(defun message-fetch-field (header &optional first) + "Return the value of the header field named HEADER. +Continuation lines are folded (i.e., newlines are removed). Surrounding whitespace is also removed. +By default, if there's more than one header field named HEADER, +all the values are returned as one concatenated string, and +values are comma-separated. + +If FIRST is non-nil, only the first value is returned. + The buffer is expected to be narrowed to just the header of the message; see `message-narrow-to-headers-or-head'." (let* ((inhibit-point-motion-hooks t) - (value (mail-fetch-field header nil (not not-all)))) + (value (mail-fetch-field header nil (not first)))) (when value (while (string-match "\n[\t ]+" value) (setq value (replace-match " " t t value))) @@ -2105,12 +2112,12 @@ see `message-narrow-to-headers-or-head'." ;; we have initial or trailing white space; remove it. (string-trim value)))) -(defun message-field-value (header &optional not-all) +(defun message-field-value (header &optional first) "The same as `message-fetch-field', only narrow to the headers first." (save-excursion (save-restriction (message-narrow-to-headers-or-head) - (message-fetch-field header not-all)))) + (message-fetch-field header first)))) (defun message-narrow-to-field () "Narrow the buffer to the header on the current line." commit ed1730718f17832d8ee22ea79bedcfa37eedbfb5 Author: Stefan Kangas Date: Wed Dec 2 10:19:16 2020 +0100 Remove specific byte-compiler warnings for cl.el * lisp/emacs-lisp/bytecomp.el (byte-compile-warning-types) (byte-compile-warnings, byte-compile-cl-file-p) (byte-compile-eval, byte-compile-eval-before-compile) (byte-compile-arglist-warn, byte-compile-find-cl-functions) (byte-compile-cl-warn, displaying-byte-compile-warnings) (byte-compile-file-form-require, byte-compile-form): Remove all specific cl.el warnings, as that library is now obsolete. The regular obsoletion warnings are sufficiently discouraging. * lisp/emacs-lisp/advice.el (ad-compile-function): Don't try to silence the now removed warning. * doc/lispref/tips.texi (Coding Conventions): * doc/misc/cl.texi (Organization): Make recommendation to not use cl.el and cl-compat.el stronger. * lisp/obsolete/cl.el: Make alias help say that they are obsolete. * lisp/obsolete/cl-compat.el (build-klist, safe-idiv) (pair-with-newsyms): Silence byte-compiler. diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index 40d01d4746..c9a43e0cde 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi @@ -139,17 +139,8 @@ your file do not need to load the extra library. @item If you need Common Lisp extensions, use the @code{cl-lib} library -rather than the old @code{cl} library. The latter does not -use a clean namespace (i.e., its definitions do not -start with a @samp{cl-} prefix). If your package loads @code{cl} at -run time, that could cause name clashes for users who don't use that -package. - -There is no problem with using the @code{cl} package at @emph{compile} -time, with @code{(eval-when-compile (require 'cl))}. That's -sufficient for using the macros in the @code{cl} package, because the -compiler expands them before generating the byte-code. It is still -better to use the more modern @code{cl-lib} in this case, though. +rather than the old @code{cl} library. The latter library is +deprecated and will be removed in a future version of Emacs. @item When defining a major mode, please follow the major mode diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 2b38544dc8..084edd11b2 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -210,17 +210,10 @@ behave in exactly the same way as the @file{cl-lib.el} versions. @c There is also cl-mapc, which was called cl-mapc even before cl-lib.el. @c But not autoloaded, so maybe not much used? -Since the old @file{cl.el} does not use a clean namespace, Emacs has a -policy that packages distributed with Emacs must not load @code{cl} at -run time. (It is ok for them to load @code{cl} at @emph{compile} -time, with @code{eval-when-compile}, and use the macros it provides.) -There is no such restriction on the use of @code{cl-lib}. New code -should use @code{cl-lib} rather than @code{cl}. - -There is one more file, @file{cl-compat.el}, which defines some -routines from the older Quiroz @file{cl.el} package that are not otherwise -present in the new package. This file is obsolete and should not be -used in new code. +The old file @file{cl.el}, as well as the even older +@file{cl-compat.el}, are deprecated and will be removed in a future +version of Emacs. Any existing code that uses them should be updated +to use @file{cl-lib.el} instead. @node Naming Conventions @section Naming Conventions diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index bb45bb37d1..948443fc18 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -2224,8 +2224,6 @@ For that it has to be fbound with a non-autoload definition." (let ((byte-compile-warnings byte-compile-warnings) ;; Don't pop up windows showing byte-compiler warnings. (warning-suppress-types '((bytecomp)))) - (if (featurep 'cl) - (byte-compile-disable-warning 'cl-functions)) (byte-compile (ad-get-advice-info-field function 'advicefunname)))) ;; @@@ Accessing argument lists: diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 879f08a09f..0acd527697 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -296,7 +296,7 @@ The information is logged to `byte-compile-log-buffer'." (defconst byte-compile-warning-types '(redefine callargs free-vars unresolved - obsolete noruntime cl-functions interactive-only + obsolete noruntime interactive-only make-local mapcar constants suspicious lexical lexical-dynamic) "The list of warning types used when `byte-compile-warnings' is t.") (defcustom byte-compile-warnings t @@ -312,8 +312,6 @@ Elements of the list may be: obsolete obsolete variables and functions. noruntime functions that may not be defined at runtime (typically defined only under `eval-when-compile'). - cl-functions calls to runtime functions (as distinguished from macros and - aliases) from the old CL package (not the newer cl-lib). interactive-only commands that normally shouldn't be called from Lisp code. lexical global/dynamic variables lacking a prefix. @@ -968,11 +966,6 @@ CONST2 may be evaluated multiple times." ;;; compile-time evaluation -(defun byte-compile-cl-file-p (file) - "Return non-nil if FILE is one of the CL files." - (and (stringp file) - (string-match "^cl\\.el" (file-name-nondirectory file)))) - (defun byte-compile-eval (form) "Eval FORM and mark the functions defined therein. Each function's symbol gets added to `byte-compile-noruntime-functions'." @@ -1003,18 +996,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." (when (and (symbolp s) (not (memq s old-autoloads))) (push s byte-compile-noruntime-functions)) (when (and (consp s) (eq t (car s))) - (push (cdr s) old-autoloads))))))) - (when (byte-compile-warning-enabled-p 'cl-functions) - (let ((hist-new load-history)) - ;; Go through load-history, looking for the cl files. - ;; Since new files are added at the start of load-history, - ;; we scan the new history until the tail matches the old. - (while (and (not byte-compile-cl-functions) - hist-new (not (eq hist-new hist-orig))) - ;; We used to check if the file had already been loaded, - ;; but it is better to check non-nil byte-compile-cl-functions. - (and (byte-compile-cl-file-p (car (pop hist-new))) - (byte-compile-find-cl-functions)))))))) + (push (cdr s) old-autoloads)))))))))) (defun byte-compile-eval-before-compile (form) "Evaluate FORM for `eval-and-compile'." @@ -1025,9 +1007,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." ;; There are other ways to do this nowadays. (let ((tem current-load-list)) (while (not (eq tem hist-nil-orig)) - (when (equal (car tem) '(require . cl)) - (byte-compile-disable-warning 'cl-functions)) - (setq tem (cdr tem))))))) + (setq tem (cdr tem))))))) ;;; byte compiler messages @@ -1577,45 +1557,6 @@ extra args." (if (equal sig1 '(1 . 1)) "argument" "arguments") (byte-compile-arglist-signature-string sig2))))))) -(defvar byte-compile-cl-functions nil - "List of functions defined in CL.") - -;; Can't just add this to cl-load-hook, because that runs just before -;; the forms from cl.el get added to load-history. -(defun byte-compile-find-cl-functions () - (unless byte-compile-cl-functions - (dolist (elt load-history) - (and (byte-compile-cl-file-p (car elt)) - (dolist (e (cdr elt)) - ;; Includes the cl-foo functions that cl autoloads. - (when (memq (car-safe e) '(autoload defun)) - (push (cdr e) byte-compile-cl-functions))))))) - -(defun byte-compile-cl-warn (form) - "Warn if FORM is a call of a function from the CL package." - (let ((func (car-safe form))) - (if (and byte-compile-cl-functions - (memq func byte-compile-cl-functions) - ;; Aliases which won't have been expanded at this point. - ;; These aren't all aliases of subrs, so not trivial to - ;; avoid hardwiring the list. - (not (memq func - '(cl--block-wrapper cl--block-throw - multiple-value-call nth-value - copy-seq first second rest endp cl-member - ;; These are included in generated code - ;; that can't be called except at compile time - ;; or unless cl is loaded anyway. - cl--defsubst-expand cl-struct-setf-expander - ;; These would sometimes be warned about - ;; but such warnings are never useful, - ;; so don't warn about them. - macroexpand - cl--compiling-file)))) - (byte-compile-warn "function `%s' from cl package called at runtime" - func))) - form) - (defun byte-compile-print-syms (str1 strn syms) (when syms (byte-compile-set-symbol-position (car syms) t)) @@ -1713,7 +1654,6 @@ extra args." (and (markerp warning-series) (eq (marker-buffer warning-series) (get-buffer byte-compile-log-buffer))))) - (byte-compile-find-cl-functions) (if (or (eq warning-series 'byte-compile-warning-series) warning-series-started) ;; warning-series does come from compilation, @@ -2510,8 +2450,7 @@ list that represents a doc string reference. (put 'require 'byte-hunk-handler 'byte-compile-file-form-require) (defun byte-compile-file-form-require (form) (let ((args (mapcar 'eval (cdr form))) - (hist-orig load-history) - hist-new prov-cons) + hist-new prov-cons) (apply 'require args) ;; Record the functions defined by the require in `byte-compile-new-defuns'. @@ -2524,21 +2463,7 @@ list that represents a doc string reference. (dolist (x (car hist-new)) (when (and (consp x) (memq (car x) '(defun t))) - (push (cdr x) byte-compile-new-defuns)))) - - (when (byte-compile-warning-enabled-p 'cl-functions) - ;; Detect (require 'cl) in a way that works even if cl is already loaded. - (if (member (car args) '("cl" cl)) - (progn - (byte-compile-warn "cl package required at runtime") - (byte-compile-disable-warning 'cl-functions)) - ;; We may have required something that causes cl to be loaded, eg - ;; the uncompiled version of a file that requires cl when compiling. - (setq hist-new load-history) - (while (and (not byte-compile-cl-functions) - hist-new (not (eq hist-new hist-orig))) - (and (byte-compile-cl-file-p (car (pop hist-new))) - (byte-compile-find-cl-functions)))))) + (push (cdr x) byte-compile-new-defuns))))) (byte-compile-keep-pending form 'byte-compile-normal-call)) (put 'progn 'byte-hunk-handler 'byte-compile-file-form-progn) @@ -3239,9 +3164,7 @@ for symbols generated by the byte compiler itself." ;; differently now). (not (eq handler 'cl-byte-compile-compiler-macro)))) (funcall handler form) - (byte-compile-normal-call form)) - (if (byte-compile-warning-enabled-p 'cl-functions) - (byte-compile-cl-warn form)))) + (byte-compile-normal-call form)))) ((and (byte-code-function-p (car form)) (memq byte-optimize '(t lap))) (byte-compile-unfold-bcf form)) diff --git a/lisp/obsolete/cl-compat.el b/lisp/obsolete/cl-compat.el index b2471523d1..c37fc8eb5b 100644 --- a/lisp/obsolete/cl-compat.el +++ b/lisp/obsolete/cl-compat.el @@ -111,8 +111,9 @@ (defun build-klist (arglist keys &optional allow-others) (let ((res (Multiple-value-call 'mapcar* 'cons (unzip-lists arglist)))) (or allow-others - (let ((bad (set-difference (mapcar 'car res) keys))) - (if bad (error "Bad keywords: %s not in %s" bad keys)))) + (with-suppressed-warnings ((obsolete set-difference)) + (let ((bad (set-difference (mapcar 'car res) keys))) + (if bad (error "Bad keywords: %s not in %s" bad keys))))) res)) (defun extract-from-klist (klist key &optional def) @@ -130,16 +131,18 @@ (funcall (or test 'eql) item elt)))) (defun safe-idiv (a b) - (let* ((q (/ (abs a) (abs b))) - (s (* (signum a) (signum b)))) - (Values q (- a (* s q b)) s))) + (with-suppressed-warnings ((obsolete signum)) + (let* ((q (/ (abs a) (abs b))) + (s (* (signum a) (signum b)))) + (Values q (- a (* s q b)) s)))) ;; Internal routines. (defun pair-with-newsyms (oldforms) - (let ((newsyms (mapcar (lambda (x) (make-symbol "--cl-var--")) oldforms))) - (Values (mapcar* 'list newsyms oldforms) newsyms))) + (with-suppressed-warnings ((obsolete mapcar*)) + (let ((newsyms (mapcar (lambda (x) (make-symbol "--cl-var--")) oldforms))) + (Values (mapcar* 'list newsyms oldforms) newsyms)))) (defun zip-lists (evens odds) (cl-mapcan 'list evens odds)) diff --git a/lisp/obsolete/cl.el b/lisp/obsolete/cl.el index 20bffffd78..6a628f305c 100644 --- a/lisp/obsolete/cl.el +++ b/lisp/obsolete/cl.el @@ -113,7 +113,7 @@ most-positive-float ;; custom-print-functions )) - (defvaralias var (intern (format "cl-%s" var)))) + (define-obsolete-variable-alias var (intern (format "cl-%s" var)) "27.1")) (dolist (fun '( (get* . cl-get) @@ -291,7 +291,7 @@ )) (let ((new (if (consp fun) (prog1 (cdr fun) (setq fun (car fun))) (intern (format "cl-%s" fun))))) - (defalias fun new))) + (define-obsolete-function-alias fun new "27.1"))) (defun cl--wrap-in-nil-block (fun &rest args) `(cl-block nil ,(apply fun args))) commit 5f45fc7ee24d025a6292bca82c4eed556be76e77 Author: Dmitry Gutov Date: Wed Dec 2 04:28:35 2020 +0200 Improve .gitignore and project-vc-ignores handling * lisp/progmodes/project.el (project-ignores): Convert .gitignore entries more faithfully. (project--vc-list-files): Convert "our" ignore entries to "proper" globs, which is what Git pathspec requires. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index fd4c256e97..449eadc3de 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -322,7 +322,7 @@ to find the list of ignores for each directory." :group 'project) (defcustom project-vc-ignores nil - "List of patterns to include in `project-ignores'." + "List of patterns to add to `project-ignores'." :type '(repeat string) :safe #'listp) @@ -468,9 +468,26 @@ backend implementation of `project-external-roots'.") (cons "--" (mapcar (lambda (i) - (if (string-match "\\./" i) - (format ":!/:%s" (substring i 2)) - (format ":!:%s" i))) + (format + ":(exclude,glob,top)%s" + (if (string-match "\\*\\*" i) + ;; Looks like pathspec glob + ;; format already. + i + (if (string-match "\\./" i) + ;; ./abc -> abc + (setq i (substring i 2)) + ;; abc -> **/abc + (setq i (concat "**/" i)) + ;; FIXME: '**/abc' should also + ;; match a directory with that + ;; name, but doesn't (git 2.25.1). + ;; Maybe we should replace + ;; such entries with two. + (if (string-match "/\\'" i) + ;; abc/ -> abc/** + (setq i (concat i "**")))) + i))) extra-ignores))))) (setq files (mapcar @@ -535,12 +552,26 @@ backend implementation of `project-external-roots'.") (append (when (file-equal-p dir root) (setq backend (vc-responsible-backend root)) - (mapcar - (lambda (entry) - (if (string-match "\\`/" entry) - (replace-match "./" t t entry) - entry)) - (vc-call-backend backend 'ignore-completion-table root))) + (delq + nil + (mapcar + (lambda (entry) + (cond + ((eq ?! (aref entry 0)) + ;; No support for whitelisting (yet). + nil) + ((string-match "\\(/\\)[^/]" entry) + ;; FIXME: This seems to be Git-specific. + ;; And / in the entry (start or even the middle) means + ;; the pattern is "rooted". Or actually it is then + ;; relative to its respective .gitignore (of which there + ;; could be several), but we only support .gitignore at + ;; the root. + (if (= (match-beginning 0) 0) + (replace-match "./" t t entry 1) + (concat "./" entry))) + (t entry))) + (vc-call-backend backend 'ignore-completion-table root)))) (project--value-in-dir 'project-vc-ignores root) (mapcar (lambda (dir) commit e19c5d43486326094ab4edaccc85cbc57c743d12 Author: Dmitry Gutov Date: Wed Dec 2 01:41:40 2020 +0200 Use project--value-in-dir * lisp/progmodes/project.el (project-files): Use 'project--value-in-dir'. To have any changes in 'project-vc-ignores' take effect immediately. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 39c3ca8417..fd4c256e97 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -434,16 +434,17 @@ backend implementation of `project-external-roots'.") (cl-defmethod project-files ((project (head vc)) &optional dirs) (mapcan (lambda (dir) - (let (backend) + (let ((ignores (project--value-in-dir 'project-vc-ignores dir)) + backend) (if (and (file-equal-p dir (cdr project)) (setq backend (vc-responsible-backend dir)) (cond ((eq backend 'Hg)) ((and (eq backend 'Git) (or - (not project-vc-ignores) + (not ignores) (version<= "1.9" (vc-git--program-version))))))) - (project--vc-list-files dir backend project-vc-ignores) + (project--vc-list-files dir backend ignores) (project--files-in-directory dir (project--dir-ignores project dir))))) commit f57a1ca869385aae063085efc10c285dd49a79e0 Author: Juri Linkov Date: Tue Dec 1 22:33:43 2020 +0200 Fix documentation of window-in-direction arg MINIBUF (bug#44932) * doc/lispref/windows.texi (Windows and Frames): Rename MINI arg of window-in-direction to MINIBUF. Explain the non-nil non-t value. diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 2d092e1842..db80b49507 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -365,7 +365,7 @@ appears right below @var{window}. @end defun @cindex window in direction -@defun window-in-direction direction &optional window ignore sign wrap mini +@defun window-in-direction direction &optional window ignore sign wrap minibuf This function returns the nearest live window in direction @var{direction} as seen from the position of @code{window-point} in window @var{window}. The argument @var{direction} must be one of @@ -392,11 +392,13 @@ is at the top of the frame and @var{direction} is @code{above}, then this function usually returns the frame's minibuffer window if it's active and a window at the bottom of the frame otherwise. -If the optional argument @var{mini} is @code{nil}, this means to return -the minibuffer window if and only if it is currently active. If -@var{mini} is non-@code{nil}, this function may return the minibuffer -window even when it's not active. However, if @var{wrap} is -non-@code{nil}, it always acts as if @var{mini} were @code{nil}. +If the optional argument @var{minibuf} is @code{t}, this function may +return the minibuffer window even when it's not active. If the +optional argument @var{minibuf} is @code{nil}, this means to return +the minibuffer window if and only if it is currently active. +If @var{minibuf} is neither @code{nil} nor @code{t}, this function +never returns the minibuffer window. However, if @var{wrap} is +non-@code{nil}, it always acts as if @var{minibuf} were @code{nil}. If it doesn't find a suitable window, this function returns @code{nil}. commit 466d7814236ce9c44af77f637eff3b86043382a5 Merge: 45f0fef718 8e73259093 Author: Glenn Morris Date: Tue Dec 1 07:50:12 2020 -0800 ; Merge from origin/emacs-27 The following commit was skipped: 8e73259093 (origin/emacs-27, emacs-27) ; Auto-commit of loaddefs files. commit 45f0fef718a77dfcef105fb7a44c7422b44d5db1 Merge: 23d206b03b 749e4b7e0b Author: Glenn Morris Date: Tue Dec 1 07:50:12 2020 -0800 Merge from origin/emacs-27 749e4b7e0b Reset xref-show-xrefs-function temporarily 3e6525d69f Don't show in 'view-lossage' responses to xterm feature qu... 9fbff9c35c ; * src/buffer.c: Fix comment describing 'buffer_defaults'. commit 23d206b03b20e0221ab34e32a93ee910177bcd46 Merge: 6c6d06c3ee 9e0085064b Author: Glenn Morris Date: Tue Dec 1 07:50:12 2020 -0800 ; Merge from origin/emacs-27 The following commit was skipped: 9e0085064b Adapt Tramp versions. Do not merge commit 6c6d06c3ee67ae876ade7f4a032da928ffeeb41f Merge: 496d1fcd76 9939c435c1 Author: Glenn Morris Date: Tue Dec 1 07:50:09 2020 -0800 Merge from origin/emacs-27 9939c435c1 Return the correct suffix in eww-make-unique-file-name 17fa17be3d Save bookmarks by using `write-file' (bug#12507) 2cdf1fd261 Fix filing messages when 'rmail-output-reset-deleted-flag'... a72db8ab8b Make file copying in tramp-gvfs more robust f31cacd1ff Revert "Fix incorrect handling of module runtime and envir... cdc632fbe6 Fix incorrect handling of module runtime and environment p... c9160bda78 CC Mode: Fix error in cache handling. This fixes bug #43481 commit 496d1fcd76778b41bccfeeac155121a4a2015274 Author: Michael Albinus Date: Tue Dec 1 15:39:38 2020 +0100 * lisp/arc-mode.el (archive-get-descr): Use default mode if needed. diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 69a159a84a..3516af68fc 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -646,7 +646,7 @@ Does not signal an error if optional argument NOERROR is non-nil." (< no (length archive-files))) (let ((item (aref archive-files no))) (if (and (archive--file-desc-p item) - (let ((mode (archive--file-desc-mode item))) + (let ((mode (or (archive--file-desc-mode item) 0))) (zerop (logand 16384 mode)))) item (if (not noerror) commit 7916c9038cb13dd68b58b6083d3b41e31d2a399d Author: Glenn Morris Date: Tue Dec 1 06:27:56 2020 -0800 ; Auto-commit of loaddefs files. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index f5ae3adf2e..ed1b2c7714 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -515,9 +515,9 @@ If called interactively, toggle `Allout 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -836,9 +836,9 @@ If called interactively, toggle `Allout-Widgets 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -1260,9 +1260,9 @@ If called interactively, toggle `Artist 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -1598,9 +1598,9 @@ If called interactively, toggle `Autoarg-Kp 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -1660,9 +1660,9 @@ If called interactively, toggle `Auto-Insert 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -1753,9 +1753,9 @@ If called interactively, toggle `Auto-Revert 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -1786,9 +1786,9 @@ If called interactively, toggle `Auto-Revert-Tail 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -1833,9 +1833,9 @@ If called interactively, toggle `Global Auto-Revert 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -1970,9 +1970,9 @@ If called interactively, toggle `Display-Battery 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -1994,7 +1994,7 @@ seconds. (autoload 'benchmark-run "benchmark" "\ Time execution of FORMS. -If REPETITIONS is supplied as a number, run forms that many times, +If REPETITIONS is supplied as a number, run FORMS that many times, accounting for the overhead of the resulting loop. Otherwise run FORMS once. Return a list of the total elapsed time for execution, the number of @@ -2952,9 +2952,9 @@ If called interactively, toggle `Bug-Reference 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -2968,9 +2968,9 @@ If called interactively, toggle `Bug-Reference-Prog 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -3038,7 +3038,11 @@ before scanning it. If the third argument FORCE is non-nil, recompile every `.el' file that already has a `.elc' file. -\(fn DIRECTORY &optional ARG FORCE)" t nil) +This command will normally not follow symlinks when compiling +files. If FOLLOW-SYMLINKS is non-nil, symlinked `.el' files will +also be compiled. + +\(fn DIRECTORY &optional ARG FORCE FOLLOW-SYMLINKS)" t nil) (put 'no-byte-compile 'safe-local-variable 'booleanp) (autoload 'byte-compile-file "bytecomp" "\ @@ -4713,9 +4717,9 @@ If called interactively, toggle `Checkdoc minor 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -4829,9 +4833,9 @@ If called interactively, toggle `Cl-Font-Lock-Built-In 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -5047,9 +5051,9 @@ If called interactively, toggle `Cl-Old-Struct-Compat 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -5486,9 +5490,9 @@ If called interactively, toggle `Compilation-Shell minor 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -5507,9 +5511,9 @@ If called interactively, toggle `Compilation minor 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -5550,9 +5554,9 @@ If called interactively, toggle `Dynamic-Completion 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -6117,9 +6121,9 @@ If called interactively, toggle `Cua 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -6171,9 +6175,9 @@ If called interactively, toggle `Cua-Rectangle-Mark 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -6200,9 +6204,9 @@ If called interactively, toggle `Cursor-Intangible 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -6221,9 +6225,9 @@ If called interactively, toggle `Cursor-Sensor 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -6607,9 +6611,9 @@ If called interactively, toggle `Cwarn 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -7062,9 +7066,9 @@ If called interactively, toggle `Delete-Selection 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -7237,9 +7241,9 @@ If called interactively, toggle `Desktop-Save 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -7636,9 +7640,9 @@ If called interactively, toggle `Diff minor 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -7828,9 +7832,9 @@ If called interactively, toggle `Dirtrack 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -8005,9 +8009,9 @@ If called interactively, toggle `Display-Fill-Column-Indicator 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -8082,9 +8086,9 @@ If called interactively, toggle `Display-Line-Numbers 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -8225,9 +8229,9 @@ If called interactively, toggle `Doc-View minor 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -8293,9 +8297,9 @@ If called interactively, toggle `Double 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -9143,9 +9147,9 @@ If called interactively, toggle `Global Ede 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -9997,9 +10001,9 @@ If called interactively, toggle `Electric-Pair 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -10021,9 +10025,9 @@ If called interactively, toggle `Electric-Pair-Local 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -10244,9 +10248,9 @@ If called interactively, toggle `Enriched 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -10509,9 +10513,9 @@ If called interactively, toggle `epa-mail 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -10579,9 +10583,9 @@ If called interactively, toggle `Epa-Global-Mail 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -11962,9 +11966,9 @@ If called interactively, toggle `Buffer-Face 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -12011,7 +12015,7 @@ Besides the choice of face, it is the same as `buffer-face-mode'. \(fn &optional ARG)" t nil) -(register-definition-prefixes "face-remap" '("buffer-face-mode-" "face-" "internal-lisp-face-attributes" "text-scale-m")) +(register-definition-prefixes "face-remap" '("buffer-face-mode-" "face-" "internal-lisp-face-attributes" "text-scale-")) ;;;*** @@ -12385,6 +12389,12 @@ Execute BODY, and unwind connection-local variables. \(fn &rest BODY)" nil t) +(autoload 'path-separator "files-x" "\ +The connection-local value of `path-separator'." nil nil) + +(autoload 'null-device "files-x" "\ +The connection-local value of `null-device'." nil nil) + (register-definition-prefixes "files-x" '("connection-local-" "dir-locals-to-string" "hack-connection-local-variables" "modify-" "read-file-local-variable")) ;;;*** @@ -12884,9 +12894,9 @@ If called interactively, toggle `Flymake 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -12972,9 +12982,9 @@ If called interactively, toggle `Flyspell 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -13055,9 +13065,9 @@ If called interactively, toggle `Follow 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -13185,9 +13195,9 @@ If called interactively, toggle `Footnote 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -13652,9 +13662,9 @@ If called interactively, toggle `Gdb-Enable-Debug 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -13836,9 +13846,9 @@ If called interactively, toggle `Glasses 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -14451,9 +14461,9 @@ 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. -If called from Lisp, toggle the mode if if ARG is `toggle'. -Enable the mode if ARG is nil, omitted, or is a positive number. -All other values will 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. @@ -14729,6 +14739,14 @@ Initialize the Gnus registry." t nil) (register-definition-prefixes "gnus-score" '("gnus-")) +;;;*** + +;;;### (autoloads nil "gnus-search" "gnus/gnus-search.el" (0 0 0 +;;;;;; 0)) +;;; Generated autoloads from gnus/gnus-search.el + +(register-definition-prefixes "gnus-search" '("gnus-search-")) + ;;;*** ;;;### (autoloads nil "gnus-sieve" "gnus/gnus-sieve.el" (0 0 0 0)) @@ -14908,9 +14926,9 @@ If called interactively, toggle `Goto-Address 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -14950,9 +14968,9 @@ If called interactively, toggle `Goto-Address-Prog 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -15290,9 +15308,9 @@ If called interactively, toggle `Gud-Tooltip 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -16011,9 +16029,9 @@ If called interactively, toggle `Hi-Lock 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -16223,9 +16241,9 @@ If called interactively, toggle `Hide-Ifdef 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -16308,9 +16326,9 @@ If called interactively, toggle `Hs minor 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -16358,9 +16376,9 @@ If called interactively, toggle `Highlight-Changes 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -16389,9 +16407,9 @@ If called interactively, toggle `Highlight-Changes-Visible 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -16539,9 +16557,9 @@ If called interactively, toggle `Hl-Line 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -16577,9 +16595,9 @@ If called interactively, toggle `Global Hl-Line 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -16995,9 +17013,9 @@ If called interactively, toggle `Fido 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -17024,9 +17042,9 @@ If called interactively, toggle `Icomplete 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -17572,9 +17590,9 @@ If called interactively, toggle `Iimage 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -17886,9 +17904,9 @@ If called interactively, toggle `Image-Dired minor 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -17988,9 +18006,9 @@ If called interactively, toggle `Auto-Image-File 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -18023,9 +18041,9 @@ If called interactively, toggle `Image minor 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -18648,8 +18666,13 @@ See Info node `(elisp)Defining Functions' for more details. 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-")) ;;;*** @@ -18664,6 +18687,9 @@ Select an input method and turn it on in interactive search." t nil) (autoload 'isearch-toggle-input-method "isearch-x" "\ Toggle input method in interactive search." t nil) +(autoload 'isearch-transient-input-method "isearch-x" "\ +Activate transient input method in interactive search." t nil) + (autoload 'isearch-process-search-multibyte-characters "isearch-x" "\ @@ -18984,9 +19010,9 @@ If called interactively, toggle `ISpell minor 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -19185,7 +19211,7 @@ one of the aforementioned options instead of using this mode. ;;;### (autoloads nil "jsonrpc" "jsonrpc.el" (0 0 0 0)) ;;; Generated autoloads from jsonrpc.el -(push (purecopy '(jsonrpc 1 0 12)) package--builtin-versions) +(push (purecopy '(jsonrpc 1 0 14)) package--builtin-versions) (register-definition-prefixes "jsonrpc" '("jsonrpc-")) @@ -19679,9 +19705,9 @@ If called interactively, toggle `Linum 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -20259,9 +20285,9 @@ If called interactively, toggle `Mail-Abbrevs 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -20601,9 +20627,9 @@ If called interactively, toggle `Master 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -20643,9 +20669,9 @@ If called interactively, toggle `Minibuffer-Depth-Indicate 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -21190,9 +21216,9 @@ If called interactively, toggle `Midnight 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -21242,9 +21268,9 @@ If called interactively, toggle `Minibuffer-Electric-Default 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -21818,9 +21844,9 @@ If called interactively, toggle `Msb 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -22556,13 +22582,6 @@ This command does not work if you use short group names." t nil) (register-definition-prefixes "nnimap" '("nnimap-")) -;;;*** - -;;;### (autoloads nil "nnir" "gnus/nnir.el" (0 0 0 0)) -;;; Generated autoloads from gnus/nnir.el - -(register-definition-prefixes "nnir" '("nnir-")) - ;;;*** ;;;### (autoloads nil "nnmail" "gnus/nnmail.el" (0 0 0 0)) @@ -24346,9 +24365,9 @@ If called interactively, toggle `Org-Num 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -24440,9 +24459,9 @@ If called interactively, toggle `Outline minor 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -24648,9 +24667,9 @@ If called interactively, toggle `Show-Paren 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -25361,9 +25380,9 @@ If called interactively, toggle `Pixel-Scroll 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -26147,13 +26166,15 @@ pattern to search for. (autoload 'project-find-file "project" "\ Visit a file (with completion) in the current project. -The completion default is the filename at point, if one is -recognized." t nil) + +The completion default is the filename at point, determined by +`thing-at-point' (whether such file exists or not)." t nil) (autoload 'project-or-external-find-file "project" "\ Visit a file (with completion) in the current project or external roots. -The completion default is the filename at point, if one is -recognized." t nil) + +The completion default is the filename at point, determined by +`thing-at-point' (whether such file exists or not)." t nil) (autoload 'project-dired "project" "\ Start Dired in the current project's root." t nil) @@ -27112,9 +27133,9 @@ If called interactively, toggle `Rcirc-Track minor 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -27164,9 +27185,9 @@ If called interactively, toggle `Recentf 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -27322,9 +27343,9 @@ If called interactively, toggle `Rectangle-Mark 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -27361,9 +27382,9 @@ If called interactively, toggle `Refill 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -27398,9 +27419,9 @@ If called interactively, toggle `Reftex 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -27679,9 +27700,9 @@ If called interactively, toggle `Reveal 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -27711,9 +27732,9 @@ If called interactively, toggle `Global Reveal 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -28245,9 +28266,9 @@ If called interactively, toggle `Rng-Validate 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -28402,9 +28423,9 @@ If called interactively, toggle `Rst minor 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -28436,7 +28457,7 @@ Major mode for editing Ruby code. \(fn)" t nil) -(add-to-list 'auto-mode-alist (cons (purecopy (concat "\\(?:\\.\\(?:" "rbw?\\|ru\\|rake\\|thor" "\\|jbuilder\\|rabl\\|gemspec\\|podspec" "\\)" "\\|/" "\\(?:Gem\\|Rake\\|Cap\\|Thor" "\\|Puppet\\|Berks" "\\|Vagrant\\|Guard\\|Pod\\)file" "\\)\\'")) 'ruby-mode)) +(add-to-list 'auto-mode-alist (cons (purecopy (concat "\\(?:\\.\\(?:" "rbw?\\|ru\\|rake\\|thor" "\\|jbuilder\\|rabl\\|gemspec\\|podspec" "\\)" "\\|/" "\\(?:Gem\\|Rake\\|Cap\\|Thor" "\\|Puppet\\|Berks\\|Brew" "\\|Vagrant\\|Guard\\|Pod\\)file" "\\)\\'")) 'ruby-mode)) (dolist (name (list "ruby" "rbx" "jruby" "ruby1.9" "ruby1.8")) (add-to-list 'interpreter-mode-alist (cons (purecopy name) 'ruby-mode))) @@ -28458,9 +28479,9 @@ If called interactively, toggle `Ruler 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -28661,6 +28682,29 @@ 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) + +(define-symbol-prop 'rx--pcase-macroexpander 'edebug-form-spec 'nil) + +(define-symbol-prop 'rx 'pcase-macroexpander #'rx--pcase-macroexpander) + (register-definition-prefixes "rx" '("rx-")) ;;;*** @@ -28729,9 +28773,9 @@ If called interactively, toggle `Savehist 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -28790,9 +28834,9 @@ If called interactively, toggle `Save-Place 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -28809,9 +28853,9 @@ If called interactively, toggle `Save-Place-Local 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -28903,9 +28947,9 @@ If called interactively, toggle `Scroll-All 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -28936,9 +28980,9 @@ If called interactively, toggle `Scroll-Lock 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -28983,7 +29027,6 @@ The possible elements of this list include the following: `global-semantic-stickyfunc-mode' - Show current fun in header line. `global-semantic-mru-bookmark-mode' - Provide `switch-to-buffer'-like keybinding for tag names. - `global-cedet-m3-minor-mode' - A mouse 3 context menu. `global-semantic-idle-local-symbol-highlight-mode' - Highlight references of the symbol under point. The following modes are more targeted at people who want to see @@ -29013,9 +29056,9 @@ If called interactively, toggle `Semantic 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -29653,9 +29696,9 @@ If called interactively, toggle `Server 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -30290,9 +30333,9 @@ If called interactively, toggle `Smerge 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -30423,9 +30466,9 @@ If called interactively, toggle `So-Long minor 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -30505,9 +30548,9 @@ If called interactively, toggle `Global So-Long 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -31623,9 +31666,9 @@ If called interactively, toggle `Strokes 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -31733,9 +31776,9 @@ If called interactively, toggle `Subword 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -31793,9 +31836,9 @@ If called interactively, toggle `Superword 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -31899,9 +31942,9 @@ If called interactively, toggle `Gpm-Mouse 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -31930,9 +31973,9 @@ If called interactively, toggle `Tab-Line 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -32346,9 +32389,9 @@ If called interactively, toggle `Table-Fixed-Width 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -33537,9 +33580,9 @@ If called interactively, toggle `Tildify 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -33592,9 +33635,9 @@ If called interactively, toggle `Display-Time 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -34484,9 +34527,9 @@ If called interactively, toggle `Type-Break 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -35015,9 +35058,9 @@ If called interactively, toggle `Url-Handler 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -37176,9 +37219,9 @@ If called interactively, toggle `View 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -37555,9 +37598,9 @@ If called interactively, toggle `Which-Function 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -37583,9 +37626,9 @@ If called interactively, toggle `Whitespace 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -37602,9 +37645,9 @@ If called interactively, toggle `Whitespace-Newline 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -37635,9 +37678,9 @@ If called interactively, toggle `Global Whitespace 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -37664,9 +37707,9 @@ If called interactively, toggle `Global Whitespace-Newline 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -37994,9 +38037,9 @@ If called interactively, toggle `Widget minor 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -38234,9 +38277,9 @@ If called interactively, toggle `Winner 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -38526,9 +38569,9 @@ If called interactively, toggle `Xterm-Mouse 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 if ARG is `toggle'. Enable -the mode if ARG is nil, omitted, or is a positive number. All other -values will 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. @@ -38682,27 +38725,27 @@ Zone out, completely." t nil) ;;;;;; "leim/quail/PY-b5.el" "leim/quail/PY.el" "leim/quail/Punct-b5.el" ;;;;;; "leim/quail/Punct.el" "leim/quail/QJ-b5.el" "leim/quail/QJ.el" ;;;;;; "leim/quail/SW.el" "leim/quail/TONEPY.el" "leim/quail/ZIRANMA.el" -;;;;;; "leim/quail/ZOZY.el" "leim/quail/arabic.el" "leim/quail/croatian.el" -;;;;;; "leim/quail/cyril-jis.el" "leim/quail/cyrillic.el" "leim/quail/czech.el" -;;;;;; "leim/quail/georgian.el" "leim/quail/greek.el" "leim/quail/hanja-jis.el" -;;;;;; "leim/quail/hanja.el" "leim/quail/hanja3.el" "leim/quail/hebrew.el" -;;;;;; "leim/quail/ipa-praat.el" "leim/quail/latin-alt.el" "leim/quail/latin-ltx.el" -;;;;;; "leim/quail/latin-post.el" "leim/quail/latin-pre.el" "leim/quail/persian.el" -;;;;;; "leim/quail/programmer-dvorak.el" "leim/quail/py-punct.el" -;;;;;; "leim/quail/pypunct-b5.el" "leim/quail/quick-b5.el" "leim/quail/quick-cns.el" -;;;;;; "leim/quail/rfc1345.el" "leim/quail/sami.el" "leim/quail/sgml-input.el" -;;;;;; "leim/quail/slovak.el" "leim/quail/symbol-ksc.el" "leim/quail/tamil-dvorak.el" -;;;;;; "leim/quail/tsang-b5.el" "leim/quail/tsang-cns.el" "leim/quail/vntelex.el" -;;;;;; "leim/quail/vnvni.el" "leim/quail/welsh.el" "loadup.el" "mail/blessmail.el" -;;;;;; "mail/rmailedit.el" "mail/rmailkwd.el" "mail/rmailmm.el" -;;;;;; "mail/rmailmsc.el" "mail/rmailsort.el" "mail/rmailsum.el" -;;;;;; "mail/undigest.el" "menu-bar.el" "mh-e/mh-gnus.el" "mh-e/mh-loaddefs.el" -;;;;;; "minibuffer.el" "mouse.el" "net/tramp-loaddefs.el" "newcomment.el" -;;;;;; "obarray.el" "org/ob-core.el" "org/ob-lob.el" "org/ob-matlab.el" -;;;;;; "org/ob-tangle.el" "org/ob.el" "org/ol-bbdb.el" "org/ol-irc.el" -;;;;;; "org/org-archive.el" "org/org-attach.el" "org/org-clock.el" -;;;;;; "org/org-datetree.el" "org/org-element.el" "org/org-feed.el" -;;;;;; "org/org-footnote.el" "org/org-id.el" "org/org-indent.el" +;;;;;; "leim/quail/ZOZY.el" "leim/quail/arabic.el" "leim/quail/compose.el" +;;;;;; "leim/quail/croatian.el" "leim/quail/cyril-jis.el" "leim/quail/cyrillic.el" +;;;;;; "leim/quail/czech.el" "leim/quail/georgian.el" "leim/quail/greek.el" +;;;;;; "leim/quail/hanja-jis.el" "leim/quail/hanja.el" "leim/quail/hanja3.el" +;;;;;; "leim/quail/hebrew.el" "leim/quail/ipa-praat.el" "leim/quail/latin-alt.el" +;;;;;; "leim/quail/latin-ltx.el" "leim/quail/latin-post.el" "leim/quail/latin-pre.el" +;;;;;; "leim/quail/persian.el" "leim/quail/programmer-dvorak.el" +;;;;;; "leim/quail/py-punct.el" "leim/quail/pypunct-b5.el" "leim/quail/quick-b5.el" +;;;;;; "leim/quail/quick-cns.el" "leim/quail/rfc1345.el" "leim/quail/sami.el" +;;;;;; "leim/quail/sgml-input.el" "leim/quail/slovak.el" "leim/quail/symbol-ksc.el" +;;;;;; "leim/quail/tamil-dvorak.el" "leim/quail/tsang-b5.el" "leim/quail/tsang-cns.el" +;;;;;; "leim/quail/vntelex.el" "leim/quail/vnvni.el" "leim/quail/welsh.el" +;;;;;; "loadup.el" "mail/blessmail.el" "mail/rmailedit.el" "mail/rmailkwd.el" +;;;;;; "mail/rmailmm.el" "mail/rmailmsc.el" "mail/rmailsort.el" +;;;;;; "mail/rmailsum.el" "mail/undigest.el" "menu-bar.el" "mh-e/mh-gnus.el" +;;;;;; "mh-e/mh-loaddefs.el" "minibuffer.el" "mouse.el" "net/tramp-loaddefs.el" +;;;;;; "newcomment.el" "obarray.el" "org/ob-core.el" "org/ob-lob.el" +;;;;;; "org/ob-matlab.el" "org/ob-tangle.el" "org/ob.el" "org/ol-bbdb.el" +;;;;;; "org/ol-irc.el" "org/org-archive.el" "org/org-attach.el" +;;;;;; "org/org-clock.el" "org/org-datetree.el" "org/org-element.el" +;;;;;; "org/org-feed.el" "org/org-footnote.el" "org/org-id.el" "org/org-indent.el" ;;;;;; "org/org-install.el" "org/org-mobile.el" "org/org-plot.el" ;;;;;; "org/org-table.el" "org/org-timer.el" "org/ox-ascii.el" "org/ox-beamer.el" ;;;;;; "org/ox-html.el" "org/ox-icalendar.el" "org/ox-latex.el" commit 8e7325909363affe27c36d1181b60a625ea04d23 Author: Glenn Morris Date: Tue Dec 1 06:12:37 2020 -0800 ; Auto-commit of loaddefs files. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index bf653cf593..70bf3f0b34 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -1913,7 +1913,7 @@ seconds. (autoload 'benchmark-run "benchmark" "\ Time execution of FORMS. -If REPETITIONS is supplied as a number, run forms that many times, +If REPETITIONS is supplied as a number, run FORMS that many times, accounting for the overhead of the resulting loop. Otherwise run FORMS once. Return a list of the total elapsed time for execution, the number of @@ -34519,7 +34519,7 @@ the output buffer or changing the window configuration. ;;;### (autoloads nil "tramp" "net/tramp.el" (0 0 0 0)) ;;; Generated autoloads from net/tramp.el -(push (purecopy '(tramp 2 4 5 -1)) package--builtin-versions) +(push (purecopy '(tramp 2 4 5 27 2)) package--builtin-versions) (defvar tramp-mode t "\ Whether Tramp is enabled. commit 1a3aa6043a51e5bb4007889dd7dcabb55dc44132 Merge: ba692b790d ace6eba036 Author: Michael Albinus Date: Tue Dec 1 13:37:27 2020 +0100 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into master commit ba692b790da79cde98932295362a5de138991d47 Author: Michael Albinus Date: Tue Dec 1 13:37:03 2020 +0100 Allow Tramp to mirror traces to a file * doc/misc/tramp.texi (Traces and Profiles): Add `tramp-debug-to-file'. * lisp/net/tramp-adb.el (tramp-adb-parse-device-names) (tramp-adb-get-device): * lisp/net/tramp-cmds.el (tramp-rename-files): * lisp/net/tramp-gvfs.el (tramp-gvfs-monitor-process-filter) (tramp-gvfs-handler-volumeadded-volumeremoved) (tramp-get-media-devices): * lisp/net/tramp-sh.el (tramp-sh-handle-file-notify-add-watch) (tramp-sh-gio-monitor-process-filter) (tramp-sh-gvfs-monitor-dir-process-filter) (tramp-sh-inotifywait-process-filter, tramp-maybe-send-script) (tramp-find-inline-encoding): * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory) (tramp-smb-handle-file-acl, tramp-smb-handle-set-file-acl): Use `tramp-compat-string-replace'. * lisp/net/tramp-compat.el (tramp-compat-string-replace): New defalias. * lisp/net/tramp.el (tramp-debug-to-file): New defcustom. (tramp-get-debug-buffer): Simplify. (tramp-get-debug-file-name): New defun. (tramp-debug-message): Write debug file if indicated. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index f853c6d7af..59b8bdbdf3 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -5043,6 +5043,7 @@ root-directory, it is most likely sufficient to make the @node Traces and Profiles @chapter How to Customize Traces @vindex tramp-verbose +@vindex tramp-debug-to-file @value{tramp} messages are raised with verbosity levels ranging from 0 to 10. @value{tramp} does not display all messages; only those with a @@ -5095,6 +5096,20 @@ If @code{tramp-verbose} is greater than or equal to 10, Lisp backtraces are also added to the @value{tramp} debug buffer in case of errors. +In very rare cases it could happen, that @value{tramp} blocks Emacs. +Killing Emacs does not allow to inspect the debug buffer. In that +case, you might instruct @value{tramp} to mirror the debug buffer to +file: + +@lisp +(customize-set-variable 'tramp-debug-to-file t) +@end lisp + +The debug buffer is written as file in your +@code{temporary-file-directory}, which is usually @file{/tmp/}. Use +this option with care, because it could decrease the performance of +@value{tramp} actions. + To enable stepping through @value{tramp} function call traces, they have to be specifically enabled as shown in this code: diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 51cb316249..4947d161f3 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -217,7 +217,7 @@ ARGUMENTS to pass to the OPERATION." (lambda (line) (when (string-match "^\\(\\S-+\\)[[:space:]]+device$" line) ;; Replace ":" by "#". - `(nil ,(replace-regexp-in-string + `(nil ,(tramp-compat-string-replace ":" tramp-prefix-port-format (match-string 1 line))))) (tramp-process-lines nil tramp-adb-program "devices")))) @@ -1074,7 +1074,7 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\" (let* ((host (tramp-file-name-host vec)) (port (tramp-file-name-port-or-default vec)) (devices (mapcar #'cadr (tramp-adb-parse-device-names nil)))) - (replace-regexp-in-string + (tramp-compat-string-replace tramp-prefix-port-format ":" (cond ((member host devices) host) ;; This is the case when the host is connected to the default port. @@ -1090,7 +1090,7 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\" (not (zerop (length host))) (tramp-adb-execute-adb-command vec "connect" - (replace-regexp-in-string + (tramp-compat-string-replace tramp-prefix-port-format ":" host))) ;; When new device connected, running other adb command (e.g. ;; adb shell) immediately will fail. To get around this diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 827d5f60a2..622116d9f9 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -387,8 +387,7 @@ ESC or `q' to quit without changing further buffers, (switch-to-buffer buffer) (let* ((bfn (buffer-file-name)) (new-bfn (and (stringp bfn) - (replace-regexp-in-string - (regexp-quote source) target bfn))) + (tramp-compat-string-replace source target bfn))) (prompt (format-message "Set visited file name to `%s' [Type yn!eq or %s] " new-bfn (key-description (vector help-char))))) diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 7fae9ba7e2..b44eabcfa8 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -341,6 +341,13 @@ A nil value for either argument stands for the current time." (lambda () (if (tramp-tramp-file-p default-directory) "/dev/null" null-device)))) +;; Function `string-replace' is new in Emacs 28.1. +(defalias 'tramp-compat-string-replace + (if (fboundp 'string-replace) + #'string-replace + (lambda (fromstring tostring instring) + (replace-regexp-in-string (regexp-quote fromstring) tostring instring)))) + (add-hook 'tramp-unload-hook (lambda () (unload-feature 'tramp-loaddefs 'force) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 098fba56b5..40a7cbbce1 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1441,11 +1441,11 @@ If FILE-SYSTEM is non-nil, return file system attributes." (tramp-message proc 6 "%S\n%s" proc string) (setq string (concat rest-string string) ;; Fix action names. - string (replace-regexp-in-string + string (tramp-compat-string-replace "attributes changed" "attribute-changed" string) - string (replace-regexp-in-string + string (tramp-compat-string-replace "changes done" "changes-done-hint" string) - string (replace-regexp-in-string + string (tramp-compat-string-replace "renamed to" "moved" string)) ;; https://bugs.launchpad.net/bugs/1742946 (when @@ -2050,7 +2050,7 @@ and \"org.gtk.Private.RemoteVolumeMonitor.VolumeRemoved\" signals." (vec (make-tramp-file-name :method "media" ;; A host name cannot contain spaces. - :host (replace-regexp-in-string " " "_" (nth 1 volume)))) + :host (tramp-compat-string-replace " " "_" (nth 1 volume)))) (media (make-tramp-media-device :method method :host (tramp-gvfs-url-host (nth 5 volume)) @@ -2355,7 +2355,7 @@ VEC is used only for traces." (vec (make-tramp-file-name :method "media" ;; A host name cannot contain spaces. - :host (replace-regexp-in-string " " "_" (nth 1 volume)))) + :host (tramp-compat-string-replace " " "_" (nth 1 volume)))) (media (make-tramp-media-device :method method :host (tramp-gvfs-url-host (nth 5 volume)) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 2851110826..1ce6542d1a 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3764,7 +3764,7 @@ Fall back to normal file name handler if no Tramp handler exists." ;; Make events a list of symbols. events (mapcar - (lambda (x) (intern-soft (replace-regexp-in-string "_" "-" x))) + (lambda (x) (intern-soft (tramp-compat-string-replace "_" "-" x))) (split-string events "," 'omit)))) ;; "gio monitor". ((setq command (tramp-get-remote-gio-monitor v)) @@ -3836,11 +3836,11 @@ Fall back to normal file name handler if no Tramp handler exists." (tramp-message proc 6 "%S\n%s" proc string) (setq string (concat rest-string string) ;; Fix action names. - string (replace-regexp-in-string + string (tramp-compat-string-replace "attributes changed" "attribute-changed" string) - string (replace-regexp-in-string + string (tramp-compat-string-replace "changes done" "changes-done-hint" string) - string (replace-regexp-in-string + string (tramp-compat-string-replace "renamed to" "moved" string)) ;; https://bugs.launchpad.net/bugs/1742946 (when @@ -3848,7 +3848,7 @@ Fall back to normal file name handler if no Tramp handler exists." (delete-process proc)) ;; Delete empty lines. - (setq string (replace-regexp-in-string "\n\n" "\n" string)) + (setq string (tramp-compat-string-replace "\n\n" "\n" string)) (while (string-match (eval-when-compile @@ -3896,7 +3896,7 @@ Fall back to normal file name handler if no Tramp handler exists." (tramp-message proc 6 "%S\n%s" proc string) (setq string (concat rest-string string) ;; Attribute change is returned in unused wording. - string (replace-regexp-in-string + string (tramp-compat-string-replace "ATTRIB CHANGED" "ATTRIBUTE_CHANGED" string)) (while (string-match @@ -3913,7 +3913,7 @@ Fall back to normal file name handler if no Tramp handler exists." proc (list (intern-soft - (replace-regexp-in-string + (tramp-compat-string-replace "_" "-" (downcase (match-string 4 string))))) ;; File names are returned as absolute paths. We must ;; add the remote prefix. @@ -3952,7 +3952,7 @@ Fall back to normal file name handler if no Tramp handler exists." (mapcar (lambda (x) (intern-soft - (replace-regexp-in-string "_" "-" (downcase x)))) + (tramp-compat-string-replace "_" "-" (downcase x)))) (split-string (match-string 1 line) "," 'omit)) (or (match-string 3 line) (file-name-nondirectory (process-get proc 'watch-name)))))) @@ -4006,7 +4006,7 @@ Only send the definition if it has not already been done." vec 5 (format-message "Sending script `%s'" name) ;; In bash, leading TABs like in `tramp-vc-registered-read-file-names' ;; could result in unwanted command expansion. Avoid this. - (setq script (replace-regexp-in-string + (setq script (tramp-compat-string-replace (make-string 1 ?\t) (make-string 8 ? ) script)) ;; The script could contain a call of Perl. This is masked with `%s'. (when (and (string-match-p "%s" script) @@ -4675,7 +4675,7 @@ Goes through the list `tramp-local-coding-commands' and ?n (concat "2>" (tramp-get-remote-null-device vec)) ?o (tramp-get-remote-od vec))) - value (replace-regexp-in-string "%" "%%" value))) + value (tramp-compat-string-replace "%" "%%" value))) (tramp-maybe-send-script vec value name) (setq rem-enc name))) (tramp-message @@ -4704,7 +4704,7 @@ Goes through the list `tramp-local-coding-commands' and ?n (concat "2>" (tramp-get-remote-null-device vec)) ?o (tramp-get-remote-od vec))) - value (replace-regexp-in-string "%" "%%" value))) + value (tramp-compat-string-replace "%" "%%" value))) (when (string-match-p "\\(^\\|[^%]\\)%t" value) (setq tmpfile (tramp-make-tramp-temp-name vec) value diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index cafa97cec0..e521371332 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -464,8 +464,8 @@ pass to the OPERATION." (let* ((share (tramp-smb-get-share v)) (localname (file-name-as-directory - (replace-regexp-in-string - "\\\\" "/" (tramp-smb-get-localname v)))) + (tramp-compat-string-replace + "\\" "/" (tramp-smb-get-localname v)))) (tmpdir (tramp-compat-make-temp-name)) (args (list (concat "//" host "/" share) "-E")) (options tramp-smb-options)) @@ -777,8 +777,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (with-tramp-file-property v localname "file-acl" (when (executable-find tramp-smb-acl-program) (let* ((share (tramp-smb-get-share v)) - (localname (replace-regexp-in-string - "\\\\" "/" (tramp-smb-get-localname v))) + (localname (tramp-compat-string-replace + "\\" "/" (tramp-smb-get-localname v))) (args (list (concat "//" host "/" share) "-E")) (options tramp-smb-options)) @@ -1445,10 +1445,10 @@ component is used as the target of the symlink." (when (and (stringp acl-string) (executable-find tramp-smb-acl-program)) (let* ((share (tramp-smb-get-share v)) - (localname (replace-regexp-in-string - "\\\\" "/" (tramp-smb-get-localname v))) + (localname (tramp-compat-string-replace + "\\" "/" (tramp-smb-get-localname v))) (args (list (concat "//" host "/" share) "-E" "-S" - (replace-regexp-in-string + (tramp-compat-string-replace "\n" "," acl-string))) (options tramp-smb-options)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 6ae79be9e3..c367182057 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -112,6 +112,13 @@ Any level x includes messages for all levels 1 .. x-1. The levels are 10 traces (huge)." :type 'integer) +(defcustom tramp-debug-to-file nil + "Whether Tramp debug messages shall be saved to file. +The debug file has the same name as the debug buffer, written to +`temporary-file-directory'." + :version "28.1" + :type 'boolean) + (defcustom tramp-backup-directory-alist nil "Alist of filename patterns and backup directory names. Each element looks like (REGEXP . DIRECTORY), with the same meaning like @@ -1722,8 +1729,7 @@ The outline level is equal to the verbosity of the Tramp message." (defun tramp-get-debug-buffer (vec) "Get the debug buffer for VEC." - (with-current-buffer - (get-buffer-create (tramp-debug-buffer-name vec)) + (with-current-buffer (get-buffer-create (tramp-debug-buffer-name vec)) (when (bobp) (setq buffer-undo-list t) ;; Activate `outline-mode'. This runs `text-mode-hook' and @@ -1732,8 +1738,7 @@ The outline level is equal to the verbosity of the Tramp message." ;; `(custom-declare-variable outline-minor-mode-prefix ...)' ;; raises on error in `(outline-mode)', we don't want to see it ;; in the traces. - (let ((default-directory (tramp-compat-temporary-file-directory)) - signal-hook-function) + (let ((default-directory (tramp-compat-temporary-file-directory))) (outline-mode)) (set (make-local-variable 'outline-level) 'tramp-debug-outline-level) (set (make-local-variable 'font-lock-keywords) @@ -1743,56 +1748,73 @@ The outline level is equal to the verbosity of the Tramp message." (use-local-map special-mode-map)) (current-buffer))) +(defun tramp-get-debug-file-name (vec) + "Get the debug buffer for VEC." + (expand-file-name + (tramp-compat-string-replace "/" " " (tramp-debug-buffer-name vec)) + (tramp-compat-temporary-file-directory))) + (defsubst tramp-debug-message (vec fmt-string &rest arguments) "Append message to debug buffer of VEC. Message is formatted with FMT-STRING as control string and the remaining ARGUMENTS to actually emit the message (if applicable)." - (with-current-buffer (tramp-get-debug-buffer vec) - (goto-char (point-max)) - ;; Headline. - (when (bobp) - (insert - (format - ";; Emacs: %s Tramp: %s -*- mode: outline; -*-" - emacs-version tramp-version)) - (when (>= tramp-verbose 10) - (let ((tramp-verbose 0)) + (let ((inhibit-message t) + file-name-handler-alist message-log-max signal-hook-function) + (with-current-buffer (tramp-get-debug-buffer vec) + (goto-char (point-max)) + (let ((point (point))) + ;; Headline. + (when (bobp) (insert (format - "\n;; Location: %s Git: %s/%s" - (locate-library "tramp") - (or tramp-repository-branch "") - (or tramp-repository-version "")))))) - (unless (bolp) - (insert "\n")) - ;; Timestamp. - (let ((now (current-time))) - (insert (format-time-string "%T." now)) - (insert (format "%06d " (nth 2 now)))) - ;; Calling Tramp function. We suppress compat and trace functions - ;; from being displayed. - (let ((btn 1) btf fn) - (while (not fn) - (setq btf (nth 1 (backtrace-frame btn))) - (if (not btf) - (setq fn "") - (and (symbolp btf) (setq fn (symbol-name btf)) - (or (not (string-match-p "^tramp" fn)) - (get btf 'tramp-suppress-trace)) - (setq fn nil)) - (setq btn (1+ btn)))) - ;; The following code inserts filename and line number. Should - ;; be inactive by default, because it is time consuming. -; (let ((ffn (find-function-noselect (intern fn)))) -; (insert -; (format -; "%s:%d: " -; (file-name-nondirectory (buffer-file-name (car ffn))) -; (with-current-buffer (car ffn) -; (1+ (count-lines (point-min) (cdr ffn))))))) - (insert (format "%s " fn))) - ;; The message. - (insert (apply #'format-message fmt-string arguments)))) + ";; Emacs: %s Tramp: %s -*- mode: outline; -*-" + emacs-version tramp-version)) + (when (>= tramp-verbose 10) + (let ((tramp-verbose 0)) + (insert + (format + "\n;; Location: %s Git: %s/%s" + (locate-library "tramp") + (or tramp-repository-branch "") + (or tramp-repository-version ""))))) + ;; Delete debug file. + (when (and tramp-debug-to-file (tramp-get-debug-file-name vec)) + (ignore-errors (delete-file (tramp-get-debug-file-name vec))))) + (unless (bolp) + (insert "\n")) + ;; Timestamp. + (let ((now (current-time))) + (insert (format-time-string "%T." now)) + (insert (format "%06d " (nth 2 now)))) + ;; Calling Tramp function. We suppress compat and trace + ;; functions from being displayed. + (let ((btn 1) btf fn) + (while (not fn) + (setq btf (nth 1 (backtrace-frame btn))) + (if (not btf) + (setq fn "") + (and (symbolp btf) (setq fn (symbol-name btf)) + (or (not (string-match-p "^tramp" fn)) + (get btf 'tramp-suppress-trace)) + (setq fn nil)) + (setq btn (1+ btn)))) + ;; The following code inserts filename and line number. + ;; Should be inactive by default, because it is time consuming. + ;; (let ((ffn (find-function-noselect (intern fn)))) + ;; (insert + ;; (format + ;; "%s:%d: " + ;; (file-name-nondirectory (buffer-file-name (car ffn))) + ;; (with-current-buffer (car ffn) + ;; (1+ (count-lines (point-min) (cdr ffn))))))) + (insert (format "%s " fn))) + ;; The message. + (insert (apply #'format-message fmt-string arguments)) + ;; Write message to debug file. + (when tramp-debug-to-file + (ignore-errors + (write-region + point (point-max) (tramp-get-debug-file-name vec) 'append))))))) (put #'tramp-debug-message 'tramp-suppress-trace t) commit 3d712d50d65a89d56bc937c5d001ac450c9c947f Author: Michael Albinus Date: Tue Dec 1 13:36:07 2020 +0100 * etc/NEWS: Add user option 'tramp-debug-to-file'. diff --git a/etc/NEWS b/etc/NEWS index 2fb33e342e..5408ea996f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -490,7 +490,7 @@ tags to be considered as well. +++ *** New user option 'gnus-paging-select-next'. -This controls what happens when using commands like `SPC' and `DEL' to +This controls what happens when using commands like 'SPC' and 'DEL' to page the current article. If non-nil (the default), go to the next/prev article, but if nil, do nothing at the end/start of the article. @@ -842,6 +842,12 @@ performance of asynchronous remote processes" node of the Tramp manual for details, and also for a discussion or restrictions. This feature is experimental. ++++ +*** New user option 'tramp-debug-to-file'. +When non-nil, this user option instructs Tramp to mirror the debug +buffer to a file under the "/tmp/" directory. This is useful, if (in +rare cases) Tramp blocks Emacs, and we need further debug information. + ** Tempo --- @@ -1526,7 +1532,7 @@ mouse now pops up a TTY menu by default instead of running the command ** text-scale-mode --- -*** text-scale-mode can now adjust font size of the header line. +*** 'text-scale-mode' can now adjust font size of the header line. When the new buffer local variable 'text-scale-remap-header-line' is non-nil, 'text-scale-adjust' will also scale the text in the header line when displaying that buffer. @@ -1812,7 +1818,7 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el. * Lisp Changes in Emacs 28.1 --- -** `defvar` detects the error of defining a variable currently lexically bound. +** 'defvar' detects the error of defining a variable currently lexically bound. Such mixes are always signs that the outer lexical binding was an error and should have used dynamic binding instead. @@ -1825,7 +1831,7 @@ a prefix string, and a suffix string. +++ ** 'read-char-from-minibuffer' and 'y-or-n-p' support 'help-form'. If you bind 'help-form' to a non-nil value while calling these functions, -then pressing 'C-h' (help-char) causes the function to evaluate 'help-form' +then pressing 'C-h' ('help-char') causes the function to evaluate 'help-form' and display the result. +++ @@ -2018,7 +2024,7 @@ file can affect code in another. For details, see the manual section "(Elisp) Converting to Lexical Binding". +++ -** 'byte-recompile-directory' can now compile symlinked .el files. +** 'byte-recompile-directory' can now compile symlinked ".el" files. This is achieved by giving a non-nil FOLLOW-SYMLINKS parameter. --- commit ace6eba036e64ff9eee6965951c48d0634b9c696 Author: Stefan Kangas Date: Tue Dec 1 13:34:17 2020 +0100 Fix byte-compiler warning for failed uses of lexical vars * lisp/emacs-lisp/bytecomp.el (byte-compile-form): Fix byte-compiler warning for failed uses of lexical vars. (Bug#44980) * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--define-warning-file-test): Don't prefix tests with 'warn'. (bytecomp/error-lexical-var-with-add-hook\.el) (bytecomp/error-lexical-var-with-remove-hook\.el) (bytecomp/error-lexical-var-with-run-hook-with-args-until-failure\.el) (bytecomp/error-lexical-var-with-run-hook-with-args-until-success\.el) (bytecomp/error-lexical-var-with-run-hook-with-args\.el) (bytecomp/error-lexical-var-with-symbol-value\.el): New tests. * test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-symbol-value.el: * test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args.el: * test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args-until-success.el: * test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args-until-failure.el: * test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-remove-hook.el: * test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-add-hook.el: New files. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index a20f363456..879f08a09f 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3203,7 +3203,7 @@ for symbols generated by the byte compiler itself." run-hook-with-args-until-failure)) (pcase (cdr form) (`(',var . ,_) - (when (assq var byte-compile-lexical-variables) + (when (memq var byte-compile-lexical-variables) (byte-compile-report-error (format-message "%s cannot use lexical var `%s'" fn var)))))) ;; Warn about using obsolete hooks. diff --git a/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-add-hook.el b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-add-hook.el new file mode 100644 index 0000000000..5f390898e6 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-add-hook.el @@ -0,0 +1,4 @@ +;;; -*- lexical-binding: t; -*- +(let ((foo nil)) + (add-hook 'foo #'next-line) + foo) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-remove-hook.el b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-remove-hook.el new file mode 100644 index 0000000000..eaa625eba1 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-remove-hook.el @@ -0,0 +1,4 @@ +;;; -*- lexical-binding: t; -*- +(let ((foo nil)) + (remove-hook 'foo #'next-line) + foo) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args-until-failure.el b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args-until-failure.el new file mode 100644 index 0000000000..7a116ad464 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args-until-failure.el @@ -0,0 +1,3 @@ +;;; -*- lexical-binding: t; -*- +(let ((foo nil)) + (run-hook-with-args-until-failure 'foo)) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args-until-success.el b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args-until-success.el new file mode 100644 index 0000000000..96d10a343d --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args-until-success.el @@ -0,0 +1,3 @@ +;;; -*- lexical-binding: t; -*- +(let ((foo nil)) + (run-hook-with-args-until-success 'foo #'next-line)) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args.el b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args.el new file mode 100644 index 0000000000..bb9101bd07 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-run-hook-with-args.el @@ -0,0 +1,3 @@ +;;; -*- lexical-binding: t; -*- +(let ((foo nil)) + (run-hook-with-args 'foo)) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-symbol-value.el b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-symbol-value.el new file mode 100644 index 0000000000..5f390898e6 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/error-lexical-var-with-symbol-value.el @@ -0,0 +1,4 @@ +;;; -*- lexical-binding: t; -*- +(let ((foo nil)) + (add-hook 'foo #'next-line) + foo) diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index bea9663d24..d9052da543 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -548,7 +548,7 @@ Subtests signal errors if something goes wrong." (should (equal (funcall 'def) -1))) (defmacro bytecomp--define-warning-file-test (file re-warning &optional reverse) - `(ert-deftest ,(intern (format "bytecomp-warn/%s" file)) () + `(ert-deftest ,(intern (format "bytecomp/%s" file)) () :expected-result ,(if reverse :failed :passed) (with-current-buffer (get-buffer-create "*Compile-Log*") (let ((inhibit-read-only t)) (erase-buffer)) @@ -556,9 +556,29 @@ Subtests signal errors if something goes wrong." (ert-info ((buffer-string) :prefix "buffer: ") (should (re-search-forward ,re-warning)))))) -(bytecomp--define-warning-file-test "warn-free-setq.el" "free.*foo") +(bytecomp--define-warning-file-test "error-lexical-var-with-add-hook.el" + "add-hook.*lexical var") -(bytecomp--define-warning-file-test "warn-free-variable-reference.el" "free.*bar") +(bytecomp--define-warning-file-test "error-lexical-var-with-remove-hook.el" + "remove-hook.*lexical var") + +(bytecomp--define-warning-file-test "error-lexical-var-with-run-hook-with-args-until-failure.el" + "args-until-failure.*lexical var") + +(bytecomp--define-warning-file-test "error-lexical-var-with-run-hook-with-args-until-success.el" + "args-until-success.*lexical var") + +(bytecomp--define-warning-file-test "error-lexical-var-with-run-hook-with-args.el" + "args.*lexical var") + +(bytecomp--define-warning-file-test "error-lexical-var-with-symbol-value.el" + "symbol-value.*lexical var") + +(bytecomp--define-warning-file-test "warn-free-setq.el" + "free.*foo") + +(bytecomp--define-warning-file-test "warn-free-variable-reference.el" + "free.*bar") (bytecomp--define-warning-file-test "warn-obsolete-defun.el" "foo-obsolete.*obsolete function.*99.99") commit 8a27b0cad7dcffd0af9b3b38028ac12276a85c1b Author: Zajcev Evgeny Date: Tue Dec 1 09:33:05 2020 +0100 Fix use of 'switch-to-buffer-preserve-window-point' * lisp/window.el (switch-to-buffer): Respect buffer local value of 'switch-to-buffer-preserve-window-point' variable. diff --git a/lisp/window.el b/lisp/window.el index 82976bf836..daa5c67df8 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8566,13 +8566,13 @@ Return the buffer switched to." (when set-window-start-and-point (let* ((entry (assq buffer (window-prev-buffers))) - (displayed (and (eq switch-to-buffer-preserve-window-point - 'already-displayed) + (preserve-win-point + (buffer-local-value 'switch-to-buffer-preserve-window-point + buffer)) + (displayed (and (eq preserve-win-point 'already-displayed) (get-buffer-window buffer 0)))) (set-window-buffer nil buffer) - (when (and entry - (or (eq switch-to-buffer-preserve-window-point t) - displayed)) + (when (and entry (or (eq preserve-win-point t) displayed)) ;; Try to restore start and point of buffer in the selected ;; window (Bug#4041). (set-window-start (selected-window) (nth 1 entry) t) commit 4457b9590c83f0245604cf6a706383d9aa2c659c Author: Stefan Kangas Date: Tue Dec 1 04:46:33 2020 +0100 Add tests for some byte-compiler warnings * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-warn/warn-interactive-only\.el) (bytecomp-warn/warn-obsolete-defun\.el) (bytecomp-warn/warn-obsolete-hook\.el) (bytecomp-warn/warn-obsolete-variable-same-file\.el) (bytecomp-warn/warn-obsolete-variable\.el): New tests. * test/lisp/emacs-lisp/bytecomp-resources/warn-interactive-only.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-defun.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-hook.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-variable-same-file.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-variable.el: New files. diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-interactive-only.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-interactive-only.el new file mode 100644 index 0000000000..9e0c99bd30 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-interactive-only.el @@ -0,0 +1,3 @@ +;;; -*- lexical-binding: t -*- +(defun foo () + (next-line)) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-defun.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-defun.el new file mode 100644 index 0000000000..2a7af617ac --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-defun.el @@ -0,0 +1,8 @@ +;;; -*- lexical-binding: t -*- + +(defun foo-obsolete () + (declare (obsolete nil "99.99")) + nil) + +(defun foo () + (foo-obsolete)) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-hook.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-hook.el new file mode 100644 index 0000000000..078e6e4a3a --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-hook.el @@ -0,0 +1,3 @@ +;;; -*- lexical-binding: t -*- +(defun foo () + (add-hook 'bytecomp--tests-obsolete-var #'next-line)) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-variable-same-file.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-variable-same-file.el new file mode 100644 index 0000000000..31deb6155b --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-variable-same-file.el @@ -0,0 +1,13 @@ +;;; -*- lexical-binding: t -*- + +(defvar foo-obsolete nil) +(make-obsolete-variable 'foo-obsolete nil "99.99") + +;; From bytecomp.el: +;; If foo.el declares `toto' as obsolete, it is likely that foo.el will +;; actually use `toto' in order for this obsolete variable to still work +;; correctly, so paradoxically, while byte-compiling foo.el, the presence +;; of a make-obsolete-variable call for `toto' is an indication that `toto' +;; should not trigger obsolete-warnings in foo.el. +(defun foo () + foo-obsolete) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-variable.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-variable.el new file mode 100644 index 0000000000..9a517cc676 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-variable.el @@ -0,0 +1,4 @@ +;;; -*- lexical-binding: t -*- + +(defun foo () + bytecomp--tests-obsolete-var) diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index c9070c03b3..bea9663d24 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -560,6 +560,24 @@ Subtests signal errors if something goes wrong." (bytecomp--define-warning-file-test "warn-free-variable-reference.el" "free.*bar") +(bytecomp--define-warning-file-test "warn-obsolete-defun.el" + "foo-obsolete.*obsolete function.*99.99") + +(defvar bytecomp--tests-obsolete-var nil) +(make-obsolete-variable 'bytecomp--tests-obsolete-var nil "99.99") + +(bytecomp--define-warning-file-test "warn-obsolete-hook.el" + "bytecomp--tests-obs.*obsolete.*99.99") + +(bytecomp--define-warning-file-test "warn-obsolete-variable-same-file.el" + "foo-obs.*obsolete.*99.99" t) + +(bytecomp--define-warning-file-test "warn-obsolete-variable.el" + "bytecomp--tests-obs.*obsolete.*99.99") + +(bytecomp--define-warning-file-test "warn-interactive-only.el" + "next-line.*interactive use only.*forward-line") + (ert-deftest test-eager-load-macro-expansion-eval-when-compile () ;; Make sure we interpret eval-when-compile forms properly. CLISP ;; and SBCL interpreter eval-when-compile (well, the CL equivalent) commit 749e4b7e0b04948f4805455e9505c6b855a84c96 Author: Dmitry Gutov Date: Tue Dec 1 03:46:27 2020 +0200 Reset xref-show-xrefs-function temporarily * lisp/dired-aux.el (dired-do-find-regexp-and-replace): Make sure xref-show-xrefs-function has the necessary value (bug#44905). diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 7f988540c2..18fb4b0b8b 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -3023,7 +3023,13 @@ REGEXP should use constructs supported by your local `grep' command." (query-replace-read-args "Query replace regexp in marked files" t t))) (list (nth 0 common) (nth 1 common)))) - (with-current-buffer (dired-do-find-regexp from) + (require 'xref) + (defvar xref-show-xrefs-function) + (with-current-buffer + (let ((xref-show-xrefs-function + ;; Some future-proofing (bug#44905). + (eval (car (get 'xref-show-xrefs-function 'standard-value))))) + (dired-do-find-regexp from)) (xref-query-replace-in-results from to))) (defun dired-nondirectory-p (file) commit 90a543e630012cc58c175d5bf3ffd42bb156c6b6 Author: Stefan Kangas Date: Mon Nov 30 22:44:09 2020 +0100 Decrease code duplication in byte-compiler free-vars warning * lisp/emacs-lisp/bytecomp.el (byte-compile-free-vars-warn): New defun extracted from... (byte-compile-variable-ref, byte-compile-variable-set): ...here. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 9ece8ec6f0..a20f363456 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3432,6 +3432,27 @@ for symbols generated by the byte compiler itself." (push var byte-compile-bound-variables) (byte-compile-dynamic-variable-op 'byte-varbind var)) +(defun byte-compile-free-vars-warn (var &optional assignment) + "Warn if symbol VAR refers to a free variable. +VAR must not be lexically bound. +If optional argument ASSIGNMENT is non-nil, this is treated as an +assignment (i.e. `setq'). " + (unless (or (not (byte-compile-warning-enabled-p 'free-vars var)) + (boundp var) + (memq var byte-compile-bound-variables) + (memq var (if assignment + byte-compile-free-assignments + byte-compile-free-references))) + (let* ((varname (prin1-to-string var)) + (desc (if assignment "assignment" "reference")) + (suggestions (help-uni-confusable-suggestions varname))) + (byte-compile-warn "%s to free variable `%s'%s" + desc varname + (if suggestions (concat "\n " suggestions) ""))) + (push var (if assignment + byte-compile-free-assignments + byte-compile-free-references)))) + (defun byte-compile-variable-ref (var) "Generate code to push the value of the variable VAR on the stack." (byte-compile-check-variable var 'reference) @@ -3440,15 +3461,7 @@ for symbols generated by the byte compiler itself." ;; VAR is lexically bound (byte-compile-stack-ref (cdr lex-binding)) ;; VAR is dynamically bound - (unless (or (not (byte-compile-warning-enabled-p 'free-vars var)) - (boundp var) - (memq var byte-compile-bound-variables) - (memq var byte-compile-free-references)) - (let* ((varname (prin1-to-string var)) - (suggestions (help-uni-confusable-suggestions varname))) - (byte-compile-warn "reference to free variable `%s'%s" varname - (if suggestions (concat "\n " suggestions) ""))) - (push var byte-compile-free-references)) + (byte-compile-free-vars-warn var) (byte-compile-dynamic-variable-op 'byte-varref var)))) (defun byte-compile-variable-set (var) @@ -3459,15 +3472,7 @@ for symbols generated by the byte compiler itself." ;; VAR is lexically bound. (byte-compile-stack-set (cdr lex-binding)) ;; VAR is dynamically bound. - (unless (or (not (byte-compile-warning-enabled-p 'free-vars var)) - (boundp var) - (memq var byte-compile-bound-variables) - (memq var byte-compile-free-assignments)) - (let* ((varname (prin1-to-string var)) - (suggestions (help-uni-confusable-suggestions varname))) - (byte-compile-warn "assignment to free variable `%s'%s" varname - (if suggestions (concat "\n " suggestions) ""))) - (push var byte-compile-free-assignments)) + (byte-compile-free-vars-warn var t) (byte-compile-dynamic-variable-op 'byte-varset var)))) (defmacro byte-compile-get-constant (const) commit a126c3684f8854f8c0d7ab5dcf55f31bac77dcf9 Author: Stefan Kangas Date: Mon Nov 30 22:42:08 2020 +0100 Test byte-compiler free variable warning * test/lisp/emacs-lisp/bytecomp-tests.el (ert-x): Require. (bytecomp--define-warning-file-test): New macro. (bytecomp-warn/warn-free-setq\.el) (bytecomp-warn/warn-free-variable-reference\.el): New tests. * test/lisp/emacs-lisp/bytecomp-resources/warn-free-setq.el: * test/lisp/emacs-lisp/bytecomp-resources/warn-free-variable-reference.el: New files. diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-free-setq.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-free-setq.el new file mode 100644 index 0000000000..6e187129c9 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-free-setq.el @@ -0,0 +1,2 @@ +;;; -*- lexical-binding: t -*- +(setq foo 'bar) diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-free-variable-reference.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-free-variable-reference.el new file mode 100644 index 0000000000..50a9527287 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-free-variable-reference.el @@ -0,0 +1,4 @@ +;;; -*- lexical-binding: t -*- +(defvar xxx-test) +(defun foo () + (setq xxx-test bar)) diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index 680aa514a2..c9070c03b3 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -26,6 +26,7 @@ ;;; Commentary: (require 'ert) +(require 'ert-x) (require 'cl-lib) (require 'subr-x) (require 'bytecomp) @@ -546,6 +547,19 @@ Subtests signal errors if something goes wrong." '(eval-and-compile (defmacro abc (arg) -1) (defun def () (abc 2)))) (should (equal (funcall 'def) -1))) +(defmacro bytecomp--define-warning-file-test (file re-warning &optional reverse) + `(ert-deftest ,(intern (format "bytecomp-warn/%s" file)) () + :expected-result ,(if reverse :failed :passed) + (with-current-buffer (get-buffer-create "*Compile-Log*") + (let ((inhibit-read-only t)) (erase-buffer)) + (byte-compile-file ,(ert-resource-file file)) + (ert-info ((buffer-string) :prefix "buffer: ") + (should (re-search-forward ,re-warning)))))) + +(bytecomp--define-warning-file-test "warn-free-setq.el" "free.*foo") + +(bytecomp--define-warning-file-test "warn-free-variable-reference.el" "free.*bar") + (ert-deftest test-eager-load-macro-expansion-eval-when-compile () ;; Make sure we interpret eval-when-compile forms properly. CLISP ;; and SBCL interpreter eval-when-compile (well, the CL equivalent) commit 713bac483b4b3b7c0116ba8cd832eb9a9ecbd536 Author: Stefan Kangas Date: Mon Nov 30 19:56:59 2020 +0100 * lisp/so-long.el: Doc fix to reduce use of passive voice. diff --git a/lisp/so-long.el b/lisp/so-long.el index 6ae8d0aec8..431073a2a1 100644 --- a/lisp/so-long.el +++ b/lisp/so-long.el @@ -50,15 +50,14 @@ ;; performance further, as well as making the so-long activity more obvious to ;; the user. These kinds of minified files are typically not intended to be ;; edited, so not providing the usual editing mode in such cases will rarely be -;; an issue. However, should the user wish to do so, the original state of the -;; buffer may be reinstated by calling `so-long-revert' (the key binding for -;; which is advertised when the major mode change occurs). If you prefer that -;; the major mode not be changed, the `so-long-minor-mode' action can be -;; configured. +;; an issue. However, you can reinstate the original state of the buffer by +;; calling `so-long-revert' (the key binding of which is advertised when the major +;; mode change occurs). If you prefer that the major mode not be changed, you +;; can customize the `so-long-minor-mode' action. ;; ;; The user options `so-long-action' and `so-long-action-alist' determine what -;; will happen when `so-long' and `so-long-revert' are invoked, allowing -;; alternative actions (including custom actions) to be configured. As well as +;; actions `so-long' and `so-long-revert' will take. This allows you to configure +;; alternative actions (including custom actions). As well as ;; the major and minor mode actions provided by this library, `longlines-mode' ;; is also supported by default as an alternative action. ;; commit 3e6525d69f0de68fe2305f8e2102c8a5ce42f671 Author: Eli Zaretskii Date: Mon Nov 30 20:44:11 2020 +0200 Don't show in 'view-lossage' responses to xterm feature queries * lisp/term/xterm.el (xterm--read-event-for-query): Prevent recording the characters read as the xterm response to a query, so as not to show them in 'view-lossage'. (Bug#44908) diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 1a727e3933..709410064b 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -767,7 +767,8 @@ Can be nil to mean \"no timeout\".") By not redisplaying right away for xterm queries, we can avoid unsightly flashing during initialization. Give up and redisplay anyway if we've been waiting a little while." - (let ((start-time (current-time))) + (let ((start-time (current-time)) + (inhibit--record-char t)) (or (let ((inhibit-redisplay t)) (read-event nil nil xterm-query-redisplay-timeout)) (read-event nil nil commit 9fbff9c35cb4a6c5099178d6c712690ea4614d6a Author: Eli Zaretskii Date: Mon Nov 30 20:42:06 2020 +0200 ; * src/buffer.c: Fix comment describing 'buffer_defaults'. diff --git a/src/buffer.c b/src/buffer.c index 5433c80edb..f252f3d7eb 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -67,8 +67,9 @@ struct buffer buffer_defaults; /* This structure marks which slots in a buffer have corresponding default values in buffer_defaults. - Each such slot has a nonzero value in this structure. - The value has only one nonzero bit. + Each such slot has a value in this structure. + The value is a positive Lisp integer that must be smaller than + MAX_PER_BUFFER_VARS. When a buffer has its own local value for a slot, the entry for that slot (found in the same slot in this structure) commit 31dcc70e555482fee59df2d8aa1939360d8f8c69 Author: Michael Albinus Date: Mon Nov 30 13:54:29 2020 +0100 Some adaptions to tramp-tests.el * test/lisp/net/tramp-tests.el (tramp-test-vec): Check for remote `tramp-test-temporary-file-directory'. (tramp-test11-copy-file, tramp-test12-rename-file): Do not skip for tramp-gvfs.el. (tramp--test-sh-p): Use `tramp-test-vec'. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index eeb838be30..819a3dfecf 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -113,7 +113,8 @@ "Temporary directory for Tramp tests.") (defconst tramp-test-vec - (tramp-dissect-file-name tramp-test-temporary-file-directory) + (and (file-remote-p tramp-test-temporary-file-directory) + (tramp-dissect-file-name tramp-test-temporary-file-directory)) "The used `tramp-file-name' structure.") (setq auth-source-save-behavior nil @@ -2542,9 +2543,8 @@ This checks also `file-name-as-directory', `file-name-directory', ;; Copy file to directory. (unwind-protect - ;; FIXME: This fails on my QNAP server, see - ;; /share/Web/owncloud/data/owncloud.log - (unless (or (tramp--test-ange-ftp-p) (tramp--test-nextcloud-p)) + ;; This doesn't work on FTP. + (unless (tramp--test-ange-ftp-p) (write-region "foo" nil source) (should (file-exists-p source)) (make-directory target) @@ -2568,9 +2568,8 @@ This checks also `file-name-as-directory', `file-name-directory', ;; Copy directory to existing directory. (unwind-protect - ;; FIXME: This fails on my QNAP server, see - ;; /share/Web/owncloud/data/owncloud.log - (unless (or (tramp--test-ange-ftp-p) (tramp--test-nextcloud-p)) + ;; This doesn't work on FTP. + (unless (tramp--test-ange-ftp-p) (make-directory source) (should (file-directory-p source)) (write-region "foo" nil (expand-file-name "foo" source)) @@ -2591,9 +2590,8 @@ This checks also `file-name-as-directory', `file-name-directory', ;; Copy directory/file to non-existing directory. (unwind-protect - ;; FIXME: This fails on my QNAP server, see - ;; /share/Web/owncloud/data/owncloud.log - (unless (or (tramp--test-ange-ftp-p) (tramp--test-nextcloud-p)) + ;; This doesn't work on FTP. + (unless (tramp--test-ange-ftp-p) (make-directory source) (should (file-directory-p source)) (write-region "foo" nil (expand-file-name "foo" source)) @@ -2686,9 +2684,8 @@ This checks also `file-name-as-directory', `file-name-directory', ;; Rename directory to existing directory. (unwind-protect - ;; FIXME: This fails on my QNAP server, see - ;; /share/Web/owncloud/data/owncloud.log - (unless (or (tramp--test-ange-ftp-p) (tramp--test-nextcloud-p)) + ;; This doesn't work on FTP. + (unless (tramp--test-ange-ftp-p) (make-directory source) (should (file-directory-p source)) (write-region "foo" nil (expand-file-name "foo" source)) @@ -2710,9 +2707,8 @@ This checks also `file-name-as-directory', `file-name-directory', ;; Rename directory/file to non-existing directory. (unwind-protect - ;; FIXME: This fails on my QNAP server, see - ;; /share/Web/owncloud/data/owncloud.log - (unless (or (tramp--test-ange-ftp-p) (tramp--test-nextcloud-p)) + ;; This doesn't work on FTP. + (unless (tramp--test-ange-ftp-p) (make-directory source) (should (file-directory-p source)) (write-region "foo" nil (expand-file-name "foo" source)) @@ -5711,8 +5707,7 @@ This does not support special file names." (defun tramp--test-sh-p () "Check, whether the remote host runs a based method from tramp-sh.el." - (tramp-sh-file-name-handler-p - (tramp-dissect-file-name tramp-test-temporary-file-directory))) + (tramp-sh-file-name-handler-p tramp-test-vec)) (defun tramp--test-share-p () "Check, whether the method needs a share." commit 84a4dd13587ca1704c669900b8143be0b87e2364 Author: Michael Albinus Date: Mon Nov 30 13:44:44 2020 +0100 Adapt Tramp versions * doc/misc/tramp.texi (Obtaining @value{tramp}): (Remote shell setup, Remote processes, Archive file names): * lisp/net/trampver.el (customize-package-emacs-version-alist): Adapt Tramp versions. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 3a6e425405..f853c6d7af 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -319,14 +319,14 @@ behind the scenes when you open a file with @value{tramp}. @uref{https://ftp.gnu.org/gnu/tramp/}. The version number of @value{tramp} can be obtained by the variable @code{tramp-version}. For released @value{tramp} versions, this is a three-number string -like ``2.4.3''. +like ``2.4.5''. A @value{tramp} release, which is packaged with Emacs, could differ slightly from the corresponding standalone release. This is because it isn't always possible to synchronize release dates between Emacs and @value{tramp}. Such version numbers have the Emacs version number -as suffix, like ``2.4.3.27.1''. This means @w{@value{tramp} 2.4.3} as -integrated in @w{Emacs 27.1}. A complete list of @value{tramp} +as suffix, like ``2.4.5.27.2''. This means @w{@value{tramp} 2.4.5} as +integrated in @w{Emacs 27.2}. A complete list of @value{tramp} versions packaged with Emacs can be retrieved by @vindex customize-package-emacs-version-alist @@ -338,7 +338,7 @@ versions packaged with Emacs can be retrieved by ELPA} package. Besides the standalone releases, further minor version of @value{tramp} will appear on GNU ELPA, until the next @value{tramp} release appears. These minor versions have a four-number string, like -``2.4.3.1''. +``2.4.5.1''. @value{tramp} development versions are available on Git servers. Development versions contain new and incomplete features. The @@ -2335,7 +2335,7 @@ string of that environment variable looks always like @example @group echo $INSIDE_EMACS -@result{} 27.1,tramp:2.4.3 +@result{} 27.2,tramp:2.4.5 @end group @end example @@ -3193,9 +3193,9 @@ integrated to work with @value{tramp}: @file{shell.el}, @value{tramp} always modifies the @env{INSIDE_EMACS} environment variable for remote processes. Per default, this environment variable shows the Emacs version. @value{tramp} adds its own version string, -so it looks like @samp{27.1,tramp:2.4.3.1}. However, other packages +so it looks like @samp{27.2,tramp:2.4.5.1}. However, other packages might also add their name to this environment variable, like -@samp{27.1,comint,tramp:2.4.3.1}. +@samp{27.2,comint,tramp:2.4.5.1}. For @value{tramp} to find the command on the remote, it must be accessible through the default search path as setup by @value{tramp} @@ -3948,7 +3948,7 @@ row are possible, like @file{/path/to/dir/file.tar.gz.uu/dir/file}. @vindex tramp-archive-all-gvfs-methods An archive file name could be a remote file name, as in -@file{/ftp:anonymous@@ftp.gnu.org:/gnu/tramp/tramp-2.4.3.tar.gz/INSTALL}. +@file{/ftp:anonymous@@ftp.gnu.org:/gnu/tramp/tramp-2.4.5.tar.gz/INSTALL}. Since all file operations are mapped internally to @acronym{GVFS} operations, remote file names supported by @code{tramp-gvfs} perform better, because no local copy of the file archive must be downloaded @@ -3959,7 +3959,7 @@ the similar @samp{/scp:user@@host:...}. See the constant If @code{url-handler-mode} is enabled, archives could be visited via URLs, like -@file{https://ftp.gnu.org/gnu/tramp/tramp-2.4.3.tar.gz/INSTALL}. This +@file{https://ftp.gnu.org/gnu/tramp/tramp-2.4.5.tar.gz/INSTALL}. This allows complex file operations like @lisp @@ -3967,8 +3967,8 @@ allows complex file operations like (progn (url-handler-mode 1) (ediff-directories - "https://ftp.gnu.org/gnu/tramp/tramp-2.4.2.tar.gz/tramp-2.4.2" - "https://ftp.gnu.org/gnu/tramp/tramp-2.4.3.tar.gz/tramp-2.4.3" "")) + "https://ftp.gnu.org/gnu/tramp/tramp-2.4.4.tar.gz/tramp-2.4.4" + "https://ftp.gnu.org/gnu/tramp/tramp-2.4.5.tar.gz/tramp-2.4.5" "")) @end group @end lisp diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 8d21133b3b..d6b582edf8 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -92,7 +92,7 @@ ("2.2.13.25.2" . "25.3") ("2.3.3" . "26.1") ("2.3.3.26.1" . "26.1") ("2.3.5.26.2" . "26.2") ("2.3.5.26.3" . "26.3") - ("2.4.3.27.1" . "27.1"))) + ("2.4.3.27.1" . "27.1") ("2.4.5.27.2" . "27.2"))) (add-hook 'tramp-unload-hook (lambda () commit 9e0085064b2f48f0f3bc52159da94ab4424fef6f Author: Michael Albinus Date: Mon Nov 30 13:19:19 2020 +0100 Adapt Tramp versions. Do not merge * doc/misc/tramp.texi (Obtaining @value{tramp}) (Remote shell setup, Remote processes, Archive file names): * doc/misc/trampver.texi: * lisp/net/tramp.el: * lisp/net/trampver.el (tramp-version) (customize-package-emacs-version-alist): Adapt Tramp versions. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index cae0abfbf3..660237bcc5 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -318,14 +318,14 @@ behind the scenes when you open a file with @value{tramp}. @uref{https://ftp.gnu.org/gnu/tramp/}. The version number of @value{tramp} can be obtained by the variable @code{tramp-version}. For released @value{tramp} versions, this is a three-number string -like ``2.4.3''. +like ``2.4.5''. A @value{tramp} release, which is packaged with Emacs, could differ slightly from the corresponding standalone release. This is because it isn't always possible to synchronize release dates between Emacs and @value{tramp}. Such version numbers have the Emacs version number -as suffix, like ``2.4.3.27.1''. This means @value{tramp} 2.4.3 as -integrated in Emacs 27.1. A complete list of @value{tramp} versions +as suffix, like ``2.4.5.27.2''. This means @value{tramp} 2.4.5 as +integrated in Emacs 27.2. A complete list of @value{tramp} versions packaged with Emacs can be retrieved by @vindex customize-package-emacs-version-alist @@ -337,7 +337,7 @@ packaged with Emacs can be retrieved by ELPA} package. Besides the standalone releases, further minor version of @value{tramp} will appear on GNU ELPA, until the next @value{tramp} release appears. These minor versions have a four-number string, like -``2.4.3.1''. +``2.4.5.1''. @value{tramp} development versions are available on Git servers. Development versions contain new and incomplete features. The @@ -2299,7 +2299,7 @@ string of that environment variable looks always like @example @group echo $INSIDE_EMACS -@result{} 27.1,tramp:2.4.3 +@result{} 27.2,tramp:2.4.5 @end group @end example @@ -3047,9 +3047,9 @@ integrated to work with @value{tramp}: @file{shell.el}, @value{tramp} always modifies the @env{INSIDE_EMACS} environment variable for remote processes. Per default, this environment variable shows the Emacs version. @value{tramp} adds its own version string, -so it looks like @samp{27.1,tramp:2.4.3.1}. However, other packages +so it looks like @samp{27.2,tramp:2.4.5.1}. However, other packages might also add their name to this environment variable, like -@samp{27.1,comint,tramp:2.4.3.1}. +@samp{27.2,comint,tramp:2.4.5.1}. For @value{tramp} to find the command on the remote, it must be accessible through the default search path as setup by @value{tramp} @@ -3731,7 +3731,7 @@ row are possible, like @file{/path/to/dir/file.tar.gz.uu/dir/file}. @vindex tramp-archive-all-gvfs-methods An archive file name could be a remote file name, as in -@file{/ftp:anonymous@@ftp.gnu.org:/gnu/tramp/tramp-2.4.3.tar.gz/INSTALL}. +@file{/ftp:anonymous@@ftp.gnu.org:/gnu/tramp/tramp-2.4.5.tar.gz/INSTALL}. Since all file operations are mapped internally to @acronym{GVFS} operations, remote file names supported by @code{tramp-gvfs} perform better, because no local copy of the file archive must be downloaded @@ -3742,7 +3742,7 @@ the similar @samp{/scp:user@@host:...}. See the constant If @code{url-handler-mode} is enabled, archives could be visited via URLs, like -@file{https://ftp.gnu.org/gnu/tramp/tramp-2.4.3.tar.gz/INSTALL}. This +@file{https://ftp.gnu.org/gnu/tramp/tramp-2.4.5.tar.gz/INSTALL}. This allows complex file operations like @lisp @@ -3750,8 +3750,8 @@ allows complex file operations like (progn (url-handler-mode 1) (ediff-directories - "https://ftp.gnu.org/gnu/tramp/tramp-2.4.2.tar.gz/tramp-2.4.2" - "https://ftp.gnu.org/gnu/tramp/tramp-2.4.3.tar.gz/tramp-2.4.3" "")) + "https://ftp.gnu.org/gnu/tramp/tramp-2.4.4.tar.gz/tramp-2.4.4" + "https://ftp.gnu.org/gnu/tramp/tramp-2.4.5.tar.gz/tramp-2.4.5" "")) @end group @end lisp diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi index cc3c768fe6..137d130aa8 100644 --- a/doc/misc/trampver.texi +++ b/doc/misc/trampver.texi @@ -8,7 +8,7 @@ @c In the Tramp GIT, the version numbers are auto-frobbed from @c tramp.el, and the bug report address is auto-frobbed from @c configure.ac. -@set trampver 2.4.5-pre +@set trampver 2.4.5.27.2 @set tramp-bug-report-address tramp-devel@@gnu.org @set emacsver 24.4 diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 5a08fa8933..cf8ec69cb3 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -7,7 +7,7 @@ ;; Maintainer: Michael Albinus ;; Keywords: comm, processes ;; Package: tramp -;; Version: 2.4.5-pre +;; Version: 2.4.5.27.2 ;; Package-Requires: ((emacs "24.4")) ;; Package-Type: multi ;; URL: https://savannah.gnu.org/projects/tramp diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 4aed8abd9b..8838d56ac8 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -39,7 +39,7 @@ (defvar inhibit-message) ;;;###tramp-autoload -(defconst tramp-version "2.4.5-pre" +(defconst tramp-version "2.4.5.27.2" "This version of Tramp.") ;;;###tramp-autoload @@ -75,7 +75,7 @@ ;; Check for Emacs version. (let ((x (if (not (string-lessp emacs-version "24.4")) "ok" - (format "Tramp 2.4.5-pre is not fit for %s" + (format "Tramp 2.4.5.27.2 is not fit for %s" (replace-regexp-in-string "\n" "" (emacs-version)))))) (unless (string-equal "ok" x) (error "%s" x))) @@ -95,7 +95,7 @@ ("2.2.13.25.2" . "25.3") ("2.3.3" . "26.1") ("2.3.3.26.1" . "26.1") ("2.3.5.26.2" . "26.2") ("2.3.5.26.3" . "26.3") - ("2.4.3.27.1" . "27.1"))) + ("2.4.3.27.1" . "27.1") ("2.4.5.27.2" . "27.2"))) (add-hook 'tramp-unload-hook (lambda () commit fa2c9421760989aef8984d86552194f5a9e97543 Author: Dmitry Gutov Date: Mon Nov 30 03:33:14 2020 +0200 Improve docstrings * lisp/progmodes/project.el (project-find-file) (project-or-external-find-file): More accurate docstrings (bug#44588). diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index a395453491..39c3ca8417 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -745,7 +745,9 @@ pattern to search for." ;;;###autoload (defun project-find-file () "Visit a file (with completion) in the current project. -The completion default is the string at point." + +The completion default is the filename at point, determined by +`thing-at-point' (whether such file exists or not)." (interactive) (let* ((pr (project-current t)) (dirs (list (project-root pr)))) @@ -754,7 +756,9 @@ The completion default is the string at point." ;;;###autoload (defun project-or-external-find-file () "Visit a file (with completion) in the current project or external roots. -The completion default is the string at point." + +The completion default is the filename at point, determined by +`thing-at-point' (whether such file exists or not)." (interactive) (let* ((pr (project-current t)) (dirs (cons commit 41c338474dd1e086494337fd18ec8828cef1a75c Author: Philipp Stephani Date: Sun Nov 29 21:13:02 2020 +0100 Fix double-free bug when finalizing module runtimes. * src/emacs-module.c (finalize_runtime_unwind): Don't finalize initial environment twice. * test/src/emacs-module-resources/mod-test.c (emacs_module_init): Allocate lots of values during module initialization to trigger the bug. diff --git a/src/emacs-module.c b/src/emacs-module.c index 5f97815ec1..0f3ef59fd8 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c @@ -1506,8 +1506,8 @@ finalize_environment_unwind (void *env) void finalize_runtime_unwind (void *raw_ert) { - struct emacs_runtime *ert = raw_ert; - finalize_environment (ert->private_members->env); + /* No further cleanup is required, as the initial environment is + unwound separately. See the logic in Fmodule_load. */ } diff --git a/test/src/emacs-module-resources/mod-test.c b/test/src/emacs-module-resources/mod-test.c index 419621256a..f855e9b6da 100644 --- a/test/src/emacs-module-resources/mod-test.c +++ b/test/src/emacs-module-resources/mod-test.c @@ -806,6 +806,12 @@ emacs_module_init (struct emacs_runtime *ert) strlen (interactive_spec))); bind_function (env, "mod-test-identity", identity_fn); + /* We allocate lots of values to trigger bugs in the frame allocator during + initialization. */ + int count = 10000; /* larger than value_frame_size in emacs-module.c */ + for (int i = 0; i < count; ++i) + env->make_integer (env, i); + provide (env, "mod-test"); return 0; } commit 367727b0f6ed2468c909b9883740bff101d5a68f Author: Juri Linkov Date: Sun Nov 29 21:54:53 2020 +0200 * lisp/simple.el (read-from-kill-ring): Call current-kill to prefill kill-ring diff --git a/lisp/simple.el b/lisp/simple.el index 93fda7de8a..7d0c229cad 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5459,6 +5459,8 @@ With ARG, rotate that many kills forward (or backward, if negative)." (defvar read-from-kill-ring-history) (defun read-from-kill-ring () "Read a string from `kill-ring' using completion and minibuffer history." + ;; `current-kill' updates `kill-ring' with a possible interprogram-paste + (current-kill 0) (let* ((history-add-new-input nil) (ellipsis (if (char-displayable-p ?…) "…" "...")) ;; Remove keymaps from text properties of copied string, commit 6355fa518330bc97b31d77147f77c38b39563820 Author: Juri Linkov Date: Sun Nov 29 21:48:01 2020 +0200 Fix MINIBUF 'nomini' arg for windmove/window-in-direction (bug#44932) * lisp/windmove.el (windmove-display-in-direction) (windmove-delete-in-direction, windmove-swap-states-in-direction): Add 'nomini' as MINIBUF arg of window-in-direction. * lisp/window.el (window-in-direction): Rename arg MINI to MINIBUF. Update docstring from walk-window-tree. Send MINIBUF arg to walk-window-tree unchanged. diff --git a/lisp/windmove.el b/lisp/windmove.el index 6557960064..5db13cf6b3 100644 --- a/lisp/windmove.el +++ b/lisp/windmove.el @@ -485,7 +485,7 @@ When `switch-to-buffer-obey-display-actions' is non-nil, (t (window-in-direction dir nil nil (and arg (prefix-numeric-value arg)) - windmove-wrap-around))))) + windmove-wrap-around 'nomini))))) (unless window (setq window (split-window nil nil dir) type 'window)) (cons window type))) @@ -569,7 +569,7 @@ select the window at direction DIR. When `windmove-wrap-around' is non-nil, takes the window from the opposite side of the frame." (let ((other-window (window-in-direction dir nil nil arg - windmove-wrap-around t))) + windmove-wrap-around 'nomini))) (cond ((null other-window) (user-error "No window %s from selected window" dir)) (t @@ -637,7 +637,7 @@ a single modifier. Default value of PREFIX is `C-x' and MODIFIERS is `shift'." When `windmove-wrap-around' is non-nil, takes the window from the opposite side of the frame." (let ((other-window (window-in-direction dir nil nil nil - windmove-wrap-around t))) + windmove-wrap-around 'nomini))) (cond ((or (null other-window) (window-minibuffer-p other-window)) (user-error "No window %s from selected window" dir)) (t diff --git a/lisp/window.el b/lisp/window.el index d564ec5546..82976bf836 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -2309,7 +2309,7 @@ SIDE can be any of the symbols `left', `top', `right' or ;; Neither of these allow one to selectively ignore specific windows ;; (windows whose `no-other-window' parameter is non-nil) as targets of ;; the movement. -(defun window-in-direction (direction &optional window ignore sign wrap mini) +(defun window-in-direction (direction &optional window ignore sign wrap minibuf) "Return window in DIRECTION as seen from WINDOW. More precisely, return the nearest window in direction DIRECTION as seen from the position of `window-point' in window WINDOW. @@ -2332,10 +2332,11 @@ frame borders. This means to return for WINDOW at the top of the frame and DIRECTION `above' the minibuffer window if the frame has one, and a window at the bottom of the frame otherwise. -Optional argument MINI nil means to return the minibuffer window -if and only if it is currently active. MINI non-nil means to -return the minibuffer window even when it's not active. However, -if WRAP is non-nil, always act as if MINI were nil. +Optional argument MINIBUF t means to return the minibuffer +window even if it isn't active. MINIBUF nil or omitted means +to return the minibuffer window if and only if it is currently active. +MINIBUF neither nil nor t means never return the minibuffer window. +However, if WRAP is non-nil, always act as if MINIBUF were nil. Return nil if no suitable window can be found." (setq window (window-normalize-window window t)) @@ -2451,7 +2452,7 @@ Return nil if no suitable window can be found." (setq best-edge-2 w-top) (setq best-diff-2 best-diff-2-new) (setq best-2 w))))) - frame nil (and mini t)) + frame nil minibuf) (or best best-2))) (defun get-window-with-predicate (predicate &optional minibuf all-frames default) commit a91ca6560cf51c6b0bb94df2962077769d0f8965 Author: Alan Third Date: Fri Nov 27 22:11:47 2020 +0000 Allow doprint to handle multibyte chars in format (bug#44349) * src/doprnt.c (doprnt): Handle the case where fmtchar is the start of a multibyte character. diff --git a/src/doprnt.c b/src/doprnt.c index 9316497720..7b742ad255 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -77,8 +77,7 @@ along with GNU Emacs. If not, see . */ where flags is [+ -0], width is [0-9]+, precision is .[0-9]+, and length is empty or l or the value of the pD or pI or PRIdMAX (sans "d") macros. A % that does not introduce a valid %-sequence causes undefined behavior. - ASCII bytes in FORMAT other than % are copied through as-is; - non-ASCII bytes should not appear in FORMAT. + Bytes in FORMAT other than % are copied through as-is. The + flag character inserts a + before any positive number, while a space inserts a space before any positive number; these flags only affect %d, %o, @@ -175,7 +174,13 @@ doprnt_non_null_end (char *buffer, ptrdiff_t bufsize, char const *format, Returns the number of bytes stored into BUFFER, excluding the terminating null byte. Output is always null-terminated. String arguments are passed as C strings. - Integers are passed as C integers. */ + Integers are passed as C integers. + + FIXME: If FORMAT_END is not at a character boundary + doprnt_non_null_end will cut the string in the middle of the + character and the returned string will have an incomplete character + sequence at the end. We may prefer to cut at a character + boundary. */ ptrdiff_t doprnt (char *buffer, ptrdiff_t bufsize, const char *format, @@ -486,14 +491,25 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, src = uLSQM, srclen = sizeof uLSQM - 1; else if (EQ (quoting_style, Qcurve) && fmtchar == '\'') src = uRSQM, srclen = sizeof uRSQM - 1; - else + else if (! LEADING_CODE_P (fmtchar)) { if (EQ (quoting_style, Qstraight) && fmtchar == '`') fmtchar = '\''; - eassert (ASCII_CHAR_P (fmtchar)); + *bufptr++ = fmtchar; continue; } + else + { + int charlen = BYTES_BY_CHAR_HEAD (fmtchar); + src = fmt0; + + /* If the format string ends in the middle of a multibyte + character we don't want to skip over the NUL byte. */ + for (srclen = 1 ; *(src + srclen) != 0 && srclen < charlen ; srclen++); + + fmt = src + srclen; + } if (bufsize < srclen) { commit 38ed05f49fcfe7c6d6908041010881a04a7ff6b1 Author: Protesilaos Stavrou Date: Sun Nov 29 11:43:38 2020 +0100 Make log-view-commit-body less intrusive * lisp/vc/log-view.el (log-view-commit-body): Inherit from font-lock-comment-face. This makes expanded commit messages in log-view look the same as they did prior to commit 1f0b929430 (consult bug#44424) (bug#44937). diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el index 56ecc64671..e7b6eea807 100644 --- a/lisp/vc/log-view.el +++ b/lisp/vc/log-view.el @@ -208,15 +208,7 @@ If it is nil, `log-view-toggle-entry-display' does nothing.") "Face for the message header line in `log-view-mode'." :group 'log-view) -(defface log-view-commit-body - '((((class color) (min-colors 88) (background light)) - :background "gray95" :foreground "black" :extend t) - (((class color) (min-colors 88) (background dark)) - :background "gray5" :foreground "white" :extend t) - (((class color) (min-colors 8) (background light)) - :foreground "black") - (((class color) (min-colors 8) (background dark)) - :foreground "white")) +(defface log-view-commit-body '((t :inherit font-lock-comment-face)) "Face for the commit body in `log-view-mode'." :version "28.1") commit 9939c435c108b099d3362ecbfa1cba6cc0bbd8f9 Author: Akira Kyle Date: Sun Nov 29 11:40:47 2020 +0100 Return the correct suffix in eww-make-unique-file-name * lisp/net/eww.el (eww-make-unique-file-name): Return the correct suffix (bug#44936). diff --git a/lisp/net/eww.el b/lisp/net/eww.el index d6f850ca3b..13b9058865 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1661,7 +1661,7 @@ Use link at point if there is one, else the current page's URL." (suffix "")) (when (string-match "\\`\\(.*\\)\\([.][^.]+\\)" file) (setq stem (match-string 1 file) - suffix (match-string 2))) + suffix (match-string 2 file))) (while (file-exists-p (expand-file-name file directory)) (setq file (format "%s(%d)%s" stem count suffix)) (setq count (1+ count))) commit bb0e6fb8862480dbabc971a1ef34721a701c1288 Author: Lars Ingebrigtsen Date: Sun Nov 29 11:10:42 2020 +0100 frame-position doc string clarificaton * src/frame.c (Fframe_position): Mention that the values are system-dependent (bug#32977). diff --git a/src/frame.c b/src/frame.c index b33c521fb6..17ec455d2d 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3634,7 +3634,11 @@ DEFUN ("frame-position", Fframe_position, FRAME must be a live frame and defaults to the selected one. The return value is a cons (x, y) of the coordinates of the top left corner of FRAME's outer frame, in pixels relative to an origin (0, 0) of FRAME's -display. */) +display. + +Note that the values returned are not guaranteed to be accurate: The +values depend on the underlying window system, and some systems add a +constant offset to the values. */) (Lisp_Object frame) { register struct frame *f = decode_live_frame (frame); commit 70c8ed55fdda7631e5e930bba81395ba9d8d1751 Author: Lars Ingebrigtsen Date: Sun Nov 29 11:05:10 2020 +0100 garbage-collect doc string clarification * src/alloc.c (Fgarbage_collect): Mention that calling this function is not guaranteed to collect all the garbage (bug#34404). diff --git a/src/alloc.c b/src/alloc.c index 504ef179ec..34f822e589 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -6154,10 +6154,17 @@ where each entry has the form (NAME SIZE USED FREE), where: - FREE is the number of those objects that are not live but that Emacs keeps around for future allocations (maybe because it does not know how to return them to the OS). + However, if there was overflow in pure space, and Emacs was dumped using the 'unexec' method, `garbage-collect' returns nil, because real GC can't be done. -See Info node `(elisp)Garbage Collection'. */) + +Note that calling this function does not guarantee that absolutely all +unreachable objects will be garbage-collected. Emacs uses a +mark-and-sweep garbage collector, but is conservative when it comes to +collecting objects in some circumstances. + +For further details, see Info node `(elisp)Garbage Collection'. */) (void) { if (garbage_collection_inhibited) commit c8f3e95ae66fdbac4768a823c3527bbd89932d12 Author: Lars Ingebrigtsen Date: Sun Nov 29 10:54:58 2020 +0100 Tweak eww-use-browse-url doc string * lisp/net/eww.el (eww-use-browse-url): Tweak doc string wording. diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 597ce95c67..0c43fc609a 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -58,7 +58,7 @@ (defcustom eww-use-browse-url "\\`mailto:" "eww will use `browse-url' when following links that match this regexp. -The action to be taken can further be customized via +The action to be taken can be further customized via `browse-url-handlers'." :version "28.1" :type 'regexp) commit 17fa17be3d93fc10f6ca91d738d5056b1b9f1f1e Author: Karl Fogel Date: Sat Nov 28 18:17:46 2020 -0600 Save bookmarks by using `write-file' (bug#12507) Go back to using `write-file' to save bookmarks, instead of using `write-region'. This means numbered backups of the bookmark file may get made again, depending on the value of `bookmark-version-control'. Thanks especially to Drew Adams and Eli Zaretskii for their persistence in tracking down information relevant to this change. diff --git a/lisp/bookmark.el b/lisp/bookmark.el index e69d9f529c..4766f61d1b 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -1475,7 +1475,32 @@ for a file, defaulting to the file defined by variable ((eq 'nospecial bookmark-version-control) version-control) (t t)))) (condition-case nil - (write-region (point-min) (point-max) file) + ;; There was a stretch of time (about 15 years) when we + ;; used `write-region' below instead of `write-file', + ;; before going back to `write-file' again. So if you're + ;; considering changing it to `write-region', please see + ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=12507. + ;; That bug tells the story of how we first started using + ;; `write-region' in 2005... + ;; + ;; commit a506054af7cd86a63fda996056c09310966f32ef + ;; Author: Karl Fogel + ;; AuthorDate: Sat Nov 12 20:30:22 2005 +0000 + ;; + ;; (bookmark-write-file): Don't visit the + ;; destination file, just write the data to it + ;; using write-region. This is similar to + ;; 2005-05-29T08:36:26Z!rms@gnu.org of saveplace.el, + ;; but with an additional change to avoid visiting + ;; the file in the first place. + ;; + ;; ...and of how further inquiry led us to investigate (in + ;; 2012 and then again in 2020) and eventually decide that + ;; matching the saveplace.el change doesn't make sense for + ;; bookmark.el. Therefore we reverted to `write-file', + ;; which means numbered backups may now be created, + ;; depending on `bookmark-version-control' as per above. + (write-file file) (file-error (message "Can't write %s" file))) (setq bookmark-file-coding-system coding-system-for-write) (kill-buffer (current-buffer)) commit 2cdf1fd261128976c5769b7959e7b98e5425a3fd Author: Eli Zaretskii Date: Sat Nov 28 19:05:18 2020 +0200 Fix filing messages when 'rmail-output-reset-deleted-flag' is non-nil * lisp/mail/rmailout.el (rmail-output): Fix off-by-one error in deciding when to advance to the next message under non-nil 'rmail-output-reset-deleted-flag'. (Bug#44839) diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el index 49531eab91..cfde335b54 100644 --- a/lisp/mail/rmailout.el +++ b/lisp/mail/rmailout.el @@ -579,7 +579,7 @@ from a non-Rmail buffer. In this case, COUNT is ignored." (progn (if rmail-delete-after-output (rmail-delete-message)) - (if (> count 0) + (if (>= count 0) (let ((msgnum rmail-current-message)) (rmail-next-message 1) (eq rmail-current-message (1+ msgnum))))) commit 769dc33df7ec9ac81aa52c336d2a61c32ddbd50f Author: Lele Gaifax Date: Sat Nov 28 09:48:09 2020 +0100 Update TUTORIAL.it * etc/tutorials/TUTORIAL.it: Follow changes made to TUTORIAL in the last year diff --git a/etc/tutorials/TUTORIAL.it b/etc/tutorials/TUTORIAL.it index e19486ac87..448937bf17 100644 --- a/etc/tutorials/TUTORIAL.it +++ b/etc/tutorials/TUTORIAL.it @@ -1,18 +1,18 @@ Esercitazione di Emacs. Condizioni d'uso alla fine del file. -I comandi di Emacs comportano generalmente l'uso del tasto CONTROL (a -volte indicato con CTRL o CTL) o del tasto META (a volte indicato con -EDIT o ALT). Piuttosto che indicarli per esteso ogni volta, useremo +I comandi di Emacs comportano generalmente l'uso del tasto CONTROL +(spesso indicato con CTRL) o del tasto META (di solito indicato con +ALT). Piuttosto che indicarli per esteso ogni volta, useremo le seguenti abbreviazioni: C- significa che bisogna tenere abbassato il tasto CONTROL mentre si preme il carattere . Quindi C-f significa: tieni premuto CONTROL e batti f. - M- significa che bisogna tenere abbassato il tasto META o EDIT - o ALT mentre si preme il carattere . Se non ci sono - tasti META, EDIT o ALT, al loro posto si può premere e poi - rilasciare il tasto ESC e quindi premere . Useremo - per indicare il tasto ESC. + M- significa che bisogna tenere abbassato il tasto META o ALT + mentre si preme il carattere . Se non ci sono tasti + META o ALT, al loro posto si può premere e poi rilasciare + il tasto ESC e quindi premere . Useremo per + indicare il tasto ESC. Nota importante: per chiudere una sessione di lavoro di Emacs usa C-x C-c (due caratteri). @@ -20,7 +20,7 @@ Per annullare un comando inserito parzialmente usa C-g. Per terminare l'esercitazione, usa C-x k quindi al prompt. I caratteri “>>” posti al margine sinistro indicano le direttive per provare a usare un comando. Per esempio: -<> +<> [Spaziatura inserita a scopo didattico. Il testo continua sotto] >> Adesso premi C-v (vedi schermata successiva) per spostarti alla prossima schermata (vai avanti, tieni premuto il tasto @@ -33,11 +33,12 @@ alla schermata successiva, favorendo così la continuità di lettura. La prima cosa che bisogna imparare è come raggiungere un certo punto del testo. Sai già come andare avanti di una schermata, con C-v. Per andare indietro di una schermata, premi M-v (tieni premuto il tasto -META e poi premi v, oppure usa v se non c'è un tasto META, EDIT o -ALT). +META e poi premi v, oppure usa v se non c'è un tasto META o ALT). >> Ora prova: premi M-v e quindi C-v alcune volte. +Puoi ovviamente spostarti avanti e indietro in questo testo in altri +modi, se li conosci. * SOMMARIO ---------- @@ -207,11 +208,11 @@ Molti comandi di Emacs accettano un argomento numerico che spesso serve a conteggiare per quante volte vanno ripetuti. Il modo in cui si può fornire ad un comando il numero di ripetizioni è il seguente: si usa C-u e quindi si indicano le cifre prima di impartire il comando -stesso. Se esiste un tasto META (o EDIT o ALT) c'è un modo -alternativo: si battono le cifre tenendo premuto il tasto META. Noi -consigliamo di imparare il metodo con C-u perché funziona su tutti i -terminali. L'argomento numerico è anche chiamato “argomento -prefisso”, perché viene indicato prima del comando a cui si riferisce. +stesso. Se esiste un tasto META (o ALT) c'è un modo alternativo: si +battono le cifre tenendo premuto il tasto META. Noi consigliamo di +imparare il metodo con C-u perché funziona su tutti i terminali. +L'argomento numerico è anche chiamato “argomento prefisso”, perché +viene indicato prima del comando a cui si riferisce. Per esempio, C-u 8 C-f sposta il cursore in avanti di otto caratteri. @@ -502,9 +503,10 @@ usare per annullare l'inserimento del testo). >> Elimina questa riga con C-k poi usa C-/ e dovrebbe ricomparire. C-_ è un comando di annullamento alternativo, funziona esattamente -come C-/. Su alcuni terminali, la sequenza C-/ invia effettivamente -C-_ a Emacs. Alternativamente, anche C-x u ha la stessa funzione di -C-/, ma è leggermente più scomoda da inserire. +come C-/. Su alcune tastiere non è necessario usare il tasto shift +per inserire C-_. Su alcuni terminali, la sequenza C-/ invia +effettivamente C-_ a Emacs. Alternativamente, anche C-x u ha la +stessa funzione di C-/, ma è leggermente più scomoda da inserire. Un argomento numerico per C-/, C-_ o C-x u agisce come numero delle ripetizioni da effettuare. @@ -651,11 +653,12 @@ la possibilità di salvare il buffer del primo file: sarebbe fastidioso dover prima passare a quel buffer per salvarlo con C-x C-s. Così c'è il comando - C-x s Salva alcuni buffer + C-x s Salva alcuni buffer nei loro file -C-x s chiede conferma del salvataggio per ogni buffer che contiene -testo modificato e non ancora salvato. Chiede, per ognuno di quei -buffer, se si voglia salvarne il contenuto nel file corrispondente. +C-x s chiede conferma del salvataggio per ogni buffer associato ad un +file che contiene testo modificato e non ancora salvato. Chiede, per +ognuno di quei buffer, se si voglia salvarne il contenuto nel file +corrispondente. >> Inserisci una riga di testo e poi premi C-x s. Dovrebbe chiederti se vuoi salvare il file chiamato “...TUTORIAL”. @@ -701,14 +704,14 @@ gestisce la posta. Ci sono molti comandi C-x. Ecco una lista di quelli già conosciuti: - C-x C-f Apri un file. - C-x C-s Salva un file. - C-x s Salva alcuni buffer. - C-x C-b Elenca buffer. - C-x b Passa a un altro buffer. - C-x C-c Chiudi Emacs. - C-x 1 Elimina tutte le finestre tranne una. - C-x u Annulla. + C-x C-f Apri un file + C-x C-s Salva il buffer sul file + C-x s Salva alcuni buffer sui loro file + C-x C-b Elenca buffer + C-x b Passa a un altro buffer + C-x C-c Chiudi Emacs + C-x 1 Elimina tutte le finestre tranne una + C-x u Annulla I comandi estesi con nome sono usati ancora meno spesso, oppure sono usati solo in certe modalità. Un esempio è il comando replace-string @@ -749,7 +752,7 @@ salvataggio automatico. Se il computer si blocca si può recuperare il file salvato automaticamente aprendo il file in modo normale (il file che si stava scrivendo, non quello di salvataggio automatico) e usando poi M-x -recover-file. Quando viene chiesta la conferma si risponda +recover-this-file. Quando viene chiesta la conferma si risponda con yes per procedere con il recupero dei dati salvati automaticamente. @@ -1091,8 +1094,8 @@ quindi anche come breve descrizione, sufficiente per ricordarsi di comandi già imparati. I comandi con più caratteri come ad esempio C-x C-s e (se non c'è il -tasto META o EDIT o ALT) v sono permessi allo stesso modo dopo -una richiesta di aiuto fatta con C-h c. +tasto META o ALT) v sono permessi allo stesso modo dopo una +richiesta di aiuto fatta con C-h c. Per avere ulteriori informazioni su un comando si usa C-h k invece che C-h c. @@ -1156,7 +1159,7 @@ Puoi imparare di più su Emacs leggendo il suo manuale, sia nella forma stampata piuttosto che da dentro Emacs stesso (usa il menu Help oppure C-h r). Due funzionalità che possono farti comodo sono il completamento automatico, che consente di ridurre il numero di -caratteri da digitare, e dired, che semplifica la gestione dei file. +caratteri da digitare, e Dired, che semplifica la gestione dei file. Il completamento è un modo per evitare la pressione di tasti quando non sia necessario. Ad esempio, quando vuoi passare al buffer commit a72db8ab8bfe417d40707be6e791c084509f4abf Author: Michael Albinus Date: Sat Nov 28 12:31:43 2020 +0100 Make file copying in tramp-gvfs more robust * test/lisp/net/tramp-tests.el (tramp-test11-copy-file) (tramp-test12-rename-file): Do not skip for tramp-gvfs.el. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): Add sanity checks. diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index e369061664..b457f54fd5 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -800,14 +800,23 @@ file names." (with-tramp-progress-reporter v 0 (format "%s %s to %s" msg-operation filename newname) (unless - (apply - #'tramp-gvfs-send-command v gvfs-operation - (append - (and (eq op 'copy) (or keep-date preserve-uid-gid) - '("--preserve")) - (list - (tramp-gvfs-url-file-name filename) - (tramp-gvfs-url-file-name newname)))) + (and (apply + #'tramp-gvfs-send-command v gvfs-operation + (append + (and (eq op 'copy) (or keep-date preserve-uid-gid) + '("--preserve")) + (list + (tramp-gvfs-url-file-name filename) + (tramp-gvfs-url-file-name newname)))) + ;; Some backends do not return a proper error + ;; code in case of direct copy/move. Apply sanity checks. + (or (not equal-remote) + (tramp-gvfs-send-command + v "gvfs-info" (tramp-gvfs-url-file-name newname)) + (eq op 'copy) + (not (tramp-gvfs-send-command + v "gvfs-info" + (tramp-gvfs-url-file-name filename))))) (if (or (not equal-remote) (and equal-remote diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index e42765ba08..26889c9a25 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2494,9 +2494,8 @@ This checks also `file-name-as-directory', `file-name-directory', ;; Copy file to directory. (unwind-protect - ;; FIXME: This fails on my QNAP server, see - ;; /share/Web/owncloud/data/owncloud.log - (unless (or (tramp--test-ange-ftp-p) (tramp--test-nextcloud-p)) + ;; This doesn't work on FTP. + (unless (tramp--test-ange-ftp-p) (write-region "foo" nil source) (should (file-exists-p source)) (make-directory target) @@ -2520,9 +2519,8 @@ This checks also `file-name-as-directory', `file-name-directory', ;; Copy directory to existing directory. (unwind-protect - ;; FIXME: This fails on my QNAP server, see - ;; /share/Web/owncloud/data/owncloud.log - (unless (or (tramp--test-ange-ftp-p) (tramp--test-nextcloud-p)) + ;; This doesn't work on FTP. + (unless (tramp--test-ange-ftp-p) (make-directory source) (should (file-directory-p source)) (write-region "foo" nil (expand-file-name "foo" source)) @@ -2543,9 +2541,8 @@ This checks also `file-name-as-directory', `file-name-directory', ;; Copy directory/file to non-existing directory. (unwind-protect - ;; FIXME: This fails on my QNAP server, see - ;; /share/Web/owncloud/data/owncloud.log - (unless (or (tramp--test-ange-ftp-p) (tramp--test-nextcloud-p)) + ;; This doesn't work on FTP. + (unless (tramp--test-ange-ftp-p) (make-directory source) (should (file-directory-p source)) (write-region "foo" nil (expand-file-name "foo" source)) @@ -2638,9 +2635,8 @@ This checks also `file-name-as-directory', `file-name-directory', ;; Rename directory to existing directory. (unwind-protect - ;; FIXME: This fails on my QNAP server, see - ;; /share/Web/owncloud/data/owncloud.log - (unless (or (tramp--test-ange-ftp-p) (tramp--test-nextcloud-p)) + ;; This doesn't work on FTP. + (unless (tramp--test-ange-ftp-p) (make-directory source) (should (file-directory-p source)) (write-region "foo" nil (expand-file-name "foo" source)) @@ -2662,9 +2658,8 @@ This checks also `file-name-as-directory', `file-name-directory', ;; Rename directory/file to non-existing directory. (unwind-protect - ;; FIXME: This fails on my QNAP server, see - ;; /share/Web/owncloud/data/owncloud.log - (unless (or (tramp--test-ange-ftp-p) (tramp--test-nextcloud-p)) + ;; This doesn't work on FTP. + (unless (tramp--test-ange-ftp-p) (make-directory source) (should (file-directory-p source)) (write-region "foo" nil (expand-file-name "foo" source)) commit bd996a9a24fcd8d84e45870469221bc517f7d9df Author: Mattias Engdegård Date: Sat Nov 28 12:28:45 2020 +0100 * etc/tutorials/TUTORIAL.sv: General copy-editing. diff --git a/etc/tutorials/TUTORIAL.sv b/etc/tutorials/TUTORIAL.sv index b60c7f93bc..fcc388f414 100644 --- a/etc/tutorials/TUTORIAL.sv +++ b/etc/tutorials/TUTORIAL.sv @@ -1,16 +1,16 @@ Emacs användarhandledning. I slutet finns kopieringsvillkoren. -Emacs-kommandon använder ofta kontrolltangenten (vanligen märkt CTRL -eller CTL) eller META-tangenten (på vissa tangentbord märkt ALT). +Emacs-kommandon använder ofta kontrolltangenten (ofta märkt CONTROL +eller CTRL) eller META-tangenten (vanligen märkt ALT). Istället för att skriva ut deras namn varje gång använder vi följande förkortningar: - C- håll ner kontrolltangenten samtidigt som du skriver bokstaven - . C-f betyder: håll ner kontrolltangenten och tryck f. - M- håll ner META- eller ALT-tangenten samtidigt som du skriver - . Om det inte finns någon META- eller ALT-tangent - trycker du på ESC-tangenten, släpper den och trycker sedan - . När vi skriver menar vi ESC-tangenten. + C- håll ner kontrolltangenten samtidigt som du skriver tecknet + . C-f betyder: håll ner kontrolltangenten och tryck f. + M- håll ner META- eller ALT-tangenten samtidigt som du skriver + . Om det inte finns någon META- eller ALT-tangent + trycker du på ESC-tangenten, släpper den och trycker sedan + . När vi skriver menar vi ESC-tangenten (eller Escape). Viktigt: För att avsluta Emacs trycker du C-x C-c (två tecken). För att avsluta kommandon som inte skrivits in fullt, tryck C-g. @@ -20,18 +20,18 @@ Tecknen ">>" i vänstermarginalen anger att du kan prova ett kommando. Till exempel: <> [Tomma rader av pedagogiska skäl. Texten fortsätter nedanför.] ->> Tryck C-v (View next screen) för att rulla nedåt i handledningen. +>> Tryck C-v för att rulla nedåt i handledningen. Prova nu. Håll ned kontrolltangenten och tryck v. Gör så i fortsättningen när du når slutet av en skärmbild. -Notera att det är ett överlapp på två rader när du rullar en hel sida. -Detta är för att behålla sammanhanget när du bläddrar framåt i texten. +Observera att det är ett överlapp på två rader när du rullar en hel sida. +Detta sker för att behålla sammanhanget när du bläddrar framåt i texten. -Det här är en kopia av Emacs användarhandledning, som anpassats något -för dig. Längre fram kommer vi att instruera dig att prova olika -kommandon som ändrar i texten. Var inte orolig om du ändrar texten -innan vi säger till dig att göra det. Det kallas för att redigera och -det är det som Emacs är till för. +Det här är ett exemplar av Emacs användarhandledning som har anpassats +något för dig. Längre fram kommer vi att be dig att prova olika kommandon +som ändrar i texten. Var inte orolig om du ändrar texten innan vi säger +till dig att göra det. Det kallas för att redigera och det är det som +Emacs är till för. Det första du behöver veta är hur du manövrerar från plats till plats i texten. Du har redan lärt dig hur du flyttar en skärmbild framåt, @@ -41,7 +41,7 @@ en META- eller ALT-tangent.) >> Prova att trycka M-v och C-v några gånger. -Det är OK att rulla texten på andra sätt om du vet hur. +Det går bra att rulla texten på andra sätt som du kanske känner till. * SAMMANFATTNING ---------------- @@ -55,12 +55,12 @@ Följande kommandon är bra för att se hela skärmbilder: KONTROLL-1.) >> Leta reda på markören och se vad som står där. Tryck sedan C-l. - Hitta markören igen och notera att det är samma text som står kring - markören nu, men nu mitt på skärmen. Om du trycker C-l igen så + Hitta markören igen och observera att det är samma text som står + kring markören nu, men nu mitt på skärmen. Om du trycker C-l igen så flyttas texten högst upp på skärmen. Tryck C-l igen och den flyttas ner till botten. -Du kan också använda PageUp och PageDn tangenterna, om din terminal +Du kan också använda tangenterna PageUp och PageDn, om din terminal har dem, för att flytta en hel skärmbild åt gången, men du redigerar effektivare om du använder C-v och M-v. @@ -88,10 +88,10 @@ fyra piltangenterna. Så här: och C-p. Använd sedan C-l för att centrera diagrammet på skärmbilden. -Detta är enklare att komma ihåg om du tänker på dessa förkortningar: P -för föregående (previous), N för nästa (next), B för bakåt (backward) -och F för framåt (forward). Du kommer att använda dessa grundläggande -kommandona hela tiden. +Kommandona är enklare att komma ihåg om man tänker på vad de står för: +P för föregående (eng. "previous"), N för nästa, B för bakåt +och F för framåt. +Du kommer att använda dessa grundläggande kommandon hela tiden. >> Gör några C-n så att du kommer ned till den här raden. @@ -104,8 +104,8 @@ avslutas också vanligtvis med ett radslut men Emacs kräver inte att den gör det. >> Prova med C-b i början av en rad. Detta gör att markören - flyttas till slutet av den tidigare raden. Detta är för att den - flyttar markören över radslutstecknet. + flyttas till slutet av den tidigare raden. Detta beror på att + markören flyttas över radslutstecknet. C-f flyttar också över radslut, precis som C-b. @@ -140,12 +140,13 @@ motsatt riktning. Lägg märke till likheten mellan C-f och C-b å ena sidan och M-f och M-b å den andra. Ofta används META-kommandon till språkrelaterade operationer (ord, stycken, avsnitt), medan kontrollkommandon används -till grundläggande operationer som inte beror av vad man redigerar +till grundläggande operationer som inte beror på vad man redigerar (bokstäver, rader, etc.). Denna likhet finns också mellan rader och stycken: C-a och C-e flyttar -markören till början av en rad eller till slutet av en rad, medan M-a -och M-e flyttar den till början respektive slutet av ett stycke. +markören till början och till slutet av en rad, medan M-a och M-e +flyttar den till början respektive slutet av ett stycke. +(Minnesregel: A och E för (tyska) Anfang och Ende.) >> Prova några C-a och sedan några C-e. Prova också några M-a och sedan några M-e. @@ -155,8 +156,8 @@ M-a fortsätter att flytta markören till nästa stycke. Även om detta inte verkar självklart är det ganska naturligt. Platsen där markören är i texten kallas också för "arbetspunkt" -(point). Eller omskrivet: Markören visar på skärmen var arbetspunkten -är i texten. +(point). Eller med andra ord: markören visar på skärmen var +arbetspunkten är i texten. Här är en kort sammanfattning av de enklaste markörförflyttnings- kommandona, inklusive ord- och styckesförflyttningskommandon: @@ -183,10 +184,10 @@ Två andra viktiga markörrörelsekommandon är M-< (META mindre-än), som flyttar markören till början av texten, och M-> (META större-än), som flyttar den till slutet av texten. -På en del tangentbord är "<" placerad över komma, så att man måste +På svenska tangentbord är ">" placerad över "<", så att man måste använda skift för att få fram den. På dessa tangentbord måste man -också använda skift för att skriva M-<. Utan skifttangenten skulle det -bli M-komma. +också använda skift för att skriva M->. Utan skifttangenten skulle det +bli M-<. >> Prova M-< nu för att flytta markören till början av vägledningen. Använd sedan C-v för att flytta markören tillbaka hit igen. @@ -197,7 +198,7 @@ bli M-komma. Du kan också flytta markören med hjälp av piltangenterna, om terminalen har piltangenter. Vi föreslår att du lär dig C-b, C-f, C-n och C-p av tre skäl. För det första kommer de att fungera på alla -slags terminaler. För det andra kommer du att finna, när du har fått +slags terminaler. För det andra kommer du att märka, när du har fått lite träning i att använda Emacs, att det går mycket snabbare att använda kontrollfunktionerna än piltangenterna (för att du undviker att ändra fingersättningen). Den tredje anledningen är att när man har @@ -205,12 +206,12 @@ lärt sig att använda kontrolltangenten blir det lättare att lära sig de mer avancerade kontrollfunktionerna. De flesta kommandon i Emacs tar ett numeriskt argument och för de -flesta kommandon leder detta till att de repeteras. Ett numeriskt +flesta kommandon leder detta till att de upprepas. Ett numeriskt argument anges genom att du skriver C-u och sedan talet, innan du skriver kommandot. Om du har en META- eller ALT-tangent så finns det ett annat alternativ för att ge numeriska argument: skriv talet medan -du håller ned META-tangenten. Vi föreslår att du använder C-u för det -fungerar på alla slags terminaler. Det numeriska argumentet kallas +du håller ned META-tangenten. Vi föreslår att du använder C-u eftersom +det fungerar på alla slags terminaler. Det numeriska argumentet kallas också för "prefixargument" eftersom det skrivs före kommandot. Till exempel: C-u 8 C-f flyttar markören åtta steg framåt. @@ -219,8 +220,8 @@ Till exempel: C-u 8 C-f flyttar markören åtta steg framåt. kommer så nära den här raden som möjligt med ett enda kommando. De flesta kommandon använder det numeriska argumentet för ett -repeterat utförande men det finns kommandon som använder det -annorlunda. Flera kommandon, men inga av dem du lärt dig hittills, +upprepat utförande men det finns kommandon som använder det på +andra sätt. Flera kommandon, men inga av dem du lärt dig hittills, använder det som en flagga. Med ett prefixargument, och oberoende av dess värde, gör kommandot något annat. @@ -232,7 +233,7 @@ uppåt. >> Prova C-u 8 C-v nu. -Detta borde ha flyttat skärmbilden 8 rader uppåt. Om du önskar flytta +Detta borde ha flyttat skärmbilden 8 rader uppåt. Om du vill flytta tillbaka igen är det bara att ge samma argument till M-v. Om du använder ett fönstersystem, som X eller MS-Windows, finns det @@ -240,7 +241,7 @@ troligen ett rektangulärt område på sidan av Emacs-fönstret, en så kallad rullningslist. Genom att klicka i den med musen kan du rulla texten. -Om din mus har ett rullningshjul kan även den användas för att rulla +Om din mus har ett rullningshjul kan även det användas för att rulla texten. @@ -264,15 +265,15 @@ Om du av misstag slår blir du kvitt detta med ett C-g. * SPÄRRADE KOMMANDON -------------------- -En del Emacs-kommandon är "spärrade" så att nybörjare inte skall +En del Emacs-kommandon är "spärrade" för att inte nybörjare skall använda dem av misstag. Om du provar ett av dessa spärrade kommandon kommer Emacs ge ett -meddelande som berättar vilket kommando det är och kommer att fråga om +meddelande som berättar vilket kommando det är och fråga om du verkligen vill fortsätta och utföra detta kommando. -Om du verkligen önskar att utföra kommandot skriver du , -(mellanslagstangenten) som svar på frågan. Normalt, om du inte önskar +Om du verkligen önskar att utföra kommandot trycker du på +mellanslagstangenten som svar på frågan. Normalt, om du inte önskar att utföra detta kommando, svarar du "n" på frågan. >> Skriv C-x C-l (som är ett spärrat kommando). @@ -296,7 +297,7 @@ tas bort. >> Flytta markören till den här raden och tryck C-u 0 C-l. >> Tryck C-h k C-f. Se hur det här fönstret krymper samtidigt som ett nytt uppträder - för att visa dokumentationen av C-f-kommandot. + för att visa dokumentationen av kommandot C-f. >> Slå C-x 1 och se hur dokumentationsfönstret nu försvinner. @@ -310,13 +311,13 @@ kommandon är två, tre eller fyra tecken långa. Om du önskar att sätta in text är det bara att skriva in texten. Vanliga tecken, som A, 7, *, etc., sätts in direkt när du skriver dem. -Tryck på för att sätta in en radbrytning. (Det är den tangent -på tangentbordet som ibland är märkt med "Enter") +Tryck på , returtangenten, för att sätta in en radbrytning. +(Den är vanligen märkt "Return" eller "Enter" eller med en krokpil bakåt.) För att radera tecknet omedelbart före aktuell markörposition, tryck på . Det är tangenten på tangentbordet som vanligtvis är markerad -med "Backspace" -- det är samma tangent som du normal använder för att -radera det sist inmatade tecknet utanför Emacs. +med en lång vänsterpil eller "Backspace" -- det är samma tangent som du +normalt använder för att radera det sist inmatade tecknet utanför Emacs. Det kan finnas en annan tangent på ditt tangentbordet som är märkt med "Delete", men det är inte den vi menar med . @@ -327,9 +328,9 @@ Det kan finnas en annan tangent på ditt tangentbordet som är märkt med är bara en lokal kopia. När en rad blir för lång för att rymmas på en skärmbredd så fortsätter -den på raden under. Om du använder ett fönstersystem, visas små böjda +den på raden under. Om du använder ett fönstersystem så visas små böjda pilar i det lilla utrymmet på bägge sidor om textmassan (i vänster och -höger marginal) för att ange var en rad fortsätter, Om du använder +höger marginal) för att ange var en rad fortsätter. Om du använder en textterminal anges med ett bakstreck (”\”) i kolumnen längst till höger att raden fortsätter. @@ -340,7 +341,7 @@ höger att raden fortsätter. >> Använd för att radera texten tills raden ryms på en skärmbredd igen. Fortsättningstecknet kommer då att försvinna. -Du kan radera radbrytning precis som andra tecken. Genom att radera +Du kan radera radbrytningar precis som andra tecken. Genom att radera radbrytningen mellan två rader slås dessa samman till en. Om resultatet av denna sammanslagning blir för stor för att passa inom en skärmbredd, så kommer den att visas med ett fortsättningstecken. @@ -364,7 +365,7 @@ Du bör se att efter att den nya raden satts in, sätter Emacs in blanktecken så att markören flyttas fram under "T" i "Tryck". Tänk på att de flesta Emacs-kommandon kan ta numeriska argument. Detta -gäller också texttecken. Genom att repetera ett texttecken kommer det +gäller också texttecken. Genom att upprepa ett texttecken kommer det skrivas flera gånger. >> Prova det nu: Skriv C-u 8 * för att sätta in ********. @@ -403,11 +404,11 @@ tryck C-w. Detta tar bort texten mellan de två positionerna. >> Tryck C-w. Detta tar bort texten från och med D fram till just före o. -Skillnaden mellan att "ta bort" (killing) och "radera" (deleting) text +Skillnaden mellan att "ta bort" (kill) och "radera" (delete) text är att "borttagen" text kan sättas tillbaka (var som helst), medan raderad text inte kan det på det sättet. (Du kan dock ångra en radering--se nedan.) Återinsättning av borttagen text kallas -"återhämtning" (yanking). Generellt kan man säga att kommandon som +"återhämtning" (yank). Generellt kan man säga att kommandon som tar bort fler än ett tecken sparar undan texten (så att den kan återhämtas) medan kommandon som bara raderar ett tecken, eller bara raderar tomma rader och mellanrum inte sparar någonting (och den @@ -423,7 +424,7 @@ Lägg märke till att ett enstaka C-k bara raderar texten på raden och att det andra C-k raderar själva raden och flyttar upp texten på raden under ett steg. C-k hanterar numeriska argument lite speciellt. Den raderar så många rader OCH innehållet i dem. Detta är alltså inte bara -en repetition av kommandot. C-u 2 C-k raderar två rader samt de tomma +en upprepning av kommandot. C-u 2 C-k raderar två rader samt de tomma raderna, medan C-k två gånger inte kommer att göra det. Du kan antingen hämta tillbaka borttagen text till samma plats som där @@ -439,7 +440,7 @@ tillbaka den sist borttagna texten och placerar den där markören är. >> Prova: Gör C-y för att få tillbaka texten. -Om du gör flera C-k i rad så kommer all bortagen text att sparas +Om du gör flera C-k i rad så kommer all borttagen text att sparas samlat så att ett C-y återhämtar alla raderna på en gång. >> Prova detta. Tryck C-k ett par gånger. @@ -451,11 +452,11 @@ Och hämta så tillbaka igen: Men vad gör du om du har en text du önskar att hämta tillbaka men du har redan tagit bort något nytt? C-y skulle hämta tillbaka den senaste -texten som blev borttagen men tidigare bortagen text är inte +texten som blev borttagen men tidigare borttagen text är inte förlorad. Du kan få tillbaka den med kommandot M-y. Efter att du har använt C-y för att hämta tillbaka den sist borttagna texten kommer M-y ersätta denna text med tidigare borttagen text. Genom att göra M-y om -och om igen hämtas allt tidigare borttagen text tillbaka. När du har +och om igen hämtas all tidigare borttagen text tillbaka. När du har nått den önskade texten behöver du inte göra något ytterligare för att behålla den. Fortsätt bara med din redigeringen och lämna den återtagna texten där den är. @@ -478,25 +479,25 @@ Om du gör en förändring i texten och sedan ångrar dig, så kan du upphäva ändringen med ångra-kommandot C-/. Normalt kommer C-/ upphäva förändringen som gjordes av det sist -utförda kommandot. Om du repeterar C-/ flera gånger kommer varje -repetition upphäva ett kommando till. +utförda kommandot. Om du upprepar C-/ flera gånger kommer varje +upprepning upphäva ett kommando till. Det finns två undantag. Kommandon som inte förändrar texten räknas inte (detta inkluderar markörförflyttningar och bläddringskommandon), -och inskrivna enkelbokstäver blir vanligtvis grupperade i grupper om -upp till 20 tecken. Detta är för att reducera antalet C-/ som behövs +och inskrivna enkelbokstäver blir vanligtvis samlade i grupper om +upp till 20 tecken. Detta görs för att reducera antalet C-/ som behövs för att ångra inskriven text. >> Ta bort den här raden med C-k, hämta sedan tillbaka den med C-/. -C-_ är ett alternativt ångra-kommandot. Den fungerar exakt på samma +C-_ är ett alternativt ångra-kommando. Det fungerar exakt på samma sätt som C-/. På vissa textterminaler skickar C-/ faktiskt C-_ till Emacs. Även C-x u fungerar precis som C-/, men är inte lika enkelt att skriva. Ett numeriskt argument till C-/, C-_ eller C-x u medför upprepning. -Du kan ångra radering av text precis på samma sätt som du kan ångra +Du kan ångra radering av text precis på samma sätt som att du kan ångra att du tagit bort text. Skillnaden mellan att ta bort och att radera någonting påverkar endast om du kan hämta tillbaka det med C-y. För ångerfunktionen spelar det ingen roll hur texten försvunnit. @@ -515,19 +516,18 @@ sätt är det som om du förändrar själva filen men förändringen du gör kommer inte bli permanent förrän filen sparas (save). Detta är för att undvika att halvförändrade filer sparas när du inte vill det. Till och med när du sparar filen kommer Emacs att behålla originalet under ett -nytt namn, som backup, ifall du senare ångrar alltihop. +nytt namn, som säkerhetskopia, ifall du senare ångrar alltihop. Om du tittar nästan längst ner på skärmbilden så kommer du se en rad -som börjar med minustecken, och som startar med "-:--- TUTORIAL.sv" +som börjar med minustecken, och som startar med "U:--- TUTORIAL.sv" eller något snarlikt. Denna del av skärmbilden visar normalt namnet på -filen du besöker. Just nu besöker du din personlig kopia av +filen du besöker. Just nu besöker du ditt personliga exemplar av vägledningen till Emacs, vilken heter "TUTORIAL.sv". Vilken fil du än är inne i så kommer filnamnet stå där. En annan sak med kommandot för att finna filer är att du måste ange -vilket filnamn du önskar. Vi säger att kommandot "läser ett -argument". I detta fall är argumentet namnet på filen. Efter att du -gett kommandot +vilket filnamn du önskar. Vi säger att kommandot "läser ett argument". +I detta fall är argumentet namnet på filen. Efter att du gett kommandot C-x C-f Finn en fil @@ -570,7 +570,7 @@ för att titta på den. Du kan också finna en fil som inte existerar. Det är så man skapar nya filer med Emacs: finn filen, som är tom till att börja med, och sätt igång med att skriva texten som skall in i filen. Först när du sparar filen kommer Emacs att verkligen skapa -filen med den text du har skrivit. Från och med detta editerar du en +filen med den text du har skrivit. Från och med detta redigerar du en fil som existerar. @@ -600,16 +600,16 @@ När du har flera buffertar så är bara en av dem "gällande" åt gången. Det är den buffert du redigerar. Om du vill redigera en annan buffert så måste du byta till den. Om du vill byta till en buffert som motsvarar en fil kan du göra det genom att besöka den igen med C-x -C-f. Det finns dock ett enklare sätt: använd C-x b kommandot. I det +C-f. Det finns dock ett enklare sätt: använd kommandot C-x b. I det kommandot anger du buffertens namn. ->> Skapa en fil med namnet "foo" genom att trycka C-x C-f foo . +>> Skapa en fil med namnet "abc" genom att trycka C-x C-f abc . Skriv sedan C-x b TUTORIAL.sv för att komma tillbaka till den här handledningen. -Mestadels är buffertens namn densamma som filens namn (utan -katalogdel.) Det är dock inte alltid så. Bufferlistan du skapar med -C-x C-b visar alltid namnen på varje buffert. +Mestadels är buffertens namn densamma som filens namn (utan katalogdel). +Det är dock inte alltid så. Bufferlistan som du skapar med C-x C-b +visar alltid namnen på varje buffert. En del buffertar är inte knutna till någon fil, till exempel bufferten "*Buffer List*". Det är den buffert som innehåller buffertlistan som @@ -670,8 +670,8 @@ Emacsprocessen förstörs. I de flesta vanliga kommandoskalen så kan man återgå till Emacs med kommandot 'fg' eller med '%emacs'. C-x C-c används när du skall avsluta Emacs. Det är klokt att avsluta -Emacs om den har startats av ett mail-program eller andra -applikationer. +Emacs om den har startats av ett e-post-program eller annan +applikation. Det finns många C-x kommandon. Här är en lista över de du har lärt dig hittills: @@ -687,14 +687,13 @@ hittills: Namngivna utvidgade kommandon är kommandon som används mycket sällan eller bara i vissa lägen. Ett exempel på ett sådant kommando är -replace-string, som globalt ersätter en teckensträng med en annan. När +replace-string, som överallt ersätter en teckensträng med en annan. När du skriver M-x kommer Emacs visa en prompt nederst i skärmbilden med M-x där du skall skriva in kommandot du önskar att köra, i det här fallet "replace-string". Det är bara att skriva "repl s" och Emacs kommer då att fylla i kommandonamnet. ( är -tabulatortangenten, som vanligtvis finns över CapsLock- eller -skifttangenten nära den vänstra kanten på tangentbordet.) Kör -kommandot med . +tabulatortangenten, som vanligtvis finns över skiftlåstangenten +nära den vänstra kanten på tangentbordet.) Kör kommandot med . Kommandot replace-string kräver två argument, teckensträngen som skall ersättas och teckensträngen som den skall ersättas med. Du måste @@ -716,7 +715,7 @@ När du har gjort förändringar i en fil men inte sparat den, så kommer detta sparar Emacs periodiskt ändringarna i en autosparfil för varje fil du redigerar. Denna fil har ett # i början och slutet av filnamnet. Om du till exempel har en fil med namnet "hej.c" så kommer -namnet på autosparfilen bli "#hej.c#". När du sparar filen på vanlig +namnet på autosparfilen bli "#hej.c#". När du sparar filen på vanligt sätt kommer Emacs radera autosparfilen. Om maskinen kraschar kan du återfå dina automatiskt sparade ändringar @@ -829,7 +828,7 @@ genom ett numeriskt argument. att använda C-x f en gång till. Om du gör förändringar mitt i en rad så kommer inte sidoläget Auto -Fill att kunna omformattera raderna för dig. +Fill att kunna formatera om raderna för dig. För att göra detta kan du trycka M-q med markören inne i det avsnittet du önskar att omformatera. @@ -947,7 +946,7 @@ sig och inte en äkta "modifierare". Om du hade skrivit C-x 1 i det nedre fönstret skulle det övre ha försvunnit. Tänk på detta kommando som "Behåll bara ett fönster, det -som markören står i." +som markören står i". Du måste inte ha samma buffert i bägge fönstren. Du kan använda C-x C-f för att finna en ny fil i ett av fönstren samtidigt som det andra @@ -965,7 +964,7 @@ filer: 1 för att bli kvitt det nedre igen. -* MULTIPLA RAMAR +* FLERA RAMAR ---------------- Emacs kan också skapa flera "ramar". En ram är vad vi kallar en @@ -1052,7 +1051,7 @@ istället för C-h c. Detta kommer visa funktionens dokumentation och namn i ett eget fönster. För att avsluta hjälpfönstret kan du trycka C-x 1. Du behöver -inte göra det omedelbart. Du kan editera med hjälptexten som stöd för +inte göra det omedelbart. Du kan redigera med hjälptexten som stöd för att först senare ta bort fönstret med C-x 1. Här är fler varianter på C-h: @@ -1107,17 +1106,17 @@ Två finesser som du kan komma att gilla speciellt är komplettering filhantering. Komplettering är ett sätt att undvika onödiga tangenttryckningar. Till -exempel, om du vill byta till *Messages* bufferten, kan du du skriva +exempel, om du vill byta till bufferten *Messages* så kan du du skriva C-x b *M och Emacs kommer fylla i resten av buffertnamnet så långt den kan räkna ut det från det du redan skrivit. Komplettering finns beskrivet i Emacs-manualen i noden "Completion". Dired gör det möjligt att lista filer i en katalog (och även dess -subkataloger), flytta runt i listan, besöka, byta namn, ta bort och +underkataloger), flytta runt i listan, besöka, byta namn, ta bort och operera på olika sätt på filerna. Dired finns beskrivet i Info i Emacs-manualen i noden "Dired". -Manualen beskriver även många andra Emacs funktioner. +Manualen beskriver även många andra funktioner i Emacs. * SLUTORD @@ -1135,7 +1134,7 @@ själv, klaga! Denna vägledning härstammar från en hel rad Emacs-vägledningar och den första skrevs av Stuart Cracraft för den ursprungliga Emacs. Mats -Lidell översatte den till Svenska. +Lidell översatte den till svenska. This version of the tutorial, like GNU Emacs, is copyrighted, and comes with permission to distribute copies on certain conditions: commit f31cacd1ff4e020c0a10fa3da6598b21a6b04988 Author: Eli Zaretskii Date: Sat Nov 28 09:21:33 2020 +0200 Revert "Fix incorrect handling of module runtime and environment pointers." This reverts commit cdc632fbe6e149318147a98cccf1b7af191f2ce8. Those changes are too significant and non-trivial to be suitable for a release branch at this time. diff --git a/src/emacs-module.c b/src/emacs-module.c index 89d96839d2..a90a9765db 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c @@ -217,9 +217,6 @@ static void module_out_of_memory (emacs_env *); static void module_reset_handlerlist (struct handler **); static bool value_storage_contains_p (const struct emacs_value_storage *, emacs_value, ptrdiff_t *); -static Lisp_Object module_objects (Lisp_Object); -static void module_push_pointer (Lisp_Object, void *); -static void module_pop_pointer (Lisp_Object, void *); static bool module_assertions = false; @@ -1008,8 +1005,7 @@ module_signal_or_throw (struct emacs_env_private *env) } } -/* Live runtime and environment objects, for assertions. These are hashtables - keyed by the thread objects. */ +/* Live runtime and environment objects, for assertions. */ static Lisp_Object Vmodule_runtimes; static Lisp_Object Vmodule_environments; @@ -1050,7 +1046,7 @@ DEFUN ("module-load", Fmodule_load, Smodule_load, 1, 1, 0, rt->private_members = &rt_priv; rt->get_environment = module_get_environment; - module_push_pointer (Vmodule_runtimes, rt); + Vmodule_runtimes = Fcons (make_mint_ptr (rt), Vmodule_runtimes); ptrdiff_t count = SPECPDL_INDEX (); record_unwind_protect_ptr (finalize_runtime_unwind, rt); @@ -1150,8 +1146,7 @@ module_assert_runtime (struct emacs_runtime *ert) if (! module_assertions) return; ptrdiff_t count = 0; - for (Lisp_Object tail = module_objects (Vmodule_runtimes); CONSP (tail); - tail = XCDR (tail)) + for (Lisp_Object tail = Vmodule_runtimes; CONSP (tail); tail = XCDR (tail)) { if (xmint_pointer (XCAR (tail)) == ert) return; @@ -1167,7 +1162,7 @@ module_assert_env (emacs_env *env) if (! module_assertions) return; ptrdiff_t count = 0; - for (Lisp_Object tail = module_objects (Vmodule_environments); CONSP (tail); + for (Lisp_Object tail = Vmodule_environments; CONSP (tail); tail = XCDR (tail)) { if (xmint_pointer (XCAR (tail)) == env) @@ -1214,83 +1209,6 @@ module_out_of_memory (emacs_env *env) XCDR (Vmemory_signal_data)); } - -/* Hash table helper functions. */ - -/* Like HASH_TABLE_SIZE, but also works during garbage collection. */ - -static ptrdiff_t -module_gc_hash_table_size (const struct Lisp_Hash_Table *h) -{ - ptrdiff_t size = gc_asize (h->next); - eassert (0 <= size); - return size; -} - -/* Like (push NEWELT (gethash KEY TABLE)). */ - -static void -module_hash_push (Lisp_Object table, Lisp_Object key, Lisp_Object newelt) -{ - /* Inline calls to Fgethash/Fputhash to avoid duplicate hash lookup. */ - struct Lisp_Hash_Table *h = XHASH_TABLE (table); - Lisp_Object hash; - ptrdiff_t i = hash_lookup (h, key, &hash); - if (i >= 0) - set_hash_value_slot (h, i, Fcons (newelt, HASH_VALUE (h, i))); - else - hash_put (h, key, list1 (newelt), hash); -} - -/* Like (pop (gethash KEY TABLE)), but removes KEY from TABLE if the new value - is nil. */ - -static Lisp_Object -module_hash_pop (Lisp_Object table, Lisp_Object key) -{ - /* Inline calls to Fgethash/Fputhash to avoid duplicate hash lookup. */ - struct Lisp_Hash_Table *h = XHASH_TABLE (table); - Lisp_Object hash; - ptrdiff_t i = hash_lookup (h, key, &hash); - eassert (i >= 0); - Lisp_Object value = HASH_VALUE (h, i); - Lisp_Object rest = XCDR (value); - if (NILP (rest)) - hash_remove_from_table(h, key); - else - set_hash_value_slot (h, i, rest); - return XCAR (value); -} - -/* Returns the list of objects for the current thread in TABLE. The keys of - TABLE are thread objects. */ - -static Lisp_Object -module_objects (Lisp_Object table) -{ - return Fgethash (Fcurrent_thread (), table, Qnil); -} - -/* Adds PTR to the front of the list of objects for the current thread in TABLE. - The keys of TABLE are thread objects. */ - -static void -module_push_pointer (Lisp_Object table, void *ptr) -{ - module_hash_push (table, Fcurrent_thread (), make_mint_ptr (ptr)); -} - -/* Removes the first object from the list of objects for the current thread in - TABLE. The keys of TABLE are thread objects. Checks that the first object - is a pointer with value PTR. */ - -static void -module_pop_pointer (Lisp_Object table, void *ptr) -{ - Lisp_Object value = module_hash_pop (table, Fcurrent_thread ()); - eassert (xmint_pointer (value) == ptr); -} - /* Value conversion. */ @@ -1308,7 +1226,7 @@ value_to_lisp (emacs_value v) environments. */ ptrdiff_t num_environments = 0; ptrdiff_t num_values = 0; - for (Lisp_Object environments = module_objects (Vmodule_environments); + for (Lisp_Object environments = Vmodule_environments; CONSP (environments); environments = XCDR (environments)) { emacs_env *env = xmint_pointer (XCAR (environments)); @@ -1408,19 +1326,16 @@ allocate_emacs_value (emacs_env *env, struct emacs_value_storage *storage, void mark_modules (void) { - const struct Lisp_Hash_Table *h = XHASH_TABLE (Vmodule_environments); - /* Can't use HASH_TABLE_SIZE because we are in the mark phase of the GC. */ - for (ptrdiff_t i = 0; i < module_gc_hash_table_size (h); ++i) - if (!EQ (HASH_KEY (h, i), Qunbound)) - for (Lisp_Object tem = HASH_VALUE (h, i); CONSP (tem); tem = XCDR (tem)) - { - emacs_env *env = xmint_pointer (XCAR (tem)); - struct emacs_env_private *priv = env->private_members; - for (struct emacs_value_frame *frame = &priv->storage.initial; - frame != NULL; frame = frame->next) - for (int i = 0; i < frame->offset; ++i) - mark_object (frame->objects[i].v); - } + for (Lisp_Object tem = Vmodule_environments; CONSP (tem); tem = XCDR (tem)) + { + emacs_env *env = xmint_pointer (XCAR (tem)); + struct emacs_env_private *priv = env->private_members; + for (struct emacs_value_frame *frame = &priv->storage.initial; + frame != NULL; + frame = frame->next) + for (int i = 0; i < frame->offset; ++i) + mark_object (frame->objects[i].v); + } } @@ -1475,7 +1390,7 @@ initialize_environment (emacs_env *env, struct emacs_env_private *priv) env->make_time = module_make_time; env->extract_big_integer = module_extract_big_integer; env->make_big_integer = module_make_big_integer; - module_push_pointer (Vmodule_environments, env); + Vmodule_environments = Fcons (make_mint_ptr (env), Vmodule_environments); return env; } @@ -1485,7 +1400,8 @@ static void finalize_environment (emacs_env *env) { finalize_storage (&env->private_members->storage); - module_pop_pointer (Vmodule_environments, env); + eassert (xmint_pointer (XCAR (Vmodule_environments)) == env); + Vmodule_environments = XCDR (Vmodule_environments); } static void @@ -1498,8 +1414,9 @@ static void finalize_runtime_unwind (void *raw_ert) { struct emacs_runtime *ert = raw_ert; + eassert (xmint_pointer (XCAR (Vmodule_runtimes)) == ert); + Vmodule_runtimes = XCDR (Vmodule_runtimes); finalize_environment (ert->private_members->env); - module_pop_pointer (Vmodule_runtimes, ert); } @@ -1589,14 +1506,10 @@ syms_of_module (void) Qnil, false); staticpro (&Vmodule_runtimes); - Vmodule_runtimes - = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, DEFAULT_REHASH_SIZE, - DEFAULT_REHASH_THRESHOLD, Qnil, false); + Vmodule_runtimes = Qnil; staticpro (&Vmodule_environments); - Vmodule_environments - = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, DEFAULT_REHASH_SIZE, - DEFAULT_REHASH_THRESHOLD, Qnil, false); + Vmodule_environments = Qnil; DEFSYM (Qmodule_load_failed, "module-load-failed"); Fput (Qmodule_load_failed, Qerror_conditions, diff --git a/test/data/emacs-module/mod-test.c b/test/data/emacs-module/mod-test.c index 528b4b4c58..8d1b421bb4 100644 --- a/test/data/emacs-module/mod-test.c +++ b/test/data/emacs-module/mod-test.c @@ -547,14 +547,6 @@ Fmod_test_double (emacs_env *env, ptrdiff_t nargs, emacs_value *args, return result; } -static emacs_value -Fmod_test_funcall (emacs_env *env, ptrdiff_t nargs, emacs_value *args, - void *data) -{ - assert (0 < nargs); - return env->funcall (env, args[0], nargs - 1, args + 1); -} - /* Lisp utilities for easier readability (simple wrappers). */ /* Provide FEATURE to Emacs. */ @@ -637,8 +629,6 @@ emacs_module_init (struct emacs_runtime *ert) DEFUN ("mod-test-add-nanosecond", Fmod_test_add_nanosecond, 1, 1, NULL, NULL); DEFUN ("mod-test-nanoseconds", Fmod_test_nanoseconds, 1, 1, NULL, NULL); DEFUN ("mod-test-double", Fmod_test_double, 1, 1, NULL, NULL); - DEFUN ("mod-test-funcall", Fmod_test_funcall, 1, emacs_variadic_function, - NULL, NULL); #undef DEFUN diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el index f9bd82e78c..9df0b25a0c 100644 --- a/test/src/emacs-module-tests.el +++ b/test/src/emacs-module-tests.el @@ -419,54 +419,4 @@ Interactively, you can try hitting \\[keyboard-quit] to quit." (ert-info ((format "input: %d" input)) (should (= (mod-test-double input) (* 2 input)))))) -(cl-defstruct (emacs-module-tests--variable - (:constructor nil) - (:constructor emacs-module-tests--make-variable - (name - &aux - (mutex (make-mutex name)) - (condvar (make-condition-variable mutex name)))) - (:copier nil)) - "A variable that's protected by a mutex." - value - (mutex nil :read-only t :type mutex) - (condvar nil :read-only t :type condition-variable)) - -(defun emacs-module-tests--wait-for-variable (variable desired) - (with-mutex (emacs-module-tests--variable-mutex variable) - (while (not (eq (emacs-module-tests--variable-value variable) desired)) - (condition-wait (emacs-module-tests--variable-condvar variable))))) - -(defun emacs-module-tests--change-variable (variable new) - (with-mutex (emacs-module-tests--variable-mutex variable) - (setf (emacs-module-tests--variable-value variable) new) - (condition-notify (emacs-module-tests--variable-condvar variable) :all))) - -(ert-deftest emacs-module-tests/interleaved-threads () - (let* ((state-1 (emacs-module-tests--make-variable "1")) - (state-2 (emacs-module-tests--make-variable "2")) - (thread-1 - (make-thread - (lambda () - (emacs-module-tests--change-variable state-1 'before-module) - (mod-test-funcall - (lambda () - (emacs-module-tests--change-variable state-1 'in-module) - (emacs-module-tests--wait-for-variable state-2 'in-module))) - (emacs-module-tests--change-variable state-1 'after-module)) - "thread 1")) - (thread-2 - (make-thread - (lambda () - (emacs-module-tests--change-variable state-2 'before-module) - (emacs-module-tests--wait-for-variable state-1 'in-module) - (mod-test-funcall - (lambda () - (emacs-module-tests--change-variable state-2 'in-module) - (emacs-module-tests--wait-for-variable state-1 'after-module))) - (emacs-module-tests--change-variable state-2 'after-module)) - "thread 2"))) - (thread-join thread-1) - (thread-join thread-2))) - ;;; emacs-module-tests.el ends here commit cdc632fbe6e149318147a98cccf1b7af191f2ce8 Author: Philipp Stephani Date: Fri Nov 27 19:08:55 2020 +0100 Fix incorrect handling of module runtime and environment pointers. We used to store module runtime and environment pointers in the static lists Vmodule_runtimes and Vmodule_environments. However, this is incorrect because these objects have to be kept per-thread. With this naive approach, interleaving module function calls in separate threads leads to environments being removed in the wrong order, which in turn can cause local module values to be incorrectly garbage-collected. Instead, turn Vmodule_runtimes and Vmodule_environments into hashtables keyed by the thread objects. The fix is relatively localized and should therefore be safe enough for the release branch. Module assertions now have to walk the pointer list for the current thread, which is more correct since they now only find environments for the current thread. Also add a unit test that exemplifies the problem. It interleaves two module calls in two threads so that the first call ends while the second one is still active. Without this change, this test triggers an assertion failure. * src/emacs-module.c (Fmodule_load, initialize_environment) (finalize_environment, finalize_runtime_unwind): Store runtime and environment pointers in per-thread lists. (syms_of_module): Initialize runtimes and environments hashtables. (module_assert_runtime, module_assert_env, value_to_lisp): Consider only objects for the current thread. (module_gc_hash_table_size, module_hash_push, module_hash_pop): New generic hashtable helper functions. (module_objects, module_push_pointer, module_pop_pointer): New helper functions to main thread-specific lists of runtime and environment pointers. (mark_modules): Mark all environments in all threads. * test/data/emacs-module/mod-test.c (Fmod_test_funcall): New test function. (emacs_module_init): Bind it. * test/src/emacs-module-tests.el (emacs-module-tests--variable): New helper type to guard access to state in a thread-safe way. (emacs-module-tests--wait-for-variable) (emacs-module-tests--change-variable): New helper functions. (emacs-module-tests/interleaved-threads): New unit test. diff --git a/src/emacs-module.c b/src/emacs-module.c index a90a9765db..89d96839d2 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c @@ -217,6 +217,9 @@ static void module_out_of_memory (emacs_env *); static void module_reset_handlerlist (struct handler **); static bool value_storage_contains_p (const struct emacs_value_storage *, emacs_value, ptrdiff_t *); +static Lisp_Object module_objects (Lisp_Object); +static void module_push_pointer (Lisp_Object, void *); +static void module_pop_pointer (Lisp_Object, void *); static bool module_assertions = false; @@ -1005,7 +1008,8 @@ module_signal_or_throw (struct emacs_env_private *env) } } -/* Live runtime and environment objects, for assertions. */ +/* Live runtime and environment objects, for assertions. These are hashtables + keyed by the thread objects. */ static Lisp_Object Vmodule_runtimes; static Lisp_Object Vmodule_environments; @@ -1046,7 +1050,7 @@ DEFUN ("module-load", Fmodule_load, Smodule_load, 1, 1, 0, rt->private_members = &rt_priv; rt->get_environment = module_get_environment; - Vmodule_runtimes = Fcons (make_mint_ptr (rt), Vmodule_runtimes); + module_push_pointer (Vmodule_runtimes, rt); ptrdiff_t count = SPECPDL_INDEX (); record_unwind_protect_ptr (finalize_runtime_unwind, rt); @@ -1146,7 +1150,8 @@ module_assert_runtime (struct emacs_runtime *ert) if (! module_assertions) return; ptrdiff_t count = 0; - for (Lisp_Object tail = Vmodule_runtimes; CONSP (tail); tail = XCDR (tail)) + for (Lisp_Object tail = module_objects (Vmodule_runtimes); CONSP (tail); + tail = XCDR (tail)) { if (xmint_pointer (XCAR (tail)) == ert) return; @@ -1162,7 +1167,7 @@ module_assert_env (emacs_env *env) if (! module_assertions) return; ptrdiff_t count = 0; - for (Lisp_Object tail = Vmodule_environments; CONSP (tail); + for (Lisp_Object tail = module_objects (Vmodule_environments); CONSP (tail); tail = XCDR (tail)) { if (xmint_pointer (XCAR (tail)) == env) @@ -1209,6 +1214,83 @@ module_out_of_memory (emacs_env *env) XCDR (Vmemory_signal_data)); } + +/* Hash table helper functions. */ + +/* Like HASH_TABLE_SIZE, but also works during garbage collection. */ + +static ptrdiff_t +module_gc_hash_table_size (const struct Lisp_Hash_Table *h) +{ + ptrdiff_t size = gc_asize (h->next); + eassert (0 <= size); + return size; +} + +/* Like (push NEWELT (gethash KEY TABLE)). */ + +static void +module_hash_push (Lisp_Object table, Lisp_Object key, Lisp_Object newelt) +{ + /* Inline calls to Fgethash/Fputhash to avoid duplicate hash lookup. */ + struct Lisp_Hash_Table *h = XHASH_TABLE (table); + Lisp_Object hash; + ptrdiff_t i = hash_lookup (h, key, &hash); + if (i >= 0) + set_hash_value_slot (h, i, Fcons (newelt, HASH_VALUE (h, i))); + else + hash_put (h, key, list1 (newelt), hash); +} + +/* Like (pop (gethash KEY TABLE)), but removes KEY from TABLE if the new value + is nil. */ + +static Lisp_Object +module_hash_pop (Lisp_Object table, Lisp_Object key) +{ + /* Inline calls to Fgethash/Fputhash to avoid duplicate hash lookup. */ + struct Lisp_Hash_Table *h = XHASH_TABLE (table); + Lisp_Object hash; + ptrdiff_t i = hash_lookup (h, key, &hash); + eassert (i >= 0); + Lisp_Object value = HASH_VALUE (h, i); + Lisp_Object rest = XCDR (value); + if (NILP (rest)) + hash_remove_from_table(h, key); + else + set_hash_value_slot (h, i, rest); + return XCAR (value); +} + +/* Returns the list of objects for the current thread in TABLE. The keys of + TABLE are thread objects. */ + +static Lisp_Object +module_objects (Lisp_Object table) +{ + return Fgethash (Fcurrent_thread (), table, Qnil); +} + +/* Adds PTR to the front of the list of objects for the current thread in TABLE. + The keys of TABLE are thread objects. */ + +static void +module_push_pointer (Lisp_Object table, void *ptr) +{ + module_hash_push (table, Fcurrent_thread (), make_mint_ptr (ptr)); +} + +/* Removes the first object from the list of objects for the current thread in + TABLE. The keys of TABLE are thread objects. Checks that the first object + is a pointer with value PTR. */ + +static void +module_pop_pointer (Lisp_Object table, void *ptr) +{ + Lisp_Object value = module_hash_pop (table, Fcurrent_thread ()); + eassert (xmint_pointer (value) == ptr); +} + /* Value conversion. */ @@ -1226,7 +1308,7 @@ value_to_lisp (emacs_value v) environments. */ ptrdiff_t num_environments = 0; ptrdiff_t num_values = 0; - for (Lisp_Object environments = Vmodule_environments; + for (Lisp_Object environments = module_objects (Vmodule_environments); CONSP (environments); environments = XCDR (environments)) { emacs_env *env = xmint_pointer (XCAR (environments)); @@ -1326,16 +1408,19 @@ allocate_emacs_value (emacs_env *env, struct emacs_value_storage *storage, void mark_modules (void) { - for (Lisp_Object tem = Vmodule_environments; CONSP (tem); tem = XCDR (tem)) - { - emacs_env *env = xmint_pointer (XCAR (tem)); - struct emacs_env_private *priv = env->private_members; - for (struct emacs_value_frame *frame = &priv->storage.initial; - frame != NULL; - frame = frame->next) - for (int i = 0; i < frame->offset; ++i) - mark_object (frame->objects[i].v); - } + const struct Lisp_Hash_Table *h = XHASH_TABLE (Vmodule_environments); + /* Can't use HASH_TABLE_SIZE because we are in the mark phase of the GC. */ + for (ptrdiff_t i = 0; i < module_gc_hash_table_size (h); ++i) + if (!EQ (HASH_KEY (h, i), Qunbound)) + for (Lisp_Object tem = HASH_VALUE (h, i); CONSP (tem); tem = XCDR (tem)) + { + emacs_env *env = xmint_pointer (XCAR (tem)); + struct emacs_env_private *priv = env->private_members; + for (struct emacs_value_frame *frame = &priv->storage.initial; + frame != NULL; frame = frame->next) + for (int i = 0; i < frame->offset; ++i) + mark_object (frame->objects[i].v); + } } @@ -1390,7 +1475,7 @@ initialize_environment (emacs_env *env, struct emacs_env_private *priv) env->make_time = module_make_time; env->extract_big_integer = module_extract_big_integer; env->make_big_integer = module_make_big_integer; - Vmodule_environments = Fcons (make_mint_ptr (env), Vmodule_environments); + module_push_pointer (Vmodule_environments, env); return env; } @@ -1400,8 +1485,7 @@ static void finalize_environment (emacs_env *env) { finalize_storage (&env->private_members->storage); - eassert (xmint_pointer (XCAR (Vmodule_environments)) == env); - Vmodule_environments = XCDR (Vmodule_environments); + module_pop_pointer (Vmodule_environments, env); } static void @@ -1414,9 +1498,8 @@ static void finalize_runtime_unwind (void *raw_ert) { struct emacs_runtime *ert = raw_ert; - eassert (xmint_pointer (XCAR (Vmodule_runtimes)) == ert); - Vmodule_runtimes = XCDR (Vmodule_runtimes); finalize_environment (ert->private_members->env); + module_pop_pointer (Vmodule_runtimes, ert); } @@ -1506,10 +1589,14 @@ syms_of_module (void) Qnil, false); staticpro (&Vmodule_runtimes); - Vmodule_runtimes = Qnil; + Vmodule_runtimes + = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, DEFAULT_REHASH_SIZE, + DEFAULT_REHASH_THRESHOLD, Qnil, false); staticpro (&Vmodule_environments); - Vmodule_environments = Qnil; + Vmodule_environments + = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, DEFAULT_REHASH_SIZE, + DEFAULT_REHASH_THRESHOLD, Qnil, false); DEFSYM (Qmodule_load_failed, "module-load-failed"); Fput (Qmodule_load_failed, Qerror_conditions, diff --git a/test/data/emacs-module/mod-test.c b/test/data/emacs-module/mod-test.c index 8d1b421bb4..528b4b4c58 100644 --- a/test/data/emacs-module/mod-test.c +++ b/test/data/emacs-module/mod-test.c @@ -547,6 +547,14 @@ Fmod_test_double (emacs_env *env, ptrdiff_t nargs, emacs_value *args, return result; } +static emacs_value +Fmod_test_funcall (emacs_env *env, ptrdiff_t nargs, emacs_value *args, + void *data) +{ + assert (0 < nargs); + return env->funcall (env, args[0], nargs - 1, args + 1); +} + /* Lisp utilities for easier readability (simple wrappers). */ /* Provide FEATURE to Emacs. */ @@ -629,6 +637,8 @@ emacs_module_init (struct emacs_runtime *ert) DEFUN ("mod-test-add-nanosecond", Fmod_test_add_nanosecond, 1, 1, NULL, NULL); DEFUN ("mod-test-nanoseconds", Fmod_test_nanoseconds, 1, 1, NULL, NULL); DEFUN ("mod-test-double", Fmod_test_double, 1, 1, NULL, NULL); + DEFUN ("mod-test-funcall", Fmod_test_funcall, 1, emacs_variadic_function, + NULL, NULL); #undef DEFUN diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el index 9df0b25a0c..f9bd82e78c 100644 --- a/test/src/emacs-module-tests.el +++ b/test/src/emacs-module-tests.el @@ -419,4 +419,54 @@ Interactively, you can try hitting \\[keyboard-quit] to quit." (ert-info ((format "input: %d" input)) (should (= (mod-test-double input) (* 2 input)))))) +(cl-defstruct (emacs-module-tests--variable + (:constructor nil) + (:constructor emacs-module-tests--make-variable + (name + &aux + (mutex (make-mutex name)) + (condvar (make-condition-variable mutex name)))) + (:copier nil)) + "A variable that's protected by a mutex." + value + (mutex nil :read-only t :type mutex) + (condvar nil :read-only t :type condition-variable)) + +(defun emacs-module-tests--wait-for-variable (variable desired) + (with-mutex (emacs-module-tests--variable-mutex variable) + (while (not (eq (emacs-module-tests--variable-value variable) desired)) + (condition-wait (emacs-module-tests--variable-condvar variable))))) + +(defun emacs-module-tests--change-variable (variable new) + (with-mutex (emacs-module-tests--variable-mutex variable) + (setf (emacs-module-tests--variable-value variable) new) + (condition-notify (emacs-module-tests--variable-condvar variable) :all))) + +(ert-deftest emacs-module-tests/interleaved-threads () + (let* ((state-1 (emacs-module-tests--make-variable "1")) + (state-2 (emacs-module-tests--make-variable "2")) + (thread-1 + (make-thread + (lambda () + (emacs-module-tests--change-variable state-1 'before-module) + (mod-test-funcall + (lambda () + (emacs-module-tests--change-variable state-1 'in-module) + (emacs-module-tests--wait-for-variable state-2 'in-module))) + (emacs-module-tests--change-variable state-1 'after-module)) + "thread 1")) + (thread-2 + (make-thread + (lambda () + (emacs-module-tests--change-variable state-2 'before-module) + (emacs-module-tests--wait-for-variable state-1 'in-module) + (mod-test-funcall + (lambda () + (emacs-module-tests--change-variable state-2 'in-module) + (emacs-module-tests--wait-for-variable state-1 'after-module))) + (emacs-module-tests--change-variable state-2 'after-module)) + "thread 2"))) + (thread-join thread-1) + (thread-join thread-2))) + ;;; emacs-module-tests.el ends here commit a7825c4be06b7c0b544df34555ecf586276245e6 Author: Mattias Engdegård Date: Fri Nov 27 21:16:15 2020 +0100 Use correct glyph in title when resizing NS frames * src/nsterm.m ([EmacsView windowWillResize:toSize:]): Use ×, not x. diff --git a/src/nsterm.m b/src/nsterm.m index a9280eb4af..0729c961bd 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -7282,7 +7282,7 @@ - (NSSize)windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize old_title = t; } size_title = xmalloc (strlen (old_title) + 40); - esprintf (size_title, "%s — (%d x %d)", old_title, cols, rows); + esprintf (size_title, "%s — (%d × %d)", old_title, cols, rows); [window setTitle: [NSString stringWithUTF8String: size_title]]; [window display]; xfree (size_title); commit 23974cfa48b9245658667eff81d132b3aecd2618 Author: Philipp Stephani Date: Fri Nov 27 19:08:55 2020 +0100 Fix incorrect handling of module runtime and environment pointers. We used to store module runtime and environment pointers in the static lists Vmodule_runtimes and Vmodule_environments. However, this is incorrect because these objects have to be kept per-thread. With this naive approach, interleaving module function calls in separate threads leads to environments being removed in the wrong order, which in turn can cause local module values to be incorrectly garbage-collected. The fix isn't completely trivial: specbinding the lists wouldn't work either, because then the garbage collector wouldn't find the environments in other threads than the current ones, again leading to objects being garbage-collected incorrectly. While introducing custom pseudovector types would fix this, it's simpler to put the runtime and environment pointers into the specbinding list as new specbinding kinds. This works since we need to unwind them anyway, and we only ever treat the lists as a stack. The thread switching machinery ensures that the specbinding lists are thread-local, and that all elements of the specbinding lists in all threads are marked during garbage collection. Module assertions now have to walk the specbinding list for the current thread, which is more correct since they now only find environments for the current thread. As a result, we can now remove the faulty Vmodule_runtimes and Vmodule_environments variables entirely. Also add a unit test that exemplifies the problem. It interleaves two module calls in two threads so that the first call ends while the second one is still active. Without this change, this test triggers an assertion failure. * src/lisp.h (enum specbind_tag): Add new tags for module runtimes and environments. * src/eval.c (record_unwind_protect_module): New function to record a module object in the specpdl list. (do_one_unbind): Unwind module objects. (backtrace_eval_unrewind, default_toplevel_binding, lexbound_p) (Fbacktrace__locals): Deal with new specbinding types. (mark_specpdl): Mark module environments as needed. * src/alloc.c (garbage_collect): Remove call to 'mark-modules'. Garbage collection of module values is now handled as part of marking the specpdl of each thread. * src/emacs-module.c (Fmodule_load, funcall_module): Use specpdl to record module runtimes and environments. (module_assert_runtime, module_assert_env, value_to_lisp): Walk through specpdl list instead of list variables. (mark_module_environment): Rename from 'mark_modules'. Don't attempt to walk though current thread's environments only, since that would miss other threads. (initialize_environment, finalize_environment): Don't change Vmodule_environments variable; environments are now in the specpdl list. (finalize_environment_unwind, finalize_runtime_unwind): Make 'extern' since do_one_unbind now calls them. (finalize_runtime_unwind): Don't change Vmodule_runtimes variable; runtimes are now in the specpdl list. (syms_of_module): Remove Vmodule_runtimes and Vmodule_environments. * test/data/emacs-module/mod-test.c (Fmod_test_funcall): New test function. (emacs_module_init): Bind it. * test/src/emacs-module-tests.el (emacs-module-tests--variable): New helper type to guard access to state in a thread-safe way. (emacs-module-tests--wait-for-variable) (emacs-module-tests--change-variable): New helper functions. (emacs-module-tests/interleaved-threads): New unit test. diff --git a/src/alloc.c b/src/alloc.c index 2b3643e35b..504ef179ec 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -6061,10 +6061,6 @@ garbage_collect (void) mark_fringe_data (); #endif -#ifdef HAVE_MODULES - mark_modules (); -#endif - /* Everything is now marked, except for the data in font caches, undo lists, and finalizers. The first two are compacted by removing an items which aren't reachable otherwise. */ diff --git a/src/emacs-module.c b/src/emacs-module.c index 23b8e8620c..5f97815ec1 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c @@ -200,8 +200,6 @@ static AVOID module_abort (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); static emacs_env *initialize_environment (emacs_env *, struct emacs_env_private *); static void finalize_environment (emacs_env *); -static void finalize_environment_unwind (void *); -static void finalize_runtime_unwind (void *); static void module_handle_nonlocal_exit (emacs_env *, enum nonlocal_exit, Lisp_Object); static void module_non_local_exit_signal_1 (emacs_env *, @@ -1089,10 +1087,6 @@ module_signal_or_throw (struct emacs_env_private *env) } } -/* Live runtime and environment objects, for assertions. */ -static Lisp_Object Vmodule_runtimes; -static Lisp_Object Vmodule_environments; - DEFUN ("module-load", Fmodule_load, Smodule_load, 1, 1, 0, doc: /* Load module FILE. */) (Lisp_Object file) @@ -1137,9 +1131,9 @@ DEFUN ("module-load", Fmodule_load, Smodule_load, 1, 1, 0, rt->private_members = &rt_priv; rt->get_environment = module_get_environment; - Vmodule_runtimes = Fcons (make_mint_ptr (rt), Vmodule_runtimes); ptrdiff_t count = SPECPDL_INDEX (); - record_unwind_protect_ptr (finalize_runtime_unwind, rt); + record_unwind_protect_module (SPECPDL_MODULE_RUNTIME, rt); + record_unwind_protect_module (SPECPDL_MODULE_ENVIRONMENT, rt_priv.env); int r = module_init (rt); @@ -1167,7 +1161,7 @@ funcall_module (Lisp_Object function, ptrdiff_t nargs, Lisp_Object *arglist) struct emacs_env_private priv; emacs_env *env = initialize_environment (&pub, &priv); ptrdiff_t count = SPECPDL_INDEX (); - record_unwind_protect_ptr (finalize_environment_unwind, env); + record_unwind_protect_module (SPECPDL_MODULE_ENVIRONMENT, env); USE_SAFE_ALLOCA; emacs_value *args = nargs > 0 ? SAFE_ALLOCA (nargs * sizeof *args) : NULL; @@ -1243,12 +1237,13 @@ module_assert_runtime (struct emacs_runtime *runtime) if (! module_assertions) return; ptrdiff_t count = 0; - for (Lisp_Object tail = Vmodule_runtimes; CONSP (tail); tail = XCDR (tail)) - { - if (xmint_pointer (XCAR (tail)) == runtime) - return; - ++count; - } + for (const union specbinding *pdl = specpdl; pdl != specpdl_ptr; ++pdl) + if (pdl->kind == SPECPDL_MODULE_RUNTIME) + { + if (pdl->unwind_ptr.arg == runtime) + return; + ++count; + } module_abort ("Runtime pointer not found in list of %"pD"d runtimes", count); } @@ -1259,13 +1254,13 @@ module_assert_env (emacs_env *env) if (! module_assertions) return; ptrdiff_t count = 0; - for (Lisp_Object tail = Vmodule_environments; CONSP (tail); - tail = XCDR (tail)) - { - if (xmint_pointer (XCAR (tail)) == env) - return; - ++count; - } + for (const union specbinding *pdl = specpdl; pdl != specpdl_ptr; ++pdl) + if (pdl->kind == SPECPDL_MODULE_ENVIRONMENT) + { + if (pdl->unwind_ptr.arg == env) + return; + ++count; + } module_abort ("Environment pointer not found in list of %"pD"d environments", count); } @@ -1323,22 +1318,22 @@ value_to_lisp (emacs_value v) environments. */ ptrdiff_t num_environments = 0; ptrdiff_t num_values = 0; - for (Lisp_Object environments = Vmodule_environments; - CONSP (environments); environments = XCDR (environments)) - { - emacs_env *env = xmint_pointer (XCAR (environments)); - struct emacs_env_private *priv = env->private_members; - /* The value might be one of the nonlocal exit values. Note - that we don't check whether a nonlocal exit is currently - pending, because the module might have cleared the flag - in the meantime. */ - if (&priv->non_local_exit_symbol == v - || &priv->non_local_exit_data == v) - goto ok; - if (value_storage_contains_p (&priv->storage, v, &num_values)) - goto ok; - ++num_environments; - } + for (const union specbinding *pdl = specpdl; pdl != specpdl_ptr; ++pdl) + if (pdl->kind == SPECPDL_MODULE_ENVIRONMENT) + { + const emacs_env *env = pdl->unwind_ptr.arg; + struct emacs_env_private *priv = env->private_members; + /* The value might be one of the nonlocal exit values. Note + that we don't check whether a nonlocal exit is currently + pending, because the module might have cleared the flag + in the meantime. */ + if (&priv->non_local_exit_symbol == v + || &priv->non_local_exit_data == v) + goto ok; + if (value_storage_contains_p (&priv->storage, v, &num_values)) + goto ok; + ++num_environments; + } /* Also check global values. */ if (module_global_reference_p (v, &num_values)) goto ok; @@ -1421,18 +1416,14 @@ allocate_emacs_value (emacs_env *env, Lisp_Object obj) /* Mark all objects allocated from local environments so that they don't get garbage-collected. */ void -mark_modules (void) +mark_module_environment (void *ptr) { - for (Lisp_Object tem = Vmodule_environments; CONSP (tem); tem = XCDR (tem)) - { - emacs_env *env = xmint_pointer (XCAR (tem)); - struct emacs_env_private *priv = env->private_members; - for (struct emacs_value_frame *frame = &priv->storage.initial; - frame != NULL; - frame = frame->next) - for (int i = 0; i < frame->offset; ++i) - mark_object (frame->objects[i].v); - } + emacs_env *env = ptr; + struct emacs_env_private *priv = env->private_members; + for (struct emacs_value_frame *frame = &priv->storage.initial; frame != NULL; + frame = frame->next) + for (int i = 0; i < frame->offset; ++i) + mark_object (frame->objects[i].v); } @@ -1495,7 +1486,6 @@ initialize_environment (emacs_env *env, struct emacs_env_private *priv) env->set_function_finalizer = module_set_function_finalizer; env->open_channel = module_open_channel; env->make_interactive = module_make_interactive; - Vmodule_environments = Fcons (make_mint_ptr (env), Vmodule_environments); return env; } @@ -1505,22 +1495,18 @@ static void finalize_environment (emacs_env *env) { finalize_storage (&env->private_members->storage); - eassert (xmint_pointer (XCAR (Vmodule_environments)) == env); - Vmodule_environments = XCDR (Vmodule_environments); } -static void +void finalize_environment_unwind (void *env) { finalize_environment (env); } -static void +void finalize_runtime_unwind (void *raw_ert) { struct emacs_runtime *ert = raw_ert; - eassert (xmint_pointer (XCAR (Vmodule_runtimes)) == ert); - Vmodule_runtimes = XCDR (Vmodule_runtimes); finalize_environment (ert->private_members->env); } @@ -1610,12 +1596,6 @@ syms_of_module (void) DEFAULT_REHASH_SIZE, DEFAULT_REHASH_THRESHOLD, Qnil, false); - staticpro (&Vmodule_runtimes); - Vmodule_runtimes = Qnil; - - staticpro (&Vmodule_environments); - Vmodule_environments = Qnil; - DEFSYM (Qmodule_load_failed, "module-load-failed"); Fput (Qmodule_load_failed, Qerror_conditions, pure_list (Qmodule_load_failed, Qerror)); diff --git a/src/eval.c b/src/eval.c index 3f9dcf6be6..d9a424b57a 100644 --- a/src/eval.c +++ b/src/eval.c @@ -681,6 +681,10 @@ default_toplevel_binding (Lisp_Object symbol) case SPECPDL_UNWIND_EXCURSION: case SPECPDL_UNWIND_VOID: case SPECPDL_BACKTRACE: +#ifdef HAVE_MODULES + case SPECPDL_MODULE_RUNTIME: + case SPECPDL_MODULE_ENVIRONMENT: +#endif case SPECPDL_LET_LOCAL: break; @@ -720,6 +724,10 @@ lexbound_p (Lisp_Object symbol) case SPECPDL_UNWIND_EXCURSION: case SPECPDL_UNWIND_VOID: case SPECPDL_BACKTRACE: +#ifdef HAVE_MODULES + case SPECPDL_MODULE_RUNTIME: + case SPECPDL_MODULE_ENVIRONMENT: +#endif case SPECPDL_LET_LOCAL: break; @@ -3479,6 +3487,15 @@ record_unwind_protect_void (void (*function) (void)) grow_specpdl (); } +void +record_unwind_protect_module (enum specbind_tag kind, void *ptr) +{ + specpdl_ptr->kind = kind; + specpdl_ptr->unwind_ptr.func = NULL; + specpdl_ptr->unwind_ptr.arg = ptr; + grow_specpdl (); +} + void rebind_for_thread_switch (void) { @@ -3529,6 +3546,14 @@ do_one_unbind (union specbinding *this_binding, bool unwinding, break; case SPECPDL_BACKTRACE: break; +#ifdef HAVE_MODULES + case SPECPDL_MODULE_RUNTIME: + finalize_runtime_unwind (this_binding->unwind_ptr.arg); + break; + case SPECPDL_MODULE_ENVIRONMENT: + finalize_environment_unwind (this_binding->unwind_ptr.arg); + break; +#endif case SPECPDL_LET: { /* If variable has a trivial value (no forwarding), and isn't trapped, we can just set it. */ @@ -3859,6 +3884,10 @@ backtrace_eval_unrewind (int distance) case SPECPDL_UNWIND_INTMAX: case SPECPDL_UNWIND_VOID: case SPECPDL_BACKTRACE: +#ifdef HAVE_MODULES + case SPECPDL_MODULE_RUNTIME: + case SPECPDL_MODULE_ENVIRONMENT: +#endif break; case SPECPDL_LET: { /* If variable has a trivial value (no forwarding), we can @@ -3994,6 +4023,10 @@ NFRAMES and BASE specify the activation frame to use, as in `backtrace-frame'. case SPECPDL_UNWIND_EXCURSION: case SPECPDL_UNWIND_VOID: case SPECPDL_BACKTRACE: +#ifdef HAVE_MODULES + case SPECPDL_MODULE_RUNTIME: + case SPECPDL_MODULE_ENVIRONMENT: +#endif break; default: @@ -4040,6 +4073,14 @@ mark_specpdl (union specbinding *first, union specbinding *ptr) } break; +#ifdef HAVE_MODULES + case SPECPDL_MODULE_RUNTIME: + break; + case SPECPDL_MODULE_ENVIRONMENT: + mark_module_environment (pdl->unwind_ptr.arg); + break; +#endif + case SPECPDL_LET_DEFAULT: case SPECPDL_LET_LOCAL: mark_object (specpdl_where (pdl)); diff --git a/src/lisp.h b/src/lisp.h index 31614b9125..a95913c4ef 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3127,6 +3127,10 @@ enum specbind_tag { SPECPDL_UNWIND_EXCURSION, /* Likewise, on an excursion. */ SPECPDL_UNWIND_VOID, /* Likewise, with no arg. */ SPECPDL_BACKTRACE, /* An element of the backtrace. */ +#ifdef HAVE_MODULES + SPECPDL_MODULE_RUNTIME, /* A live module runtime. */ + SPECPDL_MODULE_ENVIRONMENT, /* A live module environment. */ +#endif SPECPDL_LET, /* A plain and simple dynamic let-binding. */ /* Tags greater than SPECPDL_LET must be "subkinds" of LET. */ SPECPDL_LET_LOCAL, /* A buffer-local let-binding. */ @@ -4146,6 +4150,7 @@ extern void record_unwind_protect_intmax (void (*) (intmax_t), intmax_t); extern void record_unwind_protect_void (void (*) (void)); extern void record_unwind_protect_excursion (void); extern void record_unwind_protect_nothing (void); +extern void record_unwind_protect_module (enum specbind_tag, void *); extern void clear_unwind_protect (ptrdiff_t); extern void set_unwind_protect (ptrdiff_t, void (*) (Lisp_Object), Lisp_Object); extern void set_unwind_protect_ptr (ptrdiff_t, void (*) (void *), void *); @@ -4216,7 +4221,9 @@ extern module_funcptr module_function_address (struct Lisp_Module_Function const *); extern void *module_function_data (const struct Lisp_Module_Function *); extern void module_finalize_function (const struct Lisp_Module_Function *); -extern void mark_modules (void); +extern void mark_module_environment (void *); +extern void finalize_runtime_unwind (void *); +extern void finalize_environment_unwind (void *); extern void init_module_assertions (bool); extern void syms_of_module (void); #endif diff --git a/test/src/emacs-module-resources/mod-test.c b/test/src/emacs-module-resources/mod-test.c index 258a679b20..419621256a 100644 --- a/test/src/emacs-module-resources/mod-test.c +++ b/test/src/emacs-module-resources/mod-test.c @@ -691,6 +691,14 @@ Fmod_test_identity (emacs_env *env, ptrdiff_t nargs, emacs_value *args, return args[0]; } +static emacs_value +Fmod_test_funcall (emacs_env *env, ptrdiff_t nargs, emacs_value *args, + void *data) +{ + assert (0 < nargs); + return env->funcall (env, args[0], nargs - 1, args + 1); +} + /* Lisp utilities for easier readability (simple wrappers). */ /* Provide FEATURE to Emacs. */ @@ -780,6 +788,8 @@ emacs_module_init (struct emacs_runtime *ert) DEFUN ("mod-test-function-finalizer-calls", Fmod_test_function_finalizer_calls, 0, 0, NULL, NULL); DEFUN ("mod-test-async-pipe", Fmod_test_async_pipe, 1, 1, NULL, NULL); + DEFUN ("mod-test-funcall", Fmod_test_funcall, 1, emacs_variadic_function, + NULL, NULL); #undef DEFUN diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el index fb4ed4a684..99d4cafb4a 100644 --- a/test/src/emacs-module-tests.el +++ b/test/src/emacs-module-tests.el @@ -506,4 +506,54 @@ See Bug#36226." (should (not (multibyte-string-p (mod-test-return-unibyte)))) (should (equal result "foo\x00zot")))) +(cl-defstruct (emacs-module-tests--variable + (:constructor nil) + (:constructor emacs-module-tests--make-variable + (name + &aux + (mutex (make-mutex name)) + (condvar (make-condition-variable mutex name)))) + (:copier nil)) + "A variable that's protected by a mutex." + value + (mutex nil :read-only t :type mutex) + (condvar nil :read-only t :type condition-variable)) + +(defun emacs-module-tests--wait-for-variable (variable desired) + (with-mutex (emacs-module-tests--variable-mutex variable) + (while (not (eq (emacs-module-tests--variable-value variable) desired)) + (condition-wait (emacs-module-tests--variable-condvar variable))))) + +(defun emacs-module-tests--change-variable (variable new) + (with-mutex (emacs-module-tests--variable-mutex variable) + (setf (emacs-module-tests--variable-value variable) new) + (condition-notify (emacs-module-tests--variable-condvar variable) :all))) + +(ert-deftest emacs-module-tests/interleaved-threads () + (let* ((state-1 (emacs-module-tests--make-variable "1")) + (state-2 (emacs-module-tests--make-variable "2")) + (thread-1 + (make-thread + (lambda () + (emacs-module-tests--change-variable state-1 'before-module) + (mod-test-funcall + (lambda () + (emacs-module-tests--change-variable state-1 'in-module) + (emacs-module-tests--wait-for-variable state-2 'in-module))) + (emacs-module-tests--change-variable state-1 'after-module)) + "thread 1")) + (thread-2 + (make-thread + (lambda () + (emacs-module-tests--change-variable state-2 'before-module) + (emacs-module-tests--wait-for-variable state-1 'in-module) + (mod-test-funcall + (lambda () + (emacs-module-tests--change-variable state-2 'in-module) + (emacs-module-tests--wait-for-variable state-1 'after-module))) + (emacs-module-tests--change-variable state-2 'after-module)) + "thread 2"))) + (thread-join thread-1) + (thread-join thread-2))) + ;;; emacs-module-tests.el ends here commit e7423689208026658fbe8c75523eac6dbe022c39 Author: Philipp Stephani Date: Fri Nov 27 20:04:20 2020 +0100 ; * src/lisp.h (enum specbind_tag): Fix typo. diff --git a/src/lisp.h b/src/lisp.h index 76d74200ac..31614b9125 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3124,7 +3124,7 @@ enum specbind_tag { SPECPDL_UNWIND_PTR, /* Likewise, on void *. */ SPECPDL_UNWIND_INT, /* Likewise, on int. */ SPECPDL_UNWIND_INTMAX, /* Likewise, on intmax_t. */ - SPECPDL_UNWIND_EXCURSION, /* Likewise, on an execursion. */ + SPECPDL_UNWIND_EXCURSION, /* Likewise, on an excursion. */ SPECPDL_UNWIND_VOID, /* Likewise, with no arg. */ SPECPDL_BACKTRACE, /* An element of the backtrace. */ SPECPDL_LET, /* A plain and simple dynamic let-binding. */ commit 1f633311c194edff9976b0672940769e76ac538e Author: Stefan Monnier Date: Fri Nov 27 10:19:21 2020 -0500 * lisp/subr.el (activate-change-group): Refine fix for bug#33341 diff --git a/lisp/subr.el b/lisp/subr.el index 1cf3a49fe4..0b92a4f9b5 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3038,8 +3038,19 @@ to `accept-change-group' or `cancel-change-group'." (if (eq buffer-undo-list t) (setq buffer-undo-list nil) ;; Add a boundary to make sure the upcoming changes won't be - ;; merged with any previous changes (bug#33341). - (undo-boundary))))) + ;; merged/combined with any previous changes (bug#33341). + ;; We're not supposed to introduce a real (visible) + ;; `undo-boundary', tho, so we have to push something else + ;; that acts like a boundary w.r.t preventing merges while + ;; being harmless. + ;; We use for that an "empty insertion", but in order to be harmless, + ;; it has to be at a harmless position. Currently only + ;; insertions are ever merged/combined, so we use such a "boundary" + ;; only when the last change was an insertion and we use the position + ;; of the last insertion. + (when (numberp (caar buffer-undo-list)) + (push (cons (caar buffer-undo-list) (caar buffer-undo-list)) + buffer-undo-list)))))) (defun accept-change-group (handle) "Finish a change group made with `prepare-change-group' (which see). diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index e3f798d11c..019441d9a3 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -555,13 +555,24 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350." (with-temp-buffer (buffer-enable-undo) (insert "0\n") - ;; (undo-boundary) (let ((g (prepare-change-group))) (activate-change-group g) (insert "b\n") (insert "c\n") (cancel-change-group g)) - (should (equal (buffer-string) "0\n")))) + (should (equal (buffer-string) "0\n")) + (erase-buffer) + (setq buffer-undo-list nil) + (insert "0\n") + (let ((g (prepare-change-group))) + (activate-change-group g) + (insert "b\n") + (insert "c\n") + (accept-change-group g)) + (should (equal (buffer-string) "0\nb\nc\n")) + (undo-boundary) + (undo) + (should (equal (buffer-string) "")))) (provide 'subr-tests) ;;; subr-tests.el ends here commit 8ebf041d5f54d9ae0dd360d9d3b3f82c5c7e3106 Author: Mattias Engdegård Date: Tue Nov 24 12:05:47 2020 +0100 Make the 'cucumber' compilation pattern work without 'omake' When 'omake' is included in compilation-error-regexp-alist, which it still is by default, then all other rules are modified to match with an extra leading 6 spaces as well. The 'cucumber' pattern relied on this in order to work as intended. * lisp/progmodes/compile.el (compilation-error-regexp-alist-alist): Extend the 'cucumber' pattern so that it works even when 'omake' is not included. Move it below the 'gnu' rule so that it doesn't match anything else. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index de9c9a209d..787f5d5ef3 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -214,10 +214,6 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) "^\"\\([^,\" \n\t]+\\)\", line \\([0-9]+\\)\ \\(?:[(. pos]+\\([0-9]+\\))?\\)?[:.,; (-]\\( warning:\\|[-0-9 ]*(W)\\)?" 1 2 3 (4)) - (cucumber - "\\(?:^cucumber\\(?: -p [^[:space:]]+\\)?\\|#\\)\ -\\(?: \\)\\([^(].*\\):\\([1-9][0-9]*\\)" 1 2) - (msft ;; Must be before edg-1, so that MSVC's longer messages are ;; considered before EDG. @@ -399,6 +395,17 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) (regexp "[0-9][0-9][0-9]"))) 1 (2 . 4) (3 . 5) (6 . 7)) + (cucumber + ,(rx (| (: bol + (| (: "cucumber" (? " -p " (+ (not space)))) + " ")) + "#") + " " + (group (not "(") (* nonl)) ; file + ":" + (group (in "1-9") (* (in "0-9")))) ; line + 1 2) + (lcc "^\\(?:E\\|\\(W\\)\\), \\([^(\n]+\\)(\\([0-9]+\\),[ \t]*\\([0-9]+\\)" 2 3 4 (1)) diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el index 0288cba789..74d7c7682e 100644 --- a/test/lisp/progmodes/compile-tests.el +++ b/test/lisp/progmodes/compile-tests.el @@ -124,6 +124,8 @@ ;; cucumber (cucumber "Scenario: undefined step # features/cucumber.feature:3" 29 nil 3 "features/cucumber.feature") + ;; This rule is actually handled by the `cucumber' pattern but when + ;; `omake' is included, then `gnu' matches it first. (gnu " /home/gusev/.rvm/foo/bar.rb:500:in `_wrap_assertion'" 1 nil 500 "/home/gusev/.rvm/foo/bar.rb") ;; edg-1 edg-2 commit 48c747e7a8aac34442c238311bbd65b23f97175a Author: Mattias Engdegård Date: Fri Nov 27 15:29:22 2020 +0100 Update TUTORIAL.de and TUTORIAL.fr * etc/tutorials/TUTORIAL.de: * etc/tutorials/TUTORIAL.fr: Follow recent changes in TUTORIAL. diff --git a/etc/tutorials/TUTORIAL.de b/etc/tutorials/TUTORIAL.de index ae58fc9a44..e5ac254200 100644 --- a/etc/tutorials/TUTORIAL.de +++ b/etc/tutorials/TUTORIAL.de @@ -1,8 +1,8 @@ Einführung in Emacs. Siehe Dateiende für Vervielfältigungsbedingungen. Emacs-Befehle beinhalten im allgemeinen die CONTROL-Taste (manchmal -auch als CTRL, CTL oder STRG beschriftet) sowie die META-Taste (auch -EDIT oder ALT genannt). Folgende Abkürzungen werden verwendet: +auch als CTRL oder STRG beschriftet) sowie die META-Taste (oft +ALT genannt). Folgende Abkürzungen werden verwendet: C- bedeutet, dass die CONTROL-Taste gedrückt sein muss, während man das Zeichen eingibt. Beispiel: @@ -264,7 +264,7 @@ Die meisten Emacs-Befehle akzeptieren ein numerisches Argument, das in der Regel als Wiederholungszähler dient (d.h., wie oft der Befehl ausgeführt werden soll). Eingegeben wird diese Zahl mit C-u, dann die Ziffern und dann der Befehl selbst. Alternativ können Sie die -META-Taste (bzw. EDIT- oder ALT-Taste) gedrückt halten und dann die +META-Taste (oder ALT-Taste) gedrückt halten und dann die Ziffern des Wiederholungszählers eingeben. Wir empfehlen allerdings, die C-u-Methode zu lernen, da sie mit jedem Terminal funktioniert. Das numerische Argument wird auch »Präfix-Argument« genannt, da man es diff --git a/etc/tutorials/TUTORIAL.fr b/etc/tutorials/TUTORIAL.fr index 3148c3f07e..6dc0651902 100644 --- a/etc/tutorials/TUTORIAL.fr +++ b/etc/tutorials/TUTORIAL.fr @@ -1,13 +1,13 @@ Didacticiel d'Emacs. Voir la fin de ce document pour les conditions. Les commandes Emacs utilisent généralement la touche CONTROLE (souvent -désignée par CTRL ou CTL) ou la touche META (souvent désignée par EDIT -ou ALT). Pour ces touches, nous utiliserons les abréviations suivantes : +désignée par CTRL) ou la touche META (plus souvent désignée par ALT). +Pour ces touches, nous utiliserons les abréviations suivantes : C- signifie qu'il faut maintenir la touche CONTROLE appuyée tout en tapant le caractère . Ainsi, C-f signifie : presser sur la touche CONTROLE tout en pressant la touche f. - M- signifie qu'il faut maintenir la touche META ou EDIT ou ALT + M- signifie qu'il faut maintenir la touche META ou ALT appuyée tout en tapant le caractère . Si aucune de ces touches n'existe, pressez puis relâchez la touche ESC et tapez . Nous écrirons pour désigner la touche ESC. @@ -31,7 +31,7 @@ La première chose que vous devez savoir est comment vous déplacer à travers le texte. Vous savez déjà comment avancer d'un écran avec C-v. Pour revenir un écran en arrière, tapez M-v (pressez la touche META tout en appuyant sur v ou faites v si vous n'avez pas de -touche META, EDIT ou ALT). +touche META ou ALT). >> Faites M-v, puis C-v plusieurs fois. @@ -208,7 +208,7 @@ La plupart des commandes Emacs acceptent un paramètre numérique qui, la plupart du temps, indique un nombre de répétitions. Pour indiquer à une commande le nombre de fois que l'on souhaite la répéter, on utilise C-u suivi du nombre avant de taper la commande. Si vous avez -une touche META (ou EDIT ou ALT), il existe une autre façon d'entrer +une touche META (ou ALT), il existe une autre façon d'entrer un paramètre numérique : tapez le nombre tout en pressant la touche META. Nous vous conseillons d'apprendre à utiliser la méthode C-u car elle fonctionne sur tous les types de terminaux. Le paramètre @@ -1101,7 +1101,7 @@ suffisant pour vous rappeler les commandes que vous avez déjà apprises. Les commandes multi-caractères, comme C-x C-s et (si vous n'avez ni -touche META, ni touche EDIT, ni touche ALT) v sont également +touche META, ni touche ALT) v sont également possibles après C-h c. Pour obtenir plus d'informations sur une commande, faites C-h k au commit 66eeaaa48858572d47ff3b0b177d5b765df93418 Author: Stefan Monnier Date: Fri Nov 27 09:43:56 2020 -0500 * lisp/subr.el (activate-change-group): Fix bug#33341 diff --git a/lisp/subr.el b/lisp/subr.el index e009dcc2b9..1cf3a49fe4 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3036,7 +3036,10 @@ to `accept-change-group' or `cancel-change-group'." (dolist (elt handle) (with-current-buffer (car elt) (if (eq buffer-undo-list t) - (setq buffer-undo-list nil))))) + (setq buffer-undo-list nil) + ;; Add a boundary to make sure the upcoming changes won't be + ;; merged with any previous changes (bug#33341). + (undo-boundary))))) (defun accept-change-group (handle) "Finish a change group made with `prepare-change-group' (which see). diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 67f7fc9749..e3f798d11c 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -551,5 +551,17 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350." (should (equal (replace-regexp-in-string "\\`\\|x" "z" "--xx--") "z--zz--"))) +(ert-deftest subr-tests--change-group-33341 () + (with-temp-buffer + (buffer-enable-undo) + (insert "0\n") + ;; (undo-boundary) + (let ((g (prepare-change-group))) + (activate-change-group g) + (insert "b\n") + (insert "c\n") + (cancel-change-group g)) + (should (equal (buffer-string) "0\n")))) + (provide 'subr-tests) ;;; subr-tests.el ends here commit 2b14b7e6dcdf54d5a85f612b7e0c0e1da9ec40a1 Author: Stefan Kangas Date: Fri Nov 27 10:36:15 2020 +0100 Update TUTORIAL.es * etc/tutorials/TUTORIAL.es: A followup to recent changes in TUTORIAL. diff --git a/etc/tutorials/TUTORIAL.es b/etc/tutorials/TUTORIAL.es index 66ff3c34c1..faecb26432 100644 --- a/etc/tutorials/TUTORIAL.es +++ b/etc/tutorials/TUTORIAL.es @@ -2,16 +2,16 @@ Tutorial de Emacs. Vea al final las condiciones de copiado. Generalmente los comandos de Emacs involucran la tecla CONTROL (algunas veces llamada CTRL O CTL) o la tecla meta (algunas veces -llamada EDIT o ALT). En lugar de escribir completamente esto en cada +llamada ALT). En lugar de escribir completamente esto en cada ocasión, usaremos las siguientes abreviaturas. C- significa mantener presionada la tecla CONTROL mientras teclea el carácter . Por lo tanto C-f será: Mantenga presionada la tecla CONTROL y teclee f. - M- significa mantener presionada la tecla META o EDIT o ALT - mientras teclea . Si no hay teclas META, EDIT o ALT, en - su lugar presione y libere la tecla ESC y luego teclee - . Escribimos para referirnos a la tecla ESC. + M- significa mantener presionada la tecla META o ALT mientras + teclea . Si no hay teclas META o ALT, en su lugar + presione y libere la tecla ESC y luego teclee . + Escribimos para referirnos a la tecla ESC. Nota importante: para terminar la sesión de Emacs teclee C-x C-c (dos caracteres). Para cancelar un comando parcialmente introducido, @@ -32,7 +32,7 @@ texto. Lo primero que necesita saber es cómo moverse de un lugar a otro en el texto. Ya sabe cómo avanzar una pantalla, con C-v. Para retroceder una pantalla teclee M-v (mantenga oprimida la tecla META y teclee v, o -teclee v si no tiene las teclas META, EDIT o ALT). +teclee v si no tiene las teclas META o ALT). >> Intente teclear M-v y luego C-v, varias veces. @@ -203,12 +203,12 @@ La mayoría de comandos de Emacs aceptan un argumento numérico; para la mayoría de comandos esto sirve como un factor de repetición. La manera de pasarle un factor de repetición a un comando es tecleando C-u y luego los dígitos antes de introducir los comandos. Si tiene -una tecla META (o EDIT o ALT), hay una manera alternativa para -ingresar un argumento numérico: teclear los dígitos mientras presiona -la tecla META. Recomendamos aprender el método C-u porque éste -funciona en cualquier terminal. El argumento numérico es también -llamado un «argumento prefijo», porque usted teclea el argumento antes -del comando al que se aplica. +una tecla META (o ALT), hay una manera alternativa para ingresar un +argumento numérico: teclear los dígitos mientras presiona la tecla +META. Recomendamos aprender el método C-u porque éste funciona en +cualquier terminal. El argumento numérico es también llamado un +«argumento prefijo», porque usted teclea el argumento antes del +comando al que se aplica. Por ejemplo, C-u 8 C-f mueve hacia adelante ocho caracteres. @@ -1075,8 +1075,8 @@ como una breve documentación: suficiente para recordarle los comandos que ha aprendido. Los comandos de múltiples caracteres tales como C-x C-s y (si no tiene -las teclas META o EDIT o ALT) v también están permitidos después -de C-h c. +las teclas META o ALT) v también están permitidos después de +C-h c. Para conseguir más información sobre un comando use C-h k en vez de C-h c. commit 5dba35632b40a3d8ea90e02c2408eefbae012524 Author: Stefan Kangas Date: Fri Nov 27 10:22:42 2020 +0100 Update TUTORIAL.sv * etc/tutorials/TUTORIAL.sv: A followup to recent changes in TUTORIAL. Minor tweaks for grammar and style. diff --git a/etc/tutorials/TUTORIAL.sv b/etc/tutorials/TUTORIAL.sv index 231d8a061b..b60c7f93bc 100644 --- a/etc/tutorials/TUTORIAL.sv +++ b/etc/tutorials/TUTORIAL.sv @@ -1,14 +1,16 @@ Emacs användarhandledning. I slutet finns kopieringsvillkoren. -Emacs-kommandon innebär ofta användning av kontrolltangenten (vanligen -märkt CTRL eller CTL) eller META-tangenten (på vissa tangentbord märkt -ALT eller EDIT). Vi använder här följande förkortningar: +Emacs-kommandon använder ofta kontrolltangenten (vanligen märkt CTRL +eller CTL) eller META-tangenten (på vissa tangentbord märkt ALT). +Istället för att skriva ut deras namn varje gång använder vi följande +förkortningar: C- håll ner kontrolltangenten samtidigt som du skriver bokstaven . C-f betyder: håll ner kontrolltangenten och tryck f. - M- håll ner META-tangenten samtidigt som du skriver . Om - META-tangent saknas trycker du , ESC-tangenten, släpper - den och trycker sedan . + M- håll ner META- eller ALT-tangenten samtidigt som du skriver + . Om det inte finns någon META- eller ALT-tangent + trycker du på ESC-tangenten, släpper den och trycker sedan + . När vi skriver menar vi ESC-tangenten. Viktigt: För att avsluta Emacs trycker du C-x C-c (två tecken). För att avsluta kommandon som inte skrivits in fullt, tryck C-g. @@ -35,7 +37,7 @@ Det första du behöver veta är hur du manövrerar från plats till plats i texten. Du har redan lärt dig hur du flyttar en skärmbild framåt, med C-v. För att flytta dig en skärmbild bakåt trycker du M-v. (Håll ned META-tangenten och tryck v eller tryck v om du inte har -META-, EDIT- eller ALT-tangent.) +en META- eller ALT-tangent.) >> Prova att trycka M-v och C-v några gånger. @@ -205,12 +207,11 @@ de mer avancerade kontrollfunktionerna. De flesta kommandon i Emacs tar ett numeriskt argument och för de flesta kommandon leder detta till att de repeteras. Ett numeriskt argument anges genom att du skriver C-u och sedan talet, innan du -skriver kommandot. Om du har en META- (eller EDIT- eller ALT-) tangent -så finns det ett annat alternativ för att ge numeriska argument: skriv -talet medan du håller ned META-tangenten. Vi föreslår att du använder -C-u för det fungerar på alla slags terminaler. Det numeriska -argumentet kallas också för "prefixargument" eftersom det skrivs före -kommandot. +skriver kommandot. Om du har en META- eller ALT-tangent så finns det +ett annat alternativ för att ge numeriska argument: skriv talet medan +du håller ned META-tangenten. Vi föreslår att du använder C-u för det +fungerar på alla slags terminaler. Det numeriska argumentet kallas +också för "prefixargument" eftersom det skrivs före kommandot. Till exempel: C-u 8 C-f flyttar markören åtta steg framåt. @@ -641,7 +642,7 @@ vill spara eller ej. * UTVIDGNING AV KOMMANDOMÄNGDEN ------------------------------- -Det finns mycket fler Emacs-kommandon än antalet KONTROLL- eller +Det finns många fler Emacs-kommandon än antalet KONTROLL- eller META-tangenter. För att komma förbi denna begränsning har Emacs ett "X"- (eXtend) kommando. Detta finns i två varianter: @@ -1042,8 +1043,7 @@ beskrivande namn kan de också fungera som en enkel dokumentation, tillräckligt för att påminna dig om kommandon du redan lärt dig. Flerteckenskommandon, så som C-x C-s och v (i stället för M-v, om -du inte har META, EDIT eller ALT tangenten) är också tillåtna efter -C-h c. +du inte har META- eller ALT-tangenten) är också tillåtna efter C-h c. För att få mer information om ett kommando kan du använda C-h k istället för C-h c. commit 13e032bab34fb33efee23184c02baa62ebe4dbfc Author: Juri Linkov Date: Fri Nov 27 11:17:12 2020 +0200 Add completion-tab-width to align prefix chars with names in read-char-by-name * lisp/international/mule-cmds.el (mule--ucs-names-affixation): Replace mule--ucs-names-annotation to display chars in prefixes that implements two FIXME items. (read-char-by-name): Let-bind completion-tab-width to 4. Use affixation-function instead of annotation-function. * lisp/minibuffer.el (completion-tab-width): New variable. (completion--insert-strings): Align colwidth to tab positions when completion-tab-width is non-nil. * lisp/simple.el (completion-setup-function): Set tab-width to completion-tab-width when completion-tab-width is non-nil. https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg01263.html diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index d361971a1f..d59f2c0ebf 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -3084,13 +3084,11 @@ on encoding." (puthash "BELL (BEL)" ?\a names) (setq ucs-names names)))) -(defun mule--ucs-names-annotation (name) - ;; FIXME: It would be much better to add this annotation before rather than - ;; after the char name, so the annotations are aligned. - ;; FIXME: The default behavior of displaying annotations in italics - ;; doesn't work well here. - (let ((char (gethash name ucs-names))) - (when char (format " (%c)" char)))) +(defun mule--ucs-names-affixation (names) + (mapcar (lambda (name) + (let ((char (gethash name ucs-names))) + (list name (concat (if char (format "%c" char) " ") "\t") ""))) + names)) (defun char-from-name (string &optional ignore-case) "Return a character as a number from its Unicode name STRING. @@ -3133,13 +3131,14 @@ octal). Treat otherwise-ambiguous strings like \"BED\" (U+1F6CF) as names, not numbers." (let* ((enable-recursive-minibuffers t) (completion-ignore-case t) + (completion-tab-width 4) (input (completing-read prompt (lambda (string pred action) (if (eq action 'metadata) '(metadata - (annotation-function . mule--ucs-names-annotation) + (affixation-function . mule--ucs-names-affixation) (category . unicode-name)) (complete-with-action action (ucs-names) string pred))))) (char diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 87bf3d36fa..d44d896822 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1134,6 +1134,7 @@ completion candidates than this number." (defvar-local completion-all-sorted-completions nil) (defvar-local completion--all-sorted-completions-location nil) (defvar completion-cycling nil) ;Function that takes down the cycling map. +(defvar completion-tab-width nil) (defvar completion-fail-discreetly nil "If non-nil, stay quiet when there is no match.") @@ -1718,6 +1719,11 @@ It also eliminates runs of equal strings." (row 0) (first t) (laststring nil)) + (unless (or tab-stop-list (null completion-tab-width) + (zerop (mod colwidth completion-tab-width))) + ;; Align to tab positions for the case + ;; when the caller uses tabs inside prefix. + (setq colwidth (- colwidth (mod colwidth completion-tab-width)))) ;; The insertion should be "sensible" no matter what choices were made ;; for the parameters above. (dolist (str strings) @@ -1758,9 +1764,10 @@ It also eliminates runs of equal strings." ;; already past the goal column, there is still ;; a space displayed. (set-text-properties (1- (point)) (point) - ;; We can't just set tab-width, because - ;; completion-setup-function will kill - ;; all local variables :-( + ;; We can set tab-width using + ;; completion-tab-width, but + ;; the caller can prefer using + ;; \t to align prefixes. `(display (space :align-to ,column))) nil)))) (setq first nil) diff --git a/lisp/simple.el b/lisp/simple.el index 77888d07f1..93fda7de8a 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8822,6 +8822,8 @@ Called from `temp-buffer-show-hook'." insert-fun)) (set (make-local-variable 'completion-reference-buffer) mainbuf) (if base-dir (setq default-directory base-dir)) + (when completion-tab-width + (setq tab-width completion-tab-width)) ;; Maybe insert help string. (when completion-show-help (goto-char (point-min)) commit 597a49b2e2ef664cc99a7f1a1ecad7d22df096a1 Author: Juri Linkov Date: Fri Nov 27 11:00:43 2020 +0200 * lisp/simple.el (read-from-kill-ring): Use frame-text-cols, not frame-width. diff --git a/lisp/simple.el b/lisp/simple.el index c9f4f2bb44..77888d07f1 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5478,7 +5478,7 @@ With ARG, rotate that many kills forward (or backward, if negative)." (mapcar (lambda (s) (let* ((s (query-replace-descr s)) (b 0) - (limit (frame-width))) + (limit (frame-text-cols))) ;; Add ellipsis on leading whitespace (when (string-match "\\`[[:space:]]+" s) (setq b (match-end 0)) commit 2dd1c2d4ba4ecbb7ac6d6e3f5de8ccb8d1d11c4f Author: Eli Zaretskii Date: Fri Nov 27 10:50:15 2020 +0200 Update TUTORIAL.he * etc/tutorials/TUTORIAL.he: A followup to recent changes in TUTORIAL. diff --git a/etc/tutorials/TUTORIAL.he b/etc/tutorials/TUTORIAL.he index 907da24280..1478fdea73 100644 --- a/etc/tutorials/TUTORIAL.he +++ b/etc/tutorials/TUTORIAL.he @@ -1,13 +1,13 @@ שיעור ראשון בשימוש ב־‫Emacs‬. זכויות שימוש ראה בסוף המסמך. -פקודות רבות של Emacs משתמשות במקש CONTROL (לפעמים הוא מסומן ב־CTRL או CTL) -או במקש META (לפעמים מסומן EDIT או ALT). במקום לציין את כל השמות האפשריים +פקודות רבות של Emacs משתמשות במקש CONTROL (בדרך־כלל מסומן ב־CTRL) +או במקש META (בדרך־כלל מסומן ALT). במקום לציין את כל השמות האפשריים בכל פעם, נשתמש בקיצורים הבאים: ‏<תו>-C משמעותו לחץ והחזק מקש CONTROL ואז הקש על מקש <תו>. לדוגמא, C-f משמעותו: לחץ והחזק CONTROL והקש על f. -‏<תו>-M משמעותו לחץ והחזק מקש META או EDIT או ALT ואז הקש על מקש <תו>. - אם במקלדת אין אף אחד ממקשי META או EDIT או ALT, אפשר להקיש +‏<תו>-M משמעותו לחץ והחזק מקש META או ALT ואז הקש על מקש <תו>. + אם במקלדת אין אף אחד ממקשי META או ALT, אפשר להקיש ולשחרר מקש ESC ואז להקיש <תו>. אנו נכתוב עבור מקש ESC. הערה חשובה: כדי לצאת מ־Emacs יש להקיש C-x C-c (שני תוים, משמאל לימין). @@ -32,7 +32,7 @@ Emacs. דבר ראשון שעליכם ללמוד הוא כיצד לנוע ממקום אחד למשנהו בתוך הטקסט. אתם כבר יודעים כיצד להתקדם לעמוד הבא, עם C-v. לחזרה לעמוד הקודם הקישו M-v (החזיקו מקש META והקישו v או הקישו ‪v‬ אם אין במקלדת מקש META -או EDIT או ALT). +או ALT). >> נסו עתה כמה פעמים להקיש M-v ואחר־כך C-v. @@ -181,7 +181,7 @@ M-f עובר את המילה הבאה ונעצר בסופה. M-b פועל באו רוב הפקודות של Emacs מקבלות ארגומנט נומרי; עבור רוב הפקודות הארגומנט משמש כמונה של מספר החזרות על הפקודה. כדי לספק ארגומנט לפקודה, יש להקיש C-u ואחר־כך ספרות, וזאת לפני שמקישים את הפקודה עצמה. עם במקלדת קיים -מקש META (או EDIT או ALT), יש גם אפשרות אחרת לציין ארגומנט נומרי: +מקש META (או ALT), יש גם אפשרות אחרת לציין ארגומנט נומרי: הקישו את הספרות תוך כדי החזקת מקש META. אנו ממליצים על C-u משום שהוא יעבוד עם כל מקלדת. הארגומנט הנומרי נקרא גם "ארגומנט קידומת" (prefix argument) משום מקישים אותו לפני הפקודה אליה הוא מתייחס. @@ -605,7 +605,7 @@ replace-string (החלף מחרוזת) אשר מחליפה מחרוזת אחת אחרי שתקישו M-x, ‏Emacs מציג M-x בתחתית התצוגה ומחכה שתקישו את שם הפקודה, במקרה זה "replace-string". מספיק שתקישו "repl s‎" ו־Emacs ישלים את השם המלא. ( הוא מקש Tab, בדרך כלל תמצאו אותו מעל מקש -ה־CapsLock או Shift, ליד הקצה השמאלי של המקלדת.) סיימו את הזנת הפקודה +ה־Caps Lock או Shift, ליד הקצה השמאלי של המקלדת.) סיימו את הזנת הפקודה ע״י הקשת . הפקודה להחלפת מחרוזת זקוקה לשני ארגומנטים -- המחרוזת שתוחלף וזו שתחליף @@ -919,8 +919,7 @@ M-x help ‎ כתחליף.) לכם את הפקודות שלמדתם בעבר. ניתן לציין אחרי C-h c גם פקודות שמופעלות ע״י סדרת מקשים באורך גדול -מאחד, כגון C-x C-s או ‏‎ v (כתחליף ל־M-v, אם אין מקש META או EDIT -או ALT). +מאחד, כגון C-x C-s או ‏‎ v (כתחליף ל־M-v, אם אין מקש META או ALT). לקבלת מידע מפורט יותר על פקודה, השתמשו בפקודה C-h k במקום C-h c. commit 289a04cdda74a2481b9b95bc7c235af5b1454256 Author: Lars Ingebrigtsen Date: Fri Nov 27 09:23:53 2020 +0100 Fix up previous server exit directory deletion * lisp/server.el (server-start): Only delete the server directory if it's in /tmp (bug#44644). diff --git a/lisp/server.el b/lisp/server.el index 1219b02122..2fd94552dd 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -650,10 +650,15 @@ the `server-process' variable." (let (delete-by-moving-to-trash) (delete-file server-file) ;; Also delete the directory that the server file was - ;; created in. There may be other servers running, - ;; too, so this may fail. - (ignore-errors - (delete-directory (file-name-directory server-file))))) + ;; created in -- but only in /tmp (see bug#44644). + ;; There may be other servers running, too, so this may + ;; fail. + (when (equal (file-name-directory + (directory-file-name + (file-name-directory server-file))) + "/tmp/") + (ignore-errors + (delete-directory (file-name-directory server-file)))))) (setq server-mode nil) ;; already set by the minor mode code (display-warning 'server commit e3d8f4b98f19f4e8d194f1ae9a91065b80e01a0f Author: Dario Gjorgjevski Date: Thu Nov 26 11:59:23 2020 +0100 Fix modification check when custom-form is `lisp' * lisp/cus-edit.el (custom-variable-modified-p): Quote the value when custom form is 'lisp (or 'mismatch) prior to comparing in order to accommodate `custom-variable-value-create' (bug#44852). diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index cb68bae3c9..a00cb17e29 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -2900,14 +2900,20 @@ Modified means that the widget that holds the value has been edited by the user in a customize buffer. To check for other states, call `custom-variable-state'." (catch 'get-error - (let* ((symbol (widget-get widget :value)) + (let* ((form (widget-get widget :custom-form)) + (symbol (widget-get widget :value)) (get (or (get symbol 'custom-get) 'default-value)) (value (if (default-boundp symbol) (condition-case nil (funcall get symbol) (error (throw 'get-error t))) - (symbol-value symbol)))) - (not (equal value (widget-value (car (widget-get widget :children)))))))) + (symbol-value symbol))) + (orig-value (widget-value (car (widget-get widget :children))))) + (not (equal (if (memq form '(lisp mismatch)) + ;; Mimic `custom-variable-value-create'. + (custom-quote value) + value) + orig-value))))) (defun custom-variable-state-set (widget &optional state) "Set the state of WIDGET to STATE. commit 771bd26b778c089e153604244c00430f36227943 Author: Mattias Engdegård Date: Thu Nov 26 17:08:26 2020 +0100 Remove keyboard anachronisms from tutorial * etc/tutorials/TUTORIAL: Don't keep referring to EDIT as if it were a common name for the Meta key; since a few decades back it's labelled Alt (or Option or ⌥ but those keys usually also have 'alt' engraved on them). Similarly, CTL is practically extinct and not worth mentioning. diff --git a/etc/tutorials/TUTORIAL b/etc/tutorials/TUTORIAL index 319ba52b67..a5b4b76916 100644 --- a/etc/tutorials/TUTORIAL +++ b/etc/tutorials/TUTORIAL @@ -1,13 +1,13 @@ Emacs tutorial. See end for copying conditions. -Emacs commands generally involve the CONTROL key (sometimes labeled -CTRL or CTL) or the META key (sometimes labeled EDIT or ALT). Rather than -write that in full each time, we'll use the following abbreviations: +Emacs commands generally involve the CONTROL key (often labeled CTRL) +or the META key (usually labeled ALT). Rather than writing that +in full each time, we'll use the following abbreviations: C- means hold the CONTROL key while typing the character Thus, C-f would be: hold the CONTROL key and type f. - M- means hold the META or EDIT or ALT key down while typing . - If there is no META, EDIT or ALT key, instead press and release the + M- means hold the META or ALT key down while typing . + If there is no META or ALT key, instead press and release the ESC key and then type . We write for the ESC key. Important note: to end the Emacs session, type C-x C-c. (Two characters.) @@ -33,7 +33,7 @@ that is called "editing" and that's what Emacs is for. The first thing that you need to know is how to move around from place to place in the text. You already know how to move forward one screen, with C-v. To move backwards one screen, type M-v (hold down the META key -and type v, or type v if you do not have a META, EDIT, or ALT key). +and type v, or type v if you do not have a META or ALT key). >> Try typing M-v and then C-v, a few times. @@ -196,7 +196,7 @@ easily learn to use other advanced cursor motion commands as well. Most Emacs commands accept a numeric argument; for most commands, this serves as a repeat-count. The way you give a command a repeat count is by typing C-u and then the digits before you type the command. If -you have a META (or EDIT or ALT) key, there is another, alternative way +you have a META (or ALT) key, there is another, alternative way to enter a numeric argument: type the digits while holding down the META key. We recommend learning the C-u method because it works on any terminal. The numeric argument is also called a "prefix argument", @@ -676,7 +676,7 @@ another in the buffer. When you type M-x, Emacs prompts you at the bottom of the screen with M-x and you should type the name of the command; in this case, "replace-string". Just type "repl s" and Emacs will complete the name. ( is the Tab key, usually found -above the CapsLock or Shift key near the left edge of the keyboard.) +above the Caps Lock or Shift key near the left edge of the keyboard.) Submit the command name with . The replace-string command requires two arguments--the string to be @@ -1024,7 +1024,7 @@ very brief documentation--sufficient to remind you of commands you have already learned. Multi-character commands such as C-x C-s and v (instead of M-v, -if you have no META or EDIT or ALT key) are also allowed after C-h c. +if you have no META or ALT key) are also allowed after C-h c. To get more information about a command, use C-h k instead of C-h c. commit 558b6dbca7bc933fe01255be9ebeffebd44a2645 Author: Mattias Engdegård Date: Wed Nov 25 15:32:08 2020 +0100 Fix replace-regexp-in-string substring match data translation For certain patterns, re-matching the same regexp on the matched substring does not produce correctly translated match data (bug#15107 and bug#44861). Using a new builtin function also improves performance since the number of calls to string-match is halved. Reported by Kevin Ryde and Shigeru Fukaya. * lisp/subr.el (replace-regexp-in-string): Translate the match data using match-data--translate instead of trusting a call to string-match on the matched string to do the job. * test/lisp/subr-tests.el (subr-replace-regexp-in-string): Add test cases. * src/search.c (Fmatch_data__translate): New internal function. (syms_of_search): Register it as a subroutine. diff --git a/lisp/subr.el b/lisp/subr.el index 1fb0f9ab7e..e009dcc2b9 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4546,10 +4546,9 @@ and replace a sub-expression, e.g. (when (= me mb) (setq me (min l (1+ mb)))) ;; Generate a replacement for the matched substring. ;; Operate on only the substring to minimize string consing. - ;; Set up match data for the substring for replacement; - ;; presumably this is likely to be faster than munging the - ;; match data directly in Lisp. - (string-match regexp (setq str (substring string mb me))) + ;; Translate the match data so that it applies to the matched substring. + (match-data--translate (- mb)) + (setq str (substring string mb me)) (setq matches (cons (replace-match (if (stringp rep) rep diff --git a/src/search.c b/src/search.c index e7f9094946..4eb634a3c0 100644 --- a/src/search.c +++ b/src/search.c @@ -3031,6 +3031,23 @@ If optional arg RESEAT is non-nil, make markers on LIST point nowhere. */) return Qnil; } +DEFUN ("match-data--translate", Fmatch_data__translate, Smatch_data__translate, + 1, 1, 0, + doc: /* Add N to all string positions in the match data. Internal. */) + (Lisp_Object n) +{ + CHECK_FIXNUM (n); + EMACS_INT delta = XFIXNUM (n); + if (EQ (last_thing_searched, Qt)) /* String match data only. */ + for (ptrdiff_t i = 0; i < search_regs.num_regs; i++) + if (search_regs.start[i] >= 0) + { + search_regs.start[i] = max (0, search_regs.start[i] + delta); + search_regs.end[i] = max (0, search_regs.end[i] + delta); + } + return Qnil; +} + /* Called from Flooking_at, Fstring_match, search_buffer, Fstore_match_data if asynchronous code (filter or sentinel) is running. */ static void @@ -3388,6 +3405,7 @@ is to bind it with `let' around a small expression. */); defsubr (&Smatch_end); defsubr (&Smatch_data); defsubr (&Sset_match_data); + defsubr (&Smatch_data__translate); defsubr (&Sregexp_quote); defsubr (&Snewline_cache_check); diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index c77be511dc..67f7fc9749 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -545,7 +545,11 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350." (match-beginning 1) (match-end 1))) "babbcaacabc") "ba")) - ) + ;; anchors (bug#15107, bug#44861) + (should (equal (replace-regexp-in-string "a\\B" "b" "a aaaa") + "a bbba")) + (should (equal (replace-regexp-in-string "\\`\\|x" "z" "--xx--") + "z--zz--"))) (provide 'subr-tests) ;;; subr-tests.el ends here commit c9160bda7889d9e37a9b82ef64bf711ba7e32e41 Author: Alan Mackenzie Date: Thu Nov 26 11:37:38 2020 +0000 CC Mode: Fix error in cache handling. This fixes bug #43481 * lisp/progmodes/cc-engine.el (c-full-pp-to-literal): Handle correctly END being before HERE by using parse-partial-sexp to get the end of the literal containing HERE. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index babe6e7476..01ab253ceb 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -3155,7 +3155,7 @@ comment at the start of cc-engine.el for more info." ((nth 7 s) 'c++) (t 'c))) (setq start (nth 8 s)) - (unless end + (unless (and end (>= end here)) (setq s1 (parse-partial-sexp here (point-max) nil ; TARGETDEPTH nil ; STOPBEFORE commit 0287c5176867628e7acb834b3d5f26a150cfaf85 Author: Lars Ingebrigtsen Date: Thu Nov 26 11:24:20 2020 +0100 Keep point in the *eldoc* buffer in eldoc-display-in-echo-area * lisp/emacs-lisp/eldoc.el (eldoc-display-in-echo-area): Use 'save-excursion' to keep point position in *eldoc* buffer. Suggested by Andrii Kolomoiets . diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 78cb8f08c3..d81060ef16 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -591,7 +591,8 @@ Honor `eldoc-echo-area-use-multiline-p' and ;; format the *eldoc* buffer, using as most of its ;; contents as we know will fit. (with-current-buffer (eldoc--format-doc-buffer docs) - (eldoc--echo-area-substring available))) + (save-excursion + (eldoc--echo-area-substring available)))) (t ;; this is the "truncate brutally" situation (let ((string (with-current-buffer (eldoc--format-doc-buffer docs) commit d23723cfb24b87170f53ce615bff083ef2d7e76a Author: Lars Ingebrigtsen Date: Thu Nov 26 11:00:35 2020 +0100 Allow following symlinks when recompiling directories * doc/lispref/compile.texi (Compilation Functions): Document it. * lisp/emacs-lisp/bytecomp.el (byte-recompile-directory): Allow following symlinks (bug#10292). diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi index ad8afaae60..51a4b04486 100644 --- a/doc/lispref/compile.texi +++ b/doc/lispref/compile.texi @@ -199,7 +199,7 @@ $ ls -l push* @end example @end deffn -@deffn Command byte-recompile-directory directory &optional flag force +@deffn Command byte-recompile-directory directory &optional flag force follow-symlinks @cindex library compilation This command recompiles every @samp{.el} file in @var{directory} (or its subdirectories) that needs recompilation. A file needs @@ -218,6 +218,10 @@ Interactively, @code{byte-recompile-directory} prompts for If @var{force} is non-@code{nil}, this command recompiles every @samp{.el} file that has a @samp{.elc} file. +This command will normally not compile @samp{.el} files that are +symlinked. If the optional @var{follow-symlink} parameter is +non-@code{nil}, symlinked @samp{.el} will also be compiled. + The returned value is unpredictable. @end deffn diff --git a/etc/NEWS b/etc/NEWS index e0916f56b8..2fb33e342e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2017,6 +2017,10 @@ to lexical binding, where dynamic (special) variables bound in one file can affect code in another. For details, see the manual section "(Elisp) Converting to Lexical Binding". ++++ +** 'byte-recompile-directory' can now compile symlinked .el files. +This is achieved by giving a non-nil FOLLOW-SYMLINKS parameter. + --- ** 'unload-feature' now also tries to undo additions to buffer-local hooks. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index e6f6a12b53..9ece8ec6f0 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1746,7 +1746,7 @@ Files in subdirectories of DIRECTORY are processed also." (byte-recompile-directory directory nil t)) ;;;###autoload -(defun byte-recompile-directory (directory &optional arg force) +(defun byte-recompile-directory (directory &optional arg force follow-symlinks) "Recompile every `.el' file in DIRECTORY that needs recompilation. This happens when a `.elc' file exists but is older than the `.el' file. Files in subdirectories of DIRECTORY are processed also. @@ -1759,7 +1759,11 @@ compile it. A nonzero ARG also means ask about each subdirectory before scanning it. If the third argument FORCE is non-nil, recompile every `.el' file -that already has a `.elc' file." +that already has a `.elc' file. + +This command will normally not follow symlinks when compiling +files. If FOLLOW-SYMLINKS is non-nil, symlinked `.el' files will +also be compiled." (interactive "DByte recompile directory: \nP") (if arg (setq arg (prefix-numeric-value arg))) (if noninteractive @@ -1792,7 +1796,8 @@ that already has a `.elc' file." (if (file-directory-p source) (and (not (member file '("RCS" "CVS"))) (not (eq ?\. (aref file 0))) - (not (file-symlink-p source)) + (or follow-symlinks + (not (file-symlink-p source))) ;; This file is a subdirectory. Handle them differently. (or (null arg) (eq 0 arg) (y-or-n-p (concat "Check " source "? "))) commit 9c72666feac28c6adf459f1eed3a45dc60fd896a Author: Stefan Kangas Date: Thu Nov 26 07:00:19 2020 +0100 ; * etc/NEWS: Add some missing documentation markers. diff --git a/etc/NEWS b/etc/NEWS index 5f8f408c6f..e0916f56b8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1711,6 +1711,7 @@ parameter. 'previous-system-time-locale' have been removed, as they were created by mistake and were not useful to Lisp code. +--- ** The 'load-dangerous-libraries' variable is now obsolete. It was used to allow loading Lisp libraries compiled by XEmacs, a modified version of Emacs which is no longer actively maintained. @@ -1725,6 +1726,7 @@ Use macro 'with-current-buffer-window' with action alist entry 'body-function'. To load the file after byte-compiling, add a call to 'load' from Lisp or use 'M-x emacs-lisp-byte-compile-and-load' interactively. +--- ** The metamail.el library is now marked obsolete. --- commit 82e4b826fbc81d4df994c1b35e7dd6d4f114b6fa Author: Stefan Kangas Date: Thu Nov 26 06:37:18 2020 +0100 * lisp/files.el (auto-mode-alist): Add entry for "archive-contents". diff --git a/lisp/files.el b/lisp/files.el index 49c9e5d18d..2cf77d5d7e 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2678,6 +2678,7 @@ since only a single case-insensitive search through the alist is made." ("\\.dir-locals\\(?:-2\\)?\\.el\\'" . lisp-data-mode) ("eww-bookmarks\\'" . lisp-data-mode) ("tramp\\'" . lisp-data-mode) + ("/archive-contents\\'" . lisp-data-mode) ("places\\'" . lisp-data-mode) ("\\.emacs-places\\'" . lisp-data-mode) ("\\.el\\'" . emacs-lisp-mode) commit 61f1eb99b065194cb5bae29d439f16bdc0a8ac7d Author: Eric Abrahamsen Date: Wed Nov 25 15:26:06 2020 -0800 Add "replied" -> "answered" for gnus-search imap searches * lisp/gnus/gnus-search.el (gnus-search-imap-handle-flag): This allows "mark:A" to be translated into "ANSWERED" and "-mark:A" to be translated into "UNANSWERED". diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 310711eca0..89d8cff925 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1313,6 +1313,7 @@ of whichever date elements are present." (pcase flag ("flag" "flagged") ("read" "seen") + ("replied" "answered") (_ flag))) (if (member flag '("seen" "answered" "deleted" "draft" "flagged")) (upcase flag) commit 11bef9693ab89c29758eb7e82245f807a60e1dde Author: Eric Abrahamsen Date: Sat Nov 14 13:37:08 2020 -0800 Assume default imap TEXT search even when not using parsed queries This behavior both better matches the previous nnir behavior, reducing confusion for new users, and matches behavior when using parsed queries. * lisp/gnus/gnus-search.el (gnus-search-imap-search-keys): Make sure this variable contains all known IMAP search keys. (gnus-search-run-search): If the search query doesn't start with a known search key, prepend "TEXT " to the query. diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 492ee2052c..310711eca0 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1030,6 +1030,13 @@ Responsible for handling and, or, and parenthetical expressions.") (declare-function nnimap-buffer "nnimap" ()) (declare-function nnimap-command "nnimap" (&rest args)) +(defvar gnus-search-imap-search-keys + '(body cc bcc from header keyword larger smaller subject text to uid x-gm-raw + answered before deleted draft flagged on since recent seen sentbefore + senton sentsince unanswered undeleted undraft unflagged unkeyword + unseen all) + "Known IMAP search keys.") + ;; imap interface (cl-defmethod gnus-search-run-search ((engine gnus-search-imap) srv query groups) @@ -1059,6 +1066,15 @@ Responsible for handling and, or, and parenthetical expressions.") (setq q-string (gnus-search-make-query-string engine query)) + ;; A bit of backward-compatibility slash convenience: if the + ;; query string doesn't start with any known IMAP search + ;; keyword, assume it is a "TEXT" search. + (unless (and (string-match "\\`[[:word:]]+" q-string) + (memql (intern-soft (downcase + (match-string 0 q-string))) + gnus-search-imap-search-keys)) + (setq q-string (concat "TEXT " q-string))) + ;; If it's a thread query, make sure that all message-id ;; searches are also references searches. (when (alist-get 'thread query) @@ -1115,12 +1131,6 @@ Other capabilities could be tested here." (nnimap-get-response call))) (t (nnimap-command "UID SEARCH %s" query))))) -;; TODO: Don't exclude booleans and date keys, just check for them -;; before checking for general keywords. -(defvar gnus-search-imap-search-keys - '(body cc bcc from header keyword larger smaller subject text to uid x-gm-raw) - "Known IMAP search keys, excluding booleans and date keys.") - (cl-defmethod gnus-search-transform ((_ gnus-search-imap) (_query null)) "ALL") commit 67a8bdb90c9b5865b7f17290c7135b1a5458c36d Author: Michael Albinus Date: Wed Nov 25 22:13:33 2020 +0100 Use null-device where appropriate * lisp/filesets.el (filesets-select-command): * lisp/shell.el (shell-mode): * lisp/term.el (term-exec-1): * lisp/wdired.el (wdired-do-symlink-changes): * lisp/cedet/ede/pmake.el (ede-proj-makefile-create): * lisp/eshell/esh-io.el (eshell-set-output-handle): * lisp/gnus/gnus-fun.el (gnus-grab-cam-x-face): * lisp/gnus/mml2015.el (mml2015-epg-key-image): * lisp/gnus/smime.el (smime-noverify-region): * lisp/org/ob-picolisp.el (org-babel-execute:picolisp): * lisp/org/ob-screen.el (org-babel-prep-session:screen) (org-babel-prep-session:screen): * lisp/play/fortune.el (fortune-quiet-strfile-options): * lisp/progmodes/cperl-mode.el (cperl-pod2man-build-command): * lisp/progmodes/sh-script.el (sh-tmp-file): * lisp/vc/diff-mode.el (diff-add-log-current-defuns) (diff--font-lock-prettify): * lisp/vc/ediff-mult.el (ediff-patch-file-form-meta): * lisp/vc/ediff-ptch.el (ediff-map-patch-buffer) (ediff-fixup-patch-map, ediff-dispatch-file-patching-job): * lisp/vc/vc.el (vc-diff-internal): Use null-device or (null-device), respectively. (Bug#3736) diff --git a/lisp/cedet/ede/pmake.el b/lisp/cedet/ede/pmake.el index 9d9a95fd76..2e3256f4be 100644 --- a/lisp/cedet/ede/pmake.el +++ b/lisp/cedet/ede/pmake.el @@ -180,7 +180,7 @@ MFILENAME is the makefile to generate." ;; ;; NOTE: This is GNU Make specific. (if (and (oref this automatic-dependencies) df) - (insert "DEPS_MAGIC := $(shell mkdir .deps > /dev/null " + (insert "DEPS_MAGIC := $(shell mkdir .deps > " null-device " " "2>&1 || :)\n" "-include $(DEP_FILES)\n\n")) ;; diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el index b415486190..b0443a4ace 100644 --- a/lisp/eshell/esh-io.el +++ b/lisp/eshell/esh-io.el @@ -382,8 +382,7 @@ it defaults to `insert'." "Set handle INDEX, using MODE, to point to TARGET." (when target (if (and (stringp target) - (or (string= target null-device) - (string= target "/dev/null"))) + (string= target (null-device))) (aset eshell-current-handles index nil) (let ((where (eshell-get-target target mode)) (current (car (aref eshell-current-handles index)))) diff --git a/lisp/filesets.el b/lisp/filesets.el index 473f2858dd..883871c4d8 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -203,8 +203,8 @@ key is supported." (defun filesets-select-command (cmd-list) "Select one command from CMD-LIST -- a string with space separated names." (let ((this (shell-command-to-string - (format "which --skip-alias %s 2> /dev/null | head -n 1" - cmd-list)))) + (format "which --skip-alias %s 2> %s | head -n 1" + cmd-list null-device)))) (if (equal this "") nil (file-name-nondirectory (substring this 0 (- (length this) 1)))))) diff --git a/lisp/gnus/gnus-fun.el b/lisp/gnus/gnus-fun.el index 3218649761..b6d6aa4929 100644 --- a/lisp/gnus/gnus-fun.el +++ b/lisp/gnus/gnus-fun.el @@ -286,8 +286,8 @@ colors of the displayed X-Faces." (setq file (car file)) (with-temp-buffer (shell-command - (format "pnmcut -left 110 -top 30 -width 144 -height 144 '%s' | ppmnorm 2>/dev/null | pnmscale -width 48 | ppmtopgm | pgmtopbm -threshold -value 0.92 | pbmtoxbm | compface" - file) + (format "pnmcut -left 110 -top 30 -width 144 -height 144 '%s' | ppmnorm 2>%s | pnmscale -width 48 | ppmtopgm | pgmtopbm -threshold -value 0.92 | pbmtoxbm | compface" + file null-device) (current-buffer)) ;;(sleep-for 3) (delete-file file) diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el index 45c9bbfe90..0765d7b245 100644 --- a/lisp/gnus/mml2015.el +++ b/lisp/gnus/mml2015.el @@ -735,8 +735,9 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (let* ((coding-system-for-write 'binary) (coding-system-for-read 'binary) (data (shell-command-to-string - (format "%s --list-options no-show-photos --attribute-fd 3 --list-keys %s 3>&1 >/dev/null 2>&1" - (shell-quote-argument epg-gpg-program) key-id)))) + (format "%s --list-options no-show-photos --attribute-fd 3 --list-keys %s 3>&1 >%s 2>&1" + (shell-quote-argument epg-gpg-program) + key-id null-device)))) (when (> (length data) 0) (insert (substring data 16)) (condition-case nil diff --git a/lisp/gnus/smime.el b/lisp/gnus/smime.el index eb27fee88c..08d45e5315 100644 --- a/lisp/gnus/smime.el +++ b/lisp/gnus/smime.el @@ -398,7 +398,7 @@ Any details (stdout and stderr) are left in the buffer specified by `smime-details-buffer'." (smime-new-details-buffer) (if (apply 'smime-call-openssl-region b e (list smime-details-buffer t) - "smime" "-verify" "-noverify" "-out" '("/dev/null")) + "smime" "-verify" "-noverify" "-out" `(,null-device)) t (insert-buffer-substring smime-details-buffer) nil)) diff --git a/lisp/org/ob-picolisp.el b/lisp/org/ob-picolisp.el index ec2a228456..bf31197d48 100644 --- a/lisp/org/ob-picolisp.el +++ b/lisp/org/ob-picolisp.el @@ -111,11 +111,11 @@ This function is called by `org-babel-execute-src-block'." (cond ((or (member "code" result-params) (member "pp" result-params)) - (format "(pretty (out \"/dev/null\" %s))" full-body)) + (format "(pretty (out \"%s\" %s))" null-device full-body)) ((and (member "value" result-params) (not session)) - (format "(print (out \"/dev/null\" %s))" full-body)) + (format "(print (out \"%s\" %s))" null-device full-body)) ((member "value" result-params) - (format "(out \"/dev/null\" %s)" full-body)) + (format "(out \"%s\" %s)" null-device full-body)) (t full-body))) (result (if (not (string= session-name "none")) diff --git a/lisp/org/ob-screen.el b/lisp/org/ob-screen.el index 837c18f840..f663c9d197 100644 --- a/lisp/org/ob-screen.el +++ b/lisp/org/ob-screen.el @@ -62,7 +62,7 @@ In case you want to use a different screen than one selected by your $PATH") (process-name (concat "org-babel: terminal (" session ")"))) (apply 'start-process process-name "*Messages*" terminal `("-T" ,(concat "org-babel: " session) "-e" ,org-babel-screen-location - "-c" "/dev/null" "-mS" ,(concat "org-babel-session-" session) + "-c" ,null-device "-mS" ,(concat "org-babel-session-" session) ,cmd)) ;; XXX: Is there a better way than the following? (while (not (org-babel-screen-session-socketname session)) diff --git a/lisp/play/fortune.el b/lisp/play/fortune.el index c180fd06c3..ce40aba8e2 100644 --- a/lisp/play/fortune.el +++ b/lisp/play/fortune.el @@ -96,7 +96,7 @@ Normally you won't have a reason to change it." "Options to pass to the strfile program (a string)." :type 'string) -(defcustom fortune-quiet-strfile-options "> /dev/null" +(defcustom fortune-quiet-strfile-options (concat "> " null-device) "Text added to the command for running `strfile'. By default it discards the output produced by `strfile'. Set this to \"\" if you would like to see the output." diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 7a24bfcbeb..dd36c68c87 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -8156,7 +8156,7 @@ the appropriate statement modifier." (defun cperl-pod2man-build-command () "Builds the entire background manpage and cleaning command." - (let ((command (concat pod2man-program " %s 2>/dev/null")) + (let ((command (concat pod2man-program " %s 2>" null-device)) (flist (and (boundp 'Man-filter-list) Man-filter-list))) (while (and flist (car flist)) (let ((pcom (car (car flist))) diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 3b24cabe8b..b7327e7558 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -2801,12 +2801,12 @@ t means to return a list of all possible completions of STRING. (not (bolp)) ?\n) "exit:\n" - "rm $tmp* >&/dev/null" > \n) + "rm $tmp* >&" null-device > \n) (es (file-name-nondirectory (buffer-file-name)) > "local( signals = $signals sighup sigint;" \n > "tmp = `{ mktemp -t " str ".XXXXXX } ) {" \n > "catch @ e {" \n - > "rm $tmp^* >[2]/dev/null" \n + > "rm $tmp^* >[2]" null-device \n "throw $e" \n "} {" > \n _ \n @@ -2816,10 +2816,10 @@ t means to return a list of all possible completions of STRING. 7 "EXIT") (rc (file-name-nondirectory (buffer-file-name)) > "tmp = `{ mktemp -t " str ".XXXXXX }" \n - "fn sigexit { rm $tmp^* >[2]/dev/null }" \n) + "fn sigexit { rm $tmp^* >[2]" null-device " }" \n) (sh (file-name-nondirectory (buffer-file-name)) > "TMP=`mktemp -t " str ".XXXXXX`" \n - "trap \"rm $TMP* 2>/dev/null\" " ?0 \n)) + "trap \"rm $TMP* 2>" null-device "\" " ?0 \n)) diff --git a/lisp/shell.el b/lisp/shell.el index 43ad58774b..51937cdeef 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -605,7 +605,7 @@ buffer." (t "~/.history"))))) (if (or (equal comint-input-ring-file-name "") (equal (file-truename comint-input-ring-file-name) - (file-truename "/dev/null"))) + (file-truename null-device))) (setq comint-input-ring-file-name nil)) ;; Arrange to write out the input ring on exit, if the shell doesn't ;; do this itself. diff --git a/lisp/term.el b/lisp/term.el index ca64d28d9b..148d7a7c28 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -1572,9 +1572,9 @@ Nil if unknown.") process-environment)) (apply #'start-process name buffer "/bin/sh" "-c" - (format "stty -nl echo rows %d columns %d sane 2>/dev/null;\ + (format "stty -nl echo rows %d columns %d sane 2>%s;\ if [ $1 = .. ]; then shift; fi; exec \"$@\"" - term-height term-width) + term-height term-width null-device) ".." command switches))) diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 0a90613604..51f4180316 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -2326,7 +2326,7 @@ where DEFUN... is a list of function names found in FILE." ;; would look for non-existent files like ;; /dev/null. (diff-find-source-location - (not (equal "/dev/null" + (not (equal null-device (car (diff-hunk-file-names t)))))) (other-buf nil) (goto-otherbuf @@ -2567,8 +2567,8 @@ fixed, visit it in a buffer." (concat "diff.*\n" "\\(?:\\(?:new file\\|deleted\\).*\n\\)?" "\\(?:index.*\n\\)?" - "--- \\(?:/dev/null\\|a/\\(.*\\)\\)\n" - "\\+\\+\\+ \\(?:/dev/null\\|b/\\(.*\\)\\)\n")))) + "--- \\(?:" null-device "\\|a/\\(.*\\)\\)\n" + "\\+\\+\\+ \\(?:" null-device "\\|b/\\(.*\\)\\)\n")))) (put-text-property (match-beginning 0) (or (match-beginning 2) (match-beginning 1)) 'display (propertize diff --git a/lisp/vc/ediff-mult.el b/lisp/vc/ediff-mult.el index c977291a52..b48377815a 100644 --- a/lisp/vc/ediff-mult.el +++ b/lisp/vc/ediff-mult.el @@ -2317,7 +2317,7 @@ If this is a session registry buffer then just bury it." (meta-patchbuf ediff-meta-patchbufer) session-buf beg-marker end-marker) - (if (or (file-directory-p file) (string-match "/dev/null" file)) + (if (or (file-directory-p file) (string-match null-device file)) (user-error "`%s' is not an ordinary file" (file-name-as-directory file))) (setq session-buf (ediff-get-session-buffer info) beg-marker (ediff-get-session-objB-name info) diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el index f6af5a4555..08640fcece 100644 --- a/lisp/vc/ediff-ptch.el +++ b/lisp/vc/ediff-ptch.el @@ -193,7 +193,7 @@ program." (let ((count 0) (mark1 (point-min-marker)) (mark1-end (point-min)) - (possible-file-names '("/dev/null" . "/dev/null")) + (possible-file-names `(,null-device . ,null-device)) mark2-end mark2 filenames beg1 beg2 end1 end2 patch-map opoint) @@ -217,10 +217,10 @@ program." (setq possible-file-names (cons (if (and beg1 end1) (buffer-substring beg1 end1) - "/dev/null") + null-device) (if (and beg2 end2) (buffer-substring beg2 end2) - "/dev/null"))) + null-device))) ;; Remove file junk (Bug#26084). (while (re-search-backward (concat "^\\(?:" diff-file-junk-re "\\)") mark1-end t) @@ -309,12 +309,12 @@ program." (file-exists-p (cdr m2))) (setq base-dir1 (car m1) base-dir2 (car m2)))))))) - (or (string= (car proposed-file-names) "/dev/null") + (or (string= (car proposed-file-names) null-device) (setcar proposed-file-names (ediff-file-name-sans-prefix (car proposed-file-names) base-dir1))) (or (string= - (cdr proposed-file-names) "/dev/null") + (cdr proposed-file-names) null-device) (setcdr proposed-file-names (ediff-file-name-sans-prefix (cdr proposed-file-names) base-dir2))) @@ -323,7 +323,7 @@ program." ;; take the given file name into account (or (file-directory-p filename) - (string= "/dev/null" filename) + (string= null-device filename) (setcar (ediff-get-session-objA (car ediff-patch-map)) (cons (file-name-nondirectory filename) (file-name-nondirectory filename)))) @@ -582,7 +582,7 @@ optional argument, then use it." patch-buf (if (and ediff-patch-map (not (string-match-p - "^/dev/null" + (concat "^" null-device) ;; this is the file to patch (ediff-get-session-objA-name (car ediff-patch-map)))) (> (length diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 83f2596865..1a246119a6 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1774,7 +1774,7 @@ Return t if the buffer had changes, nil otherwise." ;; Diff it against /dev/null. (apply #'vc-do-command buffer (if async 'async 1) "diff" file - (append (vc-switches nil 'diff) '("/dev/null")))))) + (append (vc-switches nil 'diff) `(,(null-device))))))) (setq files (nreverse filtered)))) (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 buffer async) (set-buffer buffer) diff --git a/lisp/wdired.el b/lisp/wdired.el index bb32da3e3a..ebe1961394 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -763,7 +763,7 @@ If OLD, return the old target. If MOVE, move point before it." (unless (equal link-to-new link-to-ori) (setq changes t) (if (equal link-to-new "") ;empty filename! - (setq link-to-new "/dev/null")) + (setq link-to-new (null-device))) (condition-case err (progn (delete-file link-from) commit b5e34c34bcd81a0f261a5ee6dedaf51261ae5025 Author: Juri Linkov Date: Wed Nov 25 22:24:11 2020 +0200 * lisp/minibuffer.el (completions-format): Add new value 'one-column'. * lisp/minibuffer.el (completion--insert-strings): Support 'one-column'. * lisp/simple.el (read-from-kill-ring): Truncate strings at frame-width. diff --git a/etc/NEWS b/etc/NEWS index d1e896ef70..5f8f408c6f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1345,6 +1345,9 @@ This new command (bound to 'C-c C-l') regenerates the current hunk. When non-nil, some commands like 'describe-symbol' show more detailed completions with more information in completion prefix and suffix. +--- +*** User option 'completions-format' supports a new value 'one-column'. + --- *** New user option 'bibtex-unify-case-convert'. This new option allows the user to customize how case is converted diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 48bd39587b..87bf3d36fa 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1679,9 +1679,11 @@ Return nil if there is no valid completion, else t." "Define the appearance and sorting of completions. If the value is `vertical', display completions sorted vertically in columns in the *Completions* buffer. -If the value is `horizontal', display completions sorted -horizontally in alphabetical order, rather than down the screen." - :type '(choice (const horizontal) (const vertical)) +If the value is `horizontal', display completions sorted in columns +horizontally in alphabetical order, rather than down the screen. +If the value is `one-column', display completions down the screen +in one column." + :type '(choice (const horizontal) (const vertical) (const one-column)) :version "23.2") (defcustom completions-detailed nil @@ -1727,6 +1729,9 @@ It also eliminates runs of equal strings." (apply #'+ (mapcar #'string-width str)) (string-width str)))) (cond + ((eq completions-format 'one-column) + ;; Nothing special + ) ((eq completions-format 'vertical) ;; Vertical format (when (> row rows) @@ -1790,6 +1795,8 @@ It also eliminates runs of equal strings." (font-lock-prepend-text-property beg end 'face 'completions-annotations))))) (cond + ((eq completions-format 'one-column) + (insert "\n")) ((eq completions-format 'vertical) ;; Vertical format (if (> column 0) diff --git a/lisp/simple.el b/lisp/simple.el index 69b4639292..c9f4f2bb44 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5477,15 +5477,16 @@ With ARG, rotate that many kills forward (or backward, if negative)." (completions (mapcar (lambda (s) (let* ((s (query-replace-descr s)) - (b 0)) + (b 0) + (limit (frame-width))) ;; Add ellipsis on leading whitespace (when (string-match "\\`[[:space:]]+" s) (setq b (match-end 0)) (add-text-properties 0 b `(display ,ellipsis) s)) ;; Add ellipsis at the end of a long string - (when (> (length s) (+ 40 b)) + (when (> (length s) (+ limit b)) (add-text-properties - (min (+ 40 b) (length s)) (length s) + (min (+ limit b) (length s)) (length s) `(display ,ellipsis) s)) s)) read-from-kill-ring-history))) commit 1eb168fa9765ff62361b279a480388674e1b9745 Author: Stefan Monnier Date: Wed Nov 25 14:49:55 2020 -0500 (defvar): Detect defining a variable currently lexically bound * src/eval.c (lexbound_p): New function. (Finternal__define_uninitialized_variable): Use it. diff --git a/etc/NEWS b/etc/NEWS index 9091643da5..d1e896ef70 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1806,6 +1806,11 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el. * Lisp Changes in Emacs 28.1 +--- +** `defvar` detects the error of defining a variable currently lexically bound. +Such mixes are always signs that the outer lexical binding was an +error and should have used dynamic binding instead. + +++ ** New completion function 'affixation-function' to add prefix/suffix. It accepts a list of completions and should return a list where diff --git a/src/eval.c b/src/eval.c index 76708e6e7e..3f9dcf6be6 100644 --- a/src/eval.c +++ b/src/eval.c @@ -691,6 +691,45 @@ default_toplevel_binding (Lisp_Object symbol) return binding; } +/* Look for a lexical-binding of SYMBOL somewhere up the stack. + This will only find bindings created with interpreted code, since once + compiled names of lexical variables are basically gone anyway. */ +static bool +lexbound_p (Lisp_Object symbol) +{ + union specbinding *pdl = specpdl_ptr; + while (pdl > specpdl) + { + switch ((--pdl)->kind) + { + case SPECPDL_LET_DEFAULT: + case SPECPDL_LET: + if (EQ (specpdl_symbol (pdl), Qinternal_interpreter_environment)) + { + Lisp_Object env = specpdl_old_value (pdl); + if (CONSP (env) && !NILP (Fassq (symbol, env))) + return true; + } + break; + + case SPECPDL_UNWIND: + case SPECPDL_UNWIND_ARRAY: + case SPECPDL_UNWIND_PTR: + case SPECPDL_UNWIND_INT: + case SPECPDL_UNWIND_INTMAX: + case SPECPDL_UNWIND_EXCURSION: + case SPECPDL_UNWIND_VOID: + case SPECPDL_BACKTRACE: + case SPECPDL_LET_LOCAL: + break; + + default: + emacs_abort (); + } + } + return false; +} + DEFUN ("default-toplevel-value", Fdefault_toplevel_value, Sdefault_toplevel_value, 1, 1, 0, doc: /* Return SYMBOL's toplevel default value. "Toplevel" means outside of any let binding. */) @@ -726,6 +765,15 @@ This is like `defvar' and `defconst' but without affecting the variable's value. */) (Lisp_Object symbol, Lisp_Object doc) { + if (!XSYMBOL (symbol)->u.s.declared_special + && lexbound_p (symbol)) + /* This test tries to catch the situation where we do + (let (( ...)) ...( ...)....) + and where the `foo` package only gets loaded when + is called, so the outer `let` incorrectly made the binding lexical + because the wasn't yet declared as dynamic at that point. */ + error ("Defining as dynamic an already lexical var"); + XSYMBOL (symbol)->u.s.declared_special = true; if (!NILP (doc)) { commit d148d0259a4d3ad3da2f5bdf121e1f5836b3522b Author: Mattias Engdegård Date: Wed Nov 25 13:56:39 2020 +0100 Add tests for replace-regexp-in-string * test/lisp/subr-tests.el (subr-replace-regexp-in-string): New. diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 035c064d75..c77be511dc 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -484,5 +484,68 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350." (should-error (string-replace "" "x" "abc"))) +(ert-deftest subr-replace-regexp-in-string () + (should (equal (replace-regexp-in-string "a+" "xy" "abaabbabaaba") + "xybxybbxybxybxy")) + ;; FIXEDCASE + (let ((case-fold-search t)) + (should (equal (replace-regexp-in-string "a+" "xy" "ABAABBABAABA") + "XYBXYBBXYBXYBXY")) + (should (equal (replace-regexp-in-string "a+" "xy" "ABAABBABAABA" t) + "xyBxyBBxyBxyBxy")) + (should (equal (replace-regexp-in-string + "a[bc]*" "xyz" + "a A ab AB Ab aB abc ABC Abc AbC aBc") + "xyz XYZ xyz XYZ Xyz xyz xyz XYZ Xyz Xyz xyz")) + (should (equal (replace-regexp-in-string + "a[bc]*" "xyz" + "a A ab AB Ab aB abc ABC Abc AbC aBc" t) + "xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz"))) + (let ((case-fold-search nil)) + (should (equal (replace-regexp-in-string "a+" "xy" "ABAABBABAABA") + "ABAABBABAABA"))) + ;; group substitution + (should (equal (replace-regexp-in-string + "a\\(b*\\)" "<\\1,\\&>" "babbcaabacbab") + "bc<,a><,a>cb")) + (should (equal (replace-regexp-in-string + "x\\(?2:..\\)\\(?1:..\\)\\(..\\)\\(..\\)\\(..\\)" + "<\\3,\\5,\\4,\\1,\\2>" "yxabcdefghijkl") + "ykl")) + ;; LITERAL + (should (equal (replace-regexp-in-string + "a\\(b*\\)" "<\\1,\\&>" "babbcaabacbab" nil t) + "b<\\1,\\&>c<\\1,\\&><\\1,\\&><\\1,\\&>cb<\\1,\\&>")) + (should (equal (replace-regexp-in-string + "a" "\\\\,\\?" "aba") + "\\,\\?b\\,\\?")) + (should (equal (replace-regexp-in-string + "a" "\\\\,\\?" "aba" nil t) + "\\\\,\\?b\\\\,\\?")) + ;; SUBEXP + (should (equal (replace-regexp-in-string + "\\(a\\)\\(b*\\)c" "xy" "babbcdacd" nil nil 2) + "baxycdaxycd")) + ;; START + (should (equal (replace-regexp-in-string + "ab" "x" "abcabdabeabf" nil nil nil 4) + "bdxexf")) + ;; An empty pattern matches once before every character. + (should (equal (replace-regexp-in-string "" "x" "abc") + "xaxbxc")) + (should (equal (replace-regexp-in-string "y*" "x" "abc") + "xaxbxc")) + ;; replacement function + (should (equal (replace-regexp-in-string + "a\\(b*\\)c" + (lambda (s) + (format "<%s,%s,%s,%s,%s>" + s + (match-beginning 0) (match-end 0) + (match-beginning 1) (match-end 1))) + "babbcaacabc") + "ba")) + ) + (provide 'subr-tests) ;;; subr-tests.el ends here commit be53fe0263492a124c9cf01aec50b329287465f9 Author: Mattias Engdegård Date: Wed Nov 25 12:39:56 2020 +0100 * doc/lispref/searching.texi (Rx Constructs): Group numbering fix diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 592b876644..35a518805c 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -1484,8 +1484,8 @@ Corresponding string regexp: @samp{\_>} @cindex @code{submatch} in rx Match the @var{rx}s, making the matched text and position accessible in the match data. The first group in a regexp is numbered 1; -subsequent groups will be numbered one higher than the previous -group.@* +subsequent groups will be numbered one above the previously +highest-numbered group in the pattern so far.@* Corresponding string regexp: @samp{\(@dots{}\)} @item (group-n @var{n} @var{rx}@dots{}) commit 20f9645898b908ec37680930b2028dcda24ce2d0 Author: Michael Albinus Date: Wed Nov 25 12:24:08 2020 +0100 * test/lisp/net/tramp-tests.el (tramp-test29-start-file-process): Use `tramp--test-windows-nt-p'. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index b2e8cc1945..eeb838be30 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -4467,7 +4467,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (should (processp proc)) (should (equal (process-status proc) 'run)) ;; On MS Windows, `process-tty-name' returns nil. - (unless (tramp--test-windows-nt) + (unless (tramp--test-windows-nt-p) (should (stringp (process-tty-name proc)))))) ;; Cleanup. commit e45ad6b08e1e6639dfcca28c1a496df5b676f985 Merge: fe5ffb7366 6442cdc0e4 Author: Michael Albinus Date: Wed Nov 25 12:18:23 2020 +0100 Merge from origin/emacs-27 6442cdc0e4 Revert extra focus redirection in do_switch_frame (Bug#24803) fc4379f1ae Minor cleanup of tramp-tests.el on MS Windows dea3d6aa18 Fix handling of defcustom :local tag commit fe5ffb73662d2402c42e16f81f7796194d2105a3 Merge: ba004ac7dd b2ee665024 Author: Michael Albinus Date: Wed Nov 25 11:49:54 2020 +0100 ; Merge from origin/emacs-27 The following commit was skipped: b2ee665024 CC Mode. Fix an off by one error. Fixes bug #41809 commit ba004ac7ddcb41013c823ce6d98875f7a2e69721 Merge: 3b740591b0 f425a774c2 Author: Michael Albinus Date: Wed Nov 25 11:49:54 2020 +0100 Merge from origin/emacs-27 f425a774c2 Fix display artifacts when 'display' properties cover newl... commit 6442cdc0e4ec466841ff9c3d9016fecd7b72b5a1 Author: Martin Rudalics Date: Wed Nov 25 09:58:21 2020 +0100 Revert extra focus redirection in do_switch_frame (Bug#24803) * src/frame.c (do_switch_frame): Do not also redirect frame focus when FRAME has its minibuffer window on the selected frame which was intended to fix Bug#24500. It may cause Bug#24803 and lead to a nasty state where no active cursor is shown on any frame, see https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg01137.html. diff --git a/src/frame.c b/src/frame.c index adcc489a40..16f6d6c460 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1427,11 +1427,15 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor if (FRAMEP (gfocus)) { focus = FRAME_FOCUS_FRAME (XFRAME (gfocus)); - if ((FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ()) + if (FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ()) /* Redirect frame focus also when FRAME has its minibuffer - window on the selected frame (see Bug#24500). */ + window on the selected frame (see Bug#24500). + + Don't do that: It causes redirection problem with a + separate minibuffer frame (Bug#24803) and problems + when updating the cursor on such frames. || (NILP (focus) - && EQ (FRAME_MINIBUF_WINDOW (f), sf->selected_window))) + && EQ (FRAME_MINIBUF_WINDOW (f), sf->selected_window))) */ Fredirect_frame_focus (gfocus, frame); } } commit 3b740591b0a1d0e7a24be38471499ecace96936b Author: Juri Linkov Date: Wed Nov 25 10:46:59 2020 +0200 Add 'completions-detailed' to add prefix/suffix with 'affixation-function' * doc/lispref/minibuf.texi (Completion Variables) (Programmed Completion): Add affixation-function. * lisp/help-fns.el (help--symbol-completion-table-affixation): New function. (help--symbol-completion-table): Set affixation-function when completions-detailed is non-nil. * lisp/minibuffer.el (completion-metadata): Add affixation-function to docstring. (completions-annotations): Inherit from shadow with italic. (completions-detailed): New defcustom. (completion--insert-strings): Count string-width on all strings in completion list. Insert prefix and suffix. (completion-extra-properties): Add affixation-function to docstring. (minibuffer-completion-help): Call affixation-function. (minibuffer-default-prompt-format): Move down closer to its use. https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg00613.html diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index f1cfd29ef1..56bc0b8ab6 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -1798,6 +1798,13 @@ buffer. This function must accept one argument, a completion, and should either return @code{nil} or a string to be displayed next to the completion. +@item :affixation-function +The value should be a function to add prefixes and suffixes to +completions. This function must accept one argument, a list of +completions, and should return such a list of completions where +each element contains a list of three elements: a completion, +a prefix string, and a suffix string. + @item :exit-function The value should be a function to run after performing completion. The function should accept two arguments, @var{string} and @@ -1897,6 +1904,15 @@ function should take one argument, @var{string}, which is a possible completion. It should return a string, which is displayed after the completion @var{string} in the @file{*Completions*} buffer. +@item affixation-function +The value should be a function for adding prefixes and suffixes to +completions. The function should take one argument, +@var{completions}, which is a list of possible completions. It should +return such a list of @var{completions} where each element contains a list +of three elements: a completion, a prefix which is displayed before +the completion string in the @file{*Completions*} buffer, and +a suffix displayed after the completion string. + @item display-sort-function The value should be a function for sorting completions. The function should take one argument, a list of completion strings, and return a diff --git a/etc/NEWS b/etc/NEWS index 0a3854d0df..9091643da5 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1341,6 +1341,10 @@ This new command (bound to 'C-c C-l') regenerates the current hunk. ** Miscellaneous +*** New user option 'completions-detailed'. +When non-nil, some commands like 'describe-symbol' show more detailed +completions with more information in completion prefix and suffix. + --- *** New user option 'bibtex-unify-case-convert'. This new option allows the user to customize how case is converted @@ -1802,6 +1806,12 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el. * Lisp Changes in Emacs 28.1 ++++ +** New completion function 'affixation-function' to add prefix/suffix. +It accepts a list of completions and should return a list where +each element is a list with three elements: a completion, +a prefix string, and a suffix string. + +++ ** 'read-char-from-minibuffer' and 'y-or-n-p' support 'help-form'. If you bind 'help-form' to a non-nil value while calling these functions, diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 170f497541..1c55d0ed79 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -126,17 +126,48 @@ with the current prefix. The files are chosen according to :group 'help :version "26.3") +(defun help--symbol-completion-table-affixation (completions) + (mapcar (lambda (c) + (let* ((s (intern c)) + (doc (condition-case nil (documentation s) (error nil))) + (doc (and doc (substring doc 0 (string-match "\n" doc))))) + (list c (propertize + (concat (cond ((commandp s) + "c") ; command + ((eq (car-safe (symbol-function s)) 'macro) + "m") ; macro + ((fboundp s) + "f") ; function + ((custom-variable-p s) + "u") ; user option + ((boundp s) + "v") ; variable + ((facep s) + "a") ; fAce + ((and (fboundp 'cl-find-class) + (cl-find-class s)) + "t") ; CL type + (" ")) ; something else + " ") ; prefix separator + 'face 'completions-annotations) + (if doc (propertize (format " -- %s" doc) + 'face 'completions-annotations) + "")))) + completions)) + (defun help--symbol-completion-table (string pred action) - (when help-enable-completion-autoload - (let ((prefixes (radix-tree-prefixes (help-definition-prefixes) string))) - (help--load-prefixes prefixes))) - (let ((prefix-completions - (and help-enable-completion-autoload - (mapcar #'intern (all-completions string definition-prefixes))))) - (complete-with-action action obarray string - (if pred (lambda (sym) - (or (funcall pred sym) - (memq sym prefix-completions))))))) + (if (and completions-detailed (eq action 'metadata)) + '(metadata (affixation-function . help--symbol-completion-table-affixation)) + (when help-enable-completion-autoload + (let ((prefixes (radix-tree-prefixes (help-definition-prefixes) string))) + (help--load-prefixes prefixes))) + (let ((prefix-completions + (and help-enable-completion-autoload + (mapcar #'intern (all-completions string definition-prefixes))))) + (complete-with-action action obarray string + (if pred (lambda (sym) + (or (funcall pred sym) + (memq sym prefix-completions)))))))) (defvar describe-function-orig-buffer nil "Buffer that was current when `describe-function' was invoked. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 9d57a817b2..48bd39587b 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -83,7 +83,6 @@ ;; - add support for ** to pcm. ;; - Add vc-file-name-completion-table to read-file-name-internal. -;; - A feature like completing-help.el. ;;; Code: @@ -121,6 +120,10 @@ This metadata is an alist. Currently understood keys are: - `annotation-function': function to add annotations in *Completions*. Takes one argument (STRING), which is a possible completion and returns a string to append to STRING. +- `affixation-function': function to prepend/append a prefix/suffix to + entries. Takes one argument (COMPLETIONS) and should return a list + of completions with a list of three elements: completion, its prefix + and suffix. - `display-sort-function': function to sort entries in *Completions*. Takes one argument (COMPLETIONS) and should return a new list of completions. Can operate destructively. @@ -1669,7 +1672,7 @@ Return nil if there is no valid completion, else t." (#b000 nil) (_ t)))) -(defface completions-annotations '((t :inherit italic)) +(defface completions-annotations '((t :inherit (italic shadow))) "Face to use for annotations in the *Completions* buffer.") (defcustom completions-format 'horizontal @@ -1681,6 +1684,13 @@ horizontally in alphabetical order, rather than down the screen." :type '(choice (const horizontal) (const vertical)) :version "23.2") +(defcustom completions-detailed nil + "When non-nil, display completions with details added as prefix/suffix. +Some commands might provide a detailed view with more information prepended +or appended to completions." + :type 'boolean + :version "28.1") + (defun completion--insert-strings (strings) "Insert a list of STRINGS into the current buffer. Uses columns to keep the listing readable but compact. @@ -1689,8 +1699,7 @@ It also eliminates runs of equal strings." (let* ((length (apply #'max (mapcar (lambda (s) (if (consp s) - (+ (string-width (car s)) - (string-width (cadr s))) + (apply #'+ (mapcar #'string-width s)) (string-width s))) strings))) (window (get-buffer-window (current-buffer) 0)) @@ -1715,8 +1724,7 @@ It also eliminates runs of equal strings." ;; FIXME: `string-width' doesn't pay attention to ;; `display' properties. (let ((length (if (consp str) - (+ (string-width (car str)) - (string-width (cadr str))) + (apply #'+ (mapcar #'string-width str)) (string-width str)))) (cond ((eq completions-format 'vertical) @@ -1754,13 +1762,33 @@ It also eliminates runs of equal strings." (if (not (consp str)) (put-text-property (point) (progn (insert str) (point)) 'mouse-face 'highlight) - (put-text-property (point) (progn (insert (car str)) (point)) - 'mouse-face 'highlight) - (let ((beg (point)) - (end (progn (insert (cadr str)) (point)))) - (put-text-property beg end 'mouse-face nil) - (font-lock-prepend-text-property beg end 'face - 'completions-annotations))) + ;; If `str' is a list that has 2 elements, + ;; then the second element is a suffix annotation. + ;; If `str' has 3 elements, then the second element + ;; is a prefix, and the third element is a suffix. + (let* ((prefix (when (nth 2 str) (nth 1 str))) + (suffix (or (nth 2 str) (nth 1 str)))) + (when prefix + (let ((beg (point)) + (end (progn (insert prefix) (point)))) + (put-text-property beg end 'mouse-face nil) + ;; When both prefix and suffix are added + ;; by the caller via affixation-function, + ;; then allow the caller to decide + ;; what faces to put on prefix and suffix. + (unless prefix + (font-lock-prepend-text-property + beg end 'face 'completions-annotations)))) + (put-text-property (point) (progn (insert (car str)) (point)) + 'mouse-face 'highlight) + (let ((beg (point)) + (end (progn (insert suffix) (point)))) + (put-text-property beg end 'mouse-face nil) + ;; Put the predefined face only when suffix + ;; is added via annotation-function. + (unless prefix + (font-lock-prepend-text-property + beg end 'face 'completions-annotations))))) (cond ((eq completions-format 'vertical) ;; Vertical format @@ -1880,6 +1908,11 @@ These include: completion). The function can access the completion data via `minibuffer-completion-table' and related variables. +`:affixation-function': Function to prepend/append a prefix/suffix to + completions. The function must accept one argument, a list of + completions, and return a list where each element is a list of + three elements: a completion, a prefix and a suffix. + `:exit-function': Function to run after completion is performed. The function must accept two arguments, STRING and STATUS. @@ -1962,10 +1995,13 @@ variables.") base-size md minibuffer-completion-table minibuffer-completion-predicate)) - (afun (or (completion-metadata-get all-md 'annotation-function) - (plist-get completion-extra-properties - :annotation-function) - completion-annotate-function)) + (ann-fun (or (completion-metadata-get all-md 'annotation-function) + (plist-get completion-extra-properties + :annotation-function) + completion-annotate-function)) + (aff-fun (or (completion-metadata-get all-md 'affixation-function) + (plist-get completion-extra-properties + :affixation-function))) (mainbuf (current-buffer)) ;; If the *Completions* buffer is shown in a new ;; window, mark it as softly-dedicated, so bury-buffer in @@ -2006,12 +2042,15 @@ variables.") (if sort-fun (funcall sort-fun completions) (sort completions 'string-lessp)))) - (when afun + (when ann-fun (setq completions (mapcar (lambda (s) - (let ((ann (funcall afun s))) + (let ((ann (funcall ann-fun s))) (if ann (list s ann) s))) completions))) + (when aff-fun + (setq completions + (funcall aff-fun completions))) (with-current-buffer standard-output (set (make-local-variable 'completion-base-position) @@ -3034,19 +3073,6 @@ the commands start with a \"-\" or a SPC." :version "24.1" :type 'boolean) -(defcustom minibuffer-default-prompt-format " (default %s)" - "Format string used to output \"default\" values. -When prompting for input, there will often be a default value, -leading to prompts like \"Number of articles (default 50): \". -The \"default\" part of that prompt is controlled by this -variable, and can be set to, for instance, \" [%s]\" if you want -a shorter displayed prompt, or \"\", if you don't want to display -the default at all. - -This variable is used by the `format-prompt' function." - :version "28.1" - :type 'string) - (defun completion-pcm--pattern-trivial-p (pattern) (and (stringp (car pattern)) ;; It can be followed by `point' and "" and still be trivial. @@ -3864,6 +3890,19 @@ the minibuffer was activated, and execute the forms." (with-minibuffer-selected-window (scroll-other-window-down arg))) +(defcustom minibuffer-default-prompt-format " (default %s)" + "Format string used to output \"default\" values. +When prompting for input, there will often be a default value, +leading to prompts like \"Number of articles (default 50): \". +The \"default\" part of that prompt is controlled by this +variable, and can be set to, for instance, \" [%s]\" if you want +a shorter displayed prompt, or \"\", if you don't want to display +the default at all. + +This variable is used by the `format-prompt' function." + :version "28.1" + :type 'string) + (defun format-prompt (prompt default &rest format-args) "Format PROMPT with DEFAULT according to `minibuffer-default-prompt-format'. If FORMAT-ARGS is nil, PROMPT is used as a plain string. If commit fc4379f1aedd6b1ebae722b967a7e6feb30fa2a6 Author: Michael Albinus Date: Wed Nov 25 09:41:11 2020 +0100 Minor cleanup of tramp-tests.el on MS Windows * test/lisp/net/tramp-tests.el (tramp-test29-start-file-process): Do not test remote pty on MS Windows. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index cc65421619..e42765ba08 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -4289,7 +4289,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (setq proc (start-file-process "test4" (current-buffer) nil)) (should (processp proc)) (should (equal (process-status proc) 'run)) - (should (stringp (process-tty-name proc))))) + ;; On MS Windows, `process-tty-name' returns nil. + (unless (tramp--test-windows-nt) + (should (stringp (process-tty-name proc)))))) ;; Cleanup. (ignore-errors (delete-process proc)))))) commit d7a580c7eb189c0b0daf131f9a1f3c8c7fe5f196 Author: Lars Ingebrigtsen Date: Wed Nov 25 06:29:10 2020 +0100 Move code in face-remap.el to avoid a compilation warning * lisp/face-remap.el (text-scale--refresh): Move code to avoid compilation warning. In text-scale--refresh: face-remap.el:241:14: Warning: reference to free variable ‘text-scale-mode’ diff --git a/lisp/face-remap.el b/lisp/face-remap.el index 9f9dddfe68..4ccd463aff 100644 --- a/lisp/face-remap.el +++ b/lisp/face-remap.el @@ -233,17 +233,6 @@ Each positive or negative step scales the default face height by this amount." "If non-nil, text scaling may change font size of header lines too.") (make-variable-buffer-local 'text-scale-header-line) -(defun text-scale--refresh (symbol newval operation where) - "Watcher for `text-scale-remap-header-line'. -See `add-variable-watcher'." - (when (and (eq symbol 'text-scale-remap-header-line) - (eq operation 'set) - text-scale-mode) - (with-current-buffer where - (let ((text-scale-remap-header-line newval)) - (text-scale-mode 1))))) -(add-variable-watcher 'text-scale-remap-header-line #'text-scale--refresh) - (defun face-remap--clear-remappings () (dolist (remapping ;; This is a bit messy to stay backwards compatible. @@ -288,6 +277,17 @@ the font size of the header line." (face-remap--remap-face 'header-line))) (force-window-update (current-buffer))) +(defun text-scale--refresh (symbol newval operation where) + "Watcher for `text-scale-remap-header-line'. +See `add-variable-watcher'." + (when (and (eq symbol 'text-scale-remap-header-line) + (eq operation 'set) + text-scale-mode) + (with-current-buffer where + (let ((text-scale-remap-header-line newval)) + (text-scale-mode 1))))) +(add-variable-watcher 'text-scale-remap-header-line #'text-scale--refresh) + (defun text-scale-min-amount () "Return the minimum amount of text-scaling we allow." ;; When the resulting pixel-height of characters will become smaller commit 30c437752df0a3a9410f1249fa0f237110811af2 Author: Stefan Kangas Date: Wed Nov 25 03:03:48 2020 +0100 Make text-scale-mode optionally adjust the header line * lisp/face-remap.el (text-scale-remap-header-line-face): New buffer local variable. (text-scale-mode): Adjust header line if above variable is non-nil. (face-remap--clear-remappings, face-remap--remap-face): New defuns. * lisp/face-remap.el: Arrange to watch text-scale-mode-remapping. (text-scale--refresh): New function. * lisp/emacs-lisp/tabulated-list.el (tabulated-list-mode): Use text-scale-remap-header-line. (Bug#41852) diff --git a/etc/NEWS b/etc/NEWS index 95f801f60c..0a3854d0df 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1516,6 +1516,18 @@ mouse now pops up a TTY menu by default instead of running the command 'tmm-menubar'. To restore the old behavior, set the user option 'tty-menu-open-use-tmm' to non-nil. +** text-scale-mode + +--- +*** text-scale-mode can now adjust font size of the header line. +When the new buffer local variable 'text-scale-remap-header-line' +is non-nil, 'text-scale-adjust' will also scale the text in the header +line when displaying that buffer. + +This is useful for major modes that arrange their display in a tabular +form below the header line. It is enabled by default in +'tabulated-list-mode' and its derived modes. + ** xwidget-webkit mode *** New xwidget commands. diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index 30577679f2..ae3ed055c5 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -767,6 +767,7 @@ as the ewoc pretty-printer." (setq-local revert-buffer-function #'tabulated-list-revert) (setq-local glyphless-char-display (tabulated-list-make-glyphless-char-display-table)) + (setq-local text-scale-remap-header-line t) ;; Avoid messing up the entries' display just because the first ;; column of the first entry happens to begin with a R2L letter. (setq bidi-paragraph-direction 'left-to-right) diff --git a/lisp/face-remap.el b/lisp/face-remap.el index 028269a4b0..9f9dddfe68 100644 --- a/lisp/face-remap.el +++ b/lisp/face-remap.el @@ -229,6 +229,39 @@ Each positive or negative step scales the default face height by this amount." (defvar text-scale-mode-amount 0) (make-variable-buffer-local 'text-scale-mode-amount) +(defvar text-scale-remap-header-line nil + "If non-nil, text scaling may change font size of header lines too.") +(make-variable-buffer-local 'text-scale-header-line) + +(defun text-scale--refresh (symbol newval operation where) + "Watcher for `text-scale-remap-header-line'. +See `add-variable-watcher'." + (when (and (eq symbol 'text-scale-remap-header-line) + (eq operation 'set) + text-scale-mode) + (with-current-buffer where + (let ((text-scale-remap-header-line newval)) + (text-scale-mode 1))))) +(add-variable-watcher 'text-scale-remap-header-line #'text-scale--refresh) + +(defun face-remap--clear-remappings () + (dolist (remapping + ;; This is a bit messy to stay backwards compatible. + ;; In the future, this can be simplified to just use + ;; `text-scale-mode-remapping'. + (if (consp (car-safe text-scale-mode-remapping)) + text-scale-mode-remapping + (list text-scale-mode-remapping))) + (face-remap-remove-relative remapping)) + (setq text-scale-mode-remapping nil)) + +(defun face-remap--remap-face (sym) + (push (face-remap-add-relative sym + :height + (expt text-scale-mode-step + text-scale-mode-amount)) + text-scale-mode-remapping)) + (define-minor-mode text-scale-mode "Minor mode for displaying buffer text in a larger/smaller font. @@ -240,19 +273,19 @@ face size by the value of the variable `text-scale-mode-step' The `text-scale-increase', `text-scale-decrease', and `text-scale-set' functions may be used to interactively modify the variable `text-scale-mode-amount' (they also enable or -disable `text-scale-mode' as necessary)." +disable `text-scale-mode' as necessary). + +If `text-scale-remap-header-line' is non-nil, also change +the font size of the header line." :lighter (" " text-scale-mode-lighter) - (when text-scale-mode-remapping - (face-remap-remove-relative text-scale-mode-remapping)) + (face-remap--clear-remappings) (setq text-scale-mode-lighter (format (if (>= text-scale-mode-amount 0) "+%d" "%d") text-scale-mode-amount)) - (setq text-scale-mode-remapping - (and text-scale-mode - (face-remap-add-relative 'default - :height - (expt text-scale-mode-step - text-scale-mode-amount)))) + (when text-scale-mode + (face-remap--remap-face 'default) + (when text-scale-remap-header-line + (face-remap--remap-face 'header-line))) (force-window-update (current-buffer))) (defun text-scale-min-amount () commit 83b5fcb0014896feda98917bcf198094131e82a6 Author: Juri Linkov Date: Tue Nov 24 21:23:41 2020 +0200 Yank items selected from kill-ring using completion and minibuffer history * doc/emacs/killing.texi (Earlier Kills): Document standalone M-y. * doc/emacs/search.texi (Isearch Yank): Explain standalone M-y. * doc/lispref/text.texi (Yank Commands): Soften the wording of yank after another yank. * lisp/delsel.el: Put 'yank' property on yank-pop and yank-from-kill-ring. * lisp/isearch.el (isearch-yank-pop): Use with-isearch-suspended and read-from-kill-ring to read a string from the kill-ring and append it to the search string. * lisp/simple.el (yank-pop): Call yank-from-kill-ring and read-from-kill-ring when last-command is not 'yank' instead of signaling an error. Remove "*" from interactive spec. Update docstring. (read-from-kill-ring): New function. (yank-from-kill-ring): New command. https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg00801.html diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi index bd7dbb6f51..0bd18fd0d7 100644 --- a/doc/emacs/killing.texi +++ b/doc/emacs/killing.texi @@ -362,7 +362,7 @@ through the possibilities. that was yanked and replaces it with the text from an earlier kill. So, to recover the text of the next-to-the-last kill, first use @kbd{C-y} to yank the last kill, and then use @kbd{M-y} to replace it -with the previous kill. @kbd{M-y} is allowed only after a @kbd{C-y} +with the previous kill. This works only after a @kbd{C-y} or another @kbd{M-y}. You can understand @kbd{M-y} in terms of a last-yank pointer which @@ -394,6 +394,15 @@ pointer remains at the same place in the kill ring, so repeating When you call @kbd{C-y} with a numeric argument, that also sets the last-yank pointer to the entry that it yanks. + Alternatively, when the previous command was not a yank command, +@kbd{M-y} activates the minibuffer where you can browse previous kills +using the minibuffer history commands (@pxref{Minibuffer History}), or +you can use completion commands (@pxref{Completion}) on a list of +previously killed blocks of text from the kill ring. Exiting the +minibuffer will insert the selected text to the buffer. With a plain +prefix argument (@kbd{C-u M-y}), this command leaves the cursor in +front of the inserted text, and sets the mark at the end. + @node Appending Kills @subsection Appending Kills diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index 0612c134d1..5be45ce6a9 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -295,9 +295,12 @@ from point to the @var{n}th occurrence of the specified character. appends the current kill to the search string. @kbd{M-y} (@code{isearch-yank-pop}), if called after @kbd{C-y}, replaces that appended text with an earlier kill, similar to the usual @kbd{M-y} -(@code{yank-pop}) command (@pxref{Yanking}). Clicking @kbd{mouse-2} -in the echo area appends the current X selection (@pxref{Primary -Selection}) to the search string (@code{isearch-yank-x-selection}). +(@code{yank-pop}) command. When @kbd{M-y} is called not after +@kbd{C-y}, then it activates the minibuffer where you can select +a previous kill to append to the search string (@pxref{Earlier +Kills}). Clicking @kbd{mouse-2} in the echo area appends the current +X selection (@pxref{Primary Selection}) to the search string +(@code{isearch-yank-x-selection}). @kindex C-M-d @r{(Incremental search)} @kindex C-M-y @r{(Incremental search)} diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 550e7feee2..c6ca4eed2e 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -1100,7 +1100,7 @@ one, it rotates the kill ring to place the yanked string at the front. This command replaces the just-yanked entry from the kill ring with a different entry from the kill ring. -This is allowed only immediately after a @code{yank} or another +This works only immediately after a @code{yank} or another @code{yank-pop}. At such a time, the region contains text that was just inserted by yanking. @code{yank-pop} deletes that text and inserts in its place a different piece of killed text. It does not add the deleted diff --git a/etc/NEWS b/etc/NEWS index 135452bc30..95f801f60c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -208,6 +208,13 @@ This command would previously not redefine values defined by these forms, but this command has now been changed to work more like 'eval-defun', and reset the values as specified. ++++ +** Standalone 'M-y' uses the minibuffer to complete previous kills. +When 'M-y' is typed not after a yank command, it activates the minibuffer +where you can browse previous kills using the minibuffer history or +completion. In Isearch 'C-s M-y' uses the minibuffer with completion +on previous kills to read a string and append it to the search string. + --- ** New user options 'copy-region-blink-delay' and 'delete-pair-blink-delay'. 'copy-region-blink-delay' specifies a delay to indicate the region diff --git a/lisp/delsel.el b/lisp/delsel.el index df2adc7aeb..e1087fb391 100644 --- a/lisp/delsel.el +++ b/lisp/delsel.el @@ -274,6 +274,8 @@ to `delete-selection-mode'." (put 'quoted-insert 'delete-selection t) (put 'yank 'delete-selection 'yank) +(put 'yank-pop 'delete-selection 'yank) +(put 'yank-from-kill-ring 'delete-selection 'yank) (put 'clipboard-yank 'delete-selection 'yank) (put 'insert-register 'delete-selection t) ;; delete-backward-char and delete-forward-char already delete the selection by diff --git a/lisp/isearch.el b/lisp/isearch.el index 4fba4370d9..a0aa250c4b 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2500,11 +2500,18 @@ If search string is empty, just beep." "Replace just-yanked search string with previously killed string." (interactive) (if (not (memq last-command '(isearch-yank-kill isearch-yank-pop))) - ;; Fall back on `isearch-yank-kill' for the benefits of people - ;; who are used to the old behavior of `M-y' in isearch mode. In - ;; future, this fallback may be changed if we ever change - ;; `yank-pop' to do something like the kill-ring-browser. - (isearch-yank-kill) + ;; Yank string from kill-ring-browser. + (with-isearch-suspended + (let ((string (read-from-kill-ring))) + (if (and isearch-case-fold-search + (eq 'not-yanks search-upper-case)) + (setq string (downcase string))) + (if isearch-regexp (setq string (regexp-quote string))) + (setq isearch-yank-flag t) + (setq isearch-new-string (concat isearch-string string) + isearch-new-message (concat isearch-message + (mapconcat 'isearch-text-char-description + string ""))))) (isearch-pop-state) (isearch-yank-string (current-kill 1)))) diff --git a/lisp/simple.el b/lisp/simple.el index bb28145502..69b4639292 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5344,7 +5344,7 @@ Normally set from the UNDO element of a yank-handler; see `insert-for-yank'.") (defun yank-pop (&optional arg) "Replace just-yanked stretch of killed text with a different stretch. -This command is allowed only immediately after a `yank' or a +The main use of this command is immediately after a `yank' or a `yank-pop'. At such a time, the region contains a stretch of reinserted previously-killed text. `yank-pop' deletes that text and inserts in its place a different stretch of killed text by @@ -5359,30 +5359,36 @@ comes the newest one. This command honors the `yank-handled-properties' and `yank-excluded-properties' variables, and the `yank-handler' text -property, in the way that `yank' does." - (interactive "*p") +property, in the way that `yank' does. + +When this command is called not immediately after a `yank' or a +`yank-pop', then it activates the minibuffer with its completion +and history filled with previously-killed items from the +`kill-ring' variable, and reads a string to yank at point. +See `yank-from-kill-ring' for more details." + (interactive "p") (if (not (eq last-command 'yank)) - (user-error "Previous command was not a yank")) - (setq this-command 'yank) - (unless arg (setq arg 1)) - (let ((inhibit-read-only t) - (before (< (point) (mark t)))) - (if before - (funcall (or yank-undo-function 'delete-region) (point) (mark t)) - (funcall (or yank-undo-function 'delete-region) (mark t) (point))) - (setq yank-undo-function nil) - (set-marker (mark-marker) (point) (current-buffer)) - (insert-for-yank (current-kill arg)) - ;; Set the window start back where it was in the yank command, - ;; if possible. - (set-window-start (selected-window) yank-window-start t) - (if before - ;; This is like exchange-point-and-mark, but doesn't activate the mark. - ;; It is cleaner to avoid activation, even though the command - ;; loop would deactivate the mark because we inserted text. - (goto-char (prog1 (mark t) - (set-marker (mark-marker) (point) (current-buffer)))))) - nil) + (yank-from-kill-ring (read-from-kill-ring) current-prefix-arg) + (setq this-command 'yank) + (unless arg (setq arg 1)) + (let ((inhibit-read-only t) + (before (< (point) (mark t)))) + (if before + (funcall (or yank-undo-function 'delete-region) (point) (mark t)) + (funcall (or yank-undo-function 'delete-region) (mark t) (point))) + (setq yank-undo-function nil) + (set-marker (mark-marker) (point) (current-buffer)) + (insert-for-yank (current-kill arg)) + ;; Set the window start back where it was in the yank command, + ;; if possible. + (set-window-start (selected-window) yank-window-start t) + (if before + ;; This is like exchange-point-and-mark, but doesn't activate the mark. + ;; It is cleaner to avoid activation, even though the command + ;; loop would deactivate the mark because we inserted text. + (goto-char (prog1 (mark t) + (set-marker (mark-marker) (point) (current-buffer)))))) + nil)) (defun yank (&optional arg) "Reinsert (\"paste\") the last stretch of killed text. @@ -5449,6 +5455,76 @@ See also the command `yank-pop' (\\[yank-pop])." With ARG, rotate that many kills forward (or backward, if negative)." (interactive "p") (current-kill arg)) + +(defvar read-from-kill-ring-history) +(defun read-from-kill-ring () + "Read a string from `kill-ring' using completion and minibuffer history." + (let* ((history-add-new-input nil) + (ellipsis (if (char-displayable-p ?…) "…" "...")) + ;; Remove keymaps from text properties of copied string, + ;; because typing RET in the minibuffer might call + ;; an irrelevant command from the map of copied string. + (read-from-kill-ring-history + (mapcar (lambda (s) + (remove-list-of-text-properties + 0 (length s) + '( + keymap local-map action mouse-action + button category help-args) + s) + s) + kill-ring)) + (completions + (mapcar (lambda (s) + (let* ((s (query-replace-descr s)) + (b 0)) + ;; Add ellipsis on leading whitespace + (when (string-match "\\`[[:space:]]+" s) + (setq b (match-end 0)) + (add-text-properties 0 b `(display ,ellipsis) s)) + ;; Add ellipsis at the end of a long string + (when (> (length s) (+ 40 b)) + (add-text-properties + (min (+ 40 b) (length s)) (length s) + `(display ,ellipsis) s)) + s)) + read-from-kill-ring-history))) + (minibuffer-with-setup-hook + (lambda () + ;; Allow ‘SPC’ to be self-inserting + (use-local-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map (current-local-map)) + (define-key map " " nil) + (define-key map "?" nil) + map))) + (completing-read + "Yank from kill-ring: " + (lambda (string pred action) + (if (eq action 'metadata) + ;; Keep sorted by recency + '(metadata (display-sort-function . identity)) + (complete-with-action action completions string pred))) + nil nil nil + 'read-from-kill-ring-history)))) + +(defun yank-from-kill-ring (string &optional arg) + "Insert the `kill-ring' item selected from the minibuffer history. +Use minibuffer navigation and search commands to browse the +previously-killed items from the `kill-ring' variable in the +minibuffer history before typing RET to insert the selected item, +or use completion on the elements of `kill-ring'. You can edit +the item in the minibuffer before inserting it. + +With \\[universal-argument] as argument, put point at beginning, +and mark at end, like `yank' does." + (interactive (list (read-from-kill-ring) current-prefix-arg)) + (push-mark) + (insert-for-yank string) + (if (consp arg) + ;; Swap point and mark like in `yank'. + (goto-char (prog1 (mark t) + (set-marker (mark-marker) (point) (current-buffer)))))) ;; Some kill commands. commit 2490ba0eb015a9a831732960084e2db2fbe6a75c Author: Stefan Kangas Date: Tue Nov 24 20:09:04 2020 +0100 * build-aux/update-subdirs: Use lexical-binding in subdirs.el. diff --git a/build-aux/update-subdirs b/build-aux/update-subdirs index 96712f0b32..c0ecb84810 100755 --- a/build-aux/update-subdirs +++ b/build-aux/update-subdirs @@ -41,7 +41,7 @@ if [ "x$subdirs" = x ]; then rm -f subdirs.el else rm -f subdirs.el~ - echo ";; In load-path, after this directory should come + echo ";; In load-path, after this directory should come -*- lexical-binding: t -*- ;; certain of its subdirectories. Here we specify them. (normal-top-level-add-to-load-path '($subdirs)) ;; Local" "Variables: commit 5804ac0b49a9b98daa7eea5fbb94942601cd088c Author: Philipp Stephani Date: Tue Nov 24 18:38:36 2020 +0100 Add a (broken) unit test to exemplify Bug#11218. * test/lisp/emacs-lisp/ert-tests.el (ert-test-with-demoted-errors): New (broken) unit test. diff --git a/test/lisp/emacs-lisp/ert-tests.el b/test/lisp/emacs-lisp/ert-tests.el index 96189356c0..1f54c8d07e 100644 --- a/test/lisp/emacs-lisp/ert-tests.el +++ b/test/lisp/emacs-lisp/ert-tests.el @@ -801,6 +801,11 @@ This macro is used to test if macroexpansion in `should' works." (should (eql 0 (ert-stats-completed-unexpected stats))) (should (eql 1 (ert-stats-skipped stats))))) +(ert-deftest ert-test-with-demoted-errors () + "Check that ERT correctly handles `with-demoted-errors'." + :expected-result :failed ;; FIXME! Bug#11218 + (should-not (with-demoted-errors (error "Foo")))) + (provide 'ert-tests) commit f004b66bdbf47f6887ed1ff9976fe5282dfb54fe Author: Stefan Kangas Date: Tue Nov 24 18:10:29 2020 +0100 ; Reintroduce line mistakenly removed in my last commit diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el index b17bcc354a..af1a1b154b 100644 --- a/lisp/progmodes/idlw-help.el +++ b/lisp/progmodes/idlw-help.el @@ -365,6 +365,7 @@ It collects and prints the diagnostics messages." (idlwave-help-diagnostics nil)) ;; Check for frame switching. When the command is invoked twice ;; at the same position, we try to switch to the help frame + ;; FIXME: Frame switching works only on XEmacs (if (and idlwave-experimental (equal last-command this-command) (equal idlwave-last-context-help-pos marker)) commit 6240c0dc1f55c55ad1fef09a3a0a65060736726c Author: Stefan Kangas Date: Tue Nov 24 18:03:31 2020 +0100 Remove XEmacs compat code from idlw-help.el * lisp/progmodes/idlw-help.el (idlwave-do-context-help) (idlwave-help-show-help-frame): Remove XEmacs compat code. diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el index 68809ce1fc..b17bcc354a 100644 --- a/lisp/progmodes/idlw-help.el +++ b/lisp/progmodes/idlw-help.el @@ -365,7 +365,6 @@ It collects and prints the diagnostics messages." (idlwave-help-diagnostics nil)) ;; Check for frame switching. When the command is invoked twice ;; at the same position, we try to switch to the help frame - ;; FIXME: Frame switching works only on XEmacs (if (and idlwave-experimental (equal last-command this-command) (equal idlwave-last-context-help-pos marker)) @@ -1200,16 +1199,9 @@ Useful when source code is displayed as help. See the option (setq idlwave-help-frame (make-frame idlwave-help-frame-parameters)) ;; Strip menubar (?) and toolbar from the Help frame. - (if (fboundp 'set-specifier) - (progn - ;; XEmacs - (let ((sval (cons idlwave-help-frame nil))) - ;; (set-specifier menubar-visible-p sval) - (set-specifier default-toolbar-visible-p sval))) - ;; Emacs - (modify-frame-parameters idlwave-help-frame - '(;;(menu-bar-lines . 0) - (tool-bar-lines . 0))))) + (modify-frame-parameters idlwave-help-frame + '(;;(menu-bar-lines . 0) + (tool-bar-lines . 0)))) (select-frame idlwave-help-frame)) (defun idlwave-help-get-help-buffer () commit affe9b225de711429248a73f920dc9f38b15c932 Author: Stefan Kangas Date: Tue Nov 24 17:39:11 2020 +0100 Make XEmacs compat aliases easy-menu-{add,remove} obsolete * lisp/emacs-lisp/easymenu.el (easy-menu-remove, easy-menu-add): Make XEmacs compat aliases obsolete. * lisp/allout.el (allout-setup-menubar): * lisp/cus-edit.el (Custom-mode): * lisp/gnus/gnus-art.el (gnus-article-edit-mode): * lisp/gnus/message.el (message-mode): * lisp/net/sieve.el (sieve-manage-mode): * lisp/org/org-agenda.el (org-agenda-mode): * lisp/org/org-table.el (org-table-edit-formulas, orgtbl-mode): * lisp/org/org.el: * lisp/progmodes/cperl-mode.el (cperl-mode): * lisp/progmodes/hideshow.el (hs-minor-mode): * lisp/progmodes/idlw-help.el (idlwave-help-mode): * lisp/progmodes/idlw-shell.el (idlwave-shell-mode): * lisp/progmodes/idlwave.el (idlwave-mode): * lisp/progmodes/meta-mode.el (meta-common-mode): * lisp/progmodes/octave.el (octave-mode): * lisp/progmodes/prolog.el (prolog-menu): * lisp/progmodes/tcl.el (tcl-mode): * lisp/speedbar.el (speedbar-reconfigure-keymaps): * lisp/term.el (term-mode, term-char-mode, term-process-pager): * lisp/textmodes/dns-mode.el (dns-mode): * lisp/wid-browse.el (widget-browse-mode): Don't call above obsolete aliases. * lisp/cedet/semantic/grammar.el (semantic-grammar-setup-menu-xemacs): * lisp/mh-e/mh-folder.el (mh-folder-mode): * lisp/mh-e/mh-identity.el (mh-identity-add-menu): * lisp/mh-e/mh-letter.el (mh-letter-mode): * lisp/mh-e/mh-search.el (mh-search-mode): * lisp/mh-e/mh-show.el (mh-show-mode): * lisp/obsolete/otodo-mode.el (todo-mode): * lisp/progmodes/antlr-mode.el (antlr-mode): * lisp/progmodes/cc-mode.el (c-mode, c++-mode, objc-mode) (java-mode, idl-mode, pike-mode): * lisp/progmodes/sql.el (sql-mode, sql-interactive-mode): * lisp/progmodes/vhdl-mode.el (vhdl-update-mode-menu) (vhdl-add-source-files-menu, vhdl-mode): * lisp/textmodes/reftex-index.el (reftex-index-mode) (reftex-index-phrases-mode): * lisp/textmodes/reftex-toc.el (reftex-toc-mode): * lisp/textmodes/reftex.el (reftex-mode): Only call above obsolete aliases in XEmacs. * lisp/progmodes/prolog.el (prolog-inferior-menu): * lisp/erc/erc-menu.el (erc-menu-add, erc-menu-remove): Don't call above obsolete aliases. Make obsolete. * lisp/erc/erc-menu.el (menu, erc-menu-add, erc-menu-remove): * lisp/progmodes/prolog.el (prolog-inferior-mode): Adjust callers. * lisp/speedbar.el (speedbar-previous-menu): Make obsolete. (Bug#44731) diff --git a/lisp/allout.el b/lisp/allout.el index a4802a1c2a..880098c515 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -1621,8 +1621,7 @@ So `allout-post-command-business' should not reactivate it...") cur) (while menus (setq cur (car menus) - menus (cdr menus)) - (easy-menu-add cur)))) + menus (cdr menus))))) ;;;_ > allout-overlay-preparations (defun allout-overlay-preparations () "Set the properties of the allout invisible-text overlay and others." diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el index f71ac6c413..b7670ef44b 100644 --- a/lisp/cedet/semantic/grammar.el +++ b/lisp/cedet/semantic/grammar.el @@ -1258,7 +1258,8 @@ common grammar menu." (unless (boundp ',symbol) (easy-menu-define ,symbol nil "Grammar Menu" (copy-sequence semantic-grammar-menu))) - (easy-menu-add ,symbol) + (when (featurep 'xemacs) + (easy-menu-add ,symbol)) (let ((,items (cdr ,mode-menu)) (,path (list (car ,symbol)))) (when ,items diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index eceba8fa4d..cb68bae3c9 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -5126,7 +5126,6 @@ Erase customizations; set options Entry to this mode calls the value of `Custom-mode-hook' if that value is non-nil." (use-local-map custom-mode-map) - (easy-menu-add Custom-mode-menu) (setq-local tool-bar-map (or custom-tool-bar-map ;; Set up `custom-tool-bar-map'. diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index b0198dbf8d..7a24af7963 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el @@ -488,17 +488,14 @@ To implement dynamic menus, either call this from `menu-bar-update-hook' or use a menu filter." (easy-menu-add-item map path (easy-menu-create-menu name items) before)) -;; XEmacs needs the following two functions to add and remove menus. -;; In Emacs this is done automatically when switching keymaps, so -;; here easy-menu-remove and easy-menu-add are a noops. -(defalias 'easy-menu-remove 'ignore +(define-obsolete-function-alias 'easy-menu-remove #'ignore "28.1" "Remove MENU from the current menu bar. Contrary to XEmacs, this is a nop on Emacs since menus are automatically \(de)activated when the corresponding keymap is (de)activated. \(fn MENU)") -(defalias 'easy-menu-add #'ignore +(define-obsolete-function-alias 'easy-menu-add #'ignore "28.1" "Add the menu to the menubar. On Emacs this is a nop, because menus are already automatically activated when the corresponding keymap is activated. On XEmacs diff --git a/lisp/erc/erc-menu.el b/lisp/erc/erc-menu.el index 9c02899057..b36a1cb8fa 100644 --- a/lisp/erc/erc-menu.el +++ b/lisp/erc/erc-menu.el @@ -114,22 +114,19 @@ ERC menu yet.") ;; make sure the menu only gets defined once, since Emacs 22 ;; activates it immediately (easy-menu-define erc-menu erc-mode-map "ERC menu" erc-menu-definition) - (setq erc-menu-defined t)) - (erc-menu-add)) - ((erc-menu-remove) - ;; `easy-menu-remove' is a no-op in Emacs 22 + (setq erc-menu-defined t))) + (;; `easy-menu-remove' is a no-op in Emacs 22 (message "You might have to restart Emacs to remove the ERC menu"))) -;; silence byte-compiler warning -(defvar erc-menu) - (defun erc-menu-add () "Add the ERC menu to the current buffer." - (easy-menu-add erc-menu erc-mode-map)) + (declare (obsolete nil "28.1")) + nil) (defun erc-menu-remove () "Remove the ERC menu from the current buffer." - (easy-menu-remove erc-menu)) + (declare (obsolete nil "28.1")) + nil) (provide 'erc-menu) diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 8f4ca7eb3b..7f594c9c36 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -7251,7 +7251,6 @@ This is an extended text-mode. '(message-font-lock-keywords t)) (set (make-local-variable 'mail-header-separator) "") (set (make-local-variable 'gnus-article-edit-mode) t) - (easy-menu-add message-mode-field-menu message-mode-map) (mml-mode) (setq buffer-read-only nil) (buffer-enable-undo) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 5bdf53763a..288ccc494c 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -3109,8 +3109,6 @@ Like `text-mode', but with these additional commands: '(message-font-lock-keywords t)) (if (boundp 'tool-bar-map) (set (make-local-variable 'tool-bar-map) (message-make-tool-bar))) - (easy-menu-add message-mode-menu message-mode-map) - (easy-menu-add message-mode-field-menu message-mode-map) ;; Mmmm... Forbidden properties... (add-hook 'after-change-functions #'message-strip-forbidden-properties nil 'local) diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el index 0a73ff45c2..0fb5ebf1f7 100644 --- a/lisp/mh-e/mh-folder.el +++ b/lisp/mh-e/mh-folder.el @@ -656,9 +656,10 @@ perform the operation on all messages in that region. (mh-funcall-if-exists hl-line-mode 1) (setq revert-buffer-function 'mh-undo-folder) (add-to-list 'minor-mode-alist '(mh-showing-mode " Show")) - (easy-menu-add mh-folder-sequence-menu) - (easy-menu-add mh-folder-message-menu) - (easy-menu-add mh-folder-folder-menu) + (mh-do-in-xemacs + (easy-menu-add mh-folder-sequence-menu) + (easy-menu-add mh-folder-message-menu) + (easy-menu-add mh-folder-folder-menu)) (mh-inc-spool-make) (mh-set-help mh-folder-mode-help-messages) (if (and (featurep 'xemacs) diff --git a/lisp/mh-e/mh-identity.el b/lisp/mh-e/mh-identity.el index ed23996339..23fa87de82 100644 --- a/lisp/mh-e/mh-identity.el +++ b/lisp/mh-e/mh-identity.el @@ -91,7 +91,7 @@ See `mh-identity-add-menu'." "Add the current Identity menu. See `mh-identity-make-menu'." (if mh-identity-menu - (easy-menu-add mh-identity-menu))) + (mh-do-in-xemacs (easy-menu-add mh-identity-menu)))) (defvar mh-identity-local nil "Buffer-local variable that holds the identity currently in use.") diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el index 5e1ce40318..b8aca77ddc 100644 --- a/lisp/mh-e/mh-letter.el +++ b/lisp/mh-e/mh-letter.el @@ -330,7 +330,7 @@ order). (t ;; ...or the header only (setq font-lock-defaults '((mh-show-font-lock-keywords) t)))) - (easy-menu-add mh-letter-menu) + (mh-do-in-xemacs (easy-menu-add mh-letter-menu)) ;; Maybe we want to use the existing Mail menu from mail-mode in ;; 9.0; in the mean time, let's remove it since the redundancy will ;; only produce confusion. diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el index 6fb76beff2..5cfe67865e 100644 --- a/lisp/mh-e/mh-search.el +++ b/lisp/mh-e/mh-search.el @@ -618,7 +618,7 @@ The hook `mh-search-mode-hook' is called upon entry to this mode. \\{mh-search-mode-map}" - (easy-menu-add mh-pick-menu) + (mh-do-in-xemacs (easy-menu-add mh-pick-menu)) (mh-set-help mh-search-mode-help-messages)) diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el index 7536f949e7..48ff74131d 100644 --- a/lisp/mh-e/mh-show.el +++ b/lisp/mh-e/mh-show.el @@ -863,9 +863,10 @@ See also `mh-folder-mode'. (when mh-decode-mime-flag (mh-make-local-hook 'kill-buffer-hook) (add-hook 'kill-buffer-hook 'mh-mime-cleanup nil t)) - (easy-menu-add mh-show-sequence-menu) - (easy-menu-add mh-show-message-menu) - (easy-menu-add mh-show-folder-menu) + (mh-do-in-xemacs + (easy-menu-add mh-show-sequence-menu) + (easy-menu-add mh-show-message-menu) + (easy-menu-add mh-show-folder-menu)) (make-local-variable 'mh-show-folder-buffer) (buffer-disable-undo) (use-local-map mh-show-mode-map)) diff --git a/lisp/net/sieve.el b/lisp/net/sieve.el index 08367c698f..75bb4e242e 100644 --- a/lisp/net/sieve.el +++ b/lisp/net/sieve.el @@ -143,8 +143,7 @@ require \"fileinto\"; (define-derived-mode sieve-manage-mode special-mode "Sieve-manage" "Mode used for sieve script management." (buffer-disable-undo (current-buffer)) - (setq truncate-lines t) - (easy-menu-add sieve-manage-mode-menu sieve-manage-mode-map)) + (setq truncate-lines t)) ;; Commands used in sieve-manage mode: diff --git a/lisp/obsolete/otodo-mode.el b/lisp/obsolete/otodo-mode.el index 2a4af290b6..6aada0755e 100644 --- a/lisp/obsolete/otodo-mode.el +++ b/lisp/obsolete/otodo-mode.el @@ -923,7 +923,8 @@ If INCLUDE-SEP is non-nil, return point after the separator." ;;;###autoload (define-derived-mode todo-mode nil "TODO" "Major mode for editing TODO lists." - (easy-menu-add todo-menu)) + (when (featurep 'xemacs) + (easy-menu-add todo-menu))) (with-suppressed-warnings ((lexical date entry)) (defvar date) diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 689d134627..82bf1b23f9 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -2236,7 +2236,6 @@ The following commands are available: (setq mode-name "Org-Agenda") (setq indent-tabs-mode nil) (use-local-map org-agenda-mode-map) - (easy-menu-add org-agenda-menu) (when org-startup-truncated (setq truncate-lines t)) (setq-local line-move-visual nil) (add-hook 'post-command-hook 'org-agenda-update-agenda-type nil 'local) diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index 5c37cb1af5..4636baae73 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -3287,7 +3287,6 @@ Parameters get priority." (setq-local org-selected-window sel-win) (use-local-map org-table-fedit-map) (add-hook 'post-command-hook #'org-table-fedit-post-command t t) - (easy-menu-add org-table-fedit-menu) (setq startline (org-current-line)) (dolist (entry eql) (let* ((type (cond @@ -5129,15 +5128,13 @@ When LOCAL is non-nil, show references for the table at point." orgtbl-line-start-regexp)) (when (fboundp 'font-lock-add-keywords) (font-lock-add-keywords nil orgtbl-extra-font-lock-keywords) - (org-restart-font-lock)) - (easy-menu-add orgtbl-mode-menu)) + (org-restart-font-lock))) (t (setq auto-fill-inhibit-regexp org-old-auto-fill-inhibit-regexp) (remove-hook 'before-change-functions 'org-before-change-function t) (when (fboundp 'font-lock-remove-keywords) (font-lock-remove-keywords nil orgtbl-extra-font-lock-keywords) (org-restart-font-lock)) - (easy-menu-remove orgtbl-mode-menu) (force-mode-line-update 'all)))) (defun orgtbl-make-binding (fun n &rest keys) diff --git a/lisp/org/org.el b/lisp/org/org.el index d2a36dd0ba..de7dded158 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -4791,7 +4791,6 @@ This is for getting out of special buffers like capture.") (require 'time-date) (unless (fboundp 'time-subtract) (defalias 'time-subtract 'subtract-time)) (require 'easymenu) -(autoload 'easy-menu-add "easymenu") (require 'overlay) ;; (require 'org-macs) moved higher up in the file before it is first used diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index 9dacd5856c..dc727aa375 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el @@ -2592,7 +2592,8 @@ the default language." comment-start-skip "/\\*+ *\\|// *") ;; various ----------------------------------------------------------------- (set (make-local-variable 'font-lock-defaults) antlr-font-lock-defaults) - (easy-menu-add antlr-mode-menu) + (when (featurep 'xemacs) + (easy-menu-add antlr-mode-menu)) (set (make-local-variable 'imenu-create-index-function) 'antlr-imenu-create-index-function) (set (make-local-variable 'imenu-generic-expression) t) ; fool stupid test diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index c5201d1af5..5e8cf6161e 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -2597,7 +2597,8 @@ Key bindings: (setq abbrev-mode t) (c-init-language-vars-for 'c-mode) (c-common-init 'c-mode) - (easy-menu-add c-c-menu) + (when (featurep 'xemacs) + (easy-menu-add c-c-menu)) (cc-imenu-init cc-imenu-c-generic-expression) (add-hook 'flymake-diagnostic-functions 'flymake-cc nil t) (c-run-mode-hooks 'c-mode-common-hook)) @@ -2688,7 +2689,8 @@ Key bindings: (setq abbrev-mode t) (c-init-language-vars-for 'c++-mode) (c-common-init 'c++-mode) - (easy-menu-add c-c++-menu) + (when (featurep 'xemacs) + (easy-menu-add c-c++-menu)) (cc-imenu-init cc-imenu-c++-generic-expression) (add-hook 'flymake-diagnostic-functions 'flymake-cc nil t) (c-run-mode-hooks 'c-mode-common-hook)) @@ -2735,7 +2737,8 @@ Key bindings: (setq abbrev-mode t) (c-init-language-vars-for 'objc-mode) (c-common-init 'objc-mode) - (easy-menu-add c-objc-menu) + (when (featurep 'xemacs) + (easy-menu-add c-objc-menu)) (cc-imenu-init nil 'cc-imenu-objc-function) (c-run-mode-hooks 'c-mode-common-hook)) @@ -2785,7 +2788,8 @@ Key bindings: (setq abbrev-mode t) (c-init-language-vars-for 'java-mode) (c-common-init 'java-mode) - (easy-menu-add c-java-menu) + (when (featurep 'xemacs) + (easy-menu-add c-java-menu)) (cc-imenu-init cc-imenu-java-generic-expression) (c-run-mode-hooks 'c-mode-common-hook)) @@ -2827,7 +2831,8 @@ Key bindings: (c-initialize-cc-mode t) (c-init-language-vars-for 'idl-mode) (c-common-init 'idl-mode) - (easy-menu-add c-idl-menu) + (when (featurep 'xemacs) + (easy-menu-add c-idl-menu)) ;;(cc-imenu-init cc-imenu-idl-generic-expression) ;TODO (c-run-mode-hooks 'c-mode-common-hook)) @@ -2872,7 +2877,8 @@ Key bindings: (setq abbrev-mode t) (c-init-language-vars-for 'pike-mode) (c-common-init 'pike-mode) - (easy-menu-add c-pike-menu) + (when (featurep 'xemacs) + (easy-menu-add c-pike-menu)) ;;(cc-imenu-init cc-imenu-pike-generic-expression) ;TODO (c-run-mode-hooks 'c-mode-common-hook)) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 30a80ea8f2..7a24bfcbeb 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1718,8 +1718,6 @@ or as help on variables `cperl-tips', `cperl-problems', (and (boundp 'msb-menu-cond) (not cperl-msb-fixed) (cperl-msb-fix)) - (if (fboundp 'easy-menu-add) - (easy-menu-add cperl-menu)) ; A NOP in Emacs. (if cperl-hook-after-change (add-hook 'after-change-functions #'cperl-after-change-function nil t)) ;; After hooks since fontification will break this diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 2ad66ccc5e..4dee72c737 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -948,7 +948,6 @@ Key bindings: (add-hook 'change-major-mode-hook #'turn-off-hideshow nil t) - (easy-menu-add hs-minor-mode-menu) (set (make-local-variable 'line-move-ignore-invisible) t) (add-to-invisibility-spec '(hs . t))) (remove-from-invisibility-spec '(hs . t)) diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el index 89296ff5b5..68809ce1fc 100644 --- a/lisp/progmodes/idlw-help.el +++ b/lisp/progmodes/idlw-help.el @@ -306,7 +306,6 @@ Jump: [h] to function doclib header Here are all keybindings. \\{idlwave-help-mode-map}" (buffer-disable-undo) - (easy-menu-add idlwave-help-menu idlwave-help-mode-map) (setq truncate-lines t) (setq case-fold-search t) (setq mode-line-format diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index 70b94596e1..31f18457e7 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el @@ -954,7 +954,6 @@ IDL has currently stepped.") nil 'local) (add-hook 'kill-buffer-hook 'idlwave-shell-delete-temp-files nil 'local) (add-hook 'kill-emacs-hook 'idlwave-shell-delete-temp-files) - (easy-menu-add idlwave-shell-mode-menu idlwave-shell-mode-map) ;; Set the optional comint variables (when idlwave-shell-comint-settings @@ -4334,13 +4333,6 @@ Shell debugging commands are available as single key sequences." (easy-menu-define idlwave-shell-mode-menu idlwave-shell-mode-map "IDL shell menus" idlwave-shell-menu-def) -(save-current-buffer - (dolist (buf (buffer-list)) - (set-buffer buf) - (if (derived-mode-p 'idlwave-mode) - (progn - (easy-menu-remove idlwave-mode-debug-menu) - (easy-menu-add idlwave-mode-debug-menu))))) ;; The Breakpoint Glyph ------------------------------------------------------- diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 876c38da7e..9107086b72 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -1873,10 +1873,6 @@ The main features of this mode are (set (make-local-variable 'indent-tabs-mode) nil) (set (make-local-variable 'completion-ignore-case) t) - (when (featurep 'easymenu) - (easy-menu-add idlwave-mode-menu idlwave-mode-map) - (easy-menu-add idlwave-mode-debug-menu idlwave-mode-map)) - (setq abbrev-mode t) (set (make-local-variable idlwave-fill-function) 'idlwave-auto-fill) diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el index 4a5d872b79..87c20a2ee0 100644 --- a/lisp/progmodes/meta-mode.el +++ b/lisp/progmodes/meta-mode.el @@ -946,10 +946,7 @@ The environment marked is the one that contains point or follows point." (set (make-local-variable 'font-lock-defaults) '(meta-font-lock-keywords nil nil ((?_ . "w")) nil - (font-lock-comment-start-regexp . "%"))) - - ;; Activate syntax table, keymap and menu. - (easy-menu-add meta-mode-menu)) + (font-lock-comment-start-regexp . "%")))) ;;;###autoload diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 55a78c6cc8..c313ad1179 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -619,9 +619,7 @@ Key bindings: (add-hook 'before-save-hook 'octave-sync-function-file-names nil t) (setq-local beginning-of-defun-function 'octave-beginning-of-defun) (and octave-font-lock-texinfo-comment (octave-font-lock-texinfo-comment)) - (add-hook 'eldoc-documentation-functions 'octave-eldoc-function nil t) - - (easy-menu-add octave-mode-menu)) + (add-hook 'eldoc-documentation-functions 'octave-eldoc-function nil t)) (defcustom inferior-octave-program "octave" diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index 75e95d9b90..a4e677ba41 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -1292,8 +1292,7 @@ To find out what version of Prolog mode you are running, enter (setq-local shell-dirstack-query "pwd.") (setq-local compilation-error-regexp-alist prolog-inferior-error-regexp-alist) - (compilation-shell-minor-mode) - (prolog-inferior-menu)) + (compilation-shell-minor-mode)) (defun prolog-input-filter (str) (cond ((string-match "\\`\\s *\\'" str) nil) ;whitespace @@ -3378,9 +3377,6 @@ PREFIX is the prefix of the search regexp." (defun prolog-menu () "Add the menus for the Prolog editing buffers." - (easy-menu-add prolog-edit-menu-insert-move) - (easy-menu-add prolog-edit-menu-runtime) - ;; Add predicate index menu (setq-local imenu-create-index-function 'imenu-default-create-index-function) @@ -3391,9 +3387,7 @@ PREFIX is the prefix of the search regexp." (if (and prolog-imenu-flag (< (count-lines (point-min) (point-max)) prolog-imenu-max-lines)) - (imenu-add-to-menubar "Predicates")) - - (easy-menu-add prolog-menu-help)) + (imenu-add-to-menubar "Predicates"))) (easy-menu-define prolog-inferior-menu-all prolog-inferior-mode-map @@ -3436,8 +3430,8 @@ PREFIX is the prefix of the search regexp." "Create the menus for the Prolog inferior buffer. This menu is dynamically created because one may change systems during the life of an Emacs session." - (easy-menu-add prolog-inferior-menu-all) - (easy-menu-add prolog-menu-help)) + (declare (obsolete nil "28.1")) + nil) (defun prolog-mode-version () "Echo the current version of Prolog mode in the minibuffer." diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 6b0df2d700..22099394ff 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -4186,8 +4186,9 @@ must tell Emacs. Here's how to do that in your init file: (modify-syntax-entry ?\\\\ \"\\\\\" sql-mode-syntax-table)))" :abbrev-table sql-mode-abbrev-table - (if sql-mode-menu - (easy-menu-add sql-mode-menu)); XEmacs + (when (and (featurep 'xemacs) + sql-mode-menu) + (easy-menu-add sql-mode-menu)) ;; (smie-setup sql-smie-grammar #'sql-smie-rules) (set (make-local-variable 'comment-start) "--") @@ -4312,8 +4313,9 @@ you entered, right above the output it created. (setq mode-name (concat "SQLi[" (or (sql-get-product-feature sql-product :name) (symbol-name sql-product)) "]")) - (if sql-interactive-mode-menu - (easy-menu-add sql-interactive-mode-menu)) ; XEmacs + (when (and (featurep 'xemacs) + sql-interactive-mode-menu) + (easy-menu-add sql-interactive-mode-menu)) ;; Note that making KEYWORDS-ONLY nil will cause havoc if you try ;; SELECT 'x' FROM DUAL with SQL*Plus, because the title of the column diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index f0dd9afa4c..ff3fb9657d 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el @@ -654,9 +654,7 @@ already exist." #'tcl-add-log-defun) (setq-local beginning-of-defun-function #'tcl-beginning-of-defun-function) - (setq-local end-of-defun-function #'tcl-end-of-defun-function) - - (easy-menu-add tcl-mode-menu)) + (setq-local end-of-defun-function #'tcl-end-of-defun-function)) diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index f288facba5..489092f58e 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -4205,9 +4205,11 @@ STRING are replaced by `-' and substrings are converted to lower case." (defun vhdl-update-mode-menu () "Update VHDL Mode menu." (interactive) - (easy-menu-remove vhdl-mode-menu-list) ; for XEmacs + (when (featurep 'xemacs) + (easy-menu-remove vhdl-mode-menu-list)) (setq vhdl-mode-menu-list (vhdl-create-mode-menu)) - (easy-menu-add vhdl-mode-menu-list) ; for XEmacs + (when (featurep 'xemacs) + (easy-menu-add vhdl-mode-menu-list)) (easy-menu-define vhdl-mode-menu vhdl-mode-map "Menu keymap for VHDL Mode." vhdl-mode-menu-list)) @@ -4313,7 +4315,8 @@ The directory of the current source file is scanned." (push ["*Rescan*" vhdl-add-source-files-menu t] menu-list) (push "Sources" menu-list) ;; Create menu - (easy-menu-add menu-list) + (when (featurep 'xemacs) + (easy-menu-add menu-list)) (easy-menu-define vhdl-sources-menu newmap "VHDL source files menu" menu-list)) (message "")) @@ -4926,7 +4929,8 @@ Key bindings: ;; add source file menu (if vhdl-source-file-menu (vhdl-add-source-files-menu)) ;; add VHDL menu - (easy-menu-add vhdl-mode-menu-list) ; for XEmacs + (when (featurep 'xemacs) + (easy-menu-add vhdl-mode-menu-list)) (easy-menu-define vhdl-mode-menu vhdl-mode-map "Menu keymap for VHDL Mode." vhdl-mode-menu-list) ;; initialize hideshow and add menu diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 3619b23d9e..34687805b5 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -1144,6 +1144,7 @@ frame and window to be the currently active frame and window." (defvar speedbar-previous-menu nil "The menu before the last `speedbar-reconfigure-keymaps' was called.") +(make-obsolete-variable 'speedbar-previous-menu "no longer used." "28.1") (defun speedbar-reconfigure-keymaps () "Reconfigure the menu-bar in a speedbar frame. @@ -1195,10 +1196,7 @@ and the existence of packages." (speedbar-initial-keymap) ;; This creates a small keymap we can glom the ;; menu adjustments into. - (speedbar-make-specialized-keymap))) - ;; Delete the old menu if applicable. - (if speedbar-previous-menu (easy-menu-remove speedbar-previous-menu)) - (setq speedbar-previous-menu md) + (speedbar-make-specialized-keymap))) ;; Now add the new menu (easy-menu-define speedbar-menu-map (current-local-map) "Speedbar menu" md)) diff --git a/lisp/term.el b/lisp/term.el index 585232be6c..ca64d28d9b 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -1107,8 +1107,6 @@ Entry to this mode runs the hooks on `term-mode-hook'." (term--reset-scroll-region) - (easy-menu-add term-terminal-menu) - (easy-menu-add term-signals-menu) (or term-input-ring (setq term-input-ring (make-ring term-input-ring-size))) (term-update-mode-line)) @@ -1293,8 +1291,6 @@ intervention from Emacs, except for the escape character (usually C-c)." (when (term-in-line-mode) (setq term-old-mode-map (current-local-map)) (use-local-map term-raw-map) - (easy-menu-add term-terminal-menu) - (easy-menu-add term-signals-menu) ;; Don't allow changes to the buffer or to point which are not ;; caused by the process filter. @@ -3550,9 +3546,6 @@ The top-most line is line 0." ;; (stop-process process)) (setq term-pager-old-local-map (current-local-map)) (use-local-map term-pager-break-map) - (easy-menu-add term-terminal-menu) - (easy-menu-add term-signals-menu) - (easy-menu-add term-pager-menu) (make-local-variable 'term-old-mode-line-format) (setq term-old-mode-line-format mode-line-format) (setq mode-line-format diff --git a/lisp/textmodes/dns-mode.el b/lisp/textmodes/dns-mode.el index 6dfea8f188..712955e84d 100644 --- a/lisp/textmodes/dns-mode.el +++ b/lisp/textmodes/dns-mode.el @@ -184,8 +184,7 @@ Turning on DNS mode runs `dns-mode-hook'." (set (make-local-variable 'font-lock-defaults) '(dns-mode-font-lock-keywords nil nil ((?_ . "w")))) (add-hook 'before-save-hook 'dns-mode-soa-maybe-increment-serial - nil t) - (easy-menu-add dns-mode-menu dns-mode-map)) + nil t)) ;;;###autoload (defalias 'zone-mode 'dns-mode) diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el index a1e30269d2..bebda48367 100644 --- a/lisp/textmodes/reftex-index.el +++ b/lisp/textmodes/reftex-index.el @@ -408,7 +408,8 @@ Here are all local bindings. (make-local-hook 'post-command-hook) (make-local-hook 'pre-command-hook)) (make-local-variable 'reftex-last-follow-point) - (easy-menu-add reftex-index-menu reftex-index-mode-map) + (when (featurep 'xemacs) + (easy-menu-add reftex-index-menu reftex-index-mode-map)) (add-hook 'post-command-hook 'reftex-index-post-command-hook nil t) (add-hook 'pre-command-hook 'reftex-index-pre-command-hook nil t)) @@ -1386,7 +1387,8 @@ Here are all local bindings. :syntax-table reftex-index-phrases-syntax-table (set (make-local-variable 'font-lock-defaults) reftex-index-phrases-font-lock-defaults) - (easy-menu-add reftex-index-phrases-menu reftex-index-phrases-mode-map) + (when (featurep 'xemacs) + (easy-menu-add reftex-index-phrases-menu reftex-index-phrases-mode-map)) (set (make-local-variable 'reftex-index-phrases-marker) (make-marker))) ;; (add-hook 'reftex-index-phrases-mode-hook 'turn-on-font-lock) diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el index 02e7e3a8f1..eb6ed2ff44 100644 --- a/lisp/textmodes/reftex-toc.el +++ b/lisp/textmodes/reftex-toc.el @@ -153,7 +153,8 @@ Here are all local bindings. (make-local-variable 'reftex-last-follow-point) (add-hook 'post-command-hook 'reftex-toc-post-command-hook nil t) (add-hook 'pre-command-hook 'reftex-toc-pre-command-hook nil t) - (easy-menu-add reftex-toc-menu reftex-toc-mode-map)) + (when (featurep 'xemacs) + (easy-menu-add reftex-toc-menu reftex-toc-mode-map))) (defvar reftex-last-toc-file nil "Stores the file name from which `reftex-toc' was called. For redo command.") diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index 4071c0dd07..29ebab5f9b 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el @@ -207,7 +207,8 @@ on the menu bar. (if reftex-mode (progn ;; Mode was turned on - (easy-menu-add reftex-mode-menu) + (when (featurep 'xemacs) + (easy-menu-add reftex-mode-menu)) (and reftex-plug-into-AUCTeX (reftex-plug-into-AUCTeX)) (unless (get 'reftex-auto-view-crossref 'initialized) @@ -224,7 +225,8 @@ on the menu bar. (run-hooks 'reftex-mode-hook)) ;; Mode was turned off - (easy-menu-remove reftex-mode-menu))) + (when (featurep 'xemacs) + (easy-menu-remove reftex-mode-menu)))) (defvar reftex-docstruct-symbol) (defun reftex-kill-buffer-hook () diff --git a/lisp/wid-browse.el b/lisp/wid-browse.el index 53f918cff9..f5c3d486f4 100644 --- a/lisp/wid-browse.el +++ b/lisp/wid-browse.el @@ -77,8 +77,6 @@ if that value is non-nil." (setq major-mode 'widget-browse-mode mode-name "Widget") (use-local-map widget-browse-mode-map) - (easy-menu-add widget-browse-mode-customize-menu) - (easy-menu-add widget-browse-mode-menu) (run-mode-hooks 'widget-browse-mode-hook)) (put 'widget-browse-mode 'mode-class 'special) commit dea3d6aa18e54f0d8d75cd219b511bac5b3c87b1 Author: Basil L. Contovounesios Date: Wed Nov 18 12:53:03 2020 +0000 Fix handling of defcustom :local tag For discussion, see the following emacs-devel thread: https://lists.gnu.org/r/emacs-devel/2020-11/msg00734.html * lisp/custom.el (custom-declare-variable): Delay call to make-variable-buffer-local until after user option has been initialized with a value. Otherwise the user option may be initialized to nil. * test/lisp/custom-tests.el (custom--test-local-option) (custom--test-permanent-option): New :local user options. (custom-test-local-option): New test for defcustom :local keyword. diff --git a/lisp/custom.el b/lisp/custom.el index 885c486c5e..cdfd221216 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -157,7 +157,9 @@ set to nil, as the value is no longer rogue." (if (keywordp doc) (error "Doc string is missing")) (let ((initialize #'custom-initialize-reset) - (requests nil)) + (requests nil) + ;; Whether automatically buffer-local. + buffer-local) (unless (memq :group args) (custom-add-to-group (custom-current-group) symbol 'custom-variable)) (while args @@ -183,7 +185,7 @@ set to nil, as the value is no longer rogue." (put symbol 'safe-local-variable value)) ((eq keyword :local) (when (memq value '(t permanent)) - (make-variable-buffer-local symbol)) + (setq buffer-local t)) (when (eq value 'permanent) (put symbol 'permanent-local t))) ((eq keyword :type) @@ -205,7 +207,9 @@ set to nil, as the value is no longer rogue." (put symbol 'custom-requests requests) ;; Do the actual initialization. (unless custom-dont-initialize - (funcall initialize symbol default))) + (funcall initialize symbol default)) + (when buffer-local + (make-variable-buffer-local symbol))) (run-hooks 'custom-define-hook) symbol) diff --git a/test/lisp/custom-tests.el b/test/lisp/custom-tests.el index 766e484498..e71b7913f0 100644 --- a/test/lisp/custom-tests.el +++ b/test/lisp/custom-tests.el @@ -151,4 +151,42 @@ (widget-apply field :value-to-internal origvalue) "bar")))))) +(defcustom custom--test-local-option 'initial + "Buffer-local user option for testing." + :group 'emacs + :type '(choice (const initial) (const changed)) + :local t) + +(defcustom custom--test-permanent-option 'initial + "Permanently local user option for testing." + :group 'emacs + :type '(choice (const initial) (const changed)) + :local 'permanent) + +(ert-deftest custom-test-local-option () + "Test :local user options." + ;; Initial default values. + (should (eq custom--test-local-option 'initial)) + (should (eq custom--test-permanent-option 'initial)) + (should (eq (default-value 'custom--test-local-option) 'initial)) + (should (eq (default-value 'custom--test-permanent-option) 'initial)) + (let ((obuf (current-buffer))) + (with-temp-buffer + ;; Changed buffer-local values. + (setq custom--test-local-option 'changed) + (setq custom--test-permanent-option 'changed) + (should (eq custom--test-local-option 'changed)) + (should (eq custom--test-permanent-option 'changed)) + (should (eq (default-value 'custom--test-local-option) 'initial)) + (should (eq (default-value 'custom--test-permanent-option) 'initial)) + (with-current-buffer obuf + (should (eq custom--test-local-option 'initial)) + (should (eq custom--test-permanent-option 'initial))) + ;; Permanent variable remains unchanged. + (kill-all-local-variables) + (should (eq custom--test-local-option 'initial)) + (should (eq custom--test-permanent-option 'changed)) + (should (eq (default-value 'custom--test-local-option) 'initial)) + (should (eq (default-value 'custom--test-permanent-option) 'initial))))) + ;;; custom-tests.el ends here commit b2ee6650243ed2777f3a6c400f194f770f00da6f Author: Alan Mackenzie Date: Thu Jun 25 17:07:16 2020 +0000 CC Mode. Fix an off by one error. Fixes bug #41809 * lisp/progmodes/cc-engine.el (c-full-pp-to-literal): Change > to >= (twice). diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index f751e72de4..babe6e7476 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -3122,7 +3122,7 @@ comment at the start of cc-engine.el for more info." (not base) ; FIXME!!! Compare base and far-base?? ; (2019-05-21) (not end) - (> here end)) + (>= here end)) (progn (setq far-base-and-state (c-parse-ps-state-below here) far-base (car far-base-and-state) @@ -3135,7 +3135,7 @@ comment at the start of cc-engine.el for more info." (or (and (> here base) (null end)) (null (nth 8 s)) - (and end (> here end)) + (and end (>= here end)) (not (or (and (nth 3 s) ; string commit e86199bf9089f73564687642d9ceac17971e36ec Author: Basil L. Contovounesios Date: Tue Nov 24 16:19:55 2020 +0000 ; Fix last change to gnus-sum.el * lisp/gnus/gnus-sum.el (gnus-paging-select-next): Add :version tag. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 7444cab58c..469fa36fb7 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -448,6 +448,7 @@ If non-nil, select the next article when reaching the end of the article (or the previous article when paging backwards). If nil, don't do anything at the end/start of the articles." + :version "28.1" :group 'gnus-summary-maneuvering :type 'boolean) commit f425a774c23ef683e3c052782a497ea30c0ebd10 Author: Eli Zaretskii Date: Tue Nov 24 17:04:37 2020 +0200 Fix display artifacts when 'display' properties cover newlines * src/xdisp.c (pos_visible_p): Set glyph_row of scratch iterators to NULL, to avoid producing glyphs while we figure out the layout. (Bug#44826) diff --git a/src/xdisp.c b/src/xdisp.c index c9175a68a0..e65505b1b1 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1700,6 +1700,7 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, from a display vector, we need to consume all of the glyphs from that display vector. */ start_display (&it2, w, top); + it2.glyph_row = NULL; move_it_to (&it2, charpos - 1, -1, -1, -1, MOVE_TO_POS); /* If we didn't get to CHARPOS - 1, there's some replacing display property at that position, and @@ -1823,6 +1824,7 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, of the display line where the display string begins. */ start_display (&it3, w, top); + it3.glyph_row = NULL; move_it_to (&it3, -1, 0, top_y, -1, MOVE_TO_X | MOVE_TO_Y); /* If it3_moved stays false after the 'while' loop below, that means we already were at a newline commit c390141d39790bda2ac836a6ae03d5f02c58cdd4 Author: Mauro Aranda Date: Tue Nov 24 08:48:55 2020 -0300 Fix menu binding for files in fileset * lisp/filesets.el (filesets-remake-shortcut): We want the callback of the menu item, not a list that contains the callback. (Bug#44764) diff --git a/lisp/filesets.el b/lisp/filesets.el index 84196561fc..473f2858dd 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -1909,7 +1909,7 @@ User will be queried, if no fileset name is provided." (substring (elt submenu 0) 2)))) (if (listp submenu) (cons name (cdr submenu)) - (apply 'vector (list name (cdr (append submenu nil))))))) + (apply 'vector (list name (cadr (append submenu nil))))))) ; (vconcat `[,name] (subseq submenu 1))))) (defun filesets-wrap-submenu (submenu-body) commit cbd24607d7b7419eb0f639c95185aff13f99c10d Author: Mauro Aranda Date: Tue Nov 24 08:31:18 2020 -0300 Fix matching of inline choices for the choice widget A choice widget should be able to match either no inline values or inline values, upon request. (Bug#44579) * lisp/wid-edit.el (choice): New property, :inline-bubbles-p. A predicate that returns non-nil if the choice widget can act as an inline widget. Document it. (widget-choice-inline-bubbles-p): New function, for the :inline-bubbles-p property of the choice widget. (widget-inline-p): New function. Use the :inline-bubbles-p property of the widget, if any. (widget-match-inline): Use the above to see if the widget can act like an inline widget. Document it. (widget-choice-value-create): Account for the case of a choice widget that has inline members. (widget-checklist-add-item, widget-editable-list-value-create) (widget-group-value-create): Use widget-inline-p rather than just checking for a non-nil :inline property, allowing these functions to pass the complete information to widgets like the choice widget to create their values. * test/lisp/wid-edit-tests.el (widget-test-choice-match-no-inline) (widget-test-choice-match-all-inline) widget-test-choice-match-some-inline): New tests, to check that choice widgets can match its choices, inline or not. (widget-test-inline-p): New test, for the new function widget-inline-p. (widget-test-repeat-can-handle-choice) (widget-test-repeat-can-handle-inlinable-choice) (widget-test-list-can-handle-choice) (widget-test-list-can-handle-inlinable-choice) (widget-test-option-can-handle-choice) (widget-test-option-can-handle-inlinable-choice): New tests. This grouping widgets need to be able to create a choice widget regardless if it has inline choices or not. diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 4e2cf7416d..8250316bcc 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -591,9 +591,25 @@ Otherwise, just return the value." (widget-put widget :args args))) (widget-apply widget :default-get))))) +(defun widget-inline-p (widget &optional bubblep) + "Non-nil if the widget WIDGET is inline. + +With BUBBLEP non-nil, check also if WIDGET has a member that bubbles its inline +property (if any), up to WIDGET, so that WIDGET can act as an inline widget." + (or (widget-get widget :inline) + (and bubblep + (widget-get widget :inline-bubbles-p) + (widget-apply widget :inline-bubbles-p)))) + (defun widget-match-inline (widget vals) - "In WIDGET, match the start of VALS." - (cond ((widget-get widget :inline) + "In WIDGET, match the start of VALS. + +For an inline widget or for a widget that acts like one (see `widget-inline-p'), +try to match elements in VALS as far as possible. Otherwise, match the first +element of the list VALS. + +Return a list whose car contains all members of VALS that matched WIDGET." + (cond ((widget-inline-p widget t) (widget-apply widget :match-inline vals)) ((and (listp vals) (widget-apply widget :match (car vals))) @@ -2198,7 +2214,7 @@ But if NO-TRUNCATE is non-nil, include them." (let ((value (widget-get widget :value)) (args (widget-get widget :args)) (explicit (widget-get widget :explicit-choice)) - current) + current val inline-p fun) (if explicit (progn ;; If the user specified the choice for this value, @@ -2207,15 +2223,24 @@ But if NO-TRUNCATE is non-nil, include them." widget explicit value))) (widget-put widget :choice explicit) (widget-put widget :explicit-choice nil)) + (setq inline-p (widget-inline-p widget t)) (while args (setq current (car args) args (cdr args)) - (when (widget-apply current :match value) - (widget-put widget :children (list (widget-create-child-value - widget current value))) - (widget-put widget :choice current) - (setq args nil - current nil))) + (if inline-p + (if (widget-get current :inline) + (setq val value + fun :match-inline) + (setq val (car value) + fun :match)) + (setq val value + fun :match)) + (when (widget-apply current fun val) + (widget-put widget :children (list (widget-create-child-value + widget current val))) + (widget-put widget :choice current) + (setq args nil + current nil))) (when current (let ((void (widget-get widget :void))) (widget-put widget :children (list (widget-create-child-and-convert @@ -2438,7 +2463,7 @@ If the item is checked, CHOSEN is a cons whose cdr is the value." (let ((child (widget-create-child widget type))) (widget-apply child :deactivate) child)) - ((widget-get type :inline) + ((widget-inline-p type t) (widget-create-child-value widget type (cdr chosen))) (t @@ -2795,7 +2820,7 @@ Return an alist of (TYPE MATCH)." (if answer (setq children (cons (widget-editable-list-entry-create widget - (if (widget-get type :inline) + (if (widget-inline-p type t) (car answer) (car (car answer))) t) @@ -2979,7 +3004,7 @@ Save CHILD into the :last-deleted list, so it can be inserted later." (insert-char ?\s (widget-get widget :indent))) (push (cond ((null answer) (widget-create-child widget arg)) - ((widget-get arg :inline) + ((widget-inline-p arg t) (widget-create-child-value widget arg (car answer))) (t (widget-create-child-value widget arg (car (car answer))))) @@ -3900,12 +3925,17 @@ example: `(cons :format "Key: %v" ,key-type ,value-type))) (define-widget 'choice 'menu-choice - "A union of several sexp types." + "A union of several sexp types. + +If one of the choices of a choice widget has an :inline t property, +then the choice widget can act as an inline widget on its own if the +current choice is inline." :tag "Choice" :format "%{%t%}: %[Value Menu%] %v" :button-prefix 'widget-push-button-prefix :button-suffix 'widget-push-button-suffix - :prompt-value 'widget-choice-prompt-value) + :prompt-value 'widget-choice-prompt-value + :inline-bubbles-p #'widget-choice-inline-bubbles-p) (defun widget-choice-prompt-value (widget prompt value _unbound) "Make a choice." @@ -3948,6 +3978,20 @@ example: (if current (widget-prompt-value current prompt nil t) value))) + +(defun widget-choice-inline-bubbles-p (widget) + "Non-nil if the choice WIDGET has at least one choice that is inline. +This is used when matching values, because a choice widget needs to +match a value inline rather than just match it if at least one of its choices +is inline." + (let ((args (widget-get widget :args)) + cur found) + (while (and args (not found)) + (setq cur (car args) + args (cdr args) + found (widget-get cur :inline))) + found)) + (define-widget 'radio 'radio-button-choice "A union of several sexp types." diff --git a/test/lisp/wid-edit-tests.el b/test/lisp/wid-edit-tests.el index 4508b68023..1bd429736e 100644 --- a/test/lisp/wid-edit-tests.el +++ b/test/lisp/wid-edit-tests.el @@ -148,4 +148,157 @@ ;; Check that we effectively moved the item to the last position. (should (equal (widget-value lst) '("beg" "middle" "end")))))) +(ert-deftest widget-test-choice-match-no-inline () + "Test that a no-inline choice widget can match its values." + (let* ((choice '(choice (const nil) (const t) string function)) + (widget (widget-convert choice))) + (should (widget-apply widget :match nil)) + (should (widget-apply widget :match t)) + (should (widget-apply widget :match "")) + (should (widget-apply widget :match 'ignore)))) + +(ert-deftest widget-test-choice-match-all-inline () + "Test that a choice widget with all inline members can match its values." + (let* ((lst '(list (choice (list :inline t symbol number) + (list :inline t symbol regexp)))) + (widget (widget-convert lst))) + (should-not (widget-apply widget :match nil)) + (should (widget-apply widget :match '(:test 2))) + (should (widget-apply widget :match '(:test ".*"))) + (should-not (widget-apply widget :match '(:test ignore))))) + +(ert-deftest widget-test-choice-match-some-inline () + "Test that a choice widget with some inline members can match its values." + (let* ((lst '(list string + (choice (const t) + (list :inline t symbol number) + (list :inline t symbol regexp)))) + (widget (widget-convert lst))) + (should-not (widget-apply widget :match nil)) + (should (widget-apply widget :match '("" t))) + (should (widget-apply widget :match '("" :test 2))) + (should (widget-apply widget :match '("" :test ".*"))) + (should-not (widget-apply widget :match '(:test ignore))))) + +(ert-deftest widget-test-inline-p () + "Test `widget-inline-p'. +For widgets without an :inline t property, `widget-inline-p' has to return nil. +But if the widget is a choice widget, it has to return nil if passed nil as +the bubblep argument, or non-nil if one of the members of the choice widget has +an :inline t property and we pass a non-nil bubblep argument. If no members of +the choice widget have an :inline t property, then `widget-inline-p' has to +return nil, even with a non-nil bubblep argument." + (with-temp-buffer + (widget-insert "Testing.\n\n") + (let* ((widget (widget-create 'repeat + :value '(nil) + '(choice (const nil) (const t) + (list :inline t symbol number)) + '(choice (const nil) (const t) + (list function string)))) + (children (widget-get widget :children)) + (child-1 (car children)) + (child-2 (cadr children))) + (should-not (widget-inline-p widget)) + (should-not (widget-inline-p child-1)) + (should (widget-inline-p child-1 'bubble)) + (should-not (widget-inline-p child-2)) + (should-not (widget-inline-p child-2 'bubble))))) + +(ert-deftest widget-test-repeat-can-handle-choice () + "Test that we can create a repeat widget with a choice correctly." + (with-temp-buffer + (widget-insert "Testing.\n\n") + (let* ((widget (widget-create 'repeat + :entry-format "%i %d %v" + :value '((:test 2)) + '(choice (const nil) (const t) + (list symbol number)))) + (child (car (widget-get widget :children)))) + (widget-insert "\n") + (use-local-map widget-keymap) + (widget-setup) + (should child) + (should (equal (widget-value widget) '((:test 2))))))) + +(ert-deftest widget-test-repeat-can-handle-inlinable-choice () + "Test that we can create a repeat widget with an inlinable choice correctly." + (with-temp-buffer + (widget-insert "Testing.\n\n") + (let* ((widget (widget-create 'repeat + :entry-format "%i %d %v" + :value '(:test 2) + '(choice (const nil) (const t) + (list :inline t symbol number)))) + (child (widget-get widget :children))) + (widget-insert "\n") + (use-local-map widget-keymap) + (widget-setup) + (should child) + (should (equal (widget-value widget) '(:test 2)))))) + +(ert-deftest widget-test-list-can-handle-choice () + "Test that we can create a list widget with a choice correctly." + (with-temp-buffer + (widget-insert "Testing.\n\n") + (let* ((widget (widget-create 'list + :value '((1 "One")) + '(choice string + (list number string)))) + (child (car (widget-get widget :children)))) + (widget-insert "\n") + (use-local-map widget-keymap) + (widget-setup) + (should child) + (should (equal (widget-value widget) '((1 "One"))))))) + +(ert-deftest widget-test-list-can-handle-inlinable-choice () + "Test that we can create a list widget with an inlinable choice correctly." + (with-temp-buffer + (widget-insert "Testing.\n\n") + (let* ((widget (widget-create 'list + :value '(1 "One") + '(choice string + (list :inline t number string)))) + (child (car (widget-get widget :children)))) + (widget-insert "\n") + (use-local-map widget-keymap) + (widget-setup) + (should child) + (should (equal (widget-value widget) '(1 "One")))))) + +(ert-deftest widget-test-option-can-handle-choice () + "Test that we can create a option widget with a choice correctly." + (with-temp-buffer + (widget-insert "Testing.\n\n") + (let* ((widget (widget-create 'repeat + :value '(("foo")) + '(list (option + (choice string + (list :inline t + number string)))))) + (child (car (widget-get widget :children)))) + (widget-insert "\n") + (use-local-map widget-keymap) + (widget-setup) + (should child) + (should (equal (widget-value widget) '(("foo"))))))) + +(ert-deftest widget-test-option-can-handle-inlinable-choice () + "Test that we can create a option widget with an inlinable choice correctly." + (with-temp-buffer + (widget-insert "Testing.\n\n") + (let* ((widget (widget-create 'repeat + :value '((1 "One")) + '(list (option + (choice string + (list :inline t + number string)))))) + (child (car (widget-get widget :children)))) + (widget-insert "\n") + (use-local-map widget-keymap) + (widget-setup) + (should child) + (should (equal (widget-value widget) '((1 "One"))))))) + ;;; wid-edit-tests.el ends here commit 5cc570215a30301939a56075035e91aa540513cb Author: Drew Adams Date: Tue Nov 24 08:00:29 2020 -0300 Fix finding filelist for :tree fileset (Bug#976) * lisp/filesets.el (filesets-files-under): New function, used to get all files for a :tree fileset. (filesets-get-filelist): Use it. Look for the directory and the pattern in the right place inside entry. diff --git a/lisp/filesets.el b/lisp/filesets.el index c7ec3f77f4..84196561fc 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -1718,9 +1718,12 @@ Assume MODE (see `filesets-entry-mode'), if provided." (filesets-entry-get-master entry))))) (cons entry (filesets-ingroup-cache-get entry)))) (:tree - (let ((dir (nth 0 entry)) - (patt (nth 1 entry))) - (filesets-directory-files dir patt ':files t))) + (let* ((dirpatt (filesets-entry-get-tree entry)) + (dir (nth 0 dirpatt)) + (patt (nth 1 dirpatt)) + (depth (or (filesets-entry-get-tree-max-level entry) + filesets-tree-max-level))) + (filesets-files-under 0 depth entry dir patt))) (:pattern (let ((dirpatt (filesets-entry-get-pattern entry))) (if dirpatt @@ -1734,6 +1737,34 @@ Assume MODE (see `filesets-entry-mode'), if provided." (lambda (file) (not (filesets-filetype-property file event)))))) +(defun filesets-files-under (level depth entry dir patt &optional relativep) + "Files under DIR that match PATT. +LEVEL is the current level under DIR. +DEPTH is the maximal tree scanning depth for ENTRY. +ENTRY is a fileset. +DIR is a directory. +PATT is a regexp that included file names must match. +RELATIVEP non-nil means use relative file names." + (and (or (= depth 0) (< level depth)) + (let* ((dir (file-name-as-directory dir)) + (files-here (filesets-directory-files + dir patt nil (not relativep) + (filesets-entry-get-filter-dirs-flag entry))) + (subdirs (filesets-filter-dir-names files-here)) + (files + (filesets-filter-dir-names + (apply #'append + files-here + (mapcar + (lambda (subdir) + (let* ((subdir (file-name-as-directory subdir)) + (full-subdir (concat dir subdir))) + (filesets-files-under (+ level 1) depth entry + full-subdir patt))) + subdirs)) + t))) + files))) + (defun filesets-open (&optional mode name lookup-name) "Open the fileset called NAME. Use LOOKUP-NAME for searching additional data if provided." commit 89a24e4d0538e312bb0787ecb515bf7bd68fc04e Author: Mattias Engdegård Date: Tue Nov 24 10:37:37 2020 +0100 Autoload the 'rx' pcase macroexpander (bug#44807) * lisp/emacs-lisp/rx.el (rx--pcase-macroexpander]): Autoload. diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index 76c3ac31b8..6d33299e20 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -1418,6 +1418,7 @@ into a plain rx-expression, collecting names into `rx--pcase-vars'." (cons head (mapcar #'rx--pcase-transform rest))) (_ rx))) +;;;###autoload (pcase-defmacro rx (&rest regexps) "A pattern that matches strings against `rx' REGEXPS in sexp form. REGEXPS are interpreted as in `rx'. The pattern matches any commit 329feffc68238e293854ca2183801056bdd8a6ff Author: Lars Ingebrigtsen Date: Tue Nov 24 09:27:14 2020 +0100 Allow controlling whether SPC in Gnus goes to the next article * doc/misc/gnus.texi (Summary Maneuvering): Document it. * lisp/gnus/gnus-sum.el (gnus-paging-select-next): New variable. (gnus-summary-prev-page, gnus-summary-next-page): Use it. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 3f597455b7..81ce13945c 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -5361,6 +5361,15 @@ articles with the same subject, go to the first unread article. This variable is not particularly useful if you use a threaded display. +@item gnus-paging-select-next +@vindex gnus-paging-select-next +Control whether to select the next/previous article when paging (with +commands like @kbd{SPC} or @kbd{DEL}). If non-@code{nil}, select the +next article when reaching the end of the article (or the previous +article when paging backwards). + +If @code{nil}, don't do anything at the end/start of the articles. + @item gnus-summary-check-current @vindex gnus-summary-check-current If non-@code{nil}, all the ``unread'' movement commands will not proceed diff --git a/etc/NEWS b/etc/NEWS index f3a75e4965..135452bc30 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -481,6 +481,12 @@ tags to be considered as well. ** Gnus ++++ +*** New user option 'gnus-paging-select-next'. +This controls what happens when using commands like `SPC' and `DEL' to +page the current article. If non-nil (the default), go to the +next/prev article, but if nil, do nothing at the end/start of the article. + +++ *** New gnus-search library. A new unified search syntax which can be used across multiple diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 561f199531..7444cab58c 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -442,6 +442,15 @@ will go to the next group without confirmation." (const slightly-quietly) (sexp :menu-tag "on" t))) +(defcustom gnus-paging-select-next t + "Control whether to select the next/prev article when paging. +If non-nil, select the next article when reaching the end of the +article (or the previous article when paging backwards). + +If nil, don't do anything at the end/start of the articles." + :group 'gnus-summary-maneuvering + :type 'boolean) + (defcustom gnus-auto-select-same nil "If non-nil, select the next article with the same subject. If there are no more articles with the same subject, go to @@ -7898,7 +7907,8 @@ Also see the variable `gnus-article-skip-boring'." (gnus-message 3 "End of message")) (circular (gnus-summary-beginning-of-article)) - (lines + ((or lines + (not gnus-paging-select-next)) (gnus-message 3 "End of message")) ((null lines) (if (and (eq gnus-summary-goto-unread 'never) @@ -7929,7 +7939,8 @@ the beginning of the buffer." (gnus-eval-in-buffer-window gnus-article-buffer (setq endp (gnus-article-prev-page lines))) (when (and move endp) - (cond (lines + (cond ((or lines + (not gnus-paging-select-next)) (gnus-message 3 "Beginning of message")) ((null lines) (if (and (eq gnus-summary-goto-unread 'never) commit 71916f0758297d616fcb9c12db1c4f19c0e85458 Author: Lars Ingebrigtsen Date: Tue Nov 24 08:44:30 2020 +0100 Make the `C' command work on marked files * lisp/arc-mode.el (archive-copy-file): Make the `C' command work on marked files (bug#44753). diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index ce0c061fc0..69a159a84a 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -1058,27 +1058,43 @@ return nil. Otherwise point is returned." (archive-goto-file short)) next)) -(defun archive-copy-file (file new-name) - "Copy FILE to a location specified by NEW-NAME. -Interactively, FILE is the file at point, and the function prompts -for NEW-NAME." +(defun archive-copy-file (files new-name) + "Copy FILES to a location specified by NEW-NAME. +FILES can be a single file or a list of files. + +Interactively, FILES is the list of marked files, or the file at +point if nothing is marked, and the function prompts for +NEW-NAME." (interactive - (let ((name (archive--file-desc-ext-file-name (archive-get-descr)))) - (list name - (read-file-name (format "Copy %s to: " name))))) - (when (file-directory-p new-name) - (setq new-name (expand-file-name file new-name))) - (when (and (file-exists-p new-name) - (not (yes-or-no-p (format "%s already exists; overwrite? " - new-name)))) - (user-error "Not overwriting %s" new-name)) - (let* ((descr (archive-get-descr)) - (archive (buffer-file-name)) - (extractor (archive-name "extract")) - (ename (archive--file-desc-ext-file-name descr))) - (with-temp-buffer - (archive--extract-file extractor archive ename) - (write-region (point-min) (point-max) new-name)))) + (let ((names + (mapcar + #'archive--file-desc-ext-file-name + (or (archive-get-marked ?*) (list (archive-get-descr)))))) + (list names + (read-file-name (format "Copy %s to: " (string-join names ", ")))))) + (unless (consp files) + (setq files (list files))) + (when (and (> (length files) 1) + (not (file-directory-p new-name))) + (user-error "Can't copy a list of files to a single file")) + (save-excursion + (dolist (file files) + (let ((write-to (if (file-directory-p new-name) + (expand-file-name file new-name) + new-name))) + (when (and (file-exists-p write-to) + (not (yes-or-no-p (format "%s already exists; overwrite? " + write-to)))) + (user-error "Not overwriting %s" write-to)) + (archive-goto-file file) + (let* ((descr (archive-get-descr)) + (archive (buffer-file-name)) + (extractor (archive-name "extract")) + (ename (archive--file-desc-ext-file-name descr))) + (with-temp-buffer + (set-buffer-multibyte nil) + (archive--extract-file extractor archive ename) + (write-region (point-min) (point-max) write-to))))))) (defun archive-extract (&optional other-window-p event) "In archive mode, extract this entry of the archive into its own buffer." commit 6dad1f25de0f9f62dd4855bb6400405b627fd700 Author: Lars Ingebrigtsen Date: Tue Nov 24 08:22:26 2020 +0100 Add a user option to control how links are followed in eww * doc/misc/eww.texi (Advanced): Document it (bug#44783). * lisp/net/eww.el (eww-use-browse-url): New variable. (eww-follow-link): Use it. diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi index 1bccbd7261..a2a21f031d 100644 --- a/doc/misc/eww.texi +++ b/doc/misc/eww.texi @@ -262,6 +262,12 @@ fetching images that originate from the same source as the retrieving these images'' and @code{t} means ``always send cookies when retrieving these images''. +@vindex eww-use-browse-url + When following links in EWW, @acronym{URL}s that match the +@code{eww-use-browse-url} regexp will be passed to @code{browse-url} +instead of EWW handling them itself. The action can be further +customized by altering @code{browse-url-handlers}. + @vindex eww-header-line-format @cindex Header The header line of the EWW buffer can be changed by customizing diff --git a/etc/NEWS b/etc/NEWS index 9361cff386..f3a75e4965 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1099,6 +1099,10 @@ background colors or transparency, such as xbm, pbm, svg, png and gif. ** EWW ++++ +*** New user option 'eww-use-browse-url'. +This is a regexp that can be set to alter how links are followed in eww. + +++ *** New user option 'eww-retrieve-command'. This can be used to download data via an external command. If nil diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 9ed01ecc47..597ce95c67 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -56,6 +56,13 @@ :group 'eww :type 'string) +(defcustom eww-use-browse-url "\\`mailto:" + "eww will use `browse-url' when following links that match this regexp. +The action to be taken can further be customized via +`browse-url-handlers'." + :version "28.1" + :type 'regexp) + (defun erc--download-directory () "Return the name of the download directory. If ~/Downloads/ exists, that will be used, and if not, the @@ -1731,7 +1738,7 @@ If EXTERNAL is double prefix, browse in new buffer." (cond ((not url) (message "No link under point")) - ((string-match-p "\\`mailto:" url) + ((string-match-p eww-use-browse-url url) ;; This respects the user options `browse-url-handlers' ;; and `browse-url-mailto-function'. (browse-url url)) commit 868f51324ac96bc3af49a826e1db443548c9d6cc Author: Itai Seggev Date: Tue Nov 24 06:52:27 2020 +0100 Codesign the executable on recene MacOS systems * src/Makefile.in (temacs$(EXEEXT)): Codesign the executable on recent (ARM) MacOS systems (bug#43878). Without this, building Emacs fails. Copyright-paperwork-exempt: yes diff --git a/src/Makefile.in b/src/Makefile.in index c5fb2ea3ab..39c0f12fe6 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -336,6 +336,10 @@ DUMPING=@DUMPING@ CHECK_STRUCTS = @CHECK_STRUCTS@ HAVE_PDUMPER = @HAVE_PDUMPER@ +## ARM Macs require that all code have a valid signature. Since pump +## invalidates the signature, we must re-sign to fix it. +DO_CODESIGN=$(patsubst aarch64-apple-darwin%,yes,@configuration@) + # 'make' verbosity. AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ @@ -653,6 +657,9 @@ temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(EMACSRES) \ $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(W32_RES_LINK) $(LIBES) ifeq ($(HAVE_PDUMPER),yes) $(AM_V_at)$(MAKE_PDUMPER_FINGERPRINT) $@.tmp +ifeq ($(DO_CODESIGN),yes) + codesign -s - -f $@.tmp +endif endif $(AM_V_at)mv $@.tmp $@ $(MKDIR_P) $(etc) commit 3802f9ce3d5ff72fc73406528c90bd6e265231ab Author: Lars Ingebrigtsen Date: Tue Nov 24 06:41:03 2020 +0100 Delete the emacs-server directory upon Emacs exit * lisp/server.el (server-start): Delete the server directory upon Emacs exit (bug#44644). This fixes the problem of /tmp/emacs0 directories being left behind when running an Emacs server as root. diff --git a/lisp/server.el b/lisp/server.el index 763f651fef..1219b02122 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -648,7 +648,12 @@ the `server-process' variable." ;; Remove any leftover socket or authentication file. (ignore-errors (let (delete-by-moving-to-trash) - (delete-file server-file))) + (delete-file server-file) + ;; Also delete the directory that the server file was + ;; created in. There may be other servers running, + ;; too, so this may fail. + (ignore-errors + (delete-directory (file-name-directory server-file))))) (setq server-mode nil) ;; already set by the minor mode code (display-warning 'server commit 33e2515257ae74c638083c3f7981748c204afe04 Author: Lars Ingebrigtsen Date: Tue Nov 24 06:22:52 2020 +0100 Tweak the face of unknown backend indicators in flymake * lisp/progmodes/flymake.el (flymake--mode-line-format): Don't put a face on the the "?" unknown backend indicator, because that looks odd in inactive windows (bug#44689). diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index b286208fff..efa7b2ffbf 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -1224,7 +1224,7 @@ default) no filter is applied." map)) ,@(pcase-let ((`(,ind ,face ,explain) (cond ((null known) - '("?" mode-line "No known backends")) + '("?" nil "No known backends")) (some-waiting `("Wait" compilation-mode-line-run ,(format "Waiting for %s running backend(s)" commit 5a823a2a0c3eca60dd3939fba67df1bbe5a1b715 Author: Paul W. Rankin Date: Tue Nov 24 06:08:59 2020 +0100 Handle outline overlays better when cycling in outline.el * lisp/outline.el (outline--cycle-state): Only consider outline overlays that are on outline headings; when subtree end is point-max, return overlay-end +1 because final subtree overlay only reaches point-max -1 (bug#41198). (outline-cycle-buffer): Check that buffer has top-level headings before calling outline-hide-sublevels 1 thus preventing disconcerting buffer state of content reduced to single "..." diff --git a/lisp/outline.el b/lisp/outline.el index 47e6528859..9b11b86b9d 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -1121,14 +1121,19 @@ Return either 'hide-all, 'headings-only, or 'show-all." (setq heading-end (point)) (outline-end-of-subtree) (setq end (point)) - (setq ov-list (cl-remove-if-not - (lambda (o) (eq (overlay-get o 'invisible) 'outline)) - (overlays-in start end))) - (cond ((eq ov-list nil) 'show-all) - ;; (eq (length ov-list) 1) wouldn’t work: what if there is - ;; one folded subheading? - ((and (eq (overlay-end (car ov-list)) end) - (eq (overlay-start (car ov-list)) heading-end)) + (setq ov-list + (seq-filter + (lambda (o) + (and (eq (overlay-get o 'invisible) 'outline) + (save-excursion + (goto-char (overlay-start o)) + (outline-on-heading-p t)))) + (overlays-in start end))) + (cond ((null ov-list) 'show-all) + ((and (or (= end (point-max) + (1+ (overlay-end (car ov-list)))) + (= (overlay-end (car ov-list)) end)) + (= (overlay-start (car ov-list)) heading-end)) 'hide-all) (t 'headings-only))))) @@ -1168,20 +1173,30 @@ Return either 'hide-all, 'headings-only, or 'show-all." (defun outline-cycle-buffer () "Cycle the whole buffer like in `outline-cycle'." (interactive) - (pcase outline--cycle-buffer-state - ('show-all - (outline-hide-sublevels 1) - (setq outline--cycle-buffer-state 'top-level) - (message "Top level headings")) - ('top-level - (outline-show-all) - (outline-hide-region-body (point-min) (point-max)) - (setq outline--cycle-buffer-state 'all-heading) - (message "All headings")) - ('all-heading - (outline-show-all) - (setq outline--cycle-buffer-state 'show-all) - (message "Show all")))) + (let (has-top-level) + (save-excursion + (goto-char (point-min)) + (while (not (or has-top-level (eobp))) + (when (outline-on-heading-p t) + (when (= (funcall outline-level) 1) + (setq has-top-level t))) + (outline-next-heading))) + (cond + ((and (eq outline--cycle-buffer-state 'show-all) + has-top-level) + (outline-hide-sublevels 1) + (setq outline--cycle-buffer-state 'top-level) + (message "Top level headings")) + ((or (eq outline--cycle-buffer-state 'show-all) + (eq outline--cycle-buffer-state 'top-level)) + (outline-show-all) + (outline-hide-region-body (point-min) (point-max)) + (setq outline--cycle-buffer-state 'all-heading) + (message "All headings")) + (t + (outline-show-all) + (setq outline--cycle-buffer-state 'show-all) + (message "Show all"))))) (provide 'outline) (provide 'noutline) commit e2acb8fef4a40b94f7c43c7548453b997353e006 Author: Michael Albinus Date: Mon Nov 23 19:54:09 2020 +0100 Adapt files-x-tests.el according to recent Tramp changes * test/lisp/files-x-tests.el (tramp-connection-local-default-profile): Don't declare. (tramp-connection-local-default-shell-variables) (tramp-connection-local-default-system-variables): Declare. (files-x-test-with-connection-local-variables): Use them. diff --git a/test/lisp/files-x-tests.el b/test/lisp/files-x-tests.el index 9db198384d..6b05e6a88c 100644 --- a/test/lisp/files-x-tests.el +++ b/test/lisp/files-x-tests.el @@ -274,7 +274,8 @@ (should-not (local-variable-p 'remote-shell-file-name)) (should-not (boundp 'remote-shell-file-name)))))) -(defvar tramp-connection-local-default-profile) +(defvar tramp-connection-local-default-shell-variables) +(defvar tramp-connection-local-default-system-variables) (ert-deftest files-x-test-with-connection-local-variables () "Test setting connection-local variables." @@ -335,7 +336,10 @@ (append (nreverse (copy-tree files-x-test--variables3)) (nreverse (copy-tree files-x-test--variables2)) - (nreverse (copy-tree tramp-connection-local-default-profile))))) + (nreverse + (copy-tree tramp-connection-local-default-shell-variables)) + (nreverse + (copy-tree tramp-connection-local-default-system-variables))))) ;; The variables exist also as local variables. (should (local-variable-p 'remote-shell-file-name)) (should (local-variable-p 'remote-null-device)) commit a19b29d22cab61824b5f06c0b0993a5df810cd98 Merge: 593c262124 2b1cec5592 Author: Glenn Morris Date: Mon Nov 23 09:41:53 2020 -0800 ; Merge from origin/emacs-27 The following commits were skipped: 2b1cec5592 (origin/emacs-27) Sync latest SKK-JISYO.L 070c1f8cd7 Update publicsuffix.txt from upstream commit 593c262124ecf213da1f24fcf46c8cca8fea2fd8 Merge: 3401251744 3ceee39819 Author: Glenn Morris Date: Mon Nov 23 09:41:53 2020 -0800 Merge from origin/emacs-27 3ceee39819 Fix Bug#44481 commit 34012517447deb2361ee2f573ca6f569ed330394 Merge: be17ee78c6 a824888188 Author: Glenn Morris Date: Mon Nov 23 09:41:53 2020 -0800 ; Merge from origin/emacs-27 The following commit was skipped: a824888188 Minor Edebug manual keystroke clarifications commit be17ee78c659d0ddded4c536e10777cac2852884 Merge: a8c513b6f5 86cbc9d216 Author: Glenn Morris Date: Mon Nov 23 09:41:53 2020 -0800 Merge from origin/emacs-27 86cbc9d216 Make ignoring modifiers on IME input optional 32b97bb9e0 Ignore modifiers when processing WM_IME_CHAR messages f641ef1a07 Improve documentation of 'font-spec' # Conflicts: # etc/NEWS commit a8c513b6f56ec33b23de94395c949427fcb86ca1 Merge: a228b9dd56 9d02e6c5ff Author: Glenn Morris Date: Mon Nov 23 09:41:53 2020 -0800 ; Merge from origin/emacs-27 The following commit was skipped: 9d02e6c5ff Further doc fixes for dotimes about RESULT commit a228b9dd568b2f9ee63bcc706dd40197fd3de2ab Merge: f583cae4cc e66502fec1 Author: Glenn Morris Date: Mon Nov 23 09:41:53 2020 -0800 Merge from origin/emacs-27 e66502fec1 ; * doc/misc/eshell.texi (Input/Output): Fix typo. commit f583cae4cc428adb6b9ce183784ff5c8c7cca012 Merge: c3edaa5524 d5d3862c56 Author: Glenn Morris Date: Mon Nov 23 09:41:53 2020 -0800 ; Merge from origin/emacs-27 The following commit was skipped: d5d3862c56 ; * INSTALL: Correct a recent change. commit c3edaa552491629917489ddd7aaa4829fd3487a4 Author: Alan Mackenzie Date: Mon Nov 23 15:54:50 2020 +0000 minibuffer code: restore original frame after using minibuffer-only frame, etc * src/minibuf.c (read_minibuf): In the record_unwind_protect for the second restore_window_configuration (separate minibuffer frame case) arrange for the future switching back to the original frame by Fset_window_configuration. diff --git a/src/minibuf.c b/src/minibuf.c index 464e3018f7..fc3fd92a88 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -508,7 +508,10 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, mini_frame = WINDOW_FRAME (XWINDOW (minibuf_window)); if (!EQ (mini_frame, selected_frame)) record_unwind_protect (restore_window_configuration, - Fcons (Qt, + Fcons (/* Arrange for the frame later to be + switched back to the calling + frame. */ + Qnil, Fcurrent_window_configuration (mini_frame))); /* If the minibuffer is on an iconified or invisible frame, commit d645b6f9ac19545b0cd0e4ad75b064d89d65172c Author: Mattias Engdegård Date: Mon Nov 23 15:15:25 2020 +0100 Fix 'See @xref{...}' (bug#44811) Reported by 황병희. * doc/lispref/edebug.texi (Printing in Edebug): * doc/misc/ebrowse.texi (Marking Classes): * doc/misc/gnus.texi (Ma Gnus): * doc/misc/tramp.texi (Remote shell setup): Don't stutter (@xref expands to 'See ...'). diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index 820fdb9bea..b4c631b449 100644 --- a/doc/lispref/edebug.texi +++ b/doc/lispref/edebug.texi @@ -877,8 +877,8 @@ If non-@code{nil}, Edebug binds @code{print-circle} to this value while printing results. The default value is @code{t}. @end defopt - See @xref{Output Functions} for further details about how printing -can be customized. + For further details about how printing can be customized, see +@pxref{Output Functions}. @node Trace Buffer @subsection Trace Buffer diff --git a/doc/misc/ebrowse.texi b/doc/misc/ebrowse.texi index 1751a775d7..98c1a790bb 100644 --- a/doc/misc/ebrowse.texi +++ b/doc/misc/ebrowse.texi @@ -735,7 +735,7 @@ context menu. Classes can be marked for operations similar to the standard Emacs commands @kbd{M-x tags-search} and @kbd{M-x tags-query-replace} (see -also @xref{Tags-like Functions}.) +also @pxref{Tags-like Functions}.) @table @kbd @cindex toggle mark diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index c6ce129992..3f597455b7 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -29151,7 +29151,7 @@ again and again. @xref{MIME Commands}. @item The new hooks @code{gnus-gcc-pre-body-encode-hook} and @code{gnus-gcc-post-body-encode-hook} are run before/after encoding -the message body of the Gcc copy of a sent message. See +the message body of the Gcc copy of a sent message. @xref{Archived Messages}. @end itemize diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 6738ed5123..3a6e425405 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -2180,7 +2180,7 @@ be recomputed. To force @value{tramp} to recompute afresh, call Per default, @value{tramp} uses the command @command{/bin/sh} for starting a shell on the remote host. This can be changed by setting -the connection property @t{"remote-shell"}, see @xref{Predefined +the connection property @t{"remote-shell"}; see @pxref{Predefined connection information}. If you want, for example, use @command{/usr/bin/zsh} on a remote host, you might apply commit 613dd41769ab9953c50645983a4e91e09b16b6bf Author: Stefan Kangas Date: Mon Nov 23 13:46:21 2020 +0100 Remove Emacs 19 and 20 compat code from table.el * lisp/textmodes/table.el: (table-recognize-cell, table--make-cell-map) (*table--present-cell-popup-menu, table--update-cell) (table--update-cell-widened, table--update-cell-heightened) (table--cell-insert-char, table--warn-incompatibility): Remove Emacs 19 and 20 compat code. * lisp/textmodes/table.el (table-disable-menu) (table--set-timer, table--get-last-command): Declare obsolete. diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 065fdd09cc..984cc08de8 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el @@ -620,13 +620,6 @@ (defvar flyspell-mode) (defvar real-last-command) (defvar delete-selection-mode) -;; This is evil!! -;; (eval-when-compile -;; (unless (fboundp 'set-face-property) -;; (defun set-face-property (face prop value))) -;; (unless (fboundp 'unibyte-char-to-multibyte) -;; (defun unibyte-char-to-multibyte (char))) -;; (defun table--point-in-cell-p (&optional location))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; @@ -811,13 +804,6 @@ simply by any key input." (setplist 'table-disable-incompatibility-warning nil) -(defvar table-disable-menu (null (and (locate-library "easymenu") - (require 'easymenu) - (fboundp 'easy-menu-add-item))) - "When non-nil, use of menu by table package is disabled. -It must be set before loading this package `table.el' for the first -time.") - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; @@ -1202,12 +1188,11 @@ This is always set to nil at the entry to `table-with-cache-buffer' before execu )) ;; register table menu under global tools menu -(unless table-disable-menu - (easy-menu-define table-global-menu-map nil - "Table global menu" table-global-menu) - (easy-menu-add-item (current-global-map) '("menu-bar" "tools") "--") - (easy-menu-add-item (current-global-map) - '("menu-bar" "tools") table-global-menu-map)) +(easy-menu-define table-global-menu-map nil + "Table global menu" table-global-menu) +(easy-menu-add-item (current-global-map) '("menu-bar" "tools") "--") +(easy-menu-add-item (current-global-map) + '("menu-bar" "tools") table-global-menu-map) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @@ -1287,12 +1272,8 @@ the last cache point coordinate." ;; set up the update timer unless it is explicitly inhibited. (unless table-inhibit-update (table--update-cell))))) -(if (null (fboundp 'font-lock-add-keywords)) - nil - ;; Color it as a keyword. - (font-lock-add-keywords - 'emacs-lisp-mode - '("\\"))) +;; Color it as a keyword. +(font-lock-add-keywords 'emacs-lisp-mode '("\\")) (defmacro table-put-source-info (prop value) "Register source generation information." @@ -1975,7 +1956,7 @@ is negative the cell becomes inactive, meaning that the cell becomes plain text and loses all the table specific features." (interactive "i\ni\np") (table--make-cell-map) - (if (or force (not (memq (table--get-last-command) table-command-list))) + (if (or force (not (memq real-last-command table-command-list))) (let* ((cell (table--probe-cell (called-interactively-p 'interactive))) (cache-buffer (get-buffer-create table-cache-buffer-name)) (modified-flag (buffer-modified-p)) @@ -3863,9 +3844,8 @@ converts a table into plain text without frames. It is a companion to (setq table-cell-map map) (fset 'table-cell-map map))) ;; Add menu for table cells. - (unless table-disable-menu - (easy-menu-define table-cell-menu-map table-cell-map - "Table cell menu" table-cell-menu)) + (easy-menu-define table-cell-menu-map table-cell-map + "Table cell menu" table-cell-menu) (run-hooks 'table-cell-map-hook)) ;; Create the keymap after running the user init file so that the user @@ -4056,16 +4036,15 @@ key binding (defun *table--present-cell-popup-menu (event) "Present and handle cell popup menu." (interactive "e") - (unless table-disable-menu - (select-window (posn-window (event-start event))) - (goto-char (posn-point (event-start event))) - (let ((item-list (x-popup-menu event table-cell-menu-map)) - (func table-cell-menu-map)) - (while item-list - (setq func (nth 3 (assoc (car item-list) func))) - (setq item-list (cdr item-list))) - (if (and (symbolp func) (fboundp func)) - (call-interactively func))))) + (select-window (posn-window (event-start event))) + (goto-char (posn-point (event-start event))) + (let ((item-list (x-popup-menu event table-cell-menu-map)) + (func table-cell-menu-map)) + (while item-list + (setq func (nth 3 (assoc (car item-list) func))) + (setq item-list (cdr item-list))) + (if (and (symbolp func) (fboundp func)) + (call-interactively func)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @@ -4086,9 +4065,10 @@ cache buffer into the designated cell in the table buffer." (and (boundp 'quail-translating) quail-translating)) (setq table-update-timer - (table--set-timer table-time-before-update - (function table--update-cell) - 'now)) + (run-with-idle-timer table-time-before-update + nil + (function table--update-cell) + 'now)) (save-current-buffer (set-buffer table-cell-buffer) (let ((cache-buffer (get-buffer-create table-cache-buffer-name)) @@ -4125,9 +4105,10 @@ cache buffer into the designated cell in the table buffer." (setq table-widen-timer nil)) (if (not now) (setq table-widen-timer - (table--set-timer (+ table-time-before-update table-time-before-reformat) - (function table--update-cell-widened) - 'now)) + (run-with-idle-timer (+ table-time-before-update table-time-before-reformat) + nil + (function table--update-cell-widened) + 'now)) (save-current-buffer (if table-update-timer (table--update-cell 'now)) @@ -4164,9 +4145,10 @@ cache buffer into the designated cell in the table buffer." (setq table-heighten-timer nil)) (if (not now) (setq table-heighten-timer - (table--set-timer (+ table-time-before-update table-time-before-reformat) - (function table--update-cell-heightened) - 'now)) + (run-with-idle-timer (+ table-time-before-update table-time-before-reformat) + nil + (function table--update-cell-heightened) + 'now)) (save-current-buffer (if table-update-timer (table--update-cell 'now)) @@ -4710,8 +4692,7 @@ in the list." (defun table--cell-insert-char (char &optional overwrite) "Insert CHAR inside a table cell." - (let ((delete-selection-p (and (boundp 'delete-selection-mode) - delete-selection-mode + (let ((delete-selection-p (and delete-selection-mode transient-mark-mode mark-active (not buffer-read-only))) (mark-coordinate (table--transcoord-table-to-cache (table--get-coordinate (mark t))))) @@ -5239,8 +5220,7 @@ This feature is disabled when `table-disable-incompatibility-warning' is non-nil. The warning is done only once per session for each item." (unless (and table-disable-incompatibility-warning (not (called-interactively-p 'interactive))) - (when (and (boundp 'flyspell-mode) - flyspell-mode + (when (and flyspell-mode (not (get 'table-disable-incompatibility-warning 'flyspell))) (put 'table-disable-incompatibility-warning 'flyspell t) (display-warning 'table @@ -5443,15 +5423,24 @@ It returns COLUMN unless STR contains some wide characters." idx nil))) + +;;;; Obsolete. + +(defvar table-disable-menu nil + "When non-nil, use of menu by table package is disabled. +It must be set before loading this package `table.el' for the first +time.") +(make-obsolete-variable 'table-disable-menu "no longer used." "28.1") + (defun table--set-timer (seconds func args) "Generic wrapper for setting up a timer." + (declare (obsolete run-with-idle-timer "28.1")) (run-with-idle-timer seconds nil func args)) (defun table--get-last-command () "Generic wrapper for getting the real last command." - (if (boundp 'real-last-command) - real-last-command - last-command)) + (declare (obsolete real-last-command "28.1")) + real-last-command) (run-hooks 'table-load-hook) commit 2b1cec559202d5985b7431ffce943bf4b019fb95 Author: Stefan Kangas Date: Wed Aug 26 17:25:53 2020 +0200 Sync latest SKK-JISYO.L * leim/SKK-DIC/SKK-JISYO.L: Sync to current upstream version. (cherry picked from commit 6a5f9700846551a7f3795e257356dbab865116f4) diff --git a/leim/SKK-DIC/SKK-JISYO.L b/leim/SKK-DIC/SKK-JISYO.L index 6b024e3dc4..9098868cae 100644 --- a/leim/SKK-DIC/SKK-JISYO.L +++ b/leim/SKK-DIC/SKK-JISYO.L @@ -22978,6 +22978,7 @@ covering / coverstory /Сȡ꡼/ coverup /Сå/ coverversion /СС/ +covid-19 /ʥ륹;Coronavirus disease 2019/ cow // cowbell /٥/ cowboy /ܡ/ @@ -38107,6 +38108,9 @@ sardine / sari /꡼// sarin // sarod //å/ +sars /severe acute respiratory syndrome/žɵƵ۴ɸ/ +sars-cov /severe acute respiratory syndrome coronavirus/SARSʥ륹 +sars-cov-2 /severe acute respiratory syndrome coronavirus 2/2019ʥ륹 sartre /ȥ/ saruman /ޥ/ sasa // commit 070c1f8cd76bb47150ff6dee2c2a9672c9c1f750 Author: Stefan Kangas Date: Sun Oct 11 15:03:11 2020 +0200 Update publicsuffix.txt from upstream * etc/publicsuffix.txt: Update from https://publicsuffix.org/list/public_suffix_list.dat dated 2020-10-09 08:23:34 UTC. (cherry picked from commit 5b13afab0a903ead8363482529019d4fb80ec4b4) diff --git a/etc/publicsuffix.txt b/etc/publicsuffix.txt index ee0269c3a2..bcde6728b5 100644 --- a/etc/publicsuffix.txt +++ b/etc/publicsuffix.txt @@ -1,10 +1,15 @@ // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +// Please pull this list from, and only from https://publicsuffix.org/list/public_suffix_list.dat, +// rather than any other VCS sites. Pulling from any other URL is not guaranteed to be supported. + +// Instructions on pulling and using this list can be found at https://publicsuffix.org/list/. // ===BEGIN ICANN DOMAINS=== -// ac : http://en.wikipedia.org/wiki/.ac +// ac : https://en.wikipedia.org/wiki/.ac ac com.ac edu.ac @@ -13,11 +18,11 @@ net.ac mil.ac org.ac -// ad : http://en.wikipedia.org/wiki/.ad +// ad : https://en.wikipedia.org/wiki/.ad ad nom.ad -// ae : http://en.wikipedia.org/wiki/.ae +// ae : https://en.wikipedia.org/wiki/.ae // see also: "Domain Name Eligibility Policy" at http://www.aeda.ae/eng/aepolicy.php ae co.ae @@ -28,7 +33,7 @@ ac.ae gov.ae mil.ae -// aero : see http://www.information.aero/index.php?id=66 +// aero : see https://www.information.aero/index.php?id=66 aero accident-investigation.aero accident-prevention.aero @@ -74,7 +79,6 @@ exchange.aero express.aero federation.aero flight.aero -freight.aero fuel.aero gliding.aero government.aero @@ -150,10 +154,15 @@ mil.al net.al org.al -// am : http://en.wikipedia.org/wiki/.am +// am : https://www.amnic.net/policy/en/Policy_EN.pdf am +co.am +com.am +commune.am +net.am +org.am -// ao : http://en.wikipedia.org/wiki/.ao +// ao : https://en.wikipedia.org/wiki/.ao // http://www.dns.ao/REGISTR.DOC ao ed.ao @@ -163,10 +172,10 @@ co.ao pb.ao it.ao -// aq : http://en.wikipedia.org/wiki/.aq +// aq : https://en.wikipedia.org/wiki/.aq aq -// ar : https://nic.ar/normativa-vigente.xhtml +// ar : https://nic.ar/nic-argentina/normativa-vigente ar com.ar edu.ar @@ -174,11 +183,12 @@ gob.ar gov.ar int.ar mil.ar +musica.ar net.ar org.ar tur.ar -// arpa : http://en.wikipedia.org/wiki/.arpa +// arpa : https://en.wikipedia.org/wiki/.arpa // Confirmed by registry 2008-06-18 arpa e164.arpa @@ -188,22 +198,23 @@ iris.arpa uri.arpa urn.arpa -// as : http://en.wikipedia.org/wiki/.as +// as : https://en.wikipedia.org/wiki/.as as gov.as -// asia : http://en.wikipedia.org/wiki/.asia +// asia : https://en.wikipedia.org/wiki/.asia asia -// at : http://en.wikipedia.org/wiki/.at +// at : https://en.wikipedia.org/wiki/.at // Confirmed by registry 2008-06-17 at ac.at co.at gv.at or.at +sth.ac.at -// au : http://en.wikipedia.org/wiki/.au +// au : https://en.wikipedia.org/wiki/.au // http://www.auda.org.au/ au // 2LDs @@ -229,6 +240,8 @@ vic.au wa.au // 3LDs act.edu.au +catholic.edu.au +// eq.edu.au - Removed at the request of the Queensland Department of Education nsw.edu.au nt.edu.au qld.edu.au @@ -244,15 +257,18 @@ sa.gov.au tas.gov.au vic.gov.au wa.gov.au +// 4LDs +// education.tas.edu.au - Removed at the request of the Department of Education Tasmania +schools.nsw.edu.au -// aw : http://en.wikipedia.org/wiki/.aw +// aw : https://en.wikipedia.org/wiki/.aw aw com.aw -// ax : http://en.wikipedia.org/wiki/.ax +// ax : https://en.wikipedia.org/wiki/.ax ax -// az : http://en.wikipedia.org/wiki/.az +// az : https://en.wikipedia.org/wiki/.az az com.az net.az @@ -267,20 +283,16 @@ name.az pro.az biz.az -// ba : http://en.wikipedia.org/wiki/.ba +// ba : http://nic.ba/users_data/files/pravilnik_o_registraciji.pdf ba -org.ba -net.ba +com.ba edu.ba gov.ba mil.ba -unsa.ba -unbi.ba -co.ba -com.ba -rs.ba +net.ba +org.ba -// bb : http://en.wikipedia.org/wiki/.bb +// bb : https://en.wikipedia.org/wiki/.bb bb biz.bb co.bb @@ -293,19 +305,19 @@ org.bb store.bb tv.bb -// bd : http://en.wikipedia.org/wiki/.bd +// bd : https://en.wikipedia.org/wiki/.bd *.bd -// be : http://en.wikipedia.org/wiki/.be +// be : https://en.wikipedia.org/wiki/.be // Confirmed by registry 2008-06-08 be ac.be -// bf : http://en.wikipedia.org/wiki/.bf +// bf : https://en.wikipedia.org/wiki/.bf bf gov.bf -// bg : http://en.wikipedia.org/wiki/.bg +// bg : https://en.wikipedia.org/wiki/.bg // https://www.register.bg/user/static/rules/en/index.html bg a.bg @@ -345,7 +357,7 @@ z.bg 8.bg 9.bg -// bh : http://en.wikipedia.org/wiki/.bh +// bh : https://en.wikipedia.org/wiki/.bh bh com.bh edu.bh @@ -353,7 +365,7 @@ net.bh org.bh gov.bh -// bi : http://en.wikipedia.org/wiki/.bi +// bi : https://en.wikipedia.org/wiki/.bi // http://whois.nic.bi/ bi co.bi @@ -362,10 +374,10 @@ edu.bi or.bi org.bi -// biz : http://en.wikipedia.org/wiki/.biz +// biz : https://en.wikipedia.org/wiki/.biz biz -// bj : http://en.wikipedia.org/wiki/.bj +// bj : https://en.wikipedia.org/wiki/.bj bj asso.bj barreau.bj @@ -379,91 +391,228 @@ gov.bm net.bm org.bm -// bn : http://en.wikipedia.org/wiki/.bn -*.bn +// bn : http://www.bnnic.bn/faqs +bn +com.bn +edu.bn +gov.bn +net.bn +org.bn -// bo : http://www.nic.bo/ +// bo : https://nic.bo/delegacion2015.php#h-1.10 bo com.bo edu.bo -gov.bo gob.bo int.bo org.bo net.bo mil.bo tv.bo +web.bo +// Social Domains +academia.bo +agro.bo +arte.bo +blog.bo +bolivia.bo +ciencia.bo +cooperativa.bo +democracia.bo +deporte.bo +ecologia.bo +economia.bo +empresa.bo +indigena.bo +industria.bo +info.bo +medicina.bo +movimiento.bo +musica.bo +natural.bo +nombre.bo +noticias.bo +patria.bo +politica.bo +profesional.bo +plurinacional.bo +pueblo.bo +revista.bo +salud.bo +tecnologia.bo +tksat.bo +transporte.bo +wiki.bo // br : http://registro.br/dominio/categoria.html // Submitted by registry br +9guacu.br +abc.br adm.br adv.br agr.br +aju.br am.br +anani.br +aparecida.br +app.br arq.br art.br ato.br b.br +barueri.br +belem.br +bhz.br +bib.br bio.br blog.br bmd.br +boavista.br +bsb.br +campinagrande.br +campinas.br +caxias.br cim.br cng.br cnt.br com.br +contagem.br coop.br +coz.br +cri.br +cuiaba.br +curitiba.br +def.br +des.br +det.br +dev.br ecn.br eco.br edu.br emp.br +enf.br eng.br esp.br etc.br eti.br far.br +feira.br flog.br +floripa.br fm.br fnd.br +fortal.br fot.br +foz.br fst.br g12.br +geo.br ggf.br +goiania.br gov.br +// gov.br 26 states + df https://en.wikipedia.org/wiki/States_of_Brazil +ac.gov.br +al.gov.br +am.gov.br +ap.gov.br +ba.gov.br +ce.gov.br +df.gov.br +es.gov.br +go.gov.br +ma.gov.br +mg.gov.br +ms.gov.br +mt.gov.br +pa.gov.br +pb.gov.br +pe.gov.br +pi.gov.br +pr.gov.br +rj.gov.br +rn.gov.br +ro.gov.br +rr.gov.br +rs.gov.br +sc.gov.br +se.gov.br +sp.gov.br +to.gov.br +gru.br imb.br ind.br inf.br +jab.br +jampa.br +jdf.br +joinville.br jor.br jus.br leg.br lel.br +log.br +londrina.br +macapa.br +maceio.br +manaus.br +maringa.br mat.br med.br mil.br +morena.br mp.br mus.br +natal.br net.br +niteroi.br *.nom.br not.br ntr.br odo.br +ong.br org.br +osasco.br +palmas.br +poa.br ppg.br pro.br psc.br psi.br +pvh.br qsl.br radio.br rec.br +recife.br +rep.br +ribeirao.br +rio.br +riobranco.br +riopreto.br +salvador.br +sampa.br +santamaria.br +santoandre.br +saobernardo.br +saogonca.br +seg.br +sjc.br slg.br +slz.br +sorocaba.br srv.br taxi.br +tc.br +tec.br teo.br +the.br tmp.br trd.br tur.br tv.br +udi.br vet.br +vix.br vlog.br wiki.br zlg.br @@ -476,7 +625,7 @@ org.bs edu.bs gov.bs -// bt : http://en.wikipedia.org/wiki/.bt +// bt : https://en.wikipedia.org/wiki/.bt bt com.bt edu.bt @@ -488,14 +637,14 @@ org.bt // Submitted by registry bv -// bw : http://en.wikipedia.org/wiki/.bw +// bw : https://en.wikipedia.org/wiki/.bw // http://www.gobin.info/domainname/bw.doc // list of other 2nd level tlds ? bw co.bw org.bw -// by : http://en.wikipedia.org/wiki/.by +// by : https://en.wikipedia.org/wiki/.by // http://tld.by/rules_2006_en.html // list of other 2nd level tlds ? by @@ -509,7 +658,7 @@ com.by // http://hoster.by/ of.by -// bz : http://en.wikipedia.org/wiki/.bz +// bz : https://en.wikipedia.org/wiki/.bz // http://www.belizenic.bz/ bz com.bz @@ -518,7 +667,7 @@ org.bz edu.bz gov.bz -// ca : http://en.wikipedia.org/wiki/.ca +// ca : https://en.wikipedia.org/wiki/.ca ca // ca geographical names ab.ca @@ -535,31 +684,31 @@ pe.ca qc.ca sk.ca yk.ca -// gc.ca: http://en.wikipedia.org/wiki/.gc.ca +// gc.ca: https://en.wikipedia.org/wiki/.gc.ca // see also: http://registry.gc.ca/en/SubdomainFAQ gc.ca -// cat : http://en.wikipedia.org/wiki/.cat +// cat : https://en.wikipedia.org/wiki/.cat cat -// cc : http://en.wikipedia.org/wiki/.cc +// cc : https://en.wikipedia.org/wiki/.cc cc -// cd : http://en.wikipedia.org/wiki/.cd +// cd : https://en.wikipedia.org/wiki/.cd // see also: https://www.nic.cd/domain/insertDomain_2.jsp?act=1 cd gov.cd -// cf : http://en.wikipedia.org/wiki/.cf +// cf : https://en.wikipedia.org/wiki/.cf cf -// cg : http://en.wikipedia.org/wiki/.cg +// cg : https://en.wikipedia.org/wiki/.cg cg -// ch : http://en.wikipedia.org/wiki/.ch +// ch : https://en.wikipedia.org/wiki/.ch ch -// ci : http://en.wikipedia.org/wiki/.ci +// ci : https://en.wikipedia.org/wiki/.ci // http://www.nic.ci/index.php?page=charte ci org.ci @@ -578,25 +727,27 @@ presse.ci md.ci gouv.ci -// ck : http://en.wikipedia.org/wiki/.ck +// ck : https://en.wikipedia.org/wiki/.ck *.ck !www.ck -// cl : http://en.wikipedia.org/wiki/.cl +// cl : https://www.nic.cl +// Confirmed by .CL registry cl -gov.cl -gob.cl +aprendemas.cl co.cl +gob.cl +gov.cl mil.cl -// cm : http://en.wikipedia.org/wiki/.cm plus bug 981927 +// cm : https://en.wikipedia.org/wiki/.cm plus bug 981927 cm co.cm com.cm gov.cm net.cm -// cn : http://en.wikipedia.org/wiki/.cn +// cn : https://en.wikipedia.org/wiki/.cn // Submitted by registry cn ac.cn @@ -645,7 +796,7 @@ hk.cn mo.cn tw.cn -// co : http://en.wikipedia.org/wiki/.co +// co : https://en.wikipedia.org/wiki/.co // Submitted by registry co arts.co @@ -662,10 +813,10 @@ org.co rec.co web.co -// com : http://en.wikipedia.org/wiki/.com +// com : https://en.wikipedia.org/wiki/.com com -// coop : http://en.wikipedia.org/wiki/.coop +// coop : https://en.wikipedia.org/wiki/.coop coop // cr : http://www.nic.cr/niccr_publico/showRegistroDominiosScreen.do @@ -678,7 +829,7 @@ go.cr or.cr sa.cr -// cu : http://en.wikipedia.org/wiki/.cu +// cu : https://en.wikipedia.org/wiki/.cu cu com.cu edu.cu @@ -687,7 +838,7 @@ net.cu gov.cu inf.cu -// cv : http://en.wikipedia.org/wiki/.cv +// cv : https://en.wikipedia.org/wiki/.cv cv // cw : http://www.una.cw/cw_registry/ @@ -698,12 +849,14 @@ edu.cw net.cw org.cw -// cx : http://en.wikipedia.org/wiki/.cx +// cx : https://en.wikipedia.org/wiki/.cx // list of other 2nd level tlds ? cx gov.cx -// cy : http://en.wikipedia.org/wiki/.cy +// cy : http://www.nic.cy/ +// Submitted by registry Panayiotou Fotia +cy ac.cy biz.cy com.cy @@ -718,22 +871,22 @@ press.cy pro.cy tm.cy -// cz : http://en.wikipedia.org/wiki/.cz +// cz : https://en.wikipedia.org/wiki/.cz cz -// de : http://en.wikipedia.org/wiki/.de +// de : https://en.wikipedia.org/wiki/.de // Confirmed by registry (with technical // reservations) 2008-07-01 de -// dj : http://en.wikipedia.org/wiki/.dj +// dj : https://en.wikipedia.org/wiki/.dj dj -// dk : http://en.wikipedia.org/wiki/.dk +// dk : https://en.wikipedia.org/wiki/.dk // Confirmed by registry 2008-06-17 dk -// dm : http://en.wikipedia.org/wiki/.dm +// dm : https://en.wikipedia.org/wiki/.dm dm com.dm net.dm @@ -741,7 +894,7 @@ org.dm edu.dm gov.dm -// do : http://en.wikipedia.org/wiki/.do +// do : https://en.wikipedia.org/wiki/.do do art.do com.do @@ -754,16 +907,18 @@ org.do sld.do web.do -// dz : http://en.wikipedia.org/wiki/.dz +// dz : http://www.nic.dz/images/pdf_nic/charte.pdf dz +art.dz +asso.dz com.dz +edu.dz +gov.dz org.dz net.dz -gov.dz -edu.dz -asso.dz pol.dz -art.dz +soc.dz +tm.dz // ec : http://www.nic.ec/reg/paso1.asp // Submitted by registry @@ -781,7 +936,7 @@ gov.ec gob.ec mil.ec -// edu : http://en.wikipedia.org/wiki/.edu +// edu : https://en.wikipedia.org/wiki/.edu edu // ee : http://www.eenet.ee/EENet/dom_reeglid.html#lisa_B @@ -797,7 +952,7 @@ aip.ee org.ee fie.ee -// eg : http://en.wikipedia.org/wiki/.eg +// eg : https://en.wikipedia.org/wiki/.eg eg com.eg edu.eg @@ -809,7 +964,7 @@ net.eg org.eg sci.eg -// er : http://en.wikipedia.org/wiki/.er +// er : https://en.wikipedia.org/wiki/.er *.er // es : https://www.nic.es/site_ingles/ingles/dominios/index.html @@ -820,7 +975,7 @@ org.es gob.es edu.es -// et : http://en.wikipedia.org/wiki/.et +// et : https://en.wikipedia.org/wiki/.et et com.et gov.et @@ -831,42 +986,56 @@ name.et info.et net.et -// eu : http://en.wikipedia.org/wiki/.eu +// eu : https://en.wikipedia.org/wiki/.eu eu -// fi : http://en.wikipedia.org/wiki/.fi +// fi : https://en.wikipedia.org/wiki/.fi fi -// aland.fi : http://en.wikipedia.org/wiki/.ax +// aland.fi : https://en.wikipedia.org/wiki/.ax // This domain is being phased out in favor of .ax. As there are still many // domains under aland.fi, we still keep it on the list until aland.fi is // completely removed. // TODO: Check for updates (expected to be phased out around Q1/2009) aland.fi -// fj : http://en.wikipedia.org/wiki/.fj -*.fj - -// fk : http://en.wikipedia.org/wiki/.fk +// fj : http://domains.fj/ +// Submitted by registry 2020-02-11 +fj +ac.fj +biz.fj +com.fj +gov.fj +info.fj +mil.fj +name.fj +net.fj +org.fj +pro.fj + +// fk : https://en.wikipedia.org/wiki/.fk *.fk -// fm : http://en.wikipedia.org/wiki/.fm +// fm : https://en.wikipedia.org/wiki/.fm +com.fm +edu.fm +net.fm +org.fm fm -// fo : http://en.wikipedia.org/wiki/.fo +// fo : https://en.wikipedia.org/wiki/.fo fo // fr : http://www.afnic.fr/ -// domaines descriptifs : http://www.afnic.fr/obtenir/chartes/nommage-fr/annexe-descriptifs +// domaines descriptifs : https://www.afnic.fr/medias/documents/Cadre_legal/Afnic_Naming_Policy_12122016_VEN.pdf fr -com.fr asso.fr +com.fr +gouv.fr nom.fr prd.fr -presse.fr tm.fr -// domaines sectoriels : http://www.afnic.fr/obtenir/chartes/nommage-fr/annexe-sectoriels +// domaines sectoriels : https://www.afnic.fr/en/products-and-services/the-fr-tld/sector-based-fr-domains-4.html aeroport.fr -assedic.fr avocat.fr avoues.fr cci.fr @@ -874,7 +1043,6 @@ chambagri.fr chirurgiens-dentistes.fr experts-comptables.fr geometre-expert.fr -gouv.fr greta.fr huissier-justice.fr medecin.fr @@ -883,14 +1051,16 @@ pharmacien.fr port.fr veterinaire.fr -// ga : http://en.wikipedia.org/wiki/.ga +// ga : https://en.wikipedia.org/wiki/.ga ga // gb : This registry is effectively dormant // Submitted by registry gb -// gd : http://en.wikipedia.org/wiki/.gd +// gd : https://en.wikipedia.org/wiki/.gd +edu.gd +gov.gd gd // ge : http://www.nic.net.ge/policy_en.pdf @@ -903,7 +1073,7 @@ mil.ge net.ge pvt.ge -// gf : http://en.wikipedia.org/wiki/.gf +// gf : https://en.wikipedia.org/wiki/.gf gf // gg : http://www.channelisles.net/register-domains/ @@ -913,7 +1083,7 @@ co.gg net.gg org.gg -// gh : http://en.wikipedia.org/wiki/.gh +// gh : https://en.wikipedia.org/wiki/.gh // see also: http://www.nic.gh/reg_now.php // Although domains directly at second level are not possible at the moment, // they have been possible for some time and may come back. @@ -933,7 +1103,7 @@ mod.gi edu.gi org.gi -// gl : http://en.wikipedia.org/wiki/.gl +// gl : https://en.wikipedia.org/wiki/.gl // http://nic.gl gl co.gl @@ -955,7 +1125,7 @@ gov.gn org.gn net.gn -// gov : http://en.wikipedia.org/wiki/.gov +// gov : https://en.wikipedia.org/wiki/.gov gov // gp : http://www.nic.gp/index.php?lang=en @@ -967,7 +1137,7 @@ edu.gp org.gp asso.gp -// gq : http://en.wikipedia.org/wiki/.gq +// gq : https://en.wikipedia.org/wiki/.gq gq // gr : https://grweb.ics.forth.gr/english/1617-B-2005.html @@ -979,7 +1149,7 @@ net.gr org.gr gov.gr -// gs : http://en.wikipedia.org/wiki/.gs +// gs : https://en.wikipedia.org/wiki/.gs gs // gt : http://www.gt/politicas_de_registro.html @@ -992,13 +1162,23 @@ mil.gt net.gt org.gt -// gu : http://gadao.gov.gu/registration.txt -*.gu - -// gw : http://en.wikipedia.org/wiki/.gw +// gu : http://gadao.gov.gu/register.html +// University of Guam : https://www.uog.edu +// Submitted by uognoc@triton.uog.edu +gu +com.gu +edu.gu +gov.gu +guam.gu +info.gu +net.gu +org.gu +web.gu + +// gw : https://en.wikipedia.org/wiki/.gw gw -// gy : http://en.wikipedia.org/wiki/.gy +// gy : https://en.wikipedia.org/wiki/.gy // http://registry.gy/ gy co.gy @@ -1008,7 +1188,7 @@ gov.gy net.gy org.gy -// hk : https://www.hkdnr.hk +// hk : https://www.hkirc.hk // Submitted by registry hk com.hk @@ -1033,7 +1213,7 @@ org.hk 組織.hk 組织.hk -// hm : http://en.wikipedia.org/wiki/.hm +// hm : https://en.wikipedia.org/wiki/.hm hm // hn : http://www.nic.hn/politicas/ps02,,05.html @@ -1107,7 +1287,7 @@ tozsde.hu utazas.hu video.hu -// id : https://register.pandi.or.id/ +// id : https://pandi.id/en/domain/registration-requirements/ id ac.id biz.id @@ -1118,10 +1298,11 @@ mil.id my.id net.id or.id +ponpes.id sch.id web.id -// ie : http://en.wikipedia.org/wiki/.ie +// ie : https://en.wikipedia.org/wiki/.ie ie gov.ie @@ -1149,7 +1330,7 @@ plc.co.im tt.im tv.im -// in : http://en.wikipedia.org/wiki/.in +// in : https://en.wikipedia.org/wiki/.in // see also: https://registry.in/Policies // Please note, that nic.in is not an official eTLD, but used by most // government institutions. @@ -1167,10 +1348,10 @@ res.in gov.in mil.in -// info : http://en.wikipedia.org/wiki/.info +// info : https://en.wikipedia.org/wiki/.info info -// int : http://en.wikipedia.org/wiki/.int +// int : https://en.wikipedia.org/wiki/.int // Confirmed by registry 2008-06-18 int eu.int @@ -1215,14 +1396,12 @@ gov.is org.is int.is -// it : http://en.wikipedia.org/wiki/.it +// it : https://en.wikipedia.org/wiki/.it it gov.it edu.it -// Reserved geo-names: -// http://www.nic.it/documenti/regolamenti-e-linee-guida/regolamento-assegnazione-versione-6.0.pdf -// There is also a list of reserved geo-names corresponding to Italian municipalities -// http://www.nic.it/documenti/appendice-c.pdf, but it is not included here. +// Reserved geo-names (regions and provinces): +// https://www.nic.it/sites/default/files/archivio/docs/Regulation_assignation_v7.1.pdf // Regions abr.it abruzzo.it @@ -1276,6 +1455,12 @@ sicily.it taa.it tos.it toscana.it +trentin-sud-tirol.it +trentin-süd-tirol.it +trentin-sudtirol.it +trentin-südtirol.it +trentin-sued-tirol.it +trentin-suedtirol.it trentino-a-adige.it trentino-aadige.it trentino-alto-adige.it @@ -1283,9 +1468,12 @@ trentino-altoadige.it trentino-s-tirol.it trentino-stirol.it trentino-sud-tirol.it +trentino-süd-tirol.it trentino-sudtirol.it +trentino-südtirol.it trentino-sued-tirol.it trentino-suedtirol.it +trentino.it trentinoa-adige.it trentinoaadige.it trentinoalto-adige.it @@ -1293,9 +1481,17 @@ trentinoaltoadige.it trentinos-tirol.it trentinostirol.it trentinosud-tirol.it +trentinosüd-tirol.it trentinosudtirol.it +trentinosüdtirol.it trentinosued-tirol.it trentinosuedtirol.it +trentinsud-tirol.it +trentinsüd-tirol.it +trentinsudtirol.it +trentinsüdtirol.it +trentinsued-tirol.it +trentinsuedtirol.it tuscany.it umb.it umbria.it @@ -1310,7 +1506,13 @@ valleaosta.it valled-aosta.it valledaosta.it vallee-aoste.it +vallée-aoste.it +vallee-d-aoste.it +vallée-d-aoste.it valleeaoste.it +valléeaoste.it +valleedaoste.it +valléedaoste.it vao.it vda.it ven.it @@ -1343,6 +1545,9 @@ at.it av.it avellino.it ba.it +balsan-sudtirol.it +balsan-südtirol.it +balsan-suedtirol.it balsan.it bari.it barletta-trani-andria.it @@ -1357,13 +1562,21 @@ bl.it bn.it bo.it bologna.it +bolzano-altoadige.it bolzano.it +bozen-sudtirol.it +bozen-südtirol.it +bozen-suedtirol.it bozen.it br.it brescia.it brindisi.it bs.it bt.it +bulsan-sudtirol.it +bulsan-südtirol.it +bulsan-suedtirol.it +bulsan.it bz.it ca.it cagliari.it @@ -1381,7 +1594,9 @@ catanzaro.it cb.it ce.it cesena-forli.it +cesena-forlì.it cesenaforli.it +cesenaforlì.it ch.it chieti.it ci.it @@ -1412,7 +1627,9 @@ florence.it fm.it foggia.it forli-cesena.it +forlì-cesena.it forlicesena.it +forlìcesena.it fr.it frosinone.it ge.it @@ -1543,6 +1760,7 @@ sp.it sr.it ss.it suedtirol.it +südtirol.it sv.it ta.it taranto.it @@ -1561,7 +1779,6 @@ trani-barletta-andria.it traniandriabarletta.it tranibarlettaandria.it trapani.it -trentino.it trento.it treviso.it trieste.it @@ -1613,10 +1830,10 @@ gov.jo mil.jo name.jo -// jobs : http://en.wikipedia.org/wiki/.jobs +// jobs : https://en.wikipedia.org/wiki/.jobs jobs -// jp : http://en.wikipedia.org/wiki/.jp +// jp : https://en.wikipedia.org/wiki/.jp // http://jprs.co.jp/en/jpdomain.html // Submitted by registry jp @@ -2545,11 +2762,8 @@ arao.kumamoto.jp aso.kumamoto.jp choyo.kumamoto.jp gyokuto.kumamoto.jp -hitoyoshi.kumamoto.jp kamiamakusa.kumamoto.jp -kashima.kumamoto.jp kikuchi.kumamoto.jp -kosa.kumamoto.jp kumamoto.kumamoto.jp mashiki.kumamoto.jp mifune.kumamoto.jp @@ -2634,7 +2848,6 @@ iwanuma.miyagi.jp kakuda.miyagi.jp kami.miyagi.jp kawasaki.miyagi.jp -kesennuma.miyagi.jp marumori.miyagi.jp matsushima.miyagi.jp minamisanriku.miyagi.jp @@ -3420,8 +3633,17 @@ uenohara.yamanashi.jp yamanakako.yamanashi.jp yamanashi.yamanashi.jp -// ke : http://www.kenic.or.ke/index.php?option=com_content&task=view&id=117&Itemid=145 -*.ke +// ke : http://www.kenic.or.ke/index.php/en/ke-domains/ke-domains +ke +ac.ke +co.ke +go.ke +info.ke +me.ke +mobi.ke +ne.ke +or.ke +sc.ke // kg : http://www.domain.kg/dmn_n.html kg @@ -3445,7 +3667,7 @@ gov.ki info.ki com.ki -// km : http://en.wikipedia.org/wiki/.km +// km : https://en.wikipedia.org/wiki/.km // http://www.domaine.km/documents/charte.doc km org.km @@ -3458,7 +3680,7 @@ mil.km ass.km com.km // These are only mentioned as proposed suggestions at domaine.km, but -// http://en.wikipedia.org/wiki/.km says they're available for registration: +// https://en.wikipedia.org/wiki/.km says they're available for registration: coop.km asso.km presse.km @@ -3468,7 +3690,7 @@ pharmaciens.km veterinaire.km gouv.km -// kn : http://en.wikipedia.org/wiki/.kn +// kn : https://en.wikipedia.org/wiki/.kn // http://www.dot.kn/domainRules.html kn net.kn @@ -3485,7 +3707,7 @@ org.kp rep.kp tra.kp -// kr : http://en.wikipedia.org/wiki/.kr +// kr : https://en.wikipedia.org/wiki/.kr // see also: http://domain.nida.or.kr/eng/registration.jsp kr ac.kr @@ -3519,8 +3741,16 @@ jeonnam.kr seoul.kr ulsan.kr -// kw : http://en.wikipedia.org/wiki/.kw -*.kw +// kw : https://www.nic.kw/policies/ +// Confirmed by registry +kw +com.kw +edu.kw +emb.kw +gov.kw +ind.kw +net.kw +org.kw // ky : http://www.icta.ky/da_ky_reg_dom.php // Confirmed by registry 2008-06-17 @@ -3531,7 +3761,7 @@ com.ky org.ky net.ky -// kz : http://en.wikipedia.org/wiki/.kz +// kz : https://en.wikipedia.org/wiki/.kz // see also: http://www.nic.kz/rules/index.jsp kz org.kz @@ -3541,7 +3771,7 @@ gov.kz mil.kz com.kz -// la : http://en.wikipedia.org/wiki/.la +// la : https://en.wikipedia.org/wiki/.la // Submitted by registry la int.la @@ -3553,7 +3783,7 @@ per.la com.la org.la -// lb : http://en.wikipedia.org/wiki/.lb +// lb : https://en.wikipedia.org/wiki/.lb // Submitted by registry lb com.lb @@ -3562,7 +3792,7 @@ gov.lb net.lb org.lb -// lc : http://en.wikipedia.org/wiki/.lc +// lc : https://en.wikipedia.org/wiki/.lc // see also: http://www.nic.lc/rules.htm lc com.lc @@ -3572,10 +3802,10 @@ org.lc edu.lc gov.lc -// li : http://en.wikipedia.org/wiki/.li +// li : https://en.wikipedia.org/wiki/.li li -// lk : http://www.nic.lk/seclevpr.html +// lk : https://www.nic.lk/index.php/domain-registration/lk-domain-naming-structure lk gov.lk sch.lk @@ -3602,12 +3832,20 @@ gov.lr org.lr net.lr -// ls : http://en.wikipedia.org/wiki/.ls +// ls : http://www.nic.ls/ +// Confirmed by registry ls +ac.ls +biz.ls co.ls +edu.ls +gov.ls +info.ls +net.ls org.ls +sc.ls -// lt : http://en.wikipedia.org/wiki/.lt +// lt : https://en.wikipedia.org/wiki/.lt lt // gov.lt : http://www.gov.lt/index_en.php gov.lt @@ -3639,7 +3877,7 @@ med.ly org.ly id.ly -// ma : http://en.wikipedia.org/wiki/.ma +// ma : https://en.wikipedia.org/wiki/.ma // http://www.anrt.ma/fr/admin/download/upload/file_fr782.pdf ma co.ma @@ -3654,10 +3892,10 @@ mc tm.mc asso.mc -// md : http://en.wikipedia.org/wiki/.md +// md : https://en.wikipedia.org/wiki/.md md -// me : http://en.wikipedia.org/wiki/.me +// me : https://en.wikipedia.org/wiki/.me me co.me net.me @@ -3680,13 +3918,13 @@ mil.mg com.mg co.mg -// mh : http://en.wikipedia.org/wiki/.mh +// mh : https://en.wikipedia.org/wiki/.mh mh -// mil : http://en.wikipedia.org/wiki/.mil +// mil : https://en.wikipedia.org/wiki/.mil mil -// mk : http://en.wikipedia.org/wiki/.mk +// mk : https://en.wikipedia.org/wiki/.mk // see also: http://dns.marnet.net.mk/postapka.php mk com.mk @@ -3698,7 +3936,7 @@ inf.mk name.mk // ml : http://www.gobin.info/domainname/ml-template.doc -// see also: http://en.wikipedia.org/wiki/.ml +// see also: https://en.wikipedia.org/wiki/.ml ml com.ml edu.ml @@ -3708,10 +3946,10 @@ net.ml org.ml presse.ml -// mm : http://en.wikipedia.org/wiki/.mm +// mm : https://en.wikipedia.org/wiki/.mm *.mm -// mn : http://en.wikipedia.org/wiki/.mn +// mn : https://en.wikipedia.org/wiki/.mn mn gov.mn edu.mn @@ -3725,17 +3963,17 @@ org.mo edu.mo gov.mo -// mobi : http://en.wikipedia.org/wiki/.mobi +// mobi : https://en.wikipedia.org/wiki/.mobi mobi // mp : http://www.dot.mp/ // Confirmed by registry 2008-06-17 mp -// mq : http://en.wikipedia.org/wiki/.mq +// mq : https://en.wikipedia.org/wiki/.mq mq -// mr : http://en.wikipedia.org/wiki/.mr +// mr : https://en.wikipedia.org/wiki/.mr mr gov.mr @@ -3755,7 +3993,7 @@ edu.mt net.mt org.mt -// mu : http://en.wikipedia.org/wiki/.mu +// mu : https://en.wikipedia.org/wiki/.mu mu com.mu net.mu @@ -4134,8 +4372,6 @@ niepce.museum norfolk.museum north.museum nrw.museum -nuernberg.museum -nuremberg.museum nyc.museum nyny.museum oceanographic.museum @@ -4317,7 +4553,7 @@ zoology.museum ירושלים.museum иком.museum -// mv : http://en.wikipedia.org/wiki/.mv +// mv : https://en.wikipedia.org/wiki/.mv // "mv" included because, contra Wikipedia, google.mv exists. mv aero.mv @@ -4368,9 +4604,17 @@ edu.my mil.my name.my -// mz : http://www.gobin.info/domainname/mz-template.doc -*.mz -!teledata.mz +// mz : http://www.uem.mz/ +// Submitted by registry +mz +ac.mz +adv.mz +co.mz +edu.mz +gov.mz +mil.mz +net.mz +org.mz // na : http://www.na-nic.com.na/ // http://www.info.na/domain/ @@ -4399,14 +4643,15 @@ name // nc : http://www.cctld.nc/ nc asso.nc +nom.nc -// ne : http://en.wikipedia.org/wiki/.ne +// ne : https://en.wikipedia.org/wiki/.ne ne -// net : http://en.wikipedia.org/wiki/.net +// net : https://en.wikipedia.org/wiki/.net net -// nf : http://en.wikipedia.org/wiki/.nf +// nf : https://en.wikipedia.org/wiki/.nf nf com.nf net.nf @@ -4433,36 +4678,33 @@ org.ng sch.ng // ni : http://www.nic.ni/ +ni +ac.ni +biz.ni +co.ni com.ni -gob.ni edu.ni -org.ni -nom.ni -net.ni -mil.ni -co.ni -biz.ni -web.ni -int.ni -ac.ni +gob.ni in.ni info.ni +int.ni +mil.ni +net.ni +nom.ni +org.ni +web.ni -// nl : http://en.wikipedia.org/wiki/.nl +// nl : https://en.wikipedia.org/wiki/.nl // https://www.sidn.nl/ // ccTLD for the Netherlands nl -// BV.nl will be a registry for dutch BV's (besloten vennootschap) -bv.nl - -// no : http://www.norid.no/regelverk/index.en.html -// The Norwegian registry has declined to notify us of updates. The web pages -// referenced below are the official source of the data. There is also an -// announce mailing list: -// https://postlister.uninett.no/sympa/info/norid-diskusjon +// no : https://www.norid.no/en/om-domenenavn/regelverk-for-no/ +// Norid geographical second level domains : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-b/ +// Norid category second level domains : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-c/ +// Norid category second-level domains managed by parties other than Norid : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-d/ no -// Norid generic domains : http://www.norid.no/regelverk/vedlegg-c.en.html +// Norid category second level domains : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-c/ fhs.no vgs.no fylkesbibl.no @@ -4470,13 +4712,13 @@ folkebibl.no museum.no idrett.no priv.no -// Non-Norid generic domains : http://www.norid.no/regelverk/vedlegg-d.en.html +// Norid category second-level domains managed by parties other than Norid : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-d/ mil.no stat.no dep.no kommune.no herad.no -// no geographical names : http://www.norid.no/regelverk/vedlegg-b.en.html +// Norid geographical second level domains : https://www.norid.no/en/om-domenenavn/regelverk-for-no/vedlegg-b/ // counties aa.no ah.no @@ -5237,10 +5479,10 @@ org.nr net.nr com.nr -// nu : http://en.wikipedia.org/wiki/.nu +// nu : https://en.wikipedia.org/wiki/.nu nu -// nz : http://en.wikipedia.org/wiki/.nz +// nz : https://en.wikipedia.org/wiki/.nz // Submitted by registry nz ac.nz @@ -5260,7 +5502,7 @@ org.nz parliament.nz school.nz -// om : http://en.wikipedia.org/wiki/.om +// om : https://en.wikipedia.org/wiki/.om om co.om com.om @@ -5272,7 +5514,10 @@ net.om org.om pro.om -// org : http://en.wikipedia.org/wiki/.org +// onion : https://tools.ietf.org/html/rfc7686 +onion + +// org : https://en.wikipedia.org/wiki/.org org // pa : http://www.nic.pa/ @@ -5307,7 +5552,7 @@ com.pf org.pf edu.pf -// pg : http://en.wikipedia.org/wiki/.pg +// pg : https://en.wikipedia.org/wiki/.pg *.pg // ph : http://www.domains.ph/FAQ2.asp @@ -5557,7 +5802,7 @@ org.pn edu.pn net.pn -// post : http://en.wikipedia.org/wiki/.post +// post : https://en.wikipedia.org/wiki/.post post // pr : http://www.nic.pr/index.asp?f=1 @@ -5572,22 +5817,26 @@ pro.pr biz.pr info.pr name.pr -// these aren't mentioned on nic.pr, but on http://en.wikipedia.org/wiki/.pr +// these aren't mentioned on nic.pr, but on https://en.wikipedia.org/wiki/.pr est.pr prof.pr ac.pr -// pro : http://www.nic.pro/support_faq.htm +// pro : http://registry.pro/get-pro pro +aaa.pro aca.pro +acct.pro +avocat.pro bar.pro cpa.pro +eng.pro jur.pro law.pro med.pro -eng.pro +recht.pro -// ps : http://en.wikipedia.org/wiki/.ps +// ps : https://en.wikipedia.org/wiki/.ps // http://www.nic.ps/registration/policy.html#reg ps edu.ps @@ -5609,7 +5858,7 @@ publ.pt com.pt nome.pt -// pw : http://en.wikipedia.org/wiki/.pw +// pw : https://en.wikipedia.org/wiki/.pw pw co.pw ne.pw @@ -5669,156 +5918,19 @@ gov.rs in.rs org.rs -// ru : http://www.cctld.ru/ru/docs/aktiv_8.php -// Industry domains +// ru : https://cctld.ru/files/pdf/docs/en/rules_ru-rf.pdf +// Submitted by George Georgievsky ru -ac.ru -com.ru -edu.ru -int.ru -net.ru -org.ru -pp.ru -// Geographical domains -adygeya.ru -altai.ru -amur.ru -arkhangelsk.ru -astrakhan.ru -bashkiria.ru -belgorod.ru -bir.ru -bryansk.ru -buryatia.ru -cbg.ru -chel.ru -chelyabinsk.ru -chita.ru -chukotka.ru -chuvashia.ru -dagestan.ru -dudinka.ru -e-burg.ru -grozny.ru -irkutsk.ru -ivanovo.ru -izhevsk.ru -jar.ru -joshkar-ola.ru -kalmykia.ru -kaluga.ru -kamchatka.ru -karelia.ru -kazan.ru -kchr.ru -kemerovo.ru -khabarovsk.ru -khakassia.ru -khv.ru -kirov.ru -koenig.ru -komi.ru -kostroma.ru -krasnoyarsk.ru -kuban.ru -kurgan.ru -kursk.ru -lipetsk.ru -magadan.ru -mari.ru -mari-el.ru -marine.ru -mordovia.ru -// mosreg.ru Bug 1090800 - removed at request of Aleksey Konstantinov -msk.ru -murmansk.ru -nalchik.ru -nnov.ru -nov.ru -novosibirsk.ru -nsk.ru -omsk.ru -orenburg.ru -oryol.ru -palana.ru -penza.ru -perm.ru -ptz.ru -rnd.ru -ryazan.ru -sakhalin.ru -samara.ru -saratov.ru -simbirsk.ru -smolensk.ru -spb.ru -stavropol.ru -stv.ru -surgut.ru -tambov.ru -tatarstan.ru -tom.ru -tomsk.ru -tsaritsyn.ru -tsk.ru -tula.ru -tuva.ru -tver.ru -tyumen.ru -udm.ru -udmurtia.ru -ulan-ude.ru -vladikavkaz.ru -vladimir.ru -vladivostok.ru -volgograd.ru -vologda.ru -voronezh.ru -vrn.ru -vyatka.ru -yakutia.ru -yamal.ru -yaroslavl.ru -yekaterinburg.ru -yuzhno-sakhalinsk.ru -// More geographical domains -amursk.ru -baikal.ru -cmw.ru -fareast.ru -jamal.ru -kms.ru -k-uralsk.ru -kustanai.ru -kuzbass.ru -mytis.ru -nakhodka.ru -nkz.ru -norilsk.ru -oskol.ru -pyatigorsk.ru -rubtsovsk.ru -snz.ru -syzran.ru -vdonsk.ru -zgrad.ru -// State domains -gov.ru -mil.ru -// Technical domains -test.ru -// rw : http://www.nic.rw/cgi-bin/policy.pl +// rw : https://www.ricta.org.rw/sites/default/files/resources/registry_registrar_contract_0.pdf rw -gov.rw -net.rw -edu.rw ac.rw -com.rw co.rw -int.rw +coop.rw +gov.rw mil.rw -gouv.rw +net.rw +org.rw // sa : http://www.nic.net.sa/ sa @@ -5860,7 +5972,7 @@ tv.sd gov.sd info.sd -// se : http://en.wikipedia.org/wiki/.se +// se : https://en.wikipedia.org/wiki/.se // Submitted by registry se a.se @@ -5920,14 +6032,14 @@ gov.sh org.sh mil.sh -// si : http://en.wikipedia.org/wiki/.si +// si : https://en.wikipedia.org/wiki/.si si // sj : No registrations at this time. // Submitted by registry sj -// sk : http://en.wikipedia.org/wiki/.sk +// sk : https://en.wikipedia.org/wiki/.sk // list of 2nd level domains ? sk @@ -5940,10 +6052,10 @@ edu.sl gov.sl org.sl -// sm : http://en.wikipedia.org/wiki/.sm +// sm : https://en.wikipedia.org/wiki/.sm sm -// sn : http://en.wikipedia.org/wiki/.sn +// sn : https://en.wikipedia.org/wiki/.sn sn art.sn com.sn @@ -5953,15 +6065,28 @@ org.sn perso.sn univ.sn -// so : http://www.soregistry.com/ +// so : http://sonic.so/policies/ so com.so +edu.so +gov.so +me.so net.so org.so -// sr : http://en.wikipedia.org/wiki/.sr +// sr : https://en.wikipedia.org/wiki/.sr sr +// ss : https://registry.nic.ss/ +// Submitted by registry +ss +biz.ss +com.ss +edu.ss +gov.ss +net.ss +org.ss + // st : http://www.nic.st/html/policyrules/ st co.st @@ -5977,40 +6102,8 @@ principe.st saotome.st store.st -// su : http://en.wikipedia.org/wiki/.su +// su : https://en.wikipedia.org/wiki/.su su -adygeya.su -arkhangelsk.su -balashov.su -bashkiria.su -bryansk.su -dagestan.su -grozny.su -ivanovo.su -kalmykia.su -kaluga.su -karelia.su -khakassia.su -krasnodar.su -kurgan.su -lenug.su -mordovia.su -msk.su -murmansk.su -nalchik.su -nov.su -obninsk.su -penza.su -pokrovsk.su -sochi.su -spb.su -togliatti.su -troitsk.su -tula.su -tuva.su -vladikavkaz.su -vladimir.su -vologda.su // sv : http://www.svnet.org.sv/niveldos.pdf sv @@ -6020,12 +6113,12 @@ gob.sv org.sv red.sv -// sx : http://en.wikipedia.org/wiki/.sx +// sx : https://en.wikipedia.org/wiki/.sx // Submitted by registry sx gov.sx -// sy : http://en.wikipedia.org/wiki/.sy +// sy : https://en.wikipedia.org/wiki/.sy // see also: http://www.gobin.info/domainname/sy.doc sy edu.sy @@ -6035,31 +6128,31 @@ mil.sy com.sy org.sy -// sz : http://en.wikipedia.org/wiki/.sz +// sz : https://en.wikipedia.org/wiki/.sz // http://www.sispa.org.sz/ sz co.sz ac.sz org.sz -// tc : http://en.wikipedia.org/wiki/.tc +// tc : https://en.wikipedia.org/wiki/.tc tc -// td : http://en.wikipedia.org/wiki/.td +// td : https://en.wikipedia.org/wiki/.td td -// tel: http://en.wikipedia.org/wiki/.tel +// tel: https://en.wikipedia.org/wiki/.tel // http://www.telnic.org/ tel -// tf : http://en.wikipedia.org/wiki/.tf +// tf : https://en.wikipedia.org/wiki/.tf tf -// tg : http://en.wikipedia.org/wiki/.tg +// tg : https://en.wikipedia.org/wiki/.tg // http://www.nic.tg/ tg -// th : http://en.wikipedia.org/wiki/.th +// th : https://en.wikipedia.org/wiki/.th // Submitted by registry th ac.th @@ -6088,10 +6181,10 @@ org.tj test.tj web.tj -// tk : http://en.wikipedia.org/wiki/.tk +// tk : https://en.wikipedia.org/wiki/.tk tk -// tl : http://en.wikipedia.org/wiki/.tl +// tl : https://en.wikipedia.org/wiki/.tl tl gov.tl @@ -6106,7 +6199,7 @@ gov.tm mil.tm edu.tm -// tn : http://en.wikipedia.org/wiki/.tn +// tn : https://en.wikipedia.org/wiki/.tn // http://whois.ati.tn/ tn com.tn @@ -6130,7 +6223,7 @@ agrinet.tn defense.tn turen.tn -// to : http://en.wikipedia.org/wiki/.to +// to : https://en.wikipedia.org/wiki/.to // Submitted by registry to com.to @@ -6140,40 +6233,36 @@ org.to edu.to mil.to -// subTLDs: https://www.nic.tr/forms/eng/policies.pdf -// and: https://www.nic.tr/forms/politikalar.pdf -// Submitted by +// tr : https://nic.tr/ +// https://nic.tr/forms/eng/policies.pdf +// https://nic.tr/index.php?USRACTN=PRICELST tr -com.tr -info.tr -biz.tr -net.tr -org.tr -web.tr -gen.tr -tv.tr av.tr -dr.tr bbs.tr -name.tr -tel.tr -gov.tr bel.tr -pol.tr +biz.tr +com.tr +dr.tr +edu.tr +gen.tr +gov.tr +info.tr mil.tr k12.tr -edu.tr kep.tr - +name.tr +net.tr +org.tr +pol.tr +tel.tr +tsk.tr +tv.tr +web.tr // Used by Northern Cyprus nc.tr - // Used by government agencies of Northern Cyprus gov.nc.tr -// travel : http://en.wikipedia.org/wiki/.travel -travel - // tt : http://www.nic.tt/ tt co.tt @@ -6194,12 +6283,12 @@ name.tt gov.tt edu.tt -// tv : http://en.wikipedia.org/wiki/.tv +// tv : https://en.wikipedia.org/wiki/.tv // Not listing any 2LDs as reserved since none seem to exist in practice, // Wikipedia notwithstanding. tv -// tw : http://en.wikipedia.org/wiki/.tw +// tw : https://en.wikipedia.org/wiki/.tw tw edu.tw gov.tw @@ -6257,7 +6346,6 @@ cv.ua dn.ua dnepropetrovsk.ua dnipropetrovsk.ua -dominic.ua donetsk.ua dp.ua if.ua @@ -6325,7 +6413,7 @@ ne.ug com.ug org.ug -// uk : http://en.wikipedia.org/wiki/.uk +// uk : https://en.wikipedia.org/wiki/.uk // Submitted by registry uk ac.uk @@ -6340,7 +6428,7 @@ plc.uk police.uk *.sch.uk -// us : http://en.wikipedia.org/wiki/.us +// us : https://en.wikipedia.org/wiki/.us us dni.us fed.us @@ -6451,7 +6539,7 @@ k12.ok.us k12.or.us k12.pa.us k12.pr.us -k12.ri.us +// k12.ri.us Removed at request of Kim Cournoyer k12.sc.us // k12.sd.us Bug 934131 - Removed at request of James Booze k12.tn.us @@ -6528,7 +6616,7 @@ lib.ca.us lib.co.us lib.ct.us lib.dc.us -lib.de.us +// lib.de.us Issue #243 - Moved to Private section at request of Ed Moore lib.fl.us lib.ga.us lib.gu.us @@ -6581,6 +6669,17 @@ lib.wy.us pvt.k12.ma.us chtr.k12.ma.us paroch.k12.ma.us +// Merit Network, Inc. maintains the registry for =~ /(k12|cc|lib).mi.us/ and the following +// see also: http://domreg.merit.edu +// see also: whois -h whois.domreg.merit.edu help +ann-arbor.mi.us +cog.mi.us +dst.mi.us +eaton.mi.us +gen.mi.us +mus.mi.us +tec.mi.us +washtenaw.mi.us // uy : http://www.nic.org.uy/ uy @@ -6598,10 +6697,10 @@ com.uz net.uz org.uz -// va : http://en.wikipedia.org/wiki/.va +// va : https://en.wikipedia.org/wiki/.va va -// vc : http://en.wikipedia.org/wiki/.vc +// vc : https://en.wikipedia.org/wiki/.vc // Submitted by registry vc com.vc @@ -6632,7 +6731,7 @@ store.ve tec.ve web.ve -// vg : http://en.wikipedia.org/wiki/.vg +// vg : https://en.wikipedia.org/wiki/.vg vg // vi : http://www.nic.vi/newdomainform.htm @@ -6661,7 +6760,7 @@ name.vn pro.vn health.vn -// vu : http://en.wikipedia.org/wiki/.vu +// vu : https://en.wikipedia.org/wiki/.vu // http://www.vunic.vu/ vu com.vu @@ -6672,7 +6771,7 @@ org.vu // wf : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf wf -// ws : http://en.wikipedia.org/wiki/.ws +// ws : https://en.wikipedia.org/wiki/.ws // http://samoanic.ws/index.dhtml ws com.ws @@ -6702,6 +6801,9 @@ yt // xn--54b7fta0cc ("Bangla", Bangla) : BD বাংলা +// xn--90ae ("bg", Bulgarian) : BG +бг + // xn--90ais ("bel", Belarusian/Russian Cyrillic) : BY // Operated by .by registry бел @@ -6723,6 +6825,17 @@ yt // http://www.dotmasr.eg/ مصر +// xn--e1a4c ("eu", Cyrillic) : EU +// https://eurid.eu +ею + +// xn--qxa6a ("eu", Greek) : EU +// https://eurid.eu +ευ + +// xn--mgbah1a3hjkrd ("Mauritania", Arabic) : MR +موريتانيا + // xn--node ("ge", Georgian Mkhedruli) : GE გე @@ -6731,13 +6844,53 @@ yt ελ // xn--j6w193g ("Hong Kong", Chinese) : HK -// https://www2.hkirc.hk/register/rules.jsp +// https://www.hkirc.hk +// Submitted by registry +// https://www.hkirc.hk/content.jsp?id=30#!/34 香港 +公司.香港 +教育.香港 +政府.香港 +個人.香港 +網絡.香港 +組織.香港 + +// xn--2scrj9c ("Bharat", Kannada) : IN +// India +ಭಾರತ + +// xn--3hcrj9c ("Bharat", Oriya) : IN +// India +ଭାରତ + +// xn--45br5cyl ("Bharatam", Assamese) : IN +// India +ভাৰত + +// xn--h2breg3eve ("Bharatam", Sanskrit) : IN +// India +भारतम् + +// xn--h2brj9c8c ("Bharot", Santali) : IN +// India +भारोत + +// xn--mgbgu82a ("Bharat", Sindhi) : IN +// India +ڀارت + +// xn--rvc1e0am3e ("Bharatam", Malayalam) : IN +// India +ഭാരതം // xn--h2brj9c ("Bharat", Devanagari) : IN // India भारत +// xn--mgbbh1a ("Bharat", Kashmiri) : IN +// India +بارت + // xn--mgbbh1a71e ("Bharat", Arabic) : IN // India بھارت @@ -6784,11 +6937,11 @@ yt қаз // xn--fzc2c9e2c ("Lanka", Sinhalese-Sinhala) : LK -// http://nic.lk +// https://nic.lk ලංකා // xn--xkc2al3hye2a ("Ilangai", Tamil) : LK -// http://nic.lk +// https://nic.lk இலங்கை // xn--mgbc0a9azcg ("Morocco/al-Maghrib", Arabic) : MA @@ -6836,7 +6989,8 @@ yt ак.срб // xn--p1ai ("rf", Russian-Cyrillic) : RU -// http://www.cctld.ru/en/docs/rulesrf.php +// https://cctld.ru/files/pdf/docs/en/rules_ru-rf.pdf +// Submitted by George Georgievsky рф // xn--wgbl6a ("Qatar", Arabic) : QA @@ -6875,6 +7029,12 @@ yt // xn--o3cw4h ("Thai", Thai) : TH // http://www.thnic.co.th ไทย +ศึกษา.ไทย +ธุรกิจ.ไทย +รัฐบาล.ไทย +ทหาร.ไทย +เน็ต.ไทย +องค์กร.ไทย // xn--pgbs0dh ("Tunisia", Arabic) : TN // http://nic.tn @@ -6903,7 +7063,7 @@ xxx // ye : http://www.y.net.ye/services/domain_name.htm *.ye -// za : http://www.zadna.org.za/content/page/domain-information +// za : https://www.zadna.org.za/content/page/domain-information/ ac.za agric.za alt.za @@ -6915,6 +7075,7 @@ law.za mil.za net.za ngo.za +nic.za nis.za nom.za org.za @@ -6922,15 +7083,35 @@ school.za tm.za web.za -// zm : http://en.wikipedia.org/wiki/.zm -*.zm - -// zw : http://en.wikipedia.org/wiki/.zw -*.zw - - -// List of new gTLDs imported from https://newgtlds.icann.org/newgtlds.csv on 2016-01-04T22:39:54Z - +// zm : https://zicta.zm/ +// Submitted by registry +zm +ac.zm +biz.zm +co.zm +com.zm +edu.zm +gov.zm +info.zm +mil.zm +net.zm +org.zm +sch.zm + +// zw : https://www.potraz.gov.zw/ +// Confirmed by registry 2017-01-25 +zw +ac.zw +co.zw +gov.zw +mil.zw +org.zw + + +// newGTLDs + +// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2020-10-08T17:45:32Z +// This list is auto-generated, don't edit it manually. // aaa : 2015-02-26 American Automobile Association, Inc. aaa @@ -6955,13 +7136,13 @@ abc // able : 2015-06-25 Able Inc. able -// abogado : 2014-04-24 Top Level Domain Holdings Limited +// abogado : 2014-04-24 Minds + Machines Group Limited abogado // abudhabi : 2015-07-30 Abu Dhabi Systems and Information Centre abudhabi -// academy : 2013-11-07 Half Oaks, LLC +// academy : 2013-11-07 Binky Moon, LLC academy // accenture : 2014-08-15 Accenture plc @@ -6970,16 +7151,13 @@ accenture // accountant : 2014-11-20 dot Accountant Limited accountant -// accountants : 2014-03-20 Knob Town, LLC +// accountants : 2014-03-20 Binky Moon, LLC accountants // aco : 2015-01-08 ACO Severin Ahlmann GmbH & Co. KG aco -// active : 2014-05-01 The Active Network, Inc -active - -// actor : 2013-12-12 United TLD Holdco Ltd. +// actor : 2013-12-12 Dog Beach, LLC actor // adac : 2015-07-16 Allgemeiner Deutscher Automobil-Club e.V. (ADAC) @@ -7006,25 +7184,19 @@ afl // africa : 2014-03-24 ZA Central Registry NPC trading as Registry.Africa africa -// africamagic : 2015-03-05 Electronic Media Network (Pty) Ltd -africamagic - // agakhan : 2015-04-23 Fondation Aga Khan (Aga Khan Foundation) agakhan -// agency : 2013-11-14 Steel Falls, LLC +// agency : 2013-11-14 Binky Moon, LLC agency // aig : 2014-12-18 American International Group, Inc. aig -// aigo : 2015-08-06 aigo Digital Technology Co,Ltd. -aigo - // airbus : 2015-07-30 Airbus S.A.S. airbus -// airforce : 2014-03-06 United TLD Holdco Ltd. +// airforce : 2014-03-06 Dog Beach, LLC airforce // airtel : 2014-10-24 Bharti Airtel Limited @@ -7051,12 +7223,15 @@ allstate // ally : 2015-06-18 Ally Financial Inc. ally -// alsace : 2014-07-02 REGION D ALSACE +// alsace : 2014-07-02 Region Grand Est alsace // alstom : 2015-07-30 ALSTOM alstom +// amazon : 2019-12-19 Amazon Registry Services, Inc. +amazon + // americanexpress : 2015-07-31 American Express Travel Related Services Company, Inc. americanexpress @@ -7081,16 +7256,16 @@ analytics // android : 2014-08-07 Charleston Road Registry Inc. android -// anquan : 2015-01-08 QIHOO 360 TECHNOLOGY CO. LTD. +// anquan : 2015-01-08 Beijing Qihu Keji Co., Ltd. anquan // anz : 2015-07-31 Australia and New Zealand Banking Group Limited anz -// aol : 2015-09-17 AOL Inc. +// aol : 2015-09-17 Oath Inc. aol -// apartments : 2014-12-11 June Maple, LLC +// apartments : 2014-12-11 Binky Moon, LLC apartments // app : 2015-05-14 Charleston Road Registry Inc. @@ -7108,55 +7283,58 @@ arab // aramco : 2014-11-20 Aramco Services Company aramco -// archi : 2014-02-06 STARTING DOT LIMITED +// archi : 2014-02-06 Afilias Limited archi -// army : 2014-03-06 United TLD Holdco Ltd. +// army : 2014-03-06 Dog Beach, LLC army +// art : 2016-03-24 UK Creative Ideas Limited +art + // arte : 2014-12-11 Association Relative à la Télévision Européenne G.E.I.E. arte // asda : 2015-07-31 Wal-Mart Stores, Inc. asda -// associates : 2014-03-06 Baxter Hill, LLC +// associates : 2014-03-06 Binky Moon, LLC associates // athleta : 2015-07-30 The Gap, Inc. athleta -// attorney : 2014-03-20 +// attorney : 2014-03-20 Dog Beach, LLC attorney -// auction : 2014-03-20 +// auction : 2014-03-20 Dog Beach, LLC auction // audi : 2015-05-21 AUDI Aktiengesellschaft audi -// audible : 2015-06-25 Amazon EU S.à r.l. +// audible : 2015-06-25 Amazon Registry Services, Inc. audible -// audio : 2014-03-20 Uniregistry, Corp. +// audio : 2014-03-20 UNR Corp. audio // auspost : 2015-08-13 Australian Postal Corporation auspost -// author : 2014-12-18 Amazon EU S.à r.l. +// author : 2014-12-18 Amazon Registry Services, Inc. author -// auto : 2014-11-13 +// auto : 2014-11-13 XYZ.COM LLC auto // autos : 2014-01-09 DERAutos, LLC autos -// avianca : 2015-01-08 Aerovias del Continente Americano S.A. Avianca +// avianca : 2015-01-08 Avianca Holdings S.A. avianca -// aws : 2015-06-25 Amazon EU S.à r.l. +// aws : 2015-06-25 Amazon Registry Services, Inc. aws // axa : 2013-12-19 AXA SA @@ -7165,7 +7343,7 @@ axa // azure : 2014-12-18 Microsoft Corporation azure -// baby : 2015-04-09 Johnson & Johnson Services, Inc. +// baby : 2015-04-09 XYZ.COM LLC baby // baidu : 2015-01-08 Baidu, Inc. @@ -7177,7 +7355,7 @@ banamex // bananarepublic : 2015-07-31 The Gap, Inc. bananarepublic -// band : 2014-06-12 +// band : 2014-06-12 Dog Beach, LLC band // bank : 2014-09-25 fTLD Registry Services LLC @@ -7198,7 +7376,7 @@ barclays // barefoot : 2015-06-11 Gallo Vineyards, Inc. barefoot -// bargains : 2013-11-14 Half Hallow, LLC +// bargains : 2013-11-14 Binky Moon, LLC bargains // baseball : 2015-10-29 MLB Advanced Media DH, LLC @@ -7231,10 +7409,10 @@ bcn // beats : 2015-05-14 Beats Electronics, LLC beats -// beauty : 2015-12-03 L'Oréal +// beauty : 2015-12-03 XYZ.COM LLC beauty -// beer : 2014-01-09 Top Level Domain Holdings Limited +// beer : 2014-01-09 Minds + Machines Group Limited beer // bentley : 2014-12-18 Bentley Motors Limited @@ -7249,7 +7427,7 @@ best // bestbuy : 2015-07-31 BBY Solutions, Inc. bestbuy -// bet : 2015-05-07 Afilias plc +// bet : 2015-05-07 Afilias Limited bet // bharti : 2014-01-09 Bharti Enterprises (Holding) Private Limited @@ -7261,31 +7439,28 @@ bible // bid : 2013-12-19 dot Bid Limited bid -// bike : 2013-08-27 Grand Hollow, LLC +// bike : 2013-08-27 Binky Moon, LLC bike // bing : 2014-12-18 Microsoft Corporation bing -// bingo : 2014-12-04 Sand Cedar, LLC +// bingo : 2014-12-04 Binky Moon, LLC bingo -// bio : 2014-03-06 STARTING DOT LIMITED +// bio : 2014-03-06 Afilias Limited bio // black : 2014-01-16 Afilias Limited black -// blackfriday : 2014-01-16 Uniregistry, Corp. +// blackfriday : 2014-01-16 UNR Corp. blackfriday -// blanco : 2015-07-16 BLANCO GmbH + Co KG -blanco - // blockbuster : 2015-07-30 Dish DBS Corporation blockbuster -// blog : 2015-05-14 PRIMER NIVEL S.A. +// blog : 2015-05-14 Knock Knock WHOIS There, LLC blog // bloomberg : 2014-07-17 Bloomberg IP Holdings LLC @@ -7300,9 +7475,6 @@ bms // bmw : 2014-01-09 Bayerische Motoren Werke Aktiengesellschaft bmw -// bnl : 2014-07-24 Banca Nazionale del Lavoro -bnl - // bnpparibas : 2014-05-29 BNP Paribas bnpparibas @@ -7312,43 +7484,40 @@ boats // boehringer : 2015-07-09 Boehringer Ingelheim International GmbH boehringer -// bofa : 2015-07-31 NMS Services, Inc. +// bofa : 2015-07-31 Bank of America Corporation bofa // bom : 2014-10-16 Núcleo de Informação e Coordenação do Ponto BR - NIC.br bom -// bond : 2014-06-05 Bond University Limited +// bond : 2014-06-05 ShortDot SA bond // boo : 2014-01-30 Charleston Road Registry Inc. boo -// book : 2015-08-27 Amazon EU S.à r.l. +// book : 2015-08-27 Amazon Registry Services, Inc. book // booking : 2015-07-16 Booking.com B.V. booking -// boots : 2015-01-08 THE BOOTS COMPANY PLC -boots - // bosch : 2015-06-18 Robert Bosch GMBH bosch // bostik : 2015-05-28 Bostik SA bostik -// boston : 2015-12-10 Boston Globe Media Partners, LLC +// boston : 2015-12-10 Boston TLD Management, LLC boston -// bot : 2014-12-18 Amazon EU S.à r.l. +// bot : 2014-12-18 Amazon Registry Services, Inc. bot -// boutique : 2013-11-14 Over Galley, LLC +// boutique : 2013-11-14 Binky Moon, LLC boutique -// box : 2015-11-12 NS1 Limited +// box : 2015-11-12 .BOX INC. box // bradesco : 2014-12-18 Banco Bradesco S.A. @@ -7360,7 +7529,7 @@ bridgestone // broadway : 2014-12-22 Celebrate Broadway, Inc. broadway -// broker : 2014-12-11 IG Group Holdings PLC +// broker : 2014-12-11 Dotbroker Registry Limited broker // brother : 2015-01-29 Brother Industries, Ltd. @@ -7369,7 +7538,7 @@ brother // brussels : 2014-02-06 DNS.be vzw brussels -// budapest : 2013-11-21 Top Level Domain Holdings Limited +// budapest : 2013-11-21 Minds + Machines Group Limited budapest // bugatti : 2015-07-23 Bugatti International SA @@ -7378,13 +7547,13 @@ bugatti // build : 2013-11-07 Plan Bee LLC build -// builders : 2013-11-07 Atomic Madison, LLC +// builders : 2013-11-07 Binky Moon, LLC builders -// business : 2013-11-07 Spring Cross, LLC +// business : 2013-11-07 Binky Moon, LLC business -// buy : 2014-12-18 Amazon EU S.à r.l. +// buy : 2014-12-18 Amazon Registry Services, Inc. buy // buzz : 2013-10-02 DOTSTRATEGY CO. @@ -7393,25 +7562,28 @@ buzz // bzh : 2014-02-27 Association www.bzh bzh -// cab : 2013-10-24 Half Sunset, LLC +// cab : 2013-10-24 Binky Moon, LLC cab -// cafe : 2015-02-11 Pioneer Canyon, LLC +// cafe : 2015-02-11 Binky Moon, LLC cafe // cal : 2014-07-24 Charleston Road Registry Inc. cal -// call : 2014-12-18 Amazon EU S.à r.l. +// call : 2014-12-18 Amazon Registry Services, Inc. call // calvinklein : 2015-07-30 PVH gTLD Holdings LLC calvinklein -// camera : 2013-08-27 Atomic Maple, LLC +// cam : 2016-04-21 AC Webconnecting Holding B.V. +cam + +// camera : 2013-08-27 Binky Moon, LLC camera -// camp : 2013-11-07 Delta Dynamite, LLC +// camp : 2013-11-07 Binky Moon, LLC camp // cancerresearch : 2014-05-15 Australian Cancer Research Foundation @@ -7423,37 +7595,34 @@ canon // capetown : 2014-03-24 ZA Central Registry NPC trading as ZA Central Registry capetown -// capital : 2014-03-06 Delta Mill, LLC +// capital : 2014-03-06 Binky Moon, LLC capital // capitalone : 2015-08-06 Capital One Financial Corporation capitalone -// car : 2015-01-22 +// car : 2015-01-22 XYZ.COM LLC car // caravan : 2013-12-12 Caravan International, Inc. caravan -// cards : 2013-12-05 Foggy Hollow, LLC +// cards : 2013-12-05 Binky Moon, LLC cards -// care : 2014-03-06 Goose Cross +// care : 2014-03-06 Binky Moon, LLC care // career : 2013-10-09 dotCareer LLC career -// careers : 2013-10-02 Wild Corner, LLC +// careers : 2013-10-02 Binky Moon, LLC careers -// cars : 2014-11-13 +// cars : 2014-11-13 XYZ.COM LLC cars -// cartier : 2014-06-23 Richemont DNS Inc. -cartier - -// casa : 2013-11-21 Top Level Domain Holdings Limited +// casa : 2013-11-21 Minds + Machines Group Limited casa // case : 2015-09-03 CNH Industrial N.V. @@ -7462,13 +7631,13 @@ case // caseih : 2015-09-03 CNH Industrial N.V. caseih -// cash : 2014-03-06 Delta Lake, LLC +// cash : 2014-03-06 Binky Moon, LLC cash -// casino : 2014-12-18 Binky Sky, LLC +// casino : 2014-12-18 Binky Moon, LLC casino -// catering : 2013-12-05 New Falls. LLC +// catering : 2013-12-05 Binky Moon, LLC catering // catholic : 2015-10-21 Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) @@ -7489,7 +7658,7 @@ cbs // ceb : 2015-04-09 The Corporate Executive Board Company ceb -// center : 2013-11-07 Tin Mill, LLC +// center : 2013-11-07 Binky Moon, LLC center // ceo : 2013-11-07 CEOTLD Pty Ltd @@ -7501,7 +7670,7 @@ cern // cfa : 2014-08-28 CFA Institute cfa -// cfd : 2014-12-11 IG Group Holdings PLC +// cfd : 2014-12-11 DotCFD Registry Limited cfd // chanel : 2015-04-09 Chanel International B.V. @@ -7510,37 +7679,34 @@ chanel // channel : 2014-05-08 Charleston Road Registry Inc. channel -// chase : 2015-04-30 JPMorgan Chase & Co. +// charity : 2018-04-11 Binky Moon, LLC +charity + +// chase : 2015-04-30 JPMorgan Chase Bank, National Association chase -// chat : 2014-12-04 Sand Fields, LLC +// chat : 2014-12-04 Binky Moon, LLC chat -// cheap : 2013-11-14 Sand Cover, LLC +// cheap : 2013-11-14 Binky Moon, LLC cheap // chintai : 2015-06-11 CHINTAI Corporation chintai -// chloe : 2014-10-16 Richemont DNS Inc. -chloe - -// christmas : 2013-11-21 Uniregistry, Corp. +// christmas : 2013-11-21 UNR Corp. christmas // chrome : 2014-07-24 Charleston Road Registry Inc. chrome -// chrysler : 2015-07-30 FCA US LLC. -chrysler - -// church : 2014-02-06 Holly Fields, LLC +// church : 2014-02-06 Binky Moon, LLC church // cipriani : 2015-02-19 Hotel Cipriani Srl cipriani -// circle : 2014-12-18 Amazon EU S.à r.l. +// circle : 2014-12-18 Amazon Registry Services, Inc. circle // cisco : 2014-12-22 Cisco Technology, Inc. @@ -7555,31 +7721,31 @@ citi // citic : 2014-01-09 CITIC Group Corporation citic -// city : 2014-05-29 Snow Sky, LLC +// city : 2014-05-29 Binky Moon, LLC city // cityeats : 2014-12-11 Lifestyle Domain Holdings, Inc. cityeats -// claims : 2014-03-20 Black Corner, LLC +// claims : 2014-03-20 Binky Moon, LLC claims -// cleaning : 2013-12-05 Fox Shadow, LLC +// cleaning : 2013-12-05 Binky Moon, LLC cleaning -// click : 2014-06-05 Uniregistry, Corp. +// click : 2014-06-05 UNR Corp. click -// clinic : 2014-03-20 Goose Park, LLC +// clinic : 2014-03-20 Binky Moon, LLC clinic // clinique : 2015-10-01 The Estée Lauder Companies Inc. clinique -// clothing : 2013-08-27 Steel Lake, LLC +// clothing : 2013-08-27 Binky Moon, LLC clothing -// cloud : 2015-04-16 ARUBA S.p.A. +// cloud : 2015-04-16 Aruba PEC S.p.A. cloud // club : 2013-11-08 .CLUB DOMAINS, LLC @@ -7588,19 +7754,19 @@ club // clubmed : 2015-06-25 Club Méditerranée S.A. clubmed -// coach : 2014-10-09 Koko Island, LLC +// coach : 2014-10-09 Binky Moon, LLC coach -// codes : 2013-10-31 Puff Willow, LLC +// codes : 2013-10-31 Binky Moon, LLC codes -// coffee : 2013-10-17 Trixy Cover, LLC +// coffee : 2013-10-17 Binky Moon, LLC coffee // college : 2014-01-16 XYZ.COM LLC college -// cologne : 2014-02-05 NetCologne Gesellschaft für Telekommunikation mbH +// cologne : 2014-02-05 dotKoeln GmbH cologne // comcast : 2015-07-23 Comcast IP Holdings I, LLC @@ -7609,64 +7775,67 @@ comcast // commbank : 2014-06-26 COMMONWEALTH BANK OF AUSTRALIA commbank -// community : 2013-12-05 Fox Orchard, LLC +// community : 2013-12-05 Binky Moon, LLC community -// company : 2013-11-07 Silver Avenue, LLC +// company : 2013-11-07 Binky Moon, LLC company -// compare : 2015-10-08 iSelect Ltd +// compare : 2015-10-08 Registry Services, LLC compare -// computer : 2013-10-24 Pine Mill, LLC +// computer : 2013-10-24 Binky Moon, LLC computer // comsec : 2015-01-08 VeriSign, Inc. comsec -// condos : 2013-12-05 Pine House, LLC +// condos : 2013-12-05 Binky Moon, LLC condos -// construction : 2013-09-16 Fox Dynamite, LLC +// construction : 2013-09-16 Binky Moon, LLC construction -// consulting : 2013-12-05 +// consulting : 2013-12-05 Dog Beach, LLC consulting -// contact : 2015-01-08 Top Level Spectrum, Inc. +// contact : 2015-01-08 Dog Beach, LLC contact -// contractors : 2013-09-10 Magic Woods, LLC +// contractors : 2013-09-10 Binky Moon, LLC contractors -// cooking : 2013-11-21 Top Level Domain Holdings Limited +// cooking : 2013-11-21 Minds + Machines Group Limited cooking // cookingchannel : 2015-07-02 Lifestyle Domain Holdings, Inc. cookingchannel -// cool : 2013-11-14 Koko Lake, LLC +// cool : 2013-11-14 Binky Moon, LLC cool -// corsica : 2014-09-25 Collectivité Territoriale de Corse +// corsica : 2014-09-25 Collectivité de Corse corsica -// country : 2013-12-19 Top Level Domain Holdings Limited +// country : 2013-12-19 DotCountry LLC country -// coupon : 2015-02-26 Amazon EU S.à r.l. +// coupon : 2015-02-26 Amazon Registry Services, Inc. coupon -// coupons : 2015-03-26 Black Island, LLC +// coupons : 2015-03-26 Binky Moon, LLC coupons // courses : 2014-12-04 OPEN UNIVERSITIES AUSTRALIA PTY LTD courses -// credit : 2014-03-20 Snow Shadow, LLC +// cpa : 2019-06-10 American Institute of Certified Public Accountants +cpa + +// credit : 2014-03-20 Binky Moon, LLC credit -// creditcard : 2014-03-20 Binky Frostbite, LLC +// creditcard : 2014-03-20 Binky Moon, LLC creditcard // creditunion : 2015-01-22 CUNA Performance Resources, LLC @@ -7684,19 +7853,19 @@ crs // cruise : 2015-12-10 Viking River Cruises (Bermuda) Ltd. cruise -// cruises : 2013-12-05 Spring Way, LLC +// cruises : 2013-12-05 Binky Moon, LLC cruises // csc : 2014-09-25 Alliance-One Services, Inc. csc -// cuisinella : 2014-04-03 SALM S.A.S. +// cuisinella : 2014-04-03 SCHMIDT GROUPE S.A.S. cuisinella // cymru : 2014-05-08 Nominet UK cymru -// cyou : 2015-01-22 Beijing Gamease Age Digital Technology Co., Ltd. +// cyou : 2015-01-22 ShortDot SA cyou // dabur : 2014-02-06 Dabur India Limited @@ -7705,13 +7874,16 @@ dabur // dad : 2014-01-23 Charleston Road Registry Inc. dad -// dance : 2013-10-24 United TLD Holdco Ltd. +// dance : 2013-10-24 Dog Beach, LLC dance +// data : 2016-06-02 Dish DBS Corporation +data + // date : 2014-11-20 dot Date Limited date -// dating : 2013-12-05 Pine Fest, LLC +// dating : 2013-12-05 Binky Moon, LLC dating // datsun : 2014-03-27 NISSAN MOTOR CO., LTD. @@ -7723,22 +7895,22 @@ day // dclk : 2014-11-20 Charleston Road Registry Inc. dclk -// dds : 2015-05-07 Top Level Domain Holdings Limited +// dds : 2015-05-07 Minds + Machines Group Limited dds -// deal : 2015-06-25 Amazon EU S.à r.l. +// deal : 2015-06-25 Amazon Registry Services, Inc. deal -// dealer : 2014-12-22 Dealer Dot Com, Inc. +// dealer : 2014-12-22 Intercap Registry Inc. dealer -// deals : 2014-05-22 Sand Sunset, LLC +// deals : 2014-05-22 Binky Moon, LLC deals -// degree : 2014-03-06 +// degree : 2014-03-06 Dog Beach, LLC degree -// delivery : 2014-09-11 Steel Station, LLC +// delivery : 2014-09-11 Binky Moon, LLC delivery // dell : 2014-10-24 Dell Inc. @@ -7750,13 +7922,13 @@ deloitte // delta : 2015-02-19 Delta Air Lines, Inc. delta -// democrat : 2013-10-24 United TLD Holdco Ltd. +// democrat : 2013-10-24 Dog Beach, LLC democrat -// dental : 2014-03-20 Tin Birch, LLC +// dental : 2014-03-20 Binky Moon, LLC dental -// dentist : 2014-03-20 +// dentist : 2014-03-20 Dog Beach, LLC dentist // desi : 2013-11-14 Desi Networks LLC @@ -7771,22 +7943,22 @@ dev // dhl : 2015-07-23 Deutsche Post AG dhl -// diamonds : 2013-09-22 John Edge, LLC +// diamonds : 2013-09-22 Binky Moon, LLC diamonds -// diet : 2014-06-26 Uniregistry, Corp. +// diet : 2014-06-26 UNR Corp. diet -// digital : 2014-03-06 Dash Park, LLC +// digital : 2014-03-06 Binky Moon, LLC digital -// direct : 2014-04-10 Half Trail, LLC +// direct : 2014-04-10 Binky Moon, LLC direct -// directory : 2013-09-20 Extra Madison, LLC +// directory : 2013-09-20 Binky Moon, LLC directory -// discount : 2014-03-06 Holly Hill, LLC +// discount : 2014-03-06 Binky Moon, LLC discount // discover : 2015-07-23 Discover Financial Services @@ -7804,21 +7976,15 @@ dnp // docs : 2014-10-16 Charleston Road Registry Inc. docs -// dodge : 2015-07-30 FCA US LLC. -dodge +// doctor : 2016-06-02 Binky Moon, LLC +doctor -// dog : 2014-12-04 Koko Mill, LLC +// dog : 2014-12-04 Binky Moon, LLC dog -// doha : 2014-09-18 Communications Regulatory Authority (CRA) -doha - -// domains : 2013-10-17 Sugar Cross, LLC +// domains : 2013-10-17 Binky Moon, LLC domains -// doosan : 2014-04-03 Doosan Corporation -doosan - // dot : 2015-05-21 Dish DBS Corporation dot @@ -7828,9 +7994,6 @@ download // drive : 2015-03-05 Charleston Road Registry Inc. drive -// dstv : 2015-03-12 MultiChoice (Proprietary) Limited -dstv - // dtv : 2015-06-04 Dish DBS Corporation dtv @@ -7843,10 +8006,7 @@ duck // dunlop : 2015-07-02 The Goodyear Tire & Rubber Company dunlop -// duns : 2015-08-06 The Dun & Bradstreet Corporation -duns - -// dupont : 2015-06-25 E.I. du Pont de Nemours and Company +// dupont : 2015-06-25 E. I. du Pont de Nemours and Company dupont // durban : 2014-03-24 ZA Central Registry NPC trading as ZA Central Registry @@ -7855,8 +8015,8 @@ durban // dvag : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG dvag -// dwg : 2015-07-23 Autodesk, Inc. -dwg +// dvr : 2016-05-26 DISH Technologies L.L.C. +dvr // earth : 2014-12-04 Interlink Co., Ltd. earth @@ -7864,40 +8024,37 @@ earth // eat : 2014-01-23 Charleston Road Registry Inc. eat +// eco : 2016-07-08 Big Room Inc. +eco + // edeka : 2014-12-18 EDEKA Verband kaufmännischer Genossenschaften e.V. edeka -// education : 2013-11-07 Brice Way, LLC +// education : 2013-11-07 Binky Moon, LLC education -// email : 2013-10-31 Spring Madison, LLC +// email : 2013-10-31 Binky Moon, LLC email // emerck : 2014-04-03 Merck KGaA emerck -// emerson : 2015-07-23 Emerson Electric Co. -emerson - -// energy : 2014-09-11 Binky Birch, LLC +// energy : 2014-09-11 Binky Moon, LLC energy -// engineer : 2014-03-06 United TLD Holdco Ltd. +// engineer : 2014-03-06 Dog Beach, LLC engineer -// engineering : 2014-03-06 Romeo Canyon +// engineering : 2014-03-06 Binky Moon, LLC engineering -// enterprises : 2013-09-20 Snow Oaks, LLC +// enterprises : 2013-09-20 Binky Moon, LLC enterprises -// epost : 2015-07-23 Deutsche Post AG -epost - // epson : 2014-12-04 Seiko Epson Corporation epson -// equipment : 2013-08-27 Corn Station, LLC +// equipment : 2013-08-27 Binky Moon, LLC equipment // ericsson : 2015-07-09 Telefonaktiebolaget L M Ericsson @@ -7909,12 +8066,9 @@ erni // esq : 2014-05-08 Charleston Road Registry Inc. esq -// estate : 2013-08-27 Trixy Park, LLC +// estate : 2013-08-27 Binky Moon, LLC estate -// esurance : 2015-07-23 Esurance Insurance Company -esurance - // etisalat : 2015-09-03 Emirates Telecommunications Corporation (trading as Etisalat) etisalat @@ -7924,22 +8078,19 @@ eurovision // eus : 2013-12-12 Puntueus Fundazioa eus -// events : 2013-12-05 Pioneer Maple, LLC +// events : 2013-12-05 Binky Moon, LLC events -// everbank : 2014-05-15 EverBank -everbank - -// exchange : 2014-03-06 Spring Falls, LLC +// exchange : 2014-03-06 Binky Moon, LLC exchange -// expert : 2013-11-21 Magic Pass, LLC +// expert : 2013-11-21 Binky Moon, LLC expert -// exposed : 2013-12-05 Victor Beach, LLC +// exposed : 2013-12-05 Binky Moon, LLC exposed -// express : 2015-02-11 Sea Sunset, LLC +// express : 2015-02-11 Binky Moon, LLC express // extraspace : 2015-05-14 Extra Space Storage LLC @@ -7948,7 +8099,7 @@ extraspace // fage : 2014-12-18 Fage International S.A. fage -// fail : 2014-03-06 Atomic Pipe, LLC +// fail : 2014-03-06 Binky Moon, LLC fail // fairwinds : 2014-11-13 FairWinds Partners, LLC @@ -7957,25 +8108,25 @@ fairwinds // faith : 2014-11-20 dot Faith Limited faith -// family : 2015-04-02 +// family : 2015-04-02 Dog Beach, LLC family -// fan : 2014-03-06 +// fan : 2014-03-06 Dog Beach, LLC fan -// fans : 2014-11-07 Asiamix Digital Limited +// fans : 2014-11-07 ZDNS International Limited fans -// farm : 2013-11-07 Just Maple, LLC +// farm : 2013-11-07 Binky Moon, LLC farm // farmers : 2015-07-09 Farmers Insurance Exchange farmers -// fashion : 2014-07-03 Top Level Domain Holdings Limited +// fashion : 2014-07-03 Minds + Machines Group Limited fashion -// fast : 2014-12-18 Amazon EU S.à r.l. +// fast : 2014-12-18 Amazon Registry Services, Inc. fast // fedex : 2015-08-06 Federal Express Corporation @@ -7996,7 +8147,7 @@ fiat // fidelity : 2015-07-30 Fidelity Brokerage Services LLC fidelity -// fido : 2015-08-06 Rogers Communications Partnership +// fido : 2015-08-06 Rogers Communications Canada Inc. fido // film : 2015-01-08 Motion Picture Domain Registry Pty Ltd @@ -8005,82 +8156,82 @@ film // final : 2014-10-16 Núcleo de Informação e Coordenação do Ponto BR - NIC.br final -// finance : 2014-03-20 Cotton Cypress, LLC +// finance : 2014-03-20 Binky Moon, LLC finance -// financial : 2014-03-06 Just Cover, LLC +// financial : 2014-03-06 Binky Moon, LLC financial -// fire : 2015-06-25 Amazon EU S.à r.l. +// fire : 2015-06-25 Amazon Registry Services, Inc. fire -// firestone : 2014-12-18 Bridgestone Corporation +// firestone : 2014-12-18 Bridgestone Licensing Services, Inc firestone // firmdale : 2014-03-27 Firmdale Holdings Limited firmdale -// fish : 2013-12-12 Fox Woods, LLC +// fish : 2013-12-12 Binky Moon, LLC fish -// fishing : 2013-11-21 Top Level Domain Holdings Limited +// fishing : 2013-11-21 Minds + Machines Group Limited fishing -// fit : 2014-11-07 Top Level Domain Holdings Limited +// fit : 2014-11-07 Minds + Machines Group Limited fit -// fitness : 2014-03-06 Brice Orchard, LLC +// fitness : 2014-03-06 Binky Moon, LLC fitness -// flickr : 2015-04-02 Yahoo! Domain Services Inc. +// flickr : 2015-04-02 Flickr, Inc. flickr -// flights : 2013-12-05 Fox Station, LLC +// flights : 2013-12-05 Binky Moon, LLC flights // flir : 2015-07-23 FLIR Systems, Inc. flir -// florist : 2013-11-07 Half Cypress, LLC +// florist : 2013-11-07 Binky Moon, LLC florist -// flowers : 2014-10-09 Uniregistry, Corp. +// flowers : 2014-10-09 UNR Corp. flowers -// flsmidth : 2014-07-24 FLSmidth A/S -flsmidth - // fly : 2014-05-08 Charleston Road Registry Inc. fly // foo : 2014-01-23 Charleston Road Registry Inc. foo +// food : 2016-04-21 Lifestyle Domain Holdings, Inc. +food + // foodnetwork : 2015-07-02 Lifestyle Domain Holdings, Inc. foodnetwork -// football : 2014-12-18 Foggy Farms, LLC +// football : 2014-12-18 Binky Moon, LLC football // ford : 2014-11-13 Ford Motor Company ford -// forex : 2014-12-11 IG Group Holdings PLC +// forex : 2014-12-11 Dotforex Registry Limited forex -// forsale : 2014-05-22 +// forsale : 2014-05-22 Dog Beach, LLC forsale // forum : 2015-04-02 Fegistry, LLC forum -// foundation : 2013-12-05 John Dale, LLC +// foundation : 2013-12-05 Binky Moon, LLC foundation // fox : 2015-09-11 FOX Registry, LLC fox -// free : 2015-12-10 Amazon EU S.à r.l. +// free : 2015-12-10 Amazon Registry Services, Inc. free // fresenius : 2015-07-30 Fresenius Immobilien-Verwaltungs-GmbH @@ -8107,22 +8258,25 @@ fujitsu // fujixerox : 2015-07-23 Xerox DNHC LLC fujixerox -// fund : 2014-03-20 John Castle, LLC +// fun : 2016-01-14 DotSpace Inc. +fun + +// fund : 2014-03-20 Binky Moon, LLC fund -// furniture : 2014-03-20 Lone Fields, LLC +// furniture : 2014-03-20 Binky Moon, LLC furniture -// futbol : 2013-09-20 +// futbol : 2013-09-20 Dog Beach, LLC futbol -// fyi : 2015-04-02 Silver Tigers, LLC +// fyi : 2015-04-02 Binky Moon, LLC fyi // gal : 2013-11-07 Asociación puntoGAL gal -// gallery : 2013-09-13 Sugar House, LLC +// gallery : 2013-09-13 Binky Moon, LLC gallery // gallo : 2015-06-11 Gallo Vineyards, Inc. @@ -8131,18 +8285,21 @@ gallo // gallup : 2015-02-19 Gallup, Inc. gallup -// game : 2015-05-28 Uniregistry, Corp. +// game : 2015-05-28 UNR Corp. game -// games : 2015-05-28 Foggy Beach, LLC +// games : 2015-05-28 Dog Beach, LLC games // gap : 2015-07-31 The Gap, Inc. gap -// garden : 2014-06-26 Top Level Domain Holdings Limited +// garden : 2014-06-26 Minds + Machines Group Limited garden +// gay : 2019-05-23 Top Level Design, LLC +gay + // gbiz : 2014-07-17 Charleston Road Registry Inc. gbiz @@ -8152,7 +8309,7 @@ gdn // gea : 2014-12-04 GEA Group Aktiengesellschaft gea -// gent : 2014-01-23 COMBELL GROUP NV/SA +// gent : 2014-01-23 COMBELL NV gent // genting : 2015-03-12 Resorts World Inc Pte. Ltd. @@ -8164,13 +8321,13 @@ george // ggee : 2014-01-09 GMO Internet, Inc. ggee -// gift : 2013-10-17 Uniregistry, Corp. +// gift : 2013-10-17 DotGift, LLC gift -// gifts : 2014-07-03 Goose Sky, LLC +// gifts : 2014-07-03 Binky Moon, LLC gifts -// gives : 2014-03-06 United TLD Holdco Ltd. +// gives : 2014-03-06 Dog Beach, LLC gives // giving : 2014-11-13 Giving Limited @@ -8179,13 +8336,13 @@ giving // glade : 2015-07-23 Johnson Shareholdings, Inc. glade -// glass : 2013-11-07 Black Cover, LLC +// glass : 2013-11-07 Binky Moon, LLC glass // gle : 2014-07-24 Charleston Road Registry Inc. gle -// global : 2014-04-17 Dot GLOBAL AS +// global : 2014-04-17 Dot Global Domain Registry Limited global // globo : 2013-12-19 Globo Comunicação e Participações S.A @@ -8194,6 +8351,9 @@ globo // gmail : 2014-05-01 Charleston Road Registry Inc. gmail +// gmbh : 2016-01-29 Binky Moon, LLC +gmbh + // gmo : 2014-01-09 GMO Internet, Inc. gmo @@ -8203,21 +8363,18 @@ gmx // godaddy : 2015-07-23 Go Daddy East, LLC godaddy -// gold : 2015-01-22 June Edge, LLC +// gold : 2015-01-22 Binky Moon, LLC gold // goldpoint : 2014-11-20 YODOBASHI CAMERA CO.,LTD. goldpoint -// golf : 2014-12-18 Lone falls, LLC +// golf : 2014-12-18 Binky Moon, LLC golf // goo : 2014-12-18 NTT Resonant Inc. goo -// goodhands : 2015-07-31 Allstate Fire and Casualty Insurance Company -goodhands - // goodyear : 2015-07-02 The Goodyear Tire & Rubber Company goodyear @@ -8230,28 +8387,28 @@ google // gop : 2014-01-16 Republican State Leadership Committee, Inc. gop -// got : 2014-12-18 Amazon EU S.à r.l. +// got : 2014-12-18 Amazon Registry Services, Inc. got -// gotv : 2015-03-12 MultiChoice (Proprietary) Limited -gotv - // grainger : 2015-05-07 Grainger Registry Services, LLC grainger -// graphics : 2013-09-13 Over Madison, LLC +// graphics : 2013-09-13 Binky Moon, LLC graphics -// gratis : 2014-03-20 Pioneer Tigers, LLC +// gratis : 2014-03-20 Binky Moon, LLC gratis // green : 2014-05-08 Afilias Limited green -// gripe : 2014-03-06 Corn Sunset, LLC +// gripe : 2014-03-06 Binky Moon, LLC gripe -// group : 2014-08-15 Romeo Town, LLC +// grocery : 2016-06-16 Wal-Mart Stores, Inc. +grocery + +// group : 2014-08-15 Binky Moon, LLC group // guardian : 2015-07-30 The Guardian Life Insurance Company of America @@ -8263,16 +8420,16 @@ gucci // guge : 2014-08-28 Charleston Road Registry Inc. guge -// guide : 2013-09-13 Snow Moon, LLC +// guide : 2013-09-13 Binky Moon, LLC guide -// guitars : 2013-11-14 Uniregistry, Corp. +// guitars : 2013-11-14 UNR Corp. guitars -// guru : 2013-08-27 Pioneer Cypress, LLC +// guru : 2013-08-27 Binky Moon, LLC guru -// hair : 2015-12-03 L'Oréal +// hair : 2015-12-03 XYZ.COM LLC hair // hamburg : 2014-02-20 Hamburg Top-Level-Domain GmbH @@ -8281,7 +8438,7 @@ hamburg // hangout : 2014-11-13 Charleston Road Registry Inc. hangout -// haus : 2013-12-05 +// haus : 2013-12-05 Dog Beach, LLC haus // hbo : 2015-07-30 HBO Registry Services, Inc. @@ -8296,10 +8453,10 @@ hdfcbank // health : 2015-02-11 DotHealth, LLC health -// healthcare : 2014-06-12 Silver Glen, LLC +// healthcare : 2014-06-12 Binky Moon, LLC healthcare -// help : 2014-06-26 Uniregistry, Corp. +// help : 2014-06-26 UNR Corp. help // helsinki : 2015-02-05 City of Helsinki @@ -8314,7 +8471,7 @@ hermes // hgtv : 2015-07-02 Lifestyle Domain Holdings, Inc. hgtv -// hiphop : 2014-03-06 Uniregistry, Corp. +// hiphop : 2014-03-06 UNR Corp. hiphop // hisamitsu : 2015-07-16 Hisamitsu Pharmaceutical Co.,Inc. @@ -8323,22 +8480,22 @@ hisamitsu // hitachi : 2014-10-31 Hitachi, Ltd. hitachi -// hiv : 2014-03-13 +// hiv : 2014-03-13 UNR Corp. hiv // hkt : 2015-05-14 PCCW-HKT DataCom Services Limited hkt -// hockey : 2015-03-19 Half Willow, LLC +// hockey : 2015-03-19 Binky Moon, LLC hockey -// holdings : 2013-08-27 John Madison, LLC +// holdings : 2013-08-27 Binky Moon, LLC holdings -// holiday : 2013-11-07 Goose Woods, LLC +// holiday : 2013-11-07 Binky Moon, LLC holiday -// homedepot : 2015-04-02 Homer TLC, Inc. +// homedepot : 2015-04-02 Home Depot Product Authority, LLC homedepot // homegoods : 2015-07-16 The TJX Companies, Inc. @@ -8353,39 +8510,39 @@ homesense // honda : 2014-12-18 Honda Motor Co., Ltd. honda -// honeywell : 2015-07-23 Honeywell GTLD LLC -honeywell - -// horse : 2013-11-21 Top Level Domain Holdings Limited +// horse : 2013-11-21 Minds + Machines Group Limited horse +// hospital : 2016-10-20 Binky Moon, LLC +hospital + // host : 2014-04-17 DotHost Inc. host -// hosting : 2014-05-29 Uniregistry, Corp. +// hosting : 2014-05-29 UNR Corp. hosting -// hot : 2015-08-27 Amazon EU S.à r.l. +// hot : 2015-08-27 Amazon Registry Services, Inc. hot // hoteles : 2015-03-05 Travel Reservations SRL hoteles +// hotels : 2016-04-07 Booking.com B.V. +hotels + // hotmail : 2014-12-18 Microsoft Corporation hotmail -// house : 2013-11-07 Sugar Park, LLC +// house : 2013-11-07 Binky Moon, LLC house // how : 2014-01-23 Charleston Road Registry Inc. how -// hsbc : 2014-10-24 HSBC Holdings PLC +// hsbc : 2014-10-24 HSBC Global Services (UK) Limited hsbc -// htc : 2015-04-02 HTC corporation -htc - // hughes : 2015-07-30 Hughes Satellite Systems Corporation hughes @@ -8404,7 +8561,7 @@ icbc // ice : 2014-10-30 IntercontinentalExchange, Inc. ice -// icu : 2015-01-08 One.com A/S +// icu : 2015-01-08 ShortDot SA icu // ieee : 2015-07-23 IEEE Global LLC @@ -8413,25 +8570,25 @@ ieee // ifm : 2014-01-30 ifm electronic gmbh ifm -// iinet : 2014-07-03 Connect West Pty. Ltd. -iinet - // ikano : 2015-07-09 Ikano S.A. ikano // imamat : 2015-08-06 Fondation Aga Khan (Aga Khan Foundation) imamat -// imdb : 2015-06-25 Amazon EU S.à r.l. +// imdb : 2015-06-25 Amazon Registry Services, Inc. imdb -// immo : 2014-07-10 Auburn Bloom, LLC +// immo : 2014-07-10 Binky Moon, LLC immo -// immobilien : 2013-11-07 United TLD Holdco Ltd. +// immobilien : 2013-11-07 Dog Beach, LLC immobilien -// industries : 2013-12-05 Outer House, LLC +// inc : 2018-03-10 Intercap Registry Inc. +inc + +// industries : 2013-12-05 Binky Moon, LLC industries // infiniti : 2014-03-27 NISSAN MOTOR CO., LTD. @@ -8443,36 +8600,30 @@ ing // ink : 2013-12-05 Top Level Design, LLC ink -// institute : 2013-11-07 Outer Maple, LLC +// institute : 2013-11-07 Binky Moon, LLC institute // insurance : 2015-02-19 fTLD Registry Services LLC insurance -// insure : 2014-03-20 Pioneer Willow, LLC +// insure : 2014-03-20 Binky Moon, LLC insure -// intel : 2015-08-06 Intel Corporation -intel - -// international : 2013-11-07 Wild Way, LLC +// international : 2013-11-07 Binky Moon, LLC international // intuit : 2015-07-30 Intuit Administrative Services, Inc. intuit -// investments : 2014-03-20 Holly Glen, LLC +// investments : 2014-03-20 Binky Moon, LLC investments // ipiranga : 2014-08-28 Ipiranga Produtos de Petroleo S.A. ipiranga -// irish : 2014-08-07 Dot-Irish LLC +// irish : 2014-08-07 Binky Moon, LLC irish -// iselect : 2015-02-11 iSelect Ltd -iselect - // ismaili : 2015-08-06 Fondation Aga Khan (Aga Khan Foundation) ismaili @@ -8491,9 +8642,6 @@ itv // iveco : 2015-09-03 CNH Industrial N.V. iveco -// iwc : 2014-06-23 Richemont DNS Inc. -iwc - // jaguar : 2014-11-13 Jaguar Land Rover Ltd jaguar @@ -8509,18 +8657,15 @@ jcp // jeep : 2015-07-30 FCA US LLC. jeep -// jetzt : 2014-01-09 New TLD Company AB +// jetzt : 2014-01-09 Binky Moon, LLC jetzt -// jewelry : 2015-03-05 Wild Bloom, LLC +// jewelry : 2015-03-05 Binky Moon, LLC jewelry -// jio : 2015-04-02 Affinity Names, Inc. +// jio : 2015-04-02 Reliance Industries Limited jio -// jlc : 2014-12-04 Richemont DNS Inc. -jlc - // jll : 2015-04-02 Jones Lang LaSalle Incorporated jll @@ -8533,25 +8678,25 @@ jnj // joburg : 2014-03-24 ZA Central Registry NPC trading as ZA Central Registry joburg -// jot : 2014-12-18 Amazon EU S.à r.l. +// jot : 2014-12-18 Amazon Registry Services, Inc. jot -// joy : 2014-12-18 Amazon EU S.à r.l. +// joy : 2014-12-18 Amazon Registry Services, Inc. joy -// jpmorgan : 2015-04-30 JPMorgan Chase & Co. +// jpmorgan : 2015-04-30 JPMorgan Chase Bank, National Association jpmorgan // jprs : 2014-09-18 Japan Registry Services Co., Ltd. jprs -// juegos : 2014-03-20 Uniregistry, Corp. +// juegos : 2014-03-20 UNR Corp. juegos // juniper : 2015-07-30 JUNIPER NETWORKS, INC. juniper -// kaufen : 2013-11-07 United TLD Holdco Ltd. +// kaufen : 2013-11-07 Dog Beach, LLC kaufen // kddi : 2014-09-12 KDDI CORPORATION @@ -8578,16 +8723,16 @@ kim // kinder : 2014-11-07 Ferrero Trading Lux S.A. kinder -// kindle : 2015-06-25 Amazon EU S.à r.l. +// kindle : 2015-06-25 Amazon Registry Services, Inc. kindle -// kitchen : 2013-09-20 Just Goodbye, LLC +// kitchen : 2013-09-20 Binky Moon, LLC kitchen // kiwi : 2013-09-20 DOT KIWI LIMITED kiwi -// koeln : 2014-01-09 NetCologne Gesellschaft für Telekommunikation mbH +// koeln : 2014-01-09 dotKoeln GmbH koeln // komatsu : 2015-01-08 Komatsu Ltd. @@ -8611,18 +8756,12 @@ kred // kuokgroup : 2015-04-09 Kerry Trading Co. Limited kuokgroup -// kyknet : 2015-03-05 Electronic Media Network (Pty) Ltd -kyknet - // kyoto : 2014-11-07 Academic Institution: Kyoto Jyoho Gakuen kyoto -// lacaixa : 2014-01-09 CAIXA D'ESTALVIS I PENSIONS DE BARCELONA +// lacaixa : 2014-01-09 Fundación Bancaria Caixa d’Estalvis i Pensions de Barcelona, “la Caixa” lacaixa -// ladbrokes : 2015-08-06 LADBROKES INTERNATIONAL PLC -ladbrokes - // lamborghini : 2015-06-04 Automobili Lamborghini S.p.A. lamborghini @@ -8635,10 +8774,7 @@ lancaster // lancia : 2015-07-31 Fiat Chrysler Automobiles N.V. lancia -// lancome : 2015-07-23 L'Oréal -lancome - -// land : 2013-09-10 Pine Moon, LLC +// land : 2013-09-10 Binky Moon, LLC land // landrover : 2014-11-13 Jaguar Land Rover Ltd @@ -8659,16 +8795,16 @@ latino // latrobe : 2014-06-16 La Trobe University latrobe -// law : 2015-01-22 Minds + Machines Group Limited +// law : 2015-01-22 LW TLD Limited law -// lawyer : 2014-03-20 +// lawyer : 2014-03-20 Dog Beach, LLC lawyer -// lds : 2014-03-20 IRI Domain Management, LLC ("Applicant") +// lds : 2014-03-20 IRI Domain Management, LLC lds -// lease : 2014-03-06 Victor Trail, LLC +// lease : 2014-03-06 Binky Moon, LLC lease // leclerc : 2014-08-07 A.C.D. LEC Association des Centres Distributeurs Edouard Leclerc @@ -8677,7 +8813,7 @@ leclerc // lefrak : 2015-07-16 LeFrak Organization, Inc. lefrak -// legal : 2014-10-16 Blue Falls, LLC +// legal : 2014-10-16 Binky Moon, LLC legal // lego : 2015-07-16 LEGO Juris A/S @@ -8689,13 +8825,10 @@ lexus // lgbt : 2014-05-08 Afilias Limited lgbt -// liaison : 2014-10-02 Liaison Technologies, Incorporated -liaison - // lidl : 2014-09-18 Schwarz Domains und Services GmbH & Co. KG lidl -// life : 2014-02-06 Trixy Oaks, LLC +// life : 2014-02-06 Binky Moon, LLC life // lifeinsurance : 2015-01-15 American Council of Life Insurers @@ -8704,19 +8837,19 @@ lifeinsurance // lifestyle : 2014-12-11 Lifestyle Domain Holdings, Inc. lifestyle -// lighting : 2013-08-27 John McCook, LLC +// lighting : 2013-08-27 Binky Moon, LLC lighting -// like : 2014-12-18 Amazon EU S.à r.l. +// like : 2014-12-18 Amazon Registry Services, Inc. like // lilly : 2015-07-31 Eli Lilly and Company lilly -// limited : 2014-03-06 Big Fest, LLC +// limited : 2014-03-06 Binky Moon, LLC limited -// limo : 2013-10-17 Hidden Frostbite, LLC +// limo : 2013-10-17 Binky Moon, LLC limo // lincoln : 2014-11-13 Ford Motor Company @@ -8725,13 +8858,13 @@ lincoln // linde : 2014-12-04 Linde Aktiengesellschaft linde -// link : 2013-11-14 Uniregistry, Corp. +// link : 2013-11-14 UNR Corp. link // lipsy : 2015-06-25 Lipsy Ltd lipsy -// live : 2014-12-04 +// live : 2014-12-04 Dog Beach, LLC live // living : 2015-07-30 Lifestyle Domain Holdings, Inc. @@ -8740,10 +8873,16 @@ living // lixil : 2015-03-19 LIXIL Group Corporation lixil +// llc : 2017-12-14 Afilias Limited +llc + +// llp : 2019-08-26 UNR Corp. +llp + // loan : 2014-11-20 dot Loan Limited loan -// loans : 2014-03-20 June Woods, LLC +// loans : 2014-03-20 Binky Moon, LLC loans // locker : 2015-06-04 Dish DBS Corporation @@ -8755,7 +8894,7 @@ locus // loft : 2015-07-30 Annco, Inc. loft -// lol : 2015-01-30 Uniregistry, Corp. +// lol : 2015-01-30 UNR Corp. lol // london : 2013-11-14 Dot London Domains Limited @@ -8776,10 +8915,10 @@ lpl // lplfinancial : 2015-07-30 LPL Holdings, Inc. lplfinancial -// ltd : 2014-09-25 Over Corner, LLC +// ltd : 2014-09-25 Binky Moon, LLC ltd -// ltda : 2014-04-17 DOMAIN ROBOT SERVICOS DE HOSPEDAGEM NA INTERNET LTDA +// ltda : 2014-04-17 InterNetX, Corp ltda // lundbeck : 2015-08-06 H. Lundbeck A/S @@ -8788,7 +8927,7 @@ lundbeck // lupin : 2014-11-07 LUPIN LIMITED lupin -// luxe : 2014-01-09 Top Level Domain Holdings Limited +// luxe : 2014-01-09 Minds + Machines Group Limited luxe // luxury : 2013-10-17 Luxury Partners, LLC @@ -8803,28 +8942,31 @@ madrid // maif : 2014-10-02 Mutuelle Assurance Instituteur France (MAIF) maif -// maison : 2013-12-05 Victor Frostbite, LLC +// maison : 2013-12-05 Binky Moon, LLC maison -// makeup : 2015-01-15 L'Oréal +// makeup : 2015-01-15 XYZ.COM LLC makeup // man : 2014-12-04 MAN SE man -// management : 2013-11-07 John Goodbye, LLC +// management : 2013-11-07 Binky Moon, LLC management // mango : 2013-10-24 PUNTO FA S.L. mango -// market : 2014-03-06 +// map : 2016-06-09 Charleston Road Registry Inc. +map + +// market : 2014-03-06 Dog Beach, LLC market -// marketing : 2013-11-07 Fern Pass, LLC +// marketing : 2013-11-07 Binky Moon, LLC marketing -// markets : 2014-12-11 IG Group Holdings PLC +// markets : 2014-12-11 Dotmarkets Registry Limited markets // marriott : 2014-10-09 Marriott Worldwide Corporation @@ -8839,25 +8981,19 @@ maserati // mattel : 2015-08-06 Mattel Sites, Inc. mattel -// mba : 2015-04-02 Lone Hollow, LLC +// mba : 2015-04-02 Binky Moon, LLC mba -// mcd : 2015-07-30 McDonald’s Corporation -mcd - -// mcdonalds : 2015-07-30 McDonald’s Corporation -mcdonalds - // mckinsey : 2015-07-31 McKinsey Holdings, Inc. mckinsey // med : 2015-08-06 Medistry LLC med -// media : 2014-03-06 Grand Glen, LLC +// media : 2014-03-06 Binky Moon, LLC media -// meet : 2014-01-16 +// meet : 2014-01-16 Charleston Road Registry Inc. meet // melbourne : 2014-05-29 The Crown in right of the State of Victoria, represented by its Department of State Development, Business and Innovation @@ -8872,16 +9008,13 @@ memorial // men : 2015-02-26 Exclusive Registry Limited men -// menu : 2013-09-11 Wedding TLD2, LLC +// menu : 2013-09-11 Dot Menu Registry, LLC menu -// meo : 2014-11-07 PT Comunicacoes S.A. -meo +// merckmsd : 2016-07-14 MSD Registry Holdings, Inc. +merckmsd -// metlife : 2015-05-07 MetLife Services and Solutions, LLC -metlife - -// miami : 2013-12-19 Top Level Domain Holdings Limited +// miami : 2013-12-19 Minds + Machines Group Limited miami // microsoft : 2014-12-18 Microsoft Corporation @@ -8908,49 +9041,40 @@ mls // mma : 2014-11-07 MMA IARD mma -// mnet : 2015-03-05 Electronic Media Network (Pty) Ltd -mnet - -// mobily : 2014-12-18 GreenTech Consultancy Company W.L.L. -mobily +// mobile : 2016-06-02 Dish DBS Corporation +mobile -// moda : 2013-11-07 United TLD Holdco Ltd. +// moda : 2013-11-07 Dog Beach, LLC moda // moe : 2013-11-13 Interlink Co., Ltd. moe -// moi : 2014-12-18 Amazon EU S.à r.l. +// moi : 2014-12-18 Amazon Registry Services, Inc. moi -// mom : 2015-04-16 Uniregistry, Corp. +// mom : 2015-04-16 UNR Corp. mom // monash : 2013-09-30 Monash University monash -// money : 2014-10-16 Outer McCook, LLC +// money : 2014-10-16 Binky Moon, LLC money -// monster : 2015-09-11 Monster Worldwide, Inc. +// monster : 2015-09-11 XYZ.COM LLC monster -// montblanc : 2014-06-23 Richemont DNS Inc. -montblanc - -// mopar : 2015-07-30 FCA US LLC. -mopar - -// mormon : 2013-12-05 IRI Domain Management, LLC ("Applicant") +// mormon : 2013-12-05 IRI Domain Management, LLC mormon -// mortgage : 2014-03-20 +// mortgage : 2014-03-20 Dog Beach, LLC mortgage // moscow : 2013-12-19 Foundation for Assistance for Internet Technologies and Infrastructure Development (FAITID) moscow -// moto : 2015-06-04 Charleston Road Registry Inc. +// moto : 2015-06-04 Motorola Trademark Holdings, LLC moto // motorcycles : 2014-01-09 DERMotorcycles, LLC @@ -8959,55 +9083,34 @@ motorcycles // mov : 2014-01-30 Charleston Road Registry Inc. mov -// movie : 2015-02-05 New Frostbite, LLC +// movie : 2015-02-05 Binky Moon, LLC movie -// movistar : 2014-10-16 Telefónica S.A. -movistar - // msd : 2015-07-23 MSD Registry Holdings, Inc. msd // mtn : 2014-12-04 MTN Dubai Limited mtn -// mtpc : 2014-11-20 Mitsubishi Tanabe Pharma Corporation -mtpc - // mtr : 2015-03-12 MTR Corporation Limited mtr -// multichoice : 2015-03-12 MultiChoice (Proprietary) Limited -multichoice - // mutual : 2015-04-02 Northwestern Mutual MU TLD Registry, LLC mutual -// mutuelle : 2015-06-18 Fédération Nationale de la Mutualité Française -mutuelle - -// mzansimagic : 2015-03-05 Electronic Media Network (Pty) Ltd -mzansimagic - // nab : 2015-08-20 National Australia Bank Limited nab -// nadex : 2014-12-11 IG Group Holdings PLC -nadex - // nagoya : 2013-10-24 GMO Registry, Inc. nagoya -// naspers : 2015-02-12 Intelprop (Proprietary) Limited -naspers - // nationwide : 2015-07-23 Nationwide Mutual Insurance Company nationwide // natura : 2015-03-12 NATURA COSMÉTICOS S.A. natura -// navy : 2014-03-06 United TLD Holdco Ltd. +// navy : 2014-03-06 Dog Beach, LLC navy // nba : 2015-07-31 NBA REGISTRY, LLC @@ -9022,7 +9125,7 @@ netbank // netflix : 2015-06-18 Netflix, Inc. netflix -// network : 2013-11-14 Trixy Manor, LLC +// network : 2013-11-14 Binky Moon, LLC network // neustar : 2013-12-05 NeuStar, Inc. @@ -9034,7 +9137,7 @@ new // newholland : 2015-09-03 CNH Industrial N.V. newholland -// news : 2014-12-18 +// news : 2014-12-18 Dog Beach, LLC news // next : 2015-06-18 Next plc @@ -9064,7 +9167,7 @@ nike // nikon : 2015-05-21 NIKON CORPORATION nikon -// ninja : 2013-11-07 United TLD Holdco Ltd. +// ninja : 2013-11-07 Dog Beach, LLC ninja // nissan : 2014-03-27 NISSAN MOTOR CO., LTD. @@ -9079,10 +9182,10 @@ nokia // northwesternmutual : 2015-06-18 Northwestern Mutual Registry, LLC northwesternmutual -// norton : 2014-12-04 Symantec Corporation +// norton : 2014-12-04 NortonLifeLock Inc. norton -// now : 2015-06-25 Amazon EU S.à r.l. +// now : 2015-06-25 Amazon Registry Services, Inc. now // nowruz : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. @@ -9106,7 +9209,7 @@ nyc // obi : 2014-09-25 OBI Group Holding SE & Co. KGaA obi -// observer : 2015-04-30 Guardian News and Media Limited +// observer : 2015-04-30 Top Level Spectrum, Inc. observer // off : 2015-07-23 Johnson Shareholdings, Inc. @@ -9115,7 +9218,7 @@ off // office : 2015-03-12 Microsoft Corporation office -// okinawa : 2013-12-05 BusinessRalliart Inc. +// okinawa : 2013-12-05 BRregistry, Inc. okinawa // olayan : 2015-05-14 Crescent Holding GmbH @@ -9148,7 +9251,7 @@ online // onyourside : 2015-07-23 Nationwide Mutual Insurance Company onyourside -// ooo : 2014-01-09 INFIBEAM INCORPORATION LIMITED +// ooo : 2014-01-09 INFIBEAM AVENUES LIMITED ooo // open : 2015-07-31 American Express Travel Related Services Company, Inc. @@ -9163,13 +9266,10 @@ orange // organic : 2014-03-27 Afilias Limited organic -// orientexpress : 2015-02-05 Belmond Ltd. -orientexpress - // origins : 2015-10-01 The Estée Lauder Companies Inc. origins -// osaka : 2014-09-04 Interlink Co., Ltd. +// osaka : 2014-09-04 Osaka Registry Co., Ltd. osaka // otsuka : 2013-10-11 Otsuka Holdings Co., Ltd. @@ -9178,31 +9278,25 @@ otsuka // ott : 2015-06-04 Dish DBS Corporation ott -// ovh : 2014-01-16 OVH SAS +// ovh : 2014-01-16 MédiaBC ovh // page : 2014-12-04 Charleston Road Registry Inc. page -// pamperedchef : 2015-02-05 The Pampered Chef, Ltd. -pamperedchef - // panasonic : 2015-07-30 Panasonic Corporation panasonic -// panerai : 2014-11-07 Richemont DNS Inc. -panerai - // paris : 2014-01-30 City of Paris paris // pars : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. pars -// partners : 2013-12-05 Magic Glen, LLC +// partners : 2013-12-05 Binky Moon, LLC partners -// parts : 2013-12-05 Sea Goodbye, LLC +// parts : 2013-12-05 Binky Moon, LLC parts // party : 2014-09-11 Blue Sky Registry Limited @@ -9211,16 +9305,13 @@ party // passagens : 2015-03-05 Travel Reservations SRL passagens -// pay : 2015-08-27 Amazon EU S.à r.l. +// pay : 2015-08-27 Amazon Registry Services, Inc. pay -// payu : 2015-02-12 MIH PayU B.V. -payu - // pccw : 2015-05-14 PCCW Enterprises Limited pccw -// pet : 2015-05-07 Afilias plc +// pet : 2015-05-07 Afilias Limited pet // pfizer : 2015-09-11 Pfizer Inc. @@ -9229,37 +9320,40 @@ pfizer // pharmacy : 2014-06-19 National Association of Boards of Pharmacy pharmacy +// phd : 2016-07-28 Charleston Road Registry Inc. +phd + // philips : 2014-11-07 Koninklijke Philips N.V. philips -// photo : 2013-11-14 Uniregistry, Corp. +// phone : 2016-06-02 Dish DBS Corporation +phone + +// photo : 2013-11-14 UNR Corp. photo -// photography : 2013-09-20 Sugar Glen, LLC +// photography : 2013-09-20 Binky Moon, LLC photography -// photos : 2013-10-17 Sea Corner, LLC +// photos : 2013-10-17 Binky Moon, LLC photos // physio : 2014-05-01 PhysBiz Pty Ltd physio -// piaget : 2014-10-16 Richemont DNS Inc. -piaget - -// pics : 2013-11-14 Uniregistry, Corp. +// pics : 2013-11-14 UNR Corp. pics // pictet : 2014-06-26 Pictet Europe S.A. pictet -// pictures : 2014-03-06 Foggy Sky, LLC +// pictures : 2014-03-06 Binky Moon, LLC pictures // pid : 2015-01-08 Top Level Spectrum, Inc. pid -// pin : 2014-12-18 Amazon EU S.à r.l. +// pin : 2014-12-18 Amazon Registry Services, Inc. pin // ping : 2015-06-11 Ping Registry Provider, Inc. @@ -9271,22 +9365,22 @@ pink // pioneer : 2015-07-16 Pioneer Corporation pioneer -// pizza : 2014-06-26 Foggy Moon, LLC +// pizza : 2014-06-26 Binky Moon, LLC pizza -// place : 2014-04-24 Snow Galley, LLC +// place : 2014-04-24 Binky Moon, LLC place // play : 2015-03-05 Charleston Road Registry Inc. play -// playstation : 2015-07-02 Sony Computer Entertainment Inc. +// playstation : 2015-07-02 Sony Interactive Entertainment Inc. playstation -// plumbing : 2013-09-10 Spring Tigers, LLC +// plumbing : 2013-09-10 Binky Moon, LLC plumbing -// plus : 2015-02-05 Sugar Mill, LLC +// plus : 2015-02-05 Binky Moon, LLC plus // pnc : 2015-07-02 PNC Domain Co., LLC @@ -9295,7 +9389,7 @@ pnc // pohl : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG pohl -// poker : 2014-07-03 Afilias Domains No. 5 Limited +// poker : 2014-07-03 Afilias Limited poker // politie : 2015-08-20 Politie Nederland @@ -9313,13 +9407,13 @@ praxi // press : 2014-04-03 DotPress Inc. press -// prime : 2015-06-25 Amazon EU S.à r.l. +// prime : 2015-06-25 Amazon Registry Services, Inc. prime // prod : 2014-01-23 Charleston Road Registry Inc. prod -// productions : 2013-12-05 Magic Birch, LLC +// productions : 2013-12-05 Binky Moon, LLC productions // prof : 2014-07-24 Charleston Road Registry Inc. @@ -9328,16 +9422,16 @@ prof // progressive : 2015-07-23 Progressive Casualty Insurance Company progressive -// promo : 2014-12-18 +// promo : 2014-12-18 Afilias Limited promo -// properties : 2013-12-05 Big Pass, LLC +// properties : 2013-12-05 Binky Moon, LLC properties -// property : 2014-05-22 Uniregistry, Corp. +// property : 2014-05-22 UNR Corp. property -// protection : 2015-04-23 +// protection : 2015-04-23 XYZ.COM LLC protection // pru : 2015-07-30 Prudential Financial, Inc. @@ -9346,7 +9440,7 @@ pru // prudential : 2015-07-30 Prudential Financial, Inc. prudential -// pub : 2013-12-12 United TLD Holdco Ltd. +// pub : 2013-12-12 Dog Beach, LLC pub // pwc : 2015-10-29 PricewaterhouseCoopers LLP @@ -9358,7 +9452,7 @@ qpon // quebec : 2013-12-19 PointQuébec Inc quebec -// quest : 2015-03-26 Quest ION Limited +// quest : 2015-03-26 XYZ.COM LLC quest // qvc : 2015-07-30 QVC, Inc. @@ -9367,10 +9461,13 @@ qvc // racing : 2014-12-04 Premier Registry Limited racing +// radio : 2016-07-21 European Broadcasting Union (EBU) +radio + // raid : 2015-07-23 Johnson Shareholdings, Inc. raid -// read : 2014-12-18 Amazon EU S.à r.l. +// read : 2014-12-18 Amazon Registry Services, Inc. read // realestate : 2015-09-11 dotRealEstate LLC @@ -9382,7 +9479,7 @@ realtor // realty : 2015-03-19 Fegistry, LLC realty -// recipes : 2013-10-17 Grand Island, LLC +// recipes : 2013-10-17 Binky Moon, LLC recipes // red : 2013-11-07 Afilias Limited @@ -9394,13 +9491,13 @@ redstone // redumbrella : 2015-03-26 Travelers TLD, LLC redumbrella -// rehab : 2014-03-06 United TLD Holdco Ltd. +// rehab : 2014-03-06 Dog Beach, LLC rehab -// reise : 2014-03-13 +// reise : 2014-03-13 Binky Moon, LLC reise -// reisen : 2014-03-06 New Cypress, LLC +// reisen : 2014-03-06 Binky Moon, LLC reisen // reit : 2014-09-04 National Association of Real Estate Investment Trusts, Inc. @@ -9409,34 +9506,34 @@ reit // reliance : 2015-04-02 Reliance Industries Limited reliance -// ren : 2013-12-12 Beijing Qianxiang Wangjing Technology Development Co., Ltd. +// ren : 2013-12-12 ZDNS International Limited ren -// rent : 2014-12-04 DERRent, LLC +// rent : 2014-12-04 XYZ.COM LLC rent -// rentals : 2013-12-05 Big Hollow,LLC +// rentals : 2013-12-05 Binky Moon, LLC rentals -// repair : 2013-11-07 Lone Sunset, LLC +// repair : 2013-11-07 Binky Moon, LLC repair -// report : 2013-12-05 Binky Glen, LLC +// report : 2013-12-05 Binky Moon, LLC report -// republican : 2014-03-20 United TLD Holdco Ltd. +// republican : 2014-03-20 Dog Beach, LLC republican // rest : 2013-12-19 Punto 2012 Sociedad Anonima Promotora de Inversion de Capital Variable rest -// restaurant : 2014-07-03 Snow Avenue, LLC +// restaurant : 2014-07-03 Binky Moon, LLC restaurant // review : 2014-11-20 dot Review Limited review -// reviews : 2013-09-13 +// reviews : 2013-09-13 Dog Beach, LLC reviews // rexroth : 2015-06-18 Robert Bosch GMBH @@ -9451,16 +9548,13 @@ richardli // ricoh : 2014-11-20 Ricoh Company, Ltd. ricoh -// rightathome : 2015-07-23 Johnson Shareholdings, Inc. -rightathome - // ril : 2015-04-02 Reliance Industries Limited ril // rio : 2014-02-27 Empresa Municipal de Informática SA - IPLANRIO rio -// rip : 2014-07-10 United TLD Holdco Ltd. +// rip : 2014-07-10 Dog Beach, LLC rip // rmit : 2015-11-19 Royal Melbourne Institute of Technology @@ -9469,37 +9563,40 @@ rmit // rocher : 2014-12-18 Ferrero Trading Lux S.A. rocher -// rocks : 2013-11-14 +// rocks : 2013-11-14 Dog Beach, LLC rocks -// rodeo : 2013-12-19 Top Level Domain Holdings Limited +// rodeo : 2013-12-19 Minds + Machines Group Limited rodeo -// rogers : 2015-08-06 Rogers Communications Partnership +// rogers : 2015-08-06 Rogers Communications Canada Inc. rogers -// room : 2014-12-18 Amazon EU S.à r.l. +// room : 2014-12-18 Amazon Registry Services, Inc. room // rsvp : 2014-05-08 Charleston Road Registry Inc. rsvp +// rugby : 2016-12-15 World Rugby Strategic Developments Limited +rugby + // ruhr : 2013-10-02 regiodot GmbH & Co. KG ruhr -// run : 2015-03-19 Snow Park, LLC +// run : 2015-03-19 Binky Moon, LLC run // rwe : 2015-04-02 RWE AG rwe -// ryukyu : 2014-01-09 BusinessRalliart Inc. +// ryukyu : 2014-01-09 BRregistry, Inc. ryukyu // saarland : 2013-12-12 dotSaarland GmbH saarland -// safe : 2014-12-18 Amazon EU S.à r.l. +// safe : 2014-12-18 Amazon Registry Services, Inc. safe // safety : 2015-01-08 Safety Registry Services, LLC. @@ -9508,10 +9605,10 @@ safety // sakura : 2014-12-18 SAKURA Internet Inc. sakura -// sale : 2014-10-16 +// sale : 2014-10-16 Dog Beach, LLC sale -// salon : 2014-12-11 Outer Orchard, LLC +// salon : 2014-12-11 Binky Moon, LLC salon // samsclub : 2015-07-31 Wal-Mart Stores, Inc. @@ -9532,16 +9629,13 @@ sanofi // sap : 2014-03-27 SAP AG sap -// sapo : 2014-11-07 PT Comunicacoes S.A. -sapo - -// sarl : 2014-07-03 Delta Orchard, LLC +// sarl : 2014-07-03 Binky Moon, LLC sarl // sas : 2015-04-02 Research IP LLC sas -// save : 2015-06-25 Amazon EU S.à r.l. +// save : 2015-06-25 Amazon Registry Services, Inc. save // saxo : 2014-10-31 Saxo Bank A/S @@ -9562,16 +9656,16 @@ scb // schaeffler : 2015-08-06 Schaeffler Technologies AG & Co. KG schaeffler -// schmidt : 2014-04-03 SALM S.A.S. +// schmidt : 2014-04-03 SCHMIDT GROUPE S.A.S. schmidt // scholarships : 2014-04-24 Scholarships.com, LLC scholarships -// school : 2014-12-18 Little Galley, LLC +// school : 2014-12-18 Binky Moon, LLC school -// schule : 2014-03-06 Outer Moon, LLC +// schule : 2014-03-06 Binky Moon, LLC schule // schwarz : 2014-09-18 Schwarz Domains und Services GmbH & Co. KG @@ -9583,31 +9677,31 @@ science // scjohnson : 2015-07-23 Johnson Shareholdings, Inc. scjohnson -// scor : 2014-10-31 SCOR SE -scor - // scot : 2014-01-23 Dot Scot Registry Limited scot +// search : 2016-06-09 Charleston Road Registry Inc. +search + // seat : 2014-05-22 SEAT, S.A. (Sociedad Unipersonal) seat -// secure : 2015-08-27 Amazon EU S.à r.l. +// secure : 2015-08-27 Amazon Registry Services, Inc. secure -// security : 2015-05-14 +// security : 2015-05-14 XYZ.COM LLC security // seek : 2014-12-04 Seek Limited seek -// select : 2015-10-08 iSelect Ltd +// select : 2015-10-08 Registry Services, LLC select // sener : 2014-10-24 Sener Ingeniería y Sistemas, S.A. sener -// services : 2014-02-27 Fox Castle, LLC +// services : 2014-02-27 Binky Moon, LLC services // ses : 2015-07-23 SES @@ -9622,7 +9716,7 @@ sew // sex : 2014-11-13 ICM Registry SX LLC sex -// sexy : 2013-09-11 Uniregistry, Corp. +// sexy : 2013-09-11 UNR Corp. sexy // sfr : 2015-08-13 Societe Francaise du Radiotelephone - SFR @@ -9646,13 +9740,19 @@ shia // shiksha : 2013-11-14 Afilias Limited shiksha -// shoes : 2013-10-02 Binky Galley, LLC +// shoes : 2013-10-02 Binky Moon, LLC shoes -// shouji : 2015-01-08 QIHOO 360 TECHNOLOGY CO. LTD. +// shop : 2016-04-08 GMO Registry, Inc. +shop + +// shopping : 2016-03-31 Binky Moon, LLC +shopping + +// shouji : 2015-01-08 Beijing Qihu Keji Co., Ltd. shouji -// show : 2015-03-05 Snow Beach, LLC +// show : 2015-03-05 Binky Moon, LLC show // showtime : 2015-08-06 CBS Domains Inc. @@ -9661,64 +9761,64 @@ showtime // shriram : 2014-01-23 Shriram Capital Ltd. shriram -// silk : 2015-06-25 Amazon EU S.à r.l. +// silk : 2015-06-25 Amazon Registry Services, Inc. silk // sina : 2015-03-12 Sina Corporation sina -// singles : 2013-08-27 Fern Madison, LLC +// singles : 2013-08-27 Binky Moon, LLC singles // site : 2015-01-15 DotSite Inc. site -// ski : 2015-04-09 STARTING DOT LIMITED +// ski : 2015-04-09 Afilias Limited ski -// skin : 2015-01-15 L'Oréal +// skin : 2015-01-15 XYZ.COM LLC skin -// sky : 2014-06-19 Sky IP International Ltd, a company incorporated in England and Wales, operating via its registered Swiss branch +// sky : 2014-06-19 Sky International AG sky // skype : 2014-12-18 Microsoft Corporation skype -// sling : 2015-07-30 Hughes Satellite Systems Corporation +// sling : 2015-07-30 DISH Technologies L.L.C. sling // smart : 2015-07-09 Smart Communications, Inc. (SMART) smart -// smile : 2014-12-18 Amazon EU S.à r.l. +// smile : 2014-12-18 Amazon Registry Services, Inc. smile // sncf : 2015-02-19 Société Nationale des Chemins de fer Francais S N C F sncf -// soccer : 2015-03-26 Foggy Shadow, LLC +// soccer : 2015-03-26 Binky Moon, LLC soccer -// social : 2013-11-07 United TLD Holdco Ltd. +// social : 2013-11-07 Dog Beach, LLC social -// softbank : 2015-07-02 SoftBank Corp. +// softbank : 2015-07-02 SoftBank Group Corp. softbank -// software : 2014-03-20 +// software : 2014-03-20 Dog Beach, LLC software // sohu : 2013-12-19 Sohu.com Limited sohu -// solar : 2013-11-07 Ruby Town, LLC +// solar : 2013-11-07 Binky Moon, LLC solar -// solutions : 2013-11-07 Silver Cover, LLC +// solutions : 2013-11-07 Binky Moon, LLC solutions -// song : 2015-02-26 Amazon EU S.à r.l. +// song : 2015-02-26 Amazon Registry Services, Inc. song // sony : 2015-01-08 Sony Corporation @@ -9727,24 +9827,24 @@ sony // soy : 2014-01-23 Charleston Road Registry Inc. soy +// spa : 2019-09-19 Asia Spa and Wellness Promotion Council Limited +spa + // space : 2014-04-03 DotSpace Inc. space -// spiegel : 2014-02-05 SPIEGEL-Verlag Rudolf Augstein GmbH & Co. KG -spiegel +// sport : 2017-11-16 Global Association of International Sports Federations (GAISF) +sport -// spot : 2015-02-26 Amazon EU S.à r.l. +// spot : 2015-02-26 Amazon Registry Services, Inc. spot -// spreadbetting : 2014-12-11 IG Group Holdings PLC +// spreadbetting : 2014-12-11 Dotspreadbetting Registry Limited spreadbetting -// srl : 2015-05-07 mySRL GmbH +// srl : 2015-05-07 InterNetX, Corp srl -// srt : 2015-07-30 FCA US LLC. -srt - // stada : 2014-11-13 STADA Arzneimittel AG stada @@ -9754,18 +9854,12 @@ staples // star : 2015-01-08 Star India Private Limited star -// starhub : 2015-02-05 StarHub Ltd -starhub - // statebank : 2015-03-12 STATE BANK OF INDIA statebank // statefarm : 2015-07-30 State Farm Mutual Automobile Insurance Company statefarm -// statoil : 2014-12-04 Statoil ASA -statoil - // stc : 2014-10-09 Saudi Telecom Company stc @@ -9775,13 +9869,16 @@ stcgroup // stockholm : 2014-12-18 Stockholms kommun stockholm -// storage : 2014-12-22 Self Storage Company LLC +// storage : 2014-12-22 XYZ.COM LLC storage // store : 2015-04-09 DotStore Inc. store -// studio : 2015-02-11 +// stream : 2016-01-08 dot Stream Limited +stream + +// studio : 2015-02-11 Dog Beach, LLC studio // study : 2014-12-11 OPEN UNIVERSITIES AUSTRALIA PTY LTD @@ -9790,25 +9887,22 @@ study // style : 2014-12-04 Binky Moon, LLC style -// sucks : 2014-12-22 Vox Populi Registry Inc. +// sucks : 2014-12-22 Vox Populi Registry Ltd. sucks -// supersport : 2015-03-05 SuperSport International Holdings Proprietary Limited -supersport - -// supplies : 2013-12-19 Atomic Fields, LLC +// supplies : 2013-12-19 Binky Moon, LLC supplies -// supply : 2013-12-19 Half Falls, LLC +// supply : 2013-12-19 Binky Moon, LLC supply -// support : 2013-10-24 Grand Orchard, LLC +// support : 2013-10-24 Binky Moon, LLC support -// surf : 2014-01-09 Top Level Domain Holdings Limited +// surf : 2014-01-09 Minds + Machines Group Limited surf -// surgery : 2014-03-20 Tin Avenue, LLC +// surgery : 2014-03-20 Binky Moon, LLC surgery // suzuki : 2014-02-20 SUZUKI MOTOR CORPORATION @@ -9826,10 +9920,7 @@ swiss // sydney : 2014-09-18 State of New South Wales, Department of Premier and Cabinet sydney -// symantec : 2014-12-04 Symantec Corporation -symantec - -// systems : 2013-11-07 Dash Cypress, LLC +// systems : 2013-11-07 Binky Moon, LLC systems // tab : 2014-12-04 Tabcorp Holdings Limited @@ -9838,7 +9929,7 @@ tab // taipei : 2014-07-10 Taipei City Government taipei -// talk : 2015-04-09 Amazon EU S.à r.l. +// talk : 2015-04-09 Amazon Registry Services, Inc. talk // taobao : 2015-01-15 Alibaba Group Holding Limited @@ -9853,13 +9944,13 @@ tatamotors // tatar : 2014-04-24 Limited Liability Company "Coordination Center of Regional Domain of Tatarstan Republic" tatar -// tattoo : 2013-08-30 Uniregistry, Corp. +// tattoo : 2013-08-30 UNR Corp. tattoo -// tax : 2014-03-20 Storm Orchard, LLC +// tax : 2014-03-20 Binky Moon, LLC tax -// taxi : 2015-03-19 Pine Falls, LLC +// taxi : 2015-03-19 Binky Moon, LLC taxi // tci : 2014-09-12 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. @@ -9868,58 +9959,49 @@ tci // tdk : 2015-06-11 TDK Corporation tdk -// team : 2015-03-05 Atomic Lake, LLC +// team : 2015-03-05 Binky Moon, LLC team -// tech : 2015-01-30 Dot Tech LLC +// tech : 2015-01-30 Personals TLD Inc. tech -// technology : 2013-09-13 Auburn Falls +// technology : 2013-09-13 Binky Moon, LLC technology -// telecity : 2015-02-19 TelecityGroup International Limited -telecity - -// telefonica : 2014-10-16 Telefónica S.A. -telefonica - // temasek : 2014-08-07 Temasek Holdings (Private) Limited temasek -// tennis : 2014-12-04 Cotton Bloom, LLC +// tennis : 2014-12-04 Binky Moon, LLC tennis // teva : 2015-07-02 Teva Pharmaceutical Industries Limited teva -// thd : 2015-04-02 Homer TLC, Inc. +// thd : 2015-04-02 Home Depot Product Authority, LLC thd -// theater : 2015-03-19 Blue Tigers, LLC +// theater : 2015-03-19 Binky Moon, LLC theater -// theatre : 2015-05-07 +// theatre : 2015-05-07 XYZ.COM LLC theatre -// theguardian : 2015-04-30 Guardian News and Media Limited -theguardian - // tiaa : 2015-07-23 Teachers Insurance and Annuity Association of America tiaa // tickets : 2015-02-05 Accent Media Limited tickets -// tienda : 2013-11-14 Victor Manor, LLC +// tienda : 2013-11-14 Binky Moon, LLC tienda // tiffany : 2015-01-30 Tiffany and Company tiffany -// tips : 2013-09-20 Corn Willow, LLC +// tips : 2013-09-20 Binky Moon, LLC tips -// tires : 2014-11-07 Dog Edge, LLC +// tires : 2014-11-07 Binky Moon, LLC tires // tirol : 2014-04-24 punkt Tirol GmbH @@ -9937,16 +10019,16 @@ tkmaxx // tmall : 2015-01-15 Alibaba Group Holding Limited tmall -// today : 2013-09-20 Pearl Woods, LLC +// today : 2013-09-20 Binky Moon, LLC today // tokyo : 2013-11-13 GMO Registry, Inc. tokyo -// tools : 2013-11-21 Pioneer North, LLC +// tools : 2013-11-21 Binky Moon, LLC tools -// top : 2014-03-20 Jiangsu Bangning Science & Technology Co.,Ltd. +// top : 2014-03-20 .TOP Registry top // toray : 2014-12-18 Toray Industries, Inc. @@ -9958,27 +10040,30 @@ toshiba // total : 2015-08-06 Total SA total -// tours : 2015-01-22 Sugar Station, LLC +// tours : 2015-01-22 Binky Moon, LLC tours -// town : 2014-03-06 Koko Moon, LLC +// town : 2014-03-06 Binky Moon, LLC town // toyota : 2015-04-23 TOYOTA MOTOR CORPORATION toyota -// toys : 2014-03-06 Pioneer Orchard, LLC +// toys : 2014-03-06 Binky Moon, LLC toys // trade : 2014-01-23 Elite Registry Limited trade -// trading : 2014-12-11 IG Group Holdings PLC +// trading : 2014-12-11 Dottrading Registry Limited trading -// training : 2013-11-07 Wild Willow, LLC +// training : 2013-11-07 Binky Moon, LLC training +// travel : 2015-10-09 Dog Beach, LLC +travel + // travelchannel : 2015-07-02 Lifestyle Domain Holdings, Inc. travelchannel @@ -9988,7 +10073,7 @@ travelers // travelersinsurance : 2015-03-26 Travelers TLD, LLC travelersinsurance -// trust : 2014-10-16 +// trust : 2014-10-16 NCC Group Domain Services, Inc. trust // trv : 2015-03-26 Travelers TLD, LLC @@ -10000,10 +10085,10 @@ tube // tui : 2014-07-03 TUI AG tui -// tunes : 2015-02-26 Amazon EU S.à r.l. +// tunes : 2015-02-26 Amazon Registry Services, Inc. tunes -// tushu : 2014-12-18 Amazon EU S.à r.l. +// tushu : 2014-12-18 Amazon Registry Services, Inc. tushu // tvs : 2015-02-19 T V SUNDRAM IYENGAR & SONS LIMITED @@ -10015,16 +10100,13 @@ ubank // ubs : 2014-12-11 UBS AG ubs -// uconnect : 2015-07-30 FCA US LLC. -uconnect - // unicom : 2015-10-15 China United Network Communications Corporation Limited unicom -// university : 2014-03-06 Little Station, LLC +// university : 2014-03-06 Binky Moon, LLC university -// uno : 2013-09-11 Dot Latin LLC +// uno : 2013-09-11 DotSite Inc. uno // uol : 2014-05-01 UBN INTERNET LTDA. @@ -10033,7 +10115,7 @@ uol // ups : 2015-06-25 UPS Market Driver, Inc. ups -// vacations : 2013-12-05 Atomic Tigers, LLC +// vacations : 2013-12-05 Binky Moon, LLC vacations // vana : 2014-12-11 Lifestyle Domain Holdings, Inc. @@ -10045,22 +10127,22 @@ vanguard // vegas : 2014-01-16 Dot Vegas, Inc. vegas -// ventures : 2013-08-27 Binky Lake, LLC +// ventures : 2013-08-27 Binky Moon, LLC ventures // verisign : 2015-08-13 VeriSign, Inc. verisign -// versicherung : 2014-03-20 dotversicherung-registry GmbH +// versicherung : 2014-03-20 tldbox GmbH versicherung -// vet : 2014-03-06 +// vet : 2014-03-06 Dog Beach, LLC vet -// viajes : 2013-10-17 Black Madison, LLC +// viajes : 2013-10-17 Binky Moon, LLC viajes -// video : 2014-10-16 +// video : 2014-10-16 Dog Beach, LLC video // vig : 2015-05-14 VIENNA INSURANCE GROUP AG Wiener Versicherung Gruppe @@ -10069,10 +10151,10 @@ vig // viking : 2015-04-02 Viking River Cruises (Bermuda) Ltd. viking -// villas : 2013-12-05 New Sky, LLC +// villas : 2013-12-05 Binky Moon, LLC villas -// vin : 2015-06-18 Holly Shadow, LLC +// vin : 2015-06-18 Binky Moon, LLC vin // vip : 2015-01-22 Minds + Machines Group Limited @@ -10084,15 +10166,9 @@ virgin // visa : 2015-07-30 Visa Worldwide Pte. Limited visa -// vision : 2013-12-05 Koko Station, LLC +// vision : 2013-12-05 Binky Moon, LLC vision -// vista : 2014-09-18 Vistaprint Limited -vista - -// vistaprint : 2014-09-18 Vistaprint Limited -vistaprint - // viva : 2014-11-07 Saudi Telecom Company viva @@ -10102,7 +10178,7 @@ vivo // vlaanderen : 2014-02-06 DNS.be vzw vlaanderen -// vodka : 2013-12-19 Top Level Domain Holdings Limited +// vodka : 2013-12-19 Minds + Machines Group Limited vodka // volkswagen : 2015-05-14 Volkswagen Group of America Inc. @@ -10120,7 +10196,7 @@ voting // voto : 2013-11-21 Monolith Registry LLC voto -// voyage : 2013-08-27 Ruby House, LLC +// voyage : 2013-08-27 Binky Moon, LLC voyage // vuelos : 2015-03-05 Travel Reservations SRL @@ -10135,25 +10211,22 @@ walmart // walter : 2014-11-13 Sandvik AB walter -// wang : 2013-10-24 Zodiac Leo Limited +// wang : 2013-10-24 Zodiac Wang Limited wang -// wanggou : 2014-12-18 Amazon EU S.à r.l. +// wanggou : 2014-12-18 Amazon Registry Services, Inc. wanggou -// warman : 2015-06-18 Weir Group IP Limited -warman - -// watch : 2013-11-14 Sand Shadow, LLC +// watch : 2013-11-14 Binky Moon, LLC watch // watches : 2014-12-22 Richemont DNS Inc. watches -// weather : 2015-01-08 The Weather Channel, LLC +// weather : 2015-01-08 International Business Machines Corporation weather -// weatherchannel : 2015-03-12 The Weather Channel, LLC +// weatherchannel : 2015-03-12 International Business Machines Corporation weatherchannel // webcam : 2014-01-23 dot Webcam Limited @@ -10165,10 +10238,7 @@ weber // website : 2014-04-03 DotWebsite Inc. website -// wed : 2013-10-01 Atgron, Inc. -wed - -// wedding : 2014-04-24 Top Level Domain Holdings Limited +// wedding : 2014-04-24 Minds + Machines Group Limited wedding // weibo : 2015-03-05 Sina Corporation @@ -10195,7 +10265,7 @@ win // windows : 2014-12-18 Microsoft Corporation windows -// wine : 2015-06-18 June Station, LLC +// wine : 2015-06-18 Binky Moon, LLC wine // winners : 2015-07-16 The TJX Companies, Inc. @@ -10210,22 +10280,22 @@ wolterskluwer // woodside : 2015-07-09 Woodside Petroleum Limited woodside -// work : 2013-12-19 Top Level Domain Holdings Limited +// work : 2013-12-19 Minds + Machines Group Limited work -// works : 2013-11-14 Little Dynamite, LLC +// works : 2013-11-14 Binky Moon, LLC works -// world : 2014-06-12 Bitter Fields, LLC +// world : 2014-06-12 Binky Moon, LLC world -// wow : 2015-10-08 Amazon EU S.à r.l. +// wow : 2015-10-08 Amazon Registry Services, Inc. wow // wtc : 2013-12-19 World Trade Centers Association, Inc. wtc -// wtf : 2014-03-06 Hidden Way, LLC +// wtf : 2014-03-06 Binky Moon, LLC wtf // xbox : 2014-12-18 Microsoft Corporation @@ -10237,7 +10307,7 @@ xerox // xfinity : 2015-07-09 Comcast IP Holdings I, LLC xfinity -// xihuan : 2015-01-08 QIHOO 360 TECHNOLOGY CO. LTD. +// xihuan : 2015-01-08 Beijing Qihu Keji Co., Ltd. xihuan // xin : 2014-12-11 Elegant Leader Limited @@ -10246,7 +10316,7 @@ xin // xn--11b4c3d : 2015-01-15 VeriSign Sarl कॉम -// xn--1ck2e1b : 2015-02-26 Amazon EU S.à r.l. +// xn--1ck2e1b : 2015-02-26 Amazon Registry Services, Inc. セール // xn--1qqw23a : 2014-01-09 Guangzhou YU Wei Information Technology Co., Ltd. @@ -10258,7 +10328,7 @@ xin // xn--3bst00m : 2013-09-13 Eagle Horizon Limited 集团 -// xn--3ds443g : 2013-09-08 TLD REGISTRY LIMITED +// xn--3ds443g : 2013-09-08 TLD REGISTRY LIMITED OY 在线 // xn--3oq18vl8pn36a : 2015-07-02 Volkswagen (China) Investment Co., Ltd. @@ -10270,19 +10340,16 @@ xin // xn--42c2d9a : 2015-01-15 VeriSign Sarl คอม -// xn--45q11c : 2013-11-21 Zodiac Scorpio Limited +// xn--45q11c : 2013-11-21 Zodiac Gemini Ltd 八卦 -// xn--4gbrim : 2013-10-04 Suhub Electronic Establishment +// xn--4gbrim : 2013-10-04 Fans TLD Limited موقع -// xn--4gq48lf9j : 2015-07-31 Wal-Mart Stores, Inc. -一号店 - // xn--55qw42g : 2013-11-08 China Organizational Name Administration Center 公益 -// xn--55qx5d : 2013-11-14 Computer Network Information Center of Chinese Academy of Sciences (China Internet Network Information Center) +// xn--55qx5d : 2013-11-14 China Internet Network Information Center (CNNIC) 公司 // xn--5su34j936bgsg : 2015-09-03 Shangri‐La International Hotel Management Limited @@ -10324,7 +10391,7 @@ xin // xn--b4w605ferd : 2014-08-07 Temasek Holdings (Private) Limited 淡马锡 -// xn--bck1b9a5dre4c : 2015-02-26 Amazon EU S.à r.l. +// xn--bck1b9a5dre4c : 2015-02-26 Amazon Registry Services, Inc. ファッション // xn--c1avg : 2013-11-14 Public Interest Registry @@ -10333,46 +10400,46 @@ xin // xn--c2br7g : 2015-01-15 VeriSign Sarl नेट -// xn--cck2b3b : 2015-02-26 Amazon EU S.à r.l. +// xn--cck2b3b : 2015-02-26 Amazon Registry Services, Inc. ストア +// xn--cckwcxetd : 2019-12-19 Amazon Registry Services, Inc. +アマゾン + // xn--cg4bki : 2013-09-27 SAMSUNG SDS CO., LTD 삼성 -// xn--czr694b : 2014-01-16 HU YI GLOBAL INFORMATION RESOURCES (HOLDING) COMPANY. HONGKONG LIMITED +// xn--czr694b : 2014-01-16 Internet DotTrademark Organisation Limited 商标 -// xn--czrs0t : 2013-12-19 Wild Island, LLC +// xn--czrs0t : 2013-12-19 Binky Moon, LLC 商店 -// xn--czru2d : 2013-11-21 Zodiac Capricorn Limited +// xn--czru2d : 2013-11-21 Zodiac Aquarius Limited 商城 // xn--d1acj3b : 2013-11-20 The Foundation for Network Initiatives “The Smart Internet” дети -// xn--eckvdtc9d : 2014-12-18 Amazon EU S.à r.l. +// xn--eckvdtc9d : 2014-12-18 Amazon Registry Services, Inc. ポイント -// xn--efvy88h : 2014-08-22 Xinhua News Agency Guangdong Branch 新华通讯社广东分社 +// xn--efvy88h : 2014-08-22 Guangzhou YU Wei Information Technology Co., Ltd. 新闻 -// xn--estv75g : 2015-02-19 Industrial and Commercial Bank of China Limited -工行 - -// xn--fct429k : 2015-04-09 Amazon EU S.à r.l. +// xn--fct429k : 2015-04-09 Amazon Registry Services, Inc. 家電 // xn--fhbei : 2015-01-15 VeriSign Sarl كوم -// xn--fiq228c5hs : 2013-09-08 TLD REGISTRY LIMITED +// xn--fiq228c5hs : 2013-09-08 TLD REGISTRY LIMITED OY 中文网 // xn--fiq64b : 2013-10-14 CITIC Group Corporation 中信 -// xn--fjq720a : 2014-05-22 Will Bloom, LLC +// xn--fjq720a : 2014-05-22 Binky Moon, LLC 娱乐 // xn--flw351e : 2014-07-31 Charleston Road Registry Inc. @@ -10381,42 +10448,42 @@ xin // xn--fzys8d69uvgm : 2015-05-14 PCCW Enterprises Limited 電訊盈科 -// xn--g2xx48c : 2015-01-30 Minds + Machines Group Limited +// xn--g2xx48c : 2015-01-30 Nawang Heli(Xiamen) Network Service Co., LTD. 购物 -// xn--gckr3f0f : 2015-02-26 Amazon EU S.à r.l. +// xn--gckr3f0f : 2015-02-26 Amazon Registry Services, Inc. クラウド -// xn--gk3at1e : 2015-10-08 Amazon EU S.à r.l. +// xn--gk3at1e : 2015-10-08 Amazon Registry Services, Inc. 通販 -// xn--hxt814e : 2014-05-15 Zodiac Libra Limited +// xn--hxt814e : 2014-05-15 Zodiac Taurus Limited 网店 // xn--i1b6b1a6a2e : 2013-11-14 Public Interest Registry संगठन -// xn--imr513n : 2014-12-11 HU YI GLOBAL INFORMATION RESOURCES (HOLDING) COMPANY. HONGKONG LIMITED +// xn--imr513n : 2014-12-11 Internet DotTrademark Organisation Limited 餐厅 -// xn--io0a7i : 2013-11-14 Computer Network Information Center of Chinese Academy of Sciences (China Internet Network Information Center) +// xn--io0a7i : 2013-11-14 China Internet Network Information Center (CNNIC) 网络 // xn--j1aef : 2015-01-15 VeriSign Sarl ком +// xn--jlq480n2rg : 2019-12-19 Amazon Registry Services, Inc. +亚马逊 + // xn--jlq61u9w7b : 2015-01-08 Nokia Corporation 诺基亚 -// xn--jvr189m : 2015-02-26 Amazon EU S.à r.l. +// xn--jvr189m : 2015-02-26 Amazon Registry Services, Inc. 食品 // xn--kcrx77d1x4a : 2014-11-07 Koninklijke Philips N.V. 飞利浦 -// xn--kpu716f : 2014-12-22 Richemont DNS Inc. -手表 - // xn--kput3i : 2014-02-13 Beijing RITT-Net Technology Development Co., Ltd 手机 @@ -10432,9 +10499,6 @@ xin // xn--mgbab2bd : 2013-10-31 CORE Association بازار -// xn--mgbb9fbpob : 2014-12-18 GreenTech Consultancy Company W.L.L. -موبايلي - // xn--mgbca7dzdo : 2015-07-30 Abu Dhabi Systems and Information Centre ابوظبي @@ -10468,12 +10532,12 @@ xin // xn--nyqy26a : 2014-11-07 Stable Tone Limited 健康 +// xn--otu796d : 2017-08-06 Jiang Yu Liang Cai Technology Company Limited +招聘 + // xn--p1acf : 2013-12-12 Rusnames Limited рус -// xn--pbt977c : 2014-12-22 Richemont DNS Inc. -珠宝 - // xn--pssy2u : 2015-01-15 VeriSign Sarl 大拿 @@ -10486,10 +10550,10 @@ xin // xn--rhqv96g : 2013-09-11 Stable Tone Limited 世界 -// xn--rovu88b : 2015-02-26 Amazon EU S.à r.l. +// xn--rovu88b : 2015-02-26 Amazon Registry Services, Inc. 書籍 -// xn--ses554g : 2014-01-16 +// xn--ses554g : 2014-01-16 KNET Co., Ltd. 网址 // xn--t60b56a : 2015-01-15 VeriSign Sarl @@ -10501,7 +10565,7 @@ xin // xn--tiq49xqyj : 2015-10-21 Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) 天主教 -// xn--unup4y : 2013-07-14 Spring Fields, LLC +// xn--unup4y : 2013-07-14 Binky Moon, LLC 游戏 // xn--vermgensberater-ctb : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG @@ -10510,7 +10574,7 @@ vermögensberater // xn--vermgensberatung-pwb : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG vermögensberatung -// xn--vhquv : 2013-08-27 Dash McCook, LLC +// xn--vhquv : 2013-08-27 Binky Moon, LLC 企业 // xn--vuq861b : 2014-10-16 Beijing Tele-info Network Technology Co., Ltd. @@ -10528,9 +10592,6 @@ vermögensberatung // xn--zfr164b : 2013-11-08 China Organizational Name Administration Center 政务 -// xperia : 2015-05-14 Sony Mobile Communications AB -xperia - // xyz : 2013-12-05 XYZ.COM LLC xyz @@ -10540,46 +10601,43 @@ yachts // yahoo : 2015-04-02 Yahoo! Domain Services Inc. yahoo -// yamaxun : 2014-12-18 Amazon EU S.à r.l. +// yamaxun : 2014-12-18 Amazon Registry Services, Inc. yamaxun -// yandex : 2014-04-10 YANDEX, LLC +// yandex : 2014-04-10 Yandex Europe B.V. yandex // yodobashi : 2014-11-20 YODOBASHI CAMERA CO.,LTD. yodobashi -// yoga : 2014-05-29 Top Level Domain Holdings Limited +// yoga : 2014-05-29 Minds + Machines Group Limited yoga // yokohama : 2013-12-12 GMO Registry, Inc. yokohama -// you : 2015-04-09 Amazon EU S.à r.l. +// you : 2015-04-09 Amazon Registry Services, Inc. you // youtube : 2014-05-01 Charleston Road Registry Inc. youtube -// yun : 2015-01-08 QIHOO 360 TECHNOLOGY CO. LTD. +// yun : 2015-01-08 Beijing Qihu Keji Co., Ltd. yun -// zappos : 2015-06-25 Amazon EU S.à r.l. +// zappos : 2015-06-25 Amazon Registry Services, Inc. zappos // zara : 2014-11-07 Industria de Diseño Textil, S.A. (INDITEX, S.A.) zara -// zero : 2014-12-18 Amazon EU S.à r.l. +// zero : 2014-12-18 Amazon Registry Services, Inc. zero // zip : 2014-05-08 Charleston Road Registry Inc. zip -// zippo : 2015-07-02 Zadco Company -zippo - -// zone : 2013-11-14 Outer Falls, LLC +// zone : 2013-11-14 Binky Moon, LLC zone // zuerich : 2014-11-07 Kanton Zürich (Canton of Zurich) @@ -10590,90 +10648,296 @@ zuerich // ===BEGIN PRIVATE DOMAINS=== // (Note: these are in alphabetical order by company name) +// 1GB LLC : https://www.1gb.ua/ +// Submitted by 1GB LLC +cc.ua +inf.ua +ltd.ua + +// 611coin : https://611project.org/ +611.to + +// Adobe : https://www.adobe.com/ +// Submitted by Ian Boston +adobeaemcloud.com +adobeaemcloud.net +*.dev.adobeaemcloud.com + +// Agnat sp. z o.o. : https://domena.pl +// Submitted by Przemyslaw Plewa +beep.pl + +// alboto.ca : http://alboto.ca +// Submitted by Anton Avramov +barsy.ca + +// Alces Software Ltd : http://alces-software.com +// Submitted by Mark J. Titorenko +*.compute.estate +*.alces.network + +// all-inkl.com : https://all-inkl.com +// Submitted by Werner Kaltofen +kasserver.com + +// Algorithmia, Inc. : algorithmia.com +// Submitted by Eli Perelman +*.algorithmia.com +!teams.algorithmia.com +!test.algorithmia.com + +// Altervista: https://www.altervista.org +// Submitted by Carlo Cannas +altervista.org + +// alwaysdata : https://www.alwaysdata.com +// Submitted by Cyril +alwaysdata.net + // Amazon CloudFront : https://aws.amazon.com/cloudfront/ // Submitted by Donavan Miller cloudfront.net -// Amazon Elastic Compute Cloud: https://aws.amazon.com/ec2/ -// Submitted by Osman Surkatty -ap-northeast-1.compute.amazonaws.com -ap-southeast-1.compute.amazonaws.com -ap-southeast-2.compute.amazonaws.com -cn-north-1.compute.amazonaws.cn -compute.amazonaws.cn -compute.amazonaws.com -compute-1.amazonaws.com -eu-west-1.compute.amazonaws.com -eu-central-1.compute.amazonaws.com -sa-east-1.compute.amazonaws.com +// Amazon Elastic Compute Cloud : https://aws.amazon.com/ec2/ +// Submitted by Luke Wells +*.compute.amazonaws.com +*.compute-1.amazonaws.com +*.compute.amazonaws.com.cn us-east-1.amazonaws.com -us-gov-west-1.compute.amazonaws.com -us-west-1.compute.amazonaws.com -us-west-2.compute.amazonaws.com -z-1.compute-1.amazonaws.com -z-2.compute-1.amazonaws.com // Amazon Elastic Beanstalk : https://aws.amazon.com/elasticbeanstalk/ -// Submitted by Adam Stein +// Submitted by Luke Wells +cn-north-1.eb.amazonaws.com.cn +cn-northwest-1.eb.amazonaws.com.cn elasticbeanstalk.com +ap-northeast-1.elasticbeanstalk.com +ap-northeast-2.elasticbeanstalk.com +ap-northeast-3.elasticbeanstalk.com +ap-south-1.elasticbeanstalk.com +ap-southeast-1.elasticbeanstalk.com +ap-southeast-2.elasticbeanstalk.com +ca-central-1.elasticbeanstalk.com +eu-central-1.elasticbeanstalk.com +eu-west-1.elasticbeanstalk.com +eu-west-2.elasticbeanstalk.com +eu-west-3.elasticbeanstalk.com +sa-east-1.elasticbeanstalk.com +us-east-1.elasticbeanstalk.com +us-east-2.elasticbeanstalk.com +us-gov-west-1.elasticbeanstalk.com +us-west-1.elasticbeanstalk.com +us-west-2.elasticbeanstalk.com // Amazon Elastic Load Balancing : https://aws.amazon.com/elasticloadbalancing/ -// Submitted by Scott Vidmar -elb.amazonaws.com +// Submitted by Luke Wells +*.elb.amazonaws.com +*.elb.amazonaws.com.cn // Amazon S3 : https://aws.amazon.com/s3/ -// Submitted by Eric Kinolik +// Submitted by Luke Wells s3.amazonaws.com s3-ap-northeast-1.amazonaws.com +s3-ap-northeast-2.amazonaws.com +s3-ap-south-1.amazonaws.com s3-ap-southeast-1.amazonaws.com s3-ap-southeast-2.amazonaws.com -s3-external-1.amazonaws.com -s3-external-2.amazonaws.com -s3-fips-us-gov-west-1.amazonaws.com +s3-ca-central-1.amazonaws.com s3-eu-central-1.amazonaws.com s3-eu-west-1.amazonaws.com +s3-eu-west-2.amazonaws.com +s3-eu-west-3.amazonaws.com +s3-external-1.amazonaws.com +s3-fips-us-gov-west-1.amazonaws.com s3-sa-east-1.amazonaws.com s3-us-gov-west-1.amazonaws.com +s3-us-east-2.amazonaws.com s3-us-west-1.amazonaws.com s3-us-west-2.amazonaws.com +s3.ap-northeast-2.amazonaws.com +s3.ap-south-1.amazonaws.com s3.cn-north-1.amazonaws.com.cn +s3.ca-central-1.amazonaws.com s3.eu-central-1.amazonaws.com +s3.eu-west-2.amazonaws.com +s3.eu-west-3.amazonaws.com +s3.us-east-2.amazonaws.com +s3.dualstack.ap-northeast-1.amazonaws.com +s3.dualstack.ap-northeast-2.amazonaws.com +s3.dualstack.ap-south-1.amazonaws.com +s3.dualstack.ap-southeast-1.amazonaws.com +s3.dualstack.ap-southeast-2.amazonaws.com +s3.dualstack.ca-central-1.amazonaws.com +s3.dualstack.eu-central-1.amazonaws.com +s3.dualstack.eu-west-1.amazonaws.com +s3.dualstack.eu-west-2.amazonaws.com +s3.dualstack.eu-west-3.amazonaws.com +s3.dualstack.sa-east-1.amazonaws.com +s3.dualstack.us-east-1.amazonaws.com +s3.dualstack.us-east-2.amazonaws.com +s3-website-us-east-1.amazonaws.com +s3-website-us-west-1.amazonaws.com +s3-website-us-west-2.amazonaws.com +s3-website-ap-northeast-1.amazonaws.com +s3-website-ap-southeast-1.amazonaws.com +s3-website-ap-southeast-2.amazonaws.com +s3-website-eu-west-1.amazonaws.com +s3-website-sa-east-1.amazonaws.com +s3-website.ap-northeast-2.amazonaws.com +s3-website.ap-south-1.amazonaws.com +s3-website.ca-central-1.amazonaws.com +s3-website.eu-central-1.amazonaws.com +s3-website.eu-west-2.amazonaws.com +s3-website.eu-west-3.amazonaws.com +s3-website.us-east-2.amazonaws.com + +// Amsterdam Wireless: https://www.amsterdamwireless.nl/ +// Submitted by Imre Jonk +amsw.nl + +// Amune : https://amune.org/ +// Submitted by Team Amune +t3l3p0rt.net +tele.amune.org + +// Apigee : https://apigee.com/ +// Submitted by Apigee Security Team +apigee.io + +// Aptible : https://www.aptible.com/ +// Submitted by Thomas Orozco +on-aptible.com + +// ASEINet : https://www.aseinet.com/ +// Submitted by Asei SEKIGUCHI +user.aseinet.ne.jp +gv.vc +d.gv.vc + +// Asociación Amigos de la Informática "Euskalamiga" : http://encounter.eus/ +// Submitted by Hector Martin +user.party.eus + +// Association potager.org : https://potager.org/ +// Submitted by Lunar +pimienta.org +poivron.org +potager.org +sweetpepper.org + +// ASUSTOR Inc. : http://www.asustor.com +// Submitted by Vincent Tseng +myasustor.com + +// AVM : https://avm.de +// Submitted by Andreas Weise +myfritz.net + +// AW AdvisorWebsites.com Software Inc : https://advisorwebsites.com +// Submitted by James Kennedy +*.awdev.ca +*.advisor.ws + +// b-data GmbH : https://www.b-data.io +// Submitted by Olivier Benz +b-data.io + +// backplane : https://www.backplane.io +// Submitted by Anthony Voutas +backplaneapp.io + +// Balena : https://www.balena.io +// Submitted by Petros Angelatos +balena-devices.com + +// Banzai Cloud +// Submitted by Janos Matyas +*.banzai.cloud +app.banzaicloud.io +*.backyards.banzaicloud.io + // BetaInABox // Submitted by Adrian betainabox.com +// BinaryLane : http://www.binarylane.com +// Submitted by Nathan O'Sullivan +bnr.la + +// Blackbaud, Inc. : https://www.blackbaud.com +// Submitted by Paul Crowder +blackbaudcdn.net + +// Boomla : https://boomla.com +// Submitted by Tibor Halter +boomla.net + +// Boxfuse : https://boxfuse.com +// Submitted by Axel Fontaine +boxfuse.io + +// bplaced : https://www.bplaced.net/ +// Submitted by Miroslav Bozic +square7.ch +bplaced.com +bplaced.de +square7.de +bplaced.net +square7.net + +// BrowserSafetyMark +// Submitted by Dave Tharp +browsersafetymark.io + +// Bytemark Hosting : https://www.bytemark.co.uk +// Submitted by Paul Cammish +uk0.bigv.io +dh.bytemark.co.uk +vm.bytemark.co.uk + +// callidomus : https://www.callidomus.com/ +// Submitted by Marcus Popp +mycd.eu + +// Carrd : https://carrd.co +// Submitted by AJ +carrd.co +crd.co +uwu.ai + // CentralNic : http://www.centralnic.com/names/domains // Submitted by registry ae.org -ar.com br.com cn.com com.de com.se de.com eu.com -gb.com gb.net -hu.com hu.net jp.net jpn.com -kr.com mex.com -no.com -qc.com ru.com sa.com -se.com se.net uk.com uk.net us.com -uy.com za.bz za.com +// No longer operated by CentralNic, these entries should be adopted and/or removed by current operators +// Submitted by Gavin Brown +ar.com +gb.com +hu.com +kr.com +no.com +qc.com +uy.com + // Africa.com Web Solutions Ltd : https://registry.africa.com // Submitted by Gavin Brown africa.com @@ -10685,6 +10949,7 @@ gr.com // Radix FZC : http://domains.in.net // Submitted by Gavin Brown in.net +web.in // US REGISTRY LLC : http://us.org // Submitted by Gavin Brown @@ -10694,17 +10959,94 @@ us.org // Submitted by Gavin Brown co.com +// Roar Domains LLC : https://roar.basketball/ +// Submitted by Gavin Brown +aus.basketball +nz.basketball + +// BRS Media : https://brsmedia.com/ +// Submitted by Gavin Brown +radio.am +radio.fm + +// Globe Hosting SRL : https://www.globehosting.com/ +// Submitted by Gavin Brown +co.ro +shop.ro + // c.la : http://www.c.la/ c.la +// certmgr.org : https://certmgr.org +// Submitted by B. Blechschmidt +certmgr.org + +// Citrix : https://citrix.com +// Submitted by Alex Stoddard +xenapponazure.com + +// Civilized Discourse Construction Kit, Inc. : https://www.discourse.org/ +// Submitted by Rishabh Nambiar & Michael Brown +discourse.group +discourse.team + +// ClearVox : http://www.clearvox.nl/ +// Submitted by Leon Rowland +virtueeldomein.nl + +// Clever Cloud : https://www.clever-cloud.com/ +// Submitted by Quentin Adam +cleverapps.io + +// Clerk : https://www.clerk.dev +// Submitted by Colin Sidoti +*.lcl.dev +*.stg.dev + +// Clic2000 : https://clic2000.fr +// Submitted by Mathilde Blanchemanche +clic2000.net + +// Cloud66 : https://www.cloud66.com/ +// Submitted by Khash Sajadi +c66.me +cloud66.ws +cloud66.zone + +// CloudAccess.net : https://www.cloudaccess.net/ +// Submitted by Pawel Panek +jdevcloud.com +wpdevcloud.com +cloudaccess.host +freesite.host +cloudaccess.net + // cloudControl : https://www.cloudcontrol.com/ // Submitted by Tobias Wilken cloudcontrolled.com cloudcontrolapp.com +// Cloudera, Inc. : https://www.cloudera.com/ +// Submitted by Philip Langdale +cloudera.site + +// Cloudflare, Inc. : https://www.cloudflare.com/ +// Submitted by Cloudflare Team +pages.dev +trycloudflare.com +workers.dev + +// Clovyr : https://clovyr.io +// Submitted by Patrick Nielsen +wnext.app + // co.ca : http://registry.co.ca/ co.ca +// Co & Co : https://co-co.nl/ +// Submitted by Govert Versluis +*.otap.co + // i-registry s.r.o. : http://www.i-registry.cz/ // Submitted by Martin Semrad co.cz @@ -10717,18 +11059,157 @@ r.cdn77.net rsc.cdn77.org ssl.origin.cdn77-secure.org +// Cloud DNS Ltd : http://www.cloudns.net +// Submitted by Aleksander Hristov +cloudns.asia +cloudns.biz +cloudns.club +cloudns.cc +cloudns.eu +cloudns.in +cloudns.info +cloudns.org +cloudns.pro +cloudns.pw +cloudns.us + +// Cloudeity Inc : https://cloudeity.com +// Submitted by Stefan Dimitrov +cloudeity.net + +// CNPY : https://cnpy.gdn +// Submitted by Angelo Gladding +cnpy.gdn + // CoDNS B.V. co.nl co.no -// Commerce Guys, SAS -// Submitted by Damien Tournoud -*.platform.sh +// Combell.com : https://www.combell.com +// Submitted by Thomas Wouters +webhosting.be +hosting-cluster.nl + +// Coordination Center for TLD RU and XN--P1AI : https://cctld.ru/en/domains/domens_ru/reserved/ +// Submitted by George Georgievsky +ac.ru +edu.ru +gov.ru +int.ru +mil.ru +test.ru + +// COSIMO GmbH : http://www.cosimo.de +// Submitted by Rene Marticke +dyn.cosidns.de +dynamisches-dns.de +dnsupdater.de +internet-dns.de +l-o-g-i-n.de +dynamic-dns.info +feste-ip.net +knx-server.net +static-access.net + +// Craynic, s.r.o. : http://www.craynic.com/ +// Submitted by Ales Krajnik +realm.cz + +// Cryptonomic : https://cryptonomic.net/ +// Submitted by Andrew Cady +*.cryptonomic.net // Cupcake : https://cupcake.io/ // Submitted by Jonathan Rudenberg cupcake.is +// Curv UG : https://curv-labs.de/ +// Submitted by Marvin Wiesner +curv.dev + +// Customer OCI - Oracle Dyn https://cloud.oracle.com/home https://dyn.com/dns/ +// Submitted by Gregory Drake +// Note: This is intended to also include customer-oci.com due to wildcards implicitly including the current label +*.customer-oci.com +*.oci.customer-oci.com +*.ocp.customer-oci.com +*.ocs.customer-oci.com + +// cyon GmbH : https://www.cyon.ch/ +// Submitted by Dominic Luechinger +cyon.link +cyon.site + +// Danger Science Group: https://dangerscience.com/ +// Submitted by Skylar MacDonald +fnwk.site +folionetwork.site +platform0.app + +// Daplie, Inc : https://daplie.com +// Submitted by AJ ONeal +daplie.me +localhost.daplie.me + +// Datto, Inc. : https://www.datto.com/ +// Submitted by Philipp Heckel +dattolocal.com +dattorelay.com +dattoweb.com +mydatto.com +dattolocal.net +mydatto.net + +// Dansk.net : http://www.dansk.net/ +// Submitted by Anani Voule +biz.dk +co.dk +firm.dk +reg.dk +store.dk + +// dappnode.io : https://dappnode.io/ +// Submitted by Abel Boldu / DAppNode Team +dyndns.dappnode.io + +// dapps.earth : https://dapps.earth/ +// Submitted by Daniil Burdakov +*.dapps.earth +*.bzz.dapps.earth + +// Dark, Inc. : https://darklang.com +// Submitted by Paul Biggar +builtwithdark.com + +// Datawire, Inc : https://www.datawire.io +// Submitted by Richard Li +edgestack.me + +// Debian : https://www.debian.org/ +// Submitted by Peter Palfrader / Debian Sysadmin Team +debian.net + +// deSEC : https://desec.io/ +// Submitted by Peter Thomassen +dedyn.io + +// DNS Africa Ltd https://dns.business +// Submitted by Calvin Browne +jozi.biz + +// DNShome : https://www.dnshome.de/ +// Submitted by Norbert Auler +dnshome.de + +// DotArai : https://www.dotarai.com/ +// Submitted by Atsadawat Netcharadsang +online.th +shop.th + +// DrayTek Corp. : https://www.draytek.com/ +// Submitted by Paul Fang +drayddns.com + // DreamHost : http://www.dreamhost.com/ // Submitted by Andrew Farmer dreamhosters.com @@ -10737,10 +11218,27 @@ dreamhosters.com // Submitted by Ricardo Padilha mydrobo.com +// Drud Holdings, LLC. : https://www.drud.com/ +// Submitted by Kevin Bridges +drud.io +drud.us + // DuckDNS : http://www.duckdns.org/ // Submitted by Richard Harper duckdns.org +// Bip : https://bip.sh +// Submitted by Joel Kennedy +bip.sh + +// bitbridge.net : Submitted by Craig Welch, abeliidev@gmail.com +bitbridge.net + +// dy.fi : http://dy.fi/ +// Submitted by Heikki Hannikainen +dy.fi +tunk.org + // DynDNS.com : http://www.dyndns.com/services/dns/dyndns/ dyndns-at-home.com dyndns-at-work.com @@ -11022,6 +11520,77 @@ webhop.org worse-than.tv writesthisblog.com +// ddnss.de : https://www.ddnss.de/ +// Submitted by Robert Niedziela +ddnss.de +dyn.ddnss.de +dyndns.ddnss.de +dyndns1.de +dyn-ip24.de +home-webserver.de +dyn.home-webserver.de +myhome-server.de +ddnss.org + +// Definima : http://www.definima.com/ +// Submitted by Maxence Bitterli +definima.net +definima.io + +// dnstrace.pro : https://dnstrace.pro/ +// Submitted by Chris Partridge +bci.dnstrace.pro + +// Dynu.com : https://www.dynu.com/ +// Submitted by Sue Ye +ddnsfree.com +ddnsgeek.com +giize.com +gleeze.com +kozow.com +loseyourip.com +ooguy.com +theworkpc.com +casacam.net +dynu.net +accesscam.org +camdvr.org +freeddns.org +mywire.org +webredirect.org +myddns.rocks +blogsite.xyz + +// dynv6 : https://dynv6.com +// Submitted by Dominik Menke +dynv6.net + +// E4YOU spol. s.r.o. : https://e4you.cz/ +// Submitted by Vladimir Dudr +e4.cz + +// En root‽ : https://en-root.org +// Submitted by Emmanuel Raviart +en-root.fr + +// Enalean SAS: https://www.enalean.com +// Submitted by Thomas Cottier +mytuleap.com + +// ECG Robotics, Inc: https://ecgrobotics.org +// Submitted by +onred.one +staging.onred.one + +// One.com: https://www.one.com/ +// Submitted by Jacob Bunk Nielsen +service.one + +// Enonic : http://enonic.com/ +// Submitted by Erik Kaareng-Sunde +enonic.io +customer.enonic.io + // EU.org https://eu.org/ // Submitted by Pierre Beyssac eu.org @@ -11081,38 +11650,291 @@ tr.eu.org uk.eu.org us.eu.org -// Fastly Inc. http://www.fastly.com/ -// Submitted by Vladimir Vuksan +// Evennode : http://www.evennode.com/ +// Submitted by Michal Kralik +eu-1.evennode.com +eu-2.evennode.com +eu-3.evennode.com +eu-4.evennode.com +us-1.evennode.com +us-2.evennode.com +us-3.evennode.com +us-4.evennode.com + +// eDirect Corp. : https://hosting.url.com.tw/ +// Submitted by C.S. chang +twmail.cc +twmail.net +twmail.org +mymailer.com.tw +url.tw + +// Fabrica Technologies, Inc. : https://www.fabrica.dev/ +// Submitted by Eric Jiang +onfabrica.com + +// Facebook, Inc. +// Submitted by Peter Ruibal +apps.fbsbx.com + +// FAITID : https://faitid.org/ +// Submitted by Maxim Alzoba +// https://www.flexireg.net/stat_info +ru.net +adygeya.ru +bashkiria.ru +bir.ru +cbg.ru +com.ru +dagestan.ru +grozny.ru +kalmykia.ru +kustanai.ru +marine.ru +mordovia.ru +msk.ru +mytis.ru +nalchik.ru +nov.ru +pyatigorsk.ru +spb.ru +vladikavkaz.ru +vladimir.ru +abkhazia.su +adygeya.su +aktyubinsk.su +arkhangelsk.su +armenia.su +ashgabad.su +azerbaijan.su +balashov.su +bashkiria.su +bryansk.su +bukhara.su +chimkent.su +dagestan.su +east-kazakhstan.su +exnet.su +georgia.su +grozny.su +ivanovo.su +jambyl.su +kalmykia.su +kaluga.su +karacol.su +karaganda.su +karelia.su +khakassia.su +krasnodar.su +kurgan.su +kustanai.su +lenug.su +mangyshlak.su +mordovia.su +msk.su +murmansk.su +nalchik.su +navoi.su +north-kazakhstan.su +nov.su +obninsk.su +penza.su +pokrovsk.su +sochi.su +spb.su +tashkent.su +termez.su +togliatti.su +troitsk.su +tselinograd.su +tula.su +tuva.su +vladikavkaz.su +vladimir.su +vologda.su + +// Fancy Bits, LLC : http://getchannels.com +// Submitted by Aman Gupta +channelsdvr.net +u.channelsdvr.net + +// Fastly Inc. : http://www.fastly.com/ +// Submitted by Fastly Security +fastly-terrarium.com +fastlylb.net +map.fastlylb.net +freetls.fastly.net +map.fastly.net +a.prod.fastly.net +global.prod.fastly.net a.ssl.fastly.net b.ssl.fastly.net global.ssl.fastly.net -a.prod.fastly.net -global.prod.fastly.net + +// FASTVPS EESTI OU : https://fastvps.ru/ +// Submitted by Likhachev Vasiliy +fastvps-server.com +fastvps.host +myfast.host +fastvps.site +myfast.space + +// Featherhead : https://featherhead.xyz/ +// Submitted by Simon Menke +fhapp.xyz + +// Fedora : https://fedoraproject.org/ +// submitted by Patrick Uiterwijk +fedorainfracloud.org +fedorapeople.org +cloud.fedoraproject.org +app.os.fedoraproject.org +app.os.stg.fedoraproject.org + +// FearWorks Media Ltd. : https://fearworksmedia.co.uk +// submitted by Keith Fairley +conn.uk +copro.uk +couk.me +ukco.me + +// Fermax : https://fermax.com/ +// submitted by Koen Van Isterdael +mydobiss.com + +// Filegear Inc. : https://www.filegear.com +// Submitted by Jason Zhu +filegear.me +filegear-au.me +filegear-de.me +filegear-gb.me +filegear-ie.me +filegear-jp.me +filegear-sg.me // Firebase, Inc. // Submitted by Chris Raynor firebaseapp.com +// fly.io: https://fly.io +// Submitted by Kurt Mackey +fly.dev +edgeapp.net +shw.io + // Flynn : https://flynn.io // Submitted by Jonathan Rudenberg -flynnhub.com +flynnhosting.net + +// Frederik Braun https://frederik-braun.com +// Submitted by Frederik Braun +0e.vc + +// Freebox : http://www.freebox.fr +// Submitted by Romain Fliedel +freebox-os.com +freeboxos.com +fbx-os.fr +fbxos.fr +freebox-os.fr +freeboxos.fr + +// freedesktop.org : https://www.freedesktop.org +// Submitted by Daniel Stone +freedesktop.org + +// FunkFeuer - Verein zur Förderung freier Netze : https://www.funkfeuer.at +// Submitted by Daniel A. Maierhofer +wien.funkfeuer.at + +// Futureweb OG : http://www.futureweb.at +// Submitted by Andreas Schnederle-Wagner +*.futurecms.at +*.ex.futurecms.at +*.in.futurecms.at +futurehosting.at +futuremailing.at +*.ex.ortsinfo.at +*.kunden.ortsinfo.at +*.statics.cloud // GDS : https://www.gov.uk/service-manual/operations/operating-servicegovuk-subdomains // Submitted by David Illsley service.gov.uk +// Gehirn Inc. : https://www.gehirn.co.jp/ +// Submitted by Kohei YOSHIDA +gehirn.ne.jp +usercontent.jp + +// Gentlent, Inc. : https://www.gentlent.com +// Submitted by Tom Klein +gentapps.com +gentlentapis.com +lab.ms + // GitHub, Inc. -// Submitted by Ben Toews +// Submitted by Patrick Toomey github.io githubusercontent.com +// GitLab, Inc. +// Submitted by Alex Hanselka +gitlab.io + +// Gitplac.si - https://gitplac.si +// Submitted by Aljaž Starc +gitapp.si +gitpage.si + +// Glitch, Inc : https://glitch.com +// Submitted by Mads Hartmann +glitch.me + +// GMO Pepabo, Inc. : https://pepabo.com/ +// Submitted by dojineko +lolipop.io + +// GOV.UK Platform as a Service : https://www.cloud.service.gov.uk/ +// Submitted by Tom Whitwell +cloudapps.digital +london.cloudapps.digital + +// GOV.UK Pay : https://www.payments.service.gov.uk/ +// Submitted by Richard Baker +pymnt.uk + +// UKHomeOffice : https://www.gov.uk/government/organisations/home-office +// Submitted by Jon Shanks +homeoffice.gov.uk + // GlobeHosting, Inc. // Submitted by Zoltan Egresi -ro.com +ro.im + +// GoIP DNS Services : http://www.goip.de +// Submitted by Christian Poulter +goip.de // Google, Inc. // Submitted by Eduardo Vela +run.app +a.run.app +web.app +*.0emm.com appspot.com +*.r.appspot.com +codespot.com +googleapis.com +googlecode.com +pagespeedmobilizer.com +publishproxy.com +withgoogle.com +withyoutube.com +cloudfunctions.net +cloud.goog +translate.goog + blogspot.ae blogspot.al blogspot.am @@ -11187,43 +12009,512 @@ blogspot.td blogspot.tw blogspot.ug blogspot.vn -cloudfunctions.net -codespot.com -googleapis.com -googlecode.com -pagespeedmobilizer.com -withgoogle.com -withyoutube.com + +// Aaron Marais' Gitlab pages: https://lab.aaronleem.co.za +// Submitted by Aaron Marais +graphox.us + +// Group 53, LLC : https://www.group53.com +// Submitted by Tyler Todd +awsmppl.com + +// Hakaran group: http://hakaran.cz +// Submited by Arseniy Sokolov +fin.ci +free.hr +caa.li +ua.rs +conf.se + +// Handshake : https://handshake.org +// Submitted by Mike Damm +hs.zone +hs.run // Hashbang : https://hashbang.sh hashbang.sh +// Hasura : https://hasura.io +// Submitted by Shahidh K Muhammed +hasura.app +hasura-app.io + +// Hepforge : https://www.hepforge.org +// Submitted by David Grellscheid +hepforge.org + // Heroku : https://www.heroku.com/ // Submitted by Tom Maher herokuapp.com herokussl.com +// Hibernating Rhinos +// Submitted by Oren Eini +myravendb.com +ravendb.community +ravendb.me +development.run +ravendb.run + +// HOSTBIP REGISTRY : https://www.hostbip.com/ +// Submitted by Atanunu Igbunuroghene +bpl.biz +orx.biz +ng.city +biz.gl +ng.ink +col.ng +firm.ng +gen.ng +ltd.ng +ngo.ng +ng.school +sch.so + +// HostyHosting (hostyhosting.com) +hostyhosting.io + +// Häkkinen.fi +// Submitted by Eero Häkkinen +häkkinen.fi + +// Ici la Lune : http://www.icilalune.com/ +// Submitted by Simon Morvan +*.moonscale.io +moonscale.net + // iki.fi // Submitted by Hannu Aronsson iki.fi +// Individual Network Berlin e.V. : https://www.in-berlin.de/ +// Submitted by Christian Seitz +dyn-berlin.de +in-berlin.de +in-brb.de +in-butter.de +in-dsl.de +in-dsl.net +in-dsl.org +in-vpn.de +in-vpn.net +in-vpn.org + // info.at : http://www.info.at/ biz.at info.at +// info.cx : http://info.cx +// Submitted by Jacob Slater +info.cx + +// Interlegis : http://www.interlegis.leg.br +// Submitted by Gabriel Ferreira +ac.leg.br +al.leg.br +am.leg.br +ap.leg.br +ba.leg.br +ce.leg.br +df.leg.br +es.leg.br +go.leg.br +ma.leg.br +mg.leg.br +ms.leg.br +mt.leg.br +pa.leg.br +pb.leg.br +pe.leg.br +pi.leg.br +pr.leg.br +rj.leg.br +rn.leg.br +ro.leg.br +rr.leg.br +rs.leg.br +sc.leg.br +se.leg.br +sp.leg.br +to.leg.br + +// intermetrics GmbH : https://pixolino.com/ +// Submitted by Wolfgang Schwarz +pixolino.com + +// Internet-Pro, LLP: https://netangels.ru/ +// Submited by Vasiliy Sheredeko +na4u.ru + +// iopsys software solutions AB : https://iopsys.eu/ +// Submitted by Roman Azarenko +iopsys.se + +// IPiFony Systems, Inc. : https://www.ipifony.com/ +// Submitted by Matthew Hardeman +ipifony.net + +// IServ GmbH : https://iserv.eu +// Submitted by Kim-Alexander Brodowski +mein-iserv.de +schulserver.de +test-iserv.de +iserv.dev + +// I-O DATA DEVICE, INC. : http://www.iodata.com/ +// Submitted by Yuji Minagawa +iobb.net + +//Jelastic, Inc. : https://jelastic.com/ +// Submited by Ihor Kolodyuk +mel.cloudlets.com.au +cloud.interhostsolutions.be +users.scale.virtualcloud.com.br +mycloud.by +alp1.ae.flow.ch +appengine.flow.ch +es-1.axarnet.cloud +diadem.cloud +vip.jelastic.cloud +jele.cloud +it1.eur.aruba.jenv-aruba.cloud +it1.jenv-aruba.cloud +it1-eur.jenv-arubabiz.cloud +primetel.cloud +uk.primetel.cloud +ca.reclaim.cloud +uk.reclaim.cloud +us.reclaim.cloud +ch.trendhosting.cloud +de.trendhosting.cloud +jele.club +clicketcloud.com +ams.cloudswitches.com +au.cloudswitches.com +sg.cloudswitches.com +dopaas.com +elastyco.com +nv.elastyco.com +hidora.com +paas.hosted-by-previder.com +rag-cloud.hosteur.com +rag-cloud-ch.hosteur.com +jcloud.ik-server.com +jcloud-ver-jpc.ik-server.com +demo.jelastic.com +kilatiron.com +paas.massivegrid.com +jed.wafaicloud.com +lon.wafaicloud.com +ryd.wafaicloud.com +j.scaleforce.com.cy +jelastic.dogado.eu +paas.leviracloud.eu +fi.cloudplatform.fi +demo.datacenter.fi +paas.datacenter.fi +jele.host +mircloud.host +jele.io +ocs.opusinteractive.io +cloud.unispace.io +cloud-de.unispace.io +cloud-fr1.unispace.io +jc.neen.it +cloud.jelastic.open.tim.it +jcloud.kz +upaas.kazteleport.kz +jl.serv.net.mx +cloudjiffy.net +fra1-de.cloudjiffy.net +west1-us.cloudjiffy.net +ams1.jls.docktera.net +jls-sto1.elastx.net +jls-sto2.elastx.net +jls-sto3.elastx.net +fr-1.paas.massivegrid.net +lon-1.paas.massivegrid.net +lon-2.paas.massivegrid.net +ny-1.paas.massivegrid.net +ny-2.paas.massivegrid.net +sg-1.paas.massivegrid.net +jelastic.saveincloud.net +nordeste-idc.saveincloud.net +j.scaleforce.net +jelastic.tsukaeru.net +atl.jelastic.vps-host.net +njs.jelastic.vps-host.net +unicloud.pl +mircloud.ru +jelastic.regruhosting.ru +enscaled.sg +jele.site +jelastic.team +j.layershift.co.uk +phx.enscaled.us +mircloud.us + +// Jino : https://www.jino.ru +// Submitted by Sergey Ulyashin +myjino.ru +*.hosting.myjino.ru +*.landing.myjino.ru +*.spectrum.myjino.ru +*.vps.myjino.ru + +// Joyent : https://www.joyent.com/ +// Submitted by Brian Bennett +*.triton.zone +*.cns.joyent.com + +// JS.ORG : http://dns.js.org +// Submitted by Stefan Keim +js.org + +// KaasHosting : http://www.kaashosting.nl/ +// Submitted by Wouter Bakker +kaas.gg +khplay.nl + +// Keyweb AG : https://www.keyweb.de +// Submitted by Martin Dannehl +keymachine.de + +// KingHost : https://king.host +// Submitted by Felipe Keller Braz +kinghost.net +uni5.net + +// KnightPoint Systems, LLC : http://www.knightpoint.com/ +// Submitted by Roy Keene +knightpoint.systems + +// KUROKU LTD : https://kuroku.ltd/ +// Submitted by DisposaBoy +oya.to + +// .KRD : http://nic.krd/data/krd/Registration%20Policy.pdf +co.krd +edu.krd + +// LCube - Professional hosting e.K. : https://www.lcube-webhosting.de +// Submitted by Lars Laehn +git-repos.de +lcube-server.de +svn-repos.de + +// Leadpages : https://www.leadpages.net +// Submitted by Greg Dallavalle +leadpages.co +lpages.co +lpusercontent.com + +// Lelux.fi : https://lelux.fi/ +// Submitted by Lelux Admin +lelux.site + +// Lifetime Hosting : https://Lifetime.Hosting/ +// Submitted by Mike Fillator +co.business +co.education +co.events +co.financial +co.network +co.place +co.technology + +// Lightmaker Property Manager, Inc. : https://app.lmpm.com/ +// Submitted by Greg Holland +app.lmpm.com + +// Linki Tools UG : https://linki.tools +// Submitted by Paulo Matos +linkitools.space + +// linkyard ldt: https://www.linkyard.ch/ +// Submitted by Mario Siegenthaler +linkyard.cloud +linkyard-cloud.ch + +// Linode : https://linode.com +// Submitted by +members.linode.com +*.nodebalancer.linode.com +*.linodeobjects.com + +// LiquidNet Ltd : http://www.liquidnetlimited.com/ +// Submitted by Victor Velchev +we.bs + +// localzone.xyz +// Submitted by Kenny Niehage +localzone.xyz + +// Log'in Line : https://www.loginline.com/ +// Submitted by Rémi Mach +loginline.app +loginline.dev +loginline.io +loginline.services +loginline.site + +// LubMAN UMCS Sp. z o.o : https://lubman.pl/ +// Submitted by Ireneusz Maliszewski +krasnik.pl +leczna.pl +lubartow.pl +lublin.pl +poniatowa.pl +swidnik.pl + +// Lug.org.uk : https://lug.org.uk +// Submitted by Jon Spriggs +uklugs.org +glug.org.uk +lug.org.uk +lugs.org.uk + +// Lukanet Ltd : https://lukanet.com +// Submitted by Anton Avramov +barsy.bg +barsy.co.uk +barsyonline.co.uk +barsycenter.com +barsyonline.com +barsy.club +barsy.de +barsy.eu +barsy.in +barsy.info +barsy.io +barsy.me +barsy.menu +barsy.mobi +barsy.net +barsy.online +barsy.org +barsy.pro +barsy.pub +barsy.shop +barsy.site +barsy.support +barsy.uk + +// Magento Commerce +// Submitted by Damien Tournoud +*.magentosite.cloud + +// May First - People Link : https://mayfirst.org/ +// Submitted by Jamie McClelland +mayfirst.info +mayfirst.org + +// Mail.Ru Group : https://hb.cldmail.ru +// Submitted by Ilya Zaretskiy +hb.cldmail.ru + +// mcpe.me : https://mcpe.me +// Submitted by Noa Heyl +mcpe.me + +// McHost : https://mchost.ru +// Submitted by Evgeniy Subbotin +mcdir.ru +vps.mcdir.ru + +// Memset hosting : https://www.memset.com +// Submitted by Tom Whitwell +miniserver.com +memset.net + +// MetaCentrum, CESNET z.s.p.o. : https://www.metacentrum.cz/en/ +// Submitted by Zdeněk Šustr +*.cloud.metacentrum.cz +custom.metacentrum.cz + +// MetaCentrum, CESNET z.s.p.o. : https://www.metacentrum.cz/en/ +// Submitted by Radim Janča +flt.cloud.muni.cz +usr.cloud.muni.cz + +// Meteor Development Group : https://www.meteor.com/hosting +// Submitted by Pierre Carrier +meteorapp.com +eu.meteorapp.com + // Michau Enterprises Limited : http://www.co.pl/ co.pl -// Microsoft : http://microsoft.com -// Submitted by Barry Dorrans +// Microsoft Corporation : http://microsoft.com +// Submitted by Mostafa Elzeiny +*.azurecontainer.io azurewebsites.net azure-mobile.net cloudapp.net +// minion.systems : http://minion.systems +// Submitted by Robert Böttinger +csx.cc + +// MobileEducation, LLC : https://joinforte.com +// Submitted by Grayson Martin +forte.id + +// Mozilla Corporation : https://mozilla.com +// Submitted by Ben Francis +mozilla-iot.org + // Mozilla Foundation : https://mozilla.org/ // Submitted by glob bmoattachments.org +// MSK-IX : https://www.msk-ix.ru/ +// Submitted by Khannanov Roman +net.ru +org.ru +pp.ru + +// Mythic Beasts : https://www.mythic-beasts.com +// Submitted by Paul Cammish +hostedpi.com +customer.mythic-beasts.com +lynx.mythic-beasts.com +ocelot.mythic-beasts.com +onza.mythic-beasts.com +sphinx.mythic-beasts.com +vs.mythic-beasts.com +x.mythic-beasts.com +yali.mythic-beasts.com +cust.retrosnub.co.uk + +// Nabu Casa : https://www.nabucasa.com +// Submitted by Paulus Schoutsen +ui.nabu.casa + +// Names.of.London : https://names.of.london/ +// Submitted by James Stevens or +pony.club +of.fashion +on.fashion +of.football +in.london +of.london +for.men +and.mom +for.mom +for.one +for.sale +of.work +to.work + +// NCTU.ME : https://nctu.me/ +// Submitted by Tocknicsu +nctu.me + +// Netlify : https://www.netlify.com +// Submitted by Jessica Parsons +netlify.app + // Neustar Inc. // Submitted by Trung Tran 4u.com @@ -11232,30 +12523,286 @@ bmoattachments.org // Submitted by Alan Shreve ngrok.io +// Nimbus Hosting Ltd. : https://www.nimbushosting.co.uk/ +// Submitted by Nicholas Ford +nh-serv.co.uk + // NFSN, Inc. : https://www.NearlyFreeSpeech.NET/ // Submitted by Jeff Wheelhouse nfshost.com +// Now-DNS : https://now-dns.com +// Submitted by Steve Russell +dnsking.ch +mypi.co +n4t.co +001www.com +ddnslive.com +myiphost.com +forumz.info +16-b.it +32-b.it +64-b.it +soundcast.me +tcp4.me +dnsup.net +hicam.net +now-dns.net +ownip.net +vpndns.net +dynserv.org +now-dns.org +x443.pw +now-dns.top +ntdll.top +freeddns.us +crafting.xyz +zapto.xyz + +// nsupdate.info : https://www.nsupdate.info/ +// Submitted by Thomas Waldmann +nsupdate.info +nerdpol.ovh + +// No-IP.com : https://noip.com/ +// Submitted by Deven Reza +blogsyte.com +brasilia.me +cable-modem.org +ciscofreak.com +collegefan.org +couchpotatofries.org +damnserver.com +ddns.me +ditchyourip.com +dnsfor.me +dnsiskinky.com +dvrcam.info +dynns.com +eating-organic.net +fantasyleague.cc +geekgalaxy.com +golffan.us +health-carereform.com +homesecuritymac.com +homesecuritypc.com +hopto.me +ilovecollege.info +loginto.me +mlbfan.org +mmafan.biz +myactivedirectory.com +mydissent.net +myeffect.net +mymediapc.net +mypsx.net +mysecuritycamera.com +mysecuritycamera.net +mysecuritycamera.org +net-freaks.com +nflfan.org +nhlfan.net +no-ip.ca +no-ip.co.uk +no-ip.net +noip.us +onthewifi.com +pgafan.net +point2this.com +pointto.us +privatizehealthinsurance.net +quicksytes.com +read-books.org +securitytactics.com +serveexchange.com +servehumour.com +servep2p.com +servesarcasm.com +stufftoread.com +ufcfan.org +unusualperson.com +workisboring.com +3utilities.com +bounceme.net +ddns.net +ddnsking.com +gotdns.ch +hopto.org +myftp.biz +myftp.org +myvnc.com +no-ip.biz +no-ip.info +no-ip.org +noip.me +redirectme.net +servebeer.com +serveblog.net +servecounterstrike.com +serveftp.com +servegame.com +servehalflife.com +servehttp.com +serveirc.com +serveminecraft.net +servemp3.com +servepics.com +servequake.com +sytes.net +webhop.me +zapto.org + +// NodeArt : https://nodeart.io +// Submitted by Konstantin Nosov +stage.nodeart.io + +// Nodum B.V. : https://nodum.io/ +// Submitted by Wietse Wind +nodum.co +nodum.io + +// Nucleos Inc. : https://nucleos.com +// Submitted by Piotr Zduniak +pcloud.host + // NYC.mn : http://www.information.nyc.mn // Submitted by Matthew Brown nyc.mn +// NymNom : https://nymnom.com/ +// Submitted by NymNom +nom.ae +nom.af +nom.ai +nom.al +nym.by +nom.bz +nym.bz +nom.cl +nym.ec +nom.gd +nom.ge +nom.gl +nym.gr +nom.gt +nym.gy +nym.hk +nom.hn +nym.ie +nom.im +nom.ke +nym.kz +nym.la +nym.lc +nom.li +nym.li +nym.lt +nym.lu +nom.lv +nym.me +nom.mk +nym.mn +nym.mx +nom.nu +nym.nz +nym.pe +nym.pt +nom.pw +nom.qa +nym.ro +nom.rs +nom.si +nym.sk +nom.st +nym.su +nym.sx +nom.tj +nym.tw +nom.ug +nom.uy +nom.vc +nom.vg + +// Observable, Inc. : https://observablehq.com +// Submitted by Mike Bostock +static.observableusercontent.com + +// Octopodal Solutions, LLC. : https://ulterius.io/ +// Submitted by Andrew Sampson +cya.gg + +// OMG.LOL : +// Submitted by Adam Newbold +omg.lol + +// Omnibond Systems, LLC. : https://www.omnibond.com +// Submitted by Cole Estep +cloudycluster.net + +// OmniWe Limited: https://omniwe.com +// Submitted by Vicary Archangel +omniwe.site + // One Fold Media : http://www.onefoldmedia.com/ // Submitted by Eddie Jones nid.io +// Open Social : https://www.getopensocial.com/ +// Submitted by Alexander Varwijk +opensocial.site + +// OpenCraft GmbH : http://opencraft.com/ +// Submitted by Sven Marnach +opencraft.hosting + // Opera Software, A.S.A. // Submitted by Yngve Pettersen operaunite.com +// Oursky Limited : https://skygear.io/ +// Submited by Skygear Developer +skygearapp.com + // OutSystems // Submitted by Duarte Santos outsystemscloud.com +// OwnProvider GmbH: http://www.ownprovider.com +// Submitted by Jan Moennich +ownprovider.com +own.pm + +// OwO : https://whats-th.is/ +// Submitted by Dean Sheather +*.owo.codes + +// OX : http://www.ox.rs +// Submitted by Adam Grand +ox.rs + +// oy.lc +// Submitted by Charly Coste +oy.lc + +// Pagefog : https://pagefog.com/ +// Submitted by Derek Myers +pgfog.com + // Pagefront : https://www.pagefronthq.com/ // Submitted by Jason Kriss pagefrontapp.com +// PageXL : https://pagexl.com +// Submitted by Yann Guichard +pagexl.com + +// pcarrier.ca Software Inc: https://pcarrier.ca/ +// Submitted by Pierre Carrier +bar0.net +bar1.net +bar2.net +rdv.to + // .pl domains (grandfathered) art.pl gliwice.pl @@ -11266,9 +12813,49 @@ zakopane.pl // Pantheon Systems, Inc. : https://pantheon.io/ // Submitted by Gary Dylina -pantheon.io +pantheonsite.io gotpantheon.com +// Peplink | Pepwave : http://peplink.com/ +// Submitted by Steve Leung +mypep.link + +// Perspecta : https://perspecta.com/ +// Submitted by Kenneth Van Alstyne +perspecta.cloud + +// Planet-Work : https://www.planet-work.com/ +// Submitted by Frédéric VANNIÈRE +on-web.fr + +// Platform.sh : https://platform.sh +// Submitted by Nikola Kotur +bc.platform.sh +ent.platform.sh +eu.platform.sh +us.platform.sh +*.platformsh.site + +// Platter: https://platter.dev +// Submitted by Patrick Flor +platter-app.com +platter-app.dev +platterp.us + +// Plesk : https://www.plesk.com/ +// Submitted by Anton Akhtyamov +pdns.page +plesk.page +pleskns.com + +// Port53 : https://port53.io/ +// Submitted by Maximilian Schieder +dyn53.io + +// Positive Codes Technology Company : http://co.bn/faq.html +// Submitted by Zulfais +co.bn + // prgmr.com : https://prgmr.com/ // Submitted by Sarah Newman xen.prgmr.com @@ -11277,34 +12864,270 @@ xen.prgmr.com // Submitted by registry priv.at +// privacytools.io : https://www.privacytools.io/ +// Submitted by Jonah Aragon +prvcy.page + +// Protocol Labs : https://protocol.ai/ +// Submitted by Michael Burns +*.dweb.link + +// Protonet GmbH : http://protonet.io +// Submitted by Martin Meier +protonet.io + +// Publication Presse Communication SARL : https://ppcom.fr +// Submitted by Yaacov Akiba Slama +chirurgiens-dentistes-en-france.fr +byen.site + +// pubtls.org: https://www.pubtls.org +// Submitted by Kor Nielsen +pubtls.org + +// Qualifio : https://qualifio.com/ +// Submitted by Xavier De Cock +qualifioapp.com + +// QuickBackend: https://www.quickbackend.com +// Submitted by Dani Biro +qbuser.com + +// Redstar Consultants : https://www.redstarconsultants.com/ +// Submitted by Jons Slemmer +instantcloud.cn + +// Russian Academy of Sciences +// Submitted by Tech Support +ras.ru + // QA2 // Submitted by Daniel Dent (https://www.danieldent.com/) qa2.com +// QCX +// Submitted by Cassandra Beelen +qcx.io +*.sys.qcx.io + +// QNAP System Inc : https://www.qnap.com +// Submitted by Nick Chang +dev-myqnapcloud.com +alpha-myqnapcloud.com +myqnapcloud.com + +// Quip : https://quip.com +// Submitted by Patrick Linehan +*.quipelements.com + +// Qutheory LLC : http://qutheory.io +// Submitted by Jonas Schwartz +vapor.cloud +vaporcloud.io + // Rackmaze LLC : https://www.rackmaze.com // Submitted by Kirill Pertsev rackmaze.com rackmaze.net +// Rakuten Games, Inc : https://dev.viberplay.io +// Submitted by Joshua Zhang +g.vbrplsbx.io + +// Rancher Labs, Inc : https://rancher.com +// Submitted by Vincent Fiduccia +*.on-k3s.io +*.on-rancher.cloud +*.on-rio.io + +// Read The Docs, Inc : https://www.readthedocs.org +// Submitted by David Fischer +readthedocs.io + // Red Hat, Inc. OpenShift : https://openshift.redhat.com/ // Submitted by Tim Kramer rhcloud.com +// Render : https://render.com +// Submitted by Anurag Goel +app.render.com +onrender.com + +// Repl.it : https://repl.it +// Submitted by Mason Clayton +repl.co +repl.run + +// Resin.io : https://resin.io +// Submitted by Tim Perry +resindevice.io +devices.resinstaging.io + +// RethinkDB : https://www.rethinkdb.com/ +// Submitted by Chris Kastorff +hzc.io + +// Revitalised Limited : http://www.revitalised.co.uk +// Submitted by Jack Price +wellbeingzone.eu +ptplus.fit +wellbeingzone.co.uk + +// Rochester Institute of Technology : http://www.rit.edu/ +// Submitted by Jennifer Herting +git-pages.rit.edu + // Sandstorm Development Group, Inc. : https://sandcats.io/ // Submitted by Asheesh Laroia sandcats.io +// SBE network solutions GmbH : https://www.sbe.de/ +// Submitted by Norman Meilick +logoip.de +logoip.com + +// schokokeks.org GbR : https://schokokeks.org/ +// Submitted by Hanno Böck +schokokeks.net + +// Scottish Government: https://www.gov.scot +// Submitted by Martin Ellis +gov.scot + +// Scry Security : http://www.scrysec.com +// Submitted by Shante Adam +scrysec.com + +// Securepoint GmbH : https://www.securepoint.de +// Submitted by Erik Anders +firewall-gateway.com +firewall-gateway.de +my-gateway.de +my-router.de +spdns.de +spdns.eu +firewall-gateway.net +my-firewall.org +myfirewall.org +spdns.org + +// Seidat : https://www.seidat.com +// Submitted by Artem Kondratev +seidat.net + +// Senseering GmbH : https://www.senseering.de +// Submitted by Felix Mönckemeyer +senseering.net + // Service Online LLC : http://drs.ua/ // Submitted by Serhii Bulakh biz.ua co.ua pp.ua +// ShiftEdit : https://shiftedit.net/ +// Submitted by Adam Jimenez +shiftedit.io + +// Shopblocks : http://www.shopblocks.com/ +// Submitted by Alex Bowers +myshopblocks.com + +// Shopit : https://www.shopitcommerce.com/ +// Submitted by Craig McMahon +shopitsite.com + +// shopware AG : https://shopware.com +// Submitted by Jens Küper +shopware.store + +// Siemens Mobility GmbH +// Submitted by Oliver Graebner +mo-siemens.io + // SinaAppEngine : http://sae.sina.com.cn/ // Submitted by SinaAppEngine +1kapp.com +appchizi.com +applinzi.com sinaapp.com vipsinaapp.com -1kapp.com + +// Siteleaf : https://www.siteleaf.com/ +// Submitted by Skylar Challand +siteleaf.net + +// Skyhat : http://www.skyhat.io +// Submitted by Shante Adam +bounty-full.com +alpha.bounty-full.com +beta.bounty-full.com + +// Small Technology Foundation : https://small-tech.org +// Submitted by Aral Balkan +small-web.org + +// Stackhero : https://www.stackhero.io +// Submitted by Adrien Gillon +stackhero-network.com + +// staticland : https://static.land +// Submitted by Seth Vincent +static.land +dev.static.land +sites.static.land + +// Sony Interactive Entertainment LLC : https://sie.com/ +// Submitted by David Coles +playstation-cloud.com + +// SourceLair PC : https://www.sourcelair.com +// Submitted by Antonis Kalipetis +apps.lair.io +*.stolos.io + +// SpaceKit : https://www.spacekit.io/ +// Submitted by Reza Akhavan +spacekit.io + +// SpeedPartner GmbH: https://www.speedpartner.de/ +// Submitted by Stefan Neufeind +customer.speedpartner.de + +// Standard Library : https://stdlib.com +// Submitted by Jacob Lee +api.stdlib.com + +// Storj Labs Inc. : https://storj.io/ +// Submitted by Philip Hutchins +storj.farm + +// Studenten Net Twente : http://www.snt.utwente.nl/ +// Submitted by Silke Hofstra +utwente.io + +// Student-Run Computing Facility : https://www.srcf.net/ +// Submitted by Edwin Balani +soc.srcf.net +user.srcf.net + +// Sub 6 Limited: http://www.sub6.com +// Submitted by Dan Miller +temp-dns.com + +// Swisscom Application Cloud: https://developer.swisscom.com +// Submitted by Matthias.Winzeler +applicationcloud.io +scapp.io + +// Symfony, SAS : https://symfony.com/ +// Submitted by Fabien Potencier +*.s5y.io +*.sensiosite.cloud + +// Syncloud : https://syncloud.org +// Submitted by Boris Rybalkin +syncloud.it // Synology, Inc. : https://www.synology.com/ // Submitted by Rony Weng @@ -11321,6 +13144,12 @@ familyds.org i234.me myds.me synology.me +vpnplus.to +direct.quickconnect.to + +// TAIFUN Software AG : http://taifun-software.de +// Submitted by Bjoern Henke +taifun-dns.de // TASK geographical domains (www.task.gda.pl/uslugi/dns) gda.pl @@ -11329,6 +13158,94 @@ gdynia.pl med.pl sopot.pl +// Teckids e.V. : https://www.teckids.org +// Submitted by Dominik George +edugit.org + +// Telebit : https://telebit.cloud +// Submitted by AJ ONeal +telebit.app +telebit.io +*.telebit.xyz + +// The Gwiddle Foundation : https://gwiddlefoundation.org.uk +// Submitted by Joshua Bayfield +gwiddle.co.uk + +// Thingdust AG : https://thingdust.com/ +// Submitted by Adrian Imboden +thingdustdata.com +cust.dev.thingdust.io +cust.disrec.thingdust.io +cust.prod.thingdust.io +cust.testing.thingdust.io +*.firenet.ch +*.svc.firenet.ch + +// Tlon.io : https://tlon.io +// Submitted by Mark Staarink +arvo.network +azimuth.network +tlon.network + +// TownNews.com : http://www.townnews.com +// Submitted by Dustin Ward +bloxcms.com +townnews-staging.com + +// TrafficPlex GmbH : https://www.trafficplex.de/ +// Submitted by Phillipp Röll +12hp.at +2ix.at +4lima.at +lima-city.at +12hp.ch +2ix.ch +4lima.ch +lima-city.ch +trafficplex.cloud +de.cool +12hp.de +2ix.de +4lima.de +lima-city.de +1337.pictures +clan.rip +lima-city.rocks +webspace.rocks +lima.zone + +// TransIP : https://www.transip.nl +// Submitted by Rory Breuk +*.transurl.be +*.transurl.eu +*.transurl.nl + +// TuxFamily : http://tuxfamily.org +// Submitted by TuxFamily administrators +tuxfamily.org + +// TwoDNS : https://www.twodns.de/ +// Submitted by TwoDNS-Support +dd-dns.de +diskstation.eu +diskstation.org +dray-dns.de +draydns.de +dyn-vpn.de +dynvpn.de +mein-vigor.de +my-vigor.de +my-wan.de +syno-ds.de +synology-diskstation.de +synology-ds.de + +// Uberspace : https://uberspace.de +// Submitted by Moritz Werner +uber.space +*.uberspace.de + // UDR Limited : http://www.udr.hk.com // Submitted by registry hk.com @@ -11336,13 +13253,223 @@ hk.org ltd.hk inc.hk +// United Gameserver GmbH : https://united-gameserver.de +// Submitted by Stefan Schwarz +virtualuser.de +virtual-user.de + +// urown.net : https://urown.net +// Submitted by Hostmaster +urown.cloud +dnsupdate.info + +// .US +// Submitted by Ed Moore +lib.de.us + +// VeryPositive SIA : http://very.lv +// Submitted by Danko Aleksejevs +2038.io + +// Vercel, Inc : https://vercel.com/ +// Submitted by Connor Davis +vercel.app +vercel.dev +now.sh + +// Viprinet Europe GmbH : http://www.viprinet.com +// Submitted by Simon Kissel +router.management + +// Virtual-Info : https://www.virtual-info.info/ +// Submitted by Adnan RIHAN +v-info.info + +// Voorloper.com: https://voorloper.com +// Submitted by Nathan van Bakel +voorloper.cloud + +// Voxel.sh DNS : https://voxel.sh/dns/ +// Submitted by Mia Rehlinger +neko.am +nyaa.am +be.ax +cat.ax +es.ax +eu.ax +gg.ax +mc.ax +us.ax +xy.ax +nl.ci +xx.gl +app.gp +blog.gt +de.gt +to.gt +be.gy +cc.hn +blog.kg +io.kg +jp.kg +tv.kg +uk.kg +us.kg +de.ls +at.md +de.md +jp.md +to.md +uwu.nu +indie.porn +vxl.sh +ch.tc +me.tc +we.tc +nyan.to +at.vg +blog.vu +dev.vu +me.vu + +// V.UA Domain Administrator : https://domain.v.ua/ +// Submitted by Serhii Rostilo +v.ua + +// Waffle Computer Inc., Ltd. : https://docs.waffleinfo.com +// Submitted by Masayuki Note +wafflecell.com + +// WapBlog.ID : https://www.wapblog.id +// Submitted by Fajar Sodik +idnblogger.com +indowapblog.com +bloghp.id +wblog.id +wbq.me +fastblog.net + +// WebHare bv: https://www.webhare.com/ +// Submitted by Arnold Hendriks +*.webhare.dev + +// WeDeploy by Liferay, Inc. : https://www.wedeploy.com +// Submitted by Henrique Vicente +wedeploy.io +wedeploy.me +wedeploy.sh + +// Western Digital Technologies, Inc : https://www.wdc.com +// Submitted by Jung Jin +remotewd.com + +// WIARD Enterprises : https://wiardweb.com +// Submitted by Kidd Hustle +pages.wiardweb.com + +// Wikimedia Labs : https://wikitech.wikimedia.org +// Submitted by Arturo Borrero Gonzalez +wmflabs.org +toolforge.org +wmcloud.org + +// WISP : https://wisp.gg +// Submitted by Stepan Fedotov +panel.gg +daemon.panel.gg + +// WoltLab GmbH : https://www.woltlab.com +// Submitted by Tim Düsterhus +myforum.community +community-pro.de +diskussionsbereich.de +community-pro.net +meinforum.net + +// www.com.vc : http://www.com.vc +// Submitted by Li Hui +cn.vu + +// XenonCloud GbR: https://xenoncloud.net +// Submitted by Julian Uphoff +half.host + +// XnBay Technology : http://www.xnbay.com/ +// Submitted by XnBay Developer +xnbay.com +u2.xnbay.com +u2-local.xnbay.com + +// XS4ALL Internet bv : https://www.xs4all.nl/ +// Submitted by Daniel Mostertman +cistron.nl +demon.nl +xs4all.space + +// Yandex.Cloud LLC: https://cloud.yandex.com +// Submitted by Alexander Lodin +yandexcloud.net +storage.yandexcloud.net +website.yandexcloud.net + +// YesCourse Pty Ltd : https://yescourse.com +// Submitted by Atul Bhouraskar +official.academy + // Yola : https://www.yola.com/ // Submitted by Stefano Rivera yolasite.com +// Yombo : https://yombo.net +// Submitted by Mitch Schwenk +ybo.faith +yombo.me +homelink.one +ybo.party +ybo.review +ybo.science +ybo.trade + +// Yunohost : https://yunohost.org +// Submitted by Valentin Grimaud +nohost.me +noho.st + // ZaNiC : http://www.za.net/ // Submitted by registry za.net za.org +// Zine EOOD : https://zine.bg/ +// Submitted by Martin Angelov +bss.design + +// Zitcom A/S : https://www.zitcom.dk +// Submitted by Emil Stahl +basicserver.io +virtualserver.io +enterprisecloud.nu + +// Mintere : https://mintere.com/ +// Submitted by Ben Aubin +mintere.site + +// Cityhost LLC : https://cityhost.ua +// Submitted by Maksym Rivtin +cx.ua + +// WP Engine : https://wpengine.com/ +// Submitted by Michael Smith +// Submitted by Brandon DuRette +wpenginepowered.com +js.wpenginepowered.com + +// Impertrix Solutions : +// Submitted by Zhixiang Zhao +impertrixcdn.com +impertrix.com + +// GignoSystemJapan: http://gsj.bz +// Submitted by GignoSystemJapan +gsj.bz // ===END PRIVATE DOMAINS=== commit 781dd876e432b2ed1e2198ea12c10b122ace1c91 Author: Stefan Kangas Date: Mon Nov 23 12:12:29 2020 +0100 Use lexical-binding in most runtime leim lisp files * lisp/leim/quail/arabic.el: * lisp/leim/quail/croatian.el: * lisp/leim/quail/cyril-jis.el: * lisp/leim/quail/cyrillic.el: * lisp/leim/quail/czech.el: * lisp/leim/quail/ethiopic.el: * lisp/leim/quail/georgian.el: * lisp/leim/quail/greek.el: * lisp/leim/quail/hanja-jis.el: * lisp/leim/quail/hanja.el: * lisp/leim/quail/hanja3.el: * lisp/leim/quail/hebrew.el: * lisp/leim/quail/ipa-praat.el: * lisp/leim/quail/latin-alt.el: * lisp/leim/quail/latin-post.el: * lisp/leim/quail/latin-pre.el: * lisp/leim/quail/persian.el: * lisp/leim/quail/programmer-dvorak.el: * lisp/leim/quail/py-punct.el: * lisp/leim/quail/pypunct-b5.el: * lisp/leim/quail/rfc1345.el: * lisp/leim/quail/sami.el: * lisp/leim/quail/sgml-input.el: * lisp/leim/quail/slovak.el: * lisp/leim/quail/symbol-ksc.el: * lisp/leim/quail/tamil-dvorak.el: * lisp/leim/quail/vntelex.el: * lisp/leim/quail/vnvni.el: * lisp/leim/quail/welsh.el: Use lexical-binding. diff --git a/lisp/leim/quail/arabic.el b/lisp/leim/quail/arabic.el index a3424c8404..dd840c344c 100644 --- a/lisp/leim/quail/arabic.el +++ b/lisp/leim/quail/arabic.el @@ -1,4 +1,4 @@ -;;; arabic.el --- Quail package for inputting Arabic -*- coding: utf-8;-*- +;;; arabic.el --- Quail package for inputting Arabic -*- coding: utf-8; lexical-binding:t -*- ;; Copyright (C) 2007-2020 Free Software Foundation, Inc. diff --git a/lisp/leim/quail/croatian.el b/lisp/leim/quail/croatian.el index 97bfb855fb..2efd7ce6bb 100644 --- a/lisp/leim/quail/croatian.el +++ b/lisp/leim/quail/croatian.el @@ -1,4 +1,4 @@ -;;; croatian.el -- Quail package for inputting Croatian -*-coding: utf-8;-*- +;;; croatian.el -- Quail package for inputting Croatian -*-coding: utf-8; lexical-binding:t -*- ;; Copyright (C) 2003-2020 Free Software Foundation, Inc. diff --git a/lisp/leim/quail/cyril-jis.el b/lisp/leim/quail/cyril-jis.el index 6109dfc0e0..730042b4bc 100644 --- a/lisp/leim/quail/cyril-jis.el +++ b/lisp/leim/quail/cyril-jis.el @@ -1,4 +1,4 @@ -;;; cyril-jis.el --- Quail package for inputting JISX0208 Cyrillic letters +;;; cyril-jis.el --- Quail package for inputting JISX0208 Cyrillic letters -*- lexical-binding: t -*- ;; Copyright (C) 2001-2020 Free Software Foundation, Inc. ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, diff --git a/lisp/leim/quail/cyrillic.el b/lisp/leim/quail/cyrillic.el index 8845223e9a..fa209f0bce 100644 --- a/lisp/leim/quail/cyrillic.el +++ b/lisp/leim/quail/cyrillic.el @@ -1,4 +1,4 @@ -;;; cyrillic.el --- Quail package for inputting Cyrillic characters +;;; cyrillic.el --- Quail package for inputting Cyrillic characters -*- lexical-binding: t -*- ;; Copyright (C) 1997-1998, 2001-2020 Free Software Foundation, Inc. ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, diff --git a/lisp/leim/quail/czech.el b/lisp/leim/quail/czech.el index 7c208ef15e..34416c2b91 100644 --- a/lisp/leim/quail/czech.el +++ b/lisp/leim/quail/czech.el @@ -1,4 +1,4 @@ -;;; czech.el --- Quail package for inputting Czech -*-coding: utf-8;-*- +;;; czech.el --- Quail package for inputting Czech -*-coding: utf-8; lexical-binding:t -*- ;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc. diff --git a/lisp/leim/quail/ethiopic.el b/lisp/leim/quail/ethiopic.el index 8d19a23370..c8753effe0 100644 --- a/lisp/leim/quail/ethiopic.el +++ b/lisp/leim/quail/ethiopic.el @@ -1,4 +1,4 @@ -;;; ethiopic.el --- Quail package for inputting Ethiopic characters -*-coding: utf-8-emacs;-*- +;;; ethiopic.el --- Quail package for inputting Ethiopic characters -*-coding: utf-8-emacs; lexical-binding:t -*- ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, ;; 2006, 2007, 2008, 2009, 2010, 2011 diff --git a/lisp/leim/quail/georgian.el b/lisp/leim/quail/georgian.el index b6da6befe1..e66477a66a 100644 --- a/lisp/leim/quail/georgian.el +++ b/lisp/leim/quail/georgian.el @@ -1,4 +1,4 @@ -;;; georgian.el --- Quail package for inputting Georgian characters -*-coding: utf-8;-*- +;;; georgian.el --- Quail package for inputting Georgian characters -*- coding: utf-8; lexical-binding:t -*- ;; Copyright (C) 2001-2020 Free Software Foundation, Inc. diff --git a/lisp/leim/quail/greek.el b/lisp/leim/quail/greek.el index 14bbacc4a3..eedfb9d0f6 100644 --- a/lisp/leim/quail/greek.el +++ b/lisp/leim/quail/greek.el @@ -1,4 +1,4 @@ -;;; greek.el --- Quail package for inputting Greek -*-coding: utf-8-*- +;;; greek.el --- Quail package for inputting Greek -*- coding: utf-8; lexical-binding:t -*- ;; Copyright (C) 2001-2020 Free Software Foundation, Inc. ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, diff --git a/lisp/leim/quail/hanja-jis.el b/lisp/leim/quail/hanja-jis.el index 6f75325945..c4eb4b57be 100644 --- a/lisp/leim/quail/hanja-jis.el +++ b/lisp/leim/quail/hanja-jis.el @@ -1,4 +1,4 @@ -;;; hanja-jis.el --- Quail package for inputting Korean Hanja (JISX0208) +;;; hanja-jis.el --- Quail package for inputting Korean Hanja (JISX0208) -*- lexical-binding: t -*- ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, ;; 2006, 2007, 2008, 2009, 2010, 2011 diff --git a/lisp/leim/quail/hanja.el b/lisp/leim/quail/hanja.el index 455af12b0a..3ca17c67bd 100644 --- a/lisp/leim/quail/hanja.el +++ b/lisp/leim/quail/hanja.el @@ -1,4 +1,4 @@ -;;; hanja.el --- Quail-package for Korean Hanja (KSC5601) -*-coding: utf-8;-*- +;;; hanja.el --- Quail-package for Korean Hanja (KSC5601) -*-coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc. ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, diff --git a/lisp/leim/quail/hanja3.el b/lisp/leim/quail/hanja3.el index f318c01bea..b380d40853 100644 --- a/lisp/leim/quail/hanja3.el +++ b/lisp/leim/quail/hanja3.el @@ -1,4 +1,4 @@ -;;; hanja3.el --- Quail-package for Korean Hanja (KSC5601) -*-coding: utf-8;-*- +;;; hanja3.el --- Quail-package for Korean Hanja (KSC5601) -*-coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 1997, 1999, 2001-2020 Free Software Foundation, Inc. diff --git a/lisp/leim/quail/hebrew.el b/lisp/leim/quail/hebrew.el index 772da70b5c..fc6bb80596 100644 --- a/lisp/leim/quail/hebrew.el +++ b/lisp/leim/quail/hebrew.el @@ -1,4 +1,4 @@ -;; hebrew.el --- Quail package for inputting Hebrew characters -*-coding: utf-8;-*- +;; hebrew.el --- Quail package for inputting Hebrew characters -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, ;; 2008, 2009, 2010, 2011 diff --git a/lisp/leim/quail/ipa-praat.el b/lisp/leim/quail/ipa-praat.el index 4c241ccf8e..cc577c6aff 100644 --- a/lisp/leim/quail/ipa-praat.el +++ b/lisp/leim/quail/ipa-praat.el @@ -1,4 +1,4 @@ -;;; ipa-praat.el --- Inputting IPA characters with the conventions of Praat +;;; ipa-praat.el --- Inputting IPA characters with the conventions of Praat -*- lexical-binding: t -*- ;; Copyright (C) 2011-2020 Free Software Foundation, Inc. diff --git a/lisp/leim/quail/latin-alt.el b/lisp/leim/quail/latin-alt.el index 06ab5e3d11..4661ba8cc8 100644 --- a/lisp/leim/quail/latin-alt.el +++ b/lisp/leim/quail/latin-alt.el @@ -1,4 +1,4 @@ -;;; latin-alt.el --- Quail package for inputting various European characters -*-coding: utf-8;-*- +;;; latin-alt.el --- Quail package for inputting various European characters -*-coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 1997-1998, 2001-2020 Free Software Foundation, Inc. ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, diff --git a/lisp/leim/quail/latin-post.el b/lisp/leim/quail/latin-post.el index 1d6aeddc06..293c0c0b6e 100644 --- a/lisp/leim/quail/latin-post.el +++ b/lisp/leim/quail/latin-post.el @@ -1,4 +1,4 @@ -;;; latin-post.el --- Quail packages for inputting various European characters -*-coding: utf-8;-*- +;;; latin-post.el --- Quail packages for inputting various European characters -*-coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 1997-1998, 2001-2020 Free Software Foundation, Inc. ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, diff --git a/lisp/leim/quail/latin-pre.el b/lisp/leim/quail/latin-pre.el index f421a7eb1d..802b70ec7c 100644 --- a/lisp/leim/quail/latin-pre.el +++ b/lisp/leim/quail/latin-pre.el @@ -1,4 +1,4 @@ -;;; latin-pre.el --- Quail packages for inputting various European characters -*-coding: utf-8;-*- +;;; latin-pre.el --- Quail packages for inputting various European characters -*-coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 1997-2020 Free Software Foundation, Inc. ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, diff --git a/lisp/leim/quail/persian.el b/lisp/leim/quail/persian.el index f12abc1ac9..fcbf727e93 100644 --- a/lisp/leim/quail/persian.el +++ b/lisp/leim/quail/persian.el @@ -1,4 +1,4 @@ -;;; persian.el --- Quail package for inputting Persian/Farsi keyboard -*- coding: utf-8;-*- +;;; persian.el --- Quail package for inputting Persian/Farsi keyboard -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2011-2020 Free Software Foundation, Inc. diff --git a/lisp/leim/quail/programmer-dvorak.el b/lisp/leim/quail/programmer-dvorak.el index 0429df01de..c544c62d07 100644 --- a/lisp/leim/quail/programmer-dvorak.el +++ b/lisp/leim/quail/programmer-dvorak.el @@ -1,4 +1,4 @@ -;;; programmer-dvorak.el --- Quail package for the programmer Dvorak layout +;;; programmer-dvorak.el --- Quail package for the programmer Dvorak layout -*- lexical-binding: t -*- ;; Copyright (C) 2015-2020 Free Software Foundation, Inc. diff --git a/lisp/leim/quail/py-punct.el b/lisp/leim/quail/py-punct.el index 90fa474dd0..76bf6125ef 100644 --- a/lisp/leim/quail/py-punct.el +++ b/lisp/leim/quail/py-punct.el @@ -1,4 +1,4 @@ -;;; py-punct.el --- Quail packages for Chinese (pinyin + extra symbols) +;;; py-punct.el --- Quail packages for Chinese (pinyin + extra symbols) -*- lexical-binding: t -*- ;; Copyright (C) 2001-2020 Free Software Foundation, Inc. ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, diff --git a/lisp/leim/quail/pypunct-b5.el b/lisp/leim/quail/pypunct-b5.el index 9f4e73c9f0..f9330bd24f 100644 --- a/lisp/leim/quail/pypunct-b5.el +++ b/lisp/leim/quail/pypunct-b5.el @@ -1,4 +1,4 @@ -;;; pypunct-b5.el --- Quail packages for Chinese (pinyin + extra symbols) +;;; pypunct-b5.el --- Quail packages for Chinese (pinyin + extra symbols) -*- lexical-binding: t -*- ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, ;; 2006, 2007, 2008, 2009, 2010, 2011 diff --git a/lisp/leim/quail/rfc1345.el b/lisp/leim/quail/rfc1345.el index c2e7cd9fad..7f98021dfe 100644 --- a/lisp/leim/quail/rfc1345.el +++ b/lisp/leim/quail/rfc1345.el @@ -1,4 +1,4 @@ -;;; rfc1345.el --- Quail method for RFC 1345 mnemonics -*- coding: utf-8 -*- +;;; rfc1345.el --- Quail method for RFC 1345 mnemonics -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2001-2020 Free Software Foundation, Inc. diff --git a/lisp/leim/quail/sami.el b/lisp/leim/quail/sami.el index 66750c3140..33fe2878df 100644 --- a/lisp/leim/quail/sami.el +++ b/lisp/leim/quail/sami.el @@ -1,4 +1,4 @@ -;;; sami.el --- Quail package for inputting Sámi -*-coding: utf-8;-*- +;;; sami.el --- Quail package for inputting Sámi -*-coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2019-2020 Free Software Foundation, Inc. diff --git a/lisp/leim/quail/sgml-input.el b/lisp/leim/quail/sgml-input.el index 5cc9f5e0cc..df7ac984ce 100644 --- a/lisp/leim/quail/sgml-input.el +++ b/lisp/leim/quail/sgml-input.el @@ -1,4 +1,4 @@ -;;; sgml-input.el --- Quail method for Unicode entered as SGML entities -*- coding: utf-8 -*- +;;; sgml-input.el --- Quail method for Unicode entered as SGML entities -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2001-2020 Free Software Foundation, Inc. diff --git a/lisp/leim/quail/slovak.el b/lisp/leim/quail/slovak.el index 828d25a2e3..c306be1e55 100644 --- a/lisp/leim/quail/slovak.el +++ b/lisp/leim/quail/slovak.el @@ -1,4 +1,4 @@ -;;; slovak.el --- Quail package for inputting Slovak -*-coding: utf-8;-*- +;;; slovak.el --- Quail package for inputting Slovak -*-coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 1998, 2001-2020 Free Software Foundation, Inc. diff --git a/lisp/leim/quail/symbol-ksc.el b/lisp/leim/quail/symbol-ksc.el index ae33786c5e..e346f7c7bd 100644 --- a/lisp/leim/quail/symbol-ksc.el +++ b/lisp/leim/quail/symbol-ksc.el @@ -1,4 +1,4 @@ -;;; symbol-ksc.el --- Quail-package for Korean Symbol (KSC5601) -*-coding: utf-8;-*- +;;; symbol-ksc.el --- Quail-package for Korean Symbol (KSC5601) -*-coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 1997, 2001-2020 Free Software Foundation, Inc. ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, diff --git a/lisp/leim/quail/tamil-dvorak.el b/lisp/leim/quail/tamil-dvorak.el index 93ff0ccdac..0a70c3bfe1 100644 --- a/lisp/leim/quail/tamil-dvorak.el +++ b/lisp/leim/quail/tamil-dvorak.el @@ -1,4 +1,4 @@ -;;; tamil-dvorak.el --- Quail package for Tamil input with Dvorak keyboard +;;; tamil-dvorak.el --- Quail package for Tamil input with Dvorak keyboard -*- lexical-binding: t -*- ;; Copyright (C) 2015-2020 Free Software Foundation, Inc. diff --git a/lisp/leim/quail/vntelex.el b/lisp/leim/quail/vntelex.el index 385bc910bb..8d53ab0be0 100644 --- a/lisp/leim/quail/vntelex.el +++ b/lisp/leim/quail/vntelex.el @@ -1,4 +1,4 @@ -;;; vntelex.el --- Quail package for Vietnamese by Telex method +;;; vntelex.el --- Quail package for Vietnamese by Telex method -*- lexical-binding: t -*- ;; Copyright (C) 2001-2020 Free Software Foundation, Inc. diff --git a/lisp/leim/quail/vnvni.el b/lisp/leim/quail/vnvni.el index 36cad8e912..e7973044b0 100644 --- a/lisp/leim/quail/vnvni.el +++ b/lisp/leim/quail/vnvni.el @@ -1,4 +1,4 @@ -;;; vnvni.el --- Quail package for Vietnamese by VNI method +;;; vnvni.el --- Quail package for Vietnamese by VNI method -*- lexical-binding: t -*- ;; Copyright (C) 2001-2020 Free Software Foundation, Inc. diff --git a/lisp/leim/quail/welsh.el b/lisp/leim/quail/welsh.el index bc6e8ecd33..a62d2f5095 100644 --- a/lisp/leim/quail/welsh.el +++ b/lisp/leim/quail/welsh.el @@ -1,4 +1,4 @@ -;;; welsh.el --- Quail package for inputting Welsh characters -*-coding: utf-8;-*- +;;; welsh.el --- Quail package for inputting Welsh characters -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2001-2020 Free Software Foundation, Inc. commit 8b7fa9e663d8898adebe7315bc9dcc4272858446 Author: Eric Abrahamsen Date: Thu Nov 19 16:32:41 2020 -0800 Small fixes to gnus-search output parsing of indexed engines * lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output): When filtering for desired groups, accept any of [.\/] as potential segment delimiters. Later on, filesystem path separators will be interpreted as dots (".") when constructing group names. Also, make sure we use `expand-file-name' on the prefix, and just use `string-remove-prefix' to get rid of it. diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 498da200da..492ee2052c 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1365,10 +1365,13 @@ Returns a list of [group article score] vectors." server query &optional groups) (let ((prefix (slot-value engine 'remove-prefix)) (group-regexp (when groups - (regexp-opt - (mapcar - (lambda (x) (gnus-group-real-name x)) - groups)))) + (mapconcat + (lambda (x) + (replace-regexp-in-string + ;; Accept any of [.\/] as path separators. + "[.\\/]" "[.\\\\/]" + (gnus-group-real-name x))) + groups "\\|"))) artlist vectors article group) (goto-char (point-min)) (while (not (eobp)) @@ -1383,16 +1386,16 @@ Returns a list of [group article score] vectors." ;; Are we running an additional grep query? (when-let ((grep-reg (alist-get 'grep query))) (setq artlist (gnus-search-grep-search engine artlist grep-reg))) + ;; Prep prefix. + (when (and prefix (null (string-empty-p prefix))) + (setq prefix (file-name-as-directory (expand-file-name prefix)))) ;; Turn (file-name score) into [group article score]. (pcase-dolist (`(,f-name ,score) artlist) - (setq article (file-name-nondirectory f-name)) + (setq article (file-name-nondirectory f-name) + group (file-name-directory f-name)) ;; Remove prefix. - (when (and prefix - (file-name-absolute-p prefix) - (string-match (concat "^" - (file-name-as-directory prefix)) - f-name)) - (setq group (replace-match "" t t (file-name-directory f-name)))) + (when prefix + (setq group (string-remove-prefix prefix group))) ;; Break the directory name down until it's something that ;; (probably) can be used as a group name. (setq group commit edd949a3eb8907eed84eab30e170cc138a5b2d41 Author: Philipp Stephani Date: Sun Nov 22 23:22:50 2020 +0100 Unbreak compilation with CHECK_STRUCTS. Commit 3963aea4f4a22da0c1fb8ca8ca80b59c58373811 modified the ‘buffer’ structure, but didn’t adapt the hash. * src/pdumper.c (dump_buffer): Update buffer hash. diff --git a/src/pdumper.c b/src/pdumper.c index b5b4050b93..0096a4d45a 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2692,7 +2692,7 @@ dump_hash_table (struct dump_context *ctx, static dump_off dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer) { -#if CHECK_STRUCTS && !defined HASH_buffer_5DC36DBD42 +#if CHECK_STRUCTS && !defined HASH_buffer_EE36B4292E # error "buffer changed. See CHECK_STRUCTS comment in config.h." #endif struct buffer munged_buffer = *in_buffer; commit 9b6ad3107f93d40f82c3c53dc0984c6d70aded83 Author: Michael Albinus Date: Sun Nov 22 19:56:23 2020 +0100 Replace /dev/null by remote null-device in Tramp. * lisp/net/tramp-adb.el (tramp-adb-get-ls-command) (tramp-adb-handle-set-file-times, tramp-adb-handle-process-file): Use `tramp-get-remote-null-device'. * lisp/net/tramp-compat.el (tramp-tramp-file-p): Declare. (tramp-compat-null-device): New defalias. * lisp/net/tramp-sh.el (tramp-methods) : (tramp-perl-encode-with-module, tramp-perl-decode-with-module) (tramp-perl-encode, tramp-perl-decode, tramp-awk-decode): Use "%n" marker. (tramp-do-directory-files-and-attributes-with-stat) (tramp-sh-handle-file-name-all-completions) (tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-insert-directory, tramp-sh-handle-process-file) (tramp-set-remote-path, tramp-open-connection-setup-interactive-shell) (tramp-find-inline-encoding, tramp-send-command-and-check) (tramp-get-remote-path, tramp-get-ls-command, tramp-get-ls-command-with) (tramp-get-remote-awk, tramp-get-remote-hexdump, tramp-get-remote-od) (tramp-get-env-with-u-option): Use `tramp-get-remote-null-device'. (tramp-remote-coding-commands, tramp-call-local-coding-command): Adapt docstring. * lisp/net/tramp-smb.el (tramp-smb-conf): Use `null-device'. (tramp-smb-handle-file-acl): Use `tramp-get-remote-null-device'. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-get-remote-null-device): New defun. (tramp-interrupt-process): Use it. diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 750b735c1b..51cb316249 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -363,7 +363,8 @@ ARGUMENTS to pass to the OPERATION." ;; by GNU Coreutils. Force "ls" to print one column and set ;; time-style to imitate other "ls" flavors. ((tramp-adb-send-command-and-check - vec "ls --time-style=long-iso /dev/null") + vec (concat "ls --time-style=long-iso " + (tramp-get-remote-null-device vec))) "ls -1 --time-style=long-iso") ;; Can't disable coloring explicitly for toybox ls command. We ;; also must force "ls" to print just one column. @@ -371,7 +372,8 @@ ARGUMENTS to pass to the OPERATION." ;; On CyanogenMod based system BusyBox is used and "ls" output ;; coloring is enabled by default. So we try to disable it when ;; possible. - ((tramp-adb-send-command-and-check vec "ls --color=never -al /dev/null") + ((tramp-adb-send-command-and-check + vec (concat "ls --color=never -al " (tramp-get-remote-null-device vec))) "ls --color=never") (t "ls")))) @@ -611,13 +613,13 @@ But handle the case, if the \"test\" command is not available." ;; (introduced in POSIX.1-2008) fails. (tramp-adb-send-command-and-check v (format - (concat "touch -d %s %s %s 2>/dev/null || " - "touch -d %s %s %s 2>/dev/null || " + (concat "touch -d %s %s %s 2>%s || " + "touch -d %s %s %s 2>%s || " "touch -t %s %s %s") (format-time-string "%Y-%m-%dT%H:%M:%S.%NZ" time t) - nofollow quoted-name + nofollow quoted-name (tramp-get-remote-null-device v) (format-time-string "%Y-%m-%dT%H:%M:%S" time t) - nofollow quoted-name + nofollow quoted-name (tramp-get-remote-null-device v) (format-time-string "%Y%m%d%H%M.%S" time t) nofollow quoted-name))))) @@ -791,7 +793,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (cons program args) " ")) ;; Determine input. (if (null infile) - (setq input "/dev/null") + (setq input (tramp-get-remote-null-device v)) (setq infile (expand-file-name infile)) (if (tramp-equal-remote default-directory infile) ;; INFILE is on the same remote host. @@ -833,7 +835,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." tmpstderr (tramp-make-tramp-file-name v stderr)))) ;; stderr to be discarded. ((null (cadr destination)) - (setq stderr "/dev/null")))) + (setq stderr (tramp-get-remote-null-device v))))) ;; 't (destination (setq outbuf (current-buffer)))) diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 9a4e16efe2..7fae9ba7e2 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -43,6 +43,7 @@ ;; `temporary-file-directory' as function is introduced with Emacs 26.1. (declare-function tramp-handle-temporary-file-directory "tramp") +(declare-function tramp-tramp-file-p "tramp") (defvar tramp-temp-name-prefix) (defconst tramp-compat-emacs-compiled-version (eval-when-compile emacs-version) @@ -333,6 +334,13 @@ A nil value for either argument stands for the current time." (null (tramp-compat-directory-files dir nil directory-files-no-dot-files-regexp t 1)))))) +;; Function `null-device' is new in Emacs 28.1. +(defalias 'tramp-compat-null-device + (if (fboundp 'null-device) + #'null-device + (lambda () + (if (tramp-tramp-file-p default-directory) "/dev/null" null-device)))) + (add-hook 'tramp-unload-hook (lambda () (unload-feature 'tramp-loaddefs 'force) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index f9b218a970..d2265ed1df 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -244,14 +244,14 @@ The string is used in `tramp-methods'.") (add-to-list 'tramp-methods `("telnet" (tramp-login-program "telnet") - (tramp-login-args (("%h") ("%p") ("2>/dev/null"))) + (tramp-login-args (("%h") ("%p") ("%n"))) (tramp-remote-shell ,tramp-default-remote-shell) (tramp-remote-shell-login ("-l")) (tramp-remote-shell-args ("-c")))) (add-to-list 'tramp-methods `("nc" (tramp-login-program "telnet") - (tramp-login-args (("%h") ("%p") ("2>/dev/null"))) + (tramp-login-args (("%h") ("%p") ("%n"))) (tramp-remote-shell ,tramp-default-remote-shell) (tramp-remote-shell-login ("-l")) (tramp-remote-shell-args ("-c")) @@ -262,8 +262,7 @@ The string is used in `tramp-methods'.") ;; We use "-p" as required for newer busyboxes. For older ;; busybox/nc versions, the value must be (("-l") ("%r")). This ;; can be achieved by tweaking `tramp-connection-properties'. - (tramp-remote-copy-args (("-l") ("-p" "%r") - ("2>/dev/null"))))) + (tramp-remote-copy-args (("-l") ("-p" "%r") ("%n"))))) (add-to-list 'tramp-methods `("su" (tramp-login-program "su") @@ -763,7 +762,7 @@ This string is passed to `format', so percent characters need to be doubled.") ;; These two use base64 encoding. (defconst tramp-perl-encode-with-module - "%s -MMIME::Base64 -0777 -ne 'print encode_base64($_)' 2>/dev/null" + "%s -MMIME::Base64 -0777 -ne 'print encode_base64($_)' %n" "Perl program to use for encoding a file. Escape sequence %s is replaced with name of Perl binary. This string is passed to `format', so percent characters need to be doubled. @@ -771,7 +770,7 @@ This implementation requires the MIME::Base64 Perl module to be installed on the remote host.") (defconst tramp-perl-decode-with-module - "%s -MMIME::Base64 -0777 -ne 'print decode_base64($_)' 2>/dev/null" + "%s -MMIME::Base64 -0777 -ne 'print decode_base64($_)' %n" "Perl program to use for decoding a file. Escape sequence %s is replaced with name of Perl binary. This string is passed to `format', so percent characters need to be doubled. @@ -812,7 +811,7 @@ while (read STDIN, $data, 54) { (substr(unpack(q(B*), $data) . q(00000), 0, 432) =~ /....../g)), $pad, qq(\\n); -}' 2>/dev/null" +}' %n" "Perl program to use for encoding a file. Escape sequence %s is replaced with name of Perl binary. This string is passed to `format', so percent characters need to be doubled.") @@ -856,7 +855,7 @@ while (my $data = ) { ((join q(), map {$trans{$_} || q()} split //, $chunk) =~ /......../g); last if $finished; -}' 2>/dev/null" +}' %n" "Perl program to use for decoding a file. Escape sequence %s is replaced with name of Perl binary. This string is passed to `format', so percent characters need to be doubled.") @@ -938,7 +937,7 @@ BEGIN { if (o) { printf \"%%c\", o } else { - system(\"dd if=/dev/zero bs=1 count=1 2>/dev/null\") + system(\"dd if=/dev/zero bs=1 count=1 %n\") } obc=0; o=0 } @@ -1785,7 +1784,7 @@ ID-FORMAT valid values are `string' and `integer'." "cd %s && echo \"(\"; (%s %s -a | tr '\\n\\r' '\\000\\000' | " "xargs -0 %s -c " "'(%s%%n%s (%s%%N%s) %%h %s %s %%X %%Y %%Z %%s %s%%A%s t %%i -1)' " - "-- 2>/dev/null | sed -e 's/\"/\\\\\"/g' -e 's/%s/\"/g'); echo \")\"") + "-- 2>%s | sed -e 's/\"/\\\\\"/g' -e 's/%s/\"/g'); echo \")\"") (tramp-shell-quote-argument localname) (tramp-get-ls-command vec) ;; On systems which have no quoting style, file names with special @@ -1801,6 +1800,7 @@ ID-FORMAT valid values are `string' and `integer'." "%g" (eval-when-compile (concat tramp-stat-marker "%G" tramp-stat-marker))) tramp-stat-marker tramp-stat-marker + (tramp-get-remote-null-device vec) tramp-stat-quoted-marker))) ;; This function should return "foo/" for directories and "bar" for @@ -1827,14 +1827,16 @@ ID-FORMAT valid values are `string' and `integer'." (tramp-shell-quote-argument localname))) (format (concat - "(cd %s 2>&1 && %s -a 2>/dev/null" + "(cd %s 2>&1 && %s -a 2>%s" " | while IFS= read f; do" - " if %s -d \"$f\" 2>/dev/null;" + " if %s -d \"$f\" 2>%s;" " then \\echo \"$f/\"; else \\echo \"$f\"; fi; done" " && \\echo ok) || \\echo fail") (tramp-shell-quote-argument localname) (tramp-get-ls-command v) - (tramp-get-test-command v)))) + (tramp-get-remote-null-device v) + (tramp-get-test-command v) + (tramp-get-remote-null-device v)))) ;; Now grab the output. (with-current-buffer (tramp-get-buffer v) @@ -2362,7 +2364,8 @@ The method used must be an out-of-band method." options (format-spec (tramp-ssh-controlmaster-options v) spec) spec (format-spec-make ?h host ?u user ?p port ?r listener ?c options - ?k (if keep-date " " "")) + ?k (if keep-date " " "") + ?n (concat "2>" (tramp-get-remote-null-device v))) copy-program (tramp-get-method-parameter v 'tramp-copy-program) copy-keep-date (tramp-get-method-parameter v 'tramp-copy-keep-date) @@ -2629,12 +2632,13 @@ The method used must be an out-of-band method." (if full-directory-p (tramp-send-command v - (format "%s %s %s 2>/dev/null" + (format "%s %s %s 2>%s" (tramp-get-ls-command v) switches (if wildcard localname - (tramp-shell-quote-argument (concat localname "."))))) + (tramp-shell-quote-argument (concat localname "."))) + (tramp-get-remote-null-device v))) (tramp-barf-unless-okay v (format "cd %s" (tramp-shell-quote-argument @@ -2645,7 +2649,7 @@ The method used must be an out-of-band method." (tramp-run-real-handler #'file-name-directory (list localname)))) (tramp-send-command v - (format "%s %s %s 2>/dev/null" + (format "%s %s %s 2>%s" (tramp-get-ls-command v) switches (if (or wildcard @@ -2655,7 +2659,8 @@ The method used must be an out-of-band method." "" (tramp-shell-quote-argument (tramp-run-real-handler - #'file-name-nondirectory (list localname))))))) + #'file-name-nondirectory (list localname)))) + (tramp-get-remote-null-device v)))) (save-restriction (let ((beg (point))) @@ -3146,7 +3151,7 @@ implementation will be used." (mapconcat #'tramp-shell-quote-argument uenv " ") command))) ;; Determine input. (if (null infile) - (setq input "/dev/null") + (setq input (tramp-get-remote-null-device v)) (setq infile (expand-file-name infile)) (if (tramp-equal-remote default-directory infile) ;; INFILE is on the same remote host. @@ -3188,7 +3193,7 @@ implementation will be used." tmpstderr (tramp-make-tramp-file-name v stderr 'nohop)))) ;; stderr to be discarded. ((null (cadr destination)) - (setq stderr "/dev/null")))) + (setq stderr (tramp-get-remote-null-device v))))) ;; 't (destination (setq outbuf (current-buffer)))) @@ -4117,7 +4122,10 @@ variable PATH." (pipe-buf (with-tramp-connection-property vec "pipe-buf" (tramp-send-command-and-read - vec "getconf PIPE_BUF / 2>/dev/null || echo 4096" 'noerror))) + vec + (format "getconf PIPE_BUF / 2>%s || echo 4096" + (tramp-get-remote-null-device vec)) + 'noerror))) tmpfile chunk chunksize) (tramp-message vec 5 "Setting $PATH environment variable") (if (< (length command) pipe-buf) @@ -4439,7 +4447,12 @@ process to set up. VEC specifies the connection." (tramp-find-shell vec) ;; Disable unexpected output. - (tramp-send-command vec "mesg n 2>/dev/null; biff n 2>/dev/null" t) + (tramp-send-command + vec + (format "mesg n 2>%s; biff n 2>%s" + (tramp-get-remote-null-device vec) + (tramp-get-remote-null-device vec)) + t) ;; IRIX64 bash expands "!" even when in single quotes. This ;; destroys our shell functions, we must disable it. See @@ -4454,7 +4467,8 @@ process to set up. VEC specifies the connection." ;; Set utf8 encoding. Needed for macOS, for example. This is ;; non-POSIX, so we must expect errors on some systems. - (tramp-send-command vec "stty iutf8 2>/dev/null" t) + (tramp-send-command + vec (concat "stty iutf8 2>" (tramp-get-remote-null-device vec)) t) ;; Set `remote-tty' process property. (let ((tty (tramp-send-command-and-read vec "echo \\\"`tty`\\\"" 'noerror))) @@ -4570,7 +4584,8 @@ program will be transferred to the remote host, and it is available as shell function with the same name. A \"%t\" format specifier in the variable value denotes a temporary file. \"%a\", \"%h\" and \"%o\" format specifiers are replaced by the -respective `awk', `hexdump' and `od' commands. +respective `awk', `hexdump' and `od' commands. \"%n\" is +replaced by \"2>/dev/null\". The optional TEST command can be used for further tests, whether ENCODING and DECODING are applicable.") @@ -4657,6 +4672,8 @@ Goes through the list `tramp-local-coding-commands' and (format-spec-make ?a (tramp-get-remote-awk vec) ?h (tramp-get-remote-hexdump vec) + ?n (concat + "2>" (tramp-get-remote-null-device vec)) ?o (tramp-get-remote-od vec))) value (replace-regexp-in-string "%" "%%" value))) (tramp-maybe-send-script vec value name) @@ -4665,7 +4682,10 @@ Goes through the list `tramp-local-coding-commands' and vec 5 "Checking remote encoding command `%s' for sanity" rem-enc) (unless (tramp-send-command-and-check - vec (format "%s " (tramp-get-remote-null-device vec)) ?o (tramp-get-remote-od vec))) value (replace-regexp-in-string "%" "%%" value))) (when (string-match-p "\\(^\\|[^%]\\)%t" value) @@ -4727,7 +4749,7 @@ Goes through the list `tramp-local-coding-commands' and "Call the local encoding or decoding command. If CMD contains \"%s\", provide input file INPUT there in command. Otherwise, INPUT is passed via standard input. -INPUT can also be nil which means `/dev/null'. +INPUT can also be nil which means `null-device'. OUTPUT can be a string (which specifies a file name), or t (which means standard output and thus the current buffer), or nil (which means discard it)." @@ -5199,14 +5221,17 @@ status is 0, and nil otherwise. If the optional argument SUBSHELL is non-nil, the command is executed in a subshell, ie surrounded by parentheses. If -DONT-SUPPRESS-ERR is non-nil, stderr won't be sent to /dev/null. +DONT-SUPPRESS-ERR is non-nil, stderr won't be sent to \"/dev/null\". Optional argument EXIT-STATUS, if non-nil, triggers the return of the exit status." (tramp-send-command vec (concat (if subshell "( " "") command - (if command (if dont-suppress-err "; " " 2>/dev/null; ") "") + (if command + (if dont-suppress-err + "; " (format " 2>%s; " (tramp-get-remote-null-device vec))) + "") "echo tramp_exit_status $?" (if subshell " )" ""))) (with-current-buffer (tramp-get-connection-buffer vec) @@ -5416,7 +5441,11 @@ Nonexistent directories are removed from spec." (when elt1 (or (tramp-send-command-and-read - vec "echo \\\"`getconf PATH 2>/dev/null`\\\"" 'noerror) + vec + (format + "echo \\\"`getconf PATH 2>%s`\\\"" + (tramp-get-remote-null-device vec)) + 'noerror) ;; Default if "getconf" is not available. (progn (tramp-message @@ -5520,7 +5549,8 @@ Nonexistent directories are removed from spec." vec (format "%s -lnd /" result)) (when (tramp-send-command-and-check vec (format - "%s --color=never -al /dev/null" result)) + "%s --color=never -al %s" + result (tramp-get-remote-null-device vec))) (setq result (concat result " --color=never"))) (throw 'ls-found result)) (setq dl (cdr dl)))))) @@ -5541,7 +5571,9 @@ Nonexistent directories are removed from spec." (format "%s --help 2>&1 | grep -iq busybox" (tramp-get-ls-command vec)))) (tramp-send-command-and-check - vec (format "%s %s -al /dev/null" (tramp-get-ls-command vec) option)) + vec (format + "%s %s -al %s" + (tramp-get-ls-command vec) option (tramp-get-remote-null-device vec))) option))) (defun tramp-get-test-command (vec) @@ -5820,7 +5852,7 @@ This command is returned only if `delete-by-moving-to-trash' is non-nil." (command (format "%s %s" busybox "awk"))) (and busybox (tramp-send-command-and-check - vec (concat command " {} /dev/null | grep -qv FOO" t))) + vec (format "env FOO=foo env -u FOO 2>%s | grep -qv FOO" + (tramp-get-remote-null-device vec)) + t))) ;; Some predefined connection properties. (defun tramp-get-inline-compress (vec prop size) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 8a48ffc09b..cafa97cec0 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -74,7 +74,7 @@ :version "24.4") ;;;###tramp-autoload -(defcustom tramp-smb-conf "/dev/null" +(defcustom tramp-smb-conf null-device "Path of the \"smb.conf\" file. If it is nil, no \"smb.conf\" will be added to the `tramp-smb-program' call, letting the SMB client use the default one." @@ -797,7 +797,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (setq args (append args (list (tramp-unquote-shell-quote-argument localname) - "2>/dev/null"))) + (concat "2>" (tramp-get-remote-null-device v))))) (unwind-protect (with-temp-buffer diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index a98d478bc1..d40f9a5927 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -238,6 +238,7 @@ pair of the form (KEY VALUE). The following KEYs are defined: - \"%k\" indicates the keep-date parameter of a program, if exists. - \"%c\" adds additional `tramp-ssh-controlmaster-options' options for the first hop. + - \"%n\" expands to \"2>/dev/null\". The existence of `tramp-login-args', combined with the absence of `tramp-copy-args', is an indication that the @@ -5325,7 +5326,9 @@ name of a process or buffer, or nil to default to the current buffer." (tramp-compat-funcall 'tramp-send-command (process-get proc 'vector) - (format "(\\kill -2 -%d || \\kill -2 %d) 2>/dev/null" pid pid)) + (format "(\\kill -2 -%d || \\kill -2 %d) 2>%s" + pid pid + (tramp-get-remote-null-device (process-get proc 'vector)))) ;; Wait, until the process has disappeared. If it doesn't, ;; fall back to the default implementation. (while (tramp-accept-process-output proc 0)) @@ -5339,6 +5342,15 @@ name of a process or buffer, or nil to default to the current buffer." (lambda () (remove-hook 'interrupt-process-functions #'tramp-interrupt-process)))) +(defun tramp-get-remote-null-device (vec) + "Return null device on the remote host identified by VEC. +If VEC is nil, return local null device." + (if (null vec) + null-device + (with-tramp-connection-property vec "null-device" + (let ((default-directory (tramp-make-tramp-file-name vec))) + (tramp-compat-null-device))))) + (defmacro tramp-skeleton-delete-directory (directory recursive trash &rest body) "Skeleton for `tramp-*-handle-delete-directory'. BODY is the backend specific code." commit 9490f12c4dc4deb16f4e900646319f6de033982c Author: Stefan Kangas Date: Sun Nov 22 07:19:11 2020 +0100 Test for byte-compiler warning "variable lacks prefix" * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--with-warning-test): New macro. (bytecomp-warn-wrong-args, bytecomp-warn-wrong-args-subr): Use above new macro. (bytecomp-warn-variable-lacks-prefix): New test. diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index e0a3cc2fb8..680aa514a2 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -516,19 +516,25 @@ Subtests signal errors if something goes wrong." ;; Should not warn that mt--test2 is not known to be defined. (should-not (re-search-forward "my--test2" nil t)))) +(defmacro bytecomp--with-warning-test (re-warning &rest form) + (declare (indent 1)) + `(with-current-buffer (get-buffer-create "*Compile-Log*") + (let ((inhibit-read-only t)) (erase-buffer)) + (byte-compile ,@form) + (ert-info ((buffer-string) :prefix "buffer: ") + (should (re-search-forward ,re-warning))))) + (ert-deftest bytecomp-warn-wrong-args () - (with-current-buffer (get-buffer-create "*Compile-Log*") - (let ((inhibit-read-only t)) (erase-buffer)) - (byte-compile '(remq 1 2 3)) - (ert-info ((buffer-string) :prefix "buffer: ") - (should (re-search-forward "remq.*3.*2"))))) + (bytecomp--with-warning-test "remq.*3.*2" + '(remq 1 2 3))) (ert-deftest bytecomp-warn-wrong-args-subr () - (with-current-buffer (get-buffer-create "*Compile-Log*") - (let ((inhibit-read-only t)) (erase-buffer)) - (byte-compile '(safe-length 1 2 3)) - (ert-info ((buffer-string) :prefix "buffer: ") - (should (re-search-forward "safe-length.*3.*1"))))) + (bytecomp--with-warning-test "safe-length.*3.*1" + '(safe-length 1 2 3))) + +(ert-deftest bytecomp-warn-variable-lacks-prefix () + (bytecomp--with-warning-test "foo.*lacks a prefix" + '(defvar foo nil))) (ert-deftest test-eager-load-macro-expansion () (test-byte-comp-compile-and-load nil commit b6339fc19c378d66ce1bc53499552dfaa3c0c8c0 Author: Stefan Kangas Date: Sun Nov 22 03:24:26 2020 +0100 Test interactive-only spec of with-suppressed-warnings * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test--with-suppressed-warnings): Test suppressing warning with interactive-only. diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index 13cbedfe1f..e0a3cc2fb8 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -808,6 +808,12 @@ literals (Bug#20852)." '((obsolete obsolete-variable)) "obsolete") + (test-suppression + '(defun zot () + (next-line)) + '((interactive-only next-line)) + "interactive use only") + (test-suppression '(defun zot () (mapcar #'list '(1 2 3)) commit fb9326b45c769f83b619278eae41f680577d1b05 Author: Stefan Kangas Date: Fri Nov 13 19:15:21 2020 +0100 Say which command shadows a key binding * src/keymap.c (describe_vector): Say which command shadows this binding. (Bug#9293) * test/src/keymap-tests.el (help--describe-vector/bug-9293-one-shadowed-in-range): Adapt test. diff --git a/src/keymap.c b/src/keymap.c index aaba2ac838..e22eb411f6 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -3223,7 +3223,13 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, if (this_shadowed) { SET_PT (PT - 1); - insert_string (" (binding currently shadowed)"); + static char const fmt[] = " (currently shadowed by `%s')"; + USE_SAFE_ALLOCA; + char *buffer = SAFE_ALLOCA (sizeof fmt + + SBYTES (SYMBOL_NAME (shadowed_by))); + esprintf (buffer, fmt, SDATA (SYMBOL_NAME (shadowed_by))); + insert_string (buffer); + SAFE_FREE(); SET_PT (PT + 1); } } diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el index e467b1f055..6411cd1f0d 100644 --- a/test/src/keymap-tests.el +++ b/test/src/keymap-tests.el @@ -58,7 +58,6 @@ (let* (menu-item-filter-ran (object `(menu-item "2" identity :filter ,(lambda (cmd) - (message "foo") (setq menu-item-filter-ran t) cmd)))) (keymap--get-keyelt object t) @@ -213,14 +212,15 @@ commit 86c19714b097aa477d339ed99ffb5136c755a046." map)) (shadow-map (let ((map (make-keymap))) (define-key map "f" 'bar) - map))) + map)) + (text-quoting-style 'grave)) (with-temp-buffer (help--describe-vector (cadr orig-map) nil #'help--describe-command t shadow-map orig-map t) (should (equal (buffer-string) " e foo -f foo (binding currently shadowed) +f foo (currently shadowed by `bar') g .. h foo "))))) commit 84dd5c9bea9112daa339e4c1b8e4e556988f3195 Author: Stefan Kangas Date: Fri Nov 13 15:28:34 2020 +0100 Don't shadow bindings by the same command * src/keymap.c (describe_vector): Do not say binding is shadowed if the other key binding points to the same command. (Bug#9293) * test/src/keymap-tests.el (help--describe-vector/bug-9293-same-command-does-not-shadow): New test. diff --git a/src/keymap.c b/src/keymap.c index 749f4b6b91..aaba2ac838 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -3130,7 +3130,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, { shadowed_by = shadow_lookup (shadow, kludge, Qt, 0); - if (!NILP (shadowed_by)) + if (!NILP (shadowed_by) && !EQ (shadowed_by, definition)) { if (mention_shadow) this_shadowed = 1; diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el index 68a8438cb4..e467b1f055 100644 --- a/test/src/keymap-tests.el +++ b/test/src/keymap-tests.el @@ -224,6 +224,30 @@ f foo (binding currently shadowed) g .. h foo "))))) +(ert-deftest help--describe-vector/bug-9293-same-command-does-not-shadow () + "Check that a command can't be shadowed by the same command." + (let ((range-map + (let ((map (make-keymap))) + (define-key map "0" 'foo) + (define-key map "1" 'foo) + (define-key map "2" 'foo) + (define-key map "3" 'foo) + map)) + (shadow-map + (let ((map (make-keymap))) + (define-key map "0" 'foo) + (define-key map "1" 'foo) + (define-key map "2" 'foo) + (define-key map "3" 'foo) + map))) + (with-temp-buffer + (help--describe-vector (cadr range-map) nil #'help--describe-command + t shadow-map range-map t) + (should (equal (buffer-string) + " +0 .. 3 foo +"))))) + ;;;; apropos-internal commit a6490343366f2b2331a91dcb693effb3a9dd78f5 Author: Stefan Kangas Date: Fri Nov 13 15:28:29 2020 +0100 Don't show key ranges if shadowed by different commands * src/keymap.c (describe_vector): Make sure found consecutive keys are either not shadowed or, if they are, that they are shadowed by the same command. (Bug#9293) * test/src/keymap-tests.el (help--describe-vector/bug-9293-one-shadowed-in-range): New test. diff --git a/src/keymap.c b/src/keymap.c index 181dcdad3a..749f4b6b91 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -3085,6 +3085,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, for (i = from; ; i++) { bool this_shadowed = 0; + Lisp_Object shadowed_by = Qnil; int range_beg, range_end; Lisp_Object val; @@ -3127,11 +3128,9 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, /* If this binding is shadowed by some other map, ignore it. */ if (!NILP (shadow)) { - Lisp_Object tem; - - tem = shadow_lookup (shadow, kludge, Qt, 0); + shadowed_by = shadow_lookup (shadow, kludge, Qt, 0); - if (!NILP (tem)) + if (!NILP (shadowed_by)) { if (mention_shadow) this_shadowed = 1; @@ -3186,6 +3185,21 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, && !NILP (Fequal (tem2, definition))) i++; + /* Make sure found consecutive keys are either not shadowed or, + if they are, that they are shadowed by the same command. */ + if (CHAR_TABLE_P (vector) && i != starting_i) + { + Lisp_Object tem; + Lisp_Object key = make_nil_vector (1); + for (int j = starting_i + 1; j <= i; j++) + { + ASET (key, 0, make_fixnum (j)); + tem = shadow_lookup (shadow, key, Qt, 0); + if (NILP (Fequal (tem, shadowed_by))) + i = j - 1; + } + } + /* If we have a range of more than one character, print where the range reaches to. */ diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el index 610234c5a1..68a8438cb4 100644 --- a/test/src/keymap-tests.el +++ b/test/src/keymap-tests.el @@ -200,6 +200,33 @@ commit 86c19714b097aa477d339ed99ffb5136c755a046." (where-is-internal 'execute-extended-command global-map t)) [#x8000078]))) + +;;;; describe_vector + +(ert-deftest help--describe-vector/bug-9293-one-shadowed-in-range () + "Check that we only show a range if shadowed by the same command." + (let ((orig-map (let ((map (make-keymap))) + (define-key map "e" 'foo) + (define-key map "f" 'foo) + (define-key map "g" 'foo) + (define-key map "h" 'foo) + map)) + (shadow-map (let ((map (make-keymap))) + (define-key map "f" 'bar) + map))) + (with-temp-buffer + (help--describe-vector (cadr orig-map) nil #'help--describe-command + t shadow-map orig-map t) + (should (equal (buffer-string) + " +e foo +f foo (binding currently shadowed) +g .. h foo +"))))) + + +;;;; apropos-internal + (ert-deftest keymap-apropos-internal () (should (equal (apropos-internal "^next-line$") '(next-line))) (should (>= (length (apropos-internal "^help")) 100)) commit 0a8cd0116204354e95fbb4ebde64c58123502aa2 Author: Juri Linkov Date: Sat Nov 21 21:49:46 2020 +0200 Handle help-form in y-or-n-p and use this in find-file-noselect (bug#5423) * doc/lispref/help.texi (Help Functions): Mention help-form for read-char-from-minibuffer and y-or-n-p. * doc/lispref/minibuf.texi (Yes-or-No Queries): Mention help-form for y-or-n-p. (Multiple Queries): Mention help-form for read-char-from-minibuffer. * lisp/files.el (find-file-noselect): Let-bind multi-line help text to help-form for y-or-n-p. * lisp/subr.el (read-char-choice): Mention help-form in docstring. (read-char-from-minibuffer): Mention help-form in docstring. (y-or-n-p-map): Remove handling of 'help'. (y-or-n-p): Mention help-form in docstring. When help-form is non-nil: add help-char to 'prompt', and bind help-char to help-form-show in composed-keymap. diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 2fa54e3b66..90406df9c1 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi @@ -676,8 +676,9 @@ If this variable is non-@code{nil}, its value is a form to evaluate whenever the character @code{help-char} is read. If evaluating the form produces a string, that string is displayed. -A command that calls @code{read-event}, @code{read-char-choice}, or -@code{read-char} probably should bind @code{help-form} to a +A command that calls @code{read-event}, @code{read-char-choice}, +@code{read-char}, @code{read-char-from-minibuffer}, or +@code{y-or-n-p} probably should bind @code{help-form} to a non-@code{nil} expression while it does input. (The time when you should not do this is when @kbd{C-h} has some other meaning.) Evaluating this expression should result in a string that explains diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index b6a3434d15..f1cfd29ef1 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -2109,6 +2109,11 @@ special responses @code{recenter}, @code{scroll-up}, @kbd{C-v}, @kbd{M-v}, @kbd{C-M-v} and @kbd{C-M-S-v} in @code{query-replace-map}), this function performs the specified window recentering or scrolling operation, and poses the question again. + +If you bind @code{help-form} (@pxref{Help Functions}) to +a non-@code{nil} value while calling @code{y-or-n-p}, then pressing +@code{help-char} causes it to evaluate @code{help-form} and display +the result. @code{help-char} is automatically added to @var{prompt}. @end defun @defun y-or-n-p-with-timeout prompt seconds default @@ -2317,6 +2322,11 @@ character. Optionally, it ignores any input that is not a member of @var{chars}, a list of accepted characters. The @var{history} argument specifies the history list symbol to use; if it is omitted or @code{nil}, this function doesn't use the history. + +If you bind @code{help-form} (@pxref{Help Functions}) to +a non-@code{nil} value while calling @code{read-char-from-minibuffer}, +then pressing @code{help-char} causes it to evaluate @code{help-form} +and display the result. @end defun @node Reading a Password diff --git a/etc/NEWS b/etc/NEWS index 0cfca39c80..9361cff386 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1773,6 +1773,12 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el. * Lisp Changes in Emacs 28.1 ++++ +** 'read-char-from-minibuffer' and 'y-or-n-p' support 'help-form'. +If you bind 'help-form' to a non-nil value while calling these functions, +then pressing 'C-h' (help-char) causes the function to evaluate 'help-form' +and display the result. + +++ ** 'set-window-configuration' now takes an optional 'dont-set-frame' parameter which, when non-nil, instructs the function not to select diff --git a/lisp/files.el b/lisp/files.el index 3565b7f571..49c9e5d18d 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2310,53 +2310,52 @@ the various files." ;; hexl-mode or image-mode. (memq major-mode '(hexl-mode image-mode))) (if (buffer-modified-p) - (if (y-or-n-p - (format - (if rawfile - "The file %s is already visited normally, + (if (let ((help-form + (format-message + (if rawfile "\ +The file %s is already visited normally, and you have edited the buffer. Now you have asked to visit it literally, meaning no coding system handling, format conversion, or local variables. -Emacs can visit a file in only one way at a time. - -Do you want to save the file, and visit it literally instead? " - "The file %s is already visited literally, +Emacs can visit a file in only one way at a time." + "\ +The file %s is already visited literally, meaning no coding system handling, format conversion, or local variables. You have edited the buffer. Now you have asked to visit the file normally, -but Emacs can visit a file in only one way at a time. - -Do you want to save the file, and visit it normally instead? ") - (file-name-nondirectory filename))) +but Emacs can visit a file in only one way at a time.") + (file-name-nondirectory filename)))) + (y-or-n-p + (if rawfile "\ +Do you want to save the file, and visit it literally instead? " "\ +Do you want to save the file, and visit it normally instead? "))) (progn (save-buffer) (find-file-noselect-1 buf filename nowarn rawfile truename number)) (if (y-or-n-p - (format - (if rawfile - "\ -Do you want to discard your changes, and visit the file literally now? " - "\ -Do you want to discard your changes, and visit the file normally now? "))) + (if rawfile "\ +Do you want to discard your changes, and visit the file literally now? " "\ +Do you want to discard your changes, and visit the file normally now? ")) (find-file-noselect-1 buf filename nowarn rawfile truename number) (error (if rawfile "File already visited non-literally" "File already visited literally")))) - (if (y-or-n-p - (format - (if rawfile - "The file %s is already visited normally. + (if (let ((help-form + (format-message + (if rawfile "\ +The file %s is already visited normally. You have asked to visit it literally, meaning no coding system decoding, format conversion, or local variables. -But Emacs can visit a file in only one way at a time. - -Do you want to revisit the file literally now? " - "The file %s is already visited literally, +But Emacs can visit a file in only one way at a time." + "\ +The file %s is already visited literally, meaning no coding system decoding, format conversion, or local variables. You have asked to visit it normally, -but Emacs can visit a file in only one way at a time. - -Do you want to revisit the file normally now? ") - (file-name-nondirectory filename))) +but Emacs can visit a file in only one way at a time.") + (file-name-nondirectory filename)))) + (y-or-n-p + (if rawfile "\ +Do you want to revisit the file literally now? " "\ +Do you want to revisit the file normally now? "))) (find-file-noselect-1 buf filename nowarn rawfile truename number) (error (if rawfile "File already visited non-literally" diff --git a/lisp/subr.el b/lisp/subr.el index 6e9f66fe97..1fb0f9ab7e 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2606,7 +2606,11 @@ This function is used by the `interactive' code letter `n'." Any input that is not one of CHARS is ignored. If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore -keyboard-quit events while waiting for a valid input." +keyboard-quit events while waiting for a valid input. + +If you bind the variable `help-form' to a non-nil value +while calling this function, then pressing `help-char' +causes it to evaluate `help-form' and display the result." (unless (consp chars) (error "Called `read-char-choice' without valid char choices")) (let (char done show-help (helpbuf " *Char Help*")) @@ -2767,8 +2771,11 @@ Optional argument HISTORY, if non-nil, should be a symbol that specifies the history list variable to use for navigating in input history using `M-p' and `M-n', with `RET' to select a character from history. -If the caller has set `help-form', there is no need to explicitly add -`help-char' to chars. It's bound automatically to `help-form-show'." +If you bind the variable `help-form' to a non-nil value +while calling this function, then pressing `help-char' +causes it to evaluate `help-form' and display the result. +There is no need to explicitly add `help-char' to CHARS; +`help-char' is bound automatically to `help-form-show'." (let* ((empty-history '()) (map (if (consp chars) (or (gethash (list help-form (cons help-char chars)) @@ -2825,7 +2832,7 @@ If the caller has set `help-form', there is no need to explicitly add (define-key map [remap skip] 'y-or-n-p-insert-n) - (dolist (symbol '(help backup undo undo-all edit edit-replacement + (dolist (symbol '(backup undo undo-all edit edit-replacement delete-and-edit ignore self-insert-command)) (define-key map (vector 'remap symbol) 'y-or-n-p-insert-other)) @@ -2880,6 +2887,12 @@ Return t if answer is \"y\" and nil if it is \"n\". PROMPT is the string to display to ask the question. It should end in a space; `y-or-n-p' adds \"(y or n) \" to it. +If you bind the variable `help-form' to a non-nil value +while calling this function, then pressing `help-char' +causes it to evaluate `help-form' and display the result. +PROMPT is also updated to show `help-char' like \"(y, n or C-h) \", +where `help-char' is automatically bound to `help-form-show'. + No confirmation of the answer is requested; a single character is enough. SPC also means yes, and DEL means no. @@ -2902,7 +2915,13 @@ is nil and `use-dialog-box' is non-nil." (concat prompt (if (or (zerop l) (eq ?\s (aref prompt (1- l)))) "" " ") - (if dialog "" "(y or n) ")))))) + (if dialog "" + (if help-form + (format "(y, n or %s) " + (key-description + (vector help-char))) + "(y or n) " + ))))))) (cond (noninteractive (setq prompt (funcall padded prompt)) @@ -2911,6 +2930,7 @@ is nil and `use-dialog-box' is non-nil." (let ((str (read-string temp-prompt))) (cond ((member str '("y" "Y")) (setq answer 'act)) ((member str '("n" "N")) (setq answer 'skip)) + ((and (member str '("h" "H")) help-form) (print help-form)) (t (setq temp-prompt (concat "Please answer y or n. " prompt)))))))) ((and (display-popup-menus-p) @@ -2923,10 +2943,20 @@ is nil and `use-dialog-box' is non-nil." (setq prompt (funcall padded prompt)) (let* ((empty-history '()) (enable-recursive-minibuffers t) + (msg help-form) + (keymap (let ((map (make-composed-keymap + y-or-n-p-map query-replace-map))) + (when help-form + ;; Create a new map before modifying + (setq map (copy-keymap map)) + (define-key map (vector help-char) + (lambda () + (interactive) + (let ((help-form msg)) ; lexically bound msg + (help-form-show))))) + map)) (str (read-from-minibuffer - prompt nil - (make-composed-keymap y-or-n-p-map query-replace-map) - nil + prompt nil keymap nil (or y-or-n-p-history-variable 'empty-history)))) (setq answer (if (member str '("y" "Y")) 'act 'skip))))) (let ((ret (eq answer 'act))) commit 3ceee398192e312faa3ea073365c49bcce9ef61b Author: Michael Albinus Date: Sat Nov 21 16:00:17 2020 +0100 Fix Bug#44481 * lisp/net/tramp.el (tramp-system-name): New defconst. (tramp-default-host, tramp-restricted-shell-hosts-alist) (tramp-local-host-regexp): * lisp/net/tramp-sh.el (tramp-maybe-open-connection): Use it. (Bug#44481) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 4dca040aeb..a70d3aaf84 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -5022,7 +5022,7 @@ connection if a previous connection has died for some reason." (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 (system-name)) + (let* ((current-host tramp-system-name) (target-alist (tramp-compute-multi-hops vec)) ;; We will apply `tramp-ssh-controlmaster-options' ;; only for the first hop. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 08bc0ffdd7..5a08fa8933 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -173,6 +173,12 @@ See the variable `tramp-encoding-shell' for more information." :version "24.1" :type '(choice (const nil) string)) +;; Since Emacs 26.1, `system-name' can return `nil' at build time if +;; Emacs is compiled with "--no-build-details". We do expect it to be +;; a string. (Bug#44481) +(defconst tramp-system-name (or (system-name) "") + "The system name Tramp is running locally.") + (defvar tramp-methods nil "Alist of methods for remote files. This is a list of entries of the form (NAME PARAM1 PARAM2 ...). @@ -410,7 +416,7 @@ empty string for the method name." (choice :tag " Host regexp" regexp sexp) (choice :tag " User name" string (const nil))))) -(defcustom tramp-default-host (system-name) +(defcustom tramp-default-host tramp-system-name "Default host to use for transferring files. Useful for su and sudo methods mostly." :type 'string) @@ -465,8 +471,8 @@ interpreted as a regular expression which always matches." (defcustom tramp-restricted-shell-hosts-alist (when (memq system-type '(windows-nt)) (list (format "\\`\\(%s\\|%s\\)\\'" - (regexp-quote (downcase (system-name))) - (regexp-quote (upcase (system-name)))))) + (regexp-quote (downcase tramp-system-name)) + (regexp-quote (upcase tramp-system-name))))) "List of hosts, which run a restricted shell. This is a list of regular expressions, which denote hosts running a restricted shell like \"rbash\". Those hosts can be used as @@ -479,7 +485,7 @@ host runs a restricted shell, it shall be added to this list, too." (concat "\\`" (regexp-opt - (list "localhost" "localhost6" (system-name) "127.0.0.1" "::1") t) + (list "localhost" "localhost6" tramp-system-name "127.0.0.1" "::1") t) "\\'") "Host names which are regarded as local host. If the local host runs a chrooted environment, set this to nil." commit 789ee3e1d55a86b9ce38d1374c0e01d04f97eb7d Author: Michael Albinus Date: Sat Nov 21 15:28:52 2020 +0100 Handle connection-local null-device and path-separator variables * doc/lispref/os.texi (System Environment): Add `path-separator' function and `null-device' variable and function. * etc/NEWS: Mention 'null-device' and 'path-separator'. Fix typos. * lisp/files-x.el (path-separator, null-device): New defuns. (Bug#3736) * lisp/net/tramp-adb.el (tramp-adb-connection-local-default-shell-variables): Rename from `tramp-adb-connection-local-default-profile'. * lisp/net/tramp-integration.el (tramp-connection-local-default-system-variables): New defvar. Add it to connection-local profiles. (tramp-connection-local-default-shell-variables): Rename from `tramp-connection-local-default-profile'. * lisp/progmodes/grep.el (grep-hello-file): New defun. (grep-compute-defaults): Use `null-device' function for remote case. Handle remote `hello-file'. Use `process-file-shell-command'. (grep,grep-expand-keywords, lgrep): Use `null-device' function for remote case. diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 2c30d8ad89..f897cfa4ea 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -1077,12 +1077,19 @@ directories in a search path (as found in an environment variable). Its value is @code{":"} for Unix and GNU systems, and @code{";"} for MS systems. @end defvar +@defun path-separator +This function returns the connection-local value of variable +@code{path-separator}. That is @code{";"} for MS systems and a local +@code{default-directory}, and @code{":"} for Unix and GNU systems, or +a remote @code{default-directory}. +@end defun + @defun parse-colon-path path This function takes a search path string such as the value of the @env{PATH} environment variable, and splits it at the separators, returning a list of directories. @code{nil} in this list means the current directory. Although the function's name says -``colon'', it actually uses the value of @code{path-separator}. +``colon'', it actually uses the value of variable @code{path-separator}. @example (parse-colon-path ":/foo:/bar") @@ -1155,6 +1162,19 @@ in the system's terminal driver, before Emacs was started. @c The value is @code{nil} if Emacs is running under a window system. @end defvar +@defvar null-device +This variable holds the system null device. Its value is +@code{"/dev/null"} for Unix and GNU systems, and @code{"NUL"} for MS +systems. +@end defvar + +@defun null-device +This function returns the connection-local value of variable +@code{null-device}. That is @code{"NUL"} for MS systems and a local +@code{default-directory}, and @code{"/dev/null"} for Unix and GNU +systems, or a remote @code{default-directory}. +@end defun + @node User Identification @section User Identification @cindex user identification diff --git a/etc/NEWS b/etc/NEWS index efec674323..0cfca39c80 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -103,7 +103,7 @@ unsystematic behavior, which mixed these two is no longer available. +++ ** New system for displaying documentation for groups of functions. This can either be used by saying 'M-x shortdoc-display-group' and -choosing a group, or clicking a button in the *Help* buffers when +choosing a group, or clicking a button in the "*Help*" buffers when looking at the doc string of a function that belongs to one of these groups. @@ -187,6 +187,11 @@ space characters. freenode IRC network for years now. Occurrences of "irc.freenode.net" have been replaced with "chat.freenode.net" throughout Emacs. ++++ +** New functions 'null-device' and 'path-separator'. +These functions return the connection local value of the respective +variables. This can be used for remote hosts. + * Editing Changes in Emacs 28.1 @@ -288,7 +293,7 @@ indentation is done using SMIE or with the old ad-hoc code. When a warning is displayed to the user, the resulting buffer now has buttons which allow making permanent changes to the treatment of that warning. Automatic showing of the warning can be disabled (although -it is still logged to the *Messages* buffer), or the warning can be +it is still logged to the "*Messages*" buffer), or the warning can be disabled entirely. ** mspool.el @@ -477,13 +482,13 @@ tags to be considered as well. ** Gnus +++ -*** New gnus-search library +*** New gnus-search library. A new unified search syntax which can be used across multiple supported search engines. Set 'gnus-search-use-parsed-queries' to non-nil to enable. +++ -*** New value for user option 'smiley-style' +*** New value for user option 'smiley-style'. Smileys can now be rendered with emojis instead of small images when using the new 'emoji' value in 'smiley-style'. @@ -716,11 +721,11 @@ To revert to the previous behavior, *** Most customize commands now hide obsolete user options. Obsolete user options are no longer shown in the listings produced by -the commands `customize', `customize-group', `customize-apropos' and -`customize-changed-options'. +the commands 'customize', 'customize-group', 'customize-apropos' and +'customize-changed-options'. -To customize obsolete user options, use `customize-option' or -`customize-saved'. +To customize obsolete user options, use 'customize-option' or +'customize-saved'. ** Edebug @@ -886,7 +891,7 @@ Customize 'gdb-max-source-window-count' to use more than one window. Control source file display by 'gdb-display-source-buffer-action'. +++ -*** The default value of gdb-mi-decode-strings is now t. +*** The default value of 'gdb-mi-decode-strings' is now t. This means that the default coding-system is now used to decode strings and source file names from GDB. @@ -1155,8 +1160,8 @@ project's root directory, respectively. ** xref --- -*** Prefix arg of 'xref-goto-xref' quits the *xref* buffer. -So typing 'C-u RET' in the *xref* buffer quits its window +*** Prefix arg of 'xref-goto-xref' quits the "*xref*" buffer. +So typing 'C-u RET' in the "*xref*" buffer quits its window before navigating to the selected location. ** json.el @@ -1339,7 +1344,7 @@ buffers. This can be controlled by customizing the variable --- *** New user option 'compilation-search-all-directories'. When doing parallel builds, directories and compilation errors may -arrive in the *compilation* buffer out-of-order. If this variable is +arrive in the "*compilation*" buffer out-of-order. If this variable is non-nil (the default), Emacs will now search backwards in the buffer for any directory the file with errors may be in. If nil, this won't be done (and this restores how this previously worked). @@ -2016,7 +2021,7 @@ image API via 'M-x report-emacs-bug'. -- ** On macOS, 's-' and 's-' are now bound to -'move-beginning-of-line' and 'move-end-of-line' respectively. The commands +'move-beginning-of-line' and 'move-end-of-line' respectively. The commands to select previous/next frame are still bound to 's-~' and 's-`'. diff --git a/lisp/files-x.el b/lisp/files-x.el index 911e7ba9e3..620a2e23f5 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -730,6 +730,16 @@ Execute BODY, and unwind connection-local variables." ;; No connection-local variables to apply. ,@body)) +;;;###autoload +(defun path-separator () + "The connection-local value of `path-separator'." + (with-connection-local-variables path-separator)) + +;;;###autoload +(defun null-device () + "The connection-local value of `null-device'." + (with-connection-local-variables null-device)) + (provide 'files-x) diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 7cdb7ebf53..750b735c1b 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -1316,23 +1316,24 @@ connection if a previous connection has died for some reason." ;; Mark it as connected. (tramp-set-connection-property p "connected" t))))))) -;; Default settings for connection-local variables. -(defconst tramp-adb-connection-local-default-profile +;;; Default connection-local variables for Tramp: +;; `connection-local-set-profile-variables' and +;; `connection-local-set-profiles' exists since Emacs 26.1. +(defconst tramp-adb-connection-local-default-shell-variables '((shell-file-name . "/system/bin/sh") (shell-command-switch . "-c")) - "Default connection-local variables for remote adb connections.") + "Default connection-local shell variables for remote adb connections.") + +(tramp-compat-funcall + 'connection-local-set-profile-variables + 'tramp-adb-connection-local-default-shell-profile + tramp-adb-connection-local-default-shell-variables) -;; `connection-local-set-profile-variables' and -;; `connection-local-set-profiles' exists since Emacs 26.1. (with-eval-after-load 'shell - (tramp-compat-funcall - 'connection-local-set-profile-variables - 'tramp-adb-connection-local-default-profile - tramp-adb-connection-local-default-profile) (tramp-compat-funcall 'connection-local-set-profiles `(:application tramp :protocol ,tramp-adb-method) - 'tramp-adb-connection-local-default-profile)) + 'tramp-adb-connection-local-default-shell-profile)) (add-hook 'tramp-unload-hook (lambda () diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el index 7e4a9bf05e..566c673af1 100644 --- a/lisp/net/tramp-integration.el +++ b/lisp/net/tramp-integration.el @@ -262,23 +262,39 @@ NAME must be equal to `tramp-current-connection'." (info-lookup->topic-cache 'symbol)))))))) ;;; Default connection-local variables for Tramp: +;; `connection-local-set-profile-variables' and +;; `connection-local-set-profiles' exists since Emacs 26.1. + +(defconst tramp-connection-local-default-system-variables + '((path-separator . ":") + (null-device . "/dev/null")) + "Default connection-local system variables for remote connections.") + +(tramp-compat-funcall + 'connection-local-set-profile-variables + 'tramp-connection-local-default-system-profile + tramp-connection-local-default-system-variables) + +(tramp-compat-funcall + 'connection-local-set-profiles + `(:application tramp) + 'tramp-connection-local-default-system-profile) -(defconst tramp-connection-local-default-profile +(defconst tramp-connection-local-default-shell-variables '((shell-file-name . "/bin/sh") (shell-command-switch . "-c")) - "Default connection-local variables for remote connections.") + "Default connection-local shell variables for remote connections.") + +(tramp-compat-funcall + 'connection-local-set-profile-variables + 'tramp-connection-local-default-shell-profile + tramp-connection-local-default-shell-variables) -;; `connection-local-set-profile-variables' and -;; `connection-local-set-profiles' exists since Emacs 26.1. (with-eval-after-load 'shell - (tramp-compat-funcall - 'connection-local-set-profile-variables - 'tramp-connection-local-default-profile - tramp-connection-local-default-profile) (tramp-compat-funcall 'connection-local-set-profiles `(:application tramp) - 'tramp-connection-local-default-profile)) + 'tramp-connection-local-default-shell-profile)) (add-hook 'tramp-unload-hook (lambda () (unload-feature 'tramp-integration 'force))) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 9683826974..dafba22f77 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -296,8 +296,10 @@ See `compilation-error-screen-columns'." :help "Kill the currently running grep process")) (define-key map [menu-bar grep compilation-separator2] '("----")) (define-key map [menu-bar grep compilation-compile] - '(menu-item "Compile..." compile - :help "Compile the program including the current buffer. Default: run `make'")) + '(menu-item + "Compile..." compile + :help + "Compile the program including the current buffer. Default: run `make'")) (define-key map [menu-bar grep compilation-rgrep] '(menu-item "Recursive grep..." rgrep :help "User-friendly recursive grep in directory tree")) @@ -308,15 +310,18 @@ See `compilation-error-screen-columns'." '(menu-item "Grep via Find..." grep-find :help "Run grep via find, with user-specified args")) (define-key map [menu-bar grep compilation-grep] - '(menu-item "Another grep..." grep - :help "Run grep, with user-specified args, and collect output in a buffer.")) + '(menu-item + "Another grep..." grep + :help + "Run grep, with user-specified args, and collect output in a buffer.")) (define-key map [menu-bar grep compilation-recompile] '(menu-item "Repeat grep" recompile :help "Run grep again")) (define-key map [menu-bar grep compilation-separator1] '("----")) (define-key map [menu-bar grep compilation-first-error] - '(menu-item "First Match" first-error - :help "Restart at the first match, visit corresponding location")) + '(menu-item + "First Match" first-error + :help "Restart at the first match, visit corresponding location")) (define-key map [menu-bar grep compilation-previous-error] '(menu-item "Previous Match" previous-error :help "Visit the previous match and corresponding location")) @@ -389,7 +394,8 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) - (mbeg (text-property-any beg end 'font-lock-face grep-match-face))) + (mbeg + (text-property-any beg end 'font-lock-face grep-match-face))) (when mbeg (- mbeg beg))))) . @@ -397,8 +403,11 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) - (mbeg (text-property-any beg end 'font-lock-face grep-match-face)) - (mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end)))) + (mbeg + (text-property-any beg end 'font-lock-face grep-match-face)) + (mend + (and mbeg (next-single-property-change + mbeg 'font-lock-face nil end)))) (when mend (- mend beg)))))) nil nil @@ -614,6 +623,15 @@ This function is called from `compilation-filter-hook'." (error nil)) (or result 0)))) +(defun grep-hello-file () + (let ((result + (if (file-remote-p default-directory) + (make-temp-file (file-name-as-directory (temporary-file-directory))) + (expand-file-name "HELLO" data-directory)))) + (when (file-remote-p result) + (write-region "Copyright\n" nil result)) + result)) + ;;;###autoload (defun grep-compute-defaults () "Compute the defaults for the `grep' command. @@ -655,37 +673,46 @@ The value depends on `grep-command', `grep-template', (unless (or (not grep-use-null-device) (eq grep-use-null-device t)) (setq grep-use-null-device (with-temp-buffer - (let ((hello-file (expand-file-name "HELLO" data-directory))) - (not - (and (if grep-command - ;; `grep-command' is already set, so - ;; use that for testing. - (grep-probe grep-command - `(nil t nil "^Copyright" ,hello-file) - #'call-process-shell-command) - ;; otherwise use `grep-program' - (grep-probe grep-program - `(nil t nil "-nH" "^Copyright" ,hello-file))) - (progn - (goto-char (point-min)) - (looking-at - (concat (regexp-quote hello-file) - ":[0-9]+:Copyright"))))))))) + (let ((hello-file (grep-hello-file))) + (prog1 + (not + (and (if grep-command + ;; `grep-command' is already set, so + ;; use that for testing. + (grep-probe + grep-command + `(nil t nil "^Copyright" + ,(file-local-name hello-file)) + #'process-file-shell-command) + ;; otherwise use `grep-program' + (grep-probe + grep-program + `(nil t nil "-nH" "^Copyright" + ,(file-local-name hello-file)))) + (progn + (goto-char (point-min)) + (looking-at + (concat (regexp-quote (file-local-name hello-file)) + ":[0-9]+:Copyright"))))) + (when (file-remote-p hello-file) (delete-file hello-file))))))) (when (eq grep-use-null-filename-separator 'auto-detect) (setq grep-use-null-filename-separator (with-temp-buffer - (let* ((hello-file (expand-file-name "HELLO" data-directory)) - (args `("--null" "-ne" "^Copyright" ,hello-file))) + (let* ((hello-file (grep-hello-file)) + (args `("--null" "-ne" "^Copyright" + ,(file-local-name hello-file)))) (if grep-use-null-device - (setq args (append args (list null-device))) + (setq args (append args (list (null-device)))) (push "-H" args)) - (and (grep-probe grep-program `(nil t nil ,@args)) - (progn - (goto-char (point-min)) - (looking-at - (concat (regexp-quote hello-file) - "\0[0-9]+:Copyright")))))))) + (prog1 + (and (grep-probe grep-program `(nil t nil ,@args)) + (progn + (goto-char (point-min)) + (looking-at + (concat (regexp-quote (file-local-name hello-file)) + "\0[0-9]+:Copyright")))) + (when (file-remote-p hello-file) (delete-file hello-file))))))) (when (eq grep-highlight-matches 'auto-detect) (setq grep-highlight-matches @@ -704,7 +731,7 @@ The value depends on `grep-command', `grep-template', (concat (if grep-use-null-device "-n" "-nH") (if grep-use-null-filename-separator " --null") (when (grep-probe grep-program - `(nil nil nil "-e" "foo" ,null-device) + `(nil nil nil "-e" "foo" ,(null-device)) nil 1) " -e")))) (unless grep-command @@ -712,13 +739,14 @@ The value depends on `grep-command', `grep-template', (format "%s %s %s " grep-program (or (and grep-highlight-matches - (grep-probe grep-program - `(nil nil nil "--color" "x" ,null-device) - nil 1) + (grep-probe + grep-program + `(nil nil nil "--color" "x" ,(null-device)) + nil 1) (if (eq grep-highlight-matches 'always) "--color=always" "--color")) "") - grep-options))) + grep-options))) (unless grep-template (setq grep-template (format "%s %s " grep-program grep-options))) @@ -726,11 +754,12 @@ The value depends on `grep-command', `grep-template', (setq grep-find-use-xargs (cond ((grep-probe find-program - `(nil nil nil ,null-device "-exec" "echo" + `(nil nil nil ,(null-device) "-exec" "echo" "{}" "+")) 'exec-plus) ((and - (grep-probe find-program `(nil nil nil ,null-device "-print0")) + (grep-probe + find-program `(nil nil nil ,(null-device) "-print0")) (grep-probe xargs-program '(nil nil nil "-0" "echo"))) 'gnu) (t @@ -750,12 +779,13 @@ The value depends on `grep-command', `grep-template', (let ((cmd0 (format "%s . -type f -exec %s" find-program grep-command)) (null (if grep-use-null-device - (format "%s " null-device) + (format "%s " (null-device)) ""))) (cons (if (eq grep-find-use-xargs 'exec-plus) (format "%s %s%s +" cmd0 null quot-braces) - (format "%s %s %s%s" cmd0 quot-braces null quot-scolon)) + (format "%s %s %s%s" + cmd0 quot-braces null quot-scolon)) (1+ (length cmd0))))) (t (format "%s . -type f -print | \"%s\" %s" @@ -765,7 +795,7 @@ The value depends on `grep-command', `grep-template', (let ((gcmd (format "%s %s " grep-program grep-options)) (null (if grep-use-null-device - (format "%s " null-device) + (format "%s " (null-device)) ""))) (cond ((eq grep-find-use-xargs 'gnu) (format "%s -type f -print0 | \"%s\" -0 %s" @@ -814,7 +844,8 @@ The value depends on `grep-command', `grep-template', (let ((tag-default (shell-quote-argument (grep-tag-default))) ;; This a regexp to match single shell arguments. ;; Could someone please add comments explaining it? - (sh-arg-re "\\(\\(?:\"\\(?:[^\"]\\|\\\\\"\\)+\"\\|'[^']+'\\|[^\"' \t\n]\\)+\\)") + (sh-arg-re + "\\(\\(?:\"\\(?:[^\"]\\|\\\\\"\\)+\"\\|'[^']+'\\|[^\"' \t\n]\\)+\\)") (grep-default (or (car grep-history) grep-command))) ;; In the default command, find the arg that specifies the pattern. (when (or (string-match @@ -909,8 +940,8 @@ list is empty)." (grep--save-buffers) ;; Setting process-setup-function makes exit-message-function work ;; even when async processes aren't supported. - (compilation-start (if (and grep-use-null-device null-device) - (concat command-args " " null-device) + (compilation-start (if (and grep-use-null-device null-device (null-device)) + (concat command-args " " (null-device)) command-args) #'grep-mode)) @@ -948,7 +979,7 @@ easily repeat a find command." '(("" . (mapconcat #'identity opts " ")) ("" . (or dir ".")) ("" . files) - ("" . null-device) + ("" . (null-device)) ("" . excl) ("" . (shell-quote-argument (or regexp "")))) "List of substitutions performed by `grep-expand-template'. @@ -1052,8 +1083,9 @@ REGEXP is used as a string in the prompt." #'read-file-name-internal nil nil nil 'grep-files-history (delete-dups - (delq nil (append (list default default-alias default-extension) - (mapcar #'car grep-files-aliases))))))) + (delq nil + (append (list default default-alias default-extension) + (mapcar #'car grep-files-aliases))))))) (and files (or (cdr (assoc files grep-files-aliases)) files)))) @@ -1105,11 +1137,12 @@ command before it's run." (if (string= command grep-command) (setq command nil)) (setq dir (file-name-as-directory (expand-file-name dir))) - (unless (or (not grep-use-directories-skip) (eq grep-use-directories-skip t)) + (unless (or (not grep-use-directories-skip) + (eq grep-use-directories-skip t)) (setq grep-use-directories-skip (grep-probe grep-program `(nil nil nil "--directories=skip" "foo" - ,null-device) + ,(null-device)) nil 1))) (setq command (grep-expand-template grep-template @@ -1141,10 +1174,11 @@ command before it's run." ;; Setting process-setup-function makes exit-message-function work ;; even when async processes aren't supported. (grep--save-buffers) - (compilation-start (if (and grep-use-null-device null-device) - (concat command " " null-device) - command) - 'grep-mode)) + (compilation-start + (if (and grep-use-null-device null-device (null-device)) + (concat command " " (null-device)) + command) + 'grep-mode)) ;; Set default-directory if we started lgrep in the *grep* buffer. (if (eq next-error-last-buffer (current-buffer)) (setq default-directory dir)))))) commit a824888188f3046dca1c059ea6fc60fd822c2868 Author: Lars Ingebrigtsen Date: Tue Nov 17 00:18:11 2020 +0100 Minor Edebug manual keystroke clarifications * doc/lispref/edebug.texi (Edebug Misc): Also mention the `a' binding to abort (bug#44697). Also fix `d' function reference, and add `P' reference. (cherry picked from commit b613f25f97abf756101eaa2af90689a19c0b3350) diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index b5b5ea0a64..4dcdc0cbf0 100644 --- a/doc/lispref/edebug.texi +++ b/doc/lispref/edebug.texi @@ -425,7 +425,8 @@ arrange to deinstrument it. @item ? Display the help message for Edebug (@code{edebug-help}). -@item C-] +@item a +@itemx C-] Abort one level back to the previous command level (@code{abort-recursive-edit}). @@ -446,7 +447,7 @@ Redisplay the most recently known expression result in the echo area @item d Display a backtrace, excluding Edebug's own functions for clarity -(@code{edebug-backtrace}). +(@code{edebug-pop-to-backtrace}). @xref{Backtraces}, for a description of backtraces and the commands which work on them. @@ -640,7 +641,8 @@ configuration is the collection of windows and contents that were in effect outside of Edebug. @table @kbd -@item v +@item P +@itemx v Switch to viewing the outside window configuration (@code{edebug-view-outside}). Type @kbd{C-x X w} to return to Edebug. commit 2c7687738d0b7da60014a7af05ab199936617d71 Author: Jared Finder Date: Sat Nov 14 23:44:26 2020 -0800 Migrate usage of GPM_CLICK_EVENT to MOUSE_CLICK_EVENT. * src/termhooks.h (enum event_kind): * src/term.c (term_mouse_click, handle_one_term_event): * src/keyboard.c (discard_mouse_events, make_lispy_event): Migrate usage of GPM_CLICK_EVENT to MOUSE_CLICK_EVENT. diff --git a/src/keyboard.c b/src/keyboard.c index 1579c007ec..49261fcc3e 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3736,9 +3736,6 @@ discard_mouse_events (void) if (sp->kind == MOUSE_CLICK_EVENT || sp->kind == WHEEL_EVENT || sp->kind == HORIZ_WHEEL_EVENT -#ifdef HAVE_GPM - || sp->kind == GPM_CLICK_EVENT -#endif || sp->kind == SCROLL_BAR_CLICK_EVENT || sp->kind == HORIZONTAL_SCROLL_BAR_CLICK_EVENT) { @@ -5542,9 +5539,6 @@ make_lispy_event (struct input_event *event) /* A mouse click. Figure out where it is, decide whether it's a press, click or drag, and build the appropriate structure. */ case MOUSE_CLICK_EVENT: -#ifdef HAVE_GPM - case GPM_CLICK_EVENT: -#endif #ifndef USE_TOOLKIT_SCROLL_BARS case SCROLL_BAR_CLICK_EVENT: case HORIZONTAL_SCROLL_BAR_CLICK_EVENT: @@ -5559,11 +5553,7 @@ make_lispy_event (struct input_event *event) position = Qnil; /* Build the position as appropriate for this mouse click. */ - if (event->kind == MOUSE_CLICK_EVENT -#ifdef HAVE_GPM - || event->kind == GPM_CLICK_EVENT -#endif - ) + if (event->kind == MOUSE_CLICK_EVENT) { struct frame *f = XFRAME (event->frame_or_window); int row, column; diff --git a/src/term.c b/src/term.c index a0738594bf..fee3b55575 100644 --- a/src/term.c +++ b/src/term.c @@ -2481,7 +2481,7 @@ term_mouse_click (struct input_event *result, Gpm_Event *event, { int i, j; - result->kind = GPM_CLICK_EVENT; + result->kind = MOUSE_CLICK_EVENT; for (i = 0, j = GPM_B_LEFT; i < 3; i++, j >>= 1 ) { if (event->buttons & j) { @@ -2567,11 +2567,11 @@ handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event) { f->mouse_moved = 0; term_mouse_click (&ie, event, f); - /* eassert (ie.kind == GPM_CLICK_EVENT); */ + /* eassert (ie.kind == MOUSE_CLICK_EVENT); */ if (tty_handle_tab_bar_click (f, event->x, event->y, (ie.modifiers & down_modifier) != 0, &ie)) { - /* eassert (ie.kind == GPM_CLICK_EVENT + /* eassert (ie.kind == MOUSE_CLICK_EVENT * || ie.kind == TAB_BAR_EVENT); */ /* tty_handle_tab_bar_click stores 2 events in the event queue, so we are done here. */ @@ -2581,7 +2581,7 @@ handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event) count += 2; return count; } - /* eassert (ie.kind == GPM_CLICK_EVENT); */ + /* eassert (ie.kind == MOUSE_CLICK_EVENT); */ kbd_buffer_store_event (&ie); count++; } diff --git a/src/termhooks.h b/src/termhooks.h index 6ab06ceff9..44ab14225f 100644 --- a/src/termhooks.h +++ b/src/termhooks.h @@ -220,10 +220,6 @@ enum event_kind save yourself before shutdown. */ SAVE_SESSION_EVENT -#ifdef HAVE_GPM - , GPM_CLICK_EVENT -#endif - #ifdef HAVE_DBUS , DBUS_EVENT #endif commit 86cbc9d216c724e6be5db27fb33df2ca0c7d9804 Author: Eli Zaretskii Date: Sat Nov 21 10:14:55 2020 +0200 Make ignoring modifiers on IME input optional By default, ignore modifier keys on IME input, but add a variable to get back old behavior. * src/w32fns.c (syms_of_w32fns): New variable w32-ignore-modifiers-on-IME-input. (w32_wnd_proc): Use it to ignore modifier keys when IME input is used. (Bug#44641) * etc/NEWS: Announce the change and the new variable. diff --git a/etc/NEWS b/etc/NEWS index 61f9c0e1fe..4855cd3b61 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -48,7 +48,7 @@ skip leading or trailing empty lines of the buffer. ** Tramp -*** The user option 'tramp-completion-reread-directory-timeout' is made obsolete. +*** The user option 'tramp-completion-reread-directory-timeout' is now obsolete. * New Modes and Packages in Emacs 27.2 @@ -62,6 +62,13 @@ skip leading or trailing empty lines of the buffer. * Changes in Emacs 27.2 on Non-Free Operating Systems +** Emacs now ignores modifier keys when IME input is used. +By default, pressing Ctrl, Shift, and Alt keys while using IME input +will no longer apply the modifiers to the produced characters, as +there are IMEs which use keys with modifiers to input some +characters. Customize the variable 'w32-ignore-modifiers-on-IME-input' +to nil to get back the old behavior. + * Installation Changes in Emacs 27.1 diff --git a/src/w32fns.c b/src/w32fns.c index 96cf34430d..fd13a95865 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -4576,7 +4576,10 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) int size, i; W32Msg wmsg; HIMC context = get_ime_context_fn (hwnd); - wmsg.dwModifiers = 0; + wmsg.dwModifiers = + w32_ignore_modifiers_on_IME_input + ? 0 + : w32_get_key_modifiers (wParam, lParam); /* Get buffer size. */ size = get_composition_string_fn (context, GCS_RESULTSTR, NULL, 0); buffer = alloca (size); @@ -10697,6 +10700,15 @@ tip frame. */); doc: /* Non-nil means don't display the abort dialog when aborting. */); w32_disable_abort_dialog = 0; + DEFVAR_BOOL ("w32-ignore-modifiers-on-IME-input", + w32_ignore_modifiers_on_IME_input, + doc: /* Whether to ignore modifier keys when processing input with IME. +Some MS-Windows input methods use modifier keys such as Ctrl or Alt to input +characters, in which case applying the modifiers will change the input. +The default value of this variable is therefore t, to ignore modifier +keys when IME input is received. */); + w32_ignore_modifiers_on_IME_input = true; + #if 0 /* TODO: Port to W32 */ defsubr (&Sx_change_window_property); defsubr (&Sx_delete_window_property); commit 32b97bb9e0d91522a76c984b594be35343bf9fe3 Author: Masahiro Nakamura Date: Sat Nov 14 17:55:16 2020 +0900 Ignore modifiers when processing WM_IME_CHAR messages * src/w32fns.c (w32_wnd_proc): Ignore modifiers when processing WM_IME_CHAR messages. diff --git a/src/w32fns.c b/src/w32fns.c index bbf43717bd..96cf34430d 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -4576,7 +4576,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) int size, i; W32Msg wmsg; HIMC context = get_ime_context_fn (hwnd); - wmsg.dwModifiers = w32_get_key_modifiers (wParam, lParam); + wmsg.dwModifiers = 0; /* Get buffer size. */ size = get_composition_string_fn (context, GCS_RESULTSTR, NULL, 0); buffer = alloca (size); commit 932cb10761b9f249c87d7c19778873691f2a5d46 Author: Stefan Monnier Date: Fri Nov 20 19:28:34 2020 -0500 * lisp/emacs-lisp/package.el (package-strip-rcs-id): Don't ignore errors Ignoring errors here just postpones the error and replaces a clear "invalid version syntax" with a confusing "package lacks a version". diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index d78a1a2856..9c37ce429a 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2112,8 +2112,7 @@ Otherwise return nil." (when str (when (string-match "\\`[ \t]*[$]Revision:[ \t]+" str) (setq str (substring str (match-end 0)))) - (ignore-errors - (if (version-to-list str) str)))) + (if (version-to-list str) str))) (declare-function lm-homepage "lisp-mnt" (&optional file)) commit abd15e088e99b1c6334a427879fead0d557b7447 Author: Mauro Aranda Date: Fri Nov 20 19:28:03 2020 -0300 Use cl-letf instead of unwind-protect in a test * test/lisp/cus-edit-tests.el (cus-edit-tests-customize-saved/show-obsolete): Good use case for cl-letf, so use it. Suggested by Stefan Monnier in: https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg00914.html diff --git a/test/lisp/cus-edit-tests.el b/test/lisp/cus-edit-tests.el index 114e461b7a..bb88b8dd9f 100644 --- a/test/lisp/cus-edit-tests.el +++ b/test/lisp/cus-edit-tests.el @@ -23,6 +23,7 @@ (require 'ert) (require 'ert-x) +(eval-when-compile (require 'cl-lib)) (require 'cus-edit) (defmacro with-cus-edit-test (buffer &rest body) @@ -71,12 +72,9 @@ (ert-deftest cus-edit-tests-customize-saved/show-obsolete () (with-cus-edit-test "*Customize Saved*" - (unwind-protect - (progn - (put 'cus-edit-tests--obsolete-option-tag 'saved-value '(t)) - (customize-saved) - (should (search-forward cus-edit-tests--obsolete-option-tag nil t))) - (put 'cus-edit-tests--obsolete-option-tag 'saved-value nil)))) + (cl-letf (((get 'cus-edit-tests--obsolete-option-tag 'saved-value) '(t))) + (customize-saved) + (should (search-forward cus-edit-tests--obsolete-option-tag nil t))))) (provide 'cus-edit-tests) ;;; cus-edit-tests.el ends here commit ac98bcc906254da564d77dd33e902e4590ae1d33 Author: Stefan Monnier Date: Fri Nov 20 16:54:06 2020 -0500 * test/manual/indent/tcl.tcl: Add string interpolation case diff --git a/test/manual/indent/tcl.tcl b/test/manual/indent/tcl.tcl index c3781533ca..f055be1966 100644 --- a/test/manual/indent/tcl.tcl +++ b/test/manual/indent/tcl.tcl @@ -20,3 +20,7 @@ proc foo3 {} { puts a""b"; # And that won't either! puts "a""b"; # But this will! } + +# FIXME: The [..] interpolation within "..." strings is not properly +# handled by the current `syntax-propertize-function`! +set a "Testing: [split "192.168.1.1/24" "/"] address"; commit 2ba2e7217f520a43a098b2ef92a452868b88cc70 Author: Stefan Monnier Date: Fri Nov 20 16:45:56 2020 -0500 Don't optimize away `eval` when its lexical context is different * lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-eval): Obey lexical-binding. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index cbda16d051..e6f6a12b53 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2570,7 +2570,8 @@ list that represents a doc string reference. ;; and similar macros cleaner. (put 'eval 'byte-hunk-handler 'byte-compile-file-form-eval) (defun byte-compile-file-form-eval (form) - (if (eq (car-safe (nth 1 form)) 'quote) + (if (and (eq (car-safe (nth 1 form)) 'quote) + (equal (nth 2 form) lexical-binding)) (nth 1 (nth 1 form)) (byte-compile-keep-pending form))) commit 6924320aebce9ba885877da45e43d8d573da8bf6 Author: Mauro Aranda Date: Fri Nov 20 18:37:30 2020 -0300 Take care of a FIXME in cus-edit-tests.el * test/lisp/cus-edit-tests.el (cus-edit-tests-customize-saved/show-obsolete): Add a fake saved-value property, to be able check that the obsolete option is present in the Customize buffer. Expect the test to pass now. diff --git a/test/lisp/cus-edit-tests.el b/test/lisp/cus-edit-tests.el index 4d148b4f41..114e461b7a 100644 --- a/test/lisp/cus-edit-tests.el +++ b/test/lisp/cus-edit-tests.el @@ -70,11 +70,13 @@ (should (search-forward cus-edit-tests--obsolete-option-tag nil t)))) (ert-deftest cus-edit-tests-customize-saved/show-obsolete () - ;; FIXME: How to test for saved options? - :expected-result :failed (with-cus-edit-test "*Customize Saved*" - (customize-saved) - (should (search-forward cus-edit-tests--obsolete-option-tag nil t)))) + (unwind-protect + (progn + (put 'cus-edit-tests--obsolete-option-tag 'saved-value '(t)) + (customize-saved) + (should (search-forward cus-edit-tests--obsolete-option-tag nil t))) + (put 'cus-edit-tests--obsolete-option-tag 'saved-value nil)))) (provide 'cus-edit-tests) ;;; cus-edit-tests.el ends here commit 86d87d24310f087fef99fa959156b024626bf2d2 Author: Stefan Kangas Date: Fri Nov 20 17:25:31 2020 +0100 Don't quote lambda in idlwave.el * lisp/progmodes/idlwave.el (idlwave-keyword-abbrev): Don't quote lambda. diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 44bdd918d6..876c38da7e 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -1355,8 +1355,8 @@ Normally a space.") (defmacro idlwave-keyword-abbrev (&rest args) "Creates a function for abbrev hooks to call `idlwave-check-abbrev' with args." - `(quote (lambda () - ,(append '(idlwave-check-abbrev) args)))) + `(lambda () + ,(append '(idlwave-check-abbrev) args))) ;; If I take the time I can replace idlwave-keyword-abbrev with ;; idlwave-code-abbrev and remove the quoted abbrev check from commit 966052cb5935208e14f29e297dd93d4ce640b005 Author: Stefan Kangas Date: Fri Nov 20 16:44:52 2020 +0100 Remove remaining XEmacs compat code from erc-log.el * lisp/erc/erc-log.el (erc-save-buffer-in-logs): Remove XEmacs compat code. diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index de0a16ea3f..7eddb5f60f 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -414,8 +414,7 @@ You can save every individual message by putting this function on (or buffer (setq buffer (current-buffer))) (when (erc-logging-enabled buffer) (let ((file (erc-current-logfile buffer)) - (coding-system erc-log-file-coding-system) - (inhibit-clash-detection t)) ; needed for XEmacs + (coding-system erc-log-file-coding-system)) (save-excursion (with-current-buffer buffer (save-restriction commit ea218f424ae3a016b439f2e2d2abe0a167bac78e Author: Stefan Kangas Date: Fri Nov 20 16:43:57 2020 +0100 Don't set XEmacs only properties start-open and end-open * lisp/epa.el (epa-sign-region, epa-encrypt-region): * lisp/erc/erc.el (erc-display-prompt): * lisp/gnus/message.el (message-forward-make-body-mime): * lisp/net/eudc-bob.el (eudc-bob-display-jpeg) (eudc-bob-display-audio, eudc-bob-display-generic-binary): * lisp/url/url-http.el (url-http-chunked-encoding-after-change-function): Don't set XEmacs only properties start-open and end-open. diff --git a/lisp/epa.el b/lisp/epa.el index 4e288283d1..d6c7946c93 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -1070,9 +1070,7 @@ If no one is selected, default secret key is used. " (list 'epa-coding-system-used epa-last-coding-system-specified 'front-sticky nil - 'rear-nonsticky t - 'start-open t - 'end-open t))))) + 'rear-nonsticky t))))) (define-obsolete-function-alias 'epa--derived-mode-p 'derived-mode-p "28.1") @@ -1147,9 +1145,7 @@ If no one is selected, symmetric encryption will be performed. ") (list 'epa-coding-system-used epa-last-coding-system-specified 'front-sticky nil - 'rear-nonsticky t - 'start-open t - 'end-open t))))) + 'rear-nonsticky t))))) ;;;; Key Management diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index bf7b16d448..94ea0de7ee 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4014,8 +4014,7 @@ If FACE is non-nil, it will be used to propertize the prompt. If it is nil, ;; of the prompt, but stuff typed in front of the prompt ;; shall remain part of the prompt. (setq prompt (propertize prompt - 'start-open t ; XEmacs - 'rear-nonsticky t ; Emacs + 'rear-nonsticky t 'erc-prompt t 'field t 'front-sticky t diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 0782778fd4..5bdf53763a 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -7651,7 +7651,7 @@ Optional DIGEST will use digest to forward." ;; Consider there is no illegible text. (add-text-properties b (point) - '(no-illegible-text t rear-nonsticky t start-open t)))) + '(no-illegible-text t rear-nonsticky t)))) (defun message-forward-make-body-mml (forward-buffer) (insert "\n\n<#mml type=message/rfc822 disposition=inline>\n") diff --git a/lisp/net/eudc-bob.el b/lisp/net/eudc-bob.el index bb6682520a..b2069ed6ef 100644 --- a/lisp/net/eudc-bob.el +++ b/lisp/net/eudc-bob.el @@ -153,9 +153,7 @@ display a button." 'end-glyph (if inline glyph) 'duplicable t 'invisible inline - 'start-open t - 'end-open t - 'object-data data)))) + 'object-data data)))) ((fboundp 'create-image) (let* ((image (create-image data nil t)) (props (list 'object-data data 'eudc-image image))) @@ -192,9 +190,7 @@ display a button." eudc-bob-sound-keymap eudc-bob-sound-menu (list 'duplicable t - 'start-open t - 'end-open t - 'object-data data))) + 'object-data data))) (defun eudc-bob-display-generic-binary (data) "Display a button for unidentified binary DATA." @@ -202,9 +198,7 @@ display a button." eudc-bob-generic-keymap eudc-bob-generic-menu (list 'duplicable t - 'start-open t - 'end-open t - 'object-data data))) + 'object-data data))) (defun eudc-bob-play-sound-at-point () "Play the sound data contained in the button at point." diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index 8532da1d1f..75330d3327 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -1119,9 +1119,7 @@ the end of the document." (beginning-of-line) (looking-at regexp)) (add-text-properties (match-beginning 0) (match-end 0) - (list 'start-open t - 'end-open t - 'chunked-encoding t + (list 'chunked-encoding t 'face 'cursor 'invisible t)) (setq url-http-chunked-length (string-to-number (buffer-substring commit 8c801138acfb5b1068a78b1a10e055d2e7952c9e Author: Stefan Kangas Date: Fri Nov 20 16:22:35 2020 +0100 Remove XEmacs compat code from idlw-shell.el * lisp/progmodes/idlw-shell.el: (idlwave-shell-use-toolbar): Doc fix. (idlwave-default-mouse-track-event-is-with-button): Declare obsolete. (idlwave-shell-update-bp-overlays): Remove XEmacs compat code. diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index 155ab7ba4c..70b94596e1 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el @@ -26,8 +26,7 @@ ;;; Commentary: ;; -;; This mode is for IDL version 5 or later. It should work on -;; Emacs>20.3 or XEmacs>20.4. +;; This mode is for IDL version 5 or later. ;; ;; Runs IDL as an inferior process of Emacs, much like the Emacs ;; `shell' or `telnet' commands. Provides command history and @@ -68,15 +67,6 @@ ;; maintainers webpage (see under SOURCE) ;; ;; -;; KNOWN PROBLEMS -;; ============== -;; -;; Under XEmacs the Debug menu in the shell does not display the -;; keybindings in the prefix map. There bindings are available anyway - so -;; it is a bug in XEmacs. -;; The Debug menu in source buffers *does* display the bindings correctly. -;; -;; ;; CUSTOMIZATION VARIABLES ;; ======================= ;; @@ -166,7 +156,6 @@ t Arrows force the cursor back to the current command line and "Non-nil means, use the debugging toolbar in all IDL related buffers. Starting the shell will then add the toolbar to all idlwave-mode buffers. Exiting the shell will removed everywhere. -Available on XEmacs and on Emacs 21.x or later. At any time you can toggle the display of the toolbar with `C-c C-d C-t' (`idlwave-shell-toggle-toolbar')." :group 'idlwave-shell-general-setup @@ -606,12 +595,6 @@ the directory stack.") (defvar idlwave-shell-last-save-and-action-file nil "The last file which was compiled with `idlwave-shell-save-and-...'.") -;; Highlighting uses overlays. When necessary, require the emulation. -(if (not (fboundp 'make-overlay)) - (condition-case nil - (require 'overlay) - (error nil))) - (defvar idlwave-shell-stop-line-overlay nil "The overlay for where IDL is currently stopped.") (defvar idlwave-shell-is-stopped nil) @@ -2747,6 +2730,7 @@ Runs to the last statement and then steps 1 statement. Use the .out command." ;; Begin terrible hack section -- XEmacs tests for button2 explicitly ;; on drag events, calling drag-n-drop code if detected. Ughhh... (defun idlwave-default-mouse-track-event-is-with-button (_event _n) + (declare (obsolete nil "28.1")) t) (define-obsolete-function-alias 'idlwave-xemacs-hack-mouse-track 'ignore "27.1") @@ -3608,10 +3592,8 @@ Existing overlays are recycled, in order to minimize consumption." (when use-glyph (if old-buffers (setq old-buffers (delq (current-buffer) old-buffers))) - (if (fboundp 'set-specifier) ;; XEmacs - (set-specifier left-margin-width (cons (current-buffer) 2)) - (if (< left-margin-width 2) - (setq left-margin-width 2))) + (if (< left-margin-width 2) + (setq left-margin-width 2)) (let ((window (get-buffer-window (current-buffer) 0))) (if window (set-window-margins @@ -3619,9 +3601,7 @@ Existing overlays are recycled, in order to minimize consumption." (if use-glyph (while (setq buf (pop old-buffers)) (with-current-buffer buf - (if (fboundp 'set-specifier) ;; XEmacs - (set-specifier left-margin-width (cons (current-buffer) 0)) - (setq left-margin-width 0)) + (setq left-margin-width 0) (let ((window (get-buffer-window buf 0))) (if window (set-window-margins commit c1269e711481290a52f0e316a194145b55f18ad8 Author: Stefan Kangas Date: Fri Nov 20 16:19:14 2020 +0100 Remove some XEmacs compat code from ediff-wind.el * lisp/vc/ediff-wind.el (ediff-window) (ediff-compute-toolbar-width): Remove some XEmacs compat code. diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el index a23d72070a..c68dc71884 100644 --- a/lisp/vc/ediff-wind.el +++ b/lisp/vc/ediff-wind.el @@ -42,13 +42,6 @@ (require 'ediff-help) ;; end pacifier - -;; be careful with ediff-tbar -(eval-and-compile - (if (featurep 'xemacs) - (require 'ediff-tbar) - (defun ediff-compute-toolbar-width () 0))) - (defgroup ediff-window nil "Ediff window manipulation." :prefix "ediff-" @@ -961,8 +954,7 @@ create a new splittable frame if none is found." ;; 1 more line for the mode line (setq lines (1+ (count-lines (point-min) (point-max))) fheight lines - fwidth (max (+ (ediff-help-message-line-length) 2) - (ediff-compute-toolbar-width)) + fwidth (max (+ (ediff-help-message-line-length) 2) 0) adjusted-parameters (list ;; possibly change surrogate minibuffer @@ -1291,6 +1283,9 @@ It assumes that it is called from within the control buffer." (ediff-multiframe-setup-p) ediff-wide-display-p))))))) +(defun ediff-compute-toolbar-width () + (declare (obsolete nil "28.1")) + 0) (provide 'ediff-wind) ;;; ediff-wind.el ends here commit 430eb2f850b26f7df8473de4d929b5665673a0a2 Author: Stefan Kangas Date: Fri Nov 20 15:17:22 2020 +0100 Remove Emacs 20 compat code from org.el * lisp/org/org.el (org-org-menu, org-create-customize-menu): Remove Emacs 20 compat code. diff --git a/lisp/org/org.el b/lisp/org/org.el index 1ab8ab6888..d2a36dd0ba 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -18535,8 +18535,7 @@ an argument, unconditionally call `org-insert-heading'." ("Customize" ["Browse Org Group" org-customize t] "--" - ["Expand This Menu" org-create-customize-menu - (fboundp 'customize-menu-create)]) + ["Expand This Menu" org-create-customize-menu t]) ["Send bug report" org-submit-bug-report t] "--" ("Refresh/Reload" @@ -18709,20 +18708,17 @@ With prefix arg UNCOMPILED, load the uncompiled versions." (interactive) (org-load-modules-maybe) (org-require-autoloaded-modules) - (if (fboundp 'customize-menu-create) - (progn - (easy-menu-change - '("Org") "Customize" - `(["Browse Org group" org-customize t] - "--" - ,(customize-menu-create 'org) - ["Set" Custom-set t] - ["Save" Custom-save t] - ["Reset to Current" Custom-reset-current t] - ["Reset to Saved" Custom-reset-saved t] - ["Reset to Standard Settings" Custom-reset-standard t])) - (message "\"Org\"-menu now contains full customization menu")) - (error "Cannot expand menu (outdated version of cus-edit.el)"))) + (easy-menu-change + '("Org") "Customize" + `(["Browse Org group" org-customize t] + "--" + ,(customize-menu-create 'org) + ["Set" Custom-set t] + ["Save" Custom-save t] + ["Reset to Current" Custom-reset-current t] + ["Reset to Saved" Custom-reset-saved t] + ["Reset to Standard Settings" Custom-reset-standard t])) + (message "\"Org\"-menu now contains full customization menu")) ;;;; Miscellaneous stuff commit 8834776b140c7ffec127316e53b778c15550d5e3 Author: Stefan Kangas Date: Fri Nov 20 15:13:08 2020 +0100 Remove Emacs 20 compat code from idlwave.el * lisp/progmodes/idlwave.el (idlwave-indent-line) (idlwave-toggle-comment-region, idlwave-reset-sintern) (idlwave-unit-name, idlwave-mode-menu-def) (idlwave-create-customize-menu): Remove Emacs 20 compat code. diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 6dd8853b1a..44bdd918d6 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -2776,10 +2776,7 @@ If the optional argument EXPAND is non-nil then the actions in ;; Adjust parallel comment (end-of-line) (if (idlwave-in-comment) - ;; Emacs 21 is too smart with fill-column on comment indent - (let ((fill-column (if (fboundp 'comment-indent-new-line) - (1- (frame-width)) - fill-column))) + (let ((fill-column (1- (frame-width)))) (indent-for-comment))))) (goto-char mloc) ;; Get rid of marker @@ -3991,12 +3988,7 @@ blank lines." ;; skip blank lines (skip-chars-forward " \t\n") (if (looking-at (concat "[ \t]*\\(" comment-start "+\\)")) - (if (fboundp 'uncomment-region) - (uncomment-region beg end) - (comment-region beg end - (- (length (buffer-substring - (match-beginning 1) - (match-end 1)))))) + (uncomment-region beg end) (comment-region beg end))))) @@ -4042,11 +4034,6 @@ blank lines." (defun idlwave-reset-sintern (&optional what) "Reset all sintern hashes." ;; Make sure the hash functions are accessible. - (unless (and (fboundp 'gethash) - (fboundp 'puthash)) - (require 'cl) - (or (fboundp 'puthash) - (defalias 'puthash 'cl-puthash))) (let ((entries '((idlwave-sint-routines 1000 10) (idlwave-sint-keywords 1000 10) (idlwave-sint-methods 100 10) @@ -8886,9 +8873,7 @@ Assumes that point is at the beginning of the unit as found by (let ((begin (point))) (re-search-forward "[a-zA-Z_][a-zA-Z0-9$_]+\\(::[a-zA-Z_][a-zA-Z0-9$_]+\\)?") - (if (fboundp 'buffer-substring-no-properties) - (buffer-substring-no-properties begin (point)) - (buffer-substring begin (point))))) + (buffer-substring-no-properties begin (point)))) (defalias 'idlwave-function-menu (condition-case nil @@ -9004,8 +8989,7 @@ Assumes that point is at the beginning of the unit as found by ("Customize" ["Browse IDLWAVE Group" idlwave-customize t] "--" - ["Build Full Customize Menu" idlwave-create-customize-menu - (fboundp 'customize-menu-create)]) + ["Build Full Customize Menu" idlwave-create-customize-menu t]) ("Documentation" ["Describe Mode" describe-mode t] ["Abbreviation List" idlwave-list-abbrevs t] @@ -9045,24 +9029,21 @@ Assumes that point is at the beginning of the unit as found by (defun idlwave-create-customize-menu () "Create a full customization menu for IDLWAVE, insert it into the menu." (interactive) - (if (fboundp 'customize-menu-create) - (progn - ;; Try to load the code for the shell, so that we can customize it - ;; as well. - (or (featurep 'idlw-shell) - (load "idlw-shell" t)) - (easy-menu-change - '("IDLWAVE") "Customize" - `(["Browse IDLWAVE group" idlwave-customize t] - "--" - ,(customize-menu-create 'idlwave) - ["Set" Custom-set t] - ["Save" Custom-save t] - ["Reset to Current" Custom-reset-current t] - ["Reset to Saved" Custom-reset-saved t] - ["Reset to Standard Settings" Custom-reset-standard t])) - (message "\"IDLWAVE\"-menu now contains full customization menu")) - (error "Cannot expand menu (outdated version of cus-edit.el)"))) + ;; Try to load the code for the shell, so that we can customize it + ;; as well. + (or (featurep 'idlw-shell) + (load "idlw-shell" t)) + (easy-menu-change + '("IDLWAVE") "Customize" + `(["Browse IDLWAVE group" idlwave-customize t] + "--" + ,(customize-menu-create 'idlwave) + ["Set" Custom-set t] + ["Save" Custom-save t] + ["Reset to Current" Custom-reset-current t] + ["Reset to Saved" Custom-reset-saved t] + ["Reset to Standard Settings" Custom-reset-standard t])) + (message "\"IDLWAVE\"-menu now contains full customization menu")) (defun idlwave-show-commentary () "Use the finder to view the file documentation from `idlwave.el'." commit e8ee682733733e33336cb5983ef024c0830dbecc Author: Stefan Kangas Date: Fri Nov 20 14:57:22 2020 +0100 Properly mark obsolete semantic functions as such * lisp/cedet/semantic/ia.el (semantic-ia-get-completions) (semantic-ia-get-completions-deprecated): Make obsolete. diff --git a/lisp/cedet/semantic/ia.el b/lisp/cedet/semantic/ia.el index 4a129aae74..e671160838 100644 --- a/lisp/cedet/semantic/ia.el +++ b/lisp/cedet/semantic/ia.el @@ -79,15 +79,14 @@ (insert "(")) (t nil)))) -(defalias 'semantic-ia-get-completions 'semantic-ia-get-completions-deprecated - "`Semantic-ia-get-completions' is obsolete. -Use `semantic-analyze-possible-completions' instead.") +(defalias 'semantic-ia-get-completions 'semantic-ia-get-completions-deprecated) +(make-obsolete 'semantic-ia-get-completions + #'semantic-analyze-possible-completions "28.1") (defun semantic-ia-get-completions-deprecated (context point) "A function to help transition away from `semantic-ia-get-completions'. -Return completions based on CONTEXT at POINT. -You should not use this, nor the aliased version. -Use `semantic-analyze-possible-completions' instead." +Return completions based on CONTEXT at POINT." + (declare (obsolete semantic-analyze-possible-completions "28.1")) (semantic-analyze-possible-completions context)) ;;;###autoload commit 22d81123f5d552d516fb9461f90ad196af9c91a8 Author: Stefan Kangas Date: Fri Nov 20 14:56:49 2020 +0100 Mark compat alias in cus-face.el obsolete * lisp/cus-face.el (custom-facep): Mark compat alias obsolete. * lisp/cus-dep.el (custom-make-dependencies): * lisp/cus-edit.el (customize-changed-options) (custom-unsaved-options, customize-saved, customize-apropos) (custom-save-faces): Adjust callers. diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el index 9003b7fc1b..db2c444638 100644 --- a/lisp/cus-dep.el +++ b/lisp/cus-dep.el @@ -204,7 +204,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS" (setq where (get symbol 'custom-where)) (when where (if (or (custom-variable-p symbol) - (custom-facep symbol)) + (facep symbol)) ;; This means it's a variable or a face. (progn (if (assoc version version-alist) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index b46be39e38..eceba8fa4d 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1295,7 +1295,7 @@ that were added or redefined since that version." (push (list symbol 'custom-group) found)) (if (custom-variable-p symbol) (push (list symbol 'custom-variable) found)) - (if (custom-facep symbol) + (if (facep symbol) (push (list symbol 'custom-face) found))))))) (if found (custom-buffer-create (custom--filter-obsolete-variables @@ -1406,7 +1406,7 @@ symbols `custom-face' or `custom-variable'." (mapatoms (lambda (symbol) (and (or (get symbol 'customized-face) (get symbol 'customized-face-comment)) - (custom-facep symbol) + (facep symbol) (push (list symbol 'custom-face) found)) (and (or (get symbol 'customized-value) (get symbol 'customized-variable-comment)) @@ -1453,7 +1453,7 @@ symbols `custom-face' or `custom-variable'." (mapatoms (lambda (symbol) (and (or (get symbol 'saved-face) (get symbol 'saved-face-comment)) - (custom-facep symbol) + (facep symbol) (push (list symbol 'custom-face) found)) (and (or (get symbol 'saved-value) (get symbol 'saved-variable-comment)) @@ -1491,7 +1491,7 @@ If TYPE is `groups', include only groups." (if (get symbol 'custom-group) (push (list symbol 'custom-group) found))) (if (memq type '(nil faces)) - (if (custom-facep symbol) + (if (facep symbol) (push (list symbol 'custom-face) found))) (if (memq type '(nil options)) (if (and (boundp symbol) @@ -4898,7 +4898,7 @@ This function does not save the buffer." (let ((spec (car-safe (get symbol 'theme-face))) (value (get symbol 'saved-face)) (now (not (or (get symbol 'face-defface-spec) - (and (not (custom-facep symbol)) + (and (not (facep symbol)) (not (get symbol 'force-face)))))) (comment (get symbol 'saved-face-comment))) (when (or (and spec (eq (nth 0 spec) 'user)) diff --git a/lisp/cus-face.el b/lisp/cus-face.el index cc766aa450..199a76e5cc 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -27,8 +27,6 @@ ;;; Code: -(defalias 'custom-facep 'facep) - ;;; Declaring a face. (defun custom-declare-face (face spec doc &rest args) @@ -394,6 +392,8 @@ Each of the arguments ARGS has this form: This means reset FACE to its value in FROM-THEME." (apply 'custom-theme-reset-faces 'user args)) +(define-obsolete-function-alias 'custom-facep #'facep "28.1") + ;;; The End. (provide 'cus-face) commit 88adf1f0dd82866a81fae3338adcda735a499a63 Author: Eli Zaretskii Date: Fri Nov 20 17:00:36 2020 +0200 Fix compilation on MS-Windows with librsvg > 2.46.0 * src/image.c (rsvg_handle_get_dimensions, init_svg_functions): Make 'rsvg_handle_get_dimensions' available and defined for all versions of librsvg. (Bug#44655) diff --git a/src/image.c b/src/image.c index fdb7ef874d..5eb4132295 100644 --- a/src/image.c +++ b/src/image.c @@ -9551,10 +9551,9 @@ DEF_DLL_FN (void, rsvg_handle_get_intrinsic_dimensions, DEF_DLL_FN (gboolean, rsvg_handle_get_geometry_for_layer, (RsvgHandle *, const char *, const RsvgRectangle *, RsvgRectangle *, RsvgRectangle *, GError **)); -# else +# endif DEF_DLL_FN (void, rsvg_handle_get_dimensions, (RsvgHandle *, RsvgDimensionData *)); -# endif DEF_DLL_FN (GdkPixbuf *, rsvg_handle_get_pixbuf, (RsvgHandle *)); DEF_DLL_FN (int, gdk_pixbuf_get_width, (const GdkPixbuf *)); DEF_DLL_FN (int, gdk_pixbuf_get_height, (const GdkPixbuf *)); @@ -9604,9 +9603,8 @@ 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); -#else - LOAD_DLL_FN (library, rsvg_handle_get_dimensions); #endif + LOAD_DLL_FN (library, rsvg_handle_get_dimensions); LOAD_DLL_FN (library, rsvg_handle_get_pixbuf); LOAD_DLL_FN (gdklib, gdk_pixbuf_get_width); @@ -9644,9 +9642,8 @@ init_svg_functions (void) # if LIBRSVG_CHECK_VERSION (2, 46, 0) # undef rsvg_handle_get_intrinsic_dimensions # undef rsvg_handle_get_geometry_for_layer -# else -# undef rsvg_handle_get_dimensions # endif +# undef rsvg_handle_get_dimensions # undef rsvg_handle_get_pixbuf # if LIBRSVG_CHECK_VERSION (2, 32, 0) # undef g_file_new_for_path @@ -9677,9 +9674,8 @@ init_svg_functions (void) fn_rsvg_handle_get_intrinsic_dimensions # define rsvg_handle_get_geometry_for_layer \ fn_rsvg_handle_get_geometry_for_layer -# else -# define rsvg_handle_get_dimensions fn_rsvg_handle_get_dimensions # endif +# define rsvg_handle_get_dimensions fn_rsvg_handle_get_dimensions # 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 commit b4b1bd6e03d739871dd3ba51e8de0be2d272b766 Author: Stefan Kangas Date: Fri Nov 20 14:33:25 2020 +0100 Hide obsolete options in most customize commands * lisp/cus-edit.el (custom--filter-obsolete-variables): New defun. * lisp/cus-edit.el (customize-changed-options) (customize-apropos, custom-group-value-create): Hide obsolete user options. (Bug#44598) * test/lisp/cus-edit-tests.el: New file. diff --git a/etc/NEWS b/etc/NEWS index a0e72bc673..efec674323 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -712,6 +712,16 @@ This file was a compatibility kludge which is no longer needed. To revert to the previous behavior, '(setq lisp-indent-function 'lisp-indent-function)' from 'lisp-mode-hook'. +** Customize + +*** Most customize commands now hide obsolete user options. +Obsolete user options are no longer shown in the listings produced by +the commands `customize', `customize-group', `customize-apropos' and +`customize-changed-options'. + +To customize obsolete user options, use `customize-option' or +`customize-saved'. + ** Edebug +++ diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index d1077d367d..b46be39e38 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1298,7 +1298,8 @@ that were added or redefined since that version." (if (custom-facep symbol) (push (list symbol 'custom-face) found))))))) (if found - (custom-buffer-create (custom-sort-items found t 'first) + (custom-buffer-create (custom--filter-obsolete-variables + (custom-sort-items found t 'first)) "*Customize Changed Options*") (user-error "No user option defaults have been changed since Emacs %s" since-version)))) @@ -1504,7 +1505,8 @@ If TYPE is `groups', include only groups." (symbol-name type)) pattern)) (custom-buffer-create - (custom-sort-items found t custom-buffer-order-groups) + (custom--filter-obsolete-variables + (custom-sort-items found t custom-buffer-order-groups)) "*Customize Apropos*"))) ;;;###autoload @@ -4232,6 +4234,13 @@ and so forth. The remaining group tags are shown with `custom-group-tag'." (insert "--------"))) (widget-default-create widget)) +(defun custom--filter-obsolete-variables (items) + "Filter obsolete variables from ITEMS." + (seq-remove (lambda (item) + (and (eq (nth 1 item) 'custom-variable) + (get (nth 0 item) 'byte-obsolete-variable))) + items)) + (defun custom-group-members (symbol groups-only) "Return SYMBOL's custom group members. If GROUPS-ONLY is non-nil, return only those members that are groups." @@ -4437,12 +4446,13 @@ This works for both graphical and text displays." ?\s)) ;; Members. (message "Creating group...") - (let* ((members (custom-sort-items - members - ;; Never sort the top-level custom group. - (unless (eq symbol 'emacs) - custom-buffer-sort-alphabetically) - custom-buffer-order-groups)) + (let* ((members (custom--filter-obsolete-variables + (custom-sort-items + members + ;; Never sort the top-level custom group. + (unless (eq symbol 'emacs) + custom-buffer-sort-alphabetically) + custom-buffer-order-groups))) (prefixes (widget-get widget :custom-prefixes)) (custom-prefix-list (custom-prefix-add symbol prefixes)) (have-subtitle (and (not (eq symbol 'emacs)) diff --git a/test/lisp/cus-edit-tests.el b/test/lisp/cus-edit-tests.el new file mode 100644 index 0000000000..4d148b4f41 --- /dev/null +++ b/test/lisp/cus-edit-tests.el @@ -0,0 +1,80 @@ +;;; cus-edit-tests.el --- Tests for cus-edit.el -*- lexical-binding: t -*- + +;; Copyright (C) 2020 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 'ert-x) +(require 'cus-edit) + +(defmacro with-cus-edit-test (buffer &rest body) + (declare (indent 1)) + `(save-window-excursion + (unwind-protect + (progn ,@body) + (when-let ((buf (get-buffer ,buffer))) + (kill-buffer buf))))) + + +;;;; showing/hiding obsolete options + +(defgroup cus-edit-tests nil "test" + :group 'test-group) + +(defcustom cus-edit-tests--obsolete-option-tag nil + "This should never be removed; it is obsolete for testing purposes." + :type 'boolean + :version "917.10") ; a super high version number +(make-obsolete-variable 'cus-edit-tests--obsolete-option-tag nil "X.X-test") +(defconst cus-edit-tests--obsolete-option-tag + (custom-unlispify-tag-name 'cus-edit-tests--obsolete-option-tag)) + +(ert-deftest cus-edit-tests-customize-apropos/hide-obsolete () + (with-cus-edit-test "*Customize Apropos*" + (customize-apropos "cus-edit-tests") + (should-not (search-forward cus-edit-tests--obsolete-option-tag nil t)))) + +(ert-deftest cus-edit-tests-customize-changed-options/hide-obsolete () + (with-cus-edit-test "*Customize Changed Options*" + (customize-changed-options "917.2") ; some future version + (should-not (search-forward cus-edit-tests--obsolete-option-tag nil t)))) + +(ert-deftest cus-edit-tests-customize-group/hide-obsolete () + "Check that obsolete variables do not show up." + (with-cus-edit-test "*Customize Group: Cus Edit Tests*" + (customize-group 'cus-edit-tests) + (should-not (search-forward cus-edit-tests--obsolete-option-tag nil t)))) + +(ert-deftest cus-edit-tests-customize-option/show-obsolete () + (with-cus-edit-test "*Customize Option: Cus Edit Tests Obsolete Option Tag*" + (customize-option 'cus-edit-tests--obsolete-option-tag) + (goto-char (point-min)) + (should (search-forward cus-edit-tests--obsolete-option-tag nil t)))) + +(ert-deftest cus-edit-tests-customize-saved/show-obsolete () + ;; FIXME: How to test for saved options? + :expected-result :failed + (with-cus-edit-test "*Customize Saved*" + (customize-saved) + (should (search-forward cus-edit-tests--obsolete-option-tag nil t)))) + +(provide 'cus-edit-tests) +;;; cus-edit-tests.el ends here commit e7791c7e57b4b9ea895598cdb3f779c2173dccd9 Author: João Tãvora Date: Fri Nov 20 10:02:52 2020 +0000 Revert unintended part of last change to jsonrpc-request While playing around with the timing in this function, I left this change that could freeze the function on some platforms. * lisp/jsonrpc.el (jsonrpc-request): Use accept-process-output. (Version): Bump to 1.0.14 diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index d28cf7a91f..0b3394080c 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -4,7 +4,7 @@ ;; Author: João Távora ;; Keywords: processes, languages, extensions -;; Version: 1.0.13 +;; Version: 1.0.14 ;; Package-Requires: ((emacs "25.2")) ;; This is a GNU ELPA :core package. Avoid functionality that is not @@ -308,7 +308,7 @@ ignored." (let ((inhibit-quit t)) (while (sit-for 30))) (setq cancelled t)) `(cancelled ,cancel-on-input-retval)) - (t (while t (sit-for 30))))) + (t (while t (accept-process-output nil 30))))) ;; In normal operation, cancellation is handled by the ;; timeout function and response filter, but we still have ;; to protect against user-quit (C-g) or the commit f6b26fa43f61404e306913f7216c105b44fdc4fe Author: Lars Ingebrigtsen Date: Fri Nov 20 03:33:38 2020 +0100 Move semantic/tag obsolete variables to avoid a warning * lisp/cedet/semantic/tag.el (semantic-token-version): Move to avoid a compilation warning. diff --git a/lisp/cedet/semantic/tag.el b/lisp/cedet/semantic/tag.el index badefd59e6..3dadf34773 100644 --- a/lisp/cedet/semantic/tag.el +++ b/lisp/cedet/semantic/tag.el @@ -53,6 +53,11 @@ (declare-function semantic-clear-toplevel-cache "semantic") (declare-function semantic-tag-similar-p "semantic/tag-ls") +(define-obsolete-variable-alias 'semantic-token-version + 'semantic-tag-version "28.1") +(define-obsolete-variable-alias 'semantic-token-incompatible-version + 'semantic-tag-incompatible-version "28.1") + (defconst semantic-tag-version "2.0" "Version string of semantic tags made with this code.") @@ -1321,12 +1326,6 @@ This function is overridable with the symbol `insert-foreign-tag'." "Insert foreign tags into log-edit mode." (insert (concat "(" (semantic-format-tag-name foreign-tag) "): "))) -;;; Obsolete -;; -(define-obsolete-variable-alias 'semantic-token-version - 'semantic-tag-version "28.1") -(define-obsolete-variable-alias 'semantic-token-incompatible-version - 'semantic-tag-incompatible-version "28.1") (provide 'semantic/tag) commit 59b340c1e6c9fc8b30123fbfecd50f58adc3bf6b Author: João Távora Date: Fri Nov 20 01:18:16 2020 +0000 Fix default timeout handling in jsonrpc-request * lisp/jsonrpc.el (jsonrpc-request): Use default timeout if not passed. (Version): Bump to 1.0.13 diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index 7de6baeb00..d28cf7a91f 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -4,7 +4,7 @@ ;; Author: João Távora ;; Keywords: processes, languages, extensions -;; Version: 1.0.12 +;; Version: 1.0.13 ;; Package-Requires: ((emacs "25.2")) ;; This is a GNU ELPA :core package. Avoid functionality that is not @@ -271,7 +271,7 @@ it only exits locally (returning the JSONRPC result object) if the request is successful, otherwise it exits non-locally with an error of type `jsonrpc-error'. -DEFERRED is passed to `jsonrpc-async-request', which see. +DEFERRED and TIMEOUT as in `jsonrpc-async-request', which see. If CANCEL-ON-INPUT is non-nil and the user inputs something while the function is waiting, then it exits immediately, returning @@ -284,7 +284,8 @@ ignored." (catch tag (setq id-and-timer - (jsonrpc--async-request-1 + (apply + #'jsonrpc--async-request-1 connection method params :success-fn (lambda (result) (unless cancelled @@ -300,13 +301,14 @@ ignored." (lambda () (unless cancelled (throw tag '(error (jsonrpc-error-message . "Timed out"))))) - :deferred deferred - :timeout timeout)) + `(,@(when deferred `(:deferred ,deferred)) + ,@(when timeout `(:timeout ,timeout))))) (cond (cancel-on-input - (while (sit-for 30)) - (setq cancelled t) + (unwind-protect + (let ((inhibit-quit t)) (while (sit-for 30))) + (setq cancelled t)) `(cancelled ,cancel-on-input-retval)) - (t (while t (accept-process-output nil 30))))) + (t (while t (sit-for 30))))) ;; In normal operation, cancellation is handled by the ;; timeout function and response filter, but we still have ;; to protect against user-quit (C-g) or the commit bc951000b35fc48edfe1f643998d201b971f0d30 Author: Lars Ingebrigtsen Date: Fri Nov 20 00:19:18 2020 +0100 Avoid a compilation warning about an ambiguous else * src/data.c (set_internal): Avoid compilation warning. data.c:1443:9: error: suggest explicit braces to avoid ambiguous ‘else’ 1443 | if (idx > 0 && bindflag == SET_INTERNAL_SET | ^ diff --git a/src/data.c b/src/data.c index 5d4df1886d..384c259220 100644 --- a/src/data.c +++ b/src/data.c @@ -1442,10 +1442,12 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, int idx = PER_BUFFER_IDX (offset); if (idx > 0 && bindflag == SET_INTERNAL_SET && !PER_BUFFER_VALUE_P (buf, idx)) - if (let_shadows_buffer_binding_p (sym)) - set_default_internal (symbol, newval, bindflag); - else - SET_PER_BUFFER_VALUE_P (buf, idx, 1); + { + if (let_shadows_buffer_binding_p (sym)) + set_default_internal (symbol, newval, bindflag); + else + SET_PER_BUFFER_VALUE_P (buf, idx, 1); + } } if (voide) commit 8fac2444641567b10f4c38b599636aeae0478e68 Author: Stefan Monnier Date: Thu Nov 19 17:13:04 2020 -0500 * src/data.c (set_internal): Fix bug#44733 Set the default value when `set` encounters a PER_BUFFER variable which has been let-bound globally, to match the behavior seen with `make-variable-buffer-local`. * test/src/data-tests.el (binding-test--let-buffer-local): Add corresponding test. (data-tests--set-default-per-buffer): Add tentative test for the performance problem encountered in bug#41029. diff --git a/src/data.c b/src/data.c index 6558985668..5d4df1886d 100644 --- a/src/data.c +++ b/src/data.c @@ -1440,10 +1440,12 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, { int offset = XBUFFER_OBJFWD (innercontents)->offset; int idx = PER_BUFFER_IDX (offset); - if (idx > 0 - && bindflag == SET_INTERNAL_SET - && !let_shadows_buffer_binding_p (sym)) - SET_PER_BUFFER_VALUE_P (buf, idx, 1); + if (idx > 0 && bindflag == SET_INTERNAL_SET + && !PER_BUFFER_VALUE_P (buf, idx)) + if (let_shadows_buffer_binding_p (sym)) + set_default_internal (symbol, newval, bindflag); + else + SET_PER_BUFFER_VALUE_P (buf, idx, 1); } if (voide) diff --git a/test/src/data-tests.el b/test/src/data-tests.el index ed09203907..1312683c84 100644 --- a/test/src/data-tests.el +++ b/test/src/data-tests.el @@ -345,6 +345,25 @@ comparing the subr with a much slower lisp implementation." (setq-default binding-test-some-local 'new-default)) (should (eq binding-test-some-local 'some)))) +(ert-deftest data-tests--let-buffer-local () + (let ((blvar (make-symbol "blvar"))) + (set-default blvar nil) + (make-variable-buffer-local blvar) + + (dolist (var (list blvar 'left-margin)) + (let ((def (default-value var))) + (with-temp-buffer + (should (equal def (symbol-value var))) + (cl-progv (list var) (list 42) + (should (equal (symbol-value var) 42)) + (should (equal (default-value var) (symbol-value var))) + (set var 123) + (should (equal (symbol-value var) 123)) + (should (equal (default-value var) (symbol-value var)))) ;bug#44733 + (should (equal (symbol-value var) def)) + (should (equal (default-value var) (symbol-value var)))) + (should (equal (default-value var) def)))))) + (ert-deftest binding-test-makunbound () "Tests of makunbound, from the manual." (with-current-buffer binding-test-buffer-B @@ -381,6 +400,37 @@ comparing the subr with a much slower lisp implementation." "Test setting a keyword to itself" (with-no-warnings (should (setq :keyword :keyword)))) +(ert-deftest data-tests--set-default-per-buffer () + :expected-result t ;; Not fixed yet! + ;; FIXME: Performance tests are inherently unreliable. + ;; Using wall-clock time makes it even worse, so don't bother unless + ;; we have the primitive to measure cpu-time. + (skip-unless (fboundp 'current-cpu-time)) + ;; Test performance of set-default on DEFVAR_PER_BUFFER variables. + ;; More specifically, test the problem seen in bug#41029 where setting + ;; the default value of a variable takes time proportional to the + ;; number of buffers. + (let* ((fun #'error) + (test (lambda () + (with-temp-buffer + (let ((st (car (current-cpu-time)))) + (dotimes (_ 1000) + (let ((case-fold-search 'data-test)) + ;; Use an indirection through a mutable var + ;; to try and make sure the byte-compiler + ;; doesn't optimize away the let bindings. + (funcall fun))) + ;; FIXME: Handle the wraparound, if any. + (- (car (current-cpu-time)) st))))) + (_ (setq fun #'ignore)) + (time1 (funcall test)) + (bufs (mapcar (lambda (_) (generate-new-buffer " data-test")) + (make-list 1000 nil))) + (time2 (funcall test))) + (mapc #'kill-buffer bufs) + ;; Don't divide one time by the other since they may be 0. + (should (< time2 (* time1 5))))) + ;; More tests to write - ;; kill-local-variable ;; defconst; can modify commit f641ef1a0712d5ca1a9a6dc39d4f0846b11bc26b Author: Eli Zaretskii Date: Thu Nov 19 22:06:23 2020 +0200 Improve documentation of 'font-spec' * doc/lispref/display.texi (Low-Level Font): * src/font.c (Ffont_spec): Document 'font-spec' keys that are supported, but were undocumented. diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index be2de000c3..39cc270a5f 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -3734,6 +3734,20 @@ Additional typographic style information for the font, such as The charset registry and encoding of the font, such as @samp{iso8859-1}. The value should be a string or a symbol. +@item :dpi +The resolution in dots per inch for which the font is designed. The +value must be a non-negative number. + +@item :spacing +The spacing of the font: proportional, dual, mono, or charcell. The +value should be either an integer (0 for proportional, 90 for dual, +100 for mono, 110 for charcell) or a one-letter symbol (one of +@code{P}, @code{D}, @code{M}, or @code{C}). + +@item :avgwidth +The average width of the font in 1/10 pixel units. The value should +be a non-negative number. + @item :script The script that the font must support (a symbol). diff --git a/src/font.c b/src/font.c index 39ec1b3562..b71eae6c31 100644 --- a/src/font.c +++ b/src/font.c @@ -3934,6 +3934,23 @@ VALUE must be a non-negative integer or a floating point number specifying the font size. It specifies the font size in pixels (if VALUE is an integer), or in points (if VALUE is a float). +`:dpi' + +VALUE must be a non-negative number that specifies the resolution +(dot per inch) for which the font is designed. + +`:spacing' + +VALUE specifies the spacing of the font: mono, proportional, charcell, +or dual. It can be either a number (0 for proportional, 90 for dual, +100 for mono, 110 for charcell) or a 1-letter symbol: `P', `D', `M', +or `C' (lower-case variants are also accepted). + +`:avgwidth' + +VALUE must be a non-negative integer specifying the average width of +the font in 1/10 pixel units. + `:name' VALUE must be a string of XLFD-style or fontconfig-style font name. commit 70773e5b97e6952ad7650e6872855451c64325c0 Author: Stefan Kangas Date: Thu Nov 19 20:58:26 2020 +0100 Remove some XEmacs compat code from filesets.el * lisp/filesets.el (filesets-init): Remove some XEmacs compat code. (filesets-error): Declare obsolete. (filesets-directory-files, filesets-get-selection) (filesets-spawn-external-viewer, filesets-get-filelist) (filesets-open, filesets-close, filesets-get-menu-epilog) (filesets-ingroup-collect-files, filesets-build-ingroup-submenu) (filesets-update-pre010505): Adjust callers. diff --git a/lisp/filesets.el b/lisp/filesets.el index dc81366147..c7ec3f77f4 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -89,6 +89,7 @@ ;;; Code: (eval-when-compile (require 'cl-lib)) +(require 'easymenu) ;;; Some variables @@ -1075,18 +1076,6 @@ defined in `filesets-ingroup-patterns'." :type 'integer :group 'filesets) -;;; Emacs compatibility -(eval-and-compile - (if (featurep 'xemacs) - (fset 'filesets-error 'error) - - (require 'easymenu) - - (defun filesets-error (_class &rest args) - "`error' wrapper." - (error "%s" (mapconcat 'identity args " "))) - - )) (defun filesets-filter-dir-names (lst &optional negative) "Remove non-directory names from a list of strings. @@ -1160,7 +1149,7 @@ Return full path if FULL-FLAG is non-nil." (filesets-message 1 "Filesets: %S doesn't exist" dir) nil) (t - (filesets-error 'error "Filesets: " dir " does not exist")))) + (error "Filesets: %s does not exist" dir)))) (defun filesets-quote (txt) "Return TXT in quotes." @@ -1172,7 +1161,7 @@ Return full path if FULL-FLAG is non-nil." (p (point))) (if m (buffer-substring (min m p) (max m p)) - (filesets-error 'error "No selection.")))) + (error "No selection")))) (defun filesets-get-quoted-selection () "Return the currently selected text in quotes." @@ -1357,8 +1346,7 @@ Use the viewer defined in EV-ENTRY (a valid element of (goto-char (point-min))) (when oh (run-hooks 'oh)))) - (filesets-error 'error - "Filesets: general error when spawning external viewer")))) + (error "Filesets: general error when spawning external viewer")))) (defun filesets-find-file (file) "Call `find-file' after a possible delay (see `filesets-find-file-delay'). @@ -1741,8 +1729,7 @@ Assume MODE (see `filesets-entry-mode'), if provided." ;;(filesets-message 3 "Filesets: scanning %s" dirpatt) (filesets-directory-files dir patt ':files t)) ;; (message "Filesets: malformed entry: %s" entry))))))) - (filesets-error 'error "Filesets: malformed entry: " - entry))))))) + (error "Filesets: malformed entry: %s" entry))))))) (filesets-filter-list fl (lambda (file) (not (filesets-filetype-property file event)))))) @@ -1768,7 +1755,7 @@ Use LOOKUP-NAME for searching additional data if provided." (dolist (this files nil) (filesets-file-open open-function this)) (message "Filesets: canceled"))) - (filesets-error 'error "Filesets: Unknown fileset: " name)))) + (error "Filesets: Unknown fileset: %s" name)))) (defun filesets-close (&optional mode name lookup-name) "Close all buffers belonging to the fileset called NAME. @@ -1789,7 +1776,7 @@ Use LOOKUP-NAME for deducing the save-function, if provided." (if buffer (filesets-file-close save-function buffer))))) ; (message "Filesets: Unknown fileset: `%s'" name)))) - (filesets-error 'error "Filesets: Unknown fileset: " name)))) + (error "Filesets: Unknown fileset: %s" name)))) (defun filesets-add-buffer (&optional name buffer) "Add BUFFER (or current buffer) to the fileset called NAME. @@ -1997,7 +1984,7 @@ LOOKUP-NAME is used as lookup name for retrieving fileset specific settings." `(["Rebuild this submenu" (filesets-rebuild-this-submenu ',lookup-name)])))) (_ - (filesets-error 'error "Filesets: malformed definition of " something)))) + (error "Filesets: malformed definition of %s" something)))) (defun filesets-ingroup-get-data (master pos &optional fun) "Access to `filesets-ingroup-patterns'. Extract data section." @@ -2070,8 +2057,7 @@ LOOKUP-NAME is used as lookup name for retrieving fileset specific settings." (lst nil)) (cond ((not this-patt) - (filesets-error 'error "Filesets: malformed :ingroup definition " - this-def)) + (error "Filesets: malformed :ingroup definition %s" this-def)) ((< this-sd 0) nil) (t @@ -2174,7 +2160,7 @@ FS is a fileset's name. FLIST is a list returned by (progn (message "Filesets: can't parse %s" master) nil) - (filesets-error 'error "Filesets: can't parse " master)))) + (error "Filesets: can't parse %s" master)))) (defun filesets-build-dir-submenu-now (level depth entry lookup-name dir patt fd &optional rebuild-flag) @@ -2473,7 +2459,7 @@ We apologize for the inconvenience."))) (insert msg) (when (y-or-n-p (format "Edit startup (%s) file now? " cf)) (find-file-other-window cf)) - (filesets-error 'error msg)))) + (error msg)))) (defun filesets-update (cached-version) "Do some cleanup after updating filesets.el." @@ -2509,8 +2495,7 @@ We apologize for the inconvenience."))) (defun filesets-init () "Filesets initialization. Set up hooks, load the cache file -- if existing -- and build the menu." - (add-hook (if (featurep 'xemacs) 'activate-menubar-hook 'menu-bar-update-hook) - (function filesets-build-menu-maybe)) + (add-hook 'menu-bar-update-hook #'filesets-build-menu-maybe) (add-hook 'kill-buffer-hook (function filesets-remove-from-ubl)) (add-hook 'first-change-hook (function filesets-reset-filename-on-change)) (add-hook 'kill-emacs-hook (function filesets-exit)) @@ -2524,6 +2509,10 @@ Set up hooks, load the cache file -- if existing -- and build the menu." (setq filesets-menu-use-cached-flag t))) (filesets-build-menu))) +(defun filesets-error (_class &rest args) + "`error' wrapper." + (declare (obsolete error "28.1")) + (error "%s" (mapconcat 'identity args " "))) (provide 'filesets) commit 842fc2d01ebf7ff2d41bce2d8a0b25c30d41941b Author: Stefan Kangas Date: Thu Nov 19 17:46:16 2020 +0100 Remove some compat code from ffap.el * lisp/ffap.el (ffap-mouse-event, ffap-event-buffer): Make obsolete. (ffap-menu-ask, ffap-at-mouse): Adjust callers. diff --git a/lisp/ffap.el b/lisp/ffap.el index 9ad421c277..d4bddd0574 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -301,15 +301,14 @@ disable ffap most of the time." :version "20.3") -;;; Compatibility: -;; -;; This version of ffap supports only the Emacs it is distributed in. -;; See the ftp site for a more general version. The following -;; functions are necessary "leftovers" from the more general version. +;;; Obsolete: (defun ffap-mouse-event () ; current mouse event, or nil + (declare (obsolete nil "28.1")) (and (listp last-nonmenu-event) last-nonmenu-event)) + (defun ffap-event-buffer (event) + (declare (obsolete nil "28.1")) (window-buffer (car (event-start event)))) @@ -1736,7 +1735,9 @@ Function CONT is applied to the entry chosen by the user." (let (choice) (cond ;; Emacs mouse: - ((and (fboundp 'x-popup-menu) (ffap-mouse-event)) + ((and (fboundp 'x-popup-menu) + (listp last-nonmenu-event) + last-nonmenu-event) (setq choice (x-popup-menu t @@ -1829,7 +1830,7 @@ Return value: (ffap-guesser)))) (cond (guess - (set-buffer (ffap-event-buffer e)) + (set-buffer (window-buffer (car (event-start e)))) (ffap-highlight) (unwind-protect (progn commit 493e19b97f8561638f042fb166cd69a384718edd Author: Stefan Kangas Date: Thu Nov 19 17:42:14 2020 +0100 Declare some compat aliases obsolete * lisp/cedet/semantic/tag.el (semantic-token-version) (semantic-token-incompatible-version): * lisp/emulation/edt.el (edt-bind-standard-key): Make compat aliases obsolete. diff --git a/lisp/cedet/semantic/tag.el b/lisp/cedet/semantic/tag.el index e677264c5a..badefd59e6 100644 --- a/lisp/cedet/semantic/tag.el +++ b/lisp/cedet/semantic/tag.el @@ -1321,12 +1321,12 @@ This function is overridable with the symbol `insert-foreign-tag'." "Insert foreign tags into log-edit mode." (insert (concat "(" (semantic-format-tag-name foreign-tag) "): "))) -;;; Compatibility +;;; Obsolete ;; -(defconst semantic-token-version - semantic-tag-version) -(defconst semantic-token-incompatible-version - semantic-tag-incompatible-version) +(define-obsolete-variable-alias 'semantic-token-version + 'semantic-tag-version "28.1") +(define-obsolete-variable-alias 'semantic-token-incompatible-version + 'semantic-tag-incompatible-version "28.1") (provide 'semantic/tag) diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el index e70b44658d..b29ad7702e 100644 --- a/lisp/emulation/edt.el +++ b/lisp/emulation/edt.el @@ -2161,8 +2161,7 @@ Argument KEY is the name of a key. It can be a standard key or a function key. Argument BINDING is the Emacs function to be bound to ." (define-key edt-user-global-map key binding)) -;; For backward compatibility to existing edt-user.el files. -(fset 'edt-bind-standard-key (symbol-function 'edt-bind-key)) +(define-obsolete-function-alias 'edt-bind-standard-key #'edt-bind-key "28.1") (defun edt-bind-gold-key (key gold-binding) "Binds standard key sequences to custom bindings in the EDT Emulator. commit 1ac6330fce34beaead60f1c5c7573950e9014780 Author: Stefan Kangas Date: Thu Nov 19 17:41:18 2020 +0100 Remove some compat code from url.el * lisp/url/url.el (url-warn): Make into obsolete alias for display-warning. * lisp/url/url-auth.el (url-register-auth-scheme): * lisp/url/url-news.el (url-news-open-host): * lisp/url/url-proxy.el (url-find-proxy-for-url): Adjust callers. diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el index fd800cd978..bcb48aa455 100644 --- a/lisp/url/url-auth.el +++ b/lisp/url/url-auth.el @@ -23,7 +23,6 @@ (require 'url-vars) (require 'url-parse) -(autoload 'url-warn "url") (autoload 'auth-source-search "auth-source") (defsubst url-auth-user-prompt (url realm) @@ -540,7 +539,7 @@ RATING a rating between 1 and 10 of the strength of the authentication. (t rating))) (node (assoc type url-registered-auth-schemes))) (if (not (fboundp function)) - (url-warn + (display-warning 'security (format-message "Tried to register `%s' as an auth scheme, but it is not a function!" diff --git a/lisp/url/url-news.el b/lisp/url/url-news.el index 9ef17cccd7..78a6aa9483 100644 --- a/lisp/url/url-news.el +++ b/lisp/url/url-news.el @@ -25,7 +25,6 @@ (require 'url-util) (require 'url-parse) (require 'nntp) -(autoload 'url-warn "url") (autoload 'gnus-group-read-ephemeral-group "gnus-group") ;; Unused. @@ -42,7 +41,7 @@ (nntp-send-command "^.*\r?\n" "AUTHINFO USER" user) (nntp-send-command "^.*\r?\n" "AUTHINFO PASS" pass) (if (not (nntp-server-opened host)) - (url-warn 'url (format "NNTP authentication to `%s' as `%s' failed" + (display-warning 'url (format "NNTP authentication to `%s' as `%s' failed" host user)))))) (defun url-news-fetch-message-id (host message-id) diff --git a/lisp/url/url-proxy.el b/lisp/url/url-proxy.el index 9513c3973a..698a87098b 100644 --- a/lisp/url/url-proxy.el +++ b/lisp/url/url-proxy.el @@ -22,7 +22,6 @@ ;;; Code: (require 'url-parse) -(autoload 'url-warn "url") (defun url-default-find-proxy-for-url (urlobj host) (cond @@ -60,7 +59,7 @@ ((string-match "^socks +" proxy) (concat "socks://" (substring proxy (match-end 0)))) (t - (url-warn 'url (format "Unknown proxy directive: %s" proxy) 'critical) + (display-warning 'url (format "Unknown proxy directive: %s" proxy) 'critical) nil)))) (autoload 'url-http "url-http") diff --git a/lisp/url/url.el b/lisp/url/url.el index 33a5ebcdcc..5188007a58 100644 --- a/lisp/url/url.el +++ b/lisp/url/url.el @@ -365,19 +365,7 @@ how long to wait for a response before giving up." (if (buffer-live-p buff) (kill-buffer buff))))) -(cond - ((fboundp 'display-warning) - (defalias 'url-warn 'display-warning)) - ((fboundp 'warn) - (defun url-warn (class message &optional level) - (warn "(%s/%s) %s" class (or level 'warning) message))) - (t - (defun url-warn (class message &optional level) - (with-current-buffer (get-buffer-create "*URL-WARNINGS*") - (goto-char (point-max)) - (save-excursion - (insert (format "(%s/%s) %s\n" class (or level 'warning) message))) - (display-buffer (current-buffer)))))) +(define-obsolete-function-alias 'url-warn #'display-warning "28.1") (provide 'url) commit 75555b5b6bc517911404fc769b02f583e40f6c35 Author: Stefan Kangas Date: Thu Nov 19 06:42:46 2020 +0100 Remove some compat code for old versions and XEmacs * lisp/ibuf-ext.el (ibuffer-old-saved-filters-warning) (ibuffer-maybe-save-stuff): Assume customize-save-variable is bound; it is autoloaded. * lisp/cedet/semantic/symref/grep.el (semantic-symref-perform-search): * lisp/password-cache.el (password-cache-remove): * lisp/cedet/semantic/bovine/el.el (semantic-dependency-tag-file): Remove Emacs 21 compat code. * lisp/cedet/semantic/sort.el (semantic-string-lessp-ci): Remove Emacs 20 compat code. * test/lisp/cedet/semantic-utest.el (semantic-utest-temp-directory): * lisp/mail/supercite.el (sc-ask): Remove XEmacs compat code. * lisp/progmodes/idlw-shell.el (idlwave-shell-mode): * lisp/progmodes/idlwave.el (idlwave-mode): Remove commented out compat code. diff --git a/lisp/cedet/semantic/bovine/el.el b/lisp/cedet/semantic/bovine/el.el index bbed1d94f2..2f05b99e46 100644 --- a/lisp/cedet/semantic/bovine/el.el +++ b/lisp/cedet/semantic/bovine/el.el @@ -464,27 +464,11 @@ Return a bovination list to use." (define-mode-local-override semantic-dependency-tag-file emacs-lisp-mode (tag) "Find the file BUFFER depends on described by TAG." - (if (fboundp 'find-library-name) - (condition-case nil - ;; Try an Emacs 22 fcn. This throws errors. - (find-library-name (semantic-tag-name tag)) - (error - (message "semantic: cannot find source file %s" - (semantic-tag-name tag)))) - ;; No handy function available. (Older Emacsen) - (let* ((lib (locate-library (semantic-tag-name tag))) - (name (if lib (file-name-sans-extension lib) nil)) - (nameel (concat name ".el"))) - (cond - ((and name (file-exists-p nameel)) nameel) - ((and name (file-exists-p (concat name ".el.gz"))) - ;; This is the linux distro case. - (concat name ".el.gz")) - ;; Source file does not exist. - (name - (message "semantic: cannot find source file %s" (concat name ".el"))) - (t - nil))))) + (condition-case nil + (find-library-name (semantic-tag-name tag)) + (error + (message "semantic: cannot find source file %s" + (semantic-tag-name tag))))) ;;; DOC Strings ;; diff --git a/lisp/cedet/semantic/sort.el b/lisp/cedet/semantic/sort.el index 89fc917e0c..a565d878f1 100644 --- a/lisp/cedet/semantic/sort.el +++ b/lisp/cedet/semantic/sort.el @@ -46,11 +46,7 @@ (defun semantic-string-lessp-ci (s1 s2) "Case insensitive version of `string-lessp'. Argument S1 and S2 are the strings to compare." - ;; Use downcase instead of upcase because an average name - ;; has more lower case characters. - (if (fboundp 'compare-strings) - (eq (compare-strings s1 0 nil s2 0 nil t) -1) - (string-lessp (downcase s1) (downcase s2)))) + (eq (compare-strings s1 0 nil s2 0 nil t) -1)) (defun semantic-sort-tag-type (tag) "Return a type string for TAG guaranteed to be a string." diff --git a/lisp/cedet/semantic/symref/grep.el b/lisp/cedet/semantic/symref/grep.el index d8de8ead4e..29e88cda12 100644 --- a/lisp/cedet/semantic/symref/grep.el +++ b/lisp/cedet/semantic/symref/grep.el @@ -167,24 +167,10 @@ This shell should support pipe redirect syntax." (with-current-buffer b (erase-buffer) (setq default-directory rootdir) - - (if (not (fboundp 'grep-compute-defaults)) - - ;; find . -type f -print0 | xargs -0 -e grep -nH -e - ;; Note : I removed -e as it is not posix, nor necessary it seems. - - (let ((cmd (concat "find " (file-local-name rootdir) - " -type f " filepattern " -print0 " - "| xargs -0 grep -H " grepflags "-e " greppat))) - ;;(message "Old command: %s" cmd) - (process-file semantic-symref-grep-shell nil b nil - shell-command-switch cmd) - ) - (let ((cmd (semantic-symref-grep-use-template - (file-local-name rootdir) filepattern grepflags greppat))) - (process-file semantic-symref-grep-shell nil b nil - shell-command-switch cmd)) - )) + (let ((cmd (semantic-symref-grep-use-template + (file-local-name rootdir) filepattern grepflags greppat))) + (process-file semantic-symref-grep-shell nil b nil + shell-command-switch cmd))) (setq ans (semantic-symref-parse-tool-output tool b)) ;; Return the answer ans)) diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index 80c5b07398..7934297674 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -208,11 +208,9 @@ either clicking or hitting return " 'follow-link t 'help-echo "Click or RET: save new value in customize" 'action (lambda (_) - (if (not (fboundp 'customize-save-variable)) - (message "Customize not available; value not saved") - (customize-save-variable 'ibuffer-saved-filters - ibuffer-saved-filters) - (message "Saved updated ibuffer-saved-filters.")))) + (customize-save-variable 'ibuffer-saved-filters + ibuffer-saved-filters) + (message "Saved updated ibuffer-saved-filters."))) ". See below for an explanation and alternative ways to save the repaired value. @@ -1116,13 +1114,10 @@ filter into parts." (defun ibuffer-maybe-save-stuff () (when ibuffer-save-with-custom - (if (fboundp 'customize-save-variable) - (progn - (customize-save-variable 'ibuffer-saved-filters - ibuffer-saved-filters) - (customize-save-variable 'ibuffer-saved-filter-groups - ibuffer-saved-filter-groups)) - (message "Not saved permanently: Customize not available")))) + (customize-save-variable 'ibuffer-saved-filters + ibuffer-saved-filters) + (customize-save-variable 'ibuffer-saved-filter-groups + ibuffer-saved-filter-groups))) ;;;###autoload (defun ibuffer-save-filters (name filters) diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el index b2ccd3d993..9b7af0111e 100644 --- a/lisp/mail/supercite.el +++ b/lisp/mail/supercite.el @@ -618,10 +618,7 @@ the list should be unique." (lambda (elt) (char-to-string (cdr elt))) alist "/") ") ")) (p prompt) - (event - (if (fboundp 'allocate-event) - (allocate-event) - nil))) + event) (while (stringp p) (if (let ((cursor-in-echo-area t) (inhibit-quit t)) @@ -630,8 +627,6 @@ the list should be unique." (prog1 quit-flag (setq quit-flag nil))) (progn (message "%s%s" p (single-key-description event)) - (if (fboundp 'deallocate-event) - (deallocate-event event)) (setq quit-flag nil) (signal 'quit '()))) (let ((char event) @@ -650,8 +645,6 @@ the list should be unique." (discard-input) (if (eq p prompt) (setq p (concat "Try again. " prompt))))))) - (if (fboundp 'deallocate-event) - (deallocate-event event)) p)) (defun sc-scan-info-alist (alist) diff --git a/lisp/password-cache.el b/lisp/password-cache.el index 2443f374a8..375d06c74f 100644 --- a/lisp/password-cache.el +++ b/lisp/password-cache.el @@ -103,9 +103,7 @@ that a password is invalid, so that `password-read' query the user again." (let ((password (gethash key password-data))) (when (stringp password) - (if (fboundp 'clear-string) - (clear-string password) - (fillarray password ?_))) + (clear-string password)) (remhash key password-data))) (defun password-cache-add (key password) diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index efc51ec32c..155ab7ba4c 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el @@ -967,8 +967,6 @@ IDL has currently stepped.") (setq idlwave-shell-default-directory default-directory) (setq idlwave-shell-hide-output nil) - ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility - ;; (make-local-hook 'kill-buffer-hook) (add-hook 'kill-buffer-hook 'idlwave-shell-kill-shell-buffer-confirm nil 'local) (add-hook 'kill-buffer-hook 'idlwave-shell-delete-temp-files nil 'local) @@ -1007,8 +1005,6 @@ IDL has currently stepped.") (set (make-local-variable 'comment-start) ";") (setq abbrev-mode t) - ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility - ;; make-local-hook 'post-command-hook) (add-hook 'post-command-hook 'idlwave-command-hook nil t) ;; Read the command history? diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 5c1e82240c..6dd8853b1a 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -1920,15 +1920,10 @@ The main features of this mode are 'idlwave-forward-block nil)) ;; Make a local post-command-hook and add our hook to it - ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility - ;; (make-local-hook 'post-command-hook) (add-hook 'post-command-hook 'idlwave-command-hook nil 'local) ;; Make local hooks for buffer updates - ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility - ;; (make-local-hook 'kill-buffer-hook) (add-hook 'kill-buffer-hook 'idlwave-kill-buffer-update nil 'local) - ;; (make-local-hook 'after-save-hook) (add-hook 'after-save-hook 'idlwave-save-buffer-update nil 'local) (add-hook 'after-save-hook 'idlwave-revoke-license-to-kill nil 'local) diff --git a/test/lisp/cedet/semantic-utest.el b/test/lisp/cedet/semantic-utest.el index e537871528..bcbd7d686e 100644 --- a/test/lisp/cedet/semantic-utest.el +++ b/test/lisp/cedet/semantic-utest.el @@ -38,14 +38,9 @@ (defvar semantic-utest-test-directory (expand-file-name "tests" cedet-utest-directory) "Location of test files.") -(defvar semantic-utest-temp-directory (if (fboundp 'temp-directory) - (temp-directory) - temporary-file-directory) - "Temporary directory to use when creating files.") - (defun semantic-utest-fname (name) "Create a filename for NAME in /tmp." - (expand-file-name name semantic-utest-temp-directory)) + (expand-file-name name temporary-file-directory)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Data for C tests commit 3963aea4f4a22da0c1fb8ca8ca80b59c58373811 Author: Stefan Monnier Date: Thu Nov 19 13:10:20 2020 -0500 * src/buffer.h (struct buffer): Remove unused field `minor_modes` * src/buffer.c (bset_minor_modes): Remove function. (reset_buffer_local_variables, init_buffer_once): Don't set `minor_modes`. diff --git a/src/buffer.c b/src/buffer.c index 4fd2b0c8b1..360dd348e0 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -297,11 +297,6 @@ bset_mark (struct buffer *b, Lisp_Object val) b->mark_ = val; } static void -bset_minor_modes (struct buffer *b, Lisp_Object val) -{ - b->minor_modes_ = val; -} -static void bset_mode_line_format (struct buffer *b, Lisp_Object val) { b->mode_line_format_ = val; @@ -1004,7 +999,6 @@ reset_buffer_local_variables (struct buffer *b, bool permanent_too) bset_major_mode (b, Qfundamental_mode); bset_keymap (b, Qnil); bset_mode_name (b, QSFundamental); - bset_minor_modes (b, Qnil); /* If the standard case table has been altered and invalidated, fix up its insides first. */ @@ -5180,7 +5174,6 @@ init_buffer_once (void) bset_upcase_table (&buffer_local_flags, make_fixnum (0)); bset_case_canon_table (&buffer_local_flags, make_fixnum (0)); bset_case_eqv_table (&buffer_local_flags, make_fixnum (0)); - bset_minor_modes (&buffer_local_flags, make_fixnum (0)); bset_width_table (&buffer_local_flags, make_fixnum (0)); bset_pt_marker (&buffer_local_flags, make_fixnum (0)); bset_begv_marker (&buffer_local_flags, make_fixnum (0)); diff --git a/src/buffer.h b/src/buffer.h index 3da49414bb..fe549c5dac 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -419,9 +419,6 @@ struct buffer /* Non-nil means show ... at end of line followed by invisible lines. */ Lisp_Object selective_display_ellipses_; - /* Alist of (FUNCTION . STRING) for each minor mode enabled in buffer. */ - Lisp_Object minor_modes_; - /* t if "self-insertion" should overwrite; `binary' if it should also overwrite newlines and tabs - for editing executables and the like. */ Lisp_Object overwrite_mode_; commit 4fa1de82a28b04128fcb02b3dd1bfcca34efda4c Author: Michael Albinus Date: Thu Nov 19 17:18:36 2020 +0100 Use decoding implementation from `insert-directory' in Tramp * lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory): Use decoding implementation from `insert-directory', it is more robust. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index c4390b3d04..f9b218a970 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2658,8 +2658,7 @@ The method used must be an out-of-band method." #'file-name-nondirectory (list localname))))))) (save-restriction - (let ((beg (point)) - match) + (let ((beg (point))) (narrow-to-region (point) (point)) ;; We cannot use `insert-buffer-substring' because the Tramp ;; buffer changes its contents before insertion due to calling @@ -2692,30 +2691,44 @@ The method used must be an out-of-band method." ;; Some busyboxes are reluctant to discard colors. (unless (string-match-p "color" (tramp-get-connection-property v "ls" "")) - (goto-char beg) - (while - (re-search-forward tramp-display-escape-sequence-regexp nil t) - (replace-match ""))) - - ;; Decode the output, it could be multibyte. We must - ;; restore the text property, because `decode-coding-region' - ;; has destroyed it. However, text-property-search.el - ;; exists since Emacs 27 only. - (if (not (require 'text-property-search nil 'noerror)) - (decode-coding-region - beg (point-max) - (or file-name-coding-system default-file-name-coding-system)) - (goto-char beg) - (while (setq match - (tramp-compat-funcall - 'text-property-search-forward 'dired-filename t t)) - (decode-coding-region - (tramp-compat-funcall 'prop-match-beginning match) - (tramp-compat-funcall 'prop-match-end match) - (or file-name-coding-system default-file-name-coding-system)) - (put-text-property - (tramp-compat-funcall 'prop-match-beginning match) - (point) 'dired-filename t))) + (save-excursion + (goto-char beg) + (while + (re-search-forward tramp-display-escape-sequence-regexp nil t) + (replace-match "")))) + + ;; Now decode what read if necessary. Stolen from `insert-directory'. + (let ((coding (or coding-system-for-read + file-name-coding-system + default-file-name-coding-system + 'undecided)) + coding-no-eol + val pos) + (when (and enable-multibyte-characters + (not (memq (coding-system-base coding) + '(raw-text no-conversion)))) + ;; If no coding system is specified or detection is + ;; requested, detect the coding. + (if (eq (coding-system-base coding) 'undecided) + (setq coding (detect-coding-region beg (point) t))) + (if (not (eq (coding-system-base coding) 'undecided)) + (save-restriction + (setq coding-no-eol + (coding-system-change-eol-conversion coding 'unix)) + (narrow-to-region beg (point)) + (goto-char (point-min)) + (while (not (eobp)) + (setq pos (point) + val (get-text-property (point) 'dired-filename)) + (goto-char (next-single-property-change + (point) 'dired-filename nil (point-max))) + ;; Force no eol conversion on a file name, so + ;; that CR is preserved. + (decode-coding-region pos (point) + (if val coding-no-eol coding)) + (if val + (put-text-property pos (point) + 'dired-filename t))))))) ;; The inserted file could be from somewhere else. (when (and (not wildcard) (not full-directory-p)) commit 90aab73f8d6b5fd0a8adb706c8ae669564f23c56 Author: Mattias Engdegård Date: Thu Nov 19 14:24:24 2020 +0100 More string-search optimisations All-ASCII strings cannot have substrings with non-ASCII characters in them; use this fact to avoid searching entirely. * src/fns.c (Fstring_search): For multibyte non-ASCII needle and unibyte haystack, don't check if the haystack is all-ASCII; it's a waste of time. For multibyte non-ASCII needle and multibyte all-ASCII haystack, fail immediately. * test/src/fns-tests.el (string-search): Add more test cases. diff --git a/src/fns.c b/src/fns.c index f50bf8ecb7..e4c9acc316 100644 --- a/src/fns.c +++ b/src/fns.c @@ -5502,25 +5502,32 @@ Case is always significant and text properties are ignored. */) haybytes = SBYTES (haystack) - start_byte; /* We can do a direct byte-string search if both strings have the - same multibyteness, or if at least one of them consists of ASCII - characters only. */ + same multibyteness, or if the needle consists of ASCII characters only. */ if (STRING_MULTIBYTE (haystack) ? (STRING_MULTIBYTE (needle) || SCHARS (haystack) == SBYTES (haystack) || string_ascii_p (needle)) : (!STRING_MULTIBYTE (needle) - || SCHARS (needle) == SBYTES (needle) || string_ascii_p (haystack))) - res = memmem (haystart, haybytes, - SSDATA (needle), SBYTES (needle)); - else if (STRING_MULTIBYTE (haystack)) /* unibyte needle */ + || SCHARS (needle) == SBYTES (needle))) + { + if (STRING_MULTIBYTE (haystack) && STRING_MULTIBYTE (needle) + && SCHARS (haystack) == SBYTES (haystack) + && SCHARS (needle) != SBYTES (needle)) + /* Multibyte non-ASCII needle, multibyte ASCII haystack: impossible. */ + return Qnil; + else + res = memmem (haystart, haybytes, + SSDATA (needle), SBYTES (needle)); + } + else if (STRING_MULTIBYTE (haystack)) /* unibyte non-ASCII needle */ { Lisp_Object multi_needle = string_to_multibyte (needle); res = memmem (haystart, haybytes, SSDATA (multi_needle), SBYTES (multi_needle)); } - else /* unibyte haystack, multibyte needle */ + else /* unibyte haystack, multibyte non-ASCII needle */ { /* The only possible way we can find the multibyte needle in the - unibyte stack (since we know that neither are pure-ASCII) is + unibyte stack (since we know that the needle is non-ASCII) is if they contain "raw bytes" (and no other non-ASCII chars.) */ ptrdiff_t nbytes = SBYTES (needle); for (ptrdiff_t i = 0; i < nbytes; i++) diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index d3c22f966e..86b8d655d2 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el @@ -938,6 +938,13 @@ (should (equal (string-search "\303" "aøb") nil)) (should (equal (string-search "\270" "aøb") nil)) (should (equal (string-search "ø" "\303\270") nil)) + (should (equal (string-search "ø" (make-string 32 ?a)) nil)) + (should (equal (string-search "ø" (string-to-multibyte (make-string 32 ?a))) + nil)) + (should (equal (string-search "o" (string-to-multibyte + (apply #'string + (number-sequence ?a ?z)))) + 14)) (should (equal (string-search "a\U00010f98z" "a\U00010f98a\U00010f98z") 2)) commit 74a35d16e25bdb07d847b980008fc4d25ab9404e Author: Alan Mackenzie Date: Thu Nov 19 13:24:28 2020 +0000 * etc/NEWS: Restore entries accidentally removed by previous commit. diff --git a/etc/NEWS b/etc/NEWS index ee9f484be3..a0e72bc673 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -203,6 +203,12 @@ This command would previously not redefine values defined by these forms, but this command has now been changed to work more like 'eval-defun', and reset the values as specified. +--- +** New user options 'copy-region-blink-delay' and 'delete-pair-blink-delay'. +'copy-region-blink-delay' specifies a delay to indicate the region +copied by 'kill-ring-save'. 'delete-pair-blink-delay' specifies +a delay to show a paired character to delete. + +++ ** New command 'undo-redo'. It undoes previous undo commands, but doesn't record itself as an @@ -435,6 +441,11 @@ their 'default-directory' under VC. *** New command 'vc-dir-root' uses the root directory without asking. +--- +*** New face 'log-view-commit-body'. +This is used when expanding commit messages from 'vc-print-root-log' +and similar commands. + --- *** The responsible VC backend is now the most specific one. 'vc-responsible-backend' loops over the backends in @@ -658,6 +669,13 @@ to the search string. --- *** New input method 'compose' based on X Multi_key sequences. +--- +*** New input method 'iso-transl' with the same keys as 'C-x 8'. +After selecting it as a transient input method with 'C-u C-x \ +iso-transl RET', it supports the same key sequences as 'C-x 8', +so e.g. like 'C-x 8 [' inserts a left single quotation mark, +'C-x \ [' does the same. + --- *** Improved language transliteration in Malayalam input methods. Added a new Mozhi scheme. The inapplicable ITRANS scheme is now @@ -1124,6 +1142,13 @@ project's root directory, respectively. +++ *** New user option 'project-list-file'. +** xref + +--- +*** Prefix arg of 'xref-goto-xref' quits the *xref* buffer. +So typing 'C-u RET' in the *xref* buffer quits its window +before navigating to the selected location. + ** json.el --- @@ -1240,6 +1265,11 @@ and the result is not truncated in any way. *** The '/' operator now has higher precedence in (La)TeX input mode. It no longer has lower precedence than '+' and '-'. +--- +*** Calc now marks its windows dedicated. +The new user option 'calc-make-windows-dedicated' controls this. It +is t by default; set to nil to get back the old behavior. + ** term-mode --- @@ -1316,6 +1346,11 @@ visited errors, so you can have an overview what errors were already visited. If 'tab-always-indent' is 'complete', this new user option can be used to further tweak whether to complete or indent. +--- +*** 'dired-query' now uses 'read-char-from-minibuffer'. +Using it instead of 'read-char-choice' allows using 'C-x o' +to switch to the help window displayed after typing 'C-h'. + --- *** 'zap-up-to-char' now uses 'read-char-from-minibuffer'. This allows navigating through the history of characters that have @@ -1969,6 +2004,11 @@ image API via 'M-x report-emacs-bug'. --- ** The user option 'make-pointer-invisible' is now honored on macOS. +-- +** On macOS, 's-' and 's-' are now bound to +'move-beginning-of-line' and 'move-end-of-line' respectively. The commands +to select previous/next frame are still bound to 's-~' and 's-`'. + ---------------------------------------------------------------------- This file is part of GNU Emacs. commit 6e469709c550ba18d9d5a34f6bb89908472f0eb2 Author: Alan Mackenzie Date: Thu Nov 19 10:31:50 2020 +0000 In attempted recursive minibuffer use, display error message in correct frame This was problematic when minibuffer-follows-selected-frame was non-nil. Introduce a new parameter DONT-SET-FRAME to set-window-configuration. * doc/lispref/windows.texi (Window Configurations): Describe the new &optional parameter to set-window-configuration. * etc/NEWS (Lisp Changes): Note the new parameter to set-window-configuration. * src/keyboard.c (read_char_help_form_unwind): Add a new Qnil argument to the call of Fset_window_configuration. * src/minibuf.c (read_minibuf): Cons up a Qt with the window configuration in the argument to record_unwind_protect for the window configuration (twice). * src/window.c (Fset_window_configuration): Add the new &optional parameter and document it in the doc string. At the final do_switch_frame operation, restore the original frame when DONT-SET-FRAME is non-nil. (restore_window_configuration): Handle the new parameter when the supplied argument is a cons. diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 5ec23a9c87..2d092e1842 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -5869,13 +5869,16 @@ which window parameters (if any) are saved by this function. @xref{Window Parameters}. @end defun -@defun set-window-configuration configuration +@defun set-window-configuration configuration &optional dont-set-frame This function restores the configuration of windows and buffers as specified by @var{configuration}, for the frame that @var{configuration} was created for, regardless of whether that frame is selected or not. The argument @var{configuration} must be a value that was previously returned by @code{current-window-configuration} -for that frame. +for that frame. Normally the function also selects the frame which is +recorded in the configuration, but if @var{dont-set-frame} is +non-@code{nil}, it leaves selected the frame which was current at the +start of the function. If the frame from which @var{configuration} was saved is dead, all this function does is to restore the value of the variable diff --git a/etc/NEWS b/etc/NEWS index 9f39851b4a..ee9f484be3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -203,12 +203,6 @@ This command would previously not redefine values defined by these forms, but this command has now been changed to work more like 'eval-defun', and reset the values as specified. ---- -** New user options 'copy-region-blink-delay' and 'delete-pair-blink-delay'. -'copy-region-blink-delay' specifies a delay to indicate the region -copied by 'kill-ring-save'. 'delete-pair-blink-delay' specifies -a delay to show a paired character to delete. - +++ ** New command 'undo-redo'. It undoes previous undo commands, but doesn't record itself as an @@ -441,11 +435,6 @@ their 'default-directory' under VC. *** New command 'vc-dir-root' uses the root directory without asking. ---- -*** New face 'log-view-commit-body'. -This is used when expanding commit messages from 'vc-print-root-log' -and similar commands. - --- *** The responsible VC backend is now the most specific one. 'vc-responsible-backend' loops over the backends in @@ -669,13 +658,6 @@ to the search string. --- *** New input method 'compose' based on X Multi_key sequences. ---- -*** New input method 'iso-transl' with the same keys as 'C-x 8'. -After selecting it as a transient input method with 'C-u C-x \ -iso-transl RET', it supports the same key sequences as 'C-x 8', -so e.g. like 'C-x 8 [' inserts a left single quotation mark, -'C-x \ [' does the same. - --- *** Improved language transliteration in Malayalam input methods. Added a new Mozhi scheme. The inapplicable ITRANS scheme is now @@ -1142,13 +1124,6 @@ project's root directory, respectively. +++ *** New user option 'project-list-file'. -** xref - ---- -*** Prefix arg of 'xref-goto-xref' quits the *xref* buffer. -So typing 'C-u RET' in the *xref* buffer quits its window -before navigating to the selected location. - ** json.el --- @@ -1265,11 +1240,6 @@ and the result is not truncated in any way. *** The '/' operator now has higher precedence in (La)TeX input mode. It no longer has lower precedence than '+' and '-'. ---- -*** Calc now marks its windows dedicated. -The new user option 'calc-make-windows-dedicated' controls this. It -is t by default; set to nil to get back the old behavior. - ** term-mode --- @@ -1346,11 +1316,6 @@ visited errors, so you can have an overview what errors were already visited. If 'tab-always-indent' is 'complete', this new user option can be used to further tweak whether to complete or indent. ---- -*** 'dired-query' now uses 'read-char-from-minibuffer'. -Using it instead of 'read-char-choice' allows using 'C-x o' -to switch to the help window displayed after typing 'C-h'. - --- *** 'zap-up-to-char' now uses 'read-char-from-minibuffer'. This allows navigating through the history of characters that have @@ -1758,6 +1723,11 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el. * Lisp Changes in Emacs 28.1 ++++ +** 'set-window-configuration' now takes an optional 'dont-set-frame' +parameter which, when non-nil, instructs the function not to select +the frame recorded in the configuration. + +++ ** 'define-globalized-minor-mode' now takes a ':predicate' parameter. This can be used to control which major modes the minor mode should be @@ -1999,11 +1969,6 @@ image API via 'M-x report-emacs-bug'. --- ** The user option 'make-pointer-invisible' is now honored on macOS. --- -** On macOS, 's-' and 's-' are now bound to -'move-beginning-of-line' and 'move-end-of-line' respectively. The commands -to select previous/next frame are still bound to 's-~' and 's-`'. - ---------------------------------------------------------------------- This file is part of GNU Emacs. diff --git a/src/keyboard.c b/src/keyboard.c index 49a0a8bd23..1579c007ec 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2122,7 +2122,7 @@ read_char_help_form_unwind (void) Lisp_Object window_config = XCAR (help_form_saved_window_configs); help_form_saved_window_configs = XCDR (help_form_saved_window_configs); if (!NILP (window_config)) - Fset_window_configuration (window_config); + Fset_window_configuration (window_config, Qnil); } #define STOP_POLLING \ diff --git a/src/minibuf.c b/src/minibuf.c index c4adca1536..464e3018f7 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -501,14 +501,15 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, record_unwind_protect_void (choose_minibuf_frame); record_unwind_protect (restore_window_configuration, - Fcurrent_window_configuration (Qnil)); + Fcons (Qt, Fcurrent_window_configuration (Qnil))); /* If the minibuffer window is on a different frame, save that frame's configuration too. */ mini_frame = WINDOW_FRAME (XWINDOW (minibuf_window)); if (!EQ (mini_frame, selected_frame)) record_unwind_protect (restore_window_configuration, - Fcurrent_window_configuration (mini_frame)); + Fcons (Qt, + Fcurrent_window_configuration (mini_frame))); /* If the minibuffer is on an iconified or invisible frame, make it visible now. */ diff --git a/src/window.c b/src/window.c index a6de34f3db..6cd3122b43 100644 --- a/src/window.c +++ b/src/window.c @@ -6824,19 +6824,25 @@ DEFUN ("window-configuration-frame", Fwindow_configuration_frame, Swindow_config } DEFUN ("set-window-configuration", Fset_window_configuration, - Sset_window_configuration, 1, 1, 0, + Sset_window_configuration, 1, 2, 0, doc: /* Set the configuration of windows and buffers as specified by CONFIGURATION. CONFIGURATION must be a value previously returned by `current-window-configuration' (which see). + +Normally, this function selects the frame of the CONFIGURATION, but if +DONT-SET-FRAME is non-nil, it leaves selected the frame which was +current at the start of the function. + If CONFIGURATION was made from a frame that is now deleted, only frame-independent values can be restored. In this case, the return value is nil. Otherwise the value is t. */) - (Lisp_Object configuration) + (Lisp_Object configuration, Lisp_Object dont_set_frame) { register struct save_window_data *data; struct Lisp_Vector *saved_windows; Lisp_Object new_current_buffer; Lisp_Object frame; + Lisp_Object old_frame = selected_frame; struct frame *f; ptrdiff_t old_point = -1; USE_SAFE_ALLOCA; @@ -7153,7 +7159,10 @@ the return value is nil. Otherwise the value is t. */) select_window above totally superfluous; it still sets f's selected window. */ if (FRAME_LIVE_P (XFRAME (data->selected_frame))) - do_switch_frame (data->selected_frame, 0, 0, Qnil); + do_switch_frame (NILP (dont_set_frame) + ? data->selected_frame + : old_frame + , 0, 0, Qnil); } FRAME_WINDOW_CHANGE (f) = true; @@ -7187,11 +7196,13 @@ the return value is nil. Otherwise the value is t. */) return FRAME_LIVE_P (f) ? Qt : Qnil; } - void restore_window_configuration (Lisp_Object configuration) { - Fset_window_configuration (configuration); + if (CONSP (configuration)) + Fset_window_configuration (XCDR (configuration), XCAR (configuration)); + else + Fset_window_configuration (configuration, Qnil); } commit cb2e34b49332cf2664de6fc4a8a79da5965298ed Author: Stefan Kangas Date: Thu Nov 19 06:34:11 2020 +0100 Remove outdated comment about Emacs 20 from viper.el * lisp/emulation/viper-util.el (viper-chars-in-region): Remove outdated comment. diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index 83e45e1cd0..9da493d74b 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el @@ -249,15 +249,7 @@ Otherwise return the normal value." (goto-char cur-pos) result)) -;; Emacs used to count each multibyte character as several positions in the buffer, -;; so we had to use Emacs's chars-in-region to count characters. Since 20.3, -;; Emacs counts multibyte characters as 1 position. XEmacs has always been -;; counting each char as just one pos. So, now we can simply subtract beg from -;; end to determine the number of characters in a region. (defun viper-chars-in-region (beg end &optional preserve-sign) - ;;(let ((count (abs (if (fboundp 'chars-in-region) - ;; (chars-in-region beg end) - ;; (- end beg))))) (let ((count (abs (- end beg)))) (if (and (< end beg) preserve-sign) (- count) commit b6d2ea05cc886298f68e47de009fcdf1a5140c59 Author: Stefan Kangas Date: Thu Nov 19 06:12:25 2020 +0100 Add new variable cperl-tags-file-name * lisp/progmodes/cperl-mode.el (cperl-tags-file-name): New variable. (cperl-write-tags): Use above new variable instead of hardcoding filename "TAGS". (Bug#8802) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index b7dc59bed9..30a80ea8f2 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -6602,6 +6602,9 @@ Use as " (cperl-write-tags nil nil t t)) +(defvar cperl-tags-file-name "TAGS" + "TAGS file name to use in `cperl-write-tags'.") + (defun cperl-write-tags (&optional file erase recurse dir inbuffer noxs topdir) ;; If INBUFFER, do not select buffer, and do not save ;; If ERASE is `ignore', do not erase, and do not try to delete old info. @@ -6611,7 +6614,7 @@ Use as (if (and (not dir) (buffer-modified-p)) (error "Save buffer first!"))) (or topdir (setq topdir default-directory)) - (let ((tags-file-name "TAGS") + (let ((tags-file-name cperl-tags-file-name) (inhibit-read-only t) (case-fold-search nil) xs rel) commit 4ee6fa279954f5b03d4e2ed935de8e14b7e8b6c9 Author: Stefan Kangas Date: Thu Nov 19 03:14:19 2020 +0100 Declare XEmacs compat function in inversion.el obsolete * lisp/cedet/inversion.el (inversion-require-emacs): Declare obsolete. diff --git a/lisp/cedet/inversion.el b/lisp/cedet/inversion.el index d47701d5a8..113f4056e2 100644 --- a/lisp/cedet/inversion.el +++ b/lisp/cedet/inversion.el @@ -349,7 +349,11 @@ Optional argument RESERVED is saved for later use." ;;;###autoload (defun inversion-require-emacs (emacs-ver xemacs-ver sxemacs-ver) "Declare that you need either EMACS-VER, XEMACS-VER or SXEMACS-ver. -Only checks one based on which kind of Emacs is being run." +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) ...)" + (declare (obsolete nil "28.1")) (let ((err (inversion-test 'emacs (cond ((featurep 'sxemacs) sxemacs-ver) commit 51b9acbeccf2c62be02d1312d665ea4233d60922 Author: Stefan Kangas Date: Thu Nov 19 02:56:34 2020 +0100 Assume font-lock is provided; it's preloaded since 22.1 * lisp/cedet/semantic/format.el (semantic--format-colorize-text): * lisp/eshell/em-ls.el (eshell-ls--insert-directory): * lisp/net/dig.el (dig-mode): * lisp/progmodes/cperl-mode.el (cperl-pod-here-fontify): * lisp/progmodes/idlw-help.el (idlwave-help-fontify): * lisp/progmodes/idlwave.el (idlwave-completion-fontify-classes): Don't check for feature 'font-lock; it has been preloaded since 22.1. * lisp/cedet/semantic/format.el (font-lock): * lisp/epa.el (font-lock): * lisp/erc/erc.el (font-lock): * lisp/generic-x.el (font-lock): * lisp/net/sieve-mode.el (font-lock): * lisp/progmodes/prolog.el (font-lock): * lisp/textmodes/rst.el (font-lock): Remove unnecessary require. diff --git a/lisp/cedet/semantic/format.el b/lisp/cedet/semantic/format.el index bb2954be56..e972015c6b 100644 --- a/lisp/cedet/semantic/format.el +++ b/lisp/cedet/semantic/format.el @@ -32,7 +32,6 @@ ;; ;;; Code: -(eval-when-compile (require 'font-lock)) (require 'semantic) (require 'semantic/tag-ls) (require 'ezimage) @@ -119,12 +118,10 @@ be used unless font lock is a feature.") "Apply onto TEXT a color associated with FACE-CLASS. FACE-CLASS is a tag type found in `semantic-format-face-alist'. See that variable for details on adding new types." - (if (featurep 'font-lock) - (let ((face (cdr-safe (assoc face-class semantic-format-face-alist))) - (newtext (concat text))) - (put-text-property 0 (length text) 'face face newtext) - newtext) - text)) + (let ((face (cdr-safe (assoc face-class semantic-format-face-alist))) + (newtext (concat text))) + (put-text-property 0 (length text) 'face face newtext) + newtext)) (defun semantic--format-colorize-merge-text (precoloredtext face-class) "Apply onto PRECOLOREDTEXT a color associated with FACE-CLASS. diff --git a/lisp/epa.el b/lisp/epa.el index 25e055c201..4e288283d1 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -24,7 +24,6 @@ ;;; Dependencies (require 'epg) -(require 'font-lock) (eval-when-compile (require 'subr-x)) (require 'derived) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index e35ae0cfd8..bf7b16d448 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -58,7 +58,6 @@ (load "erc-loaddefs" nil t) (require 'cl-lib) -(require 'font-lock) (require 'format-spec) (require 'pp) (require 'thingatpt) diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el index e10be8e623..6b306f7787 100644 --- a/lisp/eshell/em-ls.el +++ b/lisp/eshell/em-ls.el @@ -270,8 +270,7 @@ instead." eshell-current-subjob-p font-lock-mode) ;; use the fancy highlighting in `eshell-ls' rather than font-lock - (when (and eshell-ls-use-colors - (featurep 'font-lock)) + (when eshell-ls-use-colors (font-lock-mode -1) (setq font-lock-defaults nil) (if (boundp 'font-lock-buffers) diff --git a/lisp/generic-x.el b/lisp/generic-x.el index b56b63132d..5875dce5f0 100644 --- a/lisp/generic-x.el +++ b/lisp/generic-x.el @@ -107,8 +107,6 @@ ;;; Code: -(eval-when-compile (require 'font-lock)) - (defgroup generic-x nil "A collection of generic modes." :prefix "generic-" diff --git a/lisp/net/dig.el b/lisp/net/dig.el index f36999119f..da4ea4050d 100644 --- a/lisp/net/dig.el +++ b/lisp/net/dig.el @@ -127,10 +127,8 @@ Buffer should contain output generated by `dig-invoke'." "Major mode for displaying dig output." (buffer-disable-undo) (setq-local font-lock-defaults '(dig-font-lock-keywords t)) - (when (featurep 'font-lock) - ;; FIXME: what is this for?? --Stef - (font-lock-set-defaults)) - ) + ;; FIXME: what is this for?? --Stef M + (font-lock-set-defaults)) (defun dig-exit () "Quit dig output buffer." diff --git a/lisp/net/sieve-mode.el b/lisp/net/sieve-mode.el index c5f4491791..05e9747e74 100644 --- a/lisp/net/sieve-mode.el +++ b/lisp/net/sieve-mode.el @@ -43,8 +43,6 @@ (autoload 'sieve-manage "sieve") (autoload 'sieve-upload "sieve") -(eval-when-compile - (require 'font-lock)) (defgroup sieve nil "Sieve." diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 3f24b10828..b7dc59bed9 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -400,7 +400,7 @@ Font for POD headers." :version "21.1" :group 'cperl-faces) -(defcustom cperl-pod-here-fontify '(featurep 'font-lock) +(defcustom cperl-pod-here-fontify t "Not-nil after evaluation means to highlight POD and here-docs sections." :type 'boolean :group 'cperl-faces) diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el index 2d4ea465c4..89296ff5b5 100644 --- a/lisp/progmodes/idlw-help.el +++ b/lisp/progmodes/idlw-help.el @@ -1173,17 +1173,16 @@ When DING is non-nil, ring the bell as well." Useful when source code is displayed as help. See the option `idlwave-help-fontify-source-code'." (interactive) - (if (featurep 'font-lock) - (let ((major-mode 'idlwave-mode) - (font-lock-verbose - (if (called-interactively-p 'interactive) font-lock-verbose nil))) - (with-syntax-table idlwave-mode-syntax-table - (set (make-local-variable 'font-lock-defaults) - idlwave-font-lock-defaults) - (if (fboundp 'font-lock-ensure) ; Emacs >= 25.1 - (font-lock-ensure) - ;; Silence "interactive use only" warning on Emacs >= 25.1. - (with-no-warnings (font-lock-fontify-buffer))))))) + (let ((major-mode 'idlwave-mode) + (font-lock-verbose + (if (called-interactively-p 'interactive) font-lock-verbose nil))) + (with-syntax-table idlwave-mode-syntax-table + (set (make-local-variable 'font-lock-defaults) + idlwave-font-lock-defaults) + (if (fboundp 'font-lock-ensure) ; Emacs >= 25.1 + (font-lock-ensure) + ;; Silence "interactive use only" warning on Emacs >= 25.1. + (with-no-warnings (font-lock-fontify-buffer)))))) (defun idlwave-help-error (name type class keyword) diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 1cb54d6324..5c1e82240c 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -7642,14 +7642,13 @@ associated TAG, if any." (defun idlwave-completion-fontify-classes () "Goto the *Completions* buffer and fontify the class info." - (when (featurep 'font-lock) - (with-current-buffer "*Completions*" - (save-excursion - (goto-char (point-min)) - (let ((buffer-read-only nil)) - (while (re-search-forward "\\.*<[^>]+>" nil t) - (put-text-property (match-beginning 0) (match-end 0) - 'face 'font-lock-string-face))))))) + (with-current-buffer "*Completions*" + (save-excursion + (goto-char (point-min)) + (let ((buffer-read-only nil)) + (while (re-search-forward "\\.*<[^>]+>" nil t) + (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))) diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index 124f652ed6..75e95d9b90 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -261,7 +261,6 @@ (require 'comint) (eval-when-compile - (require 'font-lock) ;; We need imenu everywhere because of the predicate index! (require 'imenu) ;) @@ -1883,8 +1882,6 @@ Argument BOUND is a buffer position limiting searching." ;; Set everything up (defun prolog-font-lock-keywords () "Set up font lock keywords for the current Prolog system." - ;;(when window-system - (require 'font-lock) ;; Define Prolog faces (defface prolog-redo-face diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index adda28cb81..7a7ac478b7 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -3578,8 +3578,6 @@ Region is from BEG to END. With WITH-EMPTY prefix empty lines too." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Font lock -(require 'font-lock) - ;; FIXME: The obsolete variables need to disappear. ;; The following versions have been done inside Emacs and should not be commit 7cda88250fb1ab370e12ad4e4db84a17559c6c91 Author: Stefan Kangas Date: Thu Nov 19 02:54:26 2020 +0100 * lisp/progmodes/cperl-mode.el: Doc fix. diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 3606f9a395..3f24b10828 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -54,8 +54,6 @@ ;; of other details. ;; The mode information (on C-h m) provides some customization help. -;; If you use font-lock feature of this mode, it is advisable to use -;; either lazy-lock-mode or fast-lock-mode. I prefer lazy-lock. ;; Faces used now: three faces for first-class and second-class keywords ;; and control flow words, one for each: comments, string, labels, commit 0e075c9f913d6235637e080f71f59a26c5be6b7b Author: Stefan Kangas Date: Thu Nov 19 02:39:09 2020 +0100 Remove unnecessary load from idlwave * lisp/progmodes/idlw-shell.el: * lisp/progmodes/idlwave.el: Remove unnecessary load; easy-menu-define is autoloaded. diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index 38127fccbc..efc51ec32c 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el @@ -4352,21 +4352,19 @@ Shell debugging commands are available as single key sequences." ["Toggle Toolbar" idlwave-shell-toggle-toolbar t] ["Exit IDL" idlwave-shell-quit t])) -(if (or (featurep 'easymenu) (load "easymenu" t)) - (progn - (easy-menu-define - idlwave-mode-debug-menu idlwave-mode-map "IDL debugging menus" - idlwave-shell-menu-def) - (easy-menu-define - idlwave-shell-mode-menu idlwave-shell-mode-map "IDL shell menus" - idlwave-shell-menu-def) - (save-current-buffer - (dolist (buf (buffer-list)) - (set-buffer buf) - (if (derived-mode-p 'idlwave-mode) - (progn - (easy-menu-remove idlwave-mode-debug-menu) - (easy-menu-add idlwave-mode-debug-menu))))))) +(easy-menu-define + idlwave-mode-debug-menu idlwave-mode-map "IDL debugging menus" + idlwave-shell-menu-def) +(easy-menu-define + idlwave-shell-mode-menu idlwave-shell-mode-map "IDL shell menus" + idlwave-shell-menu-def) +(save-current-buffer + (dolist (buf (buffer-list)) + (set-buffer buf) + (if (derived-mode-p 'idlwave-mode) + (progn + (easy-menu-remove idlwave-mode-debug-menu) + (easy-menu-add idlwave-mode-debug-menu))))) ;; The Breakpoint Glyph ------------------------------------------------------- diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 86f9f33672..1cb54d6324 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -9032,14 +9032,12 @@ Assumes that point is at the beginning of the unit as found by (and (boundp 'idlwave-shell-automatic-start) idlwave-shell-automatic-start)])) -(if (or (featurep 'easymenu) (load "easymenu" t)) - (progn - (easy-menu-define idlwave-mode-menu idlwave-mode-map - "IDL and WAVE CL editing menu" - idlwave-mode-menu-def) - (easy-menu-define idlwave-mode-debug-menu idlwave-mode-map - "IDL and WAVE CL editing menu" - idlwave-mode-debug-menu-def))) +(easy-menu-define idlwave-mode-menu idlwave-mode-map + "IDL and WAVE CL editing menu" + idlwave-mode-menu-def) +(easy-menu-define idlwave-mode-debug-menu idlwave-mode-map + "IDL and WAVE CL editing menu" + idlwave-mode-debug-menu-def) (defun idlwave-customize () "Call the customize function with `idlwave' as argument." commit b5f3a04f47a7542a39b18bf6026cbb7f01cab5dd Author: Stefan Kangas Date: Thu Nov 19 01:44:25 2020 +0100 Make compat alias add-submenu obsolete * lisp/emacs-lisp/easymenu.el (add-submenu): Make compat alias obsolete. * lisp/filesets.el (filesets-build-menu-now): Don't use above obsolete alias. (filesets-menu-path, filesets-menu-before) (filesets-menu-in-menu): Doc fix. diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index 73dabef3fa..b0198dbf8d 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el @@ -514,6 +514,7 @@ completely and menu filter functions can be expected to work. If BEFORE is non-nil, add before the item named BEFORE. If IN-MENU is non-nil, follow MENU-PATH in IN-MENU. This is a compatibility function; use `easy-menu-add-item'." + (declare (obsolete easy-menu-add-item "28.1")) (easy-menu-add-item (or in-menu (current-global-map)) (cons "menu-bar" menu-path) submenu before)) diff --git a/lisp/filesets.el b/lisp/filesets.el index 2cad2023b8..dc81366147 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -308,7 +308,7 @@ SYM to VAL and return t. If INIT-FLAG is non-nil, set with (defcustom filesets-menu-path '("File") ; cf recentf-menu-path "The menu under which the filesets menu should be inserted. -See `add-submenu' for documentation." +See `easy-menu-add-item' for documentation." :set (function filesets-set-default) :type '(choice (const :tag "Top Level" nil) (sexp :tag "Menu Path")) @@ -317,7 +317,7 @@ See `add-submenu' for documentation." (defcustom filesets-menu-before "Open File..." ; cf recentf-menu-before "The name of a menu before which this menu should be added. -See `add-submenu' for documentation." +See `easy-menu-add-item' for documentation." :set (function filesets-set-default) :type '(choice (string :tag "Name") (const :tag "Last" nil)) @@ -326,7 +326,7 @@ See `add-submenu' for documentation." (defcustom filesets-menu-in-menu nil "Use that instead of `current-menubar' as the menu to change. -See `add-submenu' for documentation." +See `easy-menu-add-item' for documentation." :set (function filesets-set-default) :type 'sexp :group 'filesets) @@ -2349,21 +2349,20 @@ bottom up, set `filesets-submenus' to nil, first.)" (filesets-menu-cache-file-save-maybe))) (let ((cb (current-buffer))) (when (not (member cb filesets-updated-buffers)) - (add-submenu - filesets-menu-path - `(,filesets-menu-name - ("# Filesets" - ["Edit Filesets" filesets-edit] - ["Save Filesets" filesets-save-config] - ["Save Menu Cache" filesets-menu-cache-file-save] - ["Rebuild Menu" filesets-build-menu] - ["Customize" filesets-customize] - ["About" filesets-info]) - ,(filesets-get-cmd-menu) - "---" - ,@filesets-menu-cache) - filesets-menu-before - filesets-menu-in-menu) + (easy-menu-add-item (or filesets-menu-in-menu (current-global-map)) + (cons "menu-bar" filesets-menu-path) + `(,filesets-menu-name + ("# Filesets" + ["Edit Filesets" filesets-edit] + ["Save Filesets" filesets-save-config] + ["Save Menu Cache" filesets-menu-cache-file-save] + ["Rebuild Menu" filesets-build-menu] + ["Customize" filesets-customize] + ["About" filesets-info]) + ,(filesets-get-cmd-menu) + "---" + ,@filesets-menu-cache) + filesets-menu-before) (setq filesets-updated-buffers (cons cb filesets-updated-buffers)) ;; This wipes out other messages in the echo area. commit ca8e37eaf64f23675fab36eadead4d3b613b8a1b Author: Alan Third Date: Sun Nov 15 17:21:03 2020 +0000 Fix SVG display again (bug#44655) * src/image.c (svg_load_image): Fall back to rsvg_handle_get_dimensions if we can't calculate the size of the image. diff --git a/src/image.c b/src/image.c index 3858f3c41f..fdb7ef874d 100644 --- a/src/image.c +++ b/src/image.c @@ -9903,30 +9903,21 @@ svg_load_image (struct frame *f, struct image *img, char *contents, viewbox_width = viewbox.x + viewbox.width; viewbox_height = viewbox.y + viewbox.height; } -#else - /* The function used above to get the geometry of the visible area - of the SVG are only available in librsvg 2.46 and above, so in - certain circumstances this code path can result in some parts of - the SVG being cropped. */ - RsvgDimensionData dimension_data; - - rsvg_handle_get_dimensions (rsvg_handle, &dimension_data); - viewbox_width = dimension_data.width; - viewbox_height = dimension_data.height; + if (viewbox_width == 0 || viewbox_height == 0) #endif + { + /* The functions used above to get the geometry of the visible + area of the SVG are only available in librsvg 2.46 and above, + so in certain circumstances this code path can result in some + parts of the SVG being cropped. */ + RsvgDimensionData dimension_data; - if (viewbox_width == 0 || viewbox_height == 0) - { - /* We do not have any usable dimensions, so make some up. The - values below are supposedly the default values most web - browsers use for SVGs with no set size. */ - /* FIXME: At this stage we should perhaps consider rendering the - image out to a bitmap and getting the dimensions from - that. */ - viewbox_width = 300; - viewbox_height = 150; - } + rsvg_handle_get_dimensions (rsvg_handle, &dimension_data); + + viewbox_width = dimension_data.width; + viewbox_height = dimension_data.height; + } compute_image_size (viewbox_width, viewbox_height, img->spec, &width, &height); commit de7d9e1f88da08abf3883d585a69d52fbdd61963 Author: Protesilaos Stavrou Date: Wed Nov 18 23:14:39 2020 +0200 Clarify that 'diff-error' is part of Emacs 28.1 * lisp/vc/diff-mode.el (diff-error): Add :version tag (bug#44727). diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 5aeb8feb99..0a90613604 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -403,7 +403,8 @@ well." '((((class color)) :foreground "red" :background "black" :weight bold) (t :weight bold)) - "`diff-mode' face for error messages from diff.") + "`diff-mode' face for error messages from diff." + :version "28.1") (defconst diff-yank-handler '(diff-yank-function)) (defun diff-yank-function (text) commit 9d02e6c5ff2a8af78ca8a2c934970f8a46dcef55 Author: Lars Ingebrigtsen Date: Wed Sep 30 20:29:16 2020 +0200 Further doc fixes for dotimes about RESULT * lisp/subr.el (dotimes): Be even more explicit about RESULT (bug#16206). (cherry picked from commit 5b0d8d0f288fd505ca90bd30df709a5e7ab540d6) diff --git a/lisp/subr.el b/lisp/subr.el index fcbd06a449..d5cf7fb003 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -280,8 +280,11 @@ Then evaluate RESULT to get return value, default nil. (defmacro dotimes (spec &rest body) "Loop a certain number of times. Evaluate BODY with VAR bound to successive integers running from 0, -inclusive, to COUNT, exclusive. Then evaluate RESULT to get -the return value (nil if RESULT is omitted). Its use is deprecated. +inclusive, to COUNT, exclusive. + +Finally RESULT is evaluated to get the return value (nil if +RESULT is omitted). Using RESULT is deprecated, and may result +in compilation warnings about unused variables. \(fn (VAR COUNT [RESULT]) BODY...)" (declare (indent 1) (debug dolist)) commit d5ac6679df4925ef51cc0f299af2a84f27faafe7 Author: Mattias Engdegård Date: Wed Nov 18 10:55:41 2020 +0100 Turn gdb-wait-for-pending into a plain function This avoids unnecessary body duplication in expansion and macro recursion (causing macro-expansions at runtime), making it clearer what is going on. * lisp/progmodes/gdb-mi.el (gdb-wait-for-pending): Make it a function, remove lambda quoting, η-reduce and simplify. (gdb-thread-exited, gdb-thread-selected): Adapt callers. diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 0023e1fb5d..903005610d 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -373,19 +373,17 @@ were not yet received." (dolist (handler gdb-handler-list) (setf (gdb-handler-pending-trigger handler) nil))) -(defmacro gdb-wait-for-pending (&rest body) - "Wait for all pending GDB commands to finish and evaluate BODY. +(defun gdb-wait-for-pending (func) + "Wait for all pending GDB commands to finish and call FUNC. This function checks every 0.5 seconds if there are any pending triggers in `gdb-handler-list'." - `(run-with-timer - 0.5 nil - '(lambda () - (if (not (cl-find-if (lambda (handler) - (gdb-handler-pending-trigger handler)) - gdb-handler-list)) - (progn ,@body) - (gdb-wait-for-pending ,@body))))) + (run-with-timer + 0.5 nil + (lambda () + (if (cl-some #'gdb-handler-pending-trigger gdb-handler-list) + (gdb-wait-for-pending func) + (funcall func))))) ;; Publish-subscribe @@ -2524,7 +2522,7 @@ Unset `gdb-thread-number' if current thread exited and update threads list." ;; disallow us to properly call -thread-info without --thread option. ;; Thus we need to use gdb-wait-for-pending. (gdb-wait-for-pending - (gdb-emit-signal gdb-buf-publisher 'update-threads)))) + (lambda () (gdb-emit-signal gdb-buf-publisher 'update-threads))))) (defun gdb-thread-selected (_token output-field) "Handler for =thread-selected MI output record. @@ -2538,11 +2536,10 @@ Sets `gdb-thread-number' to new id." ;; as usually. Things happen too fast and second call (from ;; gdb-thread-selected handler) gets cut off by our beloved ;; pending triggers. - ;; Solution is `gdb-wait-for-pending' macro: it guarantees that its - ;; body will get executed when `gdb-handler-list' if free of + ;; Solution is `gdb-wait-for-pending': it guarantees that its + ;; argument will get called when `gdb-handler-list' if free of ;; pending triggers. - (gdb-wait-for-pending - (gdb-update)))) + (gdb-wait-for-pending #'gdb-update))) (defun gdb-running (_token output-field) (let* ((thread-id commit 88d5b1d3253728bd314de36544996aa15345bd29 Author: Basil L. Contovounesios Date: Wed Nov 18 11:47:54 2020 +0000 Don't make bibtex-unify-case-convert buffer-local The :local tag does not currently work as intended (it results in a default value of bibtex-unify-case-convert of nil rather than identity), and no other bibtex.el user option is automatically buffer-local, so revert this recent change. For discussion, see the following emacs-devel thread: https://lists.gnu.org/r/emacs-devel/2020-11/msg00734.html * lisp/textmodes/bibtex.el (bibtex-unify-case-convert): Don't make automatically buffer-local for consistency with other user options, and because the :local tag doesn't have the intended results. diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index d53cfa0b1f..c9e21e58f6 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -96,8 +96,7 @@ It is called with one argument, the entry or field name." (const :tag "Downcase" downcase) (const :tag "Capitalize" capitalize) (const :tag "Upcase" upcase) - (function :tag "Conversion function")) - :local t) + (function :tag "Conversion function"))) (defcustom bibtex-user-optional-fields '(("annote" "Personal annotation (ignored)")) commit 827786cf759a0a14c3e2ebea2963478c2f1a9b5c Author: Michael Albinus Date: Wed Nov 18 11:32:38 2020 +0100 Preserve `dired-filename' text properties in Tramp * lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory): Restore `dired-filename' text property, which has been destroyed by `decode-coding-region'. (Bug#44682) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index ccf0c0d0e2..c4390b3d04 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2658,7 +2658,8 @@ The method used must be an out-of-band method." #'file-name-nondirectory (list localname))))))) (save-restriction - (let ((beg (point))) + (let ((beg (point)) + match) (narrow-to-region (point) (point)) ;; We cannot use `insert-buffer-substring' because the Tramp ;; buffer changes its contents before insertion due to calling @@ -2696,10 +2697,25 @@ The method used must be an out-of-band method." (re-search-forward tramp-display-escape-sequence-regexp nil t) (replace-match ""))) - ;; Decode the output, it could be multibyte. - (decode-coding-region - beg (point-max) - (or file-name-coding-system default-file-name-coding-system)) + ;; Decode the output, it could be multibyte. We must + ;; restore the text property, because `decode-coding-region' + ;; has destroyed it. However, text-property-search.el + ;; exists since Emacs 27 only. + (if (not (require 'text-property-search nil 'noerror)) + (decode-coding-region + beg (point-max) + (or file-name-coding-system default-file-name-coding-system)) + (goto-char beg) + (while (setq match + (tramp-compat-funcall + 'text-property-search-forward 'dired-filename t t)) + (decode-coding-region + (tramp-compat-funcall 'prop-match-beginning match) + (tramp-compat-funcall 'prop-match-end match) + (or file-name-coding-system default-file-name-coding-system)) + (put-text-property + (tramp-compat-funcall 'prop-match-beginning match) + (point) 'dired-filename t))) ;; The inserted file could be from somewhere else. (when (and (not wildcard) (not full-directory-p)) commit 43ad3c175d2e289f42be861eac5da807d6b1e088 Author: Stefan Kangas Date: Tue Nov 17 18:42:38 2020 +0100 Remove redundant 'function's around lambdas * lisp/allout.el (allout-latex-verb-quote): * lisp/edmacro.el (edmacro-format-keys): * lisp/ffap.el (ffap-all-subdirs-loop) (ffap-kpathsea-expand-path, ffap-menu-rescan): * lisp/files.el (save-buffers-kill-emacs): * lisp/find-lisp.el (find-lisp-find-dired-internal) (find-lisp-insert-directory): * lisp/gnus/gnus-agent.el (gnus-agent-expire-unagentized-dirs): * lisp/gnus/nnmairix.el (nnmairix-create-message-line-for-search) (nnmairix-widget-get-values) (nnmairix-widget-make-query-from-widgets) (nnmairix-widget-build-editable-fields): * lisp/international/mule-cmds.el (sort-coding-systems): * lisp/international/mule-diag.el (list-character-sets-1): * lisp/international/quail.el (quail-insert-decode-map): * lisp/mail/reporter.el (reporter-dump-state): * lisp/mail/supercite.el (sc-attribs-filter-namelist): * lisp/pcmpl-gnu.el (pcmpl-gnu-zipped-files) (pcmpl-gnu-bzipped-files): * lisp/progmodes/cperl-mode.el (cperl-find-tags) (cperl-write-tags, cperl-tags-hier-init, cperl-tags-treeify) (cperl-menu-to-keymap, cperl-pod-spell): * lisp/progmodes/gdb-mi.el (gdb-parent-mode): * lisp/progmodes/make-mode.el (makefile-browser-fill): * lisp/simple.el (transpose-lines): * lisp/term.el: * lisp/term/w32-win.el (w32-find-non-USB-fonts): * lisp/textmodes/table.el (table--generate-source-scan-lines): Remove redundant 'function's around lambdas. diff --git a/lisp/allout.el b/lisp/allout.el index b56071de59..a4802a1c2a 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -5583,12 +5583,11 @@ used verbatim." "Return copy of STRING for literal reproduction across LaTeX processing. Expresses the original characters (including carriage returns) of the string across LaTeX processing." - (mapconcat (function - (lambda (char) - (cond ((memq char '(?\\ ?$ ?% ?# ?& ?{ ?} ?_ ?^ ?- ?*)) - (concat "\\char" (number-to-string char) "{}")) - ((= char ?\n) "\\\\") - (t (char-to-string char))))) + (mapconcat (lambda (char) + (cond ((memq char '(?\\ ?$ ?% ?# ?& ?{ ?} ?_ ?^ ?- ?*)) + (concat "\\char" (number-to-string char) "{}")) + ((= char ?\n) "\\\\") + (t (char-to-string char)))) string "")) ;;;_ > allout-latex-verbatim-quote-curr-line () diff --git a/lisp/edmacro.el b/lisp/edmacro.el index 1d9b4726b0..44cf5aad38 100644 --- a/lisp/edmacro.el +++ b/lisp/edmacro.el @@ -535,32 +535,31 @@ doubt, use whitespace." (setq bind-len (1+ text))) (t (setq desc (mapconcat - (function - (lambda (ch) - (cond - ((integerp ch) - (concat - (cl-loop for pf across "ACHMsS" - for bit in '(?\A-\^@ ?\C-\^@ ?\H-\^@ - ?\M-\^@ ?\s-\^@ ?\S-\^@) - when (/= (logand ch bit) 0) - concat (format "%c-" pf)) - (let ((ch2 (logand ch (1- (ash 1 18))))) - (cond ((<= ch2 32) - (pcase ch2 - (0 "NUL") (9 "TAB") (10 "LFD") - (13 "RET") (27 "ESC") (32 "SPC") - (_ - (format "C-%c" - (+ (if (<= ch2 26) 96 64) - ch2))))) - ((= ch2 127) "DEL") - ((<= ch2 maxkey) (char-to-string ch2)) - (t (format "\\%o" ch2)))))) - ((symbolp ch) - (format "<%s>" ch)) - (t - (error "Unrecognized item in macro: %s" ch))))) + (lambda (ch) + (cond + ((integerp ch) + (concat + (cl-loop for pf across "ACHMsS" + for bit in '(?\A-\^@ ?\C-\^@ ?\H-\^@ + ?\M-\^@ ?\s-\^@ ?\S-\^@) + when (/= (logand ch bit) 0) + concat (format "%c-" pf)) + (let ((ch2 (logand ch (1- (ash 1 18))))) + (cond ((<= ch2 32) + (pcase ch2 + (0 "NUL") (9 "TAB") (10 "LFD") + (13 "RET") (27 "ESC") (32 "SPC") + (_ + (format "C-%c" + (+ (if (<= ch2 26) 96 64) + ch2))))) + ((= ch2 127) "DEL") + ((<= ch2 maxkey) (char-to-string ch2)) + (t (format "\\%o" ch2)))))) + ((symbolp ch) + (format "<%s>" ch)) + (t + (error "Unrecognized item in macro: %s" ch)))) (or fkey key) " ")))) (if prefix (setq desc (concat (edmacro-sanitize-for-string prefix) desc))) diff --git a/lisp/ffap.el b/lisp/ffap.el index bf03588600..9ad421c277 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -690,14 +690,13 @@ Optional DEPTH limits search depth." (setq depth (1- depth)) (cons dir (and (not (eq depth -1)) - (apply 'nconc + (apply #'nconc (mapcar - (function - (lambda (d) - (cond - ((not (file-directory-p d)) nil) - ((file-symlink-p d) (list d)) - (t (ffap-all-subdirs-loop d depth))))) + (lambda (d) + (cond + ((not (file-directory-p d)) nil) + ((file-symlink-p d) (list d)) + (t (ffap-all-subdirs-loop d depth)))) (directory-files dir t "\\`[^.]") ))))) @@ -710,13 +709,12 @@ Set to 0 to avoid all searching, or nil for no limit.") The subdirs begin with the original directory, and the depth of the search is bounded by `ffap-kpathsea-depth'. This is intended to mimic kpathsea, a library used by some versions of TeX." - (apply 'nconc + (apply #'nconc (mapcar - (function - (lambda (dir) - (if (string-match "[^/]//\\'" dir) - (ffap-all-subdirs (substring dir 0 -2) ffap-kpathsea-depth) - (list dir)))) + (lambda (dir) + (if (string-match "[^/]//\\'" dir) + (ffap-all-subdirs (substring dir 0 -2) ffap-kpathsea-depth) + (list dir))) path))) (defun ffap-locate-file (file nosuffix path) @@ -1793,8 +1791,7 @@ Applies `ffap-menu-text-plist' text properties at all matches." ;; Remove duplicates. (setq ffap-menu-alist ; sort by item (sort ffap-menu-alist - (function - (lambda (a b) (string-lessp (car a) (car b)))))) + (lambda (a b) (string-lessp (car a) (car b))))) (let ((ptr ffap-menu-alist)) ; remove duplicates (while (cdr ptr) (if (equal (car (car ptr)) (car (car (cdr ptr)))) @@ -1802,8 +1799,7 @@ Applies `ffap-menu-text-plist' text properties at all matches." (setq ptr (cdr ptr))))) (setq ffap-menu-alist ; sort by position (sort ffap-menu-alist - (function - (lambda (a b) (< (cdr a) (cdr b))))))) + (lambda (a b) (< (cdr a) (cdr b)))))) ;;; Mouse Support (`ffap-at-mouse'): diff --git a/lisp/files.el b/lisp/files.el index deb878cf41..3565b7f571 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -7370,9 +7370,9 @@ if any returns nil. If `confirm-kill-emacs' is non-nil, calls it." (save-some-buffers arg t) (let ((confirm confirm-kill-emacs)) (and - (or (not (memq t (mapcar (function - (lambda (buf) (and (buffer-file-name buf) - (buffer-modified-p buf)))) + (or (not (memq t (mapcar (lambda (buf) + (and (buffer-file-name buf) + (buffer-modified-p buf))) (buffer-list)))) (progn (setq confirm nil) (yes-or-no-p "Modified buffers exist; exit anyway? "))) diff --git a/lisp/find-lisp.el b/lisp/find-lisp.el index 352720412a..c1be5ff403 100644 --- a/lisp/find-lisp.el +++ b/lisp/find-lisp.el @@ -221,15 +221,12 @@ It is a function which takes two arguments, the directory and its parent." (make-local-variable 'revert-buffer-function) (setq revert-buffer-function - (function - (lambda (_ignore1 _ignore2) - (find-lisp-insert-directory - default-directory - find-lisp-file-predicate - find-lisp-directory-predicate - 'ignore) - ) - )) + (lambda (_ignore1 _ignore2) + (find-lisp-insert-directory + default-directory + find-lisp-file-predicate + find-lisp-directory-predicate + 'ignore))) ;; Set subdir-alist so that Tree Dired will work: (if (fboundp 'dired-simple-subdir-alist) @@ -267,11 +264,10 @@ It is a function which takes two arguments, the directory and its parent." (insert find-lisp-line-indent "\n") ;; Run the find function (mapc - (function - (lambda (file) - (find-lisp-find-dired-insert-file - (substring file len) - (current-buffer)))) + (lambda (file) + (find-lisp-find-dired-insert-file + (substring file len) + (current-buffer))) (sort files 'string-lessp)) ;; FIXME: Sort function is ignored for now ;; (funcall sort-function files)) diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index 76c2904eaf..053e7ea1f6 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el @@ -3567,22 +3567,21 @@ articles in every agentized group? ")) (let* (delete-recursive files f (delete-recursive - (function - (lambda (f-or-d) - (ignore-errors - (if (file-directory-p f-or-d) - (condition-case nil - (delete-directory f-or-d) - (file-error - (setq files (directory-files f-or-d)) - (while files - (setq f (pop files)) - (or (member f '("." "..")) - (funcall delete-recursive - (nnheader-concat - f-or-d f)))) - (delete-directory f-or-d))) - (delete-file f-or-d))))))) + (lambda (f-or-d) + (ignore-errors + (if (file-directory-p f-or-d) + (condition-case nil + (delete-directory f-or-d) + (file-error + (setq files (directory-files f-or-d)) + (while files + (setq f (pop files)) + (or (member f '("." "..")) + (funcall delete-recursive + (nnheader-concat + f-or-d f)))) + (delete-directory f-or-d))) + (delete-file f-or-d)))))) (funcall delete-recursive dir))))))))) ;;;###autoload diff --git a/lisp/gnus/nnmairix.el b/lisp/gnus/nnmairix.el index dcecfcf651..e53e000bea 100644 --- a/lisp/gnus/nnmairix.el +++ b/lisp/gnus/nnmairix.el @@ -1548,9 +1548,8 @@ See %s for details" proc nnmairix-mairix-output-buffer))) (defun nnmairix-create-message-line-for-search () "Create message line for interactive query in minibuffer." (mapconcat - (function - (lambda (cur) - (format "%c=%s" (car cur) (nth 3 cur)))) + (lambda (cur) + (format "%c=%s" (car cur) (nth 3 cur))) nnmairix-interactive-query-parameters ",")) (defun nnmairix-replace-illegal-chars (header) @@ -1811,13 +1810,12 @@ If VERSION is a string: must be contained in mairix version output." (gnus-summary-toggle-header 1) (set-buffer gnus-article-buffer) (mapcar - (function - (lambda (field) - (list (car (cddr field)) - (if (car field) - (nnmairix-replace-illegal-chars - (gnus-fetch-field (car field))) - nil)))) + (lambda (field) + (list (car (cddr field)) + (if (car field) + (nnmairix-replace-illegal-chars + (gnus-fetch-field (car field))) + nil))) nnmairix-widget-fields-list)))) @@ -1911,14 +1909,13 @@ If WITHVALUES is t, query is based on current article." (when (member 'flags nnmairix-widget-other) (setq flag (mapconcat - (function - (lambda (flag) - (setq temp - (widget-value (cadr (assoc (car flag) nnmairix-widgets)))) - (if (string= "yes" temp) - (cadr flag) - (if (string= "no" temp) - (concat "-" (cadr flag)))))) + (lambda (flag) + (setq temp + (widget-value (cadr (assoc (car flag) nnmairix-widgets)))) + (if (string= "yes" temp) + (cadr flag) + (if (string= "no" temp) + (concat "-" (cadr flag))))) '(("seen" "s") ("replied" "r") ("flagged" "f")) "")) (when (not (zerop (length flag))) (push (concat "F:" flag) query))) @@ -1968,32 +1965,31 @@ VALUES may contain values for editable fields from current article." ;; how can this be done less ugly? (let ((ret)) (mapc - (function - (lambda (field) - (setq field (car (cddr field))) - (setq ret - (nconc - (list - (list - (concat "c" field) - (widget-create 'checkbox - :tag field - :notify (lambda (widget &rest ignore) - (nnmairix-widget-toggle-activate widget)) - nil))) - (list - (list - (concat "e" field) - (widget-create 'editable-field - :size 60 - :format (concat " " field ":" - (make-string (- 11 (length field)) ?\ ) - "%v") - :value (or (cadr (assoc field values)) "")))) - ret)) - (widget-insert "\n") - ;; Deactivate editable field - (widget-apply (cadr (nth 1 ret)) :deactivate))) + (lambda (field) + (setq field (car (cddr field))) + (setq ret + (nconc + (list + (list + (concat "c" field) + (widget-create 'checkbox + :tag field + :notify (lambda (widget &rest ignore) + (nnmairix-widget-toggle-activate widget)) + nil))) + (list + (list + (concat "e" field) + (widget-create 'editable-field + :size 60 + :format (concat " " field ":" + (make-string (- 11 (length field)) ?\ ) + "%v") + :value (or (cadr (assoc field values)) "")))) + ret)) + (widget-insert "\n") + ;; Deactivate editable field + (widget-apply (cadr (nth 1 ret)) :deactivate)) nnmairix-widget-fields-list) ret)) diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 1e6fea8578..d361971a1f 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -441,56 +441,55 @@ non-nil, it is used to sort CODINGS instead." (most-preferred (car from-priority)) (lang-preferred (get-language-info current-language-environment 'coding-system)) - (func (function - (lambda (x) - (let ((base (coding-system-base x))) - ;; We calculate the priority number 0..255 by - ;; using the 8 bits PMMLCEII as this: - ;; P: 1 if most preferred. - ;; MM: greater than 0 if mime-charset. - ;; L: 1 if one of the current lang. env.'s codings. - ;; C: 1 if one of codings listed in the category list. - ;; E: 1 if not XXX-with-esc - ;; II: if iso-2022 based, 0..3, else 1. - (logior - (ash (if (eq base most-preferred) 1 0) 7) - (ash - (let ((mime (coding-system-get base :mime-charset))) - ;; Prefer coding systems corresponding to a - ;; MIME charset. - (if mime - ;; Lower utf-16 priority so that we - ;; normally prefer utf-8 to it, and put - ;; x-ctext below that. - (cond ((string-match-p "utf-16" - (symbol-name mime)) - 2) - ((string-match-p "^x-" (symbol-name mime)) - 1) - (t 3)) - 0)) - 5) - (ash (if (memq base lang-preferred) 1 0) 4) - (ash (if (memq base from-priority) 1 0) 3) - (ash (if (string-match-p "-with-esc\\'" - (symbol-name base)) - 0 1) 2) - (if (eq (coding-system-type base) 'iso-2022) - (let ((category (coding-system-category base))) - ;; For ISO based coding systems, prefer - ;; one that doesn't use designation nor - ;; locking/single shifting. - (cond - ((or (eq category 'coding-category-iso-8-1) - (eq category 'coding-category-iso-8-2)) - 2) - ((or (eq category 'coding-category-iso-7-tight) - (eq category 'coding-category-iso-7)) - 1) - (t - 0))) - 1) - )))))) + (func (lambda (x) + (let ((base (coding-system-base x))) + ;; We calculate the priority number 0..255 by + ;; using the 8 bits PMMLCEII as this: + ;; P: 1 if most preferred. + ;; MM: greater than 0 if mime-charset. + ;; L: 1 if one of the current lang. env.'s codings. + ;; C: 1 if one of codings listed in the category list. + ;; E: 1 if not XXX-with-esc + ;; II: if iso-2022 based, 0..3, else 1. + (logior + (ash (if (eq base most-preferred) 1 0) 7) + (ash + (let ((mime (coding-system-get base :mime-charset))) + ;; Prefer coding systems corresponding to a + ;; MIME charset. + (if mime + ;; Lower utf-16 priority so that we + ;; normally prefer utf-8 to it, and put + ;; x-ctext below that. + (cond ((string-match-p "utf-16" + (symbol-name mime)) + 2) + ((string-match-p "^x-" (symbol-name mime)) + 1) + (t 3)) + 0)) + 5) + (ash (if (memq base lang-preferred) 1 0) 4) + (ash (if (memq base from-priority) 1 0) 3) + (ash (if (string-match-p "-with-esc\\'" + (symbol-name base)) + 0 1) 2) + (if (eq (coding-system-type base) 'iso-2022) + (let ((category (coding-system-category base))) + ;; For ISO based coding systems, prefer + ;; one that doesn't use designation nor + ;; locking/single shifting. + (cond + ((or (eq category 'coding-category-iso-8-1) + (eq category 'coding-category-iso-8-2)) + 2) + ((or (eq category 'coding-category-iso-7-tight) + (eq category 'coding-category-iso-7)) + 1) + (t + 0))) + 1) + ))))) (sort codings (lambda (x y) (> (funcall func x) (funcall func y))))))) diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el index b13bde58ca..57e568689e 100644 --- a/lisp/international/mule-diag.el +++ b/lisp/international/mule-diag.el @@ -136,13 +136,12 @@ SORT-KEY should be `name' or `iso-spec' (default `name')." ((eq sort-key 'iso-spec) ;; Sort by DIMENSION CHARS FINAL-CHAR - (function - (lambda (x y) - (or (< (nth 1 x) (nth 1 y)) - (and (= (nth 1 x) (nth 1 y)) - (or (< (nth 2 x) (nth 2 y)) - (and (= (nth 2 x) (nth 2 y)) - (< (nth 3 x) (nth 3 y))))))))) + (lambda (x y) + (or (< (nth 1 x) (nth 1 y)) + (and (= (nth 1 x) (nth 1 y)) + (or (< (nth 2 x) (nth 2 y)) + (and (= (nth 2 x) (nth 2 y)) + (< (nth 3 x) (nth 3 y)))))))) (t (error "Invalid charset sort key: %s" sort-key)))) diff --git a/lisp/international/quail.el b/lisp/international/quail.el index e94b42230b..39ef6d3bf0 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -2478,14 +2478,13 @@ should be made by `quail-build-decode-map' (which see)." 'face 'font-lock-comment-face)) (quail-indent-to max-key-width) (if (vectorp (cdr elt)) - (mapc (function - (lambda (x) - (let ((width (if (integerp x) (char-width x) - (string-width x)))) - (when (> (+ (current-column) 1 width) window-width) - (insert "\n") - (quail-indent-to max-key-width)) - (insert " " x)))) + (mapc (lambda (x) + (let ((width (if (integerp x) (char-width x) + (string-width x)))) + (when (> (+ (current-column) 1 width) window-width) + (insert "\n") + (quail-indent-to max-key-width)) + (insert " " x))) (cdr elt)) (insert " " (cdr elt))) (insert ?\n)) diff --git a/lisp/mail/reporter.el b/lisp/mail/reporter.el index 0c8b8d47a0..805dd12d3b 100644 --- a/lisp/mail/reporter.el +++ b/lisp/mail/reporter.el @@ -250,14 +250,12 @@ dumped." (insert "(setq\n") (lisp-indent-line) (mapc - (function - (lambda (varsym-or-cons-cell) - (let ((varsym (or (car-safe varsym-or-cons-cell) - varsym-or-cons-cell)) - (printer (or (cdr-safe varsym-or-cons-cell) - 'reporter-dump-variable))) - (funcall printer varsym mailbuf) - ))) + (lambda (varsym-or-cons-cell) + (let ((varsym (or (car-safe varsym-or-cons-cell) + varsym-or-cons-cell)) + (printer (or (cdr-safe varsym-or-cons-cell) + 'reporter-dump-variable))) + (funcall printer varsym mailbuf))) varlist) (lisp-indent-line) (insert ")\n")) diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el index 986d0cf407..b2ccd3d993 100644 --- a/lisp/mail/supercite.el +++ b/lisp/mail/supercite.el @@ -1028,17 +1028,16 @@ supplied, is used instead of the line point is on in the current buffer." (setq position (1+ position)) (let ((keep-p t)) (mapc - (function - (lambda (filter) - (let ((regexp (car filter)) - (pos (cdr filter))) - (if (and (string-match regexp name) - (or (and (numberp pos) - (= pos position)) - (and (eq pos 'last) - (= position (1- elements))) - (eq pos 'any))) - (setq keep-p nil))))) + (lambda (filter) + (let ((regexp (car filter)) + (pos (cdr filter))) + (if (and (string-match regexp name) + (or (and (numberp pos) + (= pos position)) + (and (eq pos 'last) + (= position (1- elements))) + (eq pos 'any))) + (setq keep-p nil)))) sc-name-filter-alist) (if keep-p (setq keepers (cons position keepers))))) diff --git a/lisp/pcmpl-gnu.el b/lisp/pcmpl-gnu.el index fa84b31675..c605009449 100644 --- a/lisp/pcmpl-gnu.el +++ b/lisp/pcmpl-gnu.el @@ -65,15 +65,14 @@ "Find all zipped or unzipped files: the inverse of UNZIP-P." (pcomplete-entries nil - (function - (lambda (entry) - (or (file-directory-p entry) - (when (and (file-readable-p entry) - (file-regular-p entry)) - (let ((zipped (string-match "\\.\\(t?gz\\|\\(ta\\)?Z\\)\\'" - entry))) - (or (and unzip-p zipped) - (and (not unzip-p) (not zipped)))))))))) + (lambda (entry) + (or (file-directory-p entry) + (when (and (file-readable-p entry) + (file-regular-p entry)) + (let ((zipped (string-match "\\.\\(t?gz\\|\\(ta\\)?Z\\)\\'" + entry))) + (or (and unzip-p zipped) + (and (not unzip-p) (not zipped))))))))) ;;;###autoload (defun pcomplete/bzip2 () @@ -92,13 +91,12 @@ "Find all zipped or unzipped files: the inverse of UNZIP-P." (pcomplete-entries nil - (function - (lambda (entry) - (when (and (file-readable-p entry) - (file-regular-p entry)) - (let ((zipped (string-match "\\.\\(t?z2\\|bz2\\)\\'" entry))) - (or (and unzip-p zipped) - (and (not unzip-p) (not zipped))))))))) + (lambda (entry) + (when (and (file-readable-p entry) + (file-regular-p entry)) + (let ((zipped (string-match "\\.\\(t?z2\\|bz2\\)\\'" entry))) + (or (and unzip-p zipped) + (and (not unzip-p) (not zipped)))))))) ;;;###autoload (defun pcomplete/make () diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 0dc45515d4..3606f9a395 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -5442,11 +5442,10 @@ indentation and initial hashes. Behaves usually outside of comment." (cperl-init-faces)))) ((not cperl-faces-init) (add-hook 'font-lock-mode-hook - (function - (lambda () - (if (memq major-mode '(perl-mode cperl-mode)) - (progn - (or cperl-faces-init (cperl-init-faces))))))) + (lambda () + (if (memq major-mode '(perl-mode cperl-mode)) + (progn + (or cperl-faces-init (cperl-init-faces)))))) (eval-after-load "ps-print" '(or cperl-faces-init (cperl-init-faces)))))) @@ -6073,9 +6072,8 @@ side-effect of memorizing only. Examples in `cperl-style-examples'." (list (completing-read "Enter style: " cperl-style-alist nil 'insist))) (or cperl-old-style (setq cperl-old-style - (mapcar (function - (lambda (name) - (cons name (eval name)))) + (mapcar (lambda (name) + (cons name (eval name))) cperl-styles-entries))) (let ((style (cdr (assoc style cperl-style-alist))) setting) (while style @@ -6527,22 +6525,21 @@ Does not move point." (setq lst (cdr (assoc "+Unsorted List+..." ind)))) (setq lst (mapcar - (function - (lambda (elt) - (cond ((string-match "^[_a-zA-Z]" (car elt)) - (goto-char (cdr elt)) - (beginning-of-line) ; pos should be of the start of the line - (list (car elt) - (point) - (1+ (count-lines 1 (point))) ; 1+ since at beg-o-l - (buffer-substring (progn - (goto-char (cdr elt)) - ;; After name now... - (or (eolp) (forward-char 1)) - (point)) - (progn - (beginning-of-line) - (point)))))))) + (lambda (elt) + (cond ((string-match "^[_a-zA-Z]" (car elt)) + (goto-char (cdr elt)) + (beginning-of-line) ; pos should be of the start of the line + (list (car elt) + (point) + (1+ (count-lines 1 (point))) ; 1+ since at beg-o-l + (buffer-substring (progn + (goto-char (cdr elt)) + ;; After name now... + (or (eolp) (forward-char 1)) + (point)) + (progn + (beginning-of-line) + (point))))))) lst)) (erase-buffer) (while lst @@ -6645,16 +6642,15 @@ Use as (setq cperl-unreadable-ok t) nil) ; Return empty list (error "Aborting: unreadable directory %s" file))))))) - (mapc (function - (lambda (file) - (cond - ((string-match cperl-noscan-files-regexp file) - nil) - ((not (file-directory-p file)) - (if (string-match cperl-scan-files-regexp file) - (cperl-write-tags file erase recurse nil t noxs topdir))) - ((not recurse) nil) - (t (cperl-write-tags file erase recurse t t noxs topdir))))) + (mapc (lambda (file) + (cond + ((string-match cperl-noscan-files-regexp file) + nil) + ((not (file-directory-p file)) + (if (string-match cperl-scan-files-regexp file) + (cperl-write-tags file erase recurse nil t noxs topdir))) + ((not recurse) nil) + (t (cperl-write-tags file erase recurse t t noxs topdir)))) files))) (t (setq xs (string-match "\\.xs$" file)) @@ -6768,11 +6764,10 @@ One may build such TAGS files from CPerl mode menu." (or tags-table-list (call-interactively 'visit-tags-table)) (mapc - (function - (lambda (tagsfile) - (message "Updating list of classes... %s" tagsfile) - (set-buffer (get-file-buffer tagsfile)) - (cperl-tags-hier-fill))) + (lambda (tagsfile) + (message "Updating list of classes... %s" tagsfile) + (set-buffer (get-file-buffer tagsfile)) + (cperl-tags-hier-fill)) tags-table-list) (message "Updating list of classes... postprocessing...") (mapc remover (car cperl-hierarchy)) @@ -6816,24 +6811,23 @@ One may build such TAGS files from CPerl mode menu." l1 head cons1 cons2 ord writeto recurse root-packages root-functions (move-deeper - (function - (lambda (elt) - (cond ((and (string-match regexp (car elt)) - (or (eq ord 1) (match-end 2))) - (setq head (substring (car elt) 0 (match-end 1)) - recurse t) - (if (setq cons1 (assoc head writeto)) nil - ;; Need to init new head - (setcdr writeto (cons (list head (list "Packages: ") - (list "Methods: ")) - (cdr writeto))) - (setq cons1 (nth 1 writeto))) - (setq cons2 (nth ord cons1)) ; Either packs or meths - (setcdr cons2 (cons elt (cdr cons2)))) - ((eq ord 2) - (setq root-functions (cons elt root-functions))) - (t - (setq root-packages (cons elt root-packages)))))))) + (lambda (elt) + (cond ((and (string-match regexp (car elt)) + (or (eq ord 1) (match-end 2))) + (setq head (substring (car elt) 0 (match-end 1)) + recurse t) + (if (setq cons1 (assoc head writeto)) nil + ;; Need to init new head + (setcdr writeto (cons (list head (list "Packages: ") + (list "Methods: ")) + (cdr writeto))) + (setq cons1 (nth 1 writeto))) + (setq cons2 (nth ord cons1)) ; Either packs or meths + (setcdr cons2 (cons elt (cdr cons2)))) + ((eq ord 2) + (setq root-functions (cons elt root-functions))) + (t + (setq root-packages (cons elt root-packages))))))) (setcdr to l1) ; Init to dynamic space (setq writeto to) (setq ord 1) @@ -6903,16 +6897,15 @@ One may build such TAGS files from CPerl mode menu." (let (list) (cons 'keymap (mapcar - (function - (lambda (elt) - (cond ((listp (cdr elt)) - (setq list (cperl-list-fold - (cdr elt) (car elt) imenu-max-items)) - (cons nil - (cons (car elt) - (cperl-menu-to-keymap list)))) - (t - (list (cdr elt) (car elt) t))))) ; t is needed in 19.34 + (lambda (elt) + (cond ((listp (cdr elt)) + (setq list (cperl-list-fold + (cdr elt) (car elt) imenu-max-items)) + (cons nil + (cons (car elt) + (cperl-menu-to-keymap list)))) + (t + (list (cdr elt) (car elt) t)))) ; t is needed in 19.34 (cperl-list-fold menu "Root" imenu-max-items))))) @@ -8239,15 +8232,14 @@ If a region is highlighted, restricts to the region." end (max (mark) (point))) (setq beg (point-min) end (point-max))) - (cperl-map-pods-heres (function - (lambda (s e _p) - (if do-heres - (setq e (save-excursion - (goto-char e) - (forward-line -1) - (point)))) - (ispell-region s e) - t)) + (cperl-map-pods-heres (lambda (s e _p) + (if do-heres + (setq e (save-excursion + (goto-char e) + (forward-line -1) + (point)))) + (ispell-region s e) + t) (if do-heres 'here-doc-group 'in-pod) beg end)))) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 6e9b6830a0..0023e1fb5d 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1617,17 +1617,16 @@ this trigger is subscribed to `gdb-buf-publisher' and called with ;; (if it has an associated update trigger) (add-hook 'kill-buffer-hook - (function - (lambda () - (let ((trigger (gdb-rules-update-trigger - (gdb-current-buffer-rules)))) - (when trigger - (gdb-delete-subscriber - gdb-buf-publisher - ;; This should match gdb-add-subscriber done in - ;; gdb-get-buffer-create - (cons (current-buffer) - (gdb-bind-function-to-buffer trigger (current-buffer)))))))) + (lambda () + (let ((trigger (gdb-rules-update-trigger + (gdb-current-buffer-rules)))) + (when trigger + (gdb-delete-subscriber + gdb-buf-publisher + ;; This should match gdb-add-subscriber done in + ;; gdb-get-buffer-create + (cons (current-buffer) + (gdb-bind-function-to-buffer trigger (current-buffer))))))) nil t)) ;; Partial-output buffer : This accumulates output from a command executed on diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 8596d78a60..3e49f84dbc 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el @@ -1370,13 +1370,11 @@ Fill comments, backslashed lines, and variable definitions specially." (goto-char (point-min)) (erase-buffer) (mapconcat - (function - (lambda (item) (insert (makefile-browser-format-target-line (car item) nil) "\n"))) + (lambda (item) (insert (makefile-browser-format-target-line (car item) nil) "\n")) targets "") (mapconcat - (function - (lambda (item) (insert (makefile-browser-format-macro-line (car item) nil) "\n"))) + (lambda (item) (insert (makefile-browser-format-macro-line (car item) nil) "\n")) macros "") (sort-lines nil (point-min) (point-max)) diff --git a/lisp/simple.el b/lisp/simple.el index 5158bc74a9..bb28145502 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -7435,18 +7435,17 @@ are interchanged." With argument ARG, takes previous line and moves it past ARG lines. With argument 0, interchanges line point is in with line mark is in." (interactive "*p") - (transpose-subr (function - (lambda (arg) - (if (> arg 0) - (progn - ;; Move forward over ARG lines, - ;; but create newlines if necessary. - (setq arg (forward-line arg)) - (if (/= (preceding-char) ?\n) - (setq arg (1+ arg))) - (if (> arg 0) - (newline arg))) - (forward-line arg)))) + (transpose-subr (lambda (arg) + (if (> arg 0) + (progn + ;; Move forward over ARG lines, + ;; but create newlines if necessary. + (setq arg (forward-line arg)) + (if (/= (preceding-char) ?\n) + (setq arg (1+ arg))) + (if (> arg 0) + (newline arg))) + (forward-line arg))) arg)) ;; FIXME seems to leave point BEFORE the current object when ARG = 0, diff --git a/lisp/term.el b/lisp/term.el index 8cbbfff1b6..585232be6c 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -123,13 +123,12 @@ ;; full advantage of this package ;; ;; (add-hook 'term-mode-hook -;; (function -;; (lambda () -;; (setq term-prompt-regexp "^[^#$%>\n]*[#$%>] *") -;; (setq-local mouse-yank-at-point t) -;; (setq-local transient-mark-mode nil) -;; (auto-fill-mode -1) -;; (setq tab-width 8 )))) +;; (lambda () +;; (setq term-prompt-regexp "^[^#$%>\n]*[#$%>] *") +;; (setq-local mouse-yank-at-point t) +;; (setq-local transient-mark-mode nil) +;; (auto-fill-mode -1) +;; (setq tab-width 8))) ;; ;; ---------------------------------------- ;; diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index e866fdc36c..7a15537186 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el @@ -567,46 +567,45 @@ default font on FRAME, or its best approximation." (x-list-fonts "-*-*-medium-r-normal-*-*-*-*-*-*-iso10646-1" 'default frame))) val) - (mapc (function - (lambda (script-desc) - (let* ((script (car script-desc)) - (script-chars (vconcat (cdr script-desc))) - (nchars (length script-chars)) - (fntlist all-fonts) - (entry (list script)) - fspec ffont font-obj glyphs idx) - ;; For each font in FNTLIST, determine whether it - ;; supports the representative character(s) of any - ;; scripts that have no USBs defined for it. - (dolist (fnt fntlist) - (setq fspec (ignore-errors (font-spec :name fnt))) - (if fspec - (setq ffont (find-font fspec frame))) - (when ffont - (setq font-obj - (open-font ffont size frame)) - ;; Ignore fonts for which open-font returns nil: - ;; they are buggy fonts that we cannot use anyway. - (setq glyphs - (if font-obj - (font-get-glyphs font-obj - 0 nchars script-chars) - '[nil])) - ;; Does this font support ALL of the script's - ;; representative characters? - (setq idx 0) - (while (and (< idx nchars) (not (null (aref glyphs idx)))) - (setq idx (1+ idx))) - (if (= idx nchars) - ;; It does; add this font to the script's entry in alist. - (let ((font-family (font-get font-obj :family))) - ;; Unifont is an ugly font, and it is already - ;; present in the default fontset. - (unless (string= (downcase (symbol-name font-family)) - "unifont") - (push font-family entry)))))) - (if (> (length entry) 1) - (push (nreverse entry) val))))) + (mapc (lambda (script-desc) + (let* ((script (car script-desc)) + (script-chars (vconcat (cdr script-desc))) + (nchars (length script-chars)) + (fntlist all-fonts) + (entry (list script)) + fspec ffont font-obj glyphs idx) + ;; For each font in FNTLIST, determine whether it + ;; supports the representative character(s) of any + ;; scripts that have no USBs defined for it. + (dolist (fnt fntlist) + (setq fspec (ignore-errors (font-spec :name fnt))) + (if fspec + (setq ffont (find-font fspec frame))) + (when ffont + (setq font-obj + (open-font ffont size frame)) + ;; Ignore fonts for which open-font returns nil: + ;; they are buggy fonts that we cannot use anyway. + (setq glyphs + (if font-obj + (font-get-glyphs font-obj + 0 nchars script-chars) + '[nil])) + ;; Does this font support ALL of the script's + ;; representative characters? + (setq idx 0) + (while (and (< idx nchars) (not (null (aref glyphs idx)))) + (setq idx (1+ idx))) + (if (= idx nchars) + ;; It does; add this font to the script's entry in alist. + (let ((font-family (font-get font-obj :family))) + ;; Unifont is an ugly font, and it is already + ;; present in the default fontset. + (unless (string= (downcase (symbol-name font-family)) + "unifont") + (push font-family entry)))))) + (if (> (length entry) 1) + (push (nreverse entry) val)))) (w32--filter-USB-scripts)) ;; We've opened a lot of fonts, so clear the font caches to free ;; some memory. diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 25aa58046f..065fdd09cc 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el @@ -3270,34 +3270,33 @@ Currently this method is for LaTeX only." (let* ((span 1) ;; spanning length (first-p t) ;; first in a row (insert-column ;; a function that processes one column/multicolumn - (function - (lambda (from to) - (let ((line (table--buffer-substring-and-trim - (table--goto-coordinate (cons from y)) - (table--goto-coordinate (cons to y))))) - ;; escape special characters - (with-temp-buffer - (insert line) - (goto-char (point-min)) - (while (re-search-forward "\\([#$~_^%{}&]\\)\\|\\(\\\\\\)\\|\\([<>|]\\)" nil t) - (if (match-beginning 1) - (save-excursion - (goto-char (match-beginning 1)) - (insert "\\")) - (if (match-beginning 2) - (replace-match "$\\backslash$" t t) - (replace-match (concat "$" (match-string 3) "$")) t t))) - (setq line (buffer-substring (point-min) (point-max)))) - ;; insert a column separator and column/multicolumn contents - (with-current-buffer dest-buffer - (unless first-p - (insert (if (eq (char-before) ?\s) "" " ") "& ")) - (if (> span 1) - (insert (format "\\multicolumn{%d}{%sl|}{%s}" span (if first-p "|" "") line)) - (insert line))) - (setq first-p nil) - (setq span 1) - (setq start (nth i col-list))))))) + (lambda (from to) + (let ((line (table--buffer-substring-and-trim + (table--goto-coordinate (cons from y)) + (table--goto-coordinate (cons to y))))) + ;; escape special characters + (with-temp-buffer + (insert line) + (goto-char (point-min)) + (while (re-search-forward "\\([#$~_^%{}&]\\)\\|\\(\\\\\\)\\|\\([<>|]\\)" nil t) + (if (match-beginning 1) + (save-excursion + (goto-char (match-beginning 1)) + (insert "\\")) + (if (match-beginning 2) + (replace-match "$\\backslash$" t t) + (replace-match (concat "$" (match-string 3) "$")) t t))) + (setq line (buffer-substring (point-min) (point-max)))) + ;; insert a column separator and column/multicolumn contents + (with-current-buffer dest-buffer + (unless first-p + (insert (if (eq (char-before) ?\s) "" " ") "& ")) + (if (> span 1) + (insert (format "\\multicolumn{%d}{%sl|}{%s}" span (if first-p "|" "") line)) + (insert line))) + (setq first-p nil) + (setq span 1) + (setq start (nth i col-list)))))) (setq start x0) (setq i 1) (while (setq c (nth i border-char-list)) commit 68e57e0046328aa47ffad721718749b0991f6591 Author: Stefan Kangas Date: Tue Nov 17 03:13:50 2020 +0100 Remove redundant 'function's around lambdas in mh/*.el * lisp/mh-e/mh-alias.el (mh-alias-tstamp, mh-alias-filenames) (mh-alias-address-to-alias): * lisp/mh-e/mh-comp.el (mh-edit-again, mh-redistribute): * lisp/mh-e/mh-identity.el (mh-identity-make-menu): * lisp/mh-e/mh-utils.el (mh-help): Remove redundant 'function's around lambdas. diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el index cc437c3c49..d037bdce88 100644 --- a/lisp/mh-e/mh-alias.el +++ b/lisp/mh-e/mh-alias.el @@ -73,12 +73,11 @@ If ARG is non-nil, set timestamp with the current time." (setq mh-alias-tstamp (list (nth 0 time) (nth 1 time)))) (let ((stamp)) (car (memq t (mapcar - (function - (lambda (file) - (when (and file (file-exists-p file)) - (setq stamp (file-attribute-modification-time - (file-attributes file))) - (time-less-p mh-alias-tstamp stamp)))) + (lambda (file) + (when (and file (file-exists-p file)) + (setq stamp (file-attribute-modification-time + (file-attributes file))) + (time-less-p mh-alias-tstamp stamp))) (mh-alias-filenames t))))))) (defun mh-alias-filenames (arg) @@ -93,11 +92,10 @@ appended." (filelist (and filename (split-string filename "[ \t]+"))) (userlist (mapcar - (function - (lambda (file) - (if (and mh-user-path file - (file-exists-p (expand-file-name file mh-user-path))) - (expand-file-name file mh-user-path)))) + (lambda (file) + (if (and mh-user-path file + (file-exists-p (expand-file-name file mh-user-path))) + (expand-file-name file mh-user-path))) filelist))) (if arg (if (stringp mh-alias-system-aliases) @@ -466,12 +464,11 @@ set `mh-alias-insert-file' or the \"Aliasfile:\" profile component")) ;; Double-check that we have an individual alias. This means that the ;; alias doesn't expand into a list (of which this address is part). (car (delq nil (mapcar - (function - (lambda (alias) - (let ((recurse (mh-alias-ali alias nil))) - (if (string-match ".*,.*" recurse) - nil - alias)))) + (lambda (alias) + (let ((recurse (mh-alias-ali alias nil))) + (if (string-match ".*,.*" recurse) + nil + alias))) (split-string aliases ", +"))))))) ;;;###mh-autoload diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el index 8a69adbb75..e766bca89d 100644 --- a/lisp/mh-e/mh-comp.el +++ b/lisp/mh-e/mh-comp.el @@ -435,43 +435,42 @@ See also `mh-send'." (mh-insert-header-separator) ;; Merge in components (mh-mapc - (function - (lambda (header-field) - (let ((field (car header-field)) - (value (cdr header-field)) - (case-fold-search t)) - (cond - ;; Address field - ((string-match field "^To$\\|^Cc$\\|^From$") - (cond - ((not (mh-goto-header-field (concat field ":"))) - ;; Header field does not exist, add it - (mh-goto-header-end 0) - (insert field ": " value "\n")) - ((string-equal value "") - ;; Header field already exists and no value - ) - (t - ;; Header field exists and we have a value - (let (address mailbox (alias (mh-alias-expand value))) - (and alias - (setq address (ietf-drums-parse-address alias)) - (setq mailbox (car address))) - ;; XXX - Need to parse all addresses out of field - (if (and - (not (mh-regexp-in-field-p - (concat "\\b" (regexp-quote value) "\\b") field)) - mailbox - (not (mh-regexp-in-field-p - (concat "\\b" (regexp-quote mailbox) "\\b") field))) - (insert " " value ",")) - )))) - ((string-match field "^Fcc$") - ;; Folder reference - (mh-modify-header-field field value)) - ;; Text field, that's an easy case - (t - (mh-modify-header-field field value)))))) + (lambda (header-field) + (let ((field (car header-field)) + (value (cdr header-field)) + (case-fold-search t)) + (cond + ;; Address field + ((string-match field "^To$\\|^Cc$\\|^From$") + (cond + ((not (mh-goto-header-field (concat field ":"))) + ;; Header field does not exist, add it + (mh-goto-header-end 0) + (insert field ": " value "\n")) + ((string-equal value "") + ;; Header field already exists and no value + ) + (t + ;; Header field exists and we have a value + (let (address mailbox (alias (mh-alias-expand value))) + (and alias + (setq address (ietf-drums-parse-address alias)) + (setq mailbox (car address))) + ;; XXX - Need to parse all addresses out of field + (if (and + (not (mh-regexp-in-field-p + (concat "\\b" (regexp-quote value) "\\b") field)) + mailbox + (not (mh-regexp-in-field-p + (concat "\\b" (regexp-quote mailbox) "\\b") field))) + (insert " " value ",")) + )))) + ((string-match field "^Fcc$") + ;; Folder reference + (mh-modify-header-field field value)) + ;; Text field, that's an easy case + (t + (mh-modify-header-field field value))))) (mh-components-to-list components-file)) (delete-file components-file) (goto-char (point-min)) @@ -700,25 +699,24 @@ message and scan line." ;; trumping anything in the distcomps file. (let ((components-file (mh-bare-components mh-dist-formfile))) (mh-mapc - (function - (lambda (header-field) - (let ((field (car header-field)) - (value (cdr header-field)) - (case-fold-search t)) - (cond - ((string-match field "^Resent-Fcc$") - (setq comp-fcc value)) - ((string-match field "^Resent-From$") - (or from - (setq from value))) - ((string-match field "^Resent-To$") - (setq comp-to value)) - ((string-match field "^Resent-Cc$") - (setq comp-cc value)) - ((string-match field "^Resent-Bcc$") - (setq comp-bcc value)) - ((string-match field "^Resent-.*$") - (mh-insert-fields field value)))))) + (lambda (header-field) + (let ((field (car header-field)) + (value (cdr header-field)) + (case-fold-search t)) + (cond + ((string-match field "^Resent-Fcc$") + (setq comp-fcc value)) + ((string-match field "^Resent-From$") + (or from + (setq from value))) + ((string-match field "^Resent-To$") + (setq comp-to value)) + ((string-match field "^Resent-Cc$") + (setq comp-cc value)) + ((string-match field "^Resent-Bcc$") + (setq comp-bcc value)) + ((string-match field "^Resent-.*$") + (mh-insert-fields field value))))) (mh-components-to-list components-file)) (delete-file components-file)) (mh-insert-fields "Resent-To:" (mapconcat 'identity (list to comp-to) ", ") diff --git a/lisp/mh-e/mh-identity.el b/lisp/mh-e/mh-identity.el index ebc7d2a4fc..ed23996339 100644 --- a/lisp/mh-e/mh-identity.el +++ b/lisp/mh-e/mh-identity.el @@ -71,10 +71,9 @@ See `mh-identity-add-menu'." (mh-insert-auto-fields) mh-auto-fields-list] "--") - (mapcar (function - (lambda (arg) - `[,arg (mh-insert-identity ,arg) :style radio - :selected (equal mh-identity-local ,arg)])) + (mapcar (lambda (arg) + `[,arg (mh-insert-identity ,arg) :style radio + :selected (equal mh-identity-local ,arg)]) (mapcar 'car mh-identity-list)) '(["None" (mh-insert-identity "None") :style radio diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el index 44b4ef4879..28d3c7614c 100644 --- a/lisp/mh-e/mh-utils.el +++ b/lisp/mh-e/mh-utils.el @@ -270,9 +270,8 @@ and displayed in a help buffer." (cdr (assoc nil (assoc major-mode mh-help-messages))))) (text (substitute-command-keys (mapconcat 'identity help "")))) (with-electric-help - (function - (lambda () - (insert text))) + (lambda () + (insert text)) mh-help-buffer))) ;;;###mh-autoload commit ab9a23e029ce1507d9e863e086db8796d727d1a4 Author: Alan Mackenzie Date: Tue Nov 17 16:51:49 2020 +0000 Enhance syntax-tests.el to test nestable comments (Lisp style) Also add some tests for braces and parse-partial-sexp amongst Lisp style comments. * test/src/syntax-tests.el (\;-in, \;-out): Add syntax for { and }. (top-level): Add new tests for Lisp style comments. (\#|-in, \#|-out): New functions. (top-level): Add new tests for nested Lisp style comments, and mixtures of nested comments with "ordinary" comments. * test/src/syntax-resources/syntax-comments.txt (top-level): Add new test fragments for #|...|#, etc. diff --git a/test/src/syntax-resources/syntax-comments.txt b/test/src/syntax-resources/syntax-comments.txt index 6f595e4d8d..a292d816b9 100644 --- a/test/src/syntax-resources/syntax-comments.txt +++ b/test/src/syntax-resources/syntax-comments.txt @@ -62,7 +62,33 @@ 33; \ 33 +/* Lisp comments within lists */ +40)40 +41(;90 comment +91)41 +42(;92\ +93)42 +43( ;94 +95 + +/* Nested Lisp comments */ +100|#100 +101#|# +102#||#102 +103#| Comment |#103 +104#| Comment +|#104 +105#|#|#105 +106#| #| Comment |# |#106 +107#|#|#|#|#|#|#|#|#| Comment |#|#|#|#|#|#|#|#|#107 + +/* Mixed Lisp comments */ +110; #| +110 +111#| ; |#111 + Local Variables: mode: fundamental eval: (set-syntax-table (make-syntax-table)) End: +999 \ No newline at end of file diff --git a/test/src/syntax-tests.el b/test/src/syntax-tests.el index 4b9c3f277a..edee01ec58 100644 --- a/test/src/syntax-tests.el +++ b/test/src/syntax-tests.el @@ -220,7 +220,7 @@ missing or nil, the value of -START- is assumed for it." (cond ((eq -dir- 'forward) t) ((eq -dir- 'backward) nil) - (t (error "Invalid -dir- argument \"%s\" to `syntax-comments'" -dir-)))) + (t (error "Invalid -dir- argument \"%s\" to `syntax-br-comments'" -dir-)))) (start -start-) (start-str (format "%d" (abs start))) (type -type-)) @@ -338,10 +338,14 @@ the `parse-partial-sexp's are expected to stop. See (setq parse-sexp-ignore-comments t) (setq comment-end-can-be-escaped nil) (modify-syntax-entry ?\n ">") - (modify-syntax-entry ?\; "<")) + (modify-syntax-entry ?\; "<") + (modify-syntax-entry ?{ ".") + (modify-syntax-entry ?} ".")) (defun \;-out () (modify-syntax-entry ?\n " ") - (modify-syntax-entry ?\; ".")) + (modify-syntax-entry ?\; ".") + (modify-syntax-entry ?{ "(}") + (modify-syntax-entry ?} "){")) (eval-and-compile (setq syntax-comments-section "lisp")) @@ -353,6 +357,62 @@ the `parse-partial-sexp's are expected to stop. See (syntax-comments \; forward t 33) (syntax-comments \; backward t 33) +;; "Lisp" style comments inside lists. +(syntax-br-comments \; backward nil 40) +(syntax-br-comments \; forward t 41) +(syntax-br-comments \; backward t 41) +(syntax-br-comments \; forward t 42) +(syntax-br-comments \; backward t 42) +(syntax-br-comments \; forward nil 43) + +;; "Lisp" style comments parsed by `parse-partial-sexp'. +(syntax-pps-comments \; 41 90 91) +(syntax-pps-comments \; 42 92 93) +(syntax-pps-comments \; 43 94 95 -999) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; "Lisp" style nested comments: between delimiters #| |#. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defun \#|-in () + (setq parse-sexp-ignore-comments t) + (modify-syntax-entry ?# ". 14") + (modify-syntax-entry ?| ". 23n") + (modify-syntax-entry ?\; "< b") + (modify-syntax-entry ?\n "> b")) +(defun \#|-out () + (modify-syntax-entry ?# ".") + (modify-syntax-entry ?| ".") + (modify-syntax-entry ?\; ".") + (modify-syntax-entry ?\n " ")) +(eval-and-compile + (setq syntax-comments-section "lisp-n")) + +(syntax-comments \#| forward nil 100 0) +(syntax-comments \#| backward nil 100 0) +(syntax-comments \#| forward nil 101 -999) +(syntax-comments \#| forward t 102) +(syntax-comments \#| backward t 102) + +(syntax-comments \#| forward t 103) +(syntax-comments \#| backward t 103) +(syntax-comments \#| forward t 104) +(syntax-comments \#| backward t 104) + +(syntax-comments \#| forward nil 105 -999) +(syntax-comments \#| backward t 105) +(syntax-comments \#| forward t 106) +(syntax-comments \#| backward t 106) +(syntax-comments \#| forward t 107) +(syntax-comments \#| backward t 107) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Mixed "Lisp" style (nested and unnested) comments. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(syntax-comments \#| forward t 110) +(syntax-comments \#| backward t 110) +(syntax-comments \#| forward t 111) +(syntax-comments \#| backward t 111) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Emacs 27 "C" style comments - `comment-end-can-be-escaped' is non-nil. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; commit 030ad21afecdd718ce741cff9666c1913a8211df Author: Stefan Kangas Date: Tue Nov 17 02:51:30 2020 +0100 Don't quote lambdas with 'function' in calc/*.el * lisp/calc/calc-aent.el (calc-do-quick-calc) (calc-do-calc-eval, math-build-parse-table): * lisp/calc/calc-alg.el (math-polynomial-base): * lisp/calc/calc-alg.el (math-is-poly-rec): * lisp/calc/calc-arith.el (calcFunc-scf): * lisp/calc/calc-arith.el (math-ceiling, math-round): * lisp/calc/calc-arith.el (math-trunc-fancy, math-floor-fancy): * lisp/calc/calc-ext.el (calc-init-extensions, calc-reset) (calc-refresh-top, calc-z-prefix-help, calc-binary-op-fancy) (calc-unary-op-fancy): * lisp/calc/calc-forms.el (math-make-mod): * lisp/calc/calc-frac.el (calcFunc-frac): * lisp/calc/calc-funcs.el (calcFunc-euler): * lisp/calc/calc-help.el (calc-full-help): * lisp/calc/calc-lang.el (c, pascal, fortran, tex, latex, eqn) (yacas, maxima, giac, math, maple): * lisp/calc/calc-macs.el (calc-wrapper, calc-slow-wrapper): * lisp/calc/calc-map.el (calc-get-operator, calcFunc-mapeqr) (calcFunc-reducea, calcFunc-rreducea, calcFunc-reduced) (calcFunc-rreduced, calcFunc-outer): * lisp/calc/calc-misc.el (another-calc, calc-do-handle-whys): * lisp/calc/calc-mode.el (calc-save-modes): * lisp/calc/calc-mtx.el (math-col-matrix, math-mul-mat-vec): * lisp/calc/calc-poly.el (math-sort-terms, math-poly-div-list) (math-mul-list, math-sort-poly-base-list) (math-partial-fractions): * lisp/calc/calc-prog.el (calc-user-define-formula): * lisp/calc/calc-rewr.el (math-rewrite, math-compile-patterns) (math-compile-rewrites, math-parse-schedule) (math-rwcomp-pattern): * lisp/calc/calc-store.el (calc-var-name-map, calc-let) (calc-permanent-variable, calc-insert-variables): * lisp/calc/calc-stuff.el (calc-flush-caches, calcFunc-pclean) (calcFunc-pfrac): * lisp/calc/calc-units.el (math-build-units-table) (math-decompose-units): * lisp/calc/calc-vec.el (calcFunc-mrow, math-mat-col) (calcFunc-mcol, math-mat-less-col, math-mimic-ident): * lisp/calc/calc-yank.el (calc-edit): * lisp/calc/calc.el (calc-mode-var-list-restore-default-values) (calc-mode-var-list-restore-saved-values, calc-mode, calc-quit): * lisp/calc/calccomp.el (math-compose-expr) (math-compose-matrix, math-vector-to-string): Don't quote lambdas with 'function'. diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index 6c162b55f7..338f0ea43e 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -76,8 +76,8 @@ (calc-refresh-evaltos (nth 2 (nth 1 (car alg-exp)))) (setq alg-exp (list (nth 2 (car alg-exp))))) (setq calc-quick-prev-results alg-exp - buf (mapconcat (function (lambda (x) - (math-format-value x 1000))) + buf (mapconcat (lambda (x) + (math-format-value x 1000)) alg-exp " ") shortbuf buf) @@ -197,18 +197,17 @@ (calc-language (if (memq calc-language '(nil big)) 'flat calc-language)) (calc-dollar-values (mapcar - (function - (lambda (x) - (if (stringp x) - (progn - (setq x (math-read-exprs x)) - (if (eq (car-safe x) - 'error) - (throw 'calc-error - (calc-eval-error - (cdr x))) - (car x))) - x))) + (lambda (x) + (if (stringp x) + (progn + (setq x (math-read-exprs x)) + (if (eq (car-safe x) + 'error) + (throw 'calc-error + (calc-eval-error + (cdr x))) + (car x))) + x)) args)) (calc-dollar-used 0) (res (if (stringp str) @@ -640,10 +639,10 @@ in Calc algebraic input.") (math-find-user-tokens (car (car p))) (setq p (cdr p))) (setq calc-user-tokens (mapconcat 'identity - (sort (mapcar 'car math-toks) - (function (lambda (x y) - (> (length x) - (length y))))) + (sort (mapcar #'car math-toks) + (lambda (x y) + (> (length x) + (length y)))) "\\|") calc-last-main-parse-table mtab calc-last-user-lang-parse-table ltab diff --git a/lisp/calc/calc-alg.el b/lisp/calc/calc-alg.el index efb68395f7..53ca01d951 100644 --- a/lisp/calc/calc-alg.el +++ b/lisp/calc/calc-alg.el @@ -1785,7 +1785,7 @@ and should return the simplified expression to use (or nil)." (cons (nth 2 expr) math-poly-neg-powers)))) (not (Math-zerop (nth 2 expr))) (let ((p1 (math-is-poly-rec (nth 1 expr) negpow))) - (mapcar (function (lambda (x) (math-div x (nth 2 expr)))) + (mapcar (lambda (x) (math-div x (nth 2 expr))) p1)))) ((and (eq (car expr) 'calcFunc-exp) (equal math-var '(var e var-e))) @@ -1838,8 +1838,9 @@ and should return the simplified expression to use (or nil)." (defun math-polynomial-base (top-expr &optional pred) "Find the variable (or sub-expression) which is the base of polynomial expr." (let ((math-poly-base-pred - (or pred (function (lambda (base) (math-polynomial-p - top-expr base)))))) + (or pred (lambda (base) + (math-polynomial-p + top-expr base))))) (or (let ((math-poly-base-const-ok nil)) (math-polynomial-base-rec top-expr)) (let ((math-poly-base-const-ok t)) diff --git a/lisp/calc/calc-arith.el b/lisp/calc/calc-arith.el index ae397c4f2c..c11cecfd54 100644 --- a/lisp/calc/calc-arith.el +++ b/lisp/calc/calc-arith.el @@ -2390,7 +2390,7 @@ (math-trunc (nth 3 a))))) ((math-provably-integerp a) a) ((Math-vectorp a) - (math-map-vec (function (lambda (x) (math-trunc x math-trunc-prec))) a)) + (math-map-vec (lambda (x) (math-trunc x math-trunc-prec)) a)) ((math-infinitep a) (if (or (math-posp a) (math-negp a)) a @@ -2453,7 +2453,7 @@ (math-add (math-floor (nth 3 a)) -1) (math-floor (nth 3 a))))) ((Math-vectorp a) - (math-map-vec (function (lambda (x) (math-floor x math-floor-prec))) a)) + (math-map-vec (lambda (x) (math-floor x math-floor-prec)) a)) ((math-infinitep a) (if (or (math-posp a) (math-negp a)) a @@ -2520,7 +2520,7 @@ (math-ceiling (nth 2 a))) (math-ceiling (nth 3 a)))) ((Math-vectorp a) - (math-map-vec (function (lambda (x) (math-ceiling x prec))) a)) + (math-map-vec (lambda (x) (math-ceiling x prec)) a)) ((math-infinitep a) (if (or (math-posp a) (math-negp a)) a @@ -2573,7 +2573,7 @@ ((eq (car a) 'intv) (math-floor (math-add a '(frac 1 2)))) ((Math-vectorp a) - (math-map-vec (function (lambda (x) (math-round x prec))) a)) + (math-map-vec (lambda (x) (math-round x prec)) a)) ((math-infinitep a) (if (or (math-posp a) (math-negp a)) a @@ -2656,7 +2656,7 @@ (calcFunc-scf (nth 2 x) n) (calcFunc-scf (nth 3 x) n)))) ((eq (car x) 'vec) - (math-map-vec (function (lambda (x) (calcFunc-scf x n))) x)) + (math-map-vec (lambda (x) (calcFunc-scf x n)) x)) ((math-infinitep x) x) (t diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 23248ce1bd..4877fa6e08 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -678,14 +678,13 @@ (calc-init-prefixes) - (mapc (function - (lambda (x) + (mapc (lambda (x) (define-key calc-mode-map (format "c%c" x) 'calc-clean-num) (define-key calc-mode-map (format "j%c" x) 'calc-select-part) (define-key calc-mode-map (format "r%c" x) 'calc-recall-quick) (define-key calc-mode-map (format "s%c" x) 'calc-store-quick) (define-key calc-mode-map (format "t%c" x) 'calc-store-into-quick) - (define-key calc-mode-map (format "u%c" x) 'calc-quick-units))) + (define-key calc-mode-map (format "u%c" x) 'calc-quick-units)) "0123456789") (let ((i ?A)) @@ -711,9 +710,9 @@ (define-key calc-alg-map "\e\177" 'calc-pop-above) ;;;; (Autoloads here) - (mapc (function (lambda (x) - (mapcar (function (lambda (func) (autoload func (car x)))) - (cdr x)))) + (mapc (lambda (x) + (mapcar (lambda (func) (autoload func (car x))) + (cdr x))) '( ("calc-alg" calc-has-rules math-defsimplify @@ -980,9 +979,9 @@ calc-force-refresh calc-locate-cursor-element calc-show-edit-buffer) )) - (mapcar (function (lambda (x) - (mapcar (function (lambda (cmd) (autoload cmd (car x) nil t))) - (cdr x)))) + (mapcar (lambda (x) + (mapcar (lambda (cmd) (autoload cmd (car x) nil t)) + (cdr x))) '( ("calc-alg" calc-alg-evaluate calc-apart calc-collect calc-expand @@ -1358,7 +1357,7 @@ calc-kill calc-kill-region calc-yank)))) calc-redo-list nil) (let (calc-stack calc-user-parse-tables calc-standard-date-formats calc-invocation-macro) - (mapc (function (lambda (v) (set v nil))) calc-local-var-list) + (mapc (lambda (v) (set v nil)) calc-local-var-list) (if (and arg (<= arg 0)) (calc-mode-var-list-restore-default-values) (calc-mode-var-list-restore-saved-values))) @@ -1658,7 +1657,7 @@ calc-kill calc-kill-region calc-yank)))) (calc-pop-stack n 1 t) (calc-push-list (mapcar #'car entries) 1 - (mapcar (function (lambda (x) (nth 2 x))) + (mapcar (lambda (x) (nth 2 x)) entries))))))) (defvar calc-refreshing-evaltos nil) @@ -1924,11 +1923,10 @@ calc-kill calc-kill-region calc-yank)))) (let* ((calc-z-prefix-msgs nil) (calc-z-prefix-buf "") (kmap (sort (copy-sequence (calc-user-key-map)) - (function (lambda (x y) (< (car x) (car y)))))) + (lambda (x y) (< (car x) (car y))))) (flags (apply #'logior - (mapcar (function - (lambda (k) - (calc-user-function-classify (car k)))) + (mapcar (lambda (k) + (calc-user-function-classify (car k))) kmap)))) (if (= (logand flags 8) 0) (calc-user-function-list kmap 7) @@ -2633,9 +2631,8 @@ If X is not an error form, return 1." (let ((rhs (calc-top-n 1))) (calc-enter-result (- 1 n) name - (mapcar (function - (lambda (x) - (list func x rhs))) + (mapcar (lambda (x) + (list func x rhs)) (calc-top-list-n (- n) 2)))))))) (defun calc-unary-op-fancy (name func arg) @@ -2644,9 +2641,8 @@ If X is not an error form, return 1." (cond ((> n 0) (calc-enter-result n name - (mapcar (function - (lambda (x) - (list func x))) + (mapcar (lambda (x) + (list func x)) (calc-top-list-n n)))) ((< n 0) (calc-enter-result 1 diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index 465d4520b0..39116bfde9 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el @@ -2129,7 +2129,7 @@ and ends on the last Sunday of October at 2 a.m." ((memq (car n) '(+ - / vec neg)) (math-normalize (cons (car n) - (mapcar (function (lambda (x) (math-make-mod x m))) + (mapcar (lambda (x) (math-make-mod x m)) (cdr n))))) ((and (eq (car n) '*) (Math-anglep (nth 1 n))) (math-mul (math-make-mod (nth 1 n) m) (nth 2 n))) diff --git a/lisp/calc/calc-frac.el b/lisp/calc/calc-frac.el index 86a4808c5a..1d6895caa3 100644 --- a/lisp/calc/calc-frac.el +++ b/lisp/calc/calc-frac.el @@ -132,9 +132,8 @@ (cond ((Math-ratp a) a) ((memq (car a) '(cplx polar vec hms date sdev intv mod)) - (cons (car a) (mapcar (function - (lambda (x) - (calcFunc-frac x tol))) + (cons (car a) (mapcar (lambda (x) + (calcFunc-frac x tol)) (cdr a)))) ((Math-messy-integerp a) (math-trunc a)) diff --git a/lisp/calc/calc-funcs.el b/lisp/calc/calc-funcs.el index 5c179ff05d..9ee86e755e 100644 --- a/lisp/calc/calc-funcs.el +++ b/lisp/calc/calc-funcs.el @@ -797,12 +797,11 @@ (math-reduce-vec 'math-add (cons 'vec - (mapcar (function - (lambda (c) - (setq k (1+ k)) - (math-mul (math-mul fac c) - (math-sub (math-pow x1 k) - (math-pow x2 k))))) + (mapcar (lambda (c) + (setq k (1+ k)) + (math-mul (math-mul fac c) + (math-sub (math-pow x1 k) + (math-pow x2 k)))) coefs))) x))) (math-mul (math-pow 2 n) diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index 0b327e8d0f..06b4b9684e 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -402,32 +402,32 @@ C-w Describe how there is no warranty for Calc." "Or type `h i' to read the full Calc manual on-line.\n\n")) (princ "Basic keys:\n") (let* ((calc-full-help-flag t)) - (mapc (function (lambda (x) (princ (format - " %s\n" - (substitute-command-keys x))))) + (mapc (lambda (x) + (princ (format + " %s\n" + (substitute-command-keys x)))) (nreverse (cdr (reverse (cdr (calc-help)))))) - (mapc (function (lambda (prefix) - (let ((msgs (ignore-errors (funcall prefix)))) - (if (car msgs) - (princ - (if (eq (nth 2 msgs) ?v) - (format-message - "\n`v' or `V' prefix (vector/matrix) keys: \n") - (if (nth 2 msgs) - (format-message - "\n`%c' prefix (%s) keys:\n" - (nth 2 msgs) - (or (cdr (assq (nth 2 msgs) - calc-help-long-names)) - (nth 1 msgs))) - (format "\n%s-modified keys:\n" - (capitalize (nth 1 msgs))))))) - (mapcar (function - (lambda (x) - (princ (format - " %s\n" - (substitute-command-keys x))))) - (car msgs))))) + (mapc (lambda (prefix) + (let ((msgs (ignore-errors (funcall prefix)))) + (if (car msgs) + (princ + (if (eq (nth 2 msgs) ?v) + (format-message + "\n`v' or `V' prefix (vector/matrix) keys: \n") + (if (nth 2 msgs) + (format-message + "\n`%c' prefix (%s) keys:\n" + (nth 2 msgs) + (or (cdr (assq (nth 2 msgs) + calc-help-long-names)) + (nth 1 msgs))) + (format "\n%s-modified keys:\n" + (capitalize (nth 1 msgs))))))) + (mapcar (lambda (x) + (princ (format + " %s\n" + (substitute-command-keys x)))) + (car msgs)))) '(calc-inverse-prefix-help calc-hyperbolic-prefix-help calc-inv-hyp-prefix-help diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el index bde5abe649..283069446e 100644 --- a/lisp/calc/calc-lang.el +++ b/lisp/calc/calc-lang.el @@ -175,20 +175,19 @@ (put 'c 'math-vector-brackets "{}") (put 'c 'math-radix-formatter - (function (lambda (r s) - (if (= r 16) (format "0x%s" s) - (if (= r 8) (format "0%s" s) - (format "%d#%s" r s)))))) + (lambda (r s) + (if (= r 16) (format "0x%s" s) + (if (= r 8) (format "0%s" s) + (format "%d#%s" r s))))) (put 'c 'math-compose-subscr - (function - (lambda (a) - (let ((args (cdr (cdr a)))) - (list 'horiz - (math-compose-expr (nth 1 a) 1000) - "[" - (math-compose-vector args ", " 0) - "]"))))) + (lambda (a) + (let ((args (cdr (cdr a)))) + (list 'horiz + (math-compose-expr (nth 1 a) 1000) + "[" + (math-compose-vector args ", " 0) + "]")))) (add-to-list 'calc-lang-slash-idiv 'c) (add-to-list 'calc-lang-allow-underscores 'c) @@ -238,9 +237,9 @@ (put 'pascal 'math-output-filter 'calc-output-case-filter) (put 'pascal 'math-radix-formatter - (function (lambda (r s) - (if (= r 16) (format "$%s" s) - (format "%d#%s" r s))))) + (lambda (r s) + (if (= r 16) (format "$%s" s) + (format "%d#%s" r s)))) (put 'pascal 'math-lang-read-symbol '((?\$ @@ -253,17 +252,16 @@ math-exp-pos (match-end 1))))) (put 'pascal 'math-compose-subscr - (function - (lambda (a) - (let ((args (cdr (cdr a)))) - (while (eq (car-safe (nth 1 a)) 'calcFunc-subscr) - (setq args (append (cdr (cdr (nth 1 a))) args) - a (nth 1 a))) - (list 'horiz - (math-compose-expr (nth 1 a) 1000) - "[" - (math-compose-vector args ", " 0) - "]"))))) + (lambda (a) + (let ((args (cdr (cdr a)))) + (while (eq (car-safe (nth 1 a)) 'calcFunc-subscr) + (setq args (append (cdr (cdr (nth 1 a))) args) + a (nth 1 a))) + (list 'horiz + (math-compose-expr (nth 1 a) 1000) + "[" + (math-compose-vector args ", " 0) + "]")))) (add-to-list 'calc-lang-allow-underscores 'pascal) (add-to-list 'calc-lang-brackets-are-subscripts 'pascal) @@ -350,17 +348,16 @@ math-exp-pos (match-end 0))))) (put 'fortran 'math-compose-subscr - (function - (lambda (a) - (let ((args (cdr (cdr a)))) - (while (eq (car-safe (nth 1 a)) 'calcFunc-subscr) - (setq args (append (cdr (cdr (nth 1 a))) args) - a (nth 1 a))) - (list 'horiz - (math-compose-expr (nth 1 a) 1000) - "(" - (math-compose-vector args ", " 0) - ")"))))) + (lambda (a) + (let ((args (cdr (cdr a)))) + (while (eq (car-safe (nth 1 a)) 'calcFunc-subscr) + (setq args (append (cdr (cdr (nth 1 a))) args) + a (nth 1 a))) + (list 'horiz + (math-compose-expr (nth 1 a) 1000) + "(" + (math-compose-vector args ", " 0) + ")")))) (add-to-list 'calc-lang-slash-idiv 'fortran) (add-to-list 'calc-lang-allow-underscores 'fortran) @@ -598,18 +595,17 @@ (put 'tex 'math-input-filter 'math-tex-input-filter) (put 'tex 'math-matrix-formatter - (function - (lambda (a) - (if (and (integerp calc-language-option) - (or (= calc-language-option 0) - (> calc-language-option 1) - (< calc-language-option -1))) - (append '(vleft 0 "\\matrix{") - (math-compose-tex-matrix (cdr a)) - '("}")) - (append '(horiz "\\matrix{ ") - (math-compose-tex-matrix (cdr a)) - '(" }")))))) + (lambda (a) + (if (and (integerp calc-language-option) + (or (= calc-language-option 0) + (> calc-language-option 1) + (< calc-language-option -1))) + (append '(vleft 0 "\\matrix{") + (math-compose-tex-matrix (cdr a)) + '("}")) + (append '(horiz "\\matrix{ ") + (math-compose-tex-matrix (cdr a)) + '(" }"))))) (put 'tex 'math-var-formatter 'math-compose-tex-var) @@ -839,18 +835,17 @@ (put 'latex 'math-complex-format 'i) (put 'latex 'math-matrix-formatter - (function - (lambda (a) - (if (and (integerp calc-language-option) - (or (= calc-language-option 0) - (> calc-language-option 1) - (< calc-language-option -1))) - (append '(vleft 0 "\\begin{pmatrix}") - (math-compose-tex-matrix (cdr a) t) - '("\\end{pmatrix}")) - (append '(horiz "\\begin{pmatrix} ") - (math-compose-tex-matrix (cdr a) t) - '(" \\end{pmatrix}")))))) + (lambda (a) + (if (and (integerp calc-language-option) + (or (= calc-language-option 0) + (> calc-language-option 1) + (< calc-language-option -1))) + (append '(vleft 0 "\\begin{pmatrix}") + (math-compose-tex-matrix (cdr a) t) + '("\\end{pmatrix}")) + (append '(horiz "\\begin{pmatrix} ") + (math-compose-tex-matrix (cdr a) t) + '(" \\end{pmatrix}"))))) (put 'latex 'math-var-formatter 'math-compose-tex-var) @@ -1023,36 +1018,34 @@ (put 'eqn 'math-evalto '("evalto " . " -> ")) (put 'eqn 'math-matrix-formatter - (function - (lambda (a) - (append '(horiz "matrix { ") - (math-compose-eqn-matrix - (cdr (math-transpose a))) - '("}"))))) + (lambda (a) + (append '(horiz "matrix { ") + (math-compose-eqn-matrix + (cdr (math-transpose a))) + '("}")))) (put 'eqn 'math-var-formatter - (function - (lambda (a prec) - (let (v) - (if (and math-compose-hash-args - (let ((p calc-arg-values)) - (setq v 1) - (while (and p (not (equal (car p) a))) - (setq p (and (eq math-compose-hash-args t) (cdr p)) - v (1+ v))) - p)) - (if (eq math-compose-hash-args 1) - "#" - (format "#%d" v)) - (if (string-match ".'\\'" (symbol-name (nth 2 a))) - (math-compose-expr - (list 'calcFunc-Prime - (list - 'var - (intern (substring (symbol-name (nth 1 a)) 0 -1)) - (intern (substring (symbol-name (nth 2 a)) 0 -1)))) - prec) - (symbol-name (nth 1 a)))))))) + (lambda (a prec) + (let (v) + (if (and math-compose-hash-args + (let ((p calc-arg-values)) + (setq v 1) + (while (and p (not (equal (car p) a))) + (setq p (and (eq math-compose-hash-args t) (cdr p)) + v (1+ v))) + p)) + (if (eq math-compose-hash-args 1) + "#" + (format "#%d" v)) + (if (string-match ".'\\'" (symbol-name (nth 2 a))) + (math-compose-expr + (list 'calcFunc-Prime + (list + 'var + (intern (substring (symbol-name (nth 1 a)) 0 -1)) + (intern (substring (symbol-name (nth 2 a)) 0 -1)))) + prec) + (symbol-name (nth 1 a))))))) (defconst math-eqn-special-funcs '( calcFunc-log @@ -1065,31 +1058,30 @@ calcFunc-arcsinh calcFunc-arccosh calcFunc-arctanh)) (put 'eqn 'math-func-formatter - (function - (lambda (func a) - (let (left right) - (if (string-match "[^']'+\\'" func) - (let ((n (- (length func) (match-beginning 0) 1))) - (setq func (substring func 0 (- n))) - (while (>= (setq n (1- n)) 0) - (setq func (concat func " prime"))))) - (cond ((or (> (length a) 2) - (not (math-tex-expr-is-flat (nth 1 a)))) - (setq left "{left ( " - right " right )}")) - - ((and - (memq (car a) math-eqn-special-funcs) - (= (length a) 2) - (or (Math-realp (nth 1 a)) - (memq (car (nth 1 a)) '(var *)))) - (setq left "~{" right "}")) - (t - (setq left " ( " - right " )"))) - (list 'horiz func left - (math-compose-vector (cdr a) " , " 0) - right))))) + (lambda (func a) + (let (left right) + (if (string-match "[^']'+\\'" func) + (let ((n (- (length func) (match-beginning 0) 1))) + (setq func (substring func 0 (- n))) + (while (>= (setq n (1- n)) 0) + (setq func (concat func " prime"))))) + (cond ((or (> (length a) 2) + (not (math-tex-expr-is-flat (nth 1 a)))) + (setq left "{left ( " + right " right )}")) + + ((and + (memq (car a) math-eqn-special-funcs) + (= (length a) 2) + (or (Math-realp (nth 1 a)) + (memq (car (nth 1 a)) '(var *)))) + (setq left "~{" right "}")) + (t + (setq left " ( " + right " )"))) + (list 'horiz func left + (math-compose-vector (cdr a) " , " 0) + right)))) (put 'eqn 'math-lang-read-symbol '((?\" @@ -1111,23 +1103,22 @@ ("above" punc ","))) (put 'eqn 'math-lang-adjust-words - (function - (lambda () - (let ((code (assoc math-expr-data math-eqn-ignore-words))) - (cond ((null code)) - ((null (cdr code)) - (math-read-token)) - ((consp (nth 1 code)) - (math-read-token) - (if (assoc math-expr-data (cdr code)) - (setq math-expr-data (format "%s %s" - (car code) math-expr-data)))) - ((eq (nth 1 code) 'punc) - (setq math-exp-token 'punc - math-expr-data (nth 2 code))) - (t - (math-read-token) - (math-read-token))))))) + (lambda () + (let ((code (assoc math-expr-data math-eqn-ignore-words))) + (cond ((null code)) + ((null (cdr code)) + (math-read-token)) + ((consp (nth 1 code)) + (math-read-token) + (if (assoc math-expr-data (cdr code)) + (setq math-expr-data (format "%s %s" + (car code) math-expr-data)))) + ((eq (nth 1 code) 'punc) + (setq math-exp-token 'punc + math-expr-data (nth 2 code))) + (t + (math-read-token) + (math-read-token)))))) (put 'eqn 'math-lang-read '((eq (string-match "->\\|<-\\|\\+-\\|\\\\dots\\|~\\|\\^" @@ -1357,14 +1348,13 @@ ( calcFunc-in . (math-lang-compose-switch-args "Contains")))) (put 'yacas 'math-compose-subscr - (function - (lambda (a) - (let ((args (cdr (cdr a)))) - (list 'horiz - (math-compose-expr (nth 1 a) 1000) - "[" - (math-compose-vector args ", " 0) - "]"))))) + (lambda (a) + (let ((args (cdr (cdr a)))) + (list 'horiz + (math-compose-expr (nth 1 a) 1000) + "[" + (math-compose-vector args ", " 0) + "]")))) (defun math-yacas-parse-Sum (f _val) "Read in the arguments to \"Sum\" in Calc's Yacas mode." @@ -1600,24 +1590,22 @@ (add-to-list 'calc-lang-brackets-are-subscripts 'maxima) (put 'maxima 'math-compose-subscr - (function - (lambda (a) - (let ((args (cdr (cdr a)))) - (list 'horiz - (math-compose-expr (nth 1 a) 1000) - "[" - (math-compose-vector args ", " 0) - "]"))))) + (lambda (a) + (let ((args (cdr (cdr a)))) + (list 'horiz + (math-compose-expr (nth 1 a) 1000) + "[" + (math-compose-vector args ", " 0) + "]")))) (put 'maxima 'math-matrix-formatter - (function - (lambda (a) - (list 'horiz - "matrix(" - (math-compose-vector (cdr a) - (concat math-comp-comma " ") - math-comp-vector-prec) - ")")))) + (lambda (a) + (list 'horiz + "matrix(" + (math-compose-vector (cdr a) + (concat math-comp-comma " ") + math-comp-vector-prec) + ")"))) ;;; Giac @@ -1806,15 +1794,14 @@ order to Calc's." (add-to-list 'calc-lang-allow-underscores 'giac) (put 'giac 'math-compose-subscr - (function - (lambda (a) - ;; (let ((args (cdr (cdr a)))) - (list 'horiz - (math-compose-expr (nth 1 a) 1000) - "[" - (math-compose-expr - (calc-normalize (list '- (nth 2 a) 1)) 0) - "]")))) ;;) + (lambda (a) + ;; (let ((args (cdr (cdr a)))) + (list 'horiz + (math-compose-expr (nth 1 a) 1000) + "[" + (math-compose-expr + (calc-normalize (list '- (nth 2 a) 1)) 0) + "]"))) ;;) (defun math-read-giac-subscr (x _op) (let ((idx (math-read-expr-level 0))) @@ -1932,7 +1919,7 @@ order to Calc's." (put 'math 'math-function-close "]") (put 'math 'math-radix-formatter - (function (lambda (r s) (format "%d^^%s" r s)))) + (lambda (r s) (format "%d^^%s" r s))) (put 'math 'math-lang-read '((eq (string-match "\\[\\[\\|->\\|:>" math-exp-str math-exp-pos) @@ -1942,13 +1929,12 @@ order to Calc's." math-exp-pos (match-end 0)))) (put 'math 'math-compose-subscr - (function - (lambda (a) - (list 'horiz - (math-compose-expr (nth 1 a) 1000) - "[[" - (math-compose-expr (nth 2 a) 0) - "]]")))) + (lambda (a) + (list 'horiz + (math-compose-expr (nth 1 a) 1000) + "[[" + (math-compose-expr (nth 2 a) 0) + "]]"))) (defun math-read-math-subscr (x _op) (let ((idx (math-read-expr-level 0))) @@ -2038,26 +2024,24 @@ order to Calc's." (put 'maple 'math-complex-format 'I) (put 'maple 'math-matrix-formatter - (function - (lambda (a) - (list 'horiz - "matrix(" - math-comp-left-bracket - (math-compose-vector (cdr a) - (concat math-comp-comma " ") - math-comp-vector-prec) - math-comp-right-bracket - ")")))) + (lambda (a) + (list 'horiz + "matrix(" + math-comp-left-bracket + (math-compose-vector (cdr a) + (concat math-comp-comma " ") + math-comp-vector-prec) + math-comp-right-bracket + ")"))) (put 'maple 'math-compose-subscr - (function - (lambda (a) - (let ((args (cdr (cdr a)))) - (list 'horiz - (math-compose-expr (nth 1 a) 1000) - "[" - (math-compose-vector args ", " 0) - "]"))))) + (lambda (a) + (let ((args (cdr (cdr a)))) + (list 'horiz + (math-compose-expr (nth 1 a) 1000) + "[" + (math-compose-vector args ", " 0) + "]")))) (add-to-list 'calc-lang-allow-underscores 'maple) (add-to-list 'calc-lang-brackets-are-subscripts 'maple) diff --git a/lisp/calc/calc-macs.el b/lisp/calc/calc-macs.el index 5aaa5f48d6..06ef3ef055 100644 --- a/lisp/calc/calc-macs.el +++ b/lisp/calc/calc-macs.el @@ -33,12 +33,12 @@ (defmacro calc-wrapper (&rest body) - `(calc-do (function (lambda () - ,@body)))) + `(calc-do (lambda () + ,@body))) (defmacro calc-slow-wrapper (&rest body) `(calc-do - (function (lambda () ,@body)) (point))) + (lambda () ,@body) (point))) (defmacro math-showing-full-precision (form) `(let ((calc-float-format calc-full-float-format)) diff --git a/lisp/calc/calc-map.el b/lisp/calc/calc-map.el index 0ee8282692..3e2869d146 100644 --- a/lisp/calc/calc-map.el +++ b/lisp/calc/calc-map.el @@ -612,14 +612,13 @@ "()") minibuffer-local-map t))) - (setq math-arglist (mapcar (function - (lambda (x) - (list 'var - x - (intern - (concat - "var-" - (symbol-name x)))))) + (setq math-arglist (mapcar (lambda (x) + (list 'var + x + (intern + (concat + "var-" + (symbol-name x))))) math-arglist)))) (setq oper (list "$" (length math-arglist) @@ -962,12 +961,12 @@ (apply 'calcFunc-mapeqp func args))) (defun calcFunc-mapeqr (func &rest args) - (setq args (mapcar (function (lambda (x) - (let ((func (assq (car-safe x) - calc-tweak-eqn-table))) - (if func - (cons (nth 1 func) (cdr x)) - x)))) + (setq args (mapcar (lambda (x) + (let ((func (assq (car-safe x) + calc-tweak-eqn-table))) + (if func + (cons (nth 1 func) (cdr x)) + x))) args)) (apply 'calcFunc-mapeqp func args)) @@ -1092,28 +1091,28 @@ (defun calcFunc-reducea (func vec) (if (math-matrixp vec) (cons 'vec - (mapcar (function (lambda (x) (calcFunc-reducer func x))) + (mapcar (lambda (x) (calcFunc-reducer func x)) (cdr vec))) (calcFunc-reducer func vec))) (defun calcFunc-rreducea (func vec) (if (math-matrixp vec) (cons 'vec - (mapcar (function (lambda (x) (calcFunc-rreducer func x))) + (mapcar (lambda (x) (calcFunc-rreducer func x)) (cdr vec))) (calcFunc-rreducer func vec))) (defun calcFunc-reduced (func vec) (if (math-matrixp vec) (cons 'vec - (mapcar (function (lambda (x) (calcFunc-reducer func x))) + (mapcar (lambda (x) (calcFunc-reducer func x)) (cdr (math-transpose vec)))) (calcFunc-reducer func vec))) (defun calcFunc-rreduced (func vec) (if (math-matrixp vec) (cons 'vec - (mapcar (function (lambda (x) (calcFunc-rreducer func x))) + (mapcar (lambda (x) (calcFunc-rreducer func x)) (cdr (math-transpose vec)))) (calcFunc-rreducer func vec))) @@ -1216,10 +1215,10 @@ (let ((mat nil)) (while (setq a (cdr a)) (setq mat (cons (cons 'vec - (mapcar (function (lambda (x) - (math-build-call func - (list (car a) - x)))) + (mapcar (lambda (x) + (math-build-call func + (list (car a) + x))) (cdr b))) mat))) (math-normalize (cons 'vec (nreverse mat))))) diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el index 2db09e2b67..ada754a397 100644 --- a/lisp/calc/calc-misc.el +++ b/lisp/calc/calc-misc.el @@ -176,9 +176,9 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C). "Create another, independent Calculator buffer." (interactive) (if (eq major-mode 'calc-mode) - (mapc (function - (lambda (v) - (set-default v (symbol-value v)))) calc-local-var-list)) + (mapc (lambda (v) + (set-default v (symbol-value v))) + calc-local-var-list)) (set-buffer (generate-new-buffer "*Calculator*")) (pop-to-buffer (current-buffer)) (calc-mode)) @@ -274,9 +274,8 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C). ;;;###autoload (defun calc-do-handle-whys () (setq calc-why (sort calc-next-why - (function - (lambda (x y) - (and (eq (car x) '*) (not (eq (car y) '*)))))) + (lambda (x y) + (and (eq (car x) '*) (not (eq (car y) '*))))) calc-next-why nil) (if (and calc-why (or (eq calc-auto-why t) (and (eq (car (car calc-why)) '*) diff --git a/lisp/calc/calc-mode.el b/lisp/calc/calc-mode.el index e109233a82..358854bc93 100644 --- a/lisp/calc/calc-mode.el +++ b/lisp/calc/calc-mode.el @@ -268,7 +268,7 @@ (interactive) (calc-wrapper (let (pos - (vals (mapcar (function (lambda (v) (symbol-value (car v)))) + (vals (mapcar (lambda (v) (symbol-value (car v))) calc-mode-var-list))) (unless calc-settings-file (error "No `calc-settings-file' specified")) diff --git a/lisp/calc/calc-mtx.el b/lisp/calc/calc-mtx.el index 8deef7dc4f..bfcd61ddcd 100644 --- a/lisp/calc/calc-mtx.el +++ b/lisp/calc/calc-mtx.el @@ -55,7 +55,7 @@ (defun math-col-matrix (a) (if (and (Math-vectorp a) (not (math-matrixp a))) - (cons 'vec (mapcar (function (lambda (x) (list 'vec x))) (cdr a))) + (cons 'vec (mapcar (lambda (x) (list 'vec x)) (cdr a))) a)) @@ -79,8 +79,8 @@ (cons 'vec (nreverse mat)))) (defun math-mul-mat-vec (a b) - (cons 'vec (mapcar (function (lambda (row) - (math-dot-product row b))) + (cons 'vec (mapcar (lambda (row) + (math-dot-product row b)) (cdr a)))) diff --git a/lisp/calc/calc-poly.el b/lisp/calc/calc-poly.el index b3f2c96b0c..5928a8ee47 100644 --- a/lisp/calc/calc-poly.el +++ b/lisp/calc/calc-poly.el @@ -202,7 +202,7 @@ (if (memq (car-safe expr) '(+ -)) (math-list-to-sum (sort (math-sum-to-list expr) - (function (lambda (a b) (math-beforep (car a) (car b)))))) + (lambda (a b) (math-beforep (car a) (car b))))) expr)) (defun math-list-to-sum (lst) @@ -387,7 +387,7 @@ This returns only the remainder from the pseudo-division." lst (if (eq a -1) (math-mul-list lst a) - (mapcar (function (lambda (x) (math-poly-div-exact x a))) lst)))) + (mapcar (lambda (x) (math-poly-div-exact x a)) lst)))) (defun math-mul-list (lst a) (if (eq a 1) @@ -395,7 +395,7 @@ This returns only the remainder from the pseudo-division." (if (eq a -1) (mapcar 'math-neg lst) (and (not (eq a 0)) - (mapcar (function (lambda (x) (math-mul x a))) lst))))) + (mapcar (lambda (x) (math-mul x a)) lst))))) ;;; Run GCD on all elements in a list. (defun math-poly-gcd-list (lst) @@ -502,10 +502,10 @@ Take the base that has the highest degree considering both a and b. (defun math-sort-poly-base-list (lst) "Sort a list of polynomial bases." - (sort lst (function (lambda (a b) - (or (> (nth 1 a) (nth 1 b)) - (and (= (nth 1 a) (nth 1 b)) - (math-beforep (car a) (car b)))))))) + (sort lst (lambda (a b) + (or (> (nth 1 a) (nth 1 b)) + (and (= (nth 1 a) (nth 1 b)) + (math-beforep (car a) (car b))))))) ;;; Given an expression find all variables that are polynomial bases. ;;; Return list in the form '( (var1 degree1) (var2 degree2) ... ). @@ -1033,10 +1033,9 @@ If no partial fraction representation can be found, return nil." (math-transpose (cons 'vec (mapcar - (function - (lambda (x) - (cons 'vec (math-padded-polynomial - x var tdeg)))) + (lambda (x) + (cons 'vec (math-padded-polynomial + x var tdeg))) (cdr eqns)))))) (and (math-vectorp eqns) (let ((res 0) diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index ea9c49748e..781ba5c8b6 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -182,7 +182,7 @@ odef key keyname cmd cmd-base cmd-base-default func calc-user-formula-alist is-symb) (if is-lambda - (setq math-arglist (mapcar (function (lambda (x) (nth 1 x))) + (setq math-arglist (mapcar (lambda (x) (nth 1 x)) (nreverse (cdr (reverse (cdr form))))) form (nth (1- (length form)) form)) (calc-default-formula-arglist form) @@ -290,10 +290,10 @@ (y-or-n-p "Leave it symbolic for non-constant arguments? "))) (setq calc-user-formula-alist - (mapcar (function (lambda (x) - (or (cdr (assq x '((nil . arg-nil) - (t . arg-t)))) - x))) calc-user-formula-alist)) + (mapcar (lambda (x) + (or (cdr (assq x '((nil . arg-nil) + (t . arg-t)))) + x)) calc-user-formula-alist)) (if cmd (progn (require 'calc-macs) @@ -319,8 +319,8 @@ (append (list 'lambda calc-user-formula-alist) (and is-symb - (mapcar (function (lambda (v) - (list 'math-check-const v t))) + (mapcar (lambda (v) + (list 'math-check-const v t)) calc-user-formula-alist)) (list body)))) (put func 'calc-user-defn form) diff --git a/lisp/calc/calc-rewr.el b/lisp/calc/calc-rewr.el index 2cc7b6beef..1528e12ae0 100644 --- a/lisp/calc/calc-rewr.el +++ b/lisp/calc/calc-rewr.el @@ -181,19 +181,18 @@ (calc-line-numbering nil) (calc-show-selections t) (calc-why nil) - (math-mt-func (function - (lambda (x) - (let ((result (math-apply-rewrites x (cdr crules) - heads crules))) - (if result - (progn - (if trace-buffer - (let ((fmt (math-format-stack-value - (list result nil nil)))) - (with-current-buffer trace-buffer - (insert "\nrewrite to\n" fmt "\n")))) - (setq heads (math-rewrite-heads result heads t)))) - result))))) + (math-mt-func (lambda (x) + (let ((result (math-apply-rewrites x (cdr crules) + heads crules))) + (if result + (progn + (if trace-buffer + (let ((fmt (math-format-stack-value + (list result nil nil)))) + (with-current-buffer trace-buffer + (insert "\nrewrite to\n" fmt "\n")))) + (setq heads (math-rewrite-heads result heads t)))) + result)))) (if trace-buffer (let ((fmt (math-format-stack-value (list math-rewrite-whole-expr nil nil)))) (with-current-buffer trace-buffer @@ -485,8 +484,8 @@ (let ((math-rewrite-whole t)) (cdr (math-compile-rewrites (cons 'vec - (mapcar (function (lambda (x) - (list 'vec x t))) + (mapcar (lambda (x) + (list 'vec x t)) (if (eq (car-safe pats) 'vec) (cdr pats) (list pats))))))))) @@ -656,15 +655,14 @@ nil (nreverse (mapcar - (function - (lambda (v) - (and (car v) - (list - 'calcFunc-assign - (math-build-var-name - (car v)) - (math-rwcomp-register-expr - (nth 1 v)))))) + (lambda (v) + (and (car v) + (list + 'calcFunc-assign + (math-build-var-name + (car v)) + (math-rwcomp-register-expr + (nth 1 v))))) math-regs)))) (math-rwcomp-match-vars math-rhs)) math-remembering) @@ -672,7 +670,7 @@ (let* ((heads (math-rewrite-heads math-pattern)) (rule (list (vconcat (nreverse - (mapcar (function (lambda (x) (nth 3 x))) + (mapcar (lambda (x) (nth 3 x)) math-regs))) math-prog heads @@ -724,10 +722,9 @@ (setq rules (cdr rules))) (if nil-rules (setq rule-set (cons (cons nil nil-rules) rule-set))) - (setq all-heads (mapcar 'car - (sort all-heads (function - (lambda (x y) - (< (cdr x) (cdr y))))))) + (setq all-heads (mapcar #'car + (sort all-heads (lambda (x y) + (< (cdr x) (cdr y)))))) (let ((set rule-set) rule heads ptr) (while set @@ -790,15 +787,14 @@ (math-rewrite-heads-rec (car expr))))))) (defun math-parse-schedule (sched) - (mapcar (function - (lambda (s) - (if (integerp s) - s - (if (math-vectorp s) - (math-parse-schedule (cdr s)) - (if (eq (car-safe s) 'var) - (math-var-to-calcFunc s) - (error "Improper component in rewrite schedule")))))) + (mapcar (lambda (s) + (if (integerp s) + s + (if (math-vectorp s) + (math-parse-schedule (cdr s)) + (if (eq (car-safe s) 'var) + (math-var-to-calcFunc s) + (error "Improper component in rewrite schedule"))))) sched)) (defun math-rwcomp-match-vars (expr) @@ -1180,9 +1176,8 @@ (list 'calcFunc-register reg2)))) (math-rwcomp-pattern (car arg2) (cdr arg2)))) - (let* ((args (mapcar (function - (lambda (x) - (cons x (math-rwcomp-best-reg x)))) + (let* ((args (mapcar (lambda (x) + (cons x (math-rwcomp-best-reg x))) (cdr expr))) (args2 (copy-sequence args)) (argp (reverse args2)) diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index a1e385cb40..8f83f34d74 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el @@ -168,15 +168,13 @@ () (setq calc-var-name-map (copy-keymap minibuffer-local-completion-map)) (define-key calc-var-name-map " " 'self-insert-command) - (mapc (function - (lambda (x) + (mapc (lambda (x) (define-key calc-var-name-map (char-to-string x) - 'calcVar-digit))) + 'calcVar-digit)) "0123456789") - (mapc (function - (lambda (x) + (mapc (lambda (x) (define-key calc-var-name-map (char-to-string x) - 'calcVar-oper))) + 'calcVar-oper)) "+-*/^|")) (defvar calc-store-opers) @@ -324,10 +322,9 @@ (calc-pop-push-record (1+ calc-given-value-flag) (concat "=" (calc-var-name (car (car var)))) - (let ((saved-val (mapcar (function - (lambda (v) - (and (boundp (car v)) - (symbol-value (car v))))) + (let ((saved-val (mapcar (lambda (v) + (and (boundp (car v)) + (symbol-value (car v)))) var))) (unwind-protect (let ((vv var)) @@ -597,13 +594,12 @@ calc-settings-file))) (if var (calc-insert-permanent-variable var) - (mapatoms (function - (lambda (x) - (and (string-match "\\`var-" (symbol-name x)) - (not (memq x calc-dont-insert-variables)) - (calc-var-value x) - (not (eq (car-safe (symbol-value x)) 'special-const)) - (calc-insert-permanent-variable x)))))) + (mapatoms (lambda (x) + (and (string-match "\\`var-" (symbol-name x)) + (not (memq x calc-dont-insert-variables)) + (calc-var-value x) + (not (eq (car-safe (symbol-value x)) 'special-const)) + (calc-insert-permanent-variable x))))) (save-buffer)))) @@ -638,27 +634,26 @@ (defun calc-insert-variables (buf) (interactive "bBuffer in which to save variable values: ") (with-current-buffer buf - (mapatoms (function - (lambda (x) - (and (string-match "\\`var-" (symbol-name x)) - (not (memq x calc-dont-insert-variables)) - (calc-var-value x) - (not (eq (car-safe (symbol-value x)) 'special-const)) - (or (not (eq x 'var-Decls)) - (not (equal var-Decls '(vec)))) - (or (not (eq x 'var-Holidays)) - (not (equal var-Holidays '(vec (var sat var-sat) - (var sun var-sun))))) - (insert "(setq " - (symbol-name x) - " " - (prin1-to-string - (let ((calc-language - (if (memq calc-language '(nil big)) - 'flat - calc-language))) - (math-format-value (symbol-value x) 100000))) - ")\n"))))))) + (mapatoms (lambda (x) + (and (string-match "\\`var-" (symbol-name x)) + (not (memq x calc-dont-insert-variables)) + (calc-var-value x) + (not (eq (car-safe (symbol-value x)) 'special-const)) + (or (not (eq x 'var-Decls)) + (not (equal var-Decls '(vec)))) + (or (not (eq x 'var-Holidays)) + (not (equal var-Holidays '(vec (var sat var-sat) + (var sun var-sun))))) + (insert "(setq " + (symbol-name x) + " " + (prin1-to-string + (let ((calc-language + (if (memq calc-language '(nil big)) + 'flat + calc-language))) + (math-format-value (symbol-value x) 100000))) + ")\n")))))) (defun calc-assign (arg) (interactive "P") diff --git a/lisp/calc/calc-stuff.el b/lisp/calc/calc-stuff.el index 58b81faee5..8df2ed905a 100644 --- a/lisp/calc/calc-stuff.el +++ b/lisp/calc/calc-stuff.el @@ -182,7 +182,7 @@ With a prefix, push that prefix as a number onto the stack." math-eval-rules-cache-tag t math-format-date-cache nil math-holidays-cache-tag t) - (mapc (function (lambda (x) (set x -100))) math-cache-list) + (mapc (lambda (x) (set x -100)) math-cache-list) (unless inhibit-msg (message "All internal calculator caches have been reset")))) @@ -258,14 +258,14 @@ With a prefix, push that prefix as a number onto the stack." (t (list 'calcFunc-clean a))))) (defun calcFunc-pclean (a &optional prec) - (math-map-over-constants (function (lambda (x) (calcFunc-clean x prec))) + (math-map-over-constants (lambda (x) (calcFunc-clean x prec)) a)) (defun calcFunc-pfloat (a) (math-map-over-constants 'math-float a)) (defun calcFunc-pfrac (a &optional tol) - (math-map-over-constants (function (lambda (x) (calcFunc-frac x tol))) + (math-map-over-constants (lambda (x) (calcFunc-frac x tol)) a)) ;; The variable math-moc-func is local to math-map-over-constants, diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 709c09ea09..742b2bb872 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -860,23 +860,22 @@ If COMP or STD is non-nil, put that in the units table instead." tab) (message "Building units table...") (setq math-units-table-buffer-valid nil) - (setq tab (mapcar (function - (lambda (x) - (list (car x) - (and (nth 1 x) - (if (stringp (nth 1 x)) - (let ((exp (math-read-plain-expr - (nth 1 x)))) - (if (eq (car-safe exp) 'error) - (error "Format error in definition of %s in units table: %s" - (car x) (nth 2 exp)) - exp)) - (nth 1 x))) - (nth 2 x) - (nth 3 x) - (and (not (nth 1 x)) - (list (cons (car x) 1))) - (nth 4 x)))) + (setq tab (mapcar (lambda (x) + (list (car x) + (and (nth 1 x) + (if (stringp (nth 1 x)) + (let ((exp (math-read-plain-expr + (nth 1 x)))) + (if (eq (car-safe exp) 'error) + (error "Format error in definition of %s in units table: %s" + (car x) (nth 2 exp)) + exp)) + (nth 1 x))) + (nth 2 x) + (nth 3 x) + (and (not (nth 1 x)) + (list (cons (car x) 1))) + (nth 4 x))) combined-units)) (let ((math-units-table tab)) (mapc #'math-find-base-units tab)) @@ -1100,10 +1099,9 @@ If COMP or STD is non-nil, put that in the units table instead." (setq math-decompose-units-cache (cons entry (sort ulist - (function - (lambda (x y) - (not (Math-lessp (nth 1 x) - (nth 1 y)))))))))) + (lambda (x y) + (not (Math-lessp (nth 1 x) + (nth 1 y))))))))) (cdr math-decompose-units-cache)))) (defun math-decompose-unit-part (unit) diff --git a/lisp/calc/calc-vec.el b/lisp/calc/calc-vec.el index 875414595c..036f08e276 100644 --- a/lisp/calc/calc-vec.el +++ b/lisp/calc/calc-vec.el @@ -744,7 +744,7 @@ ;;; Get the Nth row of a matrix. (defun calcFunc-mrow (mat n) ; [Public] (if (Math-vectorp n) - (math-map-vec (function (lambda (x) (calcFunc-mrow mat x))) n) + (math-map-vec (lambda (x) (calcFunc-mrow mat x)) n) (if (and (eq (car-safe n) 'intv) (math-constp n)) (calcFunc-subvec mat (math-add (nth 2 n) (if (memq (nth 1 n) '(2 3)) 0 1)) @@ -768,15 +768,15 @@ ;;; Get the Nth column of a matrix. (defun math-mat-col (mat n) - (cons 'vec (mapcar (function (lambda (x) (elt x n))) (cdr mat)))) + (cons 'vec (mapcar (lambda (x) (elt x n)) (cdr mat)))) (defun calcFunc-mcol (mat n) ; [Public] (if (Math-vectorp n) (calcFunc-trn - (math-map-vec (function (lambda (x) (calcFunc-mcol mat x))) n)) + (math-map-vec (lambda (x) (calcFunc-mcol mat x)) n)) (if (and (eq (car-safe n) 'intv) (math-constp n)) (if (math-matrixp mat) - (math-map-vec (function (lambda (x) (calcFunc-mrow x n))) mat) + (math-map-vec (lambda (x) (calcFunc-mrow x n)) mat) (calcFunc-mrow mat n)) (or (and (integerp (setq n (math-check-integer n))) (> n 0)) @@ -804,7 +804,7 @@ ;;; Remove the Nth column from a matrix. (defun math-mat-less-col (mat n) - (cons 'vec (mapcar (function (lambda (x) (math-mat-less-row x n))) + (cons 'vec (mapcar (lambda (x) (math-mat-less-row x n)) (cdr mat)))) (defun calcFunc-mrcol (mat n) ; [Public] @@ -939,10 +939,10 @@ (calcFunc-idn a (1- (length m))) (if (math-vectorp m) (if (math-zerop a) - (cons 'vec (mapcar (function (lambda (x) - (if (math-vectorp x) - (math-mimic-ident a x) - a))) + (cons 'vec (mapcar (lambda (x) + (if (math-vectorp x) + (math-mimic-ident a x) + a)) (cdr m))) (math-dimension-error)) (calcFunc-idn a)))) diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index e03c00243c..6186df718d 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -643,12 +643,11 @@ Interactively, reads the register using `register-read-with-preview'." (allow-ret (> n 1)) (list (math-showing-full-precision (mapcar (if (> n 1) - (function (lambda (x) - (math-format-flat-expr x 0))) - (function - (lambda (x) - (if (math-vectorp x) (setq allow-ret t)) - (math-format-nice-expr x (frame-width))))) + (lambda (x) + (math-format-flat-expr x 0)) + (lambda (x) + (if (math-vectorp x) (setq allow-ret t)) + (math-format-nice-expr x (frame-width)))) (if (> n 0) (calc-top-list n) (calc-top-list 1 (- n))))))) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 5716189b34..9d869f359b 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -506,7 +506,7 @@ The variable VAR will be added to `calc-mode-var-list'." (defun calc-mode-var-list-restore-default-values () "Restore the default values of the variables in `calc-mode-var-list'." - (mapcar (function (lambda (v) (set (car v) (nth 1 v)))) + (mapcar (lambda (v) (set (car v) (nth 1 v))) calc-mode-var-list)) (defun calc-mode-var-list-restore-saved-values () @@ -535,7 +535,7 @@ The variable VAR will be added to `calc-mode-var-list'." newvarlist))) (setq varlist (cdr varlist))))))) (if newvarlist - (mapcar (function (lambda (v) (set (car v) (nth 1 v)))) + (mapcar (lambda (v) (set (car v) (nth 1 v))) newvarlist) (calc-mode-var-list-restore-default-values)))) @@ -1315,8 +1315,9 @@ Notations: 3.14e6 3.14 * 10^6 \\{calc-mode-map} " (interactive) - (mapc (function ;FIXME: Why (set-default v (symbol-value v)) ?!?!? - (lambda (v) (set-default v (symbol-value v)))) + (mapc (lambda (v) + ;; FIXME: Why (set-default v (symbol-value v)) ?!?!? + (set-default v (symbol-value v))) calc-local-var-list) (kill-all-local-variables) (use-local-map (if (eq calc-algebraic-mode 'total) @@ -1537,7 +1538,7 @@ See `window-dedicated-p' for what that means." (let ((tail (nthcdr (1- calc-undo-length) calc-undo-list))) (if tail (setcdr tail nil))) (setq calc-redo-list nil)))) - (mapc (function (lambda (v) (set-default v (symbol-value v)))) + (mapc (lambda (v) (set-default v (symbol-value v))) calc-local-var-list) (let ((buf (current-buffer)) (win (get-buffer-window (current-buffer))) diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el index 1f3ae84263..e4f6e989ec 100644 --- a/lisp/calc/calccomp.el +++ b/lisp/calc/calccomp.el @@ -464,14 +464,13 @@ (math-compose-vector (cdr (nth 1 a)) (math-vector-to-string sep nil) (or cprec prec)) - (cons 'horiz (mapcar (function - (lambda (x) - (if (eq (car-safe x) 'calcFunc-bstring) - (prog1 - (math-compose-expr - x (or bprec cprec prec)) - (setq bprec -123)) - (math-compose-expr x (or cprec prec))))) + (cons 'horiz (mapcar (lambda (x) + (if (eq (car-safe x) 'calcFunc-bstring) + (prog1 + (math-compose-expr + x (or bprec cprec prec)) + (setq bprec -123)) + (math-compose-expr x (or cprec prec)))) (cdr (nth 1 a))))))) ((and (memq (car a) '(calcFunc-cvert calcFunc-clvert calcFunc-crvert)) (not (eq calc-language 'unform)) @@ -482,47 +481,46 @@ (let* ((base 0) (v 0) (prec (or (nth 2 a) prec)) - (c (mapcar (function - (lambda (x) - (let ((b nil) (cc nil) a d) - (if (and (memq (car-safe x) '(calcFunc-cbase - calcFunc-ctbase - calcFunc-cbbase)) - (memq (length x) '(1 2))) - (setq b (car x) - x (nth 1 x))) - (if (and (eq (car-safe x) 'calcFunc-crule) - (memq (length x) '(1 2)) - (or (null (nth 1 x)) - (and (math-vectorp (nth 1 x)) - (= (length (nth 1 x)) 2) - (math-vector-is-string - (nth 1 x))) - (and (natnump (nth 1 x)) - (<= (nth 1 x) 255)))) - (setq cc (list - 'rule - (if (math-vectorp (nth 1 x)) - (aref (math-vector-to-string - (nth 1 x) nil) 0) - (or (nth 1 x) ?-)))) - (or (and (memq (car-safe x) '(calcFunc-cvspace - calcFunc-ctspace - calcFunc-cbspace)) - (memq (length x) '(2 3)) - (eq (nth 1 x) 0)) - (null x) - (setq cc (math-compose-expr x prec)))) - (setq a (if cc (math-comp-ascent cc) 0) - d (if cc (math-comp-descent cc) 0)) - (if (eq b 'calcFunc-cbase) - (setq base (+ v a -1)) - (if (eq b 'calcFunc-ctbase) - (setq base v) - (if (eq b 'calcFunc-cbbase) - (setq base (+ v a d -1))))) - (setq v (+ v a d)) - cc))) + (c (mapcar (lambda (x) + (let ((b nil) (cc nil) a d) + (if (and (memq (car-safe x) '(calcFunc-cbase + calcFunc-ctbase + calcFunc-cbbase)) + (memq (length x) '(1 2))) + (setq b (car x) + x (nth 1 x))) + (if (and (eq (car-safe x) 'calcFunc-crule) + (memq (length x) '(1 2)) + (or (null (nth 1 x)) + (and (math-vectorp (nth 1 x)) + (= (length (nth 1 x)) 2) + (math-vector-is-string + (nth 1 x))) + (and (natnump (nth 1 x)) + (<= (nth 1 x) 255)))) + (setq cc (list + 'rule + (if (math-vectorp (nth 1 x)) + (aref (math-vector-to-string + (nth 1 x) nil) 0) + (or (nth 1 x) ?-)))) + (or (and (memq (car-safe x) '(calcFunc-cvspace + calcFunc-ctspace + calcFunc-cbspace)) + (memq (length x) '(2 3)) + (eq (nth 1 x) 0)) + (null x) + (setq cc (math-compose-expr x prec)))) + (setq a (if cc (math-comp-ascent cc) 0) + d (if cc (math-comp-descent cc) 0)) + (if (eq b 'calcFunc-cbase) + (setq base (+ v a -1)) + (if (eq b 'calcFunc-ctbase) + (setq base v) + (if (eq b 'calcFunc-cbbase) + (setq base (+ v a d -1))))) + (setq v (+ v a d)) + cc)) (cdr (nth 1 a))))) (setq c (delq nil c)) (if c @@ -865,16 +863,15 @@ (while (<= (setq col (1+ col)) cols) (setq res (cons (cons math-comp-just (cons base - (mapcar (function - (lambda (r) - (list 'horiz - (math-compose-expr - (nth col r) - math-comp-vector-prec) - (if (= col cols) - "" - (concat - math-comp-comma-spc " "))))) + (mapcar (lambda (r) + (list 'horiz + (math-compose-expr + (nth col r) + math-comp-vector-prec) + (if (= col cols) + "" + (concat + math-comp-comma-spc " ")))) a))) res))) (nreverse res))) @@ -923,7 +920,7 @@ ( ?\^? . "\\^?" ))) (defun math-vector-to-string (a &optional quoted) - (setq a (concat (mapcar (function (lambda (x) (if (consp x) (nth 1 x) x))) + (setq a (concat (mapcar (lambda (x) (if (consp x) (nth 1 x) x)) (cdr a)))) (if (string-match "[\000-\037\177\\\"]" a) (let ((p 0) commit 0a7ec10ac621c210fbf87e4465cb05e378b79889 Author: Stefan Kangas Date: Tue Nov 17 12:13:13 2020 +0100 Add command to filter package menu by name or description * lisp/emacs-lisp/package.el (package-menu-filter-by-description): (package-menu-filter-by-name-or-description): New commands to filter the package menu. (Bug#44699) (package-menu-mode-map): Bind the above new commands. (package-menu-mode-menu): Add new commands to the menu. * doc/emacs/package.texi (Package Menu): Document new commands. diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi index 56e8ee1363..4981dd50c7 100644 --- a/doc/emacs/package.texi +++ b/doc/emacs/package.texi @@ -187,6 +187,14 @@ Filter package list by archive (@code{package-menu-filter-by-archive}). This prompts for a package archive (e.g., @samp{gnu}), then shows only packages from that archive. +@item / d +@kindex / d @r{(Package Menu)} +@findex package-menu-filter-by-description +Filter package list by description +(@code{package-menu-filter-by-description}). This prompts for a +regular expression, then shows only packages with descriptions +matching that regexp. + @item / k @kindex / k @r{(Package Menu)} @findex package-menu-filter-by-keyword @@ -194,6 +202,14 @@ Filter package list by keyword (@code{package-menu-filter-by-keyword}). This prompts for a keyword (e.g., @samp{games}), then shows only packages with that keyword. +@item / N +@kindex / N @r{(Package Menu)} +@findex package-menu-filter-by-name-or-description +Filter package list by name or description +(@code{package-menu-filter-by-name-or-description}). This prompts for +a regular expression, then shows only packages with a name or +description matching that regexp. + @item / n @kindex / n @r{(Package Menu)} @findex package-menu-filter-by-name diff --git a/etc/NEWS b/etc/NEWS index 79c937b9ae..9f39851b4a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -831,12 +831,14 @@ equivalent to '(map (:sym sym))'. +++ *** New commands to filter the package list. -The filter command key bindings are as follows: +The filter commands are bound to the following keys: key binding --- ------- / a package-menu-filter-by-archive +/ d package-menu-filter-by-description / k package-menu-filter-by-keyword +/ N package-menu-filter-by-name-or-description / n package-menu-filter-by-name / s package-menu-filter-by-status / v package-menu-filter-by-version diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index fbab6debd5..d78a1a2856 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2704,7 +2704,9 @@ either a full name or nil, and EMAIL is a valid email address." (define-key map "(" #'package-menu-toggle-hiding) (define-key map (kbd "/ /") 'package-menu-clear-filter) (define-key map (kbd "/ a") 'package-menu-filter-by-archive) + (define-key map (kbd "/ d") 'package-menu-filter-by-description) (define-key map (kbd "/ k") 'package-menu-filter-by-keyword) + (define-key map (kbd "/ N") 'package-menu-filter-by-name-or-description) (define-key map (kbd "/ n") 'package-menu-filter-by-name) (define-key map (kbd "/ s") 'package-menu-filter-by-status) (define-key map (kbd "/ v") 'package-menu-filter-by-version) @@ -2736,8 +2738,11 @@ either a full name or nil, and EMAIL is a valid email address." "--" ("Filter Packages" ["Filter by Archive" package-menu-filter-by-archive :help "Filter packages by archive"] + ["Filter by Description" package-menu-filter-by-description :help "Filter packages by description"] ["Filter by Keyword" package-menu-filter-by-keyword :help "Filter packages by keyword"] ["Filter by Name" package-menu-filter-by-name :help "Filter packages by name"] + ["Filter by Name or Description" package-menu-filter-by-name-or-description + :help "Filter packages by name or description"] ["Filter by Status" package-menu-filter-by-status :help "Filter packages by status"] ["Filter by Version" package-menu-filter-by-version :help "Filter packages by version"] ["Filter Marked" package-menu-filter-marked :help "Filter packages marked for upgrade"] @@ -3765,6 +3770,23 @@ packages." (string-join archive ",") archive))))) +(defun package-menu-filter-by-description (description) + "Filter the \"*Packages*\" buffer by DESCRIPTION regexp. +Display only packages with a description that matches regexp +DESCRIPTION. + +When called interactively, prompt for DESCRIPTION. + +If DESCRIPTION is nil or the empty string, show all packages." + (interactive (list (read-regexp "Filter by description (regexp)"))) + (package--ensure-package-menu-mode) + (if (or (not description) (string-empty-p description)) + (package-menu--generate t t) + (package-menu--filter-by (lambda (pkg-desc) + (string-match description + (package-desc-summary pkg-desc))) + (format "desc:%s" description)))) + (defun package-menu-filter-by-keyword (keyword) "Filter the \"*Packages*\" buffer by KEYWORD. Display only packages with specified KEYWORD. @@ -3790,6 +3812,27 @@ packages." (define-obsolete-function-alias 'package-menu-filter #'package-menu-filter-by-keyword "27.1") +(defun package-menu-filter-by-name-or-description (name-or-description) + "Filter the \"*Packages*\" buffer by NAME-OR-DESCRIPTION regexp. +Display only packages with a name-or-description that matches regexp +NAME-OR-DESCRIPTION. + +When called interactively, prompt for NAME-OR-DESCRIPTION. + +If NAME-OR-DESCRIPTION is nil or the empty string, show all +packages." + (interactive (list (read-regexp "Filter by name or description (regexp)"))) + (package--ensure-package-menu-mode) + (if (or (not name-or-description) (string-empty-p name-or-description)) + (package-menu--generate t t) + (package-menu--filter-by (lambda (pkg-desc) + (or (string-match name-or-description + (package-desc-summary pkg-desc)) + (string-match name-or-description + (symbol-name + (package-desc-name pkg-desc))))) + (format "name-or-desc:%s" name-or-description)))) + (defun package-menu-filter-by-name (name) "Filter the \"*Packages*\" buffer by NAME regexp. Display only packages with name that matches regexp NAME. commit 3626c9ae83689abd7452a07925919196f985f144 Author: Stefan Kangas Date: Tue Nov 17 03:10:12 2020 +0100 Don't quote lambdas with function macro in generic-x.el * lisp/generic-x.el (apache-conf-generic-mode, ini-generic-mode) (reg-generic-mode, mailagent-rules-generic-mode) (vrml-generic-mode, java-properties-generic-mode) (alias-generic-mode, ansible-inventory-generic-mode) (inetd-conf-generic-mode, etc-services-generic-mode) (etc-passwd-generic-mode, etc-fstab-generic-mode) (spice-generic-mode, astap-generic-mode): Don't quote lambdas with function macro. diff --git a/lisp/generic-x.el b/lisp/generic-x.el index 48ac123205..b56b63132d 100644 --- a/lisp/generic-x.el +++ b/lisp/generic-x.el @@ -280,12 +280,11 @@ your changes into effect." ("^\\s-*\\(\\sw+\\)\\s-" 1 font-lock-variable-name-face)) '("srm\\.conf\\'" "httpd\\.conf\\'" "access\\.conf\\'") (list - (function - (lambda () - (setq imenu-generic-expression - '((nil "^\\([-A-Za-z0-9_]+\\)" 1) - ("*Directories*" "^\\s-*]+\\)>" 1) - ("*Locations*" "^\\s-*]+\\)>" 1)))))) + (lambda () + (setq imenu-generic-expression + '((nil "^\\([-A-Za-z0-9_]+\\)" 1) + ("*Directories*" "^\\s-*]+\\)>" 1) + ("*Locations*" "^\\s-*]+\\)>" 1))))) "Generic mode for Apache or HTTPD configuration files.")) (when (memq 'apache-log-generic-mode generic-extras-enable-list) @@ -401,11 +400,10 @@ your changes into effect." (2 font-lock-variable-name-face))) '("\\.[iI][nN][iI]\\'") (list - (function - (lambda () - (setq imenu-generic-expression - '((nil "^\\[\\(.*\\)\\]" 1) - ("*Variables*" "^\\s-*\\([^=]+\\)\\s-*=" 1)))))) + (lambda () + (setq imenu-generic-expression + '((nil "^\\[\\(.*\\)\\]" 1) + ("*Variables*" "^\\s-*\\([^=]+\\)\\s-*=" 1))))) "Generic mode for MS-Windows INI files. You can use `ini-generic-mode-find-file-hook' to enter this mode automatically for INI files whose names do not end in \".ini\".") @@ -432,10 +430,9 @@ like an INI file. You can add this hook to `find-file-hook'." ("^\\([^\n\r]*\\)\\s-*=" 1 font-lock-variable-name-face)) '("\\.[rR][eE][gG]\\'") (list - (function - (lambda () - (setq imenu-generic-expression - '((nil "^\\s-*\\(.*\\)\\s-*=" 1)))))) + (lambda () + (setq imenu-generic-expression + '((nil "^\\s-*\\(.*\\)\\s-*=" 1))))) "Generic mode for MS-Windows Registry files.")) (declare-function w32-shell-name "w32-fns" ()) @@ -456,10 +453,9 @@ like an INI file. You can add this hook to `find-file-hook'." ("\\s-/\\([^/]+\\)/[i, \t\n]" 1 font-lock-constant-face)) '("\\.rules\\'") (list - (function - (lambda () - (setq imenu-generic-expression - '((nil "\\s-/\\([^/]+\\)/[i, \t\n]" 1)))))) + (lambda () + (setq imenu-generic-expression + '((nil "\\s-/\\([^/]+\\)/[i, \t\n]" 1))))) "Generic mode for Mailagent rules files.")) ;; Solaris/Sys V prototype files @@ -548,13 +544,12 @@ like an INI file. You can add this hook to `find-file-hook'." (2 font-lock-variable-name-face))) '("\\.wrl\\'") (list - (function - (lambda () - (setq imenu-generic-expression - '((nil "^\\([A-Za-z0-9_]+\\)\\s-*{" 1) - ("*Definitions*" - "DEF\\s-+\\([-A-Za-z0-9_]+\\)\\s-+\\([A-Za-z0-9]+\\)\\s-*{" - 1)))))) + (lambda () + (setq imenu-generic-expression + '((nil "^\\([A-Za-z0-9_]+\\)\\s-*{" 1) + ("*Definitions*" + "DEF\\s-+\\([-A-Za-z0-9_]+\\)\\s-+\\([A-Za-z0-9]+\\)\\s-*{" + 1))))) "Generic Mode for VRML files.")) ;; Java Manifests @@ -594,20 +589,18 @@ like an INI file. You can add this hook to `find-file-hook'." ;; * an equal sign ;; * a colon (mapcar - (function - (lambda (elt) - (list - (concat "^" java-properties-key elt java-properties-value "$") - '(1 font-lock-constant-face) - '(4 font-lock-variable-name-face)))) + (lambda (elt) + (list + (concat "^" java-properties-key elt java-properties-value "$") + '(1 font-lock-constant-face) + '(4 font-lock-variable-name-face))) ;; These are the separators '(":\\s-*" "\\s-+" "\\s-*=\\s-*")))) nil (list - (function - (lambda () - (setq imenu-generic-expression - '((nil "^\\([^#! \t\n\r=:]+\\)" 1)))))) + (lambda () + (setq imenu-generic-expression + '((nil "^\\([^#! \t\n\r=:]+\\)" 1))))) "Generic mode for Java properties files.")) ;; C shell alias definitions @@ -622,10 +615,9 @@ like an INI file. You can add this hook to `find-file-hook'." (1 font-lock-variable-name-face))) '("alias\\'") (list - (function - (lambda () - (setq imenu-generic-expression - '((nil "^\\(alias\\|unalias\\)\\s-+\\([-a-zA-Z0-9_]+\\)" 2)))))) + (lambda () + (setq imenu-generic-expression + '((nil "^\\(alias\\|unalias\\)\\s-+\\([-a-zA-Z0-9_]+\\)" 2))))) "Generic mode for C Shell alias files.")) ;; Ansible inventory files @@ -645,11 +637,10 @@ like an INI file. You can add this hook to `find-file-hook'." (2 font-lock-keyword-face))) '("inventory\\'") (list - (function - (lambda () - (setq imenu-generic-expression - '((nil "^\\s-*\\[\\(.*\\)\\]" 1) - ("*Variables*" "\\s-+\\([^ =\n\r]+\\)=" 1)))))) + (lambda () + (setq imenu-generic-expression + '((nil "^\\s-*\\[\\(.*\\)\\]" 1) + ("*Variables*" "\\s-+\\([^ =\n\r]+\\)=" 1))))) "Generic mode for Ansible inventory files.")) ;;; Windows RC files @@ -1432,10 +1423,9 @@ like an INI file. You can add this hook to `find-file-hook'." '(("^\\([-A-Za-z0-9_]+\\)" 1 font-lock-type-face)) '("/etc/inetd\\.conf\\'") (list - (function - (lambda () - (setq imenu-generic-expression - '((nil "^\\([-A-Za-z0-9_]+\\)" 1)))))))) + (lambda () + (setq imenu-generic-expression + '((nil "^\\([-A-Za-z0-9_]+\\)" 1))))))) ;; Services (when (memq 'etc-services-generic-mode generic-extras-enable-list) @@ -1450,10 +1440,9 @@ like an INI file. You can add this hook to `find-file-hook'." (2 font-lock-variable-name-face))) '("/etc/services\\'") (list - (function - (lambda () - (setq imenu-generic-expression - '((nil "^\\([-A-Za-z0-9_]+\\)" 1)))))))) + (lambda () + (setq imenu-generic-expression + '((nil "^\\([-A-Za-z0-9_]+\\)" 1))))))) ;; Password and Group files (when (memq 'etc-passwd-generic-mode generic-extras-enable-list) @@ -1493,10 +1482,9 @@ like an INI file. You can add this hook to `find-file-hook'." ;; /etc/passwd- is a backup file for /etc/passwd, so is group- and shadow- '("/etc/passwd-?\\'" "/etc/group-?\\'" "/etc/shadow-?\\'") (list - (function - (lambda () - (setq imenu-generic-expression - '((nil "^\\([-A-Za-z0-9_]+\\):" 1)))))))) + (lambda () + (setq imenu-generic-expression + '((nil "^\\([-A-Za-z0-9_]+\\):" 1))))))) ;; Fstab (when (memq 'etc-fstab-generic-mode generic-extras-enable-list) @@ -1547,10 +1535,9 @@ like an INI file. You can add this hook to `find-file-hook'." (2 font-lock-variable-name-face t))) '("/etc/[v]*fstab\\'") (list - (function - (lambda () - (setq imenu-generic-expression - '((nil "^\\([^# \t]+\\)\\s-+" 1)))))))) + (lambda () + (setq imenu-generic-expression + '((nil "^\\([^# \t]+\\)\\s-+" 1))))))) ;; /etc/sudoers (when (memq 'etc-sudoers-generic-mode generic-extras-enable-list) @@ -1710,9 +1697,8 @@ like an INI file. You can add this hook to `find-file-hook'." (list 'generic-bracket-support ;; Make keywords case-insensitive - (function - (lambda() - (setq font-lock-defaults '(generic-font-lock-keywords nil t))))) + (lambda () + (setq font-lock-defaults '(generic-font-lock-keywords nil t)))) "Generic mode for SPICE circuit netlist files.")) (when (memq 'ibis-generic-mode generic-extras-enable-list) @@ -1758,9 +1744,8 @@ like an INI file. You can add this hook to `find-file-hook'." (list 'generic-bracket-support ;; Make keywords case-insensitive - (function - (lambda() - (setq font-lock-defaults '(generic-font-lock-keywords nil t))))) + (lambda () + (setq font-lock-defaults '(generic-font-lock-keywords nil t)))) "Generic mode for ASTAP circuit netlist files.")) (when (memq 'etc-modules-conf-generic-mode generic-extras-enable-list) commit 27655f9f38ab8037b599ce20341662d767fdc58c Author: Stefan Kangas Date: Tue Nov 17 02:17:14 2020 +0100 Test that substitute-command-keys preserves text properties * test/lisp/help-tests.el (help-substitute-command-keys/preserves-text-properties): New test. (Bug#17052) diff --git a/test/lisp/help-tests.el b/test/lisp/help-tests.el index 42be0296c4..49cb40b29d 100644 --- a/test/lisp/help-tests.el +++ b/test/lisp/help-tests.el @@ -392,6 +392,12 @@ C-b undefined (define-key global-map (kbd "C-c C-l r") nil) (define-key global-map (kbd "C-c C-l") nil))) +(ert-deftest help-substitute-command-keys/preserves-text-properties () + "Check that we preserve text properties (Bug#17052)." + (should (equal (substitute-command-keys + (propertize "foo \\[save-buffer]" 'face 'bold)) + (propertize "foo C-x C-s" 'face 'bold)))) + (provide 'help-tests) ;;; help-tests.el ends here commit 45a1653afa8eb0032908bc94b5466604f84805d5 Author: Basil L. Contovounesios Date: Mon Nov 16 23:16:23 2020 +0000 ; Fix last change to bibtex.el * lisp/textmodes/bibtex.el (bibtex-unify-case-convert): Clarify docstring and remove leading asterisk. Use defcustom :local tag. diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index b69d715faa..d53cfa0b1f 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -88,16 +88,16 @@ If this is a function, call it to generate the initial field text." (const :tag "Default" t)) :risky t) -(defcustom bibtex-unify-case-convert 'identity - "*Function called when unifying case on entry and field names. -This variable is buffer-local." +(defcustom bibtex-unify-case-convert #'identity + "Function called when unifying case on entry and field names. +It is called with one argument, the entry or field name." :version "28.1" :type '(choice (const :tag "Same case as in `bibtex-field-alist'" identity) (const :tag "Downcase" downcase) (const :tag "Capitalize" capitalize) (const :tag "Upcase" upcase) - (function :tag "Conversion function"))) -(make-variable-buffer-local 'bibtex-unify-case-convert) + (function :tag "Conversion function")) + :local t) (defcustom bibtex-user-optional-fields '(("annote" "Personal annotation (ignored)")) commit f5f9e100972598b1bb9cea4c0445777db2e1131e Author: Harald Jörg Date: Tue Nov 17 00:20:26 2020 +0100 perl-mode and cperl-mode: Recognize regex after "return" * lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): Add "return" to the keywords which start a regex. * lisp/progmodes/perl-mode.el (defconst): Add "return" to 'perl--syntax-exp-intro-keywords' (Bug#26850). * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-28650): New test (bug#26850). diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index a42ace105a..0dc45515d4 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -3959,7 +3959,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', (not (memq (preceding-char) '(?$ ?@ ?& ?%))) (looking-at - "\\(while\\|if\\|unless\\|until\\|and\\|or\\|not\\|xor\\|split\\|grep\\|map\\|print\\|say\\)\\>"))))) + "\\(while\\|if\\|unless\\|until\\|and\\|or\\|not\\|xor\\|split\\|grep\\|map\\|print\\|say\\|return\\)\\>"))))) (and (eq (preceding-char) ?.) (eq (char-after (- (point) 2)) ?.)) (bobp)) diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index 7265aeee45..bb19436cda 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -209,7 +209,7 @@ (eval-and-compile (defconst perl--syntax-exp-intro-keywords '("split" "if" "unless" "until" "while" "print" - "grep" "map" "not" "or" "and" "for" "foreach")) + "grep" "map" "not" "or" "and" "for" "foreach" "return")) (defconst perl--syntax-exp-intro-regexp (concat "\\(?:\\(?:^\\|[^$@&%[:word:]]\\)" diff --git a/test/lisp/progmodes/cperl-mode-resources/cperl-bug-26850.pl b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-26850.pl new file mode 100644 index 0000000000..a02ea29fe9 --- /dev/null +++ b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-26850.pl @@ -0,0 +1,16 @@ +sub interesting { + $_ = shift; + return + />Today is .+\'s birthday\. likes? your comment: / + || /&birthdays=.*birthdays?\.<\/a>/; +} + +sub boring { + return + / likes? your post in Date: Tue Nov 17 00:18:11 2020 +0100 Minor Edebug manual keystroke clarifications * doc/lispref/edebug.texi (Edebug Misc): Also mention the `a' binding to abort (bug#44697). Also fix `d' function reference, and add `P' reference. diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index 6e9ec47f7b..820fdb9bea 100644 --- a/doc/lispref/edebug.texi +++ b/doc/lispref/edebug.texi @@ -425,7 +425,8 @@ arrange to deinstrument it. @item ? Display the help message for Edebug (@code{edebug-help}). -@item C-] +@item a +@itemx C-] Abort one level back to the previous command level (@code{abort-recursive-edit}). @@ -446,7 +447,7 @@ Redisplay the most recently known expression result in the echo area @item d Display a backtrace, excluding Edebug's own functions for clarity -(@code{edebug-backtrace}). +(@code{edebug-pop-to-backtrace}). @xref{Backtraces}, for a description of backtraces and the commands which work on them. @@ -640,7 +641,8 @@ configuration is the collection of windows and contents that were in effect outside of Edebug. @table @kbd -@item v +@item P +@itemx v Switch to viewing the outside window configuration (@code{edebug-view-outside}). Type @kbd{C-x X w} to return to Edebug. commit b4b3eb8b8095e64efdd0452f653da70ea70d730c Author: Lars Ingebrigtsen Date: Mon Nov 16 23:54:02 2020 +0100 Make the handwrite.el PS valid again * lisp/play/handwrite.el (handwrite): Make the PS valid (bug#44648). Suggested by Omar Antolín . diff --git a/lisp/play/handwrite.el b/lisp/play/handwrite.el index 1cf690a86d..06ea54cb47 100644 --- a/lisp/play/handwrite.el +++ b/lisp/play/handwrite.el @@ -233,7 +233,7 @@ Variables: `handwrite-linespace' (default 12) )) (switch-to-buffer ps-buf-name) (forward-line 1) - (insert "showpage exec Hwsave restore\n\n") + (insert " showpage exec Hwsave restore\n\n") (insert "%%Pages " (number-to-string ipage) " 0\n") (insert "%%EOF\n") ;;To avoid cumbersome code we simply ignore formfeeds commit fd43ecd96e5abff02101d4a7ed8507dd7b296542 Author: Lars Ingebrigtsen Date: Mon Nov 16 23:16:39 2020 +0100 Fix gnus-mime-display-alternative button natigation * lisp/gnus/gnus-art.el (gnus-mime-display-alternative): Mark the buttons correctly so that TAB can find them (bug#44690). diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 1efc1d6f7d..8f4ca7eb3b 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -6175,7 +6175,6 @@ If nil, don't show those extra buttons." face ,gnus-article-button-face follow-link t gnus-part ,id - button t article-type multipart rear-nonsticky t)) ;; Do the handles @@ -6200,6 +6199,7 @@ If nil, don't show those extra buttons." follow-link t gnus-part ,id button t + category t gnus-data ,handle rear-nonsticky t)) (insert " ")) commit 7ab6213886c72ac7a04a20b114a4f810c6484168 Author: Ruthra Kumar Date: Mon Nov 16 23:04:36 2020 +0100 Use 'eshell-find-alias-function' instead of fboundp * lisp/eshell/esh-cmd.el (eshell-invoke-directly): Fix problem with (require 'em-tramp) making password prompting from "sudo bash" no longer work (bug#43772). diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index f1cf933689..68b34837a2 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -918,7 +918,7 @@ at the moment are: (funcall pred name)) (throw 'simple nil))) t)) - (fboundp (intern-soft (concat "eshell/" name)))))) + (eshell-find-alias-function name)))) (defun eshell-eval-command (command &optional input) "Evaluate the given COMMAND iteratively." commit 29eff32307494eabed5c0160ad1713d832e65f74 Author: Francesco Potortì Date: Mon Nov 16 22:36:05 2020 +0100 Add new user option bibtex-unify-case-convert * lisp/textmodes/bibtex.el (bibtex-unify-case-convert): New variable (bug#44614). (bibtex-format-entry): Use it (bug#44614). diff --git a/etc/NEWS b/etc/NEWS index 90e4d292ba..79c937b9ae 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1307,6 +1307,11 @@ This new command (bound to 'C-c C-l') regenerates the current hunk. ** Miscellaneous +--- +*** New user option 'bibtex-unify-case-convert'. +This new option allows the user to customize how case is converted +when unifying entries. + +++ *** 'format-seconds' can now be used for sub-second times. The new optional "," parameter has been added, and diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index fcf63ed5ec..b69d715faa 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -88,6 +88,17 @@ If this is a function, call it to generate the initial field text." (const :tag "Default" t)) :risky t) +(defcustom bibtex-unify-case-convert 'identity + "*Function called when unifying case on entry and field names. +This variable is buffer-local." + :version "28.1" + :type '(choice (const :tag "Same case as in `bibtex-field-alist'" identity) + (const :tag "Downcase" downcase) + (const :tag "Capitalize" capitalize) + (const :tag "Upcase" upcase) + (function :tag "Conversion function"))) +(make-variable-buffer-local 'bibtex-unify-case-convert) + (defcustom bibtex-user-optional-fields '(("annote" "Personal annotation (ignored)")) "List of optional fields the user wants to have always present. @@ -122,7 +133,8 @@ last-comma Add or delete comma on end of last field in entry, according to value of `bibtex-comma-after-last-field'. delimiters Change delimiters according to variables `bibtex-field-delimiters' and `bibtex-entry-delimiters'. -unify-case Change case of entry types and field names. +unify-case Change case of entry and field names according to + `bibtex-unify-case-convert'. braces Enclose parts of field entries by braces according to `bibtex-field-braces-alist'. strings Replace parts of field entries by string constants @@ -2346,7 +2358,7 @@ Formats current entry according to variable `bibtex-entry-format'." ;; unify case of entry type (when (memq 'unify-case format) (delete-region beg-type end-type) - (insert (car entry-list))) + (insert (funcall bibtex-unify-case-convert (car entry-list)))) ;; update left entry delimiter (when (memq 'delimiters format) @@ -2549,47 +2561,48 @@ Formats current entry according to variable `bibtex-entry-format'." (error "Mandatory field `%s' is empty" field-name)) ;; unify case of field name - (if (memq 'unify-case format) - (let ((fname (car (assoc-string field-name - default-field-list t)))) - (if fname - (progn - (delete-region beg-name end-name) - (goto-char beg-name) - (insert fname)) - ;; there are no rules we could follow - (downcase-region beg-name end-name)))) + (when (memq 'unify-case format) + (let ((fname (car (assoc-string field-name + default-field-list t))) + (curname (buffer-substring beg-name end-name))) + (delete-region beg-name end-name) + (goto-char beg-name) + (insert (funcall bibtex-unify-case-convert + (or fname curname))))) ;; update point (goto-char end-field)))) ;; check whether all required fields are present - (if (memq 'required-fields format) - (let ((alt-expect (make-vector num-alt nil)) - (alt-found (make-vector num-alt 0))) - (dolist (fname req-field-list) - (cond ((setq idx (nth 3 fname)) - ;; t if field has alternative flag - (bibtex-vec-push alt-expect idx (car fname)) - (if (member-ignore-case (car fname) field-list) - (bibtex-vec-incr alt-found idx))) - ((not (member-ignore-case (car fname) field-list)) - ;; If we use the crossref field, a required field - ;; can have the OPT prefix. So if it was empty, - ;; we have deleted by now. Nonetheless we can - ;; move point on this empty field. - (setq error-field-name (car fname)) - (error "Mandatory field `%s' is missing" (car fname))))) - (dotimes (idx num-alt) - (cond ((= 0 (aref alt-found idx)) - (setq error-field-name (car (last (aref alt-fields idx)))) - (error "Alternative mandatory field `%s' is missing" - (aref alt-expect idx))) - ((< 1 (aref alt-found idx)) - (setq error-field-name (car (last (aref alt-fields idx)))) - (error "Alternative fields `%s' are defined %s times" - (aref alt-expect idx) - (length (aref alt-fields idx)))))))) + (when (memq 'required-fields format) + (let ((alt-expect (make-vector num-alt nil)) + (alt-found (make-vector num-alt 0))) + (dolist (fname req-field-list) + (cond ((setq idx (nth 3 fname)) + ;; t if field has alternative flag + (bibtex-vec-push alt-expect idx (car fname)) + (if (member-ignore-case (car fname) field-list) + (bibtex-vec-incr alt-found idx))) + ((not (member-ignore-case (car fname) field-list)) + ;; If we use the crossref field, a required field + ;; can have the OPT prefix. So if it was empty, + ;; we have deleted by now. Nonetheless we can + ;; move point on this empty field. + (setq error-field-name (car fname)) + (error "Mandatory field `%s' is missing" + (car fname))))) + (dotimes (idx num-alt) + (cond ((= 0 (aref alt-found idx)) + (setq error-field-name + (car (last (aref alt-fields idx)))) + (error "Alternative mandatory field `%s' is missing" + (aref alt-expect idx))) + ((< 1 (aref alt-found idx)) + (setq error-field-name + (car (last (aref alt-fields idx)))) + (error "Alternative fields `%s' are defined %s times" + (aref alt-expect idx) + (length (aref alt-fields idx)))))))) ;; update comma after last field (if (memq 'last-comma format) commit 7dd671f7f2755dad7df81640dfee0abf135095ea Author: Stefan Kangas Date: Sun Nov 15 20:12:45 2020 +0100 Use lexical-binding in time-stamp.el * lisp/time-stamp.el: Use lexical-binding. Remove redundant :group args. diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el index 7c64f2903b..c50d68b60a 100644 --- a/lisp/time-stamp.el +++ b/lisp/time-stamp.el @@ -1,4 +1,4 @@ -;;; time-stamp.el --- Maintain last change time stamps in files edited by Emacs +;;; time-stamp.el --- Maintain last change time stamps in files edited by Emacs -*- lexical-binding: t -*- ;; Copyright (C) 1989, 1993-1995, 1997, 2000-2020 Free Software ;; Foundation, Inc. @@ -87,7 +87,6 @@ transitional behavior (again, as shown). The behavior of `%5z' is new in Emacs 27. If your files might be edited by older versions of Emacs also, do not use this format yet." :type 'string - :group 'time-stamp :version "27.1") ;;;###autoload(put 'time-stamp-format 'safe-local-variable 'stringp) @@ -102,8 +101,7 @@ when they are saved, either add this line to your init file: or customize option `before-save-hook'. See also the variable `time-stamp-warn-inactive'." - :type 'boolean - :group 'time-stamp) + :type 'boolean) (defcustom time-stamp-warn-inactive t "Have \\[time-stamp] warn if a buffer did not get time-stamped. @@ -111,7 +109,6 @@ If non-nil, a warning is displayed if `time-stamp-active' has deactivated time stamping and the buffer contains a template that otherwise would have been updated." :type 'boolean - :group 'time-stamp :version "19.29") (defcustom time-stamp-time-zone nil @@ -125,7 +122,6 @@ Its format is that of the ZONE argument of the `format-time-string' function." (integer :tag "Offset (seconds east of UTC)") (string :tag "Time zone abbreviation")) (integer :tag "Offset (seconds east of UTC)")) - :group 'time-stamp :version "20.1") ;;;###autoload(put 'time-stamp-time-zone 'safe-local-variable 'time-stamp-zone-type-p) commit e66502fec11a47b50be6682262cb33fad53fa229 Author: Michael Albinus Date: Mon Nov 16 19:37:06 2020 +0100 ; * doc/misc/eshell.texi (Input/Output): Fix typo. diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 57f713635f..8e5ec25d25 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -649,7 +649,7 @@ Eshell solves this problem by running such programs in Emacs's terminal emulator. Programs that need a terminal to display output properly are referred -to in this manual as ``visual commands,'' because they are not simply +to in this manual as ``visual commands'', because they are not simply line-oriented. You must tell Eshell which commands are visual, by adding them to @code{eshell-visual-commands}; for commands that are visual for only certain @emph{sub}-commands -- e.g., @samp{git log} but commit 9191c82f6d69340ce231a41c61594e1b9b9b51aa Author: Stefan Kangas Date: Mon Nov 16 18:52:42 2020 +0100 Don't quote lambdas in net/*.el * lisp/net/eudc-export.el (eudc-create-bbdb-record): * lisp/net/eudc.el (eudc-print-attribute-value) (eudc-display-records, eudc-process-form) (eudc-filter-duplicate-attributes, eudc-filter-partial-records) (eudc-add-field-to-records, eudc-query-with-words) (eudc-query-form, eudc-menu): * lisp/net/eudcb-bbdb.el (eudc-bbdb-extract-phones) (eudc-bbdb-query-internal): * lisp/net/mairix.el (mairix-widget-make-query-from-widgets) (mairix-widget-build-editable-fields, mairix-widget-get-values): Don't quote lambdas. diff --git a/lisp/net/eudc-export.el b/lisp/net/eudc-export.el index ba86958142..5c96628149 100644 --- a/lisp/net/eudc-export.el +++ b/lisp/net/eudc-export.el @@ -78,12 +78,11 @@ If SILENT is non-nil then the created BBDB record is not displayed." record t))) ;; BBDB custom fields (setq bbdb-notes (append (list (and bbdb-notes (cons 'notes bbdb-notes))) - (mapcar (function - (lambda (mapping) - (if (and (not (memq (car mapping) - '(name company net address phone notes))) - (setq value (eudc-parse-spec (cdr mapping) record nil))) - (cons (car mapping) value)))) + (mapcar (lambda (mapping) + (if (and (not (memq (car mapping) + '(name company net address phone notes))) + (setq value (eudc-parse-spec (cdr mapping) record nil))) + (cons (car mapping) value))) conversion-alist))) (setq bbdb-notes (delq nil bbdb-notes)) (setq bbdb-record (bbdb-create-internal diff --git a/lisp/net/eudc.el b/lisp/net/eudc.el index 08cab4f047..f4e4c17d69 100644 --- a/lisp/net/eudc.el +++ b/lisp/net/eudc.el @@ -414,10 +414,9 @@ if any, is called to print the value in cdr of FIELD." (eval (list (cdr match) val)) (insert "\n")) (mapc - (function - (lambda (val-elem) - (indent-to col) - (insert val-elem "\n"))) + (lambda (val-elem) + (indent-to col) + (insert val-elem "\n")) (cond ((listp val) val) ((stringp val) (split-string val "\n")) @@ -464,37 +463,33 @@ otherwise they are formatted according to `eudc-user-attribute-names-alist'." ;; Replace field names with user names, compute max width (setq precords (mapcar - (function - (lambda (record) - (mapcar - (function - (lambda (field) - (setq attribute-name - (if raw-attr-names - (symbol-name (car field)) - (eudc-format-attribute-name-for-display (car field)))) - (if (> (length attribute-name) width) - (setq width (length attribute-name))) - (cons attribute-name (cdr field)))) - record))) + (lambda (record) + (mapcar + (lambda (field) + (setq attribute-name + (if raw-attr-names + (symbol-name (car field)) + (eudc-format-attribute-name-for-display (car field)))) + (if (> (length attribute-name) width) + (setq width (length attribute-name))) + (cons attribute-name (cdr field))) + record)) records)) ;; Display the records (setq first-record (point)) (mapc - (function - (lambda (record) - (setq beg (point)) - ;; Map over the record fields to print the attribute/value pairs - (mapc (function - (lambda (field) - (eudc-print-record-field field width))) - record) - ;; Store the record internal format in some convenient place - (overlay-put (make-overlay beg (point)) - 'eudc-record - (car records)) - (setq records (cdr records)) - (insert "\n"))) + (lambda (record) + (setq beg (point)) + ;; Map over the record fields to print the attribute/value pairs + (mapc (lambda (field) + (eudc-print-record-field field width)) + record) + ;; Store the record internal format in some convenient place + (overlay-put (make-overlay beg (point)) + 'eudc-record + (car records)) + (setq records (cdr records)) + (insert "\n")) precords)) (insert "\n") (widget-create 'push-button @@ -518,12 +513,11 @@ otherwise they are formatted according to `eudc-user-attribute-names-alist'." (if (not (and (boundp 'eudc-form-widget-list) eudc-form-widget-list)) (error "Not in a directory query form buffer") - (mapc (function - (lambda (wid-field) - (setq value (widget-value (cdr wid-field))) - (if (not (string= value "")) - (setq query-alist (cons (cons (car wid-field) value) - query-alist))))) + (mapc (lambda (wid-field) + (setq value (widget-value (cdr wid-field))) + (if (not (string= value "")) + (setq query-alist (cons (cons (car wid-field) value) + query-alist)))) eudc-form-widget-list) (kill-buffer (current-buffer)) (eudc-display-records (eudc-query query-alist) eudc-use-raw-directory-names)))) @@ -543,49 +537,47 @@ otherwise they are formatted according to `eudc-user-attribute-names-alist'." (if (null (cdar rec)) (list record) ; No duplicate attrs in this record - (mapc (function - (lambda (field) - (if (listp (cdr field)) - (setq duplicates (cons field duplicates)) - (setq unique (cons field unique))))) + (mapc (lambda (field) + (if (listp (cdr field)) + (setq duplicates (cons field duplicates)) + (setq unique (cons field unique)))) record) (setq result (list unique)) ;; Map over the record fields that have multiple values (mapc - (function - (lambda (field) - (let ((method (if (consp eudc-duplicate-attribute-handling-method) - (cdr - (assq - (or - (car - (rassq - (car field) - (symbol-value - eudc-protocol-attributes-translation-alist))) - (car field)) - eudc-duplicate-attribute-handling-method)) - eudc-duplicate-attribute-handling-method))) - (cond - ((or (null method) (eq 'list method)) - (setq result - (eudc-add-field-to-records field result))) - ((eq 'first method) - (setq result - (eudc-add-field-to-records (cons (car field) - (cadr field)) - result))) - ((eq 'concat method) - (setq result - (eudc-add-field-to-records (cons (car field) - (mapconcat - #'identity - (cdr field) - "\n")) - result))) - ((eq 'duplicate method) - (setq result - (eudc-distribute-field-on-records field result))))))) + (lambda (field) + (let ((method (if (consp eudc-duplicate-attribute-handling-method) + (cdr + (assq + (or + (car + (rassq + (car field) + (symbol-value + eudc-protocol-attributes-translation-alist))) + (car field)) + eudc-duplicate-attribute-handling-method)) + eudc-duplicate-attribute-handling-method))) + (cond + ((or (null method) (eq 'list method)) + (setq result + (eudc-add-field-to-records field result))) + ((eq 'first method) + (setq result + (eudc-add-field-to-records (cons (car field) + (cadr field)) + result))) + ((eq 'concat method) + (setq result + (eudc-add-field-to-records (cons (car field) + (mapconcat + #'identity + (cdr field) + "\n")) + result))) + ((eq 'duplicate method) + (setq result + (eudc-distribute-field-on-records field result)))))) duplicates) result))) @@ -593,19 +585,17 @@ otherwise they are formatted according to `eudc-user-attribute-names-alist'." "Eliminate records that do not contain all ATTRS from RECORDS." (delq nil (mapcar - (function - (lambda (rec) - (if (cl-every (lambda (attr) - (consp (assq attr rec))) - attrs) - rec))) + (lambda (rec) + (if (cl-every (lambda (attr) + (consp (assq attr rec))) + attrs) + rec)) records))) (defun eudc-add-field-to-records (field records) "Add FIELD to each individual record in RECORDS and return the resulting list." - (mapcar (function - (lambda (r) - (cons field r))) + (mapcar (lambda (r) + (cons field r)) records)) (defun eudc-distribute-field-on-records (field records) @@ -886,10 +876,9 @@ see `eudc-inline-expansion-servers'." (let ((response-string (apply #'format (car eudc-inline-expansion-format) - (mapcar (function - (lambda (field) - (or (cdr (assq field r)) - ""))) + (mapcar (lambda (field) + (or (cdr (assq field r)) + "")) (eudc-translate-attribute-list (cdr eudc-inline-expansion-format)))))) (if (> (length response-string) 0) @@ -929,16 +918,14 @@ queries the server for the existing fields and displays a corresponding form." ;; Build the list of prompts (setq prompts (if eudc-use-raw-directory-names (mapcar #'symbol-name (eudc-translate-attribute-list fields)) - (mapcar (function - (lambda (field) - (or (cdr (assq field eudc-user-attribute-names-alist)) - (capitalize (symbol-name field))))) + (mapcar (lambda (field) + (or (cdr (assq field eudc-user-attribute-names-alist)) + (capitalize (symbol-name field)))) fields))) ;; Loop over prompt strings to find the longest one - (mapc (function - (lambda (prompt) - (if (> (length prompt) width) - (setq width (length prompt))))) + (mapc (lambda (prompt) + (if (> (length prompt) width) + (setq width (length prompt)))) prompts) ;; Insert the first widget out of the mapcar to leave the cursor ;; in the first field @@ -949,14 +936,13 @@ queries the server for the existing fields and displays a corresponding form." eudc-form-widget-list)) (setq fields (cdr fields)) (setq prompts (cdr prompts)) - (mapc (function - (lambda (field) - (widget-insert "\n\n" (format (concat "%" (int-to-string width) "s: ") (car prompts))) - (setq widget (widget-create 'editable-field - :size 15)) - (setq eudc-form-widget-list (cons (cons field widget) - eudc-form-widget-list)) - (setq prompts (cdr prompts)))) + (mapc (lambda (field) + (widget-insert "\n\n" (format (concat "%" (int-to-string width) "s: ") (car prompts))) + (setq widget (widget-create 'editable-field + :size 15)) + (setq eudc-form-widget-list (cons (cons field widget) + eudc-form-widget-list)) + (setq prompts (cdr prompts))) fields) (widget-insert "\n\n") (widget-create 'push-button @@ -1118,27 +1104,26 @@ queries the server for the existing fields and displays a corresponding form." (append '("Server") (mapcar - (function - (lambda (servspec) - (let* ((server (car servspec)) - (protocol (cdr servspec)) - (proto-name (symbol-name protocol))) - (setq command (intern (concat "eudc-set-server-" - server - "-" - proto-name))) - (if (not (fboundp command)) - (fset command - `(lambda () - (interactive) - (eudc-set-server ,server (quote ,protocol)) - (message "Selected directory server is now %s (%s)" - ,server - ,proto-name)))) - (vector (format "%s (%s)" server proto-name) - command - :style 'radio - :selected `(equal eudc-server ,server))))) + (lambda (servspec) + (let* ((server (car servspec)) + (protocol (cdr servspec)) + (proto-name (symbol-name protocol))) + (setq command (intern (concat "eudc-set-server-" + server + "-" + proto-name))) + (if (not (fboundp command)) + (fset command + `(lambda () + (interactive) + (eudc-set-server ,server (quote ,protocol)) + (message "Selected directory server is now %s (%s)" + ,server + ,proto-name)))) + (vector (format "%s (%s)" server proto-name) + command + :style 'radio + :selected `(equal eudc-server ,server)))) eudc-server-hotlist) eudc-server-menu)) eudc-tail-menu))) diff --git a/lisp/net/eudcb-bbdb.el b/lisp/net/eudcb-bbdb.el index 82e58c2833..5d6b52a19d 100644 --- a/lisp/net/eudcb-bbdb.el +++ b/lisp/net/eudcb-bbdb.el @@ -137,18 +137,17 @@ BBDB < 3 used `net'; BBDB >= 3 uses `mail'." (defun eudc-bbdb-extract-phones (record) (require 'bbdb) - (mapcar (function - (lambda (phone) - (if eudc-bbdb-use-locations-as-attribute-names - (cons (intern (if (eudc--using-bbdb-3-or-newer-p) - (bbdb-phone-label phone) - (bbdb-phone-location phone))) - (bbdb-phone-string phone)) - (cons 'phones (format "%s: %s" - (if (eudc--using-bbdb-3-or-newer-p) - (bbdb-phone-label phone) - (bbdb-phone-location phone)) - (bbdb-phone-string phone)))))) + (mapcar (lambda (phone) + (if eudc-bbdb-use-locations-as-attribute-names + (cons (intern (if (eudc--using-bbdb-3-or-newer-p) + (bbdb-phone-label phone) + (bbdb-phone-location phone))) + (bbdb-phone-string phone)) + (cons 'phones (format "%s: %s" + (if (eudc--using-bbdb-3-or-newer-p) + (bbdb-phone-label phone) + (bbdb-phone-location phone)) + (bbdb-phone-string phone))))) (if (eudc--using-bbdb-3-or-newer-p) (bbdb-record-phone record) (bbdb-record-phones record)))) @@ -243,17 +242,15 @@ RETURN-ATTRS is a list of attributes to return, defaulting to (if (car query-attrs) (setq records (eval `(bbdb-search ,(quote records) ,@bbdb-attrs)))) (setq query-attrs (cdr query-attrs))) - (mapc (function - (lambda (record) - (setq filtered (eudc-filter-duplicate-attributes record)) - ;; If there were duplicate attributes reverse the order of the - ;; record so the unique attributes appear first - (if (> (length filtered) 1) - (setq filtered (mapcar (function - (lambda (rec) - (reverse rec))) - filtered))) - (setq result (append result filtered)))) + (mapc (lambda (record) + (setq filtered (eudc-filter-duplicate-attributes record)) + ;; If there were duplicate attributes reverse the order of the + ;; record so the unique attributes appear first + (if (> (length filtered) 1) + (setq filtered (mapcar (lambda (rec) + (reverse rec)) + filtered))) + (setq result (append result filtered))) (delq nil (mapcar 'eudc-bbdb-format-record-as-result (delq nil diff --git a/lisp/net/mairix.el b/lisp/net/mairix.el index 8218249ec1..5571b2ab81 100644 --- a/lisp/net/mairix.el +++ b/lisp/net/mairix.el @@ -631,14 +631,13 @@ See %s for details" mairix-output-buffer))) (when (member 'flags mairix-widget-other) (setq flag (mapconcat - (function - (lambda (flag) - (setq temp - (widget-value (cadr (assoc (car flag) mairix-widgets)))) - (if (string= "yes" temp) - (cadr flag) - (if (string= "no" temp) - (concat "-" (cadr flag)))))) + (lambda (flag) + (setq temp + (widget-value (cadr (assoc (car flag) mairix-widgets)))) + (if (string= "yes" temp) + (cadr flag) + (if (string= "no" temp) + (concat "-" (cadr flag))))) '(("seen" "s") ("replied" "r") ("flagged" "f")) "")) (when (not (zerop (length flag))) (push (concat "F:" flag) query))) @@ -694,34 +693,33 @@ Fill in VALUES if based on an article." VALUES may contain values for editable fields from current article." (let ((ret)) (mapc - (function - (lambda (field) - (setq field (car (cddr field))) - (setq - ret - (nconc - (list - (list - (concat "c" field) - (widget-create 'checkbox - :tag field - :notify (lambda (widget &rest ignore) - (mairix-widget-toggle-activate widget)) - nil))) - (list - (list - (concat "e" field) - (widget-create 'editable-field - :size 60 - :format (concat " " field ":" - (make-string - (- 11 (length field)) ?\ ) - "%v") - :value (or (cadr (assoc field values)) "")))) - ret)) - (widget-insert "\n") - ;; Deactivate editable field - (widget-apply (cadr (nth 1 ret)) :deactivate))) + (lambda (field) + (setq field (car (cddr field))) + (setq + ret + (nconc + (list + (list + (concat "c" field) + (widget-create 'checkbox + :tag field + :notify (lambda (widget &rest ignore) + (mairix-widget-toggle-activate widget)) + nil))) + (list + (list + (concat "e" field) + (widget-create 'editable-field + :size 60 + :format (concat " " field ":" + (make-string + (- 11 (length field)) ?\ ) + "%v") + :value (or (cadr (assoc field values)) "")))) + ret)) + (widget-insert "\n") + ;; Deactivate editable field + (widget-apply (cadr (nth 1 ret)) :deactivate)) mairix-widget-fields-list) ret)) @@ -936,13 +934,12 @@ Use cursor keys or C-n,C-p to select next/previous search.\n\n") (save-excursion (save-restriction (mapcar - (function - (lambda (field) - (list (car (cddr field)) - (if (car field) - (mairix-replace-invalid-chars - (funcall get-mail-header (car field))) - nil)))) + (lambda (field) + (list (car (cddr field)) + (if (car field) + (mairix-replace-invalid-chars + (funcall get-mail-header (car field))) + nil))) mairix-widget-fields-list))) (error "No function for obtaining mail header specified")))) commit d5d3862c5648ceb2b0a48f5663f1c659c4d02d9f Author: Glenn Morris Date: Mon Nov 16 09:43:40 2020 -0800 ; * INSTALL: Correct a recent change. Debian stopped including the major version number in the emacs package name after version 25, so there is no 'emacs27-dbg' package. We may as well drop this clause altogether, since Debian stable has version 26. No need to merge to master (where this information is in etc/PROBLEMS in any case). diff --git a/INSTALL b/INSTALL index cb1fe8d3c2..8eb5ee2869 100644 --- a/INSTALL +++ b/INSTALL @@ -254,9 +254,9 @@ updated. Emacs debugging symbols are distributed by a debug package. It does not exist for every released Emacs package, this depends on the distribution. On Debian-based systems, you can install a debug -package of Emacs with a command like 'apt-get install emacs-dbg' (on -older systems, replace 'emacs' with eg 'emacs27'). On Red Hat-based -systems, the corresponding command is 'dnf debuginfo-install emacs'. +package of Emacs with a command like 'apt-get install emacs-dbg'. +On Red Hat-based systems, the corresponding command is +'dnf debuginfo-install emacs'. DETAILED BUILDING AND INSTALLATION: commit f0f2c8563b3f57be4c6b174b49fbac1e530ef7ac Author: Stefan Kangas Date: Mon Nov 16 17:03:45 2020 +0100 Don't quote lambdas in emacs-lisp/*.el * lisp/emacs-lisp/cl-seq.el (cl--parsing-keywords, cl-sort): * lisp/emacs-lisp/cl-macs.el (cl-typecase): * lisp/emacs-lisp/cl-extra.el (cl-some, cl-every) (cl--map-keymap-recursively): * lisp/emacs-lisp/advice.el (ad-insert-argument-access-forms): * lisp/emacs-lisp/edebug.el (edebug-sort-alist) (edebug-set-windows): * lisp/emacs-lisp/pp.el (pp-display-expression): * lisp/emacs-lisp/regi.el (regi-interpret): Don't quote lambdas. diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index 5cda399b5e..bb45bb37d1 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -2370,28 +2370,26 @@ The assignment starts at position INDEX." (defun ad-insert-argument-access-forms (definition arglist) "Expands arg-access text macros in DEFINITION according to ARGLIST." (ad-substitute-tree - (function - (lambda (form) - (or (eq form 'ad-arg-bindings) - (and (memq (car-safe form) - '(ad-get-arg ad-get-args ad-set-arg ad-set-args)) - (integerp (car-safe (cdr form))))))) - (function - (lambda (form) - (if (eq form 'ad-arg-bindings) - (ad-retrieve-args-form arglist) - (let ((accessor (car form)) - (index (car (cdr form))) - (val (car (cdr (ad-insert-argument-access-forms - (cdr form) arglist))))) - (cond ((eq accessor 'ad-get-arg) - (ad-get-argument arglist index)) - ((eq accessor 'ad-set-arg) - (ad-set-argument arglist index val)) - ((eq accessor 'ad-get-args) - (ad-get-arguments arglist index)) - ((eq accessor 'ad-set-args) - (ad-set-arguments arglist index val))))))) + (lambda (form) + (or (eq form 'ad-arg-bindings) + (and (memq (car-safe form) + '(ad-get-arg ad-get-args ad-set-arg ad-set-args)) + (integerp (car-safe (cdr form)))))) + (lambda (form) + (if (eq form 'ad-arg-bindings) + (ad-retrieve-args-form arglist) + (let ((accessor (car form)) + (index (car (cdr form))) + (val (car (cdr (ad-insert-argument-access-forms + (cdr form) arglist))))) + (cond ((eq accessor 'ad-get-arg) + (ad-get-argument arglist index)) + ((eq accessor 'ad-set-arg) + (ad-set-argument arglist index val)) + ((eq accessor 'ad-get-args) + (ad-get-arguments arglist index)) + ((eq accessor 'ad-set-args) + (ad-set-arguments arglist index val)))))) definition)) ;; @@@ Mapping argument lists: diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index d3159a3768..a55d78de15 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -209,10 +209,10 @@ non-nil value. \n(fn PREDICATE SEQ...)" (if (or cl-rest (nlistp cl-seq)) (catch 'cl-some - (apply 'cl-map nil - (function (lambda (&rest cl-x) - (let ((cl-res (apply cl-pred cl-x))) - (if cl-res (throw 'cl-some cl-res))))) + (apply #'cl-map nil + (lambda (&rest cl-x) + (let ((cl-res (apply cl-pred cl-x))) + (if cl-res (throw 'cl-some cl-res)))) cl-seq cl-rest) nil) (let ((cl-x nil)) (while (and cl-seq (not (setq cl-x (funcall cl-pred (pop cl-seq)))))) @@ -224,9 +224,9 @@ non-nil value. \n(fn PREDICATE SEQ...)" (if (or cl-rest (nlistp cl-seq)) (catch 'cl-every - (apply 'cl-map nil - (function (lambda (&rest cl-x) - (or (apply cl-pred cl-x) (throw 'cl-every nil)))) + (apply #'cl-map nil + (lambda (&rest cl-x) + (or (apply cl-pred cl-x) (throw 'cl-every nil))) cl-seq cl-rest) t) (while (and cl-seq (funcall cl-pred (car cl-seq))) (setq cl-seq (cdr cl-seq))) @@ -249,14 +249,13 @@ non-nil value. (or cl-base (setq cl-base (copy-sequence [0]))) (map-keymap - (function - (lambda (cl-key cl-bind) - (aset cl-base (1- (length cl-base)) cl-key) - (if (keymapp cl-bind) - (cl--map-keymap-recursively - cl-func-rec cl-bind - (vconcat cl-base (list 0))) - (funcall cl-func-rec cl-base cl-bind)))) + (lambda (cl-key cl-bind) + (aset cl-base (1- (length cl-base)) cl-key) + (if (keymapp cl-bind) + (cl--map-keymap-recursively + cl-func-rec cl-bind + (vconcat cl-base (list 0))) + (funcall cl-func-rec cl-base cl-bind))) cl-map)) ;;;###autoload diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 1501ed4308..14b65ef25b 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -819,16 +819,15 @@ final clause, and matches if no other keys match. (cons 'cond (mapcar - (function - (lambda (c) - (cons (cond ((eq (car c) 'otherwise) t) - ((eq (car c) 'cl--ecase-error-flag) - `(error "cl-etypecase failed: %s, %s" - ,temp ',(reverse type-list))) - (t - (push (car c) type-list) - `(cl-typep ,temp ',(car c)))) - (or (cdr c) '(nil))))) + (lambda (c) + (cons (cond ((eq (car c) 'otherwise) t) + ((eq (car c) 'cl--ecase-error-flag) + `(error "cl-etypecase failed: %s, %s" + ,temp ',(reverse type-list))) + (t + (push (car c) type-list) + `(cl-typep ,temp ',(car c)))) + (or (cdr c) '(nil)))) clauses))))) ;;;###autoload @@ -2763,7 +2762,7 @@ Supported keywords for slots are: (unless (cl--struct-name-p name) (signal 'wrong-type-argument (list 'cl-struct-name-p name 'name))) (setq descs (cons '(cl-tag-slot) - (mapcar (function (lambda (x) (if (consp x) x (list x)))) + (mapcar (lambda (x) (if (consp x) x (list x))) descs))) (while opts (let ((opt (if (consp (car opts)) (caar opts) (car opts))) @@ -2790,9 +2789,8 @@ Supported keywords for slots are: ;; we include EIEIO classes rather than cl-structs! (when include-name (error "Can't :include more than once")) (setq include-name (car args)) - (setq include-descs (mapcar (function - (lambda (x) - (if (consp x) x (list x)))) + (setq include-descs (mapcar (lambda (x) + (if (consp x) x (list x))) (cdr args)))) ((eq opt :print-function) (setq print-func (car args))) diff --git a/lisp/emacs-lisp/cl-seq.el b/lisp/emacs-lisp/cl-seq.el index d34d50172d..8cfdd140f8 100644 --- a/lisp/emacs-lisp/cl-seq.el +++ b/lisp/emacs-lisp/cl-seq.el @@ -69,10 +69,9 @@ (list 'or (list 'memq '(car cl-keys-temp) (list 'quote (mapcar - (function - (lambda (x) - (if (consp x) - (car x) x))) + (lambda (x) + (if (consp x) + (car x) x)) (append kwords other-keys)))) '(car (cdr (memq (quote :allow-other-keys) @@ -668,9 +667,9 @@ This is a destructive function; it reuses the storage of SEQ if possible. (cl--parsing-keywords (:key) () (if (memq cl-key '(nil identity)) (sort cl-seq cl-pred) - (sort cl-seq (function (lambda (cl-x cl-y) - (funcall cl-pred (funcall cl-key cl-x) - (funcall cl-key cl-y))))))))) + (sort cl-seq (lambda (cl-x cl-y) + (funcall cl-pred (funcall cl-key cl-x) + (funcall cl-key cl-y)))))))) ;;;###autoload (defun cl-stable-sort (cl-seq cl-pred &rest cl-keys) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index e310313940..f242e922bd 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -309,9 +309,8 @@ A lambda list keyword is a symbol that starts with `&'." (defun edebug-sort-alist (alist function) ;; Return the ALIST sorted with comparison function FUNCTION. ;; This uses 'sort so the sorting is destructive. - (sort alist (function - (lambda (e1 e2) - (funcall function (car e1) (car e2)))))) + (sort alist (lambda (e1 e2) + (funcall function (car e1) (car e2))))) ;; Not used. '(defmacro edebug-save-restriction (&rest body) @@ -407,14 +406,13 @@ Return the result of the last expression in BODY." (if (listp window-info) (mapcar (lambda (one-window-info) (if one-window-info - (apply (function - (lambda (window buffer point start hscroll) - (if (edebug-window-live-p window) - (progn - (set-window-buffer window buffer) - (set-window-point window point) - (set-window-start window start) - (set-window-hscroll window hscroll))))) + (apply (lambda (window buffer point start hscroll) + (if (edebug-window-live-p window) + (progn + (set-window-buffer window buffer) + (set-window-point window point) + (set-window-start window start) + (set-window-hscroll window hscroll)))) one-window-info))) window-info) (set-window-configuration window-info))) diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index eb2ee94be3..458f803ffe 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -94,27 +94,25 @@ after OUT-BUFFER-NAME." ;; This function either decides not to display it at all ;; or displays it in the usual way. (temp-buffer-show-function - (function - (lambda (buf) - (with-current-buffer buf - (goto-char (point-min)) - (end-of-line 1) - (if (or (< (1+ (point)) (point-max)) - (>= (- (point) (point-min)) (frame-width))) - (let ((temp-buffer-show-function old-show-function) - (old-selected (selected-window)) - (window (display-buffer buf))) - (goto-char (point-min)) ; expected by some hooks ... - (make-frame-visible (window-frame window)) - (unwind-protect - (progn - (select-window window) - (run-hooks 'temp-buffer-show-hook)) - (when (window-live-p old-selected) - (select-window old-selected)) - (message "See buffer %s." out-buffer-name))) - (message "%s" (buffer-substring (point-min) (point))) - )))))) + (lambda (buf) + (with-current-buffer buf + (goto-char (point-min)) + (end-of-line 1) + (if (or (< (1+ (point)) (point-max)) + (>= (- (point) (point-min)) (frame-width))) + (let ((temp-buffer-show-function old-show-function) + (old-selected (selected-window)) + (window (display-buffer buf))) + (goto-char (point-min)) ; expected by some hooks ... + (make-frame-visible (window-frame window)) + (unwind-protect + (progn + (select-window window) + (run-hooks 'temp-buffer-show-hook)) + (when (window-live-p old-selected) + (select-window old-selected)) + (message "See buffer %s." out-buffer-name))) + (message "%s" (buffer-substring (point-min) (point)))))))) (with-output-to-temp-buffer out-buffer-name (pp expression) (with-current-buffer standard-output diff --git a/lisp/emacs-lisp/regi.el b/lisp/emacs-lisp/regi.el index 11b28b72cf..2e6e2b75d6 100644 --- a/lisp/emacs-lisp/regi.el +++ b/lisp/emacs-lisp/regi.el @@ -163,18 +163,15 @@ useful information: ;; let's find the special tags and remove them from the working ;; frame. note that only the last special tag is used. (mapc - (function - (lambda (entry) - (let ((pred (car entry)) - (func (car (cdr entry)))) - (cond - ((eq pred 'begin) (setq begin-tag func)) - ((eq pred 'end) (setq end-tag func)) - ((eq pred 'every) (setq every-tag func)) - (t - (setq working-frame (append working-frame (list entry)))) - ) ; end-cond - ))) + (lambda (entry) + (let ((pred (car entry)) + (func (car (cdr entry)))) + (cond + ((eq pred 'begin) (setq begin-tag func)) + ((eq pred 'end) (setq end-tag func)) + ((eq pred 'every) (setq every-tag func)) + (t + (setq working-frame (append working-frame (list entry))))))) frame) ; end-mapcar ;; execute the begin entry commit 4a8c1120f5deac6d4b4a5e7109af583818510735 Merge: 5fe469f02d 75723ec212 Author: Glenn Morris Date: Mon Nov 16 09:05:31 2020 -0800 Merge from origin/emacs-27 75723ec212 (origin/emacs-27) ; * lisp/emacs-lisp/benchmark.el (benchm... 53e2a612ad ; * lib-src/make-fingerprint.c: Update commentary. 286c632772 Reformat argument commentary in etags.c 4ec740866a Make the invocation of combine-change-calls in comment-reg... 66bcec8838 * lisp/progmodes/cc-langs.el (c-<>-notable-chars-re): Fix ... 03eeab469e ; Update the expected result files in test/manual/etags. d875a22bc6 Update the various INSTALL files # Conflicts: # INSTALL commit 5fe469f02d9d5ec58f3ff8d73ff50b1ec2c6ea2a Merge: a280a6d7ca e2c7b6372d Author: Glenn Morris Date: Mon Nov 16 08:59:47 2020 -0800 ; Merge from origin/emacs-27 The following commit was skipped: e2c7b6372d Don't leave lock files after 'replace-buffer-contents' commit a280a6d7caa715d911f3041fe074bf36b3a4df8c Merge: 82d0b88720 19da602991 Author: Glenn Morris Date: Mon Nov 16 08:59:47 2020 -0800 Merge from origin/emacs-27 19da602991 Fix input method translation near read-only text 5aabf2cc7f Fix display of truncated R2L lines on TTY frames daff3bda10 Avoid crashes when a reversed glyph row starts with a comp... b697bb91a1 ; * .gitignore: src/fingerprint.c not generated since 2019... commit 82d0b88720b1d2b0449e42ae2e9e7994fd4a5e8f Author: Stefan Kangas Date: Mon Nov 16 16:53:24 2020 +0100 Don't quote lambdas in calc/calcalg{2,3}.el * lisp/calc/calcalg2.el (calcFunc-inv\', calcFunc-sqrt\') (calcFunc-deg\', calcFunc-rad\', calcFunc-ln\') (calcFunc-log10\', calcFunc-lnp1\', calcFunc-log\') (calcFunc-log\'2, calcFunc-exp\', calcFunc-expm1\') (calcFunc-sin\', calcFunc-cos\', calcFunc-tan\', calcFunc-sec\') (calcFunc-csc\', calcFunc-cot\', calcFunc-arcsin\') (calcFunc-arccos\', calcFunc-arctan\', calcFunc-sinh\') (calcFunc-cosh\', calcFunc-tanh\', calcFunc-sech\') (calcFunc-csch\', calcFunc-coth\', calcFunc-arcsinh\') (calcFunc-arccosh\', calcFunc-arctanh\', calcFunc-bern\'2) (calcFunc-euler\'2, calcFunc-gammag\'2, calcFunc-gammaG\'2) (calcFunc-gammaP\'2, calcFunc-gammaQ\'2, calcFunc-betaB\') (calcFunc-betaI\', calcFunc-erf\', calcFunc-erfc\') (calcFunc-besJ\'2, calcFunc-besY\'2, calcFunc-sum) (calcFunc-prod, calcFunc-integ, calcFunc-if, calcFunc-subscr) (math-do-integral, calcFunc-integ, math-decompose-poly) (math-solve-system-rec, math-solve-system-subst, math-solve-for) (calcFunc-inv, calcFunc-sqrt, calcFunc-conj, calcFunc-abs) (calcFunc-deg, calcFunc-rad, calcFunc-ln, calcFunc-log10) (calcFunc-lnp1, calcFunc-exp, calcFunc-expm1, calcFunc-sin) (calcFunc-cos, calcFunc-tan, calcFunc-arcsin, calcFunc-arccos) (calcFunc-arctan, calcFunc-sinh, calcFunc-cosh, calcFunc-tanh) (calcFunc-arcsinh, calcFunc-arccosh, calcFunc-arctanh): * lisp/calc/calcalg3.el (calc-get-fit-variables) (calcFunc-polint, calcFunc-ratint, math-all-vars-but): Don't quote lambdas. diff --git a/lisp/calc/calcalg2.el b/lisp/calc/calcalg2.el index 7894bd9301..bf4d626191 100644 --- a/lisp/calc/calcalg2.el +++ b/lisp/calc/calcalg2.el @@ -361,175 +361,175 @@ res)))) (put 'calcFunc-inv\' 'math-derivative-1 - (function (lambda (u) (math-neg (math-div 1 (math-sqr u)))))) + (lambda (u) (math-neg (math-div 1 (math-sqr u))))) (put 'calcFunc-sqrt\' 'math-derivative-1 - (function (lambda (u) (math-div 1 (math-mul 2 (list 'calcFunc-sqrt u)))))) + (lambda (u) (math-div 1 (math-mul 2 (list 'calcFunc-sqrt u))))) (put 'calcFunc-deg\' 'math-derivative-1 - (function (lambda (_) (math-div-float '(float 18 1) (math-pi))))) + (lambda (_) (math-div-float '(float 18 1) (math-pi)))) (put 'calcFunc-rad\' 'math-derivative-1 - (function (lambda (_) (math-pi-over-180)))) + (lambda (_) (math-pi-over-180))) (put 'calcFunc-ln\' 'math-derivative-1 - (function (lambda (u) (math-div 1 u)))) + (lambda (u) (math-div 1 u))) (put 'calcFunc-log10\' 'math-derivative-1 - (function (lambda (u) - (math-div (math-div 1 (math-normalize '(calcFunc-ln 10))) - u)))) + (lambda (u) + (math-div (math-div 1 (math-normalize '(calcFunc-ln 10))) + u))) (put 'calcFunc-lnp1\' 'math-derivative-1 - (function (lambda (u) (math-div 1 (math-add u 1))))) + (lambda (u) (math-div 1 (math-add u 1)))) (put 'calcFunc-log\' 'math-derivative-2 - (function (lambda (x b) - (and (not (Math-zerop b)) - (let ((lnv (math-normalize - (list 'calcFunc-ln b)))) - (math-div 1 (math-mul lnv x))))))) + (lambda (x b) + (and (not (Math-zerop b)) + (let ((lnv (math-normalize + (list 'calcFunc-ln b)))) + (math-div 1 (math-mul lnv x)))))) (put 'calcFunc-log\'2 'math-derivative-2 - (function (lambda (x b) - (let ((lnv (list 'calcFunc-ln b))) - (math-neg (math-div (list 'calcFunc-log x b) - (math-mul lnv b))))))) + (lambda (x b) + (let ((lnv (list 'calcFunc-ln b))) + (math-neg (math-div (list 'calcFunc-log x b) + (math-mul lnv b)))))) (put 'calcFunc-exp\' 'math-derivative-1 - (function (lambda (u) (math-normalize (list 'calcFunc-exp u))))) + (lambda (u) (math-normalize (list 'calcFunc-exp u)))) (put 'calcFunc-expm1\' 'math-derivative-1 - (function (lambda (u) (math-normalize (list 'calcFunc-expm1 u))))) + (lambda (u) (math-normalize (list 'calcFunc-expm1 u)))) (put 'calcFunc-sin\' 'math-derivative-1 - (function (lambda (u) (math-to-radians-2 (math-normalize - (list 'calcFunc-cos u)) t)))) + (lambda (u) (math-to-radians-2 (math-normalize + (list 'calcFunc-cos u)) t))) (put 'calcFunc-cos\' 'math-derivative-1 - (function (lambda (u) (math-neg (math-to-radians-2 - (math-normalize - (list 'calcFunc-sin u)) t))))) + (lambda (u) (math-neg (math-to-radians-2 + (math-normalize + (list 'calcFunc-sin u)) t)))) (put 'calcFunc-tan\' 'math-derivative-1 - (function (lambda (u) (math-to-radians-2 - (math-sqr - (math-normalize - (list 'calcFunc-sec u))) t)))) + (lambda (u) (math-to-radians-2 + (math-sqr + (math-normalize + (list 'calcFunc-sec u))) t))) (put 'calcFunc-sec\' 'math-derivative-1 - (function (lambda (u) (math-to-radians-2 - (math-mul - (math-normalize - (list 'calcFunc-sec u)) - (math-normalize - (list 'calcFunc-tan u))) t)))) + (lambda (u) (math-to-radians-2 + (math-mul + (math-normalize + (list 'calcFunc-sec u)) + (math-normalize + (list 'calcFunc-tan u))) t))) (put 'calcFunc-csc\' 'math-derivative-1 - (function (lambda (u) (math-neg - (math-to-radians-2 - (math-mul - (math-normalize - (list 'calcFunc-csc u)) - (math-normalize - (list 'calcFunc-cot u))) t))))) + (lambda (u) (math-neg + (math-to-radians-2 + (math-mul + (math-normalize + (list 'calcFunc-csc u)) + (math-normalize + (list 'calcFunc-cot u))) t)))) (put 'calcFunc-cot\' 'math-derivative-1 - (function (lambda (u) (math-neg - (math-to-radians-2 - (math-sqr - (math-normalize - (list 'calcFunc-csc u))) t))))) + (lambda (u) (math-neg + (math-to-radians-2 + (math-sqr + (math-normalize + (list 'calcFunc-csc u))) t)))) (put 'calcFunc-arcsin\' 'math-derivative-1 - (function (lambda (u) - (math-from-radians-2 - (math-div 1 (math-normalize - (list 'calcFunc-sqrt - (math-sub 1 (math-sqr u))))) t)))) + (lambda (u) + (math-from-radians-2 + (math-div 1 (math-normalize + (list 'calcFunc-sqrt + (math-sub 1 (math-sqr u))))) t))) (put 'calcFunc-arccos\' 'math-derivative-1 - (function (lambda (u) - (math-from-radians-2 - (math-div -1 (math-normalize - (list 'calcFunc-sqrt - (math-sub 1 (math-sqr u))))) t)))) + (lambda (u) + (math-from-radians-2 + (math-div -1 (math-normalize + (list 'calcFunc-sqrt + (math-sub 1 (math-sqr u))))) t))) (put 'calcFunc-arctan\' 'math-derivative-1 - (function (lambda (u) (math-from-radians-2 - (math-div 1 (math-add 1 (math-sqr u))) t)))) + (lambda (u) (math-from-radians-2 + (math-div 1 (math-add 1 (math-sqr u))) t))) (put 'calcFunc-sinh\' 'math-derivative-1 - (function (lambda (u) (math-normalize (list 'calcFunc-cosh u))))) + (lambda (u) (math-normalize (list 'calcFunc-cosh u)))) (put 'calcFunc-cosh\' 'math-derivative-1 - (function (lambda (u) (math-normalize (list 'calcFunc-sinh u))))) + (lambda (u) (math-normalize (list 'calcFunc-sinh u)))) (put 'calcFunc-tanh\' 'math-derivative-1 - (function (lambda (u) (math-sqr - (math-normalize - (list 'calcFunc-sech u)))))) + (lambda (u) (math-sqr + (math-normalize + (list 'calcFunc-sech u))))) (put 'calcFunc-sech\' 'math-derivative-1 - (function (lambda (u) (math-neg - (math-mul - (math-normalize (list 'calcFunc-sech u)) - (math-normalize (list 'calcFunc-tanh u))))))) + (lambda (u) (math-neg + (math-mul + (math-normalize (list 'calcFunc-sech u)) + (math-normalize (list 'calcFunc-tanh u)))))) (put 'calcFunc-csch\' 'math-derivative-1 - (function (lambda (u) (math-neg - (math-mul - (math-normalize (list 'calcFunc-csch u)) - (math-normalize (list 'calcFunc-coth u))))))) + (lambda (u) (math-neg + (math-mul + (math-normalize (list 'calcFunc-csch u)) + (math-normalize (list 'calcFunc-coth u)))))) (put 'calcFunc-coth\' 'math-derivative-1 - (function (lambda (u) (math-neg - (math-sqr - (math-normalize - (list 'calcFunc-csch u))))))) + (lambda (u) (math-neg + (math-sqr + (math-normalize + (list 'calcFunc-csch u)))))) (put 'calcFunc-arcsinh\' 'math-derivative-1 - (function (lambda (u) - (math-div 1 (math-normalize - (list 'calcFunc-sqrt - (math-add (math-sqr u) 1))))))) + (lambda (u) + (math-div 1 (math-normalize + (list 'calcFunc-sqrt + (math-add (math-sqr u) 1)))))) (put 'calcFunc-arccosh\' 'math-derivative-1 - (function (lambda (u) - (math-div 1 (math-normalize - (list 'calcFunc-sqrt - (math-add (math-sqr u) -1))))))) + (lambda (u) + (math-div 1 (math-normalize + (list 'calcFunc-sqrt + (math-add (math-sqr u) -1)))))) (put 'calcFunc-arctanh\' 'math-derivative-1 - (function (lambda (u) (math-div 1 (math-sub 1 (math-sqr u)))))) + (lambda (u) (math-div 1 (math-sub 1 (math-sqr u))))) (put 'calcFunc-bern\'2 'math-derivative-2 - (function (lambda (n x) - (math-mul n (list 'calcFunc-bern (math-add n -1) x))))) + (lambda (n x) + (math-mul n (list 'calcFunc-bern (math-add n -1) x)))) (put 'calcFunc-euler\'2 'math-derivative-2 - (function (lambda (n x) - (math-mul n (list 'calcFunc-euler (math-add n -1) x))))) + (lambda (n x) + (math-mul n (list 'calcFunc-euler (math-add n -1) x)))) (put 'calcFunc-gammag\'2 'math-derivative-2 - (function (lambda (a x) (math-deriv-gamma a x 1)))) + (lambda (a x) (math-deriv-gamma a x 1))) (put 'calcFunc-gammaG\'2 'math-derivative-2 - (function (lambda (a x) (math-deriv-gamma a x -1)))) + (lambda (a x) (math-deriv-gamma a x -1))) (put 'calcFunc-gammaP\'2 'math-derivative-2 - (function (lambda (a x) (math-deriv-gamma a x - (math-div - 1 (math-normalize - (list 'calcFunc-gamma - a))))))) + (lambda (a x) (math-deriv-gamma a x + (math-div + 1 (math-normalize + (list 'calcFunc-gamma + a)))))) (put 'calcFunc-gammaQ\'2 'math-derivative-2 - (function (lambda (a x) (math-deriv-gamma a x - (math-div - -1 (math-normalize - (list 'calcFunc-gamma - a))))))) + (lambda (a x) (math-deriv-gamma a x + (math-div + -1 (math-normalize + (list 'calcFunc-gamma + a)))))) (defun math-deriv-gamma (a x scale) (math-mul scale @@ -537,13 +537,13 @@ (list 'calcFunc-exp (math-neg x))))) (put 'calcFunc-betaB\' 'math-derivative-3 - (function (lambda (x a b) (math-deriv-beta x a b 1)))) + (lambda (x a b) (math-deriv-beta x a b 1))) (put 'calcFunc-betaI\' 'math-derivative-3 - (function (lambda (x a b) (math-deriv-beta x a b - (math-div - 1 (list 'calcFunc-beta - a b)))))) + (lambda (x a b) (math-deriv-beta x a b + (math-div + 1 (list 'calcFunc-beta + a b))))) (defun math-deriv-beta (x a b scale) (math-mul (math-mul (math-pow x (math-add a -1)) @@ -551,101 +551,96 @@ scale)) (put 'calcFunc-erf\' 'math-derivative-1 - (function (lambda (x) (math-div 2 - (math-mul (list 'calcFunc-exp - (math-sqr x)) - (if calc-symbolic-mode - '(calcFunc-sqrt - (var pi var-pi)) - (math-sqrt-pi))))))) + (lambda (x) (math-div 2 + (math-mul (list 'calcFunc-exp + (math-sqr x)) + (if calc-symbolic-mode + '(calcFunc-sqrt + (var pi var-pi)) + (math-sqrt-pi)))))) (put 'calcFunc-erfc\' 'math-derivative-1 - (function (lambda (x) (math-div -2 - (math-mul (list 'calcFunc-exp - (math-sqr x)) - (if calc-symbolic-mode - '(calcFunc-sqrt - (var pi var-pi)) - (math-sqrt-pi))))))) + (lambda (x) (math-div -2 + (math-mul (list 'calcFunc-exp + (math-sqr x)) + (if calc-symbolic-mode + '(calcFunc-sqrt + (var pi var-pi)) + (math-sqrt-pi)))))) (put 'calcFunc-besJ\'2 'math-derivative-2 - (function (lambda (v z) (math-div (math-sub (list 'calcFunc-besJ - (math-add v -1) - z) - (list 'calcFunc-besJ - (math-add v 1) - z)) - 2)))) + (lambda (v z) (math-div (math-sub (list 'calcFunc-besJ + (math-add v -1) + z) + (list 'calcFunc-besJ + (math-add v 1) + z)) + 2))) (put 'calcFunc-besY\'2 'math-derivative-2 - (function (lambda (v z) (math-div (math-sub (list 'calcFunc-besY - (math-add v -1) - z) - (list 'calcFunc-besY - (math-add v 1) - z)) - 2)))) + (lambda (v z) (math-div (math-sub (list 'calcFunc-besY + (math-add v -1) + z) + (list 'calcFunc-besY + (math-add v 1) + z)) + 2))) (put 'calcFunc-sum 'math-derivative-n - (function - (lambda (expr) - (if (math-expr-contains (cons 'vec (cdr (cdr expr))) math-deriv-var) - (throw 'math-deriv nil) - (cons 'calcFunc-sum - (cons (math-derivative (nth 1 expr)) - (cdr (cdr expr)))))))) + (lambda (expr) + (if (math-expr-contains (cons 'vec (cdr (cdr expr))) math-deriv-var) + (throw 'math-deriv nil) + (cons 'calcFunc-sum + (cons (math-derivative (nth 1 expr)) + (cdr (cdr expr))))))) (put 'calcFunc-prod 'math-derivative-n - (function - (lambda (expr) - (if (math-expr-contains (cons 'vec (cdr (cdr expr))) math-deriv-var) - (throw 'math-deriv nil) - (math-mul expr - (cons 'calcFunc-sum - (cons (math-div (math-derivative (nth 1 expr)) - (nth 1 expr)) - (cdr (cdr expr))))))))) + (lambda (expr) + (if (math-expr-contains (cons 'vec (cdr (cdr expr))) math-deriv-var) + (throw 'math-deriv nil) + (math-mul expr + (cons 'calcFunc-sum + (cons (math-div (math-derivative (nth 1 expr)) + (nth 1 expr)) + (cdr (cdr expr)))))))) (put 'calcFunc-integ 'math-derivative-n - (function - (lambda (expr) - (if (= (length expr) 3) - (if (equal (nth 2 expr) math-deriv-var) - (nth 1 expr) - (math-normalize - (list 'calcFunc-integ - (math-derivative (nth 1 expr)) - (nth 2 expr)))) - (if (= (length expr) 5) - (let ((lower (math-expr-subst (nth 1 expr) (nth 2 expr) - (nth 3 expr))) - (upper (math-expr-subst (nth 1 expr) (nth 2 expr) - (nth 4 expr)))) - (math-add (math-sub (math-mul upper - (math-derivative (nth 4 expr))) - (math-mul lower - (math-derivative (nth 3 expr)))) - (if (equal (nth 2 expr) math-deriv-var) - 0 - (math-normalize - (list 'calcFunc-integ - (math-derivative (nth 1 expr)) (nth 2 expr) - (nth 3 expr) (nth 4 expr))))))))))) + (lambda (expr) + (if (= (length expr) 3) + (if (equal (nth 2 expr) math-deriv-var) + (nth 1 expr) + (math-normalize + (list 'calcFunc-integ + (math-derivative (nth 1 expr)) + (nth 2 expr)))) + (if (= (length expr) 5) + (let ((lower (math-expr-subst (nth 1 expr) (nth 2 expr) + (nth 3 expr))) + (upper (math-expr-subst (nth 1 expr) (nth 2 expr) + (nth 4 expr)))) + (math-add (math-sub (math-mul upper + (math-derivative (nth 4 expr))) + (math-mul lower + (math-derivative (nth 3 expr)))) + (if (equal (nth 2 expr) math-deriv-var) + 0 + (math-normalize + (list 'calcFunc-integ + (math-derivative (nth 1 expr)) (nth 2 expr) + (nth 3 expr) (nth 4 expr)))))))))) (put 'calcFunc-if 'math-derivative-n - (function - (lambda (expr) - (and (= (length expr) 4) - (list 'calcFunc-if (nth 1 expr) - (math-derivative (nth 2 expr)) - (math-derivative (nth 3 expr))))))) + (lambda (expr) + (and (= (length expr) 4) + (list 'calcFunc-if (nth 1 expr) + (math-derivative (nth 2 expr)) + (math-derivative (nth 3 expr)))))) (put 'calcFunc-subscr 'math-derivative-n - (function - (lambda (expr) - (and (= (length expr) 3) - (list 'calcFunc-subscr (nth 1 expr) - (math-derivative (nth 2 expr))))))) + (lambda (expr) + (and (= (length expr) 3) + (list 'calcFunc-subscr (nth 1 expr) + (math-derivative (nth 2 expr)))))) (defvar math-integ-var '(var X ---)) @@ -1015,11 +1010,10 @@ res '(calcFunc-integsubst))) (and (memq (length part) '(3 4 5)) (let ((parts (mapcar - (function - (lambda (x) - (math-expr-subst - x (nth 2 part) - math-integ-var))) + (lambda (x) + (math-expr-subst + x (nth 2 part) + math-integ-var)) (cdr part)))) (math-integrate-by-substitution expr (car parts) t @@ -1516,7 +1510,7 @@ var low high) (nth 2 (nth 2 expr)))) ((eq (car-safe expr) 'vec) - (cons 'vec (mapcar (function (lambda (x) (calcFunc-integ x var low high))) + (cons 'vec (mapcar (lambda (x) (calcFunc-integ x var low high)) (cdr expr)))) (t (let ((state (list calc-angle-mode @@ -2742,28 +2736,27 @@ math-t1 math-t2 math-t3) (setq math-t2 (math-polynomial-base math-solve-lhs - (function - (lambda (solve-b) - (let ((math-solve-b solve-b) - (math-poly-neg-powers '(1)) - (math-poly-mult-powers nil) - (math-poly-frac-powers 1) - (math-poly-exp-base t)) - (and (not (equal math-solve-b math-solve-lhs)) - (or (not (memq (car-safe math-solve-b) '(+ -))) sub-rhs) - (setq math-t3 '(1 0) math-t2 1 - math-t1 (math-is-polynomial math-solve-lhs - math-solve-b 50)) - (if (and (equal math-poly-neg-powers '(1)) - (memq math-poly-mult-powers '(nil 1)) - (eq math-poly-frac-powers 1) - sub-rhs) - (setq math-t1 (cons (math-sub (car math-t1) math-solve-rhs) - (cdr math-t1))) - (math-solve-poly-funny-powers sub-rhs)) - (math-solve-crunch-poly degree) - (or (math-expr-contains math-solve-b math-solve-var) - (math-expr-contains (car math-t3) math-solve-var)))))))) + (lambda (solve-b) + (let ((math-solve-b solve-b) + (math-poly-neg-powers '(1)) + (math-poly-mult-powers nil) + (math-poly-frac-powers 1) + (math-poly-exp-base t)) + (and (not (equal math-solve-b math-solve-lhs)) + (or (not (memq (car-safe math-solve-b) '(+ -))) sub-rhs) + (setq math-t3 '(1 0) math-t2 1 + math-t1 (math-is-polynomial math-solve-lhs + math-solve-b 50)) + (if (and (equal math-poly-neg-powers '(1)) + (memq math-poly-mult-powers '(nil 1)) + (eq math-poly-frac-powers 1) + sub-rhs) + (setq math-t1 (cons (math-sub (car math-t1) math-solve-rhs) + (cdr math-t1))) + (math-solve-poly-funny-powers sub-rhs)) + (math-solve-crunch-poly degree) + (or (math-expr-contains math-solve-b math-solve-var) + (math-expr-contains (car math-t3) math-solve-var))))))) (if math-t2 (list (math-pow math-t2 (car math-t3)) (cons 'vec math-t1) @@ -3326,12 +3319,11 @@ (delq (car v) (copy-sequence var-list)) (let ((math-solve-simplifying nil) (s (mapcar - (function - (lambda (x) - (cons - (car x) - (math-solve-system-subst - (cdr x))))) + (lambda (x) + (cons + (car x) + (math-solve-system-subst + (cdr x)))) solns))) (if elim s @@ -3347,35 +3339,33 @@ ;; Eliminated all variables, so now put solution into the proper format. (setq solns (sort solns - (function - (lambda (x y) - (not (memq (car x) (memq (car y) math-solve-vars))))))) + (lambda (x y) + (not (memq (car x) (memq (car y) math-solve-vars)))))) (if (eq math-solve-full 'all) (math-transpose (math-normalize (cons 'vec (if solns - (mapcar (function (lambda (x) (cons 'vec (cdr x)))) solns) - (mapcar (function (lambda (x) (cons 'vec x))) eqn-list))))) + (mapcar (lambda (x) (cons 'vec (cdr x))) solns) + (mapcar (lambda (x) (cons 'vec x)) eqn-list))))) (math-normalize (cons 'vec (if solns - (mapcar (function (lambda (x) (cons 'calcFunc-eq x))) solns) - (mapcar 'car eqn-list))))))) + (mapcar (lambda (x) (cons 'calcFunc-eq x)) solns) + (mapcar #'car eqn-list))))))) (defun math-solve-system-subst (x) ; uses "res" and "v" (let ((accum nil) (res2 math-solve-system-res)) (while x (setq accum (nconc accum - (mapcar (function - (lambda (r) - (if math-solve-simplifying - (math-simplify - (math-expr-subst - (car x) math-solve-system-vv r)) - (math-expr-subst - (car x) math-solve-system-vv r)))) + (mapcar (lambda (r) + (if math-solve-simplifying + (math-simplify + (math-expr-subst + (car x) math-solve-system-vv r)) + (math-expr-subst + (car x) math-solve-system-vv r))) (car res2))) x (cdr x) res2 (cdr res2))) @@ -3471,11 +3461,10 @@ (let ((old-len (length res)) new-len) (setq res (delq nil - (mapcar (function - (lambda (x) - (and (not (memq (car-safe x) - '(cplx polar))) - x))) + (mapcar (lambda (x) + (and (not (memq (car-safe x) + '(cplx polar))) + x)) res)) new-len (length res)) (if (< new-len old-len) @@ -3545,119 +3534,119 @@ (put 'calcFunc-inv 'math-inverse - (function (lambda (x) (math-div 1 x)))) + (lambda (x) (math-div 1 x))) (put 'calcFunc-inv 'math-inverse-sign -1) (put 'calcFunc-sqrt 'math-inverse - (function (lambda (x) (math-sqr x)))) + (lambda (x) (math-sqr x))) (put 'calcFunc-conj 'math-inverse - (function (lambda (x) (list 'calcFunc-conj x)))) + (lambda (x) (list 'calcFunc-conj x))) (put 'calcFunc-abs 'math-inverse - (function (lambda (x) (math-solve-get-sign x)))) + (lambda (x) (math-solve-get-sign x))) (put 'calcFunc-deg 'math-inverse - (function (lambda (x) (list 'calcFunc-rad x)))) + (lambda (x) (list 'calcFunc-rad x))) (put 'calcFunc-deg 'math-inverse-sign 1) (put 'calcFunc-rad 'math-inverse - (function (lambda (x) (list 'calcFunc-deg x)))) + (lambda (x) (list 'calcFunc-deg x))) (put 'calcFunc-rad 'math-inverse-sign 1) (put 'calcFunc-ln 'math-inverse - (function (lambda (x) (list 'calcFunc-exp x)))) + (lambda (x) (list 'calcFunc-exp x))) (put 'calcFunc-ln 'math-inverse-sign 1) (put 'calcFunc-log10 'math-inverse - (function (lambda (x) (list 'calcFunc-exp10 x)))) + (lambda (x) (list 'calcFunc-exp10 x))) (put 'calcFunc-log10 'math-inverse-sign 1) (put 'calcFunc-lnp1 'math-inverse - (function (lambda (x) (list 'calcFunc-expm1 x)))) + (lambda (x) (list 'calcFunc-expm1 x))) (put 'calcFunc-lnp1 'math-inverse-sign 1) (put 'calcFunc-exp 'math-inverse - (function (lambda (x) (math-add (math-normalize (list 'calcFunc-ln x)) - (math-mul 2 - (math-mul '(var pi var-pi) - (math-solve-get-int - '(var i var-i)))))))) + (lambda (x) (math-add (math-normalize (list 'calcFunc-ln x)) + (math-mul 2 + (math-mul '(var pi var-pi) + (math-solve-get-int + '(var i var-i))))))) (put 'calcFunc-exp 'math-inverse-sign 1) (put 'calcFunc-expm1 'math-inverse - (function (lambda (x) (math-add (math-normalize (list 'calcFunc-lnp1 x)) - (math-mul 2 - (math-mul '(var pi var-pi) - (math-solve-get-int - '(var i var-i)))))))) + (lambda (x) (math-add (math-normalize (list 'calcFunc-lnp1 x)) + (math-mul 2 + (math-mul '(var pi var-pi) + (math-solve-get-int + '(var i var-i))))))) (put 'calcFunc-expm1 'math-inverse-sign 1) (put 'calcFunc-sin 'math-inverse - (function (lambda (x) (let ((n (math-solve-get-int 1))) - (math-add (math-mul (math-normalize - (list 'calcFunc-arcsin x)) - (math-pow -1 n)) - (math-mul (math-half-circle t) - n)))))) + (lambda (x) (let ((n (math-solve-get-int 1))) + (math-add (math-mul (math-normalize + (list 'calcFunc-arcsin x)) + (math-pow -1 n)) + (math-mul (math-half-circle t) + n))))) (put 'calcFunc-cos 'math-inverse - (function (lambda (x) (math-add (math-solve-get-sign - (math-normalize - (list 'calcFunc-arccos x))) - (math-solve-get-int - (math-full-circle t)))))) + (lambda (x) (math-add (math-solve-get-sign + (math-normalize + (list 'calcFunc-arccos x))) + (math-solve-get-int + (math-full-circle t))))) (put 'calcFunc-tan 'math-inverse - (function (lambda (x) (math-add (math-normalize (list 'calcFunc-arctan x)) - (math-solve-get-int - (math-half-circle t)))))) + (lambda (x) (math-add (math-normalize (list 'calcFunc-arctan x)) + (math-solve-get-int + (math-half-circle t))))) (put 'calcFunc-arcsin 'math-inverse - (function (lambda (x) (math-normalize (list 'calcFunc-sin x))))) + (lambda (x) (math-normalize (list 'calcFunc-sin x)))) (put 'calcFunc-arccos 'math-inverse - (function (lambda (x) (math-normalize (list 'calcFunc-cos x))))) + (lambda (x) (math-normalize (list 'calcFunc-cos x)))) (put 'calcFunc-arctan 'math-inverse - (function (lambda (x) (math-normalize (list 'calcFunc-tan x))))) + (lambda (x) (math-normalize (list 'calcFunc-tan x)))) (put 'calcFunc-sinh 'math-inverse - (function (lambda (x) (let ((n (math-solve-get-int 1))) - (math-add (math-mul (math-normalize - (list 'calcFunc-arcsinh x)) - (math-pow -1 n)) - (math-mul (math-half-circle t) - (math-mul - '(var i var-i) - n))))))) + (lambda (x) (let ((n (math-solve-get-int 1))) + (math-add (math-mul (math-normalize + (list 'calcFunc-arcsinh x)) + (math-pow -1 n)) + (math-mul (math-half-circle t) + (math-mul + '(var i var-i) + n)))))) (put 'calcFunc-sinh 'math-inverse-sign 1) (put 'calcFunc-cosh 'math-inverse - (function (lambda (x) (math-add (math-solve-get-sign - (math-normalize - (list 'calcFunc-arccosh x))) - (math-mul (math-full-circle t) - (math-solve-get-int - '(var i var-i))))))) + (lambda (x) (math-add (math-solve-get-sign + (math-normalize + (list 'calcFunc-arccosh x))) + (math-mul (math-full-circle t) + (math-solve-get-int + '(var i var-i)))))) (put 'calcFunc-tanh 'math-inverse - (function (lambda (x) (math-add (math-normalize - (list 'calcFunc-arctanh x)) - (math-mul (math-half-circle t) - (math-solve-get-int - '(var i var-i))))))) + (lambda (x) (math-add (math-normalize + (list 'calcFunc-arctanh x)) + (math-mul (math-half-circle t) + (math-solve-get-int + '(var i var-i)))))) (put 'calcFunc-tanh 'math-inverse-sign 1) (put 'calcFunc-arcsinh 'math-inverse - (function (lambda (x) (math-normalize (list 'calcFunc-sinh x))))) + (lambda (x) (math-normalize (list 'calcFunc-sinh x)))) (put 'calcFunc-arcsinh 'math-inverse-sign 1) (put 'calcFunc-arccosh 'math-inverse - (function (lambda (x) (math-normalize (list 'calcFunc-cosh x))))) + (lambda (x) (math-normalize (list 'calcFunc-cosh x)))) (put 'calcFunc-arctanh 'math-inverse - (function (lambda (x) (math-normalize (list 'calcFunc-tanh x))))) + (lambda (x) (math-normalize (list 'calcFunc-tanh x)))) (put 'calcFunc-arctanh 'math-inverse-sign 1) diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el index f1f67211b8..fdcde95dae 100644 --- a/lisp/calc/calcalg3.el +++ b/lisp/calc/calcalg3.el @@ -480,13 +480,13 @@ "Fitting variables" (format "%s; %s" (mapconcat 'symbol-name - (mapcar (function (lambda (v) - (nth 1 v))) + (mapcar (lambda (v) + (nth 1 v)) defv) ",") (mapconcat 'symbol-name - (mapcar (function (lambda (v) - (nth 1 v))) + (mapcar (lambda (v) + (nth 1 v)) defc) ","))))) (coefs nil)) @@ -1336,7 +1336,7 @@ (or (> (length (nth 1 data)) 2) (math-reject-arg data "*Too few data points")) (if (and (math-vectorp x) (or (math-constp x) math-expand-formulas)) - (cons 'vec (mapcar (function (lambda (x) (calcFunc-polint data x))) + (cons 'vec (mapcar (lambda (x) (calcFunc-polint data x)) (cdr x))) (or (math-objectp x) math-expand-formulas (math-reject-arg x 'objectp)) (math-with-extra-prec 2 @@ -1352,7 +1352,7 @@ (or (> (length (nth 1 data)) 2) (math-reject-arg data "*Too few data points")) (if (and (math-vectorp x) (or (math-constp x) math-expand-formulas)) - (cons 'vec (mapcar (function (lambda (x) (calcFunc-ratint data x))) + (cons 'vec (mapcar (lambda (x) (calcFunc-ratint data x)) (cdr x))) (or (math-objectp x) math-expand-formulas (math-reject-arg x 'objectp)) (math-with-extra-prec 2 @@ -1910,8 +1910,8 @@ (while p (setq vars (delq (assoc (car-safe p) vars) vars) p (cdr p))) - (sort (mapcar 'car vars) - (function (lambda (x y) (string< (nth 1 x) (nth 1 y))))))) + (sort (mapcar #'car vars) + (lambda (x y) (string< (nth 1 x) (nth 1 y)))))) ;; The variables math-all-vars-vars (the vars for math-all-vars) and ;; math-all-vars-found are local to math-all-vars-in, but are used by commit 238261db95ae3e99907594e839fd30ec5476762b Author: Stefan Kangas Date: Mon Nov 16 14:43:55 2020 +0100 Don't quote lambdas in eshell/*.el * lisp/eshell/em-basic.el (eshell-echo): * lisp/eshell/em-cmpl.el (eshell-command-completion-function) (eshell-default-completion-function, eshell-cmpl-initialize) (eshell-complete-parse-arguments, eshell-complete-commands-list): * lisp/eshell/em-dirs.el (eshell-complete-user-reference): * lisp/eshell/em-hist.el (eshell-hist-unload-hook) (eshell-hist-initialize): * lisp/eshell/em-ls.el (eshell-ls-sort-entries): * lisp/eshell/em-pred.el (eshell-modifier-alist) (eshell-display-predicate-help, eshell-display-modifier-help) (eshell-pred-substitute, eshell-split-members): * lisp/eshell/em-prompt.el (eshell-prompt-function): * lisp/eshell/em-smart.el (eshell-smart-unload-hook) (eshell-smart-initialize, eshell-refresh-windows): * lisp/eshell/em-unix.el (eshell-shuffle-files): * lisp/eshell/esh-arg.el (eshell-parse-argument-hook): * lisp/eshell/esh-cmd.el (eshell-cmd-initialize) (eshell-parse-command): * lisp/eshell/esh-mode.el (eshell-preinput-scroll-to-bottom) (eshell-postoutput-scroll-to-bottom): * lisp/eshell/esh-module.el (eshell-modules-list): * lisp/eshell/esh-proc.el (eshell-read-process-name) (eshell-round-robin-kill): * lisp/eshell/esh-var.el (eshell-envvar-names) (eshell-variables-list): Don't quote lambdas. diff --git a/lisp/eshell/em-basic.el b/lisp/eshell/em-basic.el index 6cfc89cce6..e54eab50fc 100644 --- a/lisp/eshell/em-basic.el +++ b/lisp/eshell/em-basic.el @@ -90,11 +90,10 @@ or `eshell-printn' for display." (car args)) (t (mapcar - (function - (lambda (arg) - (if (stringp arg) - (set-text-properties 0 (length arg) nil arg)) - arg)) + (lambda (arg) + (if (stringp arg) + (set-text-properties 0 (length arg) nil arg)) + arg) args))))) (if output-newline (cond diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el index 8a444c9100..53a0cda354 100644 --- a/lisp/eshell/em-cmpl.el +++ b/lisp/eshell/em-cmpl.el @@ -210,9 +210,8 @@ to writing a completion function." :group 'eshell-cmpl) (defcustom eshell-command-completion-function - (function - (lambda () - (pcomplete-here (eshell-complete-commands-list)))) + (lambda () + (pcomplete-here (eshell-complete-commands-list))) (eshell-cmpl--custom-variable-docstring 'pcomplete-command-completion-function) :type (get 'pcomplete-command-completion-function 'custom-type) :group 'eshell-cmpl) @@ -224,12 +223,11 @@ to writing a completion function." :group 'eshell-cmpl) (defcustom eshell-default-completion-function - (function - (lambda () - (while (pcomplete-here - (pcomplete-dirs-or-entries - (cdr (assoc (funcall eshell-cmpl-command-name-function) - eshell-command-completions-alist))))))) + (lambda () + (while (pcomplete-here + (pcomplete-dirs-or-entries + (cdr (assoc (funcall eshell-cmpl-command-name-function) + eshell-command-completions-alist)))))) (eshell-cmpl--custom-variable-docstring 'pcomplete-default-completion-function) :type (get 'pcomplete-default-completion-function 'custom-type) :group 'eshell-cmpl) @@ -308,10 +306,9 @@ to writing a completion function." ;; load-hooks for any other extension modules have been run, which ;; is true at the time `eshell-mode-hook' is run (add-hook 'eshell-mode-hook - (function - (lambda () - (set (make-local-variable 'comint-file-name-quote-list) - eshell-special-chars-outside-quoting))) + (lambda () + (set (make-local-variable 'comint-file-name-quote-list) + eshell-special-chars-outside-quoting)) nil t) (add-hook 'pcomplete-quote-arg-hook #'eshell-quote-backslash nil t) (add-hook 'completion-at-point-functions @@ -391,19 +388,18 @@ to writing a completion function." (nconc args (list "")) (nconc posns (list (point)))) (cons (mapcar - (function - (lambda (arg) - (let ((val - (if (listp arg) - (let ((result - (eshell-do-eval - (list 'eshell-commands arg) t))) - (cl-assert (eq (car result) 'quote)) - (cadr result)) - arg))) - (if (numberp val) - (setq val (number-to-string val))) - (or val "")))) + (lambda (arg) + (let ((val + (if (listp arg) + (let ((result + (eshell-do-eval + (list 'eshell-commands arg) t))) + (cl-assert (eq (car result) 'quote)) + (cadr result)) + arg))) + (if (numberp val) + (setq val (number-to-string val))) + (or val ""))) args) posns))) @@ -454,9 +450,8 @@ to writing a completion function." (eshell-alias-completions filename)) (eshell-winnow-list (mapcar - (function - (lambda (name) - (substring name 7))) + (lambda (name) + (substring name 7)) (all-completions (concat "eshell/" filename) obarray #'functionp)) nil '(eshell-find-alias-function)) diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el index 51df6fa1d5..b4ed3794ad 100644 --- a/lisp/eshell/em-dirs.el +++ b/lisp/eshell/em-dirs.el @@ -289,9 +289,8 @@ Thus, this does not include the current directory.") (eshell-read-user-names) (pcomplete-uniquify-list (mapcar - (function - (lambda (user) - (file-name-as-directory (cdr user)))) + (lambda (user) + (file-name-as-directory (cdr user))) eshell-user-names))))))) (defun eshell/pwd (&rest _args) diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index bdc21c916c..c27e450376 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el @@ -79,9 +79,8 @@ (defcustom eshell-hist-unload-hook (list - (function - (lambda () - (remove-hook 'kill-emacs-hook 'eshell-save-some-history)))) + (lambda () + (remove-hook 'kill-emacs-hook 'eshell-save-some-history))) "A hook that gets run when `eshell-hist' is unloaded." :type 'hook) @@ -250,16 +249,14 @@ Returns nil if INPUT is prepended by blank space, otherwise non-nil." (set (make-local-variable 'search-invisible) t) (set (make-local-variable 'search-exit-option) t) (add-hook 'isearch-mode-hook - (function - (lambda () - (if (>= (point) eshell-last-output-end) - (setq overriding-terminal-local-map - eshell-isearch-map)))) + (lambda () + (if (>= (point) eshell-last-output-end) + (setq overriding-terminal-local-map + eshell-isearch-map))) nil t) (add-hook 'isearch-mode-end-hook - (function - (lambda () - (setq overriding-terminal-local-map nil))) + (lambda () + (setq overriding-terminal-local-map nil)) nil t)) (eshell-hist-mode)) diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el index c1a022ee52..e10be8e623 100644 --- a/lisp/eshell/em-ls.el +++ b/lisp/eshell/em-ls.el @@ -631,38 +631,37 @@ In Eshell's implementation of ls, ENTRIES is always reversed." (if (eq sort-method 'unsorted) (nreverse entries) (sort entries - (function - (lambda (l r) - (let ((result - (cond - ((eq sort-method 'by-atime) - (eshell-ls-compare-entries l r 4 'time-less-p)) - ((eq sort-method 'by-mtime) - (eshell-ls-compare-entries l r 5 'time-less-p)) - ((eq sort-method 'by-ctime) - (eshell-ls-compare-entries l r 6 'time-less-p)) - ((eq sort-method 'by-size) - (eshell-ls-compare-entries l r 7 '<)) - ((eq sort-method 'by-extension) - (let ((lx (file-name-extension - (directory-file-name (car l)))) - (rx (file-name-extension - (directory-file-name (car r))))) - (cond - ((or (and (not lx) (not rx)) - (equal lx rx)) - (string-lessp (directory-file-name (car l)) - (directory-file-name (car r)))) - ((not lx) t) - ((not rx) nil) - (t - (string-lessp lx rx))))) - (t - (string-lessp (directory-file-name (car l)) - (directory-file-name (car r))))))) - (if reverse-list - (not result) - result))))))) + (lambda (l r) + (let ((result + (cond + ((eq sort-method 'by-atime) + (eshell-ls-compare-entries l r 4 'time-less-p)) + ((eq sort-method 'by-mtime) + (eshell-ls-compare-entries l r 5 'time-less-p)) + ((eq sort-method 'by-ctime) + (eshell-ls-compare-entries l r 6 'time-less-p)) + ((eq sort-method 'by-size) + (eshell-ls-compare-entries l r 7 '<)) + ((eq sort-method 'by-extension) + (let ((lx (file-name-extension + (directory-file-name (car l)))) + (rx (file-name-extension + (directory-file-name (car r))))) + (cond + ((or (and (not lx) (not rx)) + (equal lx rx)) + (string-lessp (directory-file-name (car l)) + (directory-file-name (car r)))) + ((not lx) t) + ((not rx) nil) + (t + (string-lessp lx rx))))) + (t + (string-lessp (directory-file-name (car l)) + (directory-file-name (car r))))))) + (if reverse-list + (not result) + result)))))) (defun eshell-ls-files (files &optional size-width copy-fileinfo) "Output a list of FILES. @@ -799,9 +798,8 @@ to use, and each member of which is the width of that column (width 0) (widths (mapcar - (function - (lambda (file) - (+ 2 (length (car file))))) + (lambda (file) + (+ 2 (length (car file)))) files)) ;; must account for the added space... (max-width (+ (window-width) 2)) @@ -846,9 +844,8 @@ to use, and each member of which is the width of that column (width 0) (widths (mapcar - (function - (lambda (file) - (+ 2 (length (car file))))) + (lambda (file) + (+ 2 (length (car file)))) files)) (max-width (+ (window-width) 2)) col-widths diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el index 59139da10d..7b9503917c 100644 --- a/lisp/eshell/em-pred.el +++ b/lisp/eshell/em-pred.el @@ -116,10 +116,9 @@ The format of each entry is (defcustom eshell-modifier-alist '((?E . #'(lambda (lst) (mapcar - (function - (lambda (str) - (eshell-stringify - (car (eshell-parse-argument str))))) + (lambda (str) + (eshell-stringify + (car (eshell-parse-argument str)))) lst))) (?L . #'(lambda (lst) (mapcar 'downcase lst))) (?U . #'(lambda (lst) (mapcar 'upcase lst))) @@ -240,16 +239,14 @@ EXAMPLES: (defun eshell-display-predicate-help () (interactive) (with-electric-help - (function - (lambda () - (insert eshell-predicate-help-string))))) + (lambda () + (insert eshell-predicate-help-string)))) (defun eshell-display-modifier-help () (interactive) (with-electric-help - (function - (lambda () - (insert eshell-modifier-help-string))))) + (lambda () + (insert eshell-modifier-help-string)))) (define-minor-mode eshell-pred-mode "Minor mode for the eshell-pred module. @@ -544,20 +541,20 @@ that `ls -l' will show in the first column of its display." (if repeat `(lambda (lst) (mapcar - (function - (lambda (str) - (let ((i 0)) - (while (setq i (string-match ,match str i)) - (setq str (replace-match ,replace t nil str)))) - str)) lst)) + (lambda (str) + (let ((i 0)) + (while (setq i (string-match ,match str i)) + (setq str (replace-match ,replace t nil str)))) + str) + lst)) `(lambda (lst) (mapcar - (function - (lambda (str) - (if (string-match ,match str) - (setq str (replace-match ,replace t nil str)) - (error (concat str ": substitution failed"))) - str)) lst))))) + (lambda (str) + (if (string-match ,match str) + (setq str (replace-match ,replace t nil str)) + (error (concat str ": substitution failed"))) + str) + lst))))) (defun eshell-include-members (&optional invert-p) "Include only lisp members matching a regexp." @@ -598,9 +595,8 @@ that `ls -l' will show in the first column of its display." (goto-char (1+ end))) `(lambda (lst) (mapcar - (function - (lambda (str) - (split-string str ,sep))) lst)))) + (lambda (str) + (split-string str ,sep)) lst)))) (provide 'em-pred) diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el index 9ae5ae1281..dcee1e7a98 100644 --- a/lisp/eshell/em-prompt.el +++ b/lisp/eshell/em-prompt.el @@ -48,10 +48,9 @@ as is common with most shells." (autoload 'eshell/pwd "em-dirs") (defcustom eshell-prompt-function - (function - (lambda () - (concat (abbreviate-file-name (eshell/pwd)) - (if (= (user-uid) 0) " # " " $ ")))) + (lambda () + (concat (abbreviate-file-name (eshell/pwd)) + (if (= (user-uid) 0) " # " " $ "))) "A function that returns the Eshell prompt string. Make sure to update `eshell-prompt-regexp' so that it will match your prompt." diff --git a/lisp/eshell/em-smart.el b/lisp/eshell/em-smart.el index f173c8db9c..a28bb1d641 100644 --- a/lisp/eshell/em-smart.el +++ b/lisp/eshell/em-smart.el @@ -94,10 +94,9 @@ it to get a real sense of how it works." (defcustom eshell-smart-unload-hook (list - (function - (lambda () - (remove-hook 'window-configuration-change-hook - 'eshell-refresh-windows)))) + (lambda () + (remove-hook 'window-configuration-change-hook + 'eshell-refresh-windows))) "A hook that gets run when `eshell-smart' is unloaded." :type 'hook :group 'eshell-smart) @@ -186,9 +185,8 @@ The options are `begin', `after' or `end'." (make-local-variable 'eshell-smart-command-done) (add-hook 'eshell-post-command-hook - (function - (lambda () - (setq eshell-smart-command-done t))) + (lambda () + (setq eshell-smart-command-done t)) t t) (unless (eq eshell-review-quick-commands t) @@ -208,13 +206,12 @@ The options are `begin', `after' or `end'." "Refresh all visible Eshell buffers." (let (affected) (walk-windows - (function - (lambda (wind) - (with-current-buffer (window-buffer wind) - (if eshell-mode - (let (window-scroll-functions) ;;FIXME: Why? - (eshell-smart-scroll-window wind (window-start)) - (setq affected t)))))) + (lambda (wind) + (with-current-buffer (window-buffer wind) + (if eshell-mode + (let (window-scroll-functions) ;;FIXME: Why? + (eshell-smart-scroll-window wind (window-start)) + (setq affected t))))) 0 frame) (if affected (let (window-scroll-functions) ;;FIXME: Why? diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 937b8bfa39..18818648bc 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -419,9 +419,8 @@ Remove the DIRECTORY(ies), if they are empty.") (apply 'eshell-shuffle-files command action (mapcar - (function - (lambda (file) - (concat source "/" file))) + (lambda (file) + (concat source "/" file)) (directory-files source)) target func t args) (when (eq func 'rename-file) diff --git a/lisp/eshell/esh-arg.el b/lisp/eshell/esh-arg.el index e7b07b4208..aefda64768 100644 --- a/lisp/eshell/esh-arg.el +++ b/lisp/eshell/esh-arg.el @@ -85,51 +85,48 @@ If POS is nil, the location of point is checked." 'eshell-parse-special-reference ;; numbers convert to numbers if they stand alone - (function - (lambda () - (when (and (not eshell-current-argument) - (not eshell-current-quoted) - (looking-at eshell-number-regexp) - (eshell-arg-delimiter (match-end 0))) - (goto-char (match-end 0)) - (let ((str (match-string 0))) - (if (> (length str) 0) - (add-text-properties 0 (length str) '(number t) str)) - str)))) + (lambda () + (when (and (not eshell-current-argument) + (not eshell-current-quoted) + (looking-at eshell-number-regexp) + (eshell-arg-delimiter (match-end 0))) + (goto-char (match-end 0)) + (let ((str (match-string 0))) + (if (> (length str) 0) + (add-text-properties 0 (length str) '(number t) str)) + str))) ;; parse any non-special characters, based on the current context - (function - (lambda () - (unless eshell-inside-quote-regexp - (setq eshell-inside-quote-regexp - (format "[^%s]+" - (apply 'string eshell-special-chars-inside-quoting)))) - (unless eshell-outside-quote-regexp - (setq eshell-outside-quote-regexp - (format "[^%s]+" - (apply 'string eshell-special-chars-outside-quoting)))) - (when (looking-at (if eshell-current-quoted - eshell-inside-quote-regexp - eshell-outside-quote-regexp)) - (goto-char (match-end 0)) - (let ((str (match-string 0))) - (if str - (set-text-properties 0 (length str) nil str)) - str)))) + (lambda () + (unless eshell-inside-quote-regexp + (setq eshell-inside-quote-regexp + (format "[^%s]+" + (apply 'string eshell-special-chars-inside-quoting)))) + (unless eshell-outside-quote-regexp + (setq eshell-outside-quote-regexp + (format "[^%s]+" + (apply 'string eshell-special-chars-outside-quoting)))) + (when (looking-at (if eshell-current-quoted + eshell-inside-quote-regexp + eshell-outside-quote-regexp)) + (goto-char (match-end 0)) + (let ((str (match-string 0))) + (if str + (set-text-properties 0 (length str) nil str)) + str))) ;; whitespace or a comment is an argument delimiter - (function - (lambda () - (let (comment-p) - (when (or (looking-at "[ \t]+") - (and (not eshell-current-argument) - (looking-at "#\\([^<'].*\\|$\\)") - (setq comment-p t))) - (if comment-p - (add-text-properties (match-beginning 0) (match-end 0) - '(comment t))) - (goto-char (match-end 0)) - (eshell-finish-arg))))) + (lambda () + (let (comment-p) + (when (or (looking-at "[ \t]+") + (and (not eshell-current-argument) + (looking-at "#\\([^<'].*\\|$\\)") + (setq comment-p t))) + (if comment-p + (add-text-properties (match-beginning 0) (match-end 0) + '(comment t))) + (goto-char (match-end 0)) + (eshell-finish-arg)))) ;; parse backslash and the character after 'eshell-parse-backslash diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index e0348ba501..f1cf933689 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -304,10 +304,9 @@ otherwise t.") ;; situation can occur, for example, if a Lisp function results in ;; `debug' being called, and the user then types \\[top-level] (add-hook 'eshell-post-command-hook - (function - (lambda () - (setq eshell-current-command nil - eshell-last-async-proc nil))) + (lambda () + (setq eshell-current-command nil + eshell-last-async-proc nil)) nil t) (add-hook 'eshell-parse-argument-hook @@ -355,18 +354,17 @@ hooks should be run before and after the command." args)) (commands (mapcar - (function - (lambda (cmd) - (setq cmd - (if (or (not (car eshell--sep-terms)) - (string= (car eshell--sep-terms) ";")) - (eshell-parse-pipeline cmd) - `(eshell-do-subjob - (list ,(eshell-parse-pipeline cmd))))) - (setq eshell--sep-terms (cdr eshell--sep-terms)) - (if eshell-in-pipeline-p - cmd - `(eshell-trap-errors ,cmd)))) + (lambda (cmd) + (setq cmd + (if (or (not (car eshell--sep-terms)) + (string= (car eshell--sep-terms) ";")) + (eshell-parse-pipeline cmd) + `(eshell-do-subjob + (list ,(eshell-parse-pipeline cmd))))) + (setq eshell--sep-terms (cdr eshell--sep-terms)) + (if eshell-in-pipeline-p + cmd + `(eshell-trap-errors ,cmd))) (eshell-separate-commands terms "[&;]" nil 'eshell--sep-terms)))) (let ((cmd commands)) (while cmd diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index e0e86348bd..a80c2fc60d 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -742,13 +742,12 @@ This function should be a pre-command hook." (if (eq scroll 'this) (goto-char (point-max)) (walk-windows - (function - (lambda (window) - (when (and (eq (window-buffer window) current) - (or (eq scroll t) (eq scroll 'all))) - (select-window window) - (goto-char (point-max)) - (select-window selected)))) + (lambda (window) + (when (and (eq (window-buffer window) current) + (or (eq scroll t) (eq scroll 'all))) + (select-window window) + (goto-char (point-max)) + (select-window selected))) nil t)))))) ;;; jww (1999-10-23): this needs testing @@ -764,29 +763,28 @@ This function should be in the list `eshell-output-filter-functions'." (scroll eshell-scroll-to-bottom-on-output)) (unwind-protect (walk-windows - (function - (lambda (window) - (if (eq (window-buffer window) current) - (progn - (select-window window) - (if (and (< (point) eshell-last-output-end) - (or (eq scroll t) (eq scroll 'all) - ;; Maybe user wants point to jump to end. - (and (eq scroll 'this) - (eq selected window)) - (and (eq scroll 'others) - (not (eq selected window))) - ;; If point was at the end, keep it at end. - (>= (point) eshell-last-output-start))) - (goto-char eshell-last-output-end)) - ;; Optionally scroll so that the text - ;; ends at the bottom of the window. - (if (and eshell-scroll-show-maximum-output - (>= (point) eshell-last-output-end)) - (save-excursion - (goto-char (point-max)) - (recenter -1))) - (select-window selected))))) + (lambda (window) + (if (eq (window-buffer window) current) + (progn + (select-window window) + (if (and (< (point) eshell-last-output-end) + (or (eq scroll t) (eq scroll 'all) + ;; Maybe user wants point to jump to end. + (and (eq scroll 'this) + (eq selected window)) + (and (eq scroll 'others) + (not (eq selected window))) + ;; If point was at the end, keep it at end. + (>= (point) eshell-last-output-start))) + (goto-char eshell-last-output-end)) + ;; Optionally scroll so that the text + ;; ends at the bottom of the window. + (if (and eshell-scroll-show-maximum-output + (>= (point) eshell-last-output-end)) + (save-excursion + (goto-char (point-max)) + (recenter -1))) + (select-window selected)))) nil t) (set-buffer current)))) diff --git a/lisp/eshell/esh-module.el b/lisp/eshell/esh-module.el index 45c4c9e13c..10994ba301 100644 --- a/lisp/eshell/esh-module.el +++ b/lisp/eshell/esh-module.el @@ -65,16 +65,15 @@ Changes will only take effect in future Eshell buffers." :type (append (list 'set ':tag "Supported modules") (mapcar - (function - (lambda (modname) - (let ((modsym (intern modname))) - (list 'const - ':tag (format "%s -- %s" modname - (get modsym 'custom-tag)) - ':link (caar (get modsym 'custom-links)) - ':doc (concat "\n" (get modsym 'group-documentation) - "\n ") - modsym)))) + (lambda (modname) + (let ((modsym (intern modname))) + (list 'const + ':tag (format "%s -- %s" modname + (get modsym 'custom-tag)) + ':link (caar (get modsym 'custom-links)) + ':doc (concat "\n" (get modsym 'group-documentation) + "\n ") + modsym))) (sort (mapcar 'symbol-name (eshell-subgroups 'eshell-module)) 'string-lessp)) diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el index db1b258c8f..4a1001bf05 100644 --- a/lisp/eshell/esh-proc.el +++ b/lisp/eshell/esh-proc.el @@ -215,9 +215,8 @@ and signal names." The prompt will be set to PROMPT." (completing-read prompt (mapcar - (function - (lambda (proc) - (cons (process-name proc) t))) + (lambda (proc) + (cons (process-name proc) t)) (process-list)) nil t)) @@ -499,9 +498,8 @@ See the variable `eshell-kill-processes-on-exit'." (let ((sigs eshell-kill-process-signals)) (while sigs (eshell-process-interact - (function - (lambda (proc) - (signal-process (process-id proc) (car sigs)))) t query) + (lambda (proc) + (signal-process (process-id proc) (car sigs))) t query) (setq query nil) (if (not eshell-process-list) (setq sigs nil) diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 7388279f15..f91fb89412 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -382,9 +382,8 @@ This function is explicit for adding to `eshell-parse-argument-hook'." (defun eshell-envvar-names (&optional environment) "Return a list of currently visible environment variable names." - (mapcar (function - (lambda (x) - (substring x 0 (string-match "=" x)))) + (mapcar (lambda (x) + (substring x 0 (string-match "=" x))) (or environment process-environment))) (defun eshell-environment-variables () @@ -618,14 +617,13 @@ For example, to retrieve the second element of a user's record in (sort (append (mapcar - (function - (lambda (varname) - (let ((value (eshell-get-variable varname))) - (if (and value - (stringp value) - (file-directory-p value)) - (concat varname "/") - varname)))) + (lambda (varname) + (let ((value (eshell-get-variable varname))) + (if (and value + (stringp value) + (file-directory-p value)) + (concat varname "/") + varname))) (eshell-envvar-names (eshell-environment-variables))) (all-completions argname obarray 'boundp) completions) commit 75723ec212ca0ac0b5f019622960caf083e95105 Author: Philipp Stephani Date: Mon Nov 16 12:48:54 2020 +0100 ; * lisp/emacs-lisp/benchmark.el (benchmark-run): Fix docstring diff --git a/lisp/emacs-lisp/benchmark.el b/lisp/emacs-lisp/benchmark.el index a7fcc5cb8f..ee0774db23 100644 --- a/lisp/emacs-lisp/benchmark.el +++ b/lisp/emacs-lisp/benchmark.el @@ -43,7 +43,7 @@ ;;;###autoload (defmacro benchmark-run (&optional repetitions &rest forms) "Time execution of FORMS. -If REPETITIONS is supplied as a number, run forms that many times, +If REPETITIONS is supplied as a number, run FORMS that many times, accounting for the overhead of the resulting loop. Otherwise run FORMS once. Return a list of the total elapsed time for execution, the number of commit 53e2a612ad7441ac24d27872d404f6f0f15a3962 Author: Glenn Morris Date: Sun Nov 15 15:08:58 2020 -0800 ; * lib-src/make-fingerprint.c: Update commentary. diff --git a/lib-src/make-fingerprint.c b/lib-src/make-fingerprint.c index c013d0aca3..b72ee90bbc 100644 --- a/lib-src/make-fingerprint.c +++ b/lib-src/make-fingerprint.c @@ -19,9 +19,12 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ -/* The arguments given to this program are all the object files that - go into building GNU Emacs. There is no special search logic to find - the files. */ +/* The argument given to this program is the initial version of the + temacs executable file used when building GNU Emacs. This program computes + a digest fingerprint for the executable, and modifies the binary in + place, replacing all instances of the existing fingerprint (normally + the default fingerprint from libgnu's lib/fingerprint.c) with the + new value. With option -r, it just prints the digest. */ #include commit 81588748bd85827468e297d3e44a72844438e807 Author: Juri Linkov Date: Sun Nov 15 22:32:39 2020 +0200 New user options 'copy-region-blink-delay' and 'delete-pair-blink-delay' * lisp/emacs-lisp/lisp.el (delete-pair-blink-delay): New defcustom. (delete-pair): Use it. (Bug#4136) * lisp/simple.el (copy-region-blink-delay): New defcustom. (indicate-copied-region): Use it. (Bug#42865) Thanks to Sean Whitton . (indicate-copied-region): Use 'query-replace-descr' not to show newlines literally. Use "Copied text" instead of misleading "Saved text" (bug#42865). diff --git a/etc/NEWS b/etc/NEWS index 7aa5488250..90e4d292ba 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -203,6 +203,12 @@ This command would previously not redefine values defined by these forms, but this command has now been changed to work more like 'eval-defun', and reset the values as specified. +--- +** New user options 'copy-region-blink-delay' and 'delete-pair-blink-delay'. +'copy-region-blink-delay' specifies a delay to indicate the region +copied by 'kill-ring-save'. 'delete-pair-blink-delay' specifies +a delay to show a paired character to delete. + +++ ** New command 'undo-redo'. It undoes previous undo commands, but doesn't record itself as an diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 35590123ee..124900168c 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -784,9 +784,17 @@ This command assumes point is not in a string or comment." (interactive "P") (insert-pair arg ?\( ?\))) +(defcustom delete-pair-blink-delay blink-matching-delay + "Time in seconds to delay after showing a paired character to delete. +It's used by the command `delete-pair'. The value 0 disables blinking." + :type 'number + :group 'lisp + :version "28.1") + (defun delete-pair (&optional arg) "Delete a pair of characters enclosing ARG sexps that follow point. -A negative ARG deletes a pair around the preceding ARG sexps instead." +A negative ARG deletes a pair around the preceding ARG sexps instead. +The option `delete-pair-blink-delay' can disable blinking." (interactive "P") (if arg (setq arg (prefix-numeric-value arg)) @@ -802,6 +810,9 @@ A negative ARG deletes a pair around the preceding ARG sexps instead." (if (= (length p) 3) (cdr p) p)) insert-pair-alist)) (error "Not after matching pair")) + (when (and (numberp delete-pair-blink-delay) + (> delete-pair-blink-delay 0)) + (sit-for delete-pair-blink-delay)) (delete-char 1))) (delete-char -1)) (save-excursion @@ -814,6 +825,9 @@ A negative ARG deletes a pair around the preceding ARG sexps instead." (if (= (length p) 3) (cdr p) p)) insert-pair-alist)) (error "Not before matching pair")) + (when (and (numberp delete-pair-blink-delay) + (> delete-pair-blink-delay 0)) + (sit-for delete-pair-blink-delay)) (delete-char -1))) (delete-char 1)))) diff --git a/lisp/simple.el b/lisp/simple.el index e96c7c9a6e..5158bc74a9 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5087,11 +5087,20 @@ visual feedback indicating the extent of the region being copied." (if (called-interactively-p 'interactive) (indicate-copied-region))) +(defcustom copy-region-blink-delay 1 + "Time in seconds to delay after showing the other end of the region. +It's used by the command `kill-ring-save' and the function +`indicate-copied-region' to blink the cursor between point and mark. +The value 0 disables blinking." + :type 'number + :group 'killing + :version "28.1") + (defun indicate-copied-region (&optional message-len) "Indicate that the region text has been copied interactively. -If the mark is visible in the selected window, blink the cursor -between point and mark if there is currently no active region -highlighting. +If the mark is visible in the selected window, blink the cursor between +point and mark if there is currently no active region highlighting. +The option `copy-region-blink-delay' can disable blinking. If the mark lies outside the selected window, display an informative message containing a sample of the copied text. The @@ -5105,12 +5114,14 @@ of this sample text; it defaults to 40." (if (pos-visible-in-window-p mark (selected-window)) ;; Swap point-and-mark quickly so as to show the region that ;; was selected. Don't do it if the region is highlighted. - (unless (and (region-active-p) - (face-background 'region nil t)) + (when (and (numberp copy-region-blink-delay) + (> copy-region-blink-delay 0) + (or (not (region-active-p)) + (not (face-background 'region nil t)))) ;; Swap point and mark. (set-marker (mark-marker) (point) (current-buffer)) (goto-char mark) - (sit-for blink-matching-delay) + (sit-for copy-region-blink-delay) ;; Swap back. (set-marker (mark-marker) mark (current-buffer)) (goto-char point) @@ -5121,11 +5132,14 @@ of this sample text; it defaults to 40." (let ((len (min (abs (- mark point)) (or message-len 40)))) (if (< point mark) - ;; Don't say "killed"; that is misleading. - (message "Saved text until \"%s\"" - (buffer-substring-no-properties (- mark len) mark)) - (message "Saved text from \"%s\"" - (buffer-substring-no-properties mark (+ mark len)))))))) + ;; Don't say "killed" or "saved"; that is misleading. + (message "Copied text until \"%s\"" + ;; Don't show newlines literally + (query-replace-descr + (buffer-substring-no-properties (- mark len) mark))) + (message "Copied text from \"%s\"" + (query-replace-descr + (buffer-substring-no-properties mark (+ mark len))))))))) (defun append-next-kill (&optional interactive) "Cause following command, if it kills, to add to previous kill. commit 286c63277287a52148d8b9a8b57979d1d04d2ed0 Author: Eli Zaretskii Date: Sun Nov 15 19:26:38 2020 +0200 Reformat argument commentary in etags.c * lib-src/etags.c (pfnote, consider_token, C_entries): Resurrect original format of comments to function arguments. diff --git a/lib-src/etags.c b/lib-src/etags.c index 8babe926db..f761a7b7c3 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -1973,14 +1973,13 @@ make_tag (const char *name, /* tag name, or NULL if unnamed */ /* Record a tag. */ static void -pfnote (char *name, bool is_func, char *linestart, ptrdiff_t linelen, - intmax_t lno, intmax_t cno) - /* tag name, or NULL if unnamed */ - /* tag is a function */ - /* start of the line where tag is */ - /* length of the line where tag is */ - /* line number */ - /* character number */ +pfnote (char *name, /* tag name, or NULL if unnamed */ + bool is_func, /* tag is a function */ + char *linestart, /* start of the line where tag is */ + ptrdiff_t linelen, /* length of the line where tag is */ + intmax_t lno, /* line number */ + intmax_t cno) /* character number */ + { register node *np; @@ -2904,15 +2903,13 @@ static void make_C_tag (bool); */ static bool -consider_token (char *str, ptrdiff_t len, int c, int *c_extp, - ptrdiff_t bracelev, ptrdiff_t parlev, bool *is_func_or_var) - /* IN: token pointer */ - /* IN: token length */ - /* IN: first char after the token */ - /* IN, OUT: C extensions mask */ - /* IN: brace level */ - /* IN: parenthesis level */ - /* OUT: function or variable found */ +consider_token (char *str, /* IN: token pointer */ + ptrdiff_t len, /* IN: token length */ + int c, /* IN: first char after the token */ + int *c_extp, /* IN, OUT: C extensions mask */ + ptrdiff_t bracelev, /* IN: brace level */ + ptrdiff_t parlev, /* IN: parenthesis level */ + bool *is_func_or_var) /* OUT: function or variable found */ { /* When structdef is stagseen, scolonseen, or snone with bracelev > 0, structtype is the type of the preceding struct-like keyword, and @@ -3311,9 +3308,8 @@ perhaps_more_input (FILE *inf) * C syntax and adds them to the list. */ static void -C_entries (int c_ext, FILE *inf) - /* extension of C */ - /* input file */ +C_entries (int c_ext, /* extension of C */ + FILE *inf) /* input file */ { char c; /* latest char read; '\0' for end of line */ char *lp; /* pointer one beyond the character `c' */ commit 4ddc38fc59845f7fa088121f435f62d1c0295c69 Author: Mattias Engdegård Date: Sun Nov 15 17:54:41 2020 +0100 Reformat comment for 'gnu' compilation rule * lisp/progmodes/compile.el (compilation-error-regexp-alist-alist): The comments above the regexp for the 'gnu' rule contained references to the previous string regexp, which has been difficult to follow ever since the translation to rx. Move the comments to their proper places, and add some guiding notes. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index e0dabed6a7..de9c9a209d 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -334,48 +334,44 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) ": \\*\\*\\* \\[\\(\\(.+?\\):\\([0-9]+\\): .+\\)\\]" 2 3 nil 0 1) (gnu - ;; The first line matches the program name for - - ;; PROGRAM:SOURCE-FILE-NAME:LINENO: MESSAGE - - ;; format, which is used for non-interactive programs other than - ;; compilers (e.g. the "jade:" entry in compilation.txt). - - ;; This first line makes things ambiguous with output such as - ;; "foo:344:50:blabla" since the "foo" part can match this first - ;; line (in which case the file name as "344"). To avoid this, - ;; the second line disallows filenames exclusively composed of - ;; digits. - - ;; Similarly, we get lots of false positives with messages including - ;; times of the form "HH:MM:SS" where MM is taken as a line number, so - ;; the last line tries to rule out message where the info after the - ;; line number starts with "SS". --Stef - - ;; The core of the regexp is the one with *?. It says that a file name - ;; can be composed of any non-newline char, but it also rules out some - ;; valid but unlikely cases, such as a trailing space or a space - ;; followed by a -, or a colon followed by a space. - ;; - ;; The "in \\|from " exception was added to handle messages from Ruby. ,(rx bol + ;; Match an optional program name in the format + ;; PROGRAM:SOURCE-FILE-NAME:LINENO: MESSAGE + ;; which is used for non-interactive programs other than + ;; compilers (e.g. the "jade:" entry in compilation.txt). (? (| (regexp "[[:alpha:]][-[:alnum:].]+: ?") + ;; FIXME: This pattern was added for handling messages + ;; from Ruby, but it is unclear whether it is actually + ;; used since the gcc-include rule above seems to cover + ;; it. (regexp "[ \t]+\\(?:in \\|from\\)"))) - (group-n 1 (: (regexp "[0-9]*[^0-9\n]") - (*? (| (regexp "[^\n :]") - (regexp " [^-/\n]") - (regexp ":[^ \n]"))))) + + ;; File name group. + (group-n 1 + ;; Avoid matching the file name as a program in the pattern + ;; above by disallow file names entirely composed of digits. + (: (regexp "[0-9]*[^0-9\n]") + ;; This rule says that a file name can be composed + ;; of any non-newline char, but it also rules out + ;; some valid but unlikely cases, such as a + ;; trailing space or a space followed by a -, or a + ;; colon followed by a space. + (*? (| (regexp "[^\n :]") + (regexp " [^-/\n]") + (regexp ":[^ \n]"))))) (regexp ": ?") + + ;; Line number group. (group-n 2 (regexp "[0-9]+")) (? (| (: "-" - (group-n 4 (regexp "[0-9]+")) - (? "." (group-n 5 (regexp "[0-9]+")))) + (group-n 4 (regexp "[0-9]+")) ; ending line + (? "." (group-n 5 (regexp "[0-9]+")))) ; ending column (: (in ".:") - (group-n 3 (regexp "[0-9]+")) + (group-n 3 (regexp "[0-9]+")) ; starting column (? "-" - (? (group-n 4 (regexp "[0-9]+")) ".") - (group-n 5 (regexp "[0-9]+")))))) + (? (group-n 4 (regexp "[0-9]+")) ".") ; ending line + (group-n 5 (regexp "[0-9]+")))))) ; ending column ":" (| (: (* " ") (group-n 6 (| "FutureWarning" @@ -392,6 +388,11 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) (regexp "[Nn]ote")))) (: (* " ") (regexp "[Ee]rror")) + + ;; Avoid matching time stamps on the form "HH:MM:SS" where + ;; MM is interpreted as a line number by trying to rule out + ;; messages where the text after the line number starts with + ;; a 2-digit number. (: (regexp "[0-9]?") (| (regexp "[^0-9\n]") eol)) commit 4ec740866a65761fa1318400f299b2d591b05acf Author: Alan Mackenzie Date: Sun Nov 15 13:23:15 2020 +0000 Make the invocation of combine-change-calls in comment-region valid This fixes bug #44581. The problem was that whitespace outside of the (BEG END) region was being deleted, and this made the invocation of combine-change-calls with (BEG END) invalid. * lisp/newcomment.el (comment-region-default): Amend the second argument to combine-change-calls. diff --git a/lisp/newcomment.el b/lisp/newcomment.el index e111ae8e22..3eb158dc2c 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -1292,7 +1292,15 @@ changed with `comment-style'." (defun comment-region-default (beg end &optional arg) (if comment-combine-change-calls - (combine-change-calls beg end (comment-region-default-1 beg end arg)) + (combine-change-calls beg + ;; A new line might get inserted and whitespace deleted + ;; after END for line comments. Ensure the next argument is + ;; after any and all changes. + (save-excursion + (goto-char end) + (forward-line) + (point)) + (comment-region-default-1 beg end arg)) (comment-region-default-1 beg end arg))) ;;;###autoload commit 66bcec8838ab05b5690d7f530851ecf594c5d877 Author: Alan Mackenzie Date: Sun Nov 15 10:34:54 2020 +0000 * lisp/progmodes/cc-langs.el (c-<>-notable-chars-re): Fix wrong '-' in regexp diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 0a7f4565c0..56c3a4889b 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -3643,7 +3643,7 @@ When \"(\" is present, that defun will attempt to parse a parenthesized expression inside the template. When \")\" is present it will treat an unbalanced closing paren as a sign of the invalidity of the putative template construct." - t "[<;{},|+&->)]" + t "[<;{},|+&>)-]" c++ "[<;{},>()]") (c-lang-defvar c-<>-notable-chars-re (c-lang-const c-<>-notable-chars-re)) commit 36431e16799872e84161d46e66057b05289a1335 Author: Stefan Kangas Date: Sun Nov 15 02:41:36 2020 +0100 Make initial frame match frame-title-format * src/xterm.c (x_term_init): * src/w32term.c (w32_initialize_display_info): Sync initial frame title with new value of Vframe_title_format. Problem reported by Angelo Graziosi . diff --git a/src/w32term.c b/src/w32term.c index e0618e4f52..23cb380040 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -7165,15 +7165,21 @@ w32_initialize_display_info (Lisp_Object display_name) memset (dpyinfo, 0, sizeof (*dpyinfo)); dpyinfo->name_list_element = Fcons (display_name, Qnil); + static char const title[] = "GNU Emacs"; if (STRINGP (Vsystem_name)) { - dpyinfo->w32_id_name = xmalloc (SCHARS (Vinvocation_name) - + SCHARS (Vsystem_name) + 2); - sprintf (dpyinfo->w32_id_name, "%s@%s", - SDATA (Vinvocation_name), SDATA (Vsystem_name)); + static char const at[] = " at "; + ptrdiff_t nbytes = sizeof (title) + sizeof (at); + if (INT_ADD_WRAPV (nbytes, SCHARS (Vsystem_name), &nbytes)) + memory_full (SIZE_MAX); + dpyinfo->w32_id_name = xmalloc (nbytes); + sprintf (dpyinfo->w32_id_name, "%s%s%s", title, at, SDATA (Vsystem_name)); } else - dpyinfo->w32_id_name = xlispstrdup (Vinvocation_name); + { + dpyinfo->w32_id_name = xmalloc (sizeof (title)); + strcpy (dpyinfo->w32_id_name, title); + } /* Default Console mode values - overridden when running in GUI mode with values obtained from system metrics. */ diff --git a/src/xterm.c b/src/xterm.c index 98bb0ea891..0d2452de92 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -12928,19 +12928,23 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) #endif Lisp_Object system_name = Fsystem_name (); - - ptrdiff_t nbytes = SBYTES (Vinvocation_name) + 1; - if (STRINGP (system_name) - && INT_ADD_WRAPV (nbytes, SBYTES (system_name) + 1, &nbytes)) - memory_full (SIZE_MAX); - dpyinfo->x_id = ++x_display_id; - dpyinfo->x_id_name = xmalloc (nbytes); - char *nametail = lispstpcpy (dpyinfo->x_id_name, Vinvocation_name); + static char const title[] = "GNU Emacs"; if (STRINGP (system_name)) { - *nametail++ = '@'; - lispstpcpy (nametail, system_name); + static char const at[] = " at "; + ptrdiff_t nbytes = sizeof (title) + sizeof (at); + if (INT_ADD_WRAPV (nbytes, SBYTES (system_name), &nbytes)) + memory_full (SIZE_MAX); + dpyinfo->x_id_name = xmalloc (nbytes); + sprintf (dpyinfo->x_id_name, "%s%s%s", title, at, SDATA (system_name)); } + else + { + dpyinfo->x_id_name = xmalloc (sizeof (title)); + strcpy (dpyinfo->x_id_name, title); + } + + dpyinfo->x_id = ++x_display_id; /* Figure out which modifier bits mean what. */ x_find_modifier_meanings (dpyinfo); commit f08e6538dca6d9cd1457ba1129afe1e56ee286f4 Author: Stefan Kangas Date: Sun Nov 15 00:53:32 2020 +0100 Run menu-item :filter function before showing binding * lisp/help.el (describe-map): Fix running `menu-item' :filter functions. This fixes a mistake in the previous conversion of this defun from the old C function describe_map. See the discussion in Bug#39149. * test/src/keymap-tests.el (keymap---get-keyelt/runs-menu-item-filter) (describe-buffer-bindings/menu-item-filter-show-binding) (describe-buffer-bindings/menu-item-filter-hide-binding): New tests. (keymap-tests--test-menu-item-filter): New defun. diff --git a/lisp/help.el b/lisp/help.el index 32ee84b5f9..ac5c2f1311 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1310,6 +1310,7 @@ TRANSL, PARTIAL, SHADOW, NOMENU, MENTION-SHADOW are as in ((and mention-shadow (not (eq tem definition))) (setq this-shadowed t)) (t nil)))) + (eq definition (lookup-key tail (vector event) t)) (push (list event definition this-shadowed) vect)))) ((eq (car tail) 'keymap) ;; The same keymap might be in the structure twice, if diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el index e3dd8420d7..610234c5a1 100644 --- a/test/src/keymap-tests.el +++ b/test/src/keymap-tests.el @@ -54,6 +54,16 @@ (ert-deftest keymap-copy-keymap/is-not-eq () (should-not (eq (copy-keymap help-mode-map) help-mode-map))) +(ert-deftest keymap---get-keyelt/runs-menu-item-filter () + (let* (menu-item-filter-ran + (object `(menu-item "2" identity + :filter ,(lambda (cmd) + (message "foo") + (setq menu-item-filter-ran t) + cmd)))) + (keymap--get-keyelt object t) + (should menu-item-filter-ran))) + (ert-deftest keymap-lookup-key () (let ((map (make-keymap))) (define-key map [?a] 'foo) @@ -72,6 +82,26 @@ https://debbugs.gnu.org/39149#31" (with-temp-buffer (should (eq (describe-buffer-bindings (current-buffer)) nil)))) +(defun keymap-tests--test-menu-item-filter (show filter-fun) + (unwind-protect + (progn + (define-key global-map (kbd "C-c C-l r") + `(menu-item "2" identity :filter ,filter-fun)) + (with-temp-buffer + (describe-buffer-bindings (current-buffer)) + (goto-char (point-min)) + (if (eq show 'show) + (should (search-forward "C-c C-l r" nil t)) + (should-not (search-forward "C-c C-l r" nil t))))) + (define-key global-map (kbd "C-c C-l r") nil) + (define-key global-map (kbd "C-c C-l") nil))) + +(ert-deftest describe-buffer-bindings/menu-item-filter-show-binding () + (keymap-tests--test-menu-item-filter 'show (lambda (cmd) cmd))) + +(ert-deftest describe-buffer-bindings/menu-item-filter-hide-binding () + (keymap-tests--test-menu-item-filter 'hide (lambda (_) nil))) + (ert-deftest keymap-store_in_keymap-XFASTINT-on-non-characters () "Check for bug fixed in \"Fix assertion violation in define-key\", commit 86c19714b097aa477d339ed99ffb5136c755a046." commit ab417cf64d15fb6f6620b45e31c249baec49f3a8 Author: Eric Abrahamsen Date: Sat Nov 14 13:19:47 2020 -0800 Handle negation of search keys in gnus-search minibuffer completion * lisp/gnus/gnus-search.el (gnus-search-get-active): Keys might start with a leading "-": check for that and ignore it. diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 17f1108029..498da200da 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -2101,9 +2101,10 @@ article came from is also searched." (defun gnus-search--complete-key-data () "Potentially return completion data for a search key or value." (let* ((key-start (save-excursion - (if (re-search-backward " " (minibuffer-prompt-end) t) - (1+ (point)) - (minibuffer-prompt-end)))) + (or (re-search-backward " " (minibuffer-prompt-end) t) + (goto-char (minibuffer-prompt-end))) + (skip-chars-forward " -") + (point))) (after-colon (save-excursion (when (re-search-backward ":" key-start t) (1+ (point))))) @@ -2113,7 +2114,7 @@ article came from is also searched." ;; only handle in a contact-completion context. (when (and gnus-search-contact-tables (save-excursion - (re-search-backward "\\<\\(\\w+\\):" key-start t) + (re-search-backward "\\<-?\\(\\w+\\):" key-start t) (member (match-string 1) '("from" "to" "cc" "bcc" "recipient" "address")))) commit ad29bc74ca9d4e1768698d4002b49c234624e359 Author: Juri Linkov Date: Sat Nov 14 22:36:13 2020 +0200 * lisp/progmodes/xref.el (xref-goto-xref): Prefix arg quits the *xref* buffer. (bug#44611) diff --git a/etc/NEWS b/etc/NEWS index 0f7b64ddd1..7aa5488250 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1134,6 +1134,13 @@ project's root directory, respectively. +++ *** New user option 'project-list-file'. +** xref + +--- +*** Prefix arg of 'xref-goto-xref' quits the *xref* buffer. +So typing 'C-u RET' in the *xref* buffer quits its window +before navigating to the selected location. + ** json.el --- diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index a1c4c08c26..e1dd6e56bb 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -600,9 +600,9 @@ SELECT is `quit', also quit the *xref* window." (defun xref-goto-xref (&optional quit) "Jump to the xref on the current line and select its window. -Non-interactively, non-nil QUIT means to first quit the *xref* -buffer." - (interactive) +Non-interactively, non-nil QUIT, or interactively, with prefix argument +means to first quit the *xref* buffer." + (interactive "P") (let* ((buffer (current-buffer)) (xref (or (xref--item-at-point) (user-error "No reference at point"))) commit 844e82f5a837a16c64e32ff9dd41a9e9b3ad3432 Author: Juri Linkov Date: Sat Nov 14 22:18:38 2020 +0200 * lisp/org/ob-ruby.el (org-babel-ruby-initiate-session): Use :ruby header arg. Allow specification of ruby command using the :ruby header arg. https://lists.gnu.org/archive/html/emacs-orgmode/2020-11/msg00166.html diff --git a/lisp/org/ob-ruby.el b/lisp/org/ob-ruby.el index 1b8088eaee..aa28bf1899 100644 --- a/lisp/org/ob-ruby.el +++ b/lisp/org/ob-ruby.el @@ -51,7 +51,8 @@ (defvar org-babel-default-header-args:ruby '()) (defvar org-babel-ruby-command "ruby" - "Name of command to use for executing ruby code.") + "Name of command to use for executing ruby code. +It's possible to override it by using a header argument `:ruby'") (defcustom org-babel-ruby-hline-to "nil" "Replace hlines in incoming tables with this when translating to ruby." @@ -71,7 +72,7 @@ "Execute a block of Ruby code with Babel. This function is called by `org-babel-execute-src-block'." (let* ((session (org-babel-ruby-initiate-session - (cdr (assq :session params)))) + (cdr (assq :session params)) params)) (result-params (cdr (assq :result-params params))) (result-type (cdr (assq :result-type params))) (full-body (org-babel-expand-body:generic @@ -147,14 +148,15 @@ Emacs-lisp table, otherwise return the results as a string." res) res))) -(defun org-babel-ruby-initiate-session (&optional session _params) +(defun org-babel-ruby-initiate-session (&optional session params) "Initiate a ruby session. If there is not a current inferior-process-buffer in SESSION then create one. Return the initialized session." (unless (string= session "none") (require 'inf-ruby) - (let* ((cmd (cdr (assoc inf-ruby-default-implementation - inf-ruby-implementations))) + (let* ((cmd (cdr (or (assq :ruby params) + (assoc inf-ruby-default-implementation + inf-ruby-implementations)))) (buffer (get-buffer (format "*%s*" session))) (session-buffer (or buffer (save-window-excursion (run-ruby cmd session) commit 5afad3918bc8816b74e8efcff9cc441785446aa6 Author: Daniel Lenski Date: Sat Nov 14 17:07:49 2020 +0100 Fix `speedbar-directory-buttons' when using Tramp * lisp/speedbar.el (speedbar-directory-buttons): Make speedbar work with directories accessed via Tramp (bug#44622). Copyright-paperwork-exempt: yes diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 991c8a33d4..3619b23d9e 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -1874,9 +1874,9 @@ matches the user directory ~, then it is replaced with a ~. INDEX is not used, but is required by the caller." (let* ((tilde (expand-file-name "~/")) (dd (expand-file-name directory)) - (junk (string-match (regexp-quote tilde) dd)) + (junk (string-prefix-p "~/" dd)) (displayme (if junk - (concat "~/" (substring dd (match-end 0))) + (concat "~/" (substring dd 2 nil)) dd)) (p (point))) (if (string-match "^~[/\\]?\\'" displayme) (setq displayme tilde)) commit 61dca6e92ac972b832e889fbeab9b6131fc896fa Author: Stefan Kangas Date: Sat Nov 14 17:04:23 2020 +0100 Don't quote lambdas in several places * lisp/align.el (align-highlight-rule): * lisp/bookmark.el (bookmark-maybe-sort-alist): * lisp/emacs-lisp/advice.el (ad-read-advice-name) (ad-retrieve-args-form, ad-make-hook-form, defadvice) (ad-with-originals): * lisp/foldout.el (foldout-inhibit-key-bindings): * lisp/gnus/gnus-bookmark.el (gnus-bookmark-maybe-sort-alist): * lisp/mail/rfc822.el (rfc822-addresses-1): * lisp/net/eudcb-ldap.el (eudc-ldap-cleanup-record-simple): * lisp/net/net-utils.el (network-connection-to-service): * lisp/net/socks.el (socks-build-auth-list): * lisp/org/ox-odt.el (org-odt--image-size): * lisp/pcomplete.el (pcomplete-command-completion-function) (pcomplete-default-completion-function, pcomplete-opt): * lisp/progmodes/cperl-mode.el (cperl-highlight-charclass) (cperl-tags-hier-init, cperl-tags-treeify) (cperl-next-interpolated-REx, cperl-time-fontification): * lisp/shadowfile.el (shadow-copy-files, shadow-shadows-of-1) (shadow-save-buffers-kill-emacs): * lisp/strokes.el (strokes-renormalize-to-grid): * lisp/tempo.el (tempo-insert, tempo-forward-mark) (tempo-backward-mark): * lisp/textmodes/artist.el (artist-submit-bug-report): * lisp/textmodes/ispell.el (ispell-complete-word): * lisp/url/url-auth.el (url-get-authentication): * lisp/url/url-cache.el (url-cache-create-filename-human-readable): * lisp/vcursor.el (vcursor-find-window): * test/lisp/textmodes/reftex-tests.el (reftex-parse-bibtex-entry-test): Don't quote lambdas. diff --git a/lisp/align.el b/lisp/align.el index e3bdf77002..b2cab1c1b2 100644 --- a/lisp/align.el +++ b/lisp/align.el @@ -1004,9 +1004,8 @@ to be colored." (completing-read "Title of rule to highlight: " (mapcar - (function - (lambda (rule) - (list (symbol-name (car rule))))) + (lambda (rule) + (list (symbol-name (car rule)))) (append (or align-mode-rules-list align-rules-list) (or align-mode-exclude-rules-list align-exclude-rules-list))) nil t))) diff --git a/lisp/bookmark.el b/lisp/bookmark.el index ab7b04ddfe..d703458aa1 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -1065,8 +1065,7 @@ it to the name of the bookmark currently being set, advancing If `bookmark-sort-flag' is non-nil, then return a sorted copy of the alist." (if bookmark-sort-flag (sort (copy-alist bookmark-alist) - (function - (lambda (x y) (string-lessp (car x) (car y))))) + (lambda (x y) (string-lessp (car x) (car y)))) bookmark-alist)) diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index 0ebd2741d2..5cda399b5e 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -1894,8 +1894,8 @@ class of FUNCTION)." "Read name of existing advice of CLASS for FUNCTION with completion. An optional PROMPT is used to prompt for the name." (let* ((name-completion-table - (mapcar (function (lambda (advice) - (list (symbol-name (ad-advice-name advice))))) + (mapcar (lambda (advice) + (list (symbol-name (ad-advice-name advice)))) (ad-get-advice-info-field function class))) (default (if (null name-completion-table) @@ -2255,13 +2255,11 @@ element is its actual current value, and the third element is either (let* ((parsed-arglist (ad-parse-arglist arglist)) (rest (nth 2 parsed-arglist))) `(list - ,@(mapcar (function - (lambda (req) - `(list ',req ,req 'required))) + ,@(mapcar (lambda (req) + `(list ',req ,req 'required)) (nth 0 parsed-arglist)) - ,@(mapcar (function - (lambda (opt) - `(list ',opt ,opt 'optional))) + ,@(mapcar (lambda (opt) + `(list ',opt ,opt 'optional)) (nth 1 parsed-arglist)) ,@(if rest (list `(list ',rest ,rest 'rest)))))) @@ -2623,8 +2621,8 @@ should be modified. The assembled function will be returned." (defun ad-make-hook-form (function hook-name) "Make hook-form from FUNCTION's advice bodies in class HOOK-NAME." (let ((hook-forms - (mapcar (function (lambda (advice) - (ad-body-forms (ad-advice-definition advice)))) + (mapcar (lambda (advice) + (ad-body-forms (ad-advice-definition advice))) (ad-get-enabled-advices function hook-name)))) (if hook-forms (macroexp-progn (apply 'append hook-forms))))) @@ -3167,15 +3165,14 @@ usage: (defadvice FUNCTION (CLASS NAME [POSITION] [ARGLIST] FLAG...) (setq args (cdr args))))) (flags (mapcar - (function - (lambda (flag) + (lambda (flag) (let ((completion (try-completion (symbol-name flag) ad-defadvice-flags))) (cond ((eq completion t) flag) ((member completion ad-defadvice-flags) (intern completion)) (t (error "defadvice: Invalid or ambiguous flag: %s" - flag)))))) + flag))))) args)) (advice (ad-make-advice name (memq 'protect flags) @@ -3217,11 +3214,10 @@ undone on exit of this macro." (let* ((index -1) ;; Make let-variables to store current definitions: (current-bindings - (mapcar (function - (lambda (function) + (mapcar (lambda (function) (setq index (1+ index)) (list (intern (format "ad-oRiGdEf-%d" index)) - `(symbol-function ',function)))) + `(symbol-function ',function))) functions))) `(let ,current-bindings (unwind-protect diff --git a/lisp/foldout.el b/lisp/foldout.el index 0d7a7a88a6..58455c28b1 100644 --- a/lisp/foldout.el +++ b/lisp/foldout.el @@ -527,19 +527,18 @@ Valid modifiers are shift, control, meta, alt, hyper and super.") (define-key map "\C-z" 'foldout-zoom-subtree) (define-key map "\C-x" 'foldout-exit-fold)) (let* ((modifiers (apply 'concat - (mapcar (function - (lambda (modifier) - (vector - (cond - ((eq modifier 'shift) ?S) - ((eq modifier 'control) ?C) - ((eq modifier 'meta) ?M) - ((eq modifier 'alt) ?A) - ((eq modifier 'hyper) ?H) - ((eq modifier 'super) ?s) - (t (error "invalid mouse modifier %s" - modifier))) - ?-))) + (mapcar (lambda (modifier) + (vector + (cond + ((eq modifier 'shift) ?S) + ((eq modifier 'control) ?C) + ((eq modifier 'meta) ?M) + ((eq modifier 'alt) ?A) + ((eq modifier 'hyper) ?H) + ((eq modifier 'super) ?s) + (t (error "invalid mouse modifier %s" + modifier))) + ?-)) foldout-mouse-modifiers))) (mouse-1 (vector (intern (concat modifiers "down-mouse-1")))) (mouse-2 (vector (intern (concat modifiers "down-mouse-2")))) diff --git a/lisp/gnus/gnus-bookmark.el b/lisp/gnus/gnus-bookmark.el index 1b00bbbc69..4f85349d16 100644 --- a/lisp/gnus/gnus-bookmark.el +++ b/lisp/gnus/gnus-bookmark.el @@ -345,8 +345,7 @@ copy of the alist." (when gnus-bookmark-sort-flag (setq gnus-bookmark-alist (sort (copy-alist gnus-bookmark-alist) - (function - (lambda (x y) (string-lessp (car x) (car y)))))))) + (lambda (x y) (string-lessp (car x) (car y))))))) ;;;###autoload (defun gnus-bookmark-bmenu-list () diff --git a/lisp/mail/rfc822.el b/lisp/mail/rfc822.el index f2fe1cd816..4572f27faf 100644 --- a/lisp/mail/rfc822.el +++ b/lisp/mail/rfc822.el @@ -226,11 +226,11 @@ ((and (not (eobp)) (= (following-char) ?\@)) ;; <@foo.bar,@baz:quux@abcd.efg> (rfc822-snarf-frob-list "<...> address" ?\, ?\: - (function (lambda () - (if (rfc822-looking-at ?\@) - (rfc822-snarf-domain) - (rfc822-bad-address - "Gubbish in route-addr"))))) + (lambda () + (if (rfc822-looking-at ?\@) + (rfc822-snarf-domain) + (rfc822-bad-address + "Gubbish in route-addr")))) (rfc822-snarf-words) (or (rfc822-looking-at ?@) (rfc822-bad-address "Malformed <..@..> address")) diff --git a/lisp/net/eudcb-ldap.el b/lisp/net/eudcb-ldap.el index 1764f03e21..14cc7db2fa 100644 --- a/lisp/net/eudcb-ldap.el +++ b/lisp/net/eudcb-ldap.el @@ -76,12 +76,11 @@ "Do some cleanup in a RECORD to make it suitable for EUDC." (declare (obsolete eudc-ldap-cleanup-record-filtering-addresses "25.1")) (mapcar - (function - (lambda (field) - (cons (intern (downcase (car field))) - (if (cdr (cdr field)) - (cdr field) - (car (cdr field)))))) + (lambda (field) + (cons (intern (downcase (car field))) + (if (cdr (cdr field)) + (cdr field) + (car (cdr field))))) record)) (defun eudc-filter-$ (string) diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el index 8c7d33a67d..8777fe4bf4 100644 --- a/lisp/net/net-utils.el +++ b/lisp/net/net-utils.el @@ -985,9 +985,8 @@ This command uses `network-connection-service-alist', which see." (read-from-minibuffer "Host: " (net-utils-machine-at-point)) (completing-read "Service: " (mapcar - (function - (lambda (elt) - (list (symbol-name (car elt))))) + (lambda (elt) + (list (symbol-name (car elt)))) network-connection-service-alist)))) (network-connection host diff --git a/lisp/net/socks.el b/lisp/net/socks.el index 84fc5dccac..9b22a5083f 100644 --- a/lisp/net/socks.el +++ b/lisp/net/socks.el @@ -235,11 +235,10 @@ (let ((num 0) (retval "")) (mapc - (function - (lambda (x) - (if (fboundp (cdr (cdr x))) - (setq retval (format "%s%c" retval (car x)) - num (1+ num))))) + (lambda (x) + (if (fboundp (cdr (cdr x))) + (setq retval (format "%s%c" retval (car x)) + num (1+ num)))) (reverse socks-authentication-methods)) (format "%c%s" num retval))) diff --git a/lisp/org/ox-odt.el b/lisp/org/ox-odt.el index a1486318a7..229b524f84 100644 --- a/lisp/org/ox-odt.el +++ b/lisp/org/ox-odt.el @@ -2199,10 +2199,10 @@ SHORT-CAPTION are strings." (defun org-odt--image-size (file info &optional user-width user-height scale dpi embed-as) (let* ((--pixels-to-cms - (function (lambda (pixels dpi) - (let ((cms-per-inch 2.54) - (inches (/ pixels dpi))) - (* cms-per-inch inches))))) + (lambda (pixels dpi) + (let ((cms-per-inch 2.54) + (inches (/ pixels dpi))) + (* cms-per-inch inches)))) (--size-in-cms (function (lambda (size-in-pixels dpi) diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 679f2e93e0..a744165e0d 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -291,9 +291,8 @@ generate the completions list. This means that the hook `(pcomplete--here (lambda () ,form) ,stub ,paring ,form-only)) (defcustom pcomplete-command-completion-function - (function - (lambda () - (pcomplete-here (pcomplete-executables)))) + (lambda () + (pcomplete-here (pcomplete-executables))) "Function called for completing the initial command argument." :type 'function) @@ -302,9 +301,8 @@ generate the completions list. This means that the hook :type 'function) (defcustom pcomplete-default-completion-function - (function - (lambda () - (while (pcomplete-here (pcomplete-entries))))) + (lambda () + (while (pcomplete-here (pcomplete-entries)))) "Function called when no completion rule can be found. This function is used to generate completions for every argument." :type 'function) @@ -988,9 +986,8 @@ Arguments NO-GANGING and ARGS-FOLLOW are currently ignored." (setq index (1+ index)))) (throw 'pcomplete-completions (mapcar - (function - (lambda (opt) - (concat "-" opt))) + (lambda (opt) + (concat "-" opt)) (pcomplete-uniquify-list choices)))) (let ((arg (pcomplete-arg))) (when (and (> (length arg) 1) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index d5b30025e7..a42ace105a 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -3441,8 +3441,8 @@ Should be called with the point before leading colon of an attribute." (match-beginning 4) (match-end 4) 'face dashface)) ;; save match data (for looking-at) - (setq lll (mapcar (function (lambda (elt) (cons (match-beginning elt) - (match-end elt)))) + (setq lll (mapcar (lambda (elt) (cons (match-beginning elt) + (match-end elt))) l)) (while lll (setq ll (car lll)) @@ -6758,10 +6758,10 @@ One may build such TAGS files from CPerl mode menu." (require 'etags) (require 'imenu) (if (or update (null (nth 2 cperl-hierarchy))) - (let ((remover (function (lambda (elt) ; (name (file1...) (file2..)) - (or (nthcdr 2 elt) - ;; Only in one file - (setcdr elt (cdr (nth 1 elt))))))) + (let ((remover (lambda (elt) ; (name (file1...) (file2..)) + (or (nthcdr 2 elt) + ;; Only in one file + (setcdr elt (cdr (nth 1 elt)))))) to l1 l2 l3) ;; (setq cperl-hierarchy '(() () ())) ; Would write into '() later! (setq cperl-hierarchy (list l1 l2 l3)) @@ -6841,33 +6841,33 @@ One may build such TAGS files from CPerl mode menu." (setq ord 2) (mapc move-deeper methods) (if recurse - (mapc (function (lambda (elt) - (cperl-tags-treeify elt (1+ level)))) + (mapc (lambda (elt) + (cperl-tags-treeify elt (1+ level))) (cdr to))) ;;Now clean up leaders with one child only - (mapc (function (lambda (elt) - (if (not (and (listp (cdr elt)) - (eq (length elt) 2))) - nil - (setcar elt (car (nth 1 elt))) - (setcdr elt (cdr (nth 1 elt)))))) + (mapc (lambda (elt) + (if (not (and (listp (cdr elt)) + (eq (length elt) 2))) + nil + (setcar elt (car (nth 1 elt))) + (setcdr elt (cdr (nth 1 elt))))) (cdr to)) ;; Sort the roots of subtrees (if (default-value 'imenu-sort-function) (setcdr to (sort (cdr to) (default-value 'imenu-sort-function)))) ;; Now add back functions removed from display - (mapc (function (lambda (elt) - (setcdr to (cons elt (cdr to))))) + (mapc (lambda (elt) + (setcdr to (cons elt (cdr to)))) (if (default-value 'imenu-sort-function) (nreverse (sort root-functions (default-value 'imenu-sort-function))) root-functions)) ;; Now add back packages removed from display - (mapc (function (lambda (elt) - (setcdr to (cons (cons (concat "package " (car elt)) - (cdr elt)) - (cdr to))))) + (mapc (lambda (elt) + (setcdr to (cons (cons (concat "package " (car elt)) + (cdr elt)) + (cdr to)))) (if (default-value 'imenu-sort-function) (nreverse (sort root-packages (default-value 'imenu-sort-function))) @@ -8211,11 +8211,11 @@ a result of qr//, this is not a performance hit), t for the rest." (and (eq (get-text-property beg 'syntax-type) 'string) (setq beg (next-single-property-change beg 'syntax-type nil limit))) (cperl-map-pods-heres - (function (lambda (s _e _p) - (if (memq (get-text-property s 'REx-interpolated) skip) - t - (setq pp s) - nil))) ; nil stops + (lambda (s _e _p) + (if (memq (get-text-property s 'REx-interpolated) skip) + t + (setq pp s) + nil)) ; nil stops 'REx-interpolated beg limit) (if pp (goto-char pp) (message "No more interpolated REx")))) @@ -8334,7 +8334,7 @@ start with default arguments, then refine the slowdown regions." (or l (setq l 1)) (or step (setq step 500)) (or lim (setq lim 40)) - (let* ((timems (function (lambda () (car (cperl--time-convert nil 1000))))) + (let* ((timems (lambda () (car (cperl--time-convert nil 1000)))) (tt (funcall timems)) (c 0) delta tot) (goto-char (point-min)) (forward-line (1- l)) diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index 31f3a34d50..a7343a9f94 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el @@ -524,10 +524,9 @@ call it manually." (if (called-interactively-p 'interactive) (message "No files need to be shadowed.")) (save-excursion - (map-y-or-n-p (function - (lambda (pair) - (or arg shadow-noquery - (format "Copy shadow file %s? " (cdr pair))))) + (map-y-or-n-p (lambda (pair) + (or arg shadow-noquery + (format "Copy shadow file %s? " (cdr pair)))) (function shadow-copy-file) shadow-files-to-copy '("shadow" "shadows" "copy")) @@ -632,9 +631,8 @@ Consider them as regular expressions if third arg REGEXP is true." "shadow-shadows-of-1: %s %s %s" file (shadow-parse-name file) realname)) (mapcar - (function - (lambda (x) - (shadow-replace-name-component x realname))) + (lambda (x) + (shadow-replace-name-component x realname)) nonmatching))) (t nonmatching)) (shadow-shadows-of-1 file (cdr groups) regexp))))) @@ -791,9 +789,8 @@ look for files that have been changed and need to be copied to other systems." (save-some-buffers arg t) (shadow-copy-files) (shadow-save-todo-file) - (and (or (not (memq t (mapcar (function - (lambda (buf) (and (buffer-file-name buf) - (buffer-modified-p buf)))) + (and (or (not (memq t (mapcar (lambda (buf) (and (buffer-file-name buf) + (buffer-modified-p buf))) (buffer-list)))) (yes-or-no-p "Modified buffers exist; exit anyway? ")) (or (not (fboundp 'process-list)) diff --git a/lisp/strokes.el b/lisp/strokes.el index c2f03cac0f..11bc07a29c 100644 --- a/lisp/strokes.el +++ b/lisp/strokes.el @@ -574,9 +574,8 @@ Optional GRID-RESOLUTION may be used in place of `strokes-grid-resolution'. The grid is a square whose dimension is [0,GRID-RESOLUTION)." (or grid-resolution (setq grid-resolution strokes-grid-resolution)) (let ((stroke-extent (strokes-get-stroke-extent positions))) - (mapcar (function - (lambda (pos) - (strokes-get-grid-position stroke-extent pos grid-resolution))) + (mapcar (lambda (pos) + (strokes-get-grid-position stroke-extent pos grid-resolution)) positions))) (defun strokes-fill-stroke (unfilled-stroke &optional force) diff --git a/lisp/tempo.el b/lisp/tempo.el index f6612354b1..9ee0eefc4a 100644 --- a/lisp/tempo.el +++ b/lisp/tempo.el @@ -353,9 +353,8 @@ possible." ((and (consp element) (eq (car element) 's)) (tempo-insert-named (car (cdr element)))) ((and (consp element) - (eq (car element) 'l)) (mapcar (function - (lambda (elt) - (tempo-insert elt on-region))) + (eq (car element) 'l)) (mapcar (lambda (elt) + (tempo-insert elt on-region)) (cdr element))) ((eq element 'p) (tempo-insert-mark (point-marker))) ((eq element 'r) (if on-region @@ -546,10 +545,9 @@ and insert the results." (interactive) (let ((next-mark (catch 'found (mapc - (function - (lambda (mark) - (if (< (point) mark) - (throw 'found mark)))) + (lambda (mark) + (if (< (point) mark) + (throw 'found mark))) tempo-marks) ;; return nil if not found nil))) @@ -565,11 +563,10 @@ and insert the results." (let ((prev-mark (catch 'found (let (last) (mapc - (function - (lambda (mark) - (if (<= (point) mark) - (throw 'found last)) - (setq last mark))) + (lambda (mark) + (if (<= (point) mark) + (throw 'found last)) + (setq last mark)) tempo-marks) last)))) (if prev-mark diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index 5ce9a90ea6..90e8d360c1 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -5398,10 +5398,9 @@ The event, EV, is the mouse event." artist-arrow-point-2))) ;; Remove those variables from vars that are not bound (mapc - (function - (lambda (x) - (if (not (and (boundp x) (symbol-value x))) - (setq vars (delq x vars))))) vars) + (lambda (x) + (if (not (and (boundp x) (symbol-value x))) + (setq vars (delq x vars)))) vars) (reporter-submit-bug-report artist-maintainer-address (concat "artist.el " artist-version) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 31b699cf50..14de77cd54 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -3704,11 +3704,10 @@ Standard ispell choices are then available." ((string-equal (upcase word) word) (setq possibilities (mapcar #'upcase possibilities))) ((eq (upcase (aref word 0)) (aref word 0)) - (setq possibilities (mapcar (function - (lambda (pos) - (if (eq (aref word 0) (aref pos 0)) - pos - (capitalize pos)))) + (setq possibilities (mapcar (lambda (pos) + (if (eq (aref word 0) (aref pos 0)) + pos + (capitalize pos))) possibilities)))) (setq case-fold-search case-fold-search-val) (save-window-excursion diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el index 8f39b5ae01..fd800cd978 100644 --- a/lisp/url/url-auth.el +++ b/lisp/url/url-auth.el @@ -494,21 +494,19 @@ PROMPT is boolean - specifies whether to ask the user for a username/password (car-safe (sort (mapcar - (function - (lambda (scheme) - (if (fboundp (car (cdr scheme))) - (cons (cdr (cdr scheme)) - (funcall (car (cdr scheme)) url nil nil realm)) - (cons 0 nil)))) + (lambda (scheme) + (if (fboundp (car (cdr scheme))) + (cons (cdr (cdr scheme)) + (funcall (car (cdr scheme)) url nil nil realm)) + (cons 0 nil))) url-registered-auth-schemes) - (function - (lambda (x y) - (cond - ((null (cdr x)) nil) - ((and (cdr x) (null (cdr y))) t) - ((and (cdr x) (cdr y)) - (>= (car x) (car y))) - (t nil))))))) + (lambda (x y) + (cond + ((null (cdr x)) nil) + ((and (cdr x) (null (cdr y))) t) + ((and (cdr x) (cdr y)) + (>= (car x) (car y))) + (t nil)))))) (if (symbolp type) (setq type (symbol-name type))) (let* ((scheme (car-safe (cdr-safe (assoc (downcase type) diff --git a/lisp/url/url-cache.el b/lisp/url/url-cache.el index 056ad1e018..ea14e60ecc 100644 --- a/lisp/url/url-cache.el +++ b/lisp/url/url-cache.el @@ -110,18 +110,17 @@ The actual return value is the last modification time of the cache file." (let ((slash nil)) (setq fname (mapconcat - (function - (lambda (x) - (cond - ((and (= ?/ x) slash) - (setq slash nil) - "%2F") - ((= ?/ x) - (setq slash t) - "/") - (t - (setq slash nil) - (char-to-string x))))) fname "")))) + (lambda (x) + (cond + ((and (= ?/ x) slash) + (setq slash nil) + "%2F") + ((= ?/ x) + (setq slash t) + "/") + (t + (setq slash nil) + (char-to-string x)))) fname "")))) (setq fname (and fname (mapconcat diff --git a/lisp/vcursor.el b/lisp/vcursor.el index 3601abcd6e..e5e9f062a9 100644 --- a/lisp/vcursor.el +++ b/lisp/vcursor.el @@ -602,15 +602,14 @@ Set `vcursor-window' to the returned value as a side effect." (pos-visible-in-window-p (point) vcursor-window)) (progn (walk-windows - (function - (lambda (win) - (and (not winok) - (eq (current-buffer) (window-buffer win)) - (not (and not-this (eq thiswin win))) - (cond - ((pos-visible-in-window-p (point) win) (setq winok win)) - ((eq thiswin win)) - ((not winbuf) (setq winbuf win)))))) + (lambda (win) + (and (not winok) + (eq (current-buffer) (window-buffer win)) + (not (and not-this (eq thiswin win))) + (cond + ((pos-visible-in-window-p (point) win) (setq winok win)) + ((eq thiswin win)) + ((not winbuf) (setq winbuf win))))) nil (not this-frame)) (setq vcursor-window (cond diff --git a/test/lisp/textmodes/reftex-tests.el b/test/lisp/textmodes/reftex-tests.el index 2350326c14..42a060b395 100644 --- a/test/lisp/textmodes/reftex-tests.el +++ b/test/lisp/textmodes/reftex-tests.el @@ -153,24 +153,23 @@ edition = {17th}, note = {Updated for Emacs Version 24.2} }") - (check (function - (lambda (parsed) - (should (string= (reftex-get-bib-field "&key" parsed) - "Stallman12")) - (should (string= (reftex-get-bib-field "&type" parsed) - "book")) - (should (string= (reftex-get-bib-field "author" parsed) - "Richard Stallman et al.")) - (should (string= (reftex-get-bib-field "title" parsed) - "The Emacs Editor")) - (should (string= (reftex-get-bib-field "publisher" parsed) - "GNU Press")) - (should (string= (reftex-get-bib-field "year" parsed) - "2012")) - (should (string= (reftex-get-bib-field "edition" parsed) - "17th")) - (should (string= (reftex-get-bib-field "note" parsed) - "Updated for Emacs Version 24.2")))))) + (check (lambda (parsed) + (should (string= (reftex-get-bib-field "&key" parsed) + "Stallman12")) + (should (string= (reftex-get-bib-field "&type" parsed) + "book")) + (should (string= (reftex-get-bib-field "author" parsed) + "Richard Stallman et al.")) + (should (string= (reftex-get-bib-field "title" parsed) + "The Emacs Editor")) + (should (string= (reftex-get-bib-field "publisher" parsed) + "GNU Press")) + (should (string= (reftex-get-bib-field "year" parsed) + "2012")) + (should (string= (reftex-get-bib-field "edition" parsed) + "17th")) + (should (string= (reftex-get-bib-field "note" parsed) + "Updated for Emacs Version 24.2"))))) (funcall check (reftex-parse-bibtex-entry entry)) (with-temp-buffer (insert entry) commit e71f5f1fd1fdeda52fda537ed3b45c8fcc435cac Author: Akira Kyle Date: Sat Nov 14 16:39:41 2020 +0100 Work around glib messing with signal handlers more than it should * src/process.c (init_process_emacs): force glib's g_unix_signal handler into lib_child_handler where it should belong. Copyright-paperwork-exempt: yes diff --git a/src/process.c b/src/process.c index 50c425077a..bf64ead24e 100644 --- a/src/process.c +++ b/src/process.c @@ -8217,13 +8217,29 @@ init_process_emacs (int sockfd) if (!will_dump_with_unexec_p ()) { #if defined HAVE_GLIB && !defined WINDOWSNT - /* Tickle glib's child-handling code. Ask glib to wait for Emacs itself; - this should always fail, but is enough to initialize glib's + /* Tickle glib's child-handling code. Ask glib to install a + watch source for Emacs itself which will initialize glib's private SIGCHLD handler, allowing catch_child_signal to copy - it into lib_child_handler. */ - g_source_unref (g_child_watch_source_new (getpid ())); -#endif + it into lib_child_handler. + + Unfortunatly in glib commit 2e471acf, the behavior changed to + always install a signal handler when g_child_watch_source_new + is called and not just the first time it's called. Glib also + now resets signal handlers to SIG_DFL when it no longer has a + watcher on that signal. This is a hackey work around to get + glib's g_unix_signal_handler into lib_child_handler. */ + GSource *source = g_child_watch_source_new (getpid ()); + catch_child_signal (); + g_source_unref (source); + + eassert (lib_child_handler != dummy_handler); + signal_handler_t lib_child_handler_glib = lib_child_handler; catch_child_signal (); + eassert (lib_child_handler == dummy_handler); + lib_child_handler = lib_child_handler_glib; +#else + catch_child_signal (); +#endif } #ifdef HAVE_SETRLIMIT commit 8700319109c06932cd66615c85fc21e386b40df6 Author: Pablo Barbáchano Date: Sat Nov 14 16:24:26 2020 +0100 Add an option to preserve ANSI sequences * lisp/ansi-color.el Add an option to preserve the ANSI sequences * test/lisp/ansi-color-tests.el: Add tests (bug#44589). diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el index e9cdf03db0..d5432a60fb 100644 --- a/lisp/ansi-color.el +++ b/lisp/ansi-color.el @@ -363,7 +363,7 @@ it will override BEGIN, the start of the region. Set (setq ansi-color-context-region (list nil (match-beginning 0))) (setq ansi-color-context-region nil))))) -(defun ansi-color-apply-on-region (begin end) +(defun ansi-color-apply-on-region (begin end &optional preserve-sequences) "Translates SGR control sequences into overlays or extents. Delete all other control sequences without processing them. @@ -380,18 +380,28 @@ ansi codes. This information will be used for the next call to `ansi-color-apply-on-region'. Specifically, it will override BEGIN, the start of the region and set the face with which to start. Set `ansi-color-context-region' to nil if you don't want -this." +this. + +If PRESERVE-SEQUENCES is t, the sequences are hidden instead of +being deleted." (let ((codes (car ansi-color-context-region)) - (start-marker (or (cadr ansi-color-context-region) - (copy-marker begin))) - (end-marker (copy-marker end))) + (start-marker (or (cadr ansi-color-context-region) + (copy-marker begin))) + (end-marker (copy-marker end))) (save-excursion (goto-char start-marker) ;; Find the next escape sequence. (while (re-search-forward ansi-color-control-seq-regexp end-marker t) - ;; Remove escape sequence. - (let ((esc-seq (delete-and-extract-region + ;; Extract escape sequence. + (let ((esc-seq (buffer-substring (match-beginning 0) (point)))) + (if preserve-sequences + ;; Make the escape sequence transparent. + (overlay-put (make-overlay (match-beginning 0) (point)) + 'invisible t) + ;; Otherwise, strip. + (delete-region (match-beginning 0) (point))) + ;; Colorize the old block from start to end using old face. (funcall ansi-color-apply-face-function (prog1 (marker-position start-marker) diff --git a/test/lisp/ansi-color-tests.el b/test/lisp/ansi-color-tests.el new file mode 100644 index 0000000000..5c3da875f8 --- /dev/null +++ b/test/lisp/ansi-color-tests.el @@ -0,0 +1,49 @@ +;;; ansi-color-tests.el --- Test suite for ansi-color -*- lexical-binding: t; -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; Author: Pablo Barbáchano +;; Keywords: ansi + +;; 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 'ansi-color) + +(defvar test-strings '(("\e[33mHello World\e[0m" . "Hello World") + ("\e[1m\e[3m\e[5mbold italics blink\e[0m" . "bold italics blink"))) + +(ert-deftest ansi-color-apply-on-region-test () + (dolist (pair test-strings) + (with-temp-buffer + (insert (car pair)) + (ansi-color-apply-on-region (point-min) (point-max)) + (should (equal (buffer-string) (cdr pair))) + (should (not (equal (overlays-at (point-min)) nil)))))) + +(ert-deftest ansi-color-apply-on-region-preserving-test () + (dolist (pair test-strings) + (with-temp-buffer + (insert (car pair)) + (ansi-color-apply-on-region (point-min) (point-max) t) + (should (equal (buffer-string) (car pair)))))) + +(provide 'ansi-color-tests) + +;;; ansi-color-tests.el ends here commit b5ff3e0e0c94f3bc53e0e71dd21445ddef5ed129 Author: Lars Ingebrigtsen Date: Sat Nov 14 16:17:44 2020 +0100 project-or-external-find-file doc string fix * lisp/progmodes/project.el (project-or-external-find-file): Doc string fix -- it's not "recognizing" file names (bug#44588). diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 09e60c09ac..a395453491 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -754,8 +754,7 @@ The completion default is the string at point." ;;;###autoload (defun project-or-external-find-file () "Visit a file (with completion) in the current project or external roots. -The completion default is the filename at point, if one is -recognized." +The completion default is the string at point." (interactive) (let* ((pr (project-current t)) (dirs (cons commit 08b1028c1ecea9e560eb08154bfb3fc557f1275d Author: Stefan Kangas Date: Sat Nov 14 15:55:08 2020 +0100 Use lexical-binding in fortune.el and add tests * lisp/play/fortune.el: Use lexical-binding. Remove redundant :group args. (fortune-in-buffer): Quote function symbol as such. * test/lisp/play/fortune-resources/fortunes: * test/lisp/play/fortune-tests.el: New files. * .gitignore: Ignore generated file fortunes.dat. diff --git a/.gitignore b/.gitignore index 29565d0417..c969dcadf9 100644 --- a/.gitignore +++ b/.gitignore @@ -153,6 +153,7 @@ test/manual/etags/ETAGS test/manual/etags/CTAGS test/manual/indent/*.new test/lisp/gnus/mml-sec-resources/random_seed +test/lisp/play/fortune-resources/fortunes.dat # ctags, etags. TAGS diff --git a/lisp/play/fortune.el b/lisp/play/fortune.el index f8859d954f..c180fd06c3 100644 --- a/lisp/play/fortune.el +++ b/lisp/play/fortune.el @@ -1,4 +1,4 @@ -;;; fortune.el --- use fortune to create signatures +;;; fortune.el --- use fortune to create signatures -*- lexical-binding: t -*- ;; Copyright (C) 1999, 2001-2020 Free Software Foundation, Inc. @@ -63,76 +63,75 @@ :link '(emacs-commentary-link "fortune.el") :version "21.1" :group 'games) -(defgroup fortune-signature nil - "Settings for use of fortune for signatures." - :group 'fortune - :group 'mail) (defcustom fortune-dir "~/docs/ascii/misc/fortunes/" "The directory to look in for local fortune cookies files." - :type 'directory - :group 'fortune) + :type 'directory) + (defcustom fortune-file (expand-file-name "usenet" fortune-dir) "The file in which local fortune cookies will be stored." - :type 'file - :group 'fortune) + :type 'file) + (defcustom fortune-database-extension ".dat" "The extension of the corresponding fortune database. Normally you won't have a reason to change it." - :type 'string - :group 'fortune) + :type 'string) + (defcustom fortune-program "fortune" "Program to select a fortune cookie." - :type 'string - :group 'fortune) + :type 'string) + (defcustom fortune-program-options () "List of options to pass to the fortune program." :type '(choice (repeat (string :tag "Option")) (string :tag "Obsolete string of options")) - :version "23.1" - :group 'fortune) + :version "23.1") + (defcustom fortune-strfile "strfile" "Program to compute a new fortune database." - :type 'string - :group 'fortune) + :type 'string) + (defcustom fortune-strfile-options "" "Options to pass to the strfile program (a string)." - :type 'string - :group 'fortune) + :type 'string) + (defcustom fortune-quiet-strfile-options "> /dev/null" "Text added to the command for running `strfile'. By default it discards the output produced by `strfile'. Set this to \"\" if you would like to see the output." - :type 'string - :group 'fortune) + :type 'string) (defcustom fortune-always-compile t "Non-nil means automatically compile fortune files. If nil, you must invoke `fortune-compile' manually to do that." - :type 'boolean - :group 'fortune) + :type 'boolean) + +(defgroup fortune-signature nil + "Settings for use of fortune for signatures." + :group 'fortune + :group 'mail) + (defcustom fortune-author-line-prefix " -- " "Prefix to put before the author name of a fortunate." - :type 'string - :group 'fortune-signature) + :type 'string) + (defcustom fortune-fill-column fill-column "Fill column for fortune files." - :type 'integer - :group 'fortune-signature) + :type 'integer) + (defcustom fortune-from-mail "private e-mail" "String to use to characterize that the fortune comes from an e-mail. No need to add an `in'." - :type 'string - :group 'fortune-signature) + :type 'string) + (defcustom fortune-sigstart "" "Some text to insert before the fortune cookie, in a mail signature." - :type 'string - :group 'fortune-signature) + :type 'string) + (defcustom fortune-sigend "" "Some text to insert after the fortune cookie, in a mail signature." - :type 'string - :group 'fortune-signature) + :type 'string) ;; not customizable settings @@ -297,7 +296,7 @@ specifies the file to choose the fortune from." (erase-buffer) (if fortune-always-compile (fortune-compile fort-file)) - (apply 'call-process + (apply #'call-process fortune-program ; program to call nil fortune-buffer nil ; INFILE BUFFER DISPLAY (append (if (stringp fortune-program-options) @@ -334,7 +333,6 @@ and choose the directory as the fortune-file." (setq buffer-read-only t)) -;;; Provide ourselves. (provide 'fortune) ;;; fortune.el ends here diff --git a/test/lisp/play/fortune-resources/fortunes b/test/lisp/play/fortune-resources/fortunes new file mode 100644 index 0000000000..f1ddc512d0 --- /dev/null +++ b/test/lisp/play/fortune-resources/fortunes @@ -0,0 +1,11 @@ +Embarrassed +Manual-Writer +Accused of +Communist +Subversion +% +Embarrassingly +Mundane +Advertising +Cuts +Sales diff --git a/test/lisp/play/fortune-tests.el b/test/lisp/play/fortune-tests.el new file mode 100644 index 0000000000..97263405e8 --- /dev/null +++ b/test/lisp/play/fortune-tests.el @@ -0,0 +1,41 @@ +;;; fortune-tests.el --- Tests for fortune.el -*- lexical-binding: t -*- + +;; Copyright (C) 2020 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 'ert-x) +(require 'fortune) + +(defvar fortune-tests--regexp + (rx (| "Embarrassed" "Embarrassingly"))) + +(ert-deftest test-fortune () + (skip-unless (executable-find "fortune")) + (unwind-protect + (let ((fortune-file (ert-resource-file "fortunes"))) + (fortune) + (goto-char (point-min)) + (should (looking-at fortune-tests--regexp))) + (kill-buffer fortune-buffer-name))) + +(provide 'fortune-tests) +;;; fortune-tests.el ends here commit 03eeab469ed829b4f06d970034ef1bbce01fea6e Author: Eli Zaretskii Date: Sat Nov 14 15:59:31 2020 +0200 ; Update the expected result files in test/manual/etags. diff --git a/test/manual/etags/ETAGS.good_1 b/test/manual/etags/ETAGS.good_1 index 5451a79efa..3de15514e7 100644 --- a/test/manual/etags/ETAGS.good_1 +++ b/test/manual/etags/ETAGS.good_1 @@ -3153,13 +3153,13 @@ tex-src/gzip.texi,303 @node Top,62,2139 @node Copying,80,2652 @node Overview,83,2705 -@node Sample,166,7272 -@node Invoking gzip,Invoking gzip210,8828 -@node Advanced usage,Advanced usage357,13496 -@node Environment,420,15208 -@node Tapes,437,15769 -@node Problems,460,16768 -@node Concept Index,Concept Index473,17288 +@node Sample,166,7273 +@node Invoking gzip,Invoking gzip210,8829 +@node Advanced usage,Advanced usage357,13497 +@node Environment,420,15209 +@node Tapes,437,15770 +@node Problems,460,16769 +@node Concept Index,Concept Index473,17289 tex-src/texinfo.tex,30627 \def\texinfoversion{\texinfoversion26,1035 diff --git a/test/manual/etags/ETAGS.good_2 b/test/manual/etags/ETAGS.good_2 index ab2111eafb..ddb8d19540 100644 --- a/test/manual/etags/ETAGS.good_2 +++ b/test/manual/etags/ETAGS.good_2 @@ -3726,13 +3726,13 @@ tex-src/gzip.texi,303 @node Top,62,2139 @node Copying,80,2652 @node Overview,83,2705 -@node Sample,166,7272 -@node Invoking gzip,Invoking gzip210,8828 -@node Advanced usage,Advanced usage357,13496 -@node Environment,420,15208 -@node Tapes,437,15769 -@node Problems,460,16768 -@node Concept Index,Concept Index473,17288 +@node Sample,166,7273 +@node Invoking gzip,Invoking gzip210,8829 +@node Advanced usage,Advanced usage357,13497 +@node Environment,420,15209 +@node Tapes,437,15770 +@node Problems,460,16769 +@node Concept Index,Concept Index473,17289 tex-src/texinfo.tex,30627 \def\texinfoversion{\texinfoversion26,1035 diff --git a/test/manual/etags/ETAGS.good_3 b/test/manual/etags/ETAGS.good_3 index e53fb9629c..40be768aac 100644 --- a/test/manual/etags/ETAGS.good_3 +++ b/test/manual/etags/ETAGS.good_3 @@ -3560,13 +3560,13 @@ tex-src/gzip.texi,303 @node Top,62,2139 @node Copying,80,2652 @node Overview,83,2705 -@node Sample,166,7272 -@node Invoking gzip,Invoking gzip210,8828 -@node Advanced usage,Advanced usage357,13496 -@node Environment,420,15208 -@node Tapes,437,15769 -@node Problems,460,16768 -@node Concept Index,Concept Index473,17288 +@node Sample,166,7273 +@node Invoking gzip,Invoking gzip210,8829 +@node Advanced usage,Advanced usage357,13497 +@node Environment,420,15209 +@node Tapes,437,15770 +@node Problems,460,16769 +@node Concept Index,Concept Index473,17289 tex-src/texinfo.tex,30627 \def\texinfoversion{\texinfoversion26,1035 diff --git a/test/manual/etags/ETAGS.good_4 b/test/manual/etags/ETAGS.good_4 index 5a4b5b4b8b..15f67c5d28 100644 --- a/test/manual/etags/ETAGS.good_4 +++ b/test/manual/etags/ETAGS.good_4 @@ -3317,13 +3317,13 @@ tex-src/gzip.texi,303 @node Top,62,2139 @node Copying,80,2652 @node Overview,83,2705 -@node Sample,166,7272 -@node Invoking gzip,Invoking gzip210,8828 -@node Advanced usage,Advanced usage357,13496 -@node Environment,420,15208 -@node Tapes,437,15769 -@node Problems,460,16768 -@node Concept Index,Concept Index473,17288 +@node Sample,166,7273 +@node Invoking gzip,Invoking gzip210,8829 +@node Advanced usage,Advanced usage357,13497 +@node Environment,420,15209 +@node Tapes,437,15770 +@node Problems,460,16769 +@node Concept Index,Concept Index473,17289 tex-src/texinfo.tex,30627 \def\texinfoversion{\texinfoversion26,1035 diff --git a/test/manual/etags/ETAGS.good_5 b/test/manual/etags/ETAGS.good_5 index f89cfefc38..583de5cbe2 100644 --- a/test/manual/etags/ETAGS.good_5 +++ b/test/manual/etags/ETAGS.good_5 @@ -4297,13 +4297,13 @@ tex-src/gzip.texi,303 @node Top,62,2139 @node Copying,80,2652 @node Overview,83,2705 -@node Sample,166,7272 -@node Invoking gzip,Invoking gzip210,8828 -@node Advanced usage,Advanced usage357,13496 -@node Environment,420,15208 -@node Tapes,437,15769 -@node Problems,460,16768 -@node Concept Index,Concept Index473,17288 +@node Sample,166,7273 +@node Invoking gzip,Invoking gzip210,8829 +@node Advanced usage,Advanced usage357,13497 +@node Environment,420,15209 +@node Tapes,437,15770 +@node Problems,460,16769 +@node Concept Index,Concept Index473,17289 tex-src/texinfo.tex,30627 \def\texinfoversion{\texinfoversion26,1035 diff --git a/test/manual/etags/ETAGS.good_6 b/test/manual/etags/ETAGS.good_6 index 0a31ed078e..86df93afab 100644 --- a/test/manual/etags/ETAGS.good_6 +++ b/test/manual/etags/ETAGS.good_6 @@ -4297,13 +4297,13 @@ tex-src/gzip.texi,303 @node Top,62,2139 @node Copying,80,2652 @node Overview,83,2705 -@node Sample,166,7272 -@node Invoking gzip,Invoking gzip210,8828 -@node Advanced usage,Advanced usage357,13496 -@node Environment,420,15208 -@node Tapes,437,15769 -@node Problems,460,16768 -@node Concept Index,Concept Index473,17288 +@node Sample,166,7273 +@node Invoking gzip,Invoking gzip210,8829 +@node Advanced usage,Advanced usage357,13497 +@node Environment,420,15209 +@node Tapes,437,15770 +@node Problems,460,16769 +@node Concept Index,Concept Index473,17289 tex-src/texinfo.tex,30627 \def\texinfoversion{\texinfoversion26,1035 commit d875a22bc6bebb1e45dd39c451fef4e264fca4e3 Author: Eli Zaretskii Date: Sat Nov 14 15:55:35 2020 +0200 Update the various INSTALL files * nt/INSTALL.W64: * nt/INSTALL: * INSTALL: Update the installation information, in particular the fact that HarfBuzz is now preferred as the shaping library. diff --git a/INSTALL b/INSTALL index 4d65f302aa..cb1fe8d3c2 100644 --- a/INSTALL +++ b/INSTALL @@ -117,19 +117,25 @@ ADDITIONAL DISTRIBUTION FILES * Complex Text Layout support libraries -On GNU and Unix systems, Emacs needs the optional libraries "m17n-db", -"libm17n-flt", "libotf" to correctly display such complex scripts as -Indic and Khmer, and also for scripts that require Arabic shaping -support (Arabic and Farsi). On some systems, particularly GNU/Linux, -these libraries may be already present or available as additional -packages. Note that if there is a separate 'dev' or 'devel' package, -for use at compilation time rather than run time, you will need that -as well as the corresponding run time package; typically the dev -package will contain header files and a library archive. Otherwise, -you can download the libraries from . +On GNU and Unix systems, Emacs needs optional libraries to correctly +display such complex scripts as Indic and Khmer, and also for scripts +that require Arabic shaping support (Arabic and Farsi). If the +HarfBuzz library is installed, Emacs will build with it and use it for +this purpose. HarfBuzz is the preferred shaping engine, both on Posix +hosts and on MS-Windows, so we recommend installing it before building +Emacs. The alternative for GNU/Linux and Posix systems is to use the +"m17n-db", "libm17n-flt", and "libotf" libraries. (On some systems, +particularly GNU/Linux, these libraries may be already present or +available as additional packages.) Note that if there is a separate +'dev' or 'devel' package, for use at compilation time rather than run +time, you will need that as well as the corresponding run time +package; typically the dev package will contain header files and a +library archive. On MS-Windows, if HarfBuzz is not available, Emacs +will use the Uniscribe shaping engine that is part of the OS. Note that Emacs cannot support complex scripts on a TTY, unless the -terminal includes such a support. +terminal includes such a support. However, most modern terminal +emulators, such as xterm, do support such scripts. * intlfonts-VERSION.tar.gz @@ -234,10 +240,10 @@ directory. On Red Hat-based systems, the corresponding command is config-manager --set-enabled fedora-debuginfo updates-debuginfo'). Once you have installed the source package, for example at -/path/to/emacs-26.1, add the following line to your startup file: +/path/to/emacs-27.1, add the following line to your startup file: (setq find-function-C-source-directory - "/path/to/emacs-26.1/src") + "/path/to/emacs-27.1/src") The installation directory of the Emacs source package will contain the exact package name and version number Emacs is installed on your @@ -249,7 +255,7 @@ Emacs debugging symbols are distributed by a debug package. It does not exist for every released Emacs package, this depends on the distribution. On Debian-based systems, you can install a debug package of Emacs with a command like 'apt-get install emacs-dbg' (on -older systems, replace 'emacs' with eg 'emacs25'). On Red Hat-based +older systems, replace 'emacs' with eg 'emacs27'). On Red Hat-based systems, the corresponding command is 'dnf debuginfo-install emacs'. diff --git a/nt/INSTALL b/nt/INSTALL index 2fe2c8c267..27fb5f096f 100644 --- a/nt/INSTALL +++ b/nt/INSTALL @@ -502,11 +502,21 @@ build will run on Windows 9X and newer systems). Does Emacs use -lgnutls? yes Does Emacs use -lxml2? yes Does Emacs use -lfreetype? no + Does Emacs use HarfBuzz? yes Does Emacs use -lm17n-flt? no Does Emacs use -lotf? no Does Emacs use -lxft? no + Does Emacs use -lsystemd? no + Does Emacs use -ljansson? yes + Does Emacs use the GMP library? yes Does Emacs directly use zlib? yes + Does Emacs have dynamic modules support? yes Does Emacs use toolkit scroll bars? yes + Does Emacs support Xwidgets? no + Does Emacs have threading support in lisp? yes + Does Emacs support the portable dumper? yes + Does Emacs support the legacy unexec dumping? no + Which dumping strategy does Emacs use? pdumper You are almost there, hang on. @@ -815,6 +825,14 @@ build will run on Windows 9X and newer systems). the libjansson DLL (for 32-bit builds of Emacs) are available from the ezwinports site and from the MSYS2 project. +* Optional support for HarfBuzzz shaping library + + Emacs supports display of complex scripts and Arabic shaping. The + preferred library for that is HarfBuzz; prebuilt binaries are + available from the ezwinports site (for 32-bit builds of Emacs) and + from the MSYS2 project. If HarfBuzz is not available, Emacs will + use the Uniscribe shaping engine that is part of MS-Windows. + This file is part of GNU Emacs. diff --git a/nt/INSTALL.W64 b/nt/INSTALL.W64 index c3d4dfa4c2..498fc38f61 100644 --- a/nt/INSTALL.W64 +++ b/nt/INSTALL.W64 @@ -55,14 +55,16 @@ packages (you can copy and paste it into the shell with Shift + Insert): mingw-w64-x86_64-jansson \ mingw-w64-x86_64-libxml2 \ mingw-w64-x86_64-gnutls \ - mingw-w64-x86_64-zlib + mingw-w64-x86_64-zlib \ + mingw-w64-x86_64-harfbuzz The packages include the base developer tools (autoconf, grep, make, etc.), the compiler toolchain (gcc, gdb, etc.), several image libraries, an XML -library, the GnuTLS (transport layer security) library, and zlib for -decompressing text. Only the first three packages are required (base-devel, -toolchain, xpm-nox); the rest are optional. You can select only part of the -libraries if you don't need them all. +library, the GnuTLS (transport layer security) library, zlib for +decompressing text, and HarfBuzz for use as the shaping engine. Only the +first three packages are required (base-devel, toolchain, xpm-nox); the +rest are optional. You can select only part of the libraries if you don't +need them all. You now have a complete build environment for Emacs. commit e2c7b6372d220d09f5d1bf80aa353979a546c57c Author: Eli Zaretskii Date: Sat Nov 7 12:29:41 2020 +0200 Don't leave lock files after 'replace-buffer-contents' * src/editfns.c (Freplace_buffer_contents): Unlock the buffer's file if no changes have been made. (Bug#44303) (cherry picked from commit a5867ddfbd721568005175bf6c725f7834b21ea4) diff --git a/src/editfns.c b/src/editfns.c index f660513b2a..fb420dac7f 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2145,6 +2145,13 @@ nil. */) { signal_after_change (BEGV, size_a, ZV - BEGV); update_compositions (BEGV, ZV, CHECK_INSIDE); + /* We've locked the buffer's file above in + prepare_to_modify_buffer; if the buffer is unchanged at this + point, i.e. no insertions or deletions have been made, unlock + the file now. */ + if (SAVE_MODIFF == MODIFF + && STRINGP (BVAR (a, file_truename))) + unlock_file (BVAR (a, file_truename)); } return Qt; commit 19da602991538e03648a82214cbb1bcc9a6ec14a Author: Eli Zaretskii Date: Sat Nov 14 15:20:30 2020 +0200 Fix input method translation near read-only text * lisp/international/quail.el (quail-input-method): Don't disable input method when the character after point has the read-only property. Suggested by Evgeny Zajcev (Bug#44466) * doc/emacs/mule.texi (Input Methods): Document that input methods are inhibited in read-only text. diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index 0f07d286cd..3421ce6690 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi @@ -563,6 +563,12 @@ method's keys by defining key bindings in the keymap returned by the function @code{quail-translation-keymap}, using @code{define-key}. @xref{Init Rebinding}. + Input methods are inhibited when the text in the buffer is read-only +for some reason. This is so single-character key bindings work in +modes that make buffer text or parts of it read-only, such as +@code{read-only-mode} and @code{image-mode}, even when an input method +is active. + Another facility for typing characters not on your keyboard is by using @kbd{C-x 8 @key{RET}} (@code{insert-char}) to insert a single character based on its Unicode name or code-point; see @ref{Inserting diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 3299cc55a2..63371bce4f 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -1330,7 +1330,8 @@ If STR has `advice' text property, append the following special event: (defun quail-input-method (key) (if (or (and (or buffer-read-only - (get-char-property (point) 'read-only)) + (and (get-char-property (point) 'read-only) + (get-char-property (point) 'front-sticky))) (not (or inhibit-read-only (get-char-property (point) 'inhibit-read-only)))) (and overriding-terminal-local-map commit ca023e69e2d9ea79814a6c5f92c6e31c8f1efa70 Author: Eli Zaretskii Date: Sat Nov 14 15:02:13 2020 +0200 Make Calc windows dedicated by default * lisp/calc/calc.el (calc-make-windows-dedicated): New defcustom. (calc, calc-trail-display): Set Calc windows dedicated if calc-make-windows-dedicated is non-nil. Patch by Boruch Baum . (Bug#44108) * etc/NEWS (Calc): Announce the new behavior. diff --git a/etc/NEWS b/etc/NEWS index f21c4cb02c..0f7b64ddd1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1250,6 +1250,11 @@ and the result is not truncated in any way. *** The '/' operator now has higher precedence in (La)TeX input mode. It no longer has lower precedence than '+' and '-'. +--- +*** Calc now marks its windows dedicated. +The new user option 'calc-make-windows-dedicated' controls this. It +is t by default; set to nil to get back the old behavior. + ** term-mode --- diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index bde7bd4e2b..5716189b34 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -1435,6 +1435,12 @@ commands given here will actually operate on the *Calculator* stack." (require 'calc-ext) (calc-set-language calc-language calc-language-option t))) +(defcustom calc-make-windows-dedicated t + "If non-nil, windows displaying Calc buffers will be marked dedicated. +See `window-dedicated-p' for what that means." + :version "28.1" + :type 'boolean) + ;;;###autoload (defun calc (&optional arg full-display interactive) "The Emacs Calculator. Full documentation is listed under `calc-mode'." @@ -1480,6 +1486,8 @@ commands given here will actually operate on the *Calculator* stack." (and (windowp full-display) (window-point full-display) (select-window full-display)) + (and calc-make-windows-dedicated + (set-window-dedicated-p nil t)) (calc-check-defines) (when (and calc-said-hello interactive) (sit-for 2) @@ -2140,7 +2148,9 @@ the United States." (if calc-trail-window-hook (run-hooks 'calc-trail-window-hook) (let ((w (split-window nil (/ (* (window-width) 2) 3) t))) - (set-window-buffer w calc-trail-buffer))) + (set-window-buffer w calc-trail-buffer) + (and calc-make-windows-dedicated + (set-window-dedicated-p nil t)))) (calc-wrapper (setq overlay-arrow-string calc-trail-overlay overlay-arrow-position calc-trail-pointer) commit 29a59aad1c0a48a47bc340d75d82fcf118a7793f Author: Eli Zaretskii Date: Sat Nov 14 14:43:42 2020 +0200 Make 'prefer-utf-8' heed inhibit-*-detection variables * lisp/international/mule-conf.el (prefer-utf-8): Inhibit detection of null bytes and ISO escape sequences if the respective inhibit-*-detection variables say so. (Bug#44486) diff --git a/lisp/international/mule-conf.el b/lisp/international/mule-conf.el index 42dd19842c..99449ad359 100644 --- a/lisp/international/mule-conf.el +++ b/lisp/international/mule-conf.el @@ -1251,7 +1251,9 @@ by UTF-8." :coding-type 'undecided :mnemonic ?- :charset-list '(emacs) - :prefer-utf-8 t) + :prefer-utf-8 t + :inhibit-null-byte-detection 0 + :inhibit-iso-escape-detection 0) (define-coding-system 'raw-text "Raw text, which means text contains random 8-bit codes. commit 206445a703d38102cf6f5ac44590e720f0dfe808 Merge: e53d9e5cdb b13e87c35b Author: Eli Zaretskii Date: Sat Nov 14 14:36:34 2020 +0200 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs commit e53d9e5cdbd043575ffa5990c7f465fbea255b4e Author: Jared Finder Date: Thu Nov 5 21:15:08 2020 -0800 * lisp/faces.el (mode-line-highlight): Use :box only when supported. diff --git a/lisp/faces.el b/lisp/faces.el index 728f8b0fe6..7355e1dd0a 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -2578,7 +2578,7 @@ non-nil." :group 'basic-faces) (defface mode-line-highlight - '((((class color) (min-colors 88)) + '((((supports :box t) (class color) (min-colors 88)) :box (:line-width 2 :color "grey40" :style released-button)) (t :inherit highlight)) commit b13e87c35bb0215c211a456b8bc3184bf16eb5de Author: Philipp Stephani Date: Sat Nov 14 13:30:53 2020 +0100 Capitalize portable dump messages. We capitalize all other messages during the dump, so capitalize the "dump mode" and "dumping fingerprint" ones as well for consistency. * src/pdumper.c (Fdump_emacs_portable): Capitalize fingerprint message prefix. * lisp/loadup.el: Capitalize "dump mode" message. diff --git a/lisp/loadup.el b/lisp/loadup.el index 568b9fe40d..4b711eed06 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -57,7 +57,7 @@ ;; bidi.c needs for its job. (setq redisplay--inhibit-bidi t) -(message "dump mode: %s" dump-mode) +(message "Dump mode: %s" dump-mode) ;; Add subdirectories to the load-path for files that might get ;; autoloaded when bootstrapping or running Emacs normally. diff --git a/src/pdumper.c b/src/pdumper.c index 909900417d..b5b4050b93 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -4024,7 +4024,7 @@ types. */) ctx->header.fingerprint[i] = fingerprint[i]; const dump_off header_start = ctx->offset; - dump_fingerprint ("dumping fingerprint", ctx->header.fingerprint); + dump_fingerprint ("Dumping fingerprint", ctx->header.fingerprint); dump_write (ctx, &ctx->header, sizeof (ctx->header)); const dump_off header_end = ctx->offset; commit 91d5edd9d10db30418cb32f5734d496d76ef56f3 Author: Jared Finder Date: Sat Oct 31 21:25:47 2020 -0800 Face-changing text properties and help-echo now work with xterm-mouse. * src/dispnew.c (update_mouse_position): New function for mouse movement logic in 'handle_one_term_event' that can be shared across different mouse backends. (display--update-for-mouse-movement): New lisp function, call it. * lisp/xt-mouse.el (xterm-mouse--handle-mouse-movement): New function that calls 'display--update-for-mouse-movement'. (xterm-mouse-translate-1): Call it. * src/term.c (handle_one_term_event): Inline logic from 'term_mouse_movement' and call 'update_mouse_position'. (term_mouse_movement): Delete. diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index f9c08f9a17..9301476e81 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -77,6 +77,7 @@ https://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." (copy-sequence event)) vec) (is-move + (xterm-mouse--handle-mouse-movement) (if track-mouse vec ;; Mouse movement events are currently supposed to be ;; suppressed. Return no event. @@ -106,8 +107,14 @@ https://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." (if (null track-mouse) (vector drag) (push drag unread-command-events) + (xterm-mouse--handle-mouse-movement) (vector (list 'mouse-movement ev-data)))))))))))) +(defun xterm-mouse--handle-mouse-movement () + "Handle mouse motion that was just generated for XTerm mouse." + (display--update-for-mouse-movement (terminal-parameter nil 'xterm-mouse-x) + (terminal-parameter nil 'xterm-mouse-y))) + ;; These two variables have been converted to terminal parameters. ;; ;;(defvar xterm-mouse-x 0 diff --git a/src/dispextern.h b/src/dispextern.h index 848d3bcd20..da51772b37 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3606,6 +3606,7 @@ extern Lisp_Object marginal_area_string (struct window *, enum window_part, extern void redraw_frame (struct frame *); extern bool update_frame (struct frame *, bool, bool); extern void update_frame_with_menu (struct frame *, int, int); +extern int update_mouse_position (struct frame *, int, int); extern void bitch_at_user (void); extern void adjust_frame_glyphs (struct frame *); void free_glyphs (struct frame *); diff --git a/src/dispnew.c b/src/dispnew.c index 48a36f2006..479fccb45e 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -3323,6 +3323,53 @@ update_frame_with_menu (struct frame *f, int row, int col) display_completed = !paused_p; } +/* Update the mouse position for a frame F. This handles both + updating the display for mouse-face propreties and updating the + help echo text. + + Returns the number of events generated. */ +int +update_mouse_position (struct frame *f, int x, int y) +{ + previous_help_echo_string = help_echo_string; + help_echo_string = Qnil; + + note_mouse_highlight (f, x, y); + + /* If the contents of the global variable help_echo_string + has changed, generate a HELP_EVENT. */ + if (!NILP (help_echo_string) + || !NILP (previous_help_echo_string)) + { + Lisp_Object frame; + XSETFRAME (frame, f); + + gen_help_event (help_echo_string, frame, help_echo_window, + help_echo_object, help_echo_pos); + return 1; + } + + return 0; +} + +DEFUN ("display--update-for-mouse-movement", Fdisplay__update_for_mouse_movement, + Sdisplay__update_for_mouse_movement, 2, 2, 0, + doc: /* Handle mouse movement detected by Lisp code. + +This function should be called when Lisp code detects the mouse has +moved, even if `track-mouse' is nil. This handles updates that do not +rely on input events such as updating display for mouse-face +properties or updating the help echo text. */) + (Lisp_Object mouse_x, Lisp_Object mouse_y) +{ + CHECK_FIXNUM (mouse_x); + CHECK_FIXNUM (mouse_y); + + update_mouse_position (SELECTED_FRAME (), XFIXNUM (mouse_x), + XFIXNUM (mouse_y)); + return Qnil; +} + /************************************************************************ Window-based updates @@ -6494,6 +6541,7 @@ syms_of_display (void) { defsubr (&Sredraw_frame); defsubr (&Sredraw_display); + defsubr (&Sdisplay__update_for_mouse_movement); defsubr (&Sframe_or_buffer_changed_p); defsubr (&Sopen_termscript); defsubr (&Sding); diff --git a/src/term.c b/src/term.c index 3a13da165e..a0738594bf 100644 --- a/src/term.c +++ b/src/term.c @@ -2430,22 +2430,6 @@ tty_draw_row_with_mouse_face (struct window *w, struct glyph_row *row, cursor_to (f, save_y, save_x); } -static bool -term_mouse_movement (struct frame *frame, Gpm_Event *event) -{ - /* Has the mouse moved off the glyph it was on at the last sighting? */ - if (event->x != last_mouse_x || event->y != last_mouse_y) - { - frame->mouse_moved = 1; - note_mouse_highlight (frame, event->x, event->y); - /* Remember which glyph we're now on. */ - last_mouse_x = event->x; - last_mouse_y = event->y; - return 1; - } - return 0; -} - /* Return the current time, as a Time value. Wrap around on overflow. */ static Time current_Time (void) @@ -2562,30 +2546,22 @@ handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event) if (event->type & (GPM_MOVE | GPM_DRAG)) { - previous_help_echo_string = help_echo_string; - help_echo_string = Qnil; - Gpm_DrawPointer (event->x, event->y, fileno (tty->output)); - if (!term_mouse_movement (f, event)) - help_echo_string = previous_help_echo_string; - - /* If the contents of the global variable help_echo_string - has changed, generate a HELP_EVENT. */ - if (!NILP (help_echo_string) - || !NILP (previous_help_echo_string)) - { - Lisp_Object frame; - - if (f) - XSETFRAME (frame, f); - else - frame = Qnil; - - gen_help_event (help_echo_string, frame, help_echo_window, - help_echo_object, help_echo_pos); - count++; - } + /* Has the mouse moved off the glyph it was on at the last + sighting? */ + if (event->x != last_mouse_x || event->y != last_mouse_y) + { + /* FIXME: These three lines can not be moved into + update_mouse_position unless xterm-mouse gets updated to + generate mouse events via C code. See + https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg00163.html */ + last_mouse_x = event->x; + last_mouse_y = event->y; + f->mouse_moved = 1; + + count += update_mouse_position (f, event->x, event->y); + } } else { commit 5aabf2cc7f90a168fda694c6c5360f1df398255c Author: Eli Zaretskii Date: Sat Nov 14 13:56:12 2020 +0200 Fix display of truncated R2L lines on TTY frames * src/xdisp.c (extend_face_to_end_of_line): Use a while-loop, not a do-while loop, to avoid appending an extra glyph at the end of a line that is one character shorter than the window-width. This is needed to fix display of reversed glyph rows that are almost as wide as the window, because append_space_for_newline already added one space glyph. diff --git a/src/xdisp.c b/src/xdisp.c index 681df09341..c9175a68a0 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -22082,7 +22082,7 @@ extend_face_to_end_of_line (struct it *it) updating current_x. */ it->current_x = it->glyph_row->used[TEXT_AREA]; - do + while (it->current_x <= it->last_visible_x) { if (it->current_x != indicator_column) PRODUCE_GLYPHS (it); @@ -22100,7 +22100,6 @@ extend_face_to_end_of_line (struct it *it) it->c = it->char_to_display = ' '; } } - while (it->current_x <= it->last_visible_x); if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0 && (it->glyph_row->used[RIGHT_MARGIN_AREA] commit daff3bda10d15fe20f5f6e9c5f5ca60b97cf80df Author: Eli Zaretskii Date: Sat Nov 14 13:43:16 2020 +0200 Avoid crashes when a reversed glyph row starts with a composition * src/dispnew.c (build_frame_matrix_from_leaf_window): Add an assertion to prevent us from overwriting non-char glyphs with the vertical border glyph. * src/xdisp.c (extend_face_to_end_of_line): Account for one glyph possibly inserted by append_space_for_newline. (Bug#44506) Remove a kludgey correction for an off-by-one error in column counting, which is no longer needed. diff --git a/src/dispnew.c b/src/dispnew.c index df55b32c71..7822829d64 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -2559,11 +2559,15 @@ build_frame_matrix_from_leaf_window (struct glyph_matrix *frame_matrix, struct w the corresponding frame row to be updated. */ frame_row->enabled_p = true; - /* Maybe insert a vertical border between horizontally adjacent + /* Maybe insert a vertical border between horizontally adjacent windows. */ - if (GLYPH_CHAR (right_border_glyph) != 0) + if (GLYPH_CHAR (right_border_glyph) != 0) { - struct glyph *border = window_row->glyphs[LAST_AREA] - 1; + struct glyph *border = window_row->glyphs[LAST_AREA] - 1; + /* It's a subtle bug if we are overwriting some non-char + glyph with the vertical border glyph. */ + eassert (border->type == CHAR_GLYPH); + border->type = CHAR_GLYPH; SET_CHAR_GLYPH_FROM_GLYPH (*border, right_border_glyph); } diff --git a/src/xdisp.c b/src/xdisp.c index 71a5f1c34f..681df09341 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -22074,13 +22074,14 @@ extend_face_to_end_of_line (struct it *it) default_face->id : face->id); /* Display fill-column indicator if needed. */ - /* We need to subtract 1 to the indicator_column here because we - will add the indicator IN the column indicator number, not - after it. We compare the variable it->current_x before - producing the glyph. When FRAME_WINDOW_P we subtract - CHAR_WIDTH calculating STRETCH_WIDTH for the same reason. */ - const int indicator_column = - fill_column_indicator_column (it, 1) - 1; + const int indicator_column = fill_column_indicator_column (it, 1); + + /* Make sure our idea of current_x is in sync with the glyphs + actually in the glyph row. They might differ because + append_space_for_newline can insert one glyph without + updating current_x. */ + it->current_x = it->glyph_row->used[TEXT_AREA]; + do { if (it->current_x != indicator_column) commit 31f94e4b1c3dc201646ec436d3e2c477f784ed21 Author: Eric Abrahamsen Date: Wed Nov 11 10:48:37 2020 -0800 Save instantiated gnus-search engines in an alist So we aren't re-instantiating (and potentially configuring) them with every search. * lisp/gnus/gnus-search.el (gnus-search-engine-instance-alist): New variable holding server->engine mapping. (gnus-search-server-to-engine): See if we've already instantiated this server. If so, return it. If not, instantiate it and save in the above variable. (gnus-search-shutdown): Shutdown function clearing the above alist. diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 71854a7a3e..17f1108029 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -90,9 +90,19 @@ ;;; Internal Variables: +;; When Gnus servers are implemented as objects or structs, give them +;; a `search-engine' slot and get rid of this variable. +(defvar gnus-search-engine-instance-alist nil + "Mapping between servers and instantiated search engines.") + (defvar gnus-search-history () "Internal history of Gnus searches.") +(defun gnus-search-shutdown () + (setq gnus-search-engine-instance-alist nil)) + +(gnus-add-shutdown #'gnus-search-shutdown 'gnus) + (define-error 'gnus-search-parse-error "Gnus search parsing error") ;;; User Customizable Variables: @@ -1964,7 +1974,9 @@ remaining string, then adds all that to the top-level spec." (defun gnus-search-server-to-engine (srv) (let* ((method (gnus-server-to-method srv)) (engine-config (assoc 'gnus-search-engine (cddr method))) - (server (or (nth 1 engine-config) + (server (or (cdr-safe + (assoc-string srv gnus-search-engine-instance-alist t)) + (nth 1 engine-config) (cdr-safe (assoc (car method) gnus-search-default-engines)) (when-let ((old (assoc 'nnir-search-engine (cddr method)))) @@ -1988,17 +2000,19 @@ remaining string, then adds all that to the top-level spec." (make-instance server)) (t nil))) (if inst - (when (cddr engine-config) - ;; We're not being completely backward-compatible here, - ;; because we're not checking for nnir-specific config - ;; options in the server definition. - (pcase-dolist (`(,key ,value) (cddr engine-config)) - (condition-case nil - (setf (slot-value inst key) value) - ((invalid-slot-name invalid-slot-type) - (nnheader-message - 5 "Invalid search engine parameter: (%s %s)" - key value))))) + (unless (assoc-string srv gnus-search-engine-instance-alist t) + (when (cddr engine-config) + ;; We're not being completely backward-compatible here, + ;; because we're not checking for nnir-specific config + ;; options in the server definition. + (pcase-dolist (`(,key ,value) (cddr engine-config)) + (condition-case nil + (setf (slot-value inst key) value) + ((invalid-slot-name invalid-slot-type) + (nnheader-message + 5 "Invalid search engine parameter: (%s %s)" + key value))))) + (push (cons srv inst) gnus-search-engine-instance-alist)) (error "No search engine defined for %s" srv)) inst)) @@ -2112,7 +2126,8 @@ article came from is also searched." ;; If the value contains spaces, make sure it's ;; quoted. (when (and (memql status '(exact finished)) - (string-match-p " " str)) + (or (string-match-p " " str) + in-string)) (unless (looking-at-p "\\s\"") (insert "\"")) ;; Unless we already have an opening quote... commit bb28f8b9d1ebb4a93c66beca466cb15563075e8c Author: Eric Abrahamsen Date: Thu Nov 12 20:02:09 2020 -0800 Make sure Gnus search groups search topics recursively * lisp/gnus/gnus-group.el (gnus-group-make-search-group, gnus-group-read-ephemeral-search-group): If a search is initiated from a topic line, make sure we get all the groups under that topic (and under sub-topics). diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index c8b97c0852..73fda66fb6 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -52,6 +52,8 @@ (autoload 'gnus-cloud-upload-all-data "gnus-cloud") (autoload 'gnus-cloud-download-all-data "gnus-cloud") +(autoload 'gnus-topic-find-groups "gnus-topic") + (defcustom gnus-no-groups-message "No news is good news" "Message displayed by Gnus when no groups are available." :group 'gnus-start @@ -3194,8 +3196,10 @@ non-nil SPECS arg must be an alist with `search-query-spec' and (or gnus-group-marked (if (gnus-group-group-name) (list (gnus-group-group-name)) - (cdr - (assoc (gnus-group-topic-name) gnus-topic-alist)))))))) + (mapcar #'caadr + (gnus-topic-find-groups + (gnus-group-topic-name) + nil 'all nil t)))))))) (query-spec (or (cdr (assq 'search-query-spec specs)) @@ -3243,8 +3247,10 @@ non-nil SPECS arg must be an alist with `search-query-spec' and (or gnus-group-marked (if (gnus-group-group-name) (list (gnus-group-group-name)) - (cdr - (assoc (gnus-group-topic-name) gnus-topic-alist)))))))) + (mapcar #'caadr + (gnus-topic-find-groups + (gnus-group-topic-name) + nil 'all nil t)))))))) (query-spec (or (cdr (assq 'search-query-spec specs)) (cdr (assq 'nnir-query-spec specs)) commit b697bb91a1334e70bd7c8364e5ff6505b0edb21a Author: Glenn Morris Date: Fri Nov 13 17:02:54 2020 -0800 ; * .gitignore: src/fingerprint.c not generated since 2019-04-09. diff --git a/.gitignore b/.gitignore index 014970f96b..1271dec0df 100644 --- a/.gitignore +++ b/.gitignore @@ -188,7 +188,6 @@ src/bootstrap-emacs src/emacs src/emacs-[0-9]* src/temacs -src/fingerprint.c src/dmpstruct.h src/*.pdmp commit 51c29b7b0d9db89555bd65173feed0f25a1cccef Author: Mattias Engdegård Date: Fri Nov 13 17:42:27 2020 +0100 Simplify quick-check composition regexps * lisp/international/ucs-normalize.el (quick-check-composition-list-to-regexp): Don't add an explicit pattern for U+1161..U+1175 and U+11a8..U+11c2 since these are already part of `combining-chars'. diff --git a/lisp/international/ucs-normalize.el b/lisp/international/ucs-normalize.el index 33d0f0dda2..7822450e49 100644 --- a/lisp/international/ucs-normalize.el +++ b/lisp/international/ucs-normalize.el @@ -441,7 +441,7 @@ decomposition." (concat (quick-check-list-to-regexp quick-check-list) "\\|[가-힣]")) (defun quick-check-composition-list-to-regexp (quick-check-list) - (concat (quick-check-list-to-regexp quick-check-list) "\\|[ᅡ-ᅵᆨ-ᇂ]")) + (quick-check-list-to-regexp quick-check-list)) ) commit a32fd9f64d06ccd07a9beaf6d6f1283f7a80edac Merge: 15035e7fc8 a3d316bbb7 Author: Glenn Morris Date: Fri Nov 13 09:00:26 2020 -0800 Merge from origin/emacs-27 a3d316bbb7 (origin/emacs-27) Update information about refcards f43e9ad524 Avoid crashes in the daemon due to user interaction commit 15035e7fc807cbc2693e3f7cdd818eb1aa282cd2 Merge: d4e436e080 658952a57a Author: Glenn Morris Date: Fri Nov 13 09:00:26 2020 -0800 ; Merge from origin/emacs-27 The following commit was skipped: 658952a57a Some minor changes to Tramp, do not merge with master commit d4e436e080e2157b7bc3353ca8d1cfcf1e17c79c Merge: 3d14ec52fb ac1a2b2160 Author: Glenn Morris Date: Fri Nov 13 09:00:26 2020 -0800 Merge from origin/emacs-27 ac1a2b2160 Add more doc-view requirements 109eb1e7e2 Fix undefined behavior when fetching glyphs from the displ... # Conflicts: # lisp/doc-view.el commit 3d14ec52fbdc7162df56bcab70d330e061f9ca51 Merge: e3e1cd733e 78e1646bf7 Author: Glenn Morris Date: Fri Nov 13 08:58:06 2020 -0800 ; Merge from origin/emacs-27 The following commit was skipped: 78e1646bf7 Fix pcase rx form snag with '?' and '??' (bug#44532) commit e3e1cd733efe919d20d4273250372f0dd74c9a10 Merge: 7970610d48 75384bd155 Author: Glenn Morris Date: Fri Nov 13 08:58:06 2020 -0800 Merge from origin/emacs-27 75384bd155 Update the doc-view header line 13ab70c80e Avoid breaking Arabic shaping in 'window-text-pixel-size' e693d97e50 doc-view.el comment clarification 968e85a2ce Update erc documentation about C-c C-b commit 7970610d48701a949ce443c94c71eac47d044197 Author: Alan Third Date: Tue Nov 10 12:54:50 2020 +0000 Fix error with fn key in NS port (bug#44533) * src/nsterm.m ([EmacsView keyDown:]): Move the correction for fn key handling to before the modifiers are calculated. diff --git a/src/nsterm.m b/src/nsterm.m index 4fad521b74..a9280eb4af 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -6531,6 +6531,14 @@ flag set (this is probably a bug in the OS). */ code = 0xFF08; /* backspace */ else code = fnKeysym; + + /* Function keys (such as the F-keys, arrow keys, etc.) set + modifiers as though the fn key has been pressed when it + hasn't. Also some combinations of fn and a function key + return a different key than was pressed (e.g. fn- + gives ). We need to unset the fn key flag in these + cases. */ + flags &= ~NS_FUNCTION_KEY_MASK; } /* The ⌘ and ⌥ modifiers can be either shift-like (for alternate @@ -6552,17 +6560,6 @@ In that case we use UCKeyTranslate (ns_get_shifted_character) Lisp_Object kind = fnKeysym ? QCfunction : QCordinary; emacs_event->modifiers = EV_MODIFIERS2 (flags, kind); - /* Function keys (such as the F-keys, arrow keys, etc.) set - modifiers as though the fn key has been pressed when it - hasn't. Also some combinations of fn and a function key - return a different key than was pressed (e.g. fn- gives - ). We need to unset the fn modifier in these cases. - FIXME: Can we avoid setting it in the first place? */ - if (fnKeysym && (flags & NS_FUNCTION_KEY_MASK)) - emacs_event->modifiers - ^= parse_solitary_modifier (mod_of_kind (ns_function_modifier, - QCfunction)); - if (NS_KEYLOG) fprintf (stderr, "keyDown: code =%x\tfnKey =%x\tflags = %x\tmods = %x\n", code, fnKeysym, flags, emacs_event->modifiers); commit 297f89f7e4becd64c1732af6db8ba925186d1d45 Author: Michael Albinus Date: Fri Nov 13 16:55:08 2020 +0100 Some minor Tramp fixes, resulting from test campaign * lisp/net/tramp.el (tramp-handle-write-region): * lisp/net/tramp-adb.el (tramp-adb-handle-write-region): * lisp/net/tramp-sh.el (tramp-sh-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-write-region): Use `current-time' if needed. * lisp/net/tramp-gvfs.el (tramp-gvfs-gio-mapping): (tramp-gvfs-do-copy-or-rename-file): Remove "gvfs-rename", it is not trustworthy. * test/lisp/net/tramp-tests.el (tramp-test07-file-exists-p): Check also for symlinked files in trash. (tramp-test20-file-modes): Revert last change, it was a thinko. diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index be83f670f7..7cdb7ebf53 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -575,8 +575,9 @@ But handle the case, if the \"test\" command is not available." ;; Set file modification time. (when (or (eq visit t) (stringp visit)) (set-visited-file-modtime - (tramp-compat-file-attribute-modification-time - (file-attributes filename)))) + (or (tramp-compat-file-attribute-modification-time + (file-attributes filename)) + (current-time)))) ;; The end. (when (and (null noninteractive) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 86fb45a43b..098fba56b5 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -689,7 +689,6 @@ It has been changed in GVFS 1.14.") ("gvfs-monitor-file" . "monitor") ("gvfs-mount" . "mount") ("gvfs-move" . "move") - ("gvfs-rename" . "rename") ("gvfs-rm" . "remove") ("gvfs-set-attribute" . "set")) "List of cons cells, mapping \"gvfs-\" to \"gio \".") @@ -985,15 +984,12 @@ file names." (copy-directory filename newname keep-date t) (when (eq op 'rename) (delete-directory filename 'recursive))) - (let* ((t1 (tramp-tramp-file-p filename)) - (t2 (tramp-tramp-file-p newname)) - (equal-remote (tramp-equal-remote filename newname)) - (gvfs-operation - (cond - ((eq op 'copy) "gvfs-copy") - (equal-remote "gvfs-rename") - (t "gvfs-move"))) - (msg-operation (if (eq op 'copy) "Copying" "Renaming"))) + (let ((t1 (tramp-tramp-file-p filename)) + (t2 (tramp-tramp-file-p newname)) + (equal-remote (tramp-equal-remote filename newname)) + ;; "gvfs-rename" is not trustworthy. + (gvfs-operation (if (eq op 'copy) "gvfs-copy" "gvfs-move")) + (msg-operation (if (eq op 'copy) "Copying" "Renaming"))) (with-parsed-tramp-file-name (if t1 filename newname) nil (unless (file-exists-p filename) @@ -2439,7 +2435,10 @@ This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi." (when tramp-gvfs-enabled ;; Suppress D-Bus error messages and Tramp traces. - (let ((tramp-verbose 0) + (let (;; Sometimes, it fails with "Variable binding depth exceeds + ;; max-specpdl-size". Shall be fixed in Emacs 27. + (max-specpdl-size (* 2 max-specpdl-size)) + (tramp-verbose 0) tramp-gvfs-dbus-event-vector fun) ;; Add completion functions for services announced by DNS-SD. ;; See for valid service types. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 51e15af2ef..ccf0c0d0e2 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3530,7 +3530,8 @@ implementation will be used." ;; We must pass modtime explicitly, because FILENAME can ;; be different from (buffer-file-name), f.e. if ;; `file-precious-flag' is set. - (tramp-compat-file-attribute-modification-time file-attr)) + (or (tramp-compat-file-attribute-modification-time file-attr) + (current-time))) (when (and (= (tramp-compat-file-attribute-user-id file-attr) uid) (= (tramp-compat-file-attribute-group-id file-attr) gid)) (setq need-chown nil)))) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 0dd233aff0..8a48ffc09b 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -1630,8 +1630,9 @@ errors for shares like \"C$/\", which are common in Microsoft Windows." ;; Set file modification time. (when (or (eq visit t) (stringp visit)) (set-visited-file-modtime - (tramp-compat-file-attribute-modification-time - (file-attributes filename)))) + (or (tramp-compat-file-attribute-modification-time + (file-attributes filename)) + (current-time)))) ;; The end. (when (and (null noninteractive) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 55f652fa9a..a98d478bc1 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4181,8 +4181,9 @@ of." ;; Set file modification time. (when (or (eq visit t) (stringp visit)) (set-visited-file-modtime - (tramp-compat-file-attribute-modification-time - (file-attributes filename)))) + (or (tramp-compat-file-attribute-modification-time + (file-attributes filename)) + (current-time)))) ;; Set the ownership. (tramp-set-file-uid-gid filename uid gid)) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 7b83a8deeb..00d08ea6f6 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2281,9 +2281,13 @@ This checks also `file-name-as-directory', `file-name-directory', (delete-file tmp-name 'trash) (should-not (file-exists-p tmp-name)) (should - (file-exists-p - (expand-file-name - (file-name-nondirectory tmp-name) trash-directory))) + (or (file-exists-p + (expand-file-name + (file-name-nondirectory tmp-name) trash-directory)) + ;; Gdrive. + (file-symlink-p + (expand-file-name + (file-name-nondirectory tmp-name) trash-directory)))) (delete-directory trash-directory 'recursive) (should-not (file-exists-p trash-directory))))))) @@ -3473,7 +3477,10 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." (skip-unless (or (tramp--test-sh-p) (tramp--test-sudoedit-p) ;; Not all tramp-gvfs.el methods support changing the file mode. - (tramp--test-gvfs-p "afp") (tramp--test-gvfs-p "ftp"))) + (and + (tramp--test-gvfs-p) + (string-match-p + "ftp" (file-remote-p tramp-test-temporary-file-directory 'method))))) (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil))) (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) commit a3d316bbb7b432e21def2bdcee58bf36ca73bd75 Author: Eli Zaretskii Date: Fri Nov 13 09:10:01 2020 +0200 Update information about refcards * admin/release-process (refcards): * admin/make-tarball.txt (refcards): Update information about generating refcards and required TeX/LaTeX packages. diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 64c61705f4..2c81a49e09 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -87,10 +87,14 @@ General steps (for each step, check for possible errors): make -C etc/refcards make -C etc/refcards clean - If some of the non-English etc/refcards fail to build, you - probably need to install some TeX foreign language packages. - For more information, search for the string "refcard" in the file - admin/release-process. + If some of the etc/refcards, especially the non-English ones, fail + to build, you probably need to install some TeX/LaTeX packages, in + particular for foreign language support. For more information, + search for the string "refcard" in the file admin/release-process. + + (ru-refcard causes numerous "Underfull hbox" and "Overfull hbox" + messages from TeX, but those seem to be harmless, as the result + looks just fine.) 5. Copy lisp/loaddefs.el to lisp/ldefs-boot.el. diff --git a/admin/release-process b/admin/release-process index a1f42f0507..74e401b9cd 100644 --- a/admin/release-process +++ b/admin/release-process @@ -179,8 +179,9 @@ What paper size are the English versions supposed to be on? On Debian testing, the packages texlive-lang-czechslovak and texlive-lang-polish will let you generate the cs-* and sk-* pdfs. (You may need texlive-lang-cyrillic, texlive-lang-german, -and texlive-fonts-extra for others.) On Fedora-like systems, -texlive-lh may help. +and texlive-fonts-extra for others.) Gnus refcards need +texlive-latex-extra and/or texlive-latex-recommended. On Fedora-like +systems, texlive-lh may help. ** Ask maintainers of refcard translations to update them. commit 206dd9d5923d5db7b44a1bf67e6ec61c027ab1d2 Author: Stefan Kangas Date: Thu Nov 12 22:06:47 2020 +0100 Don't quote lambdas in several places * lisp/allout-widgets.el (allout-widgets-adjusting-message) (allout-widgets-exposure-change-processor) (allout-widgets-count-buttons-in-region): * lisp/ansi-color.el (ansi-color-make-color-map): * lisp/case-table.el (describe-buffer-case-table): * lisp/emacs-lisp/byte-opt.el (byte-decompile-bytecode-1): * lisp/gnus/gnus-agent.el (gnus-agent-regenerate-group): * lisp/gnus/nnir.el (nnir-run-swish++, nnir-run-swish-e) (nnir-run-hyrex, nnir-run-namazu): * lisp/hippie-exp.el (make-hippie-expand-function) (try-complete-lisp-symbol, try-complete-lisp-symbol-partially) (try-expand-all-abbrevs): * lisp/international/mule-cmds.el (sort-coding-systems) (select-safe-coding-system, select-message-coding-system) (read-language-name, encoded-string-description): * lisp/international/quail.el (quail-keyseq-translate) (quail-get-translations, quail-build-decode-map) (quail-insert-decode-map): * lisp/jka-compr.el (jka-compr-uninstall): * lisp/locate.el (locate-in-alternate-database): * lisp/mail/mailabbrev.el (mail-resolve-all-aliases-1) (mail-abbrev-make-syntax-table): * lisp/mh-e/mh-seq.el (mh-read-folder-sequences): * lisp/net/eudcb-ldap.el (eudc-ldap-simple-query-internal): * lisp/progmodes/make-mode.el (makefile-query-targets) (makefile-prompt-for-gmake-funargs): * lisp/shadowfile.el (shadow-cancel, shadow-shadows-of): * lisp/sort.el (sort-pages, sort-fields, sort-regexp-fields): * lisp/subr.el (listify-key-sequence): * lisp/term/wyse50.el (terminal-init-wyse50): * lisp/textmodes/ispell.el (ispell-help) (ispell-begin-tex-skip-regexp): * lisp/textmodes/page-ext.el (pages-sort-region): * lisp/textmodes/refer.el (refer-find-entry-in-file): * lisp/url/url-expand.el (url-expand-file-name): Don't quote lambdas. diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el index ac49d3bf06..7e7957762b 100644 --- a/lisp/allout-widgets.el +++ b/lisp/allout-widgets.el @@ -916,15 +916,15 @@ posting threshold criteria." (let ((min (point-max)) (max 0) first second) - (mapc (function (lambda (entry) - (if (eq :undone-exposure (car entry)) - nil - (setq first (cadr entry) - second (caddr entry)) - (if (< (min first second) min) - (setq min (min first second))) - (if (> (max first second) max) - (setq max (max first second)))))) + (mapc (lambda (entry) + (if (eq :undone-exposure (car entry)) + nil + (setq first (cadr entry) + second (caddr entry)) + (if (< (min first second) min) + (setq min (min first second))) + (if (> (max first second) max) + (setq max (max first second))))) allout-widgets-changes-record) (> (- max min) allout-widgets-adjust-message-size-threshold))) (let ((prior (current-message))) @@ -975,8 +975,8 @@ Records changes in `allout-widgets-changes-record'." Generally invoked via `allout-exposure-change-functions'." - (let ((changes (sort changes (function (lambda (this next) - (< (cadr this) (cadr next)))))) + (let ((changes (sort changes (lambda (this next) + (< (cadr this) (cadr next))))) ;; have to distinguish between concealing and exposing so that, eg, ;; `allout-expose-topic's mix is handled properly. handled-expose @@ -2301,9 +2301,9 @@ The elements of LIST are not copied, just the list structure itself." end (or end (point-max))) (if (> start end) (let ((interim start)) (setq start end end interim))) (let ((button-overlays (delq nil - (mapcar (function (lambda (o) - (if (overlay-get o 'button) - o))) + (mapcar (lambda (o) + (if (overlay-get o 'button) + o)) (overlays-in start end))))) (length button-overlays))) diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el index d20260b185..e9cdf03db0 100644 --- a/lisp/ansi-color.el +++ b/lisp/ansi-color.el @@ -572,27 +572,27 @@ The face definitions are based upon the variables (index 0)) ;; miscellaneous attributes (mapc - (function (lambda (e) - (aset map index e) - (setq index (1+ index)) )) + (lambda (e) + (aset map index e) + (setq index (1+ index)) ) ansi-color-faces-vector) ;; foreground attributes (setq index 30) (mapc - (function (lambda (e) - (aset map index - (ansi-color-make-face 'foreground - (if (consp e) (car e) e))) - (setq index (1+ index)) )) + (lambda (e) + (aset map index + (ansi-color-make-face 'foreground + (if (consp e) (car e) e))) + (setq index (1+ index)) ) ansi-color-names-vector) ;; background attributes (setq index 40) (mapc - (function (lambda (e) - (aset map index - (ansi-color-make-face 'background - (if (consp e) (cdr e) e))) - (setq index (1+ index)) )) + (lambda (e) + (aset map index + (ansi-color-make-face 'background + (if (consp e) (cdr e) e))) + (setq index (1+ index)) ) ansi-color-names-vector) map)) diff --git a/lisp/case-table.el b/lisp/case-table.el index 7379f37961..bdfe5c2b4d 100644 --- a/lisp/case-table.el +++ b/lisp/case-table.el @@ -38,26 +38,26 @@ (interactive) (let ((description (make-char-table 'case-table))) (map-char-table - (function (lambda (key value) - (if (not (natnump value)) - (if (consp key) - (set-char-table-range description key "case-invariant") - (aset description key "case-invariant")) - (let (from to) - (if (consp key) - (setq from (car key) to (cdr key)) - (setq from (setq to key))) - (while (<= from to) - (aset - description from - (cond ((/= from (downcase from)) - (concat "uppercase, matches " - (char-to-string (downcase from)))) - ((/= from (upcase from)) - (concat "lowercase, matches " - (char-to-string (upcase from)))) - (t "case-invariant"))) - (setq from (1+ from))))))) + (lambda (key value) + (if (not (natnump value)) + (if (consp key) + (set-char-table-range description key "case-invariant") + (aset description key "case-invariant")) + (let (from to) + (if (consp key) + (setq from (car key) to (cdr key)) + (setq from (setq to key))) + (while (<= from to) + (aset + description from + (cond ((/= from (downcase from)) + (concat "uppercase, matches " + (char-to-string (downcase from)))) + ((/= from (upcase from)) + (concat "lowercase, matches " + (char-to-string (upcase from)))) + (t "case-invariant"))) + (setq from (1+ from)))))) (current-case-table)) (save-excursion (with-output-to-temp-buffer "*Help*" diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 530a086b14..469bbe6c7c 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1459,10 +1459,10 @@ (setq rest (cdr rest)))) (if tags (error "optimizer error: missed tags %s" tags)) ;; Remove addrs, lap = ( [ (op . arg) | (TAG tagno) ]* ) - (mapcar (function (lambda (elt) - (if (numberp elt) - elt - (cdr elt)))) + (mapcar (lambda (elt) + (if (numberp elt) + elt + (cdr elt))) (nreverse lap)))) diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index 6a7e81b3e9..76c2904eaf 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el @@ -4033,11 +4033,11 @@ If REREAD is not nil, downloaded articles are marked as unread." (list (list (if (listp reread) reread - (delq nil (mapcar (function (lambda (c) - (cond ((eq reread t) - (car c)) - ((cdr c) - (car c))))) + (delq nil (mapcar (lambda (c) + (cond ((eq reread t) + (car c)) + ((cdr c) + (car c)))) gnus-agent-article-alist))) 'del '(read))) gnus-command-method) diff --git a/lisp/hippie-exp.el b/lisp/hippie-exp.el index ce5fc585c8..b521ddaa55 100644 --- a/lisp/hippie-exp.el +++ b/lisp/hippie-exp.el @@ -411,14 +411,14 @@ undoes the expansion." "Construct a function similar to `hippie-expand'. Make it use the expansion functions in TRY-LIST. An optional second argument VERBOSE non-nil makes the function verbose." - `(function (lambda (arg) - ,(concat - "Try to expand text before point, using the following functions: \n" - (mapconcat 'prin1-to-string (eval try-list) ", ")) - (interactive "P") - (let ((hippie-expand-try-functions-list ,try-list) - (hippie-expand-verbose ,verbose)) - (hippie-expand arg))))) + `(lambda (arg) + ,(concat + "Try to expand text before point, using the following functions: \n" + (mapconcat 'prin1-to-string (eval try-list) ", ")) + (interactive "P") + (let ((hippie-expand-try-functions-list ,try-list) + (hippie-expand-verbose ,verbose)) + (hippie-expand arg)))) ;;; Here follows the try-functions and their requisites: @@ -534,10 +534,10 @@ string). It returns t if a new completion is found, nil otherwise." (setq he-expand-list (and (not (equal he-search-string "")) (sort (all-completions he-search-string obarray - (function (lambda (sym) + (lambda (sym) (or (boundp sym) (fboundp sym) - (symbol-plist sym))))) + (symbol-plist sym)))) 'string-lessp))))) (while (and he-expand-list (he-string-member (car he-expand-list) he-tried-table)) @@ -563,10 +563,10 @@ otherwise." (if (not (string= he-search-string "")) (setq expansion (try-completion he-search-string obarray - (function (lambda (sym) + (lambda (sym) (or (boundp sym) (fboundp sym) - (symbol-plist sym))))))) + (symbol-plist sym)))))) (if (or (eq expansion t) (string= expansion he-search-string) (he-string-member expansion he-tried-table)) @@ -821,10 +821,10 @@ string). It returns t if a new expansion is found, nil otherwise." (he-init-string (he-dabbrev-beg) (point)) (setq he-expand-list (and (not (equal he-search-string "")) - (mapcar (function (lambda (sym) + (mapcar (lambda (sym) (if (and (boundp sym) (vectorp (eval sym))) (abbrev-expansion (downcase he-search-string) - (eval sym))))) + (eval sym)))) (append '(local-abbrev-table global-abbrev-table) abbrev-table-name-list)))))) diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 439843aaf8..1e6fea8578 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -491,8 +491,8 @@ non-nil, it is used to sort CODINGS instead." 0))) 1) )))))) - (sort codings (function (lambda (x y) - (> (funcall func x) (funcall func y)))))))) + (sort codings (lambda (x y) + (> (funcall func x) (funcall func y))))))) (defun find-coding-systems-region (from to) "Return a list of proper coding systems to encode a text between FROM and TO. @@ -888,7 +888,7 @@ It is highly recommended to fix it before writing to a file." ;; Change elements of the list to (coding . base-coding). (setq default-coding-system - (mapcar (function (lambda (x) (cons x (coding-system-base x)))) + (mapcar (lambda (x) (cons x (coding-system-base x))) default-coding-system)) (if (and auto-cs (not no-other-defaults)) @@ -1082,7 +1082,7 @@ it asks the user to select a proper coding system." (if (fboundp select-safe-coding-system-function) (funcall select-safe-coding-system-function (point-min) (point-max) coding - (function (lambda (x) (coding-system-get x :mime-charset)))) + (lambda (x) (coding-system-get x :mime-charset))) coding))) ;;; Language support stuff. @@ -1261,7 +1261,7 @@ This returns a language environment name as a string." (name (completing-read prompt language-info-alist (and key - (function (lambda (elm) (and (listp elm) (assq key elm))))) + (lambda (elm) (and (listp elm) (assq key elm)))) t nil nil default))) (if (and (> (length name) 0) (or (not key) @@ -2965,9 +2965,9 @@ STR should be a unibyte string." (mapconcat (if (and coding-system (eq (coding-system-type coding-system) 'iso-2022)) ;; Try to get a pretty description for ISO 2022 escape sequences. - (function (lambda (x) (or (cdr (assq x iso-2022-control-alist)) - (format "#x%02X" x)))) - (function (lambda (x) (format "#x%02X" x)))) + (lambda (x) (or (cdr (assq x iso-2022-control-alist)) + (format "#x%02X" x))) + (lambda (x) (format "#x%02X" x))) str " ")) (defun encode-coding-char (char coding-system &optional charset) diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 3299cc55a2..5abd668db8 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -787,7 +787,7 @@ you type is correctly handled." (defun quail-keyseq-translate (keyseq) (apply 'string - (mapcar (function (lambda (x) (quail-keyboard-translate x))) + (mapcar (lambda (x) (quail-keyboard-translate x)) keyseq))) (defun quail-insert-kbd-layout (kbd-layout) @@ -2145,7 +2145,7 @@ minibuffer and the selected frame has no other windows)." (setq str (format "%s[%s]" str - (concat (sort (mapcar (function (lambda (x) (car x))) + (concat (sort (mapcar (lambda (x) (car x)) (cdr map)) '<))))) ;; Show list of translations. @@ -2349,13 +2349,13 @@ Optional 6th arg IGNORES is a list of translations to ignore." ((consp translation) (setq translation (cdr translation)) (let ((multibyte nil)) - (mapc (function (lambda (x) - ;; Accept only non-ASCII chars not - ;; listed in IGNORES. - (if (and (if (integerp x) (> x 127) - (string-match-p "[^[:ascii:]]" x)) - (not (member x ignores))) - (setq multibyte t)))) + (mapc (lambda (x) + ;; Accept only non-ASCII chars not + ;; listed in IGNORES. + (if (and (if (integerp x) (> x 127) + (string-match-p "[^[:ascii:]]" x)) + (not (member x ignores))) + (setq multibyte t))) translation) (when multibyte (setcdr decode-map @@ -2380,11 +2380,11 @@ These are stored in DECODE-MAP using the concise format. DECODE-MAP should be made by `quail-build-decode-map' (which see)." (setq decode-map (sort (cdr decode-map) - (function (lambda (x y) - (setq x (car x) y (car y)) - (or (> (length x) (length y)) - (and (= (length x) (length y)) - (not (string< x y)))))))) + (lambda (x y) + (setq x (car x) y (car y)) + (or (> (length x) (length y)) + (and (= (length x) (length y)) + (not (string< x y))))))) (let ((window-width (window-width (get-buffer-window (current-buffer) 'visible))) (single-trans-width 4) diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el index eef3d14fe2..e1a3058695 100644 --- a/lisp/jka-compr.el +++ b/lisp/jka-compr.el @@ -664,11 +664,11 @@ and `inhibit-local-variables-suffixes' that were added by `jka-compr-installed'." ;; Delete from inhibit-local-variables-suffixes what jka-compr-install added. (mapc - (function (lambda (x) - (and (jka-compr-info-strip-extension x) - (setq inhibit-local-variables-suffixes - (delete (jka-compr-info-regexp x) - inhibit-local-variables-suffixes))))) + (lambda (x) + (and (jka-compr-info-strip-extension x) + (setq inhibit-local-variables-suffixes + (delete (jka-compr-info-regexp x) + inhibit-local-variables-suffixes)))) jka-compr-compression-info-list--internal) (let* ((fnha (cons nil file-name-handler-alist)) diff --git a/lisp/locate.el b/lisp/locate.el index bc78e06eab..44a67ab484 100644 --- a/lisp/locate.el +++ b/lisp/locate.el @@ -668,11 +668,11 @@ the database on the command line." (or (file-exists-p database) (error "Database file %s does not exist" database)) (let ((locate-make-command-line - (function (lambda (string) - (cons locate-command - (list (concat "--database=" - (expand-file-name database)) - string)))))) + (lambda (string) + (cons locate-command + (list (concat "--database=" + (expand-file-name database)) + string))))) (locate search-string))) (defun locate-do-redisplay (&optional arg test-for-subdir) diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el index 09afad7aa4..de4fe257f0 100644 --- a/lisp/mail/mailabbrev.el +++ b/lisp/mail/mailabbrev.el @@ -377,11 +377,11 @@ double-quotes." (setq result (cons (substring definition start end) result) start (and end (match-end 0))))) (setq definition - (mapconcat (function (lambda (x) + (mapconcat (lambda (x) (or (mail-resolve-all-aliases-1 - (intern-soft (downcase x) mail-abbrevs) - (cons sym so-far)) - x))) + (intern-soft (downcase x) mail-abbrevs) + (cons sym so-far)) + x)) (nreverse result) mail-alias-separator-string)) (set sym definition)))) @@ -436,12 +436,12 @@ of a mail alias. The value is set up, buffer-local, when first needed.") (_ (aref (standard-syntax-table) ?_)) (w (aref (standard-syntax-table) ?w))) (map-char-table - (function (lambda (key value) - (if (null value) - ;; Fetch the inherited value - (setq value (aref tab key))) - (if (equal value _) - (set-char-table-range tab key w)))) + (lambda (key value) + (if (null value) + ;; Fetch the inherited value + (setq value (aref tab key))) + (if (equal value _) + (set-char-table-range tab key w))) tab) (modify-syntax-entry ?@ "w" tab) (modify-syntax-entry ?% "w" tab) diff --git a/lisp/mh-e/mh-seq.el b/lisp/mh-e/mh-seq.el index 41c8489e16..a8fb46d8d9 100644 --- a/lisp/mh-e/mh-seq.el +++ b/lisp/mh-e/mh-seq.el @@ -794,9 +794,9 @@ If SAVE-REFILES is non-nil, then keep the sequences that note messages to be refiled." (let ((seqs ())) (cond (save-refiles - (mh-mapc (function (lambda (seq) ; Save the refiling sequences - (if (mh-folder-name-p (mh-seq-name seq)) - (setq seqs (cons seq seqs))))) + (mh-mapc (lambda (seq) ; Save the refiling sequences + (if (mh-folder-name-p (mh-seq-name seq)) + (setq seqs (cons seq seqs)))) mh-seq-list))) (save-excursion (if (eq 0 (mh-exec-cmd-quiet nil "mark" folder "-list")) diff --git a/lisp/net/eudcb-ldap.el b/lisp/net/eudcb-ldap.el index 88c58f5729..1764f03e21 100644 --- a/lisp/net/eudcb-ldap.el +++ b/lisp/net/eudcb-ldap.el @@ -138,10 +138,10 @@ RETURN-ATTRS is a list of attributes to return, defaulting to ;; Apply eudc-duplicate-attribute-handling-method (if (not (eq 'list eudc-duplicate-attribute-handling-method)) (mapc - (function (lambda (record) - (setq final-result - (append (eudc-filter-duplicate-attributes record) - final-result)))) + (lambda (record) + (setq final-result + (append (eudc-filter-duplicate-attributes record) + final-result))) result)) final-result)) diff --git a/lisp/obsolete/nnir.el b/lisp/obsolete/nnir.el index aec5ed3541..6f17854754 100644 --- a/lisp/obsolete/nnir.el +++ b/lisp/obsolete/nnir.el @@ -874,9 +874,9 @@ Windows NT 4.0." ;; Sort by score (apply #'vector (sort artlist - (function (lambda (x y) - (> (nnir-artitem-rsv x) - (nnir-artitem-rsv y))))))))) + (lambda (x y) + (> (nnir-artitem-rsv x) + (nnir-artitem-rsv y)))))))) ;; Swish-E interface. (defun nnir-run-swish-e (query server &optional _group) @@ -969,9 +969,9 @@ Tested with swish-e-2.0.1 on Windows NT 4.0." ;; Sort by score (apply #'vector (sort artlist - (function (lambda (x y) - (> (nnir-artitem-rsv x) - (nnir-artitem-rsv y))))))))) + (lambda (x y) + (> (nnir-artitem-rsv x) + (nnir-artitem-rsv y)))))))) ;; HyREX interface (defun nnir-run-hyrex (query server &optional group) @@ -1037,12 +1037,12 @@ Tested with swish-e-2.0.1 on Windows NT 4.0." (message "Massaging hyrex-search output...done.") (apply #'vector (sort artlist - (function (lambda (x y) - (if (string-lessp (nnir-artitem-group x) - (nnir-artitem-group y)) - t - (< (nnir-artitem-number x) - (nnir-artitem-number y))))))) + (lambda (x y) + (if (string-lessp (nnir-artitem-group x) + (nnir-artitem-group y)) + t + (< (nnir-artitem-number x) + (nnir-artitem-number y)))))) ))) ;; Namazu interface @@ -1112,9 +1112,9 @@ Tested with Namazu 2.0.6 on a GNU/Linux system." ;; sort artlist by score (apply #'vector (sort artlist - (function (lambda (x y) - (> (nnir-artitem-rsv x) - (nnir-artitem-rsv y))))))))) + (lambda (x y) + (> (nnir-artitem-rsv x) + (nnir-artitem-rsv y)))))))) (defun nnir-run-notmuch (query server &optional groups) "Run QUERY with GROUPS from SERVER against notmuch. diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index ac3d081709..8596d78a60 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el @@ -1600,20 +1600,19 @@ Checks each target in TARGET-TABLE using and generates the overview, one line per target name." (insert (mapconcat - (function (lambda (item) - (let* ((target-name (car item)) - (no-prereqs (not (member target-name prereq-list))) - (needs-rebuild (or no-prereqs - (funcall - makefile-query-one-target-method-function - target-name - filename)))) - (format "\t%s%s" - target-name - (cond (no-prereqs " .. has no prerequisites") - (needs-rebuild " .. NEEDS REBUILD") - (t " .. is up to date")))) - )) + (lambda (item) + (let* ((target-name (car item)) + (no-prereqs (not (member target-name prereq-list))) + (needs-rebuild (or no-prereqs + (funcall + makefile-query-one-target-method-function + target-name + filename)))) + (format "\t%s%s" + target-name + (cond (no-prereqs " .. has no prerequisites") + (needs-rebuild " .. NEEDS REBUILD") + (t " .. is up to date"))))) target-table "\n")) (goto-char (point-min)) (delete-file filename)) ; remove the tmpfile @@ -1687,9 +1686,9 @@ Then prompts for all required parameters." (defun makefile-prompt-for-gmake-funargs (function-name prompt-list) (mapconcat - (function (lambda (one-prompt) - (read-string (format "[%s] %s: " function-name one-prompt) - nil))) + (lambda (one-prompt) + (read-string (format "[%s] %s: " function-name one-prompt) + nil)) prompt-list ",")) diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index 6bea5e2256..31f3a34d50 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el @@ -540,11 +540,11 @@ them again, unless you make more changes to the files. To cancel a shadow permanently, remove the group from `shadow-literal-groups' or `shadow-regexp-groups'." (interactive) - (map-y-or-n-p (function (lambda (pair) - (format "Cancel copying %s to %s? " - (car pair) (cdr pair)))) - (function (lambda (pair) - (shadow-remove-from-todo pair))) + (map-y-or-n-p (lambda (pair) + (format "Cancel copying %s to %s? " + (car pair) (cdr pair))) + (lambda (pair) + (shadow-remove-from-todo pair)) shadow-files-to-copy '("shadow" "shadows" "cancel copy")) (message "There are %d shadows to be updated." @@ -601,8 +601,8 @@ and to are absolute file names." shadow-homedir)) (canonical-file (shadow-contract-file-name absolute-file)) (shadows - (mapcar (function (lambda (shadow) - (cons absolute-file shadow))) + (mapcar (lambda (shadow) + (cons absolute-file shadow)) (append (shadow-shadows-of-1 canonical-file shadow-literal-groups nil) diff --git a/lisp/sort.el b/lisp/sort.el index f878db24a3..b9a27a84e4 100644 --- a/lisp/sort.el +++ b/lisp/sort.el @@ -251,7 +251,7 @@ the sort order." (narrow-to-region beg end) (goto-char (point-min)) (sort-subr reverse - (function (lambda () (skip-chars-forward "\n"))) + (lambda () (skip-chars-forward "\n")) 'forward-page)))) (defvar sort-fields-syntax-table nil) @@ -316,16 +316,16 @@ FIELD, BEG and END. BEG and END specify region to sort." ;;region to sort." ;; (interactive "p\nr") ;; (sort-fields-1 field beg end -;; (function (lambda () -;; (sort-skip-fields field) -;; (string-to-number -;; (buffer-substring -;; (point) -;; (save-excursion -;; (re-search-forward -;; "[+-]?[0-9]*\\.?[0-9]*\\([eE][+-]?[0-9]+\\)?") -;; (point)))))) -;; nil)) +;; (lambda () +;; (sort-skip-fields field) +;; (string-to-number +;; (buffer-substring +;; (point) +;; (save-excursion +;; (re-search-forward +;; "[+-]?[0-9]*\\.?[0-9]*\\([eE][+-]?[0-9]+\\)?") +;; (point))))) +;; nil)) ;;;###autoload (defun sort-fields (field beg end) @@ -340,10 +340,10 @@ the sort order." (let ;; To make `end-of-line' and etc. to ignore fields. ((inhibit-field-text-motion t)) (sort-fields-1 field beg end - (function (lambda () - (sort-skip-fields field) - nil)) - (function (lambda () (skip-chars-forward "^ \t\n")))))) + (lambda () + (sort-skip-fields field) + nil) + (lambda () (skip-chars-forward "^ \t\n"))))) (defun sort-fields-1 (field beg end startkeyfun endkeyfun) (let ((tbl (syntax-table))) @@ -457,21 +457,21 @@ sRegexp specifying key within record: \nr") (goto-char (match-beginning 0)) (sort-subr reverse 'sort-regexp-fields-next-record - (function (lambda () - (goto-char sort-regexp-record-end))) - (function (lambda () - (let ((n 0)) - (cond ((numberp key-regexp) - (setq n key-regexp)) - ((re-search-forward - key-regexp sort-regexp-record-end t) - (setq n 0)) - (t (throw 'key nil))) - (condition-case () - (cons (match-beginning n) - (match-end n)) - ;; if there was no such register - (error (throw 'key nil))))))))))) + (lambda () + (goto-char sort-regexp-record-end)) + (lambda () + (let ((n 0)) + (cond ((numberp key-regexp) + (setq n key-regexp)) + ((re-search-forward + key-regexp sort-regexp-record-end t) + (setq n 0)) + (t (throw 'key nil))) + (condition-case () + (cons (match-beginning n) + (match-end n)) + ;; if there was no such register + (error (throw 'key nil)))))))))) (defvar sort-columns-subprocess t) diff --git a/lisp/subr.el b/lisp/subr.el index 04d8132eaa..6e9f66fe97 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1278,10 +1278,10 @@ The normal global definition of the character C-x indirects to this keymap.") "Convert a key sequence to a list of events." (if (vectorp key) (append key nil) - (mapcar (function (lambda (c) - (if (> c 127) - (logxor c listify-key-sequence-1) - c))) + (mapcar (lambda (c) + (if (> c 127) + (logxor c listify-key-sequence-1) + c)) key))) (defun eventp (object) diff --git a/lisp/term/wyse50.el b/lisp/term/wyse50.el index 6d72d4a05b..f06563ebeb 100644 --- a/lisp/term/wyse50.el +++ b/lisp/term/wyse50.el @@ -126,9 +126,9 @@ ;; On such terminals, Emacs should sacrifice the first and last character of ;; each mode line, rather than a whole screen column! (add-hook 'kill-emacs-hook - (function (lambda () (interactive) - (send-string-to-terminal - (concat "\ea23R" (1+ (frame-width)) "C\eG0")))))) + (lambda () (interactive) + (send-string-to-terminal + (concat "\ea23R" (1+ (frame-width)) "C\eG0"))))) (defun enable-arrow-keys () "To be called by `tty-setup-hook'. Overrides 6 Emacs standard keys diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 3358cf1ba3..31b699cf50 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -2464,14 +2464,14 @@ SPC: Accept word this time. (progn (require 'ehelp) (with-electric-help - (function (lambda () - ;;This shouldn't be necessary: with-electric-help needs - ;; an optional argument telling it about the smallest - ;; acceptable window-height of the help buffer. - ;;(if (< (window-height) 15) - ;; (enlarge-window - ;; (- 15 (ispell-adjusted-window-height)))) - (princ "Selections are: + (lambda () + ;;This shouldn't be necessary: with-electric-help needs + ;; an optional argument telling it about the smallest + ;; acceptable window-height of the help buffer. + ;;(if (< (window-height) 15) + ;; (enlarge-window + ;; (- 15 (ispell-adjusted-window-height)))) + (princ "Selections are: DIGIT: Replace the word with a digit offered in the *Choices* buffer. SPC: Accept word this time. @@ -2491,7 +2491,7 @@ SPC: Accept word this time. `C-l': Redraw screen. `C-r': Recursive edit. `C-z': Suspend Emacs or iconify frame.") - nil)))) + nil))) (let ((help-1 (concat "[r/R]eplace word; [a/A]ccept for this session; " @@ -3274,15 +3274,15 @@ otherwise, the current line is skipped." Generated from `ispell-tex-skip-alists'." (concat ;; raw tex keys - (mapconcat (function (lambda (lst) (car lst))) + (mapconcat (lambda (lst) (car lst)) (car ispell-tex-skip-alists) "\\|") "\\|" ;; keys wrapped in begin{} - (mapconcat (function (lambda (lst) - (concat "\\\\begin[ \t\n]*{[ \t\n]*" - (car lst) - "[ \t\n]*}"))) + (mapconcat (lambda (lst) + (concat "\\\\begin[ \t\n]*{[ \t\n]*" + (car lst) + "[ \t\n]*}")) (car (cdr ispell-tex-skip-alists)) "\\|"))) diff --git a/lisp/textmodes/page-ext.el b/lisp/textmodes/page-ext.el index c2b7b66b9f..b357bbbbe9 100644 --- a/lisp/textmodes/page-ext.el +++ b/lisp/textmodes/page-ext.el @@ -429,20 +429,19 @@ REVERSE (non-nil means reverse order), BEG and END (region to sort)." ;; NEXTRECFUN is called with point at the end of the ;; previous record. It moves point to the start of the ;; next record. - (function (lambda () - (re-search-forward page-delimiter nil t) - (skip-chars-forward " \t\n") - )) + (lambda () + (re-search-forward page-delimiter nil t) + (skip-chars-forward " \t\n")) ;; ENDRECFUN is called with point within the record. ;; It should move point to the end of the record. - (function (lambda () - (if (re-search-forward - page-delimiter - nil - t) - (goto-char (match-beginning 0)) - (goto-char (point-max)))))))) + (lambda () + (if (re-search-forward + page-delimiter + nil + t) + (goto-char (match-beginning 0)) + (goto-char (point-max))))))) (define-obsolete-function-alias 'sort-pages-buffer #'pages-sort-buffer "27.1") (defun pages-sort-buffer (&optional reverse) diff --git a/lisp/textmodes/refer.el b/lisp/textmodes/refer.el index c8fd0bea00..888c310b4a 100644 --- a/lisp/textmodes/refer.el +++ b/lisp/textmodes/refer.el @@ -249,9 +249,9 @@ found on the last `refer-find-entry' or `refer-find-next-entry'." (forward-paragraph 1) (setq end (point)) (setq found - (refer-every (function (lambda (keyword) - (goto-char begin) - (re-search-forward keyword end t))) + (refer-every (lambda (keyword) + (goto-char begin) + (re-search-forward keyword end t)) keywords-list)) (if (not found) (progn diff --git a/lisp/url/url-expand.el b/lisp/url/url-expand.el index be9b5426dc..9f52f2586f 100644 --- a/lisp/url/url-expand.el +++ b/lisp/url/url-expand.el @@ -65,10 +65,10 @@ path components followed by `..' are removed, along with the `..' itself." (if (and url (not (string-match "^#" url))) ;; Need to nuke newlines and spaces in the URL, or we open ;; ourselves up to potential security holes. - (setq url (mapconcat (function (lambda (x) - (if (memq x '(? ?\n ?\r)) - "" - (char-to-string x)))) + (setq url (mapconcat (lambda (x) + (if (memq x '(? ?\n ?\r)) + "" + (char-to-string x))) url ""))) ;; Need to figure out how/where to expand the fragment relative to commit 8ac71a07ce99821d8ffe41a8d6fd2261131a7261 Author: Juri Linkov Date: Thu Nov 12 22:33:27 2020 +0200 Add help-char to the cache key in read-char-from-minibuffer as well It's highly unlikely that help-char will be changed from its default value 8, but formally there is a dependence on help-char. diff --git a/lisp/subr.el b/lisp/subr.el index cf569782ce..04d8132eaa 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2771,7 +2771,7 @@ If the caller has set `help-form', there is no need to explicitly add `help-char' to chars. It's bound automatically to `help-form-show'." (let* ((empty-history '()) (map (if (consp chars) - (or (gethash (cons help-form chars) + (or (gethash (list help-form (cons help-char chars)) read-char-from-minibuffer-map-hash) (let ((map (make-sparse-keymap)) (msg help-form)) @@ -2791,7 +2791,7 @@ If the caller has set `help-form', there is no need to explicitly add 'read-char-from-minibuffer-insert-char)) (define-key map [remap self-insert-command] 'read-char-from-minibuffer-insert-other) - (puthash (cons help-form chars) + (puthash (list help-form (cons help-char chars)) map read-char-from-minibuffer-map-hash) map)) read-char-from-minibuffer-map)) commit 56a7c73f9ce3b92251c332691de273ccd9894632 Author: Robert Pluim Date: Thu Nov 12 16:51:49 2020 +0100 Emit required version when Harfbuzz is not found but Cairo is * configure.ac: Define harfbuzz_required_ver with required harfbuzz version, and put it in the warning message emitted when Cairo is found but not HarfBuzz. diff --git a/configure.ac b/configure.ac index f0c8e5210f..888b415148 100644 --- a/configure.ac +++ b/configure.ac @@ -3444,16 +3444,17 @@ else # "${HAVE_X11}" != "yes" fi # "${HAVE_X11}" != "yes" HAVE_HARFBUZZ=no +### On MS-Windows we use hb_font_get_nominal_glyph, which appeared +### in HarfBuzz version 1.2.3 +if test "${HAVE_W32}" = "yes"; then + harfbuzz_required_ver=1.2.3 +else + harfbuzz_required_ver=0.9.42 +fi if test "${HAVE_X11}" = "yes" && test "${HAVE_FREETYPE}" = "yes" \ || test "${HAVE_W32}" = "yes"; then if test "${with_harfbuzz}" != "no"; then - ### On MS-Windows we use hb_font_get_nominal_glyph, which appeared - ### in HarfBuzz version 1.2.3 - if test "${HAVE_W32}" = "yes"; then - EMACS_CHECK_MODULES([HARFBUZZ], [harfbuzz >= 1.2.3]) - else - EMACS_CHECK_MODULES([HARFBUZZ], [harfbuzz >= 0.9.42]) - fi + EMACS_CHECK_MODULES([HARFBUZZ], [harfbuzz >= $harfbuzz_required_ver]) if test "$HAVE_HARFBUZZ" = "yes"; then AC_DEFINE(HAVE_HARFBUZZ, 1, [Define to 1 if using HarfBuzz.]) ### mingw32 and Cygwin-w32 don't use -lharfbuzz, since they load @@ -5918,9 +5919,9 @@ fi if test "${HAVE_CAIRO}" = "yes" && test "${HAVE_HARFBUZZ}" = no; then AC_MSG_WARN([This configuration uses the Cairo graphics library, - but not the HarfBuzz font shaping library. We recommend the use - of HarfBuzz when using Cairo, please install HarfBuzz development - packages.]) + but not the HarfBuzz font shaping library (minimum version $harfbuzz_required_ver). + We recommend the use of HarfBuzz when using Cairo, please install + appropriate HarfBuzz development packages.]) fi # Let plain 'make' work. commit a5b48e25fe966ed67f314b77903335e8238ce8f9 Author: Mattias Engdegård Date: Thu Nov 12 10:39:36 2020 +0100 vhdl-mode: remove minor obstacle to static checking * lisp/progmodes/vhdl-mode.el (vhdl-directive-keywords-regexp): Remove unnecessary global variable. (vhdl-words-init): Remove assignment. (vhdl-font-lock-init): Inline expression. Use regexp-opt. diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 3d66483b83..f288facba5 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -5336,9 +5336,6 @@ Key bindings: (defvar vhdl-reserved-words-regexp nil "Regexp for additional reserved words.") -(defvar vhdl-directive-keywords-regexp nil - "Regexp for compiler directive keywords.") - (defun vhdl-upcase-list (condition list) "Upcase all elements in LIST based on CONDITION." (when condition @@ -5416,9 +5413,6 @@ Key bindings: (concat vhdl-forbidden-syntax "\\|")) (regexp-opt vhdl-reserved-words) "\\)\\>")) - (setq vhdl-directive-keywords-regexp - (concat "\\<\\(" (mapconcat 'regexp-quote - vhdl-directive-keywords "\\|") "\\)\\>")) (vhdl-abbrev-list-init)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -13631,7 +13625,10 @@ This does background highlighting of translate-off regions.") vhdl-template-prompt-syntax ">\\)") 2 'vhdl-font-lock-prompt-face t) (list (concat "--\\s-*" - vhdl-directive-keywords-regexp "\\s-+\\(.*\\)$") + "\\<" + (regexp-opt vhdl-directive-keywords t) + "\\>" + "\\s-+\\(.*\\)$") 2 'vhdl-font-lock-directive-face t) ;; highlight c-preprocessor directives (list "^#[ \t]*\\(\\w+\\)\\([ \t]+\\(\\w+\\)\\)?" commit 4ad3402fb331f786c04dbf2eee4a77b8da99bde2 Author: Lars Ingebrigtsen Date: Thu Nov 12 13:39:40 2020 +0100 Remove mention of `edebug-on-signal' from a doc string * lisp/emacs-lisp/edebug.el (edebug-mode): Don't mention non-existent user option (bug#44577). diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index fe733630ba..e310313940 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -4018,7 +4018,6 @@ Options: `edebug-print-circle' `edebug-on-error' `edebug-on-quit' -`edebug-on-signal' `edebug-unwrap-results' `edebug-global-break-condition'" :lighter " *Debugging*" commit b21015c9c2e80f7bfd558bf6a43592b60fd53cee Author: Lars Ingebrigtsen Date: Thu Nov 12 13:36:19 2020 +0100 Clarify project-find-file doc string * lisp/progmodes/project.el (project-find-file): Don't say anything about recognizing file names, as that may lead the user to think that it'll check whether the string at point is an existing file (bug#44588). diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index a648618e82..09e60c09ac 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -745,8 +745,7 @@ pattern to search for." ;;;###autoload (defun project-find-file () "Visit a file (with completion) in the current project. -The completion default is the filename at point, if one is -recognized." +The completion default is the string at point." (interactive) (let* ((pr (project-current t)) (dirs (list (project-root pr)))) commit 1ac47aac0855c2a57112456537f621eb1a6f8eaa Author: Juri Linkov Date: Thu Nov 12 09:38:21 2020 +0200 Add help-form to the cache key in read-char-from-minibuffer diff --git a/lisp/subr.el b/lisp/subr.el index 1129496e50..cf569782ce 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2735,7 +2735,7 @@ floating point support." "Keymap for the `read-char-from-minibuffer' function.") (defconst read-char-from-minibuffer-map-hash - (make-hash-table :weakness 'key :test 'equal)) + (make-hash-table :test 'equal)) (defun read-char-from-minibuffer-insert-char () "Insert the character you type in the minibuffer and exit. @@ -2771,7 +2771,7 @@ If the caller has set `help-form', there is no need to explicitly add `help-char' to chars. It's bound automatically to `help-form-show'." (let* ((empty-history '()) (map (if (consp chars) - (or (gethash (if help-form (cons help-char chars) chars) + (or (gethash (cons help-form chars) read-char-from-minibuffer-map-hash) (let ((map (make-sparse-keymap)) (msg help-form)) @@ -2791,7 +2791,7 @@ If the caller has set `help-form', there is no need to explicitly add 'read-char-from-minibuffer-insert-char)) (define-key map [remap self-insert-command] 'read-char-from-minibuffer-insert-other) - (puthash (if help-form (cons help-char chars) chars) + (puthash (cons help-form chars) map read-char-from-minibuffer-map-hash) map)) read-char-from-minibuffer-map)) commit dcd23618014fe710ee2a898a0b8a48e503f76d7a Author: Stefan Kangas Date: Thu Nov 12 03:27:26 2020 +0100 * test/lisp/help-fns-tests.el: Silence byte-compiler. diff --git a/test/lisp/help-fns-tests.el b/test/lisp/help-fns-tests.el index bdd488de3f..3359821b68 100644 --- a/test/lisp/help-fns-tests.el +++ b/test/lisp/help-fns-tests.el @@ -24,8 +24,9 @@ ;;; Code: (require 'ert) +(require 'help-fns) -(autoload 'help-fns-test--macro "help-fns" nil nil t) +(autoload 'help-fns-test--macro "foo" nil nil t) ;;; Several tests for describe-function commit 3ee56c7e4283c6689dcb979781067d618ab60c44 Author: Stefan Kangas Date: Thu Nov 12 03:20:39 2020 +0100 * test/lisp/hfy-cmap-resources/rgb.txt: Add comment line. diff --git a/test/lisp/hfy-cmap-resources/rgb.txt b/test/lisp/hfy-cmap-resources/rgb.txt index 86a0053990..f8e369fae2 100644 --- a/test/lisp/hfy-cmap-resources/rgb.txt +++ b/test/lisp/hfy-cmap-resources/rgb.txt @@ -1,3 +1,4 @@ +# test comment 255 250 250 snow 248 248 255 ghost white 248 248 255 GhostWhite commit 4e942670424d02fd7f1886bb459b159ca9490964 Author: Stefan Kangas Date: Thu Nov 12 02:55:02 2020 +0100 Remove redundant installation instructions * lisp/net/newsticker.el: * lisp/net/sieve-mode.el: * lisp/play/bubbles.el: * lisp/play/handwrite.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-mode.el: * lisp/whitespace.el: Remove redundant installation instructions. These packages are distributed with Emacs and/or GNU ELPA. * lisp/calendar/timeclock.el: * lisp/ehelp.el: * lisp/emacs-lisp/checkdoc.el: * lisp/filesets.el: * lisp/mail/reporter.el: * lisp/net/rfc2104.el: * lisp/net/webjump.el: * lisp/pixel-scroll.el: Remove redundant recommendation to call require before using autoloaded functions. * lisp/tar-mode.el: Remove reference to package uncompress, removed in Emacs 23. diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index a26da265fe..48028dd07b 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -37,8 +37,6 @@ ;; You'll probably want to bind the timeclock commands to some handy ;; keystrokes. At the moment, C-x t is unused: ;; -;; (require 'timeclock) -;; ;; (define-key ctl-x-map "ti" 'timeclock-in) ;; (define-key ctl-x-map "to" 'timeclock-out) ;; (define-key ctl-x-map "tc" 'timeclock-change) diff --git a/lisp/ehelp.el b/lisp/ehelp.el index 81373202c5..7da9aed075 100644 --- a/lisp/ehelp.el +++ b/lisp/ehelp.el @@ -31,7 +31,6 @@ ;; buffer. ;; To make this the default, you must do -;; (require 'ehelp) ;; (define-key global-map "\C-h" 'ehelp-command) ;; (define-key global-map [help] 'ehelp-command) ;; (define-key global-map [f1] 'ehelp-command) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index a485378a92..61384c0e6f 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -37,7 +37,6 @@ ;; documentation whenever you evaluate Lisp code with C-M-x ;; or [menu-bar emacs-lisp eval-buffer]. Additional key-bindings ;; are also provided under C-c ? KEY -;; (require 'checkdoc) ;; (add-hook 'emacs-lisp-mode-hook 'checkdoc-minor-mode) ;; ;; Using `checkdoc': diff --git a/lisp/filesets.el b/lisp/filesets.el index 4f23faa220..2cad2023b8 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -35,7 +35,7 @@ ;; inclusion group (i.e. a base file including other files). ;; Usage: -;; 1. Put (require 'filesets) and (filesets-init) in your init file. +;; 1. Put (filesets-init) in your init file. ;; 2. Type ;; M-x filesets-edit or choose "Edit Filesets" from the menu. ;; 3. Save your customizations. diff --git a/lisp/mail/reporter.el b/lisp/mail/reporter.el index edfceb373f..0c8b8d47a0 100644 --- a/lisp/mail/reporter.el +++ b/lisp/mail/reporter.el @@ -51,7 +51,6 @@ ;;(defun mypkg-submit-bug-report () ;; "Submit via mail a bug report on mypkg" ;; (interactive) -;; (require 'reporter) ;; (reporter-submit-bug-report ;; mypkg-maintainer-address ;; (concat "mypkg.el " mypkg-version) diff --git a/lisp/net/newsticker.el b/lisp/net/newsticker.el index 535122a31f..c949915845 100644 --- a/lisp/net/newsticker.el +++ b/lisp/net/newsticker.el @@ -78,14 +78,6 @@ ;; Installation ;; ------------ -;; If you are using Newsticker as part of GNU Emacs there is no need to -;; perform any installation steps in order to use Newsticker. Otherwise -;; place Newsticker in a directory where Emacs can find it. Add the -;; following line to your init file: -;; (add-to-list 'load-path "/path/to/newsticker/") -;; (autoload 'newsticker-start "newsticker" "Emacs Newsticker" t) -;; (autoload 'newsticker-show-news "newsticker" "Emacs Newsticker" t) - ;; If you are using `imenu', which allows for navigating with the help of a ;; menu, you should add the following to your Emacs startup file ;; (`~/.emacs'). diff --git a/lisp/net/rfc2104.el b/lisp/net/rfc2104.el index 50d54761b1..b008c9ac92 100644 --- a/lisp/net/rfc2104.el +++ b/lisp/net/rfc2104.el @@ -26,11 +26,9 @@ ;; ;; Example: ;; -;; (require 'md5) ;; (rfc2104-hash 'md5 64 16 "Jefe" "what do ya want for nothing?") ;; "750c783e6ab0b503eaa86e310a5db738" ;; -;; (require 'sha1) ;; (rfc2104-hash 'sha1 64 20 "Jefe" "what do ya want for nothing?") ;; "effcdf6ae5eb2fa2d27416d5f184df9c259a7c79" ;; diff --git a/lisp/net/sieve-mode.el b/lisp/net/sieve-mode.el index 7475a7b59d..c5f4491791 100644 --- a/lisp/net/sieve-mode.el +++ b/lisp/net/sieve-mode.el @@ -26,11 +26,6 @@ ;; sieve-style #-comments and a lightly hacked syntax table. It was ;; strongly influenced by awk-mode.el. ;; -;; Put something similar to the following in your .emacs to use this file: -;; -;; (load "~/lisp/sieve") -;; (setq auto-mode-alist (cons '("\\.siv\\'" . sieve-mode) auto-mode-alist)) -;; ;; References: ;; ;; RFC 3028, diff --git a/lisp/net/webjump.el b/lisp/net/webjump.el index 8bb156199c..9fbc434760 100644 --- a/lisp/net/webjump.el +++ b/lisp/net/webjump.el @@ -40,7 +40,6 @@ ;; You may wish to add something like the following to your init file: ;; -;; (require 'webjump) ;; (global-set-key "\C-cj" 'webjump) ;; (setq webjump-sites ;; (append '( diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index bd05d91e2d..9e86e4695b 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -26,9 +26,8 @@ ;; ;; M-x pixel-scroll-mode RET ;; -;; To make the mode permanent, put these in your init file: +;; To make the mode permanent, put this in your Init file: ;; -;; (require 'pixel-scroll) ;; (pixel-scroll-mode 1) ;;; Commentary: diff --git a/lisp/play/bubbles.el b/lisp/play/bubbles.el index d512a718b4..ca23a78202 100644 --- a/lisp/play/bubbles.el +++ b/lisp/play/bubbles.el @@ -30,13 +30,6 @@ ;; Bubbles is an implementation of the "Same Game", similar to "Same ;; GNOME" and many others, see . -;; Installation -;; ------------ - -;; Add the following lines to your init file: -;; (add-to-list 'load-path "/path/to/bubbles/") -;; (autoload 'bubbles "bubbles" "Play Bubbles" t) - ;; ====================================================================== ;;; History: diff --git a/lisp/play/handwrite.el b/lisp/play/handwrite.el index 7b4a59b6fc..1cf690a86d 100644 --- a/lisp/play/handwrite.el +++ b/lisp/play/handwrite.el @@ -41,16 +41,8 @@ ;; If you are not satisfied with the type page there are a number of ;; variables you may want to set. ;; -;; -;; Installation -;; -;; type at your prompt "emacs -l handwrite.el" or put this file on your -;; Emacs Lisp load path, add the following into your init file: -;; -;; (require 'handwrite) -;; -;; "M-x handwrite" or "Write by hand" in the edit menu should work now. -;; +;; To use this, say "M-x handwrite" or type at your prompt +;; "emacs -l handwrite.el". ;; ;; I tried to make it `iso_8859_1'-friendly, but there are some exotic ;; characters missing. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index a179318589..091456aa89 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -29,7 +29,7 @@ ;; Major mode for editing Python files with some fontification and ;; indentation bits extracted from original Dave Love's python.el -;; found in GNU/Emacs. +;; found in GNU Emacs. ;; Implements Syntax highlighting, Indentation, Movement, Shell ;; interaction, Shell completion, Shell virtualenv support, Shell @@ -247,13 +247,6 @@ ;; I'd recommend the first one since you'll get the same behavior for ;; all modes out-of-the-box. -;;; Installation: - -;; Add this to your .emacs: - -;; (add-to-list 'load-path "/folder/containing/file") -;; (require 'python) - ;;; TODO: ;;; Code: diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index afeabc030d..fbc6e424eb 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -28,13 +28,6 @@ ;; Provides font-locking, indentation support, and navigation for Ruby code. ;; -;; If you're installing manually, you should add this to your .emacs -;; file after putting it on your load path: -;; -;; (autoload 'ruby-mode "ruby-mode" "Major mode for ruby files" t) -;; (add-to-list 'auto-mode-alist '("\\.rb\\'" . ruby-mode)) -;; (add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode)) -;; ;; Still needs more docstrings; search below for TODO. ;;; Code: diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el index 5cf09f9055..d460c8a4f7 100644 --- a/lisp/tar-mode.el +++ b/lisp/tar-mode.el @@ -37,13 +37,6 @@ ;; This code now understands the extra fields that GNU tar adds to tar files. -;; This interacts correctly with "uncompress.el" in the Emacs library, -;; which you get with -;; -;; (autoload 'uncompress-while-visiting "uncompress") -;; (setq auto-mode-alist (cons '("\\.Z$" . uncompress-while-visiting) -;; auto-mode-alist)) -;; ;; Do not attempt to use tar-mode.el with crypt.el, you will lose. ;; *************** TO DO *************** diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 94ed6dc47f..02ee7bcf7f 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -86,19 +86,6 @@ ;; * if global whitespace is turned off, whitespace continues on only ;; in the buffers in which local whitespace is on. ;; -;; To use whitespace, insert in your ~/.emacs: -;; -;; (require 'whitespace) -;; -;; Or autoload at least one of the commands`whitespace-mode', -;; `whitespace-toggle-options', `global-whitespace-mode' or -;; `global-whitespace-toggle-options'. For example: -;; -;; (autoload 'whitespace-mode "whitespace" -;; "Toggle whitespace visualization." t) -;; (autoload 'whitespace-toggle-options "whitespace" -;; "Toggle local `whitespace-mode' options." t) -;; ;; whitespace was inspired by: ;; ;; whitespace.el Rajesh Vaidheeswarran commit af3edb3be9515e0b37d03a96f805cff62d596acd Author: Stefan Kangas Date: Thu Nov 12 02:28:10 2020 +0100 * lisp/progmodes/ruby-mode.el (auto-mode-alist): Add Brewfile. diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 14f00597bf..afeabc030d 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -2436,7 +2436,7 @@ If there is no Rubocop config file, Rubocop will be passed a flag "\\)" "\\|/" "\\(?:Gem\\|Rake\\|Cap\\|Thor" - "\\|Puppet\\|Berks" + "\\|Puppet\\|Berks\\|Brew" "\\|Vagrant\\|Guard\\|Pod\\)file" "\\)\\'")) 'ruby-mode)) commit ccf2576081dbd629765214493d08c58e28ee23dc Author: Stefan Kangas Date: Mon Nov 9 22:23:04 2020 +0100 Fix mistake in describe-buffer-bindings * src/keymap.c (Fdescribe_buffer_bindings): Fix a call in describe-buffer-bindings. This fixes a mistake in my previous commit to prefer the Lisp version of describe-map-tree (8a1441310aa1), where 0 was accidentally converted to Qt in two places. diff --git a/src/keymap.c b/src/keymap.c index e5b4781076..181dcdad3a 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -2926,7 +2926,7 @@ You type Translation\n\ CALLN (Ffuncall, Qdescribe_map_tree, KVAR (current_kboard, Vlocal_function_key_map), Qnil, Qnil, prefix, - msg, nomenu, Qt, Qt, Qt); + msg, nomenu, Qt, Qnil, Qnil); } /* Print the input-decode-map translations under this prefix. */ commit 73536ffecb6d92151cfeaf1fbc7153aa14f42fb4 Author: Juri Linkov Date: Thu Nov 12 03:38:44 2020 +0200 Use cache with help-char in read-char-from-minibuffer unless help-form is nil diff --git a/lisp/subr.el b/lisp/subr.el index 3e17ef801b..1129496e50 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2771,9 +2771,8 @@ If the caller has set `help-form', there is no need to explicitly add `help-char' to chars. It's bound automatically to `help-form-show'." (let* ((empty-history '()) (map (if (consp chars) - (or (and (gethash chars read-char-from-minibuffer-map-hash) - ;; Don't use cached keymap with `help-char'. - (not help-form)) + (or (gethash (if help-form (cons help-char chars) chars) + read-char-from-minibuffer-map-hash) (let ((map (make-sparse-keymap)) (msg help-form)) (set-keymap-parent map read-char-from-minibuffer-map) @@ -2792,9 +2791,8 @@ If the caller has set `help-form', there is no need to explicitly add 'read-char-from-minibuffer-insert-char)) (define-key map [remap self-insert-command] 'read-char-from-minibuffer-insert-other) - (unless help-form - ;; Don't cache keymap with `help-char'. - (puthash chars map read-char-from-minibuffer-map-hash)) + (puthash (if help-form (cons help-char chars) chars) + map read-char-from-minibuffer-map-hash) map)) read-char-from-minibuffer-map)) (result commit f43e9ad524b5d23dd9434e5d70bd95142207d601 Author: Eli Zaretskii Date: Wed Nov 11 21:46:43 2020 +0200 Avoid crashes in the daemon due to user interaction * src/minibuf.c (read_minibuf): Avoid crashes in the daemon if the init file invokes some kind of minibuffer interaction, by not updating the selected frame if it's the initial frame. (Bug#44583) diff --git a/src/minibuf.c b/src/minibuf.c index b837cc53eb..135655064a 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -666,7 +666,8 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, /* If cursor is on the minibuffer line, show the user we have exited by putting it in column 0. */ if (XWINDOW (minibuf_window)->cursor.vpos >= 0 - && !noninteractive) + && !noninteractive + && !FRAME_INITIAL_P (SELECTED_FRAME ())) { XWINDOW (minibuf_window)->cursor.hpos = 0; XWINDOW (minibuf_window)->cursor.x = 0; commit 17894ef565214c17d19304d9ce6a976c2588fd53 Author: Juri Linkov Date: Wed Nov 11 21:18:31 2020 +0200 In dired-query use read-char-from-minibuffer with bound help-char (bug#42708) * lisp/dired-aux.el (dired-query): Replace read-char-choice call with read-char-from-minibuffer. * lisp/subr.el (read-char-choice): Restore the previous version that uses read-key. (read-char-from-minibuffer): Bind help-char to help-form-show when help-form is non-nil. diff --git a/etc/NEWS b/etc/NEWS index eb532ce67a..f21c4cb02c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1321,6 +1321,11 @@ visited errors, so you can have an overview what errors were already visited. If 'tab-always-indent' is 'complete', this new user option can be used to further tweak whether to complete or indent. +--- +*** 'dired-query' now uses 'read-char-from-minibuffer'. +Using it instead of 'read-char-choice' allows using 'C-x o' +to switch to the help window displayed after typing 'C-h'. + --- *** 'zap-up-to-char' now uses 'read-char-from-minibuffer'. This allows navigating through the history of characters that have diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 6034d12f32..94a2bbf1f3 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1380,7 +1380,7 @@ return t; if SYM is q or ESC, return nil." (format " [Type yn!q or %s] " (key-description (vector help-char))) " [Type y, n, q or !] "))) - (set sym (setq char (read-char-choice prompt char-choices))) + (set sym (setq char (read-char-from-minibuffer prompt char-choices))) (if (memq char '(?y ?\s ?!)) t))))) diff --git a/lisp/subr.el b/lisp/subr.el index 924526d77e..3e17ef801b 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2618,15 +2618,7 @@ keyboard-quit events while waiting for a valid input." (unless (get-text-property 0 'face prompt) (setq prompt (propertize prompt 'face 'minibuffer-prompt))) (setq char (let ((inhibit-quit inhibit-keyboard-quit)) - (read-char-from-minibuffer - prompt - ;; If we have a dynamically bound `help-form' - ;; here, then the `C-h' (i.e., `help-char') - ;; character should output that instead of - ;; being a command char. - (if help-form - (cons help-char chars) - chars)))) + (read-key prompt))) (and show-help (buffer-live-p (get-buffer helpbuf)) (kill-buffer helpbuf)) (cond @@ -2774,20 +2766,36 @@ the function will ignore any input that is not one of CHARS. Optional argument HISTORY, if non-nil, should be a symbol that specifies the history list variable to use for navigating in input history using `M-p' and `M-n', with `RET' to select a character from -history." +history. +If the caller has set `help-form', there is no need to explicitly add +`help-char' to chars. It's bound automatically to `help-form-show'." (let* ((empty-history '()) (map (if (consp chars) - (or (gethash chars read-char-from-minibuffer-map-hash) - (puthash chars - (let ((map (make-sparse-keymap))) - (set-keymap-parent map read-char-from-minibuffer-map) - (dolist (char chars) - (define-key map (vector char) - 'read-char-from-minibuffer-insert-char)) - (define-key map [remap self-insert-command] - 'read-char-from-minibuffer-insert-other) - map) - read-char-from-minibuffer-map-hash)) + (or (and (gethash chars read-char-from-minibuffer-map-hash) + ;; Don't use cached keymap with `help-char'. + (not help-form)) + (let ((map (make-sparse-keymap)) + (msg help-form)) + (set-keymap-parent map read-char-from-minibuffer-map) + ;; If we have a dynamically bound `help-form' + ;; here, then the `C-h' (i.e., `help-char') + ;; character should output that instead of + ;; being a command char. + (when help-form + (define-key map (vector help-char) + (lambda () + (interactive) + (let ((help-form msg)) ; lexically bound msg + (help-form-show))))) + (dolist (char chars) + (define-key map (vector char) + 'read-char-from-minibuffer-insert-char)) + (define-key map [remap self-insert-command] + 'read-char-from-minibuffer-insert-other) + (unless help-form + ;; Don't cache keymap with `help-char'. + (puthash chars map read-char-from-minibuffer-map-hash)) + map)) read-char-from-minibuffer-map)) (result (read-from-minibuffer prompt nil map nil commit 3e07b871c498f4e33a9e49d202ae5b9cb57b9d39 Author: Eric Abrahamsen Date: Wed Nov 11 10:36:51 2020 -0800 Remove unused "internal" gnus-search variables * lisp/gnus/gnus-search.el (gnus-search-memo-query, gnus-search-memo-server): No longer needed. diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index fad120ad8e..71854a7a3e 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -90,12 +90,6 @@ ;;; Internal Variables: -(defvar gnus-search-memo-query nil - "Internal: stores current query.") - -(defvar gnus-search-memo-server nil - "Internal: stores current server.") - (defvar gnus-search-history () "Internal history of Gnus searches.") commit d22a914c799ee9cf076ed8eb1d5487500b8d06aa Author: Eric Abrahamsen Date: Wed Nov 11 09:34:53 2020 -0800 Fix defgeneric name of gnus-search-index(ed)-extract * lisp/gnus/gnus-search.el (gnus-search-indexed-extract): Had the wrong name on the generic. diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 8b71daa9ff..fad120ad8e 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1315,7 +1315,7 @@ filenames, sometimes with additional information. Returns a list of viable results, in the form of a list of [group article score] vectors.") -(cl-defgeneric gnus-search-index-extract (engine) +(cl-defgeneric gnus-search-indexed-extract (engine) "Extract a single article result from the current buffer. Returns a list of two values: a file name, and a relevancy score. Advances point to the beginning of the next result.") commit 658952a57a48c3cd80d62fcf0199ab9432ef8166 Author: Michael Albinus Date: Wed Nov 11 13:24:50 2020 +0100 Some minor changes to Tramp, do not merge with master * lisp/net/tramp.el (tramp-handle-directory-files) (tramp-handle-directory-files-and-attributes): * lisp/net/tramp-adb.el (tramp-adb-handle-directory-files-and-attributes): * lisp/net/tramp-rclone.el (tramp-rclone-handle-directory-files): * lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files): Add _COUNT. Make the functions forward compatible. * lisp/net/tramp-gvfs.el (tramp-gvfs-enabled): Increase `max-specpdl-size' temporarily. * test/lisp/net/tramp-tests.el (tramp--test-share-p): New defun. (tramp-test05-expand-file-name-relative): Use it. diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 0efe055b08..2f20c8d93e 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -383,7 +383,7 @@ ARGUMENTS to pass to the OPERATION." file-properties))) (defun tramp-adb-handle-directory-files-and-attributes - (directory &optional full match nosort id-format) + (directory &optional full match nosort id-format _count) "Like `directory-files-and-attributes' for Tramp files." (unless (file-exists-p directory) (tramp-error diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index ddb535fea6..e369061664 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -2091,7 +2091,10 @@ This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi." ;; Add completion functions for AFP, DAV, DAVS, SFTP and SMB methods. (when tramp-gvfs-enabled ;; Suppress D-Bus error messages. - (let (tramp-gvfs-dbus-event-vector) + (let (tramp-gvfs-dbus-event-vector + ;; Sometimes, it fails with "Variable binding depth exceeds + ;; max-specpdl-size". Shall be fixed in Emacs 27. + (max-specpdl-size (* 2 max-specpdl-size))) (zeroconf-init tramp-gvfs-zeroconf-domain) (if (zeroconf-list-service-types) (progn diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el index fcbd2010a2..1567a24e27 100644 --- a/lisp/net/tramp-rclone.el +++ b/lisp/net/tramp-rclone.el @@ -300,7 +300,7 @@ file names." (tramp-rclone-flush-directory-cache v))) (defun tramp-rclone-handle-directory-files - (directory &optional full match nosort) + (directory &optional full match nosort _count) "Like `directory-files' for Tramp files." (unless (file-exists-p directory) (tramp-error diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index df6720b99b..4dca040aeb 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1721,7 +1721,7 @@ of." ;; Directory listings. (defun tramp-sh-handle-directory-files-and-attributes - (directory &optional full match nosort id-format) + (directory &optional full match nosort id-format _count) "Like `directory-files-and-attributes' for Tramp files." (unless id-format (setq id-format 'integer)) (unless (file-exists-p directory) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 902fcf4b6e..b76308ac44 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -695,7 +695,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." v 'file-error "%s `%s'" (match-string 0) filename)))))) (defun tramp-smb-handle-directory-files - (directory &optional full match nosort) + (directory &optional full match nosort _count) "Like `directory-files' for Tramp files." (unless (file-exists-p directory) (tramp-error diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index e7432f2aa0..08bc0ffdd7 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3102,7 +3102,8 @@ User is always nil." (setq directory (substring directory 0 -1))) directory) -(defun tramp-handle-directory-files (directory &optional full match nosort) +(defun tramp-handle-directory-files + (directory &optional full match nosort _count) "Like `directory-files' for Tramp files." (unless (file-exists-p directory) (tramp-error @@ -3121,7 +3122,7 @@ User is always nil." (if nosort result (sort result #'string<))))) (defun tramp-handle-directory-files-and-attributes - (directory &optional full match nosort id-format) + (directory &optional full match nosort id-format _count) "Like `directory-files-and-attributes' for Tramp files." (mapcar (lambda (x) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index cc9ccefb0d..cc65421619 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2144,20 +2144,14 @@ properly. BODY shall not contain a timeout." "/method:host:/:/~/path/file")))) ;; The following test is inspired by Bug#26911 and Bug#34834. They -;; are rather bugs in `expand-file-name', and it fails for all Emacs -;; versions prior 28.1. Test added for later, when they are fixed. +;; were bugs in `expand-file-name'. (ert-deftest tramp-test05-expand-file-name-relative () "Check `expand-file-name'." - :expected-result (if (>= emacs-major-version 28) :passed :failed) (skip-unless (tramp--test-enabled)) - - ;; These are the methods the test doesn't fail. - (when (or (tramp--test-adb-p) (tramp--test-ange-ftp-p) (tramp--test-gvfs-p) - (tramp--test-rclone-p) - (tramp-smb-file-name-p tramp-test-temporary-file-directory)) - (setf (ert-test-expected-result-type - (ert-get-test 'tramp-test05-expand-file-name-relative)) - :passed)) + ;; The bugs are fixed in Emacs 28.1. + (skip-unless (tramp--test-emacs28-p)) + ;; Methods with a share do not expand "/path/..". + (skip-unless (not (tramp--test-share-p))) (should (string-equal @@ -5517,6 +5511,13 @@ This does not support special file names." (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) 'tramp-sh-file-name-handler)) +(defun tramp--test-share-p () + "Check, whether the method needs a share." + (and (tramp--test-gvfs-p) + (string-match-p + "^\\(afp\\|davs?\\|smb\\)$" + (file-remote-p tramp-test-temporary-file-directory 'method)))) + (defun tramp--test-sudoedit-p () "Check, whether the sudoedit method is used." (tramp-sudoedit-file-name-p tramp-test-temporary-file-directory)) commit e7b4f465e8b2ec1c8d54a611db7eca44ae350711 Author: Dario Gjorgjevski Date: Wed Nov 11 12:27:59 2020 +0100 Fix python-font-lock-keywords-maximum-decoration performance regression * lisp/progmodes/python.el (python-font-lock-keywords-maximum-decoration): `symbol-name' should not be quantified by a `+' as it is redundant and performs very badly (bug#44572). diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index eb84b494e3..a179318589 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -662,14 +662,11 @@ builtins.") ;; assignments ;; support for a = b = c = 5 (,(lambda (limit) - (let ((re (python-rx (group (+ symbol-name)) - (? ?\[ (+ (not ?\])) ?\]) - (* space) - ;; A type, like " : int ". - (? ?: - (* space) - (+ not-simple-operator) - (* space)) + (let ((re (python-rx (group symbol-name) + ;; subscript, like "[5]" + (? ?\[ (+ (not ?\])) ?\]) (* space) + ;; type hint, like ": int" or ": Mapping[int, str]" + (? ?: (* space) (+ not-simple-operator) (* space)) assignment-operator)) (res nil)) (while (and (setq res (re-search-forward re limit t)) @@ -679,9 +676,9 @@ builtins.") (1 font-lock-variable-name-face nil nil)) ;; support for a, b, c = (1, 2, 3) (,(lambda (limit) - (let ((re (python-rx (group (+ symbol-name)) (* space) - (* ?, (* space) (+ symbol-name) (* space)) - ?, (* space) (+ symbol-name) (* space) + (let ((re (python-rx (group symbol-name) (* space) + (* ?, (* space) symbol-name (* space)) + ?, (* space) symbol-name (* space) assignment-operator)) (res nil)) (while (and (setq res (re-search-forward re limit t)) commit daecf6d210c7e6b97ab239b24e3a335facc62891 Author: Lars Ingebrigtsen Date: Wed Nov 11 10:59:47 2020 +0100 Remove mention of global-cedet-m3-minor-mode * lisp/cedet/semantic.el (semantic-submode-list): (semantic-default-submodes): Remove mention of global-cedet-m3-minor-mode, which no longer exists, apparently (bug#44565). diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el index 71321e12da..1be0e33c5f 100644 --- a/lisp/cedet/semantic.el +++ b/lisp/cedet/semantic.el @@ -978,7 +978,6 @@ Prevent this load system from loading files in twice.") global-semanticdb-minor-mode global-semantic-idle-summary-mode global-semantic-mru-bookmark-mode - global-cedet-m3-minor-mode global-semantic-idle-local-symbol-highlight-mode global-semantic-highlight-edits-mode global-semantic-show-unmatched-syntax-mode @@ -1000,7 +999,6 @@ The possible elements of this list include the following: `global-semantic-stickyfunc-mode' - Show current fun in header line. `global-semantic-mru-bookmark-mode' - Provide `switch-to-buffer'-like keybinding for tag names. - `global-cedet-m3-minor-mode' - A mouse 3 context menu. `global-semantic-idle-local-symbol-highlight-mode' - Highlight references of the symbol under point. The following modes are more targeted at people who want to see commit 296e4dd15e3754fdddf70d33f2d630462d4b3309 Author: Dario Gjorgjevski Date: Wed Nov 11 10:49:04 2020 +0100 Fix font lock of assignments with type hints in Python * lisp/progmodes/python.el (python-font-lock-keywords-maximum-decoration): Fix regular expressions for font lock of assignments with type hints (bug#44568). The font lock of assignments with type hints in Python is rather bad. Consider the following example: from typing import Mapping, Tuple, Sequence var1: int = 5 var2: Mapping[int, int] = {10: 1024} var3: Mapping[Tuple[int, int], int] = {(2, 5): 32} var4: Sequence[Sequence[int]] = [[1], [1, 2], [1, 2, 3]] var5: Sequence[Mapping[str, Sequence[str]]] = [ { 'red': ['scarlet', 'vermilion', 'ruby'], 'green': ['emerald green', 'aqua'] }, { 'sword': ['cutlass', 'rapier'] } ] As things stand right now, only ‘var1’ would be highlighted. To make things worse, the ‘Mapping’ type hint of ‘var2’ would also be highlighted, which is entirely incorrect. This commit makes all of ‘var1’ through ‘var5’ be highlighted correctly. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 378ff8cc2c..eb84b494e3 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -662,10 +662,14 @@ builtins.") ;; assignments ;; support for a = b = c = 5 (,(lambda (limit) - (let ((re (python-rx (group (+ (any word ?. ?_))) - (? ?\[ (+ (not (any ?\]))) ?\]) (* space) + (let ((re (python-rx (group (+ symbol-name)) + (? ?\[ (+ (not ?\])) ?\]) + (* space) ;; A type, like " : int ". - (? ?: (* space) (+ (any word ?. ?_)) (* space)) + (? ?: + (* space) + (+ not-simple-operator) + (* space)) assignment-operator)) (res nil)) (while (and (setq res (re-search-forward re limit t)) @@ -675,9 +679,9 @@ builtins.") (1 font-lock-variable-name-face nil nil)) ;; support for a, b, c = (1, 2, 3) (,(lambda (limit) - (let ((re (python-rx (group (+ (any word ?. ?_))) (* space) - (* ?, (* space) (+ (any word ?. ?_)) (* space)) - ?, (* space) (+ (any word ?. ?_)) (* space) + (let ((re (python-rx (group (+ symbol-name)) (* space) + (* ?, (* space) (+ symbol-name) (* space)) + ?, (* space) (+ symbol-name) (* space) assignment-operator)) (res nil)) (while (and (setq res (re-search-forward re limit t)) commit 9038890ae21eed644251df9511cfda298a594ed9 Author: Harald Jörg Date: Wed Nov 11 10:42:44 2020 +0100 Cleanup of the test file for cperl-mode * test/lisp/progmodes/cperl-mode-tests.el (cperl--run-test-cases): New macro, factored out from various indentation / rewriting tests. Contains documentation of the format used by the cperl-mode-resources files. (cperl-test-bug-19709): Replace 'next-line' by 'forward-line'. (cperl-test-indent-exp), (cperl-test-indent-styles), (cperl-test-bug-30393): Use the new macro. (cperl-test-bug-19709): Make fit for Emacs 26. (cperl-test-indent-styles): Skip for Perl mode (bug#44561). diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index bd8a1a9f16..a0dd391840 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -34,6 +34,8 @@ (require 'ert) (require 'ert-x) +;;; Utilities + (defun cperl-test-ppss (text regexp) "Return the `syntax-ppss' of the first character matched by REGEXP in TEXT." (interactive) @@ -44,48 +46,98 @@ (re-search-forward regexp) (syntax-ppss))) -(ert-deftest cperl-mode-test-bug-42168 () - "Verify that '/' is a division after ++ or --, not a regexp. -Reported in https://github.com/jrockway/cperl-mode/issues/45. -If seen as regular expression, then the slash is displayed using -font-lock-constant-face. If seen as a division, then it doesn't -have a face property." - :tags '(:fontification) - ;; The next two Perl expressions have divisions. Perl "punctuation" - ;; operators don't get a face. - (let ((code "{ $a++ / $b }")) - (should (equal (nth 8 (cperl-test-ppss code "/")) nil))) - (let ((code "{ $a-- / $b }")) - (should (equal (nth 8 (cperl-test-ppss code "/")) nil))) - ;; The next two Perl expressions have regular expressions. The - ;; delimiter of a RE is fontified with font-lock-constant-face. - (let ((code "{ $a+ / $b } # /")) - (should (equal (nth 8 (cperl-test-ppss code "/")) 7))) - (let ((code "{ $a- / $b } # /")) - (should (equal (nth 8 (cperl-test-ppss code "/")) 7)))) +(defmacro cperl--run-test-cases (file &rest body) + "Run all test cases in FILE with BODY. +This macro helps with tests which reformat Perl code, e.g. when +indenting or rearranging flow control. It extracts source code +snippets and corresponding expected results from a resource file, +runs BODY on the snippets, and compares the resulting buffer with +the expected results. -(ert-deftest cperl-mode-test-bug-16368 () - "Verify that `cperl-forward-group-in-re' doesn't hide errors." +Test cases in FILE are formatted like this: + +# -------- NAME: input -------- +Your input to the test case comes here. +Both input and expected output may span several lines. +# -------- NAME: expected output -------- +The expected output from running BODY on the input goes here. +# -------- NAME: end -------- + +You can have many of these blocks in one test file. You can +chose a NAME for each block, which is passed to the 'should' +clause for easy identification of the first test case that +failed (if any). Text outside these the blocks is ignored by the +tests, so you can use it to document the test cases if you wish." + `(with-temp-buffer + (insert-file-contents ,file) + (goto-char (point-min)) + (while (re-search-forward + (concat "^# ?-+ \\_<\\(?1:.+?\\)\\_>: input ?-+\n" + "\\(?2:\\(?:.*\n\\)+?\\)" + "# ?-+ \\1: expected output ?-+\n" + "\\(?3:\\(?:.*\n\\)+?\\)" + "# ?-+ \\1: end ?-+") + nil t) + (let ((name (match-string 1)) + (code (match-string 2)) + (expected (match-string 3)) + got) + (with-temp-buffer + (insert code) + (goto-char (point-min)) + (funcall cperl-test-mode) + ,@body + (setq expected (concat "test case " name ":\n" expected)) + (setq got (concat "test case " name ":\n" (buffer-string))) + (should (equal got expected))))))) + +;;; Indentation tests + +(ert-deftest cperl-test-indent-exp () + "Run various tests for `cperl-indent-exp' edge cases. +These exercise some standard blocks and also the special +treatment for Perl expressions where a closing paren isn't the +end of the statement." (skip-unless (eq cperl-test-mode #'cperl-mode)) - (let ((code "/(\\d{4})(?{2}/;") ; the regex from the bug report - (result)) - (with-temp-buffer - (insert code) - (goto-char 9) - (setq result (cperl-forward-group-in-re)) - (should (equal (car result) 'scan-error)) - (should (equal (nth 1 result) "Unbalanced parentheses")) - (should (= (point) 9)))) ; point remains unchanged on error - (let ((code "/(\\d{4})(?{2})/;") ; here all parens are balanced - (result)) + (cperl--run-test-cases + (ert-resource-file "cperl-indent-exp.pl") + (cperl-indent-exp))) ; here we go! + +(ert-deftest cperl-test-indent-styles () + (skip-unless (eq cperl-test-mode #'cperl-mode)) + (cperl--run-test-cases + (ert-resource-file "cperl-indent-styles.pl") + (cperl-set-style "PBP") + (indent-region (point-min) (point-max)) ; here we go! + (cperl-set-style-back))) + +;;; Fontification tests + +(ert-deftest cperl-test-fontify-punct-vars () + "Test fontification of Perl's punctiation variables. +Perl has variable names containing unbalanced quotes for the list +separator $\" and pre- and postmatch $` and $'. A reference to +these variables, for example \\$\", should not cause the dollar +to be escaped, which would then start a string beginning with the +quote character. This used to be broken in cperl-mode at some +point in the distant past, and is still broken in perl-mode. " + (skip-unless (eq cperl-test-mode #'cperl-mode)) + (let ((file (ert-resource-file "fontify-punctuation-vars.pl"))) (with-temp-buffer - (insert code) - (goto-char 9) - (setq result (cperl-forward-group-in-re)) - (should (equal result nil)) - (should (= (point) 15))))) ; point has skipped the group + (insert-file-contents file) + (goto-char (point-min)) + (funcall cperl-test-mode) + (while (search-forward "##" nil t) + ;; The third element of syntax-ppss is true if in a string, + ;; which would indicate bad interpretation of the quote. The + ;; fourth element is true if in a comment, which should be the + ;; case. + (should (equal (nth 3 (syntax-ppss)) nil)) + (should (equal (nth 4 (syntax-ppss)) t)))))) -(defun cperl-mode-test--run-bug-10483 () +;;; Tests for issues reported in the Bug Tracker + +(defun cperl-test--run-bug-10483 () "Runs a short program, intended to be under timer scrutiny. This function is intended to be used by an Emacs subprocess in batch mode. The message buffer is used to report the result of @@ -102,7 +154,7 @@ indentation actually takes place.." (cperl-indent-exp) (message "%s" (buffer-string))))) -(ert-deftest cperl-mode-test-bug-10483 () +(ert-deftest cperl-test-bug-10483 () "Check that indenting certain perl code does not loop forever. This verifies that indenting a piece of code that ends in a paren without a statement terminator on the same line does not loop @@ -113,7 +165,7 @@ under timeout control." (skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; FIXME times out (skip-unless (not (< emacs-major-version 28))) ; times out in older Emacsen (let* ((emacs (concat invocation-directory invocation-name)) - (test-function 'cperl-mode-test--run-bug-10483) + (test-function 'cperl-test--run-bug-10483) (test-function-name (symbol-name test-function)) (test-file (symbol-file test-function 'defun)) (ran-out-of-time nil) @@ -138,156 +190,54 @@ under timeout control." (should (string-match "poop ('foo', \n 'bar')" (buffer-string)))))) -(ert-deftest cperl-mode-test-indent-exp () - "Run various tests for `cperl-indent-exp' edge cases. -These exercise some standard blocks and also the special -treatment for Perl expressions where a closing paren isn't the -end of the statement." - (skip-unless (eq cperl-test-mode #'cperl-mode)) - (let ((file (ert-resource-file "cperl-indent-exp.pl"))) - (with-temp-buffer - (insert-file-contents file) - (goto-char (point-min)) - (while (re-search-forward - (concat "^# ?-+ \\_<\\(?1:.+?\\)\\_>: input ?-+\n" - "\\(?2:\\(?:.*\n\\)+?\\)" - "# ?-+ \\1: expected output ?-+\n" - "\\(?3:\\(?:.*\n\\)+?\\)" - "# ?-+ \\1: end ?-+") - nil t) - (let ((name (match-string 1)) - (code (match-string 2)) - (expected (match-string 3)) - got) - (with-temp-buffer - (insert code) - (cperl-mode) - (goto-char (point-min)) - (cperl-indent-exp) ; here we go! - (setq expected (concat "test case " name ":\n" expected)) - (setq got (concat "test case " name ":\n" (buffer-string))) - (should (equal got expected)))))))) - -(ert-deftest cperl-mode-test-indent-styles () - "Verify correct indentation by style \"PBP\". -Perl Best Practices sets some indentation values different from - the defaults, and also wants an \"else\" or \"elsif\" keyword - to align with the \"if\"." - (let ((file (ert-resource-file "cperl-indent-styles.pl"))) - (with-temp-buffer - (cperl-set-style "PBP") - (insert-file-contents file) - (goto-char (point-min)) - (while (re-search-forward - (concat "^# ?-+ \\_<\\(?1:.+?\\)\\_>: input ?-+\n" - "\\(?2:\\(?:.*\n\\)+?\\)" - "# ?-+ \\1: expected output ?-+\n" - "\\(?3:\\(?:.*\n\\)+?\\)" - "# ?-+ \\1: end ?-+") - nil t) - (let ((name (match-string 1)) - (code (match-string 2)) - (expected (match-string 3)) - got) - (with-temp-buffer - (insert code) - (cperl-mode) - (indent-region (point-min) (point-max)) ; here we go! - (setq expected (concat "test case " name ":\n" expected)) - (setq got (concat "test case " name ":\n" (buffer-string))) - (should (equal got expected))))) - (cperl-set-style "CPerl")))) - -(ert-deftest cperl-mode-fontify-punct-vars () - "Test fontification of Perl's punctiation variables. -Perl has variable names containing unbalanced quotes for the list -separator $\" and pre- and postmatch $` and $'. A reference to -these variables, for example \\$\", should not cause the dollar -to be escaped, which would then start a string beginning with the -quote character. This used to be broken in cperl-mode at some -point in the distant past, and is still broken in perl-mode. " +(ert-deftest cperl-test-bug-16368 () + "Verify that `cperl-forward-group-in-re' doesn't hide errors." (skip-unless (eq cperl-test-mode #'cperl-mode)) - (let ((file (ert-resource-file "fontify-punctuation-vars.pl"))) + (let ((code "/(\\d{4})(?{2}/;") ; the regex from the bug report + (result)) (with-temp-buffer - (insert-file-contents file) - (goto-char (point-min)) - (funcall cperl-test-mode) - (while (search-forward "##" nil t) - ;; The third element of syntax-ppss is true if in a string, - ;; which would indicate bad interpretation of the quote. The - ;; fourth element is true if in a comment, which should be the - ;; case. - (should (equal (nth 3 (syntax-ppss)) nil)) - (should (equal (nth 4 (syntax-ppss)) t)))))) - -(ert-deftest cperl-bug30393 () - "Verify that indentation is not disturbed by an open paren in col 0. -Perl is not Lisp: An open paren in column 0 does not start a function." - (let ((file (ert-resource-file "cperl-bug-30393.pl"))) + (insert code) + (goto-char 9) + (setq result (cperl-forward-group-in-re)) + (should (equal (car result) 'scan-error)) + (should (equal (nth 1 result) "Unbalanced parentheses")) + (should (= (point) 9)))) ; point remains unchanged on error + (let ((code "/(\\d{4})(?{2})/;") ; here all parens are balanced + (result)) (with-temp-buffer - (insert-file-contents file) - (goto-char (point-min)) - (while (re-search-forward - (concat "^# ?-+ \\_<\\(?1:.+?\\)\\_>: input ?-+\n" - "\\(?2:\\(?:.*\n\\)+?\\)" - "# ?-+ \\1: expected output ?-+\n" - "\\(?3:\\(?:.*\n\\)+?\\)" - "# ?-+ \\1: end ?-+") - nil t) - (let ((name (match-string 1)) - (code (match-string 2)) - (expected (match-string 3)) - got) - (with-temp-buffer - (insert code) - (funcall cperl-test-mode) - (goto-char (point-min)) - (while (null (eobp)) - (cperl-indent-command) - (forward-line 1)) - (setq expected (concat "test case " name ":\n" expected)) - (setq got (concat "test case " name ":\n" (buffer-string))) - (should (equal got expected)))))))) + (insert code) + (goto-char 9) + (setq result (cperl-forward-group-in-re)) + (should (equal result nil)) + (should (= (point) 15))))) ; point has skipped the group -(ert-deftest cperl-bug19709 () +(ert-deftest cperl-test-bug-19709 () "Verify that indentation of closing paren works as intended. Note that Perl mode has no setting for close paren offset, per documentation it does the right thing anyway." - (let ((file (ert-resource-file "cperl-bug-19709.pl"))) - (with-temp-buffer - (insert-file-contents file) - (goto-char (point-min)) - (while (re-search-forward - (concat "^# ?-+ \\_<\\(?1:.+?\\)\\_>: input ?-+\n" - "\\(?2:\\(?:.*\n\\)+?\\)" - "# ?-+ \\1: expected output ?-+\n" - "\\(?3:\\(?:.*\n\\)+?\\)" - "# ?-+ \\1: end ?-+") - nil t) - (let ((name (match-string 1)) - (code (match-string 2)) - (expected (match-string 3)) - got) - (with-temp-buffer - (insert code) - (funcall cperl-test-mode) - (setq-local - ;; settings from the bug report - cperl-indent-level 4 - cperl-indent-parens-as-block t - cperl-close-paren-offset -4 - ;; same, adapted for per-mode - perl-indent-level 4 - perl-indent-parens-as-block t) - (goto-char (point-min)) - (while (null (eobp)) - (cperl-indent-command) - (next-line)) - (setq expected (concat "test case " name ":\n" expected)) - (setq got (concat "test case " name ":\n" (buffer-string))) - (should (equal got expected)))))))) + (cperl--run-test-cases + (ert-resource-file "cperl-bug-19709.pl") + ;; settings from the bug report + (setq-local cperl-indent-level 4) + (setq-local cperl-indent-parens-as-block t) + (setq-local cperl-close-paren-offset -4) + ;; same, adapted for per-mode + (setq-local perl-indent-level 4) + (setq-local perl-indent-parens-as-block t) + (while (null (eobp)) + (cperl-indent-command) + (forward-line 1)))) -(ert-deftest cperl-bug37127 () +(ert-deftest cperl-test-bug-30393 () + "Verify that indentation is not disturbed by an open paren in col 0. +Perl is not Lisp: An open paren in column 0 does not start a function." + (cperl--run-test-cases + (ert-resource-file "cperl-bug-30393.pl") + (while (null (eobp)) + (cperl-indent-command) + (forward-line 1)))) + +(ert-deftest cperl-test-bug-37127 () "Verify that closing a paren in a regex goes without a message. Also check that the message is issued if the regex terminator is missing." @@ -327,4 +277,24 @@ missing." (should (string-match "^End of .* string/RE" collected-messages))))) +(ert-deftest cperl-test-bug-42168 () + "Verify that '/' is a division after ++ or --, not a regexp. +Reported in https://github.com/jrockway/cperl-mode/issues/45. +If seen as regular expression, then the slash is displayed using +font-lock-constant-face. If seen as a division, then it doesn't +have a face property." + :tags '(:fontification) + ;; The next two Perl expressions have divisions. Perl "punctuation" + ;; operators don't get a face. + (let ((code "{ $a++ / $b }")) + (should (equal (nth 8 (cperl-test-ppss code "/")) nil))) + (let ((code "{ $a-- / $b }")) + (should (equal (nth 8 (cperl-test-ppss code "/")) nil))) + ;; The next two Perl expressions have regular expressions. The + ;; delimiter of a RE is fontified with font-lock-constant-face. + (let ((code "{ $a+ / $b } # /")) + (should (equal (nth 8 (cperl-test-ppss code "/")) 7))) + (let ((code "{ $a- / $b } # /")) + (should (equal (nth 8 (cperl-test-ppss code "/")) 7)))) + ;;; cperl-mode-tests.el ends here commit f2bb5747f0b548b6de1f639adf1c106de6fae499 Author: Stefan Monnier Date: Tue Nov 10 23:26:28 2020 -0500 * lisp/server.el: Refactor frame creation functions (server--create-frame): New function, extracted from `server-create-dumb-terminal-frame`. (server-create-window-system-frame, server-create-tty-frame): (server-create-dumb-terminal-frame): Use it. diff --git a/lisp/server.el b/lisp/server.el index 734fb8a34a..763f651fef 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -832,7 +832,6 @@ This handles splitting the command if it would be bigger than (error "Invalid terminal device")) (unless type (error "Invalid terminal type")) - (add-to-list 'frame-inherited-parameters 'client) (let ((frame (server-with-environment (process-get proc 'env) @@ -844,32 +843,19 @@ This handles splitting the command if it would be bigger than "TERMINFO_DIRS" "TERMPATH" ;; rxvt wants these "COLORFGBG" "COLORTERM") - (make-frame `((window-system . nil) - (tty . ,tty) - (tty-type . ,type) - ;; Ignore nowait here; we always need to - ;; clean up opened ttys when the client dies. - (client . ,proc) - ;; This is a leftover from an earlier - ;; attempt at making it possible for process - ;; run in the server process to use the - ;; environment of the client process. - ;; It has no effect now and to make it work - ;; we'd need to decide how to make - ;; process-environment interact with client - ;; envvars, and then to change the - ;; C functions `child_setup' and - ;; `getenv_internal' accordingly. - (environment . ,(process-get proc 'env)) - ,@parameters))))) + (server--create-frame + ;; Ignore nowait here; we always need to + ;; clean up opened ttys when the client dies. + nil proc + `((window-system . nil) + (tty . ,tty) + (tty-type . ,type) + ,@parameters))))) ;; ttys don't use the `display' parameter, but callproc.c does to set ;; the DISPLAY environment on subprocesses. (set-frame-parameter frame 'display (getenv-internal "DISPLAY" (process-get proc 'env))) - (select-frame frame) - (process-put proc 'frame frame) - (process-put proc 'terminal (frame-terminal frame)) frame)) (defun server-create-window-system-frame (display nowait proc parent-id @@ -895,25 +881,12 @@ This handles splitting the command if it would be bigger than ) (cond (w - ;; Flag frame as client-created, but use a dummy client. - ;; This will prevent the frame from being deleted when - ;; emacsclient quits while also preventing - ;; `server-save-buffers-kill-terminal' from unexpectedly - ;; killing emacs on that frame. - (let* ((params `((client . ,(if nowait 'nowait proc)) - ;; This is a leftover, see above. - (environment . ,(process-get proc 'env)) - ,@parameters)) - frame) - (if parent-id - (push (cons 'parent-id (string-to-number parent-id)) params)) - (add-to-list 'frame-inherited-parameters 'client) - (setq frame (make-frame-on-display display params)) - (server-log (format "%s created" frame) proc) - (select-frame frame) - (process-put proc 'frame frame) - (process-put proc 'terminal (frame-terminal frame)) - frame)) + (server--create-frame + nowait proc + `((display . ,display) + ,@(if parent-id + `((parent-id . ,(string-to-number parent-id)))) + ,@parameters))) (t (server-log "Window system unsupported" proc) @@ -921,16 +894,41 @@ This handles splitting the command if it would be bigger than nil)))) (defun server-create-dumb-terminal-frame (nowait proc &optional parameters) + ;; If the destination is a dumb terminal, we can't really run Emacs + ;; in its tty. So instead, we use whichever terminal is currently + ;; selected. This situation typically occurs when `emacsclient' is + ;; running inside something like an Emacs shell buffer (bug#25547). + (let ((frame (server--create-frame nowait proc parameters))) + ;; The client is not the exclusive owner of this terminal, so don't + ;; delete the terminal when the client exits. + ;; FIXME: Maybe we just shouldn't set the `terminal' property instead? + (process-put proc 'no-delete-terminal t) + frame)) + +(defun server--create-frame (nowait proc parameters) (add-to-list 'frame-inherited-parameters 'client) + ;; When `nowait' is set, flag frame as client-created, but use + ;; a dummy client. This will prevent the frame from being deleted + ;; when emacsclient quits while also preventing + ;; `server-save-buffers-kill-terminal' from unexpectedly killing + ;; emacs on that frame. (let ((frame (make-frame `((client . ,(if nowait 'nowait proc)) - ;; This is a leftover, see above. + ;; This is a leftover from an earlier + ;; attempt at making it possible for process + ;; run in the server process to use the + ;; environment of the client process. + ;; It has no effect now and to make it work + ;; we'd need to decide how to make + ;; process-environment interact with client + ;; envvars, and then to change the + ;; C functions `child_setup' and + ;; `getenv_internal' accordingly. (environment . ,(process-get proc 'env)) ,@parameters)))) (server-log (format "%s created" frame) proc) (select-frame frame) (process-put proc 'frame frame) (process-put proc 'terminal (frame-terminal frame)) - (process-put proc 'no-delete-terminal t) frame)) (defun server-goto-toplevel (proc) @@ -1280,11 +1278,6 @@ The following commands are accepted by the client: (setq tty-name nil tty-type nil) (if display (server-select-display display))) ((equal tty-type "dumb") - ;; Emacsclient is likely running inside something - ;; like an Emacs shell buffer. We can't run an - ;; Emacs frame in a tty like this, so instead, use - ;; whichever terminal is currently - ;; selected. (bug#25547) (server-create-dumb-terminal-frame nowait proc frame-parameters)) ((or (and (eq system-type 'windows-nt) commit 47f33e6cb0498f2405957539efcb8bd174c602ff Author: Eliza Velasquez Date: Tue Nov 10 22:14:03 2020 -0500 * lisp/server.el: Fix frame creation on dumb terminals (bug#25547) (server-create-dumb-terminal-frame): New function. (server-process-filter): Use it. (server-delete-client): Don't delete tty terminal when it's not exclusive to this client. diff --git a/lisp/server.el b/lisp/server.el index a660deab8e..734fb8a34a 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -354,9 +354,11 @@ Updates `server-clients'." (setq server-clients (delq proc server-clients)) - ;; Delete the client's tty, except on Windows (both GUI and console), - ;; where there's only one terminal and does not make sense to delete it. - (unless (eq system-type 'windows-nt) + ;; Delete the client's tty, except on Windows (both GUI and + ;; console), where there's only one terminal and does not make + ;; sense to delete it, or if we are explicitly told not. + (unless (or (eq system-type 'windows-nt) + (process-get proc 'no-delete-terminal)) (let ((terminal (process-get proc 'terminal))) ;; Only delete the terminal if it is non-nil. (when (and terminal (eq (terminal-live-p terminal) t)) @@ -918,6 +920,19 @@ This handles splitting the command if it would be bigger than (server-send-string proc "-window-system-unsupported \n") nil)))) +(defun server-create-dumb-terminal-frame (nowait proc &optional parameters) + (add-to-list 'frame-inherited-parameters 'client) + (let ((frame (make-frame `((client . ,(if nowait 'nowait proc)) + ;; This is a leftover, see above. + (environment . ,(process-get proc 'env)) + ,@parameters)))) + (server-log (format "%s created" frame) proc) + (select-frame frame) + (process-put proc 'frame frame) + (process-put proc 'terminal (frame-terminal frame)) + (process-put proc 'no-delete-terminal t) + frame)) + (defun server-goto-toplevel (proc) (condition-case nil ;; If we're running isearch, we must abort it to allow Emacs to @@ -1264,6 +1279,14 @@ The following commands are accepted by the client: terminal-frame))))) (setq tty-name nil tty-type nil) (if display (server-select-display display))) + ((equal tty-type "dumb") + ;; Emacsclient is likely running inside something + ;; like an Emacs shell buffer. We can't run an + ;; Emacs frame in a tty like this, so instead, use + ;; whichever terminal is currently + ;; selected. (bug#25547) + (server-create-dumb-terminal-frame nowait proc + frame-parameters)) ((or (and (eq system-type 'windows-nt) (daemonp) (setq display "w32")) commit 79d04ae13ff33a93f631061d912168e9703251dd Author: Juri Linkov Date: Tue Nov 10 21:27:37 2020 +0200 Don't set file name variable in org-element-parse-secondary-string (bug#44524) * lisp/org/org-element.el (org-element-parse-secondary-string): Don't set buffer-local variables buffer-file-name and buffer-file-truename in temporary buffer. diff --git a/lisp/org/org-element.el b/lisp/org/org-element.el index be74dfdbef..ef64f58f81 100644 --- a/lisp/org/org-element.el +++ b/lisp/org/org-element.el @@ -4144,7 +4144,9 @@ If STRING is the empty string or nil, return nil." (dolist (v local-variables) (ignore-errors (if (symbolp v) (makunbound v) - (set (make-local-variable (car v)) (cdr v))))) + ;; Don't set file name to avoid mishandling hooks (bug#44524) + (unless (memq (car v) '(buffer-file-name buffer-file-truename)) + (set (make-local-variable (car v)) (cdr v)))))) ;; Transferring local variables may put the temporary buffer ;; into a read-only state. Make sure we can insert STRING. (let ((inhibit-read-only t)) (insert string)) commit b0f6b83357eb8e301cab2060c7fe2c8d580c2504 Author: Juri Linkov Date: Tue Nov 10 21:21:18 2020 +0200 * lisp/leim/quail/compose.el ("iso-transl"): New input method. * doc/emacs/basic.texi (Inserting Text): Mention transient input method "iso-transl". * lisp/leim/quail/latin-ltx.el: Use same Keywords as in other quail files. diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi index 2e03d0c04a..cd1ffbebd7 100644 --- a/doc/emacs/basic.texi +++ b/doc/emacs/basic.texi @@ -145,6 +145,12 @@ the buffer. A numeric argument to @kbd{C-q} or @kbd{C-x 8 ...} specifies how many copies of the character to insert (@pxref{Arguments}). + As an alternative to @kbd{C-x 8}, you can select the corresponding +transient input method by typing @kbd{C-u C-x \ iso-transl @key{RET}}, +then temporarily activating this transient input method by typing +@kbd{C-x \ [} will insert the same character @t{‘} (@pxref{transient +input method}). + In addition, in some contexts, if you type a quotation using grave accent and apostrophe @kbd{`like this'}, it is converted to a form @t{‘like this’} using single quotation marks, even without @kbd{C-x 8} diff --git a/etc/NEWS b/etc/NEWS index 7eb0b6c5cc..eb532ce67a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -663,6 +663,13 @@ to the search string. --- *** New input method 'compose' based on X Multi_key sequences. +--- +*** New input method 'iso-transl' with the same keys as 'C-x 8'. +After selecting it as a transient input method with 'C-u C-x \ +iso-transl RET', it supports the same key sequences as 'C-x 8', +so e.g. like 'C-x 8 [' inserts a left single quotation mark, +'C-x \ [' does the same. + --- *** Improved language transliteration in Malayalam input methods. Added a new Mozhi scheme. The inapplicable ITRANS scheme is now diff --git a/lisp/leim/quail/compose.el b/lisp/leim/quail/compose.el index eb37a42199..de251a364e 100644 --- a/lisp/leim/quail/compose.el +++ b/lisp/leim/quail/compose.el @@ -2922,5 +2922,31 @@ Examples: ("_⍵" ?⍹) ) +;; Quail package `iso-transl' is based on `C-x 8' key sequences. +;; This input method supports the same key sequences as defined +;; by the `C-x 8' keymap in iso-transl.el. + +(quail-define-package + "iso-transl" "UTF-8" "X8" t + "Use the same key sequences as in `C-x 8' keymap defined in iso-transl.el. +Examples: + * E -> € 1 / 2 -> ½ ^ 3 -> ³" + '(("\t" . quail-completion)) + t nil nil nil nil nil nil nil nil t) + +(eval-when-compile + (require 'iso-transl) + (defmacro iso-transl--define-rules () + `(quail-define-rules + ,@(mapcar (lambda (rule) + (let ((from (car rule)) + (to (cdr rule))) + (list from (if (stringp to) + (vector to) + to)))) + iso-transl-char-map)))) + +(iso-transl--define-rules) + (provide 'compose) ;;; compose.el ends here diff --git a/lisp/leim/quail/latin-ltx.el b/lisp/leim/quail/latin-ltx.el index 6a2508ba31..f1a24bbd5f 100644 --- a/lisp/leim/quail/latin-ltx.el +++ b/lisp/leim/quail/latin-ltx.el @@ -8,7 +8,7 @@ ;; Author: TAKAHASHI Naoto ;; Dave Love -;; Keywords: multilingual, input, Greek, i18n +;; Keywords: multilingual, input method, i18n ;; This file is part of GNU Emacs. commit 621bb79b7044dcc277386eb7338c0eb1e08c29c7 Author: Eli Zaretskii Date: Tue Nov 10 19:41:04 2020 +0200 New debugging command 'malloc-info' * src/alloc.c (Fmalloc_info) [GNU_LINUX]: New command. (syms_of_alloc): Defsubr it. (Bug#43389) diff --git a/src/alloc.c b/src/alloc.c index f90d09265d..2b3643e35b 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -7194,6 +7194,20 @@ Frames, windows, buffers, and subprocesses count as vectors make_int (strings_consed)); } +#ifdef GNU_LINUX +DEFUN ("malloc-info", Fmalloc_info, Smalloc_info, 0, 0, "", + doc: /* Report malloc information to stderr. +This function outputs to stderr an XML-formatted +description of the current state of the memory-allocation +arenas. */) + (void) +{ + if (malloc_info (0, stderr)) + error ("malloc_info failed: %s", emacs_strerror (errno)); + return Qnil; +} +#endif + static bool symbol_uses_obj (Lisp_Object symbol, Lisp_Object obj) { @@ -7538,6 +7552,9 @@ N should be nonnegative. */); defsubr (&Sgarbage_collect); defsubr (&Smemory_info); defsubr (&Smemory_use_counts); +#ifdef GNU_LINUX + defsubr (&Smalloc_info); +#endif defsubr (&Ssuspicious_object); Lisp_Object watcher; commit bce00552654b603bcea665cd53d08fd60e86772f Author: Dmitry Gutov Date: Tue Nov 10 18:08:13 2020 +0200 Clear the vc-state cache when returning nil * lisp/vc/vc-hg.el (vc-hg-registered): Clear the vc-state cache when returning nil. diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index cacdee2226..67e129044c 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -223,7 +223,10 @@ If `ask', you will be prompted for a branch type." "Return non-nil if FILE is registered with hg." (when (vc-hg-root file) ; short cut (let ((state (vc-state file 'Hg))) ; expensive - (and state (not (memq state '(ignored unregistered))))))) + (if (memq state '(ignored unregistered nil)) + ;; Clear the cache for proper fallback to another backend. + (ignore (vc-file-setprop file 'vc-state nil)) + t)))) (defun vc-hg-state (file) "Hg-specific version of `vc-state'." commit b5b0f07b0a4acd6bdbbaf27744cf0e06f54d3008 Author: Tom Fitzhenry Date: Mon Nov 9 22:19:10 2020 +1100 Remove extra process call from vc-hg-registered Prefer vc-state to benefit from its caching (bug#44534) This same technique is used in vc-git.el, per commit 2018-06-28 "Remove extra process call from vc-git-find-file-hook" 93c41ce6aa64b14fc9bd7bdd0d909915a79191cd. * lisp/vc/vc-hg.el (vc-hg-registered): Use vc-state rather than vc-hg-state. diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index cb0657e70a..cacdee2226 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -222,7 +222,7 @@ If `ask', you will be prompted for a branch type." (defun vc-hg-registered (file) "Return non-nil if FILE is registered with hg." (when (vc-hg-root file) ; short cut - (let ((state (vc-hg-state file))) ; expensive + (let ((state (vc-state file 'Hg))) ; expensive (and state (not (memq state '(ignored unregistered))))))) (defun vc-hg-state (file) commit f1eca59dfaca57bab67b5629d7b23a8649820fc0 Author: Eli Zaretskii Date: Tue Nov 10 17:06:46 2020 +0200 Fix a recent change in image.c for MS-Windows * src/image.c: Fix DEF_DLL_FN of rsvg_handle_get_intrinsic_dimensions. Reported by Andy Moreton . diff --git a/src/image.c b/src/image.c index d190c25413..3858f3c41f 100644 --- a/src/image.c +++ b/src/image.c @@ -9546,7 +9546,7 @@ DEF_DLL_FN (gboolean, rsvg_handle_close, (RsvgHandle *, GError **)); # if LIBRSVG_CHECK_VERSION (2, 46, 0) DEF_DLL_FN (void, rsvg_handle_get_intrinsic_dimensions, - RsvgHandle *, gboolean *, RsvgLength *, gboolean *, + (RsvgHandle *, gboolean *, RsvgLength *, gboolean *, RsvgLength *, gboolean *, RsvgRectangle *)); DEF_DLL_FN (gboolean, rsvg_handle_get_geometry_for_layer, (RsvgHandle *, const char *, const RsvgRectangle *, commit ac1a2b216089b03c244c8e7ceb577198eb0dc2c2 Author: Lars Ingebrigtsen Date: Tue Nov 10 14:53:03 2020 +0100 Add more doc-view requirements * lisp/doc-view.el: Add more requirements. diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 7fdd258822..b895377f8d 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -22,10 +22,12 @@ ;;; Requirements: -;; doc-view.el requires GNU Emacs 22.1 or newer. You also need Ghostscript, -;; `dvipdf' (comes with Ghostscript) or `dvipdfm' (comes with teTeX or TeXLive) -;; and `pdftotext', which comes with xpdf (http://www.foolabs.com/xpdf/) or -;; poppler (http://poppler.freedesktop.org/). +;; Viewing PS/PDF/DVI files requires Ghostscript, `dvipdf' (comes with +;; Ghostscript) or `dvipdfm' (comes with teTeX or TeXLive) and +;; `pdftotext', which comes with xpdf (http://www.foolabs.com/xpdf/) +;; or poppler (http://poppler.freedesktop.org/). +;; Djvu documents require `ddjvu' (from DjVuLibre). +;; ODF files require `soffice' (from LibreOffice). ;;; Commentary: commit 515791ae8aa9283de381ace82abda96319a0e4f2 Author: Steven Allen Date: Tue Nov 10 10:02:15 2020 +0100 Only use nbutlast when we actually want to modify the original list * lisp/net/tramp-gvfs.el (tramp-gvfs-dbus-byte-array-to-string): Don't modify the byte array. * lisp/net/tramp-integration.el (tramp-eshell-directory-change): Don't modify the underlying exec-path. diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 8f8e628ab9..86fb45a43b 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -876,7 +876,7 @@ Return nil for null BYTE-ARRAY." byte-array (car byte-array)))) (dbus-byte-array-to-string (if (and (consp byte-array) (zerop (car (last byte-array)))) - (nbutlast byte-array) byte-array)))) + (butlast byte-array) byte-array)))) (defun tramp-gvfs-stringify-dbus-message (message) "Convert a D-Bus MESSAGE into readable UTF8 strings, used for traces." diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el index f712600072..7e4a9bf05e 100644 --- a/lisp/net/tramp-integration.el +++ b/lisp/net/tramp-integration.el @@ -132,7 +132,7 @@ been set up by `rfn-eshadow-setup-minibuffer'." ;; Use `path-separator' as it does eshell. (setq eshell-path-env (mapconcat - #'identity (nbutlast (tramp-compat-exec-path)) path-separator))) + #'identity (butlast (tramp-compat-exec-path)) path-separator))) (with-eval-after-load 'esh-util (add-hook 'eshell-mode-hook commit ee11a68320eeb8bb90ded9773c02d7863abca3d7 Author: Andrew G Cohen Date: Tue Nov 10 08:19:43 2020 +0800 Remove ephemeral group on error or null result * lisp/gnus/nnselect.el (nnselect-request-group): If an ephemeral group is empty, there is nothing to see, so remove the group. (nnselect-run): Catch and return an empty artlist on error. diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index ce2e99de05..e4753fe95c 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -295,6 +295,10 @@ If this variable is nil, or if the provided function returns nil, (if (zerop (setq length (nnselect-artlist-length nnselect-artlist))) (progn (nnheader-report 'nnselect "Selection produced empty results.") + (when (gnus-ephemeral-group-p group) + (gnus-kill-ephemeral-group group) + (setq gnus-ephemeral-servers + (assq-delete-all 'nnselect gnus-ephemeral-servers))) (nnheader-insert "")) (with-current-buffer nntp-server-buffer (nnheader-insert "211 %d %d %d %s\n" @@ -769,8 +773,10 @@ If this variable is nil, or if the provided function returns nil, Return an article list." (let ((func (alist-get 'nnselect-function specs)) (args (alist-get 'nnselect-args specs))) - (funcall func args))) - + (condition-case err + (funcall func args) + (error (gnus-error 3 "nnselect-run: %s on %s gave error %s" func args err) + [])))) (defun nnselect-search-thread (header) "Make an nnselect group containing the thread with article HEADER. commit ae3904bb5df1136cd6e8fb9d53cc2e081cf2fd01 Author: Alan Mackenzie Date: Mon Nov 9 21:19:19 2020 +0000 CC Mode: fix many compiler warnings which would appear with lexical binding * lisp/progmodes/cc-align.el (three places) prefix langelem with a _. * lisp/progmodes/cc-{cmds,engine}.el: Remove superfluous local variables. * lisp/progmodes/cc-defs.el (c-will-be-unescaped): Remove unused parameter end. * lisp/progmodes/cc-engine.el (c-looking-at-decl-block): Remove unused parameter containing-sexp. (c-looking-at-special-brace-list); Remove unused parameter lim. (c-add-class-syntax): Remove unused parameter paren-state. diff --git a/lisp/progmodes/cc-align.el b/lisp/progmodes/cc-align.el index 6172afecbc..7884d4bd2e 100644 --- a/lisp/progmodes/cc-align.el +++ b/lisp/progmodes/cc-align.el @@ -1115,7 +1115,7 @@ arglist-cont." (vector (+ (current-column) c-basic-offset)))) (vector 0))))) -(defun c-lineup-2nd-brace-entry-in-arglist (langelem) +(defun c-lineup-2nd-brace-entry-in-arglist (_langelem) "Lineup the second entry of a brace block under the first, when the first line is also contained in an arglist or an enclosing brace ON THAT LINE. @@ -1156,7 +1156,7 @@ Works with brace-list-intro." (eq (char-after) ?{)))) 'c-lineup-arglist-intro-after-paren)) -(defun c-lineup-class-decl-init-+ (langelem) +(defun c-lineup-class-decl-init-+ (_langelem) "Line up the second entry of a class (etc.) initializer c-basic-offset characters in from the identifier when: \(i) The type is a class, struct, union, etc. (but not an enum); @@ -1197,7 +1197,7 @@ Works with: brace-list-intro." (eq (point) init-pos) (vector (+ (current-column) c-basic-offset))))))) -(defun c-lineup-class-decl-init-after-brace (langelem) +(defun c-lineup-class-decl-init-after-brace (_langelem) "Line up the second entry of a class (etc.) initializer after its opening brace when: \(i) The type is a class, struct, union, etc. (but not an enum); diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 4425e275ac..0ce3b3f6ed 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -907,7 +907,6 @@ settings of `c-cleanup-list' are done." (when (and (boundp 'electric-pair-mode) electric-pair-mode) (let ((size (buffer-size)) - (c-in-electric-pair-functionality t) post-self-insert-hook) (electric-pair-post-self-insert-function) (setq got-pair-} (and at-eol @@ -2327,7 +2326,7 @@ with a brace block, at the outermost level of nesting." (c-save-buffer-state ((paren-state (c-parse-state)) (orig-point-min (point-min)) (orig-point-max (point-max)) - lim name where limits fdoc) + lim name limits where) (setq lim (c-widen-to-enclosing-decl-scope paren-state orig-point-min orig-point-max)) (and lim (setq lim (1- lim))) diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index 77e263f1aa..c82b3a34e3 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el @@ -434,9 +434,8 @@ to it is returned. This function does not modify the point or the mark." (setq count (+ count (skip-chars-backward "\\\\")))) (not (zerop (logand count 1)))))) -(defmacro c-will-be-unescaped (beg end) - ;; Would the character after END be unescaped after the removal of (BEG END)? - ;; This is regardless of its current status. It is assumed that (>= POS END). +(defmacro c-will-be-unescaped (beg) + ;; Would the character after BEG be unescaped? `(save-excursion (let (count) (goto-char ,beg) diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 75e2f0d21f..252eec138c 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -2705,7 +2705,7 @@ comment at the start of cc-engine.el for more info." (if (and (consp elt) (>= (length elt) 3)) ;; Inside a string or comment (let ((depth 0) (containing nil) (last nil) - in-string in-comment (after-quote nil) + in-string in-comment (min-depth 0) com-style com-str-start (intermediate nil) (char-1 (nth 3 elt)) ; first char of poss. 2-char construct (pos (car elt)) @@ -3024,7 +3024,7 @@ comment at the start of cc-engine.el for more info." (defun c-full-trim-near-cache () ;; Remove stale entries in `c-full-lit-near-cache', i.e. those whose END ;; entries, or positions, are above `c-full-near-cache-limit'. - (let ((nc-list c-full-lit-near-cache) elt) + (let ((nc-list c-full-lit-near-cache)) (while nc-list (let ((elt (car nc-list))) (if (if (car (cddr elt)) @@ -7625,8 +7625,7 @@ comment at the start of cc-engine.el for more info." ;; entire raw string (when properly terminated) or just the delimiter ;; (otherwise). In either of these cases, return t, otherwise return nil. ;; - (let ((here (point)) - in-macro macro-end id Rquote found) + (let (in-macro macro-end) (when (and (eq (char-before (1- (point))) ?R) @@ -9377,8 +9376,8 @@ This function might do hidden buffer changes." maybe-typeless ;; Save the value of kwd-sym between loops of the "Check for a ;; type" loop. Needed to distinguish a C++11 "auto" from a pre - ;; C++11 one. - prev-kwd-sym + ;; C++11 one. (Commented out, 2020-11-01). + ;; prev-kwd-sym ;; If a specifier is found that also can be a type prefix, ;; these flags are set instead of those above. If we need to ;; back up an identifier, they are copied to the real flag @@ -9537,7 +9536,7 @@ This function might do hidden buffer changes." ;; specifier keyword and we know we're in a ;; declaration. (setq at-decl-or-cast t) - (setq prev-kwd-sym kwd-sym) + ;; (setq prev-kwd-sym kwd-sym) (goto-char kwd-clause-end)))) @@ -11252,7 +11251,7 @@ comment at the start of cc-engine.el for more info." (c-syntactic-re-search-forward ";" nil 'move t))) nil))) -(defun c-looking-at-decl-block (_containing-sexp goto-start &optional limit) +(defun c-looking-at-decl-block (goto-start &optional limit) ;; Assuming the point is at an open brace, check if it starts a ;; block that contains another declaration level, i.e. that isn't a ;; statement block or a brace list, and if so return non-nil. @@ -11432,9 +11431,7 @@ comment at the start of cc-engine.el for more info." ; *c-looking-at-decl-block ; containing-sexp goto-start &optional ; limit) - (when (and (c-looking-at-decl-block - (c-pull-open-brace paren-state) - nil) + (when (and (c-looking-at-decl-block nil) (looking-at c-class-key)) (goto-char (match-end 1)) (c-forward-syntactic-ws) @@ -11453,9 +11450,7 @@ comment at the start of cc-engine.el for more info." (save-excursion (goto-char open-paren-pos) (when (and (eq (char-after) ?{) - (c-looking-at-decl-block - (c-safe-position open-paren-pos paren-state) - nil)) + (c-looking-at-decl-block nil)) (back-to-indentation) (vector (point) open-paren-pos)))))) @@ -11468,7 +11463,7 @@ comment at the start of cc-engine.el for more info." (while (and open-brace (save-excursion (goto-char open-brace) - (not (c-looking-at-decl-block next-open-brace nil)))) + (not (c-looking-at-decl-block nil)))) (setq open-brace next-open-brace next-open-brace (c-pull-open-brace paren-state))) open-brace)) @@ -11786,7 +11781,7 @@ comment at the start of cc-engine.el for more info." (goto-char (car res)) (c-do-declarators (point-max) t nil nil - (lambda (id-start id-end tok not-top func init) + (lambda (id-start _id-end _tok _not-top _func _init) (cond ((> id-start after-type-id-pos) (throw 'find-decl nil)) @@ -11876,7 +11871,7 @@ comment at the start of cc-engine.el for more info." (or accept-in-paren (not (eq (cdr bufpos) 'in-paren))) (car bufpos)))))) -(defun c-looking-at-special-brace-list (&optional _lim) +(defun c-looking-at-special-brace-list () ;; If we're looking at the start of a pike-style list, i.e., `({ })', ;; `([ ])', `(< >)', etc., a cons of a cons of its starting and ending ;; positions and its entry in c-special-brace-lists is returned, nil @@ -12506,8 +12501,7 @@ comment at the start of cc-engine.el for more info." (defun c-add-class-syntax (symbol containing-decl-open containing-decl-start - containing-decl-kwd - _paren-state) + containing-decl-kwd) ;; The inclass and class-close syntactic symbols are added in ;; several places and some work is needed to fix everything. ;; Therefore it's collected here. @@ -12556,7 +12550,7 @@ comment at the start of cc-engine.el for more info." ;; CASE B.1: class-open ((save-excursion (and (eq (char-after) ?{) - (c-looking-at-decl-block containing-sexp t) + (c-looking-at-decl-block t) (setq beg-of-same-or-containing-stmt (point)))) (c-add-syntax 'class-open beg-of-same-or-containing-stmt)) @@ -12759,10 +12753,7 @@ comment at the start of cc-engine.el for more info." (goto-char containing-sexp) (eq (char-after) ?{)) (setq placeholder - (c-looking-at-decl-block - (c-most-enclosing-brace paren-state - containing-sexp) - t))) + (c-looking-at-decl-block t))) (setq containing-decl-open containing-sexp containing-decl-start (point) containing-sexp nil) @@ -13004,8 +12995,7 @@ comment at the start of cc-engine.el for more info." (setq placeholder (c-add-class-syntax 'inclass containing-decl-open containing-decl-start - containing-decl-kwd - paren-state)) + containing-decl-kwd)) ;; Append access-label with the same anchor point as ;; inclass gets. (c-append-syntax 'access-label placeholder)) @@ -13077,7 +13067,7 @@ comment at the start of cc-engine.el for more info." ((save-excursion (let (tmp) (and (eq char-after-ip ?{) - (setq tmp (c-looking-at-decl-block containing-sexp t)) + (setq tmp (c-looking-at-decl-block t)) (progn (setq placeholder (point)) (goto-char tmp) @@ -13098,7 +13088,7 @@ comment at the start of cc-engine.el for more info." (goto-char indent-point) (skip-chars-forward " \t") (and (eq (char-after) ?{) - (c-looking-at-decl-block containing-sexp t) + (c-looking-at-decl-block t) (setq placeholder (point)))) (c-add-syntax 'class-open placeholder)) @@ -13138,8 +13128,7 @@ comment at the start of cc-engine.el for more info." (c-add-class-syntax 'inclass containing-decl-open containing-decl-start - containing-decl-kwd - paren-state)) + containing-decl-kwd)) ;; CASE 5A.5: ordinary defun open (t @@ -13202,8 +13191,7 @@ comment at the start of cc-engine.el for more info." (c-add-class-syntax 'inclass containing-decl-open containing-decl-start - containing-decl-kwd - paren-state))) + containing-decl-kwd))) ;; CASE 5B.4: Nether region after a C++ or Java func ;; decl, which could include a `throws' declaration. @@ -13273,8 +13261,7 @@ comment at the start of cc-engine.el for more info." (c-add-class-syntax 'inclass containing-decl-open containing-decl-start - containing-decl-kwd - paren-state))) + containing-decl-kwd))) ;; CASE 5C.3: in a Java implements/extends (injava-inher @@ -13460,8 +13447,7 @@ comment at the start of cc-engine.el for more info." (c-add-class-syntax 'class-close containing-decl-open containing-decl-start - containing-decl-kwd - paren-state)) + containing-decl-kwd)) ;; CASE 5H: we could be looking at subsequent knr-argdecls ((and c-recognize-knr-p @@ -13582,8 +13568,7 @@ comment at the start of cc-engine.el for more info." (c-add-class-syntax 'inclass containing-decl-open containing-decl-start - containing-decl-kwd - paren-state))) + containing-decl-kwd))) (when (and c-syntactic-indentation-in-macros macro-start (/= macro-start (c-point 'boi indent-point))) @@ -13899,7 +13884,7 @@ comment at the start of cc-engine.el for more info." (save-excursion (goto-char indent-point) (c-forward-syntactic-ws (c-point 'eol)) - (c-looking-at-special-brace-list (point))))) + (c-looking-at-special-brace-list)))) (c-add-syntax 'brace-entry-open (point)) (c-add-stmt-syntax 'brace-list-entry nil t containing-sexp paren-state (point)) @@ -13965,9 +13950,7 @@ comment at the start of cc-engine.el for more info." (and lim (progn (goto-char lim) - (c-looking-at-decl-block - (c-most-enclosing-brace paren-state lim) - nil)) + (c-looking-at-decl-block nil)) (setq placeholder (point)))) (c-backward-to-decl-anchor lim) (back-to-indentation) @@ -14135,9 +14118,7 @@ comment at the start of cc-engine.el for more info." (and (progn (goto-char placeholder) (eq (char-after) ?{)) - (c-looking-at-decl-block (c-most-enclosing-brace - paren-state (point)) - nil)))) + (c-looking-at-decl-block nil)))) (c-backward-to-decl-anchor lim) (back-to-indentation) (c-add-syntax 'defun-block-intro (point))) diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index c6dd671051..c5201d1af5 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -1482,7 +1482,7 @@ Note that the style variables are always made local to the buffer." ((and (c-is-escaped end) (or (eq beg end) ; .... by inserting stuff between \ and \n? - (c-will-be-unescaped beg end))) ; ... by removing an odd number of \s? + (c-will-be-unescaped beg))) ; ... by removing an odd number of \s? (goto-char (1+ end))) ; To after the NL which is being unescaped. (t (goto-char end))) commit 109eb1e7e29455418b40ca00bf5dad3e61e5fc78 Author: Philipp Stephani Date: Mon Nov 9 22:14:39 2020 +0100 Fix undefined behavior when fetching glyphs from the display vector. You can trigger this rather obscure bug by enabling selective display if the second glyph in its display vector has an invalid face. For example, evaluate (set-display-table-slot standard-display-table 'selective-display [?A (?B . invalid)]) and then enable selective display. * src/xdisp.c (next_element_from_display_vector): Check whether next glyph code is valid before accessing it. diff --git a/src/xdisp.c b/src/xdisp.c index ac706d0841..71a5f1c34f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -8221,10 +8221,10 @@ next_element_from_display_vector (struct it *it) next_face_id = it->dpvec_face_id; else { - int lface_id = - GLYPH_CODE_FACE (it->dpvec[it->current.dpvec_index + 1]); + Lisp_Object gc = it->dpvec[it->current.dpvec_index + 1]; + int lface_id = GLYPH_CODE_P (gc) ? GLYPH_CODE_FACE (gc) : 0; - if (lface_id > 0) + if (lface_id > 0) next_face_id = merge_faces (it->w, Qt, lface_id, it->saved_face_id); } commit 8ece715af613d238a86092abf62db57ded6c55b3 Author: Stefan Kangas Date: Mon Nov 9 21:43:53 2020 +0100 Add test for substitute-command-keys with command remap * test/lisp/help-tests.el (help-tests-remap-map): New variable. (help-tests-substitute-command-keys/remap): New test. (help-tests-substitute-command-keys/keymaps) (help-tests-substitute-command-keys/undefined-map): Fix indentation. diff --git a/test/lisp/help-tests.el b/test/lisp/help-tests.el index b6dffb2a40..42be0296c4 100644 --- a/test/lisp/help-tests.el +++ b/test/lisp/help-tests.el @@ -91,7 +91,7 @@ (ert-deftest help-tests-substitute-command-keys/keymaps () (with-substitute-command-keys-test (test "\\{minibuffer-local-must-match-map}" - "\ + "\ key binding --- ------- @@ -125,10 +125,21 @@ M-s next-matching-history-element (test "\\\\[abort-recursive-edit]" "C-g") (test "\\\\[eval-defun]" "C-M-x"))) +(defvar help-tests-remap-map + (let ((map (make-keymap))) + (define-key map (kbd "x") 'foo) + (define-key map (kbd "y") 'bar) + (define-key map [remap foo] 'bar) + map)) + +(ert-deftest help-tests-substitute-command-keys/remap () + (should (equal (substitute-command-keys "\\\\[foo]") "y")) + (should (equal (substitute-command-keys "\\\\[bar]") "y"))) + (ert-deftest help-tests-substitute-command-keys/undefined-map () (with-substitute-command-keys-test (test-re "\\{foobar-map}" - "\nUses keymap [`'‘]foobar-map['’], which is not currently defined.\n"))) + "\nUses keymap [`'‘]foobar-map['’], which is not currently defined.\n"))) (ert-deftest help-tests-substitute-command-keys/quotes () (with-substitute-command-keys-test commit 916eb895d1b25107a7d6a2afc63ca6df5b02e040 Author: Brian Leung Date: Mon Nov 9 08:38:18 2020 -0800 shortdoc: prefer seq-contains-p over seq-contains * lisp/emacs-lisp/shortdoc.el (sequence): use seq-contains-p instead of seq-contains, which is obsolete as of 27.1. (Bug#44536) Copyright-paperwork-exempt: yes diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index dd9cbd5d55..37d6170fee 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -689,8 +689,8 @@ There can be any number of :example/:result elements." (define-short-documentation-group sequence "Sequence Predicates" (seq-contains-p - :eval (seq-contains '(a b c) 'b) - :eval (seq-contains '(a b c) 'd)) + :eval (seq-contains-p '(a b c) 'b) + :eval (seq-contains-p '(a b c) 'd)) (seq-every-p :eval (seq-every-p #'numberp '(1 2 3))) (seq-empty-p commit 95c04675abb33c9a77e561e109348954e0d67c85 Author: Stefan Kangas Date: Thu Nov 5 15:32:45 2020 +0100 Simplify getting value of text-quoting-style (Bug#44471) * src/doc.c (text_quoting_style): Remove function by merging it... (Ftext_quoting_style): ...here. Rename from Fget_quoting_style. (syms_of_doc): Update defsubr for Ftext_quoting_style. * src/lisp.h (enum text_quoting_style): Remove enum. * src/doprnt.c (doprnt): * src/editfns.c (styled_format): * lisp/help.el (substitute-command-keys): Update callers to use text-quoting-style. diff --git a/lisp/help.el b/lisp/help.el index 466ff21eb2..32ee84b5f9 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1103,13 +1103,13 @@ Otherwise, return a new string (without any text properties)." (describe-map-tree this-keymap t (nreverse earlier-maps) nil nil t nil nil t)))))))) ;; 2. Handle quotes. - ((and (eq (get-quoting-style) 'curve) + ((and (eq (text-quoting-style) 'curve) (or (and (= (following-char) ?\`) (prog1 t (insert "‘"))) (and (= (following-char) ?') (prog1 t (insert "’"))))) (delete-char 1)) - ((and (eq (get-quoting-style) 'straight) + ((and (eq (text-quoting-style) 'straight) (= (following-char) ?\`)) (insert "'") (delete-char 1)) diff --git a/src/doc.c b/src/doc.c index f1ce266d39..5f23e3d0bb 100644 --- a/src/doc.c +++ b/src/doc.c @@ -682,37 +682,25 @@ default_to_grave_quoting_style (void) && EQ (AREF (dv, 0), make_fixnum ('`'))); } -/* Return the current effective text quoting style. */ -enum text_quoting_style -text_quoting_style (void) +DEFUN ("text-quoting-style", Ftext_quoting_style, + Stext_quoting_style, 0, 0, 0, + doc: /* Return the current effective text quoting style. +See variable `text-quoting-style'. */) + (void) { + /* Use grave accent and apostrophe `like this'. */ if (NILP (Vtext_quoting_style) ? default_to_grave_quoting_style () : EQ (Vtext_quoting_style, Qgrave)) - return GRAVE_QUOTING_STYLE; + return Qgrave; + + /* Use apostrophes 'like this'. */ else if (EQ (Vtext_quoting_style, Qstraight)) - return STRAIGHT_QUOTING_STYLE; - else - return CURVE_QUOTING_STYLE; -} + return Qstraight; -/* This is just a Lisp wrapper for text_quoting_style above. */ -DEFUN ("get-quoting-style", Fget_quoting_style, - Sget_quoting_style, 0, 0, 0, - doc: /* Return the current effective text quoting style. -See variable `text-quoting-style'. */) - (void) -{ - switch (text_quoting_style ()) - { - case STRAIGHT_QUOTING_STYLE: - return Qstraight; - case CURVE_QUOTING_STYLE: - return Qcurve; - case GRAVE_QUOTING_STYLE: - default: - return Qgrave; - } + /* Use curved single quotes ‘like this’. */ + else + return Qcurve; } @@ -755,5 +743,5 @@ otherwise. */); defsubr (&Sdocumentation); defsubr (&Sdocumentation_property); defsubr (&Ssnarf_documentation); - defsubr (&Sget_quoting_style); + defsubr (&Stext_quoting_style); } diff --git a/src/doprnt.c b/src/doprnt.c index ce259d07cf..9316497720 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -199,7 +199,7 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, /* Buffer we have got with malloc. */ char *big_buffer = NULL; - enum text_quoting_style quoting_style = text_quoting_style (); + Lisp_Object quoting_style = Ftext_quoting_style (); bufsize--; @@ -482,13 +482,13 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, char const *src; ptrdiff_t srclen; - if (quoting_style == CURVE_QUOTING_STYLE && fmtchar == '`') + if (EQ (quoting_style, Qcurve) && fmtchar == '`') src = uLSQM, srclen = sizeof uLSQM - 1; - else if (quoting_style == CURVE_QUOTING_STYLE && fmtchar == '\'') + else if (EQ (quoting_style, Qcurve) && fmtchar == '\'') src = uRSQM, srclen = sizeof uRSQM - 1; else { - if (quoting_style == STRAIGHT_QUOTING_STYLE && fmtchar == '`') + if (EQ (quoting_style, Qstraight) && fmtchar == '`') fmtchar = '\''; eassert (ASCII_CHAR_P (fmtchar)); *bufptr++ = fmtchar; diff --git a/src/editfns.c b/src/editfns.c index aedab47614..4104edd77f 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3154,7 +3154,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) if (STRINGP (args[i]) && STRING_MULTIBYTE (args[i])) multibyte = true; - int quoting_style = message ? text_quoting_style () : -1; + Lisp_Object quoting_style = message ? Ftext_quoting_style () : Qnil; ptrdiff_t ispec; ptrdiff_t nspec = 0; @@ -3774,7 +3774,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) unsigned char str[MAX_MULTIBYTE_LENGTH]; if ((format_char == '`' || format_char == '\'') - && quoting_style == CURVE_QUOTING_STYLE) + && EQ (quoting_style, Qcurve)) { if (! multibyte) { @@ -3785,7 +3785,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) convbytes = 3; new_result = true; } - else if (format_char == '`' && quoting_style == STRAIGHT_QUOTING_STYLE) + else if (format_char == '`' && EQ (quoting_style, Qstraight)) { convsrc = "'"; new_result = true; diff --git a/src/lisp.h b/src/lisp.h index cf33031342..76d74200ac 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4497,18 +4497,6 @@ extern void set_initial_environment (void); extern void syms_of_callproc (void); /* Defined in doc.c. */ -enum text_quoting_style - { - /* Use curved single quotes ‘like this’. */ - CURVE_QUOTING_STYLE, - - /* Use grave accent and apostrophe `like this'. */ - GRAVE_QUOTING_STYLE, - - /* Use apostrophes 'like this'. */ - STRAIGHT_QUOTING_STYLE - }; -extern enum text_quoting_style text_quoting_style (void); extern Lisp_Object read_doc_string (Lisp_Object); extern Lisp_Object get_doc_string (Lisp_Object, bool, bool); extern void syms_of_doc (void); commit a08320f7234685cd84a18040556fd3f7eaacaf45 Author: Philipp Stephani Date: Mon Nov 9 18:15:12 2020 +0100 * lisp/disp-table.el (make-glyph-code): Remove obsolete comment. diff --git a/lisp/disp-table.el b/lisp/disp-table.el index 2e88d35024..70343a39ad 100644 --- a/lisp/disp-table.el +++ b/lisp/disp-table.el @@ -220,8 +220,6 @@ for a graphical frame." ;;;###autoload (defun make-glyph-code (char &optional face) "Return a glyph code representing char CHAR with face FACE." - ;; Due to limitations on Emacs integer values, faces with - ;; face id greater than 512 are silently ignored. (if (not face) char (let ((fid (face-id face))) commit d8a31b0c03f93976027722324b173e880b402f34 Author: Mattias Engdegård Date: Mon Nov 9 18:05:08 2020 +0100 Better warning suppression in rx-tests * test/lisp/emacs-lisp/rx-tests.el (rx-compat): Use with-no-warnings instead of with-suppressed-warnings which complains when running the test interactively. diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el index 91b0884d4a..d2e11cf06a 100644 --- a/test/lisp/emacs-lisp/rx-tests.el +++ b/test/lisp/emacs-lisp/rx-tests.el @@ -544,7 +544,7 @@ (ert-deftest rx-compat () "Test old symbol retained for compatibility (bug#37517)." (should (equal - (with-suppressed-warnings ((obsolete rx-submatch-n)) + (with-no-warnings (rx-submatch-n '(group-n 3 (+ nonl) eol))) "\\(?3:.+$\\)"))) commit 78e1646bf7bde8f00c196319f4803e98460d506a Author: Mattias Engdegård Date: Mon Nov 9 17:11:05 2020 +0100 Fix pcase rx form snag with '?' and '??' (bug#44532) This is a regression from Emacs 26. Reported by Phillip Stephani. * lisp/emacs-lisp/rx.el (rx--pcase-transform): Process ? and ?? correctly. * test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add test case. (cherry picked from commit 575b0681d926463960fc00d1e33decaa71d5c956) diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index 6564563e7e..88c843f3ce 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -1413,7 +1413,7 @@ into a plain rx-expression, collecting names into `rx--pcase-vars'." (mapconcat #'symbol-name rx--pcase-vars " "))) `(backref ,index))) ((and `(,head . ,rest) - (guard (and (symbolp head) + (guard (and (or (symbolp head) (memq head '(?\s ??))) (not (memq head '(literal regexp regex eval)))))) (cons head (mapcar #'rx--pcase-transform rest))) (_ rx))) diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el index 0fece4004b..05779b4e0a 100644 --- a/test/lisp/emacs-lisp/rx-tests.el +++ b/test/lisp/emacs-lisp/rx-tests.el @@ -158,7 +158,11 @@ (let ((k "blue")) (should (equal (pcase "" ((rx "<" (literal k) ">") 'ok)) - 'ok)))) + 'ok))) + (should (equal (pcase "abc" + ((rx (? (let x alpha)) (?? (let y alnum)) ?c) + (list x y))) + '("a" "b")))) (ert-deftest rx-kleene () "Test greedy and non-greedy repetition operators." commit 575b0681d926463960fc00d1e33decaa71d5c956 Author: Mattias Engdegård Date: Mon Nov 9 17:11:05 2020 +0100 Fix pcase rx form snag with '?' and '??' (bug#44532) This is a regression from Emacs 26. Reported by Phillip Stephani. * lisp/emacs-lisp/rx.el (rx--pcase-transform): Process ? and ?? correctly. * test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add test case. diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index 8d8d071031..76c3ac31b8 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -1413,7 +1413,7 @@ into a plain rx-expression, collecting names into `rx--pcase-vars'." (mapconcat #'symbol-name rx--pcase-vars " "))) `(backref ,index))) ((and `(,head . ,rest) - (guard (and (symbolp head) + (guard (and (or (symbolp head) (memq head '(?\s ??))) (not (memq head '(literal regexp regex eval)))))) (cons head (mapcar #'rx--pcase-transform rest))) (_ rx))) diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el index 59d8c600a2..91b0884d4a 100644 --- a/test/lisp/emacs-lisp/rx-tests.el +++ b/test/lisp/emacs-lisp/rx-tests.el @@ -167,7 +167,11 @@ (let ((k "blue")) (should (equal (pcase "" ((rx "<" (literal k) ">") 'ok)) - 'ok)))) + 'ok))) + (should (equal (pcase "abc" + ((rx (? (let x alpha)) (?? (let y alnum)) ?c) + (list x y))) + '("a" "b")))) (ert-deftest rx-kleene () "Test greedy and non-greedy repetition operators." commit 52937958064223bec3ad518363d3cc50d995b259 Author: Alan Third Date: Mon Nov 9 16:22:13 2020 +0000 Fix css length calculations * src/image.c (svg_css_length_to_pixels): Put in missing breaks where necessary. diff --git a/src/image.c b/src/image.c index d207f78e04..d190c25413 100644 --- a/src/image.c +++ b/src/image.c @@ -9767,6 +9767,7 @@ svg_css_length_to_pixels (RsvgLength length) case RSVG_UNIT_CM: /* 2.54 cm in an inch. */ value = dpi * value / 2.54; + break; case RSVG_UNIT_MM: /* 25.4 mm in an inch. */ value = dpi * value / 25.4; @@ -9774,9 +9775,11 @@ svg_css_length_to_pixels (RsvgLength length) case RSVG_UNIT_PT: /* 72 points in an inch. */ value = dpi * value / 72; + break; case RSVG_UNIT_PC: /* 6 picas in an inch. */ value = dpi * value / 6; + break; case RSVG_UNIT_IN: value *= dpi; break; commit 0d9e2b80d8a9e36608c88316362e5f1bb92791d6 Author: Lars Ingebrigtsen Date: Mon Nov 9 17:21:56 2020 +0100 Make the SHOW parameter work again in `run-python' * lisp/progmodes/python.el (run-python): Make the SHOW parameter work again after the fix for 31398 (bug#44421). diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index d6feba254b..378ff8cc2c 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2921,7 +2921,7 @@ process buffer for a list of commands.)" (python-shell-make-comint (or cmd (python-shell-calculate-command)) (python-shell-get-process-name dedicated) show))) - (pop-to-buffer buffer) + (set-buffer buffer) (get-buffer-process buffer))) (defun run-python-internal () commit 1f0b92943093c2101ca661e24751a3e57934cf77 Author: Protesilaos Stavrou Date: Mon Nov 9 17:14:24 2020 +0100 Use a separate face for expanded log-view bodies * lisp/vc/log-view.el (log-view-commit-body): Define new face. (log-view-toggle-entry-display): Implement 'log-view-commit-body' face (bug#44424). diff --git a/etc/NEWS b/etc/NEWS index 68a4aac82b..7eb0b6c5cc 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -435,6 +435,11 @@ their 'default-directory' under VC. *** New command 'vc-dir-root' uses the root directory without asking. +--- +*** New face 'log-view-commit-body'. +This is used when expanding commit messages from 'vc-print-root-log' +and similar commands. + --- *** The responsible VC backend is now the most specific one. 'vc-responsible-backend' loops over the backends in diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el index e1c2b976a4..56ecc64671 100644 --- a/lisp/vc/log-view.el +++ b/lisp/vc/log-view.el @@ -208,6 +208,18 @@ If it is nil, `log-view-toggle-entry-display' does nothing.") "Face for the message header line in `log-view-mode'." :group 'log-view) +(defface log-view-commit-body + '((((class color) (min-colors 88) (background light)) + :background "gray95" :foreground "black" :extend t) + (((class color) (min-colors 88) (background dark)) + :background "gray5" :foreground "white" :extend t) + (((class color) (min-colors 8) (background light)) + :foreground "black") + (((class color) (min-colors 8) (background dark)) + :foreground "white")) + "Face for the commit body in `log-view-mode'." + :version "28.1") + (defvar log-view-file-re (concat "^\\(?:Working file: \\(?1:.+\\)" ;RCS and CVS. ;; Subversion has no such thing?? @@ -415,7 +427,7 @@ This calls `log-view-expanded-log-entry-function' to do the work." (insert long-entry "\n") (add-text-properties beg (point) - '(font-lock-face font-lock-comment-face log-view-comment t)) + '(font-lock-face log-view-commit-body log-view-comment t)) (goto-char opoint)))))))) (defun log-view-beginning-of-defun (&optional arg) commit 391260e46c2d8cd716c951b41933448fc51614f5 Author: Lars Ingebrigtsen Date: Mon Nov 9 16:50:45 2020 +0100 Clarify Lisp warning about elements following other expressions * lisp/emacs-lisp/lisp-mode.el (lisp-fdefs): Clarify warning in help text (bug#44482). diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index daf4967089..cc40af7a41 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -481,7 +481,7 @@ This will generate compile-time constants from BINDINGS." (3 'font-lock-regexp-grouping-construct prepend)) (lisp--match-hidden-arg (0 '(face font-lock-warning-face - help-echo "Hidden behind deeper element; move to another line?") + help-echo "Easy to misread; consider moving the element to the next line") prepend)) (lisp--match-confusable-symbol-character 0 '(face font-lock-warning-face @@ -526,7 +526,7 @@ This will generate compile-time constants from BINDINGS." (1 font-lock-keyword-face)) (lisp--match-hidden-arg (0 '(face font-lock-warning-face - help-echo "Hidden behind deeper element; move to another line?") + help-echo "Easy to misread; consider moving the element to the next line") prepend)) )) "Gaudy level highlighting for Lisp modes."))) commit 3de31e7b71353bc35d994dc924fae5178f09130b Author: Eli Zaretskii Date: Mon Nov 9 17:35:52 2020 +0200 Fix compilation of image.c on MS-Windows This is a followup to last change in image.c. * src/image.c (rsvg_handle_get_intrinsic_dimensions): Define to call fn_rsvg_handle_get_intrinsic_dimensions. (svg_css_length_to_pixels): Compile only for librsvg >= 2.46.0, as RsvgLength type was not defined before. diff --git a/src/image.c b/src/image.c index b4cb1b7bf8..d207f78e04 100644 --- a/src/image.c +++ b/src/image.c @@ -9542,19 +9542,19 @@ DEF_DLL_FN (void, rsvg_handle_set_base_uri, (RsvgHandle *, const char *)); DEF_DLL_FN (gboolean, rsvg_handle_write, (RsvgHandle *, const guchar *, gsize, GError **)); DEF_DLL_FN (gboolean, rsvg_handle_close, (RsvgHandle *, GError **)); -#endif +# endif -#if LIBRSVG_CHECK_VERSION (2, 46, 0) +# if LIBRSVG_CHECK_VERSION (2, 46, 0) DEF_DLL_FN (void, rsvg_handle_get_intrinsic_dimensions, RsvgHandle *, gboolean *, RsvgLength *, gboolean *, RsvgLength *, gboolean *, RsvgRectangle *)); DEF_DLL_FN (gboolean, rsvg_handle_get_geometry_for_layer, (RsvgHandle *, const char *, const RsvgRectangle *, RsvgRectangle *, RsvgRectangle *, GError **)); -#else +# else DEF_DLL_FN (void, rsvg_handle_get_dimensions, (RsvgHandle *, RsvgDimensionData *)); -#endif +# endif DEF_DLL_FN (GdkPixbuf *, rsvg_handle_get_pixbuf, (RsvgHandle *)); DEF_DLL_FN (int, gdk_pixbuf_get_width, (const GdkPixbuf *)); DEF_DLL_FN (int, gdk_pixbuf_get_height, (const GdkPixbuf *)); @@ -9642,6 +9642,7 @@ init_svg_functions (void) # undef g_object_unref # undef g_type_init # if LIBRSVG_CHECK_VERSION (2, 46, 0) +# undef rsvg_handle_get_intrinsic_dimensions # undef rsvg_handle_get_geometry_for_layer # else # undef rsvg_handle_get_dimensions @@ -9672,7 +9673,10 @@ init_svg_functions (void) # define g_type_init fn_g_type_init # endif # if LIBRSVG_CHECK_VERSION (2, 46, 0) -# define rsvg_handle_get_geometry_for_layer fn_rsvg_handle_get_geometry_for_layer +# define rsvg_handle_get_intrinsic_dimensions \ + fn_rsvg_handle_get_intrinsic_dimensions +# define rsvg_handle_get_geometry_for_layer \ + fn_rsvg_handle_get_geometry_for_layer # else # define rsvg_handle_get_dimensions fn_rsvg_handle_get_dimensions # endif @@ -9746,6 +9750,7 @@ svg_load (struct frame *f, struct image *img) return success_p; } +#if LIBRSVG_CHECK_VERSION (2, 46, 0) static double svg_css_length_to_pixels (RsvgLength length) { @@ -9783,6 +9788,7 @@ svg_css_length_to_pixels (RsvgLength length) return value; } +#endif /* Load frame F and image IMG. CONTENTS contains the SVG XML data to be parsed, SIZE is its size, and FILENAME is the name of the SVG commit 75384bd1555feca0ba11948ed71e4b557b8da59f Author: Lars Ingebrigtsen Date: Mon Nov 9 16:29:54 2020 +0100 Update the doc-view header line diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 244f4112ba..7fdd258822 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1,4 +1,4 @@ -;;; doc-view.el --- View PDF/PostScript/DVI files in Emacs -*- lexical-binding: t -*- +;;; doc-view.el --- Document viewer for Emacs -*- lexical-binding: t -*- ;; Copyright (C) 2007-2020 Free Software Foundation, Inc. ;; commit 13ab70c80e2e31fdf0a289c8e730a33a1cf5d6ae Author: Eli Zaretskii Date: Mon Nov 9 17:22:25 2020 +0200 Avoid breaking Arabic shaping in 'window-text-pixel-size' * src/xdisp.c (CHAR_COMPOSED_P): If the bidi_p flag is not set, pass -1 to composition_reseat_it, so that the shaping engine will figure out the directionality of the text. This is important, e.g., when using move_it_* functions in some context that is not redisplay, such as 'window-text-pixel-size'. (Bug#44521) diff --git a/src/xdisp.c b/src/xdisp.c index 60864c2671..ac706d0841 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -7221,14 +7221,21 @@ static next_element_function const get_next_element[NUM_IT_METHODS] = /* Return true iff a character at CHARPOS (and BYTEPOS) is composed - (possibly with the following characters). */ + (possibly with the following characters). + + Note: we pass -1 as the "resolved bidi level" when the iterator + doesn't have the bidi_p flag set, because in that case we really + don't know what is the directionality of the text, so we leave it to + the shaping engine to figure that out. */ #define CHAR_COMPOSED_P(IT,CHARPOS,BYTEPOS,END_CHARPOS) \ ((IT)->cmp_it.id >= 0 \ || ((IT)->cmp_it.stop_pos == (CHARPOS) \ && composition_reseat_it (&(IT)->cmp_it, CHARPOS, BYTEPOS, \ END_CHARPOS, (IT)->w, \ - (IT)->bidi_it.resolved_level, \ + (IT)->bidi_p \ + ? (IT)->bidi_it.resolved_level \ + : -1, \ FACE_FROM_ID_OR_NULL ((IT)->f, \ (IT)->face_id), \ (IT)->string))) commit bffd5d3a9d44ed99d6a573dc0fabe542d6b3bb8b Merge: b83e31bf95 18a7267c32 Author: Eli Zaretskii Date: Mon Nov 9 16:57:03 2020 +0200 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs commit 18a7267c32a909bb26bd93d24543155aeb10e042 Author: Alan Third Date: Sat Oct 31 15:14:34 2020 +0000 Fix crash in ns_mouse_position (bug#44313) * src/nsterm.m (ns_destroy_window): Close the window before freeing the frame resources so we don't end up accessing the frame struct after it's been freed. diff --git a/src/nsterm.m b/src/nsterm.m index fa38350a2f..4fad521b74 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1782,6 +1782,8 @@ Hide the window (X11 semantics) { NSTRACE ("ns_destroy_window"); + check_window_system (f); + /* If this frame has a parent window, detach it as not doing so can cause a crash in GNUStep. */ if (FRAME_PARENT_FRAME (f) != NULL) @@ -1792,7 +1794,7 @@ Hide the window (X11 semantics) [parent removeChildWindow: child]; } - check_window_system (f); + [[FRAME_NS_VIEW (f) window] close]; ns_free_frame_resources (f); ns_window_num--; } commit b4ec9cf79c67c16096d93b4ed682d8e19278bab3 Author: Andrii Kolomoiets Date: Mon Oct 12 14:24:25 2020 +0300 NS: Make s- to move to beginning/end of line * lisp/term/ns-win.el: Bind 's-' to 'move-beginning-of-line'; bind 's-' to 'move-end-of-line'. * etc/NEWS: Mention new bindings. diff --git a/etc/NEWS b/etc/NEWS index 8b5acafe31..68a4aac82b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1957,6 +1957,11 @@ image API via 'M-x report-emacs-bug'. --- ** The user option 'make-pointer-invisible' is now honored on macOS. +-- +** On macOS, 's-' and 's-' are now bound to +'move-beginning-of-line' and 'move-end-of-line' respectively. The commands +to select previous/next frame are still bound to 's-~' and 's-`'. + ---------------------------------------------------------------------- This file is part of GNU Emacs. diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el index cc7a3762b4..8273c067f8 100644 --- a/lisp/term/ns-win.el +++ b/lisp/term/ns-win.el @@ -148,9 +148,8 @@ The properties returned may include `top', `left', `height', and `width'." (define-key global-map [?\s-|] 'shell-command-on-region) (define-key global-map [s-kp-bar] 'shell-command-on-region) (define-key global-map [?\C-\s- ] 'ns-do-show-character-palette) -;; (as in Terminal.app) -(define-key global-map [s-right] 'ns-next-frame) -(define-key global-map [s-left] 'ns-prev-frame) +(define-key global-map [s-right] 'move-end-of-line) +(define-key global-map [s-left] 'move-beginning-of-line) (define-key global-map [home] 'beginning-of-buffer) (define-key global-map [end] 'end-of-buffer) commit 4469e0de011c2c5862f6c1c970b9ad1dfbbda496 Author: Alan Third Date: Sun Oct 25 15:45:07 2020 +0000 Calculate SVG image sizes more accurately (bug#44206) * src/image.c (svg_css_length_to_pixels): New function. (svg_load_image): Try more methods to work out the image size. diff --git a/src/image.c b/src/image.c index c857b8e62a..b4cb1b7bf8 100644 --- a/src/image.c +++ b/src/image.c @@ -9545,6 +9545,9 @@ DEF_DLL_FN (gboolean, rsvg_handle_close, (RsvgHandle *, GError **)); #endif #if LIBRSVG_CHECK_VERSION (2, 46, 0) +DEF_DLL_FN (void, rsvg_handle_get_intrinsic_dimensions, + RsvgHandle *, gboolean *, RsvgLength *, gboolean *, + RsvgLength *, gboolean *, RsvgRectangle *)); DEF_DLL_FN (gboolean, rsvg_handle_get_geometry_for_layer, (RsvgHandle *, const char *, const RsvgRectangle *, RsvgRectangle *, RsvgRectangle *, GError **)); @@ -9599,6 +9602,7 @@ init_svg_functions (void) LOAD_DLL_FN (library, rsvg_handle_close); #endif #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); #else LOAD_DLL_FN (library, rsvg_handle_get_dimensions); @@ -9742,6 +9746,44 @@ svg_load (struct frame *f, struct image *img) return success_p; } +static double +svg_css_length_to_pixels (RsvgLength length) +{ + /* FIXME: 96 appears to be a pretty standard DPI but we should + probably use the real DPI if we can get it. */ + double dpi = 96; + double value = length.length; + + switch (length.unit) + { + case RSVG_UNIT_PX: + /* Already a pixel value. */ + break; + case RSVG_UNIT_CM: + /* 2.54 cm in an inch. */ + value = dpi * value / 2.54; + case RSVG_UNIT_MM: + /* 25.4 mm in an inch. */ + value = dpi * value / 25.4; + break; + case RSVG_UNIT_PT: + /* 72 points in an inch. */ + value = dpi * value / 72; + case RSVG_UNIT_PC: + /* 6 picas in an inch. */ + value = dpi * value / 6; + case RSVG_UNIT_IN: + value *= dpi; + break; + default: + /* Probably one of em, ex, or %. We can't know what the pixel + value is without more information. */ + value = 0; + } + + return value; +} + /* Load frame F and image IMG. CONTENTS contains the SVG XML data to be parsed, SIZE is its size, and FILENAME is the name of the SVG file being loaded. @@ -9810,11 +9852,48 @@ svg_load_image (struct frame *f, struct image *img, char *contents, #if LIBRSVG_CHECK_VERSION (2, 46, 0) RsvgRectangle zero_rect, viewbox, out_logical_rect; - rsvg_handle_get_geometry_for_layer (rsvg_handle, NULL, - &zero_rect, &viewbox, - &out_logical_rect, NULL); - viewbox_width = viewbox.x + viewbox.width; - viewbox_height = viewbox.y + viewbox.height; + /* Try the instrinsic dimensions first. */ + gboolean has_width, has_height, has_viewbox; + RsvgLength iwidth, iheight; + + rsvg_handle_get_intrinsic_dimensions (rsvg_handle, + &has_width, &iwidth, + &has_height, &iheight, + &has_viewbox, &viewbox); + + if (has_width && has_height) + { + /* Success! We can use these values directly. */ + viewbox_width = svg_css_length_to_pixels (iwidth); + viewbox_height = svg_css_length_to_pixels (iheight); + } + else if (has_width && has_viewbox) + { + viewbox_width = svg_css_length_to_pixels (iwidth); + viewbox_height = svg_css_length_to_pixels (iwidth) + * viewbox.width / viewbox.height; + } + else if (has_height && has_viewbox) + { + viewbox_height = svg_css_length_to_pixels (iheight); + viewbox_width = svg_css_length_to_pixels (iheight) + * viewbox.height / viewbox.width; + } + else if (has_viewbox) + { + viewbox_width = viewbox.width; + viewbox_height = viewbox.height; + } + else + { + /* We haven't found a useable set of sizes, so try working out + the visible area. */ + rsvg_handle_get_geometry_for_layer (rsvg_handle, NULL, + &zero_rect, &viewbox, + &out_logical_rect, NULL); + viewbox_width = viewbox.x + viewbox.width; + viewbox_height = viewbox.y + viewbox.height; + } #else /* The function used above to get the geometry of the visible area of the SVG are only available in librsvg 2.46 and above, so in @@ -9827,6 +9906,19 @@ svg_load_image (struct frame *f, struct image *img, char *contents, viewbox_width = dimension_data.width; viewbox_height = dimension_data.height; #endif + + if (viewbox_width == 0 || viewbox_height == 0) + { + /* We do not have any usable dimensions, so make some up. The + values below are supposedly the default values most web + browsers use for SVGs with no set size. */ + /* FIXME: At this stage we should perhaps consider rendering the + image out to a bitmap and getting the dimensions from + that. */ + viewbox_width = 300; + viewbox_height = 150; + } + compute_image_size (viewbox_width, viewbox_height, img->spec, &width, &height); commit e693d97e5005f82c7dbb4f6922d9dc8deac3d14f Author: Lars Ingebrigtsen Date: Mon Nov 9 15:38:35 2020 +0100 doc-view.el comment clarification * lisp/doc-view.el: Make the commentary mention that it's not limited to a narrow range of file formats (bug#44504). diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 9f5dc40ea1..244f4112ba 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -29,10 +29,11 @@ ;;; Commentary: -;; DocView is a document viewer for Emacs. It converts PDF, PS and DVI files -;; to a set of PNG files, one PNG for each page, and displays the PNG images -;; inside an Emacs buffer. This buffer uses `doc-view-mode' which provides -;; convenient key bindings for browsing the document. +;; DocView is a document viewer for Emacs. It converts a number of +;; document formats (including PDF, PS, DVI, Djvu and ODF files) to a +;; set of PNG files, one PNG for each page, and displays the PNG +;; images inside an Emacs buffer. This buffer uses `doc-view-mode' +;; which provides convenient key bindings for browsing the document. ;; ;; To use it simply open a document file with ;; commit 968e85a2cef487abc921bceff71c879106fa6f81 Author: Daniel Martín Date: Mon Nov 9 15:34:08 2020 +0100 Update erc documentation about C-c C-b * doc/misc/erc.texi (Keystroke Summary): C-c C-b runs erc-switch-to-buffer, which is implemented in terms of read-buffer (bug#44498). diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index a35225256b..a555b768cc 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -283,8 +283,8 @@ Complete the given word, using ispell. @item C-c C-a (@code{erc-bol}) Go to beginning of line or end of prompt. -@item C-c C-b (@code{erc-iswitchb}) -Use @code{iswitchb-read-buffer} to prompt for a ERC buffer to switch to. +@item C-c C-b (@code{erc-switch-to-buffer}) +Use @code{read-buffer} to prompt for a ERC buffer to switch to. @item C-c C-c (@code{erc-toggle-interpret-controls}) Toggle interpretation of control sequences in messages. commit 8dc237270f88a6abce4df9a1235b38288792ab71 Author: Harald Jörg Date: Mon Nov 9 15:25:47 2020 +0100 cperl-mode: Indentation of ')' follows customisation * lisp/progmodes/cperl-mode.el (cperl-style-alist): Add cperl-close-paren-offset to the settings for PBP style. * test/lisp/progmodes/cperl-mode-tests.el (cperl-bug19709): New test to verify correct indentation of closing parentheses (Bug#19709). * test/lisp/progmodes/cperl-mode-resources/cperl-bug-19709.pl: New test case with code from the bug report. * test/lisp/progmodes/cperl-mode-resources/cperl-indent-styles.pl: Add a new test clause for cperl-close-paren-offset. diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 6178cdfc9b..d5b30025e7 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -5983,6 +5983,7 @@ else (cperl-continued-brace-offset . 0) (cperl-label-offset . -2) (cperl-continued-statement-offset . 4) + (cperl-close-paren-offset . -4) (cperl-extra-newline-before-brace . nil) (cperl-extra-newline-before-brace-multiline . nil) (cperl-merge-trailing-else . nil) diff --git a/test/lisp/progmodes/cperl-mode-resources/cperl-bug-19709.pl b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-19709.pl new file mode 100644 index 0000000000..f7c51a2ce5 --- /dev/null +++ b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-19709.pl @@ -0,0 +1,25 @@ +# -------- bug#19709: input -------- +my $a = func1( + Module::test() + ); + +my $b = func2( + test() +); + +my $c = func3( + Module::test(), +); +# -------- bug#19709: expected output -------- +my $a = func1( + Module::test() +); + +my $b = func2( + test() +); + +my $c = func3( + Module::test(), +); +# -------- bug#19709: end -------- diff --git a/test/lisp/progmodes/cperl-mode-resources/cperl-indent-styles.pl b/test/lisp/progmodes/cperl-mode-resources/cperl-indent-styles.pl index 0832f86828..371b19b730 100644 --- a/test/lisp/progmodes/cperl-mode-resources/cperl-indent-styles.pl +++ b/test/lisp/progmodes/cperl-mode-resources/cperl-indent-styles.pl @@ -42,3 +42,13 @@ } } # -------- PBP uncuddle else: end -------- + +# -------- PBP closing paren offset: input -------- +my $a = func1( + Module::test() + ); +# -------- PBP closing paren offset: expected output -------- +my $a = func1( + Module::test() +); +# -------- PBP closing paren offset: end -------- diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index effebc8068..bd8a1a9f16 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -249,6 +249,44 @@ Perl is not Lisp: An open paren in column 0 does not start a function." (setq got (concat "test case " name ":\n" (buffer-string))) (should (equal got expected)))))))) +(ert-deftest cperl-bug19709 () + "Verify that indentation of closing paren works as intended. +Note that Perl mode has no setting for close paren offset, per +documentation it does the right thing anyway." + (let ((file (ert-resource-file "cperl-bug-19709.pl"))) + (with-temp-buffer + (insert-file-contents file) + (goto-char (point-min)) + (while (re-search-forward + (concat "^# ?-+ \\_<\\(?1:.+?\\)\\_>: input ?-+\n" + "\\(?2:\\(?:.*\n\\)+?\\)" + "# ?-+ \\1: expected output ?-+\n" + "\\(?3:\\(?:.*\n\\)+?\\)" + "# ?-+ \\1: end ?-+") + nil t) + (let ((name (match-string 1)) + (code (match-string 2)) + (expected (match-string 3)) + got) + (with-temp-buffer + (insert code) + (funcall cperl-test-mode) + (setq-local + ;; settings from the bug report + cperl-indent-level 4 + cperl-indent-parens-as-block t + cperl-close-paren-offset -4 + ;; same, adapted for per-mode + perl-indent-level 4 + perl-indent-parens-as-block t) + (goto-char (point-min)) + (while (null (eobp)) + (cperl-indent-command) + (next-line)) + (setq expected (concat "test case " name ":\n" expected)) + (setq got (concat "test case " name ":\n" (buffer-string))) + (should (equal got expected)))))))) + (ert-deftest cperl-bug37127 () "Verify that closing a paren in a regex goes without a message. Also check that the message is issued if the regex terminator is commit a05810b2d5f1a87ad1b20c4e61adc464a31e315d Author: Akira Kyle Date: Mon Nov 9 14:51:48 2020 +0100 Fix xwidget's webkitgtk widget overriding of Emacs SIGCHLD handler * src/xwidget.c (make-xwidget): Save and restore Emacs SIGCHLD signal handler since glib doesn't (but should) do this. Copyright-paperwork-exempt: yes diff --git a/src/xwidget.c b/src/xwidget.c index 031975fafb..e078a28a35 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -128,6 +128,16 @@ Returns the newly constructed xwidget, or nil if construction fails. */) if (EQ (xw->type, Qwebkit)) { xw->widget_osr = webkit_web_view_new (); + + /* webkitgtk uses GSubprocess which sets sigaction causing + Emacs to not catch SIGCHLD with its usual handle setup in + catch_child_signal(). This resets the SIGCHLD + sigaction. */ + struct sigaction old_action; + sigaction (SIGCHLD, NULL, &old_action); + webkit_web_view_load_uri(WEBKIT_WEB_VIEW (xw->widget_osr), + "about:blank"); + sigaction (SIGCHLD, &old_action, NULL); } gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width, commit 3289b96abd12058439f02e84415793acb44a733b Author: Stefan Kangas Date: Mon Nov 9 11:35:32 2020 +0100 Remove test for return value of set-keymap-parent * test/src/keymap-tests.el (keymap-keymap-set-parent/returns-parent): Remove test for the return value of set-keymap-parent. It is not clear that returning the value is a very good idea. Problem pointed out by Stefan Monnier . diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el index 8331a41e3f..e3dd8420d7 100644 --- a/test/src/keymap-tests.el +++ b/test/src/keymap-tests.el @@ -48,10 +48,6 @@ (set-keymap-parent map help-mode-map) (should (equal (keymap-parent map) help-mode-map)))) -(ert-deftest keymap-keymap-set-parent/returns-parent () - (let ((map (make-keymap))) - (should (equal (set-keymap-parent map help-mode-map) help-mode-map)))) - (ert-deftest keymap-copy-keymap/is-equal () (should (equal (copy-keymap help-mode-map) help-mode-map))) commit 795b7da16b89f7e7e0392700fdca967637b0485e Author: Eric Abrahamsen Date: Sun Nov 8 16:32:10 2020 -0800 Add more protections to gnus-search query parsing * lisp/gnus/gnus-group.el (gnus-group-make-search-group, gnus-group-read-ephemeral-search-group): If the query is coming in via the old 'nnir-query-spec key, we know not to parse it. * lisp/gnus/gnus-search.el (gnus-search-make-query-string): Check if the query was sent in as '(query "query"), and not '(query . "query). (gnus-search-imap-search-keys): Add x-gm-raw to imap search keys. (gnus-search-prepare-query): If we know this query should be raw, don't even try parsing it, as it probably won't work. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 9db0e1897a..c8b97c0852 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -3201,6 +3201,10 @@ non-nil SPECS arg must be an alist with `search-query-spec' and (cdr (assq 'search-query-spec specs)) (cdr (assq 'nnir-query-spec specs)) (gnus-search-make-spec no-parse)))) + ;; If our query came via an old call to nnir, we know not to + ;; parse the query. + (when (assq 'nnir-query-spec specs) + (setf (alist-get 'raw query-spec) t)) (gnus-group-make-group name (list 'nnselect "nnselect") @@ -3245,6 +3249,10 @@ non-nil SPECS arg must be an alist with `search-query-spec' and (or (cdr (assq 'search-query-spec specs)) (cdr (assq 'nnir-query-spec specs)) (gnus-search-make-spec no-parse)))) + ;; If our query came via an old call to nnir, we know not to parse + ;; the query. + (when (assq 'nnir-query-spec specs) + (setf (alist-get 'raw query-spec) t)) (gnus-group-read-ephemeral-group (concat "nnselect-" (message-unique-id)) (list 'nnselect "nnselect") diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index fbed9029fb..8b71daa9ff 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -962,12 +962,18 @@ Responsible for handling and, or, and parenthetical expressions.") (cl-defmethod gnus-search-make-query-string ((engine gnus-search-engine) query-spec) - (if (and gnus-search-use-parsed-queries - (null (alist-get 'raw query-spec)) - (null (slot-value engine 'raw-queries-p))) - (gnus-search-transform - engine (alist-get 'parsed-query query-spec)) - (alist-get 'query query-spec))) + (let ((parsed-query (alist-get 'parsed-query query-spec)) + (raw-query (alist-get 'query query-spec))) + (if (and gnus-search-use-parsed-queries + (null (alist-get 'raw query-spec)) + (null (slot-value engine 'raw-queries-p)) + parsed-query) + (gnus-search-transform engine parsed-query) + (if (listp raw-query) + ;; Some callers are sending this in as (query "query"), not + ;; as a cons cell? + (car raw-query) + raw-query)))) (defsubst gnus-search-single-p (query) "Return t if QUERY is a search for a single message." @@ -1108,7 +1114,7 @@ Other capabilities could be tested here." ;; TODO: Don't exclude booleans and date keys, just check for them ;; before checking for general keywords. (defvar gnus-search-imap-search-keys - '(body cc bcc from header keyword larger smaller subject text to uid) + '(body cc bcc from header keyword larger smaller subject text to uid x-gm-raw) "Known IMAP search keys, excluding booleans and date keys.") (cl-defmethod gnus-search-transform ((_ gnus-search-imap) @@ -1952,7 +1958,8 @@ remaining string, then adds all that to the top-level spec." (setq query (string-trim (replace-match "" t t query 0))) (setf (alist-get 'query query-spec) query))) - (when gnus-search-use-parsed-queries + (when (and gnus-search-use-parsed-queries + (null (alist-get 'raw query-spec))) (setf (alist-get 'parsed-query query-spec) (gnus-search-parse-query query))) query-spec)) commit 74de386a8a62f44520759320557a985dda923979 Author: Juri Linkov Date: Sun Nov 8 21:45:02 2020 +0200 * lisp/progmodes/project.el: Don't truncate the saved project list. * lisp/progmodes/project.el (project--write-project-list): Let-bind print-length and print-level to nil to not truncate the saved project list with unreadable ellipsis. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 6c647a092a..a648618e82 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1160,7 +1160,9 @@ With some possible metadata (to be decided).") (let ((filename project-list-file)) (with-temp-buffer (insert ";;; -*- lisp-data -*-\n") - (pp project--list (current-buffer)) + (let ((print-length nil) + (print-level nil)) + (pp project--list (current-buffer))) (write-region nil nil filename nil 'silent)))) ;;;###autoload commit 33c7ddd47da7645a5002185414868ff654452752 Author: Eric Abrahamsen Date: Sun Nov 8 08:37:03 2020 -0800 Another backwards-compatibility fix for gnus-search * lisp/gnus/gnus-search.el (gnus-search-server-to-engine): Because of the way we've set up the obsolete variable alias for `nnir-method-default-engines', we may end up with its value in `gnus-search-default-engines'. Make the check for "old style" values general, so we catch them no matter where they came from. diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index abee7c4711..fbed9029fb 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1963,25 +1963,29 @@ remaining string, then adds all that to the top-level spec." (defun gnus-search-server-to-engine (srv) (let* ((method (gnus-server-to-method srv)) (engine-config (assoc 'gnus-search-engine (cddr method))) - (server - (or (nth 1 engine-config) - (cdr-safe (assoc (car method) gnus-search-default-engines)) - (when-let ((old (assoc 'nnir-search-engine - (cddr method)))) - (nnheader-message - 8 "\"nnir-search-engine\" is no longer a valid parameter") - (pcase (nth 1 old) - ('notmuch 'gnus-search-notmuch) - ('namazu 'gnus-search-namazu) - ('find-grep 'gnus-search-find-grep))))) - (inst + (server (or (nth 1 engine-config) + (cdr-safe (assoc (car method) gnus-search-default-engines)) + (when-let ((old (assoc 'nnir-search-engine + (cddr method)))) + (nnheader-message + 8 "\"nnir-search-engine\" is no longer a valid parameter") + (nth 1 old)))) + inst) + (setq server + (pcase server + ('notmuch 'gnus-search-notmuch) + ('namazu 'gnus-search-namazu) + ('find-grep 'gnus-search-find-grep) + ('imap 'gnus-search-imap) + (_ server)) + inst (cond ((null server) nil) ((eieio-object-p server) server) ((class-p server) (make-instance server)) - (t nil)))) + (t nil))) (if inst (when (cddr engine-config) ;; We're not being completely backward-compatible here, @@ -1994,7 +1998,7 @@ remaining string, then adds all that to the top-level spec." (nnheader-message 5 "Invalid search engine parameter: (%s %s)" key value))))) - (error "No search engine defined for %S" method)) + (error "No search engine defined for %s" srv)) inst)) (declare-function gnus-registry-get-id-key "gnus-registry" (id key)) commit b83e31bf9561f05204f503236373cbef14d61012 Merge: 7be8d8a801 cfe8a73cab Author: Eli Zaretskii Date: Sun Nov 8 16:51:13 2020 +0200 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs commit cfe8a73cab5e7a9c6a6fcc212bd9df980f233895 Author: Alan Mackenzie Date: Sun Nov 8 13:28:55 2020 +0000 Don't set the selected window to the miniwindow on a frame change. Intended to fix bug #44502. * src/minibuf.c (move_minibuffer_onto_frame): Remove the lines of code which set the selected window to the minibuffer. diff --git a/src/minibuf.c b/src/minibuf.c index 068086ead8..8c19559b08 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -142,10 +142,6 @@ void move_minibuffer_onto_frame (void) set_window_buffer (sf->minibuffer_window, buffer, 0, 0); minibuf_window = sf->minibuffer_window; - if (EQ (XWINDOW (minibuf_window)->frame, selected_frame)) - /* The minibuffer might be on another frame. */ - Fset_frame_selected_window (selected_frame, sf->minibuffer_window, - Qnil); set_window_buffer (of->minibuffer_window, get_minibuffer (0), 0, 0); } } commit dcd20a0c5152746bd879f3903a4b22601bcf1379 Author: Dmitry Gutov Date: Sun Nov 8 14:29:11 2020 +0200 Doc fix * lisp/vc/vc.el (vc-deduce-fileset): Doc fix (bug#44420). diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 32664bcd25..83f2596865 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1045,7 +1045,7 @@ requesting the fileset doesn't intend to change the VC state, such as when printing the log or showing the diffs. If the current buffer is in `vc-dir' or Dired mode, FILESET is the -list of marked files, or the current directory if no files are +list of marked files, or the file under point if no files are marked. Otherwise, if the current buffer is visiting a version-controlled file or is an indirect buffer whose base buffer visits a commit 8dab61958daa8973ab8e7d7d2f829cc2ea4c8f8a Author: Dmitry Gutov Date: Sun Nov 8 14:02:55 2020 +0200 Mention which exact file is already registered * lisp/vc/vc.el (vc-register): Mention which exact file is already registered (bug#44420). diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 8def7da377..32664bcd25 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1391,7 +1391,7 @@ first backend that could register the file is used." (unless fname (setq fname buffer-file-name)) (when (vc-call-backend backend 'registered fname) - (error "This file is already registered")) + (error "This file is already registered: %s" fname)) ;; Watch out for new buffers of size 0: the corresponding file ;; does not exist yet, even though buffer-modified-p is nil. (when bname commit 33e8116fc2c24b14d30c08a09cc034bea6f9d584 Merge: 1de00441a5 f5d7fb3a2d Author: Glenn Morris Date: Sat Nov 7 09:57:56 2020 -0800 Merge from origin/emacs-27 f5d7fb3a2d (origin/emacs-27) Fix 'uudecode-decode-region-internal' in... d4242177da Fix 'send-string-to-terminal' writing very long strings 9da0f4026c * lisp/subr.el (read-char-from-minibuffer): Doc fix. (Bug... 9899f74e4e Merge branch 'emacs-27' of git.savannah.gnu.org:/srv/git/e... a6fcba783e Fix documentation of 'windmove-swap-states-default-keybind... f4acd7a924 Split windows evenly when 'min-margins' parameter was set ... commit 1de00441a5cd983ae4d76eecd80286928e791e96 Merge: 6b63b6669d 0cdd6c9218 Author: Glenn Morris Date: Sat Nov 7 09:57:56 2020 -0800 ; Merge from origin/emacs-27 The following commits were skipped: 0cdd6c9218 Handle Cairo errors in ftcrfont_open 29af10afe8 Backport: Fix exiting the finder-commentary buffer commit 6b63b6669d51331381063781dd28bb02a26d3d04 Merge: 35d9881809 53933cdf5c Author: Glenn Morris Date: Sat Nov 7 09:57:56 2020 -0800 Merge from origin/emacs-27 53933cdf5c ; * lisp/international/mule.el (define-coding-system): Doc... e90ffcf759 * src/w32fns.c (Fw32_register_hot_key): Doc fix. (Bug#44456) 89740e9cb5 Prevent redisplay from moving point behind user's back 5932df7435 Document that the :match function for a widget takes an ex... 1b7ab9d0ac Don't render XML declaration of an HTML document (bug#44348) # Conflicts: # lisp/international/mule.el commit 35d9881809b4e27d1ae0fe1c7329df8e0968f5f8 Author: Eric Abrahamsen Date: Sat Nov 7 09:40:40 2020 -0800 Various fixes and backward compatibility for gnus-search * lisp/gnus/gnus-group.el (gnus-group-make-search-group, gnus-group-read-ephemeral-search-group): Check for and accept the old nnir-* spec keys. * lisp/gnus/gnus-search.el (shared-initialize): Use generate-new-buffer instead of doing it ourselves. (gnus-search-server-to-engine): Raise an informative error explicitly if we can't find a search engine, rather than letting it fall through to something less helpful. (gnus-search-make-spec): Add `gnus-search--complete-key-data' to `completion-at-point-functions' locally, not globally. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index c6f7e1c41a..9db0e1897a 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -3186,6 +3186,7 @@ non-nil SPECS arg must be an alist with `search-query-spec' and (let* ((group-spec (or (cdr (assq 'search-group-spec specs)) + (cdr (assq 'nnir-group-spec specs)) (if (gnus-server-server-name) (list (list (gnus-server-server-name))) (seq-group-by @@ -3198,6 +3199,7 @@ non-nil SPECS arg must be an alist with `search-query-spec' and (query-spec (or (cdr (assq 'search-query-spec specs)) + (cdr (assq 'nnir-query-spec specs)) (gnus-search-make-spec no-parse)))) (gnus-group-make-group name @@ -3229,6 +3231,7 @@ non-nil SPECS arg must be an alist with `search-query-spec' and (interactive "P") (let* ((group-spec (or (cdr (assq 'search-group-spec specs)) + (cdr (assq 'nnir-group-spec specs)) (if (gnus-server-server-name) (list (list (gnus-server-server-name))) (seq-group-by @@ -3240,6 +3243,7 @@ non-nil SPECS arg must be an alist with `search-query-spec' and (assoc (gnus-group-topic-name) gnus-topic-alist)))))))) (query-spec (or (cdr (assq 'search-query-spec specs)) + (cdr (assq 'nnir-query-spec specs)) (gnus-search-make-spec no-parse)))) (gnus-group-read-ephemeral-group (concat "nnselect-" (message-unique-id)) diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 07bd2bca1b..abee7c4711 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -782,8 +782,7 @@ the files in ARTLIST by that search key.") (cl-defmethod shared-initialize ((engine gnus-search-process) slots) (setq slots (plist-put slots :proc-buffer - (get-buffer-create - (generate-new-buffer-name " *gnus-search-")))) + (generate-new-buffer " *gnus-search-"))) (cl-call-next-method engine slots)) (defclass gnus-search-imap (gnus-search-engine) @@ -1995,7 +1994,7 @@ remaining string, then adds all that to the top-level spec." (nnheader-message 5 "Invalid search engine parameter: (%s %s)" key value))))) - (nnheader-message 5 "No search engine defined for %s" srv)) + (error "No search engine defined for %S" method)) inst)) (declare-function gnus-registry-get-id-key "gnus-registry" (id key)) @@ -2127,7 +2126,8 @@ article came from is also searched." (minibuffer-with-setup-hook (lambda () (add-hook 'completion-at-point-functions - #'gnus-search--complete-key-data)) + #'gnus-search--complete-key-data + nil t)) (read-from-minibuffer "Query: " nil gnus-search-minibuffer-map nil 'gnus-search-history))) commit 7be8d8a801d0e4ec38b8ec79ef29d87b5fdf35b7 Merge: a5867ddfbd e8f5657bc7 Author: Eli Zaretskii Date: Sat Nov 7 17:26:45 2020 +0200 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs commit e8f5657bc7f6e0e45f70e4849736c6e87d44a1ac Author: Stefan Monnier Date: Sat Nov 7 10:15:22 2020 -0500 * lisp/emacs-lisp/lisp-mode.el: Avoid false-positive "hidden arg" in strings (lisp--match-hidden-arg): Don't misfire in strings and comments. Reported by: Andrii Kolomoiets diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 268992295b..daf4967089 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -178,13 +178,16 @@ (defun lisp--match-hidden-arg (limit) (let ((res nil)) + (forward-line 0) (while - (let ((ppss (parse-partial-sexp (line-beginning-position) + (let ((ppss (parse-partial-sexp (point) (line-end-position) -1))) (skip-syntax-forward " )") (if (or (>= (car ppss) 0) - (looking-at ";\\|$")) + (eolp) + (looking-at ";") + (nth 8 (syntax-ppss))) ;Within a string or comment. (progn (forward-line 1) (< (point) limit)) commit 423b6b62296df0558cf16f286dd268e0b49b3bce Author: Mauro Aranda Date: Sat Nov 7 09:53:21 2020 -0300 Add test for recent change in enable-theme * test/lisp/custom-tests.el (custom-test-enable-theme-keeps-settings): Enabling a theme should not change the theme settings, so test for that. See https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg00232.html diff --git a/test/lisp/custom-tests.el b/test/lisp/custom-tests.el index a1451cf0ce..7691f16773 100644 --- a/test/lisp/custom-tests.el +++ b/test/lisp/custom-tests.el @@ -156,4 +156,13 @@ (load custom-test-admin-cus-test) (should (null (cus-test-opts t)))) +(ert-deftest custom-test-enable-theme-keeps-settings () + "Test that enabling a theme doesn't change its settings." + (let* ((custom-theme-load-path `(,(ert-resource-directory))) + settings) + (load-theme 'custom--test 'no-confirm 'no-enable) + (setq settings (get 'custom--test 'theme-settings)) + (enable-theme 'custom--test) + (should (equal settings (get 'custom--test 'theme-settings))))) + ;;; custom-tests.el ends here commit a5867ddfbd721568005175bf6c725f7834b21ea4 Author: Eli Zaretskii Date: Sat Nov 7 12:29:41 2020 +0200 Don't leave lock files after 'replace-buffer-contents' * src/editfns.c (Freplace_buffer_contents): Unlock the buffer's file if no changes have been made. (Bug#44303) diff --git a/src/editfns.c b/src/editfns.c index ca6b8981eb..aedab47614 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2117,6 +2117,13 @@ nil. */) { signal_after_change (BEGV, size_a, ZV - BEGV); update_compositions (BEGV, ZV, CHECK_INSIDE); + /* We've locked the buffer's file above in + prepare_to_modify_buffer; if the buffer is unchanged at this + point, i.e. no insertions or deletions have been made, unlock + the file now. */ + if (SAVE_MODIFF == MODIFF + && STRINGP (BVAR (a, file_truename))) + unlock_file (BVAR (a, file_truename)); } return Qt; commit f5d7fb3a2dee3f9ae49151e3d01483aad7fb734b Author: Kazuhiro Ito Date: Thu Nov 5 19:48:08 2020 +0900 Fix 'uudecode-decode-region-internal' in multibyte buffers * lisp/mail/uudecode.el (uudecode-decode-region-internal): Fix inserting the decoded string into a multibyte buffer. Optimize by working with characters, not strings. (Bug#44411) Copyright-paperwork-exempt: yes diff --git a/lisp/mail/uudecode.el b/lisp/mail/uudecode.el index 9423275b2e..8bcb3925a9 100644 --- a/lisp/mail/uudecode.el +++ b/lisp/mail/uudecode.el @@ -162,12 +162,10 @@ If FILE-NAME is non-nil, save the result to FILE-NAME." (setq counter (1+ counter) inputpos (1+ inputpos)) (cond ((= counter 4) - (setq result (cons - (concat - (char-to-string (ash bits -16)) - (char-to-string (logand (ash bits -8) 255)) - (char-to-string (logand bits 255))) - result)) + (setq result (cons (logand bits 255) + (cons (logand (ash bits -8) 255) + (cons (ash bits -16) + result)))) (setq bits 0 counter 0)) (t (setq bits (ash bits 6))))))) (cond @@ -179,26 +177,26 @@ If FILE-NAME is non-nil, save the result to FILE-NAME." ;;(error "uucode ends unexpectedly") (setq done t)) ((= counter 3) - (setq result (cons - (concat - (char-to-string (logand (ash bits -16) 255)) - (char-to-string (logand (ash bits -8) 255))) - result))) + (setq result (cons (logand (ash bits -8) 255) + (cons (logand (ash bits -16) 255) + result)))) ((= counter 2) - (setq result (cons - (char-to-string (logand (ash bits -10) 255)) - result)))) + (setq result (cons (logand (ash bits -10) 255) + result)))) (skip-chars-forward non-data-chars end)) (if file-name (with-temp-file file-name (set-buffer-multibyte nil) - (insert (apply #'concat (nreverse result)))) + (apply #'insert (nreverse result))) (or (markerp end) (setq end (set-marker (make-marker) end))) (goto-char start) - (if enable-multibyte-characters - (dolist (x (nreverse result)) - (insert (decode-coding-string x 'binary))) - (insert (apply #'concat (nreverse result)))) + (apply #'insert + (nreverse + (if enable-multibyte-characters + (mapcar (lambda (ch) + (or (decode-char 'eight-bit ch) ch)) + result) + result))) (delete-region (point) end)))))) ;;;###autoload commit d4242177daaee9078245570125c5a99e65f55163 Author: Eli Zaretskii Date: Sat Nov 7 11:19:44 2020 +0200 Fix 'send-string-to-terminal' writing very long strings * src/dispnew.c (Fsend_string_to_terminal): Prevent partial writes by blocking SIGIO while 'fwrite' runs. (Bug#44320) diff --git a/src/dispnew.c b/src/dispnew.c index 5b6fa51a56..df55b32c71 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -5904,8 +5904,12 @@ when TERMINAL is nil. */) } out = tty->output; } + /* STRING might be very long, in which case fwrite could be + interrupted by SIGIO. So we temporarily block SIGIO. */ + unrequest_sigio (); fwrite (SDATA (string), 1, SBYTES (string), out); fflush (out); + request_sigio (); unblock_input (); return Qnil; } commit 9da0f4026c62ac917e84780a27a00eefc0f1c0c6 Author: Eli Zaretskii Date: Sat Nov 7 11:10:36 2020 +0200 * lisp/subr.el (read-char-from-minibuffer): Doc fix. (Bug#44451) diff --git a/lisp/subr.el b/lisp/subr.el index 2b3231b879..fcbd06a449 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2712,12 +2712,14 @@ Also discard all previous input in the minibuffer." (defvar empty-history) (defun read-char-from-minibuffer (prompt &optional chars history) - "Read a character from the minibuffer, prompting for PROMPT. + "Read a character from the minibuffer, prompting for it with PROMPT. Like `read-char', but uses the minibuffer to read and return a character. -When CHARS is non-nil, any input that is not one of CHARS is ignored. -When HISTORY is a symbol, then allows navigating in a history. -The navigation commands are `M-p' and `M-n', with `RET' to select -a character from history." +Optional argument CHARS, if non-nil, should be a list of characters; +the function will ignore any input that is not one of CHARS. +Optional argument HISTORY, if non-nil, should be a symbol that +specifies the history list variable to use for navigating in input +history using `M-p' and `M-n', with `RET' to select a character from +history." (let* ((empty-history '()) (map (if (consp chars) (or (gethash chars read-char-from-minibuffer-map-hash) commit 9899f74e4e1f45064a3235db153739ab769a3e45 Merge: a6fcba783e f4acd7a924 Author: Eli Zaretskii Date: Sat Nov 7 10:57:48 2020 +0200 Merge branch 'emacs-27' of git.savannah.gnu.org:/srv/git/emacs into emacs-27 commit a6fcba783e48a232fe8c60e6fb4803334dabddcc Author: Earl Hyatt Date: Wed Nov 4 07:26:06 2020 -0500 Fix documentation of 'windmove-swap-states-default-keybindings' * doc/emacs/windows.texi (Window Convenience): Fix description of 'windmove-swap-states-default-keybindings' and related index entry. (Bug#44441) diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index 4c67660b92..d2bac51a7b 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi @@ -579,7 +579,7 @@ buffer. @xref{Follow Mode}. @findex windmove-default-keybindings @findex windmove-display-default-keybindings @findex windmove-delete-default-keybindings -@findex windmove-swap-states-in-direction +@findex windmove-swap-states-default-keybindings The Windmove package defines commands for moving directionally between neighboring windows in a frame. @kbd{M-x windmove-right} selects the window immediately to the right of the currently selected @@ -593,7 +593,7 @@ keybindings for commands that specify in what direction to display the window for the buffer that the next command is going to display. Also there is @w{@kbd{M-x windmove-delete-default-keybindings}} to define keybindings for commands that delete windows directionally, and -@w{@kbd{M-x windmove-swap-states-in-direction}} that define +@w{@kbd{M-x windmove-swap-states-default-keybindings}} that defines keybindings for commands that swap the window contents of the selected window with the window in the specified direction. commit bc76afd355c0a6608830e2b43c8c67243aa0fa7b Author: Eli Zaretskii Date: Sat Nov 7 10:44:30 2020 +0200 ; * src/xdisp.c (redisplay_window): Add comment for a recent change. diff --git a/src/xdisp.c b/src/xdisp.c index bff14e584d..0001bcd98d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -18820,6 +18820,10 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) /* Try to scroll by specified few lines. */ if ((0 < scroll_conservatively + /* FIXME: the option is supposed to affect minibuffers, but we + test MINI_WINDOW_P, which can also catch uses of + mini-windows for displaying the echo area. Do we need to + distinguish these two use cases? */ || (scroll_minibuffer_conservatively && MINI_WINDOW_P (w)) || 0 < emacs_scroll_step || temp_scroll_step commit 33e2418a7cfd2ac1b98b86c5ddaf99c1d90daaf0 Author: Eli Zaretskii Date: Sat Nov 7 10:27:15 2020 +0200 Fix scrolling problems with misc-fixed fonts under Cairo * src/ftcrfont.c (ftcrfont_glyph_extents): Avoid rounding up the glyph ascent to a higher value than needed due to floating-point roundoff errors. (Bug#44284) diff --git a/src/ftcrfont.c b/src/ftcrfont.c index a10308c62e..b89510704e 100644 --- a/src/ftcrfont.c +++ b/src/ftcrfont.c @@ -84,7 +84,12 @@ ftcrfont_glyph_extents (struct font *font, cache->lbearing = floor (extents.x_bearing); cache->rbearing = ceil (extents.width + extents.x_bearing); cache->width = lround (extents.x_advance); - cache->ascent = ceil (- extents.y_bearing); + /* The subtraction of a small number is to avoid rounding up due + to floating-point inaccuracies with some fonts, which then + could cause unpleasant effects while scrolling (see bug + #44284), since we then think that a glyph row's ascent is too + small to accommodate a glyph with a higher phys_ascent. */ + cache->ascent = ceil (- extents.y_bearing - 1.0 / 256); cache->descent = ceil (extents.height + extents.y_bearing); } commit f4acd7a924fbb6400130e5091ea37e50e2d0fac2 Author: Martin Rudalics Date: Sat Nov 7 09:20:14 2020 +0100 Split windows evenly when 'min-margins' parameter was set (Bug#44483) * lisp/window.el (split-window): Make new window inherit any 'min-margins' parameter from WINDOW so that horizontal splits reliably produce windows of same width (Bug#44483). diff --git a/lisp/window.el b/lisp/window.el index 48005fc93e..ba56dedf04 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5412,7 +5412,13 @@ frame. The selected window is not changed by this function." (set-window-parameter (window-parent new) 'window-atom t)) (set-window-parameter new 'window-atom t))) - ;; Sanitize sizes unless SIZE was specified. + ;; Make the new window inherit the `min-margins' parameter of + ;; WINDOW (Bug#44483). + (let ((min-margins (window-parameter window 'min-margins))) + (when min-margins + (set-window-parameter new 'min-margins min-margins))) + + ;; Sanitize sizes unless SIZE was specified. (unless size (window--sanitize-window-sizes horizontal)) commit 0cdd6c9218f7df5793155e86d2028288b9b38bd1 Author: Pip Cet Date: Thu Oct 22 13:40:34 2020 +0200 Handle Cairo errors in ftcrfont_open * src/ftcrfont.c (ftcrfont_open): Handle Cairo errors (bug#41627). (cherry picked from commit 954a4decfcc8e41084789516773b22d0adc11d91) diff --git a/src/ftcrfont.c b/src/ftcrfont.c index a0e18e13cf..c5dfa09974 100644 --- a/src/ftcrfont.c +++ b/src/ftcrfont.c @@ -139,7 +139,8 @@ ftcrfont_open (struct frame *f, Lisp_Object entity, int pixel_size) FcPatternDestroy (pat); font_face = cairo_ft_font_face_create_for_pattern (match); - if (!font_face) + if (!font_face + || cairo_font_face_status (font_face) != CAIRO_STATUS_SUCCESS) { unblock_input (); FcPatternDestroy (match); @@ -154,6 +155,18 @@ ftcrfont_open (struct frame *f, Lisp_Object entity, int pixel_size) cairo_font_face_destroy (font_face); cairo_font_options_destroy (options); unblock_input (); + if (!scaled_font + || cairo_scaled_font_status (scaled_font) != CAIRO_STATUS_SUCCESS) + { + FcPatternDestroy (match); + return Qnil; + } + ft_face = cairo_ft_scaled_font_lock_face (scaled_font); + if (!ft_face) + { + FcPatternDestroy (match); + return Qnil; + } font_object = font_build_object (VECSIZE (struct font_info), AREF (entity, FONT_TYPE_INDEX), @@ -231,7 +244,6 @@ ftcrfont_open (struct frame *f, Lisp_Object entity, int pixel_size) font->descent = font->height - font->ascent; } - ft_face = cairo_ft_scaled_font_lock_face (scaled_font); if (XFIXNUM (AREF (entity, FONT_SIZE_INDEX)) == 0) { int upEM = ft_face->units_per_EM; commit ece1e1da5ea86fb02230e10111ea188ee0a59fc9 Author: Stefan Kangas Date: Sat Nov 7 08:20:21 2020 +0100 Delete outdated comment about C rewrite in apropos.el Maybe it made sense to rewrite apropos.el in C for speed in 1991, but today the speed increase would not outweigh the maintenance burden. * lisp/apropos.el: Delete outdated comment. diff --git a/lisp/apropos.el b/lisp/apropos.el index e7e8955afe..9debdfb19c 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -27,8 +27,7 @@ ;; The ideas for this package were derived from the C code in ;; src/keymap.c and elsewhere. The functions in this file should -;; always be byte-compiled for speed. Someone should rewrite this in -;; C (as part of src/keymap.c) for speed. +;; always be byte-compiled for speed. ;; The idea for super-apropos is based on the original implementation ;; by Lynn Slater . commit 6df06148e55959c0a31c50e260cfb697de3b4394 Author: Stefan Kangas Date: Sat Nov 7 07:55:50 2020 +0100 Add some more tests for keymap.c * test/src/keymap-tests.el (keymap-make-keymap) (keymap-make-sparse-keymap, keymap-keymapp) (keymap-keymap-parent, keymap-keymap-set-parent/returns-parent) (keymap-copy-keymap/is-equal, keymap-copy-keymap/is-not-eq) (keymap-lookup-key, keymap-apropos-internal) (keymap-apropos-internal/predicate): New tests. (keymap-tests--make-keymap-test): New defun. diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el index 0f3fde4804..8331a41e3f 100644 --- a/test/src/keymap-tests.el +++ b/test/src/keymap-tests.el @@ -24,6 +24,45 @@ (require 'ert) +(defun keymap-tests--make-keymap-test (fun) + (should (eq (car (funcall fun)) 'keymap)) + (should (proper-list-p (funcall fun))) + (should (equal (car (last (funcall fun "foo"))) "foo"))) + +(ert-deftest keymap-make-keymap () + (keymap-tests--make-keymap-test #'make-keymap) + (should (char-table-p (cadr (make-keymap))))) + +(ert-deftest keymap-make-sparse-keymap () + (keymap-tests--make-keymap-test #'make-sparse-keymap)) + +(ert-deftest keymap-keymapp () + (should (keymapp (make-keymap))) + (should (keymapp (make-sparse-keymap))) + (should-not (keymapp '(foo bar)))) + +(ert-deftest keymap-keymap-parent () + (should-not (keymap-parent (make-keymap))) + (should-not (keymap-parent (make-sparse-keymap))) + (let ((map (make-keymap))) + (set-keymap-parent map help-mode-map) + (should (equal (keymap-parent map) help-mode-map)))) + +(ert-deftest keymap-keymap-set-parent/returns-parent () + (let ((map (make-keymap))) + (should (equal (set-keymap-parent map help-mode-map) help-mode-map)))) + +(ert-deftest keymap-copy-keymap/is-equal () + (should (equal (copy-keymap help-mode-map) help-mode-map))) + +(ert-deftest keymap-copy-keymap/is-not-eq () + (should-not (eq (copy-keymap help-mode-map) help-mode-map))) + +(ert-deftest keymap-lookup-key () + (let ((map (make-keymap))) + (define-key map [?a] 'foo) + (should (eq (lookup-key map [?a]) 'foo)))) + (ert-deftest describe-buffer-bindings/header-in-current-buffer () "Header should be inserted into the current buffer. https://debbugs.gnu.org/39149#31" @@ -135,6 +174,16 @@ commit 86c19714b097aa477d339ed99ffb5136c755a046." (where-is-internal 'execute-extended-command global-map t)) [#x8000078]))) +(ert-deftest keymap-apropos-internal () + (should (equal (apropos-internal "^next-line$") '(next-line))) + (should (>= (length (apropos-internal "^help")) 100)) + (should-not (apropos-internal "^test-a-missing-symbol-foo-bar-zut$"))) + +(ert-deftest keymap-apropos-internal/predicate () + (should (equal (apropos-internal "^next-line$" #'commandp) '(next-line))) + (should (>= (length (apropos-internal "^help" #'commandp)) 15)) + (should-not (apropos-internal "^next-line$" #'keymapp))) + (provide 'keymap-tests) ;;; keymap-tests.el ends here commit 29af10afe8be0154a6ce2e538ff50aa1a174c9f0 Author: Stefan Kangas Date: Tue Nov 3 01:35:01 2020 +0100 Backport: Fix exiting the finder-commentary buffer Do not merge to master. * lisp/finder.el (finder-exit): Fix exiting the finder-commentary buffer. (Bug#44384) (finder-buffer): New defconst. (finder-list-keywords): Use above new defconst. diff --git a/lisp/finder.el b/lisp/finder.el index 71f8ac740e..5835144b06 100644 --- a/lisp/finder.el +++ b/lisp/finder.el @@ -178,6 +178,9 @@ directory name and PACKAGE is the name of a package (a symbol). When generating `package--builtins', Emacs assumes any file in DIR is part of the package PACKAGE.") +(defconst finder-buffer "*Finder*" + "Name of the Finder buffer.") + (defun finder-compile-keywords (&rest dirs) "Regenerate list of built-in Emacs packages. This recomputes `package--builtins' and `finder-keywords-hash', @@ -338,9 +341,9 @@ not `finder-known-keywords'." (defun finder-list-keywords () "Display descriptions of the keywords in the Finder buffer." (interactive) - (if (get-buffer "*Finder*") - (pop-to-buffer "*Finder*") - (pop-to-buffer (get-buffer-create "*Finder*")) + (if (get-buffer finder-buffer) + (pop-to-buffer finder-buffer) + (pop-to-buffer (get-buffer-create finder-buffer)) (finder-mode) (let ((inhibit-read-only t)) (erase-buffer) @@ -467,10 +470,9 @@ finder directory, \\[finder-exit] = quit, \\[finder-summary] = help"))) "Exit Finder mode. Quit the window and kill all Finder-related buffers." (interactive) - (let ((buf "*Finder*")) - (if (equal (current-buffer) buf) - (quit-window t) - (and (get-buffer buf) (kill-buffer buf))))) + (quit-window t) + (dolist (buf (list finder-buffer "*Finder-package*")) + (and (get-buffer buf) (kill-buffer buf)))) (defun finder-unload-function () "Unload the Finder library." commit b7b9bbb93d669f08fd485cb93bcd4caf7ad13613 Author: Mattias Engdegård Date: Fri Nov 6 23:02:29 2020 +0100 Rectify skip-set argument * lisp/gnus/gnus-search.el (gnus-search-query-end-of-input): Remove brackets that don't belong. Found by relint. diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 7ee7c53aca..07bd2bca1b 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -701,7 +701,7 @@ return one word." (defun gnus-search-query-end-of-input () "Are we at the end of input?" - (skip-chars-forward "[[:blank:]]") + (skip-chars-forward "[:blank:]") (looking-at "$")) ;;; Search engines commit 53933cdf5c8df479897b3c60d8c259d9d9dbc0f2 Author: Eli Zaretskii Date: Fri Nov 6 22:13:50 2020 +0200 ; * lisp/international/mule.el (define-coding-system): Doc fix. diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 86f3d2a34b..c47f072254 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -876,16 +876,23 @@ as an encoding result. `:inhibit-nul-byte-detection' -VALUE non-nil means Emacs ignore null bytes on code detection. +VALUE non-nil means Emacs should ignore null bytes on code detection. See the variable `inhibit-nul-byte-detection'. This attribute is meaningful only when `:coding-type' is `undecided'. +If VALUE is t, Emacs will ignore null bytes unconditionally while +detecting encoding. If VALUE is non-nil and not t, Emacs will +ignore null bytes if `inhibit-null-byte-detection' is non-nil. `:inhibit-iso-escape-detection' -VALUE non-nil means Emacs ignores ISO-2022 escape sequences on +VALUE non-nil means Emacs should ignore ISO-2022 escape sequences on code detection. See the variable `inhibit-iso-escape-detection'. This attribute is meaningful only when `:coding-type' is `undecided'. +If VALUE is t, Emacs will ignore escape sequences unconditionally +while detecting encoding. If VALUE is non-nil and not t, Emacs +will ignore escape sequences if `inhibit-iso-escape-detection' is +non-nil. `:prefer-utf-8' commit 6e9564f09a223f1c3f964e04905ecb3f235fa2f5 Author: Mattias Engdegård Date: Fri Nov 6 17:10:55 2020 +0100 Fix javac message parsing column number off-by-one * lisp/progmodes/compile.el (compilation-error-regexp-alist-alist): 'javac': Column numbers are 1-based by default; remove subtraction and η-reduce. Translate regexp to rx (mechanised). * test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data): Adapt 'javac' test cases to the change. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index de0ea428d5..e0dabed6a7 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -268,17 +268,20 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) "^\\(?:[ \t]+at \\|==[0-9]+== +\\(?:at\\|b\\(y\\)\\)\\).+(\\([^()\n]+\\):\\([0-9]+\\))$" 2 3 nil (1)) (javac - ,(concat - ;; line1 - "^\\(\\(?:[A-Za-z]:\\)?[^:\n]+\\):" ;file - "\\([0-9]+\\): " ;line - "\\(warning: \\)?.*\n" ;type (optional) and message - ;; line2: source line containing error - ".*\n" - ;; line3: single "^" under error position in line2 - " *\\^$") + ,(rx bol + (group ; file + (? (in "A-Za-z") ":") + (+ (not (in "\n:")))) + ":" + (group (+ (in "0-9"))) ; line number + ": " + (? (group "warning: ")) ; type (optional) + (* nonl) "\n" ; message + (* nonl) "\n" ; source line containing error + (* " ") "^" ; caret line; ^ marks error + eol) 1 2 - ,(lambda () (1- (current-column))) + ,#'current-column (3)) (jikes-file diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el index b8ed6e0e76..0288cba789 100644 --- a/test/lisp/progmodes/compile-tests.el +++ b/test/lisp/progmodes/compile-tests.el @@ -191,10 +191,10 @@ ;; javac (javac "/src/Test.java:5: ';' expected\n foo foo\n ^\n" - 1 15 5 "/src/Test.java" 2) + 1 16 5 "/src/Test.java" 2) (javac "e:\\src\\Test.java:7: warning: ';' expected\n foo foo\n ^\n" - 1 10 7 "e:\\src\\Test.java" 1) + 1 11 7 "e:\\src\\Test.java" 1) ;; jikes-file jikes-line (jikes-file "Found 2 semantic errors compiling \"../javax/swing/BorderFactory.java\":" commit 6b77ad6e77a4812b05ee03360e853e0fcb822a96 Author: Glenn Morris Date: Fri Nov 6 08:00:54 2020 -0800 Fix --enable-check-lisp-object-type build * src/print.c (syms_of_print) : Fix type. diff --git a/src/print.c b/src/print.c index 9ff331fb8e..008bf5e639 100644 --- a/src/print.c +++ b/src/print.c @@ -2295,7 +2295,7 @@ Only independent graphic characters, and control characters with named escape sequences such as newline, are printed this way. Other integers, including those corresponding to raw bytes, are printed as numbers the usual way. */); - print_integers_as_characters = Qnil; + print_integers_as_characters = false; DEFVAR_LISP ("print-length", Vprint_length, doc: /* Maximum length of list to print before abbreviating. commit 093a6bec52d21aba6b3b1318a6d7bafc2c870f25 Author: Mattias Engdegård Date: Fri Nov 6 15:37:17 2020 +0100 Update gdb-mi-tests * test/lisp/progmodes/gdb-mi-tests.el (gdb-mi-parse-value): Make test pass after the change in gdb-mi-decode-strings default value. diff --git a/test/lisp/progmodes/gdb-mi-tests.el b/test/lisp/progmodes/gdb-mi-tests.el index 79493a571b..64b7a26663 100644 --- a/test/lisp/progmodes/gdb-mi-tests.el +++ b/test/lisp/progmodes/gdb-mi-tests.el @@ -34,8 +34,10 @@ '((alpha . "ab\ncd") (beta . ("x" ("y" (delta . ()))))))) - (should (equal (gdb-mi--from-string "alpha=\"a\\303\\245b\"") - `((alpha . ,(string-to-multibyte "a\303\245b"))))) + (let ((gdb-mi-decode-strings nil)) + (let ((ref `((alpha . ,(string-to-multibyte "a\303\245b"))))) + (should (equal (gdb-mi--from-string "alpha=\"a\\303\\245b\"") + ref)))) (let ((gdb-mi-decode-strings 'utf-8)) (should (equal (gdb-mi--from-string "alpha=\"a\\303\\245b\"") '((alpha . "aåb"))))) commit aea936562b033899f0b7160cc492bbea1006863b Author: Mattias Engdegård Date: Fri Nov 6 13:43:53 2020 +0100 * lisp/gnus/gnus-search.el (gnus-search-contact-tables): Fix type. A more precise type is desirable but at it is now correct ('list' is not). diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 15d96e3e0c..7ee7c53aca 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -410,7 +410,7 @@ returned by `completion-at-point-functions'. That usually means a list of strings, a hash table, or an alist." :group 'gnus-search :version "28.1" - :type 'list) + :type '(repeat sexp)) ;;; Search language commit 1b9e159525409d6a1ad41686c34f66aa2effa71e Author: Mattias Engdegård Date: Sat Oct 31 14:44:58 2020 +0100 Change the default value of gdb-mi-decode-strings to t (bug#44173) This is likely to be a more commonly wanted default value today. * lisp/progmodes/gdb-mi.el (gdb-mi-decode-strings): Change default. * doc/emacs/building.texi (Source Buffers): Update manual. * etc/NEWS: Announce. diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 3e09f24322..91c749aa2d 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -1092,13 +1092,12 @@ code that has already executed, in order to examine its execution in more detail. @vindex gdb-mi-decode-strings - If the file names of the source files are shown with octal escapes, -set the variable @code{gdb-mi-decode-strings} to the appropriate -coding-system, most probably @code{utf-8}. (This is @code{nil} by -default because GDB may emit octal escapes in situations where -decoding is undesirable, and also because the program being debugged -might use an encoding different from the one used to encode non-ASCII -file names on your system.) + By default, source file names and non-ASCII strings in the program +being debugged are decoded using the default coding-system. If you +prefer a different decoding, perhaps because the program being +debugged uses a different character encoding, set the variable +@code{gdb-mi-decode-strings} to the appropriate coding-system, or to +@code{nil} to leave non-ASCII characters as undecoded octal escapes. @node Breakpoints Buffer @subsubsection Breakpoints Buffer diff --git a/etc/NEWS b/etc/NEWS index 06a2864b7e..8b5acafe31 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -855,6 +855,11 @@ Now GDB only uses one source window to display source file by default. Customize 'gdb-max-source-window-count' to use more than one window. Control source file display by 'gdb-display-source-buffer-action'. ++++ +*** The default value of gdb-mi-decode-strings is now t. +This means that the default coding-system is now used to decode strings +and source file names from GDB. + ** Gravatar --- diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 4bebf88d35..6e9b6830a0 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -2455,7 +2455,7 @@ the end of the current result or async record is reached." ;; files, values of string variables in the inferior, etc., are all ;; encoded in the same encoding. -(defcustom gdb-mi-decode-strings nil +(defcustom gdb-mi-decode-strings t "When non-nil, decode octal escapes in GDB output into non-ASCII text. If the value is a coding-system, use that coding-system to decode commit 0c5eb1c7e798fdf16c3f2694285fe0d18367c6ea Author: Mattias Engdegård Date: Mon Nov 2 23:37:16 2020 +0100 Reduce integer-output-format to print-integers-as-characters The variable now only controls whether characters are printed, not the radix. Control chars are printed in human-readable syntax only when special escapes such as ?\n are available. Spaces, formatting and combining chars are excluded (bug#44155). Done in collaboration with Juri Linkov. * src/character.c (graphic_base_p): * src/print.c (named_escape): New functions. (print_object): Change semantics as described above. (syms_of_print): Rename integer-output-format. Update doc string. * doc/lispref/streams.texi (Output Variables): * etc/NEWS: * test/src/print-tests.el (print-integers-as-characters): Rename and update according to new semantics. The test now passes. diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi index f171f13779..0534afb67f 100644 --- a/doc/lispref/streams.texi +++ b/doc/lispref/streams.texi @@ -903,10 +903,16 @@ in the C function @code{sprintf}. For further restrictions on what you can use, see the variable's documentation string. @end defvar -@defvar integer-output-format -This variable specifies how to print integer numbers. The default is -@code{nil}, meaning use the decimal format. When bound to @code{t}, -print integers as characters when an integer represents a character -(@pxref{Basic Char Syntax}). When bound to the number @code{16}, -print non-negative integers in the hexadecimal format. +@defvar print-integers-as-characters +When this variable is non-@code{nil}, integers that represent +graphic base characters will be printed using Lisp character syntax +(@pxref{Basic Char Syntax}). Other numbers are printed the usual way. +For example, the list @code{(4 65 -1 10)} would be printed as +@samp{(4 ?A -1 ?\n)}. + +More precisely, values printed in character syntax are those +representing characters belonging to the Unicode general categories +Letter, Number, Punctuation, Symbol and Private-use +(@pxref{Character Properties}), as well as the control characters +having their own escape syntax such as newline. @end defvar diff --git a/etc/NEWS b/etc/NEWS index 1a1cfc3751..06a2864b7e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1711,12 +1711,6 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el. * Lisp Changes in Emacs 28.1 -** New variable 'integer-output-format' determines how to print integer values. -When this variable is bound to the value 't', integers are printed by -printing functions as characters when an integer represents a character. -When bound to the number 16, non-negative integers are printed in the -hexadecimal format. - +++ ** 'define-globalized-minor-mode' now takes a ':predicate' parameter. This can be used to control which major modes the minor mode should be @@ -1909,6 +1903,11 @@ file can affect code in another. For details, see the manual section 'replace-regexp-in-string', 'catch', 'throw', 'error', 'signal' and 'play-sound-file'. ++++ +** New variable 'print-integers-as-characters' modifies integer printing. +If this variable is non-nil, character syntax is used for printing +numbers when this makes sense, such as '?A' for 65. + * Changes in Emacs 28.1 on Non-Free Operating Systems diff --git a/src/character.c b/src/character.c index 5860f6a0c8..00b73293a3 100644 --- a/src/character.c +++ b/src/character.c @@ -982,6 +982,27 @@ printablep (int c) || gen_cat == UNICODE_CATEGORY_Cn)); /* unassigned */ } +/* Return true if C is graphic character that can be printed independently. */ +bool +graphic_base_p (int c) +{ + Lisp_Object category = CHAR_TABLE_REF (Vunicode_category_table, c); + if (! FIXNUMP (category)) + return false; + EMACS_INT gen_cat = XFIXNUM (category); + + return (!(gen_cat == UNICODE_CATEGORY_Mn /* mark, nonspacing */ + || gen_cat == UNICODE_CATEGORY_Mc /* mark, combining */ + || gen_cat == UNICODE_CATEGORY_Me /* mark, enclosing */ + || gen_cat == UNICODE_CATEGORY_Zs /* separator, space */ + || gen_cat == UNICODE_CATEGORY_Zl /* separator, line */ + || gen_cat == UNICODE_CATEGORY_Zp /* separator, paragraph */ + || gen_cat == UNICODE_CATEGORY_Cc /* other, control */ + || gen_cat == UNICODE_CATEGORY_Cs /* other, surrogate */ + || gen_cat == UNICODE_CATEGORY_Cf /* other, format */ + || gen_cat == UNICODE_CATEGORY_Cn)); /* other, unassigned */ +} + /* Return true if C is a horizontal whitespace character, as defined by https://www.unicode.org/reports/tr18/tr18-19.html#blank. */ bool diff --git a/src/character.h b/src/character.h index af5023f77c..cbf43097ae 100644 --- a/src/character.h +++ b/src/character.h @@ -583,6 +583,7 @@ extern bool alphanumericp (int); extern bool graphicp (int); extern bool printablep (int); extern bool blankp (int); +extern bool graphic_base_p (int); /* Look up the element in char table OBJ at index CH, and return it as an integer. If the element is not a character, return CH itself. */ diff --git a/src/print.c b/src/print.c index fa65a3cb26..9ff331fb8e 100644 --- a/src/print.c +++ b/src/print.c @@ -1848,6 +1848,24 @@ print_vectorlike (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag, return true; } +static char +named_escape (int i) +{ + switch (i) + { + case '\b': return 'b'; + case '\t': return 't'; + case '\n': return 'n'; + case '\f': return 'f'; + case '\r': return 'r'; + case ' ': return 's'; + /* \a, \v, \e and \d are excluded from printing as escapes since + they are somewhat rare as characters and more likely to be + plain integers. */ + } + return 0; +} + static void print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) { @@ -1908,29 +1926,30 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) { case_Lisp_Int: { - int c; - intmax_t i; + EMACS_INT i = XFIXNUM (obj); + char escaped_name; - if (EQ (Vinteger_output_format, Qt) && CHARACTERP (obj) - && (c = XFIXNUM (obj))) + if (print_integers_as_characters && i >= 0 && i <= MAX_UNICODE_CHAR + && ((escaped_name = named_escape (i)) + || graphic_base_p (i))) { printchar ('?', printcharfun); - if (escapeflag - && (c == ';' || c == '(' || c == ')' || c == '{' || c == '}' - || c == '[' || c == ']' || c == '\"' || c == '\'' || c == '\\')) + if (escaped_name) + { + printchar ('\\', printcharfun); + i = escaped_name; + } + else if (escapeflag + && (i == ';' || i == '\"' || i == '\'' || i == '\\' + || i == '(' || i == ')' + || i == '{' || i == '}' + || i == '[' || i == ']')) printchar ('\\', printcharfun); - printchar (c, printcharfun); - } - else if (INTEGERP (Vinteger_output_format) - && integer_to_intmax (Vinteger_output_format, &i) - && i == 16 && !NILP (Fnatnump (obj))) - { - int len = sprintf (buf, "#x%"pI"x", (EMACS_UINT) XFIXNUM (obj)); - strout (buf, len, len, printcharfun); + printchar (i, printcharfun); } else { - int len = sprintf (buf, "%"pI"d", XFIXNUM (obj)); + int len = sprintf (buf, "%"pI"d", i); strout (buf, len, len, printcharfun); } } @@ -2270,12 +2289,13 @@ A value of nil means to use the shortest notation that represents the number without losing information. */); Vfloat_output_format = Qnil; - DEFVAR_LISP ("integer-output-format", Vinteger_output_format, - doc: /* The format used to print integers. -When t, print characters from integers that represent a character. -When a number 16, print non-negative integers in the hexadecimal format. -Otherwise, by default print integers in the decimal format. */); - Vinteger_output_format = Qnil; + DEFVAR_BOOL ("print-integers-as-characters", print_integers_as_characters, + doc: /* Non-nil means integers are printed using characters syntax. +Only independent graphic characters, and control characters with named +escape sequences such as newline, are printed this way. Other +integers, including those corresponding to raw bytes, are printed +as numbers the usual way. */); + print_integers_as_characters = Qnil; DEFVAR_LISP ("print-length", Vprint_length, doc: /* Maximum length of list to print before abbreviating. diff --git a/test/src/print-tests.el b/test/src/print-tests.el index 7b026b6b21..202555adb3 100644 --- a/test/src/print-tests.el +++ b/test/src/print-tests.el @@ -383,25 +383,28 @@ otherwise, use a different charset." (let ((print-length 1)) (format "%S" h)))))) -(print-tests--deftest print-integer-output-format () +(print-tests--deftest print-integers-as-characters () ;; Bug#44155. - (let ((integer-output-format t) - (syms (list ?? ?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\ ?Á))) - (should (equal (read (print-tests--prin1-to-string syms)) syms)) - (should (equal (print-tests--prin1-to-string syms) - (concat "(" (mapconcat #'prin1-char syms " ") ")")))) - (let ((integer-output-format t) - (syms (list -1 0 1 ?\120 4194175 4194176 (max-char) (1+ (max-char))))) - (should (equal (read (print-tests--prin1-to-string syms)) syms))) - (let ((integer-output-format 16) - (syms (list -1 0 1 most-positive-fixnum (1+ most-positive-fixnum)))) - (should (equal (read (print-tests--prin1-to-string syms)) syms)) - (should (equal (print-tests--prin1-to-string syms) - (concat "(" (mapconcat - (lambda (i) - (if (and (>= i 0) (<= i most-positive-fixnum)) - (format "#x%x" i) (format "%d" i))) - syms " ") ")"))))) + (let* ((print-integers-as-characters t) + (chars '(?? ?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\ ?f ?~ ?Á 32 + ?\n ?\r ?\t ?\b ?\f ?\a ?\v ?\e ?\d)) + (nums '(-1 -65 0 1 31 #x80 #x9f #x110000 #x3fff80 #x3fffff)) + (nonprints '(#xd800 #xdfff #x030a #xffff #x2002 #x200c)) + (printed-chars (print-tests--prin1-to-string chars)) + (printed-nums (print-tests--prin1-to-string nums)) + (printed-nonprints (print-tests--prin1-to-string nonprints))) + (should (equal (read printed-chars) chars)) + (should (equal + printed-chars + (concat + "(?? ?\\; ?\\( ?\\) ?\\{ ?\\} ?\\[ ?\\] ?\\\" ?\\' ?\\\\" + " ?f ?~ ?Á ?\\s ?\\n ?\\r ?\\t ?\\b ?\\f 7 11 27 127)"))) + (should (equal (read printed-nums) nums)) + (should (equal printed-nums + "(-1 -65 0 1 31 128 159 1114112 4194176 4194303)")) + (should (equal (read printed-nonprints) nonprints)) + (should (equal printed-nonprints + "(55296 57343 778 65535 8194 8204)")))) (provide 'print-tests) ;;; print-tests.el ends here commit 527413fb2ff8c073d89ee2d22d38a67c74678b27 Author: Mauro Aranda Date: Fri Nov 6 09:34:08 2020 -0300 Go back to not using custom-push-theme when enabling a theme * lisp/custom.el (enable-theme): Relying on custom-push-theme to handle theme settings and prior user settings was a mistake. The theme settings haven't changed between loading the theme and enabling it, so we don't need all of what custom-push-theme does. However, we still need to save a user setting outside of Customize, in order to be able to get back to it, so do that in enable-theme itself. diff --git a/lisp/custom.el b/lisp/custom.el index cee4589543..3f1e8cacb2 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -1385,8 +1385,30 @@ function runs. To disable other themes, use `disable-theme'." ;; Loop through theme settings, recalculating vars/faces. (dolist (s settings) (let* ((prop (car s)) - (symbol (cadr s))) - (custom-push-theme prop symbol theme 'set (nth 3 s)) + (symbol (cadr s)) + (spec-list (get symbol prop)) + (sv (get symbol 'standard-value)) + (val (and (boundp symbol) (symbol-value symbol)))) + ;; We can't call `custom-push-theme' when enabling the theme: it's not + ;; that the theme settings have changed, it's just that we want to + ;; enable those settings. But we might need to save a user setting + ;; outside of Customize, in order to get back to it when disabling + ;; the theme, just like in `custom-push-theme'. + (when (and (custom--should-apply-setting theme) + ;; Only do it for variables; for faces, using + ;; `face-new-frame-defaults' is enough. + (eq prop 'theme-value) + (boundp symbol) + (not (or spec-list + ;; Only if the current value is different from + ;; the standard value. + (and sv (equal (eval (car sv)) val)) + ;; And only if the changed value is different + ;; from the new value under the user theme. + (and (eq theme 'user) + (equal (custom-quote val) (nth 3 s)))))) + (setq spec-list `((changed ,(custom-quote val))))) + (put symbol prop (cons (cddr s) (assq-delete-all theme spec-list))) (cond ((eq prop 'theme-face) (custom-theme-recalc-face symbol)) commit 291955a588cd8a99e93aff3eb79e16e83c3e3e13 Author: Eli Zaretskii Date: Fri Nov 6 13:49:07 2020 +0200 Improve documentation of a recent change * doc/emacs/mule.texi (Select Input Method): Add an @anchor. * doc/emacs/search.texi (Special Isearch): Add cross-reference and improve wording. diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index 200937c9d7..72ae769767 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi @@ -682,6 +682,7 @@ including the string that stands for it in the mode line. @findex activate-transient-input-method @kindex C-x \ +@anchor{transient input method} Sometimes it can be convenient to enable an input method @dfn{transiently}, for inserting only a single character. Typing @kbd{C-x \} (@code{activate-transient-input-method}) will temporarily diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index f33c71db22..0612c134d1 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -438,10 +438,11 @@ I-search [@var{im}]: @noindent where @var{im} is the mnemonic of the active input method. Any input method you enable during incremental search remains enabled in the -current buffer afterwards. You can temporarily enable a transient -input method with @kbd{C-x \} (@code{isearch-transient-input-method}) -to insert a single character to the search string and automatically -disable the input method afterwards. +current buffer afterwards. Finally, you can temporarily enable a +transient input method (@pxref{transient input method}) with +@kbd{C-x \} (@code{isearch-transient-input-method}) to insert a single +character to the search string using an input method, and +automatically disable the input method afterwards. @end itemize @kindex M-s o @r{(Incremental Search)} commit af6891629d48f348b6458384898a637cc7ce16e7 Author: Juri Linkov Date: Fri Nov 6 10:31:58 2020 +0200 Support transient input methods in Isearch mode (bug#44266) * doc/emacs/mule.texi (Select Input Method): Rename transient-input-method to activate-transient-input-method. * doc/emacs/search.texi (Special Isearch): Document isearch-transient-input-method. * lisp/international/isearch-x.el (isearch-transient-input-method): New function. (isearch-process-search-multibyte-characters): Call 'deactivate-transient-input-method' after 'read-string'. * lisp/international/mule-cmds.el (mule-menu-keymap): Remove duplicate menu item 'describe-input-method'. Add new menu item 'activate-transient-input-method'. (default-transient-input-method): Rename from transient-input-method. (current-transient-input-method) (previous-transient-input-method): New buffer-local variables. (deactivate-input-method): Don't add current-transient-input-method to input-method-history. (toggle-input-method): Call deactivate-transient-input-method when current-transient-input-method is non-nil. (activate-transient-input-method): Rename from transient-input-method. (deactivate-transient-input-method): New function with body from renamed function transient-input-method. * lisp/isearch.el (isearch-menu-bar-map): Add new menu item 'isearch-transient-input-method'. (isearch-mode-map): Bind 'C-x \' to isearch-transient-input-method. (isearch-forward): Add isearch-transient-input-method to docstring. (isearch-message-prefix): Use shorter string for narrowed buffer. diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index 2fca4a544c..200937c9d7 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi @@ -581,7 +581,7 @@ Select a new input method for the current buffer (@code{set-input-method}). @item C-x \ @var{method} @key{RET} Temporarily enable the selected transient input method ; it will be automatically disabled after inserting a single character -(@code{transient-input-method}). +(@code{activate-transient-input-method}). @item C-h I @var{method} @key{RET} @itemx C-h C-\ @var{method} @key{RET} @@ -680,13 +680,13 @@ character. input methods. The list gives information about each input method, including the string that stands for it in the mode line. -@findex transient-input-method +@findex activate-transient-input-method @kindex C-x \ Sometimes it can be convenient to enable an input method @dfn{transiently}, for inserting only a single character. Typing -@kbd{C-x \} (@code{transient-input-method}) will temporarily enable an -input method, let you insert a single character using the input method -rules, and then automatically disable the input method. If no +@kbd{C-x \} (@code{activate-transient-input-method}) will temporarily +enable an input method, let you insert a single character using the input +method rules, and then automatically disable the input method. If no transient input method was selected yet, @kbd{C-x \} will prompt you for an input method; subsequent invocations of this command will enable the selected transient input method. To select a different diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index 91b433f173..f33c71db22 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -419,6 +419,7 @@ character into the search string, similar to the usual @kindex C-^ @r{(Incremental Search)} @findex isearch-toggle-input-method @findex isearch-toggle-specified-input-method +@findex isearch-transient-input-method Use an input method (@pxref{Input Methods}). If an input method is enabled in the current buffer when you start the search, the same method will be active in the minibuffer when you type the search @@ -437,7 +438,10 @@ I-search [@var{im}]: @noindent where @var{im} is the mnemonic of the active input method. Any input method you enable during incremental search remains enabled in the -current buffer afterwards. +current buffer afterwards. You can temporarily enable a transient +input method with @kbd{C-x \} (@code{isearch-transient-input-method}) +to insert a single character to the search string and automatically +disable the input method afterwards. @end itemize @kindex M-s o @r{(Incremental Search)} diff --git a/etc/NEWS b/etc/NEWS index ca8f71fe26..1a1cfc3751 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -652,6 +652,8 @@ transient input method (which can be different from the input method enabled by 'C-\'). For example, 'C-u C-x \ compose RET' selects the 'compose' input method; then typing 'C-x \ 1 2' will insert the character '½', and disable the 'compose' input method afterwards. +You can use 'C-x \' in incremental search to insert a single character +to the search string. --- *** New input method 'compose' based on X Multi_key sequences. diff --git a/lisp/international/isearch-x.el b/lisp/international/isearch-x.el index d77234ec77..f50f86a035 100644 --- a/lisp/international/isearch-x.el +++ b/lisp/international/isearch-x.el @@ -51,6 +51,17 @@ (setq input-method-function nil) (isearch-update)) +;;;###autoload +(defun isearch-transient-input-method () + "Activate transient input method in interactive search." + (interactive) + (let ((overriding-terminal-local-map nil)) + (activate-transient-input-method)) + (setq isearch-input-method-function input-method-function + isearch-input-method-local-p t) + (setq input-method-function nil) + (isearch-update)) + (defvar isearch-minibuffer-local-map (let ((map (copy-keymap minibuffer-local-map))) (define-key map [with-keyboard-coding] 'isearch-with-keyboard-coding) @@ -117,6 +128,7 @@ (cons last-char unread-command-events)) ;; Inherit current-input-method in a minibuffer. str (read-string prompt isearch-message 'junk-hist nil t)) + (deactivate-transient-input-method) (if (or (not str) (< (length str) (length isearch-message))) ;; All inputs were deleted while the input method ;; was working. diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index dc435d9b17..439843aaf8 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -55,7 +55,7 @@ ;; Keep "C-x C-m ..." for mule specific commands. (define-key ctl-x-map "\C-m" mule-keymap) -(define-key ctl-x-map "\\" 'transient-input-method) +(define-key ctl-x-map "\\" 'activate-transient-input-method) (defvar describe-language-environment-map (let ((map (make-sparse-keymap "Describe Language Environment"))) @@ -140,8 +140,8 @@ `(menu-item "Set Coding Systems" ,set-coding-system-map)) (bindings--define-key map [separator-input-method] menu-bar-separator) - (bindings--define-key map [describe-input-method] - '(menu-item "Describe Input Method" describe-input-method)) + (bindings--define-key map [activate-transient-input-method] + '(menu-item "Transient Input Method" activate-transient-input-method)) (bindings--define-key map [set-input-method] '(menu-item "Select Input Method..." set-input-method)) (bindings--define-key map [toggle-input-method] @@ -1345,10 +1345,10 @@ This is the input method activated automatically by the command mule-input-method-string) :set-after '(current-language-environment)) -(defcustom transient-input-method nil +(defcustom default-transient-input-method nil "Default transient input method. This is the input method activated by the command -`transient-input-method' (\\[transient-input-method])." +`activate-transient-input-method' (\\[activate-transient-input-method])." :link '(custom-manual "(emacs)Input Methods") :group 'mule :type '(choice (const nil) @@ -1356,6 +1356,18 @@ This is the input method activated by the command :set-after '(current-language-environment) :version "28.1") +(defvar current-transient-input-method nil + "The current input method temporarily enabled by `activate-transient-input-method'. +If nil, that means no transient input method is active now.") +(make-variable-buffer-local 'current-transient-input-method) +(put 'current-transient-input-method 'permanent-local t) + +(defvar previous-transient-input-method nil + "The input method that was active before enabling the transient input method. +If nil, that means no previous input method was active.") +(make-variable-buffer-local 'previous-transient-input-method) +(put 'previous-transient-input-method 'permanent-local t) + (put 'input-method-function 'permanent-local t) (defvar input-method-history nil @@ -1490,7 +1502,8 @@ If INPUT-METHOD is nil, deactivate any current input method." (defun deactivate-input-method () "Turn off the current input method." (when current-input-method - (add-to-history 'input-method-history current-input-method) + (unless current-transient-input-method + (add-to-history 'input-method-history current-input-method)) (unwind-protect (progn (setq input-method-function nil @@ -1531,36 +1544,6 @@ To deactivate it programmatically, use `deactivate-input-method'." (defvar toggle-input-method-active nil "Non-nil inside `toggle-input-method'.") -(defun transient-input-method (&optional arg interactive) - "Enable a transient input method for the current buffer. -If `transient-input-method' was not yet defined, prompt for it." - (interactive "P\np") - (when (or arg (not transient-input-method)) - (let* ((default (or (car input-method-history) default-input-method)) - (input-method - (read-input-method-name - (if default "Transient input method (default %s): " "Transient input method: ") - default t))) - (setq transient-input-method input-method) - (when interactive - (customize-mark-as-set 'transient-input-method)))) - (let* ((previous-input-method current-input-method) - (history input-method-history) - (clearfun (make-symbol "clear-transient-input-method")) - (exitfun - (lambda () - (deactivate-input-method) - (when previous-input-method - (activate-input-method previous-input-method)) - (setq input-method-history history) - (remove-hook 'input-method-after-insert-chunk-hook clearfun)))) - (fset clearfun (lambda () (funcall exitfun))) - (add-hook 'input-method-after-insert-chunk-hook clearfun) - (when previous-input-method - (deactivate-input-method)) - (activate-input-method transient-input-method) - exitfun)) - (defun toggle-input-method (&optional arg interactive) "Enable or disable multilingual text input method for the current buffer. Only one input method can be enabled at any time in a given buffer. @@ -1582,7 +1565,9 @@ which marks the variable `default-input-method' as set for Custom buffers." (if toggle-input-method-active (error "Recursive use of `toggle-input-method'")) (if (and current-input-method (not arg)) - (deactivate-input-method) + (if current-transient-input-method + (deactivate-transient-input-method) + (deactivate-input-method)) (let ((toggle-input-method-active t) (default (or (car input-method-history) default-input-method))) (if (and arg default (equal current-input-method default) @@ -1601,6 +1586,42 @@ which marks the variable `default-input-method' as set for Custom buffers." (when interactive (customize-mark-as-set 'default-input-method))))))) +(defun activate-transient-input-method (&optional arg interactive) + "Select and enable a transient input method for the current buffer. +If `default-transient-input-method' was not yet defined, prompt for it." + (interactive "P\np") + (when (or arg (not default-transient-input-method)) + (let* ((default (or (car input-method-history) default-input-method)) + (input-method + (read-input-method-name + (format-prompt "Transient input method" default) + default t))) + (setq default-transient-input-method input-method) + (when interactive + (customize-mark-as-set 'default-transient-input-method)))) + (let* ((clearfun (make-symbol "clear-transient-input-method")) + (exitfun + (lambda () + (deactivate-transient-input-method) + (remove-hook 'input-method-after-insert-chunk-hook clearfun)))) + (fset clearfun (lambda () (funcall exitfun))) + (add-hook 'input-method-after-insert-chunk-hook clearfun) + (setq previous-transient-input-method current-input-method) + (when previous-transient-input-method + (deactivate-input-method)) + (activate-input-method default-transient-input-method) + (setq current-transient-input-method default-transient-input-method) + exitfun)) + +(defun deactivate-transient-input-method () + "Disable currently active transient input method for the current buffer." + (when current-transient-input-method + (deactivate-input-method) + (when previous-transient-input-method + (activate-input-method previous-transient-input-method) + (setq previous-transient-input-method nil)) + (setq current-transient-input-method nil))) + (autoload 'help-buffer "help-mode") (defun describe-input-method (input-method) diff --git a/lisp/isearch.el b/lisp/isearch.el index 245bf452b1..4fba4370d9 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -565,6 +565,10 @@ This is like `describe-bindings', but displays only Isearch keys." :help "Highlight all matches for current search string")) (define-key map [isearch-search-replace-separator] '(menu-item "--")) + (define-key map [isearch-transient-input-method] + '(menu-item "Turn on transient input method" + isearch-transient-input-method + :help "Turn on transient input method for search")) (define-key map [isearch-toggle-specified-input-method] '(menu-item "Turn on specific input method" isearch-toggle-specified-input-method @@ -747,6 +751,7 @@ This is like `describe-bindings', but displays only Isearch keys." ;; For searching multilingual text. (define-key map "\C-\\" 'isearch-toggle-input-method) (define-key map "\C-^" 'isearch-toggle-specified-input-method) + (define-key map "\C-x\\" 'isearch-transient-input-method) ;; People expect to be able to paste with the mouse. (define-key map [mouse-2] #'isearch-mouse-2) @@ -1078,6 +1083,8 @@ To use a different input method for searching, type \ \\[isearch-toggle-specified-input-method], and specify an input method you want to use. +To activate a transient input method, type \\[isearch-transient-input-method]. + The above keys, bound in `isearch-mode-map', are often controlled by options; do \\[apropos] on search-.* to find them. Other control and meta characters terminate the search @@ -3263,7 +3270,7 @@ the word mode." "over") (if isearch-wrapped "wrapped ") (if (and (not isearch-success) (buffer-narrowed-p) widen-automatically) - "narrowed-buffer " "") + "narrowed " "") (if (and (not isearch-success) (not isearch-case-fold-search)) "case-sensitive ") (let ((prefix "")) commit 2180ccbe29701f274d8390355d13ee41cf9727be Author: Eli Zaretskii Date: Fri Nov 6 07:51:07 2020 +0200 ; * etc/NEWS: Fix wording in a recently added entry. diff --git a/etc/NEWS b/etc/NEWS index 7ef832e603..ca8f71fe26 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -90,14 +90,15 @@ This is controlled by the new variable 'scroll-minibuffer-conservatively'. +++ ** Improved handling of minibuffers on switching frames. -By default, an active minibuffer now moves to a newly selected frame. -When continuing the current command (by completing the minibuffer -action), the effect happens in the frame where the minibuffer was -first opened. An alternative behavior is available by customizing +By default, when you switch to another frame, an active minibuffer now +moves to the newly selected frame. Nevertheless, the effect of what +you type in the minibuffer happens in the frame where the minibuffer +was first activated, even if it moved to another frame. An +alternative behavior is available by customizing 'minibuffer-follows-selected-frame' to nil. Here, the minibuffer stays in the frame where you first opened it, and you must switch back to this frame to continue or abort its command. The old, somewhat -unsystematic behavior is no longer available. +unsystematic behavior, which mixed these two is no longer available. +++ ** New system for displaying documentation for groups of functions. commit 1efcec2717a683202cbea538aabfb9f71ea1ec96 Author: Stefan Kangas Date: Fri Nov 6 04:45:26 2020 +0100 Add more tests for where-is-internal * test/src/keymap-tests.el (keymap-where-is-internal) (keymap-where-is-internal/firstonly-t) (keymap-where-is-internal/menu-item) (keymap-where-is-internal/advertised-binding) (keymap-where-is-internal/advertised-binding-respect-remap) (keymap-where-is-internal/remap) (keymap-where-is-internal/shadowed): New tests. (keymap-where-is-internal/preferred-modifier-is-a-string): Rename from keymap-where-is-internal-test. diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el index 1a30a7d3a0..0f3fde4804 100644 --- a/test/src/keymap-tests.el +++ b/test/src/keymap-tests.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2015-2020 Free Software Foundation, Inc. ;; Author: Juanma Barranquero +;; Stefan Kangas ;; This file is part of GNU Emacs. @@ -51,7 +52,83 @@ commit 86c19714b097aa477d339ed99ffb5136c755a046." (should (eq (lookup-key Buffer-menu-mode-map [32]) 'undefined))) (define-key Buffer-menu-mode-map [32] def)))) -(ert-deftest keymap-where-is-internal-test () + +;;;; where-is-internal + +(defun keymap-tests--command-1 () (interactive) nil) +(defun keymap-tests--command-2 () (interactive) nil) +(put 'keymap-tests--command-1 :advertised-binding [?y]) + +(ert-deftest keymap-where-is-internal () + (let ((map (make-sparse-keymap))) + (define-key map "x" 'keymap-tests--command-1) + (define-key map "y" 'keymap-tests--command-1) + (should (equal (where-is-internal 'keymap-tests--command-1 map) + '([?y] [?x]))))) + +(ert-deftest keymap-where-is-internal/firstonly-t () + (let ((map (make-sparse-keymap))) + (define-key map "x" 'keymap-tests--command-1) + (define-key map "y" 'keymap-tests--command-1) + (should (equal (where-is-internal 'keymap-tests--command-1 map t) + [?y])))) + +(ert-deftest keymap-where-is-internal/menu-item () + (let ((map (make-sparse-keymap))) + (define-key map [menu-bar foobar cmd1] + '(menu-item "Run Command 1" keymap-tests--command-1 + :help "Command 1 Help")) + (define-key map "x" 'keymap-tests--command-1) + (should (equal (where-is-internal 'keymap-tests--command-1 map) + '([?x] [menu-bar foobar cmd1]))) + (should (equal (where-is-internal 'keymap-tests--command-1 map t) [?x])))) + + +(ert-deftest keymap-where-is-internal/advertised-binding () + ;; Make sure order does not matter. + (dolist (keys '(("x" . "y") ("y" . "x"))) + (let ((map (make-sparse-keymap))) + (define-key map (car keys) 'keymap-tests--command-1) + (define-key map (cdr keys) 'keymap-tests--command-1) + (should (equal (where-is-internal 'keymap-tests--command-1 map t) [121]))))) + +(ert-deftest keymap-where-is-internal/advertised-binding-respect-remap () + (let ((map (make-sparse-keymap))) + (define-key map "x" 'next-line) + (define-key map [remap keymap-tests--command-1] 'next-line) + (define-key map "y" 'keymap-tests--command-1) + (should (equal (where-is-internal 'keymap-tests--command-1 map t) [?x])))) + +(ert-deftest keymap-where-is-internal/remap () + (let ((map (make-keymap))) + (define-key map (kbd "x") 'foo) + (define-key map (kbd "y") 'bar) + (define-key map [remap foo] 'bar) + (should (equal (where-is-internal 'foo map t) [?y])) + (should (equal (where-is-internal 'bar map t) [?y])))) + +(defvar keymap-tests-minor-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "x" 'keymap-tests--command-2) + map)) + +(defvar keymap-tests-major-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "x" 'keymap-tests--command-1) + map)) + +(define-minor-mode keymap-tests-minor-mode "Test.") + +(define-derived-mode keymap-tests-major-mode nil "Test.") + +(ert-deftest keymap-where-is-internal/shadowed () + (with-temp-buffer + (keymap-tests-major-mode) + (keymap-tests-minor-mode) + (should-not (where-is-internal 'keymap-tests--command-1 nil t)) + (should (equal (where-is-internal 'keymap-tests--command-2 nil t) [120])))) + +(ert-deftest keymap-where-is-internal/preferred-modifier-is-a-string () "Make sure we don't crash when `where-is-preferred-modifier' is not a symbol." (should (equal (let ((where-is-preferred-modifier "alt")) commit ac471ff09d9b7874c53447fdd2d06efd2d8b1e40 Author: Eric Abrahamsen Date: Wed Nov 4 21:13:03 2020 -0800 Fixes and improvements to gnus-search * lisp/gnus/gnus-search.el (gnus-search-default-engines): Change type from a list of two-element lists, to alist. This matches nnir's old option type, and should make transition easier. (nnir-imap-default-search-key): Note that variable is obsolete. (gnus-search-transform-expression): Interpret the "attachment" key as "body" in imap searches. Allow specifying larger/smaller message size values in KB or MB units. (gnus-search-server-to-engine): Fix error in this function, and clarify somewhat. diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 3053501fe7..15d96e3e0c 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -74,10 +74,6 @@ ;; need a completely separate top-level command, since we wouldn't be ;; creating a group at all. -;; TODO: Do better with handling message size searches. Make sure -;; we're providing for the usual shorthands (kb, M, etc), and that all -;; the engines handle it properly. - ;;; Code: (require 'gnus-group) @@ -134,6 +130,10 @@ transformed." :type 'regexp :group 'gnus-search) +(make-obsolete-variable + 'nnir-imap-default-search-key + "specify imap search keys, or use parsed queries." "28.1") + ;; Engine-specific configuration options. (defcustom gnus-search-swish++-config-file @@ -930,11 +930,11 @@ quirks.") (define-obsolete-variable-alias 'nnir-method-default-engines 'gnus-search-default-engines "28.1") -(defcustom gnus-search-default-engines '((nnimap gnus-search-imap)) +(defcustom gnus-search-default-engines '((nnimap . gnus-search-imap)) "Alist of default search engines keyed by server method." :version "26.1" :group 'gnus-search - :type `(repeat (list (choice (const nnimap) (const nntp) (const nnspool) + :type `(repeat (cons (choice (const nnimap) (const nntp) (const nnspool) (const nneething) (const nndir) (const nnmbox) (const nnml) (const nnmh) (const nndraft) (const nnfolder) (const nnmaildir)) @@ -1168,7 +1168,21 @@ means (usually the \"mark\" keyword)." (cl-case (car expr) (date (setcar expr 'on)) (tag (setcar expr 'keyword)) - (sender (setcar expr 'from))) + (sender (setcar expr 'from)) + (attachment (setcar expr 'body))) + ;; Allow sizes specified as KB or MB. + (let ((case-fold-search t) + unit) + (when (and (memq (car expr) '(larger smaller)) + (string-match "\\(kb?\\|mb?\\)\\'" (cdr expr))) + (setq unit (match-string 1 (cdr expr))) + (setcdr expr + (number-to-string + (* (string-to-number + (string-replace unit "" (cdr expr))) + (if (string-prefix-p "k" unit) + 1024 + 1048576)))))) (cond ((consp (car expr)) (format "(%s)" (gnus-search-transform engine expr))) @@ -1176,14 +1190,14 @@ means (usually the \"mark\" keyword)." (gnus-search-transform engine (gnus-search-parse-query (format - "to:%s or cc:%s or bcc:%s" - (cdr expr) (cdr expr) (cdr expr))))) + "to:%s or cc:%s or bcc:%s" + (cdr expr) (cdr expr) (cdr expr))))) ((eq (car expr) 'address) (gnus-search-transform engine (gnus-search-parse-query (format - "from:%s or to:%s or cc:%s or bcc:%s" - (cdr expr) (cdr expr) (cdr expr) (cdr expr))))) + "from:%s or to:%s or cc:%s or bcc:%s" + (cdr expr) (cdr expr) (cdr expr) (cdr expr))))) ((memq (car expr) '(before since on sentbefore senton sentsince)) ;; Ignore dates given as strings. (when (listp (cdr expr)) @@ -1949,28 +1963,32 @@ remaining string, then adds all that to the top-level spec." ;; server. (defun gnus-search-server-to-engine (srv) (let* ((method (gnus-server-to-method srv)) + (engine-config (assoc 'gnus-search-engine (cddr method))) (server - (or (assoc 'gnus-search-engine (cddr method)) - (assoc (car method) gnus-search-default-engines) + (or (nth 1 engine-config) + (cdr-safe (assoc (car method) gnus-search-default-engines)) (when-let ((old (assoc 'nnir-search-engine (cddr method)))) (nnheader-message 8 "\"nnir-search-engine\" is no longer a valid parameter") - (pcase old + (pcase (nth 1 old) ('notmuch 'gnus-search-notmuch) ('namazu 'gnus-search-namazu) ('find-grep 'gnus-search-find-grep))))) (inst (cond ((null server) nil) - ((eieio-object-p (cadr server)) - (cadr server)) - ((class-p (cadr server)) - (make-instance (cadr server))) + ((eieio-object-p server) + server) + ((class-p server) + (make-instance server)) (t nil)))) (if inst - (when (cddr server) - (pcase-dolist (`(,key ,value) (cddr server)) + (when (cddr engine-config) + ;; We're not being completely backward-compatible here, + ;; because we're not checking for nnir-specific config + ;; options in the server definition. + (pcase-dolist (`(,key ,value) (cddr engine-config)) (condition-case nil (setf (slot-value inst key) value) ((invalid-slot-name invalid-slot-type) commit 9ab69cc82f08234709168edb6153075e4470b2da Author: Katsumi Yamaoka Date: Thu Nov 5 22:32:09 2020 +0000 * doc/misc/gnus.texi (Selection Groups): Delete excessive paren diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 340fc69dbb..c6ce129992 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -17937,7 +17937,7 @@ find all message that have been received recently from certain groups: (cons 'criteria ""))) (group-spec (cadr args))) (gnus-search-run-query (list (cons 'search-query-spec query-spec) - (cons 'search-group-spec group-spec)))))) + (cons 'search-group-spec group-spec))))) @end lisp Then the following @code{nnselect-specs}: commit 67829946456be44fd72620ac182ee61e067532b4 Author: Mauro Aranda Date: Thu Nov 5 18:56:29 2020 -0300 Enable/disable buttons, tool bar and menu items in Custom buffer (Bug#14398) * lisp/cus-edit.el (custom-reset-extended-menu): Keymap menu for the Revert... menu button. (custom-reset-menu): Keep for backward compatibility, but default to nil, so we prefer the keymap menu instead. (custom-reset): Pass the new keymap menu to widget-choose. (custom-commands): Add an element to each list item, to manage its enable/disable state. Add docstring. (custom-command-buttons): New variable, to hold the buttons that act on all options in a Custom buffer. (custom-buffer-create-internal): When creating the command buttons, add the optional :notify function to enable/disable them. Add the buttons to the new variable custom-command-buttons. (customize-menu-create): Notify the command buttons after creating the Custom buffer, so they are correctly enabled/disabled. (custom-redraw-magic, custom-notify): Notify the command buttons and update the tool bar when changing a widget to the modified state. diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 34d76bf096..d1077d367d 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -730,48 +730,86 @@ groups after non-groups, if nil do not order groups at all." ;; `custom-buffer-create-internal' if `custom-buffer-verbose-help' is non-nil. (defvar custom-commands - '((" Apply " Custom-set t - "Apply settings (for the current session only)." - "index" - "Apply") - (" Apply and Save " Custom-save - (or custom-file user-init-file) - "Apply settings and save for future sessions." - "save" - "Save") + '((" Apply " Custom-set t "Apply settings (for the current session only)." + "index" "Apply" (modified)) + (" Apply and Save " Custom-save (or custom-file user-init-file) + "Apply settings and save for future sessions." "save" "Save" + (modified set changed rogue)) (" Undo Edits " Custom-reset-current t "Restore customization buffer to reflect existing settings." - "refresh" - "Undo") + "refresh" "Undo" (modified)) (" Reset Customizations " Custom-reset-saved t - "Undo any settings applied only for the current session." - "undo" - "Reset") + "Undo any settings applied only for the current session." "undo" "Reset" + (modified set changed rogue)) (" Erase Customizations " Custom-reset-standard (or custom-file user-init-file) - "Un-customize settings in this and future sessions." - "delete" - "Uncustomize") - (" Help for Customize " Custom-help t - "Get help for using Customize." - "help" - "Help") - (" Exit " Custom-buffer-done t "Exit Customize." "exit" "Exit"))) + "Un-customize settings in this and future sessions." "delete" "Uncustomize" + (modified set changed rogue saved)) + (" Help for Customize " Custom-help t "Get help for using Customize." + "help" "Help" t) + (" Exit " Custom-buffer-done t "Exit Customize." "exit" "Exit" t)) + "Alist of specifications for Customize menu items, tool bar icons and buttons. +Each member has the format (TAG COMMAND VISIBLE HELP ICON LABEL ENABLE). +TAG is a string, used as the :tag property of a widget. +COMMAND is the command that the item or button runs. +VISIBLE should be a form, suitable to pass as the :visible property for menu +or tool bar items. +HELP should be a string that can be used as the help echo property for tooltips +and the like. +ICON is a string that names the image to use for the tool bar item, like in the +first argument of `tool-bar-local-item'. +LABEL should be a string, used as the name of the menu items. +ENABLE should be a list of custom states or t. When ENABLE is t, the item is +always enabled. Otherwise, it is enabled only if at least one option displayed +in the Custom buffer is in a state present in ENABLE.") + +(defvar-local custom-command-buttons nil + "A list that holds the buttons that act on all settings in a Custom buffer. +`custom-buffer-create-internal' adds the buttons to this list. +Changes in the state of the custom options should notify the buttons via the +:notify property, so buttons can be enabled/disabled correctly at all times.") (defun Custom-help () "Read the node on Easy Customization in the Emacs manual." (interactive) (info "(emacs)Easy Customization")) -(defvar custom-reset-menu - '(("Undo Edits in Customization Buffer" . Custom-reset-current) - ("Revert This Session's Customizations" . Custom-reset-saved) - ("Erase Customizations" . Custom-reset-standard)) - "Alist of actions for the `Reset' button. +(defvar custom-reset-menu nil + "If non-nil, an alist of actions for the `Reset' button. + +This variable is kept for backward compatibility reasons, please use +`custom-reset-extended-menu' instead. + The key is a string containing the name of the action, the value is a Lisp function taking the widget as an element which will be called when the action is chosen.") +(defvar custom-reset-extended-menu + (let ((map (make-sparse-keymap))) + (define-key-after map [Custom-reset-current] + '(menu-item "Undo Edits in Customization Buffer" Custom-reset-current + :enable (seq-some (lambda (option) + (eq (widget-get option :custom-state) + 'modified)) + custom-options))) + (define-key-after map [Custom-reset-saved] + '(menu-item "Revert This Session's Customizations" Custom-reset-saved + :enable (seq-some (lambda (option) + (memq (widget-get option :custom-state) + '(modified set changed rogue))) + custom-options))) + (when (or custom-file user-init-file) + (define-key-after map [Custom-reset-standard] + '(menu-item "Erase Customizations" Custom-reset-standard + :enable (seq-some + (lambda (option) + (memq (widget-get option :custom-state) + '(modified set changed rogue saved))) + custom-options)))) + map) + "A menu for the \"Revert...\" button. +Used in `custom-reset' to show a menu to the user.") + (defvar custom-options nil "Customization widgets in the current buffer.") @@ -821,7 +859,8 @@ setting was merely edited before, this sets it then saves it." "Select item from reset menu." (let* ((completion-ignore-case t) (answer (widget-choose "Reset settings" - custom-reset-menu + (or custom-reset-menu + custom-reset-extended-menu) event))) (if answer (funcall answer)))) @@ -1555,7 +1594,10 @@ that option. DESCRIPTION is unused." (pop-to-buffer-same-window (custom-get-fresh-buffer (or name "*Customization*"))) - (custom-buffer-create-internal options)) + (custom-buffer-create-internal options) + ;; Notify the command buttons, to correctly enable/disable them. + (dolist (btn custom-command-buttons) + (widget-apply btn :notify))) ;;;###autoload (defun custom-buffer-create-other-window (options &optional name _description) @@ -1672,11 +1714,24 @@ or a regular expression.") (if custom-buffer-verbose-help (widget-insert " Operate on all settings in this buffer:\n")) - (let ((button (lambda (tag action active help _icon _label) + (let ((button (lambda (tag action visible help _icon _label active) (widget-insert " ") - (if (eval active) - (widget-create 'push-button :tag tag - :help-echo help :action action)))) + (if (eval visible) + (push (widget-create + 'push-button :tag tag + :help-echo help :action action + :notify + (lambda (widget) + (when (listp active) + (if (seq-some + (lambda (widget) + (memq + (widget-get widget :custom-state) + active)) + custom-options) + (widget-apply widget :activate) + (widget-apply widget :deactivate))))) + custom-command-buttons)))) (commands custom-commands)) (if custom-reset-button-menu (progn @@ -2215,7 +2270,11 @@ and `face'." (let ((state (widget-get widget :custom-state))) (unless (eq state 'modified) (unless (memq state '(nil unknown hidden)) - (widget-put widget :custom-state 'modified)) + (widget-put widget :custom-state 'modified) + ;; Tell our buttons and the tool bar that we changed the widget's state. + (force-mode-line-update) + (dolist (btn custom-command-buttons) + (widget-apply btn :notify))) ;; Update the status text (usually from "STANDARD" to "EDITED ;; bla bla" in the buffer after the command has run. Otherwise ;; commands like `M-u' (that work on a region in the buffer) @@ -2254,7 +2313,10 @@ and `face'." (custom-group-state-update widget))) (t (setq widget nil))))) - (widget-setup)) + (widget-setup) + (force-mode-line-update) + (dolist (btn custom-command-buttons) + (widget-apply btn :notify))) (defun custom-show (widget value) "Non-nil if WIDGET should be shown with VALUE by default." @@ -4945,9 +5007,19 @@ The format is suitable for use with `easy-menu-define'." (mapcar (lambda (arg) (let ((tag (nth 0 arg)) (command (nth 1 arg)) - (active (nth 2 arg)) - (help (nth 3 arg))) - (vector tag command :active (eval active) :help help))) + (visible (nth 2 arg)) + (help (nth 3 arg)) + (active (nth 6 arg))) + (vector tag command :visible (eval visible) + :active + `(or (eq t ',active) + (seq-some ,(lambda (widget) + (memq + (widget-get widget + :custom-state) + active)) + custom-options)) + :help help))) custom-commands))) (defvar tool-bar-map) commit 4610241a9b3fbddd1f0973bf49f7008ed09ab955 Author: Basil L. Contovounesios Date: Thu Nov 5 21:06:39 2020 +0000 Fix coding system in eww-display-pdf * lisp/net/eww.el (eww-display-pdf): Make *eww pdf* buffer unibyte before populating it to avoid conversions. The binding for coding-system-for-write is then no longer necessary, and can be delegated to the viewer invoked by mailcap-view-mime. Suggested by Stefan Monnier . (Bug#44338) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 340a913ceb..43405fbd9c 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -814,9 +814,9 @@ Currently this means either text/html or application/xhtml+xml." (let ((buf (current-buffer)) (pos (point))) (with-current-buffer (get-buffer-create "*eww pdf*") - (let ((coding-system-for-write 'raw-text-unix) - (inhibit-read-only t)) + (let ((inhibit-read-only t)) (erase-buffer) + (set-buffer-multibyte nil) (insert-buffer-substring buf pos) (mailcap-view-mime "application/pdf")) (if (zerop (buffer-size)) commit 5d0da63f00393c2deaa24feb8ac75ee2de33895e Author: Philipp Stephani Date: Thu Nov 5 21:11:14 2020 +0100 * src/minibuf.c (move_minibuffer_onto_frame): Fix comparison diff --git a/src/minibuf.c b/src/minibuf.c index ebc00ae4e4..068086ead8 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -142,7 +142,7 @@ void move_minibuffer_onto_frame (void) set_window_buffer (sf->minibuffer_window, buffer, 0, 0); minibuf_window = sf->minibuffer_window; - if (XWINDOW (minibuf_window)->frame == selected_frame) + if (EQ (XWINDOW (minibuf_window)->frame, selected_frame)) /* The minibuffer might be on another frame. */ Fset_frame_selected_window (selected_frame, sf->minibuffer_window, Qnil); commit 2ecbf4cfae7bd504fbdca28e1e51ee2574fe5d12 Author: Alan Mackenzie Date: Thu Nov 5 19:27:43 2020 +0000 Allow minibuffer to stay in its original frame. Tidy up this area. * doc/emacs/mini.texi (Basic Minibuffer): Add an entry for minibuffer-follows-selected-frame. * doc/lispref/minibuf.texi (Minibuffer Misc): Describe the new parameter to minibufferp, LIVE. * etc/NEWS: Add an entry describing the new minibuffer strategy. * lisp/cus-start.el (minibuffer-prompt-properties--setter): Add an entry for minibuffer-follows-selected-frame. * lisp/minibuffer.el (minibuffer-message): Check for the current buffer being an _active_ minibuffer rather than merely a minibuffer. * src/frame.c (do_switch_frame): Call move_minibuffer_onto_frame. * src/lisp.h (Top level): Add prototypes for move_minibuffer_onto_frame and is_minibuffer. * src/minibuf.c (minibuf_follows_frame): New function which ignores local and let-bound values of minibuffer-follows-selected-frame. (choose_minibuf_frame): Reformulate this function to reuse a minibuffer window where possible, and to ensure no other frame has its minibuffer current, but only when `minibuffer-follows-selected-frame'. (move_minibuffer_onto_frame): New function. (live_minibuffer_p): New function. (Fminibufferp): Add a new &optional parameter LIVE. Reformulate, possibly calling live_minibuffer_p. (read_minibuf): move the incrementation of minibuf_level to before the call of choose_minibuf_frame. Empty the miniwindows of frames without an active minibuffer, rather than of all but the current frame. (is_minibuffer): New function. (read_minibuf_unwind): Note the miniwindow being restored and resize all other miniwindows to zero size. (minibuffer-follows-selected-frame): New configuration variable. * src/window.c (candidate_window_p): In some scenarios, check the miniwindow holds an active minibuffer. * src/xdisp.c (get_window_cursor_type): Suppress the cursor for non-active miniwindows, regardless of minibuf_level. diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi index 54f046a7e0..ede95a28d4 100644 --- a/doc/emacs/mini.texi +++ b/doc/emacs/mini.texi @@ -69,6 +69,17 @@ the minibuffer for a few seconds, or until you type something; then the minibuffer comes back. While the minibuffer is in use, Emacs does not echo keystrokes. +@vindex minibuffer-follows-selected-frame + While using the minibuffer, you can switch to a different frame, +perhaps to note text you need to enter (@pxref{Frame Commands}). By +default, the active minibuffer moves to this new frame. If you set +the user option @code{minibuffer-follows-selected-frame} to +@code{nil}, then the minibuffer stays in the frame where you opened +it, and you must switch back to that frame in order to complete (or +abort) the current command. Note that the effect of the command, when +you finally finish using the minibuffer, always takes place in the +frame where you first opened it. + @node Minibuffer File @section Minibuffers for File Names diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index e5a0233b3c..b6a3434d15 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -2586,10 +2586,12 @@ The minibuffer command @code{next-matching-history-element} (normally @node Minibuffer Misc @section Minibuffer Miscellany -@defun minibufferp &optional buffer-or-name +@defun minibufferp &optional buffer-or-name live This function returns non-@code{nil} if @var{buffer-or-name} is a -minibuffer. If @var{buffer-or-name} is omitted, it tests the current -buffer. +minibuffer. If @var{buffer-or-name} is omitted or @code{nil}, it +tests the current buffer. When @var{live} is non-@code{nil}, the +function returns non-@code{nil} only when @var{buffer-or-name} is an +active minibuffer. @end defun @defvar minibuffer-setup-hook diff --git a/etc/NEWS b/etc/NEWS index d15f3ed1ae..7ef832e603 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -88,6 +88,17 @@ useful on systems such as FreeBSD which ships only with "etc/termcap". ** Minibuffer scrolling is now conservative by default. This is controlled by the new variable 'scroll-minibuffer-conservatively'. ++++ +** Improved handling of minibuffers on switching frames. +By default, an active minibuffer now moves to a newly selected frame. +When continuing the current command (by completing the minibuffer +action), the effect happens in the frame where the minibuffer was +first opened. An alternative behavior is available by customizing +'minibuffer-follows-selected-frame' to nil. Here, the minibuffer +stays in the frame where you first opened it, and you must switch back +to this frame to continue or abort its command. The old, somewhat +unsystematic behavior is no longer available. + +++ ** New system for displaying documentation for groups of functions. This can either be used by saying 'M-x shortdoc-display-group' and diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 6927b6df6b..04fb1dc6d0 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -394,6 +394,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of ;; (directory :format "%v")))) (load-prefer-newer lisp boolean "24.4") ;; minibuf.c + (minibuffer-follows-selected-frame minibuffer boolean "28.1") (enable-recursive-minibuffers minibuffer boolean) (history-length minibuffer (choice (const :tag "Infinite" t) integer) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 5a41e2f30b..9d57a817b2 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -701,7 +701,7 @@ The text is displayed for `minibuffer-message-timeout' seconds, or until the next input event arrives, whichever comes first. Enclose MESSAGE in [...] if this is not yet the case. If ARGS are provided, then pass MESSAGE through `format-message'." - (if (not (minibufferp (current-buffer))) + (if (not (minibufferp (current-buffer) t)) (progn (if args (apply #'message message args) diff --git a/src/frame.c b/src/frame.c index 7c377da445..512aaf5f45 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1482,6 +1482,7 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor #endif internal_last_event_frame = Qnil; + move_minibuffer_onto_frame (); return frame; } diff --git a/src/lisp.h b/src/lisp.h index a3cfb5044d..cf33031342 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4336,6 +4336,8 @@ extern void clear_regexp_cache (void); extern Lisp_Object Vminibuffer_list; extern Lisp_Object last_minibuf_string; +extern void move_minibuffer_onto_frame (void); +extern bool is_minibuffer (EMACS_INT, Lisp_Object); extern Lisp_Object get_minibuffer (EMACS_INT); extern void init_minibuf_once (void); extern void syms_of_minibuf (void); diff --git a/src/minibuf.c b/src/minibuf.c index f957b2ae17..ebc00ae4e4 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -64,6 +64,12 @@ static Lisp_Object minibuf_prompt; static ptrdiff_t minibuf_prompt_width; +static bool +minibuf_follows_frame (void) +{ + return !NILP (Fdefault_toplevel_value (Qminibuffer_follows_selected_frame)); +} + /* Put minibuf on currently selected frame's minibuffer. We do this whenever the user starts a new minibuffer or when a minibuffer exits. */ @@ -76,37 +82,72 @@ choose_minibuf_frame (void) && !EQ (minibuf_window, XFRAME (selected_frame)->minibuffer_window)) { struct frame *sf = XFRAME (selected_frame); - Lisp_Object buffer; - /* I don't think that any frames may validly have a null minibuffer window anymore. */ if (NILP (sf->minibuffer_window)) emacs_abort (); - /* Under X, we come here with minibuf_window being the - minibuffer window of the unused termcap window created in - init_window_once. That window doesn't have a buffer. */ - buffer = XWINDOW (minibuf_window)->contents; - if (BUFFERP (buffer)) - /* Use set_window_buffer instead of Fset_window_buffer (see - discussion of bug#11984, bug#12025, bug#12026). */ - set_window_buffer (sf->minibuffer_window, buffer, 0, 0); minibuf_window = sf->minibuffer_window; + /* If we've still got another minibuffer open, use its mini-window + instead. */ + if (minibuf_level && !minibuf_follows_frame ()) + { + Lisp_Object buffer = get_minibuffer (minibuf_level); + Lisp_Object tail, frame; + + FOR_EACH_FRAME (tail, frame) + if (EQ (XWINDOW (XFRAME (frame)->minibuffer_window)->contents, + buffer)) + { + minibuf_window = XFRAME (frame)->minibuffer_window; + break; + } + } } - /* Make sure no other frame has a minibuffer as its selected window, - because the text would not be displayed in it, and that would be - confusing. Only allow the selected frame to do this, - and that only if the minibuffer is active. */ - { - Lisp_Object tail, frame; + if (minibuf_follows_frame ()) + /* Make sure no other frame has a minibuffer as its selected window, + because the text would not be displayed in it, and that would be + confusing. Only allow the selected frame to do this, + and that only if the minibuffer is active. */ + { + Lisp_Object tail, frame; + + FOR_EACH_FRAME (tail, frame) + if (MINI_WINDOW_P (XWINDOW (FRAME_SELECTED_WINDOW (XFRAME (frame)))) + && !(EQ (frame, selected_frame) + && minibuf_level > 0)) + Fset_frame_selected_window (frame, Fframe_first_window (frame), + Qnil); + } +} - FOR_EACH_FRAME (tail, frame) - if (MINI_WINDOW_P (XWINDOW (FRAME_SELECTED_WINDOW (XFRAME (frame)))) - && !(EQ (frame, selected_frame) - && minibuf_level > 0)) - Fset_frame_selected_window (frame, Fframe_first_window (frame), Qnil); - } +/* If `minibuffer_follows_selected_frame' and we have a minibuffer, move it + from its current frame to the selected frame. This function is + intended to be called from `do_switch_frame' in frame.c. */ +void move_minibuffer_onto_frame (void) +{ + if (!minibuf_level) + return; + if (!minibuf_follows_frame ()) + return; + if (FRAMEP (selected_frame) + && FRAME_LIVE_P (XFRAME (selected_frame)) + && !EQ (minibuf_window, XFRAME (selected_frame)->minibuffer_window)) + { + struct frame *sf = XFRAME (selected_frame); + Lisp_Object old_frame = XWINDOW (minibuf_window)->frame; + struct frame *of = XFRAME (old_frame); + Lisp_Object buffer = XWINDOW (minibuf_window)->contents; + + set_window_buffer (sf->minibuffer_window, buffer, 0, 0); + minibuf_window = sf->minibuffer_window; + if (XWINDOW (minibuf_window)->frame == selected_frame) + /* The minibuffer might be on another frame. */ + Fset_frame_selected_window (selected_frame, sf->minibuffer_window, + Qnil); + set_window_buffer (of->minibuffer_window, get_minibuffer (0), 0, 0); + } } DEFUN ("active-minibuffer-window", Factive_minibuffer_window, @@ -261,15 +302,31 @@ read_minibuf_noninteractive (Lisp_Object prompt, bool expflag, return val; } +/* Return true when BUFFER is an active minibuffer. */ +static bool +live_minibuffer_p (Lisp_Object buffer) +{ + Lisp_Object tem; + EMACS_INT i; + + if (EQ (buffer, Fcar (Vminibuffer_list))) + /* *Minibuf-0* is never active. */ + return false; + tem = Fcdr (Vminibuffer_list); + for (i = 1; i <= minibuf_level; i++, tem = Fcdr (tem)) + if (EQ (Fcar (tem), buffer)) + return true; + return false; +} + DEFUN ("minibufferp", Fminibufferp, - Sminibufferp, 0, 1, 0, + Sminibufferp, 0, 2, 0, doc: /* Return t if BUFFER is a minibuffer. No argument or nil as argument means use current buffer as BUFFER. -BUFFER can be a buffer or a buffer name. */) - (Lisp_Object buffer) +BUFFER can be a buffer or a buffer name. If LIVE is non-nil, then +return t only if BUFFER is an active minibuffer. */) + (Lisp_Object buffer, Lisp_Object live) { - Lisp_Object tem; - if (NILP (buffer)) buffer = Fcurrent_buffer (); else if (STRINGP (buffer)) @@ -277,8 +334,10 @@ BUFFER can be a buffer or a buffer name. */) else CHECK_BUFFER (buffer); - tem = Fmemq (buffer, Vminibuffer_list); - return ! NILP (tem) ? Qt : Qnil; + return (NILP (live) + ? !NILP (Fmemq (buffer, Vminibuffer_list)) + : live_minibuffer_p (buffer)) + ? Qt : Qnil; } DEFUN ("minibuffer-prompt-end", Fminibuffer_prompt_end, @@ -433,6 +492,8 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, return unbind_to (count, val); } + minibuf_level++; /* Before calling choose_minibuf_frame. */ + /* Choose the minibuffer window and frame, and take action on them. */ /* Prepare for restoring the current buffer since choose_minibuf_frame @@ -484,7 +545,6 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, = Fcons (Fthis_command_keys_vector (), minibuf_save_list); record_unwind_protect_void (read_minibuf_unwind); - minibuf_level++; /* We are exiting the minibuffer one way or the other, so run the hook. It should be run before unwinding the minibuf settings. Do it separately from read_minibuf_unwind because we need to make sure that @@ -566,8 +626,8 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, if (minibuf_level == 1 || !EQ (minibuf_window, selected_window)) minibuf_selected_window = selected_window; - /* Empty out the minibuffers of all frames other than the one - where we are going to display one now. + /* Empty out the minibuffers of all frames, except those frames + where there is an active minibuffer. Set them to point to ` *Minibuf-0*', which is always empty. */ empty_minibuf = get_minibuffer (0); @@ -575,12 +635,17 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, { Lisp_Object root_window = Fframe_root_window (frame); Lisp_Object mini_window = XWINDOW (root_window)->next; + Lisp_Object buffer; - if (! NILP (mini_window) && ! EQ (mini_window, minibuf_window) - && !NILP (Fwindow_minibuffer_p (mini_window))) - /* Use set_window_buffer instead of Fset_window_buffer (see - discussion of bug#11984, bug#12025, bug#12026). */ - set_window_buffer (mini_window, empty_minibuf, 0, 0); + if (!NILP (mini_window) && !EQ (mini_window, minibuf_window) + && !NILP (Fwindow_minibuffer_p (mini_window))) + { + buffer = XWINDOW (mini_window)->contents; + if (!live_minibuffer_p (buffer)) + /* Use set_window_buffer instead of Fset_window_buffer (see + discussion of bug#11984, bug#12025, bug#12026). */ + set_window_buffer (mini_window, empty_minibuf, 0, 0); + } } /* Display this minibuffer in the proper window. */ @@ -714,6 +779,16 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, return val; } +/* Return true if BUF is a particular existing minibuffer. */ +bool +is_minibuffer (EMACS_INT depth, Lisp_Object buf) +{ + Lisp_Object tail = Fnthcdr (make_fixnum (depth), Vminibuffer_list); + return + !NILP (tail) + && EQ (Fcar (tail), buf); +} + /* Return a buffer to be used as the minibuffer at depth `depth'. depth = 0 is the lowest allowed argument, and that is the value used for nonrecursive minibuffer invocations. */ @@ -775,6 +850,7 @@ read_minibuf_unwind (void) { Lisp_Object old_deactivate_mark; Lisp_Object window; + Lisp_Object future_mini_window; /* If this was a recursive minibuffer, tie the minibuffer window back to the outer level minibuffer buffer. */ @@ -809,6 +885,7 @@ read_minibuf_unwind (void) if (FRAME_LIVE_P (XFRAME (WINDOW_FRAME (XWINDOW (temp))))) minibuf_window = temp; #endif + future_mini_window = Fcar (minibuf_save_list); minibuf_save_list = Fcdr (minibuf_save_list); /* Erase the minibuffer we were using at this level. */ @@ -825,7 +902,8 @@ read_minibuf_unwind (void) /* When we get to the outmost level, make sure we resize the mini-window back to its normal size. */ - if (minibuf_level == 0) + if (minibuf_level == 0 + || !EQ (selected_frame, WINDOW_FRAME (XWINDOW (future_mini_window)))) resize_mini_window (XWINDOW (window), 0); /* Deal with frames that should be removed when exiting the @@ -1911,6 +1989,8 @@ syms_of_minibuf (void) staticpro (&minibuf_prompt); staticpro (&minibuf_save_list); + DEFSYM (Qminibuffer_follows_selected_frame, + "minibuffer-follows-selected-frame"); DEFSYM (Qcompletion_ignore_case, "completion-ignore-case"); DEFSYM (Qminibuffer_default, "minibuffer-default"); Fset (Qminibuffer_default, Qnil); @@ -1954,6 +2034,14 @@ For example, `eval-expression' uses this. */); The function is called with the arguments passed to `read-buffer'. */); Vread_buffer_function = Qnil; + DEFVAR_BOOL ("minibuffer-follows-selected-frame", minibuffer_follows_selected_frame, + doc: /* Non-nil means the active minibuffer always displays on the selected frame. +Nil means that a minibuffer will appear only in the frame which created it. + +Any buffer local or dynamic binding of this variable is ignored. Only the +default top level value is used. */); + minibuffer_follows_selected_frame = 1; + DEFVAR_BOOL ("read-buffer-completion-ignore-case", read_buffer_completion_ignore_case, doc: /* Non-nil means completion ignores case when reading a buffer name. */); diff --git a/src/window.c b/src/window.c index e7433969d2..a6de34f3db 100644 --- a/src/window.c +++ b/src/window.c @@ -2643,8 +2643,10 @@ candidate_window_p (Lisp_Object window, Lisp_Object owindow, /* To qualify as candidate, it's not sufficient for WINDOW's frame to just share the minibuffer window - it must be active as well (see Bug#24500). */ - candidate_p = (EQ (XWINDOW (all_frames)->frame, w->frame) - || EQ (XWINDOW (all_frames)->frame, FRAME_FOCUS_FRAME (f))); + candidate_p = ((EQ (XWINDOW (all_frames)->frame, w->frame) + || (EQ (f->minibuffer_window, all_frames) + && EQ (XWINDOW (all_frames)->frame, FRAME_FOCUS_FRAME (f)))) + && !is_minibuffer (0, XWINDOW (all_frames)->contents)); else if (FRAMEP (all_frames)) candidate_p = EQ (all_frames, w->frame); diff --git a/src/xdisp.c b/src/xdisp.c index 618ec688e8..bff14e584d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -31224,7 +31224,9 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width, { *active_cursor = false; - if (MINI_WINDOW_P (w) && minibuf_level == 0) + if (MINI_WINDOW_P (w) && + (minibuf_level == 0 + || is_minibuffer (0, w->contents))) return NO_CURSOR; non_selected = true; commit e90ffcf7598c6bb529f67d4d8afe451f60d32eb8 Author: Eli Zaretskii Date: Thu Nov 5 19:46:50 2020 +0200 * src/w32fns.c (Fw32_register_hot_key): Doc fix. (Bug#44456) diff --git a/src/w32fns.c b/src/w32fns.c index 2f01fb52e9..bbf43717bd 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -8626,8 +8626,8 @@ DEFUN ("w32-register-hot-key", Fw32_register_hot_key, doc: /* Register KEY as a hot-key combination. Certain key combinations like Alt-Tab and Win-R are reserved for system use on Windows, and therefore are normally intercepted by the -system. These key combinations can be received by registering them -as hot-keys, except for Win-L which always locks the computer. +system. These key combinations can be used in Emacs by registering +them as hot-keys, except for Win-L which always locks the computer. On Windows 98 and ME, KEY must be a one element key definition in vector form that would be acceptable to `define-key' (e.g. [A-tab] for @@ -8636,16 +8636,19 @@ Alt-Tab). The meta modifier is interpreted as Alt if modifier keys. The return value is the hotkey-id if registered, otherwise nil. -On Windows versions since NT, KEY can also be specified as [M-], [s-] or -[h-] to indicate that all combinations of that key should be processed -by Emacs instead of the operating system. The super and hyper -modifiers are interpreted according to the current values of -`w32-lwindow-modifier' and `w32-rwindow-modifier'. For instance, -setting `w32-lwindow-modifier' to `super' and then calling -`(w32-register-hot-key [s-])' grabs all combinations of the left Windows -key to Emacs, but leaves the right Windows key free for the operating -system keyboard shortcuts. The return value is t if the call affected -any key combinations, otherwise nil. */) +On Windows versions since NT, KEY can also be specified as just a +modifier key, [M-], [s-] or [H-], to indicate that all combinations +of the respective modifier key should be processed by Emacs instead +of the operating system. The super and hyper modifiers are +interpreted according to the current values of `w32-lwindow-modifier' +and `w32-rwindow-modifier'. For instance, setting `w32-lwindow-modifier' +to `super' and then calling `(w32-register-hot-key [s-])' grabs all +combinations of the left Windows key to Emacs as keys with the Super +modifier, but leaves the right Windows key free for the operating +system keyboard shortcuts. + +The return value is t if the call affected any key combinations, +otherwise nil. */) (Lisp_Object key) { key = w32_parse_and_hook_hot_key (key, 1); commit bfd31242025cde90c8252db92dc54d0be4115c91 Author: Basil L. Contovounesios Date: Tue Nov 3 22:54:34 2020 +0000 Improve eww support for externally viewed PDFs The *eww pdf* buffer is only needed when viewing PDFs within Emacs, e.g., with doc-view-mode. External PDF viewers are called with a temporary file, so the buffer is not needed in that case. What's more, mailcap-view-mime erased the buffer and left it in fundamental-mode until now, so the user was left staring at a useless, empty buffer. To make things even worse, external viewers were invoked synchronously until now, so the user could not browse the PDF file and use Emacs simultaneously. * lisp/net/mailcap.el (mailcap--async-shell): New function. (mailcap-view-mime): Use it to invoke external viewers asynchronously. Mention erasure of current buffer in that case in docstring. Add a period between the temporary file name and its extension. * lisp/net/eww.el (eww-display-pdf): Simplify using insert-buffer-substring. Fix coding-system-for-write for a stream of raw bytes. Pop to *eww pdf* buffer only if it is used for displaying a document; otherwise kill it. (bug#44338) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index ebc75e0e8a..340a913ceb 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -811,14 +811,19 @@ Currently this means either text/html or application/xhtml+xml." (declare-function mailcap-view-mime "mailcap" (type)) (defun eww-display-pdf () - (let ((data (buffer-substring (point) (point-max)))) - (pop-to-buffer-same-window (get-buffer-create "*eww pdf*")) - (let ((coding-system-for-write 'raw-text) - (inhibit-read-only t)) - (erase-buffer) - (insert data) - (mailcap-view-mime "application/pdf"))) - (goto-char (point-min))) + (let ((buf (current-buffer)) + (pos (point))) + (with-current-buffer (get-buffer-create "*eww pdf*") + (let ((coding-system-for-write 'raw-text-unix) + (inhibit-read-only t)) + (erase-buffer) + (insert-buffer-substring buf pos) + (mailcap-view-mime "application/pdf")) + (if (zerop (buffer-size)) + ;; Buffer contents passed to shell command via temporary file. + (kill-buffer) + (goto-char (point-min)) + (pop-to-buffer-same-window (current-buffer)))))) (defun eww-setup-buffer () (when (or (plist-get eww-data :url) diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el index f9c71c9b9f..d0f8c1272d 100644 --- a/lisp/net/mailcap.el +++ b/lisp/net/mailcap.el @@ -1131,20 +1131,30 @@ For instance, \"foo.png\" will result in \"image/png\"." res))) (nreverse res))))) +(defun mailcap--async-shell (command file) + "Asynchronously call MIME viewer shell COMMAND. +Replace %s in COMMAND with FILE, as per `mailcap-mime-data'. +Delete FILE once COMMAND exits." + (let ((buf (get-buffer-create " *mailcap shell*"))) + (async-shell-command (format command file) buf) + (add-function :after (process-sentinel (get-buffer-process buf)) + (lambda (proc _msg) + (when (memq (process-status proc) '(exit signal)) + (delete-file file)))))) + (defun mailcap-view-mime (type) "View the data in the current buffer that has MIME type TYPE. -`mailcap--computed-mime-data' determines the method to use." +The variable `mailcap--computed-mime-data' determines the method +to use. If the method is a shell command string, erase the +current buffer after passing its contents to the shell command." (let ((method (mailcap-mime-info type))) (if (stringp method) - (let ((file (make-temp-file "emacs-mailcap" nil - (cadr (split-string type "/"))))) - (unwind-protect - (let ((coding-system-for-write 'binary)) - (write-region (point-min) (point-max) file nil 'silent) - (delete-region (point-min) (point-max)) - (shell-command (format method file))) - (when (file-exists-p file) - (delete-file file)))) + (let* ((ext (concat "." (cadr (split-string type "/")))) + (file (make-temp-file "emacs-mailcap" nil ext)) + (coding-system-for-write 'binary)) + (write-region nil nil file nil 'silent) + (delete-region (point-min) (point-max)) + (mailcap--async-shell method file)) (funcall method)))) (provide 'mailcap) commit 38a109e58c3a4d945123e3e985efd40b0626eca0 Author: Stefan Kangas Date: Thu Nov 5 18:23:56 2020 +0100 ; Silence byte-compiler warnings in tests * test/lisp/emacs-lisp/easy-mmode-tests.el (easy-mmode--minor-mode): * test/lisp/progmodes/cperl-mode-tests.el (cperl-bug30393): Silence byte-compiler. diff --git a/test/lisp/emacs-lisp/easy-mmode-tests.el b/test/lisp/emacs-lisp/easy-mmode-tests.el index c05379e441..bbd01970b5 100644 --- a/test/lisp/emacs-lisp/easy-mmode-tests.el +++ b/test/lisp/emacs-lisp/easy-mmode-tests.el @@ -44,20 +44,21 @@ '(c-mode (not message-mode mail-mode) text-mode)) t)))) +(define-minor-mode easy-mmode-test-mode "A test.") + (ert-deftest easy-mmode--minor-mode () (with-temp-buffer - (define-minor-mode test-mode "A test.") - (should (eq test-mode nil)) - (test-mode nil) - (should (eq test-mode t)) - (test-mode -33) - (should (eq test-mode nil)) - (test-mode 33) - (should (eq test-mode t)) - (test-mode 'toggle) - (should (eq test-mode nil)) - (test-mode 'toggle) - (should (eq test-mode t)))) + (should (eq easy-mmode-test-mode nil)) + (easy-mmode-test-mode nil) + (should (eq easy-mmode-test-mode t)) + (easy-mmode-test-mode -33) + (should (eq easy-mmode-test-mode nil)) + (easy-mmode-test-mode 33) + (should (eq easy-mmode-test-mode t)) + (easy-mmode-test-mode 'toggle) + (should (eq easy-mmode-test-mode nil)) + (easy-mmode-test-mode 'toggle) + (should (eq easy-mmode-test-mode t)))) (provide 'easy-mmode-tests) diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index 2977f10813..effebc8068 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -244,7 +244,7 @@ Perl is not Lisp: An open paren in column 0 does not start a function." (goto-char (point-min)) (while (null (eobp)) (cperl-indent-command) - (next-line)) + (forward-line 1)) (setq expected (concat "test case " name ":\n" expected)) (setq got (concat "test case " name ":\n" (buffer-string))) (should (equal got expected)))))))) commit 334e2ab440a466a40b7c28d26dfe4207c6bb95e8 Author: Michael Albinus Date: Thu Nov 5 17:36:04 2020 +0100 Still fixes for Tramp directory-files-* * lisp/net/tramp.el (tramp-handle-directory-files): * lisp/net/tramp-adb.el (tramp-adb-handle-directory-files-and-attributes): Fix COUNT. * lisp/net/tramp-crypt.el (tramp-crypt-handle-directory-files): Implement COUNT. * lisp/net/tramp-gvfs.el (tramp-gvfs-dbus-byte-array-to-string): * lisp/net/tramp-integration.el (tramp-eshell-directory-change): Use `nbutlast'. * lisp/net/tramp-rclone.el (tramp-rclone-handle-delete-directory) (tramp-rclone-handle-delete-file): Reorder cache flushing. (tramp-rclone-handle-directory-files): Use `tramp-compat-directory-files'. * lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes): Fix NOSORT and COUNT. * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files): Fix NOSORT. * test/lisp/net/tramp-tests.el (tramp--test-share-p): New defun. (tramp-test05-expand-file-name-relative): Use it. (tramp-test16-directory-files) (tramp-test19-directory-files-and-attributes): Strengthen test. (tramp-test20-file-modes): Simplify check. diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 8ccbe412f2..be83f670f7 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -350,8 +350,8 @@ ARGUMENTS to pass to the OPERATION." match (car x))) x)) result))) - (when (natnump count) - (setq result (last result count))) + (when (and (natnump count) (> count 0)) + (setq result (nbutlast result (- (length result) count)))) result))))))) (defun tramp-adb-get-ls-command (vec) diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el index 286b60a48c..4d34bbbeea 100644 --- a/lisp/net/tramp-crypt.el +++ b/lisp/net/tramp-crypt.el @@ -668,7 +668,8 @@ absolute file names." (let (tramp-crypt-enabled) (delete-file (tramp-crypt-encrypt-file-name filename))))) -(defun tramp-crypt-handle-directory-files (directory &optional full match nosort) +(defun tramp-crypt-handle-directory-files + (directory &optional full match nosort count) "Like `directory-files' for Tramp files." (unless (file-exists-p directory) (tramp-error @@ -697,7 +698,11 @@ absolute file names." (replace-regexp-in-string (concat "^" (regexp-quote directory)) "" x)) result))) - (if nosort result (sort result #'string<))))) + (unless nosort + (setq result (sort result #'string<))) + (when (and (natnump count) (> count 0)) + (setq result (nbutlast result (- (length result) count)))) + result))) (defun tramp-crypt-handle-file-attributes (filename &optional id-format) "Like `file-attributes' for Tramp files." diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 86fb45a43b..8f8e628ab9 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -876,7 +876,7 @@ Return nil for null BYTE-ARRAY." byte-array (car byte-array)))) (dbus-byte-array-to-string (if (and (consp byte-array) (zerop (car (last byte-array)))) - (butlast byte-array) byte-array)))) + (nbutlast byte-array) byte-array)))) (defun tramp-gvfs-stringify-dbus-message (message) "Convert a D-Bus MESSAGE into readable UTF8 strings, used for traces." diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el index 7e4a9bf05e..f712600072 100644 --- a/lisp/net/tramp-integration.el +++ b/lisp/net/tramp-integration.el @@ -132,7 +132,7 @@ been set up by `rfn-eshadow-setup-minibuffer'." ;; Use `path-separator' as it does eshell. (setq eshell-path-env (mapconcat - #'identity (butlast (tramp-compat-exec-path)) path-separator))) + #'identity (nbutlast (tramp-compat-exec-path)) path-separator))) (with-eval-after-load 'esh-util (add-hook 'eshell-mode-hook diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el index 1a7b0600d2..4790bb453d 100644 --- a/lisp/net/tramp-rclone.el +++ b/lisp/net/tramp-rclone.el @@ -289,16 +289,16 @@ file names." (directory &optional recursive trash) "Like `delete-directory' for Tramp files." (with-parsed-tramp-file-name (expand-file-name directory) nil - (delete-directory (tramp-rclone-local-file-name directory) recursive trash) (tramp-flush-directory-properties v localname) - (tramp-rclone-flush-directory-cache v))) + (tramp-rclone-flush-directory-cache v) + (delete-directory (tramp-rclone-local-file-name directory) recursive trash))) (defun tramp-rclone-handle-delete-file (filename &optional trash) "Like `delete-file' for Tramp files." (with-parsed-tramp-file-name (expand-file-name filename) nil + (tramp-rclone-flush-directory-cache v) (delete-file (tramp-rclone-local-file-name filename) trash) - (tramp-flush-file-properties v localname) - (tramp-rclone-flush-directory-cache v))) + (tramp-flush-file-properties v localname))) (defun tramp-rclone-handle-directory-files (directory &optional full match nosort count) @@ -311,8 +311,8 @@ file names." (setq directory (file-name-as-directory (expand-file-name directory))) (with-parsed-tramp-file-name directory nil (let ((result - (directory-files - (tramp-rclone-local-file-name directory) full match count))) + (tramp-compat-directory-files + (tramp-rclone-local-file-name directory) full match nosort count))) ;; Massage the result. (when full (let ((local (concat "^" (regexp-quote (tramp-rclone-mount-point v)))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 655949a79b..51e15af2ef 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1738,12 +1738,13 @@ ID-FORMAT valid values are `string' and `integer'." (setcar item (expand-file-name (car item) directory))) (push item result))) - (when (natnump count) - (setq result (last result count))) + (unless nosort + (setq result (sort result (lambda (x y) (string< (car x) (car y)))))) - (or (if nosort - result - (sort result (lambda (x y) (string< (car x) (car y))))) + (when (and (natnump count) (> count 0)) + (setq result (nbutlast result (- (length result) count)))) + + (or result ;; The scripts could fail, for example with huge file size. (tramp-handle-directory-files-and-attributes directory full match nosort id-format count))))) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index a040508553..0dd233aff0 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -704,6 +704,10 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (mapcar (lambda (x) (when (string-match-p match x) x)) result)))) + ;; Sort them if necessary. + (unless nosort + (setq result (sort result #'string-lessp))) + ;; Return count number of results. (when (and (natnump count) (> count 0)) (setq result (nbutlast result (- (length result) count)))) @@ -714,8 +718,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (mapcar (lambda (x) (format "%s/%s" (directory-file-name directory) x)) result))) - ;; Sort them if necessary. - (unless nosort (setq result (sort result #'string-lessp))) + result)) (defun tramp-smb-handle-expand-file-name (name &optional dir) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 1859e84375..55f652fa9a 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3134,8 +3134,8 @@ User is always nil." result))) (unless nosort (setq result (sort result #'string<))) - (when (natnump count) - (setq result (last result count))) + (when (and (natnump count) (> count 0)) + (setq result (nbutlast result (- (length result) count)))) result))) (defun tramp-handle-directory-files-and-attributes diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 2670723ecd..7b83a8deeb 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2169,6 +2169,8 @@ is greater than 10. (skip-unless (tramp--test-enabled)) ;; The bugs are fixed in Emacs 28.1. (skip-unless (tramp--test-emacs28-p)) + ;; Methods with a share do not expand "/path/..". + (skip-unless (not (tramp--test-share-p))) (should (string-equal @@ -2931,10 +2933,10 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." (when (tramp--test-emacs28-p) (with-no-warnings (should - (= 1 (length - (directory-files - tmp-name1 nil directory-files-no-dot-files-regexp - nil 1))))))) + (equal + (directory-files + tmp-name1 nil directory-files-no-dot-files-regexp nil 1) + '("bla")))))) ;; Cleanup. (ignore-errors (delete-directory tmp-name1 'recursive)))))) @@ -3457,8 +3459,9 @@ They might differ only in time attributes or directory size." ;; Check the COUNT arg. It exists since Emacs 28. (when (tramp--test-emacs28-p) (with-no-warnings - (should (= 1 (length (directory-files-and-attributes - tmp-name2 nil "\\`b" nil nil 1))))))) + (setq attr (directory-files-and-attributes + tmp-name2 nil "\\`b" nil nil 1)) + (should (equal (mapcar #'car attr) '("bar")))))) ;; Cleanup. (ignore-errors (delete-directory tmp-name1 'recursive)))))) @@ -3470,10 +3473,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." (skip-unless (or (tramp--test-sh-p) (tramp--test-sudoedit-p) ;; Not all tramp-gvfs.el methods support changing the file mode. - (and - (tramp--test-gvfs-p) - (string-match-p - "ftp" (file-remote-p tramp-test-temporary-file-directory 'method))))) + (tramp--test-gvfs-p "afp") (tramp--test-gvfs-p "ftp"))) (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil))) (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) @@ -5705,6 +5705,13 @@ This does not support special file names." (tramp-sh-file-name-handler-p (tramp-dissect-file-name tramp-test-temporary-file-directory))) +(defun tramp--test-share-p () + "Check, whether the method needs a share." + (and (tramp--test-gvfs-p) + (string-match-p + "^\\(afp\\|davs?\\|smb\\)$" + (file-remote-p tramp-test-temporary-file-directory 'method)))) + (defun tramp--test-sudoedit-p () "Check, whether the sudoedit method is used." (tramp-sudoedit-file-name-p tramp-test-temporary-file-directory)) commit ef5211d0aa3186fffa43639072fc3325a3003623 Author: Lars Ingebrigtsen Date: Tue Nov 3 15:50:44 2020 +0100 Let pdf-view-mode take precedence over doc-view-mode * lisp/net/mailcap.el (mailcap-mime-data): Note the order, and let pdf-view-mode take precedence, since it's an optional package (bug#44338). diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el index 94cd9e2156..f9c71c9b9f 100644 --- a/lisp/net/mailcap.el +++ b/lisp/net/mailcap.el @@ -175,11 +175,11 @@ is consulted." (type . "application/zip") ("copiousoutput")) ("pdf" - (viewer . pdf-view-mode) + (viewer . doc-view-mode) (type . "application/pdf") (test . window-system)) ("pdf" - (viewer . doc-view-mode) + (viewer . pdf-view-mode) (type . "application/pdf") (test . window-system)) ("pdf" @@ -330,7 +330,10 @@ Content-Type header as argument to return a boolean value for the validity. Otherwise, if it is a non-function Lisp symbol or list whose car is a symbol, it is `eval'uated to yield the validity. If it is a string or list of strings, it represents a shell command to run -to return a true or false shell value for the validity.") +to return a true or false shell value for the validity. + +The last matching entry in this structure takes presedence over +preceding entries.") (put 'mailcap-mime-data 'risky-local-variable t) (defvar mailcap--computed-mime-data nil commit 37c0208aaaed404c35934eba6c3a3efa07e7182d Author: Stefan Kangas Date: Thu Nov 5 15:42:26 2020 +0100 ; Silence byte-compiler warning in xdisp-tests.el * test/src/xdisp-tests.el (xdisp-tests--minibuffer-scroll): Silence byte-compiler. diff --git a/test/src/xdisp-tests.el b/test/src/xdisp-tests.el index fad90fad53..a7e05a57de 100644 --- a/test/src/xdisp-tests.el +++ b/test/src/xdisp-tests.el @@ -57,9 +57,9 @@ (xdisp-tests--in-minibuffer (let ((max-mini-window-height 4)) (dotimes (_ 80) (insert "\nhello")) - (beginning-of-buffer) + (goto-char (point-min)) (redisplay 'force) - (end-of-buffer) + (goto-char (point-max)) ;; A simple edit like removing the last `o' shouldn't cause ;; the rest of the minibuffer's text to move. (list commit 771046f5d888c703c875d8629fdf227429a36d3d Author: Basil L. Contovounesios Date: Thu Oct 29 22:48:12 2020 +0000 Sync biblatex entries and fields with v3.15 * lisp/textmodes/bibtex.el (bibtex-BibTeX-entry-alist): Fix abbreviation of PhD. (bibtex-biblatex-entry-alist, bibtex-biblatex-field-alist): Sync standard entry and field types with those described in the biblatex v3.15 manual of 2020-08-19 (bug#44322). diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 715379fa80..fcf63ed5ec 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -387,13 +387,13 @@ If parsing fails, try to set this variable to nil." (("author") ("howpublished" "The way in which the booklet was published") ("address") ("month") ("year") ("note"))) - ("PhdThesis" "PhD. Thesis" + ("PhdThesis" "PhD Thesis" (("author") - ("title" "Title of the PhD. thesis") - ("school" "School where the PhD. thesis was written") + ("title" "Title of the PhD thesis") + ("school" "School where the PhD thesis was written") ("year")) nil - (("type" "Type of the PhD. thesis") + (("type" "Type of the PhD thesis") ("address" "Address of the school (if not part of field \"school\") or country") ("month") ("note"))) ("MastersThesis" "Master's Thesis" @@ -467,8 +467,8 @@ alternatives, starting from zero." ("year" nil nil 0) ("date" nil nil 0)) nil (("translator") ("annotator") ("commentator") ("subtitle") ("titleaddon") - ("editor") ("editora") ("editorb") ("editorc") - ("journalsubtitle") ("issuetitle") ("issuesubtitle") + ("editor") ("editora") ("editorb") ("editorc") ("journalsubtitle") + ("journaltitleaddon") ("issuetitle") ("issuesubtitle") ("issuetitleaddon") ("language") ("origlanguage") ("series") ("volume") ("number") ("eid") ("issue") ("month") ("pages") ("version") ("note") ("issn") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") @@ -481,7 +481,7 @@ alternatives, starting from zero." ("introduction") ("foreword") ("afterword") ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle") ("maintitleaddon") ("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes") - ("series") ("number") ("note") ("publisher") ("location") ("isbn") + ("series") ("number") ("note") ("publisher") ("location") ("isbn") ("eid") ("chapter") ("pages") ("pagetotal") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) ("MVBook" "Multi-Volume Book" @@ -502,7 +502,7 @@ alternatives, starting from zero." ("afterword") ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle") ("maintitleaddon") ("booksubtitle") ("booktitleaddon") ("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes") - ("series") ("number") ("note") ("publisher") ("location") ("isbn") + ("series") ("number") ("note") ("publisher") ("location") ("isbn") ("eid") ("chapter") ("pages") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) ("BookInBook" "Book in Collection" ; same as @inbook @@ -513,7 +513,7 @@ alternatives, starting from zero." ("afterword") ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle") ("maintitleaddon") ("booksubtitle") ("booktitleaddon") ("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes") - ("series") ("number") ("note") ("publisher") ("location") ("isbn") + ("series") ("number") ("note") ("publisher") ("location") ("isbn") ("eid") ("chapter") ("pages") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) ("SuppBook" "Supplemental Material in a Book" ; same as @inbook @@ -524,7 +524,7 @@ alternatives, starting from zero." ("afterword") ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle") ("maintitleaddon") ("booksubtitle") ("booktitleaddon") ("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes") - ("series") ("number") ("note") ("publisher") ("location") ("isbn") + ("series") ("number") ("note") ("publisher") ("location") ("isbn") ("eid") ("chapter") ("pages") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) ("Booklet" "Booklet (Bound, but no Publisher)" @@ -532,9 +532,9 @@ alternatives, starting from zero." ("year" nil nil 1) ("date" nil nil 1)) nil (("subtitle") ("titleaddon") ("language") ("howpublished") ("type") - ("note") ("location") ("chapter") ("pages") ("pagetotal") ("addendum") - ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") - ("url") ("urldate"))) + ("note") ("location") ("eid") ("chapter") ("pages") ("pagetotal") + ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") + ("eprinttype") ("url") ("urldate"))) ("Collection" "Single-Volume Collection" (("editor") ("title") ("year" nil nil 0) ("date" nil nil 0)) nil @@ -543,8 +543,8 @@ alternatives, starting from zero." ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle") ("maintitleaddon") ("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes") ("series") ("number") ("note") - ("publisher") ("location") ("isbn") ("chapter") ("pages") ("pagetotal") - ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") + ("publisher") ("location") ("isbn") ("eid") ("chapter") ("pages") + ("pagetotal") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) ("MVCollection" "Multi-Volume Collection" (("editor") ("title") ("year" nil nil 0) ("date" nil nil 0)) @@ -558,32 +558,40 @@ alternatives, starting from zero." ("InCollection" "Article in a Collection" (("author") ("title") ("year" nil nil 0) ("date" nil nil 0)) (("booktitle")) - (("editor") ("editora") ("editorb") ("editorc") ("translator") ("annotator") - ("commentator") ("introduction") ("foreword") ("afterword") + (("editor") ("editora") ("editorb") ("editorc") ("translator") + ("annotator") ("commentator") ("introduction") ("foreword") ("afterword") ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle") ("maintitleaddon") ("booksubtitle") ("booktitleaddon") ("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes") ("series") ("number") ("note") ("publisher") ("location") - ("isbn") ("chapter") ("pages") ("addendum") ("pubstate") ("doi") + ("isbn") ("eid") ("chapter") ("pages") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) ("SuppCollection" "Supplemental Material in a Collection" ; same as @incollection - (("author") ("editor") ("title") ("year" nil nil 0) ("date" nil nil 0)) + (("author") ("title") ("year" nil nil 0) ("date" nil nil 0)) (("booktitle")) - (("editora") ("editorb") ("editorc") ("translator") ("annotator") - ("commentator") ("introduction") ("foreword") ("afterword") + (("editor") ("editora") ("editorb") ("editorc") ("translator") + ("annotator") ("commentator") ("introduction") ("foreword") ("afterword") ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle") ("maintitleaddon") ("booksubtitle") ("booktitleaddon") ("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes") ("series") ("number") ("note") ("publisher") ("location") - ("isbn") ("chapter") ("pages") ("addendum") ("pubstate") ("doi") + ("isbn") ("eid") ("chapter") ("pages") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) + ("Dataset" "Data Set" + (("author" nil nil 0) ("editor" nil nil 0) ("title") + ("year" nil nil 1) ("date" nil nil 1)) + nil + (("subtitle") ("titleaddon") ("language") ("edition") ("type") ("series") + ("number") ("version") ("note") ("organization") ("publisher") + ("location") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") + ("eprinttype") ("url") ("urldate"))) ("Manual" "Technical Manual" (("author" nil nil 0) ("editor" nil nil 0) ("title") ("year" nil nil 1) ("date" nil nil 1)) nil (("subtitle") ("titleaddon") ("language") ("edition") ("type") ("series") ("number") ("version") ("note") - ("organization") ("publisher") ("location") ("isbn") ("chapter") + ("organization") ("publisher") ("location") ("isbn") ("eid") ("chapter") ("pages") ("pagetotal") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) ("Misc" "Miscellaneous" @@ -592,35 +600,37 @@ alternatives, starting from zero." nil (("subtitle") ("titleaddon") ("language") ("howpublished") ("type") ("version") ("note") ("organization") ("location") - ("date") ("month") ("year") ("addendum") ("pubstate") + ("month") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) ("Online" "Online Resource" (("author" nil nil 0) ("editor" nil nil 0) ("title") - ("year" nil nil 1) ("date" nil nil 1) ("url")) + ("year" nil nil 1) ("date" nil nil 1) + ("doi" nil nil 2) ("eprint" nil nil 2) ("url" nil nil 2)) nil (("subtitle") ("titleaddon") ("language") ("version") ("note") - ("organization") ("date") ("month") ("year") ("addendum") - ("pubstate") ("urldate"))) + ("organization") ("month") ("addendum") + ("pubstate") ("eprintclass") ("eprinttype") ("urldate"))) ("Patent" "Patent" (("author") ("title") ("number") ("year" nil nil 0) ("date" nil nil 0)) nil (("holder") ("subtitle") ("titleaddon") ("type") ("version") ("location") - ("note") ("date") ("month") ("year") ("addendum") ("pubstate") + ("note") ("month") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) ("Periodical" "Complete Issue of a Periodical" (("editor") ("title") ("year" nil nil 0) ("date" nil nil 0)) nil - (("editora") ("editorb") ("editorc") ("subtitle") ("issuetitle") - ("issuesubtitle") ("language") ("series") ("volume") ("number") ("issue") - ("date") ("month") ("year") ("note") ("issn") ("addendum") ("pubstate") + (("editora") ("editorb") ("editorc") ("subtitle") ("titleaddon") + ("issuetitle") ("issuesubtitle") ("issuetitleaddon") ("language") + ("series") ("volume") ("number") ("issue") + ("month") ("note") ("issn") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) ("SuppPeriodical" "Supplemental Material in a Periodical" ; same as @article (("author") ("title") ("journaltitle") ("year" nil nil 0) ("date" nil nil 0)) nil (("translator") ("annotator") ("commentator") ("subtitle") ("titleaddon") - ("editor") ("editora") ("editorb") ("editorc") - ("journalsubtitle") ("issuetitle") ("issuesubtitle") + ("editor") ("editora") ("editorb") ("editorc") ("journalsubtitle") + ("journaltitleaddon") ("issuetitle") ("issuesubtitle") ("issuetitleaddon") ("language") ("origlanguage") ("series") ("volume") ("number") ("eid") ("issue") ("month") ("pages") ("version") ("note") ("issn") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") @@ -628,19 +638,19 @@ alternatives, starting from zero." ("Proceedings" "Single-Volume Conference Proceedings" (("title") ("year" nil nil 0) ("date" nil nil 0)) nil - (("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle") - ("maintitleaddon") ("eventtitle") ("eventdate") ("venue") ("language") - ("editor") - ("volume") ("part") ("volumes") ("series") ("number") ("note") - ("organization") ("publisher") ("location") ("month") - ("isbn") ("chapter") ("pages") ("pagetotal") ("addendum") ("pubstate") - ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) + (("editor") ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle") + ("maintitleaddon") ("eventtitle") ("eventtitleaddon") ("eventdate") + ("venue") ("language") ("volume") ("part") ("volumes") ("series") + ("number") ("note") ("organization") ("publisher") ("location") ("month") + ("isbn") ("eid") ("chapter") ("pages") ("pagetotal") ("addendum") + ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") + ("urldate"))) ("MVProceedings" "Multi-Volume Conference Proceedings" - (("editor") ("title") ("year" nil nil 0) ("date" nil nil 0)) + (("title") ("year" nil nil 0) ("date" nil nil 0)) nil - (("subtitle") ("titleaddon") ("eventtitle") ("eventdate") ("venue") - ("language") ("volumes") ("series") ("number") ("note") - ("organization") ("publisher") ("location") ("month") + (("editor") ("subtitle") ("titleaddon") ("eventtitle") ("eventtitleaddon") + ("eventdate") ("venue") ("language") ("volumes") ("series") ("number") + ("note") ("organization") ("publisher") ("location") ("month") ("isbn") ("pagetotal") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) ("InProceedings" "Article in Conference Proceedings" @@ -648,9 +658,9 @@ alternatives, starting from zero." (("booktitle")) (("editor") ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle") ("maintitleaddon") ("booksubtitle") ("booktitleaddon") - ("eventtitle") ("eventdate") ("venue") ("language") + ("eventtitle") ("eventtitleaddon") ("eventdate") ("venue") ("language") ("volume") ("part") ("volumes") ("series") ("number") ("note") - ("organization") ("publisher") ("location") ("month") ("isbn") + ("organization") ("publisher") ("location") ("month") ("isbn") ("eid") ("chapter") ("pages") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) ("Reference" "Single-Volume Work of Reference" ; same as @collection @@ -661,8 +671,8 @@ alternatives, starting from zero." ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle") ("maintitleaddon") ("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes") ("series") ("number") ("note") - ("publisher") ("location") ("isbn") ("chapter") ("pages") ("pagetotal") - ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") + ("publisher") ("location") ("isbn") ("eid") ("chapter") ("pages") + ("pagetotal") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) ("MVReference" "Multi-Volume Work of Reference" ; same as @mvcollection (("editor") ("title") ("year" nil nil 0) ("date" nil nil 0)) @@ -674,42 +684,51 @@ alternatives, starting from zero." ("location") ("isbn") ("pagetotal") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) ("InReference" "Article in a Work of Reference" ; same as @incollection - (("author") ("editor") ("title") ("year" nil nil 0) ("date" nil nil 0)) + (("author") ("title") ("year" nil nil 0) ("date" nil nil 0)) (("booktitle")) - (("editora") ("editorb") ("editorc") ("translator") ("annotator") - ("commentator") ("introduction") ("foreword") ("afterword") + (("editor") ("editora") ("editorb") ("editorc") ("translator") + ("annotator") ("commentator") ("introduction") ("foreword") ("afterword") ("subtitle") ("titleaddon") ("maintitle") ("mainsubtitle") ("maintitleaddon") ("booksubtitle") ("booktitleaddon") ("language") ("origlanguage") ("volume") ("part") ("edition") ("volumes") ("series") ("number") ("note") ("publisher") ("location") - ("isbn") ("chapter") ("pages") ("addendum") ("pubstate") ("doi") + ("isbn") ("eid") ("chapter") ("pages") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) ("Report" "Technical or Research Report" (("author") ("title") ("type") ("institution") ("year" nil nil 0) ("date" nil nil 0)) nil (("subtitle") ("titleaddon") ("language") ("number") ("version") ("note") - ("location") ("month") ("isrn") ("chapter") ("pages") ("pagetotal") - ("addendum") ("pubstate") + ("location") ("month") ("isrn") ("eid") ("chapter") ("pages") + ("pagetotal") ("addendum") ("pubstate") + ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) + ("Software" "Computer Software" ; Same as @misc. + (("author" nil nil 0) ("editor" nil nil 0) ("title") + ("year" nil nil 1) ("date" nil nil 1)) + nil + (("subtitle") ("titleaddon") ("language") ("howpublished") ("type") + ("version") ("note") ("organization") ("location") + ("month") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) - ("Thesis" "PhD. or Master's Thesis" + ("Thesis" "PhD or Master's Thesis" (("author") ("title") ("type") ("institution") ("year" nil nil 0) ("date" nil nil 0)) nil (("subtitle") ("titleaddon") ("language") ("note") ("location") - ("month") ("isbn") ("chapter") ("pages") ("pagetotal") + ("month") ("isbn") ("eid") ("chapter") ("pages") ("pagetotal") ("addendum") ("pubstate") ("doi") ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate"))) ("Unpublished" "Unpublished" (("author") ("title") ("year" nil nil 0) ("date" nil nil 0)) nil - (("subtitle") ("titleaddon") ("language") ("howpublished") - ("note") ("location") ("isbn") ("date") ("month") ("year") - ("addendum") ("pubstate") ("url") ("urldate")))) + (("subtitle") ("titleaddon") ("type") ("eventtitle") ("eventtitleaddon") + ("eventdate") ("venue") ("language") ("howpublished") ("note") + ("location") ("isbn") ("month") ("addendum") ("pubstate") ("doi") + ("eprint") ("eprintclass") ("eprinttype") ("url") ("urldate")))) "Alist of biblatex entry types and their associated fields. It has the same format as `bibtex-BibTeX-entry-alist'." :group 'bibtex - :version "24.1" + :version "28.1" :type 'bibtex-entry-alist :risky t) @@ -766,6 +785,7 @@ if `bibtex-BibTeX-entry-alist' does not define a comment for FIELD." ("eprinttype" "Type of eprint identifier") ("eventdate" "Date of a conference or some other event") ("eventtitle" "Title of a conference or some other event") + ("eventtitleaddon" "Annex to the eventtitle (e.g., acronym of known event)") ("file" "Local link to an electronic version of the work") ("foreword" "Author(s) of a foreword to the work") ("holder" "Holder(s) of a patent") @@ -781,9 +801,11 @@ if `bibtex-BibTeX-entry-alist' does not define a comment for FIELD." ("issue" "Issue of a journal") ("issuesubtitle" "Subtitle of a specific issue of a journal or other periodical.") ("issuetitle" "Title of a specific issue of a journal or other periodical.") + ("issuetitleaddon" "Annex to the issuetitle") ("iswc" "International Standard Work Code of a musical work") ("journalsubtitle" "Subtitle of a journal, a newspaper, or some other periodical.") ("journaltitle" "Name of a journal, a newspaper, or some other periodical.") + ("journaltitleaddon" "Annex to the journaltitle") ("label" "Substitute for the regular label to be used by the citation style") ("language" "Language(s) of the work") ("library" "Library name and a call number") @@ -811,6 +833,8 @@ if `bibtex-BibTeX-entry-alist' does not define a comment for FIELD." ("series" "Name of a publication series") ("shortauthor" "Author(s) of the work, given in an abbreviated form") ("shorteditor" "Editor(s) of the work, given in an abbreviated form") + ("shorthand" "Special designation overriding the default label") + ("shorthandintro" "Phrase overriding the standard shorthand introduction") ("shortjournal" "Short version or an acronym of the journal title") ("shortseries" "Short version or an acronym of the series field") ("shorttitle" "Title in an abridged form") @@ -829,7 +853,7 @@ if `bibtex-BibTeX-entry-alist' does not define a comment for FIELD." "Alist of biblatex fields. It has the same format as `bibtex-BibTeX-entry-alist'." :group 'bibtex - :version "24.1" + :version "28.1" :type 'bibtex-field-alist) (defcustom bibtex-dialect-list '(BibTeX biblatex) commit 233d350d1984bcb4e0f636ddfa29482b815fa2f2 Author: Stephen Berman Date: Wed Nov 4 23:52:21 2020 +0100 Improve display of tabulated list header line labels (bug#44068) * lisp/emacs-lisp/tabulated-list.el (tabulated-list-init-header): Ensure sort indicator appears after the label of any selected sortable column that is wide enough and enable label truncation when narrowing a column. * lisp/emacs-lisp/timer-list.el (timer-list-mode): Improve column alignment. (timer-list--function-predicate): Correct typo in doc string. diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index b13f609f88..30577679f2 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -269,42 +269,48 @@ Populated by `tabulated-list-init-header'.") ;; FIXME: Should share code with tabulated-list-print-col! (let ((x (max tabulated-list-padding 0)) (button-props `(help-echo "Click to sort by column" - mouse-face header-line-highlight - keymap ,tabulated-list-sort-button-map)) + mouse-face header-line-highlight + keymap ,tabulated-list-sort-button-map)) + (len (length tabulated-list-format)) (cols nil)) (if display-line-numbers (setq x (+ x (tabulated-list-line-number-width)))) (push (propertize " " 'display `(space :align-to ,x)) cols) - (dotimes (n (length tabulated-list-format)) + (dotimes (n len) (let* ((col (aref tabulated-list-format n)) + (not-last-col (< n (1- len))) (label (nth 0 col)) + (lablen (length label)) + (pname label) (width (nth 1 col)) (props (nthcdr 3 col)) (pad-right (or (plist-get props :pad-right) 1)) (right-align (plist-get props :right-align)) (next-x (+ x pad-right width))) + (when (and (>= lablen 3) (> lablen width) not-last-col) + (setq label (truncate-string-to-width label (- lablen 1) nil nil t))) (push (cond ;; An unsortable column ((not (nth 2 col)) - (propertize label 'tabulated-list-column-name label)) + (propertize label 'tabulated-list-column-name pname)) ;; The selected sort column ((equal (car col) (car tabulated-list-sort-key)) (apply 'propertize - (concat label - (cond - ((> (+ 2 (length label)) width) "") - ((cdr tabulated-list-sort-key) + (concat label + (cond + ((and (< lablen 3) not-last-col) "") + ((cdr tabulated-list-sort-key) (format " %c" tabulated-list-gui-sort-indicator-desc)) - (t (format " %c" + (t (format " %c" tabulated-list-gui-sort-indicator-asc)))) - 'face 'bold - 'tabulated-list-column-name label - button-props)) + 'face 'bold + 'tabulated-list-column-name pname + button-props)) ;; Unselected sortable column. (t (apply 'propertize label - 'tabulated-list-column-name label + 'tabulated-list-column-name pname button-props))) cols) (when right-align diff --git a/lisp/emacs-lisp/timer-list.el b/lisp/emacs-lisp/timer-list.el index 4bda9acebf..024f003062 100644 --- a/lisp/emacs-lisp/timer-list.el +++ b/lisp/emacs-lisp/timer-list.el @@ -95,8 +95,8 @@ (setq-local revert-buffer-function #'list-timers) (setq tabulated-list-format '[("Idle" 6 timer-list--idle-predicate) - (" Next" 12 timer-list--next-predicate) - (" Repeat" 12 timer-list--repeat-predicate) + ("Next" 12 timer-list--next-predicate :right-align t :pad-right 1) + ("Repeat" 12 timer-list--repeat-predicate :right-align t :pad-right 1) ("Function" 10 timer-list--function-predicate)])) (defun timer-list--idle-predicate (A B) @@ -121,7 +121,7 @@ (string< rA rB))) (defun timer-list--function-predicate (A B) - "Predicate to sort Timer-List by the Next column." + "Predicate to sort Timer-List by the Function column." (let ((fA (aref (cadr A) 3)) (fB (aref (cadr B) 3))) (string< fA fB))) commit 89740e9cb59ec05f3eef5a53dc39845d7d9fb638 Author: Eli Zaretskii Date: Wed Nov 4 22:10:06 2020 +0200 Prevent redisplay from moving point behind user's back * src/bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start): Bind inhibit-quit to a non-nil value around calls to fast_looking_at, to prevent breaking out of redisplay_window, which temporarily moves point in buffers shown in non-selected windows. (Bug#44448) diff --git a/src/bidi.c b/src/bidi.c index 3abde7fcb0..77e92c302f 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -1458,6 +1458,11 @@ bidi_at_paragraph_end (ptrdiff_t charpos, ptrdiff_t bytepos) else start_re = paragraph_start_re; + /* Prevent quitting inside re_match_2, as redisplay_window could + have temporarily moved point. */ + ptrdiff_t count = SPECPDL_INDEX (); + specbind (Qinhibit_quit, Qt); + val = fast_looking_at (sep_re, charpos, bytepos, ZV, ZV_BYTE, Qnil); if (val < 0) { @@ -1467,6 +1472,7 @@ bidi_at_paragraph_end (ptrdiff_t charpos, ptrdiff_t bytepos) val = -2; } + unbind_to (count, Qnil); return val; } @@ -1542,6 +1548,11 @@ bidi_find_paragraph_start (ptrdiff_t pos, ptrdiff_t pos_byte) if (cache_buffer->base_buffer) cache_buffer = cache_buffer->base_buffer; + /* Prevent quitting inside re_match_2, as redisplay_window could + have temporarily moved point. */ + ptrdiff_t count = SPECPDL_INDEX (); + specbind (Qinhibit_quit, Qt); + while (pos_byte > BEGV_BYTE && n++ < MAX_PARAGRAPH_SEARCH && fast_looking_at (re, pos, pos_byte, limit, limit_byte, Qnil) < 0) @@ -1559,6 +1570,7 @@ bidi_find_paragraph_start (ptrdiff_t pos, ptrdiff_t pos_byte) else pos = find_newline_no_quit (pos, pos_byte, -1, &pos_byte); } + unbind_to (count, Qnil); if (n >= MAX_PARAGRAPH_SEARCH) pos = BEGV, pos_byte = BEGV_BYTE; if (bpc) commit 1c9500da6615ecaa6e7a5029e0f5d0200d66e7ef Author: Stefan Monnier Date: Wed Nov 4 13:44:51 2020 -0500 * src/term.c (handle_one_term_event): Simplify. Remove the `hold_quit` argument which was never used. Streamline the control flow. Thanks to Jared Finder for pointing it out. * src/keyboard.c (tty_read_avail_input): Simplify accordingly. diff --git a/src/keyboard.c b/src/keyboard.c index 2e0143379a..49a0a8bd23 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -7005,12 +7005,8 @@ tty_read_avail_input (struct terminal *terminal, if (gpm_tty == tty) { Gpm_Event event; - struct input_event gpm_hold_quit; int gpm, fd = gpm_fd; - EVENT_INIT (gpm_hold_quit); - gpm_hold_quit.kind = NO_EVENT; - /* gpm==1 if event received. gpm==0 if the GPM daemon has closed the connection, in which case Gpm_GetEvent closes gpm_fd and clears it to -1, which is why @@ -7018,13 +7014,11 @@ tty_read_avail_input (struct terminal *terminal, select masks. gpm==-1 if a protocol error or EWOULDBLOCK; the latter is normal. */ while (gpm = Gpm_GetEvent (&event), gpm == 1) { - nread += handle_one_term_event (tty, &event, &gpm_hold_quit); + nread += handle_one_term_event (tty, &event); } if (gpm == 0) /* Presumably the GPM daemon has closed the connection. */ close_gpm (fd); - if (gpm_hold_quit.kind != NO_EVENT) - kbd_buffer_store_event (&gpm_hold_quit); if (nread) return nread; } diff --git a/src/term.c b/src/term.c index ff1aabfed2..3a13da165e 100644 --- a/src/term.c +++ b/src/term.c @@ -2550,67 +2550,63 @@ term_mouse_click (struct input_event *result, Gpm_Event *event, } int -handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event, - struct input_event *hold_quit) +handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event) { struct frame *f = XFRAME (tty->top_frame); struct input_event ie; - bool do_help = 0; int count = 0; EVENT_INIT (ie); ie.kind = NO_EVENT; ie.arg = Qnil; - if (event->type & (GPM_MOVE | GPM_DRAG)) { - previous_help_echo_string = help_echo_string; - help_echo_string = Qnil; + if (event->type & (GPM_MOVE | GPM_DRAG)) + { + previous_help_echo_string = help_echo_string; + help_echo_string = Qnil; - Gpm_DrawPointer (event->x, event->y, fileno (tty->output)); + Gpm_DrawPointer (event->x, event->y, fileno (tty->output)); - if (!term_mouse_movement (f, event)) - help_echo_string = previous_help_echo_string; + if (!term_mouse_movement (f, event)) + help_echo_string = previous_help_echo_string; - /* If the contents of the global variable help_echo_string - has changed, generate a HELP_EVENT. */ - if (!NILP (help_echo_string) - || !NILP (previous_help_echo_string)) - do_help = 1; + /* If the contents of the global variable help_echo_string + has changed, generate a HELP_EVENT. */ + if (!NILP (help_echo_string) + || !NILP (previous_help_echo_string)) + { + Lisp_Object frame; - goto done; - } - else { - f->mouse_moved = 0; - term_mouse_click (&ie, event, f); - if (tty_handle_tab_bar_click (f, event->x, event->y, - (ie.modifiers & down_modifier) != 0, &ie)) - { - /* tty_handle_tab_bar_click stores 2 events in the event - queue, so we are done here. */ - count += 2; - return count; - } - } + if (f) + XSETFRAME (frame, f); + else + frame = Qnil; - done: - if (ie.kind != NO_EVENT) - { - kbd_buffer_store_event_hold (&ie, hold_quit); - count++; + gen_help_event (help_echo_string, frame, help_echo_window, + help_echo_object, help_echo_pos); + count++; + } } - - if (do_help - && !(hold_quit && hold_quit->kind != NO_EVENT)) + else { - Lisp_Object frame; - - if (f) - XSETFRAME (frame, f); - else - frame = Qnil; - - gen_help_event (help_echo_string, frame, help_echo_window, - help_echo_object, help_echo_pos); + f->mouse_moved = 0; + term_mouse_click (&ie, event, f); + /* eassert (ie.kind == GPM_CLICK_EVENT); */ + if (tty_handle_tab_bar_click (f, event->x, event->y, + (ie.modifiers & down_modifier) != 0, &ie)) + { + /* eassert (ie.kind == GPM_CLICK_EVENT + * || ie.kind == TAB_BAR_EVENT); */ + /* tty_handle_tab_bar_click stores 2 events in the event + queue, so we are done here. */ + /* FIXME: Actually, `tty_handle_tab_bar_click` returns true + without storing any events, when + (ie.modifiers & down_modifier) != 0 */ + count += 2; + return count; + } + /* eassert (ie.kind == GPM_CLICK_EVENT); */ + kbd_buffer_store_event (&ie); count++; } diff --git a/src/termhooks.h b/src/termhooks.h index d18b750c3a..6ab06ceff9 100644 --- a/src/termhooks.h +++ b/src/termhooks.h @@ -370,7 +370,7 @@ enum { #ifdef HAVE_GPM #include -extern int handle_one_term_event (struct tty_display_info *, Gpm_Event *, struct input_event *); +extern int handle_one_term_event (struct tty_display_info *, Gpm_Event *); #ifndef HAVE_WINDOW_SYSTEM extern void term_mouse_moveto (int, int); #endif commit 125956725be2f7aea8e7436530f4b32cf621d9ac Author: Eric Abrahamsen Date: Tue Nov 3 22:31:42 2020 -0800 Avoid use of eieio-oset-default * lisp/gnus/gnus-search.el: Replace with an :initform tag on the slot definition. `symbol-value' is necessary, otherwise the defclass macro will treat the option as a quoted symbol. diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 81be7c588f..3053501fe7 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -810,31 +810,27 @@ the files in ARTLIST by that search key.") :documentation "Can this search engine handle the FUZZY search capability? This slot is set automatically by the imap server, and cannot - be set manually. Currently only partially implemented.")) + be set manually. Currently only partially implemented.") + (raw-queries-p + :initform (symbol-value 'gnus-search-imap-raw-queries-p))) :documentation "The base IMAP search engine, using an IMAP server's search capabilites. - This backend may be subclassed to handle particular IMAP servers' quirks.") -(eieio-oset-default 'gnus-search-imap 'raw-queries-p - gnus-search-imap-raw-queries-p) - (defclass gnus-search-find-grep (gnus-search-engine gnus-search-process gnus-search-grep) nil) -;;; The "indexed" search engine. These are engines that use an -;;; external program, with indexes kept on disk, to search messages -;;; usually kept in some local directory. The three common slots are -;;; "program", holding the string name of the executable; "switches", -;;; holding additional switches to pass to the executable; and -;;; "prefix", which is sort of the path to the found messages which -;;; should be removed so that Gnus can find them. Many of the -;;; subclasses also allow distinguishing multiple databases or -;;; indexes. These slots can be set using a global default, or on a -;;; per-server basis. +;;; The "indexed" search engine. + +;; These are engines that use an external program, with indexes kept +;; on disk, to search messages usually kept in some local directory. +;; They have several slots in common, for instance program name or +;; configuration file. Many of the subclasses also allow +;; distinguishing multiple databases or indexes. These slots can be +;; set using a global default, or on a per-server basis. (defclass gnus-search-indexed (gnus-search-engine gnus-search-process @@ -851,10 +847,11 @@ quirks.") :documentation "Location of the config file, if any.") (remove-prefix :initarg :remove-prefix + :initform (concat (getenv "HOME") "/Mail/") :type string :documentation "The path to the directory where the indexed mails are - kept. This path is removed from the search results.") + kept. This path is removed from the search results.") (switches :initarg :switches :type list @@ -866,103 +863,69 @@ quirks.") :documentation "A base search engine class that assumes a local search index accessed by a command line program.") -(eieio-oset-default 'gnus-search-indexed 'remove-prefix - (concat (getenv "HOME") "/Mail/")) - (defclass gnus-search-swish-e (gnus-search-indexed) ((index-files :init-arg :index-files - :type list))) - -(eieio-oset-default 'gnus-search-swish-e 'program - gnus-search-swish-e-program) - -(eieio-oset-default 'gnus-search-swish-e 'remove-prefix - gnus-search-swish-e-remove-prefix) - -(eieio-oset-default 'gnus-search-swish-e 'index-files - gnus-search-swish-e-index-files) - -(eieio-oset-default 'gnus-search-swish-e 'switches - gnus-search-swish-e-switches) - -(eieio-oset-default 'gnus-search-swish-e 'raw-queries-p - gnus-search-swish-e-raw-queries-p) + :initform (symbol-value 'gnus-search-swish-e-index-files) + :type list) + (program + :initform (symbol-value 'gnus-search-swish-e-program)) + (remove-prefix + :initform (symbol-value 'gnus-search-swish-e-remove-prefix)) + (switches + :initform (symbol-value 'gnus-search-swish-e-switches)) + (raw-queries-p + :initform (symbol-value 'gnus-search-swish-e-raw-queries-p)))) (defclass gnus-search-swish++ (gnus-search-indexed) - nil) - -(eieio-oset-default 'gnus-search-swish++ 'program - gnus-search-swish++-program) - -(eieio-oset-default 'gnus-search-swish++ 'remove-prefix - gnus-search-swish++-remove-prefix) - -(eieio-oset-default 'gnus-search-swish++ 'config-file - gnus-search-swish++-config-file) - -(eieio-oset-default 'gnus-search-swish++ 'switches - gnus-search-swish++-switches) - -(eieio-oset-default 'gnus-search-swish++ 'raw-queries-p - gnus-search-swish++-raw-queries-p) + ((program + :initform (symbol-value 'gnus-search-swish++-program)) + (remove-prefix + :initform (symbol-value 'gnus-search-swish++-remove-prefix)) + (switches + :initform (symbol-value 'gnus-search-swish++-switches)) + (config-file + :initform (symbol-value 'gnus-search-swish++-config-file)) + (raw-queries-p + :initform (symbol-value 'gnus-search-swish++-raw-queries-p)))) (defclass gnus-search-mairix (gnus-search-indexed) - nil) - -(eieio-oset-default 'gnus-search-mairix 'program - gnus-search-mairix-program) - -(eieio-oset-default 'gnus-search-mairix 'switches - gnus-search-mairix-switches) - -(eieio-oset-default 'gnus-search-mairix 'remove-prefix - gnus-search-mairix-remove-prefix) - -(eieio-oset-default 'gnus-search-mairix 'config-file - gnus-search-mairix-config-file) - -(eieio-oset-default 'gnus-search-mairix 'raw-queries-p - gnus-search-mairix-raw-queries-p) + ((program + :initform (symbol-value 'gnus-search-mairix-program)) + (remove-prefix + :initform (symbol-value 'gnus-search-mairix-remove-prefix)) + (switches + :initform (symbol-value 'gnus-search-mairix-switches)) + (config-file + :initform (symbol-value 'gnus-search-mairix-config-file)) + (raw-queries-p + :initform (symbol-value 'gnus-search-mairix-raw-queries-p)))) (defclass gnus-search-namazu (gnus-search-indexed) ((index-directory :initarg :index-directory :type string - :custom directory))) - -(eieio-oset-default 'gnus-search-namazu 'program - gnus-search-namazu-program) - -(eieio-oset-default 'gnus-search-namazu 'index-directory - gnus-search-namazu-index-directory) - -(eieio-oset-default 'gnus-search-namazu 'switches - gnus-search-namazu-switches) - -(eieio-oset-default 'gnus-search-namazu 'remove-prefix - gnus-search-namazu-remove-prefix) - -(eieio-oset-default 'gnus-search-namazu 'raw-queries-p - gnus-search-namazu-raw-queries-p) + :custom directory) + (program + :initform (symbol-value 'gnus-search-namazu-program)) + (remove-prefix + :initform (symbol-value 'gnus-search-namazu-remove-prefix)) + (switches + :initform (symbol-value 'gnus-search-namazu-switches)) + (raw-queries-p + :initform (symbol-value 'gnus-search-namazu-raw-queries-p)))) (defclass gnus-search-notmuch (gnus-search-indexed) - nil) - -(eieio-oset-default 'gnus-search-notmuch 'program - gnus-search-notmuch-program) - -(eieio-oset-default 'gnus-search-notmuch 'switches - gnus-search-notmuch-switches) - -(eieio-oset-default 'gnus-search-notmuch 'remove-prefix - gnus-search-notmuch-remove-prefix) - -(eieio-oset-default 'gnus-search-notmuch 'config-file - gnus-search-notmuch-config-file) - -(eieio-oset-default 'gnus-search-notmuch 'raw-queries-p - gnus-search-notmuch-raw-queries-p) + ((program + :initform (symbol-value 'gnus-search-notmuch-program)) + (remove-prefix + :initform (symbol-value 'gnus-search-notmuch-remove-prefix)) + (switches + :initform (symbol-value 'gnus-search-notmuch-switches)) + (config-file + :initform (symbol-value 'gnus-search-notmuch-config-file)) + (raw-queries-p + :initform (symbol-value 'gnus-search-notmuch-raw-queries-p)))) (define-obsolete-variable-alias 'nnir-method-default-engines 'gnus-search-default-engines "28.1") commit d6cb106a374800b1899dca8fc25b8698e152e64c Author: Stefan Monnier Date: Wed Nov 4 11:37:00 2020 -0500 * lisp-mode.el: Fix missing highlight of "hidden" string arg * lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2) (lisp-cl-font-lock-keywords-2): Highlight "hidden arg" even if it already has another face. diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 352210f859..268992295b 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -478,7 +478,8 @@ This will generate compile-time constants from BINDINGS." (3 'font-lock-regexp-grouping-construct prepend)) (lisp--match-hidden-arg (0 '(face font-lock-warning-face - help-echo "Hidden behind deeper element; move to another line?"))) + help-echo "Hidden behind deeper element; move to another line?") + prepend)) (lisp--match-confusable-symbol-character 0 '(face font-lock-warning-face help-echo "Confusable character")) @@ -522,7 +523,8 @@ This will generate compile-time constants from BINDINGS." (1 font-lock-keyword-face)) (lisp--match-hidden-arg (0 '(face font-lock-warning-face - help-echo "Hidden behind deeper element; move to another line?"))) + help-echo "Hidden behind deeper element; move to another line?") + prepend)) )) "Gaudy level highlighting for Lisp modes."))) commit 43431f7108a6cb2af09b5f73092c7ab43f0d5199 Author: Manuel Uberti Date: Wed Nov 4 15:41:53 2020 +0100 * lisp/progmodes/project.el (project--files-in-directory): Fix formatting Copyright-paperwork-exempt: yes diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 8f7482a23d..6c647a092a 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -301,8 +301,8 @@ to find the list of ignores for each directory." (split-string files) (concat " -o " find-name-arg " ")) " " - (shell-quote-argument ")"))"") - ))) + (shell-quote-argument ")")) + "")))) (project--remote-file-names (sort (split-string (shell-command-to-string command) "\0" t) #'string<)))) commit d408866ff2a0de7af5d8bb40d9c1c310573f1800 Author: Stefan Kangas Date: Wed Nov 4 15:50:52 2020 +0100 Use lexical-binding in mule-charsets.el * admin/charsets/mule-charsets.el: Use lexical-binding. (mule-charsets-header): Rename from 'header' to silence byte-compiler. diff --git a/admin/charsets/mule-charsets.el b/admin/charsets/mule-charsets.el index 8355af4488..99a8c60d88 100644 --- a/admin/charsets/mule-charsets.el +++ b/admin/charsets/mule-charsets.el @@ -1,4 +1,4 @@ -;; mule-charsets.el -- Generate Mule-original charset maps. +;; mule-charsets.el -- Generate Mule-original charset maps. -*- lexical-binding: t -*- ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) ;; Registration Number H13PRO009 @@ -55,14 +55,14 @@ ("MULE-lviscii.map" . vietnamese-viscii-lower) ("MULE-uviscii.map" . vietnamese-viscii-upper))) -(defconst header +(defconst mule-charsets-header (format "# Generated by running admin/charsets/mule-charsets.el in Emacs %d.%d.\n" emacs-major-version emacs-minor-version)) (dolist (elt charset-alist) (with-temp-buffer - (insert header) + (insert mule-charsets-header) (map-charset-chars 'func (cdr elt) (cdr elt)) (sort-lines nil (point-min) (point-max)) (let ((coding-system-for-write 'unix)) commit 2668bb47b03230400f94855a58b81a516b46acc5 Author: Reuben Thomas Date: Wed Nov 4 08:50:25 2020 +0000 Remove unused variable in ispell.el (thanks, Stefan Kangas) * lisp/textmodes/ispell.el (ispell-check-version): Remove unused variable `speller'. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index c185f9f2c8..3358cf1ba3 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -685,9 +685,7 @@ Otherwise returns the library directory name, if that is defined." (setq status (ispell-call-process ispell-program-name nil t nil (let ((case-fold-search - (memq system-type '(ms-dos windows-nt))) - (speller - (file-name-nondirectory ispell-program-name))) + (memq system-type '(ms-dos windows-nt)))) "-vv"))) (goto-char (point-min)) (if interactivep commit f7ea667b54380a7b7c60490cef30728b5f444ae1 Author: Stefan Kangas Date: Wed Nov 4 07:40:16 2020 +0100 Fix warnings in url-irc.el * lisp/url/url-irc.el (zenirc-server-alist, zenirc-buffer-name): Declare to fix warnings. (url-irc-rcirc): Silence warning by adding missing password argument to rcirc-connect. diff --git a/lisp/url/url-irc.el b/lisp/url/url-irc.el index ece53c9029..3ff6e64747 100644 --- a/lisp/url/url-irc.el +++ b/lisp/url/url-irc.el @@ -48,6 +48,8 @@ PASSWORD - What password to use" ;; External. (declare-function zenirc "ext:zenirc" (&optional prefix)) (declare-function zenirc-send-line "ext:zenirc" ()) +(defvar zenirc-server-alist) +(defvar zenirc-buffer-name) (defun url-irc-zenirc (host port channel user password) (let ((zenirc-buffer-name (if (and user host port) @@ -65,7 +67,7 @@ PASSWORD - What password to use" (defun url-irc-rcirc (host port channel user password) (let ((chan (when channel (concat "#" channel)))) - (rcirc-connect host port user nil nil (when chan (list chan))) + (rcirc-connect host port user nil nil (when chan (list chan)) password) (when chan (switch-to-buffer (concat chan "@" host))))) commit 197a53f7b83dc95384fb98080de89e059cafadb5 Author: Stefan Kangas Date: Wed Nov 4 07:12:21 2020 +0100 * lisp/obsolete/nnir.el: Add "Obsolete-since" header. diff --git a/lisp/obsolete/nnir.el b/lisp/obsolete/nnir.el index 20f82e5cbd..aec5ed3541 100644 --- a/lisp/obsolete/nnir.el +++ b/lisp/obsolete/nnir.el @@ -12,6 +12,7 @@ ;; Justus Piater Piater.name> ;; Mostly rewritten by Andrew Cohen from 2010 ;; Keywords: news mail searching ir +;; Obsolete-since: 28.1 ;; This file is part of GNU Emacs. commit 0d39d1e2f399ee054d02ad1785281557b03a89a1 Author: Stefan Kangas Date: Tue Nov 3 08:15:39 2020 +0100 * lisp/cedet/srecode.el: Use lexical-binding. diff --git a/lisp/cedet/srecode.el b/lisp/cedet/srecode.el index eb7af1c272..79c8afff34 100644 --- a/lisp/cedet/srecode.el +++ b/lisp/cedet/srecode.el @@ -1,4 +1,4 @@ -;;; srecode.el --- Semantic buffer evaluator. +;;; srecode.el --- Semantic buffer evaluator. -*- lexical-binding: t -*- ;;; Copyright (C) 2005, 2007-2020 Free Software Foundation, Inc. commit a63d90517549b1940ffbe3438a614afc7ea1aa6d Author: Stefan Monnier Date: Wed Nov 4 00:24:45 2020 -0500 Fix misuses of `make-local-variable` on hooks * lisp/vc/smerge-mode.el (smerge-ediff): * lisp/progmodes/python.el (python-pdbtrack-setup-tracking): * lisp/net/tramp-smb.el (tramp-smb-call-winexe): * lisp/net/secrets.el (secrets-mode): * lisp/mail/rmail.el (rmail-variables): * lisp/ielm.el (inferior-emacs-lisp-mode): * lisp/erc/erc-log.el (erc-log-setup-logging): Use `add-hook`. * lisp/eshell/em-unix.el (eshell/diff): * lisp/eshell/em-hist.el (eshell-hist-initialize): Don't `make-local-variable` on hooks. diff --git a/lisp/dframe.el b/lisp/dframe.el index efe2bc57d9..417477be27 100644 --- a/lisp/dframe.el +++ b/lisp/dframe.el @@ -287,6 +287,9 @@ CREATE-HOOK is a hook to run after creating a frame." ;; Correct use of `temp-buffer-show-function': Bob Weiner (if (and (boundp 'temp-buffer-show-hook) (boundp 'temp-buffer-show-function)) + ;; FIXME: Doesn't this get us into an inf-loop when the + ;; `temp-buffer-show-function' runs `temp-buffer-show-hook' + ;; (as is normally the case)? (progn (make-local-variable 'temp-buffer-show-hook) (setq temp-buffer-show-hook temp-buffer-show-function))) (make-local-variable 'temp-buffer-show-function) diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index 2166123e67..de0a16ea3f 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -267,7 +267,7 @@ The current buffer is given by BUFFER." (with-current-buffer buffer (auto-save-mode -1) (setq buffer-file-name nil) - (set (make-local-variable 'write-file-functions) '(erc-save-buffer-in-logs)) + (add-hook 'write-file-functions #'erc-save-buffer-in-logs nil t) (when erc-log-insert-log-on-open (ignore-errors (save-excursion diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index 5cee1bad36..bdc21c916c 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el @@ -75,8 +75,7 @@ (defcustom eshell-hist-load-hook nil "A list of functions to call when loading `eshell-hist'." :version "24.1" ; removed eshell-hist-initialize - :type 'hook - :group 'eshell-hist) + :type 'hook) (defcustom eshell-hist-unload-hook (list @@ -84,8 +83,7 @@ (lambda () (remove-hook 'kill-emacs-hook 'eshell-save-some-history)))) "A hook that gets run when `eshell-hist' is unloaded." - :type 'hook - :group 'eshell-hist) + :type 'hook) (defcustom eshell-history-file-name (expand-file-name "history" eshell-directory-name) @@ -93,20 +91,17 @@ See also `eshell-read-history' and `eshell-write-history'. If it is nil, Eshell will use the value of HISTFILE." :type '(choice (const :tag "Use HISTFILE" nil) - file) - :group 'eshell-hist) + file)) (defcustom eshell-history-size 128 "Size of the input history ring. If nil, use envvar HISTSIZE." :type '(choice (const :tag "Use HISTSIZE" nil) - integer) - :group 'eshell-hist) + integer)) (defcustom eshell-hist-ignoredups nil "If non-nil, don't add input matching the last on the input ring. This mirrors the optional behavior of bash." - :type 'boolean - :group 'eshell-hist) + :type 'boolean) (defcustom eshell-save-history-on-exit t "Determine if history should be automatically saved. @@ -118,8 +113,7 @@ If set to `ask', ask if any Eshell buffers are open at exit time. If set to t, history will always be saved, silently." :type '(choice (const :tag "Never" nil) (const :tag "Ask" ask) - (const :tag "Always save" t)) - :group 'eshell-hist) + (const :tag "Always save" t))) (defcustom eshell-input-filter 'eshell-input-filter-default "Predicate for filtering additions to input history. @@ -128,8 +122,7 @@ the input history list. Default is to save anything that isn't all whitespace." :type '(radio (function-item eshell-input-filter-default) (function-item eshell-input-filter-initial-space) - (function :tag "Other function")) - :group 'eshell-hist) + (function :tag "Other function"))) (put 'eshell-input-filter 'risky-local-variable t) @@ -138,31 +131,26 @@ whitespace." Otherwise, typing and will always go to the next history element, regardless of any text on the command line. In that case, and still offer that functionality." - :type 'boolean - :group 'eshell-hist) + :type 'boolean) (defcustom eshell-hist-move-to-end t "If non-nil, move to the end of the buffer before cycling history." - :type 'boolean - :group 'eshell-hist) + :type 'boolean) (defcustom eshell-hist-event-designator "^!\\(!\\|-?[0-9]+\\|\\??[^:^$%*?]+\\??\\|#\\)" "The regexp used to identifier history event designators." - :type 'regexp - :group 'eshell-hist) + :type 'regexp) (defcustom eshell-hist-word-designator "^:?\\([0-9]+\\|[$^%*]\\)?\\(-[0-9]*\\|[$^%*]\\)?" "The regexp used to identify history word designators." - :type 'regexp - :group 'eshell-hist) + :type 'regexp) (defcustom eshell-hist-modifier "^\\(:\\([hretpqx&g]\\|s/\\([^/]*\\)/\\([^/]*\\)/\\)\\)*" "The regexp used to identity history modifiers." - :type 'regexp - :group 'eshell-hist) + :type 'regexp) (defcustom eshell-hist-rebind-keys-alist '(([(control ?p)] . eshell-previous-input) @@ -180,8 +168,7 @@ element, regardless of any text on the command line. In that case, "History keys to bind differently if point is in input text." :type '(repeat (cons (vector :tag "Keys to bind" (repeat :inline t sexp)) - (function :tag "Command"))) - :group 'eshell-hist) + (function :tag "Command")))) ;;; Internal Variables: @@ -308,7 +295,6 @@ Returns nil if INPUT is prepended by blank space, otherwise non-nil." (add-hook 'kill-emacs-hook #'eshell-save-some-history) - (make-local-variable 'eshell-input-filter-functions) (add-hook 'eshell-input-filter-functions #'eshell-add-to-history nil t)) (defun eshell-save-some-history () diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 68aa680327..937b8bfa39 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -1007,18 +1007,17 @@ Show wall-clock time elapsed during execution of COMMAND.") (throw 'eshell-replace-command (eshell-parse-command "*diff" orig-args)))) (when (fboundp 'diff-mode) - (make-local-variable 'compilation-finish-functions) (add-hook 'compilation-finish-functions - `(lambda (buff msg) + (lambda (buff _msg) (with-current-buffer buff (diff-mode) - (set (make-local-variable 'eshell-diff-window-config) - ,config) - (local-set-key [?q] 'eshell-diff-quit) + (set (make-local-variable 'eshell-diff-window-config) config) + (local-set-key [?q] #'eshell-diff-quit) (if (fboundp 'turn-on-font-lock-if-enabled) (turn-on-font-lock-if-enabled)) - (goto-char (point-min)))))) + (goto-char (point-min)))) + nil t)) (pop-to-buffer (current-buffer)))))) nil) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 8a88e0e6e6..7984998d21 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -365,7 +365,7 @@ textual parts.") (mm-disable-multibyte) (buffer-disable-undo) (gnus-add-buffer) - (set (make-local-variable 'after-change-functions) nil) + (set (make-local-variable 'after-change-functions) nil) ;FIXME: Why? (set (make-local-variable 'nnimap-object) (make-nnimap :server (nnoo-current-server 'nnimap) :initial-resync 0)) diff --git a/lisp/ielm.el b/lisp/ielm.el index b3654b91d3..91d025dd5d 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -533,9 +533,10 @@ Customized bindings may be defined in `ielm-map', which currently contains: (set (make-local-variable 'paragraph-start) comint-prompt-regexp) (setq comint-input-sender 'ielm-input-sender) (setq comint-process-echoes nil) - (set (make-local-variable 'completion-at-point-functions) - '(comint-replace-by-expanded-history - ielm-complete-filename elisp-completion-at-point)) + (dolist (f '(elisp-completion-at-point + ielm-complete-filename + comint-replace-by-expanded-history)) + (add-hook 'completion-at-point-functions f nil t)) (add-hook 'eldoc-documentation-functions #'elisp-eldoc-var-docstring nil t) (add-hook 'eldoc-documentation-functions diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 86084b03f4..2c972ee7aa 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -1492,8 +1492,7 @@ If so restore the actual mbox message collection." (setq require-final-newline nil) (make-local-variable 'version-control) (setq version-control 'never) - (make-local-variable 'kill-buffer-hook) - (add-hook 'kill-buffer-hook 'rmail-mode-kill-summary) + (add-hook 'kill-buffer-hook #'rmail-mode-kill-summary nil t) (make-local-variable 'file-precious-flag) (setq file-precious-flag t) (make-local-variable 'desktop-save-buffer) diff --git a/lisp/net/secrets.el b/lisp/net/secrets.el index dc1b468a11..f98ded4b0c 100644 --- a/lisp/net/secrets.el +++ b/lisp/net/secrets.el @@ -795,8 +795,8 @@ In this mode, widgets represent the search results. (set (make-local-variable 'revert-buffer-function) #'secrets-show-collections) ;; When we toggle, we must set temporary widgets. - (set (make-local-variable 'tree-widget-after-toggle-functions) - '(secrets-tree-widget-after-toggle-function))) + (add-hook 'tree-widget-after-toggle-functions + #'secrets-tree-widget-after-toggle-function nil t)) ;; It doesn't make sense to call it interactively. (put 'secrets-mode 'disabled t) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 3220e51605..a040508553 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -2143,8 +2143,7 @@ Removes smb prompt. Returns nil if an error message has appeared." "%s %s" tramp-smb-winexe-shell-command tramp-smb-winexe-shell-command-switch)) - (set (make-local-variable 'kill-buffer-hook) - '(tramp-smb-kill-winexe-function)) + (add-hook 'kill-buffer-hook #'tramp-smb-kill-winexe-function nil t) ;; Suppress "^M". Shouldn't we specify utf8? (set-process-coding-system (tramp-get-connection-process vec) 'raw-text-dos) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 53b654001e..d6feba254b 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -4011,8 +4011,8 @@ Argument OUTPUT is a string with the output from the comint process." "Setup pdb tracking in current buffer." (make-local-variable 'python-pdbtrack-buffers-to-kill) (make-local-variable 'python-pdbtrack-tracked-buffer) - (add-to-list (make-local-variable 'comint-input-filter-functions) - #'python-pdbtrack-comint-input-filter-function) + (add-hook 'comint-input-filter-functions + #'python-pdbtrack-comint-input-filter-function nil t) (add-to-list (make-local-variable 'comint-output-filter-functions) #'python-pdbtrack-comint-output-filter-function) (add-function :before (process-sentinel (get-buffer-process (current-buffer))) diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el index d0a83fd7c4..fe7724d902 100644 --- a/lisp/vc/smerge-mode.el +++ b/lisp/vc/smerge-mode.el @@ -1352,24 +1352,26 @@ buffer names." ;; Do a few further adjustments and take precautions for exit. (set (make-local-variable 'smerge-ediff-windows) config) (set (make-local-variable 'smerge-ediff-buf) buf) - (set (make-local-variable 'ediff-quit-hook) - (lambda () - (let ((buffer-A ediff-buffer-A) - (buffer-B ediff-buffer-B) - (buffer-C ediff-buffer-C) - (buffer-Ancestor ediff-ancestor-buffer) - (buf smerge-ediff-buf) - (windows smerge-ediff-windows)) - (ediff-cleanup-mess) - (with-current-buffer buf - (erase-buffer) - (insert-buffer-substring buffer-C) - (kill-buffer buffer-A) - (kill-buffer buffer-B) - (kill-buffer buffer-C) - (when (bufferp buffer-Ancestor) (kill-buffer buffer-Ancestor)) - (set-window-configuration windows) - (message "Conflict resolution finished; you may save the buffer"))))) + (add-hook 'ediff-quit-hook + (lambda () + (let ((buffer-A ediff-buffer-A) + (buffer-B ediff-buffer-B) + (buffer-C ediff-buffer-C) + (buffer-Ancestor ediff-ancestor-buffer) + (buf smerge-ediff-buf) + (windows smerge-ediff-windows)) + (ediff-cleanup-mess) + (with-current-buffer buf + (erase-buffer) + (insert-buffer-substring buffer-C) + (kill-buffer buffer-A) + (kill-buffer buffer-B) + (kill-buffer buffer-C) + (when (bufferp buffer-Ancestor) + (kill-buffer buffer-Ancestor)) + (set-window-configuration windows) + (message "Conflict resolution finished; you may save the buffer")))) + nil t) (message "Please resolve conflicts now; exit ediff when done"))) (defun smerge-makeup-conflict (pt1 pt2 pt3 &optional pt4) diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 99bf5bf9b6..932b9158f2 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -138,7 +138,9 @@ preserve the setting." ;; Variables the user doesn't need to know about. (defvar vc-log-operation nil) -(defvar vc-log-after-operation-hook nil) +(defvar vc-log-after-operation-hook nil + "Name of the hook run at the end of `vc-finish-logentry'. +BEWARE: Despite its name, this variable is not itself a hook!") (defvar vc-log-fileset) ;; In a log entry buffer, this is a local variable commit 9bcdebd9b7432dbdc826579c9a9ec725bbd70d53 Author: Eric Abrahamsen Date: Sat Oct 31 18:30:57 2020 -0700 Remove gmane search engine Remove the gnus-search-gmane class and all associated methods. If search functionality is ever resurrected, then revert this commit. * lisp/gnus/gnus-search.el: Delete code, and remove from default value of `gnus-search-default-engines'. diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 3ca81f304a..81be7c588f 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -825,9 +825,6 @@ quirks.") gnus-search-grep) nil) -(defclass gnus-search-gmane (gnus-search-engine gnus-search-process) - nil) - ;;; The "indexed" search engine. These are engines that use an ;;; external program, with indexes kept on disk, to search messages ;;; usually kept in some local directory. The three common slots are @@ -970,8 +967,7 @@ quirks.") (define-obsolete-variable-alias 'nnir-method-default-engines 'gnus-search-default-engines "28.1") -(defcustom gnus-search-default-engines '((nnimap gnus-search-imap) - (nntp gnus-search-gmane)) +(defcustom gnus-search-default-engines '((nnimap gnus-search-imap)) "Alist of default search engines keyed by server method." :version "26.1" :group 'gnus-search @@ -1921,77 +1917,6 @@ Assume \"size\" key is equal to \"larger\"." artlist))) grouplist)))) -(declare-function mm-url-insert "mm-url" (url &optional follow-refresh)) -(declare-function mm-url-encode-www-form-urlencoded "mm-url" (pairs)) - -;; gmane interface -(cl-defmethod gnus-search-run-search ((engine gnus-search-gmane) - srv query &optional groups) - "Run a search against a gmane back-end server." - (let* ((case-fold-search t) - (groupspec (mapconcat - (lambda (x) - (if (string-match-p "gmane" x) - (format "group:%s" (gnus-group-short-name x)) - (error "Can't search non-gmane groups: %s" x))) - groups " ")) - (buffer (slot-value engine 'proc-buffer)) - (search (concat (gnus-search-make-query-string engine query) - " " - groupspec)) - (gnus-inhibit-demon t) - artlist) - (require 'mm-url) - (with-current-buffer buffer - (erase-buffer) - (mm-url-insert - (concat - "http://search.gmane.org/nov.php" - "?" - (mm-url-encode-www-form-urlencoded - `(("query" . ,search) - ("HITSPERPAGE" . "999"))))) - (set-buffer-multibyte t) - (decode-coding-region (point-min) (point-max) 'utf-8) - (goto-char (point-min)) - (forward-line 1) - (while (not (eobp)) - (unless (or (eolp) (looking-at "\x0d")) - (let ((header (nnheader-parse-nov))) - (let ((xref (mail-header-xref header)) - (xscore (string-to-number (cdr (assoc 'X-Score - (mail-header-extra header)))))) - (when (string-match " \\([^:]+\\)[:/]\\([0-9]+\\)" xref) - (push - (vector - (gnus-group-prefixed-name (match-string 1 xref) srv) - (string-to-number (match-string 2 xref)) xscore) - artlist))))) - (forward-line 1))) - (apply #'vector (nreverse (delete-dups artlist))))) - -(cl-defmethod gnus-search-transform-expression ((_e gnus-search-gmane) - (_expr (head near))) - nil) - -;; Can Gmane handle OR or NOT keywords? -(cl-defmethod gnus-search-transform-expression ((_e gnus-search-gmane) - (_expr (head or))) - nil) - -(cl-defmethod gnus-search-transform-expression ((_e gnus-search-gmane) - (_expr (head not))) - nil) - -(cl-defmethod gnus-search-transform-expression ((_e gnus-search-gmane) - (expr list)) - "The only keyword value gmane can handle is author, ie from." - (cond - ((memq (car expr) '(from sender author address)) - (format "author:%s" (cdr expr))) - ((eql (car expr) 'body) - (cdr expr)))) - ;;; Util Code: (defun gnus-search-run-query (specs) commit 0328b21d1e44f0b5ec2001e2347743ec69159260 Author: Eric Abrahamsen Date: Fri Oct 16 09:34:06 2020 -0700 Move nnir.el to lisp/obsolete * lisp/obsolete/nnir.el: This is no longer used, but users might still be requiring it. diff --git a/lisp/gnus/nnir.el b/lisp/obsolete/nnir.el similarity index 100% rename from lisp/gnus/nnir.el rename to lisp/obsolete/nnir.el commit 7fad12c59b3c65665c10050e800d1d7ad5a2e056 Author: Eric Abrahamsen Date: Wed Oct 14 21:39:46 2020 -0700 New gnus-search library This library provides a fundamental reworking of the search functionality previously found in nnir.el. It uses class-based search engines to interface with external searching facilities, and a parsed search query syntax that can search multiple engines. * lisp/gnus/gnus-search.el: New library containing search functionality for Gnus. * doc/misc/gnus.texi: Document. * lisp/gnus/gnus-group.el (gnus-group-make-search-group, gnus-group-read-ephemeral-search-group): Remove references to nnir, change meaning of prefix argument, change values of nnselect-function and nnselect-args. * lisp/gnus/nnselect.el: Replace references to nnir (nnselect-request-article): Use gnus-search functions, and search criteria. (nnselect-request-thread, nnselect-search-thread): Use gnus-search thread search. (gnus-summary-make-search-group): Switch to use gnus-search function and arguments. * test/lisp/gnus/search-tests.el: Tests for new functionality. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 69ac05d5aa..340fc69dbb 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -795,19 +795,11 @@ Advanced Scoring Searching -* nnir:: Searching with various engines. +* Search Engines:: Selecting and configuring search engines. +* Creating Search Groups:: Creating search groups. +* Search Queries:: Gnus' built-in search syntax. * nnmairix:: Searching with Mairix. -nnir - -* What is nnir?:: What does nnir do. -* Basic Usage:: How to perform simple searches. -* Setting up nnir:: How to set up nnir. - -Setting up nnir - -* Associating Engines:: How to associate engines. - Various * Process/Prefix:: A convention used by many treatment commands. @@ -17919,12 +17911,11 @@ Or we may wish to create a group from the results of a search query: @lisp (nnselect-specs - (nnselect-function . nnir-run-query) + (nnselect-function . gnus-search-run-query) (nnselect-args - (nnir-query-spec - (query . "FLAGGED") - (criteria . "")) - (nnir-group-spec + (search-query-spec + (query . "mark:flag")) + (search-group-spec ("nnimap:home") ("nnimap:work")))) @end lisp @@ -17945,9 +17936,8 @@ find all message that have been received recently from certain groups: (days-to-time (car args))))) (cons 'criteria ""))) (group-spec (cadr args))) - (nnir-run-query (cons 'nnir-specs - (list (cons 'nnir-query-spec query-spec) - (cons 'nnir-group-spec group-spec)))))) + (gnus-search-run-query (list (cons 'search-query-spec query-spec) + (cons 'search-group-spec group-spec)))))) @end lisp Then the following @code{nnselect-specs}: @@ -17970,18 +17960,13 @@ parameter of @code{nnselect-rescan} will allow automatic refreshing. A refresh can always be invoked manually through @code{gnus-group-get-new-news-this-group}. -The nnir interface (@pxref{nnir}) includes engines for searching a -variety of backends. While the details of each search engine vary, -the result of an nnir search is always a vector of the sort used by -the nnselect method, and the results of nnir queries are usually -viewed using an nnselect group. Indeed the standard search function -@code{gnus-group-read-ephemeral-search-group} just creates an -ephemeral nnselect group with the appropriate nnir query as the -@code{nnselect-specs}. nnir originally included both the search -engines and the glue to connect search results to gnus. Over time -this glue evolved into the nnselect method. The two had a mostly -amicable parting so that nnselect could pursue its dream of becoming a -fully functioning backend, but occasional conflicts may still linger. +Gnus includes engines for searching a variety of backends. While the +details of each search engine vary, the result of a search is always a +vector of the sort used by the nnselect method, and the results of +queries are usually viewed using an nnselect group. Indeed the +standard search function @code{gnus-group-read-ephemeral-search-group} +just creates an ephemeral nnselect group with the appropriate search +query as the @code{nnselect-specs}. @node Combined Groups @subsection Combined Groups @@ -21445,9 +21430,6 @@ four days, Gnus will decay the scores four times, for instance. @chapter Searching @cindex searching -FIXME: A brief comparison of nnir, nnmairix, contrib/gnus-namazu would -be nice. - Gnus has various ways of finding articles that match certain criteria (from a particular author, on a certain subject, etc.). The simplest method is to enter a group and then either "limit" the summary buffer @@ -21455,50 +21437,166 @@ to the desired articles using the limiting commands (@pxref{Limiting}), or searching through messages in the summary buffer (@pxref{Searching for Articles}). -Limiting commands and summary buffer searching work on subsets of the -articles already fetched from the servers, and these commands won't -query the server for additional articles. While simple, these methods -are therefore inadequate if the desired articles span multiple groups, -or if the group is so large that fetching all articles is impractical. -Many backends (such as imap, notmuch, namazu, etc.) provide their own -facilities to search for articles directly on the server and Gnus can -take advantage of these methods. This chapter describes tools for -searching groups and servers for articles matching a query. +Limiting commands and summary buffer searching work on articles +already fetched from the servers, and these commands won't query the +server for additional articles. While simple, these methods are +therefore inadequate if the desired articles span multiple groups, or +if the group is so large that fetching all articles is impractical. + +It's possible to search a backend more thoroughly using an associated +search engine. Some backends come with their own search engine: IMAP +servers, for instance, do their own searching. Other backends, for +example a local @code{nnmaildir} installation, might require the user +to manually set up some sort of search indexing. Default associations +between backends and engines can be defined in +@code{gnus-search-default-engines}, and engines can also be defined on +a per-backend basis (@pxref{Search Engines}). + +Once the search engines are set up, you can search for messages in +groups from one or more backends, and show the results in a group. +The groups that hold search results are created on the nnselect +backend, and can be either ephemeral or persistent (@pxref{Creating +Search Groups}). + +@vindex gnus-search-use-parsed-queries +Search queries can be specified one of two ways: either using the +syntax of the engine responsible for the group you're searching, or +using Gnus' generalized search syntax. Set the option +@code{gnus-search-use-parsed-queries} to a non-nil value to used the +generalized syntax. The advantage of this syntax is that, if you have +multiple backends indexed by different engines, you don't need to +remember which one you're searching---it's also possible to issue the +same query against multiple groups, indexed by different engines, at +the same time. It also provides a few other conveniences including +relative date parsing and tie-ins into other Emacs packages. For +details on Gnus' query language, see @ref{Search Queries}. @menu -* nnir:: Searching with various engines. -* nnmairix:: Searching with Mairix. +* Search Engines:: Selecting and configuring search engines. +* Creating Search Groups:: How and where. +* Search Queries:: Gnus' built-in search syntax. +* nnmairix:: Searching with Mairix. @end menu -@node nnir -@section nnir -@cindex nnir +@node Search Engines +@section Search Engines +@cindex search engines +@cindex configuring search + +In order to search for messages from any given server, that server +must have a search engine associated with it. IMAP servers do their +own searching (theoretically it is possible to use a different engine +to search an IMAP store, but we don't recommend it), but in all other +cases the user will have to manually specify an engine to use. This +can be done at two different levels: by server type, or on a +per-server basis. + +@vindex gnus-search-default-engines +The option @code{gnus-search-default-engines} assigns search engines +by server type. Its value is an alist mapping symbols indicating a +server type (e.g.@: @code{nnmaildir} or @code{nnml}) to symbols +indicating a search engine class. The built-in search engine symbols +are: + +@itemize +@item +@code{gnus-search-imap} -This section describes how to use @code{nnir} to search for articles -within gnus. +@item +@code{gnus-search-find-grep} -@menu -* What is nnir?:: What does @code{nnir} do? -* Basic Usage:: How to perform simple searches. -* Setting up nnir:: How to set up @code{nnir}. -@end menu +@item +@code{gnus-search-notmuch} -@node What is nnir? -@subsection What is nnir? +@item +@code{gnus-search-swish-e} -@code{nnir} is a Gnus interface to a number of tools for searching -through mail and news repositories. Different backends (like -@code{nnimap} and @code{nntp}) work with different tools (called -@dfn{engines} in @code{nnir} lingo), but all use the same basic search -interface. +@item +@code{gnus-search-swish++} + +@item +@code{gnus-search-mairix} + +@item +@code{gnus-search-namazu} +@end itemize + +If you need more granularity, you can specify a search engine in the +server definition, using the @code{gnus-search-engine} key, whether +that be in your @file{.gnus.el} config file, or through Gnus' server +buffer. That might look like: -The @code{nnimap} search engine should work with no configuration. -Other engines may require a local index that needs to be created and -maintained outside of Gnus. +@example +'(nnmaildir "My Mail" + (directory "/home/user/.mail") + (gnus-search-engine gnus-search-notmuch + (config-file "/home/user/.mail/.notmuch_config"))) +@end example +Search engines like notmuch, namazu and mairix are similar in +behavior: they use a local executable to create an index of a message +store, and run command line search queries against those messages, +and return a list of absolute file names of matching messages. -@node Basic Usage -@subsection Basic Usage +These engines have a handful of configuration parameters in common. +These common parameters are: + +@table @code +@item program +The name of the executable. Defaults to the plain +program name such as @command{notmuch} or @command{namazu}. + +@item config-file +The absolute filename of the configuration file for this search +engine. + +@item remove-prefix +The directory part to be removed from the filenames returned by the +search query. This absolute path should include everything up to the +top level of the message store. + +@item switches +Additional command-line switches to be fed to the search program. The +value of this parameter must be a list of strings, one string per +switch. +@end table + +The options above can be set in one of two ways: using a customization +option that is set for all engines of that type, or on a per-engine +basis in your server configuration files. + +The customization options are formed on the pattern +@code{gnus-search-@var{engine}-@var{parameter}}. For instance, to use a +non-standard notmuch program, you might set +@code{gnus-search-notmuch-program} to @file{/usr/local/bin/notmuch}. +This would apply to all notmuch engines. The engines that use these +options are: ``notmuch'', ``namazu'', ``mairix'', ``swish-e'' and +``swish++''. + +Alternately, the options can be set directly on your Gnus server +definitions, for instance, in the @code{nnmaildir} example above. +Note that the server options are part of the @code{gnus-search-engine} +sexp, and the option symbol and value form a two-element list, not a +cons cell. + +The namazu and swish-e engines each have one additional option, +specifying where to store their index files. For namazu it is +@code{index-directory}, and should be a single directory path. For +swish-e it is @code{index-files}, and should be a list of strings. + +All indexed search engines come with their own method of updating +their search indexes to include newly-arrived messages. Gnus +currently provides no convenient interface for this, and you'll have +to manage updates yourself, though this will likely change in the +future. + +Lastly, all search engines accept a @code{raw-queries-p} option. This +indicates that engines of this type (or this particular engine) should +always use raw queries, never parsed (@pxref{Search Queries}). + +@node Creating Search Groups +@section Creating Search Groups +@cindex creating search groups In the group buffer typing @kbd{G G} will search the group on the current line by calling @code{gnus-group-read-ephemeral-search-group}. @@ -21525,297 +21623,133 @@ in their original group. You can @emph{warp} (i.e., jump) to the original group for the article on the current line with @kbd{A W}, aka @code{gnus-warp-to-article}. -You say you want to search more than just the group on the current line? -No problem: just process-mark the groups you want to search. You want -even more? Calling for an nnir search with the cursor on a topic heading -will search all the groups under that heading. +You say you want to search more than just the group on the current +line? No problem: just process-mark the groups you want to search. +You want even more? Initiating a search with the cursor on a topic +heading will search all the groups under that topic. +@vindex gnus-search-ignored-newsgroups Still not enough? OK, in the server buffer -@code{gnus-group-read-ephemeral-search-group} (now bound to @kbd{G}) +@code{gnus-group-read-ephemeral-search-group} (here bound to @kbd{G}) will search all groups from the server on the current line. Too much? Want to ignore certain groups when searching, like spam groups? Just -customize @code{nnir-ignored-newsgroups}. - -One more thing: individual search engines may have special search -features. You can access these special features by giving a -prefix-arg to @code{gnus-group-read-ephemeral-search-group}. If you -are searching multiple groups with different search engines you will -be prompted for the special search features for each engine -separately. - - -@node Setting up nnir -@subsection Setting up nnir - -To set up nnir you may need to do some prep work. Firstly, you may -need to configure the search engines you plan to use. Some of them, -like @code{imap}, need no special configuration. Others, like -@code{namazu} and @code{swish}, require configuration as described -below. Secondly, you need to associate a search engine with a server -or a backend. - -If you just want to use the @code{imap} engine to search @code{nnimap} -servers then you don't have to do anything. But you might want to -read the details of the query language anyway. - -@menu -* Associating Engines:: How to associate engines. -* The imap Engine:: Imap configuration and usage. -* The swish++ Engine:: Swish++ configuration and usage. -* The swish-e Engine:: Swish-e configuration and usage. -* The namazu Engine:: Namazu configuration and usage. -* The notmuch Engine:: Notmuch configuration and usage. -* The hyrex Engine:: Hyrex configuration and usage. -* Customizations:: User customizable settings. -@end menu - -@node Associating Engines -@subsubsection Associating Engines - - -When searching a group, @code{nnir} needs to know which search engine to -use. You can configure a given server to use a particular engine by -setting the server variable @code{nnir-search-engine} to the engine -name. For example to use the @code{namazu} engine to search the server -named @code{home} you can use - -@lisp -(setq gnus-secondary-select-methods - '((nnml "home" - (nnimap-address "localhost") - (nnir-search-engine namazu)))) -@end lisp - -Alternatively you might want to use a particular engine for all servers -with a given backend. For example, you might want to use the @code{imap} -engine for all servers using the @code{nnimap} backend. In this case you -can customize the variable @code{nnir-method-default-engines}. This is -an alist of pairs of the form @code{(backend . engine)}. By default this -variable is set to use the @code{imap} engine for all servers using the -@code{nnimap} backend. But if you wanted to use @code{namazu} for all -your servers with an @code{nnimap} backend you could change this to - -@lisp -'((nnimap . namazu)) -@end lisp - -@node The imap Engine -@subsubsection The imap Engine - -The @code{imap} engine requires no configuration. - -Queries using the @code{imap} engine follow a simple query language. -The search is always case-insensitive and supports the following -features (inspired by the Google search input language): - -@table @samp - -@item Boolean query operators -AND, OR, and NOT are supported, and parentheses can be used to control -operator precedence, e.g., (emacs OR xemacs) AND linux. Note that -operators must be written with all capital letters to be -recognized. Also preceding a term with a @minus{} sign is equivalent -to NOT term. - -@item Automatic AND queries -If you specify multiple words then they will be treated as an AND -expression intended to match all components. - -@item Phrase searches -If you wrap your query in double-quotes then it will be treated as a -literal string. - -@end table - -By default the whole message will be searched. The query can be limited -to a specific part of a message by using a prefix-arg. After inputting -the query this will prompt (with completion) for a message part. -Choices include ``Whole message'', ``Subject'', ``From'', and -``To''. Any unrecognized input is interpreted as a header name. For -example, typing @kbd{Message-ID} in response to this prompt will limit -the query to the Message-ID header. - -Finally selecting ``Imap'' will interpret the query as a raw -@acronym{IMAP} search query. The format of such queries can be found in -RFC3501. - -If you don't like the default of searching whole messages you can -customize @code{nnir-imap-default-search-key}. For example to use -@acronym{IMAP} queries by default - -@lisp -(setq nnir-imap-default-search-key "Imap") -@end lisp - -@node The swish++ Engine -@subsubsection The swish++ Engine - -FIXME: Say something more here. - -Documentation for swish++ may be found at the swish++ sourceforge page: -@uref{http://swishplusplus.sourceforge.net} - -@table @code - -@item nnir-swish++-program -The name of the swish++ executable. Defaults to @code{search} - -@item nnir-swish++-additional-switches -A list of strings to be given as additional arguments to -swish++. @code{nil} by default. - -@item nnir-swish++-remove-prefix -The prefix to remove from each file name returned by swish++ in order -to get a group name. By default this is @code{$HOME/Mail}. - -@end table - -@node The swish-e Engine -@subsubsection The swish-e Engine - -FIXME: Say something more here. - -@table @code - -@item nnir-swish-e-program -The name of the swish-e search program. Defaults to @code{swish-e}. - -@item nnir-swish-e-additional-switches -A list of strings to be given as additional arguments to -swish-e. @code{nil} by default. - -@item nnir-swish-e-remove-prefix -The prefix to remove from each file name returned by swish-e in order -to get a group name. By default this is @code{$HOME/Mail}. - -@end table - -@node The namazu Engine -@subsubsection The namazu Engine - -Using the namazu engine requires creating and maintaining index files. -One directory should contain all the index files, and nnir must be told -where to find them by setting the @code{nnir-namazu-index-directory} -variable. - -To work correctly the @code{nnir-namazu-remove-prefix} variable must -also be correct. This is the prefix to remove from each file name -returned by Namazu in order to get a proper group name (albeit with @samp{/} -instead of @samp{.}). - -For example, suppose that Namazu returns file names such as -@samp{/home/john/Mail/mail/misc/42}. For this example, use the -following setting: @code{(setq nnir-namazu-remove-prefix -"/home/john/Mail/")} Note the trailing slash. Removing this prefix from -the directory gives @samp{mail/misc/42}. @code{nnir} knows to remove -the @samp{/42} and to replace @samp{/} with @samp{.} to arrive at the -correct group name @samp{mail.misc}. - -Extra switches may be passed to the namazu search command by setting the -variable @code{nnir-namazu-additional-switches}. It is particularly -important not to pass any switches to namazu that will change the -output format. Good switches to use include @option{--sort}, -@option{--ascending}, @option{--early} and @option{--late}. -Refer to the Namazu documentation for further -information on valid switches. - -Mail must first be indexed with the @command{mknmz} program. Read the -documentation for namazu to create a configuration file. Here is an -example: - -@cartouche -@example - package conf; # Don't remove this line! - - # Paths which will not be indexed. Don't use '^' or '$' anchors. - $EXCLUDE_PATH = "spam|sent"; - - # Header fields which should be searchable. case-insensitive - $REMAIN_HEADER = "from|date|message-id|subject"; - - # Searchable fields. case-insensitive - $SEARCH_FIELD = "from|date|message-id|subject"; - - # The max length of a word. - $WORD_LENG_MAX = 128; - - # The max length of a field. - $MAX_FIELD_LENGTH = 256; -@end example -@end cartouche - -For this example, mail is stored in the directories @samp{~/Mail/mail/}, -@samp{~/Mail/lists/} and @samp{~/Mail/archive/}, so to index them go to -the index directory set in @code{nnir-namazu-index-directory} and issue -the following command: +customize @code{gnus-search-ignored-newsgroups}: groups matching this +regexp will not be searched. + +@node Search Queries +@section Search Queries +@cindex search queries +@cindex search syntax + +Gnus provides an optional unified search syntax that can be used +across all supported search engines. This can be convenient in that +you don't have to remember different search syntaxes; it's also +possible to mark multiple groups indexed by different engines and +issue a single search against them. + +@vindex gnus-search-use-parsed-queries +Set the option @code{gnus-search-use-parsed-queries} to non-@code{nil} +to enable this---it is @code{nil} by default. Even if it is +non-@code{nil}, it's still possible to turn off parsing for a class of +engines or a single engine (@pxref{Search Engines}), or a single +search by giving a prefix argument to any of the search commands. + +The search syntax is fairly simple: keys and values are separated by a +colon, multi-word values must be quoted, ``and'' is implicit, ``or'' +is explicit, ``not'' will negate the following expression (or keys can +be prefixed with a ``-''),and parentheses can be used to group logical +sub-clauses. For example: @example -mknmz --mailnews ~/Mail/archive/ ~/Mail/mail/ ~/Mail/lists/ +(from:john or from:peter) subject:"lunch tomorrow" since:3d @end example -For maximum searching efficiency you might want to have a cron job run -this command periodically, say every four hours. +The syntax is made to be accepted by a wide range of engines, and thus +will happily accept most input, valid or not. Some terms will only be +meaningful to some engines; other engines will drop them silently. +Key completion is offered on @key{TAB}, but it's also possible to +enter the query with abbreviated keys, which will be expanded during +parsing. If a key is abbreviated to the point of ambiguity (for +instance, ``s:'' could be ``subject:'' or ``since:''), an error will +be raised. -@node The notmuch Engine -@subsubsection The notmuch Engine - -@table @code -@item nnir-notmuch-program -The name of the notmuch search executable. Defaults to -@samp{notmuch}. - -@item nnir-notmuch-additional-switches -A list of strings, to be given as additional arguments to notmuch. - -@item nnir-notmuch-remove-prefix -The prefix to remove from each file name returned by notmuch in order -to get a group name (albeit with @samp{/} instead of @samp{.}). This -is a regular expression. - -@item nnir-notmuch-filter-group-names-function -A function used to transform the names of groups being searched in, -for use as a ``path:'' search keyword for notmuch. If nil, the -default, ``path:'' keywords are not used. Otherwise, this should be a -callable which accepts a single group name and returns a transformed -name as notmuch expects to see it. In many mail backends, for -instance, dots in group names must be converted to forward slashes: to -achieve this, set this option to -@example -(lambda (g) (replace-regexp-in-string "\\." "/" g)) -@end example +Supported keys include all the usual mail headers: ``from'', +``subject'', ``cc'', etc. Other keys are: +@table @samp +@item body +The body of the message. +@item recipient +Equivalent to @samp{to or cc or bcc}. +@item address +Equivalent to @samp{from or recipient}. +@item id +The keys @samp{message-id} and @samp{id} are equivalent. +@item mark +Accepts @samp{flag}, @samp{seen}, @samp{read} or @samp{replied}, or +any of Gnus' single-letter representations of those marks, e.g.@: +@samp{mark:R} for @samp{read}. +@item tag +This is interpreted as @samp{keyword} for IMAP and @samp{tag} for +notmuch. +@item attachment +Matches the attachment file name. +@item before +Date is exclusive; see below for date parsing. +@item after +Date is inclusive; can also use @samp{since}. +@item thread +Return entire message threads, not just individual messages. +@item raw +Do not parse this particular search. +@item limit +Limit the results to this many messages. When searching multiple +groups this may give undesired results, as the limiting happens before +sorting. +@item grep +Only applicable to ``local index'' engines such as mairix or notmuch. +On systems with a grep command, additionally filter the results by +using the value of this term as a grep regexp. @end table +@vindex gnus-search-contact-tables +Elisp-based contact management packages (e.g.@: BBDB or EBDB) can push +completion tables onto the variable @code{gnus-search-contact-tables}, +allowing auto-completion of contact names and addresses for keys like +@samp{from} or @samp{to}. -@node The hyrex Engine -@subsubsection The hyrex Engine -This engine is obsolete. +@subsection Date value parsing -@node Customizations -@subsubsection Customizations +@vindex gnus-search-date-keys +Date-type keys (see @code{gnus-search-date-keys}) will accept a wide +variety of values. First, anything that @code{parse-time-string} can +parse is acceptable. Dates with missing values will be interpreted as +the most recent occurrence thereof: for instance ``march 03'' is the +most recent March 3rd. Lastly, it's possible to use relative +specifications, such as ``3d'' (three days ago). This format also accepts +w, m and y. -@table @code +When creating persistent search groups, the search is saved unparsed, +and re-parsed every time the group is updated. So a permanent search +group with a query like: -@item nnir-method-default-engines -Alist of pairs of server backends and search engines. The default -association is @example -(nnimap . imap) +from:"my boss" mark:flag since:1w @end example -@item nnir-ignored-newsgroups -A regexp to match newsgroups in the active file that should be skipped -when searching all groups on a server. - -@end table - +would always contain only messages from the past seven days. @node nnmairix @section nnmairix @cindex mairix @cindex nnmairix + +This section is now mostly obsolete, as mairix can be used as a regular +search engine, including persistent search groups, with +@code{nnselect}. + This paragraph describes how to set up mairix and the back end @code{nnmairix} for indexing and searching your mail from within Gnus. Additionally, you can create permanent ``smart'' groups which are diff --git a/etc/NEWS b/etc/NEWS index fc90843c73..d15f3ed1ae 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -454,7 +454,13 @@ tags to be considered as well. ** Gnus +++ -*** New value for user option 'smiley-style'. +*** New gnus-search library +A new unified search syntax which can be used across multiple +supported search engines. Set 'gnus-search-use-parsed-queries' to +non-nil to enable. + ++++ +*** New value for user option 'smiley-style' Smileys can now be rendered with emojis instead of small images when using the new 'emoji' value in 'smiley-style'. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 1d614f8a8d..c6f7e1c41a 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -3165,29 +3165,27 @@ mail messages or news articles in files that have numeric names." (gnus-group-real-name group) (list 'nndir (gnus-group-real-name group) (list 'nndir-directory dir))))) - -(autoload 'nnir-read-parms "nnir") -(autoload 'nnir-server-to-search-engine "nnir") (autoload 'gnus-group-topic-name "gnus-topic") +(autoload 'gnus-search-make-spec "gnus-search") ;; Temporary to make group creation easier -(defun gnus-group-make-search-group (nnir-extra-parms &optional specs) +(defun gnus-group-make-search-group (no-parse &optional specs) "Make a group based on a search. Prompt for a search query and determine the groups to search as follows: if called from the *Server* buffer search all groups belonging to the server on the current line; if called from the *Group* buffer search any marked groups, or the group on the -current line, or all the groups under the current topic. Calling -with a prefix arg prompts for additional search-engine specific -constraints. A non-nil SPECS arg must be an alist with -`nnir-query-spec' and `nnir-group-spec' keys, and skips all -prompting." +current line, or all the groups under the current topic. A +prefix arg NO-PARSE means that Gnus should not parse the search +query before passing it to the underlying search engine. A +non-nil SPECS arg must be an alist with `search-query-spec' and +`search-group-spec' keys, and skips all prompting." (interactive "P") (let ((name (gnus-read-group "Group name: "))) (with-current-buffer gnus-group-buffer (let* ((group-spec (or - (cdr (assq 'nnir-group-spec specs)) + (cdr (assq 'search-group-spec specs)) (if (gnus-server-server-name) (list (list (gnus-server-server-name))) (seq-group-by @@ -3199,16 +3197,8 @@ prompting." (assoc (gnus-group-topic-name) gnus-topic-alist)))))))) (query-spec (or - (cdr (assq 'nnir-query-spec specs)) - (apply - 'append - (list (cons 'query - (read-string "Query: " nil 'nnir-search-history))) - (when nnir-extra-parms - (mapcar - (lambda (x) - (nnir-read-parms (nnir-server-to-search-engine (car x)))) - group-spec)))))) + (cdr (assq 'search-query-spec specs)) + (gnus-search-make-spec no-parse)))) (gnus-group-make-group name (list 'nnselect "nnselect") @@ -3216,29 +3206,29 @@ prompting." (list (cons 'nnselect-specs (list - (cons 'nnselect-function 'nnir-run-query) + (cons 'nnselect-function 'gnus-search-run-query) (cons 'nnselect-args - (list (cons 'nnir-query-spec query-spec) - (cons 'nnir-group-spec group-spec))))) + (list (cons 'search-query-spec query-spec) + (cons 'search-group-spec group-spec))))) (cons 'nnselect-artlist nil))))))) (define-obsolete-function-alias 'gnus-group-make-nnir-group 'gnus-group-read-ephemeral-search-group "28.1") -(defun gnus-group-read-ephemeral-search-group (nnir-extra-parms &optional specs) +(defun gnus-group-read-ephemeral-search-group (no-parse &optional specs) "Read an nnselect group based on a search. Prompt for a search query and determine the groups to search as follows: if called from the *Server* buffer search all groups belonging to the server on the current line; if called from the *Group* buffer search any marked groups, or the group on the -current line, or all the groups under the current topic. Calling -with a prefix arg prompts for additional search-engine specific -constraints. A non-nil SPECS arg must be an alist with -`nnir-query-spec' and `nnir-group-spec' keys, and skips all -prompting." +current line, or all the groups under the current topic. A +prefix arg NO-PARSE means that Gnus should not parse the search +query before passing it to the underlying search engine. A +non-nil SPECS arg must be an alist with `search-query-spec' and +`search-group-spec' keys, and skips all prompting." (interactive "P") (let* ((group-spec - (or (cdr (assq 'nnir-group-spec specs)) + (or (cdr (assq 'search-group-spec specs)) (if (gnus-server-server-name) (list (list (gnus-server-server-name))) (seq-group-by @@ -3249,16 +3239,8 @@ prompting." (cdr (assoc (gnus-group-topic-name) gnus-topic-alist)))))))) (query-spec - (or (cdr (assq 'nnir-query-spec specs)) - (apply - 'append - (list (cons 'query - (read-string "Query: " nil 'nnir-search-history))) - (when nnir-extra-parms - (mapcar - (lambda (x) - (nnir-read-parms (nnir-server-to-search-engine (car x)))) - group-spec)))))) + (or (cdr (assq 'search-query-spec specs)) + (gnus-search-make-spec no-parse)))) (gnus-group-read-ephemeral-group (concat "nnselect-" (message-unique-id)) (list 'nnselect "nnselect") @@ -3268,10 +3250,10 @@ prompting." (list (cons 'nnselect-specs (list - (cons 'nnselect-function 'nnir-run-query) + (cons 'nnselect-function 'gnus-search-run-query) (cons 'nnselect-args - (list (cons 'nnir-query-spec query-spec) - (cons 'nnir-group-spec group-spec))))) + (list (cons 'search-query-spec query-spec) + (cons 'search-group-spec group-spec))))) (cons 'nnselect-artlist nil))))) (defun gnus-group-add-to-virtual (n vgroup) diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el new file mode 100644 index 0000000000..3ca81f304a --- /dev/null +++ b/lisp/gnus/gnus-search.el @@ -0,0 +1,2231 @@ +;;; gnus-search.el --- Search facilities for Gnus -*- lexical-binding: t; -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; Author: Eric Abrahamsen + +;; This program 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. + +;; This program 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 this program. If not, see . + +;;; Commentary: + +;; This file defines a generalized search language, and search engines +;; that interface with various search programs. It is responsible for +;; parsing the user's search input, sending that query to the search +;; engines, and collecting results. Results are in the form of a +;; vector of vectors, each vector representing a found article. The +;; nnselect backend interprets that value to create a group containing +;; the search results. + +;; This file was formerly known as nnir. Later, the backend parts of +;; nnir became nnselect, and only the search functionality was left +;; here. + +;; See the Gnus manual for details of the search language. Tests are +;; in tests/gnus-search-test.el. + +;; The search parsing routines are responsible for accepting the +;; user's search query as a string and parsing it into a sexp +;; structure. The function `gnus-search-parse-query' is the entry +;; point for that. Once the query is in sexp form, it is passed to +;; the search engines themselves, which are responsible for +;; transforming the query into a form that the external program can +;; understand, and then filtering the search results into a format +;; that nnselect can understand. + +;; The general flow is: + +;; 1. The user calls one of `gnus-group-make-search-group' or +;; `gnus-group-make-permanent-search-group' (or a few other entry +;; points). These functions prompt for a search query, and collect +;; the groups to search, then create an nnselect group, setting an +;; 'nnselect-specs group parameter where 'nnselect-function is +;; `gnus-search-run-query', and 'nnselect-args is the search query and +;; groups to search. + +;; 2. `gnus-search-run-query' is called with 'nnselect-args. It looks +;; at the groups to search, categorizes them by server, and for each +;; server finds the search engine to use. It calls each engine's +;; `gnus-search-run-search' method with the query and groups passed as +;; arguments, and the results are collected and handed off to the +;; nnselect group. + +;; For information on writing new search engines, see the Gnus manual. + +;; TODO: Rewrite the query parser using syntax tables and +;; `parse-partial-sexp'. + +;; TODO: Refactor IMAP search so we can move code that uses nnimap-* +;; functions out into nnimap.el. + +;; TODO: Is there anything we can do about sorting results? + +;; TODO: Provide for returning a result count. This would probably +;; need a completely separate top-level command, since we wouldn't be +;; creating a group at all. + +;; TODO: Do better with handling message size searches. Make sure +;; we're providing for the usual shorthands (kb, M, etc), and that all +;; the engines handle it properly. + +;;; Code: + +(require 'gnus-group) +(require 'gnus-sum) +(require 'message) +(require 'gnus-util) +(require 'eieio) +(eval-when-compile (require 'cl-lib)) +(autoload 'eieio-build-class-alist "eieio-opt") +(autoload 'nnmaildir-base-name-to-article-number "nnmaildir") + +(defvar gnus-inhibit-demon) +(defvar gnus-english-month-names) + +;;; Internal Variables: + +(defvar gnus-search-memo-query nil + "Internal: stores current query.") + +(defvar gnus-search-memo-server nil + "Internal: stores current server.") + +(defvar gnus-search-history () + "Internal history of Gnus searches.") + +(define-error 'gnus-search-parse-error "Gnus search parsing error") + +;;; User Customizable Variables: + +(defgroup gnus-search nil + "Search groups in Gnus with assorted search engines." + :group 'gnus) + +(defcustom gnus-search-use-parsed-queries nil + "When t, use Gnus' generalized search language. +The generalized search language is a search language that can be +used across all search engines that Gnus supports. See the Gnus +manual for details. + +If this option is set to nil, search queries will be passed +directly to the search engines without being parsed or +transformed." + :version "28.1" + :type 'boolean + :group 'gnus-search) + +(define-obsolete-variable-alias 'nnir-ignored-newsgroups + 'gnus-search-ignored-newsgroups "28.1") + +(defcustom gnus-search-ignored-newsgroups "" + "A regexp to match newsgroups in the active file that should + be skipped when searching." + :version "24.1" + :type 'regexp + :group 'gnus-search) + +;; Engine-specific configuration options. + +(defcustom gnus-search-swish++-config-file + (expand-file-name "~/Mail/swish++.conf") + "Location of Swish++ configuration file. +This variable can also be set per-server." + :type 'file + :group 'gnus-search) + +(defcustom gnus-search-swish++-program "search" + "Name of swish++ search executable. +This variable can also be set per-server." + :type 'string + :group 'gnus-search) + +(defcustom gnus-search-swish++-switches '() + "A list of strings, to be given as additional arguments to swish++. +Note that this should be a list. I.e., do NOT use the following: + (setq gnus-search-swish++-switches \"-i -w\") ; wrong +Instead, use this: + (setq gnus-search-swish++-switches \\='(\"-i\" \"-w\")) + +This variable can also be set per-server." + :type '(repeat string) + :group 'gnus-search) + +(defcustom gnus-search-swish++-remove-prefix (concat (getenv "HOME") "/Mail/") + "The prefix to remove from each file name returned by swish++ +in order to get a group name (albeit with / instead of .). This is a +regular expression. + +This variable can also be set per-server." + :type 'regexp + :group 'gnus-search) + +(defcustom gnus-search-swish++-raw-queries-p nil + "If t, all Swish++ engines will only accept raw search query + strings." + :type 'boolean + :version "28.1" + :group 'gnus-search) + +(defcustom gnus-search-swish-e-config-file + (expand-file-name "~/Mail/swish-e.conf") + "Configuration file for swish-e. +This variable can also be set per-server." + :type 'file + :version "28.1" + :group 'gnus-search) + +(defcustom gnus-search-swish-e-program "search" + "Name of swish-e search executable. +This variable can also be set per-server." + :type 'string + :version "28.1" + :group 'gnus-search) + +(defcustom gnus-search-swish-e-switches '() + "A list of strings, to be given as additional arguments to swish-e. +Note that this should be a list. I.e., do NOT use the following: + (setq gnus-search-swish-e-switches \"-i -w\") ; wrong +Instead, use this: + (setq gnus-search-swish-e-switches \\='(\"-i\" \"-w\")) + +This variable can also be set per-server." + :type '(repeat string) + :version "28.1" + :group 'gnus-search) + +(defcustom gnus-search-swish-e-remove-prefix (concat (getenv "HOME") "/Mail/") + "The prefix to remove from each file name returned by swish-e +in order to get a group name (albeit with / instead of .). This is a +regular expression. + +This variable can also be set per-server." + :type 'regexp + :version "28.1" + :group 'gnus-search) + +(defcustom gnus-search-swish-e-index-files '() + "A list of index files to use with this Swish-e instance. +This variable can also be set per-server." + :type '(repeat file) + :version "28.1" + :group 'gnus-search) + +(defcustom gnus-search-swish-e-raw-queries-p nil + "If t, all Swish-e engines will only accept raw search query + strings." + :type 'boolean + :version "28.1" + :group 'gnus-search) + +;; Namazu engine, see + +(defcustom gnus-search-namazu-program "namazu" + "Name of Namazu search executable. +This variable can also be set per-server." + :type 'string + :version "28.1" + :group 'gnus-search) + +(defcustom gnus-search-namazu-index-directory (expand-file-name "~/Mail/namazu/") + "Index directory for Namazu. +This variable can also be set per-server." + :type 'directory + :version "28.1" + :group 'gnus-search) + +(defcustom gnus-search-namazu-switches '() + "A list of strings, to be given as additional arguments to namazu. +The switches `-q', `-a', and `-s' are always used, very few other switches +make any sense in this context. + +Note that this should be a list. I.e., do NOT use the following: + (setq gnus-search-namazu-switches \"-i -w\") ; wrong +Instead, use this: + (setq gnus-search-namazu-switches \\='(\"-i\" \"-w\")) + +This variable can also be set per-server." + :type '(repeat string) + :version "28.1" + :group 'gnus-search) + +(defcustom gnus-search-namazu-remove-prefix (concat (getenv "HOME") "/Mail/") + "The prefix to remove from each file name returned by Namazu +in order to get a group name (albeit with / instead of .). + +For example, suppose that Namazu returns file names such as +\"/home/john/Mail/mail/misc/42\". For this example, use the following +setting: (setq gnus-search-namazu-remove-prefix \"/home/john/Mail/\") +Note the trailing slash. Removing this prefix gives \"mail/misc/42\". +Gnus knows to remove the \"/42\" and to replace \"/\" with \".\" to +arrive at the correct group name, \"mail.misc\". + +This variable can also be set per-server." + :type 'directory + :version "28.1" + :group 'gnus-search) + +(defcustom gnus-search-namazu-raw-queries-p nil + "If t, all Namazu engines will only accept raw search query + strings." + :type 'boolean + :version "28.1" + :group 'gnus-search) + +(defcustom gnus-search-notmuch-program "notmuch" + "Name of notmuch search executable. +This variable can also be set per-server." + :type '(string) + :version "28.1" + :group 'gnus-search) + +(defcustom gnus-search-notmuch-config-file + (expand-file-name "~/.notmuch-config") + "Configuration file for notmuch. +This variable can also be set per-server." + :type 'file + :version "28.1" + :group 'gnus-search) + +(defcustom gnus-search-notmuch-switches '() + "A list of strings, to be given as additional arguments to notmuch. +Note that this should be a list. I.e., do NOT use the following: + (setq gnus-search-notmuch-switches \"-i -w\") ; wrong +Instead, use this: + (setq gnus-search-notmuch-switches \\='(\"-i\" \"-w\")) + +This variable can also be set per-server." + :type '(repeat string) + :version "28.1" + :group 'gnus-search) + +(defcustom gnus-search-notmuch-remove-prefix (concat (getenv "HOME") "/Mail/") + "The prefix to remove from each file name returned by notmuch +in order to get a group name (albeit with / instead of .). This is a +regular expression. + +This variable can also be set per-server." + :type 'regexp + :version "28.1" + :group 'gnus-search) + +(defcustom gnus-search-notmuch-raw-queries-p nil + "If t, all Notmuch engines will only accept raw search query + strings." + :type 'boolean + :version "28.1" + :group 'gnus-search) + +(defcustom gnus-search-imap-raw-queries-p nil + "If t, all IMAP engines will only accept raw search query + strings." + :version "28.1" + :type 'boolean + :group 'gnus-search) + +(defcustom gnus-search-mairix-program "mairix" + "Name of mairix search executable. +This variable can also be set per-server." + :version "28.1" + :type 'string + :group 'gnus-search) + +(defcustom gnus-search-mairix-config-file + (expand-file-name "~/.mairixrc") + "Configuration file for mairix. +This variable can also be set per-server." + :version "28.1" + :type 'file + :group 'gnus-search) + +(defcustom gnus-search-mairix-switches '() + "A list of strings, to be given as additional arguments to mairix. +Note that this should be a list. I.e., do NOT use the following: + (setq gnus-search-mairix-switches \"-i -w\") ; wrong +Instead, use this: + (setq gnu-search-mairix-switches \\='(\"-i\" \"-w\")) + +This variable can also be set per-server." + :version "28.1" + :type '(repeat string) + :group 'gnus-search) + +(defcustom gnus-search-mairix-remove-prefix (concat (getenv "HOME") "/Mail/") + "The prefix to remove from each file name returned by mairix +in order to get a group name (albeit with / instead of .). This is a +regular expression. + +This variable can also be set per-server." + :version "28.1" + :type 'regexp + :group 'gnus-search) + +(defcustom gnus-search-mairix-raw-queries-p nil + "If t, all Mairix engines will only accept raw search query + strings." + :version "28.1" + :type 'boolean + :group 'gnus-search) + +;; Options for search language parsing. + +(defcustom gnus-search-expandable-keys + '("from" "subject" "to" "cc" "bcc" "body" "recipient" "date" + "mark" "before" "after" "larger" "smaller" "attachment" "text" + "since" "thread" "sender" "address" "tag" "size" "grep" "limit" + "raw" "message-id" "id") + "A list of strings representing expandable search keys. +\"Expandable\" simply means the key can be abbreviated while +typing in search queries, ie \"subject\" could be entered as +\"subj\" or even \"su\", though \"s\" is ambigous between +\"subject\" and \"since\". + +Ambiguous abbreviations will raise an error." + :group 'gnus-search + :version "28.1" + :type '(repeat string)) + +(defcustom gnus-search-date-keys + '("date" "before" "after" "on" "senton" "sentbefore" "sentsince" "since") + "A list of keywords whose value should be parsed as a date. +See the docstring of `gnus-search-parse-query' for information on +date parsing." + :group 'gnus-search + :version "26.1" + :type '(repeat string)) + +(defcustom gnus-search-contact-tables '() + "A list of completion tables used to search for messages from contacts. +Each list element should be a table or collection suitable to be +returned by `completion-at-point-functions'. That usually means +a list of strings, a hash table, or an alist." + :group 'gnus-search + :version "28.1" + :type 'list) + +;;; Search language + +;; This "language" was generalized from the original IMAP search query +;; parsing routine. + +(defun gnus-search-parse-query (string) + "Turn STRING into an s-expression based query. +The resulting query structure is passed to the various search +backends, each of which adapts it as needed. + +The search \"language\" is essentially a series of key:value +expressions. Key is most often a mail header, but there are +other keys. Value is a string, quoted if it contains spaces. +Key and value are separated by a colon, no space. Expressions +are implictly ANDed; the \"or\" keyword can be used to +OR. \"not\" will negate the following expression, or keys can be +prefixed with a \"-\". The \"near\" operator will work for +engines that understand it; other engines will convert it to +\"or\". Parenthetical groups work as expected. + +A key that matches the name of a mail header will search that +header. + +Search keys can be expanded with TAB during entry, or left +abbreviated so long as they remain unambiguous, ie \"f\" will +search the \"from\" header. \"s\" will raise an error. + +Other keys: + +\"address\" will search all sender and recipient headers. + +\"recipient\" will search \"To\", \"Cc\", and \"Bcc\". + +\"before\" will search messages sent before the specified +date (date specifications to come later). Date is exclusive. + +\"after\" (or its synonym \"since\") will search messages sent +after the specified date. Date is inclusive. + +\"mark\" will search messages that have some sort of mark. +Likely values include \"flag\", \"seen\", \"read\", \"replied\". +It's also possible to use Gnus' internal marks, ie \"mark:R\" +will be interpreted as mark:read. + +\"tag\" will search tags -- right now that's translated to +\"keyword\" in IMAP, and left as \"tag\" for notmuch. At some +point this should also be used to search marks in the Gnus +registry. + +Other keys can be specified, provided that the search backends +know how to interpret them. + +External contact-management packages can push completion tables +onto the list variable `gnus-search-contact-tables', to provide +auto-completion of contact names and addresses for keys like +\"from\" and \"to\". + +Date values (any key in `gnus-search-date-keys') can be provided +in any format that `parse-time-string' can parse (note that this +can produce weird results). Dates with missing bits will be +interpreted as the most recent occurance thereof (ie \"march 03\" +is the most recent March 3rd). Lastly, relative specifications +such as 1d (one day ago) are understood. This also accepts w, m, +and y. m is assumed to be 30 days. + +This function will accept pretty much anything as input. Its +only job is to parse the query into a sexp, and pass that on -- +it is the job of the search backends to make sense of the +structured query. Malformed, unusable or invalid queries will +typically be silently ignored." + (with-temp-buffer + ;; Set up the parsing environment. + (insert string) + (goto-char (point-min)) + ;; Now, collect the output terms and return them. + (let (out) + (while (not (gnus-search-query-end-of-input)) + (push (gnus-search-query-next-expr) out)) + (reverse out)))) + +(defun gnus-search-query-next-expr (&optional count halt) + "Return the next expression from the current buffer." + (let ((term (gnus-search-query-next-term count)) + (next (gnus-search-query-peek-symbol))) + ;; Deal with top-level expressions. And, or, not, near... What + ;; else? Notmuch also provides xor and adj. It also provides a + ;; "nearness" parameter for near and adj. + (cond + ;; Handle 'expr or expr' + ((and (eq next 'or) + (null halt)) + (list 'or term (gnus-search-query-next-expr 2))) + ;; Handle 'near operator. + ((eq next 'near) + (let ((near-next (gnus-search-query-next-expr 2))) + (if (and (stringp term) + (stringp near-next)) + (list 'near term near-next) + (signal 'gnus-search-parse-error + (list "\"Near\" keyword must appear between two plain strings."))))) + ;; Anything else + (t term)))) + +(defun gnus-search-query-next-term (&optional count) + "Return the next TERM from the current buffer." + (let ((term (gnus-search-query-next-symbol count))) + ;; What sort of term is this? + (cond + ;; negated term + ((eq term 'not) (list 'not (gnus-search-query-next-expr nil 'halt))) + ;; generic term + (t term)))) + +(defun gnus-search-query-peek-symbol () + "Return the next symbol from the current buffer, but don't consume it." + (save-excursion + (gnus-search-query-next-symbol))) + +(defun gnus-search-query-next-symbol (&optional count) + "Return the next symbol from the current buffer, or nil if we are +at the end of the buffer. If supplied COUNT skips some symbols before +returning the one at the supplied position." + (when (and (numberp count) (> count 1)) + (gnus-search-query-next-symbol (1- count))) + (let ((case-fold-search t)) + ;; end of input stream? + (unless (gnus-search-query-end-of-input) + ;; No, return the next symbol from the stream. + (cond + ;; Negated expression -- return it and advance one char. + ((looking-at "-") (forward-char 1) 'not) + ;; List expression -- we parse the content and return this as a list. + ((looking-at "(") + (gnus-search-parse-query (gnus-search-query-return-string ")" t))) + ;; Keyword input -- return a symbol version. + ((looking-at "\\band\\b") (forward-char 3) 'and) + ((looking-at "\\bor\\b") (forward-char 2) 'or) + ((looking-at "\\bnot\\b") (forward-char 3) 'not) + ((looking-at "\\bnear\\b") (forward-char 4) 'near) + ;; Plain string, no keyword + ((looking-at "[\"/]?\\b[^:]+\\([[:blank:]]\\|\\'\\)") + (gnus-search-query-return-string + (when (looking-at-p "[\"/]") t))) + ;; Assume a K:V expression. + (t (let ((key (gnus-search-query-expand-key + (buffer-substring + (point) + (progn + (re-search-forward ":" (point-at-eol) t) + (1- (point)))))) + (value (gnus-search-query-return-string + (when (looking-at-p "[\"/]") t)))) + (gnus-search-query-parse-kv key value))))))) + +(defun gnus-search-query-parse-kv (key value) + "Handle KEY and VALUE, parsing and expanding as necessary. +This may result in (key value) being turned into a larger query +structure. + +In the simplest case, they are simply consed together. String +KEY is converted to a symbol." + (let (return) + (cond + ((member key gnus-search-date-keys) + (when (string= "after" key) + (setq key "since")) + (setq value (gnus-search-query-parse-date value))) + ((equal key "mark") + (setq value (gnus-search-query-parse-mark value))) + ((string= "message-id" key) + (setq key "id"))) + (or return + (cons (intern key) value)))) + +(defun gnus-search-query-parse-date (value &optional rel-date) + "Interpret VALUE as a date specification. +See the docstring of `gnus-search-parse-query' for details. + +The result is a list of (dd mm yyyy); individual elements can be +nil. + +If VALUE is a relative time, interpret it as relative to +REL-DATE, or (current-time) if REL-DATE is nil." + ;; Time parsing doesn't seem to work with slashes. + (let ((value (replace-regexp-in-string "/" "-" value)) + (now (append '(0 0 0) + (seq-subseq (decode-time (or rel-date + (current-time))) + 3)))) + ;; Check for relative time parsing. + (if (string-match "\\([[:digit:]]+\\)\\([dwmy]\\)" value) + (seq-subseq + (decode-time + (time-subtract + (apply #'encode-time now) + (days-to-time + (* (string-to-number (match-string 1 value)) + (cdr (assoc (match-string 2 value) + '(("d" . 1) + ("w" . 7) + ("m" . 30) + ("y" . 365)))))))) + 3 6) + ;; Otherwise check the value of `parse-time-string'. + + ;; (SEC MIN HOUR DAY MON YEAR DOW DST TZ) + (let ((d-time (parse-time-string value))) + ;; Did parsing produce anything at all? + (if (seq-some #'integerp (seq-subseq d-time 3 7)) + (seq-subseq + ;; If DOW is given, handle that specially. + (if (and (seq-elt d-time 6) (null (seq-elt d-time 3))) + (decode-time + (time-subtract (apply #'encode-time now) + (days-to-time + (+ (if (> (seq-elt d-time 6) + (seq-elt now 6)) + 7 0) + (- (seq-elt now 6) (seq-elt d-time 6)))))) + d-time) + 3 6) + ;; `parse-time-string' failed to produce anything, just + ;; return the string. + value))))) + +(defun gnus-search-query-parse-mark (mark) + "Possibly transform MARK. +If MARK is a single character, assume it is one of the +gnus-*-mark marks, and return an appropriate string." + (if (= 1 (length mark)) + (let ((m (aref mark 0))) + ;; Neither pcase nor cl-case will work here. + (cond + ((eql m gnus-ticked-mark) "flag") + ((eql m gnus-read-mark) "read") + ((eql m gnus-replied-mark) "replied") + ((eql m gnus-recent-mark) "recent") + (t mark))) + mark)) + +(defun gnus-search-query-expand-key (key) + (cond ((test-completion key gnus-search-expandable-keys) + ;; We're done! + key) + ;; There is more than one possible completion. + ((consp (cdr (completion-all-completions + key gnus-search-expandable-keys #'stringp 0))) + (signal 'gnus-search-parse-error + (list (format "Ambiguous keyword: %s" key)))) + ;; Return KEY, either completed or untouched. + ((car-safe (completion-try-completion + key gnus-search-expandable-keys + #'stringp 0))))) + +(defun gnus-search-query-return-string (&optional delimited trim) + "Return a string from the current buffer. +If DELIMITED is non-nil, assume the next character is a delimiter +character, and return everything between point and the next +occurance of the delimiter, including the delimiters themselves. +If TRIM is non-nil, do not return the delimiters. Otherwise, +return one word." + ;; This function cannot handle nested delimiters, as it's not a + ;; proper parser. Ie, you cannot parse "to:bob or (from:bob or + ;; (cc:bob or bcc:bob))". + (let ((start (point)) + (delimiter (if (stringp delimited) + delimited + (when delimited + (char-to-string (char-after))))) + end) + (if delimiter + (progn + (when trim + ;; Skip past first delimiter if we're trimming. + (forward-char 1)) + (while (not end) + (unless (search-forward delimiter nil t (unless trim 2)) + (signal 'gnus-search-parse-error + (list (format "Unmatched delimited input with %s in query" delimiter)))) + (let ((here (point))) + (unless (equal (buffer-substring (- here 2) (- here 1)) "\\") + (setq end (if trim (1- (point)) (point)) + start (if trim (1+ start) start)))))) + (setq end (progn (re-search-forward "\\([[:blank:]]+\\|$\\)" (point-max) t) + (match-beginning 0)))) + (buffer-substring-no-properties start end))) + +(defun gnus-search-query-end-of-input () + "Are we at the end of input?" + (skip-chars-forward "[[:blank:]]") + (looking-at "$")) + +;;; Search engines + +;; Search engines are implemented as classes. This is good for two +;; things: encapsulating things like indexes and search prefixes, and +;; transforming search queries. + +(defclass gnus-search-engine () + ((raw-queries-p + :initarg :raw-queries-p + :initform nil + :type boolean + :custom boolean + :documentation + "When t, searches through this engine will never be parsed or + transformed, and must be entered \"raw\".")) + :abstract t + :documentation "Abstract base class for Gnus search engines.") + +(defclass gnus-search-grep () + ((grep-program + :initarg :grep-program + :initform "grep" + :type string + :documentation "Grep executable to use for second-pass grep + searches.") + (grep-options + :initarg :grep-options + :initform nil + :type list + :documentation "Additional options, in the form of a list, + passed to the second-pass grep search, when present.")) + :abstract t + :documentation "An abstract mixin class that can be added to + local-filesystem search engines, providing an additional grep: + search key. After the base engine returns a list of search + results (as local filenames), an external grep process is used + to further filter the results.") + +(cl-defgeneric gnus-search-grep-search (engine artlist criteria) + "Run a secondary grep search over a list of preliminary results. + +ARTLIST is a list of (filename score) pairs, produced by one of +the other search engines. CRITERIA is a grep-specific search +key. This method uses an external grep program to further filter +the files in ARTLIST by that search key.") + +(cl-defmethod gnus-search-grep-search ((engine gnus-search-grep) + artlist criteria) + (with-slots (grep-program grep-options) engine + (if (executable-find grep-program) + ;; Don't catch errors -- allow them to propagate. + (let ((matched-files + (apply + #'process-lines + grep-program + `("-l" ,@grep-options + "-e" ,(shell-quote-argument criteria) + ,@(mapcar #'car artlist))))) + (seq-filter (lambda (a) (member (car a) matched-files)) + artlist)) + (nnheader-report 'search "invalid grep program: %s" grep-program)))) + +(defclass gnus-search-process () + ((proc-buffer + :initarg :proc-buffer + :type buffer + :documentation "A temporary buffer this engine uses for its + search process, and for munging its search results.")) + :abstract t + :documentation + "A mixin class for engines that do their searching in a single + process launched for this purpose, which returns at the end of + the search. Subclass instances are safe to be run in + threads.") + +(cl-defmethod shared-initialize ((engine gnus-search-process) + slots) + (setq slots (plist-put slots :proc-buffer + (get-buffer-create + (generate-new-buffer-name " *gnus-search-")))) + (cl-call-next-method engine slots)) + +(defclass gnus-search-imap (gnus-search-engine) + ((literal-plus + :initarg :literal-plus + :initform nil + :type boolean + :documentation + "Can this search engine handle literal+ searches? This slot + is set automatically by the imap server, and cannot be + set manually. Only the LITERAL+ capability is handled.") + (multisearch + :initarg :multisearch + :initform nil + :type boolean + :documentation + "Can this search engine handle the MULTISEARCH capability? + This slot is set automatically by the imap server, and cannot + be set manually. Currently unimplemented.") + (fuzzy + :initarg :fuzzy + :initform nil + :type boolean + :documentation + "Can this search engine handle the FUZZY search capability? + This slot is set automatically by the imap server, and cannot + be set manually. Currently only partially implemented.")) + :documentation + "The base IMAP search engine, using an IMAP server's search capabilites. + +This backend may be subclassed to handle particular IMAP servers' +quirks.") + +(eieio-oset-default 'gnus-search-imap 'raw-queries-p + gnus-search-imap-raw-queries-p) + +(defclass gnus-search-find-grep (gnus-search-engine + gnus-search-process + gnus-search-grep) + nil) + +(defclass gnus-search-gmane (gnus-search-engine gnus-search-process) + nil) + +;;; The "indexed" search engine. These are engines that use an +;;; external program, with indexes kept on disk, to search messages +;;; usually kept in some local directory. The three common slots are +;;; "program", holding the string name of the executable; "switches", +;;; holding additional switches to pass to the executable; and +;;; "prefix", which is sort of the path to the found messages which +;;; should be removed so that Gnus can find them. Many of the +;;; subclasses also allow distinguishing multiple databases or +;;; indexes. These slots can be set using a global default, or on a +;;; per-server basis. + +(defclass gnus-search-indexed (gnus-search-engine + gnus-search-process + gnus-search-grep) + ((program + :initarg :program + :type string + :documentation + "The executable used for indexing and searching.") + (config-file + :init-arg :config-file + :type string + :custom file + :documentation "Location of the config file, if any.") + (remove-prefix + :initarg :remove-prefix + :type string + :documentation + "The path to the directory where the indexed mails are + kept. This path is removed from the search results.") + (switches + :initarg :switches + :type list + :documentation + "Additional switches passed to the search engine command-line + program.")) + :abstract t + :allow-nil-initform t + :documentation "A base search engine class that assumes a local search index + accessed by a command line program.") + +(eieio-oset-default 'gnus-search-indexed 'remove-prefix + (concat (getenv "HOME") "/Mail/")) + +(defclass gnus-search-swish-e (gnus-search-indexed) + ((index-files + :init-arg :index-files + :type list))) + +(eieio-oset-default 'gnus-search-swish-e 'program + gnus-search-swish-e-program) + +(eieio-oset-default 'gnus-search-swish-e 'remove-prefix + gnus-search-swish-e-remove-prefix) + +(eieio-oset-default 'gnus-search-swish-e 'index-files + gnus-search-swish-e-index-files) + +(eieio-oset-default 'gnus-search-swish-e 'switches + gnus-search-swish-e-switches) + +(eieio-oset-default 'gnus-search-swish-e 'raw-queries-p + gnus-search-swish-e-raw-queries-p) + +(defclass gnus-search-swish++ (gnus-search-indexed) + nil) + +(eieio-oset-default 'gnus-search-swish++ 'program + gnus-search-swish++-program) + +(eieio-oset-default 'gnus-search-swish++ 'remove-prefix + gnus-search-swish++-remove-prefix) + +(eieio-oset-default 'gnus-search-swish++ 'config-file + gnus-search-swish++-config-file) + +(eieio-oset-default 'gnus-search-swish++ 'switches + gnus-search-swish++-switches) + +(eieio-oset-default 'gnus-search-swish++ 'raw-queries-p + gnus-search-swish++-raw-queries-p) + +(defclass gnus-search-mairix (gnus-search-indexed) + nil) + +(eieio-oset-default 'gnus-search-mairix 'program + gnus-search-mairix-program) + +(eieio-oset-default 'gnus-search-mairix 'switches + gnus-search-mairix-switches) + +(eieio-oset-default 'gnus-search-mairix 'remove-prefix + gnus-search-mairix-remove-prefix) + +(eieio-oset-default 'gnus-search-mairix 'config-file + gnus-search-mairix-config-file) + +(eieio-oset-default 'gnus-search-mairix 'raw-queries-p + gnus-search-mairix-raw-queries-p) + +(defclass gnus-search-namazu (gnus-search-indexed) + ((index-directory + :initarg :index-directory + :type string + :custom directory))) + +(eieio-oset-default 'gnus-search-namazu 'program + gnus-search-namazu-program) + +(eieio-oset-default 'gnus-search-namazu 'index-directory + gnus-search-namazu-index-directory) + +(eieio-oset-default 'gnus-search-namazu 'switches + gnus-search-namazu-switches) + +(eieio-oset-default 'gnus-search-namazu 'remove-prefix + gnus-search-namazu-remove-prefix) + +(eieio-oset-default 'gnus-search-namazu 'raw-queries-p + gnus-search-namazu-raw-queries-p) + +(defclass gnus-search-notmuch (gnus-search-indexed) + nil) + +(eieio-oset-default 'gnus-search-notmuch 'program + gnus-search-notmuch-program) + +(eieio-oset-default 'gnus-search-notmuch 'switches + gnus-search-notmuch-switches) + +(eieio-oset-default 'gnus-search-notmuch 'remove-prefix + gnus-search-notmuch-remove-prefix) + +(eieio-oset-default 'gnus-search-notmuch 'config-file + gnus-search-notmuch-config-file) + +(eieio-oset-default 'gnus-search-notmuch 'raw-queries-p + gnus-search-notmuch-raw-queries-p) + +(define-obsolete-variable-alias 'nnir-method-default-engines + 'gnus-search-default-engines "28.1") + +(defcustom gnus-search-default-engines '((nnimap gnus-search-imap) + (nntp gnus-search-gmane)) + "Alist of default search engines keyed by server method." + :version "26.1" + :group 'gnus-search + :type `(repeat (list (choice (const nnimap) (const nntp) (const nnspool) + (const nneething) (const nndir) (const nnmbox) + (const nnml) (const nnmh) (const nndraft) + (const nnfolder) (const nnmaildir)) + (choice + ,@(mapcar + (lambda (el) (list 'const (intern (car el)))) + (eieio-build-class-alist 'gnus-search-engine t)))))) + +;;; Transforming and running search queries. + +(cl-defgeneric gnus-search-run-search (engine server query groups) + "Run QUERY in GROUPS against SERVER, using search ENGINE. +Should return results as a vector of vectors.") + +(cl-defgeneric gnus-search-transform (engine expression) + "Transform sexp EXPRESSION into a string search query usable by ENGINE. +Responsible for handling and, or, and parenthetical expressions.") + +(cl-defgeneric gnus-search-transform-expression (engine expression) + "Transform a basic EXPRESSION into a string usable by ENGINE.") + +(cl-defgeneric gnus-search-make-query-string (engine query-spec) + "Extract the actual query string to use from QUERY-SPEC.") + +;; Methods that are likely to be the same for all engines. + +(cl-defmethod gnus-search-make-query-string ((engine gnus-search-engine) + query-spec) + (if (and gnus-search-use-parsed-queries + (null (alist-get 'raw query-spec)) + (null (slot-value engine 'raw-queries-p))) + (gnus-search-transform + engine (alist-get 'parsed-query query-spec)) + (alist-get 'query query-spec))) + +(defsubst gnus-search-single-p (query) + "Return t if QUERY is a search for a single message." + (let ((q (alist-get 'parsed-query query))) + (and (= (length q ) 1) + (consp (car-safe q)) + (eq (caar q) 'id)))) + +(cl-defmethod gnus-search-transform ((engine gnus-search-engine) + (query list)) + (let (clauses) + (mapc + (lambda (item) + (when-let ((expr (gnus-search-transform-expression engine item))) + (push expr clauses))) + query) + (mapconcat #'identity (reverse clauses) " "))) + +;; Most search engines just pass through plain strings. +(cl-defmethod gnus-search-transform-expression ((_ gnus-search-engine) + (expr string)) + expr) + +;; Most search engines use implicit ANDs. +(cl-defmethod gnus-search-transform-expression ((_ gnus-search-engine) + (_expr (eql and))) + nil) + +;; Most search engines use explicit infixed ORs. +(cl-defmethod gnus-search-transform-expression ((engine gnus-search-engine) + (expr (head or))) + (let ((left (gnus-search-transform-expression engine (nth 1 expr))) + (right (gnus-search-transform-expression engine (nth 2 expr)))) + ;; Unhandled keywords return a nil; don't create an "or" expression + ;; unless both sub-expressions are non-nil. + (if (and left right) + (format "%s or %s" left right) + (or left right)))) + +;; Most search engines just use the string "not" +(cl-defmethod gnus-search-transform-expression ((engine gnus-search-engine) + (expr (head not))) + (let ((next (gnus-search-transform-expression engine (cadr expr)))) + (when next + (format "not %s" next)))) + +;;; Search Engine Interfaces: + +(autoload 'nnimap-change-group "nnimap") +(declare-function nnimap-buffer "nnimap" ()) +(declare-function nnimap-command "nnimap" (&rest args)) + +;; imap interface +(cl-defmethod gnus-search-run-search ((engine gnus-search-imap) + srv query groups) + (save-excursion + (let ((server (cadr (gnus-server-to-method srv))) + (gnus-inhibit-demon t) + ;; We're using the message id to look for a single message. + (single-search (gnus-search-single-p query)) + (grouplist (or groups (gnus-search-get-active srv))) + q-string artlist group) + (message "Opening server %s" server) + ;; We should only be doing this once, in + ;; `nnimap-open-connection', but it's too frustrating to try to + ;; get to the server from the process buffer. + (with-current-buffer (nnimap-buffer) + (setf (slot-value engine 'literal-plus) + (when (nnimap-capability "LITERAL+") t)) + ;; MULTISEARCH not yet implemented. + (setf (slot-value engine 'multisearch) + (when (nnimap-capability "MULTISEARCH") t)) + ;; FUZZY only partially supported: the command is sent to the + ;; server (and presumably acted upon), but we don't yet + ;; request a RELEVANCY score as part of the response. + (setf (slot-value engine 'fuzzy) + (when (nnimap-capability "SEARCH=FUZZY") t))) + + (setq q-string + (gnus-search-make-query-string engine query)) + + ;; If it's a thread query, make sure that all message-id + ;; searches are also references searches. + (when (alist-get 'thread query) + (setq q-string + (replace-regexp-in-string + "HEADER Message-Id \\([^ )]+\\)" + "(OR HEADER Message-Id \\1 HEADER References \\1)" + q-string))) + + (while (and (setq group (pop grouplist)) + (or (null single-search) (null artlist))) + (when (nnimap-change-group + (gnus-group-short-name group) server) + (with-current-buffer (nnimap-buffer) + (message "Searching %s..." group) + (let ((result + (gnus-search-imap-search-command engine q-string))) + (when (car result) + (setq artlist + (vconcat + (mapcar + (lambda (artnum) + (let ((artn (string-to-number artnum))) + (when (> artn 0) + (vector group artn 100)))) + (cdr (assoc "SEARCH" (cdr result)))) + artlist)))) + (message "Searching %s...done" group)))) + (nreverse artlist)))) + +(cl-defmethod gnus-search-imap-search-command ((engine gnus-search-imap) + (query string)) + "Create the IMAP search command for QUERY. +Currenly takes into account support for the LITERAL+ capability. +Other capabilities could be tested here." + (with-slots (literal-plus) engine + (when literal-plus + (setq query (split-string query "\n"))) + (cond + ((consp query) + ;; We're not really streaming, just need to prevent + ;; `nnimap-send-command' from waiting for a response. + (let* ((nnimap-streaming t) + (call + (nnimap-send-command + "UID SEARCH CHARSET UTF-8 %s" + (pop query)))) + (dolist (l query) + (process-send-string (get-buffer-process (current-buffer)) l) + (process-send-string (get-buffer-process (current-buffer)) + (if (nnimap-newlinep nnimap-object) + "\n" + "\r\n"))) + (nnimap-get-response call))) + (t (nnimap-command "UID SEARCH %s" query))))) + +;; TODO: Don't exclude booleans and date keys, just check for them +;; before checking for general keywords. +(defvar gnus-search-imap-search-keys + '(body cc bcc from header keyword larger smaller subject text to uid) + "Known IMAP search keys, excluding booleans and date keys.") + +(cl-defmethod gnus-search-transform ((_ gnus-search-imap) + (_query null)) + "ALL") + +(cl-defmethod gnus-search-transform-expression ((engine gnus-search-imap) + (expr string)) + (unless (string-match-p "\\`/.+/\\'" expr) + ;; Also need to check for fuzzy here. Or better, do some + ;; refactoring of this stuff. + (format "TEXT %s" + (gnus-search-imap-handle-string engine expr)))) + +(cl-defmethod gnus-search-transform-expression ((engine gnus-search-imap) + (expr (head or))) + (let ((left (gnus-search-transform-expression engine (nth 1 expr))) + (right (gnus-search-transform-expression engine (nth 2 expr)))) + (if (and left right) + (format "(OR %s %s)" + left (format (if (eq 'or (car-safe (nth 2 expr))) + "(%s)" "%s") + right)) + (or left right)))) + +(cl-defmethod gnus-search-transform-expression ((engine gnus-search-imap) + (expr (head near))) + "Imap searches interpret \"near\" as \"or\"." + (setcar expr 'or) + (gnus-search-transform-expression engine expr)) + +(cl-defmethod gnus-search-transform-expression ((engine gnus-search-imap) + (expr (head not))) + "Transform IMAP NOT. +If the term to be negated is a flag, then use the appropriate UN* +boolean instead." + (if (eql (caadr expr) 'mark) + (if (string= (cdadr expr) "new") + "OLD" + (format "UN%s" (gnus-search-imap-handle-flag (cdadr expr)))) + (format "NOT %s" + (gnus-search-transform-expression engine (cadr expr))))) + +(cl-defmethod gnus-search-transform-expression ((_ gnus-search-imap) + (expr (head mark))) + (gnus-search-imap-handle-flag (cdr expr))) + +(cl-defmethod gnus-search-transform-expression ((engine gnus-search-imap) + (expr list)) + "Handle a search keyword for IMAP. +All IMAP search keywords that take a value are supported +directly. Keywords that are boolean are supported through other +means (usually the \"mark\" keyword)." + (let ((fuzzy-supported (slot-value engine 'fuzzy)) + (fuzzy "")) + (cl-case (car expr) + (date (setcar expr 'on)) + (tag (setcar expr 'keyword)) + (sender (setcar expr 'from))) + (cond + ((consp (car expr)) + (format "(%s)" (gnus-search-transform engine expr))) + ((eq (car expr) 'recipient) + (gnus-search-transform + engine (gnus-search-parse-query + (format + "to:%s or cc:%s or bcc:%s" + (cdr expr) (cdr expr) (cdr expr))))) + ((eq (car expr) 'address) + (gnus-search-transform + engine (gnus-search-parse-query + (format + "from:%s or to:%s or cc:%s or bcc:%s" + (cdr expr) (cdr expr) (cdr expr) (cdr expr))))) + ((memq (car expr) '(before since on sentbefore senton sentsince)) + ;; Ignore dates given as strings. + (when (listp (cdr expr)) + (format "%s %s" + (upcase (symbol-name (car expr))) + (gnus-search-imap-handle-date engine (cdr expr))))) + ((stringp (cdr expr)) + ;; If the search term starts or ends with "*", remove the + ;; asterisk. If the engine supports FUZZY, then additionally make + ;; the search fuzzy. + (when (string-match "\\`\\*\\|\\*\\'" (cdr expr)) + (setcdr expr (replace-regexp-in-string + "\\`\\*\\|\\*\\'" "" (cdr expr))) + (when fuzzy-supported + (setq fuzzy "FUZZY "))) + ;; If the search term is a regexp, drop the expression altogether. + (unless (string-match-p "\\`/.+/\\'" (cdr expr)) + (cond + ((memq (car expr) gnus-search-imap-search-keys) + (format "%s%s %s" + fuzzy + (upcase (symbol-name (car expr))) + (gnus-search-imap-handle-string engine (cdr expr)))) + ((eq (car expr) 'id) + (format "HEADER Message-ID \"%s\"" (cdr expr))) + ;; Treat what can't be handled as a HEADER search. Probably a bad + ;; idea. + (t (format "%sHEADER %s %s" + fuzzy + (car expr) + (gnus-search-imap-handle-string engine (cdr expr)))))))))) + +(cl-defmethod gnus-search-imap-handle-date ((_engine gnus-search-imap) + (date list)) + "Turn DATE into a date string recognizable by IMAP. +While other search engines can interpret partially-qualified +dates such as a plain \"January\", IMAP requires an absolute +date. + +DATE is a list of (dd mm yyyy), any element of which could be +nil. Massage those numbers into the most recent past occurrence +of whichever date elements are present." + (let ((now (decode-time (current-time)))) + ;; Set nil values to 1, current-month, current-year, or else 1, 1, + ;; current-year, depending on what we think the user meant. + (unless (seq-elt date 1) + (setf (seq-elt date 1) + (if (seq-elt date 0) + (seq-elt now 4) + 1))) + (unless (seq-elt date 0) + (setf (seq-elt date 0) 1)) + (unless (seq-elt date 2) + (setf (seq-elt date 2) + (seq-elt now 5))) + ;; Fiddle with the date until it's in the past. There + ;; must be a way to combine all these steps. + (unless (< (seq-elt date 2) + (seq-elt now 5)) + (when (< (seq-elt now 3) + (seq-elt date 0)) + (cl-decf (seq-elt date 1))) + (cond ((zerop (seq-elt date 1)) + (setf (seq-elt date 1) 1) + (cl-decf (seq-elt date 2))) + ((< (seq-elt now 4) + (seq-elt date 1)) + (cl-decf (seq-elt date 2)))))) + (format-time-string "%e-%b-%Y" (apply #'encode-time + (append '(0 0 0) + date)))) + +(cl-defmethod gnus-search-imap-handle-string ((engine gnus-search-imap) + (str string)) + (with-slots (literal-plus) engine + (if (multibyte-string-p str) + ;; If LITERAL+ is available, use it and encode string as + ;; UTF-8. + (if literal-plus + (format "{%d+}\n%s" + (string-bytes str) + (encode-coding-string str 'utf-8)) + ;; Otherwise, if the user hasn't already quoted the string, + ;; quote it for them. + (if (string-prefix-p "\"" str) + str + (format "\"%s\"" str))) + str))) + +(defun gnus-search-imap-handle-flag (flag) + "Make sure string FLAG is something IMAP will recognize." + ;; What else? What about the KEYWORD search key? + (setq flag + (pcase flag + ("flag" "flagged") + ("read" "seen") + (_ flag))) + (if (member flag '("seen" "answered" "deleted" "draft" "flagged")) + (upcase flag) + "")) + +;;; Methods for the indexed search engines. + +;; First, some common methods. + +(cl-defgeneric gnus-search-indexed-parse-output (engine server &optional groups) + "Parse the results of ENGINE's query against SERVER in GROUPS. +Locally-indexed search engines return results as a list of +filenames, sometimes with additional information. Returns a list +of viable results, in the form of a list of [group article score] +vectors.") + +(cl-defgeneric gnus-search-index-extract (engine) + "Extract a single article result from the current buffer. +Returns a list of two values: a file name, and a relevancy score. +Advances point to the beginning of the next result.") + +(cl-defmethod gnus-search-run-search ((engine gnus-search-indexed) + server query groups) + "Run QUERY against SERVER using ENGINE. +This method is common to all indexed search engines. + +Returns a list of [group article score] vectors." + + (save-excursion + (let* ((qstring (gnus-search-make-query-string engine query)) + (program (slot-value engine 'program)) + (buffer (slot-value engine 'proc-buffer)) + (cp-list (gnus-search-indexed-search-command + engine qstring query groups)) + proc exitstatus) + (set-buffer buffer) + (erase-buffer) + + (if groups + (message "Doing %s query on %s..." program groups) + (message "Doing %s query..." program)) + (setq proc (apply #'start-process (format "search-%s" server) + buffer program cp-list)) + (while (process-live-p proc) + (accept-process-output proc)) + (setq exitstatus (process-exit-status proc)) + (if (zerop exitstatus) + ;; The search results have been put into the current buffer; + ;; `parse-output' finds them there and returns the article + ;; list. + (gnus-search-indexed-parse-output engine server query groups) + (nnheader-report 'search "%s error: %s" program exitstatus) + ;; Failure reason is in this buffer, show it if the user + ;; wants it. + (when (> gnus-verbose 6) + (display-buffer buffer)) + nil)))) + +(cl-defmethod gnus-search-indexed-parse-output ((engine gnus-search-indexed) + server query &optional groups) + (let ((prefix (slot-value engine 'remove-prefix)) + (group-regexp (when groups + (regexp-opt + (mapcar + (lambda (x) (gnus-group-real-name x)) + groups)))) + artlist vectors article group) + (goto-char (point-min)) + (while (not (eobp)) + (pcase-let ((`(,f-name ,score) (gnus-search-indexed-extract engine))) + (when (and (file-readable-p f-name) + (null (file-directory-p f-name)) + (or (null groups) + (and (gnus-search-single-p query) + (alist-get 'thread query)) + (string-match-p group-regexp f-name))) + (push (list f-name score) artlist)))) + ;; Are we running an additional grep query? + (when-let ((grep-reg (alist-get 'grep query))) + (setq artlist (gnus-search-grep-search engine artlist grep-reg))) + ;; Turn (file-name score) into [group article score]. + (pcase-dolist (`(,f-name ,score) artlist) + (setq article (file-name-nondirectory f-name)) + ;; Remove prefix. + (when (and prefix + (file-name-absolute-p prefix) + (string-match (concat "^" + (file-name-as-directory prefix)) + f-name)) + (setq group (replace-match "" t t (file-name-directory f-name)))) + ;; Break the directory name down until it's something that + ;; (probably) can be used as a group name. + (setq group + (replace-regexp-in-string + "[/\\]" "." + (replace-regexp-in-string + "/?\\(cur\\|new\\|tmp\\)?/\\'" "" + (replace-regexp-in-string + "^[./\\]" "" + group nil t) + nil t) + nil t)) + + (push (vector (gnus-group-full-name group server) + (if (string-match-p "\\`[[:digit:]]+\\'" article) + (string-to-number article) + (nnmaildir-base-name-to-article-number + (substring article 0 (string-match ":" article)) + group nil)) + (if (numberp score) + score + (string-to-number score))) + vectors)) + vectors)) + +(cl-defmethod gnus-search-indexed-extract ((_engine gnus-search-indexed)) + "Base implementation treats the whole line as a filename, and +fudges a relevancy score of 100." + (prog1 + (list (buffer-substring-no-properties (line-beginning-position) + (line-end-position)) + 100) + (forward-line 1))) + +;; Swish++ + +(cl-defmethod gnus-search-transform-expression ((engine gnus-search-swish++) + (expr (head near))) + (format "%s near %s" + (gnus-search-transform-expression engine (nth 1 expr)) + (gnus-search-transform-expression engine (nth 2 expr)))) + +(cl-defmethod gnus-search-transform-expression ((engine gnus-search-swish++) + (expr list)) + (cond + ((listp (car expr)) + (format "(%s)" (gnus-search-transform engine expr))) + ;; Untested and likely wrong. + ((and (stringp (cdr expr)) + (string-prefix-p "(" (cdr expr))) + (format "%s = %s" (car expr) (gnus-search-transform + engine + (gnus-search-parse-query (cdr expr))))) + (t (format "%s = %s" (car expr) (cdr expr))))) + +(cl-defmethod gnus-search-indexed-search-command ((engine gnus-search-swish++) + (qstring string) + _query &optional _groups) + (with-slots (config-file switches) engine + `("--config-file" ,config-file + ,@switches + ,qstring + ))) + +(cl-defmethod gnus-search-indexed-extract ((_engine gnus-search-swish++)) + (when (re-search-forward + "\\(^[0-9]+\\) \\([^ ]+\\) [0-9]+ \\(.*\\)$" nil t) + (list (match-string 2) + (match-string 1)))) + +;; Swish-e + +;; I didn't do the query transformation for Swish-e, because the +;; program seems no longer to exist. + +(cl-defmethod gnus-search-indexed-search-command ((engine gnus-search-swish-e) + (qstring string) + _query &optional _groups) + (with-slots (index-files switches) engine + `("-f" ,@index-files + ,@switches + "-w" + ,qstring + ))) + +(cl-defmethod gnus-search-indexed-extract ((_engine gnus-search-swish-e)) + (when (re-search-forward + "\\(^[0-9]+\\) \\([^ ]+\\) \"\\([^\"]+\\)\" [0-9]+$" nil t) + (list (match-string 3) + (match-string 1)))) + +;; Namazu interface + +(cl-defmethod gnus-search-transform-expression ((engine gnus-search-namazu) + (expr list)) + (cond + ((listp (car expr)) + (format "(%s)" (gnus-search-transform engine expr))) + ((eql (car expr) 'body) + (cadr expr)) + ;; I have no idea which fields namazu can handle. Just do these + ;; for now. + ((memq (car expr) '(subject from to)) + (format "+%s:%s" (car expr) (cdr expr))) + ((eql (car expr) 'address) + (gnus-search-transform engine `((or (from . ,(cdr expr)) + (to . ,(cdr expr)))))) + ((eq (car expr) 'id) + (format "+message-id:%s" (cdr expr))) + (t (ignore-errors (cl-call-next-method))))) + +;; I can't tell if this is actually necessary. +(cl-defmethod gnus-search-run-search :around ((_e gnus-search-namazu) + _server _query _groups) + (let ((process-environment (copy-sequence process-environment))) + (setenv "LC_MESSAGES" "C") + (cl-call-next-method))) + +(cl-defmethod gnus-search-indexed-search-command ((engine gnus-search-namazu) + (qstring string) + query &optional _groups) + (let ((max (alist-get 'limit query))) + (with-slots (switches index-directory) engine + (append + (list "-q" ; don't be verbose + "-a" ; show all matches + "-s") ; use short format + (when max (list (format "--max=%d" max))) + switches + (list qstring index-directory))))) + +(cl-defmethod gnus-search-indexed-extract ((_engine gnus-search-namazu)) + "Extract a single message result for Namazu. +Namazu provides a little more information, for instance a score." + + (when (re-search-forward + "^\\([0-9,]+\\.\\).*\\((score: \\([0-9]+\\)\\))\n\\([^ ]+\\)" + nil t) + (list (match-string 4) + (match-string 3)))) + +;;; Notmuch interface + +(cl-defmethod gnus-search-transform ((_engine gnus-search-notmuch) + (_query null)) + "*") + +(cl-defmethod gnus-search-transform-expression ((engine gnus-search-notmuch) + (expr (head near))) + (format "%s near %s" + (gnus-search-transform-expression engine (nth 1 expr)) + (gnus-search-transform-expression engine (nth 2 expr)))) + +(cl-defmethod gnus-search-transform-expression ((engine gnus-search-notmuch) + (expr list)) + ;; Swap keywords as necessary. + (cl-case (car expr) + (sender (setcar expr 'from)) + ;; Notmuch's "to" is already equivalent to our "recipient". + (recipient (setcar expr 'to)) + (mark (setcar expr 'tag))) + ;; Then actually format the results. + (cl-flet ((notmuch-date (date) + (if (stringp date) + date + (pcase date + (`(nil ,m nil) + (nth (1- m) gnus-english-month-names)) + (`(nil nil ,y) + (number-to-string y)) + (`(,d ,m nil) + (format "%02d-%02d" d m)) + (`(nil ,m ,y) + (format "%02d-%d" m y)) + (`(,d ,m ,y) + (format "%d/%d/%d" m d y)))))) + (cond + ((consp (car expr)) + (format "(%s)" (gnus-search-transform engine expr))) + ((eql (car expr) 'address) + (gnus-search-transform engine `((or (from . ,(cdr expr)) + (to . ,(cdr expr)))))) + ((eql (car expr) 'body) + (cdr expr)) + ((memq (car expr) '(from to subject attachment mimetype tag id + thread folder path lastmod query property)) + ;; Notmuch requires message-id with no angle brackets. + (when (eql (car expr) 'id) + (setcdr + expr (replace-regexp-in-string "\\`<\\|>\\'" "" (cdr expr)))) + (format "%s:%s" (car expr) + (if (string-match "\\`\\*" (cdr expr)) + ;; Notmuch can only handle trailing asterisk + ;; wildcards, so strip leading asterisks. + (replace-match "" nil nil (cdr expr)) + (cdr expr)))) + ((eq (car expr) 'date) + (format "date:%s" (notmuch-date (cdr expr)))) + ((eq (car expr) 'before) + (format "date:..%s" (notmuch-date (cdr expr)))) + ((eq (car expr) 'since) + (format "date:%s.." (notmuch-date (cdr expr)))) + (t (ignore-errors (cl-call-next-method)))))) + +(cl-defmethod gnus-search-run-search :around ((engine gnus-search-notmuch) + server query groups) + "Handle notmuch's thread-search routine." + ;; Notmuch allows for searching threads, but only using its own + ;; thread ids. That means a thread search is a \"double-bounce\": + ;; once to find the relevant thread ids, and again to find the + ;; actual messages. This method performs the first \"bounce\". + (if (alist-get 'thread query) + (with-slots (program proc-buffer) engine + (let* ((qstring + (gnus-search-make-query-string engine query)) + (cp-list (gnus-search-indexed-search-command + engine qstring query groups)) + thread-ids proc) + (set-buffer proc-buffer) + (erase-buffer) + (setq proc (apply #'start-process (format "search-%s" server) + proc-buffer program cp-list)) + (while (process-live-p proc) + (accept-process-output proc)) + (while (re-search-forward "^thread:\\([^ ]+\\)" (point-max) t) + (push (match-string 1) thread-ids)) + (cl-call-next-method + engine server + ;; Completely replace the query with our new thread-based one. + (mapconcat (lambda (thrd) (concat "thread:" thrd)) + thread-ids " or ") + nil))) + (cl-call-next-method engine server query groups))) + +(cl-defmethod gnus-search-indexed-search-command ((engine gnus-search-notmuch) + (qstring string) + query &optional _groups) + ;; Theoretically we could use the GROUPS parameter to pass a + ;; --folder switch to notmuch, but I'm not confident of getting the + ;; format right. + (let ((limit (alist-get 'limit query)) + (thread (alist-get 'thread query))) + (with-slots (switches config-file) engine + `(,(format "--config=%s" config-file) + "search" + ,(if thread + "--output=threads" + "--output=files") + "--duplicate=1" ; I have found this necessary, I don't know why. + ,@switches + ,(if limit (format "--limit=%d" limit) "") + ,qstring + )))) + +;;; Mairix interface + +;; See the Gnus manual for why mairix searching is a bit weird. + +(cl-defmethod gnus-search-transform ((engine gnus-search-mairix) + (query list)) + "Transform QUERY for a Mairix engine. +Because Mairix doesn't accept parenthesized expressions, nor +\"or\" statements between different keys, results may differ from +other engines. We unpeel parenthesized expressions, and just +cross our fingers for the rest of it." + (let (clauses) + (mapc + (lambda (item) + (when-let ((expr (if (consp (car-safe item)) + (gnus-search-transform engine item) + (gnus-search-transform-expression engine item)))) + (push expr clauses))) + query) + (mapconcat #'identity (reverse clauses) " "))) + +(cl-defmethod gnus-search-transform-expression ((engine gnus-search-mairix) + (expr (head not))) + "Transform Mairix \"not\". +Mairix negation requires a \"~\" preceding string search terms, +and \"-\" before marks." + (let ((next (gnus-search-transform-expression engine (cadr expr)))) + (replace-regexp-in-string + ":" + (if (eql (caadr expr) 'mark) + ":-" + ":~") + next))) + +(cl-defmethod gnus-search-transform-expression ((engine gnus-search-mairix) + (expr (head or))) + "Handle Mairix \"or\" statement. +Mairix only accepts \"or\" expressions on homogenous keys. We +cast \"or\" expressions on heterogenous keys as \"and\", which +isn't quite right, but it's the best we can do. For date keys, +only keep one of the terms." + (let ((term1 (caadr expr)) + (term2 (caaddr expr)) + (val1 (gnus-search-transform-expression engine (nth 1 expr))) + (val2 (gnus-search-transform-expression engine (nth 2 expr)))) + (cond + ((or (listp term1) (listp term2)) + (concat val1 " " val2)) + ((and (member (symbol-name term1) gnus-search-date-keys) + (member (symbol-name term2) gnus-search-date-keys)) + (or val1 val2)) + ((eql term1 term2) + (if (and val1 val2) + (format "%s/%s" + val1 + (nth 1 (split-string val2 ":"))) + (or val1 val2))) + (t (concat val1 " " val2))))) + + +(cl-defmethod gnus-search-transform-expression ((_ gnus-search-mairix) + (expr (head mark))) + (gnus-search-mairix-handle-mark (cdr expr))) + +(cl-defmethod gnus-search-transform-expression ((engine gnus-search-mairix) + (expr list)) + (let ((key (cl-case (car expr) + (sender "f") + (from "f") + (to "t") + (cc "c") + (subject "s") + (id "m") + (body "b") + (address "a") + (recipient "tc") + (text "bs") + (attachment "n") + (t nil)))) + (cond + ((consp (car expr)) + (gnus-search-transform engine expr)) + ((member (symbol-name (car expr)) gnus-search-date-keys) + (gnus-search-mairix-handle-date expr)) + ((memq (car expr) '(size smaller larger)) + (gnus-search-mairix-handle-size expr)) + ;; Drop regular expressions. + ((string-match-p "\\`/" (cdr expr)) + nil) + ;; Turn parenthesized phrases into multiple word terms. Again, + ;; this isn't quite what the user is asking for, but better to + ;; return false positives. + ((and key (string-match-p "[[:blank:]]" (cdr expr))) + (mapconcat + (lambda (s) (format "%s:%s" key s)) + (split-string (gnus-search-mairix-treat-string + (cdr expr))) + " ")) + (key (format "%s:%s" key + (gnus-search-mairix-treat-string + (cdr expr)))) + (t nil)))) + +(defun gnus-search-mairix-treat-string (str) + "Treat string for wildcards. +Mairix accepts trailing wildcards, but not leading. Also remove +double quotes." + (replace-regexp-in-string + "\\`\\*\\|\"" "" + (replace-regexp-in-string "\\*\\'" "=" str))) + +(defun gnus-search-mairix-handle-size (expr) + "Format a mairix size search. +Assume \"size\" key is equal to \"larger\"." + (format + (if (eql (car expr) 'smaller) + "z:-%s" + "z:%s-") + (cdr expr))) + +(defun gnus-search-mairix-handle-mark (expr) + "Format a mairix mark search." + (let ((mark + (pcase (cdr expr) + ("flag" "f") + ("read" "s") + ("seen" "s") + ("replied" "r") + (_ nil)))) + (when mark + (format "F:%s" mark)))) + +(defun gnus-search-mairix-handle-date (expr) + (let ((str + (pcase (cdr expr) + (`(nil ,m nil) + (substring + (nth (1- m) gnus-english-month-names) + 0 3)) + (`(nil nil ,y) + (number-to-string y)) + (`(,d ,m nil) + (format "%s%02d" + (substring + (nth (1- m) gnus-english-month-names) + 0 3) + d)) + (`(nil ,m ,y) + (format "%d%s" + y (substring + (nth (1- m) gnus-english-month-names) + 0 3))) + (`(,d ,m ,y) + (format "%d%02d%02d" y m d))))) + (format + (pcase (car expr) + ('date "d:%s") + ('since "d:%s-") + ('after "d:%s-") + ('before "d:-%s")) + str))) + +(cl-defmethod gnus-search-indexed-search-command ((engine gnus-search-mairix) + (qstring string) + query &optional _groups) + (with-slots (switches config-file) engine + (append `("--rcfile" ,config-file "-r") + switches + (when (alist-get 'thread query) (list "-t")) + (list qstring)))) + +;;; Find-grep interface + +(cl-defmethod gnus-search-transform-expression ((_engine gnus-search-find-grep) + (_ list)) + ;; Drop everything that isn't a plain string. + nil) + +(cl-defmethod gnus-search-run-search ((engine gnus-search-find-grep) + server query + &optional groups) + "Run find and grep to obtain matching articles." + (let* ((method (gnus-server-to-method server)) + (sym (intern + (concat (symbol-name (car method)) "-directory"))) + (directory (cadr (assoc sym (cddr method)))) + (regexp (alist-get 'grep query)) + (grep-options (slot-value engine 'grep-options)) + (grouplist (or groups (gnus-search-get-active server))) + (buffer (slot-value engine 'proc-buffer))) + (unless directory + (error "No directory found in method specification of server %s" + server)) + (apply + 'vconcat + (mapcar (lambda (x) + (let ((group x) + artlist) + (message "Searching %s using find-grep..." + (or group server)) + (save-window-excursion + (set-buffer buffer) + (if (> gnus-verbose 6) + (pop-to-buffer (current-buffer))) + (cd directory) ; Using relative paths simplifies + ; postprocessing. + (let ((group + (if (not group) + "." + ;; Try accessing the group literally as + ;; well as interpreting dots as directory + ;; separators so the engine works with + ;; plain nnml as well as the Gnus Cache. + (let ((group (gnus-group-real-name group))) + ;; Replace cl-func find-if. + (if (file-directory-p group) + group + (if (file-directory-p + (setq group + (replace-regexp-in-string + "\\." "/" + group nil t))) + group)))))) + (unless group + (error "Cannot locate directory for group")) + (save-excursion + (apply + 'call-process "find" nil t + "find" group "-maxdepth" "1" "-type" "f" + "-name" "[0-9]*" "-exec" + (slot-value engine 'grep-program) + `("-l" ,@(and grep-options + (split-string grep-options "\\s-" t)) + "-e" ,regexp "{}" "+")))) + + ;; Translate relative paths to group names. + (while (not (eobp)) + (let* ((path (split-string + (buffer-substring + (point) + (line-end-position)) "/" t)) + (art (string-to-number (car (last path))))) + (while (string= "." (car path)) + (setq path (cdr path))) + (let ((group (mapconcat #'identity + (cl-subseq path 0 -1) + "."))) + (push + (vector (gnus-group-full-name group server) art 0) + artlist)) + (forward-line 1))) + (message "Searching %s using find-grep...done" + (or group server)) + artlist))) + grouplist)))) + +(declare-function mm-url-insert "mm-url" (url &optional follow-refresh)) +(declare-function mm-url-encode-www-form-urlencoded "mm-url" (pairs)) + +;; gmane interface +(cl-defmethod gnus-search-run-search ((engine gnus-search-gmane) + srv query &optional groups) + "Run a search against a gmane back-end server." + (let* ((case-fold-search t) + (groupspec (mapconcat + (lambda (x) + (if (string-match-p "gmane" x) + (format "group:%s" (gnus-group-short-name x)) + (error "Can't search non-gmane groups: %s" x))) + groups " ")) + (buffer (slot-value engine 'proc-buffer)) + (search (concat (gnus-search-make-query-string engine query) + " " + groupspec)) + (gnus-inhibit-demon t) + artlist) + (require 'mm-url) + (with-current-buffer buffer + (erase-buffer) + (mm-url-insert + (concat + "http://search.gmane.org/nov.php" + "?" + (mm-url-encode-www-form-urlencoded + `(("query" . ,search) + ("HITSPERPAGE" . "999"))))) + (set-buffer-multibyte t) + (decode-coding-region (point-min) (point-max) 'utf-8) + (goto-char (point-min)) + (forward-line 1) + (while (not (eobp)) + (unless (or (eolp) (looking-at "\x0d")) + (let ((header (nnheader-parse-nov))) + (let ((xref (mail-header-xref header)) + (xscore (string-to-number (cdr (assoc 'X-Score + (mail-header-extra header)))))) + (when (string-match " \\([^:]+\\)[:/]\\([0-9]+\\)" xref) + (push + (vector + (gnus-group-prefixed-name (match-string 1 xref) srv) + (string-to-number (match-string 2 xref)) xscore) + artlist))))) + (forward-line 1))) + (apply #'vector (nreverse (delete-dups artlist))))) + +(cl-defmethod gnus-search-transform-expression ((_e gnus-search-gmane) + (_expr (head near))) + nil) + +;; Can Gmane handle OR or NOT keywords? +(cl-defmethod gnus-search-transform-expression ((_e gnus-search-gmane) + (_expr (head or))) + nil) + +(cl-defmethod gnus-search-transform-expression ((_e gnus-search-gmane) + (_expr (head not))) + nil) + +(cl-defmethod gnus-search-transform-expression ((_e gnus-search-gmane) + (expr list)) + "The only keyword value gmane can handle is author, ie from." + (cond + ((memq (car expr) '(from sender author address)) + (format "author:%s" (cdr expr))) + ((eql (car expr) 'body) + (cdr expr)))) + +;;; Util Code: + +(defun gnus-search-run-query (specs) + "Invoke appropriate search engine function." + ;; For now, run the searches synchronously. At some point + ;; multiple-server searches can each be run in their own thread, + ;; allowing concurrent searches of multiple backends. At present + ;; this causes problems when searching more than one server that + ;; uses `nntp-server-buffer', as their return values are written + ;; interleaved into that buffer. Anyway, that's the reason for the + ;; `mapc'. + (let* ((results []) + (prepared-query (gnus-search-prepare-query + (alist-get 'search-query-spec specs))) + (limit (alist-get 'limit prepared-query))) + (mapc + (pcase-lambda (`(,server . ,groups)) + (let ((search-engine (gnus-search-server-to-engine server))) + (setq results + (vconcat + (gnus-search-run-search + search-engine server prepared-query groups) + results)))) + (alist-get 'search-group-spec specs)) + ;; Some search engines do their own limiting, but some don't, so + ;; do it again here. This is bad because, if the user is + ;; searching multiple groups, they would reasonably expect the + ;; limiting to apply to the search results *after sorting*. Doing + ;; it this way is liable to, for instance, eliminate all results + ;; from a later group entirely. + (if limit + (seq-subseq results 0 (min limit (length results))) + results))) + +(defun gnus-search-prepare-query (query-spec) + "Accept a search query in raw format, and prepare it. +QUERY-SPEC is an alist produced by functions such as +`gnus-group-make-search-group', and contains at least a 'query +key, and possibly some meta keys. This function extracts any +additional meta keys from the 'query string, and parses the +remaining string, then adds all that to the top-level spec." + (let ((query (alist-get 'query query-spec)) + val) + (when (stringp query) + ;; Look for these meta keys: + (while (string-match + "\\(thread\\|grep\\|limit\\|raw\\):\\([^ ]+\\)" + query) + (setq val (match-string 2 query)) + (setf (alist-get (intern (match-string 1 query)) query-spec) + ;; This is stupid. + (cond + ((equal val "t")) + ((null (zerop (string-to-number val))) + (string-to-number val)) + (t val))) + (setq query + (string-trim (replace-match "" t t query 0))) + (setf (alist-get 'query query-spec) query))) + (when gnus-search-use-parsed-queries + (setf (alist-get 'parsed-query query-spec) + (gnus-search-parse-query query))) + query-spec)) + +;; This should be done once at Gnus startup time, when the servers are +;; first opened, and the resulting engine instance attached to the +;; server. +(defun gnus-search-server-to-engine (srv) + (let* ((method (gnus-server-to-method srv)) + (server + (or (assoc 'gnus-search-engine (cddr method)) + (assoc (car method) gnus-search-default-engines) + (when-let ((old (assoc 'nnir-search-engine + (cddr method)))) + (nnheader-message + 8 "\"nnir-search-engine\" is no longer a valid parameter") + (pcase old + ('notmuch 'gnus-search-notmuch) + ('namazu 'gnus-search-namazu) + ('find-grep 'gnus-search-find-grep))))) + (inst + (cond + ((null server) nil) + ((eieio-object-p (cadr server)) + (cadr server)) + ((class-p (cadr server)) + (make-instance (cadr server))) + (t nil)))) + (if inst + (when (cddr server) + (pcase-dolist (`(,key ,value) (cddr server)) + (condition-case nil + (setf (slot-value inst key) value) + ((invalid-slot-name invalid-slot-type) + (nnheader-message + 5 "Invalid search engine parameter: (%s %s)" + key value))))) + (nnheader-message 5 "No search engine defined for %s" srv)) + inst)) + +(declare-function gnus-registry-get-id-key "gnus-registry" (id key)) + +(defun gnus-search-thread (header) + "Make an nnselect group based on the thread containing the article +header. The current server will be searched. If the registry is +installed, the server that the registry reports the current +article came from is also searched." + (let* ((ids (cons (mail-header-id header) + (split-string + (or (mail-header-references header) + "")))) + (query + (list (cons 'query (mapconcat (lambda (i) + (format "id:%s" i)) + ids " or ")) + (cons 'thread t))) + (server + (list (list (gnus-method-to-server + (gnus-find-method-for-group gnus-newsgroup-name))))) + (registry-group (and + (bound-and-true-p gnus-registry-enabled) + (car (gnus-registry-get-id-key + (mail-header-id header) 'group)))) + (registry-server + (and registry-group + (gnus-method-to-server + (gnus-find-method-for-group registry-group))))) + (when registry-server + (cl-pushnew (list registry-server) server :test #'equal)) + (gnus-group-make-search-group nil (list + (cons 'search-query-spec query) + (cons 'search-group-spec server))) + (gnus-summary-goto-subject (gnus-id-to-article (mail-header-id header))))) + +(defun gnus-search-get-active (srv) + (let ((method (gnus-server-to-method srv)) + groups) + (gnus-request-list method) + (with-current-buffer nntp-server-buffer + (let ((cur (current-buffer))) + (goto-char (point-min)) + (unless (or (null gnus-search-ignored-newsgroups) + (string= gnus-search-ignored-newsgroups "")) + (delete-matching-lines gnus-search-ignored-newsgroups)) + (if (eq (car method) 'nntp) + (while (not (eobp)) + (ignore-errors + (push (gnus-group-decoded-name + (gnus-group-full-name + (buffer-substring + (point) + (progn + (skip-chars-forward "^ \t") + (point))) + method)) + groups)) + (forward-line)) + (while (not (eobp)) + (ignore-errors + (push (gnus-group-decoded-name + (if (eq (char-after) ?\") + (gnus-group-full-name (read cur) method) + (let ((p (point)) (name "")) + (skip-chars-forward "^ \t\\\\") + (setq name (buffer-substring p (point))) + (while (eq (char-after) ?\\) + (setq p (1+ (point))) + (forward-char 2) + (skip-chars-forward "^ \t\\\\") + (setq name (concat name (buffer-substring + p (point))))) + (gnus-group-full-name name method)))) + groups)) + (forward-line))))) + groups)) + +(defvar gnus-search-minibuffer-map + (let ((km (make-sparse-keymap))) + (set-keymap-parent km minibuffer-local-map) + (define-key km (kbd "TAB") #'completion-at-point) + km)) + +(defun gnus-search--complete-key-data () + "Potentially return completion data for a search key or value." + (let* ((key-start (save-excursion + (if (re-search-backward " " (minibuffer-prompt-end) t) + (1+ (point)) + (minibuffer-prompt-end)))) + (after-colon (save-excursion + (when (re-search-backward ":" key-start t) + (1+ (point))))) + in-string) + (if after-colon + ;; We're in the value part of a key:value pair, which we + ;; only handle in a contact-completion context. + (when (and gnus-search-contact-tables + (save-excursion + (re-search-backward "\\<\\(\\w+\\):" key-start t) + (member (match-string 1) + '("from" "to" "cc" + "bcc" "recipient" "address")))) + (setq in-string (nth 3 (syntax-ppss))) + (list (if in-string (1+ after-colon) after-colon) + (point) (apply #'completion-table-merge + gnus-search-contact-tables) + :exit-function + (lambda (str status) + ;; If the value contains spaces, make sure it's + ;; quoted. + (when (and (memql status '(exact finished)) + (string-match-p " " str)) + (unless (looking-at-p "\\s\"") + (insert "\"")) + ;; Unless we already have an opening quote... + (unless in-string + (save-excursion + (goto-char after-colon) + (insert "\""))))))) + (list + key-start (point) gnus-search-expandable-keys + :exit-function (lambda (_s status) + (when (memql status '(exact finished)) + (insert ":"))))))) + +(defun gnus-search-make-spec (arg) + (list (cons 'query + (minibuffer-with-setup-hook + (lambda () + (add-hook 'completion-at-point-functions + #'gnus-search--complete-key-data)) + (read-from-minibuffer + "Query: " nil gnus-search-minibuffer-map + nil 'gnus-search-history))) + (cons 'raw arg))) + +(provide 'gnus-search) +;;; gnus-search.el ends here diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index 21206b683c..ce2e99de05 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -36,10 +36,10 @@ ;; sorting. Most functions will just chose a fixed number, such as ;; 100, for this score. -;; For example the search function `nnir-run-query' applied to -;; arguments specifying a search query (see "nnir.el") can be used to -;; return a list of articles from a search. Or the function can be the -;; identity and the args a vector of articles. +;; For example the search function `gnus-search-run-query' applied to +;; arguments specifying a search query (see "gnus-search.el") can be +;; used to return a list of articles from a search. Or the function +;; can be the identity and the args a vector of articles. ;;; Code: @@ -47,7 +47,7 @@ ;;; Setup: (require 'gnus-art) -(require 'nnir) +(require 'gnus-search) (eval-when-compile (require 'cl-lib)) @@ -372,25 +372,25 @@ If this variable is nil, or if the provided function returns nil, ;; find the servers for a pseudo-article (if (eq 'nnselect (car (gnus-server-to-method server))) (with-current-buffer gnus-summary-buffer - (let ((thread (gnus-id-to-thread article))) + (let ((thread (gnus-id-to-thread article))) (when thread (mapc - #'(lambda (x) - (when (and x (> x 0)) - (cl-pushnew - (list - (gnus-method-to-server - (gnus-find-method-for-group - (nnselect-article-group x)))) servers :test 'equal))) + (lambda (x) + (when (and x (> x 0)) + (cl-pushnew + (list + (gnus-method-to-server + (gnus-find-method-for-group + (nnselect-article-group x)))) servers :test 'equal))) (gnus-articles-in-thread thread))))) (setq servers (list (list server)))) (setq artlist - (nnir-run-query + (gnus-search-run-query (list - (cons 'nnir-query-spec - (list (cons 'query (format "HEADER Message-ID %s" article)) - (cons 'criteria "") (cons 'shortcut t))) - (cons 'nnir-group-spec servers)))) + (cons 'search-query-spec + (list (cons 'query `((id . ,article))) + (cons 'criteria "") (cons 'shortcut t))) + (cons 'search-group-spec servers)))) (unless (zerop (nnselect-artlist-length artlist)) (setq group-art @@ -603,26 +603,35 @@ If this variable is nil, or if the provided function returns nil, (cl-some #'(lambda (x) (when (and x (> x 0)) x)) (gnus-articles-in-thread thread))))))))) - ;; Check if we are dealing with an imap backend. - (if (eq 'nnimap - (car (gnus-find-method-for-group artgroup))) + ;; Check if search-based thread referral is permitted, and + ;; available. + (if (and gnus-refer-thread-use-search + (gnus-search-server-to-engine + (gnus-method-to-server + (gnus-find-method-for-group artgroup)))) ;; If so we perform the query, massage the result, and return ;; the new headers back to the caller to incorporate into the ;; current summary buffer. (let* ((group-spec (list (delq nil (list (or server (gnus-group-server artgroup)) - (unless gnus-refer-thread-use-search + (unless gnus-refer-thread-use-search artgroup))))) + (ids (cons (mail-header-id header) + (split-string + (or (mail-header-references header) + "")))) (query-spec - (list (cons 'query (nnimap-make-thread-query header)) - (cons 'criteria ""))) + (list (cons 'query (mapconcat (lambda (i) + (format "id:%s" i)) + ids " or ")) + (cons 'thread t))) (last (nnselect-artlist-length gnus-newsgroup-selection)) (first (1+ last)) (new-nnselect-artlist - (nnir-run-query - (list (cons 'nnir-query-spec query-spec) - (cons 'nnir-group-spec group-spec)))) + (gnus-search-run-query + (list (cons 'search-query-spec query-spec) + (cons 'search-group-spec group-spec)))) old-arts seq headers) (mapc @@ -670,7 +679,7 @@ If this variable is nil, or if the provided function returns nil, group (cons 1 (nnselect-artlist-length gnus-newsgroup-selection)))) headers) - ;; If not an imap backend just warp to the original article + ;; If we can't or won't use search, just warp to the original ;; group and punt back to gnus-summary-refer-thread. (and (gnus-warp-to-article) (gnus-summary-refer-thread)))))) @@ -768,9 +777,15 @@ Return an article list." The current server will be searched. If the registry is installed, the server that the registry reports the current article came from is also searched." - (let* ((query - (list (cons 'query (nnimap-make-thread-query header)) - (cons 'criteria ""))) + (let* ((ids (cons (mail-header-id header) + (split-string + (or (mail-header-references header) + "")))) + (query + (list (cons 'query (mapconcat (lambda (i) + (format "id:%s" i)) + ids " or ")) + (cons 'thread t))) (server (list (list (gnus-method-to-server (gnus-find-method-for-group gnus-newsgroup-name))))) @@ -794,10 +809,10 @@ article came from is also searched." (list (cons 'nnselect-specs (list - (cons 'nnselect-function 'nnir-run-query) + (cons 'nnselect-function 'gnus-search-run-query) (cons 'nnselect-args - (list (cons 'nnir-query-spec query) - (cons 'nnir-group-spec server))))) + (list (cons 'search-query-spec query) + (cons 'search-group-spec server))))) (cons 'nnselect-artlist nil))) (gnus-summary-goto-subject (gnus-id-to-article (mail-header-id header))))) @@ -929,18 +944,18 @@ article came from is also searched." (declare-function gnus-registry-get-id-key "gnus-registry" (id key)) -(defun gnus-summary-make-search-group (nnir-extra-parms) +(defun gnus-summary-make-search-group (no-parse) "Search a group from the summary buffer. -Pass NNIR-EXTRA-PARMS on to the search engine." +Pass NO-PARSE on to the search engine." (interactive "P") (gnus-warp-to-article) (let ((spec (list - (cons 'nnir-group-spec + (cons 'search-group-spec (list (list (gnus-group-server gnus-newsgroup-name) gnus-newsgroup-name)))))) - (gnus-group-make-search-group nnir-extra-parms spec))) + (gnus-group-make-search-group no-parse spec))) ;; The end. diff --git a/test/lisp/gnus/gnus-search-tests.el b/test/lisp/gnus/gnus-search-tests.el new file mode 100644 index 0000000000..5bae9cb14d --- /dev/null +++ b/test/lisp/gnus/gnus-search-tests.el @@ -0,0 +1,96 @@ +;;; gnus-search-tests.el --- Tests for Gnus' search routines -*- lexical-binding: t; -*- + +;; Copyright (C) 2017 Free Software Foundation, Inc. + +;; Author: Eric Abrahamsen +;; Keywords: + +;; This program 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. + +;; This program 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 this program. If not, see . + +;;; Commentary: + +;; Tests for the search parsing, search engines, and their +;; transformations. + +;;; Code: + +(require 'ert) +(require 'gnus-search) + +(ert-deftest gnus-s-parse () + "Test basic structural parsing." + (let ((pairs + '(("string" . ("string")) + ("from:john" . ((from . "john"))) + ("here and there" . ("here" and "there")) + ("here or there" . ((or "here" "there"))) + ("here (there or elsewhere)" . ("here" ((or "there" "elsewhere")))) + ("here not there" . ("here" (not "there"))) + ("from:boss or not vacation" . ((or (from . "boss") (not "vacation"))))))) + (dolist (p pairs) + (should (equal (gnus-search-parse-query (car p)) (cdr p)))))) + +(ert-deftest gnus-s-expand-keyword () + "Test expansion of keywords" + (let ((gnus-search-expandable-keys + (default-value 'gnus-search-expandable-keys)) + (pairs + '(("su" . "subject") + ("sin" . "since")))) + (dolist (p pairs) + (should (equal (gnus-search-query-expand-key (car p)) + (cdr p)))) + (should-error (gnus-search-query-expand-key "s") + :type 'gnus-search-parse-error))) + +(ert-deftest gnus-s-parse-date () + "Test parsing of date expressions." + (let ((rel-date (encode-time 0 0 0 15 4 2017)) + (pairs + '(("January" . (nil 1 nil)) + ("2017" . (nil nil 2017)) + ("15" . (15 nil nil)) + ("January 15" . (15 1 nil)) + ("tuesday" . (11 4 2017)) + ("1d" . (14 4 2017)) + ("1w" . (8 4 2017))))) + (dolist (p pairs) + (should (equal (gnus-search-query-parse-date (car p) rel-date) + (cdr p)))))) + +(ert-deftest gnus-s-delimited-string () + "Test proper functioning of `gnus-search-query-return-string'." + (with-temp-buffer + (insert "one\ntwo words\nthree \"words with quotes\"\n\"quotes at start\"\n/alternate \"quotes\"/\n(more bits)") + (goto-char (point-min)) + (should (string= (gnus-search-query-return-string) + "one")) + (forward-line) + (should (string= (gnus-search-query-return-string) + "two")) + (forward-line) + (should (string= (gnus-search-query-return-string) + "three")) + (forward-line) + (should (string= (gnus-search-query-return-string "\"") + "\"quotes at start\"")) + (forward-line) + (should (string= (gnus-search-query-return-string "/") + "/alternate \"quotes\"/")) + (forward-line) + (should (string= (gnus-search-query-return-string ")" t) + "more bits")))) + +(provide 'gnus-search-tests) +;;; search-tests.el ends here commit 9aa6b5bb89beb07175e9f36c7b1ff28df8456531 Author: Stefan Monnier Date: Tue Nov 3 23:02:13 2020 -0500 * lisp/progmodes/tcl.el: Use lexical-binding Remove redundant `:group` args. diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index d4d51e8b50..f0dd9afa4c 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el @@ -1,4 +1,4 @@ -;;; tcl.el --- Tcl code editing commands for Emacs +;;; tcl.el --- Tcl code editing commands for Emacs -*- lexical-binding: t; -*- ;; Copyright (C) 1994, 1998-2020 Free Software Foundation, Inc. @@ -120,20 +120,17 @@ (defcustom tcl-indent-level 4 "Indentation of Tcl statements with respect to containing block." - :type 'integer - :group 'tcl) -(put 'tcl-indent-level 'safe-local-variable 'integerp) + :type 'integer) +(put 'tcl-indent-level 'safe-local-variable #'integerp) (defcustom tcl-continued-indent-level 4 "Indentation of continuation line relative to first line of command." - :type 'integer - :group 'tcl) -(put 'tcl-continued-indent-level 'safe-local-variable 'integerp) + :type 'integer) +(put 'tcl-continued-indent-level 'safe-local-variable #'integerp) (defcustom tcl-auto-newline nil "Non-nil means automatically newline before and after braces you insert." - :type 'boolean - :group 'tcl) + :type 'boolean) (defcustom tcl-tab-always-indent tab-always-indent "Control effect of TAB key. @@ -151,8 +148,7 @@ to take place: 6. Move backward to start of comment, indenting if necessary." :type '(choice (const :tag "Always" t) (const :tag "Beginning only" nil) - (other :tag "Maybe move or make or delete comment" tcl)) - :group 'tcl) + (other :tag "Maybe move or make or delete comment" tcl))) (defcustom tcl-electric-hash-style nil ;; 'smart @@ -163,28 +159,23 @@ meaning that the choice between `backslash' and `quote' should be made depending on the number of hashes inserted; or nil, meaning that no quoting should be done. Any other value for this variable is taken to mean `smart'. The default is nil." - :type '(choice (const backslash) (const quote) (const smart) (const nil)) - :group 'tcl) + :type '(choice (const backslash) (const quote) (const smart) (const nil))) (defcustom tcl-help-directory-list nil "List of topmost directories containing TclX help files." - :type '(repeat directory) - :group 'tcl) + :type '(repeat directory)) (defcustom tcl-use-smart-word-finder t "If not nil, use smart way to find current word, for Tcl help feature." - :type 'boolean - :group 'tcl) + :type 'boolean) (defcustom tcl-application "wish" "Name of Tcl program to run in inferior Tcl mode." - :type 'string - :group 'tcl) + :type 'string) (defcustom tcl-command-switches nil "List of switches to supply to the `tcl-application' program." - :type '(repeat string) - :group 'tcl) + :type '(repeat string)) (defcustom tcl-prompt-regexp "^\\(% \\|\\)" "If not nil, a regexp that will match the prompt in the inferior process. @@ -192,8 +183,7 @@ If nil, the prompt is the name of the application with \">\" appended. The default is \"^\\(% \\|\\)\", which will match the default primary and secondary prompts for tclsh and wish." - :type 'regexp - :group 'tcl) + :type 'regexp) (defcustom inferior-tcl-source-command "source %s\n" "Format-string for building a Tcl command to load a file. @@ -201,12 +191,10 @@ This format string should use `%s' to substitute a file name and should result in a Tcl expression that will command the inferior Tcl to load that file. The filename will be appropriately quoted for Tcl." - :type 'string - :group 'tcl) + :type 'string) (defface tcl-escaped-newline '((t :inherit font-lock-string-face)) "Face used for (non-escaped) backslash at end of a line in Tcl mode." - :group 'tcl :version "22.1") ;; @@ -266,16 +254,16 @@ quoted for Tcl." ;; Maybe someone has a better set? (let ((map (make-sparse-keymap))) ;; Will inherit from `comint-mode-map' thanks to define-derived-mode. - (define-key map "\t" 'completion-at-point) - (define-key map "\M-?" 'comint-dynamic-list-filename-completions) - (define-key map "\177" 'backward-delete-char-untabify) - (define-key map "\M-\C-x" 'tcl-eval-defun) - (define-key map "\C-c\C-i" 'tcl-help-on-word) - (define-key map "\C-c\C-v" 'tcl-eval-defun) - (define-key map "\C-c\C-f" 'tcl-load-file) - (define-key map "\C-c\C-t" 'inferior-tcl) - (define-key map "\C-c\C-x" 'tcl-eval-region) - (define-key map "\C-c\C-s" 'switch-to-tcl) + (define-key map "\t" #'completion-at-point) + (define-key map "\M-?" #'comint-dynamic-list-filename-completions) + (define-key map "\177" #'backward-delete-char-untabify) + (define-key map "\M-\C-x" #'tcl-eval-defun) + (define-key map "\C-c\C-i" #'tcl-help-on-word) + (define-key map "\C-c\C-v" #'tcl-eval-defun) + (define-key map "\C-c\C-f" #'tcl-load-file) + (define-key map "\C-c\C-t" #'inferior-tcl) + (define-key map "\C-c\C-x" #'tcl-eval-region) + (define-key map "\C-c\C-s" #'switch-to-tcl) map) "Keymap used in `inferior-tcl-mode'.") @@ -356,7 +344,7 @@ information): Add functions to the hook with `add-hook': - (add-hook 'tcl-mode-hook 'tcl-guess-application)") + (add-hook 'tcl-mode-hook #'tcl-guess-application)") (defvar tcl-proc-list @@ -461,6 +449,7 @@ This variable is generally set from `tcl-proc-regexp', (string-to-syntax ".")))))))) (defconst tcl-syntax-propertize-function + ;; FIXME: Handle the [...] commands nested inside "..." strings. (syntax-propertize-rules ;; Mark the few `#' that are not comment-markers. ((concat "[^" tcl--word-delimiters "][ \t]*\\(#\\)") (1 ".")) @@ -629,8 +618,8 @@ already exist." (unless (and (boundp 'filladapt-mode) filladapt-mode) (set (make-local-variable 'paragraph-ignore-fill-prefix) t)) - (set (make-local-variable 'indent-line-function) 'tcl-indent-line) - (set (make-local-variable 'comment-indent-function) 'tcl-comment-indent) + (set (make-local-variable 'indent-line-function) #'tcl-indent-line) + (set (make-local-variable 'comment-indent-function) #'tcl-comment-indent) ;; Tcl doesn't require a final newline. ;; (make-local-variable 'require-final-newline) ;; (setq require-final-newline t) @@ -662,7 +651,7 @@ already exist." (set (make-local-variable 'parse-sexp-ignore-comments) t) (set (make-local-variable 'defun-prompt-regexp) tcl-omit-ws-regexp) (set (make-local-variable 'add-log-current-defun-function) - 'tcl-add-log-defun) + #'tcl-add-log-defun) (setq-local beginning-of-defun-function #'tcl-beginning-of-defun-function) (setq-local end-of-defun-function #'tcl-end-of-defun-function) @@ -1246,7 +1235,7 @@ See documentation for function `inferior-tcl-mode' for more information." (setq inferior-tcl-buffer "*inferior-tcl*") (pop-to-buffer "*inferior-tcl*")) -(defalias 'run-tcl 'inferior-tcl) +(defalias 'run-tcl #'inferior-tcl) commit bec4a6dacad7a34b2919749e9805d2b7b77b8b45 Author: Eli Zaretskii Date: Tue Nov 3 21:48:23 2020 +0200 Fix last change * lisp/mwheel.el (mwheel-scroll): Don't use passive tense in doc string. diff --git a/lisp/mwheel.el b/lisp/mwheel.el index a27c714d25..1d9fe68075 100644 --- a/lisp/mwheel.el +++ b/lisp/mwheel.el @@ -258,9 +258,11 @@ active window." This should be bound only to mouse buttons 4, 5, 6, and 7 on non-Windows systems. -An optional prefix ARG can be used to change the step of horizontal -scrolling. The arg numeric value can be typed before starting to scroll. -The value is saved in the variable `mouse-wheel-scroll-amount-horizontal'." +Optional argument ARG (interactively, prefix numeric argument) controls +the step of horizontal scrolling. + +The variable `mouse-wheel-scroll-amount-horizontal' records the last +value of ARG, and the command uses it in subsequent scrolls." (interactive (list last-input-event current-prefix-arg)) (let* ((selected-window (selected-window)) (scroll-window (mouse-wheel--get-scroll-window event)) commit a6240cb263c3dd5a12fb23118444e59f622226a7 Author: Juri Linkov Date: Tue Nov 3 21:06:11 2020 +0200 Horizontal mouse wheel scrolling amount (bug#43568) * lisp/mwheel.el (mouse-wheel-scroll-amount-horizontal): New defcustom. (mwheel-scroll): Use it. * doc/emacs/frames.texi (Mouse Commands): Update doc about horizontal scrolling step. diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 1a44d8dc62..f5e2e8d172 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -214,7 +214,11 @@ speed is linked to how fast you move the wheel. This mode also supports increasing or decreasing the height of the default face, by default bound to scrolling with the @key{Ctrl} modifier. -Emacs also supports horizontal scrolling with the @key{Shift} modifier. +@vindex mouse-wheel-scroll-amount-horizontal +Emacs also supports horizontal scrolling with the @key{Shift} +modifier. Typing a numeric prefix arg (e.g., @kbd{M-5}) before +starting horizontal scrolling changes its step value defined +by the user option @code{mouse-wheel-scroll-amount-horizontal}. @vindex mouse-wheel-tilt-scroll @vindex mouse-wheel-flip-direction diff --git a/etc/NEWS b/etc/NEWS index e11effc9e8..fc90843c73 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -148,7 +148,9 @@ displays.) +++ ** Mouse wheel scrolling with Shift modifier now scrolls horizontally. -This works in text buffers and over images. +This works in text buffers and over images. Typing a numeric prefix arg +(e.g. 'M-5') before starting horizontal scrolling changes its step value. +The value is saved in the user option 'mouse-wheel-scroll-amount-horizontal'. --- ** The default value of 'frame-title-format' and 'icon-title-format' has changed. diff --git a/lisp/mwheel.el b/lisp/mwheel.el index c6a7391df1..a27c714d25 100644 --- a/lisp/mwheel.el +++ b/lisp/mwheel.el @@ -146,6 +146,16 @@ face height." :group 'mouse :type 'boolean) +(defcustom mouse-wheel-scroll-amount-horizontal 1 + "Amount to scroll windows horizontally. +Its value can be changed dynamically by using a numeric prefix argument +before starting horizontal scrolling. +It has effect when `mouse-wheel-scroll-amount' binds the value `hscroll' +to one of modifiers (`Shift' by default)." + :group 'mouse + :type 'number + :version "28.1") + ;;; For tilt-scroll ;;; (defcustom mouse-wheel-tilt-scroll nil @@ -243,11 +253,15 @@ active window." frame nil t))))) (mwheel-event-window event))) -(defun mwheel-scroll (event) +(defun mwheel-scroll (event &optional arg) "Scroll up or down according to the EVENT. This should be bound only to mouse buttons 4, 5, 6, and 7 on -non-Windows systems." - (interactive (list last-input-event)) +non-Windows systems. + +An optional prefix ARG can be used to change the step of horizontal +scrolling. The arg numeric value can be typed before starting to scroll. +The value is saved in the variable `mouse-wheel-scroll-amount-horizontal'." + (interactive (list last-input-event current-prefix-arg)) (let* ((selected-window (selected-window)) (scroll-window (mouse-wheel--get-scroll-window event)) (old-point @@ -275,9 +289,12 @@ non-Windows systems." (unwind-protect (let ((button (mwheel-event-button event))) (cond ((and (eq amt 'hscroll) (eq button mouse-wheel-down-event)) + (when (and (natnump arg) (> arg 0)) + (setq mouse-wheel-scroll-amount-horizontal arg)) (funcall (if mouse-wheel-flip-direction mwheel-scroll-left-function - mwheel-scroll-right-function) 1)) + mwheel-scroll-right-function) + mouse-wheel-scroll-amount-horizontal)) ((eq button mouse-wheel-down-event) (condition-case nil (funcall mwheel-scroll-down-function amt) ;; Make sure we do indeed scroll to the beginning of @@ -294,9 +311,12 @@ non-Windows systems." ;; to only affect scroll-down. --Stef (set-window-start (selected-window) (point-min)))))) ((and (eq amt 'hscroll) (eq button mouse-wheel-up-event)) + (when (and (natnump arg) (> arg 0)) + (setq mouse-wheel-scroll-amount-horizontal arg)) (funcall (if mouse-wheel-flip-direction mwheel-scroll-right-function - mwheel-scroll-left-function) 1)) + mwheel-scroll-left-function) + mouse-wheel-scroll-amount-horizontal)) ((eq button mouse-wheel-up-event) (condition-case nil (funcall mwheel-scroll-up-function amt) ;; Make sure we do indeed scroll to the end of the buffer. commit 2fffc1dfdff0a37f826a67d90d8a97091207dcb2 Author: Michael Albinus Date: Tue Nov 3 18:47:32 2020 +0100 Some Tramp fixes for directory-files-* and delete-* * lisp/files.el (delete-directory): Simplify check for trash. * lisp/net/ange-ftp.el (ange-ftp-delete-file): Implement TRASH. * lisp/net/tramp-compat.el (tramp-compat-directory-files) (tramp-compat-directory-files-and-attributes) (tramp-compat-directory-empty-p): New defaliases. * lisp/net/tramp.el (tramp-handle-directory-files-and-attributes) (tramp-skeleton-delete-directory): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-delete-directory): Use them. * lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes): Implement COUNT. * test/lisp/net/tramp-tests.el (tramp-test14-delete-directory): Do not run trash test for ange-ftp. (tramp-test16-directory-files) (tramp-test19-directory-files-and-attributes): Check COUNT argument. diff --git a/lisp/files.el b/lisp/files.el index e55552a2d9..deb878cf41 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -5867,10 +5867,7 @@ RECURSIVE if DIRECTORY is nonempty." ;; case, where the operation fails in delete-directory-internal. ;; As `move-file-to-trash' trashes directories (empty or ;; otherwise) as a unit, we do not need to recurse here. - (if (and (not recursive) - ;; Check if directory is empty apart from "." and "..". - (directory-files - directory 'full directory-files-no-dot-files-regexp)) + (if (not (or recursive (directory-empty-p directory))) (error "Directory is not empty, not moving to trash") (move-file-to-trash directory))) ;; Otherwise, call ourselves recursively if needed. diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 15322219ef..e0c162df57 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -3536,20 +3536,22 @@ system TYPE.") (setq file (expand-file-name file)) (let ((parsed (ange-ftp-ftp-name file))) (if parsed - (let* ((host (nth 0 parsed)) - (user (nth 1 parsed)) - (name (ange-ftp-quote-string (nth 2 parsed))) - (abbr (ange-ftp-abbreviate-filename file)) - (result (ange-ftp-send-cmd host user - (list 'delete name) - (format "Deleting %s" abbr)))) - (or (car result) - (signal 'ftp-error - (list - "Removing old name" - (format "FTP Error: \"%s\"" (cdr result)) - file))) - (ange-ftp-delete-file-entry file)) + (if (and delete-by-moving-to-trash trash) + (move-file-to-trash file) + (let* ((host (nth 0 parsed)) + (user (nth 1 parsed)) + (name (ange-ftp-quote-string (nth 2 parsed))) + (abbr (ange-ftp-abbreviate-filename file)) + (result (ange-ftp-send-cmd host user + (list 'delete name) + (format "Deleting %s" abbr)))) + (or (car result) + (signal 'ftp-error + (list + "Removing old name" + (format "FTP Error: \"%s\"" (cdr result)) + file))) + (ange-ftp-delete-file-entry file))) (ange-ftp-real-delete-file file trash)))) (defun ange-ftp-file-modtime (file) @@ -4163,45 +4165,55 @@ directory, so that Emacs will know its current contents." (defun ange-ftp-delete-directory (dir &optional recursive trash) (if (file-directory-p dir) - (let ((parsed (ange-ftp-ftp-name dir))) - (if recursive - (mapc - (lambda (file) - (if (file-directory-p file) - (ange-ftp-delete-directory file recursive trash) - (delete-file file trash))) - (directory-files dir 'full directory-files-no-dot-files-regexp))) - (if parsed - (let* ((host (nth 0 parsed)) - (user (nth 1 parsed)) - ;; Some ftp's on unix machines (at least on Suns) - ;; insist that rmdir take a filename, and not a - ;; directory-name name as an arg. Argh!! This is a bug. - ;; Non-unix machines will probably always insist - ;; that rmdir takes a directory-name as an arg - ;; (as the ftp man page says it should). - (name (ange-ftp-quote-string - (if (eq (ange-ftp-host-type host) 'unix) - (ange-ftp-real-directory-file-name - (nth 2 parsed)) - (ange-ftp-real-file-name-as-directory - (nth 2 parsed))))) - (abbr (ange-ftp-abbreviate-filename dir)) - (result - (progn - ;; CWD must not in this directory. - (ange-ftp-cd host user "/" 'noerror) - (ange-ftp-send-cmd host user - (list 'rmdir name) - (format "Removing directory %s" - abbr))))) - (or (car result) - (ange-ftp-error host user - (format "Could not remove directory %s: %s" - dir - (cdr result)))) - (ange-ftp-delete-file-entry dir t)) - (ange-ftp-real-delete-directory dir recursive trash))) + ;; Trashing directories does not work yet, because + ;; `rename-file', called in `move-file-to-trash', does not + ;; handle directories. + (if nil ; (and delete-by-moving-to-trash trash) + ;; Move non-empty dir to trash only if recursive deletion was + ;; requested. + (if (not (or recursive (directory-empty-p dir))) + (signal 'ftp-error + (list "Directory is not empty, not moving to trash")) + (move-file-to-trash dir)) + (let ((parsed (ange-ftp-ftp-name dir))) + (if recursive + (mapc + (lambda (file) + (if (file-directory-p file) + (ange-ftp-delete-directory file recursive) + (delete-file file))) + (directory-files dir 'full directory-files-no-dot-files-regexp))) + (if parsed + (let* ((host (nth 0 parsed)) + (user (nth 1 parsed)) + ;; Some ftp's on unix machines (at least on Suns) + ;; insist that rmdir take a filename, and not a + ;; directory-name name as an arg. Argh!! This is a bug. + ;; Non-unix machines will probably always insist + ;; that rmdir takes a directory-name as an arg + ;; (as the ftp man page says it should). + (name (ange-ftp-quote-string + (if (eq (ange-ftp-host-type host) 'unix) + (ange-ftp-real-directory-file-name + (nth 2 parsed)) + (ange-ftp-real-file-name-as-directory + (nth 2 parsed))))) + (abbr (ange-ftp-abbreviate-filename dir)) + (result + (progn + ;; CWD must not in this directory. + (ange-ftp-cd host user "/" 'noerror) + (ange-ftp-send-cmd host user + (list 'rmdir name) + (format "Removing directory %s" + abbr))))) + (or (car result) + (ange-ftp-error host user + (format "Could not remove directory %s: %s" + dir + (cdr result)))) + (ange-ftp-delete-file-entry dir t)) + (ange-ftp-real-delete-directory dir recursive trash)))) (error "Not a directory: %s" dir))) ;; Make a local copy of FILE and return its name. diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index c554a8d0c2..9a4e16efe2 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -309,6 +309,30 @@ A nil value for either argument stands for the current time." (lambda (filename &optional timestamp _flag) (set-file-times filename timestamp)))) +;; `directory-files' and `directory-files-and-attributes' got argument +;; COUNT in Emacs 28.1. +(defalias 'tramp-compat-directory-files + (if (equal (tramp-compat-funcall 'func-arity #'directory-files) '(1 . 5)) + #'directory-files + (lambda (directory &optional full match nosort _count) + (directory-files directory full match nosort)))) + +(defalias 'tramp-compat-directory-files-and-attributes + (if (equal (tramp-compat-funcall 'func-arity #'directory-files-and-attributes) + '(1 . 6)) + #'directory-files-and-attributes + (lambda (directory &optional full match nosort id-format _count) + (directory-files-and-attributes directory full match nosort id-format)))) + +;; `directory-empty-p' is new in Emacs 28.1. +(defalias 'tramp-compat-directory-empty-p + (if (fboundp 'directory-empty-p) + #'directory-empty-p + (lambda (dir) + (and (file-directory-p dir) + (null (tramp-compat-directory-files + dir nil directory-files-no-dot-files-regexp t 1)))))) + (add-hook 'tramp-unload-hook (lambda () (unload-feature 'tramp-loaddefs 'force) @@ -322,5 +346,8 @@ A nil value for either argument stands for the current time." ;; ;; * Starting with Emacs 27.1, there's no need to escape open ;; parentheses with a backslash in docstrings anymore. +;; +;; * Starting with Emacs 27.1, there's `make-empty-file'. Could be +;; used instead of `write-region'. ;;; tramp-compat.el ends here diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index bf55777e33..86fb45a43b 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1088,7 +1088,7 @@ file names." (delete-file file))) (directory-files directory 'full directory-files-no-dot-files-regexp)) - (when (directory-files directory nil directory-files-no-dot-files-regexp) + (unless (tramp-compat-directory-empty-p directory) (tramp-error v 'file-error "Couldn't delete non-empty %s" directory))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 915ce2f6a6..655949a79b 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1738,6 +1738,9 @@ ID-FORMAT valid values are `string' and `integer'." (setcar item (expand-file-name (car item) directory))) (push item result))) + (when (natnump count) + (setq result (last result count))) + (or (if nosort result (sort result (lambda (x y) (string< (car x) (car y))))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index ce0a2b54ff..1859e84375 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3145,7 +3145,7 @@ User is always nil." (lambda (x) (cons x (file-attributes (if full x (expand-file-name x directory)) id-format))) - (directory-files directory full match nosort count))) + (tramp-compat-directory-files directory full match nosort count))) (defun tramp-handle-dired-uncache (dir) "Like `dired-uncache' for Tramp files." @@ -5346,9 +5346,7 @@ BODY is the backend specific code." (if (and delete-by-moving-to-trash ,trash) ;; Move non-empty dir to trash only if recursive deletion was ;; requested. - (if (and (not ,recursive) - (directory-files - ,directory nil directory-files-no-dot-files-regexp)) + (if (not (or ,recursive (tramp-compat-directory-empty-p ,directory))) (tramp-error v 'file-error "Directory is not empty, not moving to trash") (move-file-to-trash ,directory)) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 50db55ebb4..2670723ecd 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2783,8 +2783,9 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." (should-not (file-directory-p tmp-name1)) ;; Trashing directories works only since Emacs 27.1. It doesn't - ;; work for crypted remote directories. - (when (and (not (tramp--test-crypt-p)) (tramp--test-emacs27-p)) + ;; work for crypted remote directories and for ange-ftp. + (when (and (not (tramp--test-crypt-p)) (not (tramp--test-ftp-p)) + (tramp--test-emacs27-p)) (let ((trash-directory (tramp--test-make-temp-name 'local quoted)) (delete-by-moving-to-trash t)) (make-directory trash-directory) @@ -2925,7 +2926,15 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." '("bla" "foo"))) (should (equal (directory-files tmp-name1 'full directory-files-no-dot-files-regexp) - `(,tmp-name2 ,tmp-name3)))) + `(,tmp-name2 ,tmp-name3))) + ;; Check the COUNT arg. It exists since Emacs 28. + (when (tramp--test-emacs28-p) + (with-no-warnings + (should + (= 1 (length + (directory-files + tmp-name1 nil directory-files-no-dot-files-regexp + nil 1))))))) ;; Cleanup. (ignore-errors (delete-directory tmp-name1 'recursive)))))) @@ -3443,7 +3452,13 @@ They might differ only in time attributes or directory size." (file-attributes (car elt)) (cdr elt)))) (setq attr (directory-files-and-attributes tmp-name2 nil "\\`b")) - (should (equal (mapcar #'car attr) '("bar" "boz")))) + (should (equal (mapcar #'car attr) '("bar" "boz"))) + + ;; Check the COUNT arg. It exists since Emacs 28. + (when (tramp--test-emacs28-p) + (with-no-warnings + (should (= 1 (length (directory-files-and-attributes + tmp-name2 nil "\\`b" nil nil 1))))))) ;; Cleanup. (ignore-errors (delete-directory tmp-name1 'recursive)))))) commit f9d6e463d310db0e1931f26609d938531c56f9c3 Author: Reuben Thomas Date: Mon Nov 2 21:45:40 2020 +0000 Factor out some common code in ispell.el * lisp/textmodes/ispell.el (ispell-with-safe-default-directory): Add macro. (ispell-call-process, ispell-call-process-region): Use it. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 60415b02b8..c185f9f2c8 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -769,18 +769,23 @@ Otherwise returns the library directory name, if that is defined." (setq ispell-really-hunspell nil)))))) result)) +(defmacro ispell-with-safe-default-directory (&rest body) + "Execute the forms in BODY with a reasonable +`default-directory'." + (declare (indent 0) (debug t)) + `(let ((default-directory default-directory)) + (unless (file-accessible-directory-p default-directory) + (setq default-directory (expand-file-name "~/"))) + ,@body)) + (defun ispell-call-process (&rest args) - "Like `call-process' but defend against bad `default-directory'." - (let ((default-directory default-directory)) - (unless (file-accessible-directory-p default-directory) - (setq default-directory (expand-file-name "~/"))) + "Like `call-process', but defend against bad `default-directory'." + (ispell-with-safe-default-directory (apply 'call-process args))) (defun ispell-call-process-region (&rest args) - "Like `call-process-region' but defend against bad `default-directory'." - (let ((default-directory default-directory)) - (unless (file-accessible-directory-p default-directory) - (setq default-directory (expand-file-name "~/"))) + "Like `call-process-region', but defend against bad `default-directory'." + (ispell-with-safe-default-directory (apply 'call-process-region args))) (defvar ispell-debug-buffer) commit 640b41cd9b7e1196eea51a5664a3756916e37715 Author: Reuben Thomas Date: Mon Nov 2 21:41:05 2020 +0000 Simplify ispell-check-version’s use of -vv flag * lisp/textmodes/ispell.el (ispell-check-version): All supported spell checker programs accept -vv, including aspell for many years, so use it. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index da518b1074..60415b02b8 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -684,13 +684,11 @@ Otherwise returns the library directory name, if that is defined." (with-temp-buffer (setq status (ispell-call-process ispell-program-name nil t nil - ;; aspell doesn't accept the -vv switch. (let ((case-fold-search (memq system-type '(ms-dos windows-nt))) (speller (file-name-nondirectory ispell-program-name))) - ;; Assume anything that isn't `aspell' is Ispell. - (if (string-match "\\`aspell" speller) "-v" "-vv")))) + "-vv"))) (goto-char (point-min)) (if interactivep ;; Report version information of ispell commit 84f74136d374421d3eb6a71a2e248e2b369cddbe Author: Harald Jörg Date: Tue Nov 3 15:28:40 2020 +0100 cperl-mode: Fix indentation for Emacs 26 * lisp/progmodes/cperl-mode.el (cperl-mode): Add a fix which is only required for Emacs versions older than 27. * test/lisp/progmodes/cperl-mode-tests.el (cperl-bug30393): Add a test to verify correct indentation (bug#30393). diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index ebbea6bed9..6178cdfc9b 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1606,6 +1606,9 @@ or as help on variables `cperl-tips', `cperl-problems', (if (cperl-val 'cperl-electric-keywords) (abbrev-mode 1)) (set-syntax-table cperl-mode-syntax-table) + ;; Workaround for Bug#30393, needed for Emacs 26. + (when (< emacs-major-version 27) + (setq-local open-paren-in-column-0-is-defun-start nil)) ;; Until Emacs is multi-threaded, we do not actually need it local: (make-local-variable 'cperl-font-lock-multiline-start) (make-local-variable 'cperl-font-locking) diff --git a/test/lisp/progmodes/cperl-mode-resources/cperl-bug-30393.pl b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-30393.pl new file mode 100644 index 0000000000..01db7b5206 --- /dev/null +++ b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-30393.pl @@ -0,0 +1,19 @@ +# -------- bug#30393: input -------- +# + my $sql = "insert into jobs (id, priority) values (1, 2);"; + my $sth = $dbh->prepare($sql) or die "bother"; + + my $sql = "insert into jobs +(id, priority) +values (1, 2);"; + my $sth = $dbh->prepare($sql) or die "bother"; +# -------- bug#30393: expected output -------- +# +my $sql = "insert into jobs (id, priority) values (1, 2);"; +my $sth = $dbh->prepare($sql) or die "bother"; + +my $sql = "insert into jobs +(id, priority) +values (1, 2);"; +my $sth = $dbh->prepare($sql) or die "bother"; +# -------- bug#30393: end -------- diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index dcde3b68a0..2977f10813 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -220,6 +220,35 @@ point in the distant past, and is still broken in perl-mode. " (should (equal (nth 3 (syntax-ppss)) nil)) (should (equal (nth 4 (syntax-ppss)) t)))))) +(ert-deftest cperl-bug30393 () + "Verify that indentation is not disturbed by an open paren in col 0. +Perl is not Lisp: An open paren in column 0 does not start a function." + (let ((file (ert-resource-file "cperl-bug-30393.pl"))) + (with-temp-buffer + (insert-file-contents file) + (goto-char (point-min)) + (while (re-search-forward + (concat "^# ?-+ \\_<\\(?1:.+?\\)\\_>: input ?-+\n" + "\\(?2:\\(?:.*\n\\)+?\\)" + "# ?-+ \\1: expected output ?-+\n" + "\\(?3:\\(?:.*\n\\)+?\\)" + "# ?-+ \\1: end ?-+") + nil t) + (let ((name (match-string 1)) + (code (match-string 2)) + (expected (match-string 3)) + got) + (with-temp-buffer + (insert code) + (funcall cperl-test-mode) + (goto-char (point-min)) + (while (null (eobp)) + (cperl-indent-command) + (next-line)) + (setq expected (concat "test case " name ":\n" expected)) + (setq got (concat "test case " name ":\n" (buffer-string))) + (should (equal got expected)))))))) + (ert-deftest cperl-bug37127 () "Verify that closing a paren in a regex goes without a message. Also check that the message is issued if the regex terminator is commit bd8f4b04d51083bd61350c70c09daff4fd8bb61d Author: Mauro Aranda Date: Tue Nov 3 10:02:51 2020 -0300 Fix customizing user options of type face * lisp/cus-edit.el (face): Move the %f escape after the tag, because otherwise customizing a face user option doesn't work: custom-variable-value-create thinks that everything up until the first ":" is part of the tag, and the item widget doesn't know how to handle the %f escape. diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 3eef446839..34d76bf096 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -4021,7 +4021,7 @@ restoring it to the state of a face that has never been customized." (define-widget 'face 'symbol "A Lisp face name (with sample)." - :format "%f %{%t%}: (%{sample%}) %v" + :format "%{%t%}: %f (%{sample%}) %v" :tag "Face" :value 'default :sample-face-get 'widget-face-sample-face-get commit 2d4c981b2112083e80195c0c258422e203048946 Author: Stefan Kangas Date: Tue Nov 3 04:37:44 2020 +0100 Use lexical-binding in some url-*.el files * lisp/url/url-dired.el: * lisp/url/url-ftp.el: * lisp/url/url-irc.el: Use lexical-binding. diff --git a/lisp/url/url-dired.el b/lisp/url/url-dired.el index ba68fe100e..fa75a0a6bb 100644 --- a/lisp/url/url-dired.el +++ b/lisp/url/url-dired.el @@ -1,4 +1,4 @@ -;;; url-dired.el --- URL Dired minor mode +;;; url-dired.el --- URL Dired minor mode -*- lexical-binding: t -*- ;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc. diff --git a/lisp/url/url-ftp.el b/lisp/url/url-ftp.el index a436a431db..50b21bd8d4 100644 --- a/lisp/url/url-ftp.el +++ b/lisp/url/url-ftp.el @@ -1,4 +1,4 @@ -;;; url-ftp.el --- FTP wrapper +;;; url-ftp.el --- FTP wrapper -*- lexical-binding: t -*- ;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc. diff --git a/lisp/url/url-irc.el b/lisp/url/url-irc.el index 9647df1c13..ece53c9029 100644 --- a/lisp/url/url-irc.el +++ b/lisp/url/url-irc.el @@ -1,4 +1,4 @@ -;;; url-irc.el --- IRC URL interface +;;; url-irc.el --- IRC URL interface -*- lexical-binding: t -*- ;; Copyright (C) 1996-1999, 2004-2020 Free Software Foundation, Inc. commit 39561fbfb3dd1baefc1e6f2ca3d1d02d2001cd3e Author: Stefan Kangas Date: Tue Nov 3 04:16:03 2020 +0100 Use lexical-binding in solitaire.el * lisp/play/solitaire.el: Use lexical-binding. Remove redundant :group args. diff --git a/lisp/play/solitaire.el b/lisp/play/solitaire.el index 5c1dd061c9..1383efe37c 100644 --- a/lisp/play/solitaire.el +++ b/lisp/play/solitaire.el @@ -1,4 +1,4 @@ -;;; solitaire.el --- game of solitaire in Emacs Lisp +;;; solitaire.el --- game of solitaire in Emacs Lisp -*- lexical-binding: t -*- ;; Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc. @@ -38,8 +38,7 @@ (defcustom solitaire-mode-hook nil "Hook to run upon entry to Solitaire." - :type 'hook - :group 'solitaire) + :type 'hook) (defvar solitaire-mode-map (let ((map (make-sparse-keymap))) @@ -119,8 +118,7 @@ The usual mnemonic keys move the cursor around the board; in addition, "Non-nil means check for possible moves after each major change. This takes a while, so switch this on if you like to be informed when the game is over, or off, if you are working on a slow machine." - :type 'boolean - :group 'solitaire) + :type 'boolean) (defconst solitaire-valid-directions '(solitaire-left solitaire-right solitaire-up solitaire-down)) commit 74dd264d08ee6f02ee468400bc845953f7ea30f2 Author: Stefan Kangas Date: Tue Nov 3 03:55:50 2020 +0100 Use lexical-binding in some of emulation/edt*.el * lisp/emulation/edt-vt100.el: * lisp/emulation/edt-pc.el: * lisp/emulation/edt-lk201.el: Use lexical-binding. diff --git a/lisp/emulation/edt-lk201.el b/lisp/emulation/edt-lk201.el index c922e00f8f..f7b2c0c93e 100644 --- a/lisp/emulation/edt-lk201.el +++ b/lisp/emulation/edt-lk201.el @@ -1,4 +1,4 @@ -;;; edt-lk201.el --- enhanced EDT keypad mode emulation for LK-201 keyboards +;;; edt-lk201.el --- enhanced EDT keypad mode emulation for LK-201 keyboards -*- lexical-binding: t -*- ;; Copyright (C) 1986, 1992-1993, 1995, 2001-2020 Free Software ;; Foundation, Inc. diff --git a/lisp/emulation/edt-pc.el b/lisp/emulation/edt-pc.el index aa31d5bc32..53fc9886b7 100644 --- a/lisp/emulation/edt-pc.el +++ b/lisp/emulation/edt-pc.el @@ -1,4 +1,4 @@ -;;; edt-pc.el --- enhanced EDT keypad mode emulation for PC 101 keyboards +;;; edt-pc.el --- enhanced EDT keypad mode emulation for PC 101 keyboards -*- lexical-binding: t -*- ;; Copyright (C) 1986, 1994-1995, 2001-2020 Free Software Foundation, ;; Inc. diff --git a/lisp/emulation/edt-vt100.el b/lisp/emulation/edt-vt100.el index 199212d222..420d29b6aa 100644 --- a/lisp/emulation/edt-vt100.el +++ b/lisp/emulation/edt-vt100.el @@ -1,4 +1,4 @@ -;;; edt-vt100.el --- enhanced EDT keypad mode emulation for VT series terminals +;;; edt-vt100.el --- enhanced EDT keypad mode emulation for VT series terminals -*- lexical-binding: t -*- ;; Copyright (C) 1986, 1992-1993, 1995, 2002-2020 Free Software ;; Foundation, Inc. commit 0462ba3032633f3de08eb24e1dab89859bb726c7 Author: Stefan Kangas Date: Tue Nov 3 02:23:46 2020 +0100 Use lexical-binding in pcmpl-rpm.el * lisp/pcmpl-rpm.el: Use lexical-binding. Remove redundant :group args. (pcmpl-rpm-packages): Quote function symbol as such. diff --git a/lisp/pcmpl-rpm.el b/lisp/pcmpl-rpm.el index 52a1dd486b..efd255908c 100644 --- a/lisp/pcmpl-rpm.el +++ b/lisp/pcmpl-rpm.el @@ -1,4 +1,4 @@ -;;; pcmpl-rpm.el --- functions for dealing with rpm completions +;;; pcmpl-rpm.el --- functions for dealing with rpm completions -*- lexical-binding: t -*- ;; Copyright (C) 1999-2020 Free Software Foundation, Inc. @@ -47,14 +47,12 @@ :version "24.3" :type '(choice (const :tag "No options" nil) (string :tag "Single option") - (repeat :tag "List of options" string)) - :group 'pcmpl-rpm) + (repeat :tag "List of options" string))) (defcustom pcmpl-rpm-cache t "Whether to cache the list of installed packages." :version "24.3" - :type 'boolean - :group 'pcmpl-rpm) + :type 'boolean) (defconst pcmpl-rpm-cache-stamp-file "/var/lib/rpm/Packages" "File used to check that the list of installed packages is up-to-date.") @@ -78,7 +76,7 @@ (message "Getting list of installed rpms...") (setq pcmpl-rpm-cache-time (current-time) pcmpl-rpm-packages - (split-string (apply 'pcomplete-process-result "rpm" + (split-string (apply #'pcomplete-process-result "rpm" (append '("-q" "-a") (if (stringp pcmpl-rpm-query-options) (list pcmpl-rpm-query-options) commit 499847ab952299f0d978291ed8e84a9b13786e80 Author: Stefan Kangas Date: Tue Nov 3 02:06:05 2020 +0100 Use lexical-binding in pcmpl-cvs.el * lisp/pcmpl-cvs.el: Use lexical-binding. (executable): Remove unnecessary require. (pcmpl-cvs-binary): Remove redundant :group arg. (pcmpl-cvs-tags): Quote function symbol as such. diff --git a/lisp/pcmpl-cvs.el b/lisp/pcmpl-cvs.el index 1b49b297e4..13f3093c21 100644 --- a/lisp/pcmpl-cvs.el +++ b/lisp/pcmpl-cvs.el @@ -1,4 +1,4 @@ -;;; pcmpl-cvs.el --- functions for dealing with cvs completions +;;; pcmpl-cvs.el --- functions for dealing with cvs completions -*- lexical-binding: t -*- ;; Copyright (C) 1999-2020 Free Software Foundation, Inc. @@ -29,7 +29,6 @@ (provide 'pcmpl-cvs) (require 'pcomplete) -(require 'executable) (defgroup pcmpl-cvs nil "Functions for dealing with CVS completions." @@ -39,8 +38,7 @@ (defcustom pcmpl-cvs-binary (or (executable-find "cvs") "cvs") "The full path of the `cvs' binary." - :type 'file - :group 'pcmpl-cvs) + :type 'file) ;; Functions: @@ -139,7 +137,7 @@ (let ((entries (pcmpl-cvs-entries opers)) tags) (with-temp-buffer - (apply 'call-process pcmpl-cvs-binary nil t nil + (apply #'call-process pcmpl-cvs-binary nil t nil "status" "-v" entries) (goto-char (point-min)) (while (re-search-forward "Existing Tags:" nil t) commit e1644c065e3d31c1c01456322ec1a37208eb3bd3 Author: Stefan Kangas Date: Tue Nov 3 02:04:22 2020 +0100 ; * lisp/pcomplete.el: Fix typo. diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 014f9628b9..679f2e93e0 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -352,7 +352,7 @@ modified to be an empty string, or the desired separation string." (defvar pcomplete-show-list nil) (defvar pcomplete-expand-only-p nil) -;; for the sake of the bye-compiler, when compiling other files that +;; for the sake of the byte-compiler, when compiling other files that ;; contain completion functions (defvar pcomplete-args nil) (defvar pcomplete-begins nil) commit a7374f668b0db27f0e8430d085fbf7f2655b8c7f Author: Stefan Kangas Date: Tue Nov 3 01:35:01 2020 +0100 Fix exiting the finder-commentary buffer * lisp/finder.el (finder-exit): Fix exiting the finder-commentary buffer. (Bug#44384) (finder-buffer): New defconst. (finder-list-keywords): Use above new defconst. diff --git a/lisp/finder.el b/lisp/finder.el index 820d6d0a3b..a59a185cc9 100644 --- a/lisp/finder.el +++ b/lisp/finder.el @@ -178,6 +178,9 @@ directory name and PACKAGE is the name of a package (a symbol). When generating `package--builtins', Emacs assumes any file in DIR is part of the package PACKAGE.") +(defconst finder-buffer "*Finder*" + "Name of the Finder buffer.") + (defun finder-compile-keywords (&rest dirs) "Regenerate list of built-in Emacs packages. This recomputes `package--builtins' and `finder-keywords-hash', @@ -338,9 +341,9 @@ not `finder-known-keywords'." (defun finder-list-keywords () "Display descriptions of the keywords in the Finder buffer." (interactive) - (if (get-buffer "*Finder*") - (pop-to-buffer "*Finder*") - (pop-to-buffer (get-buffer-create "*Finder*")) + (if (get-buffer finder-buffer) + (pop-to-buffer finder-buffer) + (pop-to-buffer (get-buffer-create finder-buffer)) (finder-mode) (let ((inhibit-read-only t)) (erase-buffer) @@ -460,10 +463,9 @@ finder directory, \\[finder-exit] = quit, \\[finder-summary] = help"))) "Exit Finder mode. Quit the window and kill all Finder-related buffers." (interactive) - (let ((buf "*Finder*")) - (if (equal (current-buffer) buf) - (quit-window t) - (and (get-buffer buf) (kill-buffer buf))))) + (quit-window t) + (dolist (buf (list finder-buffer "*Finder-package*")) + (and (get-buffer buf) (kill-buffer buf)))) (defun finder-unload-function () "Unload the Finder library." commit 2800513af5f5bc0f16879ce6ab250f0f63f7bb6e Author: Harald Jörg Date: Mon Nov 2 23:44:58 2020 +0100 cperl-mode: Skip a test for older Emacsen (preparing for ELPA) * test/lisp/progmodes/cperl-mode-tests.el (cperl-bug37127): Skip this test for older Emacsen. The bug has been fixed in Emacs, but outside of CPerl mode, and therefore will not be available for older versions via ELPA. diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index 9a7b5e4d6d..dcde3b68a0 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -224,6 +224,10 @@ point in the distant past, and is still broken in perl-mode. " "Verify that closing a paren in a regex goes without a message. Also check that the message is issued if the regex terminator is missing." + ;; The actual fix for this bug is in simple.el, which is not + ;; backported to older versions of Emacs. Therefore we skip this + ;; test if we're running Emacs 27 or older. + (skip-unless (< 27 emacs-major-version)) ;; Part one: Regex is ok, no messages (ert-with-message-capture collected-messages (with-temp-buffer commit 6ad628b8657d840de1c9ac07e653d945e2a88889 Author: Stefan Kangas Date: Mon Nov 2 19:06:46 2020 +0100 Improve ert-resource-directory docstring * lisp/emacs-lisp/ert-x.el (ert-resource-directory): Improve docstring. diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el index abbff6da62..a8da2c413e 100644 --- a/lisp/emacs-lisp/ert-x.el +++ b/lisp/emacs-lisp/ert-x.el @@ -363,18 +363,19 @@ convert it to a string and pass it to COLLECTOR first." ;; Has to be a macro for `load-file-name'. (defmacro ert-resource-directory () - "Return absolute file name of the resource directory for this file. + "Return absolute file name of the resource (test data) directory. The path to the resource directory is the \"resources\" directory -in the same directory as the test file. - -If that directory doesn't exist, use the directory named like the -test file but formatted by `ert-resource-directory-format' and trimmed -using `string-trim' with arguments +in the same directory as the test file this is called from. + +If that directory doesn't exist, find a directory based on the +test file name. If the file is named \"foo-tests.el\", return +the absolute file name for \"foo-resources\". If you want a +different resource directory naming scheme, set the variable +`ert-resource-directory-format'. Before formatting, the file +name will be trimmed using `string-trim' with arguments `ert-resource-directory-trim-left-regexp' and -`ert-resource-directory-trim-right-regexp'. The default values mean -that if called from a test file named \"foo-tests.el\", return -the absolute file name for \"foo-resources\"." +`ert-resource-directory-trim-right-regexp'." `(let* ((testfile ,(or (bound-and-true-p byte-compile-current-file) (and load-in-progress load-file-name) buffer-file-name)) commit a8f04014c2ba99ee8a5c17c85f4db671ef707773 Author: Reuben Thomas Date: Mon Nov 2 22:10:56 2020 +0000 Fix previous patch to ispell.el * lisp/textmodes/ispell.el (ispell--call-enchant-lsmod): with-current-buffer and with-output-to-string need to be the other way around. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index da3c3f4d6f..da518b1074 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1215,8 +1215,8 @@ Internal use.") (defun ispell--call-enchant-lsmod (&rest args) "Call enchant-lsmod with ARGS and return the output as string." - (with-current-buffer standard-output - (with-output-to-string + (with-output-to-string + (with-current-buffer standard-output (apply #'ispell-call-process (replace-regexp-in-string "enchant\\(-[0-9]\\)?\\'" "enchant-lsmod\\1" commit 50f0b00748bea6d39915a1e2e2cbeca2accb7417 Author: Reuben Thomas Date: Mon Nov 2 21:37:46 2020 +0000 Fix previous code change to `ispell--call-enchant-lsmod' * lisp/textmodes/ispell.el (ispell--call-enchant-lsmod): Restore the use of with-current-buffer, to avoid enchant-lsmod’s output being dumped into the current buffer. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 1cd17b11ca..da3c3f4d6f 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1215,14 +1215,15 @@ Internal use.") (defun ispell--call-enchant-lsmod (&rest args) "Call enchant-lsmod with ARGS and return the output as string." - (with-output-to-string - (apply #'ispell-call-process - (replace-regexp-in-string "enchant\\(-[0-9]\\)?\\'" - "enchant-lsmod\\1" - ispell-program-name) - ;; We discard stderr here because enchant-lsmod can emit - ;; unrelated warnings that will confuse us. - nil '(t nil) nil args))) + (with-current-buffer standard-output + (with-output-to-string + (apply #'ispell-call-process + (replace-regexp-in-string "enchant\\(-[0-9]\\)?\\'" + "enchant-lsmod\\1" + ispell-program-name) + ;; We discard stderr here because enchant-lsmod can emit + ;; unrelated warnings that will confuse us. + nil '(t nil) nil args)))) (defun ispell--get-extra-word-characters (&optional lang) "Get the extra word characters for LANG as a character class. commit a2bddd77108c622cd88eb2d0468d9236bf8f33a5 Author: Eli Zaretskii Date: Mon Nov 2 21:47:18 2020 +0200 Explain last change * lisp/textmodes/ispell.el (ispell--call-enchant-lsmod): Explain the workaround with discarding stderr. (Bug#44318) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 413d8802a1..1cd17b11ca 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1220,6 +1220,8 @@ Internal use.") (replace-regexp-in-string "enchant\\(-[0-9]\\)?\\'" "enchant-lsmod\\1" ispell-program-name) + ;; We discard stderr here because enchant-lsmod can emit + ;; unrelated warnings that will confuse us. nil '(t nil) nil args))) (defun ispell--get-extra-word-characters (&optional lang) commit 55e92de6d5bf43651c687b857cf18773628fe253 Author: Reuben Thomas Date: Mon Nov 2 18:06:11 2020 +0000 Make ispell.el ignore warnings from enchant-lsmod (closes #44318) * lisp/textmodes/ispell.el (ispell--call-enchant-lsmod): Don’t capture stderr. Also remove unnecessary with-current-buffer wrapper. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 05a4bd058c..413d8802a1 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1216,13 +1216,11 @@ Internal use.") (defun ispell--call-enchant-lsmod (&rest args) "Call enchant-lsmod with ARGS and return the output as string." (with-output-to-string - (with-current-buffer - standard-output - (apply #'ispell-call-process - (replace-regexp-in-string "enchant\\(-[0-9]\\)?\\'" - "enchant-lsmod\\1" - ispell-program-name) - nil t nil args)))) + (apply #'ispell-call-process + (replace-regexp-in-string "enchant\\(-[0-9]\\)?\\'" + "enchant-lsmod\\1" + ispell-program-name) + nil '(t nil) nil args))) (defun ispell--get-extra-word-characters (&optional lang) "Get the extra word characters for LANG as a character class. commit 4445cb76db57b3037d906ef2d0703a4ab4b1f9a7 Author: Mattias Engdegård Date: Mon Nov 2 18:54:14 2020 +0100 Add missing argument to directory_files_internal calls * src/kqueue.c (kqueue_compare_dir_list, Fkqueue_add_watch): Pass the new seventh argument. diff --git a/src/kqueue.c b/src/kqueue.c index adbb8d92c0..590b747ef7 100644 --- a/src/kqueue.c +++ b/src/kqueue.c @@ -128,7 +128,7 @@ kqueue_compare_dir_list (Lisp_Object watch_object) return; } new_directory_files = - directory_files_internal (dir, Qnil, Qnil, Qnil, true, Qnil); + directory_files_internal (dir, Qnil, Qnil, Qnil, true, Qnil, Qnil); new_dl = kqueue_directory_listing (new_directory_files); /* Parse through the old list. */ @@ -452,7 +452,8 @@ only when the upper directory of the renamed file is watched. */) if (NILP (Ffile_directory_p (file))) watch_object = list4 (watch_descriptor, file, flags, callback); else { - dir_list = directory_files_internal (file, Qnil, Qnil, Qnil, true, Qnil); + dir_list = directory_files_internal (file, Qnil, Qnil, Qnil, true, Qnil, + Qnil); watch_object = list5 (watch_descriptor, file, flags, callback, dir_list); } watch_list = Fcons (watch_object, watch_list); commit 5f6dcb1c666e931c4bbf3c3385b5334b904ed025 Author: Eli Zaretskii Date: Mon Nov 2 19:55:48 2020 +0200 Fix a recent change in dired.c * src/dired.c (directory_files_internal): Fix type of integer variables to avoid overflow in 32-bit builds --with-wide-int. diff --git a/src/dired.c b/src/dired.c index 039dd68c17..feb5f05cb1 100644 --- a/src/dired.c +++ b/src/dired.c @@ -167,7 +167,7 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object match, Lisp_Object nosort, bool attrs, Lisp_Object id_format, Lisp_Object return_count) { - ptrdiff_t ind = 0, last = MOST_POSITIVE_FIXNUM; + EMACS_INT ind = 0, last = MOST_POSITIVE_FIXNUM; if (!NILP (return_count)) { commit 3e8cdc404fb884f0be473fe2785c3b041c1129fd Author: Eli Zaretskii Date: Mon Nov 2 19:49:32 2020 +0200 Improve documentation of a recent commit * lisp/international/mule-cmds.el (transient-input-method): Doc fix. Add :version tag. (transient-input-method): Doc fix. * etc/NEWS: * doc/emacs/mule.texi (Select Input Method): Fix wording of the last change. diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index d4ad1d6d5e..2fca4a544c 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi @@ -579,8 +579,8 @@ Enable or disable use of the selected input method (@code{toggle-input-method}). Select a new input method for the current buffer (@code{set-input-method}). @item C-x \ @var{method} @key{RET} -Temporarily enable the selected transient input method, and -automatically disable it after inserting a single character +Temporarily enable the selected transient input method ; it will be +automatically disabled after inserting a single character (@code{transient-input-method}). @item C-h I @var{method} @key{RET} @@ -682,13 +682,17 @@ including the string that stands for it in the mode line. @findex transient-input-method @kindex C-x \ - To insert only a single character using a transient input method you -can first select a transient input method by typing @kbd{C-u C-x \}. -Then typing @kbd{C-x \} (@code{transient-input-method}) will -temporarily enable the selected transient input method, and disable it -automatically after using the activated input method to insert -a single character. This is useful to insert a character from input -methods with rare Unicode characters. + Sometimes it can be convenient to enable an input method +@dfn{transiently}, for inserting only a single character. Typing +@kbd{C-x \} (@code{transient-input-method}) will temporarily enable an +input method, let you insert a single character using the input method +rules, and then automatically disable the input method. If no +transient input method was selected yet, @kbd{C-x \} will prompt you +for an input method; subsequent invocations of this command will +enable the selected transient input method. To select a different +transient input method, type @kbd{C-u C-x \}. You can select a +transient method that is different from the input method which you +selected using @kbd{C-u C-\}. @node Coding Systems @section Coding Systems diff --git a/etc/NEWS b/etc/NEWS index 4ddb192493..e11effc9e8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -624,11 +624,14 @@ The menu bar "Help" menu now has a "Show Recent Inputs" item under the ** Input methods +++ -*** 'C-x \' temporarily enables a transient input method. -'C-u C-x \' can be used to select a transient input method, e.g. -'C-u C-x \ compose RET' selects the 'compose' input method. Then typing -'C-x \ 1 2' will insert the character '½', and disable the input method -afterwards. +*** Emacs now supports "transient" input methods. +A transient input method is enabled for inserting a single character, +and is then automatically disabled. 'C-x \' temporarily enables the +selected transient input method. Use 'C-u C-x \' to select a +transient input method (which can be different from the input method +enabled by 'C-\'). For example, 'C-u C-x \ compose RET' selects the +'compose' input method; then typing 'C-x \ 1 2' will insert the +character '½', and disable the 'compose' input method afterwards. --- *** New input method 'compose' based on X Multi_key sequences. diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index c5a0145163..dc435d9b17 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -1347,13 +1347,14 @@ This is the input method activated automatically by the command (defcustom transient-input-method nil "Default transient input method. -This is the input method activated automatically by the command +This is the input method activated by the command `transient-input-method' (\\[transient-input-method])." :link '(custom-manual "(emacs)Input Methods") :group 'mule :type '(choice (const nil) mule-input-method-string) - :set-after '(current-language-environment)) + :set-after '(current-language-environment) + :version "28.1") (put 'input-method-function 'permanent-local t) @@ -1531,7 +1532,8 @@ To deactivate it programmatically, use `deactivate-input-method'." "Non-nil inside `toggle-input-method'.") (defun transient-input-method (&optional arg interactive) - "Enable transient input method for the current buffer." + "Enable a transient input method for the current buffer. +If `transient-input-method' was not yet defined, prompt for it." (interactive "P\np") (when (or arg (not transient-input-method)) (let* ((default (or (car input-method-history) default-input-method)) commit 49b6e2716c385f2a6d696cdc2d000ffa6f111f79 Merge: c1565cc3b9 cd69a50648 Author: Glenn Morris Date: Mon Nov 2 09:27:41 2020 -0800 ; Merge from origin/emacs-27 The following commit was skipped: cd69a50648 (origin/emacs-27) Recover the contents of the schemas.xml ... commit c1565cc3b9193c322f0001ab4d58a93c4761f341 Merge: 997116f3dd 4e6104ea0b Author: Glenn Morris Date: Mon Nov 2 09:27:40 2020 -0800 Merge from origin/emacs-27 4e6104ea0b ; * src/xdisp.c (display_string): Fix a typo in a comment. 7162228815 Improve indexing of check-declare d218b28ab5 ; * lisp/autoinsert.el (auto-insert-alist): Fix texinfo URL. commit 997116f3dd1e2c7c7826c74714117d5d972b90be Merge: 018e0c36fb 4de7daa1b9 Author: Glenn Morris Date: Mon Nov 2 09:27:40 2020 -0800 ; Merge from origin/emacs-27 The following commits were skipped: 4de7daa1b9 (emacs-27) ; Auto-commit of loaddefs files. 0c01381423 * doc/lispref/commands.texi (Key Sequence Input): Fix inde... 487aae38d4 Updating docs with all special window prefix keys. commit 018e0c36fbae6570e58a95d2ac47c0577a496f91 Merge: e654b41c6f 1fc9de4b81 Author: Glenn Morris Date: Mon Nov 2 09:27:40 2020 -0800 Merge from origin/emacs-27 1fc9de4b81 Improve reproducibility of generated -pkg.el files da6234e2df Make sure pixel sizes are zero when setting window size fo... 2d15296db1 Fix failure of 'emacs --daemon' on Cygwin 8abce5b0c6 CC Mode: Only recognize foo (*bar) as a function pointer w... 85d1d8d768 Fix NEWS entry for fix of Bug#44080 2443b15a91 * src/buffer.c (syms_of_buffer) : Improve doc... # Conflicts: # etc/NEWS commit e654b41c6f9eae424736bc8845d92b9dd97ccd3e Author: Michael Albinus Date: Mon Nov 2 17:56:06 2020 +0100 Fix some glitches in recent directory-files-* changes * doc/lispref/files.texi (Contents of Directories): Fix description of directory-files, directory-empty-p and directory-files-and-attributes. * etc/NEWS: Fix entry for directory-files-and-attributes. Fix typos. * lisp/dired.el (directory-empty-p): Move function from here ... * lisp/files.el (directory-empty-p): ... to here. * lisp/net/ange-ftp.el (ange-ftp-directory-files): Call `nreverse' later. * lisp/net/tramp.el (tramp-handle-directory-files): * lisp/net/tramp-adb.el (tramp-adb-handle-directory-files-and-attributes): Do not call `nreverse'. * src/dired.c (Fdirectory_files) (Fdirectory_files_and_attributes): Fix docstrings. * test/src/dired-tests.el: Removed. Tests moved to test/lisp/dired-tests.el. * test/lisp/dired-tests.el (dired-test-bug27899): Tag it :unstable. (dired-test-directory-files) (dired-test-directory-files-and-attributes): New tests. diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index f707fde88a..d49ac42bb4 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -2917,7 +2917,7 @@ or display the names in a buffer using the @code{ls} shell command. In the latter case, it can optionally display information about each file, depending on the options passed to the @code{ls} command. -@defun directory-files directory &optional full-name match-regexp nosort +@defun directory-files directory &optional full-name match-regexp nosort count This function returns a list of the names of the files in the directory @var{directory}. By default, the list is in alphabetical order. @@ -2954,20 +2954,14 @@ An error is signaled if @var{directory} is not the name of a directory that can be read. @end defun -@defun directory-empty-p filename -This utility function returns t if given @var{filename} is an -accessible directory and it does not contain any files, i.e. is an -empty directory. It will ignore '.' and '..' on systems that returns -them as files in a directory. - -As a special case, this function will also return t if -FILENAME is the empty string (""). This quirk is due to Emacs -interpreting the empty string (in some cases) as the current -directory. +@defun directory-empty-p directory +This utility function returns @code{t} if given @var{directory} is an +accessible directory and it does not contain any files, i.e., is an +empty directory. It will ignore @samp{.} and @samp{..} on systems +that return them as files in a directory. Symbolic links to directories count as directories. See @var{file-symlink-p} to distinguish symlinks. - @end defun @cindex recursive traverse of directory tree @@ -3016,7 +3010,7 @@ is called with one argument (the file or directory) and should return non-@code{nil} if that directory is the one it is looking for. @end defun -@defun directory-files-and-attributes directory &optional full-name match-regexp nosort id-format +@defun directory-files-and-attributes directory &optional full-name match-regexp nosort id-format count This is similar to @code{directory-files} in deciding which files to report on and how to report their names. However, instead of returning a list of file names, it returns for each file a diff --git a/etc/NEWS b/etc/NEWS index 5fbe0755fe..4ddb192493 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1704,34 +1704,34 @@ argument 'ellipsis', will now indicate truncation using '…' when the selected frame can display it, and using "..." otherwise. +++ -*** New command 'make-directory-autoloads'. +** New command 'make-directory-autoloads'. This does the same as the old command 'update-directory-autoloads', but has different semantics: Instead of passing in the output file via the dynamically bound 'generated-autoload-file' variable, the output file is now a explicit parameter. +++ -*** New function 'string-search'. +** New function 'string-search'. This function takes two string parameters and returns the position of the first instance of the former string in the latter. +++ -*** New function 'string-replace'. +** New function 'string-replace'. This function works along the line of 'replace-regexp-in-string', but matching on strings instead of regexps, and does not change the global match state. +++ -*** New function 'process-lines-ignore-status'. +** New function 'process-lines-ignore-status'. This is like 'process-lines', but does not signal an error if the return status is non-zero. 'process-lines-handling-status' has also been added, and takes a callback to handle the return status. --- -*** 'ascii' is now a coding system alias for 'us-ascii'. +** 'ascii' is now a coding system alias for 'us-ascii'. +++ -*** New function 'file-backup-file-names'. +** New function 'file-backup-file-names'. This function returns the list of file names of all the backup files of its file argument. @@ -1744,7 +1744,8 @@ directory and whether it contains no other directories or files. ** 'directory-files' now takes an additional COUNT parameter. The parameter makes 'directory-files' return COUNT first file names from a directory. If MATCH is also given, the function will return -first COUNT file names that match the expression. +first COUNT file names that match the expression. The same COUNT +parameter has been added to 'directory-files-and-attributes'. +++ ** The 'count-lines' function now takes an optional parameter to diff --git a/lisp/dired.el b/lisp/dired.el index 5ac2f20334..08b19a0225 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3016,20 +3016,6 @@ dired-buffers." ;; Tree Dired ;;; utility functions -(defun directory-empty-p (filename) - "Return t if FILENAME names an existing directory containing no -other files. Return nil if FILENAME does not name a directory, or if -there was trouble determining whether DIRECTORYNAME is a directory or empty. - -As a special case, this function will also return t if FILENAME is the -empty string (\"\"). This quirk is due to Emacs interpreting the -empty string (in some cases) as the current directory. - -Symbolic links to directories count as directories. -See `file-symlink-p' to distinguish symlinks. " - (and (file-directory-p filename) - (null (directory-files - filename nil directory-files-no-dot-files-regexp t 1)))) (defun dired-in-this-tree-p (file dir) ;;"Is FILE part of the directory tree starting at DIR?" diff --git a/lisp/files.el b/lisp/files.el index 59bcc3e8a7..e55552a2d9 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -888,6 +888,16 @@ recursion." (push (concat dir "/" file) files))))) (nconc result (nreverse files)))) +(defun directory-empty-p (dir) + "Return t if DIR names an existing directory containing no other files. +Return nil if DIR does not name a directory, or if there was +trouble determining whether DIR is a directory or empty. + +Symbolic links to directories count as directories. +See `file-symlink-p' to distinguish symlinks." + (and (file-directory-p dir) + (null (directory-files dir nil directory-files-no-dot-files-regexp t 1)))) + (defvar module-file-suffix) (defun load-file (file) diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 7ce90504ba..15322219ef 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -3442,9 +3442,9 @@ system TYPE.") (if (or (not match) (string-match-p match f)) (setq files (cons (if full (concat directory f) f) files)))) - (nreverse files)) - (when (natnump count) - (setq files (last files count)))) + (when (natnump count) + (setq files (last files count))) + (nreverse files))) (apply 'ange-ftp-real-directory-files directory full match nosort count))) (defun ange-ftp-directory-files-and-attributes diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index e8dbe1618d..8ccbe412f2 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -344,14 +344,14 @@ ARGUMENTS to pass to the OPERATION." (sort result (lambda (x y) (string< (car x) (car y)))))) (setq result (delq nil - (mapcar (lambda (x) (if (or (not match) - (string-match-p - match (car x))) - x)) result))) + (mapcar + (lambda (x) (if (or (not match) + (string-match-p + match (car x))) + x)) + result))) (when (natnump count) - (setq result (last result count)) - (nreverse result)) - + (setq result (last result count))) result))))))) (defun tramp-adb-get-ls-command (vec) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 7afd6fac47..915ce2f6a6 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1701,6 +1701,7 @@ ID-FORMAT valid values are `string' and `integer'." (tramp-get-remote-gid v 'integer))))))))) ;; Directory listings. + (defun tramp-sh-handle-directory-files-and-attributes (directory &optional full match nosort id-format count) "Like `directory-files-and-attributes' for Tramp files." @@ -1744,7 +1745,7 @@ ID-FORMAT valid values are `string' and `integer'." (tramp-handle-directory-files-and-attributes directory full match nosort id-format count))))) -;; FIXME Fix function to work with count parameter. +;; FIXME: Fix function to work with count parameter. (defun tramp-do-directory-files-and-attributes-with-perl (vec localname &optional id-format) "Implement `directory-files-and-attributes' for Tramp files using a Perl script." @@ -1760,7 +1761,7 @@ ID-FORMAT valid values are `string' and `integer'." (when (stringp object) (tramp-error vec 'file-error object)) object)) -;; FIXME Fix function to work with count parameter. +;; FIXME: Fix function to work with count parameter. (defun tramp-do-directory-files-and-attributes-with-stat (vec localname &optional id-format) "Implement `directory-files-and-attributes' for Tramp files using stat(1) command." diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index b3b6a94e9c..3220e51605 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -704,7 +704,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (mapcar (lambda (x) (when (string-match-p match x) x)) result)))) - ;; return count number of results + ;; Return count number of results. (when (and (natnump count) (> count 0)) (setq result (nbutlast result (- (length result) count)))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 25fa975488..ce0a2b54ff 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3135,8 +3135,8 @@ User is always nil." (unless nosort (setq result (sort result #'string<))) (when (natnump count) - (setq result (last file count)) - (nreverse files))))) + (setq result (last result count))) + result))) (defun tramp-handle-directory-files-and-attributes (directory &optional full match nosort id-format count) diff --git a/src/dired.c b/src/dired.c index 120934bfe7..039dd68c17 100644 --- a/src/dired.c +++ b/src/dired.c @@ -169,9 +169,9 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, { ptrdiff_t ind = 0, last = MOST_POSITIVE_FIXNUM; - if (!NILP(return_count)) + if (!NILP (return_count)) { - CHECK_FIXNAT(return_count); + CHECK_FIXNAT (return_count); last = XFIXNAT (return_count); } @@ -302,7 +302,7 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, DEFUN ("directory-files", Fdirectory_files, Sdirectory_files, 1, 5, 0, doc: /* Return a list of names of files in DIRECTORY. -There are three optional arguments: +There are four optional arguments: If FULL is non-nil, return absolute file names. Otherwise return names that are relative to the specified directory. If MATCH is non-nil, mention only file names whose non-directory part @@ -338,7 +338,7 @@ Value is a list of the form: where each FILEn-ATTRS is the attributes of FILEn as returned by `file-attributes'. -This function accepts four optional arguments: +This function accepts five optional arguments: If FULL is non-nil, return absolute file names. Otherwise return names that are relative to the specified directory. If MATCH is non-nil, mention only file names whose non-directory part @@ -347,10 +347,10 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable. NOSORT is useful if you plan to sort the result yourself. ID-FORMAT specifies the preferred format of attributes uid and gid, see `file-attributes' for further documentation. -On MS-Windows, performance depends on `w32-get-true-file-attributes', -which see. If COUNT is non-nil and a natural number, the function will return - COUNT number of file names (if so many are present). */) + COUNT number of file names (if so many are present). +On MS-Windows, performance depends on `w32-get-true-file-attributes', +which see. */) (Lisp_Object directory, Lisp_Object full, Lisp_Object match, Lisp_Object nosort, Lisp_Object id_format, Lisp_Object count) { diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el index cec533ddfa..66f8ed95b8 100644 --- a/test/lisp/dired-tests.el +++ b/test/lisp/dired-tests.el @@ -293,6 +293,7 @@ (ert-deftest dired-test-bug27899 () "Test for https://debbugs.gnu.org/27899 ." + :tags '(:unstable) (dired (list (expand-file-name "src" source-directory) "cygw32.c" "alloc.c" "w32xfns.c" "xdisp.c")) (let ((orig dired-hide-details-mode)) @@ -440,6 +441,81 @@ (should (= 6 (length (dired-get-marked-files)))) ; All empty dirs but zeta-empty-dir deleted. (advice-remove 'read-answer 'dired-test-bug27940-advice)))) +(ert-deftest dired-test-directory-files () + "Test for `directory-files'." + (let ((testdir (expand-file-name + "directory-files-test" (temporary-file-directory))) + (nod directory-files-no-dot-files-regexp)) + (unwind-protect + (progn + (when (file-directory-p testdir) + (delete-directory testdir t)) + + (make-directory testdir) + (when (file-directory-p testdir) + ;; directory-empty-p: test non-existent dir + (should-not (directory-empty-p "some-imaginary-dir")) + (should (= 2 (length (directory-files testdir)))) + ;; directory-empty-p: test empty dir + (should (directory-empty-p testdir)) + (should-not (directory-files testdir nil nod t 1)) + (dolist (file '(a b c d)) + (make-empty-file (expand-file-name (symbol-name file) testdir))) + (should (= 6 (length (directory-files testdir)))) + (should (equal "abcd" (mapconcat 'identity (directory-files + testdir nil nod) ""))) + (should (= 2 (length (directory-files testdir nil "[bc]")))) + (should (= 3 (length (directory-files testdir nil nod nil 3)))) + (dolist (file '(5 4 3 2 1)) + (make-empty-file + (expand-file-name (number-to-string file) testdir))) + ;;(should (= 0 (length (directory-files testdir nil "[0-9]" t -1)))) + (should (= 5 (length (directory-files testdir nil "[0-9]" t)))) + (should (= 5 (length (directory-files testdir nil "[0-9]" t 50)))) + (should-not (directory-empty-p testdir))) + + (delete-directory testdir t))))) + +(ert-deftest dired-test-directory-files-and-attributes () + "Test for `directory-files-and-attributes'." + (let ((testdir (expand-file-name + "directory-files-test" (temporary-file-directory))) + (nod directory-files-no-dot-files-regexp)) + + (unwind-protect + (progn + (when (file-directory-p testdir) + (delete-directory testdir t)) + + (make-directory testdir) + (when (file-directory-p testdir) + (should (= 2 (length (directory-files testdir)))) + (should-not (directory-files-and-attributes testdir t nod t 1)) + (dolist (file '(a b c d)) + (make-directory (expand-file-name (symbol-name file) testdir))) + (should (= 6 (length (directory-files-and-attributes testdir)))) + (dolist (dir (directory-files-and-attributes testdir t nod)) + (should (file-directory-p (car dir))) + (should-not (file-regular-p (car dir)))) + (should (= 2 (length + (directory-files-and-attributes testdir nil "[bc]")))) + (should (= 3 (length + (directory-files-and-attributes + testdir nil nod nil nil 3)))) + (dolist (file '(5 4 3 2 1)) + (make-empty-file + (expand-file-name (number-to-string file) testdir))) + ;; (should (= 0 (length (directory-files-and-attributes testdir nil + ;; "[0-9]" t + ;; nil -1)))) + (should (= 5 (length + (directory-files-and-attributes + testdir nil "[0-9]" t)))) + (should (= 5 (length + (directory-files-and-attributes + testdir nil "[0-9]" t nil 50)))))) + (when (file-directory-p testdir) + (delete-directory testdir t))))) (provide 'dired-tests) ;; dired-tests.el ends here diff --git a/test/src/dired-tests.el b/test/src/dired-tests.el deleted file mode 100644 index 3beb51366f..0000000000 --- a/test/src/dired-tests.el +++ /dev/null @@ -1,105 +0,0 @@ -;;; dired-tests.el --- Tests for directory-files in dired.c -*- lexical-binding: t; -*- - -;; Copyright (C) 2020 Free Software Foundation, Inc. - -;; Author: Arthur Miller -;; Keywords: - -;; This program 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. - -;; This program 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 this program. If not, see . - -;;; Commentary: - -;; These tests check mostly for correct behaviour with COUNT argument. - -;;; Code: -(require 'ert) - -(ert-deftest directory-files-tests () - (let ((testdir (expand-file-name "directory-files-test" - (temporary-file-directory))) - (nod directory-files-no-dot-files-regexp)) - (unwind-protect - (progn - (when (file-directory-p testdir) - (delete-directory testdir t)) - - (make-directory testdir) - (when (file-directory-p testdir) - ;; directory-empty-p: test non-existent dir - (should-not (directory-empty-p "some-imaginary-dir")) - (should (= 2 (length (directory-files testdir)))) - ;; directory-empty-p: test empty dir - (should (directory-empty-p testdir)) - (should-not (directory-files testdir nil nod t 1)) - (dolist (file '(a b c d)) - (make-empty-file (expand-file-name (symbol-name file) testdir))) - (should (= 6 (length (directory-files testdir)))) - (should (equal "abcd" (mapconcat 'identity (directory-files - testdir nil nod) ""))) - (should (= 2 (length (directory-files testdir nil "[bc]")))) - (should (= 3 (length (directory-files testdir nil nod nil 3)))) - (dolist (file '(5 4 3 2 1)) - (make-empty-file (expand-file-name (number-to-string - file) testdir))) - ;;(should (= 0 (length (directory-files testdir nil "[0-9]" t -1)))) - (should (= 5 (length (directory-files testdir nil "[0-9]" t)))) - (should (= 5 (length (directory-files testdir nil "[0-9]" t 50)))) - (should-not (directory-empty-p testdir))) - - (delete-directory testdir t))))) - -(ert-deftest directory-files-and-attributes-tests () - (let ((testdir (expand-file-name "directory-files-test" - (temporary-file-directory))) - (nod directory-files-no-dot-files-regexp)) - - (unwind-protect - (progn - (when (file-directory-p testdir) - (delete-directory testdir t)) - - (make-directory testdir) - (when (file-directory-p testdir) - (should (= 2 (length (directory-files testdir)))) - (should-not (directory-files-and-attributes testdir t nod t 1)) - (dolist (file '(a b c d)) - (make-directory (expand-file-name (symbol-name file) testdir))) - (should (= 6 (length (directory-files-and-attributes testdir)))) - (dolist (dir (directory-files-and-attributes testdir t nod)) - (should (file-directory-p (car dir))) - (should-not (file-regular-p (car dir)))) - (should (= 2 (length - (directory-files-and-attributes testdir nil - "[bc]")))) - (should (= 3 (length - (directory-files-and-attributes testdir nil nod - nil nil 3)))) - (dolist (file '(5 4 3 2 1)) - (make-empty-file (expand-file-name (number-to-string file) - testdir))) - ;; (should (= 0 (length (directory-files-and-attributes testdir nil - ;; "[0-9]" t - ;; nil -1)))) - (should (= 5 (length - (directory-files-and-attributes testdir nil - "[0-9]" t)))) - (should (= 5 (length - (directory-files-and-attributes testdir nil - "[0-9]" t - nil 50)))))) - (when (file-directory-p testdir) - (delete-directory testdir t))))) - -(provide 'dired-tests) -;;; dired-tests.el ends here commit 554495006e8d33a06c5df63fd8767c1124e1ed9e Merge: 0806075520 95f7a2835a Author: Michael Albinus Date: Mon Nov 2 17:53:00 2020 +0100 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into master commit 95f7a2835a79c1f12b5dc86230405e8040910c72 Author: João Távora Date: Mon Nov 2 16:24:59 2020 +0000 Fix Elisp's elisp--documentation-one-liner (bug#43609) To be backward compatible, this function must return nil when there is a symbol at point but no documentation for it. Before this fixed it returned the string ": nil". * lisp/progmodes/elisp-mode.el (elisp--documentation-one-liner): Check callback actually produced non-nil doc. diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index ce2b924d51..12788eacf1 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -1416,12 +1416,13 @@ which see." (defun elisp--documentation-one-liner () (let* (str (callback (lambda (doc &rest plist) - (setq str - (format "%s: %s" - (propertize (prin1-to-string - (plist-get plist :thing)) - 'face (plist-get plist :face)) - doc))))) + (when doc + (setq str + (format "%s: %s" + (propertize (prin1-to-string + (plist-get plist :thing)) + 'face (plist-get plist :face)) + doc)))))) (or (progn (elisp-eldoc-var-docstring callback) str) (progn (elisp-eldoc-funcall callback) str)))) commit 4e2264b60d1748bfec13486003f526d8c434fda6 Author: Lars Ingebrigtsen Date: Mon Nov 2 16:53:57 2020 +0100 Fix mouse-1 on [Show] buttons in the *Help* buffer * lisp/descr-text.el (describe-text-sexp): Add a `follow-link' so that the [Show] buttons work correctly with mouse-1 (bug#44340). diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 075cb21c21..677db2f68a 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -54,10 +54,12 @@ (<= (length pp) (- (window-width) (current-column)))) (insert pp) (insert-text-button - "[Show]" 'action (lambda (&rest _ignore) - (with-output-to-temp-buffer - "*Pp Eval Output*" - (princ pp))) + "[Show]" + 'follow-link t + 'action (lambda (&rest _ignore) + (with-output-to-temp-buffer + "*Pp Eval Output*" + (princ pp))) 'help-echo "mouse-2, RET: pretty print value in another buffer")))) (defun describe-property-list (properties) commit cd69a50648a110ff6089f39553ddf0809479b597 Author: Yasuhiro KIMURA Date: Sun Nov 1 14:01:31 2020 +0100 Recover the contents of the schemas.xml file * etc/schema/schemas.xml: Recover the file, which was apparently (mostly) removed by mistake by commit 165f738382 (bug#42851). Copyright-paperwork-exempt: yes diff --git a/etc/schema/schemas.xml b/etc/schema/schemas.xml index f1e0ed7856..40175b056b 100644 --- a/etc/schema/schemas.xml +++ b/etc/schema/schemas.xml @@ -1,7 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + commit 5932df74354316e117b2e6a43dc3ffd748aa7c7f Author: Mauro Aranda Date: Mon Nov 2 09:33:55 2020 -0300 Document that the :match function for a widget takes an external value * doc/misc/widget.texi (Basic Types): Document what an external value is. Document that a :match function expects the value to be in the external format. (Bug#8717) diff --git a/doc/misc/widget.texi b/doc/misc/widget.texi index bccfa0ab6c..2dde6ce4d3 100644 --- a/doc/misc/widget.texi +++ b/doc/misc/widget.texi @@ -484,9 +484,21 @@ are interpreted in a widget specific way. The following keyword arguments apply to all widgets: @table @code +@cindex internal format +@cindex external format @vindex value@r{ keyword} @item :value -The initial value for widgets of this type. +The initial value for widgets of this type. Typically, a widget +represents its value in two formats: external and internal. The +external format is the value as the rest of Emacs sees it, and the +internal format is a representation that the widget defines and uses +in a widget specific way. + +Both formats might be the same for certain widgets and might differ +for others, and there is no guarantee about which format the value +stored in the @code{:value} property has. However, when creating a +widget or defining a new one (@pxref{Defining New Widgets}), the +@code{:value} should be in the external format. @vindex format@r{ keyword} @item :format @@ -629,8 +641,9 @@ representation of the @code{:value} property if not. @vindex match@r{ keyword} @item :match -Should be a function called with two arguments, the widget and a value, -and returning non-@code{nil} if the widget can represent the specified value. +Should be a function called with two arguments, the widget and an +external value, and should return non-@code{nil} if the widget can +represent the specified value. @vindex validate@r{ keyword} @item :validate commit 1b7ab9d0ac2edf88d8c12346a6c0c1301670f858 Author: Stephen Berman Date: Mon Nov 2 23:24:20 2020 +0100 Don't render XML declaration of an HTML document (bug#44348) * lisp/net/eww.el (eww--preprocess-html): Prevent converting the left angle bracket in the sequence " Date: Mon Nov 2 12:38:27 2020 +0100 Add directory-empty-p and new argument COUNT for directory-files-* * doc/lispref/files.texi (Contents of Directories): Mention COUNT argument of directory-files. Add directory-empty-p. * etc/NEWS: Mention directory-empty-p and directory-files changes. * lisp/dired.el (directory-empty-p): New defun. * lisp/net/ange-ftp.el (ange-ftp-directory-files) (ange-ftp-directory-files-and-attributes): * lisp/net/tramp.el (tramp-handle-directory-files) (tramp-handle-directory-files-and-attributes): * lisp/net/tramp-adb.el (tramp-adb-handle-directory-files-and-attributes): * lisp/net/tramp-rclone.el (tramp-rclone-handle-directory-files): * lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes): * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files): Add new COUNT argument. * src/dired.c (directory_files_internal): Implement new RETURN_COUNT argument. (Fdirectory_files, Fdirectory_files_and_attributes): Add new COUNT argument. * src/lisp.h (directory_files_internal): Add RETURN_COUNT to declaration. * src/sysdep.c (list_system_processes): Add Qnil to directory_files_internal call. * test/src/dired-tests.el (directory-files-and-attributes-tests): New file. diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index fc66d1c085..f707fde88a 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -2937,6 +2937,10 @@ you want the utmost possible speed and don't care what order the files are processed in. If the order of processing is visible to the user, then the user will probably be happier if you do sort the names. +If @var{count} is non-@code{nil}, the function will return names of +first @var{count} number of files, or names of all files, whichever +occurs first. @var{count} has to be an integer greater than zero. + @example @group (directory-files "~lewis") @@ -2950,6 +2954,22 @@ An error is signaled if @var{directory} is not the name of a directory that can be read. @end defun +@defun directory-empty-p filename +This utility function returns t if given @var{filename} is an +accessible directory and it does not contain any files, i.e. is an +empty directory. It will ignore '.' and '..' on systems that returns +them as files in a directory. + +As a special case, this function will also return t if +FILENAME is the empty string (""). This quirk is due to Emacs +interpreting the empty string (in some cases) as the current +directory. + +Symbolic links to directories count as directories. +See @var{file-symlink-p} to distinguish symlinks. + +@end defun + @cindex recursive traverse of directory tree @defun directory-files-recursively directory regexp &optional include-directories predicate follow-symlinks Return all files under @var{directory} whose names match @var{regexp}. diff --git a/etc/NEWS b/etc/NEWS index 59a0f26f26..6c4f1b24be 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1723,6 +1723,17 @@ been added, and takes a callback to handle the return status. This function returns the list of file names of all the backup files of its file argument. ++++ +** New utility function 'directory-empty-p'. +This predicate tests whether a given filename is an accessible +directory and whether it contains no other directories or files. + ++++ +** 'directory-files' now takes an additional COUNT parameter. +The parameter makes 'directory-files' return COUNT first file names +from a directory. If MATCH is also given, the function will return +first COUNT file names that match the expression. + +++ ** The 'count-lines' function now takes an optional parameter to ignore invisible lines. diff --git a/lisp/dired.el b/lisp/dired.el index 08b19a0225..5ac2f20334 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3016,6 +3016,20 @@ dired-buffers." ;; Tree Dired ;;; utility functions +(defun directory-empty-p (filename) + "Return t if FILENAME names an existing directory containing no +other files. Return nil if FILENAME does not name a directory, or if +there was trouble determining whether DIRECTORYNAME is a directory or empty. + +As a special case, this function will also return t if FILENAME is the +empty string (\"\"). This quirk is due to Emacs interpreting the +empty string (in some cases) as the current directory. + +Symbolic links to directories count as directories. +See `file-symlink-p' to distinguish symlinks. " + (and (file-directory-p filename) + (null (directory-files + filename nil directory-files-no-dot-files-regexp t 1)))) (defun dired-in-this-tree-p (file dir) ;;"Is FILE part of the directory tree starting at DIR?" diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 0cb8d7cb83..7ce90504ba 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -3427,8 +3427,7 @@ system TYPE.") (and (file-directory-p name) (file-readable-p name))) -(defun ange-ftp-directory-files (directory &optional full match - &rest v19-args) +(defun ange-ftp-directory-files (directory &optional full match nosort count) (setq directory (expand-file-name directory)) (if (ange-ftp-ftp-name directory) (progn @@ -3443,19 +3442,21 @@ system TYPE.") (if (or (not match) (string-match-p match f)) (setq files (cons (if full (concat directory f) f) files)))) - (nreverse files))) - (apply 'ange-ftp-real-directory-files directory full match v19-args))) + (nreverse files)) + (when (natnump count) + (setq files (last files count)))) + (apply 'ange-ftp-real-directory-files directory full match nosort count))) (defun ange-ftp-directory-files-and-attributes - (directory &optional full match nosort id-format) + (directory &optional full match nosort id-format count) (setq directory (expand-file-name directory)) (if (ange-ftp-ftp-name directory) (mapcar (lambda (file) (cons file (file-attributes (expand-file-name file directory)))) - (ange-ftp-directory-files directory full match nosort)) + (ange-ftp-directory-files directory full match nosort count)) (ange-ftp-real-directory-files-and-attributes - directory full match nosort id-format))) + directory full match nosort id-format count))) (defun ange-ftp-file-attributes (file &optional id-format) (setq file (expand-file-name file)) diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 3d3b955e8c..e8dbe1618d 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -301,7 +301,7 @@ ARGUMENTS to pass to the OPERATION." file-properties))) (defun tramp-adb-handle-directory-files-and-attributes - (directory &optional full match nosort id-format) + (directory &optional full match nosort id-format count) "Like `directory-files-and-attributes' for Tramp files." (unless (file-exists-p directory) (tramp-error @@ -311,8 +311,8 @@ ARGUMENTS to pass to the OPERATION." (with-parsed-tramp-file-name (expand-file-name directory) nil (copy-tree (with-tramp-file-property - v localname (format "directory-files-and-attributes-%s-%s-%s-%s" - full match id-format nosort) + v localname (format "directory-files-and-attributes-%s-%s-%s-%s-%s" + full match id-format nosort count) (with-current-buffer (tramp-get-buffer v) (when (tramp-adb-send-command-and-check v (format "%s -a -l %s" @@ -342,11 +342,17 @@ ARGUMENTS to pass to the OPERATION." (unless nosort (setq result (sort result (lambda (x y) (string< (car x) (car y)))))) - (delq nil - (mapcar (lambda (x) - (if (or (not match) (string-match-p match (car x))) - x)) - result))))))))) + + (setq result (delq nil + (mapcar (lambda (x) (if (or (not match) + (string-match-p + match (car x))) + x)) result))) + (when (natnump count) + (setq result (last result count)) + (nreverse result)) + + result))))))) (defun tramp-adb-get-ls-command (vec) "Determine `ls' command and its arguments." diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el index 3701bfc22c..1a7b0600d2 100644 --- a/lisp/net/tramp-rclone.el +++ b/lisp/net/tramp-rclone.el @@ -301,7 +301,7 @@ file names." (tramp-rclone-flush-directory-cache v))) (defun tramp-rclone-handle-directory-files - (directory &optional full match nosort) + (directory &optional full match nosort count) "Like `directory-files' for Tramp files." (unless (file-exists-p directory) (tramp-error @@ -312,7 +312,7 @@ file names." (with-parsed-tramp-file-name directory nil (let ((result (directory-files - (tramp-rclone-local-file-name directory) full match))) + (tramp-rclone-local-file-name directory) full match count))) ;; Massage the result. (when full (let ((local (concat "^" (regexp-quote (tramp-rclone-mount-point v)))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 860641b258..7afd6fac47 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1701,9 +1701,8 @@ ID-FORMAT valid values are `string' and `integer'." (tramp-get-remote-gid v 'integer))))))))) ;; Directory listings. - (defun tramp-sh-handle-directory-files-and-attributes - (directory &optional full match nosort id-format) + (directory &optional full match nosort id-format count) "Like `directory-files-and-attributes' for Tramp files." (unless id-format (setq id-format 'integer)) (unless (file-exists-p directory) @@ -1743,8 +1742,9 @@ ID-FORMAT valid values are `string' and `integer'." (sort result (lambda (x y) (string< (car x) (car y))))) ;; The scripts could fail, for example with huge file size. (tramp-handle-directory-files-and-attributes - directory full match nosort id-format))))) + directory full match nosort id-format count))))) +;; FIXME Fix function to work with count parameter. (defun tramp-do-directory-files-and-attributes-with-perl (vec localname &optional id-format) "Implement `directory-files-and-attributes' for Tramp files using a Perl script." @@ -1760,6 +1760,7 @@ ID-FORMAT valid values are `string' and `integer'." (when (stringp object) (tramp-error vec 'file-error object)) object)) +;; FIXME Fix function to work with count parameter. (defun tramp-do-directory-files-and-attributes-with-stat (vec localname &optional id-format) "Implement `directory-files-and-attributes' for Tramp files using stat(1) command." diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index c236e1cb65..b3b6a94e9c 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -689,7 +689,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (tramp-error v 'file-error "%s `%s'" (match-string 0) filename))))))) (defun tramp-smb-handle-directory-files - (directory &optional full match nosort) + (directory &optional full match nosort count) "Like `directory-files' for Tramp files." (unless (file-exists-p directory) (tramp-error @@ -703,6 +703,11 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (delete nil (mapcar (lambda (x) (when (string-match-p match x) x)) result)))) + + ;; return count number of results + (when (and (natnump count) (> count 0)) + (setq result (nbutlast result (- (length result) count)))) + ;; Prepend directory. (when full (setq result diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index f3966479db..25fa975488 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3116,7 +3116,7 @@ User is always nil." (setq directory (substring directory 0 -1))) directory) -(defun tramp-handle-directory-files (directory &optional full match nosort) +(defun tramp-handle-directory-files (directory &optional full match nosort count) "Like `directory-files' for Tramp files." (unless (file-exists-p directory) (tramp-error @@ -3132,16 +3132,20 @@ User is always nil." (when (or (null match) (string-match-p match item)) (push (if full (concat directory item) item) result))) - (if nosort result (sort result #'string<))))) + (unless nosort + (setq result (sort result #'string<))) + (when (natnump count) + (setq result (last file count)) + (nreverse files))))) (defun tramp-handle-directory-files-and-attributes - (directory &optional full match nosort id-format) + (directory &optional full match nosort id-format count) "Like `directory-files-and-attributes' for Tramp files." (mapcar (lambda (x) (cons x (file-attributes (if full x (expand-file-name x directory)) id-format))) - (directory-files directory full match nosort))) + (directory-files directory full match nosort count))) (defun tramp-handle-dired-uncache (dir) "Like `dired-uncache' for Tramp files." diff --git a/src/dired.c b/src/dired.c index 8256f2626d..120934bfe7 100644 --- a/src/dired.c +++ b/src/dired.c @@ -165,8 +165,16 @@ read_dirent (DIR *dir, Lisp_Object dirname) Lisp_Object directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object match, Lisp_Object nosort, bool attrs, - Lisp_Object id_format) + Lisp_Object id_format, Lisp_Object return_count) { + ptrdiff_t ind = 0, last = MOST_POSITIVE_FIXNUM; + + if (!NILP(return_count)) + { + CHECK_FIXNAT(return_count); + last = XFIXNAT (return_count); + } + if (!NILP (match)) CHECK_STRING (match); @@ -267,6 +275,10 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, else finalname = name; + if (ind == last) + break; + ind ++; + list = Fcons (attrs ? Fcons (finalname, fileattrs) : finalname, list); } @@ -288,7 +300,7 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, } -DEFUN ("directory-files", Fdirectory_files, Sdirectory_files, 1, 4, 0, +DEFUN ("directory-files", Fdirectory_files, Sdirectory_files, 1, 5, 0, doc: /* Return a list of names of files in DIRECTORY. There are three optional arguments: If FULL is non-nil, return absolute file names. Otherwise return names @@ -297,9 +309,11 @@ If MATCH is non-nil, mention only file names whose non-directory part matches the regexp MATCH. If NOSORT is non-nil, the list is not sorted--its order is unpredictable. Otherwise, the list returned is sorted with `string-lessp'. - NOSORT is useful if you plan to sort the result yourself. */) + NOSORT is useful if you plan to sort the result yourself. +If COUNT is non-nil and a natural number, the function will return + COUNT number of file names (if so many are present). */) (Lisp_Object directory, Lisp_Object full, Lisp_Object match, - Lisp_Object nosort) + Lisp_Object nosort, Lisp_Object count) { directory = Fexpand_file_name (directory, Qnil); @@ -307,14 +321,15 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable. call the corresponding file name handler. */ Lisp_Object handler = Ffind_file_name_handler (directory, Qdirectory_files); if (!NILP (handler)) - return call5 (handler, Qdirectory_files, directory, - full, match, nosort); + return call6 (handler, Qdirectory_files, directory, + full, match, nosort, count); - return directory_files_internal (directory, full, match, nosort, false, Qnil); + return directory_files_internal (directory, full, match, nosort, + false, Qnil, count); } DEFUN ("directory-files-and-attributes", Fdirectory_files_and_attributes, - Sdirectory_files_and_attributes, 1, 5, 0, + Sdirectory_files_and_attributes, 1, 6, 0, doc: /* Return a list of names of files and their attributes in DIRECTORY. Value is a list of the form: @@ -333,9 +348,11 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable. ID-FORMAT specifies the preferred format of attributes uid and gid, see `file-attributes' for further documentation. On MS-Windows, performance depends on `w32-get-true-file-attributes', -which see. */) +which see. +If COUNT is non-nil and a natural number, the function will return + COUNT number of file names (if so many are present). */) (Lisp_Object directory, Lisp_Object full, Lisp_Object match, - Lisp_Object nosort, Lisp_Object id_format) + Lisp_Object nosort, Lisp_Object id_format, Lisp_Object count) { directory = Fexpand_file_name (directory, Qnil); @@ -344,11 +361,11 @@ which see. */) Lisp_Object handler = Ffind_file_name_handler (directory, Qdirectory_files_and_attributes); if (!NILP (handler)) - return call6 (handler, Qdirectory_files_and_attributes, - directory, full, match, nosort, id_format); + return call7 (handler, Qdirectory_files_and_attributes, + directory, full, match, nosort, id_format, count); return directory_files_internal (directory, full, match, nosort, - true, id_format); + true, id_format, count); } diff --git a/src/lisp.h b/src/lisp.h index 45353fbef3..a3cfb5044d 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4612,7 +4612,7 @@ extern void syms_of_ccl (void); extern void syms_of_dired (void); extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, - bool, Lisp_Object); + bool, Lisp_Object, Lisp_Object); /* Defined in term.c. */ extern int *char_ins_del_vector; diff --git a/src/sysdep.c b/src/sysdep.c index f6c0ddee01..a96de2c18b 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -2892,7 +2892,8 @@ list_system_processes (void) process. */ procdir = build_string ("/proc"); match = build_string ("[0-9]+"); - proclist = directory_files_internal (procdir, Qnil, match, Qt, false, Qnil); + proclist = directory_files_internal (procdir, Qnil, match, Qt, + false, Qnil, Qnil); /* `proclist' gives process IDs as strings. Destructively convert each string into a number. */ diff --git a/test/src/dired-tests.el b/test/src/dired-tests.el new file mode 100644 index 0000000000..3beb51366f --- /dev/null +++ b/test/src/dired-tests.el @@ -0,0 +1,105 @@ +;;; dired-tests.el --- Tests for directory-files in dired.c -*- lexical-binding: t; -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; Author: Arthur Miller +;; Keywords: + +;; This program 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. + +;; This program 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 this program. If not, see . + +;;; Commentary: + +;; These tests check mostly for correct behaviour with COUNT argument. + +;;; Code: +(require 'ert) + +(ert-deftest directory-files-tests () + (let ((testdir (expand-file-name "directory-files-test" + (temporary-file-directory))) + (nod directory-files-no-dot-files-regexp)) + (unwind-protect + (progn + (when (file-directory-p testdir) + (delete-directory testdir t)) + + (make-directory testdir) + (when (file-directory-p testdir) + ;; directory-empty-p: test non-existent dir + (should-not (directory-empty-p "some-imaginary-dir")) + (should (= 2 (length (directory-files testdir)))) + ;; directory-empty-p: test empty dir + (should (directory-empty-p testdir)) + (should-not (directory-files testdir nil nod t 1)) + (dolist (file '(a b c d)) + (make-empty-file (expand-file-name (symbol-name file) testdir))) + (should (= 6 (length (directory-files testdir)))) + (should (equal "abcd" (mapconcat 'identity (directory-files + testdir nil nod) ""))) + (should (= 2 (length (directory-files testdir nil "[bc]")))) + (should (= 3 (length (directory-files testdir nil nod nil 3)))) + (dolist (file '(5 4 3 2 1)) + (make-empty-file (expand-file-name (number-to-string + file) testdir))) + ;;(should (= 0 (length (directory-files testdir nil "[0-9]" t -1)))) + (should (= 5 (length (directory-files testdir nil "[0-9]" t)))) + (should (= 5 (length (directory-files testdir nil "[0-9]" t 50)))) + (should-not (directory-empty-p testdir))) + + (delete-directory testdir t))))) + +(ert-deftest directory-files-and-attributes-tests () + (let ((testdir (expand-file-name "directory-files-test" + (temporary-file-directory))) + (nod directory-files-no-dot-files-regexp)) + + (unwind-protect + (progn + (when (file-directory-p testdir) + (delete-directory testdir t)) + + (make-directory testdir) + (when (file-directory-p testdir) + (should (= 2 (length (directory-files testdir)))) + (should-not (directory-files-and-attributes testdir t nod t 1)) + (dolist (file '(a b c d)) + (make-directory (expand-file-name (symbol-name file) testdir))) + (should (= 6 (length (directory-files-and-attributes testdir)))) + (dolist (dir (directory-files-and-attributes testdir t nod)) + (should (file-directory-p (car dir))) + (should-not (file-regular-p (car dir)))) + (should (= 2 (length + (directory-files-and-attributes testdir nil + "[bc]")))) + (should (= 3 (length + (directory-files-and-attributes testdir nil nod + nil nil 3)))) + (dolist (file '(5 4 3 2 1)) + (make-empty-file (expand-file-name (number-to-string file) + testdir))) + ;; (should (= 0 (length (directory-files-and-attributes testdir nil + ;; "[0-9]" t + ;; nil -1)))) + (should (= 5 (length + (directory-files-and-attributes testdir nil + "[0-9]" t)))) + (should (= 5 (length + (directory-files-and-attributes testdir nil + "[0-9]" t + nil 50)))))) + (when (file-directory-p testdir) + (delete-directory testdir t))))) + +(provide 'dired-tests) +;;; dired-tests.el ends here commit 5cea77af41b59ba6f6386264812c36ec31ba2efc Author: Lars Ingebrigtsen Date: Mon Nov 2 10:17:08 2020 +0100 Partially revert previous define-minor-mode change * lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring): Only document the values we want to support, not the ones we actually support. (define-minor-mode): Partially revert to previous behaviour. diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 77f10e61c6..261f2508af 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -90,7 +90,7 @@ 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. -All other values will disable the mode. +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.") @@ -312,12 +312,10 @@ or call the function `%s'.")))) (cond ((eq arg 'toggle) (not ,getter)) ((and (numberp arg) - (> arg 0)) - t) - ((eq arg nil) - t) + (< arg 1)) + nil) (t - nil))) + t))) ,@body ;; The on/off hooks are here for backward compatibility only. (run-hooks ',hook (if ,getter ',hook-on ',hook-off)) diff --git a/test/lisp/emacs-lisp/easy-mmode-tests.el b/test/lisp/emacs-lisp/easy-mmode-tests.el index 4a448200a2..c05379e441 100644 --- a/test/lisp/emacs-lisp/easy-mmode-tests.el +++ b/test/lisp/emacs-lisp/easy-mmode-tests.el @@ -48,22 +48,16 @@ (with-temp-buffer (define-minor-mode test-mode "A test.") (should (eq test-mode nil)) - (test-mode t) - (should (eq test-mode nil)) (test-mode nil) (should (eq test-mode t)) (test-mode -33) (should (eq test-mode nil)) (test-mode 33) (should (eq test-mode t)) - (test-mode 0) - (should (eq test-mode nil)) - (test-mode 'toggle) - (should (eq test-mode t)) (test-mode 'toggle) (should (eq test-mode nil)) - (test-mode "what") - (should (eq test-mode nil)))) + (test-mode 'toggle) + (should (eq test-mode t)))) (provide 'easy-mmode-tests) commit 5ab5504def63ebdfba08169f24a5829353bff137 Author: Stefan Kangas Date: Sun Nov 1 22:49:12 2020 +0100 Fix mistake in Lisp conversion of describe-map-tree * lisp/help.el (describe-map-tree): Fix mistake in conversion to Lisp from the C function describe_map_tree; make the condition match the now removed C code. (Bug#44360) diff --git a/lisp/help.el b/lisp/help.el index df055d602f..466ff21eb2 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1189,8 +1189,8 @@ Any inserted text ends in two newlines (used by ;; map. (or (keymapp sub-shadows) (null sub-shadows) - (consp sub-shadows) - (not (keymapp (car sub-shadows))))) + (and (consp sub-shadows) + (keymapp (car sub-shadows))))) ;; Maps we have already listed in this loop shadow this map. (let ((tail orig-maps)) (while (not (equal tail maps)) commit 030ab2dad50a448bd5cf3ef06f5d768717cdac70 Author: Juri Linkov Date: Sun Nov 1 23:35:41 2020 +0200 Transient input methods bound to 'C-x \' (bug#44266) * lisp/international/mule-cmds.el (ctl-x-map): Bind 'C-x \' to 'transient-input-method'. (input-method-function): New defcustom. (transient-input-method): New command. * doc/emacs/mule.texi (Select Input Method): Document transient-input-method. diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index b78019020a..d4ad1d6d5e 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi @@ -578,6 +578,11 @@ Enable or disable use of the selected input method (@code{toggle-input-method}). @item C-x @key{RET} C-\ @var{method} @key{RET} Select a new input method for the current buffer (@code{set-input-method}). +@item C-x \ @var{method} @key{RET} +Temporarily enable the selected transient input method, and +automatically disable it after inserting a single character +(@code{transient-input-method}). + @item C-h I @var{method} @key{RET} @itemx C-h C-\ @var{method} @key{RET} @findex describe-input-method @@ -675,6 +680,16 @@ character. input methods. The list gives information about each input method, including the string that stands for it in the mode line. +@findex transient-input-method +@kindex C-x \ + To insert only a single character using a transient input method you +can first select a transient input method by typing @kbd{C-u C-x \}. +Then typing @kbd{C-x \} (@code{transient-input-method}) will +temporarily enable the selected transient input method, and disable it +automatically after using the activated input method to insert +a single character. This is useful to insert a character from input +methods with rare Unicode characters. + @node Coding Systems @section Coding Systems @cindex coding systems diff --git a/etc/NEWS b/etc/NEWS index 7bf212dd13..1061a15cd2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -132,14 +132,6 @@ Emacs to break lines after more characters than just whitespace characters. In particular, this significantly improves word-wrapping for CJK text mixed with Latin text. ---- -** New input method 'compose' based on X Multi_key sequences. - ---- -** Improved language transliteration in Malayalam input methods. -Added a new Mozhi scheme. The inapplicable ITRANS scheme is now -deprecated. Errors in the Inscript method were corrected. - --- ** Rudimentary support for the 'st' terminal emulator. Emacs now supports 256 color display on the 'st' terminal emulator. @@ -629,6 +621,23 @@ recorded for the purpose of 'view-lossage'. The menu bar "Help" menu now has a "Show Recent Inputs" item under the "Describe" sub-menu. +** Input methods + ++++ +*** 'C-x \' temporarily enables a transient input method. +'C-u C-x \' can be used to select a transient input method, e.g. +'C-u C-x \ compose RET' selects the 'compose' input method. Then typing +'C-x \ 1 2' will insert the character '½', and disable the input method +afterwards. + +--- +*** New input method 'compose' based on X Multi_key sequences. + +--- +*** Improved language transliteration in Malayalam input methods. +Added a new Mozhi scheme. The inapplicable ITRANS scheme is now +deprecated. Errors in the Inscript method were corrected. + ** Ispell +++ diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index e3155dfc52..c5a0145163 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -55,6 +55,7 @@ ;; Keep "C-x C-m ..." for mule specific commands. (define-key ctl-x-map "\C-m" mule-keymap) +(define-key ctl-x-map "\\" 'transient-input-method) (defvar describe-language-environment-map (let ((map (make-sparse-keymap "Describe Language Environment"))) @@ -1344,6 +1345,16 @@ This is the input method activated automatically by the command mule-input-method-string) :set-after '(current-language-environment)) +(defcustom transient-input-method nil + "Default transient input method. +This is the input method activated automatically by the command +`transient-input-method' (\\[transient-input-method])." + :link '(custom-manual "(emacs)Input Methods") + :group 'mule + :type '(choice (const nil) + mule-input-method-string) + :set-after '(current-language-environment)) + (put 'input-method-function 'permanent-local t) (defvar input-method-history nil @@ -1519,6 +1530,35 @@ To deactivate it programmatically, use `deactivate-input-method'." (defvar toggle-input-method-active nil "Non-nil inside `toggle-input-method'.") +(defun transient-input-method (&optional arg interactive) + "Enable transient input method for the current buffer." + (interactive "P\np") + (when (or arg (not transient-input-method)) + (let* ((default (or (car input-method-history) default-input-method)) + (input-method + (read-input-method-name + (if default "Transient input method (default %s): " "Transient input method: ") + default t))) + (setq transient-input-method input-method) + (when interactive + (customize-mark-as-set 'transient-input-method)))) + (let* ((previous-input-method current-input-method) + (history input-method-history) + (clearfun (make-symbol "clear-transient-input-method")) + (exitfun + (lambda () + (deactivate-input-method) + (when previous-input-method + (activate-input-method previous-input-method)) + (setq input-method-history history) + (remove-hook 'input-method-after-insert-chunk-hook clearfun)))) + (fset clearfun (lambda () (funcall exitfun))) + (add-hook 'input-method-after-insert-chunk-hook clearfun) + (when previous-input-method + (deactivate-input-method)) + (activate-input-method transient-input-method) + exitfun)) + (defun toggle-input-method (&optional arg interactive) "Enable or disable multilingual text input method for the current buffer. Only one input method can be enabled at any time in a given buffer. commit 1a1019f99fce48c372f8a43c2a9758f5dac9153e Author: Juri Linkov Date: Sun Nov 1 23:25:10 2020 +0200 * lisp/leim/quail/compose.el: New input method (bug#44267). diff --git a/etc/NEWS b/etc/NEWS index 59a0f26f26..7bf212dd13 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -132,6 +132,9 @@ Emacs to break lines after more characters than just whitespace characters. In particular, this significantly improves word-wrapping for CJK text mixed with Latin text. +--- +** New input method 'compose' based on X Multi_key sequences. + --- ** Improved language transliteration in Malayalam input methods. Added a new Mozhi scheme. The inapplicable ITRANS scheme is now diff --git a/lisp/leim/quail/compose.el b/lisp/leim/quail/compose.el new file mode 100644 index 0000000000..eb37a42199 --- /dev/null +++ b/lisp/leim/quail/compose.el @@ -0,0 +1,2926 @@ +;;; compose.el --- Quail package for Multi_key character composition -*-coding: utf-8;-*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; Author: Juri Linkov +;; Keywords: multilingual, input method, i18n + +;; 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 input method supports the same key sequences as defined by the +;; standard X Multi_key: https://en.wikipedia.org/wiki/Compose_key + +;; You can enable this input method transiently with `C-u C-x \ compose RET'. +;; Then typing `C-x \' will enable this input method temporarily, and +;; after typing a key sequence it will be disabled. So typing +;; e.g. `C-x \ E =' will insert the Euro sign character, and disable +;; this input method automatically afterwards. + +;;; Code: + +(require 'quail) + +(quail-define-package + "compose" "UTF-8" "+" t + "Compose-like input method with the same key sequences as X Multi_key. +Examples: + E = -> € 1 2 -> ½ ^ 3 -> ³" + '(("\t" . quail-completion)) + t nil nil nil nil nil nil nil nil t) + +(quail-define-rules + ("''" ?´) + ("-^" ?¯) + ("^-" ?¯) + ("__" ?¯) + ("_^" ?¯) + (" (" ?˘) + ("( " ?˘) + ("\"\"" ?¨) + (" <" ?ˇ) + ("< " ?ˇ) + ("-- " ?­) + ("++" ?#) + ("' " ?\') + (" '" ?\') + ("AT" ?@) + ("((" ?\[) + ("//" ["\\\\"]) + ("/<" ["\\\\"]) + (" " ?^) + (" >" ?^) + ("` " ?`) + (" `" ?`) + (", " ?¸) + (" ," ?¸) + (",," ?¸) + ("(-" ?\{) + ("-(" ?\{) + ("/^" ?|) + ("^/" ?|) + ("VL" ?|) + ("LV" ?|) + ("vl" ?|) + ("lv" ?|) + (")-" ?\}) + ("-)" ?\}) + ("~ " ?~) + (" ~" ?~) + ("- " ?~) + (" -" ?~) + (" " ? ) + (" ." ? ) + ("oc" ?©) + ("oC" ?©) + ("Oc" ?©) + ("OC" ?©) + ("Co" ?©) + ("CO" ?©) + ("or" ?®) + ("oR" ?®) + ("Or" ?®) + ("OR" ?®) + ("Ro" ?®) + ("RO" ?®) + (".>" ?›) + (".<" ?‹) + (".." ?…) + (".-" ?·) + (".^" ?·) + ("^." ?·) + (".=" ?•) + ("!^" ?¦) + ("!!" ?¡) + ("p!" ?¶) + ("P!" ?¶) + ("+-" ?±) + ("-+" ?±) + ("??" ?¿) + ("ss" ?ß) + ("SS" ?ẞ) + ("oe" ?œ) + ("OE" ?Œ) + ("ae" ?æ) + ("AE" ?Æ) + ("ff" ?ff) + ("fi" ?fi) + ("fl" ?fl) + ("Fi" ?ffi) + ("Fl" ?ffl) + ("IJ" ?IJ) + ("Ij" ?IJ) + ("ij" ?ij) + ("oo" ?°) + ("*0" ?°) + ("0*" ?°) + ("<<" ?«) + (">>" ?») + ("<'" ?‘) + ("'<" ?‘) + (">'" ?’) + ("'>" ?’) + (",'" ?‚) + ("'," ?‚) + ("<\"" ?“) + ("\"<" ?“) + (">\"" ?”) + ("\">" ?”) + (",\"" ?„) + ("\"," ?„) + ("%o" ?‰) + ("CE" ?₠) + ("C/" ?₡) + ("/C" ?₡) + ("Cr" ?₢) + ("Fr" ?₣) + ("L=" ?₤) + ("=L" ?₤) + ("m/" ?₥) + ("/m" ?₥) + ("N=" ?₦) + ("=N" ?₦) + ("Pt" ?₧) + ("Rs" ?₨) + ("W=" ?₩) + ("=W" ?₩) + ("d=" ?₫) + ("=d" ?₫) + ("C=" ?€) + ("=C" ?€) + ("c=" ?€) + ("=c" ?€) + ("E=" ?€) + ("=E" ?€) + ("e=" ?€) + ("=e" ?€) + ("С=" ?€) + ("=С" ?€) + ("Е=" ?€) + ("=Е" ?€) + ("P=" ?₽) + ("p=" ?₽) + ("=P" ?₽) + ("=p" ?₽) + ("З=" ?₽) + ("з=" ?₽) + ("=З" ?₽) + ("=з" ?₽) + ("R=" ?₹) + ("=R" ?₹) + ("r=" ?₹) + ("=r" ?₹) + ("C|" ?¢) + ("|C" ?¢) + ("c|" ?¢) + ("|c" ?¢) + ("c/" ?¢) + ("/c" ?¢) + ("L-" ?£) + ("-L" ?£) + ("l-" ?£) + ("-l" ?£) + ("Y=" ?¥) + ("=Y" ?¥) + ("y=" ?¥) + ("=y" ?¥) + ("Y-" ?¥) + ("-Y" ?¥) + ("y-" ?¥) + ("-y" ?¥) + ("fs" ?ſ) + ("fS" ?ſ) + ("--." ?–) + ("---" ?—) + ("#q" ?♩) + ("#e" ?♪) + ("#E" ?♫) + ("#S" ?♬) + ("#b" ?♭) + ("#f" ?♮) + ("##" ?♯) + ("so" ?§) + ("os" ?§) + ("SO" ?§) + ("OS" ?§) + ("s!" ?§) + ("S!" ?§) + ("па" ?§) + ("ox" ?¤) + ("xo" ?¤) + ("oX" ?¤) + ("Xo" ?¤) + ("OX" ?¤) + ("XO" ?¤) + ("Ox" ?¤) + ("xO" ?¤) + ("PP" ?¶) + ("No" ?№) + ("NO" ?№) + ("Но" ?№) + ("НО" ?№) + ("?!" ?⸘) + ("!?" ?‽) + ("CCCP" ?☭) + ("OA" ?Ⓐ) + ("<3" ?♥) + (":)" ?☺) + (":(" ?☹) + ("\\o/" ?🙌) + ("poo" ?💩) + ("FU" ?🖕) + ("LLAP" ?🖖) + ("ᄀᄀ" ?ᄁ) + ("ᄃᄃ" ?ᄄ) + ("ᄇᄇ" ?ᄈ) + ("ᄉᄉ" ?ᄊ) + ("ᄌᄌ" ?ᄍ) + ("ᄂᄀ" ?ᄓ) + ("ᄂᄂ" ?ᄔ) + ("ᄂᄃ" ?ᄕ) + ("ᄂᄇ" ?ᄖ) + ("ᄃᄀ" ?ᄗ) + ("ᄅᄂ" ?ᄘ) + ("ᄅᄅ" ?ᄙ) + ("ᄅᄒ" ?ᄚ) + ("ᄅᄋ" ?ᄛ) + ("ᄆᄇ" ?ᄜ) + ("ᄆᄋ" ?ᄝ) + ("ᄇᄀ" ?ᄞ) + ("ᄇᄂ" ?ᄟ) + ("ᄇᄃ" ?ᄠ) + ("ᄇᄉ" ?ᄡ) + ("ᄇᄌ" ?ᄧ) + ("ᄇᄎ" ?ᄨ) + ("ᄇᄐ" ?ᄩ) + ("ᄇᄑ" ?ᄪ) + ("ᄇᄋ" ?ᄫ) + ("ᄉᄀ" ?ᄭ) + ("ᄉᄂ" ?ᄮ) + ("ᄉᄃ" ?ᄯ) + ("ᄉᄅ" ?ᄰ) + ("ᄉᄆ" ?ᄱ) + ("ᄉᄇ" ?ᄲ) + ("ᄉᄋ" ?ᄵ) + ("ᄉᄌ" ?ᄶ) + ("ᄉᄎ" ?ᄷ) + ("ᄉᄏ" ?ᄸ) + ("ᄉᄐ" ?ᄹ) + ("ᄉᄑ" ?ᄺ) + ("ᄉᄒ" ?ᄻ) + ("ᄼᄼ" ?ᄽ) + ("ᄾᄾ" ?ᄿ) + ("ᄋᄀ" ?ᅁ) + ("ᄋᄃ" ?ᅂ) + ("ᄋᄆ" ?ᅃ) + ("ᄋᄇ" ?ᅄ) + ("ᄋᄉ" ?ᅅ) + ("ᄋᅀ" ?ᅆ) + ("ᄋᄋ" ?ᅇ) + ("ᄋᄌ" ?ᅈ) + ("ᄋᄎ" ?ᅉ) + ("ᄋᄐ" ?ᅊ) + ("ᄋᄑ" ?ᅋ) + ("ᄌᄋ" ?ᅍ) + ("ᅎᅎ" ?ᅏ) + ("ᅐᅐ" ?ᅑ) + ("ᄎᄏ" ?ᅒ) + ("ᄎᄒ" ?ᅓ) + ("ᄑᄇ" ?ᅖ) + ("ᄑᄋ" ?ᅗ) + ("ᄒᄒ" ?ᅘ) + ("ᅡᅵ" ?ᅢ) + ("ᅣᅵ" ?ᅤ) + ("ᅥᅵ" ?ᅦ) + ("ᅧᅵ" ?ᅨ) + ("ᅩᅡ" ?ᅪ) + ("ᅩᅵ" ?ᅬ) + ("ᅮᅥ" ?ᅯ) + ("ᅮᅵ" ?ᅱ) + ("ᅳᅵ" ?ᅴ) + ("ᅡᅩ" ?ᅶ) + ("ᅡᅮ" ?ᅷ) + ("ᅣᅩ" ?ᅸ) + ("ᅣᅭ" ?ᅹ) + ("ᅥᅩ" ?ᅺ) + ("ᅥᅮ" ?ᅻ) + ("ᅥᅳ" ?ᅼ) + ("ᅧᅩ" ?ᅽ) + ("ᅧᅮ" ?ᅾ) + ("ᅩᅥ" ?ᅿ) + ("ᅩᅦ" ?ᆀ) + ("ᅩᅨ" ?ᆁ) + ("ᅩᅩ" ?ᆂ) + ("ᅩᅮ" ?ᆃ) + ("ᅭᅣ" ?ᆄ) + ("ᅭᅤ" ?ᆅ) + ("ᅭᅧ" ?ᆆ) + ("ᅭᅩ" ?ᆇ) + ("ᅭᅵ" ?ᆈ) + ("ᅮᅡ" ?ᆉ) + ("ᅮᅢ" ?ᆊ) + ("ᅮᅨ" ?ᆌ) + ("ᅮᅮ" ?ᆍ) + ("ᅲᅡ" ?ᆎ) + ("ᅲᅥ" ?ᆏ) + ("ᅲᅦ" ?ᆐ) + ("ᅲᅧ" ?ᆑ) + ("ᅲᅨ" ?ᆒ) + ("ᅲᅮ" ?ᆓ) + ("ᅲᅵ" ?ᆔ) + ("ᅳᅮ" ?ᆕ) + ("ᅳᅳ" ?ᆖ) + ("ᅴᅮ" ?ᆗ) + ("ᅵᅡ" ?ᆘ) + ("ᅵᅣ" ?ᆙ) + ("ᅵᅩ" ?ᆚ) + ("ᅵᅮ" ?ᆛ) + ("ᅵᅳ" ?ᆜ) + ("ᅵᆞ" ?ᆝ) + ("ᆞᅥ" ?ᆟ) + ("ᆞᅮ" ?ᆠ) + ("ᆞᅵ" ?ᆡ) + ("ᆞᆞ" ?ᆢ) + ("ᆨᆨ" ?ᆩ) + ("ᆨᆺ" ?ᆪ) + ("ᆫᆽ" ?ᆬ) + ("ᆫᇂ" ?ᆭ) + ("ᆯᆨ" ?ᆰ) + ("ᆯᆷ" ?ᆱ) + ("ᆯᆸ" ?ᆲ) + ("ᆯᆺ" ?ᆳ) + ("ᆯᇀ" ?ᆴ) + ("ᆯᇁ" ?ᆵ) + ("ᆯᇂ" ?ᆶ) + ("ᆸᆺ" ?ᆹ) + ("ᆺᆺ" ?ᆻ) + ("ᆨᆯ" ?ᇃ) + ("ᆫᆨ" ?ᇅ) + ("ᆫᆮ" ?ᇆ) + ("ᆫᆺ" ?ᇇ) + ("ᆫᇫ" ?ᇈ) + ("ᆫᇀ" ?ᇉ) + ("ᆮᆨ" ?ᇊ) + ("ᆮᆯ" ?ᇋ) + ("ᆯᆫ" ?ᇍ) + ("ᆯᆮ" ?ᇎ) + ("ᆯᆯ" ?ᇐ) + ("ᆯᇫ" ?ᇗ) + ("ᆯᆿ" ?ᇘ) + ("ᆯᇹ" ?ᇙ) + ("ᆷᆨ" ?ᇚ) + ("ᆷᆯ" ?ᇛ) + ("ᆷᆸ" ?ᇜ) + ("ᆷᆺ" ?ᇝ) + ("ᆷᇫ" ?ᇟ) + ("ᆷᆾ" ?ᇠ) + ("ᆷᇂ" ?ᇡ) + ("ᆷᆼ" ?ᇢ) + ("ᆸᆯ" ?ᇣ) + ("ᆸᇁ" ?ᇤ) + ("ᆸᇂ" ?ᇥ) + ("ᆸᆼ" ?ᇦ) + ("ᆺᆨ" ?ᇧ) + ("ᆺᆮ" ?ᇨ) + ("ᆺᆯ" ?ᇩ) + ("ᆺᆸ" ?ᇪ) + ("ᆼᆨ" ?ᇬ) + ("ᆼᆼ" ?ᇮ) + ("ᆼᆿ" ?ᇯ) + ("ᇰᆺ" ?ᇱ) + ("ᇰᇫ" ?ᇲ) + ("ᇁᆸ" ?ᇳ) + ("ᇁᆼ" ?ᇴ) + ("ᇂᆫ" ?ᇵ) + ("ᇂᆯ" ?ᇶ) + ("ᇂᆷ" ?ᇷ) + ("ᇂᆸ" ?ᇸ) + ("ᄡᄀ" ?ᄢ) + ("ᄡᄃ" ?ᄣ) + ("ᄡᄇ" ?ᄤ) + ("ᄡᄉ" ?ᄥ) + ("ᄡᄌ" ?ᄦ) + ("ᄈᄋ" ?ᄬ) + ("ᄲᄀ" ?ᄳ) + ("ᄊᄉ" ?ᄴ) + ("ᅪᅵ" ?ᅫ) + ("ᅯᅵ" ?ᅰ) + ("ᅯᅳ" ?ᆋ) + ("ᆪᆨ" ?ᇄ) + ("ᆰᆺ" ?ᇌ) + ("ᇎᇂ" ?ᇏ) + ("ᆱᆨ" ?ᇑ) + ("ᆱᆺ" ?ᇒ) + ("ᆲᆺ" ?ᇓ) + ("ᆲᇂ" ?ᇔ) + ("ᆲᆼ" ?ᇕ) + ("ᆳᆺ" ?ᇖ) + ("ᇝᆺ" ?ᇞ) + ("ᇬᆨ" ?ᇭ) + ("ᄇᄭ" ?ᄢ) + ("ᄇᄯ" ?ᄣ) + ("ᄇᄲ" ?ᄤ) + ("ᄇᄊ" ?ᄥ) + ("ᄇᄶ" ?ᄦ) + ("ᄇᄫ" ?ᄬ) + ("ᄉᄞ" ?ᄳ) + ("ᄉᄊ" ?ᄴ) + ("ᅩᅢ" ?ᅫ) + ("ᅮᅦ" ?ᅰ) + ("ᅮᅼ" ?ᆋ) + ("ᆨᇧ" ?ᇄ) + ("ᆯᆪ" ?ᇌ) + ("ᆯᇚ" ?ᇑ) + ("ᆯᇝ" ?ᇒ) + ("ᆯᆹ" ?ᇓ) + ("ᆯᇥ" ?ᇔ) + ("ᆯᇦ" ?ᇕ) + ("ᆯᆻ" ?ᇖ) + ("ᆷᆻ" ?ᇞ) + ("ᆼᆩ" ?ᇭ) + (",-" ?¬) + ("-," ?¬) + ("^_a" ?ª) + ("^_a" ?ª) + ("^2" ?²) + ("2^" ?²) + ("^3" ?³) + ("3^" ?³) + ("mu" ?µ) + ("/u" ?µ) + ("u/" ?µ) + ("^1" ?¹) + ("1^" ?¹) + ("^_o" ?º) + ("^_o" ?º) + ("14" ?¼) + ("12" ?½) + ("34" ?¾) + ("`A" ?À) + ("A`" ?À) + ("´A" ?Á) + ("A´" ?Á) + ("'A" ?Á) + ("A'" ?Á) + ("^A" ?Â) + ("A^" ?Â) + (">A" ?Â) + ("A>" ?Â) + ("~A" ?Ã) + ("A~" ?Ã) + ("\"A" ?Ä) + ("A\"" ?Ä) + ("¨A" ?Ä) + ("A¨" ?Ä) + ("oA" ?Å) + ("*A" ?Å) + ("A*" ?Å) + ("AA" ?Å) + (",C" ?Ç) + ("C," ?Ç) + ("¸C" ?Ç) + ("`E" ?È) + ("E`" ?È) + ("´E" ?É) + ("E´" ?É) + ("'E" ?É) + ("E'" ?É) + ("^E" ?Ê) + ("E^" ?Ê) + (">E" ?Ê) + ("E>" ?Ê) + ("\"E" ?Ë) + ("E\"" ?Ë) + ("¨E" ?Ë) + ("E¨" ?Ë) + ("`I" ?Ì) + ("I`" ?Ì) + ("´I" ?Í) + ("I´" ?Í) + ("'I" ?Í) + ("I'" ?Í) + ("^I" ?Î) + ("I^" ?Î) + (">I" ?Î) + ("I>" ?Î) + ("\"I" ?Ï) + ("I\"" ?Ï) + ("¨I" ?Ï) + ("I¨" ?Ï) + ("'J" ["J́"]) + ("J'" ["J́"]) + ("´J" ["J́"]) + ("J´" ["J́"]) + ("DH" ?Ð) + ("~N" ?Ñ) + ("N~" ?Ñ) + ("`O" ?Ò) + ("O`" ?Ò) + ("´O" ?Ó) + ("O´" ?Ó) + ("'O" ?Ó) + ("O'" ?Ó) + ("^O" ?Ô) + ("O^" ?Ô) + (">O" ?Ô) + ("O>" ?Ô) + ("~O" ?Õ) + ("O~" ?Õ) + ("\"O" ?Ö) + ("O\"" ?Ö) + ("¨O" ?Ö) + ("O¨" ?Ö) + ("xx" ?×) + ("/O" ?Ø) + ("O/" ?Ø) + ("`U" ?Ù) + ("U`" ?Ù) + ("´U" ?Ú) + ("U´" ?Ú) + ("'U" ?Ú) + ("U'" ?Ú) + ("^U" ?Û) + ("U^" ?Û) + (">U" ?Û) + ("U>" ?Û) + ("\"U" ?Ü) + ("U\"" ?Ü) + ("¨U" ?Ü) + ("U¨" ?Ü) + ("´Y" ?Ý) + ("Y´" ?Ý) + ("'Y" ?Ý) + ("Y'" ?Ý) + ("TH" ?Þ) + ("`a" ?à) + ("a`" ?à) + ("´a" ?á) + ("a´" ?á) + ("'a" ?á) + ("a'" ?á) + ("^a" ?â) + ("a^" ?â) + (">a" ?â) + ("a>" ?â) + ("~a" ?ã) + ("a~" ?ã) + ("\"a" ?ä) + ("a\"" ?ä) + ("¨a" ?ä) + ("a¨" ?ä) + ("oa" ?å) + ("*a" ?å) + ("a*" ?å) + ("aa" ?å) + (",c" ?ç) + ("c," ?ç) + ("¸c" ?ç) + ("`e" ?è) + ("e`" ?è) + ("´e" ?é) + ("e´" ?é) + ("'e" ?é) + ("e'" ?é) + ("^e" ?ê) + ("e^" ?ê) + (">e" ?ê) + ("e>" ?ê) + ("\"e" ?ë) + ("e\"" ?ë) + ("¨e" ?ë) + ("e¨" ?ë) + ("`i" ?ì) + ("i`" ?ì) + ("´i" ?í) + ("i´" ?í) + ("'i" ?í) + ("i'" ?í) + ("^i" ?î) + ("i^" ?î) + (">i" ?î) + ("i>" ?î) + ("\"i" ?ï) + ("i\"" ?ï) + ("¨i" ?ï) + ("i¨" ?ï) + ("'j" ["j́"]) + ("j'" ["j́"]) + ("´j" ["j́"]) + ("j´" ["j́"]) + ("dh" ?ð) + ("~n" ?ñ) + ("n~" ?ñ) + ("`o" ?ò) + ("o`" ?ò) + ("´o" ?ó) + ("o´" ?ó) + ("'o" ?ó) + ("o'" ?ó) + ("^o" ?ô) + ("o^" ?ô) + (">o" ?ô) + ("o>" ?ô) + ("~o" ?õ) + ("o~" ?õ) + ("o¨" ?ö) + ("¨o" ?ö) + ("\"o" ?ö) + ("o\"" ?ö) + (":-" ?÷) + ("-:" ?÷) + ("/o" ?ø) + ("o/" ?ø) + ("`u" ?ù) + ("u`" ?ù) + ("´u" ?ú) + ("u´" ?ú) + ("'u" ?ú) + ("u'" ?ú) + ("^u" ?û) + ("u^" ?û) + (">u" ?û) + ("u>" ?û) + ("\"u" ?ü) + ("u\"" ?ü) + ("¨u" ?ü) + ("u¨" ?ü) + ("´y" ?ý) + ("y´" ?ý) + ("'y" ?ý) + ("y'" ?ý) + ("th" ?þ) + ("\"y" ?ÿ) + ("y\"" ?ÿ) + ("¨y" ?ÿ) + ("y¨" ?ÿ) + ("¯A" ?Ā) + ("_A" ?Ā) + ("A_" ?Ā) + ("-A" ?Ā) + ("A-" ?Ā) + ("¯a" ?ā) + ("_a" ?ā) + ("a_" ?ā) + ("-a" ?ā) + ("a-" ?ā) + ("UA" ?Ă) + ("uA" ?Ă) + ("bA" ?Ă) + ("A(" ?Ă) + ("Ua" ?ă) + ("ua" ?ă) + ("ba" ?ă) + ("a(" ?ă) + (";A" ?Ą) + ("A;" ?Ą) + (",A" ?Ą) + ("A," ?Ą) + (";a" ?ą) + ("a;" ?ą) + (",a" ?ą) + ("a," ?ą) + ("´C" ?Ć) + ("'C" ?Ć) + ("C'" ?Ć) + ("´c" ?ć) + ("'c" ?ć) + ("c'" ?ć) + ("^C" ?Ĉ) + ("^c" ?ĉ) + (".C" ?Ċ) + ("C." ?Ċ) + (".c" ?ċ) + ("c." ?ċ) + ("cC" ?Č) + ("" ?→) + ("=>" ?⇒) + ("∄" ?∄) + ("{}" ?∅) + ("∉" ?∉) + ("∌" ?∌) + ("∤" ?∤) + ("∦" ?∦) + ("≁" ?≁) + ("≄" ?≄) + ("≁" ?≇) + ("≉" ?≉) + ("/=" ?≠) + ("=/" ?≠) + ("≠" ?≠) + ("≢" ?≢) + ("<=" ?≤) + (">=" ?≥) + ("≭" ?≭) + ("≮" ?≮) + ("≮" ?≮) + ("≯" ?≯) + ("≯" ?≯) + ("≰" ?≰) + ("≱" ?≱) + ("≴" ?≴) + ("≵" ?≵) + ("≸" ?≸) + ("≹" ?≹) + ("⊀" ?⊀) + ("⊁" ?⊁) + ("⊄" ?⊄) + ("⊄" ?⊄) + ("⊅" ?⊅) + ("⊅" ?⊅) + ("⊈" ?⊈) + ("⊉" ?⊉) + ("⊬" ?⊬) + ("⊭" ?⊭) + ("⊮" ?⊮) + ("⊯" ?⊯) + ("⋠" ?⋠) + ("⋡" ?⋡) + ("⋢" ?⋢) + ("⋣" ?⋣) + ("⋪" ?⋪) + ("⋫" ?⋫) + ("⋬" ?⋬) + ("⋭" ?⋭) + ("di" ?⌀) + ("(1)" ?①) + ("(2)" ?②) + ("(3)" ?③) + ("(4)" ?④) + ("(5)" ?⑤) + ("(6)" ?⑥) + ("(7)" ?⑦) + ("(8)" ?⑧) + ("(9)" ?⑨) + ("(10)" ?⑩) + ("(11)" ?⑪) + ("(12)" ?⑫) + ("(13)" ?⑬) + ("(14)" ?⑭) + ("(15)" ?⑮) + ("(16)" ?⑯) + ("(17)" ?⑰) + ("(18)" ?⑱) + ("(19)" ?⑲) + ("(20)" ?⑳) + ("(A)" ?Ⓐ) + ("(B)" ?Ⓑ) + ("(C)" ?Ⓒ) + ("(D)" ?Ⓓ) + ("(E)" ?Ⓔ) + ("(F)" ?Ⓕ) + ("(G)" ?Ⓖ) + ("(H)" ?Ⓗ) + ("(I)" ?Ⓘ) + ("(J)" ?Ⓙ) + ("(K)" ?Ⓚ) + ("(L)" ?Ⓛ) + ("(M)" ?Ⓜ) + ("(N)" ?Ⓝ) + ("(O)" ?Ⓞ) + ("(P)" ?Ⓟ) + ("(Q)" ?Ⓠ) + ("(R)" ?Ⓡ) + ("(S)" ?Ⓢ) + ("(T)" ?Ⓣ) + ("(U)" ?Ⓤ) + ("(V)" ?Ⓥ) + ("(W)" ?Ⓦ) + ("(X)" ?Ⓧ) + ("(Y)" ?Ⓨ) + ("(Z)" ?Ⓩ) + ("(a)" ?ⓐ) + ("(b)" ?ⓑ) + ("(c)" ?ⓒ) + ("(d)" ?ⓓ) + ("(e)" ?ⓔ) + ("(f)" ?ⓕ) + ("(g)" ?ⓖ) + ("(h)" ?ⓗ) + ("(i)" ?ⓘ) + ("(j)" ?ⓙ) + ("(k)" ?ⓚ) + ("(l)" ?ⓛ) + ("(m)" ?ⓜ) + ("(n)" ?ⓝ) + ("(o)" ?ⓞ) + ("(p)" ?ⓟ) + ("(q)" ?ⓠ) + ("(r)" ?ⓡ) + ("(s)" ?ⓢ) + ("(t)" ?ⓣ) + ("(u)" ?ⓤ) + ("(v)" ?ⓥ) + ("(w)" ?ⓦ) + ("(x)" ?ⓧ) + ("(y)" ?ⓨ) + ("(z)" ?ⓩ) + ("(0)" ?⓪) + ("⫝̸" ?⫝̸) + ("^一" ?㆒) + ("^二" ?㆓) + ("^三" ?㆔) + ("^四" ?㆕) + ("^上" ?㆖) + ("^中" ?㆗) + ("^下" ?㆘) + ("^甲" ?㆙) + ("^乙" ?㆚) + ("^丙" ?㆛) + ("^丁" ?㆜) + ("^天" ?㆝) + ("^地" ?㆞) + ("^人" ?㆟) + ("(21)" ?㉑) + ("(22)" ?㉒) + ("(23)" ?㉓) + ("(24)" ?㉔) + ("(25)" ?㉕) + ("(26)" ?㉖) + ("(27)" ?㉗) + ("(28)" ?㉘) + ("(29)" ?㉙) + ("(30)" ?㉚) + ("(31)" ?㉛) + ("(32)" ?㉜) + ("(33)" ?㉝) + ("(34)" ?㉞) + ("(35)" ?㉟) + ("(ᄀ)" ?㉠) + ("(ᄂ)" ?㉡) + ("(ᄃ)" ?㉢) + ("(ᄅ)" ?㉣) + ("(ᄆ)" ?㉤) + ("(ᄇ)" ?㉥) + ("(ᄉ)" ?㉦) + ("(ᄋ)" ?㉧) + ("(ᄌ)" ?㉨) + ("(ᄎ)" ?㉩) + ("(ᄏ)" ?㉪) + ("(ᄐ)" ?㉫) + ("(ᄑ)" ?㉬) + ("(ᄒ)" ?㉭) + ("(가)" ?㉮) + ("(나)" ?㉯) + ("(다)" ?㉰) + ("(라)" ?㉱) + ("(마)" ?㉲) + ("(바)" ?㉳) + ("(사)" ?㉴) + ("(아)" ?㉵) + ("(자)" ?㉶) + ("(차)" ?㉷) + ("(카)" ?㉸) + ("(타)" ?㉹) + ("(파)" ?㉺) + ("(하)" ?㉻) + ("(一)" ?㊀) + ("(二)" ?㊁) + ("(三)" ?㊂) + ("(四)" ?㊃) + ("(五)" ?㊄) + ("(六)" ?㊅) + ("(七)" ?㊆) + ("(八)" ?㊇) + ("(九)" ?㊈) + ("(十)" ?㊉) + ("(月)" ?㊊) + ("(火)" ?㊋) + ("(水)" ?㊌) + ("(木)" ?㊍) + ("(金)" ?㊎) + ("(土)" ?㊏) + ("(日)" ?㊐) + ("(株)" ?㊑) + ("(有)" ?㊒) + ("(社)" ?㊓) + ("(名)" ?㊔) + ("(特)" ?㊕) + ("(財)" ?㊖) + ("(祝)" ?㊗) + ("(労)" ?㊘) + ("(秘)" ?㊙) + ("(男)" ?㊚) + ("(女)" ?㊛) + ("(適)" ?㊜) + ("(優)" ?㊝) + ("(印)" ?㊞) + ("(注)" ?㊟) + ("(項)" ?㊠) + ("(休)" ?㊡) + ("(写)" ?㊢) + ("(正)" ?㊣) + ("(上)" ?㊤) + ("(中)" ?㊥) + ("(下)" ?㊦) + ("(左)" ?㊧) + ("(右)" ?㊨) + ("(医)" ?㊩) + ("(宗)" ?㊪) + ("(学)" ?㊫) + ("(監)" ?㊬) + ("(企)" ?㊭) + ("(資)" ?㊮) + ("(協)" ?㊯) + ("(夜)" ?㊰) + ("(36)" ?㊱) + ("(37)" ?㊲) + ("(38)" ?㊳) + ("(39)" ?㊴) + ("(40)" ?㊵) + ("(41)" ?㊶) + ("(42)" ?㊷) + ("(43)" ?㊸) + ("(44)" ?㊹) + ("(45)" ?㊺) + ("(46)" ?㊻) + ("(47)" ?㊼) + ("(48)" ?㊽) + ("(49)" ?㊾) + ("(50)" ?㊿) + ("(ア)" ?㋐) + ("(イ)" ?㋑) + ("(ウ)" ?㋒) + ("(エ)" ?㋓) + ("(オ)" ?㋔) + ("(カ)" ?㋕) + ("(キ)" ?㋖) + ("(ク)" ?㋗) + ("(ケ)" ?㋘) + ("(コ)" ?㋙) + ("(サ)" ?㋚) + ("(シ)" ?㋛) + ("(ス)" ?㋜) + ("(セ)" ?㋝) + ("(ソ)" ?㋞) + ("(タ)" ?㋟) + ("(チ)" ?㋠) + ("(ツ)" ?㋡) + ("(テ)" ?㋢) + ("(ト)" ?㋣) + ("(ナ)" ?㋤) + ("(ニ)" ?㋥) + ("(ヌ)" ?㋦) + ("(ネ)" ?㋧) + ("(ノ)" ?㋨) + ("(ハ)" ?㋩) + ("(ヒ)" ?㋪) + ("(フ)" ?㋫) + ("(ヘ)" ?㋬) + ("(ホ)" ?㋭) + ("(マ)" ?㋮) + ("(ミ)" ?㋯) + ("(ム)" ?㋰) + ("(メ)" ?㋱) + ("(モ)" ?㋲) + ("(ヤ)" ?㋳) + ("(ユ)" ?㋴) + ("(ヨ)" ?㋵) + ("(ラ)" ?㋶) + ("(リ)" ?㋷) + ("(ル)" ?㋸) + ("(レ)" ?㋹) + ("(ロ)" ?㋺) + ("(ワ)" ?㋻) + ("(ヰ)" ?㋼) + ("(ヱ)" ?㋽) + ("(ヲ)" ?㋾) + ("ִי" ?יִ) + ("ַײ" ?ײַ) + ("ׁש" ?שׁ) + ("ׂש" ?שׂ) + ("ׁשּ" ?שּׁ) + ("ּׁש" ?שּׁ) + ("ׂשּ" ?שּׂ) + ("ּׂש" ?שּׂ) + ("ַא" ?אַ) + ("ָא" ?אָ) + ("ּא" ?אּ) + ("ּב" ?בּ) + ("ּג" ?גּ) + ("ּד" ?דּ) + ("ּה" ?הּ) + ("ּו" ?וּ) + ("ּז" ?זּ) + ("ּט" ?טּ) + ("ּי" ?יּ) + ("ּך" ?ךּ) + ("ּכ" ?כּ) + ("ּל" ?לּ) + ("ּמ" ?מּ) + ("ּנ" ?נּ) + ("ּס" ?סּ) + ("ּף" ?ףּ) + ("ּפ" ?פּ) + ("ּצ" ?צּ) + ("ּק" ?קּ) + ("ּר" ?רּ) + ("ּש" ?שּ) + ("ּת" ?תּ) + ("ֹו" ?וֹ) + ("ֿב" ?בֿ) + ("ֿכ" ?כֿ) + ("ֿפ" ?פֿ) + ("𝅗𝅥" ?𝅗𝅥) + ("𝅘𝅥" ?𝅘𝅥) + ("𝅘𝅥𝅮" ?𝅘𝅥𝅮) + ("𝅘𝅥𝅯" ?𝅘𝅥𝅯) + ("𝅘𝅥𝅰" ?𝅘𝅥𝅰) + ("𝅘𝅥𝅱" ?𝅘𝅥𝅱) + ("𝅘𝅥𝅲" ?𝅘𝅥𝅲) + ("𝆹𝅥" ?𝆹𝅥) + ("𝆺𝅥" ?𝆺𝅥) + ("𝆹𝅥𝅮" ?𝆹𝅥𝅮) + ("𝆺𝅥𝅮" ?𝆺𝅥𝅮) + ("𝆹𝅥𝅯" ?𝆹𝅥𝅯) + ("𝆺𝅥𝅯" ?𝆺𝅥𝅯) + (";S" ?Ș) + ("S;" ?Ș) + (";s" ?ș) + ("s;" ?ș) + (";T" ?Ț) + ("T;" ?Ț) + (";t" ?ț) + ("t;" ?ț) + ("``а" ["а̏"]) + ("`а" ["а̀"]) + ("´а" ["а́"]) + ("'а" ["а́"]) + ("¯а" ["а̄"]) + ("_а" ["а̄"]) + ("^а" ["а̂"]) + ("``А" ["А̏"]) + ("`А" ["А̀"]) + ("´А" ["А́"]) + ("'А" ["А́"]) + ("¯А" ["А̄"]) + ("_А" ["А̄"]) + ("^А" ["А̂"]) + ("``е" ["е̏"]) + ("´е" ["е́"]) + ("'е" ["е́"]) + ("¯е" ["е̄"]) + ("_е" ["е̄"]) + ("^е" ["е̂"]) + ("``Е" ["Е̏"]) + ("´Е" ["Е́"]) + ("'Е" ["Е́"]) + ("¯Е" ["Е̄"]) + ("_Е" ["Е̄"]) + ("^Е" ["Е̂"]) + ("``и" ["и̏"]) + ("´и" ["и́"]) + ("'и" ["и́"]) + ("^и" ["и̂"]) + ("``И" ["И̏"]) + ("´И" ["И́"]) + ("'И" ["И́"]) + ("^И" ["И̂"]) + ("``о" ["о̏"]) + ("`о" ["о̀"]) + ("´о" ["о́"]) + ("'о" ["о́"]) + ("¯о" ["о̄"]) + ("_о" ["о̄"]) + ("^о" ["о̂"]) + ("``О" ["О̏"]) + ("`О" ["О̀"]) + ("´О" ["О́"]) + ("'О" ["О́"]) + ("¯О" ["О̄"]) + ("_О" ["О̄"]) + ("^О" ["О̂"]) + ("``у" ["у̏"]) + ("`у" ["у̀"]) + ("´у" ["у́"]) + ("'у" ["у́"]) + ("^у" ["у̂"]) + ("``У" ["У̏"]) + ("`У" ["У̀"]) + ("´У" ["У́"]) + ("'У" ["У́"]) + ("^У" ["У̂"]) + ("``р" ["р̏"]) + ("`р" ["р̀"]) + ("´р" ["р́"]) + ("'р" ["р́"]) + ("¯р" ["р̄"]) + ("_р" ["р̄"]) + ("^р" ["р̂"]) + ("``Р" ["Р̏"]) + ("`Р" ["Р̀"]) + ("´Р" ["Р́"]) + ("'Р" ["Р́"]) + ("¯Р" ["Р̄"]) + ("_Р" ["Р̄"]) + ("^Р" ["Р̂"]) + ("v/" ?√) + ("/v" ?√) + ("88" ?∞) + ("=_" ?≡) + ("_≠" ?≢) + ("≠_" ?≢) + ("<_" ?≤) + ("_<" ?≤) + (">_" ?≥) + ("_>" ?≥) + ("_⊂" ?⊆) + ("⊂_" ?⊆) + ("_⊃" ?⊇) + ("⊃_" ?⊇) + ("○-" ?⊖) + ("-○" ?⊖) + ("○." ?⊙) + (".○" ?⊙) + ("<>" ?⋄) + ("><" ?⋄) + ("∧∨" ?⋄) + ("∨∧" ?⋄) + (":." ?∴) + (".:" ?∵) + ("⊥⊤" ?⌶) + ("⊤⊥" ?⌶) + ("[]" ?⌷) + ("][" ?⌷) + ("⎕=" ?⌸) + ("=⎕" ?⌸) + ("⎕÷" ?⌹) + ("÷⎕" ?⌹) + ("⎕⋄" ?⌺) + ("⋄⎕" ?⌺) + ("⎕∘" ?⌻) + ("∘⎕" ?⌻) + ("⎕○" ?⌼) + ("○⎕" ?⌼) + ("○|" ?⌽) + ("|○" ?⌽) + ("○∘" ?⌾) + ("∘○" ?⌾) + ("/-" ?⌿) + ("-/" ?⌿) + ("\\-" ?⍀) + ("-\\" ?⍀) + ("/⎕" ?⍁) + ("⎕/" ?⍁) + ("\\⎕" ?⍂) + ("⎕\\" ?⍂) + ("<⎕" ?⍃) + ("⎕<" ?⍃) + (">⎕" ?⍄) + ("⎕>" ?⍄) + ("←|" ?⍅) + ("|←" ?⍅) + ("→|" ?⍆) + ("|→" ?⍆) + ("←⎕" ?⍇) + ("⎕←" ?⍇) + ("→⎕" ?⍈) + ("⎕→" ?⍈) + ("○\\" ?⍉) + ("\\○" ?⍉) + ("_⊥" ?⍊) + ("⊥_" ?⍊) + ("∆|" ?⍋) + ("|∆" ?⍋) + ("∨⎕" ?⍌) + ("⎕∨" ?⍌) + ("∆⎕" ?⍍) + ("⎕∆" ?⍍) + ("∘⊥" ?⍎) + ("⊥∘" ?⍎) + ("↑-" ?⍏) + ("-↑" ?⍏) + ("↑⎕" ?⍐) + ("⎕↑" ?⍐) + ("¯⊤" ?⍑) + ("⊤¯" ?⍑) + ("∇|" ?⍒) + ("|∇" ?⍒) + ("∧⎕" ?⍓) + ("⎕∧" ?⍓) + ("∇⎕" ?⍔) + ("⎕∇" ?⍔) + ("∘⊤" ?⍕) + ("⊤∘" ?⍕) + ("↓-" ?⍖) + ("-↓" ?⍖) + ("↓⎕" ?⍗) + ("⎕↓" ?⍗) + ("_'" ?⍘) + ("∆_" ?⍙) + ("_∆" ?⍙) + ("⋄_" ?⍚) + ("_⋄" ?⍚) + ("∘_" ?⍛) + ("_∘" ?⍛) + ("○_" ?⍜) + ("_○" ?⍜) + ("∘∩" ?⍝) + ("∩∘" ?⍝) + ("⎕'" ?⍞) + ("'⎕" ?⍞) + ("○*" ?⍟) + ("*○" ?⍟) + (":⎕" ?⍠) + ("⎕:" ?⍠) + ("¨⊤" ?⍡) + ("⊤¨" ?⍡) + ("¨∇" ?⍢) + ("∇¨" ?⍢) + ("*¨" ?⍣) + ("¨*" ?⍣) + ("∘¨" ?⍤) + ("¨∘" ?⍤) + ("○¨" ?⍥) + ("¨○" ?⍥) + ("∪|" ?⍦) + ("|∪" ?⍦) + ("⊂|" ?⍧) + ("|⊂" ?⍧) + ("~¨" ?⍨) + ("¨>" ?⍩) + (">¨" ?⍩) + ("∇~" ?⍫) + ("~∇" ?⍫) + ("0~" ?⍬) + ("~0" ?⍬) + ("|~" ?⍭) + ("~|" ?⍭) + (";_" ?⍮) + ("≠⎕" ?⍯) + ("⎕≠" ?⍯) + ("?⎕" ?⍰) + ("⎕?" ?⍰) + ("∨~" ?⍱) + ("~∨" ?⍱) + ("∧~" ?⍲) + ("~∧" ?⍲) + ("⍺_" ?⍶) + ("_⍺" ?⍶) + ("∊_" ?⍷) + ("_∊" ?⍷) + ("⍳_" ?⍸) + ("_⍳" ?⍸) + ("⍵_" ?⍹) + ("_⍵" ?⍹) + ) + +(provide 'compose) +;;; compose.el ends here commit 43d5b79a6931b169557b5d78f9a7f9be0ab72e77 Author: Juri Linkov Date: Sun Nov 1 23:20:53 2020 +0200 Show nobreak-space face for more blank characters in describe-char. * lisp/descr-text.el (describe-char): Handle more non-ASCII whitespace characters added in f018cffca0098ad1b82c51730a6d6cf146e3c488 (bug#44236) diff --git a/lisp/descr-text.el b/lisp/descr-text.el index ec9a968013..075cb21c21 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -687,7 +687,8 @@ The character information includes: (save-excursion (goto-char pos) (looking-at-p "[ \t]+$"))) 'trailing-whitespace) - ((and nobreak-char-display char (eq char '#xa0)) + ((and nobreak-char-display char + (eq (get-char-code-property char 'general-category) 'Zs)) 'nobreak-space) ((and nobreak-char-display char (memq char '(#xad #x2010 #x2011))) commit 4e6104ea0b7f1eb1725e81800e584b337e2da447 Author: Eli Zaretskii Date: Sun Nov 1 21:49:35 2020 +0200 ; * src/xdisp.c (display_string): Fix a typo in a comment. diff --git a/src/xdisp.c b/src/xdisp.c index 6c14a9a7b9..60864c2671 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -26844,7 +26844,7 @@ display_string (const char *string, Lisp_Object lisp_string, Lisp_Object face_st else max_x = min (max_x, it->last_visible_x); - /* Skip over display elements that are not visible. because IT->w is + /* Skip over display elements that are not visible because IT->w is hscrolled. */ if (it->current_x < it->first_visible_x) move_it_in_display_line_to (it, 100000, it->first_visible_x, commit 7162228815e4789c9186ec7e57a5ed0e1442a799 Author: Stefan Kangas Date: Sun Nov 1 19:29:47 2020 +0100 Improve indexing of check-declare * doc/lispref/functions.texi (Declaring Functions): Improve indexing. diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 2898cb4d2b..8458bebbb5 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -2349,6 +2349,8 @@ argument @var{fileonly} non-@code{nil} means check only that @var{file} exists, not that it actually defines @var{function}. @end defmac +@findex check-declare-file +@findex check-declare-directory To verify that these functions really are declared where @code{declare-function} says they are, use @code{check-declare-file} to check all @code{declare-function} calls in one source file, or use commit d218b28ab5060b2cf6f727727c1d018ad800accb Author: Stefan Kangas Date: Sun Nov 1 19:08:21 2020 +0100 ; * lisp/autoinsert.el (auto-insert-alist): Fix texinfo URL. The old texinfo domain seems to no longer be controlled by the GNU project, starting at least as early as 2012. See also: https://web.archive.org/web/20120410044746/http://www.texinfo.org/ diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el index 25961d4108..6d3802816d 100644 --- a/lisp/autoinsert.el +++ b/lisp/autoinsert.el @@ -264,7 +264,7 @@ Foundation Web site at @url{https://www.gnu.org/licenses/fdl.html}. @end quotation The document was typeset with -@uref{http://www.texinfo.org/, GNU Texinfo}. +@uref{https://www.gnu.org/software/texinfo/, GNU Texinfo}. @end copying commit 7baf8cae0f54502fc2b21c01e133308b746cd7a0 Author: Stefan Kangas Date: Sun Nov 1 18:52:23 2020 +0100 Don't auto-insert "@c file ends here" in .texi files * lisp/autoinsert.el (auto-insert-alist): Don't insert "@c file ends here" at the end of new .texi files. diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el index 4af3d631a2..9798668325 100644 --- a/lisp/autoinsert.el +++ b/lisp/autoinsert.el @@ -315,8 +315,7 @@ The document was typeset with @printindex cp @bye - -@c " (file-name-nondirectory (buffer-file-name)) " ends here\n")) +")) "A list specifying text to insert by default into a new file. Elements look like (CONDITION . ACTION) or ((CONDITION . DESCRIPTION) . ACTION). CONDITION may be a regexp that must match the new file's name, or it may be commit 8ad9932f1163506370ee05a0d7a2f2d5d57c0fd1 Author: Stefan Kangas Date: Sun Nov 1 16:31:12 2020 +0100 Don't bind standard-output in substitute-command-keys This fixes a regression with regards to the old C version of substitute-command-keys. * lisp/help.el (substitute-command-keys): Don't bind standard-output. See Bug#39149. * test/lisp/help-tests.el (help-tests--was-in-buffer): New variable. (help-substitute-command-keys/menu-filter-in-correct-buffer): New test. diff --git a/lisp/help.el b/lisp/help.el index 795f7e74d8..df055d602f 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1013,8 +1013,7 @@ Otherwise, return a new string (without any text properties)." (insert string) (goto-char (point-min)) (while (< (point) (point-max)) - (let ((standard-output (current-buffer)) - (orig-point (point)) + (let ((orig-point (point)) end-point active-maps close generate-summary) (cond diff --git a/test/lisp/help-tests.el b/test/lisp/help-tests.el index 079b1114a8..b6dffb2a40 100644 --- a/test/lisp/help-tests.el +++ b/test/lisp/help-tests.el @@ -361,6 +361,26 @@ C-b undefined "))))) +(defvar help-tests--was-in-buffer nil) + +(ert-deftest help-substitute-command-keys/menu-filter-in-correct-buffer () + "Evaluate menu-filter in the original buffer. See Bug#39149." + (unwind-protect + (progn + (define-key global-map (kbd "C-c C-l r") + `(menu-item "2" identity + :filter ,(lambda (cmd) + (setq help-tests--was-in-buffer + (current-buffer)) + cmd))) + (with-temp-buffer + (substitute-command-keys "\\[identity]") + (should (eq help-tests--was-in-buffer + (current-buffer))))) + (setq help-tests--was-in-buffer nil) + (define-key global-map (kbd "C-c C-l r") nil) + (define-key global-map (kbd "C-c C-l") nil))) + (provide 'help-tests) ;;; help-tests.el ends here commit 8761c155e43c08428054677c75781e312a728667 Author: Glenn Morris Date: Sun Nov 1 09:39:44 2020 -0800 * lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring): Doc typo. diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index a5a971a698..77f10e61c6 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -88,7 +88,7 @@ If called interactively, toggle `%s'. 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 if ARG is `toggle'. +If called from Lisp, toggle the mode if ARG is `toggle'. Enable the mode if ARG is nil, omitted, or is a positive number. All other values will disable the mode. commit d85e0df7adaa21e20d44e7bbca62fa91272506bd Author: Mattias Engdegård Date: Sun Nov 1 15:57:12 2020 +0100 Add missing side-effect-free and error-free properties Any function that is pure is also side-effect-free and some are also error-free. Right now these have to be declared separately. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Add bool-vector-count-consecutive, bool-vector-count-population, bool-vector-subsetp, copysign, isnan, lax-plist-get, ldexp, memql, regexp-opt and string-to-syntax. (side-effect-and-error-free-fns): Add type-of. * lisp/subr.el (kbd, string-replace): Declare side-effect-free. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 56b957384f..530a086b14 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1147,12 +1147,14 @@ (let ((side-effect-free-fns '(% * + - / /= 1+ 1- < <= = > >= abs acos append aref ash asin atan assq + bool-vector-count-consecutive bool-vector-count-population + bool-vector-subsetp boundp buffer-file-name buffer-local-variables buffer-modified-p buffer-substring byte-code-function-p capitalize car-less-than-car car cdr ceiling char-after char-before char-equal char-to-string char-width compare-strings compare-window-configurations concat coordinates-in-window-p - copy-alist copy-sequence copy-marker cos count-lines + copy-alist copy-sequence copy-marker copysign cos count-lines current-time-string current-time-zone decode-char decode-time default-boundp default-value documentation downcase @@ -1165,22 +1167,22 @@ frame-visible-p fround ftruncate get gethash get-buffer get-buffer-window getenv get-file-buffer hash-table-count - int-to-string intern-soft + int-to-string intern-soft isnan keymap-parent - length line-beginning-position line-end-position + lax-plist-get ldexp length line-beginning-position line-end-position local-variable-if-set-p local-variable-p locale-info log log10 logand logb logcount logior lognot logxor lsh make-byte-code make-list make-string make-symbol marker-buffer max - member memq min minibuffer-selected-window minibuffer-window + member memq memql min minibuffer-selected-window minibuffer-window mod multibyte-char-to-unibyte next-window nth nthcdr number-to-string parse-colon-path plist-get plist-member prefix-numeric-value previous-window prin1-to-string propertize degrees-to-radians - radians-to-degrees rassq rassoc read-from-string regexp-quote - region-beginning region-end reverse round + radians-to-degrees rassq rassoc read-from-string regexp-opt + regexp-quote region-beginning region-end reverse round sin sqrt string string< string= string-equal string-lessp string-search string-to-char - string-to-number substring + string-to-number string-to-syntax substring sxhash sxhash-equal sxhash-eq sxhash-eql symbol-function symbol-name symbol-plist symbol-value string-make-unibyte string-make-multibyte string-as-multibyte string-as-unibyte @@ -1230,7 +1232,7 @@ standard-case-table standard-syntax-table stringp subrp symbolp syntax-table syntax-table-p this-command-keys this-command-keys-vector this-single-command-keys - this-single-command-raw-keys + this-single-command-raw-keys type-of user-real-login-name user-real-uid user-uid vector vectorp visible-frame-list wholenump window-configuration-p window-live-p diff --git a/lisp/subr.el b/lisp/subr.el index b7a746f2db..286851dfc8 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -896,7 +896,7 @@ This is the same format used for saving keyboard macros (see For an approximate inverse of this, see `key-description'." ;; Don't use a defalias, since the `pure' property is true only for ;; the calling convention of `kbd'. - (declare (pure t)) + (declare (pure t) (side-effect-free t)) ;; A pure function is expected to preserve the match data. (save-match-data (read-kbd-macro keys))) @@ -4446,7 +4446,7 @@ Unless optional argument INPLACE is non-nil, return a new string." (defun string-replace (fromstring tostring instring) "Replace FROMSTRING with TOSTRING in INSTRING each time it occurs." - (declare (pure t)) + (declare (pure t) (side-effect-free t)) (when (equal fromstring "") (signal 'wrong-length-argument fromstring)) (let ((start 0) commit d8601684934e8c4b72002c7d84036ca48048187f Author: Mattias Engdegård Date: Sun Nov 1 15:01:31 2020 +0100 * lisp/emacs-lisp/byte-opt.el (pure-fns): Fix typos. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 1dc83dd395..56b957384f 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1262,7 +1262,7 @@ '(concat regexp-opt regexp-quote string-to-char string-to-syntax symbol-name eq eql - = /= < <= => > min max + = /= < <= >= > min max + - * / % mod abs ash 1+ 1- sqrt logand logior lognot logxor logcount copysign isnan ldexp float logb @@ -1270,7 +1270,7 @@ ffloor fceiling fround ftruncate string= string-equal string< string-lessp string-search - consp atom listp nlistp propert-list-p + consp atom listp nlistp proper-list-p sequencep arrayp vectorp stringp bool-vector-p hash-table-p null not numberp integerp floatp natnump characterp commit ce1856ec09dd312667d8f7cf9ffc908b473d27b8 Author: Stefan Kangas Date: Sun Nov 1 15:27:17 2020 +0100 Insert describe-map-tree header into original buffer * lisp/help.el (describe-map-tree): Insert header into the original buffer, not in standard-output. * test/src/keymap-tests.el (describe-buffer-bindings/header-in-current-buffer) (describe-buffer-bindings/returns-nil): New tests. Ref: https://debbugs.gnu.org/39149#31 diff --git a/lisp/help.el b/lisp/help.el index 6ae2664cf4..795f7e74d8 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1169,14 +1169,14 @@ Any inserted text ends in two newlines (used by (print-title (or maps always-title))) ;; Print title. (when print-title - (princ (concat (if title - (concat title - (if prefix - (concat " Starting With " - (key-description prefix))) - ":\n")) - "key binding\n" - "--- -------\n"))) + (insert (concat (if title + (concat title + (if prefix + (concat " Starting With " + (key-description prefix))) + ":\n")) + "key binding\n" + "--- -------\n"))) ;; Describe key bindings. (setq help--keymaps-seen nil) (while (consp maps) @@ -1202,7 +1202,7 @@ Any inserted text ends in two newlines (used by sub-shadows no-menu mention-shadow))) (setq maps (cdr maps))) (when print-title - (princ "\n")))) + (insert "\n")))) (defun help--shadow-lookup (keymap key accept-default remap) "Like `lookup-key', but with command remapping. diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el index 75f8c0f092..1a30a7d3a0 100644 --- a/test/src/keymap-tests.el +++ b/test/src/keymap-tests.el @@ -23,6 +23,19 @@ (require 'ert) +(ert-deftest describe-buffer-bindings/header-in-current-buffer () + "Header should be inserted into the current buffer. +https://debbugs.gnu.org/39149#31" + (with-temp-buffer + (describe-buffer-bindings (current-buffer)) + (should (string-match (rx bol "key" (+ space) "binding" eol) + (buffer-string))))) + +(ert-deftest describe-buffer-bindings/returns-nil () + "Should return nil." + (with-temp-buffer + (should (eq (describe-buffer-bindings (current-buffer)) nil)))) + (ert-deftest keymap-store_in_keymap-XFASTINT-on-non-characters () "Check for bug fixed in \"Fix assertion violation in define-key\", commit 86c19714b097aa477d339ed99ffb5136c755a046." commit 5ce37da355a27ed281230e23d9b501d75e222ac7 Author: Basil L. Contovounesios Date: Sun Nov 1 14:46:22 2020 +0000 ; * doc/emacs/custom.texi (Keymaps): Fix typo. diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index ee4ab6c3c6..fb60caa773 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1582,7 +1582,7 @@ starts with @kbd{@key{ESC} [}.) If Emacs understands your terminal type properly, it automatically handles such sequences as single input events. - Key sequences that consists of @kbd{C-c} followed by a letter (upper + Key sequences that consist of @kbd{C-c} followed by a letter (upper or lower case; @acronym{ASCII} or non-@acronym{ASCII}) are reserved for users. Emacs itself will never bind those key sequences, and Emacs extensions should avoid binding them. In other words, users can commit ed70be7a187f211d366312e1c6b04b1dbcbffd06 Author: Glenn Morris Date: Sun Nov 1 06:28:38 2020 -0800 ; Auto-commit of loaddefs files. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index d611293546..f5ae3adf2e 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -511,10 +511,13 @@ Return t if `allout-mode' is active in current buffer." nil t) (autoload 'allout-mode "allout" "\ Toggle Allout outline mode. -If called interactively, enable Allout mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Allout 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -829,10 +832,13 @@ See `allout-widgets-mode' for allout widgets mode features.") (autoload 'allout-widgets-mode "allout-widgets" "\ Toggle Allout Widgets mode. -If called interactively, enable Allout-Widgets mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Allout-Widgets 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -1246,15 +1252,17 @@ Entering array mode calls the function `array-mode-hook'. ;;;### (autoloads nil "artist" "textmodes/artist.el" (0 0 0 0)) ;;; Generated autoloads from textmodes/artist.el -(push (purecopy '(artist 1 2 6)) package--builtin-versions) (autoload 'artist-mode "artist" "\ Toggle Artist mode. -If called interactively, enable Artist mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Artist 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -1528,7 +1536,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 https://www.passwordstore.org/#organization): +the following (see http://www.passwordstore.org/#organization): secret key1: value1 @@ -1586,10 +1594,13 @@ or call the function `autoarg-kp-mode'.") (autoload 'autoarg-kp-mode "autoarg" "\ Toggle Autoarg-KP mode, a global minor mode. -If called interactively, enable Autoarg-Kp mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Autoarg-Kp 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -1645,10 +1656,13 @@ or call the function `auto-insert-mode'.") (autoload 'auto-insert-mode "autoinsert" "\ Toggle Auto-insert mode, a global minor mode. -If called interactively, enable Auto-Insert mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Auto-Insert 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -1696,14 +1710,29 @@ The function does NOT recursively descend into subdirectories of the directory or directories specified. In an interactive call, prompt for a default output file for the -autoload definitions, and temporarily bind the variable -`generated-autoload-file' to this value. When called from Lisp, -use the existing value of `generated-autoload-file'. If any Lisp -file binds `generated-autoload-file' as a file-local variable, -write its autoloads into the specified file instead. +autoload definitions. When called from Lisp, use the existing +value of `generated-autoload-file'. If any Lisp file binds +`generated-autoload-file' as a file-local variable, write its +autoloads into the specified file instead. \(fn &rest DIRS)" t nil) +(make-obsolete 'update-directory-autoloads 'make-directory-autoloads '"28.1") + +(autoload 'make-directory-autoloads "autoload" "\ +Update autoload definitions for Lisp files in the directories DIRS. +DIR can be either a single directory or a list of +directories. (The latter usage is discouraged.) + +The autoloads will be written to OUTPUT-FILE. If any Lisp file +binds `generated-autoload-file' as a file-local variable, write +its autoloads into the specified file instead. + +The function does NOT recursively descend into subdirectories of the +directory or directories specified. + +\(fn DIR OUTPUT-FILE)" t nil) + (autoload 'batch-update-autoloads "autoload" "\ Update loaddefs.el autoloads in batch mode. Calls `update-directory-autoloads' on the command line arguments. @@ -1720,10 +1749,13 @@ should be non-nil)." nil nil) (autoload 'auto-revert-mode "autorevert" "\ Toggle reverting buffer when the file changes (Auto-Revert Mode). -If called interactively, enable Auto-Revert mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Auto-Revert 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -1750,10 +1782,13 @@ This function is designed to be added to hooks, for example: (autoload 'auto-revert-tail-mode "autorevert" "\ Toggle reverting tail of buffer when the file grows. -If called interactively, enable Auto-Revert-Tail mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Auto-Revert-Tail 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -1794,10 +1829,13 @@ or call the function `global-auto-revert-mode'.") (autoload 'global-auto-revert-mode "autorevert" "\ Toggle Global Auto-Revert Mode. -If called interactively, enable Global Auto-Revert mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Global Auto-Revert 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -1928,10 +1966,13 @@ or call the function `display-battery-mode'.") (autoload 'display-battery-mode "battery" "\ Toggle battery status display in mode line (Display Battery mode). -If called interactively, enable Display-Battery mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Display-Battery 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -2907,10 +2948,13 @@ columns on its right towards the left. (autoload 'bug-reference-mode "bug-reference" "\ Toggle hyperlinking bug references in the buffer (Bug Reference mode). -If called interactively, enable Bug-Reference mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Bug-Reference 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -2920,10 +2964,13 @@ disabled. (autoload 'bug-reference-prog-mode "bug-reference" "\ Like `bug-reference-mode', but only buttonize in comments and strings. -If called interactively, enable Bug-Reference-Prog mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Bug-Reference-Prog 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -2998,11 +3045,14 @@ that already has a `.elc' file. Compile a file of Lisp code named FILENAME into a file of byte code. The output file's name is generated by passing FILENAME to the function `byte-compile-dest-file' (which see). -With prefix arg (noninteractively: 2nd arg), LOAD the file after compiling. The value is non-nil if there were no errors, nil if errors. +See also `emacs-lisp-byte-compile-and-load'. + \(fn FILENAME &optional LOAD)" t nil) +(set-advertised-calling-convention 'byte-compile-file '(filename) '"28.1") + (autoload 'compile-defun "bytecomp" "\ Compile and evaluate the current top-level form. Print the result in the echo area. @@ -3293,14 +3343,6 @@ See Info node `(calc)Defining Functions'. (register-definition-prefixes "calc" '("calc" "defcalcmodevar" "inexact-result" "math-" "var-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "calc-aent" "calc/calc-aent.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from calc/calc-aent.el - -(register-definition-prefixes "calc-aent" '("calc" "math-")) - ;;;*** ;;;### (autoloads nil "calc-alg" "calc/calc-alg.el" (0 0 0 0)) @@ -3336,14 +3378,6 @@ See Info node `(calc)Defining Functions'. (register-definition-prefixes "calc-cplx" '("calc" "math-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "calc-embed" "calc/calc-embed.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from calc/calc-embed.el - -(register-definition-prefixes "calc-embed" '("calc-")) - ;;;*** ;;;### (autoloads nil "calc-ext" "calc/calc-ext.el" (0 0 0 0)) @@ -3442,14 +3476,6 @@ See Info node `(calc)Defining Functions'. (register-definition-prefixes "calc-menu" '("calc-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "calc-misc" "calc/calc-misc.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from calc/calc-misc.el - -(register-definition-prefixes "calc-misc" '("math-iipow")) - ;;;*** ;;;### (autoloads nil "calc-mode" "calc/calc-mode.el" (0 0 0 0)) @@ -3560,14 +3586,6 @@ See Info node `(calc)Defining Functions'. (register-definition-prefixes "calc-vec" '("calc" "math-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "calc-yank" "calc/calc-yank.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from calc/calc-yank.el - -(register-definition-prefixes "calc-yank" '("calc-" "math-number-regexp")) - ;;;*** ;;;### (autoloads nil "calcalg2" "calc/calcalg2.el" (0 0 0 0)) @@ -4499,7 +4517,6 @@ from which to start. ;;;### (autoloads nil "chart" "emacs-lisp/chart.el" (0 0 0 0)) ;;; Generated autoloads from emacs-lisp/chart.el -(push (purecopy '(chart 0 2)) package--builtin-versions) (register-definition-prefixes "chart" '("chart")) @@ -4692,10 +4709,13 @@ Prefix argument is the same as for `checkdoc-defun'." t nil) (autoload 'checkdoc-minor-mode "checkdoc" "\ Toggle automatic docstring checking (Checkdoc minor mode). -If called interactively, enable Checkdoc minor mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Checkdoc minor 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -4786,14 +4806,6 @@ and runs the normal hook `command-history-hook'." t nil) (register-definition-prefixes "chistory" '("command-history-" "default-command-history-filter" "list-command-history-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "cl-extra" "emacs-lisp/cl-extra.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from emacs-lisp/cl-extra.el - -(register-definition-prefixes "cl-extra" '("cl-")) - ;;;*** ;;;### (autoloads nil "cl-font-lock" "progmodes/cl-font-lock.el" @@ -4813,10 +4825,13 @@ or call the function `cl-font-lock-built-in-mode'.") (autoload 'cl-font-lock-built-in-mode "cl-font-lock" "\ Highlight built-in functions, variables, and types in `lisp-mode'. -If called interactively, enable Cl-Font-Lock-Built-In mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Cl-Font-Lock-Built-In 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -5028,10 +5043,13 @@ This can be needed when using code byte-compiled using the old macro-expansion of `cl-defstruct' that used vectors objects instead of record objects. -If called interactively, enable Cl-Old-Struct-Compat mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Cl-Old-Struct-Compat 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -5040,14 +5058,6 @@ disabled. (register-definition-prefixes "cl-lib" '("cl-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "cl-macs" "emacs-lisp/cl-macs.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from emacs-lisp/cl-macs.el - -(register-definition-prefixes "cl-macs" '("cl-")) - ;;;*** ;;;### (autoloads nil "cl-print" "emacs-lisp/cl-print.el" (0 0 0 @@ -5104,14 +5114,6 @@ limit. (register-definition-prefixes "cl-print" '("cl-print-" "help-byte-code")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "cl-seq" "emacs-lisp/cl-seq.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from emacs-lisp/cl-seq.el - -(register-definition-prefixes "cl-seq" '("cl--")) - ;;;*** ;;;### (autoloads nil "cmacexp" "progmodes/cmacexp.el" (0 0 0 0)) @@ -5480,10 +5482,13 @@ Runs `compilation-mode-hook' with `run-mode-hooks' (which see). (autoload 'compilation-shell-minor-mode "compile" "\ Toggle Compilation Shell minor mode. -If called interactively, enable Compilation-Shell minor mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Compilation-Shell minor 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -5498,10 +5503,13 @@ See `compilation-mode'. (autoload 'compilation-minor-mode "compile" "\ Toggle Compilation minor mode. -If called interactively, enable Compilation minor mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Compilation minor 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -5538,10 +5546,13 @@ or call the function `dynamic-completion-mode'.") (autoload 'dynamic-completion-mode "completion" "\ Toggle dynamic word-completion on or off. -If called interactively, enable Dynamic-Completion mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Dynamic-Completion 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -6102,10 +6113,13 @@ or call the function `cua-mode'.") (autoload 'cua-mode "cua-base" "\ Toggle Common User Access style editing (CUA mode). -If called interactively, enable Cua mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Cua 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -6153,10 +6167,13 @@ Enable CUA selection mode without the C-z/C-x/C-c/C-v bindings. Toggle the region as rectangular. Activates the region if needed. Only lasts until the region is deactivated. -If called interactively, enable Cua-Rectangle-Mark mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Cua-Rectangle-Mark 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -6179,10 +6196,13 @@ By convention, this is a list of symbols where each symbol stands for the (autoload 'cursor-intangible-mode "cursor-sensor" "\ Keep cursor outside of any `cursor-intangible' text property. -If called interactively, enable Cursor-Intangible mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Cursor-Intangible 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -6197,10 +6217,13 @@ where WINDOW is the affected window, OLDPOS is the last known position of the cursor and DIR can be `entered' or `left' depending on whether the cursor is entering the area covered by the text-property property or leaving it. -If called interactively, enable Cursor-Sensor mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Cursor-Sensor 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -6523,7 +6546,7 @@ The format is suitable for use with `easy-menu-define'. \(fn SYMBOL &optional NAME)" nil nil) -(register-definition-prefixes "cus-edit" '("Custom-" "custom" "widget-")) +(register-definition-prefixes "cus-edit" '("Custom-" "cus" "widget-")) ;;;*** @@ -6580,10 +6603,13 @@ Mode used for cvs status output. (autoload 'cwarn-mode "cwarn" "\ Minor mode that highlights suspicious C and C++ constructions. -If called interactively, enable Cwarn mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Cwarn 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -6618,7 +6644,9 @@ ARG is omitted or nil. Cwarn mode is enabled in all buffers where `turn-on-cwarn-mode-if-enabled' would do it. -See `cwarn-mode' for more information on Cwarn mode. + +See `cwarn-mode' for more information on +Cwarn mode. \(fn &optional ARG)" t nil) @@ -6824,8 +6852,7 @@ Variables controlling indentation style and extra features: dcl-imenu-label-call Change the text that is used as sub-listing labels in imenu. -Loading this package calls the value of the variable -`dcl-mode-load-hook' with no args, if that value is non-nil. +To run code after DCL mode has loaded, use `with-eval-after-load'. Turning on DCL mode calls the value of the variable `dcl-mode-hook' with no args, if that value is non-nil. @@ -6971,7 +6998,6 @@ The most useful commands are: ;;;### (autoloads nil "delim-col" "delim-col.el" (0 0 0 0)) ;;; Generated autoloads from delim-col.el -(push (purecopy '(delim-col 2 1)) package--builtin-versions) (autoload 'delimit-columns-customize "delim-col" "\ Customize the `columns' group." t nil) @@ -7032,10 +7058,13 @@ or call the function `delete-selection-mode'.") (autoload 'delete-selection-mode "delsel" "\ Toggle Delete Selection mode. -If called interactively, enable Delete-Selection mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Delete-Selection 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -7204,10 +7233,13 @@ or call the function `desktop-save-mode'.") (autoload 'desktop-save-mode "desktop" "\ Toggle desktop saving (Desktop Save mode). -If called interactively, enable Desktop-Save mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Desktop-Save 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -7600,10 +7632,13 @@ a diff with \\[diff-reverse-direction]. (autoload 'diff-minor-mode "diff-mode" "\ Toggle Diff minor mode. -If called interactively, enable Diff minor mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Diff minor 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -7781,22 +7816,6 @@ Like \\[dired-jump] (`dired-jump') but in other window. (register-definition-prefixes "dired" '("dired-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "dired-aux" "dired-aux.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from dired-aux.el - -(register-definition-prefixes "dired-aux" '("dired-" "minibuffer-default-add-dired-shell-commands")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "dired-x" "dired-x.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from dired-x.el - -(register-definition-prefixes "dired-x" '("dired-" "virtual-dired")) - ;;;*** ;;;### (autoloads nil "dirtrack" "dirtrack.el" (0 0 0 0)) @@ -7805,10 +7824,13 @@ Like \\[dired-jump] (`dired-jump') but in other window. (autoload 'dirtrack-mode "dirtrack" "\ Toggle directory tracking in shell buffers (Dirtrack mode). -If called interactively, enable Dirtrack mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Dirtrack 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -7979,10 +8001,13 @@ in `.emacs'. Toggle display of fill-column indicator. This uses `display-fill-column-indicator' internally. -If called interactively, enable Display-Fill-Column-Indicator mode if -ARG is positive, and disable it if ARG is zero or negative. If called -from Lisp, also enable the mode if ARG is omitted or nil, and toggle -it if ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Display-Fill-Column-Indicator 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -7990,6 +8015,8 @@ disabled. To change the position of the column displayed by default customize `display-fill-column-indicator-column'. You can change the character for the indicator setting `display-fill-column-indicator-character'. +The globalized version is `global-display-fill-column-indicator-mode', +which see. See Info node `Displaying Boundaries' for details. \(fn &optional ARG)" t nil) @@ -8014,10 +8041,31 @@ ARG is omitted or nil. Display-Fill-Column-Indicator mode is enabled in all buffers where `display-fill-column-indicator--turn-on' would do it. -See `display-fill-column-indicator-mode' for more information on Display-Fill-Column-Indicator mode. + +See `display-fill-column-indicator-mode' for more information on +Display-Fill-Column-Indicator mode. + +`global-display-fill-column-indicator-modes' is used to control which modes +this minor mode is used in. \(fn &optional ARG)" t nil) +(defvar global-display-fill-column-indicator-modes '((not special-mode) t) "\ +Which major modes `display-fill-column-indicator-mode' is switched on in. +This variable can be either t (all major modes), nil (no major modes), +or a list of modes and (not modes) to switch use this minor mode or +not. For instance + + (c-mode (not message-mode mail-mode) text-mode) + +means \"use this mode in all modes derived from `c-mode', don't use in +modes derived from `message-mode' or `mail-mode', but do use in other +modes derived from `text-mode'\". An element with value t means \"use\" +and nil means \"don't use\". There's an implicit nil at the end of the +list.") + +(custom-autoload 'global-display-fill-column-indicator-modes "display-fill-column-indicator" t) + (register-definition-prefixes "display-fill-column-indicator" '("display-fill-column-indicator--turn-on")) ;;;*** @@ -8030,10 +8078,13 @@ See `display-fill-column-indicator-mode' for more information on Display-Fill-Co Toggle display of line numbers in the buffer. This uses `display-line-numbers' internally. -If called interactively, enable Display-Line-Numbers mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Display-Line-Numbers 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -8064,7 +8115,9 @@ ARG is omitted or nil. Display-Line-Numbers mode is enabled in all buffers where `display-line-numbers--turn-on' would do it. -See `display-line-numbers-mode' for more information on Display-Line-Numbers mode. + +See `display-line-numbers-mode' for more information on +Display-Line-Numbers mode. \(fn &optional ARG)" t nil) @@ -8168,10 +8221,13 @@ to the next best mode." nil nil) (autoload 'doc-view-minor-mode "doc-view" "\ Toggle displaying buffer via Doc View (Doc View minor mode). -If called interactively, enable Doc-View minor mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Doc-View minor 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -8233,10 +8289,13 @@ Switch to *doctor* buffer and start giving psychotherapy." t nil) (autoload 'double-mode "double" "\ Toggle special insertion on double keypresses (Double mode). -If called interactively, enable Double mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Double 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -8252,7 +8311,6 @@ strings when pressed twice. See `double-map' for details. ;;;### (autoloads nil "dunnet" "play/dunnet.el" (0 0 0 0)) ;;; Generated autoloads from play/dunnet.el -(push (purecopy '(dunnet 2 2)) package--builtin-versions) (autoload 'dunnet "dunnet" "\ Switch to *dungeon* buffer and start game." t nil) @@ -8297,6 +8355,10 @@ appear in DOC, a paragraph is added to DOC explaining usage of the mode argument. Optional INIT-VALUE is the initial value of the mode's variable. + Note that the minor mode function won't be called by setting + this option, so the value *reflects* the minor mode's natural + initial state, rather than *setting* it. + In the vast majority of cases it should be nil. Optional LIGHTER is displayed in the mode line when the mode is on. Optional KEYMAP is the default keymap bound to the mode keymap. If non-nil, it should be a variable name (whose value is a keymap), @@ -8354,18 +8416,21 @@ For example, you could write (autoload 'define-globalized-minor-mode "easy-mmode" "\ Make a global mode GLOBAL-MODE corresponding to buffer-local minor MODE. TURN-ON is a function that will be called with no args in every buffer - and that should try to turn MODE on if applicable for that buffer. -Each of KEY VALUE is a pair of CL-style keyword arguments. As - the minor mode defined by this function is always global, any - :global keyword is ignored. Other keywords have the same - meaning as in `define-minor-mode', which see. In particular, - :group specifies the custom group. The most useful keywords - are those that are passed on to the `defcustom'. It normally - makes no sense to pass the :lighter or :keymap keywords to - `define-globalized-minor-mode', since these are usually passed - to the buffer-local version of the minor mode. +and that should try to turn MODE on if applicable for that buffer. + +Each of KEY VALUE is a pair of CL-style keyword arguments. :predicate +specifies which major modes the globalized minor mode should be switched on +in. As the minor mode defined by this function is always global, any +:global keyword is ignored. Other keywords have the same meaning as in +`define-minor-mode', which see. In particular, :group specifies the custom +group. The most useful keywords are those that are passed on to the +`defcustom'. It normally makes no sense to pass the :lighter or :keymap +keywords to `define-globalized-minor-mode', since these are usually passed +to the buffer-local version of the minor mode. + BODY contains code to execute each time the mode is enabled or disabled. - It is executed after toggling the mode, and before running GLOBAL-MODE-hook. +It is executed after toggling the mode, and before running +GLOBAL-MODE-hook. If MODE's set-up depends on the major mode in effect when it was enabled, then disabling and reenabling MODE should make MODE work @@ -9074,10 +9139,13 @@ or call the function `global-ede-mode'.") (autoload 'global-ede-mode "ede" "\ Toggle global EDE (Emacs Development Environment) mode. -If called interactively, enable Global Ede mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Global Ede 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -9104,38 +9172,6 @@ an EDE controlled project. (register-definition-prefixes "ede/autoconf-edit" '("autoconf-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/base" "cedet/ede/base.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/base.el - -(register-definition-prefixes "ede/base" '("ede-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/config" "cedet/ede/config.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/config.el - -(register-definition-prefixes "ede/config" '("ede-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/cpp-root" -;;;;;; "cedet/ede/cpp-root.el" (0 0 0 0)) -;;; Generated autoloads from cedet/ede/cpp-root.el - -(register-definition-prefixes "ede/cpp-root" '("ede-cpp-root-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/custom" "cedet/ede/custom.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/custom.el - -(register-definition-prefixes "ede/custom" '("ede-" "eieio-ede-old-variables")) - ;;;*** ;;;### (autoloads nil "ede/detect" "cedet/ede/detect.el" (0 0 0 0)) @@ -9143,62 +9179,6 @@ an EDE controlled project. (register-definition-prefixes "ede/detect" '("ede-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/dired" "cedet/ede/dired.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/dired.el - -(register-definition-prefixes "ede/dired" '("ede-dired-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/emacs" "cedet/ede/emacs.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/emacs.el - -(register-definition-prefixes "ede/emacs" '("ede-emacs-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/files" "cedet/ede/files.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/files.el - -(register-definition-prefixes "ede/files" '("ede-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/generic" -;;;;;; "cedet/ede/generic.el" (0 0 0 0)) -;;; Generated autoloads from cedet/ede/generic.el - -(register-definition-prefixes "ede/generic" '("ede-generic-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/linux" "cedet/ede/linux.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/linux.el - -(register-definition-prefixes "ede/linux" '("ede-linux-" "project-linux-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/locate" "cedet/ede/locate.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/locate.el - -(register-definition-prefixes "ede/locate" '("ede-locate-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/make" "cedet/ede/make.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/make.el - -(register-definition-prefixes "ede/make" '("ede-")) - ;;;*** ;;;### (autoloads nil "ede/makefile-edit" "cedet/ede/makefile-edit.el" @@ -9316,14 +9296,6 @@ an EDE controlled project. (register-definition-prefixes "ede/project-am" '("project-am-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/shell" "cedet/ede/shell.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/shell.el - -(register-definition-prefixes "ede/shell" '("ede-shell-run-command")) - ;;;*** ;;;### (autoloads nil "ede/simple" "cedet/ede/simple.el" (0 0 0 0)) @@ -9338,14 +9310,6 @@ an EDE controlled project. (register-definition-prefixes "ede/source" '("ede-source")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/speedbar" -;;;;;; "cedet/ede/speedbar.el" (0 0 0 0)) -;;; Generated autoloads from cedet/ede/speedbar.el - -(register-definition-prefixes "ede/speedbar" '("ede-")) - ;;;*** ;;;### (autoloads nil "ede/srecode" "cedet/ede/srecode.el" (0 0 0 @@ -9354,14 +9318,6 @@ an EDE controlled project. (register-definition-prefixes "ede/srecode" '("ede-srecode-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "ede/util" "cedet/ede/util.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from cedet/ede/util.el - -(register-definition-prefixes "ede/util" '("ede-make-buffer-writable")) - ;;;*** ;;;### (autoloads nil "edebug" "emacs-lisp/edebug.el" (0 0 0 0)) @@ -9829,7 +9785,6 @@ To change the default, set the variable `ediff-use-toolbar-p', which see." t nil ;;;### (autoloads nil "edmacro" "edmacro.el" (0 0 0 0)) ;;; Generated autoloads from edmacro.el -(push (purecopy '(edmacro 2 1)) package--builtin-versions) (autoload 'edit-kbd-macro "edmacro" "\ Edit a keyboard macro. @@ -9979,14 +9934,6 @@ BUFFER is put back into its original major mode. (register-definition-prefixes "eieio-base" '("eieio-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "eieio-compat" -;;;;;; "emacs-lisp/eieio-compat.el" (0 0 0 0)) -;;; Generated autoloads from emacs-lisp/eieio-compat.el - -(register-definition-prefixes "eieio-compat" '("eieio--generic-static-symbol-specializers" "generic-p" "next-method-p" "no-")) - ;;;*** ;;;### (autoloads nil "eieio-core" "emacs-lisp/eieio-core.el" (0 @@ -10006,14 +9953,6 @@ It creates an autoload function for CNAME's constructor. (register-definition-prefixes "eieio-core" '("class-" "eieio-" "inconsistent-class-hierarchy" "invalid-slot-" "unbound-slot")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "eieio-custom" -;;;;;; "emacs-lisp/eieio-custom.el" (0 0 0 0)) -;;; Generated autoloads from emacs-lisp/eieio-custom.el - -(register-definition-prefixes "eieio-custom" '("eieio-")) - ;;;*** ;;;### (autoloads nil "eieio-datadebug" "emacs-lisp/eieio-datadebug.el" @@ -10022,14 +9961,6 @@ It creates an autoload function for CNAME's constructor. (register-definition-prefixes "eieio-datadebug" '("data-debug-insert-object-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "eieio-opt" "emacs-lisp/eieio-opt.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from emacs-lisp/eieio-opt.el - -(register-definition-prefixes "eieio-opt" '("eieio-")) - ;;;*** ;;;### (autoloads nil "eieio-speedbar" "emacs-lisp/eieio-speedbar.el" @@ -10042,7 +9973,7 @@ It creates an autoload function for CNAME's constructor. ;;;### (autoloads nil "eldoc" "emacs-lisp/eldoc.el" (0 0 0 0)) ;;; Generated autoloads from emacs-lisp/eldoc.el -(push (purecopy '(eldoc 1 10 0)) package--builtin-versions) +(push (purecopy '(eldoc 1 11 0)) package--builtin-versions) ;;;*** @@ -10062,10 +9993,13 @@ or call the function `electric-pair-mode'.") (autoload 'electric-pair-mode "elec-pair" "\ Toggle automatic parens pairing (Electric Pair mode). -If called interactively, enable Electric-Pair mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Electric-Pair 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -10083,10 +10017,13 @@ To toggle the mode in a single buffer, use `electric-pair-local-mode'. (autoload 'electric-pair-local-mode "elec-pair" "\ Toggle `electric-pair-mode' only in this buffer. -If called interactively, enable Electric-Pair-Local mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Electric-Pair-Local 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -10180,142 +10117,6 @@ displayed." t nil) (register-definition-prefixes "elp" '("elp-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-alias" "eshell/em-alias.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-alias.el - -(register-definition-prefixes "em-alias" '("eshell" "pcomplete/eshell-mode/alias")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-banner" "eshell/em-banner.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-banner.el - -(register-definition-prefixes "em-banner" '("eshell-banner-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-basic" "eshell/em-basic.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-basic.el - -(register-definition-prefixes "em-basic" '("eshell")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-cmpl" "eshell/em-cmpl.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-cmpl.el - -(register-definition-prefixes "em-cmpl" '("eshell-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-dirs" "eshell/em-dirs.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-dirs.el - -(register-definition-prefixes "em-dirs" '("eshell")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-glob" "eshell/em-glob.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-glob.el - -(register-definition-prefixes "em-glob" '("eshell-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-hist" "eshell/em-hist.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-hist.el - -(register-definition-prefixes "em-hist" '("eshell")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-ls" "eshell/em-ls.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-ls.el - -(register-definition-prefixes "em-ls" '("eshell")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-pred" "eshell/em-pred.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-pred.el - -(register-definition-prefixes "em-pred" '("eshell-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-prompt" "eshell/em-prompt.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-prompt.el - -(register-definition-prefixes "em-prompt" '("eshell-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-rebind" "eshell/em-rebind.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-rebind.el - -(register-definition-prefixes "em-rebind" '("eshell-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-script" "eshell/em-script.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-script.el - -(register-definition-prefixes "em-script" '("eshell")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-smart" "eshell/em-smart.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-smart.el - -(register-definition-prefixes "em-smart" '("eshell-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-term" "eshell/em-term.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-term.el - -(register-definition-prefixes "em-term" '("eshell-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-tramp" "eshell/em-tramp.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-tramp.el - -(register-definition-prefixes "em-tramp" '("eshell")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-unix" "eshell/em-unix.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-unix.el - -(register-definition-prefixes "em-unix" '("eshell" "nil-blank-string")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "em-xtra" "eshell/em-xtra.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from eshell/em-xtra.el - -(register-definition-prefixes "em-xtra" '("eshell/")) - ;;;*** ;;;### (autoloads nil "emacs-lock" "emacs-lock.el" (0 0 0 0)) @@ -10439,10 +10240,13 @@ Minor mode for editing text/enriched files. These are files with embedded formatting information in the MIME standard text/enriched format. -If called interactively, enable Enriched mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Enriched 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -10701,10 +10505,13 @@ Encrypt marked files." t nil) (autoload 'epa-mail-mode "epa-mail" "\ A minor-mode for composing encrypted/clearsigned mails. -If called interactively, enable epa-mail mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `epa-mail 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -10768,10 +10575,13 @@ or call the function `epa-global-mail-mode'.") (autoload 'epa-global-mail-mode "epa-mail" "\ Minor mode to hook EasyPG into Mail mode. -If called interactively, enable Epa-Global-Mail mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Epa-Global-Mail 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -10882,14 +10692,6 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL. (register-definition-prefixes "erc" '("define-erc-module" "erc-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-autoaway" -;;;;;; "erc/erc-autoaway.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-autoaway.el - -(register-definition-prefixes "erc-autoaway" '("erc-auto")) - ;;;*** ;;;### (autoloads nil "erc-backend" "erc/erc-backend.el" (0 0 0 0)) @@ -10897,54 +10699,6 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL. (register-definition-prefixes "erc-backend" '("erc-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-button" "erc/erc-button.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-button.el - -(register-definition-prefixes "erc-button" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-capab" "erc/erc-capab.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-capab.el - -(register-definition-prefixes "erc-capab" '("erc-capab-identify-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-dcc" "erc/erc-dcc.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-dcc.el - -(register-definition-prefixes "erc-dcc" '("erc-" "pcomplete/erc-mode/")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-desktop-notifications" -;;;;;; "erc/erc-desktop-notifications.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-desktop-notifications.el - -(register-definition-prefixes "erc-desktop-notifications" '("erc-notifications-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-ezbounce" -;;;;;; "erc/erc-ezbounce.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-ezbounce.el - -(register-definition-prefixes "erc-ezbounce" '("erc-ezb-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-fill" "erc/erc-fill.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-fill.el - -(register-definition-prefixes "erc-fill" '("erc-")) - ;;;*** ;;;### (autoloads nil "erc-goodies" "erc/erc-goodies.el" (0 0 0 0)) @@ -10959,30 +10713,6 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL. (register-definition-prefixes "erc-ibuffer" '("erc-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-identd" "erc/erc-identd.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-identd.el - -(register-definition-prefixes "erc-identd" '("erc-identd-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-imenu" "erc/erc-imenu.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-imenu.el - -(register-definition-prefixes "erc-imenu" '("erc-unfill-notice")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-join" "erc/erc-join.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-join.el - -(register-definition-prefixes "erc-join" '("erc-")) - ;;;*** ;;;### (autoloads nil "erc-lang" "erc/erc-lang.el" (0 0 0 0)) @@ -10990,46 +10720,6 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL. (register-definition-prefixes "erc-lang" '("erc-cmd-LANG" "iso-638-languages" "language")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-list" "erc/erc-list.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-list.el - -(register-definition-prefixes "erc-list" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-log" "erc/erc-log.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-log.el - -(register-definition-prefixes "erc-log" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-match" "erc/erc-match.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-match.el - -(register-definition-prefixes "erc-match" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-menu" "erc/erc-menu.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-menu.el - -(register-definition-prefixes "erc-menu" '("erc-menu-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-netsplit" -;;;;;; "erc/erc-netsplit.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-netsplit.el - -(register-definition-prefixes "erc-netsplit" '("erc-")) - ;;;*** ;;;### (autoloads nil "erc-networks" "erc/erc-networks.el" (0 0 0 @@ -11046,118 +10736,6 @@ Interactively select a server to connect to using `erc-server-alist'." t nil) (register-definition-prefixes "erc-networks" '("erc-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-notify" "erc/erc-notify.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-notify.el - -(register-definition-prefixes "erc-notify" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-page" "erc/erc-page.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-page.el - -(register-definition-prefixes "erc-page" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-pcomplete" -;;;;;; "erc/erc-pcomplete.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-pcomplete.el - -(register-definition-prefixes "erc-pcomplete" '("erc-pcomplet" "pcomplete")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-replace" -;;;;;; "erc/erc-replace.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-replace.el - -(register-definition-prefixes "erc-replace" '("erc-replace-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-ring" "erc/erc-ring.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-ring.el - -(register-definition-prefixes "erc-ring" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-services" -;;;;;; "erc/erc-services.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-services.el - -(register-definition-prefixes "erc-services" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-sound" "erc/erc-sound.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-sound.el - -(register-definition-prefixes "erc-sound" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-speedbar" -;;;;;; "erc/erc-speedbar.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-speedbar.el - -(register-definition-prefixes "erc-speedbar" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-spelling" -;;;;;; "erc/erc-spelling.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-spelling.el - -(register-definition-prefixes "erc-spelling" '("erc-spelling-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-stamp" "erc/erc-stamp.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-stamp.el - -(register-definition-prefixes "erc-stamp" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-status-sidebar" -;;;;;; "erc/erc-status-sidebar.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-status-sidebar.el - -(register-definition-prefixes "erc-status-sidebar" '("erc-status-sidebar-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-track" "erc/erc-track.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-track.el - -(register-definition-prefixes "erc-track" '("erc-")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-truncate" -;;;;;; "erc/erc-truncate.el" (0 0 0 0)) -;;; Generated autoloads from erc/erc-truncate.el - -(register-definition-prefixes "erc-truncate" '("erc-max-buffer-size")) - -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "erc-xdcc" "erc/erc-xdcc.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from erc/erc-xdcc.el - -(register-definition-prefixes "erc-xdcc" '("erc-")) - ;;;*** ;;;### (autoloads nil "ert" "emacs-lisp/ert.el" (0 0 0 0)) @@ -12067,11 +11645,11 @@ Render FILE using EWW. \(fn FILE)" t nil) (autoload 'eww-search-words "eww" "\ -Search the web for the text between BEG and END. +Search the web for the text in the region. If region is active (and not whitespace), search the web for -the text between BEG and END. Else, prompt the user for a search -string. See the `eww-search-prefix' variable for the search -engine used." t nil) +the text between region beginning and end. Else, prompt the +user for a search string. See the variable `eww-search-prefix' +for the search engine used." t nil) (autoload 'eww-mode "eww" "\ Mode for browsing the web. @@ -12380,10 +11958,13 @@ a top-level keymap, `text-scale-increase' or (autoload 'buffer-face-mode "face-remap" "\ Minor mode for a buffer-specific default face. -If called interactively, enable Buffer-Face mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Buffer-Face 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -13299,10 +12880,13 @@ region is invalid. (autoload 'flymake-mode "flymake" "\ Toggle Flymake mode on or off. -If called interactively, enable Flymake mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Flymake 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -13384,10 +12968,13 @@ Turn on `flyspell-mode' for comments and strings." t nil) (autoload 'flyspell-mode "flyspell" "\ Toggle on-the-fly spell checking (Flyspell mode). -If called interactively, enable Flyspell mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Flyspell 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -13412,7 +12999,7 @@ invoking `ispell-change-dictionary'. Consider using the `ispell-parser' to check your text. For instance consider adding: -\(add-hook \\='tex-mode-hook (function (lambda () (setq ispell-parser \\='tex)))) +\(add-hook \\='tex-mode-hook (lambda () (setq ispell-parser \\='tex))) in your init file. \\[flyspell-region] checks all words inside a region. @@ -13464,10 +13051,13 @@ Turn off Follow mode. Please see the function `follow-mode'." nil nil) (autoload 'follow-mode "follow" "\ Toggle Follow mode. -If called interactively, enable Follow mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Follow 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -13587,15 +13177,17 @@ selected if the original window is the first one in the frame. ;;;### (autoloads nil "footnote" "mail/footnote.el" (0 0 0 0)) ;;; Generated autoloads from mail/footnote.el -(push (purecopy '(footnote 0 19)) package--builtin-versions) (autoload 'footnote-mode "footnote" "\ Toggle Footnote mode. -If called interactively, enable Footnote mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Footnote 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -14026,7 +13618,6 @@ Interactively, reads the register using `register-read-with-preview'. ;;;### (autoloads nil "gamegrid" "play/gamegrid.el" (0 0 0 0)) ;;; Generated autoloads from play/gamegrid.el -(push (purecopy '(gamegrid 1 2)) package--builtin-versions) (register-definition-prefixes "gamegrid" '("gamegrid-")) @@ -14057,10 +13648,13 @@ being transferred. This list may grow up to a size of `gdb-debug-log-max' after which the oldest element (at the end of the list) is deleted every time a new one is added (at the front). -If called interactively, enable Gdb-Enable-Debug mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Gdb-Enable-Debug 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -14238,10 +13832,13 @@ regular expression that can be used as an element of (autoload 'glasses-mode "glasses" "\ Minor mode for making identifiers likeThis readable. -If called interactively, enable Glasses mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Glasses 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -14850,10 +14447,13 @@ If FORCE is non-nil, replace the old ones. (autoload 'gnus-mailing-list-mode "gnus-ml" "\ Minor mode for providing mailing-list commands. -If called interactively, enable Gnus-Mailing-List mode if ARG is -positive, and disable it if ARG is zero or negative. If called -from Lisp, also enable the mode if ARG is omitted or nil, and -toggle it if ARG is `toggle'; disable the mode otherwise. +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. + +If called from Lisp, toggle the mode if if ARG is `toggle'. +Enable the mode if ARG is nil, omitted, or is a positive number. +All other values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -15304,10 +14904,13 @@ Also fontifies the buffer appropriately (see `goto-address-fontify-p' and (autoload 'goto-address-mode "goto-addr" "\ Minor mode to buttonize URLs and e-mail addresses in the current buffer. -If called interactively, enable Goto-Address mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Goto-Address 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -15334,17 +14937,22 @@ ARG is omitted or nil. Goto-Address mode is enabled in all buffers where `goto-addr-mode--turn-on' would do it. -See `goto-address-mode' for more information on Goto-Address mode. + +See `goto-address-mode' for more information on +Goto-Address mode. \(fn &optional ARG)" t nil) (autoload 'goto-address-prog-mode "goto-addr" "\ Like `goto-address-mode', but only for comments and strings. -If called interactively, enable Goto-Address-Prog mode if ARG is -positive, and disable it if ARG is zero or negative. If called from -Lisp, also enable the mode if ARG is omitted or nil, and toggle it if -ARG is `toggle'; disable the mode otherwise. +If called interactively, toggle `Goto-Address-Prog 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -15678,10 +15286,13 @@ or call the function `gud-tooltip-mode'.") (autoload 'gud-tooltip-mode "gud" "\ Toggle the display of GUD tooltips. -If called interactively, enable Gud-Tooltip mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Gud-Tooltip 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -16388,14 +15999,6 @@ This discards the buffer's undo information." t nil) (register-definition-prefixes "hexl" '("dehexlify-buffer" "hexl-")) -;;;*** - -;;;### (autoloads "actual autoloads are elsewhere" "hfy-cmap" "hfy-cmap.el" -;;;;;; (0 0 0 0)) -;;; Generated autoloads from hfy-cmap.el - -(register-definition-prefixes "hfy-cmap" '("hfy-" "htmlfontify-unload-rgb-file")) - ;;;*** ;;;### (autoloads nil "hi-lock" "hi-lock.el" (0 0 0 0)) @@ -16404,10 +16007,13 @@ This discards the buffer's undo information." t nil) (autoload 'hi-lock-mode "hi-lock" "\ Toggle selective highlighting of patterns (Hi Lock mode). -If called interactively, enable Hi-Lock mode if ARG is positive, and -disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Hi-Lock 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -16494,7 +16100,9 @@ ARG is omitted or nil. Hi-Lock mode is enabled in all buffers where `turn-on-hi-lock-if-enabled' would do it. -See `hi-lock-mode' for more information on Hi-Lock mode. + +See `hi-lock-mode' for more information on +Hi-Lock mode. \(fn &optional ARG)" t nil) @@ -16598,6 +16206,9 @@ Interactively added patterns are those normally specified using `highlight-regexp' and `highlight-lines-matching-regexp'; they can be found in variable `hi-lock-interactive-patterns'." t nil) +(autoload 'hi-lock-find-patterns "hi-lock" "\ +Add patterns from the current buffer to the list of hi-lock patterns." t nil) + (register-definition-prefixes "hi-lock" '("hi-lock-" "turn-on-hi-lock-if-enabled")) ;;;*** @@ -16608,10 +16219,13 @@ be found in variable `hi-lock-interactive-patterns'." t nil) (autoload 'hide-ifdef-mode "hideif" "\ Toggle features to hide/show #ifdef blocks (Hide-Ifdef mode). -If called interactively, enable Hide-Ifdef mode if ARG is positive, -and disable it if ARG is zero or negative. If called from Lisp, also -enable the mode if ARG is omitted or nil, and toggle it if ARG is -`toggle'; disable the mode otherwise. +If called interactively, toggle `Hide-Ifdef 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 if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. All other +values will disable the mode. The mode's hook is called both when the mode is enabled and when it is disabled. @@ -16659,7 +16273,7 @@ Several variables affect how the hiding is done: ;;;### (autoloads nil "hideshow" "progmodes/hideshow.el" (0 0 0 0)) ;;; Generated autoloads from progmodes/hideshow.el -(defvar hs-special-modes-alist (mapcar 'purecopy '((c-mode "{" "}" "/[*/]" nil nil) (c++-mode "{" "}" "/[*/]" nil nil) (bibtex-mode ("@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil nil) (js-mode "{" "}" "/[*/]" nil))) "\ +(defvar hs-special-modes-alist (mapcar 'purecopy '((c-mode "{" "}" "/[*/]" nil nil) (c++-mode "{" "}" "/[*/]" nil nil) (bibtex-mode ("@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil nil) (js-mode "{" "}" "/[*/]" nil) (mhtml-mode "{\\|<[^/>]*?" "}\\|]*[^/]>" " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + commit 7a3d8559c9abac17c4ef2b951554912a87a9995d Author: Lars Ingebrigtsen Date: Sun Nov 1 13:55:29 2020 +0100 Doc string clarification for cl-some * lisp/emacs-lisp/cl-extra.el (cl-some): Clarify the return value (bug#44330). diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 23c784f9f8..d3159a3768 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -201,8 +201,11 @@ the elements themselves. ;;;###autoload (defun cl-some (cl-pred cl-seq &rest cl-rest) - "Return true if PREDICATE is true of any element of SEQ or SEQs. -If so, return the true (non-nil) value returned by PREDICATE. + "Say whether PREDICATE is true for any element in the SEQ sequences. +More specifically, the return value of this function will be the +same as the first return value of PREDICATE where PREDICATE has a +non-nil value. + \n(fn PREDICATE SEQ...)" (if (or cl-rest (nlistp cl-seq)) (catch 'cl-some commit 76d522e59ef03397e15d30bb3b4de3840c917e63 Author: Lars Ingebrigtsen Date: Sun Nov 1 13:14:41 2020 +0100 custom-theme-set-variables more resilient against removed libraries * lisp/custom.el (custom-theme-set-variables): Don't bug out on settings that require a library that has been removed (bug#38843). diff --git a/lisp/custom.el b/lisp/custom.el index cc445fe765..cee4589543 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -1010,7 +1010,10 @@ COMMENT is a comment string about SYMBOL." set) (when requests (put symbol 'custom-requests requests) - (mapc #'require requests)) + ;; Load any libraries that the setting has specified as + ;; being required, but don't error out if the package has + ;; been removed. + (mapc (lambda (lib) (require lib nil t)) requests)) (setq set (or (get symbol 'custom-set) #'custom-set-default)) (put symbol 'saved-value (list value)) (put symbol 'saved-variable-comment comment) commit a0a60321fe8128dae8bab111a96fbe12f38e481c Author: Lars Ingebrigtsen Date: Sun Nov 1 12:51:17 2020 +0100 Mention non-ASCII C-c LETTER bindings in the lispref manual * doc/lispref/tips.texi (Key Binding Conventions): Mention non-ASCII C-c LETTER (bug#15917). diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index 32836639a0..40d01d4746 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi @@ -283,8 +283,9 @@ implementing such clickable links. @cindex keys, reserved Don't define @kbd{C-c @var{letter}} as a key in Lisp programs. Sequences consisting of @kbd{C-c} and a letter (either upper or lower -case) are reserved for users; they are the @strong{only} sequences -reserved for users, so do not block them. +case; @acronym{ASCII} or non-@acronym{ASCII}) are reserved for users; +they are the @strong{only} sequences reserved for users, so do not +block them. Changing all the Emacs major modes to respect this convention was a lot of work; abandoning this convention would make that work go to commit 7602ed6b8271cb034383bd371a1a5f753130aaa4 Author: Lars Ingebrigtsen Date: Sun Nov 1 12:48:34 2020 +0100 Mention the C-c LETTER keybinding convention * doc/emacs/custom.texi (Keymaps): Reintroduce the text about C-c LETTER (bug#15917), and clarify. diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 81874a04aa..ee4ab6c3c6 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1582,6 +1582,13 @@ starts with @kbd{@key{ESC} [}.) If Emacs understands your terminal type properly, it automatically handles such sequences as single input events. + Key sequences that consists of @kbd{C-c} followed by a letter (upper +or lower case; @acronym{ASCII} or non-@acronym{ASCII}) are reserved +for users. Emacs itself will never bind those key sequences, and +Emacs extensions should avoid binding them. In other words, users can +bind key sequences like @kbd{C-c a} or @kbd{C-c ç} and rely on these +never being shadowed by other Emacs bindings. + @node Prefix Keymaps @subsection Prefix Keymaps commit 06585bb939ed61574a4b79455c58cab02f11f0fc Author: Michael Albinus Date: Sun Nov 1 12:42:29 2020 +0100 Trash remote files to local trash (Bug#44216) * doc/misc/tramp.texi (Frequently Asked Questions): Add trashing. * lisp/net/tramp-adb.el (tramp-adb-handle-delete-directory) (tramp-adb-handle-delete-file): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-delete-directory) (tramp-gvfs-handle-delete-file): * lisp/net/tramp-sh.el (tramp-sh-handle-delete-directory) (tramp-sh-handle-delete-file): * lisp/net/tramp-smb.el (tramp-smb-handle-delete-directory) (tramp-smb-handle-delete-file): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-delete-directory) (tramp-sudoedit-handle-delete-file): Implement local trash. (Bug#44216) * lisp/net/tramp-crypt.el (tramp-crypt-handle-delete-directory) (tramp-crypt-handle-delete-file): Do not trash. * lisp/net/tramp.el (tramp-skeleton-delete-directory): New defmacro. * test/lisp/net/tramp-tests.el (tramp-test07-file-exists-p) (tramp-test14-delete-directory): Add trashing. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index a7339bf298..6738ed5123 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -4511,6 +4511,21 @@ HISTFILE=/dev/null @end example +@item +Where are remote files trashed to? + +Emacs can trash file instead of deleting them, @ref{Misc File Ops, +Trashing , , emacs}. Remote files are always trashed to the local +trash, except remote encrypted files (@pxref{Keeping files +encrypted}), which are deleted anyway. + +If Emacs is configured to use the XDG conventions for the trash +directory, remote files cannot be restored with the respective tools, +because those conventions don't specify remote paths. Such files must +be restored by moving them manually from +@file{$@{XDG_DATA_HOME@}/Trash/files/}, if needed. + + @item How to shorten long file names when typing in @value{tramp}? diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 49ecaa58ee..3d3b955e8c 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -437,27 +437,25 @@ Emacs dired can't find files." (and parents (file-directory-p dir))) (tramp-error v 'file-error "Couldn't make directory %s" dir)))) -(defun tramp-adb-handle-delete-directory (directory &optional recursive _trash) +(defun tramp-adb-handle-delete-directory (directory &optional recursive trash) "Like `delete-directory' for Tramp files." - (setq directory (expand-file-name directory)) - (with-parsed-tramp-file-name (file-truename directory) nil - (tramp-flush-directory-properties v localname)) - (with-parsed-tramp-file-name directory nil - (tramp-flush-directory-properties v localname) + (tramp-skeleton-delete-directory directory recursive trash (tramp-adb-barf-unless-okay v (format "%s %s" (if recursive "rm -r" "rmdir") (tramp-shell-quote-argument localname)) "Couldn't delete %s" directory))) -(defun tramp-adb-handle-delete-file (filename &optional _trash) +(defun tramp-adb-handle-delete-file (filename &optional trash) "Like `delete-file' for Tramp files." (setq filename (expand-file-name filename)) (with-parsed-tramp-file-name filename nil (tramp-flush-file-properties v localname) - (tramp-adb-barf-unless-okay - v (format "rm %s" (tramp-shell-quote-argument localname)) - "Couldn't delete %s" filename))) + (if (and delete-by-moving-to-trash trash) + (move-file-to-trash filename) + (tramp-adb-barf-unless-okay + v (format "rm %s" (tramp-shell-quote-argument localname)) + "Couldn't delete %s" filename)))) (defun tramp-adb-handle-file-name-all-completions (filename directory) "Like `file-name-all-completions' for Tramp files." diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el index 3e96daa7b1..286b60a48c 100644 --- a/lisp/net/tramp-crypt.el +++ b/lisp/net/tramp-crypt.el @@ -651,21 +651,22 @@ absolute file names." (list filename newname ok-if-already-exists keep-date preserve-uid-gid preserve-extended-attributes)))) +;; Crypted files won't be trashed. (defun tramp-crypt-handle-delete-directory - (directory &optional recursive trash) + (directory &optional recursive _trash) "Like `delete-directory' for Tramp files." (with-parsed-tramp-file-name (expand-file-name directory) nil (tramp-flush-directory-properties v localname) (let (tramp-crypt-enabled) - (delete-directory - (tramp-crypt-encrypt-file-name directory) recursive trash)))) + (delete-directory (tramp-crypt-encrypt-file-name directory) recursive)))) -(defun tramp-crypt-handle-delete-file (filename &optional trash) +;; Crypted files won't be trashed. +(defun tramp-crypt-handle-delete-file (filename &optional _trash) "Like `delete-file' for Tramp files." (with-parsed-tramp-file-name (expand-file-name filename) nil (tramp-flush-file-properties v localname) (let (tramp-crypt-enabled) - (delete-file (tramp-crypt-encrypt-file-name filename) trash)))) + (delete-file (tramp-crypt-encrypt-file-name filename))))) (defun tramp-crypt-handle-directory-files (directory &optional full match nosort) "Like `directory-files' for Tramp files." diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 6467d8f88b..bf55777e33 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -691,8 +691,7 @@ It has been changed in GVFS 1.14.") ("gvfs-move" . "move") ("gvfs-rename" . "rename") ("gvfs-rm" . "remove") - ("gvfs-set-attribute" . "set") - ("gvfs-trash" . "trash")) + ("gvfs-set-attribute" . "set")) "List of cons cells, mapping \"gvfs-\" to \"gio \".") ;; @@ -1080,24 +1079,21 @@ file names." (defun tramp-gvfs-handle-delete-directory (directory &optional recursive trash) "Like `delete-directory' for Tramp files." - (with-parsed-tramp-file-name directory nil + (tramp-skeleton-delete-directory directory recursive trash (if (and recursive (not (file-symlink-p directory))) (mapc (lambda (file) (if (eq t (tramp-compat-file-attribute-type (file-attributes file))) - (delete-directory file recursive trash) - (delete-file file trash))) + (delete-directory file recursive) + (delete-file file))) (directory-files directory 'full directory-files-no-dot-files-regexp)) (when (directory-files directory nil directory-files-no-dot-files-regexp) (tramp-error v 'file-error "Couldn't delete non-empty %s" directory))) - (tramp-flush-directory-properties v localname) - (unless - (tramp-gvfs-send-command - v (if (and trash delete-by-moving-to-trash) "gvfs-trash" "gvfs-rm") - (tramp-gvfs-url-file-name directory)) + (unless (tramp-gvfs-send-command + v "gvfs-rm" (tramp-gvfs-url-file-name directory)) ;; Propagate the error. (with-current-buffer (tramp-get-connection-buffer v) (goto-char (point-min)) @@ -1108,15 +1104,15 @@ file names." "Like `delete-file' for Tramp files." (with-parsed-tramp-file-name filename nil (tramp-flush-file-properties v localname) - (unless - (tramp-gvfs-send-command - v (if (and trash delete-by-moving-to-trash) "gvfs-trash" "gvfs-rm") - (tramp-gvfs-url-file-name filename)) - ;; Propagate the error. - (with-current-buffer (tramp-get-connection-buffer v) - (goto-char (point-min)) - (tramp-error-with-buffer - nil v 'file-error "Couldn't delete %s" filename))))) + (if (and delete-by-moving-to-trash trash) + (move-file-to-trash filename) + (unless (tramp-gvfs-send-command + v "gvfs-rm" (tramp-gvfs-url-file-name filename)) + ;; Propagate the error. + (with-current-buffer (tramp-get-connection-buffer v) + (goto-char (point-min)) + (tramp-error-with-buffer + nil v 'file-error "Couldn't delete %s" filename)))))) (defun tramp-gvfs-handle-expand-file-name (name &optional dir) "Like `expand-file-name' for Tramp files." diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index f1b45ee851..860641b258 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2523,13 +2523,10 @@ The method used must be an out-of-band method." (defun tramp-sh-handle-delete-directory (directory &optional recursive trash) "Like `delete-directory' for Tramp files." - (setq directory (expand-file-name directory)) - (with-parsed-tramp-file-name directory nil - (tramp-flush-directory-properties v localname) + (tramp-skeleton-delete-directory directory recursive trash (tramp-barf-unless-okay v (format "cd / && %s %s" - (or (and trash (tramp-get-remote-trash v)) - (if recursive "rm -rf" "rmdir")) + (if recursive "rm -rf" "rmdir") (tramp-shell-quote-argument localname)) "Couldn't delete %s" directory))) @@ -2538,11 +2535,11 @@ The method used must be an out-of-band method." (setq filename (expand-file-name filename)) (with-parsed-tramp-file-name filename nil (tramp-flush-file-properties v localname) - (tramp-barf-unless-okay - v (format "%s %s" - (or (and trash (tramp-get-remote-trash v)) "rm -f") - (tramp-shell-quote-argument localname)) - "Couldn't delete %s" filename))) + (if (and delete-by-moving-to-trash trash) + (move-file-to-trash filename) + (tramp-barf-unless-okay + v (format "rm -f %s" (tramp-shell-quote-argument localname)) + "Couldn't delete %s" filename)))) ;; Dired. diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 1b6af2a2e3..c236e1cb65 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -635,41 +635,39 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (file-attributes filename)) (unless ok-if-already-exists 'nofollow))))) -(defun tramp-smb-handle-delete-directory (directory &optional recursive _trash) +(defun tramp-smb-handle-delete-directory (directory &optional recursive trash) "Like `delete-directory' for Tramp files." - (setq directory (directory-file-name (expand-file-name directory))) - (when (file-exists-p directory) - (when recursive - (mapc - (lambda (file) - (if (file-directory-p file) - (delete-directory file recursive) - (delete-file file))) - ;; We do not want to delete "." and "..". - (directory-files directory 'full directory-files-no-dot-files-regexp))) - - (with-parsed-tramp-file-name directory nil + (tramp-skeleton-delete-directory directory recursive trash + (when (file-exists-p directory) + (when recursive + (mapc + (lambda (file) + (if (file-directory-p file) + (delete-directory file recursive) + (delete-file file))) + ;; We do not want to delete "." and "..". + (directory-files directory 'full directory-files-no-dot-files-regexp))) + ;; We must also flush the cache of the directory, because ;; `file-attributes' reads the values from there. (tramp-flush-directory-properties v localname) (unless (tramp-smb-send-command v (format "%s \"%s\"" - (if (tramp-smb-get-cifs-capabilities v) "posix_rmdir" "rmdir") + (if (tramp-smb-get-cifs-capabilities v) + "posix_rmdir" "rmdir") (tramp-smb-get-localname v))) ;; Error. (with-current-buffer (tramp-get-connection-buffer v) (goto-char (point-min)) (search-forward-regexp tramp-smb-errors nil t) - (tramp-error - v 'file-error "%s `%s'" (match-string 0) directory))) + (tramp-error v 'file-error "%s `%s'" (match-string 0) directory))) ;; "rmdir" does not report an error. So we check ourselves. (when (file-exists-p directory) - (tramp-error - v 'file-error "`%s' not removed." directory))))) + (tramp-error v 'file-error "`%s' not removed." directory))))) -(defun tramp-smb-handle-delete-file (filename &optional _trash) +(defun tramp-smb-handle-delete-file (filename &optional trash) "Like `delete-file' for Tramp files." (setq filename (expand-file-name filename)) (when (file-exists-p filename) @@ -677,17 +675,18 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." ;; We must also flush the cache of the directory, because ;; `file-attributes' reads the values from there. (tramp-flush-file-properties v localname) - (unless (tramp-smb-send-command - v (format - "%s \"%s\"" - (if (tramp-smb-get-cifs-capabilities v) "posix_unlink" "rm") - (tramp-smb-get-localname v))) - ;; Error. - (with-current-buffer (tramp-get-connection-buffer v) - (goto-char (point-min)) - (search-forward-regexp tramp-smb-errors nil t) - (tramp-error - v 'file-error "%s `%s'" (match-string 0) filename)))))) + (if (and delete-by-moving-to-trash trash) + (move-file-to-trash filename) + (unless (tramp-smb-send-command + v (format + "%s \"%s\"" + (if (tramp-smb-get-cifs-capabilities v) "posix_unlink" "rm") + (tramp-smb-get-localname v))) + ;; Error. + (with-current-buffer (tramp-get-connection-buffer v) + (goto-char (point-min)) + (search-forward-regexp tramp-smb-errors nil t) + (tramp-error v 'file-error "%s `%s'" (match-string 0) filename))))))) (defun tramp-smb-handle-directory-files (directory &optional full match nosort) diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index 98727dc4a8..558a57b2ea 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el @@ -321,29 +321,25 @@ absolute file names." (defun tramp-sudoedit-handle-delete-directory (directory &optional recursive trash) "Like `delete-directory' for Tramp files." - (setq directory (expand-file-name directory)) - (with-parsed-tramp-file-name directory nil - (tramp-flush-directory-properties v localname) - (unless - (tramp-sudoedit-send-command - v (or (and trash "trash") - (if recursive '("rm" "-rf") "rmdir")) - (tramp-compat-file-name-unquote localname)) + (tramp-skeleton-delete-directory directory recursive trash + (unless (tramp-sudoedit-send-command + v (if recursive '("rm" "-rf") "rmdir") + (tramp-compat-file-name-unquote localname)) (tramp-error v 'file-error "Couldn't delete %s" directory)))) (defun tramp-sudoedit-handle-delete-file (filename &optional trash) "Like `delete-file' for Tramp files." (with-parsed-tramp-file-name filename nil (tramp-flush-file-properties v localname) - (unless - (tramp-sudoedit-send-command - v (if (and trash delete-by-moving-to-trash) "trash" "rm") - (tramp-compat-file-name-unquote localname)) - ;; Propagate the error. - (with-current-buffer (tramp-get-connection-buffer v) - (goto-char (point-min)) - (tramp-error-with-buffer - nil v 'file-error "Couldn't delete %s" filename))))) + (if (and delete-by-moving-to-trash trash) + (move-file-to-trash filename) + (unless (tramp-sudoedit-send-command + v "rm" (tramp-compat-file-name-unquote localname)) + ;; Propagate the error. + (with-current-buffer (tramp-get-connection-buffer v) + (goto-char (point-min)) + (tramp-error-with-buffer + nil v 'file-error "Couldn't delete %s" filename)))))) (defun tramp-sudoedit-handle-expand-file-name (name &optional dir) "Like `expand-file-name' for Tramp files. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 0c85025d54..f3966479db 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3864,7 +3864,7 @@ It does not support `:stderr'." p)))))) (defun tramp-handle-make-symbolic-link - (target linkname &optional ok-if-already-exists) + (target linkname &optional ok-if-already-exists) "Like `make-symbolic-link' for Tramp files. This is the fallback implementation for backends which do not support symbolic links." @@ -3877,8 +3877,7 @@ support symbolic links." (tramp-run-real-handler #'make-symbolic-link (list target linkname ok-if-already-exists)))) -(defun tramp-handle-shell-command - (command &optional output-buffer error-buffer) +(defun tramp-handle-shell-command (command &optional output-buffer error-buffer) "Like `shell-command' for Tramp files." (let* ((asynchronous (string-match-p "[ \t]*&[ \t]*\\'" command)) (command (substring command 0 asynchronous)) @@ -4662,6 +4661,7 @@ If both files are local, the function returns t." (and (tramp-tramp-file-p file1) (tramp-tramp-file-p file2) (string-equal (file-remote-p file1) (file-remote-p file2))))) +;; See also `file-modes-symbolic-to-number'. (defun tramp-mode-string-to-int (mode-string) "Convert a ten-letter \"drwxrwxrwx\"-style MODE-STRING into mode bits." (let* (case-fold-search @@ -4741,6 +4741,7 @@ If both files are local, the function returns t." "A list of file types returned from the `stat' system call. This is used to map a mode number to a permission string.") +;; See also `file-modes-number-to-symbolic'. (defun tramp-file-mode-from-int (mode) "Turn an integer representing a file MODE into an ls(1)-like string." (let ((type (cdr @@ -5333,6 +5334,25 @@ name of a process or buffer, or nil to default to the current buffer." (lambda () (remove-hook 'interrupt-process-functions #'tramp-interrupt-process)))) +(defmacro tramp-skeleton-delete-directory (directory recursive trash &rest body) + "Skeleton for `tramp-*-handle-delete-directory'. +BODY is the backend specific code." + (declare (indent 3) (debug t)) + `(with-parsed-tramp-file-name (expand-file-name ,directory) nil + (if (and delete-by-moving-to-trash ,trash) + ;; Move non-empty dir to trash only if recursive deletion was + ;; requested. + (if (and (not ,recursive) + (directory-files + ,directory nil directory-files-no-dot-files-regexp)) + (tramp-error + v 'file-error "Directory is not empty, not moving to trash") + (move-file-to-trash ,directory)) + ,@body) + (tramp-flush-directory-properties v localname))) + +(put #'tramp-skeleton-delete-directory 'tramp-suppress-trace t) + ;; Checklist for `tramp-unload-hook' ;; - Unload all `tramp-*' packages ;; - Reset `file-name-handler-alist' diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 2c5b4bf18d..50db55ebb4 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2266,7 +2266,24 @@ This checks also `file-name-as-directory', `file-name-directory', (write-region "foo" nil tmp-name) (should (file-exists-p tmp-name)) (delete-file tmp-name) - (should-not (file-exists-p tmp-name))))) + (should-not (file-exists-p tmp-name)) + + ;; Trashing files doesn't work for crypted remote files. + (unless (tramp--test-crypt-p) + (let ((trash-directory (tramp--test-make-temp-name 'local quoted)) + (delete-by-moving-to-trash t)) + (make-directory trash-directory) + (should-not (file-exists-p tmp-name)) + (write-region "foo" nil tmp-name) + (should (file-exists-p tmp-name)) + (delete-file tmp-name 'trash) + (should-not (file-exists-p tmp-name)) + (should + (file-exists-p + (expand-file-name + (file-name-nondirectory tmp-name) trash-directory))) + (delete-directory trash-directory 'recursive) + (should-not (file-exists-p trash-directory))))))) (ert-deftest tramp-test08-file-local-copy () "Check `file-local-copy'." @@ -2431,7 +2448,7 @@ This checks also `file-name-as-directory', `file-name-directory', (should-error (cl-letf (((symbol-function #'y-or-n-p) #'ignore) ;; Ange-FTP. - ((symbol-function 'yes-or-no-p) 'ignore)) + ((symbol-function #'yes-or-no-p) #'ignore)) (write-region "foo" nil tmp-name nil nil nil 'mustbenew)) :type 'file-already-exists) (should-error @@ -2763,7 +2780,52 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." (delete-directory tmp-name1) :type 'file-error) (delete-directory tmp-name1 'recursive) - (should-not (file-directory-p tmp-name1))))) + (should-not (file-directory-p tmp-name1)) + + ;; Trashing directories works only since Emacs 27.1. It doesn't + ;; work for crypted remote directories. + (when (and (not (tramp--test-crypt-p)) (tramp--test-emacs27-p)) + (let ((trash-directory (tramp--test-make-temp-name 'local quoted)) + (delete-by-moving-to-trash t)) + (make-directory trash-directory) + ;; Delete empty directory. + (make-directory tmp-name1) + (should (file-directory-p tmp-name1)) + (delete-directory tmp-name1 nil 'trash) + (should-not (file-directory-p tmp-name1)) + (should + (file-exists-p + (expand-file-name + (file-name-nondirectory tmp-name1) trash-directory))) + (delete-directory trash-directory 'recursive) + (should-not (file-exists-p trash-directory)) + ;; Delete non-empty directory. + (make-directory tmp-name1) + (should (file-directory-p tmp-name1)) + (write-region "foo" nil (expand-file-name "bla" tmp-name1)) + (should (file-exists-p (expand-file-name "bla" tmp-name1))) + (make-directory tmp-name2) + (should (file-directory-p tmp-name2)) + (write-region "foo" nil (expand-file-name "bla" tmp-name2)) + (should (file-exists-p (expand-file-name "bla" tmp-name2))) + (should-error + (delete-directory tmp-name1 nil 'trash) + ;; tramp-rclone.el calls the local `delete-directory'. + ;; This raises another error. + :type (if (tramp--test-rclone-p) 'error 'file-error)) + (delete-directory tmp-name1 'recursive 'trash) + (should-not (file-directory-p tmp-name1)) + (should + (file-exists-p + (format + "%s/%s/bla" trash-directory (file-name-nondirectory tmp-name1)))) + (should + (file-exists-p + (format + "%s/%s/%s/bla" trash-directory (file-name-nondirectory tmp-name1) + (file-name-nondirectory tmp-name2)))) + (delete-directory trash-directory 'recursive) + (should-not (file-exists-p trash-directory))))))) (ert-deftest tramp-test15-copy-directory () "Check `copy-directory'." commit 881eeeef9452c42a04f531a9ed18e7c254642a6b Author: Michael Albinus Date: Sun Nov 1 12:40:30 2020 +0100 * etc/NEWS: Add trashing of remote files. Fix typos. diff --git a/etc/NEWS b/etc/NEWS index 5a646d2bb9..59a0f26f26 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -89,13 +89,13 @@ useful on systems such as FreeBSD which ships only with "etc/termcap". This is controlled by the new variable 'scroll-minibuffer-conservatively'. +++ -** New system for displaying documentation for groups of function. +** New system for displaying documentation for groups of functions. This can either be used by saying 'M-x shortdoc-display-group' and choosing a group, or clicking a button in the *Help* buffers when looking at the doc string of a function that belongs to one of these groups. -** New var 'redisplay-skip-initial-frame' to enable batch redisplay tests. +** New variable 'redisplay-skip-initial-frame' to enable batch redisplay tests. Setting it to nil forces the redisplay to do its job even in the initial frame used in batch mode. @@ -173,10 +173,10 @@ characters. Now it also covers the rest of the non-ASCII Unicode space characters. --- -** Prefer chat.freenode.net to irc.freenode.net. -chat.freenode.net has been the preferred address for connecting to the -freenode IRC network for years now. Occurrences of irc.freenode.net -have been replaced with chat.freenode.net throughout Emacs. +** Prefer "chat.freenode.net" to "irc.freenode.net". +"chat.freenode.net" has been the preferred address for connecting to the +freenode IRC network for years now. Occurrences of "irc.freenode.net" +have been replaced with "chat.freenode.net" throughout Emacs. * Editing Changes in Emacs 28.1 @@ -332,7 +332,7 @@ and variables. ** Archive mode --- -*** Archive Mode can now parse .squashfs files. +*** Archive Mode can now parse ".squashfs" files. *** Can now modify members of 'ar' archives. @@ -367,7 +367,7 @@ time zones will use a form like "+0100" instead of "CET". +++ *** New user option 'dired-switches-in-mode-line'. -This variable controls how 'ls' switches are displayed in the mode +This user option controls how 'ls' switches are displayed in the mode line, and allows truncating them (to preserve space on the mode line) or showing them literally, either instead of, or in addition to, displaying "by name" or "by date" sort order. @@ -457,7 +457,7 @@ tags to be considered as well. ** Gnus +++ -*** New value for user option 'smiley-style' +*** New value for user option 'smiley-style'. Smileys can now be rendered with emojis instead of small images when using the new 'emoji' value in 'smiley-style'. @@ -593,11 +593,12 @@ authentication mechanism by setting a value for the key 'smtp-auth'. ** Grep +++ -*** New variable 'grep-match-regexp' matches grep markers to highlight. -grep emits SGR ANSI escape sequences to color its output. The new variable -'grep-match-regexp' holds the regular expression to match the appropriate -markers in order to provide highlighting in the source buffer. The variable -can be customized to accommodate other grep-like tools. +*** New user option 'grep-match-regexp' matches grep markers to highlight. +Grep emits SGR ANSI escape sequences to color its output. The new +user option 'grep-match-regexp' holds the regular expression to match +the appropriate markers in order to provide highlighting in the source +buffer. The user option can be customized to accommodate other +grep-like tools. --- *** The 'lgrep' command now ignores directories. @@ -622,7 +623,7 @@ recorded for the purpose of 'view-lossage'. --- *** The command 'view-lossage' can now be invoked from the menu bar. -The menu-bar Help menu now has a "Show Recent Inputs" item under the +The menu bar "Help" menu now has a "Show Recent Inputs" item under the "Describe" sub-menu. ** Ispell @@ -685,11 +686,11 @@ doc string functions are accessible to the user through the user option 'eldoc-documentation-strategy'. *** New hook 'eldoc-display-functions'. -This hook is intended to be used for displaying doc string. The -functions receive the docstrings composed according to -`eldoc-documentation-strategy' and are tasked with displaying it to +This hook is intended to be used for displaying doc strings. The +functions receive the doc string composed according to +'eldoc-documentation-strategy' and are tasked with displaying it to the user. Examples of such functions would use the echo area, a -separate buffer or a tooltip. +separate buffer, or a tooltip. +++ *** New user option 'eldoc-documentation-strategy'. @@ -737,6 +738,11 @@ preferred over the eudcb-mab.el backend. *** New connection method "media", which allows accessing media devices like cell phones, tablets or cameras. ++++ +*** Trashed remote files are moved to the local trash directory. +All remote files, which are trashed, are moved to the local trash +directory. Except remote encrypted files, which are always deleted. + +++ *** New command 'tramp-crypt-add-directory'. This command marks a remote directory to contain only encrypted files. @@ -1213,27 +1219,26 @@ window after starting). This variable defaults to nil. --- *** The 'editable-list' widget now supports moving items up and down. You can now move items up and down by deleting and then reinserting -them, using the DEL and INS buttons respectively. This is useful in -Custom buffers, for example, to change the order of the elements in a -list. +them, using the 'DEL' and 'INS' buttons respectively. This is useful +in Custom buffers, for example, to change the order of the elements in +a list. ** Diff --- *** New 'diff-mode' font locking face 'diff-error'. -This face is used for error messages from diff. +This face is used for error messages from 'diff'. +++ *** New command 'diff-refresh-hunk'. This new command (bound to 'C-c C-l') regenerates the current hunk. - ** Miscellaneous +++ *** 'format-seconds' can now be used for sub-second times. The new optional "," parameter has been added, and -(format-seconds "%mm %,1ss" 66.4) will now result in "1m 6.4s". +'(format-seconds "%mm %,1ss" 66.4)' will now result in "1m 6.4s". --- *** 'global-display-fill-column-indicator-mode' skips some buffers. @@ -1259,7 +1264,7 @@ visited errors, so you can have an overview what errors were already visited. +++ *** New user option 'tab-first-completion'. -If 'tab-always-indent' is 'complete', this new option can be used to +If 'tab-always-indent' is 'complete', this new user option can be used to further tweak whether to complete or indent. --- @@ -1389,10 +1394,10 @@ horizontal movements now stop at the edge of the board. --- *** TTY menu navigation is now supported in 'xterm-mouse-mode'. -TTY menus support mouse navigation and selection when xterm-mouse-mode +TTY menus support mouse navigation and selection when 'xterm-mouse-mode' is active. When run on a terminal, clicking on the menu bar with the mouse now pops up a TTY menu by default instead of running the command -'tmm-menubar'. To restore the old behavior, set the variable +'tmm-menubar'. To restore the old behavior, set the user option 'tty-menu-open-use-tmm' to non-nil. ** xwidget-webkit mode @@ -1473,10 +1478,10 @@ type symbols. Both functions propagate D-Bus errors. *** D-Bus errors, which have been converted from incoming D-Bus error messages, contain the error name of that message now. ---- ++++ *** D-Bus messages can be monitored with new function 'dbus-register-monitor'. ---- ++++ *** D-Bus events have changed their internal structure. They carry now the destination and the error-name of an event. They also keep the type information of their arguments. Use the @@ -1581,7 +1586,7 @@ This is no longer supported, and setting this variable has no effect. Use macro 'with-current-buffer-window' with action alist entry 'body-function'. +++ -** `byte-compile-file' optional argument LOAD is now obsolete. +** 'byte-compile-file' optional argument LOAD is now obsolete. To load the file after byte-compiling, add a call to 'load' from Lisp or use 'M-x emacs-lisp-byte-compile-and-load' interactively. @@ -1676,7 +1681,7 @@ When bound to the number 16, non-negative integers are printed in the hexadecimal format. +++ -** 'define-globalized-minor-mode' now takes a :predicate parameter. +** 'define-globalized-minor-mode' now takes a ':predicate' parameter. This can be used to control which major modes the minor mode should be used in. @@ -1845,7 +1850,7 @@ menu handling. It is meant as an (experimental) aid for converting Emacs Lisp code to lexical binding, where dynamic (special) variables bound in one file can affect code in another. For details, see the manual section -'(Elisp) Converting to Lexical Binding'. +"(Elisp) Converting to Lexical Binding". --- ** 'unload-feature' now also tries to undo additions to buffer-local hooks. commit 47addaea9f5c4889e7eab57ff10f683c4cd3a16f Author: Lars Ingebrigtsen Date: Sun Nov 1 12:21:05 2020 +0100 Fix error message in feedmail * lisp/mail/feedmail.el (feedmail-buffer-to-smtpmail): Remove superfluous %s in insert string diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index 98782efb4b..6effe13986 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el @@ -1630,7 +1630,7 @@ local gurus." (let ((result (smtpmail-via-smtp addr-listoid prepped))) (when result (set-buffer errors-to) - (insert "Send via smtpmail failed: %s" result) + (insert "Send via smtpmail failed: " result) (let ((case-fold-search t) ;; don't be overconfident about the name of the trace buffer (tracer (concat "trace.*smtp.*" (regexp-quote smtpmail-smtp-server)))) commit 9405cd84a6309f780e76c11a4c79709aa8a4f44f Author: Lars Ingebrigtsen Date: Sun Nov 1 00:10:21 2020 +0100 Fix a segfault in the new svg code * src/image.c (svg_load_image): Don't pass in a NULL for the logical rect, because that will sometimes segfault. diff --git a/src/image.c b/src/image.c index 61c5aa760c..c857b8e62a 100644 --- a/src/image.c +++ b/src/image.c @@ -9808,11 +9808,11 @@ svg_load_image (struct frame *f, struct image *img, char *contents, /* Get the image dimensions. */ #if LIBRSVG_CHECK_VERSION (2, 46, 0) - RsvgRectangle zero_rect, viewbox; + RsvgRectangle zero_rect, viewbox, out_logical_rect; rsvg_handle_get_geometry_for_layer (rsvg_handle, NULL, &zero_rect, &viewbox, - NULL, NULL); + &out_logical_rect, NULL); viewbox_width = viewbox.x + viewbox.width; viewbox_height = viewbox.y + viewbox.height; #else commit 5d9e456c3ed3dcefe6bf48e24a1a8f275fc887cb Author: Juri Linkov Date: Sat Oct 31 22:11:02 2020 +0200 New variable integer-output-format to print integers as characters (bug#44155) * doc/lispref/streams.texi (Output Variables): Add integer-output-format. * src/print.c (print_object): In case of Lisp_Int, print integers as characters when Vinteger_output_format is Qt, and in hex format when Vinteger_output_format is 16. (Vinteger_output_format): New variable. * test/src/print-tests.el (print-integer-output-format): New test. diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi index 2cd61ad04f..f171f13779 100644 --- a/doc/lispref/streams.texi +++ b/doc/lispref/streams.texi @@ -902,3 +902,11 @@ variable. The string should hold a @samp{%}-specification to be used in the C function @code{sprintf}. For further restrictions on what you can use, see the variable's documentation string. @end defvar + +@defvar integer-output-format +This variable specifies how to print integer numbers. The default is +@code{nil}, meaning use the decimal format. When bound to @code{t}, +print integers as characters when an integer represents a character +(@pxref{Basic Char Syntax}). When bound to the number @code{16}, +print non-negative integers in the hexadecimal format. +@end defvar diff --git a/etc/NEWS b/etc/NEWS index 62cc814164..5a646d2bb9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1669,6 +1669,12 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el. * Lisp Changes in Emacs 28.1 +** New variable 'integer-output-format' determines how to print integer values. +When this variable is bound to the value 't', integers are printed by +printing functions as characters when an integer represents a character. +When bound to the number 16, non-negative integers are printed in the +hexadecimal format. + +++ ** 'define-globalized-minor-mode' now takes a :predicate parameter. This can be used to control which major modes the minor mode should be diff --git a/src/print.c b/src/print.c index 53aa353769..fa65a3cb26 100644 --- a/src/print.c +++ b/src/print.c @@ -1908,8 +1908,31 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) { case_Lisp_Int: { - int len = sprintf (buf, "%"pI"d", XFIXNUM (obj)); - strout (buf, len, len, printcharfun); + int c; + intmax_t i; + + if (EQ (Vinteger_output_format, Qt) && CHARACTERP (obj) + && (c = XFIXNUM (obj))) + { + printchar ('?', printcharfun); + if (escapeflag + && (c == ';' || c == '(' || c == ')' || c == '{' || c == '}' + || c == '[' || c == ']' || c == '\"' || c == '\'' || c == '\\')) + printchar ('\\', printcharfun); + printchar (c, printcharfun); + } + else if (INTEGERP (Vinteger_output_format) + && integer_to_intmax (Vinteger_output_format, &i) + && i == 16 && !NILP (Fnatnump (obj))) + { + int len = sprintf (buf, "#x%"pI"x", (EMACS_UINT) XFIXNUM (obj)); + strout (buf, len, len, printcharfun); + } + else + { + int len = sprintf (buf, "%"pI"d", XFIXNUM (obj)); + strout (buf, len, len, printcharfun); + } } break; @@ -2247,6 +2270,13 @@ A value of nil means to use the shortest notation that represents the number without losing information. */); Vfloat_output_format = Qnil; + DEFVAR_LISP ("integer-output-format", Vinteger_output_format, + doc: /* The format used to print integers. +When t, print characters from integers that represent a character. +When a number 16, print non-negative integers in the hexadecimal format. +Otherwise, by default print integers in the decimal format. */); + Vinteger_output_format = Qnil; + DEFVAR_LISP ("print-length", Vprint_length, doc: /* Maximum length of list to print before abbreviating. A value of nil means no limit. See also `eval-expression-print-length'. */); diff --git a/test/src/print-tests.el b/test/src/print-tests.el index eb9572dbdf..7b026b6b21 100644 --- a/test/src/print-tests.el +++ b/test/src/print-tests.el @@ -383,5 +383,25 @@ otherwise, use a different charset." (let ((print-length 1)) (format "%S" h)))))) +(print-tests--deftest print-integer-output-format () + ;; Bug#44155. + (let ((integer-output-format t) + (syms (list ?? ?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\ ?Á))) + (should (equal (read (print-tests--prin1-to-string syms)) syms)) + (should (equal (print-tests--prin1-to-string syms) + (concat "(" (mapconcat #'prin1-char syms " ") ")")))) + (let ((integer-output-format t) + (syms (list -1 0 1 ?\120 4194175 4194176 (max-char) (1+ (max-char))))) + (should (equal (read (print-tests--prin1-to-string syms)) syms))) + (let ((integer-output-format 16) + (syms (list -1 0 1 most-positive-fixnum (1+ most-positive-fixnum)))) + (should (equal (read (print-tests--prin1-to-string syms)) syms)) + (should (equal (print-tests--prin1-to-string syms) + (concat "(" (mapconcat + (lambda (i) + (if (and (>= i 0) (<= i most-positive-fixnum)) + (format "#x%x" i) (format "%d" i))) + syms " ") ")"))))) + (provide 'print-tests) ;;; print-tests.el ends here commit c307c9648d541338814fe541389ea8c7a1cf50a5 Author: Mauro Aranda Date: Fri Oct 30 11:13:34 2020 -0300 Give the scroll-bar face a non-trivial spec * lisp/faces.el (scroll-bar): Give it a non-trivial spec, so when resetting it to its face-defface-spec, we effectively reset it. (Bug#13476) diff --git a/lisp/faces.el b/lisp/faces.el index 0ce9532270..728f8b0fe6 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -2716,9 +2716,11 @@ used to display the prompt text." :group 'frames :group 'basic-faces) -(defface scroll-bar '((t nil)) +(defface scroll-bar + '((((background light)) :foreground "black") + (((background dark)) :foreground "white")) "Basic face for the scroll bar colors under X." - :version "21.1" + :version "28.1" :group 'frames :group 'basic-faces) commit 80a87af1357492b16a057c1f31d0e9a8b501d7d0 Author: Juri Linkov Date: Sat Oct 31 21:38:26 2020 +0200 Improve goto-line in regard to narrowed buffers (bug#44294) * lisp/simple.el (goto-line): Rewrite to first find the position of the line where to go, then later don't widen the buffer when the found position is still inside narrowed part of buffer. * lisp/isearch.el (isearch-message-prefix): Warn about narrowed buffer in case of no more matches found. diff --git a/lisp/isearch.el b/lisp/isearch.el index c3d5ff2d31..245bf452b1 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -3262,6 +3262,8 @@ the word mode." (< (point) isearch-opoint))) "over") (if isearch-wrapped "wrapped ") + (if (and (not isearch-success) (buffer-narrowed-p) widen-automatically) + "narrowed-buffer " "") (if (and (not isearch-success) (not isearch-case-fold-search)) "case-sensitive ") (let ((prefix "")) diff --git a/lisp/simple.el b/lisp/simple.el index d871be104c..e96c7c9a6e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1344,18 +1344,20 @@ rather than line counts." ;; Leave mark at previous position (or (region-active-p) (push-mark)) ;; Move to the specified line number in that buffer. - (if (and (not relative) (not widen-automatically)) - (save-restriction - (widen) - (goto-char (point-min)) - (if (eq selective-display t) - (re-search-forward "[\n\C-m]" nil 'end (1- line)) - (forward-line (1- line)))) - (unless relative (widen)) - (goto-char (point-min)) - (if (eq selective-display t) - (re-search-forward "[\n\C-m]" nil 'end (1- line)) - (forward-line (1- line))))) + (let ((pos (save-restriction + (unless relative (widen)) + (goto-char (point-min)) + (if (eq selective-display t) + (re-search-forward "[\n\C-m]" nil 'end (1- line)) + (forward-line (1- line))) + (point)))) + (when (and (not relative) + (buffer-narrowed-p) + widen-automatically + ;; Position is outside narrowed part of buffer + (or (> (point-min) pos) (> pos (point-max)))) + (widen)) + (goto-char pos))) (defun goto-line-relative (line &optional buffer) "Go to LINE, counting from line at (point-min). commit 71795c6c4a61817f60e001702ed01785d2da3faf Author: Juri Linkov Date: Sat Oct 31 21:33:33 2020 +0200 Reimplement commit 46b3db5579e57b9daf16667914205adc99d3f104 (bug#44294) * lisp/progmodes/etags.el (etags-goto-tag-location): Revert change from commit 46b3db5579e57b9daf16667914205adc99d3f104. (xref-location-marker): Use the same change as was made in elisp-mode.el in commit 46b3db5579e57b9daf16667914205adc99d3f104 to widen before going to the found position. diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 41ed317766..8879726ad5 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -1406,13 +1406,8 @@ hits the start of file." offset (* 3 offset))) ; expand search window (or found (re-search-forward pat nil t) - (if (and (buffer-narrowed-p) widen-automatically) - (progn - ;; Rerun after removing narrowing - (widen) - (etags-goto-tag-location tag-info)) - (user-error "Rerun etags: `%s' not found in %s" - pat buffer-file-name)))) + (user-error "Rerun etags: `%s' not found in %s" + pat buffer-file-name))) ;; Position point at the right place ;; if the search string matched an extra Ctrl-m at the beginning. (and (eq selective-display t) @@ -2140,8 +2135,10 @@ file name, add `tag-partial-file-name-match-p' to the list value.") (let ((buffer (find-file-noselect file))) (with-current-buffer buffer (save-excursion - (etags-goto-tag-location tag-info) - (point-marker)))))) + (save-restriction + (widen) + (etags-goto-tag-location tag-info) + (point-marker))))))) (cl-defmethod xref-location-line ((l xref-etags-location)) (with-slots (tag-info) l commit f9cac26dc1545ce7b79c68dc2294dfba8486c48b Author: Stefan Kangas Date: Sat Oct 31 20:26:54 2020 +0100 * test/README: Document TEST_BACKTRACE_LINE_LENGTH. diff --git a/test/README b/test/README index fe05b5403b..d0da89d1c2 100644 --- a/test/README +++ b/test/README @@ -81,6 +81,11 @@ Some tests might take long time to run. In order to summarize the make SUMMARIZE_TESTS= ... +The backtrace of failing tests are truncated to the default value of +'ert-batch-backtrace-right-margin'. To see more of the backtrace, use + + make TEST_BACKTRACE_LINE_LENGTH= ... + The tests are run in batch mode by default; sometimes it's useful to get precisely the same environment but run in interactive mode for debugging. To do that, use commit ca3b199ad536283e5775d2fc1bf2cbeb998e7907 Author: Amin Bandali Date: Sat Oct 31 14:39:36 2020 -0400 ; * etc/NEWS: Tweak the wording for the newly added entry diff --git a/etc/NEWS b/etc/NEWS index 1b663d2e5f..62cc814164 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -173,7 +173,7 @@ characters. Now it also covers the rest of the non-ASCII Unicode space characters. --- -** Replace irc.freenode.net with chat.freenode.net. +** Prefer chat.freenode.net to irc.freenode.net. chat.freenode.net has been the preferred address for connecting to the freenode IRC network for years now. Occurrences of irc.freenode.net have been replaced with chat.freenode.net throughout Emacs. commit ae9f234dd92b73a7f162b2fb9aa3af0836f6d503 Author: Amin Bandali Date: Sat Oct 31 14:29:13 2020 -0400 ; * etc/NEWS: Add entry for my last change diff --git a/etc/NEWS b/etc/NEWS index a52122bcea..1b663d2e5f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -172,6 +172,12 @@ Previously, this was limited only to NO-BREAK-SPACE and hyphen characters. Now it also covers the rest of the non-ASCII Unicode space characters. +--- +** Replace irc.freenode.net with chat.freenode.net. +chat.freenode.net has been the preferred address for connecting to the +freenode IRC network for years now. Occurrences of irc.freenode.net +have been replaced with chat.freenode.net throughout Emacs. + * Editing Changes in Emacs 28.1 commit 694c82ab1a89a0f473e5e619f256f23f9f3bc132 Author: Amin Bandali Date: Sat Oct 31 14:07:11 2020 -0400 Replace irc.freenode.net with chat.freenode.net chat.freenode.net has been the preferred address for connecting to the freenode IRC network for years now. Replace the occurrences of irc.freenode.net with chat.freenode.net. diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index a35225256b..cb2e83270e 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -140,12 +140,12 @@ out. @item Connect to Freenode -Run @kbd{M-x erc}. Use ``irc.freenode.net'' as the IRC server, ``6667'' -as the port, and choose a nickname. +Run @kbd{M-x erc}. Use ``chat.freenode.net'' as the IRC server, +``6667'' as the port, and choose a nickname. @item Get used to the interface -Switch to the ``irc.freenode.net:6667'' buffer, if you're not already +Switch to the ``chat.freenode.net:6667'' buffer, if you're not already there. You will see first some messages about checking for ident, and then a bunch of other messages that describe the current IRC server. @@ -162,9 +162,10 @@ channel. If you would like to be able to talk with people privately on the Freenode network, you will have to ``register'' your nickname. To do -so, switch to the ``irc.freenode.net:6667'' buffer and type ``/msg +so, switch to the ``chat.freenode.net:6667'' buffer and type ``/msg NickServ register '', replacing ``'' with your -desired password. It should tell you that the operation was successful. +desired password. It should tell you that the operation was +successful. @item Talk to people in the channel @@ -518,7 +519,7 @@ That is, if called with the following arguments, @var{server} and parameters. @example -(erc :server "irc.freenode.net" :full-name "Harry S Truman") +(erc :server "chat.freenode.net" :full-name "Harry S Truman") @end example @end defun @@ -694,7 +695,8 @@ stuff, to the current ERC buffer." ;; This causes ERC to connect to the Freenode network upon hitting ;; C-c e f. Replace MYNICK with your IRC nick. (global-set-key "\C-cef" (lambda () (interactive) - (erc :server "irc.freenode.net" :port "6667" + (erc :server "chat.freenode.net" + :port "6667" :nick "MYNICK"))) ;; This causes ERC to connect to the IRC server on your own machine (if @@ -718,7 +720,7 @@ stuff, to the current ERC buffer." (setq erc-autojoin-channels-alist '(("freenode.net" "#emacs" "#erc"))) ;; Rename server buffers to reflect the current network name instead -;; of SERVER:PORT (e.g., "freenode" instead of "irc.freenode.net:6667"). +;; of SERVER:PORT (e.g., "freenode" instead of "chat.freenode.net:6667"). ;; This is useful when using a bouncer like ZNC where you have multiple ;; connections to the same server. (setq erc-rename-buffers t) diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi index 6e2aedae71..adb812f572 100644 --- a/doc/misc/gnus-faq.texi +++ b/doc/misc/gnus-faq.texi @@ -2144,7 +2144,7 @@ I need real-time help, where to find it? @subsubheading Answer -Point your IRC client to irc.freenode.net, channel #gnus. +Point your IRC client to chat.freenode.net, channel #gnus. @node FAQ 9 - Tuning Gnus @subsection Tuning Gnus diff --git a/doc/misc/rcirc.texi b/doc/misc/rcirc.texi index 75f9cc63a2..2054ca5860 100644 --- a/doc/misc/rcirc.texi +++ b/doc/misc/rcirc.texi @@ -126,7 +126,7 @@ Here's a typical example: @cindex redirection to random servers When you connect to the Freenode network (@code{http://freenode.net/}), you point your IRC client at the -server @code{irc.freenode.net}. That server will redirect your client +server @code{chat.freenode.net}. That server will redirect your client to a random server on the network, such as @code{zelazny.freenode.net}. @cindex channel name @@ -176,7 +176,7 @@ using a different nick. This will prompt you for four things: What server do you want to connect to? All the servers in a particular network are equivalent. Some networks use a round-robin system where a single server redirects new connections to a random server in the -network. @code{irc.freenode.net} is such a server for the Freenode +network. @code{chat.freenode.net} is such a server for the Freenode network. Freenode provides the network ``for the Free and Open Source Software communities, for not-for-profit organizations and for related communities and organizations.'' @@ -211,7 +211,7 @@ Emacs, or join @code{#rcirc}, the channel about @code{rcirc}. @cindex server buffer When you have answered these questions, @code{rcirc} will create a server -buffer, which will be named something like @file{*irc.freenode.net*}, +buffer, which will be named something like @file{*chat.freenode.net*}, and a channel buffer for each of the channels you wanted to join. @kindex RET @@ -482,7 +482,7 @@ Here's an example of how to set it: @end example By default you will be connected to the @code{rcirc} support channel: -@code{#rcirc} on @code{irc.freenode.net}. +@code{#rcirc} on @code{chat.freenode.net}. @table @code @item :nick diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el index 309a78865d..d957fcee05 100644 --- a/lisp/erc/erc-networks.el +++ b/lisp/erc/erc-networks.el @@ -190,9 +190,9 @@ ("Fraggers: Random server" Fraggers "irc.fraggers.co.uk" ((6661 6669) (7000 7001) )) ("FreedomChat: Random server" FreedomChat "chat.freedomchat.net" 6667) ("FreedomIRC: Random server" FreedomIRC "irc.freedomirc.net" 6667) - ("Freenode: Random server" freenode "irc.freenode.net" 6667) - ("Freenode: Random EU server" freenode "irc.eu.freenode.net" 6667) - ("Freenode: Random US server" freenode "irc.us.freenode.net" 6667) + ("Freenode: Random server" freenode "chat.freenode.net" 6667) + ("Freenode: Random EU server" freenode "chat.eu.freenode.net" 6667) + ("Freenode: Random US server" freenode "chat.us.freenode.net" 6667) ("FunNet: Random server" FunNet "irc.funnet.org" 6667) ("Galaxynet: Random server" GalaxyNet "irc.galaxynet.org" ((6662 6668) 7000 )) ("Galaxynet: AU, NZ, Auckland" GalaxyNet "auckland.nz.galaxynet.org" ((6661 6669))) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 6481446ba5..e35ae0cfd8 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -1500,7 +1500,7 @@ Defaults to the server buffer." ;; activation -(defconst erc-default-server "irc.freenode.net" +(defconst erc-default-server "chat.freenode.net" "IRC server to use if it cannot be detected otherwise.") (defconst erc-default-port 6667 @@ -2244,7 +2244,7 @@ Non-interactively, it takes the keyword arguments That is, if called with - (erc :server \"irc.freenode.net\" :full-name \"Harry S Truman\") + (erc :server \"chat.freenode.net\" :full-name \"Harry S Truman\") then the server and full-name will be set to those values, whereas `erc-compute-port', `erc-compute-nick' and `erc-compute-full-name' will diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 3260b67a99..d611293546 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -10857,7 +10857,7 @@ Non-interactively, it takes the keyword arguments That is, if called with - (erc :server \"irc.freenode.net\" :full-name \"Harry S Truman\") + (erc :server \"chat.freenode.net\" :full-name \"Harry S Truman\") then the server and full-name will be set to those values, whereas `erc-compute-port', `erc-compute-nick' and `erc-compute-full-name' will diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index f296ae3afe..63e6eedb20 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -56,7 +56,7 @@ :group 'applications) (defcustom rcirc-server-alist - '(("irc.freenode.net" :channels ("#rcirc") + '(("chat.freenode.net" :channels ("#rcirc") ;; Don't use the TLS port by default, in case gnutls is not available. ;; :port 7000 :encryption tls )) commit 0ef5bbd5d4d633135224d69a9f1b8a8713be0a43 Author: Mattias Engdegård Date: Sat Oct 31 17:19:44 2020 +0100 Fix eshell glob modifiers Modified globbing such as *.txt(W) for all world-writable files ending in .txt apparently never worked correctly. * lisp/eshell/em-pred.el (eshell-predicate-alist): Use correct elisp syntax for octal constants. (eshell-pred-file-mode): Return a boolean, not a number. diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el index c26f654e27..59139da10d 100644 --- a/lisp/eshell/em-pred.el +++ b/lisp/eshell/em-pred.el @@ -73,18 +73,18 @@ ordinary strings." (?p . (eshell-pred-file-type ?p)) ; named pipes (?@ . (eshell-pred-file-type ?l)) ; symbolic links (?% . (eshell-pred-file-type ?%)) ; allow user to specify (c def.) - (?r . (eshell-pred-file-mode 0400)) ; owner-readable - (?w . (eshell-pred-file-mode 0200)) ; owner-writable - (?x . (eshell-pred-file-mode 0100)) ; owner-executable - (?A . (eshell-pred-file-mode 0040)) ; group-readable - (?I . (eshell-pred-file-mode 0020)) ; group-writable - (?E . (eshell-pred-file-mode 0010)) ; group-executable - (?R . (eshell-pred-file-mode 0004)) ; world-readable - (?W . (eshell-pred-file-mode 0002)) ; world-writable - (?X . (eshell-pred-file-mode 0001)) ; world-executable - (?s . (eshell-pred-file-mode 4000)) ; setuid - (?S . (eshell-pred-file-mode 2000)) ; setgid - (?t . (eshell-pred-file-mode 1000)) ; sticky bit + (?r . (eshell-pred-file-mode #o0400)) ; owner-readable + (?w . (eshell-pred-file-mode #o0200)) ; owner-writable + (?x . (eshell-pred-file-mode #o0100)) ; owner-executable + (?A . (eshell-pred-file-mode #o0040)) ; group-readable + (?I . (eshell-pred-file-mode #o0020)) ; group-writable + (?E . (eshell-pred-file-mode #o0010)) ; group-executable + (?R . (eshell-pred-file-mode #o0004)) ; world-readable + (?W . (eshell-pred-file-mode #o0002)) ; world-writable + (?X . (eshell-pred-file-mode #o0001)) ; world-executable + (?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)) @@ -478,7 +478,7 @@ that `ls -l' will show in the first column of its display." `(lambda (file) (let ((modes (file-modes file 'nofollow))) (if modes - (logand ,mode modes))))) + (not (zerop (logand ,mode modes))))))) (defun eshell-pred-file-links () "Return a predicate to test whether a file has a given number of links." commit 596802c06301c28c21563a221dec759c50b99db6 Author: Andreas Schwab Date: Sat Oct 31 16:30:04 2020 +0100 wdired: fix error handling of set-file-modes * lisp/wdired.el (wdired-perms-to-number): Return decimal number. (wdired-do-perm-changes): Handle error from set-file-modes. (wdired-finish-edit): Remove `rename' from error message. (Bug#44343) diff --git a/lisp/wdired.el b/lisp/wdired.el index da162b7bb2..bb32da3e3a 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -482,7 +482,7 @@ non-nil means return old filename." (when files-deleted (wdired-flag-for-deletion files-deleted)) (when (> errors 0) - (dired-log-summary (format "%d rename actions failed" errors) nil))) + (dired-log-summary (format "%d actions failed" errors) nil))) (set-buffer-modified-p nil) (setq buffer-undo-list nil)) @@ -911,26 +911,26 @@ Like original function but it skips read-only words." (mouse-set-point event) (wdired-toggle-bit)) -;; Allowed chars for 4000 bit are Ss in position 3 -;; Allowed chars for 2000 bit are Ssl in position 6 -;; Allowed chars for 1000 bit are Tt in position 9 +;; Allowed chars for #o4000 bit are Ss in position 3 +;; Allowed chars for #o2000 bit are Ssl in position 6 +;; Allowed chars for #o1000 bit are Tt in position 9 (defun wdired-perms-to-number (perms) - (let ((nperm 0777)) - (if (= (elt perms 1) ?-) (setq nperm (- nperm 400))) - (if (= (elt perms 2) ?-) (setq nperm (- nperm 200))) + (let ((nperm #o0777)) + (if (= (elt perms 1) ?-) (setq nperm (- nperm #o400))) + (if (= (elt perms 2) ?-) (setq nperm (- nperm #o200))) (let ((p-bit (elt perms 3))) - (if (memq p-bit '(?- ?S)) (setq nperm (- nperm 100))) - (if (memq p-bit '(?s ?S)) (setq nperm (+ nperm 4000)))) - (if (= (elt perms 4) ?-) (setq nperm (- nperm 40))) - (if (= (elt perms 5) ?-) (setq nperm (- nperm 20))) + (if (memq p-bit '(?- ?S)) (setq nperm (- nperm #o100))) + (if (memq p-bit '(?s ?S)) (setq nperm (+ nperm #o4000)))) + (if (= (elt perms 4) ?-) (setq nperm (- nperm #o40))) + (if (= (elt perms 5) ?-) (setq nperm (- nperm #o20))) (let ((p-bit (elt perms 6))) - (if (memq p-bit '(?- ?S ?l)) (setq nperm (- nperm 10))) - (if (memq p-bit '(?s ?S ?l)) (setq nperm (+ nperm 2000)))) + (if (memq p-bit '(?- ?S ?l)) (setq nperm (- nperm #o10))) + (if (memq p-bit '(?s ?S ?l)) (setq nperm (+ nperm #o2000)))) (if (= (elt perms 7) ?-) (setq nperm (- nperm 4))) (if (= (elt perms 8) ?-) (setq nperm (- nperm 2))) (let ((p-bit (elt perms 9))) (if (memq p-bit '(?- ?T)) (setq nperm (- nperm 1))) - (if (memq p-bit '(?t ?T)) (setq nperm (+ nperm 1000)))) + (if (memq p-bit '(?t ?T)) (setq nperm (+ nperm #o1000)))) nperm)) ;; Perform the changes in the permissions of the files that have @@ -940,7 +940,7 @@ Like original function but it skips read-only words." (errors 0) (prop-wanted (if (eq wdired-allow-to-change-permissions 'advanced) 'old-perm 'perm-changed)) - filename perms-ori perms-new perm-tmp) + filename perms-ori perms-new) (goto-char (next-single-property-change (point-min) prop-wanted nil (point-max))) (while (not (eobp)) @@ -951,14 +951,12 @@ Like original function but it skips read-only words." (setq changes t) (setq filename (wdired-get-filename nil t)) (if (= (length perms-new) 10) - (progn - (setq perm-tmp - (string-to-number - (int-to-string (wdired-perms-to-number perms-new)) 8)) - (unless (set-file-modes filename perm-tmp) - (setq errors (1+ errors)) - (dired-log "%s %s `%s' failed\n\n" - dired-chmod-program perm-tmp filename))) + (condition-case nil + (set-file-modes filename (wdired-perms-to-number perms-new)) + (error + (setq errors (1+ errors)) + (dired-log "Setting mode of `%s' to `%s' failed\n\n" + filename perms-new))) (setq errors (1+ errors)) (dired-log "Cannot parse permission `%s' for file `%s'\n\n" perms-new filename))) commit 283b8d274bd54192b3876ce8bf2930a096391839 Author: Eli Zaretskii Date: Sat Oct 31 16:05:03 2020 +0200 * etc/HELLO: Enlarge tab-width to account for "tofu". diff --git a/etc/HELLO b/etc/HELLO index 4db6bc8e5b..9ea7ebc2de 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -126,7 +126,7 @@ along with GNU Emacs. If not, see <. ;;; Local Variables: -;;; tab-width: 40 +;;; tab-width: 42 ;;; bidi-display-reordering: t ;;; coding: utf-8 ;;; inhibit-compacting-font-caches: t commit 0cbcc6223a75fee4af9211107ed392cb987c0a91 Author: Mattias Engdegård Date: Sat Oct 31 14:16:25 2020 +0100 'assoc' is not side-effect-free; constprop its pure subset Since a supplied test function can do anything, assoc is not side-effect-free (bug#44018). However, with only two arguments it is pure and should be optimised accordingly. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Remove 'assoc'. (byte-optimize-assoc): Constant-propagate through 2-arg assoc calls. * test/lisp/emacs-lisp/bytecomp-tests.el (byte-opt-testsuite-arith-data): Add test cases. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 65e4e44626..1dc83dd395 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -830,11 +830,13 @@ (defun byte-optimize-assoc (form) ;; Replace 2-argument `assoc' with `assq', `rassoc' with `rassq', ;; if the first arg is a symbol. - (if (and (= (length form) 3) - (byte-optimize--constant-symbol-p (nth 1 form))) - (cons (if (eq (car form) 'assoc) 'assq 'rassq) - (cdr form)) - form)) + (cond + ((/= (length form) 3) + form) + ((byte-optimize--constant-symbol-p (nth 1 form)) + (cons (if (eq (car form) 'assoc) 'assq 'rassq) + (cdr form))) + (t (byte-optimize-constant-args form)))) (defun byte-optimize-memq (form) ;; (memq foo '(bar)) => (and (eq foo 'bar) '(bar)) @@ -1144,7 +1146,7 @@ ;; I wonder if I missed any :-\) (let ((side-effect-free-fns '(% * + - / /= 1+ 1- < <= = > >= abs acos append aref ash asin atan - assoc assq + assq boundp buffer-file-name buffer-local-variables buffer-modified-p buffer-substring byte-code-function-p capitalize car-less-than-car car cdr ceiling char-after char-before diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index ea5aacd791..13cbedfe1f 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -365,7 +365,12 @@ '(((a b)) a b (c) (d))) (mapcar (lambda (x) (cond ((memq '(a b) x) 1) ((equal x '(c)) 2))) - '(((a b)) a b (c) (d)))) + '(((a b)) a b (c) (d))) + + (assoc 'b '((a 1) (b 2) (c 3))) + (assoc "b" '(("a" 1) ("b" 2) ("c" 3))) + (let ((x '((a 1) (b 2) (c 3)))) (assoc 'c x)) + (assoc 'a '((a 1) (b 2) (c 3)) (lambda (u v) (not (equal u v))))) "List of expression for test. Each element will be executed by interpreter and with bytecompiled code, and their results compared.") commit 8d72075aeb58e3b8eb91c78c4f51076d12d22263 Author: Eli Zaretskii Date: Sat Oct 31 15:20:18 2020 +0200 Improve support for displaying Javanese script * lisp/international/fontset.el (setup-default-fontset) (script-representative-chars): Add Javanese entries. * etc/HELLO: Fix the Javanese text. See https://omniglot.com/language/phrases/javanese.php for the source. diff --git a/etc/HELLO b/etc/HELLO index f3033dcafb..4db6bc8e5b 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -61,7 +61,7 @@ Hindi (हिंदी) नमस्ते / नमस्कार । Inuktitut (ᐃᓄᒃᑎᑐᑦ) ᐊᐃ Italian (italiano) Ciao / Buon giorno -Javanese (ꦧꦱꦗꦮ) console.log("ꦱꦸꦒꦼꦁꦱꦶꦪꦁ"); +Javanese (ꦧꦱꦗꦮꦶ) console.log("ꦲꦭꦺꦴ"); Kannada (ಕನ್ನಡ) ನಮಸ್ಕಾರ Khmer (ភាសាខ្មែរ) ជំរាបសួរ Lao (ພາສາລາວ) ສະບາຍດີ / ຂໍໃຫ້ໂຊກດີ diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index 23abb0d0a9..a52b6283c3 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -191,6 +191,7 @@ (kanbun #x319D) (han #x5B57) (yi #xA288) + (javanese #xA980) (cham #xAA00) (tai-viet #xAA80) (hangul #xAC00) @@ -723,6 +724,7 @@ symbol braille yi + javanese tai-viet aegean-number ancient-greek-number commit 7103192cd2b0434c7acf712d0b7cf5a2f7b19e75 Author: Stefan Monnier Date: Sat Oct 31 09:07:53 2020 -0400 * src/xdisp.c (syms_of_xdisp) <"scroll-minibuffer-conservatively">: New var Fix bug#44070, which causes the minibuffer display to jump upon minor edit (redisplay_window): Obey it. * lisp/simple.el (end-of-buffer): Obey it. * test/src/xdisp-tests.el (xdisp-tests--in-minibuffer): New macro, extracted from `xdisp-tests--minibuffer-resizing`. (xdisp-tests--minibuffer-resizing): Use it. (xdisp-tests--minibuffer-scroll): New test. diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index 02859d522e..7dadb0966f 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -244,6 +244,7 @@ point vertically in the window, but there are several ways to alter this behavior. @vindex scroll-conservatively +@vindex scroll-minibuffer-conservatively If you set @code{scroll-conservatively} to a small number @var{n}, then moving point just a little off the screen (no more than @var{n} lines) causes Emacs to scroll just enough to bring point back on @@ -255,6 +256,9 @@ moves; Emacs always scrolls text just enough to bring point into view, either at the top or bottom of the window depending on the scroll direction. By default, @code{scroll-conservatively} is@tie{}0, which means to always center point in the window. +This said, in minibuffer windows, scrolling is always conservative by +default because @code{scroll-minibuffer-conservatively} is non-nil, +which takes precedence over @code{scroll-conservatively}. @vindex scroll-step Another way to control automatic scrolling is to customize the diff --git a/etc/NEWS b/etc/NEWS index 4435d0563b..a52122bcea 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -85,6 +85,9 @@ useful on systems such as FreeBSD which ships only with "etc/termcap". * Changes in Emacs 28.1 +** Minibuffer scrolling is now conservative by default. +This is controlled by the new variable 'scroll-minibuffer-conservatively'. + +++ ** New system for displaying documentation for groups of function. This can either be used by saying 'M-x shortdoc-display-group' and diff --git a/lisp/simple.el b/lisp/simple.el index a9d79d031e..d871be104c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1134,7 +1134,11 @@ is supplied, or Transient Mark mode is enabled and the mark is active." ;; If the end of the buffer is not already on the screen, ;; then scroll specially to put it near, but not at, the bottom. (overlay-recenter (point)) - (recenter -3)))) + ;; FIXME: Arguably if `scroll-conservatively' is set, then + ;; we should pass -1 to `recenter'. + (recenter (if (and scroll-minibuffer-conservatively + (window-minibuffer-p)) + -1 -3))))) (defcustom delete-active-region t "Whether single-char deletion commands delete an active region. diff --git a/src/xdisp.c b/src/xdisp.c index 0e5dffbe00..cc499f3326 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -18820,6 +18820,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) /* Try to scroll by specified few lines. */ if ((0 < scroll_conservatively + || (scroll_minibuffer_conservatively && MINI_WINDOW_P (w)) || 0 < emacs_scroll_step || temp_scroll_step || NUMBERP (BVAR (current_buffer, scroll_up_aggressively)) @@ -18830,7 +18831,10 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) /* The function returns -1 if new fonts were loaded, 1 if successful, 0 if not successful. */ int ss = try_scrolling (window, just_this_one_p, - scroll_conservatively, + ((scroll_minibuffer_conservatively + && MINI_WINDOW_P (w)) + ? SCROLL_LIMIT + 1 + : scroll_conservatively), emacs_scroll_step, temp_scroll_step, last_line_misfit); switch (ss) @@ -34538,7 +34542,14 @@ syms_of_xdisp (void) DEFSYM (Qredisplay_internal_xC_functionx, "redisplay_internal (C function)"); - DEFVAR_BOOL("inhibit-message", inhibit_message, + DEFVAR_BOOL ("scroll-minibuffer-conservatively", + scroll_minibuffer_conservatively, + doc: /* Non-nil means scroll conservatively in minibuffer windows. +When the value is nil, scrolling in minibuffer windows obeys the +settings of `scroll-conservatively'. */); + scroll_minibuffer_conservatively = true; /* bug#44070 */ + + DEFVAR_BOOL ("inhibit-message", inhibit_message, doc: /* Non-nil means calls to `message' are not displayed. They are still logged to the *Messages* buffer. @@ -34546,7 +34557,7 @@ Do NOT set this globally to a non-nil value, as doing that will disable messages everywhere, including in I-search and other places where they are necessary. This variable is intended to be let-bound around code that needs to disable messages temporarily. */); - inhibit_message = 0; + inhibit_message = false; message_dolog_marker1 = Fmake_marker (); staticpro (&message_dolog_marker1); diff --git a/test/src/xdisp-tests.el b/test/src/xdisp-tests.el index 95c39dacc3..fad90fad53 100644 --- a/test/src/xdisp-tests.el +++ b/test/src/xdisp-tests.el @@ -21,34 +21,55 @@ (require 'ert) +(defmacro xdisp-tests--in-minibuffer (&rest body) + (declare (debug t) (indent 0)) + `(catch 'result + (minibuffer-with-setup-hook + (lambda () + (let ((redisplay-skip-initial-frame nil) + (executing-kbd-macro nil)) ;Don't skip redisplay + (throw 'result (progn . ,body)))) + (let ((executing-kbd-macro t)) ;Force real minibuffer in `read-string'. + (read-string "toto: "))))) + (ert-deftest xdisp-tests--minibuffer-resizing () ;; bug#43519 - ;; FIXME: This test returns success when run in batch but - ;; it's only a lucky accident: it also returned success - ;; when bug#43519 was not fixed. (should (equal t - (catch 'result - (minibuffer-with-setup-hook - (lambda () - (insert "hello") - (let ((ol (make-overlay (point) (point))) - (redisplay-skip-initial-frame nil) - (max-mini-window-height 1) - (text "askdjfhaklsjdfhlkasjdfhklasdhflkasdhflkajsdhflkashdfkljahsdlfkjahsdlfkjhasldkfhalskdjfhalskdfhlaksdhfklasdhflkasdhflkasdhflkajsdhklajsdgh")) - ;; (save-excursion (insert text)) - ;; (sit-for 2) - ;; (delete-region (point) (point-max)) - (put-text-property 0 1 'cursor t text) - (overlay-put ol 'after-string text) - (let ((executing-kbd-macro nil)) ;Don't skip redisplay - (redisplay 'force)) - (throw 'result - ;; Make sure we do the see "hello" text. - (prog1 (equal (window-start) (point-min)) - ;; (list (window-start) (window-end) (window-width)) - (delete-overlay ol))))) - (let ((executing-kbd-macro t)) ;Force real minibuffer in `read-string'. - (read-string "toto: "))))))) + (xdisp-tests--in-minibuffer + (insert "hello") + (let ((ol (make-overlay (point) (point))) + (max-mini-window-height 1) + (text "askdjfhaklsjdfhlkasjdfhklasdhflkasdhflkajsdhflkashdfkljahsdlfkjahsdlfkjhasldkfhalskdjfhalskdfhlaksdhfklasdhflkasdhflkasdhflkajsdhklajsdgh")) + ;; (save-excursion (insert text)) + ;; (sit-for 2) + ;; (delete-region (point) (point-max)) + (put-text-property 0 1 'cursor t text) + (overlay-put ol 'after-string text) + (redisplay 'force) + ;; Make sure we do the see "hello" text. + (prog1 (equal (window-start) (point-min)) + ;; (list (window-start) (window-end) (window-width)) + (delete-overlay ol))))))) + +(ert-deftest xdisp-tests--minibuffer-scroll () ;; bug#44070 + (let ((posns + (xdisp-tests--in-minibuffer + (let ((max-mini-window-height 4)) + (dotimes (_ 80) (insert "\nhello")) + (beginning-of-buffer) + (redisplay 'force) + (end-of-buffer) + ;; A simple edit like removing the last `o' shouldn't cause + ;; the rest of the minibuffer's text to move. + (list + (progn (redisplay 'force) (window-start)) + (progn (delete-char -1) + (redisplay 'force) (window-start)) + (progn (goto-char (point-min)) (redisplay 'force) + (goto-char (point-max)) (redisplay 'force) + (window-start))))))) + (should (equal (nth 0 posns) (nth 1 posns))) + (should (equal (nth 1 posns) (nth 2 posns))))) ;;; xdisp-tests.el ends here commit c3a20804a81826ec091a4a096c1987a61e412580 Author: Mattias Engdegård Date: Sat Oct 31 11:35:06 2020 +0100 Trim and explain set of safe forms for 'unsafep' (bug#44018) * lisp/emacs-lisp/unsafep.el: Add comment explaining the policy for which forms can be considered 'safe' in the sense of unsafep. Remove ones that didn't make the cut: play-sound-file (large attack surface) catch, throw (alter program flow, inject data) replace-regexp-in-string (execute arbitary code) error, signal (deceptive messages) * test/lisp/emacs-lisp/unsafep-tests.el (unsafep-tests--unsafe): Add test cases. * etc/NEWS: Announce the change. diff --git a/etc/NEWS b/etc/NEWS index 4cc66aef6b..4435d0563b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1835,6 +1835,11 @@ file can affect code in another. For details, see the manual section --- ** 'unload-feature' now also tries to undo additions to buffer-local hooks. +--- +** Some functions are no longer considered safe by 'unsafep': +'replace-regexp-in-string', 'catch', 'throw', 'error', 'signal' +and 'play-sound-file'. + * Changes in Emacs 28.1 on Non-Free Operating Systems diff --git a/lisp/emacs-lisp/unsafep.el b/lisp/emacs-lisp/unsafep.el index e7077140e5..c4db86a0db 100644 --- a/lisp/emacs-lisp/unsafep.el +++ b/lisp/emacs-lisp/unsafep.el @@ -91,17 +91,41 @@ in the parse.") (put 'unsafep-vars 'risky-local-variable t) -;;Other safe functions +;; Other safe forms. +;; +;; A function, macro or special form may be put here only if all of +;; the following statements are true: +;; +;; * It is not already marked `pure' or `side-effect-free', or handled +;; explicitly by `unsafep'. +;; +;; * It is not inherently unsafe; eg, would allow the execution of +;; arbitrary code, interact with the file system, network or other +;; processes, or otherwise exfiltrate information from the running +;; Emacs process or manipulate the user's environment. +;; +;; * It does not have side-effects that can make other code behave in +;; unsafe and/or unexpected ways; eg, set variables, mutate data, or +;; change control flow. +;; Any side effect must be innocuous; altering the match data is +;; explicitly permitted. +;; +;; * It does not allow Emacs to behave deceptively to the user; eg, +;; display arbitrary messages. +;; +;; * It does not present a potentially large attack surface; eg, +;; play arbitrary audio files. + (dolist (x '(;;Special forms - and catch if or prog1 prog2 progn while unwind-protect + and if or prog1 prog2 progn while unwind-protect ;;Safe subrs that have some side-effects - ding error random signal sleep-for string-match throw + ding random sleep-for string-match ;;Defsubst functions from subr.el caar cadr cdar cddr ;;Macros from subr.el save-match-data unless when ;;Functions from subr.el that have side effects - split-string replace-regexp-in-string play-sound-file)) + split-string)) (put x 'safe-function t)) ;;;###autoload diff --git a/test/lisp/emacs-lisp/unsafep-tests.el b/test/lisp/emacs-lisp/unsafep-tests.el index dde0e0201d..06c40d28ca 100644 --- a/test/lisp/emacs-lisp/unsafep-tests.el +++ b/test/lisp/emacs-lisp/unsafep-tests.el @@ -105,6 +105,18 @@ . (variable (x))) ( (let (1) 2) . (variable 1)) + ( (error "asdf") + . #'error) + ( (signal 'error "asdf") + . #'signal) + ( (throw 'asdf) + . #'throw) + ( (catch 'asdf 17) + . #'catch) + ( (play-sound-file "asdf") + . #'play-sound-file) + ( (replace-regexp-in-string "a" "b") + . #'replace-regexp-in-string) ) "A-list of (FORM . REASON)... that `unsafep' should decide are unsafe.") commit a78c6141bc1a34622894af3cee45f350e3b629ac Author: Mattias Engdegård Date: Sun Oct 25 12:40:36 2020 +0100 Parse GDB/MI results directly instead of going via JSON (bug#44173) Translating GDB/MI into JSON is an unnecessary and fragile detour that made it hard to deal with octal escapes in strings correctly. Parse GDB/MI directly instead. * lisp/progmodes/gdb-mi.el (gdb-mi-decode-strings): Adjust doc string. (gdb-mi-decode, gud-gdbmi-marker-filter): Remove gdb-mi-decode. (gdb-jsonify-buffer): Remove. (gdb-mi--parse-tuple-or-list, gdb-mi--parse-c-string) (gdb-mi--parse-value, gdb-mi--parse-result-or-value) (gdb-mi--parse-results, gdb-mi--fix-key, gdb-mi--extend-fullname) (gdb-mi--c-string-from-string): New functions. (gdb-json-read-buffer, gdb-json-string, gdb-json-partial-output): Rename to gdb-mi--read-buffer, gdb-mi--from-string and gdb-mi--partial-output respectively. Remove useless FIX-LIST argument. FIX-KEY is now a symbol, not a string. All callers updated. (gdb-tooltip-print, gdbmi-bnf-log-stream-output, gdb-internals) (gdb-console, gdb-done-or-error, gdb-get-source-file-list) (gdb-get-prompt, gdb-get-source-file): Use gdb-mi--c-string-from-string instead of 'read'. * test/lisp/progmodes/gdb-mi-tests.el: New file. diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 8ff094ffe8..4bebf88d35 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -89,7 +89,6 @@ ;;; Code: (require 'gud) -(require 'json) (require 'cl-lib) (require 'cl-seq) (eval-when-compile (require 'pcase)) @@ -166,7 +165,7 @@ May be manually changed by user with `gdb-select-frame'.") "Associative list of threads provided by \"-thread-info\" MI command. Keys are thread numbers (in strings) and values are structures as -returned from -thread-info by `gdb-json-partial-output'. Updated in +returned from -thread-info by `gdb-mi--partial-output'. Updated in `gdb-thread-list-handler-custom'.") (defvar gdb-running-threads-count nil @@ -185,7 +184,7 @@ See also `gdb-running-threads-count'.") "Associative list of breakpoints provided by \"-break-list\" MI command. Keys are breakpoint numbers (in string) and values are structures -as returned from \"-break-list\" by `gdb-json-partial-output' +as returned from \"-break-list\" by `gdb-mi--partial-output' \(\"body\" field is used). Updated in `gdb-breakpoints-list-handler-custom'.") @@ -1124,11 +1123,11 @@ no input, and GDB is waiting for input." "\\)") nil t) (tooltip-show - (concat expr " = " (read (match-string 1))) + (concat expr " = " (gdb-mi--c-string-from-string (match-string 1))) (or gud-tooltip-echo-area (not (display-graphic-p))))) ((re-search-forward "msg=\\(\".+\"\\)$" nil t) - (tooltip-show (read (match-string 1)) + (tooltip-show (gdb-mi--c-string-from-string (match-string 1)) (or gud-tooltip-echo-area (not (display-graphic-p)))))))) @@ -1268,7 +1267,7 @@ With arg, enter name of variable to be watched in the minibuffer." (cdr (assq field value))) (defun gdb-var-create-handler (expr) - (let* ((result (gdb-json-partial-output))) + (let* ((result (gdb-mi--partial-output))) (if (not (gdb-mi--field result 'msg)) (let ((var (list (gdb-mi--field result 'name) @@ -1309,7 +1308,7 @@ With arg, enter name of variable to be watched in the minibuffer." (defun gdb-var-list-children-handler (varnum) (let* ((var-list nil) - (output (gdb-json-partial-output 'child)) + (output (gdb-mi--partial-output 'child)) (children (gdb-mi--field output 'children))) (catch 'child-already-watched (dolist (var gdb-var-list) @@ -1384,7 +1383,7 @@ With arg, enter name of variable to be watched in the minibuffer." 'gdb-var-update)) (defun gdb-var-update-handler () - (let ((changelist (gdb-mi--field (gdb-json-partial-output) 'changelist))) + (let ((changelist (gdb-mi--field (gdb-mi--partial-output) 'changelist))) (dolist (var gdb-var-list) (setcar (nthcdr 5 var) nil)) (let ((temp-var-list gdb-var-list)) @@ -2306,7 +2305,8 @@ a GDB/MI reply message." ;; Suppress "No registers." GDB 6.8 and earlier ;; duplicates MI error message on internal stream. ;; Don't print to GUD buffer. - (if (not (string-equal (read c-string) "No registers.\n")) + (if (not (string-equal (gdb-mi--c-string-from-string c-string) + "No registers.\n")) (gdb-internals c-string))) @@ -2428,7 +2428,7 @@ the end of the current result or async record is reached." is-complete))) -; The following grammar rules are not yet implemented by this GDBMI-BNF parser. +; The following grammar rules are not parsed directly by this GDBMI-BNF parser. ; The handling of those rules is currently done by the handlers registered ; in gdbmi-bnf-result-state-configs ; @@ -2450,19 +2450,17 @@ the end of the current result or async record is reached." ; list ==> ; "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]" +;; FIXME: This is fragile: it relies on the assumption that all the +;; non-ASCII strings output by GDB, including names of the source +;; files, values of string variables in the inferior, etc., are all +;; encoded in the same encoding. + (defcustom gdb-mi-decode-strings nil "When non-nil, decode octal escapes in GDB output into non-ASCII text. If the value is a coding-system, use that coding-system to decode the bytes reconstructed from octal escapes. Any other non-nil value -means to decode using the coding-system set for the GDB process. - -Warning: setting this non-nil might mangle strings reported by GDB -that have literal substrings which match the \\nnn octal escape -patterns, where nnn is an octal number between 200 and 377. So -we only recommend to set this variable non-nil if the program you -are debugging really reports non-ASCII text, or some of its source -file names include non-ASCII characters." +means to decode using the coding-system set for the GDB process." :type '(choice (const :tag "Don't decode" nil) (const :tag "Decode using default coding-system" t) @@ -2470,47 +2468,9 @@ file names include non-ASCII characters." :group 'gdb :version "25.1") -;; The idea of the following function was suggested -;; by Kenichi Handa . -;; -;; FIXME: This is fragile: it relies on the assumption that all the -;; non-ASCII strings output by GDB, including names of the source -;; files, values of string variables in the inferior, etc., are all -;; encoded in the same encoding. It also assumes that the \nnn -;; sequences are not split between chunks of output of the GDB process -;; due to buffering, and arrive together. Finally, if some string -;; included literal \nnn strings (as opposed to non-ASCII characters -;; converted by GDB/MI to octal escapes), this decoding will mangle -;; those strings. When/if GDB acquires the ability to not -;; escape-protect non-ASCII characters in its MI output, this kludge -;; should be removed. -(defun gdb-mi-decode (string) - "Decode octal escapes in MI output STRING into multibyte text." - (let ((coding - (if (coding-system-p gdb-mi-decode-strings) - gdb-mi-decode-strings - (with-current-buffer - (gdb-get-buffer-create 'gdb-partial-output-buffer) - buffer-file-coding-system)))) - (with-temp-buffer - (set-buffer-multibyte nil) - (prin1 string (current-buffer)) - (goto-char (point-min)) - ;; prin1 quotes the octal escapes as well, which interferes with - ;; their interpretation by 'read' below. Remove the extra - ;; backslashes to countermand that. - (while (re-search-forward "\\\\\\(\\\\[2-3][0-7][0-7]\\)" nil t) - (replace-match "\\1" nil nil)) - (goto-char (point-min)) - (decode-coding-string (read (current-buffer)) coding)))) - (defun gud-gdbmi-marker-filter (string) "Filter GDB/MI output." - ;; If required, decode non-ASCII text encoded with octal escapes. - (or (null gdb-mi-decode-strings) - (setq string (gdb-mi-decode string))) - ;; Record transactions if logging is enabled. (when gdb-enable-debug (push (cons 'recv string) gdb-debug-log) @@ -2557,7 +2517,7 @@ file names include non-ASCII characters." (defun gdb-thread-exited (_token output-field) "Handle =thread-exited async record. Unset `gdb-thread-number' if current thread exited and update threads list." - (let* ((thread-id (gdb-mi--field (gdb-json-string output-field) 'id))) + (let* ((thread-id (gdb-mi--field (gdb-mi--from-string output-field) 'id))) (if (string= gdb-thread-number thread-id) (gdb-setq-thread-number nil)) ;; When we continue current thread and it quickly exits, @@ -2571,7 +2531,7 @@ Unset `gdb-thread-number' if current thread exited and update threads list." "Handler for =thread-selected MI output record. Sets `gdb-thread-number' to new id." - (let* ((result (gdb-json-string output-field)) + (let* ((result (gdb-mi--from-string output-field)) (thread-id (gdb-mi--field result 'id))) (gdb-setq-thread-number thread-id) ;; Typing `thread N' in GUD buffer makes GDB emit `^done' followed @@ -2587,7 +2547,7 @@ Sets `gdb-thread-number' to new id." (defun gdb-running (_token output-field) (let* ((thread-id - (gdb-mi--field (gdb-json-string output-field) 'thread-id))) + (gdb-mi--field (gdb-mi--from-string output-field) 'thread-id))) ;; We reset gdb-frame-number to nil if current thread has gone ;; running. This can't be done in gdb-thread-list-handler-custom ;; because we need correct gdb-frame-number by the time @@ -2616,7 +2576,7 @@ Sets `gdb-thread-number' to new id." "Given the contents of *stopped MI async record, select new current thread and update GDB buffers." ;; Reason is available with target-async only - (let* ((result (gdb-json-string output-field)) + (let* ((result (gdb-mi--from-string output-field)) (reason (gdb-mi--field result 'reason)) (thread-id (gdb-mi--field result 'thread-id)) (retval (gdb-mi--field result 'return-value)) @@ -2696,7 +2656,7 @@ current thread and update GDB buffers." (if (string= output-field "\"\\n\"") "" (let ((error-message - (read output-field))) + (gdb-mi--c-string-from-string output-field))) (put-text-property 0 (length error-message) 'face font-lock-warning-face @@ -2707,7 +2667,8 @@ current thread and update GDB buffers." ;; (frontend MI commands should not print to this stream) (defun gdb-console (output-field) (setq gdb-filter-output - (gdb-concat-output gdb-filter-output (read output-field)))) + (gdb-concat-output gdb-filter-output + (gdb-mi--c-string-from-string output-field)))) (defun gdb-done (token-number output-field is-complete) (gdb-done-or-error token-number 'done output-field is-complete)) @@ -2724,7 +2685,8 @@ current thread and update GDB buffers." ;; MI error - send to minibuffer (when (eq type 'error) ;; Skip "msg=" from `output-field' - (message "%s" (read (substring output-field 4))) + (message "%s" (gdb-mi--c-string-from-string + (substring output-field 4))) ;; Don't send to the console twice. (If it is a console error ;; it is also in the console stream.) (setq output-field nil))) @@ -2772,83 +2734,154 @@ current thread and update GDB buffers." (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer) (erase-buffer))) -(defun gdb-jsonify-buffer (&optional fix-key fix-list) - "Prepare GDB/MI output in current buffer for parsing with `json-read'. - -Field names are wrapped in double quotes and equal signs are -replaced with semicolons. - -If FIX-KEY is non-nil, strip all \"FIX-KEY=\" occurrences from -partial output. This is used to get rid of useless keys in lists -in MI messages, e.g.: [key=.., key=..]. -stack-list-frames and --break-info are examples of MI commands which issue such -responses. - -If FIX-LIST is non-nil, \"FIX-LIST={..}\" is replaced with -\"FIX-LIST=[..]\" prior to parsing. This is used to fix broken --break-info output when it contains breakpoint script field -incompatible with GDB/MI output syntax. +;; Parse GDB/MI result records: this process converts +;; list [...] -> list +;; tuple {...} -> list +;; result KEY=VALUE -> (KEY . VALUE) where KEY is a symbol +;; c-string "..." -> string + +(defun gdb-mi--parse-tuple-or-list (end-char) + "Parse a tuple or list, either returned as a Lisp list. +END-CHAR is the ending delimiter; will stop at end-of-buffer otherwise." + (let ((items nil)) + (while (not (or (eobp) + (eq (following-char) end-char))) + (let ((item (gdb-mi--parse-result-or-value))) + (push item items) + (when (eq (following-char) ?,) + (forward-char)))) + (when (eq (following-char) end-char) + (forward-char)) + (nreverse items))) + +(defun gdb-mi--parse-c-string () + "Parse a c-string." + (let ((start (point)) + (pieces nil) + (octals-used nil)) + (while (and (re-search-forward (rx (or ?\\ ?\"))) + (not (eq (preceding-char) ?\"))) + (push (buffer-substring start (1- (point))) pieces) + (cond + ((looking-at (rx (any "0-7") (? (any "0-7") (? (any "0-7"))))) + (push (unibyte-string (string-to-number (match-string 0) 8)) pieces) + (setq octals-used t) + (goto-char (match-end 0))) + ((looking-at (rx (any "ntrvfab\"\\"))) + (push (cdr (assq (following-char) + '((?n . "\n") + (?t . "\t") + (?r . "\r") + (?v . "\v") + (?f . "\f") + (?a . "\a") + (?b . "\b") + (?\" . "\"") + (?\\ . "\\")))) + pieces) + (forward-char)) + (t + (warn "Unrecognised escape char: %c" (following-char)))) + (setq start (point))) + (push (buffer-substring start (1- (point))) pieces) + (let ((s (apply #'concat (nreverse pieces)))) + (if (and octals-used gdb-mi-decode-strings) + (let ((coding + (if (coding-system-p gdb-mi-decode-strings) + gdb-mi-decode-strings + (buffer-local-value + 'buffer-file-coding-system + ;; FIXME: This is somewhat expensive. + (gdb-get-buffer-create 'gdb-partial-output-buffer))))) + (decode-coding-string s coding)) + s)))) + +;; FIXME: Ideally this function should not be needed. +(defun gdb-mi--c-string-from-string (string) + "Parse a c-string from (the beginning of) STRING." + (with-temp-buffer + (insert string) + (goto-char (1+ (point-min))) ; Skip leading double quote. + (gdb-mi--parse-c-string))) -If `default-directory' is remote, full file names are adapted accordingly." - (save-excursion +(defun gdb-mi--parse-value () + "Parse a value." + (cond + ((eq (following-char) ?\{) + (forward-char) + (gdb-mi--parse-tuple-or-list ?\})) + ((eq (following-char) ?\[) + (forward-char) + (gdb-mi--parse-tuple-or-list ?\])) + ((eq (following-char) ?\") + (forward-char) + (gdb-mi--parse-c-string)) + (t (error "Bad start of result or value: %c" (following-char))))) + +(defun gdb-mi--parse-result-or-value () + "Parse a result (key=value) or value." + (if (looking-at (rx (group (+ (any "a-zA-Z" ?_ ?-))) "=")) + (progn + (goto-char (match-end 0)) + (let* ((variable (intern (match-string 1))) + (value (gdb-mi--parse-value))) + (cons variable value))) + (gdb-mi--parse-value))) + +(defun gdb-mi--parse-results () + "Parse zero or more result productions as a list." + (gdb-mi--parse-tuple-or-list nil)) + +(defun gdb-mi--fix-key (key value) + "Convert any result (key-value pair) in VALUE whose key is KEY to its value." + (cond + ((atom value) value) + ((symbolp (car value)) + (if (eq (car value) key) + (cdr value) + (cons (car value) (gdb-mi--fix-key key (cdr value))))) + (t (mapcar (lambda (x) (gdb-mi--fix-key key x)) value)))) + +(defun gdb-mi--extend-fullname (remote value) + "Prepend REMOTE to any result string with `fullname' as the key in VALUE." + (cond + ((atom value) value) + ((symbolp (car value)) + (if (and (eq (car value) 'fullname) + (stringp (cdr value))) + (cons 'fullname (concat remote (cdr value))) + (cons (car value) (gdb-mi--extend-fullname remote (cdr value))))) + (t (mapcar (lambda (x) (gdb-mi--extend-fullname remote x)) value)))) + +(defun gdb-mi--read-buffer (fix-key) + "Parse the current buffer as a list of result productions. +If FIX-KEY is a non-nil symbol, convert all FIX-KEY=VALUE results into VALUE. +This is used to get rid of useless keys in lists in MI messages; +eg, [key=.., key=..]. -stack-list-frames and -break-info are +examples of MI commands which issue such responses." + (goto-char (point-min)) + (let ((results (gdb-mi--parse-results))) (let ((remote (file-remote-p default-directory))) (when remote - (goto-char (point-min)) - (while (re-search-forward "[\\[,]fullname=\"\\(.+\\)\"" nil t) - (replace-match (concat remote "\\1") nil nil nil 1)))) - (goto-char (point-min)) + (setq results (gdb-mi--extend-fullname remote results)))) (when fix-key - (save-excursion - (while (re-search-forward (concat "[\\[,]\\(" fix-key "=\\)") nil t) - (replace-match "" nil nil nil 1)))) - (when fix-list - (save-excursion - ;; Find positions of braces which enclose broken list - (while (re-search-forward (concat fix-list "={\"") nil t) - (let ((p1 (goto-char (- (point) 2))) - (p2 (progn (forward-sexp) - (1- (point))))) - ;; Replace braces with brackets - (save-excursion - (goto-char p1) - (delete-char 1) - (insert "[") - (goto-char p2) - (delete-char 1) - (insert "]")))))) - (goto-char (point-min)) - (insert "{") - (let ((re (concat "\\([[:alnum:]_-]+\\)="))) - (while (re-search-forward re nil t) - (replace-match "\"\\1\":" nil nil) - (if (eq (char-after) ?\") (forward-sexp) (forward-char)))) - (goto-char (point-max)) - (insert "}"))) - -(defun gdb-json-read-buffer (&optional fix-key fix-list) - "Prepare and parse GDB/MI output in current buffer with `json-read'. - -FIX-KEY and FIX-LIST work as in `gdb-jsonify-buffer'." - (gdb-jsonify-buffer fix-key fix-list) - (save-excursion - (goto-char (point-min)) - (let ((json-array-type 'list)) - (json-read)))) + (setq results (gdb-mi--fix-key fix-key results))) + results)) -(defun gdb-json-string (string &optional fix-key fix-list) - "Prepare and parse STRING containing GDB/MI output with `json-read'. +(defun gdb-mi--from-string (string &optional fix-key) + "Prepare and parse STRING containing GDB/MI output. -FIX-KEY and FIX-LIST work as in `gdb-jsonify-buffer'." +FIX-KEY works as in `gdb-mi--read-buffer'." (with-temp-buffer (insert string) - (gdb-json-read-buffer fix-key fix-list))) + (gdb-mi--read-buffer fix-key))) -(defun gdb-json-partial-output (&optional fix-key fix-list) - "Prepare and parse gdb-partial-output-buffer with `json-read'. +(defun gdb-mi--partial-output (&optional fix-key) + "Prepare and parse gdb-partial-output-buffer. -FIX-KEY and FIX-KEY work as in `gdb-jsonify-buffer'." +FIX-KEY works as in `gdb-mi--read-buffer'." (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer) - (gdb-json-read-buffer fix-key fix-list))) + (gdb-mi--read-buffer fix-key))) (defun gdb-line-posns (line) "Return a pair of LINE beginning and end positions." @@ -3017,7 +3050,7 @@ See `def-gdb-auto-update-handler'." (defun gdb-breakpoints-list-handler-custom () (let ((breakpoints-list (gdb-mi--field - (gdb-mi--field (gdb-json-partial-output 'bkpt) + (gdb-mi--field (gdb-mi--partial-output 'bkpt) 'BreakpointTable) 'body)) (table (make-gdb-table))) @@ -3340,7 +3373,7 @@ corresponding to the mode line clicked." 'gdb-invalidate-threads) (defun gdb-thread-list-handler-custom () - (let ((threads-list (gdb-mi--field (gdb-json-partial-output) 'threads)) + (let ((threads-list (gdb-mi--field (gdb-mi--partial-output) 'threads)) (table (make-gdb-table)) (marked-line nil)) (setq gdb-threads-list nil) @@ -3581,7 +3614,7 @@ in `gdb-memory-format'." (error "Unknown format")))) (defun gdb-read-memory-custom () - (let* ((res (gdb-json-partial-output)) + (let* ((res (gdb-mi--partial-output)) (err-msg (gdb-mi--field res 'msg))) (if (not err-msg) (let ((memory (gdb-mi--field res 'memory))) @@ -3990,7 +4023,7 @@ DOC is an optional documentation string." 'gdb-invalidate-disassembly) (defun gdb-disassembly-handler-custom () - (let* ((instructions (gdb-mi--field (gdb-json-partial-output) 'asm_insns)) + (let* ((instructions (gdb-mi--field (gdb-mi--partial-output) 'asm_insns)) (address (gdb-mi--field (gdb-current-buffer-frame) 'addr)) (table (make-gdb-table)) (marked-line nil)) @@ -4131,7 +4164,7 @@ member." (if res (concat " of " res) "")))) (defun gdb-stack-list-frames-custom () - (let ((stack (gdb-mi--field (gdb-json-partial-output 'frame) 'stack)) + (let ((stack (gdb-mi--field (gdb-mi--partial-output 'frame) 'stack)) (table (make-gdb-table))) (set-marker gdb-stack-position nil) (dolist (frame stack) @@ -4259,7 +4292,7 @@ member." ;; Don't display values of arrays or structures. ;; These can be expanded using gud-watch. (defun gdb-locals-handler-custom () - (let ((locals-list (gdb-mi--field (gdb-json-partial-output) 'locals)) + (let ((locals-list (gdb-mi--field (gdb-mi--partial-output) 'locals)) (table (make-gdb-table))) (dolist (local locals-list) (let ((name (gdb-mi--field local 'name)) @@ -4356,7 +4389,7 @@ member." (defun gdb-registers-handler-custom () (when gdb-register-names (let ((register-values - (gdb-mi--field (gdb-json-partial-output) 'register-values)) + (gdb-mi--field (gdb-mi--partial-output) 'register-values)) (table (make-gdb-table))) (dolist (register register-values) (let* ((register-number (gdb-mi--field register 'number)) @@ -4446,7 +4479,7 @@ member." (defun gdb-changed-registers-handler () (setq gdb-changed-registers nil) (dolist (register-number - (gdb-mi--field (gdb-json-partial-output) 'changed-registers)) + (gdb-mi--field (gdb-mi--partial-output) 'changed-registers)) (push register-number gdb-changed-registers))) (defun gdb-register-names-handler () @@ -4454,7 +4487,7 @@ member." ;; only once (in gdb-init-1) (setq gdb-register-names nil) (dolist (register-name - (gdb-mi--field (gdb-json-partial-output) 'register-names)) + (gdb-mi--field (gdb-mi--partial-output) 'register-names)) (push register-name gdb-register-names)) (setq gdb-register-names (reverse gdb-register-names))) @@ -4465,7 +4498,8 @@ If buffers already exist for any of these files, `gud-minor-mode' is set in them." (goto-char (point-min)) (while (re-search-forward gdb-source-file-regexp nil t) - (push (read (match-string 1)) gdb-source-file-list)) + (push (gdb-mi--c-string-from-string (match-string 1)) + gdb-source-file-list)) (dolist (buffer (buffer-list)) (with-current-buffer buffer (when (member buffer-file-name gdb-source-file-list) @@ -4481,7 +4515,7 @@ Called from `gdb-update'." (defun gdb-frame-handler () "Set `gdb-selected-frame' and `gdb-selected-file' to show overlay arrow in source buffer." - (let ((frame (gdb-mi--field (gdb-json-partial-output) 'frame))) + (let ((frame (gdb-mi--field (gdb-mi--partial-output) 'frame))) (when frame (setq gdb-selected-frame (gdb-mi--field frame 'func)) (setq gdb-selected-file (gdb-mi--field frame 'fullname)) @@ -4512,7 +4546,7 @@ overlay arrow in source buffer." (goto-char (point-min)) (setq gdb-prompt-name nil) (re-search-forward gdb-prompt-name-regexp nil t) - (setq gdb-prompt-name (read (match-string 1))) + (setq gdb-prompt-name (gdb-mi--c-string-from-string (match-string 1))) ;; Insert first prompt. (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name))) @@ -4961,7 +4995,7 @@ buffers, if required." ;; This function is called only once on startup. (goto-char (point-min)) (if (re-search-forward gdb-source-file-regexp nil t) - (setq gdb-main-file (read (match-string 1)))) + (setq gdb-main-file (gdb-mi--c-string-from-string (match-string 1)))) (if gdb-many-windows (gdb-setup-windows) (gdb-get-buffer-create 'gdb-breakpoints-buffer) diff --git a/test/lisp/progmodes/gdb-mi-tests.el b/test/lisp/progmodes/gdb-mi-tests.el new file mode 100644 index 0000000000..79493a571b --- /dev/null +++ b/test/lisp/progmodes/gdb-mi-tests.el @@ -0,0 +1,44 @@ +;;; gdb-mi-tests.el --- tests for gdb-mi.el -*- lexical-binding: t -*- + +;; Copyright (C) 2020 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 . + +(require 'ert) +(require 'gdb-mi) + +(ert-deftest gdb-mi-parse-value () + ;; Test the GDB/MI result/value parser. + (should (equal + (gdb-mi--from-string + "alpha=\"ab\\ncd\",beta=[\"x\",{gamma=\"y\",delta=[]}]") + '((alpha . "ab\ncd") + (beta . ("x" ((gamma . "y") (delta . ()))))))) + (should (equal + (gdb-mi--from-string + "alpha=\"ab\\ncd\",beta=[\"x\",{gamma=\"y\",delta=[]}]" + 'gamma) + '((alpha . "ab\ncd") + (beta . ("x" ("y" (delta . ()))))))) + + (should (equal (gdb-mi--from-string "alpha=\"a\\303\\245b\"") + `((alpha . ,(string-to-multibyte "a\303\245b"))))) + (let ((gdb-mi-decode-strings 'utf-8)) + (should (equal (gdb-mi--from-string "alpha=\"a\\303\\245b\"") + '((alpha . "aåb"))))) + ) + +(provide 'gdb-mi-tests) commit 7f30bf72066514db44cf00b20f807bb360e1b968 Author: Eli Zaretskii Date: Sat Oct 31 13:02:52 2020 +0200 * etc/HELLO: Add Egyptian Hieroglyphs. diff --git a/etc/HELLO b/etc/HELLO index fcc907536e..f3033dcafb 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -40,6 +40,8 @@ Danish (dansk) Hej / Goddag / Halløj Dutch (Nederlands) Hallo / Dag Efik /ˈɛfɪk/ Mɔkɔm +Egyptian Hieroglyphs (𓂋𓐰𓏤𓈖𓆎𓅓𓏏𓐰𓊖) 𓅓𓊵𓐰𓐷𓏏𓊪𓐸, 𓇍𓇋𓂻𓍘𓇋 + Emacs emacs --no-splash -f view-hello-file Emoji 👋 @@ -124,7 +126,7 @@ along with GNU Emacs. If not, see <. ;;; Local Variables: -;;; tab-width: 32 +;;; tab-width: 40 ;;; bidi-display-reordering: t ;;; coding: utf-8 ;;; inhibit-compacting-font-caches: t commit 66ceb148c7d90be71ead193306a4aa2d1f55674c Author: Eli Zaretskii Date: Sat Oct 31 12:40:25 2020 +0200 Support prettified display of fractional numbers * lisp/composite.el (composition-function-table): Define an entry for U+2044 FRACTION SLASH, for prettier display of fractional numbers. diff --git a/lisp/composite.el b/lisp/composite.el index 47d91c5d21..0a8dcb875c 100644 --- a/lisp/composite.el +++ b/lisp/composite.el @@ -747,7 +747,18 @@ All non-spacing characters have this function in unicode-category-table)) ;; for dotted-circle (aset composition-function-table #x25CC - `([,(purecopy ".\\c^") 0 compose-gstring-for-dotted-circle]))) + `([,(purecopy ".\\c^") 0 compose-gstring-for-dotted-circle])) + ;; For prettier display of fractions + (set-char-table-range + composition-function-table + #x2044 + ;; We use font-shape-gstring so that if the font doesn't support + ;; fractional display, the characters are shown separately, not as + ;; a composed cluster. + (list (vector (purecopy "[1-9][0-9][0-9]\u2044[0-9]+") + 3 'font-shape-gstring) + (vector (purecopy "[1-9][0-9]\u2044[0-9]+") 2 'font-shape-gstring) + (vector (purecopy "[1-9]\u2044[0-9]+") 1 'font-shape-gstring)))) (defun compose-gstring-for-terminal (gstring _direction) "Compose glyph-string GSTRING for terminal display. commit dc16c70bada4c8520b8363d3df154dd6dd389ef9 Author: Michael Albinus Date: Sat Oct 31 11:29:06 2020 +0100 Check also for "DragonFly" remote systems in Tramp * lisp/net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): Check also for "DragonFly". diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index e65d376eff..f1b45ee851 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -480,7 +480,7 @@ The string is used in `tramp-methods'.") ;; HP-UX: /usr/bin:/usr/ccs/bin:/opt/ansic/bin:/opt/langtools/bin:/opt/fortran/bin ;; Solaris: /usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin ;; GNU/Linux (Debian, Suse, RHEL): /bin:/usr/bin -;; FreeBSD: /usr/bin:/bin:/usr/sbin:/sbin: - beware trailing ":"! +;; FreeBSD, DragonFly: /usr/bin:/bin:/usr/sbin:/sbin: - beware trailing ":"! ;; Darwin: /usr/bin:/bin:/usr/sbin:/sbin ;; IRIX64: /usr/bin ;; QNAP QTS: --- @@ -4388,7 +4388,7 @@ process to set up. VEC specifies the connection." (t (tramp-message vec 5 "Checking remote host type for `send-process-string' bug") - (if (string-match-p "^FreeBSD" uname) 500 0)))) + (if (string-match-p "FreeBSD\\|DragonFly" uname) 500 0)))) ;; Set remote PATH variable. (tramp-set-remote-path vec) @@ -4415,7 +4415,7 @@ process to set up. VEC specifies the connection." (tramp-send-command vec "set +H" t)) ;; Disable tab expansion. - (if (string-match-p "BSD\\|Darwin" uname) + (if (string-match-p "BSD\\|DragonFly\\|Darwin" uname) (tramp-send-command vec "stty tabs" t) (tramp-send-command vec "stty tab0" t)) commit 96ec0340716292f577f6dcaa0f8102f1a04e1d5e Author: Eli Zaretskii Date: Sat Oct 31 11:41:53 2020 +0200 Speed up ls-lisp This speeds up Dired by 25% in large directories. * lisp/ls-lisp.el (ls-lisp--time-locale): New defvar. (ls-lisp-format-time): calculate the locale for formatting times only once and cache the value in 'ls-lisp--time-locale'. (Bug#44273) diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index 8851522bbd..e264620931 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el @@ -836,6 +836,9 @@ Return nil if no time switch found." ((memq ?t switches) 5) ; last modtime ((memq ?u switches) 4))) ; last access +(defvar ls-lisp--time-locale nil + "Locale to be used for formatting file times.") + (defun ls-lisp-format-time (file-attr time-index) "Format time for file with attributes FILE-ATTR according to TIME-INDEX. Use the same method as ls to decide whether to show time-of-day or year, @@ -851,11 +854,13 @@ All ls time options, namely c, t and u, are handled." (condition-case nil ;; Use traditional time format in the C or POSIX locale, ;; ISO-style time format otherwise, so columns line up. - (let ((locale system-time-locale)) + (let ((locale (or system-time-locale ls-lisp--time-locale))) (if (not locale) (let ((vars '("LC_ALL" "LC_TIME" "LANG"))) (while (and vars (not (setq locale (getenv (car vars))))) - (setq vars (cdr vars))))) + (setq vars (cdr vars))) + ;; Cache the locale for next calls. + (setq ls-lisp--time-locale (or locale "C")))) (if (member locale '("C" "POSIX")) (setq locale nil)) (format-time-string commit 0c013814233197ec7ab1b2fa918a7d5f327cbc04 Author: Eli Zaretskii Date: Sat Oct 31 10:01:44 2020 +0200 * doc/lispref/commands.texi (Key Sequence Input): Fix indexing. (cherry picked from commit 41c4f337c8f798d4700dcd13b73ad4ccdb3257eb) diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index d70c4d58ba..744d3e585c 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -2509,20 +2509,20 @@ button-down events entirely. It also reshuffles focus events and miscellaneous window events so that they never appear in a key sequence with any other events. -@cindex @code{tab-line} prefix key -@cindex @code{header-line} prefix key -@cindex @code{mode-line} prefix key -@cindex @code{vertical-line} prefix key -@cindex @code{horizontal-scroll-bar} prefix key -@cindex @code{vertical-scroll-bar} prefix key -@cindex @code{menu-bar} prefix key -@cindex @code{tab-bar} prefix key -@cindex @code{left-margin} prefix key -@cindex @code{right-margin} prefix key -@cindex @code{left-fringe} prefix key -@cindex @code{right-fringe} prefix key -@cindex @code{right-divider} prefix key -@cindex @code{bottom-divider} prefix key +@cindex @code{tab-line}, prefix key +@cindex @code{header-line}, prefix key +@cindex @code{mode-line}, prefix key +@cindex @code{vertical-line}, prefix key +@cindex @code{horizontal-scroll-bar}, prefix key +@cindex @code{vertical-scroll-bar}, prefix key +@cindex @code{menu-bar}, prefix key +@cindex @code{tab-bar}, prefix key +@cindex @code{left-margin}, prefix key +@cindex @code{right-margin}, prefix key +@cindex @code{left-fringe}, prefix key +@cindex @code{right-fringe}, prefix key +@cindex @code{right-divider}, prefix key +@cindex @code{bottom-divider}, prefix key @cindex mouse events, in special parts of window or frame When mouse events occur in special parts of a window or frame, such as a mode line or a scroll bar, the event type shows nothing special---it is the commit 487aae38d4348ff98cfef170f3d08505399d3af0 Author: Jared Finder Date: Sun Oct 4 00:01:23 2020 -0700 Updating docs with all special window prefix keys. * doc/lispref/commands.texi (Key Sequence Input): Add documentation for missing special window areas. Explicitly call out window or frame. (cherry picked from commit a105db13e11fd15cc72804bf33672122d1c3f2e1) diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index aabaec256b..d70c4d58ba 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -2517,8 +2517,14 @@ with any other events. @cindex @code{vertical-scroll-bar} prefix key @cindex @code{menu-bar} prefix key @cindex @code{tab-bar} prefix key -@cindex mouse events, in special parts of frame -When mouse events occur in special parts of a window, such as a mode +@cindex @code{left-margin} prefix key +@cindex @code{right-margin} prefix key +@cindex @code{left-fringe} prefix key +@cindex @code{right-fringe} prefix key +@cindex @code{right-divider} prefix key +@cindex @code{bottom-divider} prefix key +@cindex mouse events, in special parts of window or frame +When mouse events occur in special parts of a window or frame, such as a mode line or a scroll bar, the event type shows nothing special---it is the same symbol that would normally represent that combination of mouse button and modifier keys. The information about the window part is kept @@ -2526,9 +2532,11 @@ elsewhere in the event---in the coordinates. But @code{read-key-sequence} translates this information into imaginary prefix keys, all of which are symbols: @code{tab-line}, @code{header-line}, @code{horizontal-scroll-bar}, @code{menu-bar}, @code{tab-bar}, @code{mode-line}, -@code{vertical-line}, and @code{vertical-scroll-bar}. You can define -meanings for mouse clicks in special window parts by defining key -sequences using these imaginary prefix keys. +@code{vertical-line}, @code{vertical-scroll-bar}, @code{left-margin}, +@code{right-margin}, @code{left-fringe}, @code{right-fringe}, +@code{right-divider}, and @code{bottom-divider}. You can define meanings for +mouse clicks in special window parts by defining key sequences using these +imaginary prefix keys. For example, if you call @code{read-key-sequence} and then click the mouse on the window's mode line, you get two events, like this: commit 41c4f337c8f798d4700dcd13b73ad4ccdb3257eb Author: Eli Zaretskii Date: Sat Oct 31 10:01:44 2020 +0200 * doc/lispref/commands.texi (Key Sequence Input): Fix indexing. diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 85bd2c1ed9..ebfda01671 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -2508,20 +2508,20 @@ button-down events entirely. It also reshuffles focus events and miscellaneous window events so that they never appear in a key sequence with any other events. -@cindex @code{tab-line} prefix key -@cindex @code{header-line} prefix key -@cindex @code{mode-line} prefix key -@cindex @code{vertical-line} prefix key -@cindex @code{horizontal-scroll-bar} prefix key -@cindex @code{vertical-scroll-bar} prefix key -@cindex @code{menu-bar} prefix key -@cindex @code{tab-bar} prefix key -@cindex @code{left-margin} prefix key -@cindex @code{right-margin} prefix key -@cindex @code{left-fringe} prefix key -@cindex @code{right-fringe} prefix key -@cindex @code{right-divider} prefix key -@cindex @code{bottom-divider} prefix key +@cindex @code{tab-line}, prefix key +@cindex @code{header-line}, prefix key +@cindex @code{mode-line}, prefix key +@cindex @code{vertical-line}, prefix key +@cindex @code{horizontal-scroll-bar}, prefix key +@cindex @code{vertical-scroll-bar}, prefix key +@cindex @code{menu-bar}, prefix key +@cindex @code{tab-bar}, prefix key +@cindex @code{left-margin}, prefix key +@cindex @code{right-margin}, prefix key +@cindex @code{left-fringe}, prefix key +@cindex @code{right-fringe}, prefix key +@cindex @code{right-divider}, prefix key +@cindex @code{bottom-divider}, prefix key @cindex mouse events, in special parts of window or frame When mouse events occur in special parts of a window or frame, such as a mode line or a scroll bar, the event type shows nothing special---it is the commit a105db13e11fd15cc72804bf33672122d1c3f2e1 Author: Jared Finder Date: Sun Oct 4 00:01:23 2020 -0700 Updating docs with all special window prefix keys. * doc/lispref/commands.texi (Key Sequence Input): Add documentation for missing special window areas. Explicitly call out window or frame. diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 8959175def..85bd2c1ed9 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -2516,8 +2516,14 @@ with any other events. @cindex @code{vertical-scroll-bar} prefix key @cindex @code{menu-bar} prefix key @cindex @code{tab-bar} prefix key -@cindex mouse events, in special parts of frame -When mouse events occur in special parts of a window, such as a mode +@cindex @code{left-margin} prefix key +@cindex @code{right-margin} prefix key +@cindex @code{left-fringe} prefix key +@cindex @code{right-fringe} prefix key +@cindex @code{right-divider} prefix key +@cindex @code{bottom-divider} prefix key +@cindex mouse events, in special parts of window or frame +When mouse events occur in special parts of a window or frame, such as a mode line or a scroll bar, the event type shows nothing special---it is the same symbol that would normally represent that combination of mouse button and modifier keys. The information about the window part is kept @@ -2525,9 +2531,11 @@ elsewhere in the event---in the coordinates. But @code{read-key-sequence} translates this information into imaginary prefix keys, all of which are symbols: @code{tab-line}, @code{header-line}, @code{horizontal-scroll-bar}, @code{menu-bar}, @code{tab-bar}, @code{mode-line}, -@code{vertical-line}, and @code{vertical-scroll-bar}. You can define -meanings for mouse clicks in special window parts by defining key -sequences using these imaginary prefix keys. +@code{vertical-line}, @code{vertical-scroll-bar}, @code{left-margin}, +@code{right-margin}, @code{left-fringe}, @code{right-fringe}, +@code{right-divider}, and @code{bottom-divider}. You can define meanings for +mouse clicks in special window parts by defining key sequences using these +imaginary prefix keys. For example, if you call @code{read-key-sequence} and then click the mouse on the window's mode line, you get two events, like this: commit 2a6337a6c4dd00fbe00298bcec48a53a6faf87eb Author: Jared Finder Date: Sat Oct 24 08:25:06 2020 -0700 Fix unit tests broken by changes to xt-mouse.el * test/lisp/xt-mouse-tests.el (xt-mouse-tracking-basic) (xt-mouse-tracking-utf-8): Update expected escape sequence. diff --git a/test/lisp/xt-mouse-tests.el b/test/lisp/xt-mouse-tests.el index 61bd759018..12840df13f 100644 --- a/test/lisp/xt-mouse-tests.el +++ b/test/lisp/xt-mouse-tests.el @@ -53,9 +53,9 @@ (ert-deftest xt-mouse-tracking-basic () (should (equal (xterm-mouse-tracking-enable-sequence) - "\e[?1000h\e[?1002h\e[?1006h")) + "\e[?1000h\e[?1003h\e[?1006h")) (should (equal (xterm-mouse-tracking-disable-sequence) - "\e[?1006l\e[?1002l\e[?1000l")) + "\e[?1006l\e[?1003l\e[?1000l")) (with-xterm-mouse-mode (should xterm-mouse-mode) (should (terminal-parameter nil 'xterm-mouse-mode)) @@ -73,9 +73,9 @@ (ert-deftest xt-mouse-tracking-utf-8 () (let ((xterm-mouse-utf-8 t)) (should (equal (xterm-mouse-tracking-enable-sequence) - "\e[?1000h\e[?1002h\e[?1005h\e[?1006h")) + "\e[?1000h\e[?1003h\e[?1005h\e[?1006h")) (should (equal (xterm-mouse-tracking-disable-sequence) - "\e[?1006l\e[?1005l\e[?1002l\e[?1000l")) + "\e[?1006l\e[?1005l\e[?1003l\e[?1000l")) (with-xterm-mouse-mode (should xterm-mouse-mode) (should (terminal-parameter nil 'xterm-mouse-mode)) commit 8800d8c640276b41f1a9f46397e43e2f02b6b664 Author: Eli Zaretskii Date: Sat Oct 31 09:56:14 2020 +0200 Revert "Temporarily mark two failing tests" This reverts commit a8426f46726d94cdf21c0e6b3c85c0afe0064784. A proper fix for the test is about to be installed shortly. diff --git a/test/lisp/xt-mouse-tests.el b/test/lisp/xt-mouse-tests.el index 2b27e3cbc8..61bd759018 100644 --- a/test/lisp/xt-mouse-tests.el +++ b/test/lisp/xt-mouse-tests.el @@ -52,7 +52,6 @@ (xterm-mouse-mode 0))))) (ert-deftest xt-mouse-tracking-basic () - :expected-result :failed ; FIXME (should (equal (xterm-mouse-tracking-enable-sequence) "\e[?1000h\e[?1002h\e[?1006h")) (should (equal (xterm-mouse-tracking-disable-sequence) @@ -72,7 +71,6 @@ (should (equal xy '(184 . 95)))))))) (ert-deftest xt-mouse-tracking-utf-8 () - :expected-result :failed ; FIXME (let ((xterm-mouse-utf-8 t)) (should (equal (xterm-mouse-tracking-enable-sequence) "\e[?1000h\e[?1002h\e[?1005h\e[?1006h")) commit 73bc7b543bfad54d50eb15943800dce12834efd6 Author: Thien-Thi Nguyen Date: Fri Oct 30 22:40:11 2020 -0400 Make hideshow.el work with Mhtml mode Suggested by Ian Williams . * lisp/textmodes/mhtml-mode.el: Require ‘pcase’ when compiling. (mhtml-forward): New func. * lisp/progmodes/hideshow.el (hs-special-modes-alist): Add entry for ‘mhtml-mode’. diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 625e08e4d7..2ad66ccc5e 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -264,7 +264,10 @@ This has effect only if `search-invisible' is set to `open'." (c++-mode "{" "}" "/[*/]" nil nil) (bibtex-mode ("@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil nil) - (js-mode "{" "}" "/[*/]" nil))) + (js-mode "{" "}" "/[*/]" nil) + (mhtml-mode "{\\|<[^/>]*?" "}\\|]*[^/]>" "