2022 Developer Survey is open! Take survey.

Hot answers tagged

53 votes
Accepted

What is the difference between a function and a command?

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 ...
user avatar
  • 14.2k
47 votes

How can I start learning Emacs Lisp?

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 ...
user avatar
  • 3,835
29 votes
Accepted

How can I start learning Emacs Lisp?

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: ...
user avatar
  • 560
18 votes

If I know a keybinding/shortcut, how to get the corresponding function?

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 ...
user avatar
  • 19.1k
15 votes
Accepted

How can I look up help for a key sequence that I can't type

Evaluate the following using eval-expression (M-:) or in a scratch buffer: (describe-key (kbd "C-<whatever>"))
user avatar
  • 4,950
13 votes

Info file emacs does not exist

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 ...
user avatar
  • 306
13 votes

Change focus to *Help* buffer after running describe-mode

Customize the variable help-window-select: "Non-nil means select help window for viewing. Choices are: never (nil) Select help window only if there is no other window on its frame. ...
user avatar
  • 17.6k
13 votes

Emacs manuals are missing on Debian/Ubuntu

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). On Debian... Emacs on Debian doesn't come with the Emacs ...
user avatar
  • 3,835
12 votes
Accepted

Is there a command `describe-command', similar to command `describe-function'?

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 ...
user avatar
  • 69.2k
11 votes
Accepted

Why does GNU Emacs use ksi(ξ) as its logo?

It doesn't. It uses just an E that is suggestive of a gnu's horns.
user avatar
  • 69.2k
11 votes

How can I start learning Emacs Lisp?

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. ...
user avatar
  • 2,646
10 votes

How to get the function help without typing?

From gnu.org: 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 ...
user avatar
  • 1,538
10 votes
Accepted

How to describe a key sequence that starts with `C-u`?

Prefix keys like C-u may be described in the function body. You should therefore ignore such prefix keys when using C-h k to describe a function.
user avatar
  • 5,325
10 votes
Accepted

How to discover (standard) function names?

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 ...
user avatar
  • 69.2k
9 votes
Accepted

How to look up documentation for a minor mode?

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 ...
user avatar
  • 43.1k
9 votes

How can I look up help for a key sequence that I can't type

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 ...
user avatar
  • 1,316
9 votes

Is there a command `describe-command', similar to command `describe-function'?

apropos-command might be sufficiently close. It doesn’t offer describe-function’s tab completion, but it lets you search only through commands, and it takes you to their doc page.
user avatar
  • 22.3k
9 votes
Accepted

How do I create a button in Emacs?

You can use both make-button or make-text-button. For example (defun button-pressed (button) (message (format "Button pressed!"))) (define-button-type 'custom-button 'action 'button-pressed '...
user avatar
  • 801
9 votes
Accepted

How to view package Full Description (commentary section) inside Emacs

M-x finder-commentary RET <library-name> RET extracts that section and presents it in a separate buffer for reading. There is also M-x finder-by-keyword for discovering libraries this way.
user avatar
  • 21k
9 votes
Accepted

Are the graphical depictions in docs drawed in manual labour?

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)...
user avatar
  • 6,943
8 votes

Is there a command `describe-command', similar to command `describe-function'?

if you have smex installed, just call smex. Start to type, when the right one comes up, press C-h f.
user avatar
  • 1,706
8 votes

What's :eval (colon eval) in defcustom?

The doc string tells you this: "Mode line lighter for Github Notifier." You couldn't otherwise know for sure what the code is about, or what :eval means in that context. That is, you ...
user avatar
  • 69.2k
7 votes

Is there a command `describe-command', similar to command `describe-function'?

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 ...
user avatar
7 votes
Accepted

What are possible real use cases of the Emacs "psychotherapist" mode?

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 ...
user avatar
7 votes
Accepted

How do I customize the way Emacs prints out certain keys and key sequences?

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-...
user avatar
  • 11.4k
7 votes
Accepted

How can I have multiple *Help* buffers with different content?

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>...
user avatar
  • 693
7 votes

How can I start learning Emacs Lisp?

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 ...
user avatar
  • 69.2k
7 votes
Accepted

Meaning of "value is t"

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. ...
user avatar
  • 3,835
6 votes
Accepted

How to see the name of the command every time I run it by a shortcut?

You can use post-command-hook. (defun my-echo-command-name-hook () (unless (or (eq this-command 'self-insert-command) (eq this-command 'next-line)) (message "%s" this-command))) (...
user avatar
  • 1,639
6 votes

How can I have multiple *Help* buffers with different content?

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 ...
user avatar
  • 69.2k

Only top scored, non community-wiki answers of a minimum length are eligible