mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-29 19:48:19 +00:00
(insert-kbd-macro): Handle C-@, C-[, etc. properly and their meta variants too.
This commit is contained in:
parent
b5e8c6b79d
commit
41d1fb49f5
@ -76,23 +76,35 @@ use this command, and then save the file."
|
||||
(goto-char beg)
|
||||
(while (< (point) end)
|
||||
(let ((char (following-char)))
|
||||
(cond ((< char 32)
|
||||
(cond ((= char 0)
|
||||
(delete-region (point) (1+ (point)))
|
||||
(insert "\\C-@"))
|
||||
((< char 27)
|
||||
(delete-region (point) (1+ (point)))
|
||||
(insert "\\C-" (+ 96 char)))
|
||||
((< char 32)
|
||||
(delete-region (point) (1+ (point)))
|
||||
(insert "\\C-" (+ 64 char)))
|
||||
((< char 127)
|
||||
(forward-char 1))
|
||||
((= char 127)
|
||||
(delete-region (point) (1+ (point)))
|
||||
(insert "\\C-?"))
|
||||
((= char 128)
|
||||
(delete-region (point) (1+ (point)))
|
||||
(insert "\\M-\\C-@"))
|
||||
((< char 155)
|
||||
(delete-region (point) (1+ (point)))
|
||||
(insert "\\M-\\C-" (- char 32)))
|
||||
((< char 160)
|
||||
(delete-region (point) (1+ (point)))
|
||||
(insert "\\M-C-" (- char 32)))
|
||||
(insert "\\M-\\C-" (- char 64)))
|
||||
((< char 255)
|
||||
(delete-region (point) (1+ (point)))
|
||||
(insert "\\M-" (- char 128)))
|
||||
((= char 255)
|
||||
(delete-region (point) (1+ (point)))
|
||||
(insert "\\M-C-?"))))))
|
||||
(insert "\\M-\\C-?"))))))
|
||||
(insert ")\n")
|
||||
(if keys
|
||||
(let ((keys (where-is-internal macroname '(keymap))))
|
||||
|
Loading…
Reference in New Issue
Block a user