commit 302274b18625b04d1f52fe4c1e52dbcd2cd5124b (HEAD, refs/remotes/origin/master) Author: Juri Linkov Date: Mon Feb 10 09:19:46 2025 +0200 * lisp/treesit.el: Fix treesit-outline. (treesit-outline--at-point): New internal function. (treesit-outline-search, treesit-outline-level): Use 'treesit-outline--at-point'. diff --git a/lisp/treesit.el b/lisp/treesit.el index 1c760e3b6ce..58f1b38dc40 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -3507,15 +3507,26 @@ when a major mode sets it.") (funcall (nth 2 setting) node)))) treesit-simple-imenu-settings)) +(defun treesit-outline--at-point () + "Return the outline heading at the current line." + (let* ((pred treesit-outline-predicate) + (bol (pos-bol)) + (eol (pos-eol)) + (current (treesit-thing-at (point) pred)) + (current-valid (when current + (<= bol (treesit-node-start current) eol))) + (next (unless current-valid + (treesit-navigate-thing (point) 1 'beg pred))) + (next-valid (when next (<= bol next eol)))) + (or (and current-valid current) + (and next-valid (treesit-thing-at next pred))))) + (defun treesit-outline-search (&optional bound move backward looking-at) "Search for the next outline heading in the syntax tree. For BOUND, MOVE, BACKWARD, LOOKING-AT, see the descriptions in `outline-search-function'." (if looking-at - (when-let* ((node (or (treesit-thing-at (1- (pos-eol)) treesit-outline-predicate) - (treesit-thing-at (pos-bol) treesit-outline-predicate))) - (start (treesit-node-start node))) - (eq (pos-bol) (save-excursion (goto-char start) (pos-bol)))) + (when (treesit-outline--at-point) (pos-bol)) (let* ((bob-pos ;; `treesit-navigate-thing' can't find a thing at bobp, @@ -3546,7 +3557,7 @@ For BOUND, MOVE, BACKWARD, LOOKING-AT, see the descriptions in (defun treesit-outline-level () "Return the depth of the current outline heading." - (let* ((node (treesit-node-at (point) nil t)) + (let* ((node (treesit-outline--at-point)) (level (if (treesit-node-match-p node treesit-outline-predicate) 1 0))) (while (setq node (treesit-parent-until node treesit-outline-predicate)) commit 6e8bb757841d76e2df9757404dfafc5cb7777cb8 Author: Po Lu Date: Mon Feb 10 12:04:27 2025 +0800 Fix compilation on Haiku Nightly hrev58622 * configure.ac (BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER): Define if BObjectList ownership over its contents is specified as a template parameter. * src/haiku_support.cc (class EmacsFontSelectionDialog) [BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER]: Adjust accordingly. diff --git a/configure.ac b/configure.ac index 33d04a5bdb9..089a18959e3 100644 --- a/configure.ac +++ b/configure.ac @@ -2953,6 +2953,17 @@ if test "${opsys}" = "haiku" && test "${with_be_app}" = "yes"; then [AC_MSG_ERROR([The Application Kit headers required for building with the Application Kit were not found or cannot be compiled. Either fix this, or re-configure with the option '--without-be-app'.])]) + AC_CACHE_CHECK([whether BObjectList accepts ownership as a template parameter], + [emacs_cv_bobjectlist_ownership_is_template_parameter], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + static BObjectList test;]], [])], + [emacs_cv_bobjectlist_ownership_is_template_parameter=yes], + [emacs_cv_bobjectlist_ownership_is_template_parameter=no])]) + AS_IF([test "x$emacs_cv_bobjectlist_ownership_is_template_parameter"], + [AC_DEFINE([BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER], [1], + [Define to 1 if BObjectList ownership is defined as a template parameter.])]) AC_LANG_POP([C++]) fi diff --git a/src/haiku_support.cc b/src/haiku_support.cc index d83b5c145d6..bfa2cb51456 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -2862,8 +2862,13 @@ class EmacsFontSelectionDialog : public BWindow BScrollView font_family_scroller; BScrollView font_style_scroller; TripleLayoutView style_view; +#ifdef BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER + BObjectList all_families; + BObjectList all_styles; +#else /* !BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER */ BObjectList all_families; BObjectList all_styles; +#endif /* !BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER */ BButton cancel_button, ok_button; BTextControl size_entry; port_id comm_port; @@ -3126,8 +3131,13 @@ class EmacsFontSelectionDialog : public BWindow B_SUPPORTS_LAYOUT, false, true), style_view (&font_style_scroller, &antialias_checkbox, &preview_checkbox), +#ifdef BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER + all_families (20), + all_styles (20), +#else /* !BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER */ all_families (20, true), all_styles (20, true), +#endif /* !BOBJECTLIST_OWNERSHIP_IS_TEMPLATE_PARAMETER */ cancel_button ("Cancel", "Cancel", new BMessage (B_CANCEL)), ok_button ("OK", "OK", new BMessage (B_OK)), commit ceef9025944fd3d51122f913ed9a74a259db55f7 Author: Stefan Kangas Date: Mon Feb 10 00:40:23 2025 +0100 Don't use deprecated unload-hook variables in Gnus * lisp/gnus/gnus-registry.el (gnus-registry-unload-hook): * lisp/gnus/spam-stat.el (spam-stat-unload-hook): * lisp/gnus/spam.el (spam-unload-hook): Rename functions from this... * lisp/gnus/gnus-registry.el (gnus-registry-unload-function): * lisp/gnus/spam-stat.el (spam-stat-unload-function): * lisp/gnus/spam.el (spam-unload-function): ...to this. Don't set the corresponding variables, always return nil, update callers, and leave old name as obsolete function aliases. Ref: https://lists.gnu.org/r/emacs-devel/2025-02/msg00294.html diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index c4c1c649e1e..0d7282d73da 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el @@ -1174,7 +1174,7 @@ non-nil." (defun gnus-registry-clear () "Clear the registry." - (gnus-registry-unload-hook) + (gnus-registry-unload-function) (setq gnus-registry-db nil)) (gnus-add-shutdown 'gnus-registry-clear 'gnus) @@ -1198,7 +1198,7 @@ non-nil." (add-hook 'gnus-summary-prepare-hook #'gnus-registry-register-message-ids)) -(defun gnus-registry-unload-hook () +(defun gnus-registry-unload-function () "Uninstall the registry hooks." (remove-hook 'gnus-summary-article-move-hook #'gnus-registry-action) (remove-hook 'gnus-summary-article-delete-hook #'gnus-registry-action) @@ -1208,9 +1208,8 @@ non-nil." (remove-hook 'gnus-save-newsrc-hook #'gnus-registry-save) (remove-hook 'gnus-read-newsrc-el-hook #'gnus-registry-load) - (remove-hook 'gnus-summary-prepare-hook #'gnus-registry-register-message-ids)) - -(add-hook 'gnus-registry-unload-hook #'gnus-registry-clear) + (remove-hook 'gnus-summary-prepare-hook #'gnus-registry-register-message-ids) + nil) (defun gnus-registry-install-p () "Return non-nil if the registry is enabled (and maybe enable it first). @@ -1297,6 +1296,9 @@ from your existing entries." (gnus-registry-insert db k newv))) (registry-reindex db)))) +(define-obsolete-function-alias 'gnus-registry-unload-hook + #'gnus-registry-unload-function "31.1") + (provide 'gnus-registry) ;;; gnus-registry.el ends here diff --git a/lisp/gnus/spam-stat.el b/lisp/gnus/spam-stat.el index 61f0b132201..b4698e9b2b6 100644 --- a/lisp/gnus/spam-stat.el +++ b/lisp/gnus/spam-stat.el @@ -643,15 +643,17 @@ COUNT defaults to 5" (add-hook 'gnus-select-article-hook #'spam-stat-store-gnus-article-buffer)) -(defun spam-stat-unload-hook () +(defun spam-stat-unload-function () "Uninstall the spam-stat function hooks." (interactive) (remove-hook 'nnmail-prepare-incoming-message-hook #'spam-stat-store-current-buffer) (remove-hook 'gnus-select-article-hook - #'spam-stat-store-gnus-article-buffer)) + #'spam-stat-store-gnus-article-buffer) + nil) -(add-hook 'spam-stat-unload-hook #'spam-stat-unload-hook) +(define-obsolete-function-alias 'spam-stat-unload-hook + #'spam-stat-unload-function "31.1") (provide 'spam-stat) diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el index dab68332ec5..5c25df049e3 100644 --- a/lisp/gnus/spam.el +++ b/lisp/gnus/spam.el @@ -2854,7 +2854,7 @@ installed through `spam-necessary-extra-headers'." ;; Don't install things more than once. (setq spam-install-hooks nil))) -(defun spam-unload-hook () +(defun spam-unload-function () "Uninstall the spam.el hooks." (interactive) (spam-teardown-widening) @@ -2864,12 +2864,13 @@ installed through `spam-necessary-extra-headers'." (remove-hook 'gnus-summary-prepare-exit-hook #'spam-summary-prepare-exit) (remove-hook 'gnus-summary-prepare-hook #'spam-summary-prepare) (remove-hook 'gnus-get-new-news-hook #'spam-setup-widening) - (remove-hook 'gnus-summary-prepare-hook #'spam-find-spam)) - -(add-hook 'spam-unload-hook #'spam-unload-hook) + (remove-hook 'gnus-summary-prepare-hook #'spam-find-spam) + nil) ;;}}} +(define-obsolete-function-alias 'spam-unload-hook #'spam-unload-function "31.1") + (provide 'spam) ;;; spam.el ends here commit 1c16d81bac05f0feb9e2fabfd435f92e9ac951ee Author: Stefan Kangas Date: Mon Feb 10 00:03:12 2025 +0100 Fix fontification of ATTRIBUTE_NO_SANITIZE_ADDRESS functions * .dir-locals.el (c-mode) : Add "ATTRIBUTE_NO_SANITIZE_ADDRESS", to fontify functions with this attribute correctly. diff --git a/.dir-locals.el b/.dir-locals.el index 06ebedb7a49..af92eac5bba 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -18,6 +18,7 @@ (vc-default-patch-addressee . "bug-gnu-emacs@gnu.org"))) (c-mode . ((c-file-style . "GNU") (c-noise-macro-names . ("INLINE" "NO_INLINE" "ATTRIBUTE_NO_SANITIZE_UNDEFINED" + "ATTRIBUTE_NO_SANITIZE_ADDRESS" "UNINIT" "CALLBACK" "ALIGN_STACK" "ATTRIBUTE_MALLOC" "ATTRIBUTE_DEALLOC_FREE" "ANDROID_EXPORT" "TEST_STATIC" "INLINE_HEADER_BEGIN" "INLINE_HEADER_END")) commit 893f6652da3127bb894c822f338179aa6c0cb1cc Author: Stefan Kangas Date: Sun Feb 9 22:17:45 2025 +0100 ; Add missing section marker to ert.el diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index bf57d7b6774..5d1b9f2acbb 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -2864,6 +2864,8 @@ To be used in the ERT results buffer." 'ert--activate-font-lock-keywords) nil) +;;; erts files. + (defun ert-test-erts-file (file &optional transform) "Parse FILE as a file containing before/after parts (an erts file). commit 859608c05152ef7efdc55b3fcd3997d7801125f8 Author: Stefan Kangas Date: Sun Feb 9 22:16:09 2025 +0100 Use unload-function instead of unload-hook in ert * lisp/emacs-lisp/ert.el (ert-unload-function): Rename from 'ert--unload-function'. (ert--unload-function): Make into obsolete function alias for the above. diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 5d9230fa3cf..bf57d7b6774 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -2856,7 +2856,7 @@ To be used in the ERT results buffer." (ert--tests-running-mode-line-indicator)))) (add-hook 'emacs-lisp-mode-hook #'ert--activate-font-lock-keywords) -(defun ert--unload-function () +(defun ert-unload-function () "Unload function to undo the side-effects of loading ert.el." (ert--remove-from-list 'find-function-regexp-alist 'ert--test :key #'car) (ert--remove-from-list 'minor-mode-alist 'ert--current-run-stats :key #'car) @@ -2990,9 +2990,6 @@ write erts files." (forward-line 1))) (nreverse specs)))) -(defvar ert-unload-hook ()) -(add-hook 'ert-unload-hook #'ert--unload-function) - ;;; Obsolete (define-obsolete-function-alias 'ert-equal-including-properties @@ -3000,6 +2997,8 @@ write erts files." (put 'ert-equal-including-properties 'ert-explainer 'ert--explain-equal-including-properties) +(define-obsolete-function-alias 'ert--unload-function 'ert-unload-function "31.1") + (provide 'ert) ;;; ert.el ends here commit e9d17e41971c887675d52e1dcee21978d4247130 Author: Juri Linkov Date: Sun Feb 9 19:54:02 2025 +0200 Improve treesit settings for {json,html,toml,yaml}-ts-mode (bug#73404) * lisp/progmodes/json-ts-mode.el (json-ts-mode): Add 'list' thing to 'treesit-thing-settings'. (json-ts-mode): Disable outlines. * lisp/textmodes/html-ts-mode.el (html-ts-mode--defun-name): Get a grandchild 'tag_name' from 'element' that was already defined by 'treesit-defun-type-regexp'. (html-ts-mode--outline-predicate): New function. (html-ts-mode): Add "comment" to the 'list' thing in 'treesit-thing-settings'. Use "tag_name" and "attribute" in 'sentence' to conform to sentence navigating arguments in other ts-modes. Remove unnecessary heading from 'treesit-simple-imenu-settings' and use "element" supported by 'html-ts-mode--defun-name'. Set 'treesit-outline-predicate' to 'html-ts-mode--outline-predicate'. * lisp/textmodes/toml-ts-mode.el (toml-ts-mode): Add 'treesit-thing-settings'. * lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode--defun-name) (yaml-ts-mode--outline-predicate): New functions. (yaml-ts-mode): Set 'treesit-defun-type-regexp', 'treesit-defun-name-function', 'treesit-defun-tactic'. Add 'sentence' to 'treesit-thing-settings'. Set 'treesit-simple-imenu-settings' and 'treesit-outline-predicate'. Use 'kill-local-variable' for 'forward-sexp-function' and 'show-paren-data-function' instead of resetting their value. * lisp/treesit.el (treesit-outline-search): Check for the thing before the end of the line to support such case when the thing fits on the current line and ends before the end of the line such as e.g. '

...

' in html-ts-mode. (treesit-hs-find-next-block, treesit-hs-inside-comment-p): Use anchors for "\\`comment\\'" (bug#75609). diff --git a/lisp/progmodes/json-ts-mode.el b/lisp/progmodes/json-ts-mode.el index f26ba9e8d63..1b8f033e97a 100644 --- a/lisp/progmodes/json-ts-mode.el +++ b/lisp/progmodes/json-ts-mode.el @@ -152,6 +152,7 @@ Return nil if there is no name or if NODE is not a defun node." (setq-local treesit-thing-settings `((json + (list ,(rx (or "object" "array"))) (sentence "pair")))) ;; Font-lock. @@ -165,7 +166,12 @@ Return nil if there is no name or if NODE is not a defun node." (setq-local treesit-simple-imenu-settings '((nil "\\`pair\\'" nil nil))) - (treesit-major-mode-setup)) + (treesit-major-mode-setup) + + ;; Disable outlines since they are created for 'pair' from + ;; 'treesit-simple-imenu-settings' almost on every line: + (kill-local-variable 'outline-search-function) + (kill-local-variable 'outline-level)) (derived-mode-add-parents 'json-ts-mode '(json-mode)) diff --git a/lisp/textmodes/html-ts-mode.el b/lisp/textmodes/html-ts-mode.el index dad49b7ed4c..7e6c3e0b7d1 100644 --- a/lisp/textmodes/html-ts-mode.el +++ b/lisp/textmodes/html-ts-mode.el @@ -90,8 +90,20 @@ (defun html-ts-mode--defun-name (node) "Return the defun name of NODE. Return nil if there is no name or if NODE is not a defun node." - (when (equal (treesit-node-type node) "tag_name") - (treesit-node-text node t))) + (when (string-match-p "element" (treesit-node-type node)) + (treesit-node-text + (treesit-search-subtree node "\\`tag_name\\'" nil nil 2) + t))) + +(defun html-ts-mode--outline-predicate (node) + "Limit outlines to a few most meaningful elements." + (let ((name (html-ts-mode--defun-name node))) + (and name (string-match-p + (rx bos (or "html" "head" "script" "style" + "body" (and "h" (any "1-6")) + "ol" "ul" "table") + eos) + name)))) ;;;###autoload (define-derived-mode html-ts-mode html-mode "HTML" @@ -108,7 +120,6 @@ Return nil if there is no name or if NODE is not a defun node." ;; Navigation. (setq-local treesit-defun-type-regexp "element") - (setq-local treesit-defun-name-function #'html-ts-mode--defun-name) (setq-local treesit-thing-settings @@ -117,8 +128,12 @@ Return nil if there is no name or if NODE is not a defun node." "text" "attribute" "value"))) - (list ,(regexp-opt '("element")) 'symbols) - (sentence "tag") + (list ,(rx (or + ;; Also match script_element and style_element + "element" + ;; HTML comments have the element syntax + "comment"))) + (sentence ,(rx (and bos (or "tag_name" "attribute") eos))) (text ,(regexp-opt '("comment" "text")))))) ;; Font-lock. @@ -130,10 +145,10 @@ Return nil if there is no name or if NODE is not a defun node." ;; Imenu. (setq-local treesit-simple-imenu-settings - '(("Element" "\\`tag_name\\'" nil nil))) + '((nil "element" nil nil))) ;; Outline minor mode. - (setq-local treesit-outline-predicate "\\`element\\'") + (setq-local treesit-outline-predicate #'html-ts-mode--outline-predicate) ;; `html-ts-mode' inherits from `html-mode' that sets ;; regexp-based outline variables. So need to restore ;; the default values of outline variables to be able diff --git a/lisp/textmodes/toml-ts-mode.el b/lisp/textmodes/toml-ts-mode.el index 759995590f6..3b55fe7706a 100644 --- a/lisp/textmodes/toml-ts-mode.el +++ b/lisp/textmodes/toml-ts-mode.el @@ -137,6 +137,14 @@ Return nil if there is no name or if NODE is not a defun node." (setq-local treesit-defun-type-regexp (rx (or "table" "table_array_element"))) (setq-local treesit-defun-name-function #'toml-ts-mode--defun-name) + (setq-local treesit-thing-settings + `((toml + (list + ,(rx bos (or "array" "inline_table") eos)) + (sentence + ,(rx bos (or "pair") eos)) + (text + ,(rx bos (or "comment") eos))))) ;; Font-lock. (setq-local treesit-font-lock-settings toml-ts-mode--font-lock-settings) diff --git a/lisp/textmodes/yaml-ts-mode.el b/lisp/textmodes/yaml-ts-mode.el index defef096aa6..7a5132634ca 100644 --- a/lisp/textmodes/yaml-ts-mode.el +++ b/lisp/textmodes/yaml-ts-mode.el @@ -141,6 +141,19 @@ boundaries. JUSTIFY is passed to `fill-paragraph'." (fill-region start-marker end justify)) t)))) +(defun yaml-ts-mode--defun-name (node) + "Return the defun name of NODE. +Return nil if there is no name or if NODE is not a defun node." + (when (equal (treesit-node-type node) "block_mapping_pair") + (treesit-node-text (treesit-node-child-by-field-name + node "key") + t))) + +(defun yaml-ts-mode--outline-predicate (node) + "Limit outlines to top-level mappings." + (when (equal (treesit-node-type node) "block_mapping_pair") + (not (treesit-parent-until node treesit-outline-predicate)))) + ;;;###autoload (define-derived-mode yaml-ts-mode text-mode "YAML" "Major mode for editing YAML, powered by tree-sitter." @@ -168,11 +181,21 @@ boundaries. JUSTIFY is passed to `fill-paragraph'." (setq-local fill-paragraph-function #'yaml-ts-mode--fill-paragraph) ;; Navigation. + (setq-local treesit-defun-type-regexp "block_mapping_pair") + (setq-local treesit-defun-name-function #'yaml-ts-mode--defun-name) + (setq-local treesit-defun-tactic 'top-level) + (setq-local treesit-thing-settings `((yaml - (list ,(regexp-opt '("block_mapping_pair" - "flow_sequence")) - 'symbols)))) + (list ,(rx (or "block_mapping_pair" "flow_sequence"))) + (sentence ,"block_mapping_pair")))) + + ;; Imenu. + (setq-local treesit-simple-imenu-settings + '((nil "\\`block_mapping_pair\\'" nil nil))) + + ;; Outline minor mode. + (setq-local treesit-outline-predicate #'yaml-ts-mode--outline-predicate) (treesit-major-mode-setup) @@ -181,8 +204,8 @@ boundaries. JUSTIFY is passed to `fill-paragraph'." ;; with `C-M-f', `C-M-b' neither adapt to 'show-paren-mode' ;; that is problematic in languages without explicit ;; opening/closing nodes. - (setq-local forward-sexp-function nil) - (setq-local show-paren-data-function 'show-paren--default))) + (kill-local-variable 'forward-sexp-function) + (kill-local-variable 'show-paren-data-function))) (derived-mode-add-parents 'yaml-ts-mode '(yaml-mode)) diff --git a/lisp/treesit.el b/lisp/treesit.el index 9e3c75519f9..1c760e3b6ce 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -3512,7 +3512,7 @@ when a major mode sets it.") For BOUND, MOVE, BACKWARD, LOOKING-AT, see the descriptions in `outline-search-function'." (if looking-at - (when-let* ((node (or (treesit-thing-at (pos-eol) treesit-outline-predicate) + (when-let* ((node (or (treesit-thing-at (1- (pos-eol)) treesit-outline-predicate) (treesit-thing-at (pos-bol) treesit-outline-predicate))) (start (treesit-node-start node))) (eq (pos-bol) (save-excursion (goto-char start) (pos-bol)))) @@ -3586,7 +3586,7 @@ For BOUND, MOVE, BACKWARD, LOOKING-AT, see the descriptions in (let* ((comment-pred (when comments (if (treesit-thing-defined-p 'comment (treesit-language-at (point))) - 'comment "comment"))) + 'comment "\\`comment\\'"))) (pred (if comment-pred (append '(or list) (list comment-pred)) 'list)) ;; `treesit-navigate-thing' can't find a thing at bobp, ;; so use `treesit-thing-at' to match at bobp. @@ -3621,7 +3621,7 @@ For BOUND, MOVE, BACKWARD, LOOKING-AT, see the descriptions in "Tree-sitter implementation of `hs-inside-comment-p-func'." (let* ((comment-pred (if (treesit-thing-defined-p 'comment (treesit-language-at (point))) - 'comment "comment")) + 'comment "\\`comment\\'")) (thing (or (treesit-thing-at (point) comment-pred) (unless (bobp) (treesit-thing-at (1- (point)) comment-pred))))) commit 7e60ceeccbca1b9f67297ad7e9f11fd498b28d4d Author: Stefan Kangas Date: Sun Feb 9 16:16:01 2025 +0100 ; Silence byte-compiler * lisp/net/eww.el (eww-bookmark-kill): * test/lisp/savehist-tests.el: Silence byte-compiler. diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 6e598de1be4..18a72e97fcb 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -2476,7 +2476,7 @@ in of `eww-bookmark-mode'. Order stars counting from 1." (setq eww-bookmarks (delq bookmark-at-point eww-bookmarks)) (eww-write-bookmarks) (when (= (point) (point-max)) - (previous-line)) ; don't go outside the vtable, or reverting fails + (forward-line -1)) ; don't go outside the vtable, or reverting fails (vtable-revert-command) (goto-char position))) diff --git a/test/lisp/savehist-tests.el b/test/lisp/savehist-tests.el index e37dceccc10..7e4437a75a9 100644 --- a/test/lisp/savehist-tests.el +++ b/test/lisp/savehist-tests.el @@ -32,58 +32,60 @@ (ert-deftest savehist-test-saved-variables () ;; These accommodate symbol-value. - (defvar t1) - (defvar t2) + (defvar savehist-tests--t1) + (defvar savehist-tests--t2) (ert-with-temp-file tmpfile (let* ((savehist-file tmpfile) (savehist-save-minibuffer-history t) (savehist-save-hook) (savehist-loaded) (savehist-minibuffer-history-variables) - (savehist-additional-variables '(t2)) + (savehist-additional-variables '(savehist-tests--t2)) (savehist-ignored-variables '(t3)) - (t1 '("t1-value")) - (t2 '("t2-value")) + (savehist-tests--t1 '("t1-value")) + (savehist-tests--t2 '("t2-value")) (t3 '("t3-value")) - (t1-copy (copy-tree t1)) - (t2-copy (copy-tree t2)) - (t3-copy (copy-tree t3)) + (t1-copy (copy-tree savehist-tests--t1)) + (t2-copy (copy-tree savehist-tests--t2)) + (_t3-copy (copy-tree t3)) (save-var (lambda (x) (let ((minibuffer-history-variable x)) (savehist-minibuffer-hook))))) (savehist-mode) - (funcall save-var 't1) - (funcall save-var 't2) + (funcall save-var 'savehist-tests--t1) + (funcall save-var 'savehist-tests--t2) (funcall save-var 't3) ; should be ignored (savehist-save) - (setq t1 nil t2 nil t3 nil) + (setq savehist-tests--t1 nil savehist-tests--t2 nil t3 nil) (progn ;; Force reloading the file. (savehist-mode -1) (setq savehist-loaded nil) (savehist-mode)) - (should (equal t1 t1-copy)) - (should (equal t2 t2-copy)) + (should (equal savehist-tests--t1 t1-copy)) + (should (equal savehist-tests--t2 t2-copy)) (should (equal t3 nil))))) (ert-deftest savehist-test-duplicated-saved-symbols () - (defvar t1) - (defvar t2) + (defvar savehist-tests--t1) + (defvar savehist-tests--t2) (ert-with-temp-file tmpfile (let* ((savehist-file tmpfile) (savehist-save-minibuffer-history t) (savehist-save-hook) (savehist-loaded) - (savehist-minibuffer-history-variables) ; will be '(t2 t1) - (savehist-additional-variables '(t2)) ; t2 should not be saved twice - (t1 '("t1-value")) - (t2 '("t2-value")) + ;; Will be '(savehist-tests--t2 savehist-tests--t1) + (savehist-minibuffer-history-variables) + ;; `savehist-tests--t2' should not be saved twice. + (savehist-additional-variables '(savehist-tests--t2)) + (savehist-tests--t1 '("t1-value")) + (savehist-tests--t2 '("t2-value")) (save-var (lambda (x) (let ((minibuffer-history-variable x)) (savehist-minibuffer-hook))))) (savehist-mode) - (funcall save-var 't1) - (funcall save-var 't2) + (funcall save-var 'savehist-tests--t1) + (funcall save-var 'savehist-tests--t2) (savehist-save) (progn ;; Force reloading the file. commit 5c07fc7557ad9dd353f18a270042d9e844c85bef Author: Stefan Kangas Date: Sun Feb 9 15:56:35 2025 +0100 ; Simplify last commit * lisp/mail/footnote.el (footnote-mode): Simplify last change. diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el index 1e6265c79bf..8ce78505d20 100644 --- a/lisp/mail/footnote.el +++ b/lisp/mail/footnote.el @@ -895,9 +895,8 @@ play around with the following keys: (make-local-variable 'footnote-end-tag) (make-local-variable 'adaptive-fill-function) (setq-local sentence-end-base - (rx (or (regexp sentence-end-base) - (seq (regexp sentence-end-base) - "[" (+ digit) "]")))) + (rx (regexp sentence-end-base) + (? (seq "[" (+ digit) "]")))) ;; Filladapt is a GNU ELPA package. (when (boundp 'filladapt-token-table) commit 64905eba2707f89c3befe99b36d14e24eeb9f8c0 Author: Stefan Kangas Date: Sun Feb 9 15:34:41 2025 +0100 Improve filling with footnote-mode * lisp/mail/footnote.el (footnote-mode): Add regexp for footnotes to sentence-end-base to improve filling. diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el index c4d10b74856..1e6265c79bf 100644 --- a/lisp/mail/footnote.el +++ b/lisp/mail/footnote.el @@ -894,6 +894,10 @@ play around with the following keys: (make-local-variable 'footnote-start-tag) (make-local-variable 'footnote-end-tag) (make-local-variable 'adaptive-fill-function) + (setq-local sentence-end-base + (rx (or (regexp sentence-end-base) + (seq (regexp sentence-end-base) + "[" (+ digit) "]")))) ;; Filladapt is a GNU ELPA package. (when (boundp 'filladapt-token-table)