commit a3de48687eb28121f3dbfc20be19bd06c4cd6e98 (HEAD, refs/remotes/origin/master) Author: Tassilo Horn Date: Fri May 21 23:11:43 2021 +0200 Add documentation about bug-reference auto-setup. * doc/emacs/maintaining.texi (Bug Reference): Add documentation about the automatic setup. * lisp/progmodes/bug-reference.el (bug-reference-setup-from-irc-alist): Remove doubling in docstring. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index d385e88ce3..8b0f65d967 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -3065,16 +3065,16 @@ the target should be built. @section Bug Reference @cindex bug reference - Most projects with a certain amount of users track bug reports in -some issue tracking software which assigns each report a unique and -short number or identifier. Those are used to reference a given bug, -e.g., in a source code comment above the code fixing some bug, in +Most projects with a certain amount of users track bug reports in some +issue tracking software which assigns each report a unique and short +number or identifier. Those are used to reference a given bug, e.g., +in a source code comment above the code fixing some bug, in documentation files, or in discussions on some mailinglist or IRC channel. @findex bug-reference-mode @findex bug-reference-prog-mode -The minor modes @code{bug-reference-mode} and + The minor modes @code{bug-reference-mode} and @code{bug-reference-prog-mode} highlight such bug references and make it possible to follow them to the corresponding bug report on the project's issue tracker. @code{bug-reference-prog-mode} is a variant @@ -3083,7 +3083,7 @@ inside source code comments and strings. @vindex bug-reference-bug-regexp @vindex bug-reference-url-format -For its working, bug reference mode needs to know the syntax of bug + For its working, bug reference mode needs to know the syntax of bug references (@code{bug-reference-bug-regexp}), and the URL of the tracker where bug reports can be looked up (@code{bug-reference-url-format}). Since those are typically @@ -3112,6 +3112,71 @@ the actual bug number has to be used to distinguish between issues and merge requests where each of them has a different URL. +@heading Automatic Setup + +@vindex bug-reference-auto-setup-functions +If @code{bug-reference-mode} is activated, +@code{bug-reference-mode-hook} has been run and still +@code{bug-reference-bug-regexp}, and @code{bug-reference-url-format} +aren't both set, it'll try to setup suitable values for these two +variables itself by calling the functions in +@code{bug-reference-auto-setup-functions} one after the other until +one is able to set the variables. + + Right now, there are three types of setup functions. + +@enumerate +@item +Setup for version-controlled files configurable by the variable +@code{bug-reference-setup-from-vc-alist}. The default is able to +setup GNU projects where @url{https://debbugs.gnu.org} is used as +issue tracker, Github projects where both bugs and pull requests are +referenced using the @code{#42} notation, and GitLab projects where +bugs are references with @code{#17}, too, but merge requests use the +@code{!18} notation. + +@item +Setup for email guessing from mail folder/mbox names, and mail header +values configurable by the variable +@code{bug-reference-setup-from-mail-alist}. The built-in news- and +mailreader @ref{Gnus} and @ref{Rmail} are supported. + +@item +Setup for IRC channels configurable by the variable +@code{bug-reference-setup-from-irc-alist}. The built-in IRC clients +Rcirc, @xref{,,,Rcirc, Rcirc}, and ERC, @xref{,,,ERC, ERC}, are +supported. +@end enumerate + +For almost all of those modes, it's enough to simply enable +@code{bug-reference-mode}, only Rmail requires a slightly different +setup. + +@smallexample +;; Use VC-based setup if file is under version control. +(add-hook 'prog-mode-hook #'bug-reference-prog-mode) + +;; Gnus (summary & article buffers) +(add-hook 'gnus-mode-hook #'bug-reference-mode) + +;; Rmail +(add-hook 'rmail-show-message-hook #'bug-reference-mode-force-auto-setup) + +;; Rcirc +(add-hook 'rcirc-mode-hook #'bug-reference-mode) + +;; ERC +(add-hook 'erc-mode-hook #'bug-reference-mode) +@end smallexample + +In the Rmail case, instead of the mode hook, the +@code{rmail-show-message-hook} has to be used in combination with the +function @code{bug-reference-mode-force-auto-setup} which activates +@code{bug-reference-mode} and forces auto-setup. The reason is that +with Rmail all messages reside in the same buffer but the setup needs +to be performed whenever another messages is displayed. + + @heading Integration with the debbugs package @findex debbugs-browse-mode diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el index fc9627c272..141e97c3b0 100644 --- a/lisp/progmodes/bug-reference.el +++ b/lisp/progmodes/bug-reference.el @@ -372,8 +372,8 @@ From, and Cc against HEADER-REGEXP in "An alist for setting up `bug-reference-mode' in IRC modes. This takes action if `bug-reference-mode' is enabled in IRC -channels using one of Emacs' IRC clients (rcirc and ERC). -Currently, rcirc and ERC are supported. +channels using one of Emacs' IRC clients. Currently, rcirc and +ERC are supported. Each element has the form commit 5fe343a44cdd83c43793c86b92ab5dd16a29bc3a Author: Eric Abrahamsen Date: Fri May 21 13:35:38 2021 -0700 Robustify parsing of gnus-search search results * lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output): Look for a "process finished" tag, and don't choke on mis-parsed lines. diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index a59d0e57a7..fc9f8684f6 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1358,9 +1358,12 @@ Returns a list of [group article score] vectors." "\\|"))) artlist vectors article group) (goto-char (point-min)) - (while (not (eobp)) + (while (not (or (eobp) + (looking-at-p + "\\(?:[[:space:]\n]+\\)?Process .+ finished"))) (pcase-let ((`(,f-name ,score) (gnus-search-indexed-extract engine))) - (when (and (file-readable-p f-name) + (when (and f-name + (file-readable-p f-name) (null (file-directory-p f-name)) (or (null groups) (and (gnus-search-single-p query) commit 484bd8137a71d26fc712053c6904e16877ca9be3 Author: Basil L. Contovounesios Date: Fri May 21 20:49:32 2021 +0100 ; * etc/NEWS: Fix typo in last change. diff --git a/etc/NEWS b/etc/NEWS index acd7899b75..e11b860616 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -749,7 +749,7 @@ This can be switched off on a per-usage basis by providing 'dired-do-copy' with a 'C-u' prefix. *** New user option 'dired-do-revert-buffer'. -Non-nil reverts the destination Dired buffer after preforming one +Non-nil reverts the destination Dired buffer after performing one of these operations: 'dired-do-copy', 'dired-do-rename', 'dired-do-symlink', 'dired-do-hardlink'. commit 099caace34867a716224eeba5b9901373b06df28 Author: Juri Linkov Date: Fri May 21 21:31:48 2021 +0300 * lisp/dired-aux.el (dired-do-revert-buffer): New defcustom (bug#48456). (dired-do-create-files): Use it. diff --git a/etc/NEWS b/etc/NEWS index 693d0c0026..acd7899b75 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -748,6 +748,11 @@ If set to non-nil, Dired will dereference symbolic links when copying. This can be switched off on a per-usage basis by providing 'dired-do-copy' with a 'C-u' prefix. +*** New user option 'dired-do-revert-buffer'. +Non-nil reverts the destination Dired buffer after preforming one +of these operations: 'dired-do-copy', 'dired-do-rename', +'dired-do-symlink', 'dired-do-hardlink'. + *** New user option 'dired-mark-region' affects all Dired commands that mark files. When non-nil and the region is active in Transient Mark mode, then Dired commands operate only on files in the active diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index d57237f038..0ac4e54baf 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -2065,6 +2065,25 @@ ESC or `q' to not overwrite any of the remaining files, operation success-count)))) (dired-move-to-filename)) +(defcustom dired-do-revert-buffer nil + "Automatically revert Dired buffers after `dired-do' operations. +This option controls whether to refresh the directory listing in a +Dired buffer that is the destination of one of these operations: +`dired-do-copy', `dired-do-rename', `dired-do-symlink', `dired-do-hardlink'. +If the value is t, always revert the Dired buffer updated in the result +of these operations. +If the value is a function, it is called with the destination directory name +as a single argument, and the buffer is reverted after Dired operations +if the function returns non-nil." + :type '(choice + (const :tag "Don't revert" nil) + (const :tag "Always revert destination directory" t) + (const :tag "Revert only local Dired buffers" + (lambda (dir) (not (file-remote-p dir)))) + (function :tag "Predicate function")) + :group 'dired + :version "28.1") + (defun dired-do-create-files (op-symbol file-creator operation arg &optional marker-char op1 how-to) @@ -2168,7 +2187,12 @@ Optional arg HOW-TO determines how to treat the target. (lambda (from) (expand-file-name (file-name-nondirectory from) target)) (lambda (_from) target)) - marker-char)))) + marker-char) + (when (or (eq dired-do-revert-buffer t) + (and (functionp dired-do-revert-buffer) + (funcall dired-do-revert-buffer target))) + (dired-fun-in-all-buffers (file-name-directory target) nil + #'revert-buffer))))) ;; Read arguments for a marked-files command that wants a file name, ;; perhaps popping up the list of marked files. commit dfe79a8185bb1374e09096f81aba865adb33359f Author: Juri Linkov Date: Fri May 21 21:18:09 2021 +0300 * lisp/simple.el (yank-from-kill-ring): Fix kill-ring-yank-pointer (bug#48478) diff --git a/lisp/simple.el b/lisp/simple.el index f139555dd3..2a90a07631 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5772,9 +5772,8 @@ When called from Lisp, insert STRING like `insert-for-yank' does." (insert-for-yank string) (when yank-from-kill-ring-rotate (let ((pos (seq-position kill-ring string))) - (setq kill-ring-yank-pointer - (or (and pos (nthcdr pos kill-ring)) - kill-ring)))) + (when pos + (setq kill-ring-yank-pointer (nthcdr pos kill-ring))))) (if (consp arg) ;; Swap point and mark like in `yank' and `yank-pop'. (goto-char (prog1 (mark t) commit bab7e8546143d21e30c1d49bfdc1315a196c2c41 Author: Michael Albinus Date: Fri May 21 20:03:31 2021 +0200 ; * test/infra/gitlab-ci.yml: Fix it, again. diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index cd059fd990..fa10fa6761 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -110,15 +110,7 @@ default: - test -n "$(docker ps -aq -f name=${test_name})" && docker cp ${test_name}:checkout/test ${test_name} - test -n "$(docker ps -aq -f name=${test_name})" && docker rm ${test_name} -# We must declare it here, because it is used in .build-template. -prep-image-base: - stage: prep-images - extends: [.job-template, .build-template] - variables: - target: emacs-base - .build-template: - needs: [prep-image-base] rules: - if: '$CI_PIPELINE_SOURCE == "web"' when: always @@ -224,6 +216,7 @@ prep-image-base: build-image-inotify: stage: build-images extends: [.job-template, .build-template] + needs: [prep-image-base] variables: target: emacs-inotify @@ -251,12 +244,14 @@ test-lisp-net-inotify: build-image-filenotify-gio: stage: platform-images extends: [.job-template, .build-template, .filenotify-gio-template] + needs: [prep-image-base] variables: target: emacs-filenotify-gio build-image-gnustep: stage: platform-images extends: [.job-template, .build-template, .gnustep-template] + needs: [prep-image-base] variables: target: emacs-gnustep @@ -281,6 +276,7 @@ test-gnustep: build-native-bootstrap-speed0: stage: native-comp-images extends: [.job-template, .build-template, .native-comp-template] + needs: [prep-image-base] variables: target: emacs-native-comp-speed0 commit 9351da3862d917fde2fd9e2b7d6aea624914b018 Author: Michael Albinus Date: Fri May 21 20:00:55 2021 +0200 ; * test/infra/gitlab-ci.yml: Fix previous commit diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index edaa24cd4e..cd059fd990 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -110,6 +110,13 @@ default: - test -n "$(docker ps -aq -f name=${test_name})" && docker cp ${test_name}:checkout/test ${test_name} - test -n "$(docker ps -aq -f name=${test_name})" && docker rm ${test_name} +# We must declare it here, because it is used in .build-template. +prep-image-base: + stage: prep-images + extends: [.job-template, .build-template] + variables: + target: emacs-base + .build-template: needs: [prep-image-base] rules: commit 5fbbcdea2b94527b5bd476501dd54333eba649e1 Author: Michael Albinus Date: Fri May 21 19:33:42 2021 +0200 Adapt native-comp entries in gitlab-ci.yml * test/infra/gitlab-ci.yml (stages): New stages native-comp-images and native-comp. (build-native-bootstrap-speed0): Simplify. (build-native-bootstrap-speed1, build-native-bootstrap-speed2): Deactivate temporarily. * test/infra/gitlab-ci.yml (.build-template): Add 'needs:' clause. (.native-comp-template): New template. (build-native-bootstrap-speed0): Use it. diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index 7914a2c10e..edaa24cd4e 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -111,6 +111,7 @@ default: - test -n "$(docker ps -aq -f name=${test_name})" && docker rm ${test_name} .build-template: + needs: [prep-image-base] rules: - if: '$CI_PIPELINE_SOURCE == "web"' when: always @@ -181,6 +182,21 @@ default: - test/lisp/autorevert-tests.el - test/lisp/filenotify-tests.el +.native-comp-template: + rules: + - if: '$CI_PIPELINE_SOURCE == "web"' + - if: '$CI_PIPELINE_SOURCE == "schedule"' + changes: + - "**/Makefile.in" + - .gitlab-ci.yml + - lisp/emacs-lisp/comp.el + - lisp/emacs-lisp/comp-cstr.el + - src/comp.{h,m} + - test/infra/* + - test/src/comp-resources/*.el + - test/src/comp-tests.el + timeout: 8 hours + stages: - prep-images - build-images @@ -257,10 +273,9 @@ test-gnustep: build-native-bootstrap-speed0: stage: native-comp-images - extends: [.job-template, .build-template] + extends: [.job-template, .build-template, .native-comp-template] variables: target: emacs-native-comp-speed0 - timeout: 8 hours # build-native-bootstrap-speed0: # # Test a full native bootstrap commit fe8c1e7b1a683d0177ad1cbea0cc37b6f92d84f3 Author: Eli Zaretskii Date: Fri May 21 13:37:48 2021 +0300 Avoid byte-compiler warning during bootstrap * lisp/isearch.el (multi-isearch-switch-buffer): Avoid byte-compiler warning. diff --git a/lisp/isearch.el b/lisp/isearch.el index 00969e5e2a..232a994dfa 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -3462,6 +3462,10 @@ Can be changed via `isearch-search-fun-function' for special needs." (if isearch-forward #'re-search-forward #'re-search-backward) regexp bound noerror count)))) +;; This is for when we compile this file during bootstrap, with +;; loaddefs.el still not loaded. +(declare-function multi-isearch-switch-buffer "misearch" ()) + (defun isearch-search-string (string bound noerror) "Search for the first occurrence of STRING or its translation. STRING's characters are translated using `translation-table-for-input'