emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#47566: closed (28.0.50; diff-hl should use `repeat-mode' ... and not


From: GNU bug Tracking System
Subject: bug#47566: closed (28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep')
Date: Sat, 10 Apr 2021 01:41:02 +0000

Your message dated Sat, 10 Apr 2021 04:40:49 +0300
with message-id <7f1b570f-ea1b-5524-59fa-83bb5eaa9abd@yandex.ru>
and subject line Re: bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... 
and not `smartrep'
has caused the debbugs.gnu.org bug report #47566,
regarding 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep'
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
47566: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=47566
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep' Date: Fri, 2 Apr 2021 11:10:13 +0530 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0
28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep'.

Commentary in `diff-hl' says

    ;; `diff-hl-mode' highlights uncommitted changes on the side of the
    ;; window (using the fringe, by default), allows you to jump between
    ;; the hunks and revert them selectively.

    ;; Provided commands:
    ;;
    ;; `diff-hl-diff-goto-hunk'  C-x v =
    ;; `diff-hl-revert-hunk'     C-x v n
    ;; `diff-hl-previous-hunk'   C-x v [
    ;; `diff-hl-next-hunk'       C-x v ]
    ;;
    ;; The mode takes advantage of `smartrep' if it is installed.

FWIW, `smartrep' is not part of GNU Emacs or GNU ELPA but available
elsewhere.  (I install it via MELPA)

Now, that `repeat-mode' is part of GNU Emacs, I think this dependency
on `smartrep' can be removed.

FWIW, this is what I have in my `.emacs'.

    (progn
      (defvar diff-hl--repeat-map
        (let
            ((map
              (make-sparse-keymap)))
          map))
      (message "Installed %s" 'diff-hl--repeat-map)
      (cl-loop for
               (cmd . key)
               in
               '((diff-hl-diff-goto-hunk . "=")
                 (diff-hl-revert-hunk . "n")
                 (diff-hl-previous-hunk . "[")
                 (diff-hl-next-hunk . "]"))
               do
               (define-key diff-hl--repeat-map key cmd)
               (put cmd 'repeat-map 'diff-hl--repeat-map)))

----------------

In GNU Emacs 28.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo 
version 1.16.0)
 of 2021-03-20 built on debian
Repository revision: 31544bc908d35bff513450bc4bea1d0283a7ddb0
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12010000
System Description: Debian GNU/Linux bullseye/sid



--- End Message ---
--- Begin Message --- Subject: Re: bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep' Date: Sat, 10 Apr 2021 04:40:49 +0300 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1
On 08.04.2021 21:57, Juri Linkov wrote:
Thanks for the detailed test case.  Now it's fixed in 580c4c6510.

Thanks! repeat-mode is looking good now (*).

I've added integration for it to diff-hl master, and with that we can close this issue.

Thanks all.

(*) Though the first impression, in comparison, was that it is too chatty. The hints are definitely helpful for discovery at first, though.

Maybe something like this would be an improvement? Experimental code warning.

diff --git a/lisp/repeat.el b/lisp/repeat.el
index b3c58f2f81..e704e4da56 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -404,7 +404,7 @@ repeat-post-hook
                                        (key-description repeat-exit-key))
                              ""))))
                 (if (current-message)
-                    (message "%s [%s]" (current-message) mess)
+ (message #("%s [%s]" 3 7 (face deemphasized)) (current-message) mess)
                   (message mess))))

             ;; Adding an exit key


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]