From e6c5f32e77dceed4e26b16889cc56547093bdc45 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Mon, 23 Jan 2023 09:55:29 +0200 Subject: [PATCH 01/30] * lisp/find-dired.el (find-dired): Fix bug where M-p skips first history item. Don't apply "skip first duplicate history item" trick when find-args used as initial input is nil. --- lisp/find-dired.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/find-dired.el b/lisp/find-dired.el index 9fa139a8025..33376ee4ed9 100644 --- a/lisp/find-dired.el +++ b/lisp/find-dired.el @@ -177,7 +177,9 @@ using GNU findutils (on macOS and *BSD systems), see instead the man page for \"find\"." (interactive (list (read-directory-name "Run find in directory: " nil "" t) (read-string "Run find (with args): " find-args - '(find-args-history . 1)))) + (if find-args + '(find-args-history . 1) + 'find-args-history)))) (setq find-args args ; save for next interactive call args (concat find-program " . " (if (string= args "") From cb9628373a8dcb5ace0cb8fcc7b636dea39b5703 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 23 Jan 2023 15:09:07 +0200 Subject: [PATCH 02/30] * lisp/startup.el (command-line): Fix warning message. (Bug#61014) --- lisp/startup.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/startup.el b/lisp/startup.el index cd1654f28cd..bb6250d3968 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1604,7 +1604,7 @@ please check its value") (display-warning 'initialization (format-message "\ Your `load-path' seems to contain\n\ -your `.emacs.d' directory: %s\n\ +your `user-emacs-directory': %s\n\ This is likely to cause problems...\n\ Consider using a subdirectory instead, e.g.: %s" dir (expand-file-name From 7f438ff543b7bd83cee6c75be1d16abc1215d37f Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Sun, 22 Jan 2023 22:54:53 -0800 Subject: [PATCH 03/30] Don't try to make a pipe process for remote processes in Eshell Tramp currently isn't able to handle this, so the result will just produce an error (bug#61024). * lisp/eshell/esh-proc.el (eshell-gather-process-output): Check for a remote 'default-directory' before trying to make a pipe process. * test/lisp/eshell/esh-proc-tests.el (esh-var-test/output/remote-redirect): New test. --- lisp/eshell/esh-proc.el | 9 +++++++-- test/lisp/eshell/esh-proc-tests.el | 13 +++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el index f1ec3a905b6..fcd59ab9f37 100644 --- a/lisp/eshell/esh-proc.el +++ b/lisp/eshell/esh-proc.el @@ -296,8 +296,13 @@ Used only on systems which do not support async subprocesses.") 'unix)))) (cond ((fboundp 'make-process) - (unless (equal (car (aref eshell-current-handles eshell-output-handle)) - (car (aref eshell-current-handles eshell-error-handle))) + (unless (or ;; FIXME: It's not currently possible to use a + ;; stderr process for remote files. + (file-remote-p default-directory) + (equal (car (aref eshell-current-handles + eshell-output-handle)) + (car (aref eshell-current-handles + eshell-error-handle)))) (eshell-protect-handles eshell-current-handles) (setq stderr-proc (make-pipe-process diff --git a/test/lisp/eshell/esh-proc-tests.el b/test/lisp/eshell/esh-proc-tests.el index ae7b1dddd69..8e02fbb5497 100644 --- a/test/lisp/eshell/esh-proc-tests.el +++ b/test/lisp/eshell/esh-proc-tests.el @@ -19,6 +19,7 @@ ;;; Code: +(require 'tramp) (require 'ert) (require 'esh-mode) (require 'eshell) @@ -85,6 +86,18 @@ "\\`\\'")) (should (equal (buffer-string) "stdout\nstderr\n")))) +(ert-deftest esh-var-test/output/remote-redirect () + "Check that redirecting stdout for a remote process works." + (skip-unless (and (eshell-tests-remote-accessible-p) + (executable-find "echo"))) + (let ((default-directory ert-remote-temporary-file-directory)) + (eshell-with-temp-buffer bufname "old" + (with-temp-eshell + (eshell-match-command-output + (format "*echo hello > #<%s>" bufname) + "\\`\\'")) + (should (equal (buffer-string) "hello\n"))))) + ;; Exit status From c15c0f7f018f5beea02175603f45ff5edf6d3837 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Mon, 23 Jan 2023 21:28:32 +0000 Subject: [PATCH 04/30] CC Mode: Change the default value of objc-font-lock-extra-types to nil This fixes bug #59234, in which random identifiers in a .m file were getting fontified as types. * lisp/progmodes/cc-vars.el (objc-font-lock-extra-types): Change the default value to nil. * etc/NEWS: Mention the change in default value of objc-font-lock-extra-types, and how to get the old behavior back. --- etc/NEWS | 6 ++++++ lisp/progmodes/cc-vars.el | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 64c26f93c50..dd026016382 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1679,6 +1679,12 @@ command is installed. --- *** C++ Mode now supports most of the new features in the C++20 Standard. +--- +*** In objective-C Mode, the default value of +objc-font-lock-extra-types has been changed to nil, since too many +identifiers were getting misfontified as types. This may cause some +actual types not to get fontified. To get the old behavior back, +customize the variable to the value suggested in its doc string. ** Cperl Mode diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index 2206e0fcab6..60ed3521b8a 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el @@ -1609,8 +1609,7 @@ as a type name.") :type 'c-extra-types-widget :group 'c) -(defcustom objc-font-lock-extra-types - (list (concat "[" c-upper "]\\sw*[" c-lower "]\\sw*")) +(defcustom objc-font-lock-extra-types nil (c-make-font-lock-extra-types-blurb "ObjC" "objc-mode" (concat "For example, a value of (\"[" c-upper "]\\\\sw*[" c-lower "]\\\\sw*\") means capitalized words are treated as type names (the requirement for a From bc78285e6864f07212c21f70fe62ba06a647256b Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 24 Jan 2023 09:27:17 +0100 Subject: [PATCH 05/30] ; * etc/NEWS: Fix typos. --- etc/NEWS | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index dd026016382..ec0c9650f76 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1679,12 +1679,14 @@ command is installed. --- *** C++ Mode now supports most of the new features in the C++20 Standard. + --- -*** In objective-C Mode, the default value of -objc-font-lock-extra-types has been changed to nil, since too many -identifiers were getting misfontified as types. This may cause some -actual types not to get fontified. To get the old behavior back, -customize the variable to the value suggested in its doc string. +*** In Objective C Mode, no extra types are recognized by default. +The default value of 'objc-font-lock-extra-types' has been changed to +nil, since too many identifiers were getting misfontified as types. +This may cause some actual types not to get fontified. To get the old +behavior back, customize the user option to the value suggested in its +doc string. ** Cperl Mode From deee3a92623ef6b2c879b99fd0dfa449ee4f420d Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 24 Jan 2023 18:27:57 +0100 Subject: [PATCH 06/30] ; Fix last change in etc/NEWS --- etc/NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index ec0c9650f76..5da9a069736 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1681,7 +1681,7 @@ command is installed. *** C++ Mode now supports most of the new features in the C++20 Standard. --- -*** In Objective C Mode, no extra types are recognized by default. +*** In Objective-C Mode, no extra types are recognized by default. The default value of 'objc-font-lock-extra-types' has been changed to nil, since too many identifiers were getting misfontified as types. This may cause some actual types not to get fontified. To get the old From e31a56239654a74b60e51f20799c8b09522082e4 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 24 Jan 2023 20:24:15 +0200 Subject: [PATCH 07/30] * lisp/vc/vc-bzr.el (vc-bzr--pushpull): Return buffer's process. * lisp/vc/vc-git.el (vc-git--pushpull): Add comment. * lisp/vc/vc.el (vc-pull-and-push): Expand docstring about prerequisites for backend to support this command (bug#60569). --- etc/NEWS | 2 +- lisp/vc/vc-bzr.el | 4 +++- lisp/vc/vc-git.el | 1 + lisp/vc/vc.el | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 5da9a069736..b034dab7e61 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2080,7 +2080,7 @@ This is in addition to the old keybindings 'C-c C-n' and 'C-c C-p'. --- *** New command 'vc-pull-and-push'. This commands first does a "pull" command, and if that is successful, -does a "push" command afterwards. +does a "push" command afterwards. Currently supported in Git and Bzr. +++ *** 'C-x v b' prefix key is used now for branch commands. diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index 6443f6d57aa..f66e37fffa4 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -381,7 +381,9 @@ If PROMPT is non-nil, prompt for the Bzr command to run." (setq-local compile-command (concat vc-bzr-program " " command " " (if args (mapconcat #'identity args " ") ""))))) - (vc-set-async-update buf)))) + (vc-set-async-update buf) + ;; Return the process for `vc-pull-and-push' + (get-buffer-process buf)))) (defun vc-bzr-pull (prompt) "Pull changes into the current Bzr branch. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 04aa37d6400..7ae763d2ee4 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1168,6 +1168,7 @@ If PROMPT is non-nil, prompt for the Git command to run." (lambda (_name-of-mode) buffer) nil)))) (vc-set-async-update buffer) + ;; Return the process for `vc-pull-and-push' proc)) (defun vc-git-pull (prompt) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index d4a3280f1bd..a181765eac3 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -3064,7 +3064,8 @@ On a distributed version control system, this runs a \"pull\" operation on the current branch, prompting for the precise command if required. Optional prefix ARG non-nil forces a prompt for the VCS command to run. If this is successful, a \"push\" -operation will then be done. +operation will then be done. This is supported only in backends +where the pull operation returns a process. On a non-distributed version control system, this signals an error. It also signals an error in a Bazaar bound branch." From 695e9f71c3f13c1338de5bb653d71462a6e436b8 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Tue, 24 Jan 2023 20:37:56 +0200 Subject: [PATCH 08/30] Use named keymaps for outline buttons https://lists.gnu.org/archive/html/emacs-devel/2023-01/msg00334.html * lisp/outline.el (outline-button-icon-map) (outline-overlay-button-map, outline-inserted-button-map): Keymaps refactored from outline--create-button-icons and outline--insert-button. (outline--create-button-icons, outline--insert-button): Move keymaps to separate variables. --- lisp/outline.el | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/lisp/outline.el b/lisp/outline.el index 0bfda8388ed..a89985d1990 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -1776,6 +1776,20 @@ With a prefix argument, show headings up to that LEVEL." ;;; Button/margin indicators +(defvar-keymap outline-button-icon-map + "" #'outline-cycle + ;; Need to override the global binding + ;; `mouse-appearance-menu' with : + "S-" #'ignore + "S-" #'outline-cycle-buffer) + +(defvar-keymap outline-overlay-button-map + "RET" #'outline-cycle) + +(defvar-keymap outline-inserted-button-map + :parent (make-composed-keymap outline-button-icon-map + outline-overlay-button-map)) + (defun outline--create-button-icons () (pcase outline-minor-mode-use-buttons ('in-margins @@ -1808,12 +1822,7 @@ With a prefix argument, show headings up to that LEVEL." (propertize (icon-string icon-name) 'mouse-face 'default 'follow-link 'mouse-face - 'keymap (define-keymap - "" #'outline-cycle - ;; Need to override the global binding - ;; `mouse-appearance-menu' with : - "S-" #'ignore - "S-" #'outline-cycle-buffer))) + 'keymap outline-button-icon-map)) (list 'outline-open (if outline--use-rtl 'outline-close-rtl 'outline-close)))))) @@ -1839,19 +1848,13 @@ With a prefix argument, show headings up to that LEVEL." (overlay-put o 'face (plist-get icon 'face)) (overlay-put o 'follow-link 'mouse-face) (overlay-put o 'mouse-face 'highlight) - (overlay-put o 'keymap (define-keymap - "RET" #'outline-cycle - "" #'outline-cycle - ;; Need to override the global binding - ;; `mouse-appearance-menu' with : - "S-" #'ignore - "S-" #'outline-cycle-buffer))) + (overlay-put o 'keymap outline-inserted-button-map)) ('in-margins (overlay-put o 'before-string icon) - (overlay-put o 'keymap (define-keymap "RET" #'outline-cycle))) + (overlay-put o 'keymap outline-overlay-button-map)) (_ (overlay-put o 'before-string icon) - (overlay-put o 'keymap (define-keymap "RET" #'outline-cycle)))))))) + (overlay-put o 'keymap outline-overlay-button-map))))))) (defun outline--fix-up-all-buttons (&optional from to) (when outline-minor-mode-use-buttons From ecf500b5e34f3767df6b41f110efcf307c74ebc9 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 24 Jan 2023 20:48:20 +0200 Subject: [PATCH 09/30] Handle relative file names in vc-resynch-window and vc-resynch-buffer * lisp/vc/vc-dispatcher.el (vc-resynch-window, vc-resynch-buffer): While comparing with `buffer-file-name' if `file' is not absolute use `expand-file-name' in `vc-root-dir'. This fixes the case of refreshing the buffers after typing `C-x v = C-x v u' (bug#60897). --- lisp/vc/vc-dispatcher.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index e1a3eff448d..fd5f655a0f6 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -608,7 +608,10 @@ reverting. NOQUERY should be t *only* if it is known the only difference between the buffer and the file is due to modifications by the dispatcher client code, rather than user editing!" - (and (string= buffer-file-name file) + (and (string= buffer-file-name + (if (file-name-absolute-p file) + file + (expand-file-name file (vc-root-dir)))) (if keep (when (file-exists-p file) (when reset-vc-info @@ -643,7 +646,10 @@ editing!" (defun vc-resynch-buffer (file &optional keep noquery reset-vc-info) "If FILE is currently visited, resynch its buffer." - (if (string= buffer-file-name file) + (if (string= buffer-file-name + (if (file-name-absolute-p file) + file + (expand-file-name file (vc-root-dir)))) (vc-resynch-window file keep noquery reset-vc-info) (if (file-directory-p file) (vc-resynch-buffers-in-directory file keep noquery reset-vc-info) From 3846e79c93bc018b28d1d24ad5f1e038e50f39be Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Tue, 24 Jan 2023 02:34:29 -0800 Subject: [PATCH 10/30] ; Fix filename mismatches in prop lines of ERC tests * test/lisp/erc/erc-scenarios-base-compat-rename-bouncer.el: Fix file name in prop line and footer. * test/lisp/erc/erc-scenarios-base-local-modules.el: Fix file name in prop line and footer. * test/lisp/erc/erc-scenarios-base-netid-samenet.el: Fix file name in prop line and footer. * test/lisp/erc/erc-scenarios-base-upstream-recon-soju.el: Fix file name in prop line and footer. * test/lisp/erc/erc-scenarios-base-upstream-recon-znc.el: Fix file name in prop line and footer. --- .../erc-scenarios-base-compat-rename-bouncer.el | 4 ++-- test/lisp/erc/erc-scenarios-base-local-modules.el | 15 ++++++++------- test/lisp/erc/erc-scenarios-base-netid-samenet.el | 4 ++-- .../erc/erc-scenarios-base-upstream-recon-soju.el | 7 ++++--- .../erc/erc-scenarios-base-upstream-recon-znc.el | 7 ++++--- 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/test/lisp/erc/erc-scenarios-base-compat-rename-bouncer.el b/test/lisp/erc/erc-scenarios-base-compat-rename-bouncer.el index 74d4444ccd2..9275aba2875 100644 --- a/test/lisp/erc/erc-scenarios-base-compat-rename-bouncer.el +++ b/test/lisp/erc/erc-scenarios-base-compat-rename-bouncer.el @@ -1,4 +1,4 @@ -;;; erc-scenarios-compat-rename-bouncer.el --- compat-rename scenarios -*- lexical-binding: t -*- +;;; erc-scenarios-base-compat-rename-bouncer.el --- Compat-rename scenarios -*- lexical-binding: t -*- ;; Copyright (C) 2022-2023 Free Software Foundation, Inc. @@ -169,4 +169,4 @@ (erc-scenarios-common--base-compat-no-rename-bouncer dialogs 'auto after))))) -;;; erc-scenarios-compat-rename-bouncer.el ends here +;;; erc-scenarios-base-compat-rename-bouncer.el ends here diff --git a/test/lisp/erc/erc-scenarios-base-local-modules.el b/test/lisp/erc/erc-scenarios-base-local-modules.el index 916d105779a..1318207a3bf 100644 --- a/test/lisp/erc/erc-scenarios-base-local-modules.el +++ b/test/lisp/erc/erc-scenarios-base-local-modules.el @@ -1,4 +1,4 @@ -;;; erc-scenarios-local-modules.el --- Local modules tests for ERC -*- lexical-binding: t -*- +;;; erc-scenarios-base-local-modules.el --- Local-module tests for ERC -*- lexical-binding: t -*- ;; Copyright (C) 2022-2023 Free Software Foundation, Inc. @@ -22,14 +22,15 @@ ;; A local module doubles as a minor mode whose mode variable and ;; associated local data can withstand service disruptions. ;; Unfortunately, the current implementation is too unwieldy to be -;; made public because it doesn't perform any of the boiler plate -;; needed to save and restore buffer-local and "network-local" copies -;; of user options. Ultimately, a user-friendly framework must fill -;; this void if third-party local modules are ever to become +;; promoted publicly because it doesn't perform any of the boiler +;; plate needed to save and restore buffer-local and "network-local" +;; copies of user options. Ultimately, a user-friendly framework must +;; fill this void if third-party local modules are ever to become ;; practical. ;; ;; The following tests all use `sasl' because, as of ERC 5.5, it's the -;; only local module. +;; only connection-oriented local module. A fictitious +;; target-oriented module is defined below for testing purposes. ;;; Code: @@ -325,4 +326,4 @@ (funcall expect 10 "User modes for tester") (should (eql erc-scenarios-base-local-modules--local-var 1)))))) -;;; erc-scenarios-local-modules.el ends here +;;; erc-scenarios-base-local-modules.el ends here diff --git a/test/lisp/erc/erc-scenarios-base-netid-samenet.el b/test/lisp/erc/erc-scenarios-base-netid-samenet.el index 7304dead44c..997dab93735 100644 --- a/test/lisp/erc/erc-scenarios-base-netid-samenet.el +++ b/test/lisp/erc/erc-scenarios-base-netid-samenet.el @@ -1,4 +1,4 @@ -;;; erc-scenarios-base-network-id-samenet.el --- netid-id samenet scenarios -*- lexical-binding: t -*- +;;; erc-scenarios-base-netid-samenet.el --- One-network net-ID scenarios -*- lexical-binding: t -*- ;; Copyright (C) 2022-2023 Free Software Foundation, Inc. @@ -148,4 +148,4 @@ :server "foonet/chester" :chan "#chan@foonet/chester"))) -;;; erc-scenarios-base-network-id-samenet.el ends here +;;; erc-scenarios-base-netid-samenet.el ends here diff --git a/test/lisp/erc/erc-scenarios-base-upstream-recon-soju.el b/test/lisp/erc/erc-scenarios-base-upstream-recon-soju.el index 28b0db77be6..fc8be982f65 100644 --- a/test/lisp/erc/erc-scenarios-base-upstream-recon-soju.el +++ b/test/lisp/erc/erc-scenarios-base-upstream-recon-soju.el @@ -1,4 +1,4 @@ -;;; erc-scenarios-upstream-recon-soju.el --- Upstream soju -*- lexical-binding: t -*- +;;; erc-scenarios-base-upstream-recon-soju.el --- Bouncer recon scenario -*- lexical-binding: t -*- ;; Copyright (C) 2022-2023 Free Software Foundation, Inc. @@ -19,7 +19,8 @@ ;; Commentary: -;; These concern the loss and recovery of a proxy's IRC-side connection. +;; These concern the loss and recovery of a proxy's IRC-side +;; connection (hence "upstream"). ;;; Code: @@ -41,4 +42,4 @@ 'soju-foonet 'soju-barnet)) -;;; erc-scenarios-upstream-recon-soju.el ends here +;;; erc-scenarios-base-upstream-recon-soju.el ends here diff --git a/test/lisp/erc/erc-scenarios-base-upstream-recon-znc.el b/test/lisp/erc/erc-scenarios-base-upstream-recon-znc.el index 79e1349bd95..461dac27b21 100644 --- a/test/lisp/erc/erc-scenarios-base-upstream-recon-znc.el +++ b/test/lisp/erc/erc-scenarios-base-upstream-recon-znc.el @@ -1,4 +1,4 @@ -;;; erc-scenarios-upstream-recon-znc.el --- Upstream znc -*- lexical-binding: t -*- +;;; erc-scenarios-base-upstream-recon-znc.el --- Bouncer recon scenario -*- lexical-binding: t -*- ;; Copyright (C) 2022-2023 Free Software Foundation, Inc. @@ -19,7 +19,8 @@ ;; Commentary: -;; These concern the loss and recovery of a proxy's IRC-side connection. +;; These concern the loss and recovery of a proxy's IRC-side +;; connection (hence "upstream"). ;;; Code: @@ -41,4 +42,4 @@ 'znc-foonet 'znc-barnet)) -;;; erc-scenarios-upstream-recon-znc.el ends here +;;; erc-scenarios-base-upstream-recon-znc.el ends here From 987e53f3e2d72d15c2d043beb2b9ed4ada118fe0 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Tue, 24 Jan 2023 19:49:02 -0800 Subject: [PATCH 11/30] ; * doc/misc/erc.texi: Improve Local Modules section. --- doc/misc/erc.texi | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index 23cdcbff575..8030dfa4bb7 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -539,36 +539,55 @@ so demands special precautions to avoid degrading the user experience. At present, the only such module is @code{networks}, whose library ERC always loads anyway. +@anchor{Local Modules} @subheading Local Modules @cindex local modules All modules operate as minor modes under the hood, and some newer ones may be defined as buffer-local. These so-called ``local modules'' are a work in progress and their behavior and interface are subject to -change. As of ERC 5.5, the only practical differences are +change. As of ERC 5.5, the only practical differences are as follows: @enumerate @item -``Control variables,'' like @code{erc-sasl-mode}, are stateful across -IRC sessions and override @code{erc-module} membership when influencing -module activation in new sessions. +``Control variables,'' like @code{erc-sasl-mode}, retain their values +across IRC sessions and override @code{erc-module} membership when +influencing module activation. @item Removing a local module from @code{erc-modules} via Customize not only disables its mode but also kills its control variable in all ERC buffers. @item -``Mode toggles,'' like @code{erc-sasl-mode} and -@code{erc-sasl-enable}, behave differently relative to each other and -to their global counterparts. (More on this just below.) +``Mode toggles,'' like @code{erc-sasl-mode} and the complementary +@code{erc-sasl-enable}/@code{erc-sasl-disable} pairing, behave +differently than their global counterparts. @end enumerate -By default, all local-mode toggles, like @code{erc-sasl-mode}, only -affect the current buffer, but their ``non-mode'' variants, such as -@code{erc-sasl-enable}, operate on all buffers belonging to a -connection when called interactively. Keep in mind that whether -enabled or not, a module may effectively be ``inert'' in certain types -of buffers, such as queries and channels. Whatever the case, a local -toggle never mutates @code{erc-modules}. +In target buffers, a local module's activation state survives +``reassociation'' by default, but modules themselves always have the +final say. For example, a module may reset all instances of itself in +its network context upon reconnecting. Moreover, the value of a mode +variable may be meaningless in buffers that its module has no interest +in. For example, the value of @code{erc-sasl-mode} doesn't matter in +target buffers and may even remain non-@code{nil} after SASL has been +disabled for the current connection (and vice versa). + +When it comes to server buffers, a module's activation state only +persists for sessions revived via the automatic reconnection mechanism +or a manual @samp{/reconnect} issued at the prompt. In other words, +this doesn't apply to sessions revived by an entry-point command, such +as @code{erc-tls}, because such commands always ensure a clean slate +by looking only to @code{erc-modules}. Although a session revived in +this manner may indeed harvest other information from a previous +server buffer, it simply doesn't care which modules might have been +active during that connection. + +Lastly, a local mode's toggle command, like @code{erc-sasl-mode}, only +affects the current buffer, but its ``non-mode'' cousins, like +@code{erc-sasl-enable} and @code{erc-sasl-disable}, operate on all +buffers belonging to their connection (when called interactively). +And unlike global toggles, none of these ever mutates +@code{erc-modules}. @c PRE5_4: Document every option of every module in its own subnode From cfe26f31893681fcba36a635546d62ab512524ab Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Wed, 25 Jan 2023 13:00:33 +0100 Subject: [PATCH 12/30] Add new java indent rules * lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): Check for enum_body_declarations and switch_label. --- lisp/progmodes/java-ts-mode.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index af2b0c1fa8d..8737472e514 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el @@ -81,6 +81,7 @@ ((parent-is "annotation_type_body") parent-bol java-ts-mode-indent-offset) ((parent-is "interface_body") parent-bol java-ts-mode-indent-offset) ((parent-is "constructor_body") parent-bol java-ts-mode-indent-offset) + ((parent-is "enum_body_declarations") parent-bol 0) ((parent-is "enum_body") parent-bol java-ts-mode-indent-offset) ((parent-is "switch_block") parent-bol java-ts-mode-indent-offset) ((parent-is "record_declaration_body") parent-bol java-ts-mode-indent-offset) @@ -93,6 +94,7 @@ ((parent-is "variable_declarator") parent-bol java-ts-mode-indent-offset) ((parent-is "method_invocation") parent-bol java-ts-mode-indent-offset) ((parent-is "switch_rule") parent-bol java-ts-mode-indent-offset) + ((parent-is "switch_label") parent-bol java-ts-mode-indent-offset) ((parent-is "ternary_expression") parent-bol java-ts-mode-indent-offset) ((parent-is "lambda_expression") parent-bol java-ts-mode-indent-offset) ((parent-is "element_value_array_initializer") parent-bol java-ts-mode-indent-offset) From 8a1498c01f76391f61c8bd9861a31fec42e1073a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jostein=20Kj=C3=B8nigsen?= Date: Wed, 25 Jan 2023 10:38:09 +0100 Subject: [PATCH 13/30] Fix fontification of function-valued variables (bug#61053) * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--font-lock-settings): Remove overrides and reorder the variable_declarator rule. --- lisp/progmodes/typescript-ts-mode.el | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 34030968806..25cc327d05f 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -132,26 +132,21 @@ Argument LANGUAGE is either `typescript' or `tsx'." Argument LANGUAGE is either `typescript' or `tsx'." (treesit-font-lock-rules :language language - :override t :feature 'comment `((comment) @font-lock-comment-face) :language language - :override t :feature 'constant `(((identifier) @font-lock-constant-face (:match "^[A-Z_][A-Z_\\d]*$" @font-lock-constant-face)) - [(true) (false) (null)] @font-lock-constant-face) :language language - :override t :feature 'keyword `([,@typescript-ts-mode--keywords] @font-lock-keyword-face [(this) (super)] @font-lock-keyword-face) :language language - :override t :feature 'string `((regex pattern: (regex_pattern)) @font-lock-regexp-face (string) @font-lock-string-face @@ -159,7 +154,7 @@ Argument LANGUAGE is either `typescript' or `tsx'." (template_substitution ["${" "}"] @font-lock-misc-punctuation-face)) :language language - :override t + :override t ;; for functions assigned to variables :feature 'declaration `((function name: (identifier) @font-lock-function-name-face) @@ -174,6 +169,10 @@ Argument LANGUAGE is either `typescript' or `tsx'." (required_parameter (identifier) @font-lock-variable-name-face) (optional_parameter (identifier) @font-lock-variable-name-face) + (variable_declarator + name: (identifier) @font-lock-function-name-face + value: [(function) (arrow_function)]) + (variable_declarator name: (identifier) @font-lock-variable-name-face) @@ -188,10 +187,6 @@ Argument LANGUAGE is either `typescript' or `tsx'." (arrow_function parameter: (identifier) @font-lock-variable-name-face) - (variable_declarator - name: (identifier) @font-lock-function-name-face - value: [(function) (arrow_function)]) - (variable_declarator name: (array_pattern (identifier) @@ -205,7 +200,6 @@ Argument LANGUAGE is either `typescript' or `tsx'." (import_clause (named_imports (import_specifier (identifier)) @font-lock-variable-name-face))) :language language - :override t :feature 'identifier `((nested_type_identifier module: (identifier) @font-lock-type-face) @@ -234,7 +228,6 @@ Argument LANGUAGE is either `typescript' or `tsx'." (_ (_ (_ (identifier) @font-lock-variable-name-face)))])) :language language - :override t :feature 'property `((property_signature name: (property_identifier) @font-lock-property-face) @@ -249,7 +242,6 @@ Argument LANGUAGE is either `typescript' or `tsx'." @font-lock-property-face)) :language language - :override t :feature 'expression '((assignment_expression left: [(identifier) @font-lock-function-name-face @@ -266,7 +258,6 @@ Argument LANGUAGE is either `typescript' or `tsx'." property: (property_identifier) @font-lock-function-name-face)])) :language language - :override t :feature 'pattern `((pair_pattern key: (property_identifier) @font-lock-property-face) @@ -274,7 +265,6 @@ Argument LANGUAGE is either `typescript' or `tsx'." (array_pattern (identifier) @font-lock-variable-name-face)) :language language - :override t :feature 'jsx `((jsx_opening_element [(nested_identifier (identifier)) (identifier)] From 8198803f66098686d817d06a5ebdc5b81bab3566 Mon Sep 17 00:00:00 2001 From: Arash Esbati Date: Wed, 25 Jan 2023 11:02:24 +0100 Subject: [PATCH 14/30] ; Don't mention in the Gnus manual user options that were removed * doc/misc/gnus.texi (HTML): Delete entries for custom variables removed in commit 2c8b2fc8d5. (Bug#61054) --- doc/misc/gnus.texi | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 3289d66f017..1769b70c9bc 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -12106,17 +12106,6 @@ if they were public groups, you can add the name of that group to the Also @pxref{Misc Article} for @code{gnus-inhibit-images}. -@item gnus-html-cache-directory -@vindex gnus-html-cache-directory -Gnus will download and cache images according to how -@code{gnus-blocked-images} is set. These images will be stored in -this directory. - -@item gnus-html-cache-size -@vindex gnus-html-cache-size -When @code{gnus-html-cache-size} bytes have been used in that -directory, the oldest files will be deleted. The default is 500MB. - @item gnus-html-frame-width @vindex gnus-html-frame-width The width to use when rendering HTML@. The default is 70. From f30a4f51fefa7251386d7393920a082f3830bcac Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Wed, 25 Jan 2023 14:23:44 +0100 Subject: [PATCH 15/30] Announce outline.el keymaps * etc/NEWS: Announce new keymaps. --- etc/NEWS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index b034dab7e61..10dddf8c84b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1126,6 +1126,12 @@ buffer, and you can use 'RET' to cycle outline visibility. When the value is 'in-margins', Outline Minor Mode uses the window margins for buttons that hide/show outlines. ++++ +*** buttons and headings now have their own keymap. +'outline-button-icon-map', 'outline-overlay-button-map', and +'outline-inserted-button-map' are now available as defined keymaps +instead of being anonymous keymaps. + ** Windows +++ From 9a21cb107516d45a5b1ca43e4204f2c93cbf12fd Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 25 Jan 2023 15:31:33 +0100 Subject: [PATCH 16/30] ; * etc/NEWS: Fix typos. --- etc/NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 10dddf8c84b..133cdb1e718 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1127,7 +1127,7 @@ the value is 'in-margins', Outline Minor Mode uses the window margins for buttons that hide/show outlines. +++ -*** buttons and headings now have their own keymap. +*** Buttons and headings now have their own keymaps. 'outline-button-icon-map', 'outline-overlay-button-map', and 'outline-inserted-button-map' are now available as defined keymaps instead of being anonymous keymaps. From 37454de0c8f07584a1604d54acc97e4bc1c9ddfc Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Wed, 25 Jan 2023 01:02:30 +0000 Subject: [PATCH 17/30] Pacify --without-x unused function warning * src/xfaces.c (font_maybe_unset_attribute): Move definition... [HAVE_WINDOW_SYSTEM] (font_maybe_unset_attribute): ...to here, since the function is used only when we HAVE_WINDOW_SYSTEM (bug#61049). --- src/xfaces.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xfaces.c b/src/xfaces.c index 68f7cc493cc..35b79154805 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -6012,7 +6012,6 @@ realize_non_ascii_face (struct frame *f, Lisp_Object font_object, return face; } -#endif /* HAVE_WINDOW_SYSTEM */ /* Remove the attribute at INDEX from the font object if SYMBOL appears in `font-fallback-ignored-attributes'. */ @@ -6031,6 +6030,7 @@ font_maybe_unset_attribute (Lisp_Object font_object, ASET (font_object, index, Qnil); } } +#endif /* HAVE_WINDOW_SYSTEM */ /* Realize the fully-specified face with attributes ATTRS in face cache CACHE for ASCII characters. Do it for GUI frame CACHE->f. From c6613403e5cb5e2f0043d16530be046922d23f43 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Wed, 25 Jan 2023 14:24:39 +0000 Subject: [PATCH 18/30] Fix Dired face for directory symlinks * lisp/dired.el (dired-font-lock-keywords): Fontify directory symlinks with the value of dired-directory-face rather than its name as a (nonexistent) face (bug#60977). --- lisp/dired.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/dired.el b/lisp/dired.el index 42d15f27a54..2bcb28a0e00 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -789,7 +789,7 @@ Subexpression 2 must end right before the \\n.") '(dired-move-to-filename) nil '(1 dired-symlink-face) - '(2 '(face dired-directory-face dired-symlink-filename t)))) + '(2 `(face ,dired-directory-face dired-symlink-filename t)))) ;; ;; Symbolic link to a non-directory. (list dired-re-sym From abb3becb9fb925a4fc3c13da677cc55823423cb3 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Wed, 25 Jan 2023 17:01:28 +0200 Subject: [PATCH 19/30] treesit-install-language-grammar: Provide default repo url * lisp/treesit.el (treesit--check-repo-url): New function. (treesit--install-language-grammar-build-recipe): Use it (bug#61051). --- lisp/treesit.el | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lisp/treesit.el b/lisp/treesit.el index 660039cc7cc..4c9bdfc0bd4 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -2707,8 +2707,10 @@ See `treesit-language-source-alist' for details." (if (equal string "") nil string))) (list lang - (read-string - "Enter the URL of the Git repository of the language grammar: ") + (let ((repo-default (format "https://github.com/tree-sitter/tree-sitter-%s" lang))) + (read-string + "Enter the URL of the Git repository of the language grammar: " + (and (treesit--check-repo-url repo-default) repo-default))) (empty-string-to-nil (read-string "Enter the tag or branch (default: default branch): ")) @@ -2722,6 +2724,16 @@ See `treesit-language-source-alist' for details." (read-string "Enter the C++ compiler to use (default: auto-detect): ")))))) +(defun treesit--check-repo-url (url) + (defvar url-request-method) + (let ((url-request-method "HEAD")) + (let ((buffer (condition-case nil (url-retrieve-synchronously url t t) + (file-error nil)))) + (and buffer + (eql + (buffer-local-value 'url-http-response-status buffer) + 200))))) + ;;;###autoload (defun treesit-install-language-grammar (lang) "Build and install the tree-sitter language grammar library for LANG. From cfb180329b567d907c11fc9f2bd24728729ec689 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Wed, 25 Jan 2023 17:21:49 +0200 Subject: [PATCH 20/30] ruby-ts-mode: Don't reindent when "class" or "def" is under "ERROR" * lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules): Don't reindent when "class" or "def" is under "ERROR" (bug#61017). --- lisp/progmodes/ruby-ts-mode.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index eff846f8585..60215978176 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -566,6 +566,12 @@ a statement container is a node that matches ((n-p-gp nil nil "regex") no-indent 0) ((parent-is "regex") no-indent 0) + ;; Incomplete buffer state, better not reindent (bug#61017). + ((and (parent-is "ERROR") + (or (node-is ,ruby-ts--class-or-module-regex) + (node-is "\\`def\\'"))) + no-indent 0) + ;; if then else elseif notes: ;; ;; 1. The "then" starts at the end of the line that ends From 37c1c924666c991f893b5b1959783ba9d961a3c8 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 25 Jan 2023 19:38:01 +0200 Subject: [PATCH 21/30] ; * etc/NEWS: Minor reordering. Move Exif section closer to Image changes, define-keymap/defvar-keymap and lookup-key closer to Keymaps section. --- etc/NEWS | 74 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 133cdb1e718..4d199676848 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2730,6 +2730,13 @@ some commands and user options are no longer needed and are now obsolete: 'image-dired-display-window-width-correction', 'image-dired-temp-image-file'. +** Exif + +--- +*** New function 'exif-field'. +This is a convenience function to extract the field data from +'exif-parse-file' and 'exif-parse-buffer'. + ** Bookmarks --- @@ -2751,13 +2758,6 @@ It is bound to the new command 'bookmark-edit-annotation-cancel'. This option controls the bitmap used to indicate bookmarks in the fringe (or nil to disable showing this marker). -** Exif - ---- -*** New function 'exif-field'. -This is a convenience function to extract the field data from -'exif-parse-file' and 'exif-parse-buffer'. - ** Xwidget --- @@ -4275,6 +4275,24 @@ vectors and strings. The new 'key' type can be used for options that should be a valid key according to 'key-valid-p'. The type 'key-sequence' is now obsolete. ++++ +** New function 'define-keymap'. +This function allows defining a number of keystrokes with one form. + ++++ +** New macro 'defvar-keymap'. +This macro allows defining keymap variables more conveniently. + +** 'defvar-keymap' can specify 'repeat-mode' behavior for the keymap. +Use ':repeat t' to have all bindings be repeatable or for more +advanced usage: + + :repeat (:enter (commands ...) :exit (commands ...)) + +--- +** 'kbd' can now be used in built-in, preloaded libraries. +It no longer depends on edmacro.el and cl-lib.el. + +++ ** New substitution in docstrings and 'substitute-command-keys'. Use \\`KEYSEQ' to insert a literal key sequence "KEYSEQ" (for example @@ -4284,6 +4302,18 @@ be used only when a key sequence has no corresponding command, for example when it is read directly with 'read-key-sequence'. It must be a valid key sequence according to 'key-valid-p'. +--- +** 'lookup-key' is more permissive when searching for extended menu items. +In Emacs 28.1, the behavior of 'lookup-key' was changed: when looking +for a menu item '[menu-bar Foo-Bar]', first try to find an exact +match, then look for the lowercased '[menu-bar foo-bar]'. + +This has been extended, so that when looking for a menu item with a +symbol containing spaces, as in '[menu-bar Foo\ Bar]', first look for +an exact match, then the lowercased '[menu-bar foo\ bar]' and finally +'[menu-bar foo-bar]'. This further improves backwards-compatibility +when converting menus to use 'easy-menu-define'. + +++ ** New function 'file-name-split'. This returns a list of all the components of a file name. @@ -4483,24 +4513,6 @@ permanent local variables. ** Third 'mapconcat' argument SEPARATOR is now optional. An explicit nil always meant the empty string, now it can be left out. -+++ -** New function 'define-keymap'. -This function allows defining a number of keystrokes with one form. - -+++ -** New macro 'defvar-keymap'. -This macro allows defining keymap variables more conveniently. - -** 'defvar-keymap' can specify 'repeat-mode' behavior for the keymap. -Use ':repeat t' to have all bindings be repeatable or for more -advanced usage: - - :repeat (:enter (commands ...) :exit (commands ...)) - ---- -** 'kbd' can now be used in built-in, preloaded libraries. -It no longer depends on edmacro.el and cl-lib.el. - +++ ** New function 'image-at-point-p'. This function returns t if point is on a valid image, and nil @@ -4524,18 +4536,6 @@ separate glyphs. This takes into account combining characters and grapheme clusters, by treating each sequence of characters composed on display as a single unit. ---- -** 'lookup-key' is more permissive when searching for extended menu items. -In Emacs 28.1, the behavior of 'lookup-key' was changed: when looking -for a menu item '[menu-bar Foo-Bar]', first try to find an exact -match, then look for the lowercased '[menu-bar foo-bar]'. - -This has been extended, so that when looking for a menu item with a -symbol containing spaces, as in '[menu-bar Foo\ Bar]', first look for -an exact match, then the lowercased '[menu-bar foo\ bar]' and finally -'[menu-bar foo-bar]'. This further improves backwards-compatibility -when converting menus to use 'easy-menu-define'. - ** Xwidget +++ From 42e02480c2b70b4a7065690a528d2f3fda017b3b Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 25 Jan 2023 20:19:44 +0200 Subject: [PATCH 22/30] * doc/emacs/text.texi (Outline Minor Mode): New node split from "Outline Mode" (Outline Mode): Move all outline-minor-mode related information to the new node "Outline Minor Mode" (bug#61062). --- doc/emacs/text.texi | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index 8fbf731a4f7..83d5869ee64 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -958,8 +958,6 @@ hooks. @cindex invisible lines @findex outline-mode -@findex outline-minor-mode -@vindex outline-minor-mode-prefix @vindex outline-mode-hook Outline mode is a major mode derived from Text mode, which is specialized for editing outlines. It provides commands to navigate @@ -982,6 +980,19 @@ previous visible line. Killing the ellipsis at the end of a visible line really kills all the following invisible text associated with the ellipsis. +@menu +* Outline Minor Mode:: Outline mode to use with other major modes. +* Outline Format:: What the text of an outline looks like. +* Outline Motion:: Special commands for moving through outlines. +* Outline Visibility:: Commands to control what is visible. +* Outline Views:: Outlines and multiple views. +* Foldout:: Folding means zooming in on outlines. +@end menu + +@node Outline Minor Mode +@subsection Outline Minor Mode + +@findex outline-minor-mode Outline minor mode is a buffer-local minor mode which provides the same commands as the major mode, Outline mode, but can be used in conjunction with other major modes. You can type @kbd{M-x @@ -990,6 +1001,7 @@ buffer, or use a file-local variable setting to enable it in a specific file (@pxref{File Variables}). @kindex C-c @@ @r{(Outline minor mode)} +@vindex outline-minor-mode-prefix The major mode, Outline mode, provides special key bindings on the @kbd{C-c} prefix. Outline minor mode provides similar bindings with @kbd{C-c @@} as the prefix; this is to reduce the conflicts with the @@ -1014,14 +1026,6 @@ outline heading lines. @kbd{TAB} cycles hiding, showing the sub-heading, and showing all for the current section. @kbd{S-@key{TAB}} does the same for the entire buffer. -@menu -* Outline Format:: What the text of an outline looks like. -* Outline Motion:: Special commands for moving through outlines. -* Outline Visibility:: Commands to control what is visible. -* Outline Views:: Outlines and multiple views. -* Foldout:: Folding means zooming in on outlines. -@end menu - @node Outline Format @subsection Format of Outlines From af28191b04fa3e70caeea83c1c8a6c16a57adece Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 25 Jan 2023 20:14:12 +0100 Subject: [PATCH 23/30] * lisp/net/tramp.el (tramp-wrong-passwd-regexp): Fix regexp. --- lisp/net/tramp.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 123d01c747d..04b683a8a24 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -659,7 +659,7 @@ The `sudo' program appears to insert a `^@' character into the prompt." (defcustom tramp-wrong-passwd-regexp (rx bol (* nonl) (| "Permission denied" - "Login [Ii]ncorrect" + (: "Login " (| "Incorrect" "incorrect")) "Connection refused" "Connection closed" "Timeout, server not responding." From 00675aa724a6e18d03c2ccc63269ef03c67086ec Mon Sep 17 00:00:00 2001 From: Randy Taylor Date: Thu, 19 Jan 2023 09:16:55 -0500 Subject: [PATCH 24/30] Add support for building tree-sitter modules with MinGW * admin/notes/tree-sitter/build-module/build.sh: Add support for building tree-sitter modules with MinGW. --- admin/notes/tree-sitter/build-module/build.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/admin/notes/tree-sitter/build-module/build.sh b/admin/notes/tree-sitter/build-module/build.sh index f0962940287..9dc674237ca 100755 --- a/admin/notes/tree-sitter/build-module/build.sh +++ b/admin/notes/tree-sitter/build-module/build.sh @@ -3,12 +3,17 @@ lang=$1 topdir="$PWD" -if [ $(uname) == "Darwin" ] -then - soext="dylib" -else - soext="so" -fi +case $(uname) in + "Darwin") + soext="dylib" + ;; + *"MINGW"*) + soext="dll" + ;; + *) + soext="so" + ;; +esac echo "Building ${lang}" From 4bd06ce2a9fa1601aff5a5fcab7411e5fce20d28 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Wed, 25 Jan 2023 23:12:41 -0800 Subject: [PATCH 25/30] Fix call to treesit_record_change in insdel.c The start position of the change shouldn't be PT_BYTE, IIUC PT_BYTE is actually the end position. * src/insdel.c (insert_from_buffer): Move to here. (insert_from_buffer_1): Remove call to treesit_record_change. --- src/insdel.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/insdel.c b/src/insdel.c index b51767bf527..33dea569b24 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1175,9 +1175,19 @@ insert_from_buffer (struct buffer *buf, { ptrdiff_t opoint = PT; +#ifdef HAVE_TREE_SITTER + ptrdiff_t obyte = PT_BYTE; +#endif + insert_from_buffer_1 (buf, charpos, nchars, inherit); signal_after_change (opoint, 0, PT - opoint); update_compositions (opoint, PT, CHECK_BORDER); + +#ifdef HAVE_TREE_SITTER + eassert (PT_BYTE >= 0); + eassert (PT_BYTE >= obyte); + treesit_record_change (obyte, obyte, PT_BYTE); +#endif } static void @@ -1305,12 +1315,6 @@ insert_from_buffer_1 (struct buffer *buf, /* Insert those intervals. */ graft_intervals_into_buffer (intervals, PT, nchars, current_buffer, inherit); -#ifdef HAVE_TREE_SITTER - eassert (outgoing_nbytes >= 0); - eassert (PT_BYTE >= 0); - treesit_record_change (PT_BYTE, PT_BYTE, PT_BYTE + outgoing_nbytes); -#endif - adjust_point (nchars, outgoing_nbytes); } From cdf74254ffa2c53612f6d985e3774b51233fbd49 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Wed, 25 Jan 2023 23:47:27 -0800 Subject: [PATCH 26/30] Fix indentation for c-ts-mode (bug#61026) Fix indentation for things like while (true) if (true) { puts ("Hello"); } Note that the outer while loop omits brackets. * lisp/progmodes/c-ts-mode.el: (c-ts-mode--statement-offset-post-processr): New variable. (c-ts-mode--statement-offset): Use the new function. (c-ts-mode--fix-bracketless-indent): New function. (c-ts-base-mode): Use the new function. * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New tests. --- lisp/progmodes/c-ts-mode.el | 32 +++++++++++- .../progmodes/c-ts-mode-resources/indent.erts | 52 +++++++++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 95f9001e0d7..788c911f86b 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -279,6 +279,19 @@ NODE should be a labeled_statement." "enumerator_list")) "Regexp matching types of block nodes (i.e., {} blocks).") +(defvar c-ts-mode--statement-offset-post-processr nil + "A functions that makes adjustments to `c-ts-mode--statement-offset'. + +This is a function that takes two arguments, the current indent +level and the current node, and returns a new level. + +When `c-ts-mode--statement-offset' runs and go up the parse tree, +it increments the indent level when some condition are met in +each level. At each level, after (possibly) incrementing the +offset, it calls this function, passing it the current indent +level and the current node, and use the return value as the new +indent level.") + (defun c-ts-mode--statement-offset (node parent &rest _) "This anchor is used for children of a statement inside a block. @@ -319,9 +332,24 @@ PARENT is NODE's parent." ;; Add a level. ((looking-back (rx bol (* whitespace)) (line-beginning-position)) - (cl-incf level)))))) + (cl-incf level))))) + (when c-ts-mode--statement-offset-post-processr + (setq level (funcall c-ts-mode--statement-offset-post-processr + level node)))) (* level c-ts-mode-indent-offset))) +(defun c-ts-mode--fix-bracketless-indent (level node) + "Takes LEVEL and NODE and returns adjusted LEVEL. +This fixes indentation for cases shown in bug#61026. Basically +in C/C++, constructs like if, for, while sometimes don't have +bracket." + (if (and (not (equal (treesit-node-type node) "compound_statement")) + (member (treesit-node-type (treesit-node-parent node)) + '("if_statement" "while_statement" "do_statement" + "for_statement"))) + (1+ level) + level)) + (defun c-ts-mode--close-bracket-offset (node parent &rest _) "Offset for the closing bracket, NODE. It's basically one level less that the statements in the block. @@ -758,6 +786,8 @@ the semicolon. This function skips the semicolon." ;; Indent. (when (eq c-ts-mode-indent-style 'linux) (setq-local indent-tabs-mode t)) + (setq-local c-ts-mode--statement-offset-post-processr + #'c-ts-mode--fix-bracketless-indent) ;; Comment (c-ts-common-comment-setup) diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent.erts b/test/lisp/progmodes/c-ts-mode-resources/indent.erts index b8524432d02..67654404a77 100644 --- a/test/lisp/progmodes/c-ts-mode-resources/indent.erts +++ b/test/lisp/progmodes/c-ts-mode-resources/indent.erts @@ -105,6 +105,58 @@ main (int argc, } =-=-= +Name: Bracket-less Block-Statement (GNU Style) (bug#61026) + +=-= +int main() { + while (true) + if (true) + { + puts ("Hello"); + } + for (int i=0; i<5; i++) + if (true) + { + puts ("Hello"); + } + do + if (true) + { + puts ("Hello"); + } + while (true); + if (true) + if (true) + { + puts ("Hello"); + } +} +=-=-= + +Name: Bracket-less Block-Statement (Linux Style) (bug#61026) + +=-=-= +int main() { + while (true) + if (true) { + puts ("Hello"); + } + for (int i=0; i<5; i++) + if (true) { + puts ("Hello"); + } + do + if (true) { + puts ("Hello"); + } + while (true); + if (true) + if (true) { + puts ("Hello"); + } +} +=-=-= + Name: Multiline Parameter List (bug#60398) =-= From 41f497c8bee6e36a621a6d9088636069159387a9 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 26 Jan 2023 09:59:58 +0200 Subject: [PATCH 27/30] Fix doc strings of window-splitting commands * lisp/window.el (split-window-below, split-window-right): Doc fixes. (Bug#60886) --- lisp/window.el | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lisp/window.el b/lisp/window.el index 84f5c5c3f5a..0cd30822ff6 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5670,9 +5670,11 @@ the original point in both windows." (defun split-window-below (&optional size window-to-split) "Split WINDOW-TO-SPLIT into two windows, one above the other. -WINDOW-TO-SPLIT defaults to the selected window and and will be above -the other window after splitting. The newly split-off window is -below and displays the same buffer. Return the new window. +WINDOW-TO-SPLIT defaults to the selected window if omitted or nil. +The newly created window will be below WINDOW-TO-SPLIT and will show +the same buffer as WINDOW-TO-SPLIT, if it is a live window, else the +buffer shown in the WINDOW-TO-SPLIT's frame's selected window. +Return the new window. If optional argument SIZE is omitted or nil, both windows get the same height, or close to it. If SIZE is positive, the upper @@ -5735,9 +5737,11 @@ handled as in `split-window-below'." (defun split-window-right (&optional size window-to-split) "Split WINDOW-TO-SPLIT into two side-by-side windows. -WINDOW-TO-SPLIT defaults to the selected window and and will be on the -left after splitting. The newly split-off window is on the right and -displays the same buffer. Return the new window. +WINDOW-TO-SPLIT defaults to the selected window if omitted or nil. +The newly created window will be to the right of WINDOW-TO-SPLIT and +will show the same buffer as WINDOW-TO-SPLIT, if it is a live window, +else the buffer shown in the WINDOW-TO-SPLIT's frame's selected window. +Return the new window. If optional argument SIZE is omitted or nil, both windows get the same width, or close to it. If SIZE is positive, the left-hand From ff9498624fcd15e2ab6264d259d089aa5f989ae6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 26 Jan 2023 10:23:58 +0200 Subject: [PATCH 28/30] ; * src/insdel.c (insert_from_buffer): Fix assertions. --- src/insdel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/insdel.c b/src/insdel.c index 33dea569b24..0e1e98664b3 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1184,7 +1184,8 @@ insert_from_buffer (struct buffer *buf, update_compositions (opoint, PT, CHECK_BORDER); #ifdef HAVE_TREE_SITTER - eassert (PT_BYTE >= 0); + eassert (PT_BYTE >= BEG_BYTE); + eassert (obyte >= BEG_BYTE); eassert (PT_BYTE >= obyte); treesit_record_change (obyte, obyte, PT_BYTE); #endif From 4bf7cb71edc2694c9939ae27594e9a1e3b79e1c6 Mon Sep 17 00:00:00 2001 From: Randy Taylor Date: Tue, 24 Jan 2023 21:20:48 -0500 Subject: [PATCH 29/30] Fix go-ts-mode indentation and set indent offset to 8 (Bug#61006) * lisp/progmodes/go-ts-mode.el (go-ts-mode-indent-offset): Change default value to 8. (go-ts-mode--indent-rules): Add indentation for parameters and interfaces. --- lisp/progmodes/go-ts-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index d552e1360e0..5f3e1ea3e68 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -38,7 +38,7 @@ (declare-function treesit-node-type "treesit.c") (declare-function treesit-search-subtree "treesit.c") -(defcustom go-ts-mode-indent-offset 4 +(defcustom go-ts-mode-indent-offset 8 "Number of spaces for each indentation step in `go-ts-mode'." :version "29.1" :type 'integer @@ -78,8 +78,10 @@ ((parent-is "expression_switch_statement") parent-bol 0) ((parent-is "field_declaration_list") parent-bol go-ts-mode-indent-offset) ((parent-is "import_spec_list") parent-bol go-ts-mode-indent-offset) + ((parent-is "interface_type") parent-bol go-ts-mode-indent-offset) ((parent-is "labeled_statement") parent-bol go-ts-mode-indent-offset) ((parent-is "literal_value") parent-bol go-ts-mode-indent-offset) + ((parent-is "parameter_list") parent-bol go-ts-mode-indent-offset) ((parent-is "type_spec") parent-bol go-ts-mode-indent-offset) ((parent-is "var_declaration") parent-bol go-ts-mode-indent-offset) (no-node parent-bol 0))) From f8c95d1a7681e861fc22d2a040cda0ddfe23eff4 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 26 Jan 2023 10:54:43 +0200 Subject: [PATCH 30/30] Fix xt-mouse on terminals that report UTF-8 encoded coordinates * lisp/xt-mouse.el (xterm-mouse--read-coordinate): Fix conversion of mouse coordinates in rxvt-unicode. Patches by Vladimir Panteleev and Jared Finder . (Bug#61022) --- lisp/xt-mouse.el | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index adfa480bc0f..4ccd35d5277 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -151,16 +151,22 @@ If `xterm-mouse-utf-8' was non-nil when `turn-on-xterm-mouse-tracking-on-terminal' was called, reads the coordinate as an UTF-8 code unit sequence; otherwise, reads a single byte." - (let ((previous-keyboard-coding-system (keyboard-coding-system))) + (let ((previous-keyboard-coding-system (keyboard-coding-system)) + (utf-8-p (terminal-parameter nil 'xterm-mouse-utf-8)) + ;; Prevent conversions inside 'read-char' due to input method, + ;; when we call 'read-char' below with 2nd argument non-nil. + (input-method-function nil)) (unwind-protect (progn - (set-keyboard-coding-system - (if (terminal-parameter nil 'xterm-mouse-utf-8) - 'utf-8-unix - 'no-conversion)) - ;; Wait only a little; we assume that the entire escape sequence - ;; has already been sent when this function is called. - (read-char nil nil 0.1)) + (set-keyboard-coding-system (if utf-8-p 'utf-8-unix 'no-conversion)) + (read-char nil + ;; Force 'read-char' to decode UTF-8 sequences if + ;; 'xterm-mouse-utf-8' is non-nil. + utf-8-p + ;; Wait only a little; we assume that the entire + ;; escape sequence has already been sent when + ;; this function is called. + 0.1)) (set-keyboard-coding-system previous-keyboard-coding-system)))) ;; In default mode, each numeric parameter of XTerm's mouse report is