diff --git a/emacs/MANUAL.md b/emacs/MANUAL.md index 5e1cae0..1ac431c 100644 --- a/emacs/MANUAL.md +++ b/emacs/MANUAL.md @@ -362,7 +362,7 @@ answers; anything that needs to know what a form means asks. longer empty. It lists the stopped program's frames, innermost first, each with where it is and how many named slots it has. -`TAB` on a frame opens it and shows what its locals hold — name, type and +`TAB` on a frame opens it (or `f`, which folds from anywhere on the frame) and shows what its locals hold — name, type and value, rendered the same way the inspector renders anything else. They are fetched the first time a frame is opened and then kept, because a stopped program's locals cannot change underneath you and a round trip behind a key diff --git a/emacs/flan-cnr.el b/emacs/flan-cnr.el index 59b2eb2..67a6b57 100644 --- a/emacs/flan-cnr.el +++ b/emacs/flan-cnr.el @@ -383,11 +383,23 @@ list already says it." (get-text-property pos 'flan-cnr-frame) (get-text-property pos 'flan-cnr-inspect))) +(defun flan-cnr-tab () + "Fold this frame, or move to the next actionable line. + +TAB does two things because the buffer has two kinds of line and the section +header already promised the first one: on a frame, it opens or closes that +frame's locals; anywhere else, it moves. `f' still folds unconditionally, for +anyone who would rather TAB always moved." + (interactive) + (if (get-text-property (point) 'flan-cnr-frame) + (flan-cnr-toggle-frame) + (flan-cnr-next))) + (defvar flan-cnr-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "RET") #'flan-cnr-take) (define-key map [mouse-1] #'flan-cnr-take) - (define-key map (kbd "TAB") #'flan-cnr-next) + (define-key map (kbd "TAB") #'flan-cnr-tab) (define-key map [backtab] #'flan-cnr-previous) (define-key map "n" #'flan-cnr-next) (define-key map "p" #'flan-cnr-previous)