4 ms·
If you hit `C-h b` you get a list of all the current keybindings. `C-h m` lists the keybindings focused on the active modes. You can search either for the funct
by jolmg 6y ago
If you hit `C-h b` you get a list of all the current keybindings. `C-h m` lists the keybindings focused on the active modes. You can search either for the functionality or binding you're looking for. Also, `C-h k` followed by any keybinding will describe the keybinding. If you get the documentation of a function or command with `C-h f`, it'll also mention the keybindings it's bound to, if any. All these `C-h` help keybindings are described if you hit `C-h C-h`, and they're also mentioned in the tutorial that's linked to when you start up emacs for the first time on default configuration.
These helps are also available in the GUI menu bar, for example Help > Describe > List Key Bindings, which also mentions the keybinding `C-h b` to the right of that.
How is discoverability of keybindings lacking?
- morelisp 6y agoDiscovery of functionality is lacking, not the keybindings. Most of the time I want an answer to "how do I do...?" not "what happens if I press this key?", and even isearching the help buffer I have to guess did they suffix `at-point` or not? did they call it `swap` or `transpose`? `forward` or `next`? did they make a `sexp` do something useful in this mode, or will it just pick something between parens, or some awful mix of the two?
- wtetzner 6y agoDoes a GUI actually solve any of these problems?
- morelisp 6y agoYes, a GUI allows you to give richer contextual feedback without introducing modality to the core functionality. For example, if I can click and drag, I do not need `transient-mark-mode`, a tricky modality in our "non-modal" editor. If I can summon a menu of relevant commands for a region, I do not need a menu of all commands filling up multiple pages of a separate window. A GUI also introduces other problems, but the ability to just point at what you want to know more about or do something with has been a cornerstone of discoverability since the introduction of the mouse.
- throwaway_pdp09 6y ago> For example, if I can click and drag, I do not need `transient-mark-mode`, a tricky modality in our "non-modal" editor transient-mark-mode just allows you to see what you're selecting. If you don't have it you don't see what's being selected until you release the mouse. You need that more with a mouse than a keyboard.
- morelisp 6y ago> transient-mark-mode just allows you to see what you're selecting. Yeah, no. It's a modal state, and since Emacs doesn't support modal interfaces directly, it touches tons of separate commands (anything using `region-active-p`) and means it's tremendously difficult to find out all it does! Many commands change their behavior when Transient Mark mode is in effect and the mark is active, by acting on the region instead of their usual default part of the buffer’s text. Examples of such commands include M-;, M-x flush-lines, M-x keep-lines, M-%, M-%, M-x ispell, and C-x u. To see the documentation of commands which are sensitive to the Transient Mark mode, invoke C-h d and type "transient" or "mark.*active" at the prompt. The reason selection with a mouse also triggers it is because all these commands would not DTRT unless it did, given Emacs's approach of forcing mice to fit into the system designed for keyboards.
- throwaway_pdp09 6y agoHmm, thanks for pointing this out. But I'm slightly baffled, for the commands you gave (flush-lines, M-%, M-S-%) that's fine - transient mode with keyboard (between point and mark) and with a mouse, they are the same thing. Transmode is just highlighting AFAICS (between point and mark) and that mode quits the moment you release the mouse (leaving mark where you started the drag, point where you ended it). The convention of "operate only on stuff between point and mark" is necessary, mouse or no, and has been there since forever. But I'm no expert!
- philsnow 6y agoEmacs suffers somewhat here for its ancient-ish heritage, because it was conceived and developed in the depths of university computer lab precursors, when people had different names for everything. Try explaining "yank-pop" to somebody who's only ever used sublime/vscode.