Emacs: `C-h k` is undefined [duplicate] - emacs

This question already has an answer here:
Why does Ctrl+. not work when I bind it to a command in Emacs?
(1 answer)
Closed 5 years ago.
I am new to EMACS. I want to know the command bound with C-x f, so I type C-h k. But it won't work ,and shows me C-h k is undefined.
And my EMACS version is 26.0.90.

"Answer" because I don't have 50 rep to ask in "comment".
Welcome to Emacs!
Thank you for your version info. There are other questions which are valuable to the effort to help you. For example:
What OS are you using?
Are you using a gui or a terminal?
If terminal, which terminal?
Are there errors in the Messages buffer on startup?
Do you see the same problem if you start with "emacs -q"?
Do you see the same problem if you start with "emacs -Q"?
One option you have would be to jump into the emacs chat room at https://chat.stackexchange.com/rooms/17392/scratch
EDIT:
You may have a problem with C-h being a delete - see https://www.emacswiki.org/emacs/BackspaceKey
To route around, the important help commands are:
C-h k -> M-x describe-key
C-h f -> M-x describe-function
C-h v -> M-x describe-variable
C-h a -> M-x apropos-command
C-h i -> M-x info

As shown in the following figure: enter image description here
You can see a key sequence C-h k
Otherwise, Look at what you are。

Related

Emacs C-x C-; comment line is not working [duplicate]

This question already has an answer here:
Why does Ctrl+. not work when I bind it to a command in Emacs?
(1 answer)
Closed 2 years ago.
I am using emacs26.3 with the major mode "Javascript-IDE" activated. When I type M-x comment-line the desired effects happen in the editor. However, when I type the shortcut C-x C-; I have this output:
Comment column set to 2
And the line is not commented/uncommented. C-h b shows that is the key binding is correct.
Here is my emacs configuration: https://github.com/Amine27/dotfiles/blob/master/emacs.el
Are you using emacs in a terminal? A terminal cannot transmit all combinations of keys and modifiers you could press. I can reproduce this behavior when I run emacs in my terminal (pressing C-; just produces an ordinary ;), but when run in my OS's windowing system emacs registers the C-; chord as desired.

A few Emacs noob questions

Sorry if these are obvious answers but I've googled around and can't seem to find what I'm looking for.
When I have multiple files open in split screen mode using C-x C-3 how do I close JUST the window I'm currently in and no other?
I'm using Ruby and it doesn't seem to auto indent my def end correctly.. is there a Ruby plugin that will fix this?
Is there a command to go to a specific line?
How do I interpret ruby from within emacs?
1. When I have multiple files open in split screen mode using C-x C-3 how do I close JUST the window I'm currently in and no other?
To close current view C-x 0. (Btw, I think you're referring to C-x 3.)
2. I'm using Ruby and it doesn't seem to auto indent my def end correctly.. is there a Ruby plugin that will fix this?
Have a look at
ruby-mode for emacs
RubyMode
3. Is there a command to go to a specific line?
Sure, M-g g (or M-x goto-line)
4. How do I interpret ruby from within emacs?
Don't know. You could try rubydebug.
You can also see C-h b which will give you key binding for the current-buffer to give you a lot of additional things that you might need. Once you install any Ruby Mode, you can also use C-h m to see key binding for that specific modes in your current buffer, including ruby mode.
for Q3) in addition you might want to know
C-h w COMMAND
will always show you the key binding for a funcion
C-h w goto-line RET
goto-line is on M-g g, M-g M-g, <menu-bar> <edit> <goto> <go-to-line>
for Q4) you could start a shell in a buffer, either M-x eshell or M-x shell and the simply run your script there.
Using the eshell configuration in [1] you can easily switch between the shell and your script source (pressing C-z).
[1] http://www.emacswiki.org/alex/2008-08-19_Emacs_on_Windows

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

List all Keybindings for a certain emacs mode

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

Emacs C-h c doesn't seem to work for chords 3 combinations long?

I'm trying to use C-h c in emacs to figure out what a key combination is bound to. The combination is C-u C-c C-q, which realigns tags in org-mode. However, Emacs just tries to look up C-u C-c and then fails. What am I doing wrong? I realize I could easily look at the orgmode source or something to figure this out, but for future reference what would I do to figure out what function something like this is bound to?
Edit: OK, so it's actually C-u followed by C-c C-q, and according to emacs this is what that combination is bound to:
(org-set-tags-command &optional arg just-align)
Call the set-tags command for the current entry.
So what exactly does it mean to give this command the argument 4?
Oh, just to give an explanation: I'm trying to start learning emacs-lisp and customization and one of the things I wanted to do was to have this command added to the before-save-hook so that when I save an org file, the tags get automatically aligned.
Final edit: I figured out why this command behaves as it does; given the prefix argument it changes its behavior. How can I set the prefix argument when calling the function in elisp?
It's not a general problem with combinations that are three keys long: For example, C-h c ESC ESC ESC (keyboard-escape-quit) or C-h c C-x r t (string-rectangle) both work fine.
When I try C-h c C-u C-c C-q in org-mode, the command interrupts after C-u and shows:
C-u runs the command universal-argument
in the minibuffer, which is correct. So, in fact, "C-u C-c C-q" is not a command, it's the command "C-c C-q" (org-table-wrap-region) started with an additional argument (4 -- see C-h k C-u for an explanation).