commit 5959c96f8b0e2174a39dc707526e70a7c96b026b Author: Juri Linkov Date: Fri Dec 12 09:31:15 2025 +0200 ; * lisp/progmodes/hideshow.el (hs-cycle-filter): Tweak docstring (bug#79970). diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 7f47f7588ff..41e804ae3d0 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -438,7 +438,9 @@ then \\`TAB' will invoke the visibility-cycling commands where that function returns non-nil. For example, if the value is `bolp', those commands will be invoked at the headline's beginning. This allows to preserve the usual bindings, as determined by the -major mode, elsewhere on the headlines." +major mode, elsewhere on the headlines. +Currently it affects only the command `hs-toggle-hiding' by default, +but it can be easily replaced with the command `hs-cycle'." :type `(choice (const :tag "Nowhere" nil) (const :tag "Everywhere on the headline" t) (const :tag "At block beginning" commit ef73f5c25430c43bd4e87aabcdb5e880d933d026 Author: Elías Gabriel Pérez Date: Wed Dec 10 10:05:44 2025 -0600 ; * lisp/progmodes/hideshow.el (hs-cycle): Fix regression. (Bug#79983) * test/lisp/progmodes/hideshow-tests.el (hideshow-cycle-with-delimiters) (hideshow-cycle-without-delimiters) (hideshow-check-unbalanced-parens): Add new tests. diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index f0bea28ceac..7f47f7588ff 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -1425,7 +1425,7 @@ only blocks which are that many levels below the level of point." (message "Hide %d level" level)) (t (let* (hs-allow-nesting - (block (hs-block-positions nil :ad-end)) + (block (hs-block-positions :ad-beg :ad-end)) (ov (seq-find (lambda (o) (and (eq (overlay-get o 'invisible) 'hs))) @@ -1436,7 +1436,8 @@ only blocks which are that many levels below the level of point." (hs-hide-block) (message "Hide block and nested blocks")) ;; Hide the children blocks if the parent block is hidden - ((= (overlay-end ov) (cadr block)) + ((and (= (overlay-start ov) (car block)) + (= (overlay-end ov) (cadr block))) (apply #'hs-hide-level-recursive 1 block) (message "Hide first nested blocks")) ;; Otherwise show all in the parent block, we cannot use diff --git a/test/lisp/progmodes/hideshow-tests.el b/test/lisp/progmodes/hideshow-tests.el index 39161f2455c..49f661a2390 100644 --- a/test/lisp/progmodes/hideshow-tests.el +++ b/test/lisp/progmodes/hideshow-tests.el @@ -342,6 +342,90 @@ main() (funcall call-at "}") (should (string= (hideshow-tests-visible-string) contents))))) +(ert-deftest hideshow-cycle-with-delimiters () + "Should cycle the visibility of a block with delimiters." + (let ((contents " +int +main () +{ + { + { + } + } +} +")) + (hideshow-tests-with-temp-buffer + c-mode + contents + (hideshow-tests-look-at "{") + (hs-cycle 1) + (should (string= + (hideshow-tests-visible-string) + " +int +main () +{} +")) + (hs-cycle 1) + (should (string= + (hideshow-tests-visible-string) + " +int +main () +{ + {} +} +")) + (hs-cycle 1) + (should (string= + (hideshow-tests-visible-string) + contents))))) + +(ert-deftest hideshow-cycle-without-delimiters () + "Should cycle the visibility of a block without delimiters." + (let ((contents " +def test1 (): + def test2 (): + def test3(): +")) + (hideshow-tests-with-temp-buffer + python-mode + contents + (hideshow-tests-look-at "test1") + (hs-cycle 1) + (should (string= + (hideshow-tests-visible-string) + " +def test1 (): +")) + (hs-cycle 1) + (should (string= + (hideshow-tests-visible-string) + " +def test1 (): + def test2 (): +")) + (hs-cycle 1) + (should (string= + (hideshow-tests-visible-string) + contents))))) + +(ert-deftest hideshow-check-unbalanced-parens () + (let ((contents " +(defun test1 ()) + +(defun test2 +")) + (hideshow-tests-with-temp-buffer + c-mode + contents + (hideshow-tests-look-at "test1") + (beginning-of-line) + (should (hs-block-positions)) + (hideshow-tests-look-at "test2") + (beginning-of-line) + (should-not (hs-block-positions))))) + (provide 'hideshow-tests) ;;; hideshow-tests.el ends here commit cc4f23302c9616b3a0ef5f5f3340befbb62cb583 Author: Pierre Téchoueyres Date: Thu Dec 11 19:21:55 2025 +0100 ; Fix 'prepare-user-lisp' that always add directory to 'load-path' * lisp/startup.el (prepare-user-lisp): Filter out directory matching any of 'user-lisp-ignored-directories'. (Bug#79978) diff --git a/lisp/startup.el b/lisp/startup.el index f1fb726d62b..41e08d4d2bd 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1251,11 +1251,11 @@ unconditionally." (unless autoload-file (setq autoload-file (expand-file-name ".user-lisp-autoloads.el" user-lisp-directory))) - (let* ((pred - (let ((ignored - (concat "\\`" (regexp-opt user-lisp-ignored-directories) "\\'"))) - (lambda (dir) - (not (string-match-p ignored (file-name-nondirectory dir)))))) + (let* ((ignored + (concat "\\`" (regexp-opt user-lisp-ignored-directories) "\\'")) + (pred + (lambda (dir) + (not (string-match-p ignored (file-name-nondirectory dir))))) (dir (expand-file-name user-lisp-directory)) (backup-inhibited t) (dirs (list dir))) @@ -1268,7 +1268,8 @@ unconditionally." (byte-recompile-file file force 0) (when (native-comp-available-p) (native-compile-async file))))) - ((file-directory-p file) + ((and (file-directory-p file) + (not (string-match-p ignored (file-name-nondirectory file)))) (add-to-list 'load-path (directory-file-name file)) (push file dirs)))) (unless just-activate commit 10d022741cf854817ec241c0d1c7b68b3f748d68 Author: Eli Zaretskii Date: Thu Dec 11 11:36:34 2025 +0200 ; * lisp/progmodes/antlr-mode.el (antlr-syntax-propertize): Doc fix. diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index eb61d529259..e80789a0d8f 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el @@ -983,7 +983,7 @@ imenu. For sorted menu entries, customize variable ;;;=========================================================================== (defvar antlr-syntax-propertize nil - "Specification used to apply `'syntax-table' text properties. + "Specification used to apply \\+`syntax-table' text properties. When non-nil, the value looks like (MAIN EXTEND-REGION MULTILINE-CHAR). MAIN is used as value for `syntax-propertize-function'.