[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: |
Juri Linkov |
Subject: |
bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep' |
Date: |
Mon, 05 Apr 2021 23:43:32 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) |
>> (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)))
>
> Try this alternative too, seems shorter:
>
> (map-keymap
> (lambda (_key cmd)
> (put cmd 'repeat-map 'diff-hl-command-map))
> diff-hl-command-map)
>
> But either version (together with enabling repeat-mode) seems to break
> diff-hl-revert-hunk: as soon as it reaches the the y-or-n prompt, and I try
> to answer 'n', it enters the repeat loop again, instead of sending the
> result to the command.
Could you provide a minimal test case? I tried with:
#+begin_src emacs-lisp
(defun hl-test ()
(interactive)
(message "OK")
(y-or-n-p "Yes? "))
(defvar hl-repeat-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "r") 'hl-test)
map)
"Keymap to repeat hl-test.")
(put 'hl-test 'repeat-map 'hl-repeat-map)
#+end_src
Then typing `M-x hl-test RET', and `y r y r y r ...' keeps the loop.
- bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep', Ramesh Nedunchezian, 2021/04/02
- bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep', Dmitry Gutov, 2021/04/03
- bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep',
Juri Linkov <=
- bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep', Dmitry Gutov, 2021/04/06
- bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep', Juri Linkov, 2021/04/08
- bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep', Dmitry Gutov, 2021/04/09
- bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep', Ramesh Nedunchezian, 2021/04/10
- bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep', Juri Linkov, 2021/04/10
- bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep', Ramesh Nedunchezian, 2021/04/11
- bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep', Juri Linkov, 2021/04/11
- bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep', Juri Linkov, 2021/04/12
- bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep', Juri Linkov, 2021/04/10
- bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep', Dmitry Gutov, 2021/04/10