New answers tagged


You can use substitute-command-keys, e.g., (substitute-command-keys "\\[keyboard-quit]") ;; => "C-g" though if there are multiple key bindings, it returns only one of them (the "first" one), for example, (substitute-command-keys "\\[kmacro-start-macro]") ;; => "C-x (" see also it's docstring and (elisp) Keys in Documentation.


Try this: (defun foo (function &optional descriptionp) (unless (commandp function) (error "Not a command: %s" function)) (let* ((key (car (where-is-internal (or (command-remapping function) function) overriding-local-map nil nil))) (desc (and descriptionp (key-description key)))) (or desc ...


You can use func-arity added in 26.1. C-h f func-arity: func-arity is a built-in function in `C source code'. (func-arity FUNCTION) Return minimum and maximum number of args allowed for FUNCTION. FUNCTION must be a function of some kind. The returned value is a cons cell (MIN . MAX). MIN is the minimum number of args. MAX is the maximum ...


You might want to have the documentation display immediately when you type C-h f on a command (that is, without having to press <RET>), while keeping the original behaviour of being able to type the function name when you're anywhere else. That is not so trivial to do, because function-at-point is very greedy. Telling it to display its first ...


I'm familiar with C-c and with C-h, but I can't figure out what the @ means. It's the literal character @ for which your keyboard should have a key (or key sequence). On my keyboard @ is Shift+2. So just type Ctrl+C and then type @ Conceptually it's no different to being told to type C-c a (for example).


@ doesn't mean anything, by itself, beside representing the @ key on your keyboard. The key sequence C-c @ C-h is bound to command hs-hide-block in hs-minor-mode, that is, in keymap hs-minor-mode-map. In that key sequence, C-c is a prefix key, which means it's bound to a keymap. In that keymap, @ is a prefix key, which means it's bound to a keymap. In that ...

Top 50 recent answers are included