Pages

Wednesday, May 27, 2026

Emacs view- Commands

A kind reader suggested I try the view-lossage command to display a list of recent keystrokes. This would be helpful for those times when I press a key accidentally and don't know what I did (as described in "zap-to-char M-z").

The output resembles what you'd get from edit-kbd-macro (assuming that a keyboard macro had been defined). This provides an alternate way to define a keyboard macro -- just select the desired portion of the output and invoke read-kbd-macro .  At this point you can "play back" those keystrokes with C-x e.

After I understood view-lossage ,  I skimmed through the list of commands that start with view- (by doing M-x view- TAB ). The commands view-buffer ,   view-file (and variants that view in another buffer , window , frame ) provide a safe (read-only) way to examine the contents of a buffer or file.

Entering M-x view-file-other-frame .emacs allows me to display my init file in a new Emacs frame and close it (by pressing "q") when I'm done with it. And then I don't have to worry about changing it inadvertently.

No comments:

Post a Comment

Thank you for taking time to comment. Please note that comments may be deleted if they:

* Contain link(s) to a domain outside USA or Canada or to a commercial enterprise.
* Include non-English words or characters.
* Are irrelevant to the subject matter of the post.

For posts older than 14 days, comments are moderated and require approval.