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: Dmitry Gutov
Subject: bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep'
Date: Wed, 7 Apr 2021 01:44:07 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

Hi Juri,

On 05.04.2021 23:43, Juri Linkov wrote:
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.

Here you go:

(defun hl-test ()
  (interactive)
  (message "OK")
  (message "result: %s"
           (y-or-n-p "Yes? ")))

(defvar hl-repeat-map
  (let ((map (make-sparse-keymap)))
    (define-key map (kbd "n") 'hl-test) ; Note the changed key binding.
    map)
  "Keymap to repeat hl-test.")

(put 'hl-test 'repeat-map 'hl-repeat-map)

To try it:

1. M-x hl-test.
2. Press 'n' a few times.

Expected behavior:

It alternates between the prompt "Yes? " and message "result: nil".

Actual behavior:

It enters some sort of recursive state, only showing the prompt. I have to press 'y' a bunch of times to get out of it.





reply via email to

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