justbur / emacs-which-key

Emacs package that displays available keybindings in popup
GNU General Public License v3.0
1.73k stars 87 forks source link

which-key crashes when trying to display term-raw-map #346

Closed bcc32 closed 1 year ago

bcc32 commented 1 year ago

To reproduce, run:

emacs --batch -Q -l term -L ~/src/emacs-which-key -l which-key --eval "(which-key-show-keymap 'term-raw-map)"

The backtrace is reproduced below. Apparently, some values returned by key-description are not accepted by kbd. I think it might not be safe to pass around key descriptions in general and then translated back into events; they should be passed as actual input event sequences and only described when needed for display.

Debugger entered--Lisp error: (error "C- must prefix a single character, not @..C-b")
  signal(error ("C- must prefix a single character, not @..C-b"))
  error("%s must prefix a single character, not %s" "C-" "@..C-b")
  edmacro-parse-keys("C-@..C-b" nil)
  read-kbd-macro("C-@..C-b")
  kbd("C-@..C-b")
  (which-key--safe-lookup-key local-map (kbd keys))
  (eq (which-key--safe-lookup-key local-map (kbd keys)) (intern orig-desc))
  (let* ((keys (car key-binding)) (orig-desc (cdr key-binding)) (group (which-key--group-p orig-desc)) (local (eq (which-key--safe-lookup-key local-map (kbd keys)) (intern orig-desc))) (hl-face (which-key--highlight-face orig-desc)) (key-binding (which-key--maybe-replace key-binding)) (final-desc (which-key--propertize-description (cdr key-binding) group local hl-face orig-desc))) (if final-desc (progn (setq final-desc (which-key--truncate-description (which-key--maybe-add-docstring final-desc orig-desc) avl-width)))) (if (consp key-binding) (progn (setq new-list (cons (list (which-key--propertize-key (if preserve-full-key ... ...)) sep-w-face final-desc) new-list)))))
  (let ((key-binding (car --dolist-tail--))) (let* ((keys (car key-binding)) (orig-desc (cdr key-binding)) (group (which-key--group-p orig-desc)) (local (eq (which-key--safe-lookup-key local-map (kbd keys)) (intern orig-desc))) (hl-face (which-key--highlight-face orig-desc)) (key-binding (which-key--maybe-replace key-binding)) (final-desc (which-key--propertize-description (cdr key-binding) group local hl-face orig-desc))) (if final-desc (progn (setq final-desc (which-key--truncate-description (which-key--maybe-add-docstring final-desc orig-desc) avl-width)))) (if (consp key-binding) (progn (setq new-list (cons (list (which-key--propertize-key ...) sep-w-face final-desc) new-list))))) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (while --dolist-tail-- (let ((key-binding (car --dolist-tail--))) (let* ((keys (car key-binding)) (orig-desc (cdr key-binding)) (group (which-key--group-p orig-desc)) (local (eq (which-key--safe-lookup-key local-map (kbd keys)) (intern orig-desc))) (hl-face (which-key--highlight-face orig-desc)) (key-binding (which-key--maybe-replace key-binding)) (final-desc (which-key--propertize-description (cdr key-binding) group local hl-face orig-desc))) (if final-desc (progn (setq final-desc (which-key--truncate-description (which-key--maybe-add-docstring final-desc orig-desc) avl-width)))) (if (consp key-binding) (progn (setq new-list (cons (list ... sep-w-face final-desc) new-list))))) (setq --dolist-tail-- (cdr --dolist-tail--))))
  (let ((--dolist-tail-- unformatted)) (while --dolist-tail-- (let ((key-binding (car --dolist-tail--))) (let* ((keys (car key-binding)) (orig-desc (cdr key-binding)) (group (which-key--group-p orig-desc)) (local (eq (which-key--safe-lookup-key local-map ...) (intern orig-desc))) (hl-face (which-key--highlight-face orig-desc)) (key-binding (which-key--maybe-replace key-binding)) (final-desc (which-key--propertize-description (cdr key-binding) group local hl-face orig-desc))) (if final-desc (progn (setq final-desc (which-key--truncate-description ... avl-width)))) (if (consp key-binding) (progn (setq new-list (cons ... new-list))))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
  (let ((sep-w-face (which-key--propertize which-key-separator 'face 'which-key-separator-face)) (local-map (current-local-map)) (avl-width (cdr (which-key--popup-max-dimensions))) new-list) (let ((--dolist-tail-- unformatted)) (while --dolist-tail-- (let ((key-binding (car --dolist-tail--))) (let* ((keys (car key-binding)) (orig-desc (cdr key-binding)) (group (which-key--group-p orig-desc)) (local (eq ... ...)) (hl-face (which-key--highlight-face orig-desc)) (key-binding (which-key--maybe-replace key-binding)) (final-desc (which-key--propertize-description ... group local hl-face orig-desc))) (if final-desc (progn (setq final-desc ...))) (if (consp key-binding) (progn (setq new-list ...)))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (nreverse new-list))
  which-key--format-and-replace((("C-/" . "term-send-C-_") ("C-c" . "prefix") ("C-<down>" . "term-send-ctrl-down") ("C-<left>" . "term-send-ctrl-left") ("C-<right>" . "term-send-ctrl-right") ("C-<up>" . "term-send-ctrl-up") ("C-@..C-b" . "term-send-raw") ("ESC C-@Debugger entered--Lisp error: (error "C- must prefix a single character, not @..C-b")
  signal(error ("C- must prefix a single character, not @..C-b"))
  error("%s must prefix a single character, not %s" "C-" "@..C-b")
  edmacro-parse-keys("C-@..C-b" nil)
  read-kbd-macro("C-@..C-b")
  kbd("C-@..C-b")
  (which-key--safe-lookup-key local-map (kbd keys))
  (eq (which-key--safe-lookup-key local-map (kbd keys)) (intern orig-desc))
  (let* ((keys (car key-binding)) (orig-desc (cdr key-binding)) (group (which-key--group-p orig-desc)) (local (eq (which-key--safe-lookup-key local-map (kbd keys)) (intern orig-desc))) (hl-face (which-key--highlight-face orig-desc)) (key-binding (which-key--maybe-replace key-binding)) (final-desc (which-key--propertize-description (cdr key-binding) group local hl-face orig-desc))) (if final-desc (progn (setq final-desc (which-key--truncate-description (which-key--maybe-add-docstring final-desc orig-desc) avl-width)))) (if (consp key-binding) (progn (setq new-list (cons (list (which-key--propertize-key (if preserve-full-key ... ...)) sep-w-face final-desc) new-list)))))
  (let ((key-binding (car --dolist-tail--))) (let* ((keys (car key-binding)) (orig-desc (cdr key-binding)) (group (which-key--group-p orig-desc)) (local (eq (which-key--safe-lookup-key local-map (kbd keys)) (intern orig-desc))) (hl-face (which-key--highlight-face orig-desc)) (key-binding (which-key--maybe-replace key-binding)) (final-desc (which-key--propertize-description (cdr key-binding) group local hl-face orig-desc))) (if final-desc (progn (setq final-desc (which-key--truncate-description (which-key--maybe-add-docstring final-desc orig-desc) avl-width)))) (if (consp key-binding) (progn (setq new-list (cons (list (which-key--propertize-key ...) sep-w-face final-desc) new-list))))) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (while --dolist-tail-- (let ((key-binding (car --dolist-tail--))) (let* ((keys (car key-binding)) (orig-desc (cdr key-binding)) (group (which-key--group-p orig-desc)) (local (eq (which-key--safe-lookup-key local-map (kbd keys)) (intern orig-desc))) (hl-face (which-key--highlight-face orig-desc)) (key-binding (which-key--maybe-replace key-binding)) (final-desc (which-key--propertize-description (cdr key-binding) group local hl-face orig-desc))) (if final-desc (progn (setq final-desc (which-key--truncate-description (which-key--maybe-add-docstring final-desc orig-desc) avl-width)))) (if (consp key-binding) (progn (setq new-list (cons (list ... sep-w-face final-desc) new-list))))) (setq --dolist-tail-- (cdr --dolist-tail--))))
  (let ((--dolist-tail-- unformatted)) (while --dolist-tail-- (let ((key-binding (car --dolist-tail--))) (let* ((keys (car key-binding)) (orig-desc (cdr key-binding)) (group (which-key--group-p orig-desc)) (local (eq (which-key--safe-lookup-key local-map ...) (intern orig-desc))) (hl-face (which-key--highlight-face orig-desc)) (key-binding (which-key--maybe-replace key-binding)) (final-desc (which-key--propertize-description (cdr key-binding) group local hl-face orig-desc))) (if final-desc (progn (setq final-desc (which-key--truncate-description ... avl-width)))) (if (consp key-binding) (progn (setq new-list (cons ... new-list))))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
  (let ((sep-w-face (which-key--propertize which-key-separator 'face 'which-key-separator-face)) (local-map (current-local-map)) (avl-width (cdr (which-key--popup-max-dimensions))) new-list) (let ((--dolist-tail-- unformatted)) (while --dolist-tail-- (let ((key-binding (car --dolist-tail--))) (let* ((keys (car key-binding)) (orig-desc (cdr key-binding)) (group (which-key--group-p orig-desc)) (local (eq ... ...)) (hl-face (which-key--highlight-face orig-desc)) (key-binding (which-key--maybe-replace key-binding)) (final-desc (which-key--propertize-description ... group local hl-face orig-desc))) (if final-desc (progn (setq final-desc ...))) (if (consp key-binding) (progn (setq new-list ...)))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (nreverse new-list))
  which-key--format-and-replace((("C-/" . "term-send-C-_") ("C-c" . "prefix") ("C-<down>" . "term-send-ctrl-down") ("C-<left>" . "term-send-ctrl-left") ("C-<right>" . "term-send-ctrl-right") ("C-<up>" . "term-send-ctrl-up") ("C-@..C-b" . "term-send-raw") ("ESC C-@..N" . "term-send-raw-meta") ("C-\\..DEL" . "term-send-raw") ("C-d..C-z" . "term-send-raw") ("S-<insert>" . "term-paste") ("S-<next>" . "scroll-up") ("S-<prior>" . "scroll-down") ("<backspace>" . "term-send-backspace") ("<delete>" . "term-send-del") ("<deletechar>" . "term-send-del") ("<down>" . "term-send-down") ("<end>" . "term-send-end") ("<home>" . "term-send-home") ("<insert>" . "term-send-insert") ("<left>" . "term-send-left") ("<next>" . "term-send-next") ("<prior>" . "term-send-prior") ("<right>" . "term-send-right") ("<up>" . "term-send-up") ("<xterm-paste>" . "term--xterm-paste") ("ESC P..Z" . "term-send-raw-meta") ("ESC \\..DEL" . "term-send-raw-meta")) nil)
  (let* ((unformatted (cond ((keymapp keymap) (which-key--get-keymap-bindings keymap nil prefix filter recursive)) (keymap (error "%s is not a keymap" keymap)) (t (which-key--get-current-bindings prefix filter))))) (if which-key-sort-order (progn (setq unformatted (sort unformatted which-key-sort-order)))) (which-key--format-and-replace unformatted recursive))
  which-key--get-bindings(nil (keymap #^[nil nil keymap
#^^[3 0 term-send-raw term-send-raw term-send-raw (keymap (3 . term-send-raw) (27 keymap ...) (10 . term-line-mode) (11 . term-char-mode) (17 . term-pager-toggle) (21 . universal-argument) (22 . scroll-up-command) keymap #^[nil nil keymap
#^^[3 0 pop-global-mark nil list-buffers save-buffers-kill-terminal list-directory eval-last-sexp find-file nil nil indent-rigidly dired-jump kmacro-keymap downcase-region ... set-goal-column delete-blank-lines mark-page read-only-mode find-file-read-only save-buffer transpose-lines upcase-region find-alternate-file write-file exchange-point-and-mark ...] #^^[1 0 #^^[2 0
#^^[3 0 pop-global-mark nil list-buffers save-buffers-kill-terminal list-directory eval-last-sexp find-file nil nil indent-rigidly dired-jump kmacro-keymap downcase-region ... set-goal-column delete-blank-lines mark-page read-only-mode find-file-read-only save-buffer transpose-lines upcase-region find-alternate-file write-file exchange-point-and-mark ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] (67108912 . text-scale-adjust) (67108925 . text-scale-adjust) (67108909 . text-scale-adjust) (67108907 . text-scale-adjust) (67108923 . comment-line) (67108896 . pop-global-mark) (C-left . previous-buffer) (left . previous-buffer) (C-right . next-buffer) (right . next-buffer)) term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw ...] #^^[1 0 #^^[2 0
#^^[3 0 term-send-raw term-send-raw term-send-raw ... term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] (menu-bar keymap (signals menu-item "Signals" ...) (terminal menu-item "Terminal" ...)) (67108911 . term-send-C-_) (xterm-paste . term--xterm-paste) (next . term-send-next) (prior . term-send-prior) (S-insert . term-paste) (S-next . scroll-up) (S-prior . scroll-down) (insert . term-send-insert) (end . term-send-end) (home . term-send-home) (backspace . term-send-backspace) (deletechar . term-send-del) (delete . term-send-del) (C-left . term-send-ctrl-left) (C-right . term-send-ctrl-right) (C-down . term-send-ctrl-down) (C-up . term-send-ctrl-up) (left . term-send-left) (right . term-send-right) (down . term-send-down) (up . term-send-up) (mouse-2 . term-mouse-paste) (remap keymap (self-insert-command . term-send-raw))) nil nil)
  (let ((bindings (which-key--get-bindings nil keymap filter all))) (if (= (length bindings) 0) (message "which-key: No bindings found in %s" keymap-name) (cond ((listp which-key-side-window-location) (setq which-key--last-try-2-loc (apply #'which-key--try-2-side-windows bindings nil keymap-name which-key-side-window-location))) (t (setq which-key--pages-obj (which-key--create-pages bindings nil keymap-name)) (which-key--show-page))) (if no-paging nil (let* ((key (read-key)) (key-desc (key-description (list key))) (next-def (lookup-key keymap (vector key)))) (cond ((and which-key-use-C-h-commands (numberp key) (= key help-char)) (which-key-C-h-dispatch)) ((keymapp next-def) (which-key--hide-popup-ignore-command) (which-key--show-keymap (concat keymap-name " " key-desc) next-def (cons keymap-name keymap))) (t (which-key--hide-popup)))))))
  which-key--show-keymap("term-raw-map" (keymap #^[nil nil keymap
#^^[3 0 term-send-raw term-send-raw term-send-raw (keymap (3 . term-send-raw) (27 keymap ...) (10 . term-line-mode) (11 . term-char-mode) (17 . term-pager-toggle) (21 . universal-argument) (22 . scroll-up-command) keymap #^[nil nil keymap
#^^[3 0 pop-global-mark nil list-buffers save-buffers-kill-terminal list-directory eval-last-sexp find-file nil nil indent-rigidly dired-jump kmacro-keymap downcase-region ... set-goal-column delete-blank-lines mark-page read-only-mode find-file-read-only save-buffer transpose-lines upcase-region find-alternate-file write-file exchange-point-and-mark ...] #^^[1 0 #^^[2 0
#^^[3 0 pop-global-mark nil list-buffers save-buffers-kill-terminal list-directory eval-last-sexp find-file nil nil indent-rigidly dired-jump kmacro-keymap downcase-region ... set-goal-column delete-blank-lines mark-page read-only-mode find-file-read-only save-buffer transpose-lines upcase-region find-alternate-file write-file exchange-point-and-mark ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] (67108912 . text-scale-adjust) (67108925 . text-scale-adjust) (67108909 . text-scale-adjust) (67108907 . text-scale-adjust) (67108923 . comment-line) (67108896 . pop-global-mark) (C-left . previous-buffer) (left . previous-buffer) (C-right . next-buffer) (right . next-buffer)) term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw ...] #^^[1 0 #^^[2 0
#^^[3 0 term-send-raw term-send-raw term-send-raw ... term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] (menu-bar keymap (signals menu-item "Signals" ...) (terminal menu-item "Terminal" ...)) (67108911 . term-send-C-_) (xterm-paste . term--xterm-paste) (next . term-send-next) (prior . term-send-prior) (S-insert . term-paste) (S-next . scroll-up) (S-prior . scroll-down) (insert . term-send-insert) (end . term-send-end) (home . term-send-home) (backspace . term-send-backspace) (deletechar . term-send-del) (delete . term-send-del) (C-left . term-send-ctrl-left) (C-right . term-send-ctrl-right) (C-down . term-send-ctrl-down) (C-up . term-send-ctrl-up) (left . term-send-left) (right . term-send-right) (down . term-send-down) (up . term-send-up) (mouse-2 . term-mouse-paste) (remap keymap (self-insert-command . term-send-raw))) nil nil nil)
  which-key-show-keymap(term-raw-map)
  eval((which-key-show-keymap 'term-raw-map) t)
  command-line-1(("-l" "term" "-L" "/home/azeng/src/emacs-which-key" "-l" "which-key" "--eval" "(which-key-show-keymap 'term-raw-map)"))
  command-line()
  normal-top-level()
Debugger entered--Lisp error: (error "C- must prefix a single character, not @..C-b")
  signal(error ("C- must prefix a single character, not @..C-b"))
  error("%s must prefix a single character, not %s" "C-" "@..C-b")
  edmacro-parse-keys("C-@..C-b" nil)
  read-kbd-macro("C-@..C-b")
  kbd("C-@..C-b")
  (which-key--safe-lookup-key local-map (kbd keys))
  (eq (which-key--safe-lookup-key local-map (kbd keys)) (intern orig-desc))
  (let* ((keys (car key-binding)) (orig-desc (cdr key-binding)) (group (which-key--group-p orig-desc)) (local (eq (which-key--safe-lookup-key local-map (kbd keys)) (intern orig-desc))) (hl-face (which-key--highlight-face orig-desc)) (key-binding (which-key--maybe-replace key-binding)) (final-desc (which-key--propertize-description (cdr key-binding) group local hl-face orig-desc))) (if final-desc (progn (setq final-desc (which-key--truncate-description (which-key--maybe-add-docstring final-desc orig-desc) avl-width)))) (if (consp key-binding) (progn (setq new-list (cons (list (which-key--propertize-key (if preserve-full-key ... ...)) sep-w-face final-desc) new-list)))))
  (let ((key-binding (car --dolist-tail--))) (let* ((keys (car key-binding)) (orig-desc (cdr key-binding)) (group (which-key--group-p orig-desc)) (local (eq (which-key--safe-lookup-key local-map (kbd keys)) (intern orig-desc))) (hl-face (which-key--highlight-face orig-desc)) (key-binding (which-key--maybe-replace key-binding)) (final-desc (which-key--propertize-description (cdr key-binding) group local hl-face orig-desc))) (if final-desc (progn (setq final-desc (which-key--truncate-description (which-key--maybe-add-docstring final-desc orig-desc) avl-width)))) (if (consp key-binding) (progn (setq new-list (cons (list (which-key--propertize-key ...) sep-w-face final-desc) new-list))))) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (while --dolist-tail-- (let ((key-binding (car --dolist-tail--))) (let* ((keys (car key-binding)) (orig-desc (cdr key-binding)) (group (which-key--group-p orig-desc)) (local (eq (which-key--safe-lookup-key local-map (kbd keys)) (intern orig-desc))) (hl-face (which-key--highlight-face orig-desc)) (key-binding (which-key--maybe-replace key-binding)) (final-desc (which-key--propertize-description (cdr key-binding) group local hl-face orig-desc))) (if final-desc (progn (setq final-desc (which-key--truncate-description (which-key--maybe-add-docstring final-desc orig-desc) avl-width)))) (if (consp key-binding) (progn (setq new-list (cons (list ... sep-w-face final-desc) new-list))))) (setq --dolist-tail-- (cdr --dolist-tail--))))
  (let ((--dolist-tail-- unformatted)) (while --dolist-tail-- (let ((key-binding (car --dolist-tail--))) (let* ((keys (car key-binding)) (orig-desc (cdr key-binding)) (group (which-key--group-p orig-desc)) (local (eq (which-key--safe-lookup-key local-map ...) (intern orig-desc))) (hl-face (which-key--highlight-face orig-desc)) (key-binding (which-key--maybe-replace key-binding)) (final-desc (which-key--propertize-description (cdr key-binding) group local hl-face orig-desc))) (if final-desc (progn (setq final-desc (which-key--truncate-description ... avl-width)))) (if (consp key-binding) (progn (setq new-list (cons ... new-list))))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
  (let ((sep-w-face (which-key--propertize which-key-separator 'face 'which-key-separator-face)) (local-map (current-local-map)) (avl-width (cdr (which-key--popup-max-dimensions))) new-list) (let ((--dolist-tail-- unformatted)) (while --dolist-tail-- (let ((key-binding (car --dolist-tail--))) (let* ((keys (car key-binding)) (orig-desc (cdr key-binding)) (group (which-key--group-p orig-desc)) (local (eq ... ...)) (hl-face (which-key--highlight-face orig-desc)) (key-binding (which-key--maybe-replace key-binding)) (final-desc (which-key--propertize-description ... group local hl-face orig-desc))) (if final-desc (progn (setq final-desc ...))) (if (consp key-binding) (progn (setq new-list ...)))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (nreverse new-list))
  which-key--format-and-replace((("C-/" . "term-send-C-_") ("C-c" . "prefix") ("C-<down>" . "term-send-ctrl-down") ("C-<left>" . "term-send-ctrl-left") ("C-<right>" . "term-send-ctrl-right") ("C-<up>" . "term-send-ctrl-up") ("C-@..C-b" . "term-send-raw") ("ESC C-@..N" . "term-send-raw-meta") ("C-\\..DEL" . "term-send-raw") ("C-d..C-z" . "term-send-raw") ("S-<insert>" . "term-paste") ("S-<next>" . "scroll-up") ("S-<prior>" . "scroll-down") ("<backspace>" . "term-send-backspace") ("<delete>" . "term-send-del") ("<deletechar>" . "term-send-del") ("<down>" . "term-send-down") ("<end>" . "term-send-end") ("<home>" . "term-send-home") ("<insert>" . "term-send-insert") ("<left>" . "term-send-left") ("<next>" . "term-send-next") ("<prior>" . "term-send-prior") ("<right>" . "term-send-right") ("<up>" . "term-send-up") ("<xterm-paste>" . "term--xterm-paste") ("ESC P..Z" . "term-send-raw-meta") ("ESC \\..DEL" . "term-send-raw-meta")) nil)
  (let* ((unformatted (cond ((keymapp keymap) (which-key--get-keymap-bindings keymap nil prefix filter recursive)) (keymap (error "%s is not a keymap" keymap)) (t (which-key--get-current-bindings prefix filter))))) (if which-key-sort-order (progn (setq unformatted (sort unformatted which-key-sort-order)))) (which-key--format-and-replace unformatted recursive))
  which-key--get-bindings(nil (keymap #^[nil nil keymap
#^^[3 0 term-send-raw term-send-raw term-send-raw (keymap (3 . term-send-raw) (27 keymap ...) (10 . term-line-mode) (11 . term-char-mode) (17 . term-pager-toggle) (21 . universal-argument) (22 . scroll-up-command) keymap #^[nil nil keymap
#^^[3 0 pop-global-mark nil list-buffers save-buffers-kill-terminal list-directory eval-last-sexp find-file nil nil indent-rigidly dired-jump kmacro-keymap downcase-region ... set-goal-column delete-blank-lines mark-page read-only-mode find-file-read-only save-buffer transpose-lines upcase-region find-alternate-file write-file exchange-point-and-mark ...] #^^[1 0 #^^[2 0
#^^[3 0 pop-global-mark nil list-buffers save-buffers-kill-terminal list-directory eval-last-sexp find-file nil nil indent-rigidly dired-jump kmacro-keymap downcase-region ... set-goal-column delete-blank-lines mark-page read-only-mode find-file-read-only save-buffer transpose-lines upcase-region find-alternate-file write-file exchange-point-and-mark ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] (67108912 . text-scale-adjust) (67108925 . text-scale-adjust) (67108909 . text-scale-adjust) (67108907 . text-scale-adjust) (67108923 . comment-line) (67108896 . pop-global-mark) (C-left . previous-buffer) (left . previous-buffer) (C-right . next-buffer) (right . next-buffer)) term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw ...] #^^[1 0 #^^[2 0
#^^[3 0 term-send-raw term-send-raw term-send-raw ... term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] (menu-bar keymap (signals menu-item "Signals" ...) (terminal menu-item "Terminal" ...)) (67108911 . term-send-C-_) (xterm-paste . term--xterm-paste) (next . term-send-next) (prior . term-send-prior) (S-insert . term-paste) (S-next . scroll-up) (S-prior . scroll-down) (insert . term-send-insert) (end . term-send-end) (home . term-send-home) (backspace . term-send-backspace) (deletechar . term-send-del) (delete . term-send-del) (C-left . term-send-ctrl-left) (C-right . term-send-ctrl-right) (C-down . term-send-ctrl-down) (C-up . term-send-ctrl-up) (left . term-send-left) (right . term-send-right) (down . term-send-down) (up . term-send-up) (mouse-2 . term-mouse-paste) (remap keymap (self-insert-command . term-send-raw))) nil nil)
  (let ((bindings (which-key--get-bindings nil keymap filter all))) (if (= (length bindings) 0) (message "which-key: No bindings found in %s" keymap-name) (cond ((listp which-key-side-window-location) (setq which-key--last-try-2-loc (apply #'which-key--try-2-side-windows bindings nil keymap-name which-key-side-window-location))) (t (setq which-key--pages-obj (which-key--create-pages bindings nil keymap-name)) (which-key--show-page))) (if no-paging nil (let* ((key (read-key)) (key-desc (key-description (list key))) (next-def (lookup-key keymap (vector key)))) (cond ((and which-key-use-C-h-commands (numberp key) (= key help-char)) (which-key-C-h-dispatch)) ((keymapp next-def) (which-key--hide-popup-ignore-command) (which-key--show-keymap (concat keymap-name " " key-desc) next-def (cons keymap-name keymap))) (t (which-key--hide-popup)))))))
  which-key--show-keymap("term-raw-map" (keymap #^[nil nil keymap
#^^[3 0 term-send-raw term-send-raw term-send-raw (keymap (3 . term-send-raw) (27 keymap ...) (10 . term-line-mode) (11 . term-char-mode) (17 . term-pager-toggle) (21 . universal-argument) (22 . scroll-up-command) keymap #^[nil nil keymap
#^^[3 0 pop-global-mark nil list-buffers save-buffers-kill-terminal list-directory eval-last-sexp find-file nil nil indent-rigidly dired-jump kmacro-keymap downcase-region ... set-goal-column delete-blank-lines mark-page read-only-mode find-file-read-only save-buffer transpose-lines upcase-region find-alternate-file write-file exchange-point-and-mark ...] #^^[1 0 #^^[2 0
#^^[3 0 pop-global-mark nil list-buffers save-buffers-kill-terminal list-directory eval-last-sexp find-file nil nil indent-rigidly dired-jump kmacro-keymap downcase-region ... set-goal-column delete-blank-lines mark-page read-only-mode find-file-read-only save-buffer transpose-lines upcase-region find-alternate-file write-file exchange-point-and-mark ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] (67108912 . text-scale-adjust) (67108925 . text-scale-adjust) (67108909 . text-scale-adjust) (67108907 . text-scale-adjust) (67108923 . comment-line) (67108896 . pop-global-mark) (C-left . previous-buffer) (left . previous-buffer) (C-right . next-buffer) (right . next-buffer)) term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw ...] #^^[1 0 #^^[2 0
#^^[3 0 term-send-raw term-send-raw term-send-raw ... term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] (menu-bar keymap (signals menu-item "Signals" ...) (terminal menu-item "Terminal" ...)) (67108911 . term-send-C-_) (xterm-paste . term--xterm-paste) (next . term-send-next) (prior . term-send-prior) (S-insert . term-paste) (S-next . scroll-up) (S-prior . scroll-down) (insert . term-send-insert) (end . term-send-end) (home . term-send-home) (backspace . term-send-backspace) (deletechar . term-send-del) (delete . term-send-del) (C-left . term-send-ctrl-left) (C-right . term-send-ctrl-right) (C-down . term-send-ctrl-down) (C-up . term-send-ctrl-up) (left . term-send-left) (right . term-send-right) (down . term-send-down) (up . term-send-up) (mouse-2 . term-mouse-paste) (remap keymap (self-insert-command . term-send-raw))) nil nil nil)
  which-key-show-keymap(term-raw-map)
  eval((which-key-show-keymap 'term-raw-map) t)
  command-line-1(("-l" "term" "-L" "/home/azeng/src/emacs-which-key" "-l" "which-key" "--eval" "(which-key-show-keymap 'term-raw-map)"))
  command-line()
  normal-top-level()
.N" . "term-send-raw-meta") ("C-\\..DEL" . "term-send-raw") ("C-d..C-z" . "term-send-raw") ("S-<insert>" . "term-paste") ("S-<next>" . "scroll-up") ("S-<prior>" . "scroll-down") ("<backspace>" . "term-send-backspace") ("<delete>" . "term-send-del") ("<deletechar>" . "term-send-del") ("<down>" . "term-send-down") ("<end>" . "term-send-end") ("<home>" . "term-send-home") ("<insert>" . "term-send-insert") ("<left>" . "term-send-left") ("<next>" . "term-send-next") ("<prior>" . "term-send-prior") ("<right>" . "term-send-right") ("<up>" . "term-send-up") ("<xterm-paste>" . "term--xterm-paste") ("ESC P..Z" . "term-send-raw-meta") ("ESC \\..DEL" . "term-send-raw-meta")) nil)
  (let* ((unformatted (cond ((keymapp keymap) (which-key--get-keymap-bindings keymap nil prefix filter recursive)) (keymap (error "%s is not a keymap" keymap)) (t (which-key--get-current-bindings prefix filter))))) (if which-key-sort-order (progn (setq unformatted (sort unformatted which-key-sort-order)))) (which-key--format-and-replace unformatted recursive))
  which-key--get-bindings(nil (keymap #^[nil nil keymap
#^^[3 0 term-send-raw term-send-raw term-send-raw (keymap (3 . term-send-raw) (27 keymap ...) (10 . term-line-mode) (11 . term-char-mode) (17 . term-pager-toggle) (21 . universal-argument) (22 . scroll-up-command) keymap #^[nil nil keymap
#^^[3 0 pop-global-mark nil list-buffers save-buffers-kill-terminal list-directory eval-last-sexp find-file nil nil indent-rigidly dired-jump kmacro-keymap downcase-region ... set-goal-column delete-blank-lines mark-page read-only-mode find-file-read-only save-buffer transpose-lines upcase-region find-alternate-file write-file exchange-point-and-mark ...] #^^[1 0 #^^[2 0
#^^[3 0 pop-global-mark nil list-buffers save-buffers-kill-terminal list-directory eval-last-sexp find-file nil nil indent-rigidly dired-jump kmacro-keymap downcase-region ... set-goal-column delete-blank-lines mark-page read-only-mode find-file-read-only save-buffer transpose-lines upcase-region find-alternate-file write-file exchange-point-and-mark ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] (67108912 . text-scale-adjust) (67108925 . text-scale-adjust) (67108909 . text-scale-adjust) (67108907 . text-scale-adjust) (67108923 . comment-line) (67108896 . pop-global-mark) (C-left . previous-buffer) (left . previous-buffer) (C-right . next-buffer) (right . next-buffer)) term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw ...] #^^[1 0 #^^[2 0
#^^[3 0 term-send-raw term-send-raw term-send-raw ... term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] (menu-bar keymap (signals menu-item "Signals" ...) (terminal menu-item "Terminal" ...)) (67108911 . term-send-C-_) (xterm-paste . term--xterm-paste) (next . term-send-next) (prior . term-send-prior) (S-insert . term-paste) (S-next . scroll-up) (S-prior . scroll-down) (insert . term-send-insert) (end . term-send-end) (home . term-send-home) (backspace . term-send-backspace) (deletechar . term-send-del) (delete . term-send-del) (C-left . term-send-ctrl-left) (C-right . term-send-ctrl-right) (C-down . term-send-ctrl-down) (C-up . term-send-ctrl-up) (left . term-send-left) (right . term-send-right) (down . term-send-down) (up . term-send-up) (mouse-2 . term-mouse-paste) (remap keymap (self-insert-command . term-send-raw))) nil nil)
  (let ((bindings (which-key--get-bindings nil keymap filter all))) (if (= (length bindings) 0) (message "which-key: No bindings found in %s" keymap-name) (cond ((listp which-key-side-window-location) (setq which-key--last-try-2-loc (apply #'which-key--try-2-side-windows bindings nil keymap-name which-key-side-window-location))) (t (setq which-key--pages-obj (which-key--create-pages bindings nil keymap-name)) (which-key--show-page))) (if no-paging nil (let* ((key (read-key)) (key-desc (key-description (list key))) (next-def (lookup-key keymap (vector key)))) (cond ((and which-key-use-C-h-commands (numberp key) (= key help-char)) (which-key-C-h-dispatch)) ((keymapp next-def) (which-key--hide-popup-ignore-command) (which-key--show-keymap (concat keymap-name " " key-desc) next-def (cons keymap-name keymap))) (t (which-key--hide-popup)))))))
  which-key--show-keymap("term-raw-map" (keymap #^[nil nil keymap
#^^[3 0 term-send-raw term-send-raw term-send-raw (keymap (3 . term-send-raw) (27 keymap ...) (10 . term-line-mode) (11 . term-char-mode) (17 . term-pager-toggle) (21 . universal-argument) (22 . scroll-up-command) keymap #^[nil nil keymap
#^^[3 0 pop-global-mark nil list-buffers save-buffers-kill-terminal list-directory eval-last-sexp find-file nil nil indent-rigidly dired-jump kmacro-keymap downcase-region ... set-goal-column delete-blank-lines mark-page read-only-mode find-file-read-only save-buffer transpose-lines upcase-region find-alternate-file write-file exchange-point-and-mark ...] #^^[1 0 #^^[2 0
#^^[3 0 pop-global-mark nil list-buffers save-buffers-kill-terminal list-directory eval-last-sexp find-file nil nil indent-rigidly dired-jump kmacro-keymap downcase-region ... set-goal-column delete-blank-lines mark-page read-only-mode find-file-read-only save-buffer transpose-lines upcase-region find-alternate-file write-file exchange-point-and-mark ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] (67108912 . text-scale-adjust) (67108925 . text-scale-adjust) (67108909 . text-scale-adjust) (67108907 . text-scale-adjust) (67108923 . comment-line) (67108896 . pop-global-mark) (C-left . previous-buffer) (left . previous-buffer) (C-right . next-buffer) (right . next-buffer)) term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw ...] #^^[1 0 #^^[2 0
#^^[3 0 term-send-raw term-send-raw term-send-raw ... term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw term-send-raw ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...] (menu-bar keymap (signals menu-item "Signals" ...) (terminal menu-item "Terminal" ...)) (67108911 . term-send-C-_) (xterm-paste . term--xterm-paste) (next . term-send-next) (prior . term-send-prior) (S-insert . term-paste) (S-next . scroll-up) (S-prior . scroll-down) (insert . term-send-insert) (end . term-send-end) (home . term-send-home) (backspace . term-send-backspace) (deletechar . term-send-del) (delete . term-send-del) (C-left . term-send-ctrl-left) (C-right . term-send-ctrl-right) (C-down . term-send-ctrl-down) (C-up . term-send-ctrl-up) (left . term-send-left) (right . term-send-right) (down . term-send-down) (up . term-send-up) (mouse-2 . term-mouse-paste) (remap keymap (self-insert-command . term-send-raw))) nil nil nil)
  which-key-show-keymap(term-raw-map)
  eval((which-key-show-keymap 'term-raw-map) t)
  command-line-1(("-l" "term" "-L" "~/src/emacs-which-key" "-l" "which-key" "--eval" "(which-key-show-keymap 'term-raw-map)"))
  command-line()
  normal-top-level()
justbur commented 1 year ago

Thanks