From 423b6b62296df0558cf16f286dd268e0b49b3bce Mon Sep 17 00:00:00 2001 From: Mauro Aranda Date: Sat, 7 Nov 2020 09:53:21 -0300 Subject: Add test for recent change in enable-theme * test/lisp/custom-tests.el (custom-test-enable-theme-keeps-settings): Enabling a theme should not change the theme settings, so test for that. See https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg00232.html --- test/lisp/custom-tests.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/lisp/custom-tests.el b/test/lisp/custom-tests.el index a1451cf0ce6..7691f167738 100644 --- a/test/lisp/custom-tests.el +++ b/test/lisp/custom-tests.el @@ -156,4 +156,13 @@ (load custom-test-admin-cus-test) (should (null (cus-test-opts t)))) +(ert-deftest custom-test-enable-theme-keeps-settings () + "Test that enabling a theme doesn't change its settings." + (let* ((custom-theme-load-path `(,(ert-resource-directory))) + settings) + (load-theme 'custom--test 'no-confirm 'no-enable) + (setq settings (get 'custom--test 'theme-settings)) + (enable-theme 'custom--test) + (should (equal settings (get 'custom--test 'theme-settings))))) + ;;; custom-tests.el ends here -- cgit v1.2.1 From e8f5657bc7f6e0e45f70e4849736c6e87d44a1ac Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 7 Nov 2020 10:15:22 -0500 Subject: * lisp/emacs-lisp/lisp-mode.el: Avoid false-positive "hidden arg" in strings (lisp--match-hidden-arg): Don't misfire in strings and comments. Reported by: Andrii Kolomoiets --- lisp/emacs-lisp/lisp-mode.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 268992295bf..daf49670894 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -178,13 +178,16 @@ (defun lisp--match-hidden-arg (limit) (let ((res nil)) + (forward-line 0) (while - (let ((ppss (parse-partial-sexp (line-beginning-position) + (let ((ppss (parse-partial-sexp (point) (line-end-position) -1))) (skip-syntax-forward " )") (if (or (>= (car ppss) 0) - (looking-at ";\\|$")) + (eolp) + (looking-at ";") + (nth 8 (syntax-ppss))) ;Within a string or comment. (progn (forward-line 1) (< (point) limit)) -- cgit v1.2.1