Buffer Specific Commands

Remember the other day when I said I almost always learn something new from Bozhidar Batsov’s posts? I just ran across another example. Batsov informs us that as of Emacs 29, there’s a new command called execute-extended-command-for-buffer (bound to Meta+X) that’s like execute-extented-command (bound to Meta+x) except that the candidate commands are limited to those that make sense for the current buffer. That means commands specific to the current major mode, enabled minor mode, and commands bound to the local key map.

This is useful for those (almost everybody?) who have some sort of completion mechanism in place for the minibuffer. It’s especially useful for those who, like me, sometimes can’t remember the exact name of the command they want to run and depend on the completion mechanism to find it for them.

Meta+X is marginally harder to type than Meta+x but not enough to discourage its use. I suppose that if you find yourself using it all the time, it might make sense to switch the bindings but I doubt that’s necessary for most users.

Thanks again to Batsov for letting us know about this command.

This entry was posted in General and tagged . Bookmark the permalink.