[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#49104: [PATCH] 28.0.50; Handle remapped commands for M-TAB in `flysp
From: |
Stefan Monnier |
Subject: |
bug#49104: [PATCH] 28.0.50; Handle remapped commands for M-TAB in `flyspell-prog-mode' |
Date: |
Sat, 19 Jun 2021 07:51:29 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>> To reproduce this issue, you can do the following:
>>
>> emacs -Q
>> (global-set-key [remap completion-at-point]
>> (lambda () (interactive) (message "remapped")))
>> M-x flyspell-prog-mode
>> M-TAB ;; Or C-M-i
>
> Isn't it a bug that global/local-key-binding don't return such
> remapped bindings, at least optionally?
I don't, but I wonder why flyspell-prog-mode uses those functions
instead of using just `key-binding` (which seems simpler and does pay
attention to remapping).
IOW, what would be the problem with the patch below?
Stefan
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index fb9361e45d..30b44daf54 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -415,8 +415,7 @@ flyspell-prog-mode
(setq flyspell-generic-check-word-predicate
#'flyspell-generic-progmode-verify)
(setq-local flyspell--prev-meta-tab-binding
- (or (local-key-binding "\M-\t" t)
- (global-key-binding "\M-\t" t)))
+ (key-binding "\M-\t"))
(flyspell-mode 1)
(run-hooks 'flyspell-prog-mode-hook))
- bug#49104: [PATCH] 28.0.50; Handle remapped commands for M-TAB in `flyspell-prog-mode', Jim Porter, 2021/06/18
- bug#49104: [PATCH] 28.0.50; Handle remapped commands for M-TAB in `flyspell-prog-mode', Eli Zaretskii, 2021/06/19
- bug#49104: [PATCH] 28.0.50; Handle remapped commands for M-TAB in `flyspell-prog-mode',
Stefan Monnier <=
- bug#49104: [PATCH] 28.0.50; Handle remapped commands for M-TAB in `flyspell-prog-mode', Eli Zaretskii, 2021/06/19
- bug#49104: [PATCH] 28.0.50; Handle remapped commands for M-TAB in `flyspell-prog-mode', Stefan Monnier, 2021/06/19
- bug#49104: [PATCH] 28.0.50; Handle remapped commands for M-TAB in `flyspell-prog-mode', Jim Porter, 2021/06/19
- bug#49104: [PATCH] 28.0.50; Handle remapped commands for M-TAB in `flyspell-prog-mode', Stefan Monnier, 2021/06/27
- bug#49104: [PATCH] 28.0.50; Handle remapped commands for M-TAB in `flyspell-prog-mode', Jim Porter, 2021/06/28