commit 8bea0aae3bb59bd0452c61f856d74650838f6a45 (HEAD, refs/remotes/origin/master) Author: Mauro Aranda Date: Sat Feb 15 09:43:58 2025 -0300 Action button when point is just after it * lisp/cus-edit.el (Custom-newline): If no button at point, check for a button before point. (Bug#72341) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index e0e39b72c76..5cfd2b774b7 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -5351,10 +5351,13 @@ The format is suitable for use with `easy-menu-define'." To see what function the widget will call, use the `widget-describe' command." (interactive "@d") - (let ((button (get-char-property pos 'button))) - ;; If there is no button at point, then use the one at the start - ;; of the line, if it is a custom-group-link (bug#2298). + (let ((button (or (get-char-property pos 'button) + ;; Maybe we are just past a button, and it's quite handy + ;; to action it as well. (Bug#72341) + (get-char-property (1- pos) 'button)))) (or button + ;; If there is no button at point, then use the one at the start + ;; of the line, if it is a custom-group-link (bug#2298). (if (setq button (get-char-property (line-beginning-position) 'button)) (or (eq (widget-type button) 'custom-group-link) (setq button nil)))) commit 00e284fc52b44fc3cb435a5d17ce58af1b753a34 Author: Christoph Badura Date: Sun Jan 26 22:48:11 2025 +0100 VC: New hook to strip CVS template lines when committing Add a hook function to strip all lines beginning with "CVS:" from the commit message as CVS does. Do this only if 'log-edit-vc-backend' is 'CVS'. (Bug#72341) * lisp/vc/log-edit.el (log-edit-done-strip-cvs-lines): New command. (log-edit-done-hook): Add it as an option. * test/lisp/vc/log-edit-tests.el (log-edit-done-strip-cvs-lines-helper): New function. (log-edit-done-strip-cvs-lines-cvs) (log-edit-done-strip-cvs-lines-non-cvs) (log-edit-done-strip-cvs-lines-only-cvs-colon-blank) (log-edit-done-strip-cvs-lines-only-cvs-colon): New test cases. * etc/NEWS: Mention log-edit-done-strip-cvs-lines. diff --git a/etc/NEWS b/etc/NEWS index db49c4cde67..6cfed2932d4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1335,6 +1335,12 @@ the directory into which the repository was cloned. *** 'C-x v u' ('vc-revert') now works on directories listed in VC Directory. Reverting a directory means reverting changes to all files inside it. +*** New function 'log-edit-done-strip-cvs-lines'. +This function strips all lines beginning with "CVS:" from the buffer. +It is intended to be added to the 'log-edit-done-hook' so that +'vc-cvs-checkin' behaves like invoking "cvs commit [files...]" from the +command line. + ** Package +++ diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index bb85de8bd10..3eb614f6030 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -210,7 +210,8 @@ such as a bug-tracking system. The list of files about to be committed can be obtained from `log-edit-files'." :group 'log-edit :type '(hook :options (log-edit-set-common-indentation - log-edit-add-to-changelog))) + log-edit-add-to-changelog + log-edit-done-strip-cvs-lines))) (defcustom log-edit-strip-single-file-name nil "If non-nil, remove file name from single-file log entries." @@ -927,6 +928,20 @@ This simply uses the local CVS/Template file." (goto-char (point-max)) (insert-file-contents "CVS/Template")))) +(defun log-edit-done-strip-cvs-lines (&optional interactive) + "Strip lines starting with \"CVS:\" from commit log message. +When not called interactively do this only when the VC backend is CVS. +This mimicks what CVS does when invoked as \\='cvs commit [files...]'." + (interactive "p") + (when (or interactive (eq log-edit-vc-backend 'CVS)) + (let ((case-fold-search nil)) + (goto-char (point-min)) + ;; NB: While CVS defines CVSEDITPREFIX as "CVS: " it actually + ;; checks only the first four characters of af a line, i.e. "CVS:" + ;; to deal with editors that strip trailing whitespace. + ;; c.f. src/cvs.h and src/logmsg.c:do_editor() + (flush-lines "^CVS:")))) + (defun log-edit-insert-cvs-rcstemplate () "Insert the RCS commit log template from the CVS repository. This contacts the repository to get the rcstemplate file and diff --git a/test/lisp/vc/log-edit-tests.el b/test/lisp/vc/log-edit-tests.el index 005c336a3b6..6a312c6dac7 100644 --- a/test/lisp/vc/log-edit-tests.el +++ b/test/lisp/vc/log-edit-tests.el @@ -360,4 +360,57 @@ Report color and/or grayscale properly. (let ((fill-column 64)) (log-edit-fill-entry)) (should (equal (buffer-string) wanted))))) +(defun log-edit-done-strip-cvs-lines-helper (initial-text wanted vc-backend) + "Helper function for the log-edit-done-strip-cvs-lines tests. +Tests that running log-edit-done-strip-cvs-lines as a log-edit-done-hook +produces the WANTED string when run on INITIAL-TEXT with +'log-edit-vc-backend' set to VC-BACKEND.\"" + (with-temp-buffer + (let ((log-edit-done-hook 'log-edit-done-strip-cvs-lines) + (log-edit-vc-backend vc-backend)) + (setq-local log-edit-callback #'(lambda () (interactive) nil)) + (insert initial-text) + (log-edit-done) + (should (equal (buffer-string) wanted))))) + +(ert-deftest log-edit-done-strip-cvs-lines-cvs () + "Strip lines beginning with \"CVS:\" when using CVS as VC backend." + (let (string wanted) + (setq string "summary line +first line +CVS: Please evaluate your changes and consider the following. +CVS: Abort checkin if you answer no. +" + wanted "summary line +first line +") + (log-edit-done-strip-cvs-lines-helper string wanted 'CVS))) + +(ert-deftest log-edit-done-strip-cvs-lines-non-cvs () + "Do not strip lines beginning with \"CVS:\" when not using CVS as VC backend." + (let (string) + (setq string "summary line +first line +CVS: Please evaluate your changes and consider the following. +CVS: Abort checkin if you answer no. +") + (log-edit-done-strip-cvs-lines-helper string string nil))) + +(ert-deftest log-edit-done-strip-cvs-lines-only-cvs-colon-blank () + "Strip lines that contain solely \"CVS: \" when using CVS as VC backend." + (let (string wanted) + (setq string "CVS: \n" + wanted "") + (log-edit-done-strip-cvs-lines-helper string wanted 'CVS))) + +(ert-deftest log-edit-done-strip-cvs-lines-only-cvs-colon () + "Strip lines that contain solely \"CVS:\" when using CVS as VC backend." + ;; This test verifies that lines consisting only of "CVS:" (no blank + ;; after the colon) are stripped from the commit message. + ;; CVS does this to accomodate editors that delete trailing whitespace. + (let (string wanted) + (setq string "CVS:\n" + wanted "") + (log-edit-done-strip-cvs-lines-helper string wanted 'CVS))) + ;;; log-edit-tests.el ends here commit 4db604f3751ffb6a1fc3fd4277445a8f94cec13f Author: Po Lu Date: Sun Mar 9 13:22:59 2025 +0800 ; * java/org/gnu/emacs/EmacsWindow.java (viewLayout): Typo in comment. diff --git a/java/org/gnu/emacs/EmacsWindow.java b/java/org/gnu/emacs/EmacsWindow.java index 861bcace2ad..394b2c26414 100644 --- a/java/org/gnu/emacs/EmacsWindow.java +++ b/java/org/gnu/emacs/EmacsWindow.java @@ -353,7 +353,7 @@ else if (parent == null) /* Otherwise accept the new position offered by the toolkit. FIXME: isn't there a potential race condition here if the toolkit lays out EmacsView after a child frame's rect is set but before it - calls onLayout to read the modifies rect? */ + calls onLayout to read the modified rect? */ else { rect.left = left; commit 1e289586fc08615031783a28e1e197071b734aaf Author: Po Lu Date: Sun Mar 9 13:20:02 2025 +0800 Avoid reserved names in sfnt.c * src/sfnt.c (_MIN, _MAX): Rename to INS_MIN and INS_MAX. (sfnt_interpret_run): Adjust accordingly. diff --git a/src/sfnt.c b/src/sfnt.c index 470cf1f0c88..6728d70dde7 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -7685,7 +7685,7 @@ sfnt_interpret_trap (struct sfnt_interpreter *interpreter, PUSH_UNCHECKED (c); \ } -#define _MAX() \ +#define INS_MAX() \ { \ int32_t e1, e2; \ \ @@ -7695,7 +7695,7 @@ sfnt_interpret_trap (struct sfnt_interpreter *interpreter, PUSH_UNCHECKED (MAX (e1, e2)); \ } -#define _MIN() \ +#define INS_MIN() \ { \ int32_t e1, e2; \ \ @@ -12190,11 +12190,11 @@ sfnt_interpret_run (struct sfnt_interpreter *interpreter, break; case 0x8B: /* MAX */ - _MAX (); + INS_MAX (); break; case 0x8C: /* MIN */ - _MIN (); + INS_MIN (); break; /* Scan or dropout control is not implemented. Instead, 256 commit 2f1b1414f78e471f1c4e852c1cbd8320cb0fa60d Author: john muhl Date: Wed Feb 26 10:31:24 2025 -0600 Use TS to support 'hs-minor-mode' in 'lua-ts-mode' * lisp/progmodes/lua-ts-mode.el (lua-ts-mode): Add list type to 'treesit-thing-settings'. * lisp/progmodes/hideshow.el (hs-special-modes-alist): Remove regular expression based implementation. * test/lisp/progmodes/lua-ts-mode-resources/hide-show.lua: New file. * test/lisp/progmodes/lua-ts-mode-tests.el (lua-ts-test-hideshow): Add test. (Bug#76693) diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index c9b43fe8e16..c1d62fb92ab 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -266,7 +266,6 @@ This has effect only if `search-invisible' is set to `open'." (java-ts-mode "{" "}" "/[*/]" nil nil) (js-mode "{" "}" "/[*/]" nil) (js-ts-mode "{" "}" "/[*/]" nil) - (lua-ts-mode "{\\|\\[\\[" "}\\|\\]\\]" "--" nil) (mhtml-mode "{\\|<[^/>]*?" "}\\|]*[^/]>" "