[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: |
Sun, 11 Apr 2021 12:18:43 +0530 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 11/04/21 4:29 am, Juri Linkov wrote:
>> It seems to me that repeat-mode is essentially a poor man's hydra.
>
> It is. It provides only the basic functionality.
> Don't expect many fancy things from repeat-mode.
The code below is pulled out from the existing code i.e., it doesn't
add any additional layer of complexity or does anything fanciful. But
it does add a bit of extensibility.
This is what I was suggesting:
(defvar repeat-mode-helper
(defun repeat-mode-helper (map)
(let (keys)
(message "Coming here")
(map-keymap (lambda (key _) (push key keys)) map)
(let ((mess (format-message
"Repeat with %s%s"
(mapconcat (lambda (key)
(key-description (vector key)))
keys ", ")
(if repeat-exit-key
(format ", or exit with %s"
(key-description repeat-exit-key))
""))))
(if (current-message)
(message "%s [%s]" (current-message) mess)
(message mess))))))
And in `repeat-post-hook', do something like
;; Messaging
(unless prefix-arg
(funcall (or (get rep-sym 'help) repeat-mode-helper) rep-map))
For those who don't want hints, they can use
(setq repeat-mode-helper #'ignore)
For those who want hints, but do /not/ want the hints hogging the echo
area, they could have their own custom helper like the one above,
after replacing
(message mess)
with
(tooltip-show mess)
--------------------------------
I would also appreciate if you could assess adding the exit key as a
property to the repeat mode symbol.
- 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, 2021/04/05
- 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 <=
- 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
- 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', Dmitry Gutov, 2021/04/13
- bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep', Kévin Le Gouguec, 2021/04/14
- bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep', Juri Linkov, 2021/04/14
- bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep', Kévin Le Gouguec, 2021/04/14
- bug#47566: 28.0.50; diff-hl should use `repeat-mode' ... and not `smartrep', Juri Linkov, 2021/04/14