branch: externals/hyperbole commit 575f988b41e7e01c7854b90f69140b1d660e7b29 Author: Mats Lidell <mats.lid...@lidells.se> Commit: GitHub <nore...@github.com>
Action key on + in magit diff moves to worktree file (#759) * Action key on + in magit diff moves to worktree file * Add texi doc for smart-magit jump to worktree Set locale to en_US.utf8 for using English month names on save. Add substitution marker for identifying the info page date. To avoid risk of changing other lines on save. --- ChangeLog | 12 ++++++++++++ hui-mouse.el | 31 ++++++++++++++++++++----------- man/.dir-locals.el | 33 +++++++++++++++++---------------- man/hyperbole.texi | 13 ++++++++----- 4 files changed, 57 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index d2e973f3bc..f18e89c785 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2025-06-26 Mats Lidell <ma...@gnu.org> + +* man/.dir-locals.el: Use with-locale-environment to ensure English is + used for month names. +* man/hyperbole.texi: Insert auto-replace-on-save marker comment for date + update on save. Needed for the date in info pages. + +* hui-mouse.el (smart-magit): Add jump to worktree file when action press on + `+' char in magit-status-mode or magit-revision-mode. +* man/hyperbole.texi (Smart Key - Magit Mode): Update docs with jump to + worktree. + 2025-06-24 Mats Lidell <ma...@gnu.org> * test/hui-tests.el (hui--kill-region-delimited-text-and-yank-back) diff --git a/hui-mouse.el b/hui-mouse.el index 8665bbf595..356b6b23c8 100644 --- a/hui-mouse.el +++ b/hui-mouse.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 04-Feb-89 -;; Last-Mod: 19-May-25 at 00:01:18 by Bob Weiner +;; Last-Mod: 24-Jun-25 at 16:38:34 by Mats Lidell ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -173,13 +173,14 @@ Its default value is `smart-scroll-down'. To disable it, set it to (declare-function todotxt-edit-item "ext:todotxt") (declare-function magit-current-section "magit-selection") -(declare-function magit-diff-visit-file "etx:magit-diff") -(declare-function magit-diff-visit-file--internal "etx:magit-diff") -(declare-function magit-file-at-point "etx:magit-git") -(declare-function magit-section-cycle-diffs "etx:magit-diff") -(declare-function magit-section-cycle-global "etx:magit-selection") -(declare-function magit-section-hide "etx:magit-selection") -(declare-function magit-section-show "etx:magit-selection") +(declare-function magit-diff-visit-file "ext:magit-diff") +(declare-function magit-diff-visit-file--internal "ext:magit-diff") +(declare-function magit-diff-visit-worktree-file "ext:magit-diff") +(declare-function magit-file-at-point "ext:magit-git") +(declare-function magit-section-cycle-diffs "ext:magit-diff") +(declare-function magit-section-cycle-global "ext:magit-selection") +(declare-function magit-section-hide "ext:magit-selection") +(declare-function magit-section-show "ext:magit-selection") (defvar magit-root-section) (defvar magit-display-buffer-function) @@ -1567,8 +1568,10 @@ If key is pressed: (2) at the end of a line, scroll up a windowful; (3) in a `magit-status-mode' buffer on a merge conflict marker, keep either the upper, both or the lower version of the conflict. - (4) on an initial read-only header line, cycle visibility of diff sections; - (5) anywhere else, hide/show the thing at point (\"TAB\" key binding) + (4) on a line starting with a `+' char in `magit-status-mode' or + `magit-revision-mode' go to the worktree file. + (5) on an initial read-only header line, cycle visibility of diff sections; + (6) anywhere else, hide/show the thing at point (\"TAB\" key binding) unless that does nothing in the mode, then jump to the thing at point (\"RET\" key binding) but display based on the value of `hpath:display-where'." @@ -1589,7 +1592,13 @@ If key is pressed: ((looking-at (regexp-quote "++=======")) (setq op 'magit-smerge-keep-all))))) (call-interactively op)) - (t + ((and + (memq major-mode '(magit-status-mode magit-revision-mode)) + (save-excursion + (beginning-of-line) + (looking-at-p "\\+"))) + (call-interactively #'magit-diff-visit-worktree-file)) + (t (let ((magit-display-buffer-function #'hpath:display-buffer)) (call-interactively #'smart-magit-tab)))))) diff --git a/man/.dir-locals.el b/man/.dir-locals.el index 7643932b4d..06e82591df 100644 --- a/man/.dir-locals.el +++ b/man/.dir-locals.el @@ -1,19 +1,20 @@ ((texinfo-mode . ((before-save-hook . (lambda () - (let ((day (format-time-string "%d" (current-time))) - (month (capitalize (format-time-string "%B" (current-time)))) - (year (format-time-string "%Y" (current-time)))) - (save-excursion - (goto-char (point-min)) - (when (re-search-forward "\\(@set UPDATED [[:word:]]+, [[:digit:]]+\\)" nil t) - (replace-match (format "@set UPDATED %s, %s" month year) nil t nil nil)) - (goto-char (point-min)) - (when (re-search-forward "\\(@set UPDATED-MONTH [[:word:]]+ [[:digit:]]+\\)" nil t) - (replace-match (format "@set UPDATED-MONTH %s %s" month year) nil t nil nil)) - (goto-char (point-min)) - (when (re-search-forward "\\(Printed [[:word:]]+ [[:digit:]]+, [[:digit:]]+\.\\)" nil t) - (replace-match (format "Printed %s %s, %s." month day year) nil t nil nil)) - (goto-char (point-min)) - (when (re-search-forward "\\([[:word:]]+ [[:digit:]]+, [[:digit:]]+ @c AUTO-REPLACE-ON-SAVE\\)" nil t) - (replace-match (format "%s %s, %s @c AUTO-REPLACE-ON-SAVE" month day year) nil t nil nil))))))))) + (with-locale-environment "en_US.utf8" + (let ((day (format-time-string "%d" (current-time))) + (month (capitalize (format-time-string "%B" (current-time)))) + (year (format-time-string "%Y" (current-time)))) + (save-excursion + (goto-char (point-min)) + (when (re-search-forward "\\(@set UPDATED [[:word:]]+, [[:digit:]]+\\)" nil t) + (replace-match (format "@set UPDATED %s, %s" month year) nil t nil nil)) + (goto-char (point-min)) + (when (re-search-forward "\\(@set UPDATED-MONTH [[:word:]]+ [[:digit:]]+\\)" nil t) + (replace-match (format "@set UPDATED-MONTH %s %s" month year) nil t nil nil)) + (goto-char (point-min)) + (when (re-search-forward "\\(Printed [[:word:]]+ [[:digit:]]+, [[:digit:]]+\.\\)" nil t) + (replace-match (format "Printed %s %s, %s." month day year) nil t nil nil)) + (goto-char (point-min)) + (when (re-search-forward "\\([[:word:]]+ [[:digit:]]+, [[:digit:]]+ @c AUTO-REPLACE-ON-SAVE\\)" nil t) + (replace-match (format "%s %s, %s @c AUTO-REPLACE-ON-SAVE" month day year) nil t nil nil)))))))))) diff --git a/man/hyperbole.texi b/man/hyperbole.texi index 1edff261c9..d9eb21c09e 100644 --- a/man/hyperbole.texi +++ b/man/hyperbole.texi @@ -7,7 +7,7 @@ @c Author: Bob Weiner @c @c Orig-Date: 6-Nov-91 at 11:18:03 -@c Last-Mod: 21-Jun-25 at 22:30:47 by Bob Weiner +@c Last-Mod: 26-Jun-25 at 18:26:06 by Mats Lidell @c %**start of header (This is for running Texinfo on a region.) @setfilename hyperbole.info @@ -171,7 +171,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</P> <PRE> Edition 9.0.2pre -Printed June 21, 2025. +Printed June 26, 2025. Published by the Free Software Foundation, Inc. Author: Bob Weiner @@ -213,7 +213,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @example Edition 9.0.2pre -May 19, 2025 +June 26, 2025 @c AUTO-REPLACE-ON-SAVE + Published by the Free Software Foundation, Inc. Author: Bob Weiner @@ -10890,8 +10891,10 @@ If pressed within a Magit buffer and not on a button: (3) in a @code{magit-status-mode} buffer on a merge conflict marker, keep either the upper, both or the lower version of the conflict. See also @ref{smerge}. - (4) on an initial read-only header line, cycle visibility of diff sections; - (5) anywhere else, hide/show the thing at point (@bkbd{@key{TAB}} key binding) + (4) on a line starting with a `+' char in `magit-status-mode' or + `magit-revision-mode' go to the worktree file. + (5) on an initial read-only header line, cycle visibility of diff sections; + (6) anywhere else, hide/show the thing at point (@bkbd{@key{TAB}} key binding) unless that does nothing in the mode, then jump to the thing at point (@bkbd{@key{RET}} key binding) but display based on the value of @code{hpath:display-where}.