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

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

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


From: Ramesh Nedunchezian
Subject: bug#47566: 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





reply via email to

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