Add use-package and keymap-set forms, remove cl-lib#169
Add use-package and keymap-set forms, remove cl-lib#169Esnos33 wants to merge 3 commits intoemacsorphanage:masterfrom
Conversation
|
@darth10 builds doesn't proceed, but on my machine all test passes. Is there something I should do to fix this? |
|
I guess you're using a version later than Emacs 29. Thinking about this further, I don't think we should be replacing all usages of I'll refine this when I get some time. Thanks again for your contribution! 🚀 |
| (suppress-keymap map t) | ||
| (define-key map [remap self-insert-command] 'god-mode-self-insert) | ||
| (keymap-set map "<remap> <self-insert-command>" #'god-mode-self-insert) |
There was a problem hiding this comment.
This doesn't look right - (suppress-keymap map t) is removed, which is used to override self-inserting keys.
There was a problem hiding this comment.
We are anyway remapping self-insert keys with god-mode-self-insert, so this line just doesn't do anything. With code below I checked if both keymaps are the same, and they are:
;; map1 is without (supress-keymap map t), and map2 is with it
(let ((map1 (let ((map (make-sparse-keymap)))
;; (suppress-keymap map t)
(keymap-set map "<remap> <self-insert-command>" #'god-mode-self-insert)
(let ((i ?\s))
(while (< i 256)
(keymap-set map (single-key-description i) 'god-mode-self-insert)
(setq i (1+ i))))
(when god-mode-enable-function-key-translation
(dotimes (i 35)
(keymap-set map (single-key-description (god-mode-make-f-key (1+ i))) 'god-mode-self-insert)
(keymap-set map (single-key-description (god-mode-make-f-key (1+ i) t)) 'god-mode-self-insert)))
(keymap-set map "DEL" nil)
(keymap-set map "C-h k" #'god-mode-describe-key)
map))
(map2 (let ((map (make-sparse-keymap)))
(suppress-keymap map t)
(keymap-set map "<remap> <self-insert-command>" #'god-mode-self-insert)
(let ((i ?\s))
(while (< i 256)
(keymap-set map (single-key-description i) 'god-mode-self-insert)
(setq i (1+ i))))
(when god-mode-enable-function-key-translation
(dotimes (i 35)
(keymap-set map (single-key-description (god-mode-make-f-key (1+ i))) 'god-mode-self-insert)
(keymap-set map (single-key-description (god-mode-make-f-key (1+ i) t)) 'god-mode-self-insert)))
(keymap-set map "DEL" nil)
(keymap-set map "C-h k" #'god-mode-describe-key)
map)))
(equal map1 map2)) ;; -> t
And if suppress-keymap should do something, than tests doesn't coverage it
|
Maybe I will split this commit into four different commits and then you can easily choose which you want to keep? Even if they are small changes, I think I made to many things at the same time, sorry about that. |
Yes, that would be helpful. |
|
@darth10 I tidied commits, but I still leave them as single pull request. Is it okay, or should I split them into 3 different pull request and close this one? |
|
That's all good - I'll work through the commits and keep what's necessary. |
Resolves #168