commit 931b9f5953013c1e8844d0c723411b87ccfedb1a (HEAD, refs/remotes/origin/master) Author: Amin Bandali Date: Wed Sep 9 23:03:06 2020 -0400 Set `generated-autoload-file' in erc-status-sidebar.el * lisp/erc/erc-status-sidebar.el: Set `generated-autoload-file' to ERC's dedicated "erc-loaddefs.el", since we don't need this file's autoloaded functions to be available before ERC itself is loaded. diff --git a/lisp/erc/erc-status-sidebar.el b/lisp/erc/erc-status-sidebar.el index 033c7d600f..ab9883665d 100644 --- a/lisp/erc/erc-status-sidebar.el +++ b/lisp/erc/erc-status-sidebar.el @@ -302,3 +302,7 @@ to the `window-configuration-change-hook'." (provide 'erc-status-sidebar) ;;; erc-status-sidebar.el ends here + +;; Local Variables: +;; generated-autoload-file: "erc-loaddefs.el" +;; End: commit d08568e6e923051ca2376c2e0e6e7a22b66a2f33 Author: Basil L. Contovounesios Date: Thu Sep 10 00:20:24 2020 +0100 ; Silence byte-compilation warning in last change * lisp/tab-line.el (tab-line-switch-cycling): Move definition before first use. diff --git a/lisp/tab-line.el b/lisp/tab-line.el index a6387f8f9b..108f9f7d99 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -642,6 +642,15 @@ using the `previous-buffer' command." (with-selected-window window (switch-to-buffer buffer)))))) +(defcustom tab-line-switch-cycling nil + "Enable cycling tab switch. +If non-nil, `tab-line-switch-to-prev-tab' in the first tab +switches to the last tab and `tab-line-switch-to-next-tab' in the +last tab switches to the first tab." + :type 'boolean + :group 'tab-line + :version "28.1") + (defun tab-line-switch-to-prev-tab (&optional mouse-event) "Switch to the previous tab. Its effect is the same as using the `previous-buffer' command @@ -690,15 +699,6 @@ Its effect is the same as using the `next-buffer' command (when (bufferp buffer) (switch-to-buffer buffer))))))) -(defcustom tab-line-switch-cycling nil - "Enable cycling tab switch. -If non-nil, `tab-line-switch-to-prev-tab' in the first tab -switches to the last tab and `tab-line-switch-to-next-tab' in the -last tab switches to the first tab." - :type 'boolean - :group 'tab-line - :version "28.1") - (defcustom tab-line-close-tab-function 'bury-buffer "Defines what to do on closing the tab. commit 60cb56e9999050740f4b987ccb806ee6e8227c07 Author: Basil L. Contovounesios Date: Thu Sep 10 00:15:09 2020 +0100 ; Fix typo in last change diff --git a/lisp/tab-line.el b/lisp/tab-line.el index ddba483859..a6387f8f9b 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -693,8 +693,8 @@ Its effect is the same as using the `next-buffer' command (defcustom tab-line-switch-cycling nil "Enable cycling tab switch. If non-nil, `tab-line-switch-to-prev-tab' in the first tab -switches to the last tab and `tab-line-switch-to-next-tab' in the last -tab swithces to the first tab." +switches to the last tab and `tab-line-switch-to-next-tab' in the +last tab switches to the first tab." :type 'boolean :group 'tab-line :version "28.1") commit 5d436090952559eb4fe8204e75760f96dcadd599 Author: Kiso Katsuyuki Date: Wed Sep 9 22:22:49 2020 +0300 Introduce a new variable tab-line-switch-cycling If it is set t, enable cycling tab switch. Default is nil. Copyright-paperwork-exempt: yes diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 140ee8c389..ddba483859 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -658,7 +658,10 @@ Its effect is the same as using the `previous-buffer' command (if (bufferp tab) (eq buffer tab) (eq buffer (cdr (assq 'buffer tab))))))) - (tab (if pos (nth (1- pos) tabs))) + (tab (if pos + (if (and tab-line-switch-cycling (<= pos 0)) + (nth (1- (length tabs)) tabs) + (nth (1- pos) tabs)))) (buffer (if (bufferp tab) tab (cdr (assq 'buffer tab))))) (when (bufferp buffer) (switch-to-buffer buffer))))))) @@ -679,11 +682,23 @@ Its effect is the same as using the `next-buffer' command (if (bufferp tab) (eq buffer tab) (eq buffer (cdr (assq 'buffer tab))))))) - (tab (if pos (nth (1+ pos) tabs))) + (tab (if pos + (if (and tab-line-switch-cycling (<= (length tabs) (1+ pos))) + (car tabs) + (nth (1+ pos) tabs)))) (buffer (if (bufferp tab) tab (cdr (assq 'buffer tab))))) (when (bufferp buffer) (switch-to-buffer buffer))))))) +(defcustom tab-line-switch-cycling nil + "Enable cycling tab switch. +If non-nil, `tab-line-switch-to-prev-tab' in the first tab +switches to the last tab and `tab-line-switch-to-next-tab' in the last +tab swithces to the first tab." + :type 'boolean + :group 'tab-line + :version "28.1") + (defcustom tab-line-close-tab-function 'bury-buffer "Defines what to do on closing the tab. commit c3f986a4557b8785e16daf84f94c029b89c9feff Author: Kiso Katsuyuki Date: Wed Sep 9 22:16:34 2020 +0300 Suppress errors of tab-line-switch functions Traget errors occurs when tab-line-switch-to-prev-tab or tab-line-switch-to-next-tab is invoked in a buffer which is not in tabs Copyright-paperwork-exempt: yes diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 40f80959cc..140ee8c389 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -652,13 +652,13 @@ Its effect is the same as using the `previous-buffer' command (switch-to-prev-buffer window) (with-selected-window (or window (selected-window)) (let* ((tabs (funcall tab-line-tabs-function)) - (tab (nth (1- (seq-position - tabs (current-buffer) - (lambda (tab buffer) - (if (bufferp tab) - (eq buffer tab) - (eq buffer (cdr (assq 'buffer tab))))))) - tabs)) + (pos (seq-position + tabs (current-buffer) + (lambda (tab buffer) + (if (bufferp tab) + (eq buffer tab) + (eq buffer (cdr (assq 'buffer tab))))))) + (tab (if pos (nth (1- pos) tabs))) (buffer (if (bufferp tab) tab (cdr (assq 'buffer tab))))) (when (bufferp buffer) (switch-to-buffer buffer))))))) @@ -673,13 +673,13 @@ Its effect is the same as using the `next-buffer' command (switch-to-next-buffer window) (with-selected-window (or window (selected-window)) (let* ((tabs (funcall tab-line-tabs-function)) - (tab (nth (1+ (seq-position - tabs (current-buffer) - (lambda (tab buffer) - (if (bufferp tab) - (eq buffer tab) - (eq buffer (cdr (assq 'buffer tab))))))) - tabs)) + (pos (seq-position + tabs (current-buffer) + (lambda (tab buffer) + (if (bufferp tab) + (eq buffer tab) + (eq buffer (cdr (assq 'buffer tab))))))) + (tab (if pos (nth (1+ pos) tabs))) (buffer (if (bufferp tab) tab (cdr (assq 'buffer tab))))) (when (bufferp buffer) (switch-to-buffer buffer))))))) commit dd25055829a08d37ca56ee4352af8e79f6f0331c Author: João Távora Date: Wed Sep 9 20:12:45 2020 +0100 Fix up fix for bug#19032 * lisp/icomplete.el (icomplete-ret): Call minibuffer-icomplete-and-exit, not minibuffer-exit. diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 93514d2cc8..4e546807b7 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -171,7 +171,7 @@ icompletion is occurring." (car completion-all-sorted-completions) (eql (icomplete--field-end) (icomplete--field-beg))) (icomplete-force-complete-and-exit) - (exit-minibuffer))) + (minibuffer-complete-and-exit))) (defun icomplete-force-complete-and-exit () "Complete the minibuffer with the longest possible match and exit. commit ceb5d1745f4df253afdda53a96965056e441109b Author: Stefan Kangas Date: Wed Sep 9 20:14:54 2020 +0200 Minor clean ups and doc fixes in find-dired * lisp/find-dired.el (find-ls-option, find-dired): Doc fixes. (find-dired, kill-find): Minor clean ups. diff --git a/lisp/find-dired.el b/lisp/find-dired.el index a96c6c9edb..18330d821c 100644 --- a/lisp/find-dired.el +++ b/lisp/find-dired.el @@ -85,8 +85,8 @@ the options \"-dilsb\". While the option `find -ls' often produces unsorted output, the option `find -exec ls -ld' maintains the sorting order only on short output, -whereas `find -print | sort | xargs' produced sorted output even -on the large number of files." +whereas `find -print | sort | xargs' produces sorted output even +on a large number of files." :version "27.1" ; add choice of predefined set of options :type `(choice (cons :tag "find -ls" @@ -164,7 +164,10 @@ The command run (after changing into DIR) is essentially find . \\( ARGS \\) -ls except that the car of the variable `find-ls-option' specifies what to -use in place of \"-ls\" as the final argument." +use in place of \"-ls\" as the final argument. + +Collect output in the \"*Find*\" buffer. To kill the job before +it finishes, type \\[kill-find]." (interactive (list (read-directory-name "Run find in directory: " nil "" t) (read-string "Run find (with args): " find-args '(find-args-history . 1)))) @@ -215,7 +218,6 @@ use in place of \"-ls\" as the final argument." (car find-ls-option)))) ;; Start the find process. (shell-command (concat args "&") (current-buffer)) - ;; The next statement will bomb in classic dired (no optional arg allowed) (dired-mode dir (cdr find-ls-option)) (let ((map (make-sparse-keymap))) (set-keymap-parent map (current-local-map)) @@ -247,8 +249,8 @@ use in place of \"-ls\" as the final argument." (dired-insert-set-properties point (point))) (setq buffer-read-only t) (let ((proc (get-buffer-process (current-buffer)))) - (set-process-filter proc (function find-dired-filter)) - (set-process-sentinel proc (function find-dired-sentinel)) + (set-process-filter proc #'find-dired-filter) + (set-process-sentinel proc #'find-dired-sentinel) ;; Initialize the process marker; it is used by the filter. (move-marker (process-mark proc) (point) (current-buffer))) (setq mode-line-process '(":%s")))) @@ -258,7 +260,7 @@ use in place of \"-ls\" as the final argument." (interactive) (let ((find (get-buffer-process (current-buffer)))) (and find (eq (process-status find) 'run) - (eq (process-filter find) (function find-dired-filter)) + (eq (process-filter find) #'find-dired-filter) (condition-case nil (delete-process find) (error nil))))) commit fab443827a6127174861fa8406d3f82a4faa596e Author: Stefan Kangas Date: Thu Aug 27 21:56:26 2020 +0200 Make flyspell-prog-text-faces into defcustom * lisp/textmodes/flyspell.el (flyspell-prog-text-faces): Make into defcustom. (Bug#32136) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 6889d7eada..51ed3a2f78 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -387,9 +387,13 @@ like \"Some." ;;*---------------------------------------------------------------------*/ ;;* Programming mode */ ;;*---------------------------------------------------------------------*/ -(defvar flyspell-prog-text-faces +(defcustom flyspell-prog-text-faces '(font-lock-string-face font-lock-comment-face font-lock-doc-face) - "Faces corresponding to text in programming-mode buffers.") + "Faces corresponding to text in programming-mode buffers." + :type '(set (const font-lock-string-face) + (const font-lock-comment-face) + (const font-lock-doc-face)) + :version "28.1") (defun flyspell-generic-progmode-verify () "Used for `flyspell-generic-check-word-predicate' in programming modes." commit 66509f2ead423b814378a44a55c9f63dcb1e149b Author: Naoya Yamashita Date: Wed Sep 9 09:52:39 2020 +0900 Add gv-define-expander for plist-get It is necessary to make plist-get as a generalized variable, and this definition allows user to use setf and other useful functions on plist-get. * lisp/emacs-lisp/gv.el: Add gv-define-expander for plist-get * lisp/emacs-lisp/gv-tests.el: Add new tests for plist-get diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 78d86b9fc3..5470b8532f 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -417,6 +417,17 @@ The return value is the last VAL in the list. `(delq ,p ,getter)))))) ,v)))))))))) +(gv-define-expander plist-get + (lambda (do plist prop) + (macroexp-let2 macroexp-copyable-p key prop + (gv-letplace (getter setter) plist + (macroexp-let2 nil p `(cdr (plist-member ,getter ,key)) + (funcall do + `(car ,p) + (lambda (val) + `(if ,p + (setcar ,p ,val) + ,(funcall setter `(cons ,key (cons ,val ,getter))))))))))) ;;; Some occasionally handy extensions. diff --git a/test/lisp/emacs-lisp/gv-tests.el b/test/lisp/emacs-lisp/gv-tests.el index 7a8402be07..10e3b531f3 100644 --- a/test/lisp/emacs-lisp/gv-tests.el +++ b/test/lisp/emacs-lisp/gv-tests.el @@ -156,6 +156,46 @@ its getter (Bug#41853)." (eval-buffer))) (should (equal (get 'gv-setter-edebug 'gv-setter-edebug-prop) '(123)))) +(ert-deftest gv-plist-get () + (require 'cl-lib) + + ;; Simple setf usage for plist-get. + (should (equal (let ((target '(:a "a" :b "b" :c "c"))) + (setf (plist-get target :b) "modify") + target) + '(:a "a" :b "modify" :c "c"))) + + ;; Other function (cl-rotatef) usage for plist-get. + (should (equal (let ((target '(:a "a" :b "b" :c "c"))) + (cl-rotatef (plist-get target :b) (plist-get target :c)) + target) + '(:a "a" :b "c" :c "b"))) + + ;; Add new key value pair at top of list if setf for missing key. + (should (equal (let ((target '(:a "a" :b "b" :c "c"))) + (setf (plist-get target :d) "modify") + target) + '(:d "modify" :a "a" :b "b" :c "c"))) + + ;; Rotate with missing value. + ;; The value corresponding to the missing key is assumed to be nil. + (should (equal (let ((target '(:a "a" :b "b" :c "c"))) + (cl-rotatef (plist-get target :b) (plist-get target :d)) + target) + '(:d "b" :a "a" :b nil :c "c"))) + + ;; Simple setf usage for plist-get. (symbol plist) + (should (equal (let ((target '(a "a" b "b" c "c"))) + (setf (plist-get target 'b) "modify") + target) + '(a "a" b "modify" c "c"))) + + ;; Other function (cl-rotatef) usage for plist-get. (symbol plist) + (should (equal (let ((target '(a "a" b "b" c "c"))) + (cl-rotatef (plist-get target 'b) (plist-get target 'c)) + target) + '(a "a" b "c" c "b")))) + ;; `ert-deftest' messes up macroexpansion when the test file itself is ;; compiled (see Bug #24402). commit 4064d074459ea3eebbc596b7ad645fab95a5b30f Author: Stefan Monnier Date: Wed Sep 9 13:33:15 2020 -0400 * lisp/dnd.el: Use lexical-binding. Remove redundant :group (dnd--unescape-uri): Mark it internal, but don't mark it inlinable. * lisp/cus-edit.el (dnd): Move the group to dnd.el. diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index cb1a78d8e2..6d0ec5d148 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -408,10 +408,6 @@ Use group `text' for this instead. This group is deprecated." "Input from the menus." :group 'environment) -(defgroup dnd nil - "Handling data from drag and drop." - :group 'environment) - (defgroup auto-save nil "Preventing accidental loss of data." :group 'files) diff --git a/lisp/dnd.el b/lisp/dnd.el index 1d0e26cb01..815a4afbec 100644 --- a/lisp/dnd.el +++ b/lisp/dnd.el @@ -1,4 +1,4 @@ -;;; dnd.el --- drag and drop support +;;; dnd.el --- drag and drop support -*- lexical-binding: t; -*- ;; Copyright (C) 2005-2020 Free Software Foundation, Inc. @@ -33,6 +33,9 @@ ;;; Customizable variables +(defgroup dnd nil + "Handling data from drag and drop." + :group 'environment) ;;;###autoload (defcustom dnd-protocol-alist @@ -54,14 +57,13 @@ If no match is found, the URL is inserted as text by calling `dnd-insert-text'. The function shall return the action done (move, copy, link or private) if some action was made, or nil if the URL is ignored." :version "22.1" - :type '(repeat (cons (regexp) (function))) - :group 'dnd) + :type '(repeat (cons (regexp) (function)))) (defcustom dnd-open-remote-file-function (if (eq system-type 'windows-nt) - 'dnd-open-local-file - 'dnd-open-remote-url) + #'dnd-open-local-file + #'dnd-open-remote-url) "The function to call when opening a file on a remote machine. The function will be called with two arguments, URI and ACTION. See `dnd-open-file' for details. @@ -71,15 +73,13 @@ Predefined functions are `dnd-open-local-file' and `dnd-open-remote-url'. is the default on MS-Windows. `dnd-open-remote-url' uses `url-handler-mode' and is the default except for MS-Windows." :version "22.1" - :type 'function - :group 'dnd) + :type 'function) (defcustom dnd-open-file-other-window nil "If non-nil, always use find-file-other-window to open dropped files." :version "22.1" - :type 'boolean - :group 'dnd) + :type 'boolean) ;; Functions @@ -133,7 +133,8 @@ Return nil if URI is not a local file." (string-equal sysname-no-dot hostname))) (concat "file://" (substring uri (+ 7 (length hostname)))))))) -(defsubst dnd-unescape-uri (uri) +(defun dnd--unescape-uri (uri) + ;; Merge with corresponding code in URL library. (replace-regexp-in-string "%[[:xdigit:]][[:xdigit:]]" (lambda (arg) @@ -157,7 +158,7 @@ Return nil if URI is not a local file." 'utf-8 (or file-name-coding-system default-file-name-coding-system)))) - (and f (setq f (decode-coding-string (dnd-unescape-uri f) coding))) + (and f (setq f (decode-coding-string (dnd--unescape-uri f) coding))) (when (and f must-exist (not (file-readable-p f))) (setq f nil)) f)) commit 6e7736ac5f42e2f1b17aacdfb2a60d8bb951d038 Author: Stefan Monnier Date: Wed Sep 9 13:29:59 2020 -0400 (define-minor-mode): Don't compute a default :group (bug#41145) * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Rely on the `defcustom`s own defaulting for the :group. * lisp/display-fill-column-indicator.el (global-display-fill-column-indicator-mode): Remove now redundant :group. * lisp/cus-dep.el (custom--get-def): New function. (custom-make-dependencies): Use it. diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el index b1027ce34f..9003b7fc1b 100644 --- a/lisp/cus-dep.el +++ b/lisp/cus-dep.el @@ -51,6 +51,25 @@ ldefs-boot\\|cus-load\\|finder-inf\\|esh-groups\\|subdirs\\)\\.el$\\)" (defalias sym e)))) '(defcustom defface defgroup))) +(defun custom--get-def (expr) + (if (not (memq (car-safe expr) + '( define-minor-mode define-globalized-minor-mode))) + expr + ;; For define-minor-mode, we don't want to evaluate the whole + ;; expression, because it tends to define functions which aren't + ;; usable (because they call other functions that were skipped). + ;; Concretely it gave us an error + ;; "void-function bug-reference--run-auto-setup" + ;; when subsequently loading `cus-load.el'. + (let ((es (list (macroexpand-all expr))) + defs) + (while es + (let ((e (pop es))) + (pcase e + (`(progn . ,exps) (setq es (append exps es))) + (`(custom-declare-variable . ,_) (push e defs))))) + (macroexp-progn (nreverse defs))))) + (defun custom-make-dependencies () "Batch function to extract custom dependencies from .el files. Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS" @@ -102,12 +121,16 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS" "^(def\\(custom\\|face\\|group\\|ine\\(?:-globalized\\)?-minor-mode\\)" nil t) (beginning-of-line) (let ((type (match-string 1)) - (expr (read (current-buffer)))) + (expr (custom--get-def (read (current-buffer))))) (condition-case nil - (let ((custom-dont-initialize t)) + (let ((custom-dont-initialize t) + (sym (nth 1 expr))) + (put (if (eq (car-safe sym) 'quote) + (cadr sym) + sym) + 'custom-where name) ;; Eval to get the 'custom-group, -tag, ;; -version, group-documentation etc properties. - (put (nth 1 expr) 'custom-where name) (eval expr)) ;; Eval failed for some reason. Eg maybe the ;; defcustom uses something defined earlier @@ -148,7 +171,8 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS" (when found (push (cons (symbol-name symbol) (with-output-to-string - (prin1 (sort found 'string<)))) alist)))))) + (prin1 (sort found #'string<)))) + alist)))))) (dolist (e (sort alist (lambda (e1 e2) (string< (car e1) (car e2))))) (insert "(put '" (car e) " 'custom-loads '" (cdr e) ")\n"))) (insert "\ diff --git a/lisp/display-fill-column-indicator.el b/lisp/display-fill-column-indicator.el index 3391aa371b..e1395f000b 100644 --- a/lisp/display-fill-column-indicator.el +++ b/lisp/display-fill-column-indicator.el @@ -57,12 +57,13 @@ See Info node `Displaying Boundaries' for details." (progn (setq display-fill-column-indicator t) (unless display-fill-column-indicator-character - (if (and (char-displayable-p ?\u2502) - (or (not (display-graphic-p)) - (eq (aref (query-font (car (internal-char-font nil ?\u2502))) 0) - (face-font 'default)))) - (setq display-fill-column-indicator-character ?\u2502) - (setq display-fill-column-indicator-character ?|)))) + (setq display-fill-column-indicator-character + (if (and (char-displayable-p ?\u2502) + (or (not (display-graphic-p)) + (eq (aref (query-font (car (internal-char-font nil ?\u2502))) 0) + (face-font 'default)))) + ?\u2502 + ?|)))) (setq display-fill-column-indicator nil))) (defun display-fill-column-indicator--turn-on () @@ -73,9 +74,7 @@ See Info node `Displaying Boundaries' for details." ;;;###autoload (define-globalized-minor-mode global-display-fill-column-indicator-mode - display-fill-column-indicator-mode display-fill-column-indicator--turn-on - ;; See bug#41145 - :group 'display-fill-column-indicator) + display-fill-column-indicator-mode display-fill-column-indicator--turn-on) (provide 'display-fill-column-indicator) diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 24c9e79f2c..e3eb9294ed 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -1,4 +1,4 @@ -;;; easy-mmode.el --- easy definition for major and minor modes +;;; easy-mmode.el --- easy definition for major and minor modes -*- lexical-binding: t; -*- ;; Copyright (C) 1997, 2000-2020 Free Software Foundation, Inc. @@ -157,9 +157,6 @@ BODY contains code to execute each time the mode is enabled or disabled. the minor mode is global): :group GROUP Custom group name to use in all generated `defcustom' forms. - Defaults to MODE without the possible trailing \"-mode\". - Don't use this default group name unless you have written a - `defgroup' to define that group properly. :global GLOBAL If non-nil specifies that the minor mode is not meant to be buffer-local, so don't make the variable MODE buffer-local. By default, the mode is buffer-local. @@ -262,12 +259,6 @@ For example, you could write (unless initialize (setq initialize '(:initialize 'custom-initialize-default))) - (unless group - ;; We might as well provide a best-guess default group. - (setq group - `(:group ',(intern (replace-regexp-in-string - "-mode\\'" "" mode-name))))) - ;; TODO? Mark booleans as safe if booleanp? Eg abbrev-mode. (unless type (setq type '(:type 'boolean))) commit 9de9976de003b94d7496a55d4d643ac31514d520 Author: Michael Albinus Date: Wed Sep 9 19:29:18 2020 +0200 Adapt Tramp doc * doc/misc/tramp.texi (Remote shell setup): Mention password-word-equivalents. * lisp/net/tramp.el (tramp-password-prompt-regexp): Fix docstring. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index bdf3b403d8..538f85f35d 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -2280,6 +2280,12 @@ example below: @end group @end lisp +@vindex password-word-equivalents +This variable is, by default, initialised from +@code{password-word-equivalents} when @value{tramp} is loaded, and it +is usually more convenient to add new passphrases to that variable +instead of altering this variable. + Similar localization may be necessary for handling wrong password prompts, for which @value{tramp} uses @code{tramp-wrong-passwd-regexp}. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 2ae28b8758..7fd48b29a9 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -585,7 +585,7 @@ This regexp must match both `tramp-initial-end-of-output' and The regexp should match at end of buffer. This variable is, by default, initialised from -`password-word-equivalents' when tramp is loaded, and it is +`password-word-equivalents' when Tramp is loaded, and it is usually more convenient to add new passphrases to that variable instead of altering this variable. commit 482fa0d9ed3d1b5ef6b95e908b5684a1f24cef4a Merge: a5cc0242eb 366a97c980 Author: Glenn Morris Date: Wed Sep 9 07:51:14 2020 -0700 Merge from origin/emacs-27 366a97c980 (origin/emacs-27) Avoid crashes when trying to load bad GI... 7938713105 C++ Mode: handle comma separated brace initializers. 2b95300cf8 * lisp/display-fill-column-indicator.el: Fix bug#41145 commit a5cc0242ebe174152a1488ddec26210f404fdd0f Merge: 5a9e237e15 5489524ab0 Author: Glenn Morris Date: Wed Sep 9 07:51:14 2020 -0700 ; Merge from origin/emacs-27 The following commits were skipped: 5489524ab0 Backport recent change in tramp-tests.el from master, don'... c9708e5ba2 Fix bug in dbus.el; do not merge with master commit 5a9e237e154f2445e2c198cd4491b26a5a962dcf Merge: fecdc1a66a 9b35b0c99c Author: Glenn Morris Date: Wed Sep 9 07:51:14 2020 -0700 Merge from origin/emacs-27 9b35b0c99c ; * lisp/man.el (Man-mode): Fix formatting. abca75d2e9 ; Fix typos; change "Emacs-Lisp" to "Emacs Lisp" commit fecdc1a66a278a4ccaf160d23c0becdc43965fc8 Merge: baade53cbe e0a8a7e94c Author: Glenn Morris Date: Wed Sep 9 07:51:14 2020 -0700 ; Merge from origin/emacs-27 The following commit was skipped: e0a8a7e94c (emacs-27) ; Auto-commit of loaddefs files. commit baade53cbedd57b3d010b148e25537ceaab8f9c0 Merge: 4fa5bad400 302f71e55d Author: Glenn Morris Date: Wed Sep 9 07:51:12 2020 -0700 Merge from origin/emacs-27 302f71e55d Fix help message with help-window-select 0fb3fc92b3 Remove obsolete "Wide Characters" section of Gnus manual commit 4fa5bad400738c1c233b76e07a942186f4b507d5 Author: Michael Albinus Date: Wed Sep 9 14:53:26 2020 +0200 Fix thinko in dbus.el * doc/misc/dbus.texi (Register Objects): Rename from "Receiving Method Calls". Add reference to D-Bus API Design document. * lisp/net/dbus.el (dbus-managed-objects-handler): Fix thinko. * test/lisp/net/dbus-tests.el (dbus-test05-register-property) (dbus-test05-register-property-several-paths): Extend tests. diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi index 4b2a5dc212..2880b7f743 100644 --- a/doc/misc/dbus.texi +++ b/doc/misc/dbus.texi @@ -59,7 +59,7 @@ another. An overview of D-Bus can be found at * Type Conversion:: Mapping Lisp types and D-Bus types. * Synchronous Methods:: Calling methods in a blocking way. * Asynchronous Methods:: Calling methods non-blocking. -* Receiving Method Calls:: Offering own methods. +* Register Objects:: Offering own services. * Signals:: Sending and receiving signals. * Alternative Buses:: Alternative buses and environments. * Errors and Events:: Errors and events. @@ -1341,11 +1341,15 @@ message arrives, and @var{handler} is called. Example: @end defun -@node Receiving Method Calls -@chapter Offering own methods. +@node Register Objects +@chapter Offering own services. @cindex method calls, returning @cindex returning method calls +You can offer an own service in D-Bus, which will be visible by other +D-Bus clients. See @uref{https://dbus.freedesktop.org/doc/dbus-api-design.html} +for a discussion of the design. + In order to register methods on the D-Bus, Emacs has to request a well known name on the D-Bus under which it will be available for other clients. Names on the D-Bus can be registered and unregistered using diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index 525036caed..5afc7f111f 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el @@ -1780,7 +1780,7 @@ It will be registered for all objects created by `dbus-register-service'." ;; Check for object path wildcard interfaces. (maphash (lambda (key val) - (when (and (equal (butlast key 2) (list :method bus)) + (when (and (equal (butlast key 2) (list :property bus)) (null (nth 2 (car-safe val)))) (push (nth 2 key) interfaces))) dbus-registered-objects-table) @@ -1789,7 +1789,7 @@ It will be registered for all objects created by `dbus-register-service'." (maphash (lambda (key val) (let ((object (or (nth 2 (car-safe val)) ""))) - (when (and (equal (butlast key 2) (list :method bus)) + (when (and (equal (butlast key 2) (list :property bus)) (string-prefix-p path object)) (dolist (interface (cons (nth 2 key) interfaces)) (unless (assoc object result) diff --git a/test/lisp/net/dbus-tests.el b/test/lisp/net/dbus-tests.el index cc4bdc11ec..8b456c3551 100644 --- a/test/lisp/net/dbus-tests.el +++ b/test/lisp/net/dbus-tests.el @@ -348,17 +348,18 @@ This includes initialization and closing the bus." dbus--test-interface))) (should (string-equal (cdr (assoc property1 result)) "foo")) (should (string-equal (cdr (assoc property3 result)) "/baz/baz")) - (should-not (assoc property2 result)))) + (should-not (assoc property2 result))) - ;; FIXME: This is wrong! The properties are missing. - ;; (should - ;; (equal - ;; (dbus-get-all-managed-objects - ;; :session dbus--test-service dbus--test-path) - ;; `((,dbus--test-path - ;; ((,dbus-interface-peer) - ;; (,dbus-interface-objectmanager) - ;; (,dbus-interface-properties))))))) + ;; `dbus-get-all-managed-objects'. We cannot retrieve a value for + ;; the property with `:write' access type. + (let ((result + (dbus-get-all-managed-objects + :session dbus--test-service dbus--test-path))) + (should (setq result (cadr (assoc dbus--test-path result)))) + (should (setq result (cadr (assoc dbus--test-interface result)))) + (should (string-equal (cdr (assoc property1 result)) "foo")) + (should (string-equal (cdr (assoc property3 result)) "/baz/baz")) + (should-not (assoc property2 result)))) ;; Cleanup. (dbus-unregister-service :session dbus--test-service))) @@ -488,13 +489,33 @@ This includes initialization and closing the bus." (should (string-equal (cdr (assoc property1 result)) "foofoo")) (should (string-equal (cdr (assoc property2 result)) "barbar")) (should-not (assoc property3 result))) + (let ((result (dbus-get-all-properties :session dbus--test-service (concat dbus--test-path dbus--test-path) dbus--test-interface))) (should (string-equal (cdr (assoc property2 result)) "foofoo")) (should (string-equal (cdr (assoc property3 result)) "barbar")) - (should-not (assoc property1 result)))) + (should-not (assoc property1 result))) + + ;; Final check with `dbus-get-all-managed-objects'. + (let ((result + (dbus-get-all-managed-objects :session dbus--test-service "/")) + result1) + (should (setq result1 (cadr (assoc dbus--test-path result)))) + (should (setq result1 (cadr (assoc dbus--test-interface result1)))) + (should (string-equal (cdr (assoc property1 result1)) "foofoo")) + (should (string-equal (cdr (assoc property2 result1)) "barbar")) + (should-not (assoc property3 result1)) + + (should + (setq + result1 + (cadr (assoc (concat dbus--test-path dbus--test-path) result)))) + (should (setq result1 (cadr (assoc dbus--test-interface result1)))) + (should (string-equal (cdr (assoc property2 result1)) "foofoo")) + (should (string-equal (cdr (assoc property3 result1)) "barbar")) + (should-not (assoc property1 result1)))) ;; Cleanup. (dbus-unregister-service :session dbus--test-service))) commit 554c15841991d98b926463bbf33c81d57a8fc8ce Author: Lars Ingebrigtsen Date: Wed Sep 9 13:06:50 2020 +0200 Add the (hopefully) correct debbugs header for patches * lisp/mail/emacsbug.el (submit-emacs-patch): Mark the submission as a patch. diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index 5d1da08e24..db85b64cc8 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -508,6 +508,7 @@ Message buffer where you can explain more about the patch." (insert "\n\n\n") (emacs-bug--system-description) (mml-attach-file file "text/patch" nil "attachment") + (message-add-header "X-Debbugs-Tags: patch") (message-goto-body) (message "Write a description of the patch and use `C-c C-c' to send it") (message-add-action commit 4038b4fee794a85c055ba28b499264045a2cb2dc Author: Lars Ingebrigtsen Date: Wed Sep 9 12:59:23 2020 +0200 Implement a new `submit-emacs-patch' command * doc/emacs/trouble.texi (Checklist): Mention the new command. * doc/lispref/intro.texi (Caveats): Ditto. * lisp/mail/emacsbug.el (emacs-bug--system-description): Factor out into own function. (report-emacs-bug): ... from here. (submit-emacs-patch): New command. diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi index 33f67f2b44..dbd1a07557 100644 --- a/doc/emacs/trouble.texi +++ b/doc/emacs/trouble.texi @@ -721,18 +721,24 @@ will be sent to the Emacs maintainers at @ifhtml @url{https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs, bug-gnu-emacs}. @end ifhtml -(If you want to suggest an improvement or new feature, use the same -address.) If you cannot send mail from inside Emacs, you can copy the +If you cannot send mail from inside Emacs, you can copy the text of your report to your normal mail client (if your system supports it, you can type @kbd{C-c M-i} to have Emacs do this for you) and send it to that address. Or you can simply send an email to that address describing the problem. -Your report will be sent to the @samp{bug-gnu-emacs} mailing list, and -stored in the GNU Bug Tracker at @url{https://debbugs.gnu.org}. Please -include a valid reply email address, in case we need to ask you for -more information about your report. Submissions are moderated, so -there may be a delay before your report appears. +If you want to submit code to Emacs (to fix a problem or implement a +new feature), the easiest way to do this is to send a patch to the +Emacs issue tracker. This is done with the @kbd{M-x +submit-emacs-patch} command, and works much the same as when reporting +bugs. + +In any case, your report will be sent to the @samp{bug-gnu-emacs} +mailing list, and stored in the GNU Bug Tracker at +@url{https://debbugs.gnu.org}. Please include a valid reply email +address, in case we need to ask you for more information about your +report. Submissions are moderated, so there may be a delay before +your report appears. You do not need to know how the GNU Bug Tracker works in order to report a bug, but if you want to, you can read the tracker's online diff --git a/doc/lispref/intro.texi b/doc/lispref/intro.texi index 8e4fbc7c31..254d4e9b03 100644 --- a/doc/lispref/intro.texi +++ b/doc/lispref/intro.texi @@ -87,7 +87,9 @@ you are criticizing. @cindex bugs @cindex suggestions -Please send comments and corrections using @kbd{M-x report-emacs-bug}. +Please send comments and corrections using @kbd{M-x +report-emacs-bug}. If you wish to contribute new code (or send a +patch to fix a problem), use @kbd{M-x submit-emacs-patch}). @node Lisp History @section Lisp History diff --git a/etc/NEWS b/etc/NEWS index 350ea5633c..9d26620295 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -958,6 +958,11 @@ window after starting). This variable defaults to nil. ** Miscellaneous ++++ +*** New command 'submit-emacs-patch' +This works along the lines of 'report-emacs-bug', but is more geared +towards sending a patch to the Emacs issue tracker. + +++ *** New minor mode 'button-mode'. This minor mode does nothing else than install 'button-buffer-map' as diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index 6b9e1db5fc..5d1da08e24 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -305,30 +305,7 @@ usually do not have translators for other languages.\n\n"))) (let ((txt (delete-and-extract-region (1+ user-point) (point)))) (insert (propertize "\n" 'display txt))) - (insert "\nIn " (emacs-version)) - (if emacs-build-system - (insert " built on " emacs-build-system)) - (insert "\n") - - (if (stringp emacs-repository-version) - (insert "Repository revision: " emacs-repository-version "\n")) - (if (stringp emacs-repository-branch) - (insert "Repository branch: " emacs-repository-branch "\n")) - (if (fboundp 'x-server-vendor) - (condition-case nil - ;; This is used not only for X11 but also W32 and others. - (insert "Windowing system distributor '" (x-server-vendor) - "', version " - (mapconcat 'number-to-string (x-server-version) ".") "\n") - (error t))) - (let ((os (ignore-errors (report-emacs-bug--os-description)))) - (if (stringp os) - (insert "System Description: " os "\n\n"))) - (when (and system-configuration-options - (not (equal system-configuration-options ""))) - (insert "Configured using:\n 'configure " - system-configuration-options "'\n\n") - (fill-region (line-beginning-position -1) (point))) + (emacs-bug--system-description) (insert "Configured features:\n" system-configuration-features "\n\n") (fill-region (line-beginning-position -1) (point)) (insert "Important settings:\n") @@ -409,6 +386,32 @@ usually do not have translators for other languages.\n\n"))) (buffer-substring-no-properties (point-min) (point))) (goto-char user-point))) +(defun emacs-bug--system-description () + (insert "\nIn " (emacs-version)) + (if emacs-build-system + (insert " built on " emacs-build-system)) + (insert "\n") + + (if (stringp emacs-repository-version) + (insert "Repository revision: " emacs-repository-version "\n")) + (if (stringp emacs-repository-branch) + (insert "Repository branch: " emacs-repository-branch "\n")) + (if (fboundp 'x-server-vendor) + (condition-case nil + ;; This is used not only for X11 but also W32 and others. + (insert "Windowing system distributor '" (x-server-vendor) + "', version " + (mapconcat 'number-to-string (x-server-version) ".") "\n") + (error t))) + (let ((os (ignore-errors (report-emacs-bug--os-description)))) + (if (stringp os) + (insert "System Description: " os "\n\n"))) + (when (and system-configuration-options + (not (equal system-configuration-options ""))) + (insert "Configured using:\n 'configure " + system-configuration-options "'\n\n") + (fill-region (line-beginning-position -1) (point)))) + (define-obsolete-function-alias 'report-emacs-bug-info 'info-emacs-bug "24.3") (defun report-emacs-bug-hook () @@ -475,6 +478,45 @@ and send the mail again%s." (when (get-buffer-window help) (quit-window nil (get-buffer-window help)))))) +;;;###autoload +(defun submit-emacs-patch (subject file) + "Send an Emacs patch to the Emacs maintainers. +Interactively, you will be prompted for SUBJECT and a patch FILE +name (which will be attached to the mail). You will end up in a +Message buffer where you can explain more about the patch." + (interactive "sThis patch is about: \nfPatch file name: ") + (switch-to-buffer "*Patch Help*") + (let ((inhibit-read-only t)) + (erase-buffer) + (insert "Thank you for considering submitting a patch to the Emacs project.\n\n" + "Please describe what the patch fixes (or, if it's a new feature, what it\n" + "implements) in the mail buffer below. When done, use the `C-c C-c' command\n" + "to send the patch as an email to the Emacs issue tracker.\n\n" + "If this is the first time you've submitted an Emacs patch, please\n" + "read the ") + (insert-text-button + "CONTRIBUTE" + 'action (lambda (_) + (view-buffer + (find-file-noselect + (expand-file-name "CONTRIBUTE" installation-directory))))) + (insert " file first.\n") + (goto-char (point-min)) + (view-mode 1) + (button-mode 1)) + (message-mail-other-window report-emacs-bug-address subject) + (insert "\n\n\n") + (emacs-bug--system-description) + (mml-attach-file file "text/patch" nil "attachment") + (message-goto-body) + (message "Write a description of the patch and use `C-c C-c' to send it") + (message-add-action + (lambda () + ;; Bury the help buffer (if it's shown). + (when-let ((help (get-buffer "*Patch Help*"))) + (when (get-buffer-window help) + (quit-window nil (get-buffer-window help))))) + 'send)) (provide 'emacsbug) commit 1ee76735a2b52088f483134155e0826e8aa96d38 Author: Lars Ingebrigtsen Date: Wed Sep 9 12:40:36 2020 +0200 Make the button navigation commands available via a minor mode * lisp/button.el (button-mode): New minor mode. * doc/lispref/display.texi (Button Buffer Commands): Mention it. diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index d3adb62c1b..e5494002ce 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -6926,6 +6926,9 @@ such as @code{forward-button} and @code{backward-button} are additionally available in the keymap stored in @code{button-buffer-map}; a mode which uses buttons may want to use @code{button-buffer-map} as a parent keymap for its keymap. +Alternatively, the @code{button-mode} can be switched on for much the +same effect: It's a minor mode that does nothing else than install +@code{button-buffer-map} as a minor mode keymap. If the button has a non-@code{nil} @code{follow-link} property, and @code{mouse-1-click-follows-link} is set, a quick @key{mouse-1} click diff --git a/etc/NEWS b/etc/NEWS index 76f44f2ce6..350ea5633c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -958,6 +958,13 @@ window after starting). This variable defaults to nil. ** Miscellaneous ++++ +*** New minor mode 'button-mode'. +This minor mode does nothing else than install 'button-buffer-map' as +a minor mode map (which binds the TAB/S-TAB key bindings to navigate +to buttons), and can be used in any view-mode-like buffer that has +buttons in it. + --- *** 'icomplete-show-matches-on-no-input' behavior change. Previously, choosing a different completion with commands like 'C-.' diff --git a/lisp/button.el b/lisp/button.el index 03ab59b109..11317605ce 100644 --- a/lisp/button.el +++ b/lisp/button.el @@ -78,6 +78,10 @@ "Keymap useful for buffers containing buttons. Mode-specific keymaps may want to use this as their parent keymap.") +(define-minor-mode button-mode + "A minor mode for navigating to buttons with the TAB key." + :keymap button-buffer-map) + ;; Default properties for buttons. (put 'default-button 'face 'button) (put 'default-button 'mouse-face 'highlight) commit 7bd6dd065b7a63ed800fab1993ecb8052f3924b4 Author: Andrew G Cohen Date: Wed Sep 9 17:01:44 2020 +0800 Make Gnus cache work with nnselect * lisp/gnus/gnus-cache.el (gnus-cache-possibly-enter-article) (gnus-cache-possibly-remove-articles) (gnus-cache-possibly-remove-article): Use originating article info for nnselect groups. diff --git a/lisp/gnus/gnus-cache.el b/lisp/gnus/gnus-cache.el index 7ca3bf1ce1..c31d97d41c 100644 --- a/lisp/gnus/gnus-cache.el +++ b/lisp/gnus/gnus-cache.el @@ -93,6 +93,8 @@ it's not cached." (autoload 'nnml-generate-nov-databases-directory "nnml") (autoload 'nnvirtual-find-group-art "nnvirtual") +(autoload 'nnselect-article-group "nnselect") +(autoload 'nnselect-article-number "nnselect") @@ -158,8 +160,12 @@ it's not cached." (file-name-coding-system nnmail-pathname-coding-system)) ;; If this is a virtual group, we find the real group. (when (gnus-virtual-group-p group) - (let ((result (nnvirtual-find-group-art - (gnus-group-real-name group) article))) + (let ((result (if (gnus-nnselect-group-p group) + (with-current-buffer gnus-summary-buffer + (cons (nnselect-article-group article) + (nnselect-article-number article))) + (nnvirtual-find-group-art + (gnus-group-real-name group) article)))) (setq group (car result) number (cdr result)))) (when (and number @@ -232,8 +238,14 @@ it's not cached." (let ((arts gnus-cache-removable-articles) ga) (while arts - (when (setq ga (nnvirtual-find-group-art - (gnus-group-real-name gnus-newsgroup-name) (pop arts))) + (when (setq ga + (if (gnus-nnselect-group-p gnus-newsgroup-name) + (with-current-buffer gnus-summary-buffer + (let ((article (pop arts))) + (cons (nnselect-article-group article) + (nnselect-article-number article)))) + (nnvirtual-find-group-art + (gnus-group-real-name gnus-newsgroup-name) (pop arts)))) (let ((gnus-cache-removable-articles (list (cdr ga))) (gnus-newsgroup-name (car ga))) (gnus-cache-possibly-remove-articles-1))))) @@ -467,8 +479,12 @@ Returns the list of articles removed." (file-name-coding-system nnmail-pathname-coding-system)) ;; If this is a virtual group, we find the real group. (when (gnus-virtual-group-p group) - (let ((result (nnvirtual-find-group-art - (gnus-group-real-name group) article))) + (let ((result (if (gnus-nnselect-group-p group) + (with-current-buffer gnus-summary-buffer + (cons (nnselect-article-group article) + (nnselect-article-number article))) + (nnvirtual-find-group-art + (gnus-group-real-name group) article)))) (setq group (car result) number (cdr result)))) (setq file (gnus-cache-file-name group number)) commit 366a97c980f068a3ed665d337d644ee58cd25ca0 (refs/remotes/origin/emacs-27) Author: Eli Zaretskii Date: Tue Sep 8 19:17:23 2020 +0300 Avoid crashes when trying to load bad GIF files * src/image.c (gif_load): Handle the case when GifErrorString returns NULL. (Bug#43281) diff --git a/src/image.c b/src/image.c index 56878bcb8c..956fb1325e 100644 --- a/src/image.c +++ b/src/image.c @@ -8160,11 +8160,13 @@ gif_load (struct frame *f, struct image *img) if (gif == NULL) { #if HAVE_GIFERRORSTRING - image_error ("Cannot open `%s': %s", - file, build_string (GifErrorString (gif_err))); -#else - image_error ("Cannot open `%s'", file); + const char *errstr = GifErrorString (gif_err); + if (errstr) + image_error ("Cannot open `%s': %s", file, build_string (errstr)); + else #endif + image_error ("Cannot open `%s'", file); + return 0; } } @@ -8190,11 +8192,13 @@ gif_load (struct frame *f, struct image *img) if (!gif) { #if HAVE_GIFERRORSTRING - image_error ("Cannot open memory source `%s': %s", - img->spec, build_string (GifErrorString (gif_err))); -#else - image_error ("Cannot open memory source `%s'", img->spec); + const char *errstr = GifErrorString (gif_err); + if (errstr) + image_error ("Cannot open memory source `%s': %s", + img->spec, build_string (errstr)); + else #endif + image_error ("Cannot open memory source `%s'", img->spec); return 0; } } @@ -8474,9 +8478,9 @@ gif_load (struct frame *f, struct image *img) if (error_text) image_error ("Error closing `%s': %s", img->spec, build_string (error_text)); -#else - image_error ("Error closing `%s'", img->spec); + else #endif + image_error ("Error closing `%s'", img->spec); } /* Maybe fill in the background field while we have ximg handy. */ commit 793871310599f8c75cf86bed97bdad70577cc5dd Author: Alan Mackenzie Date: Fri Sep 4 19:10:17 2020 +0000 C++ Mode: handle comma separated brace initializers. This includes both indentation and fontification. * lisp/progmodes/cc-engine.el (c-do-declarators): Handle brace initializers without = correctly. (c-looking-at-or-maybe-in-bracelist): Use c-do-declarators with a simple inline function to check that after-type-id-pos points to the start of a declarator. * lisp/progmodes/cc-langs.el (c-recognize-bare-brace-inits): New lang const/variable. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 34490d1356..4b14dd131c 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -9091,7 +9091,7 @@ This function might do hidden buffer changes." (let ((cdd-pos (point)) cdd-next-pos cdd-id-start cdd-id-end cdd-decl-res cdd-got-func cdd-got-type cdd-got-init - c-last-identifier-range cdd-exhausted) + c-last-identifier-range cdd-exhausted cdd-after-block) ;; The following `while' applies `cdd-function' to a single declarator id ;; each time round. It loops only when CDD-LIST is non-nil. @@ -9144,23 +9144,25 @@ This function might do hidden buffer changes." (c-forward-syntactic-ws cdd-limit) (setq cdd-exhausted t))) ; unbalanced parens - (cdd-got-init ; "=" sign OR opening "(", "[", or "{" - ;; Skip an initializer expression. If we're at a '=' - ;; then accept a brace list directly after it to cope - ;; with array initializers. Otherwise stop at braces - ;; to avoid going past full function and class blocks. - (if (and (if (and (eq cdd-got-init ?=) - (= (c-forward-token-2 1 nil cdd-limit) 0) - (looking-at "{")) - (c-go-list-forward (point) cdd-limit) - t) - ;; FIXME: Should look for c-decl-end markers here; - ;; we might go far into the following declarations - ;; in e.g. ObjC mode (see e.g. methods-4.m). - (c-syntactic-re-search-forward "[;,{]" cdd-limit 'move t)) + (cdd-got-init ; "=" sign OR opening "(", "[", or "(" + ;; Skip an initializer expression in braces, whether or not (in + ;; C++ Mode) preceded by an "=". Be careful that the brace list + ;; isn't a code block or a struct (etc.) block. + (cond + ((and (eq cdd-got-init ?=) + (zerop (c-forward-token-2 1 nil cdd-limit)) + (eq (char-after) ?{) + (c-go-list-forward (point) cdd-limit))) + ((and (eq cdd-got-init ?{) + c-recognize-bare-brace-inits + (setq cdd-after-block + (save-excursion + (c-go-list-forward (point) cdd-limit))) + (not (c-looking-at-statement-block))) + (goto-char cdd-after-block))) + (if (c-syntactic-re-search-forward "[;,{]" cdd-limit 'move t) (backward-char) - (setq cdd-exhausted t) - )) + (setq cdd-exhausted t))) (t (c-forward-syntactic-ws cdd-limit))) @@ -11729,7 +11731,22 @@ comment at the start of cc-engine.el for more info." (save-excursion (c-backward-syntactic-ws) (point)) nil nil)) (and (consp res) - (eq (car res) after-type-id-pos)))))) + (cond + ((eq (car res) after-type-id-pos)) + ((> (car res) after-type-id-pos) nil) + (t + (catch 'find-decl + (save-excursion + (goto-char (car res)) + (c-do-declarators + (point-max) t nil nil + (lambda (id-start id-end tok not-top func init) + (cond + ((> id-start after-type-id-pos) + (throw 'find-decl nil)) + ((eq id-start after-type-id-pos) + (throw 'find-decl t))))) + nil))))))))) (cons bufpos (or in-paren inexpr-brace-list))) ((or (eq (char-after) ?\;) ;; Brace lists can't contain a semicolon, so we're done. diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index e7e7cfd4b0..0a7f4565c0 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -3684,6 +3684,20 @@ Foo bar = gnu;" c++ t) (c-lang-defvar c-recognize-paren-inits (c-lang-const c-recognize-paren-inits)) +(c-lang-defconst c-recognize-bare-brace-inits + "Non-nil means that brace initializers without \"=\" exist, +i.e. constructs like + +int foo[] {1, 2, 3}; + +in addition to the more classic + +int foo[] = {1, 2, 3};" + t nil + c++ t) +(c-lang-defvar c-recognize-bare-brace-inits + (c-lang-const c-recognize-bare-brace-inits)) + (c-lang-defconst c-recognize-paren-inexpr-blocks "Non-nil to recognize gcc style in-expression blocks, i.e. compound statements surrounded by parentheses inside expressions." commit 2b95300cf8e3da9f505233f116cabe39a3564fa7 Author: Stefan Monnier Date: Fri Sep 4 08:46:45 2020 -0400 * lisp/display-fill-column-indicator.el: Fix bug#41145 (global-display-fill-column-indicator-mode): Specify the implicit defustom's group explicitly. * lisp/cus-dep.el (custom-make-dependencies): Also look at define(-globalized)-minor-mode since it can also define custom vars. diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el index fd307a5c04..e2fd7febd2 100644 --- a/lisp/cus-dep.el +++ b/lisp/cus-dep.el @@ -99,7 +99,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS" (setq name (intern name))) (condition-case nil (while (re-search-forward - "^(def\\(custom\\|face\\|group\\)" nil t) + "^(def\\(custom\\|face\\|group\\|ine\\(?:-globalized\\)?-minor-mode\\)" nil t) (beginning-of-line) (let ((type (match-string 1)) (expr (read (current-buffer)))) diff --git a/lisp/display-fill-column-indicator.el b/lisp/display-fill-column-indicator.el index 3f947bdc1c..3391aa371b 100644 --- a/lisp/display-fill-column-indicator.el +++ b/lisp/display-fill-column-indicator.el @@ -73,7 +73,9 @@ See Info node `Displaying Boundaries' for details." ;;;###autoload (define-globalized-minor-mode global-display-fill-column-indicator-mode - display-fill-column-indicator-mode display-fill-column-indicator--turn-on) + display-fill-column-indicator-mode display-fill-column-indicator--turn-on + ;; See bug#41145 + :group 'display-fill-column-indicator) (provide 'display-fill-column-indicator) commit 5489524ab0dfb1854bf43077d9adedf1eb022027 Author: Michael Albinus Date: Fri Sep 4 14:24:23 2020 +0200 Backport recent change in tramp-tests.el from master, don't merge * test/lisp/net/tramp-tests.el (tramp-test05-expand-file-name): No need to expect different results in Emacs 28 and later. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 02f436141f..89d4171dde 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2057,8 +2057,8 @@ properly. BODY shall not contain a timeout." ;; user "foo" to "/~foo"". Otherwise, it doesn't expand. (should (string-equal - (substitute-in-file-name - "/method:host:/path/~foo") "/method:host:/path/~foo")) + (substitute-in-file-name "/method:host:/path/~foo") + "/method:host:/path/~foo")) ;; Quoting local part. (should (string-equal @@ -2070,12 +2070,12 @@ properly. BODY shall not contain a timeout." "/method:host:/:/~foo") "/method:host:/:/~foo")) (should (string-equal - (substitute-in-file-name - "/method:host:/:/path//~foo") "/method:host:/:/path//~foo")) + (substitute-in-file-name "/method:host:/:/path//~foo") + "/method:host:/:/path//~foo")) (should (string-equal - (substitute-in-file-name - "/method:host:/:/path/~foo") "/method:host:/:/path/~foo"))) + (substitute-in-file-name "/method:host:/:/path/~foo") + "/method:host:/:/path/~foo"))) (let (process-environment) (should @@ -2120,19 +2120,16 @@ properly. BODY shall not contain a timeout." (expand-file-name "/method:host:/path/../file") "/method:host:/file")) (should (string-equal - (expand-file-name "/method:host:/path/.") - (if (tramp--test-emacs28-p) "/method:host:/path/" "/method:host:/path"))) + (expand-file-name "/method:host:/path/.") "/method:host:/path")) (should (string-equal (expand-file-name "/method:host:/path/..") "/method:host:/")) (should (string-equal - (expand-file-name "." "/method:host:/path/") - (if (tramp--test-emacs28-p) "/method:host:/path/" "/method:host:/path"))) + (expand-file-name "." "/method:host:/path/") "/method:host:/path")) (should (string-equal - (expand-file-name "" "/method:host:/path/") - (if (tramp--test-emacs28-p) "/method:host:/path/" "/method:host:/path"))) + (expand-file-name "" "/method:host:/path/") "/method:host:/path")) ;; Quoting local part. (should (string-equal commit c9708e5ba238661fede5a0d6cb175342a9e7fd31 Author: Michael Albinus Date: Thu Sep 3 13:56:13 2020 +0200 Fix bug in dbus.el; do not merge with master * lisp/net/dbus.el (dbus-register-property) (dbus-property-handler): Handle properties of the same interface at different object paths properly. (Bug#43146) diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index 06bd9e567f..cafbfa73c1 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el @@ -1477,6 +1477,26 @@ nil is returned." (nreverse result)) (push (cons (car dict) (cl-caadr dict)) result))))) +(defun dbus-get-this-registered-property (bus _service path interface property) + "Return PROPERTY entry of `dbus-registered-objects-table'. +Filter out not matching PATH." + ;; Remove entries not belonging to this case. + (seq-remove + (lambda (item) + (not (string-equal path (nth 2 item)))) + (gethash (list :property bus interface property) + dbus-registered-objects-table))) + +(defun dbus-get-other-registered-property (bus _service path interface property) + "Return PROPERTY entry of `dbus-registered-objects-table'. +Filter out matching PATH." + ;; Remove matching entries. + (seq-remove + (lambda (item) + (string-equal path (nth 2 item))) + (gethash (list :property bus interface property) + dbus-registered-objects-table))) + (defun dbus-register-property (bus service path interface property access value &optional emits-signal dont-register-service) @@ -1543,12 +1563,14 @@ clients from discovering the still incomplete interface." ;; because the property might be accessed from anybody. (let ((key (list :property bus interface property)) (val - (list + (cons (list nil service path (cons (if emits-signal (list access :emits-signal) (list access)) - value))))) + value)) + (dbus-get-other-registered-property + bus service path interface property)))) (puthash key val dbus-registered-objects-table) ;; Return the object. @@ -1566,16 +1588,16 @@ It will be registered for all objects created by `dbus-register-property'." (cond ;; "Get" returns a variant. ((string-equal method "Get") - (let ((entry (gethash (list :property bus interface property) - dbus-registered-objects-table))) + (let ((entry (dbus-get-this-registered-property + bus service path interface property))) (when (string-equal path (nth 2 (car entry))) `((:variant ,(cdar (last (car entry)))))))) ;; "Set" expects a variant. ((string-equal method "Set") (let* ((value (caar (cddr args))) - (entry (gethash (list :property bus interface property) - dbus-registered-objects-table)) + (entry (dbus-get-this-registered-property + bus service path interface property)) ;; The value of the hash table is a list; in case of ;; properties it contains just one element (UNAME SERVICE ;; PATH OBJECT). OBJECT is a cons cell of a list, which @@ -1590,8 +1612,10 @@ It will be registered for all objects created by `dbus-register-property'." (signal 'dbus-error (list "Property not writable at path" property path))) (puthash (list :property bus interface property) - (list (append (butlast (car entry)) - (list (cons (car object) value)))) + (cons (append (butlast (car entry)) + (list (cons (car object) value))) + (dbus-get-other-registered-property + bus service path interface property)) dbus-registered-objects-table) ;; Send the "PropertiesChanged" signal. (when (member :emits-signal (car object)) @@ -1607,14 +1631,15 @@ It will be registered for all objects created by `dbus-register-property'." (let (result) (maphash (lambda (key val) - (when (and (equal (butlast key) (list :property bus interface)) - (string-equal path (nth 2 (car val))) - (not (functionp (car (last (car val)))))) - (push - (list :dict-entry - (car (last key)) - (list :variant (cdar (last (car val))))) - result))) + (dolist (item val) + (when (and (equal (butlast key) (list :property bus interface)) + (string-equal path (nth 2 item)) + (not (functionp (car (last item))))) + (push + (list :dict-entry + (car (last key)) + (list :variant (cdar (last item)))) + result)))) dbus-registered-objects-table) ;; Return the result, or an empty array. (list :array (or result '(:signature "{sv}")))))))) commit 9b35b0c99ceaeca74a16bea86a665ae5f44430a1 Author: Stefan Kangas Date: Mon Aug 31 20:47:50 2020 +0200 ; * lisp/man.el (Man-mode): Fix formatting. diff --git a/lisp/man.el b/lisp/man.el index c914ec34b9..bec3bfdbb2 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1541,8 +1541,8 @@ The following man commands are available in the buffer. Try \\[man] Prompt to retrieve a new manpage. \\[Man-follow-manual-reference] Retrieve reference in SEE ALSO section. -\\[Man-next-manpage] Jump to next manpage in circular list. -\\[Man-previous-manpage] Jump to previous manpage in circular list. +\\[Man-next-manpage] Jump to next manpage in circular list. +\\[Man-previous-manpage] Jump to previous manpage in circular list. \\[Man-next-section] Jump to next manpage section. \\[Man-previous-section] Jump to previous manpage section. \\[Man-goto-section] Go to a manpage section. commit abca75d2e9b2a406157383dfb7fe3f185e0b5741 Author: Stefan Kangas Date: Tue Sep 1 23:59:11 2020 +0200 ; Fix typos; change "Emacs-Lisp" to "Emacs Lisp" diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi index 29a0ab71ea..3fea604184 100644 --- a/doc/lispref/debugging.texi +++ b/doc/lispref/debugging.texi @@ -147,7 +147,7 @@ set @code{debug-ignored-errors} to @code{nil}. If this variable has a non-@code{nil} value (the default), running the command @code{eval-expression} causes @code{debug-on-error} to be temporarily bound to @code{t}. @xref{Lisp Eval,, Evaluating -Emacs-Lisp Expressions, emacs, The GNU Emacs Manual}. +Emacs Lisp Expressions, emacs, The GNU Emacs Manual}. If @code{eval-expression-debug-on-error} is @code{nil}, then the value of @code{debug-on-error} is not changed during @code{eval-expression}. diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi index d40ec8db10..2cd61ad04f 100644 --- a/doc/lispref/streams.texi +++ b/doc/lispref/streams.texi @@ -859,7 +859,7 @@ exceeding this limit is abbreviated with an ellipsis. A value of These are the values for @code{print-length} and @code{print-level} used by @code{eval-expression}, and thus, indirectly, by many interactive evaluation commands (@pxref{Lisp Eval,, Evaluating -Emacs-Lisp Expressions, emacs, The GNU Emacs Manual}). +Emacs Lisp Expressions, emacs, The GNU Emacs Manual}). @end defopt These variables are used for detecting and reporting circular diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index 182e99a611..444a0e53b9 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el @@ -310,7 +310,7 @@ to the list. To include the phases of the moon, add (lunar-phases) -to the holiday list, where `lunar-phases' is an Emacs-Lisp function that +to the holiday list, where `lunar-phases' is an Emacs Lisp function that you've written to return a (possibly empty) list of the relevant VISIBLE dates with descriptive strings such as diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 61319266ce..dbe92a164d 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -71,7 +71,7 @@ uses considerably less memory." (const :tag "Write directly to file" nil))) (defcustom gnus-init-file (nnheader-concat gnus-home-directory ".gnus") - "Your Gnus Emacs-Lisp startup file name. + "Your Gnus Emacs Lisp startup file name. If a file with the `.el' or `.elc' suffixes exists, it will be read instead." :group 'gnus-start :type 'file) @@ -82,7 +82,7 @@ If a file with the `.el' or `.elc' suffixes exists, it will be read instead." (directory-file-name installation-directory)) "site-lisp/gnus-init") (error nil)) - "The site-wide Gnus Emacs-Lisp startup file name, or nil if none. + "The site-wide Gnus Emacs Lisp startup file name, or nil if none. If a file with the `.el' or `.elc' suffixes exists, it will be read instead." :group 'gnus-start :type '(choice file (const nil))) diff --git a/lisp/play/handwrite.el b/lisp/play/handwrite.el index f69e0622c9..7b4a59b6fc 100644 --- a/lisp/play/handwrite.el +++ b/lisp/play/handwrite.el @@ -45,7 +45,7 @@ ;; 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: +;; Emacs Lisp load path, add the following into your init file: ;; ;; (require 'handwrite) ;; diff --git a/lisp/ses.el b/lisp/ses.el index 96b219fc60..218043f219 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -378,7 +378,7 @@ area of a spreadsheet.") ;; "Side-effect variables". They are set in one function, altered in ;; another as a side effect, then read back by the first, as a way of ;; passing back more than one value. These declarations are just to make -;; the compiler happy, and to conform to standard Emacs-Lisp practice (I +;; the compiler happy, and to conform to standard Emacs Lisp practice (I ;; think the make-local-variable trick above is cleaner). ;; diff --git a/test/file-organization.org b/test/file-organization.org index 34bd0b90e0..64c0755b3b 100644 --- a/test/file-organization.org +++ b/test/file-organization.org @@ -1,10 +1,10 @@ -#+TITLE: The Location of Emacs-Lisp Tests +#+TITLE: The Location of Emacs Lisp Tests * The Main Emacs Repository -The Emacs repository contains a very large number of Emacs-Lisp files, many of +The Emacs repository contains a very large number of Emacs Lisp files, many of which pre-date both formal package support for Emacs and automated unit testing. commit e0a8a7e94cdf1352e7f66de74131c6c5df9b6983 Author: Glenn Morris Date: Tue Sep 1 06:12:02 2020 -0700 ; Auto-commit of loaddefs files. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index c755bdfde3..9febeb96d4 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -7250,7 +7250,7 @@ file. To upgrade a version 206 file to version 208, call this command explicitly with a prefix argument: \\[universal-argument] \\[desktop-save]. -If you are upgrading from Emacs 24 or older, we recommed to do +If you are upgrading from Emacs 24 or older, we recommend to do this once you decide you no longer need compatibility with versions of Emacs before 25.1. @@ -34508,7 +34508,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 3)) package--builtin-versions) +(push (purecopy '(tramp 2 4 5 -1)) package--builtin-versions) (defvar tramp-mode t "\ Whether Tramp is enabled. commit 302f71e55da427529d3d0d62dd1511552aad9f7b Author: Stefan Kangas Date: Tue Sep 1 11:39:22 2020 +0200 Fix help message with help-window-select * lisp/help.el (help-print-return-message): (help-window-display-message): Recommend 'scroll-up-command' instead of 'scroll-up' when 'help-window-select' is non-nil. (Bug#43122) diff --git a/lisp/help.el b/lisp/help.el index 0f1991e318..c276c1dc28 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -179,7 +179,7 @@ Do not call this in the scope of `with-help-window'." (if (same-window-p (buffer-name standard-output)) ;; Say how to scroll this window. (substitute-command-keys - "\\[scroll-up] to scroll the help.") + "\\[scroll-up-command] to scroll the help.") ;; Say how to scroll some other window. (substitute-command-keys "\\[scroll-other-window] to scroll the help.")))))))) @@ -1243,7 +1243,7 @@ window." ".") ((eq scroll 'other) ", \\[scroll-other-window] to scroll help.") - (scroll ", \\[scroll-up] to scroll help.")))) + (scroll ", \\[scroll-up-command] to scroll help.")))) (message "%s" (substitute-command-keys (concat quit-part scroll-part))))) commit 0fb3fc92b33a6adb657194e056b2910058478022 Author: Eric Abrahamsen Date: Mon Aug 31 11:46:23 2020 -0700 Remove obsolete "Wide Characters" section of Gnus manual * doc/misc/gnus.texi: This hasn't been valid since 2016. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index c8ac7f0a7c..a96be30cd6 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -839,7 +839,6 @@ Formatting Variables * Formatting Fonts:: Making the formatting look colorful and nice. * Positioning Point:: Moving point to a position after an operation. * Tabulation:: Tabulating your output. -* Wide Characters:: Dealing with wide characters. Image Enhancements @@ -22356,7 +22355,6 @@ lots of percentages everywhere. * Formatting Fonts:: Making the formatting look colorful and nice. * Positioning Point:: Moving point to a position after an operation. * Tabulation:: Tabulating your output. -* Wide Characters:: Dealing with wide characters. @end menu Currently Gnus uses the following formatting variables: @@ -22611,23 +22609,6 @@ This is the soft tabulator. 50 will be removed. This is the hard tabulator. -@node Wide Characters -@subsection Wide Characters - -Fixed width fonts in most countries have characters of the same width. -Some countries, however, use Latin characters mixed with wider -characters---most notable East Asian countries. - -The problem is that when formatting, Gnus assumes that if a string is 10 -characters wide, it'll be 10 Latin characters wide on the screen. In -these countries, that's not true. - -@vindex gnus-use-correct-string-widths -To help fix this, you can set @code{gnus-use-correct-string-widths} to -@code{t}. This makes buffer generation slower, but the results will be -prettier. The default value is @code{nil}. - - @node Window Layout @section Window Layout @cindex window layout