Every command is a function, but not every function is also a command.1
A command includes a call to interactive; this is why commands are commonly referred to as "interactive functions". Commands can be invoked via M-x name-of-command RET, and they can also be bound to a key sequence. Regular functions do not include a call to interactive, can not be ...
What a great question! Here is the path I've taken:
Step 0: Read the Emacs Tutorial
Read the Emacs Tutorial before anything else. It sounds like you've done this. Good on ya! However, for anyone coming to this at a later time, this is the place to start your Emacs journey. There are a lot of misleading blog posts out there. They over complicate things. ...
In my experience, the included tutorial on Emacs Lisp was not too helpful (I tried twice over the years and failed). Instead, I finally used the included Emacs Lisp Reference.
What finally did work:
Realize that there are two aspects to Emacs Lisp: The basic language itself, and the interaction with Emacs. Separate these two in your mind. Focus first on ...
The describe-key command (C-h k) will tell you what command is bound to a given key sequence. To go the other way and find out what keys (if any) are bound to a command, use where-is (C-h w).
You can list all available key bindings using describe-bindings (C-h b).
As of Emacs 25, you can also use view-lossage (C-h l) to see the recent history of every key ...
Yes. Library help-fns+.el defines command describe-command.
And it redefines describe-function so that it does describe-command if you give it a prefix arg.
The library binds describe-command to C-h c (describe-key-briefly is moved to C-h C-c).
The same library defines other help commands, such as describe-file, describe-buffer, describe-keymap, and ...
That error is because the full documentation is not installed by default.
Solve it by installing emacs25-common-non-dfsg
# aptitude install emacs25-common-non-dfsg
Test it by trying,
C-h i h
It should now work.
I recommend the "Emacs Lisp Intro".
The "Emacs Lisp Intro" might be already available in info format within your Emacs. Try C-h i m Emacs Lisp Intro RET or evaluate (info "(eintr) Top") in Emacs.
If this fails search the web for "Emacs Lisp Intro".
Customize the variable help-window-select:
"Non-nil means select help window for viewing.
never (nil) Select help window only if there is no other window
on its frame.
other Select help window unless the selected window is the
only other window on the help window's frame.
always (t) Always select the help ...
If you type C-h f <RET>, it describes the function called by the
innermost Lisp expression in the buffer around point, provided that
function name is a valid, defined Lisp function. (That name appears as
the default while you enter the argument.
This is a great question!
I've found the directions online to install it by hand unclear and, frankly, a bit of a pain (at least on Debian).
Emacs on Debian doesn't come with the Emacs Lisp Reference Manual by default. It's kind of silly, but Debian stores it in the non-free repos. Unfortunately, a regular apt-get install doesn't Just Work™...
Apropos help in Emacs is by no means limited to function apropos.
M-x apropos documentation. It lets you match keywords or a regexp against doc strings. Very helpful when you don't know how the function might be named but you might be able to guess some words used in its doc.
For example, M-x apropos-documentation RET shift bit RET shows you the names and ...
If you can't use a particular key combination because of your terminal, you can often fake it by manually simulating the key modifier. The following combinations work exactly as though you had used the corresponding modifier key:
C-x @ a alt
C-x @ m meta
C-x @ c control
C-x @ h hyper
C-x @ s super (lowercase s)
C-x @ S shift (...
Included with emacs is a basic tool called picture-mode:
To edit a picture made out of text characters (for example, a picture of
the division of a register into fields, as a comment in a program), use
the command ‘M-x picture-mode’ to enter Picture mode.
In Picture mode, editing is based on the “quarter-plane” model of
text, according to which ...
You've seen the basics, really. Your main problem was that this documentation was wrong, not that you weren't looking in the right place.
The slightly more direct way to read that documentation for a mode is by calling describe-function:
And the bit you missed is that, should the mode in question be indexed in the manual, you can ...
You can use both make-button or make-text-button. For example
(defun button-pressed (button)
(message (format "Button pressed!")))
'help-echo "Click Button"
(make-button 1 10 :type 'custom-button)
This will create a button at char 1 to 10 in the current ...
Eliza stems from 1960s research in AI. It goes beyond the fun as far as AI research is concerned; it's wildly out of date, but still a common, reasonably fun programming exercise. As far as psychotherapy is concerned, it is about fun. It can alleviate frustration, but it isn't supposed to bring serious psychological help.
doctor.el is in the lisp/play/ ...
I can't find this built-in. It is fairly easy to make a wrapper around describe-function that only completes command names when called interactively. In the implementation below, I duplicated the interactive form from describe-function and changed the fboundp test to commandp. As an added bonus, this function offers all function names when called with a ...
Yes. There is a function key-description that takes a list or vector of keys and returns a string that describes them. This is used by the built-in help facilities such as describe-key and describe-function to display information about key bindings. It calls single-key-description on each element of the input list. Both of these are written in C rather than ...
You can use rename-uniquely. Go to the help buffer, call rename-uniquely. It renames the buffer to something like *Help*<2>. Now If you open another help buffer, it doesn't affect *Help*<2>.
Rename current buffer to a similar name not already taken.
Start with the Emacs Wiki page Learn Emacs Lisp.
Not that that page itself will teach you Emacs Lisp. It will instead point to learning resources -- exactly what you're looking for here, with your question. Many users have contributed to it and edited it over a period of years. That presents advantages as well as disadvantages wrt one user's blog. The ...
To quote the Emacs Lisp Manual,
t is the preferred way to represent the truth value true. When you
need to choose a value that represents true, and there is no other
basis for choosing, use t. The symbol t always has the value t.
t stands for "True".
This is important because it is used for decision making. It is used in decisions such as "If ...
You can also use command/function clone-buffer.
M-x clone-buffer in buffer *Help* opens a new buffer *Help*<2> (or *Help*<3> if there is already a buffer *Help*<2>, etc.).
Same thing, if you use M-x clone-buffer in buffer *Help*<2>: you get *Help*<3> (or *Help*<4> if there is already a buffer *Help*<3>, etc.).
(with-help-window "*My Help Buffer*" ; Whatever buffer name you like.
;; Use `princ`, `prin1`, `terpri`, etc. to put text in the displayed buffer
Key q will automatically be bound to do what you want.
C-h f with-help-window says:
with-help-window is a Lisp macro in help.el.
(with-help-window BUFFER-OR-NAME &rest BODY)...