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

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 10 Apr 2021 01:41:02 +0000

Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
47566: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=47566
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep'
From: Dmitry Gutov <[email-masked]>
To: Juri Linkov <[email-masked]>
Cc: [email-masked], Ramesh Nedunchezian <[email-masked]>
Date: Sat, 10 Apr 2021 04:40:49 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

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

Subject: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep'
From: Ramesh Nedunchezian <[email-masked]>
To: [email-masked]
Date: Fri, 2 Apr 2021 11:10:13 +0530
List-Id: <debbugs-submit.debbugs.gnu.org>

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