List all Keybindings for a certain emacs mode - emacs

I know that I can list all the keybindings available in emacs by using C-h b, but is it possible to list only the keybindings that apply to a certain mode, say dired-mode.
In dired+, I can do
?
h
and it shows me all the applicable dired mode keybindings.
Thanks

use C-h m or M-x describe-mode

Not sure what the question is. C-h b shows you all of the key bindings currently available (i.e., in the current mode).
If you want to see only the key bindings provided by a mode's own keymap, then use library help-fns+.el and hit C-h M-k. You are prompted for the keymap variable (e.g. dired-mode-map).
http://www.emacswiki.org/emacs/help-fns%2b.el

Related

describe binding filtering in emacs

Is there a way to filter the list of available bindings (C-h b), so it will not show all the possible bindings but just the relevant ones for the used mode?
For example on org-mode, I get all the general C-x list plus all the bindings of the modes that have general key bindings plus all the major mode bindings, followed by all the org mode ones, followed by global bindings... 1369 lines in total... I'm using this view for learning my way around, perhaps there is a way to filter so as to find my way around.
I think you are looking for C-h m which runs the command describe-mode.
You will find more goodies in C-h C-h which runs the command help-for-help.
C-h m shows the doc for the current major mode, as well as currently enabled minor modes.
Often C-h m lists some of the more important local key bindings, that is, some of the bindings made for the current major mode. But not always, and typically it does not list all of the local bindings.
If you use library help-fns+.el then you can use command describe-keymap to list all of the local key bindings:
M-: (describe-keymap (current-local-map))
If you know the name of the local keymap variable (e.g. emacs-lisp-mode) then you can invoke describe-keymap interactively using C-h M-k, providing the map name at the prompt.
If you use Icicles then you can see all of the currently available key bindings using S-TAB (key completion). By default, the local bindings (i.e, those for the current major mode) are shown first, and are highlighted specially. (You can use C-, to sort the candidate bindings in other ways (by key name, prefix keys first; by command name).
After C-h b switch into Help-buffer and call M-xoccurRETorgRET which will display all lines containing "org".

org mode - how to disable some keybindings?

I started using Emacs (currently for org mode only). I don't use priorities in my TODOs, hence I'd like to disable S-UP and S-DOWN key bindings (which loop through the priorities). How can I do this?
#lawlist gave you the recipe in his comment. Here's how to find this out for yourself.
See if there is a keymap variable for the mode in question - typically there is one. In this case, try C-h v org-mode-map. If you find no such variable, fish around a little, using the apropos commands - for example, M-x apropos-variable org-mode.
Bind the key(s) in question to nil in that keymap:
(define-key org-mode-map (kbd "S-<up>") nil)
C-h m gives you info about the current mode. Sometimes it lists the important key bindings for the mode. And C-h b (anywhere) lists lots of key bindings for the current context.
If you want to see all of the key bindings that belong to a given keymap variable (in human-readable form), then load library help-fns+.el and then use C-h M-k followed by the keymap variable name (e.g. org-mode-map). See Help+.

How do I get a list of available themes in Emacs 24?

I know that you can do
M-x load-theme RET
and get a list of available themes for auto-complete, of which you could select one.
What I'm looking for, is a way to get this list of themes through Emacs LISP, so that I can cycle through it with a custom key-binding, without having to look at all the available themes and switch to one manually.
The function custom-available-themes should give you the list of themes.
I did not know this “off the top of my head”, but Emacs is a fairly discoverable system once one is comfortable digging about in the Emacs Lisp code. Here is how I found this answer:
Started a non-customized instance of Emacs:
% emacs -q
I wanted to make sure none of my normal customizations (installed packages, et cetera) would interfere with my investigation.
Since the list is available during autocomplete after M-x load-theme RET, I started with that function:
C-h f load-theme RET
Switched to the *Help* buffer and hit Enter on the link to the definition of load-theme in custom.el.
Scanned the definition of load-theme to see if it was arranging a custom completion handler. Its (interactive …) form uses the function completing-read, giving it the output of this form:
(mapcar 'symbol-name (custom-available-themes))
A quick C-h f RET on custom-availabe-themes verified that this is the source of the list of available themes.

How do I list all yanks in emacs?

Is there a way to list all the yanked text in Emacs? You can do it on Textmate with SPLAT+V.
Edit: I meant recently killed items, items that can be yanked.
The list of kills (i.e., the list of things you can yank) is called kill ring and stored in the variable kill-ring, so you can view it (in a not very nice way) with C-h v kill-ring RET.
The kill ring also appears in the menu, under “Edit / Paste from kill menu”. If you use a text mode Emacs or have turned the menu bar off, you can access the menu with M-x tmm-menubar (bound to M-`): type M-` e p followed by the first letter of the item you want to paste (if it's a letter and it's unique, otherwise whatever character is indicated). If you don't want to paste anything, type M-` e p C-g; the kills remain in the *Completions* buffer. The kill texts are displayed truncated to yank-menu-length characters.
To my knowledge, emacs doesn't support that feature out of the box.
If you're using a Debian or Ubuntu Linux distribution, you can install the emacs-goodies-el package, which contains a browse-kill-ring feature (bound to M-y by default).
Alternatively, you can use the browse-kill-ring ELisp package available here.
See also here for a nice article about this problem and other alternate solutions.
EmacsWiki has a satisfying list of solutions. A portable and intuitive solution uses the built-in popup.el to display a vertical list to choose from:
(global-set-key (kbd "C-c y") '(lambda ()
(interactive)
(popup-menu 'yank-menu)))
In Icicles you can see all of your kill-ring, and yank any entries in it using completion. By default, C-y is bound in Icicle mode to icicle-yank-maybe-completing.
That's the same as yank, unless you give it a negative prefix arg (e.g., C--). In that case, it lets you complete against the kill-ring. Completion can be prefix, apropos (substring, regexp), or fuzzy.
http://www.emacswiki.org/emacs/Icicles_-_Multi-Commands
councel-yank-pop wors well for me
especially with the binding suggested in
http://pragmaticemacs.com/emacs/counsel-yank-pop-with-a-tweak/
(use-package counsel
:bind
(("M-y" . counsel-yank-pop)
:map ivy-minibuffer-map
("M-y" . ivy-next-line)))
if you use helm, you may call the helm-show-kill-ring function.

How do I list the defined keys in emacs isearch-mode?

How do I list the defined keys in emacs isearch-mode?
Based on Emacs: print key binding for a command or list all key bindings I have tried C-h m, but I cannot do that while in isearch-mode (C-h and M-x seem to cancel out of it)
Thanks,
-Shawn
Try this to get the help page:
M-x isearch-mode-help
I think you can find everything in the documention of isearch-forward. Do C-h f isearch-forward
You can get a listing of the bindings by typing C-h b during search (Emacs 23.2). Also available are C-h m (which worked for me) and C-h k.
C-s C-h b
Which I found out using C-s C-h ?
You might also want to try this:
http://www.emacswiki.org/emacs/isearch%2b.el
http://www.emacswiki.org/emacs/IsearchPlus
And C-h M-k (describe-keymap) in this library will let you know the bindings in any keymap (e.g. isearch-mode-map):
http://www.emacswiki.org/emacs/help-fns%2b.el