Frequent Questions

42 votes
2 answers
8k views

How to evaluate the variables before adding them to a list?

The below obviously doesn't work and hence this question. How do I correct the below code so that the value of somelist becomes '(("abc" . 123)) ? (setq x "abc") (setq y 123) (setq somelist nil) (...
Kaushal Modi's user avatar
  • 26.2k
42 votes
6 answers
19k views

Problems with keybindings when using terminal

I have the following line in init.el: (global-set-key [(control \;)] 'comment-region) It works very well in GUI window, but if emacs is invoked with the -nw option then C-; doesn't comment region, ...
WeSenseASoulInSearchOfAnswers's user avatar
28 votes
1 answer
5k views

How do I troubleshoot Emacs problems?

In a situation where Emacs is not behaving like I want, what can I do to troubleshoot the problem? What steps can I take to find and fix the problem myself? Or, failing that, how can I gather useful ...
Tyler's user avatar
  • 23.1k
44 votes
1 answer
4k views

What is the difference between a function and a command?

When posting questions and answers here, people sometimes use the terms "function" and "command" interchangeably. In other cases, people only use one of the two terms to discuss specific pieces of ...
itsjeyd's user avatar
  • 14.9k
36 votes
1 answer
7k views

Why do regular expressions created with the regex builder use syntax different from the interactive regular expressions?

So, using the regular expression builder (M-x re-builder), finding lines that end in \ takes "\\$", while in search and replace by regex, it only takes "\$". I would have expected the regex builder ...
user2699's user avatar
  • 2,301
63 votes
12 answers
9k views

Synchronize packages between different machines

I use emacs in different places and I want to have a similar setup and packages installed everywhere. I guess I can use a version control repository for the setup files. Since I use Prelude, that ...
El Diego Efe's user avatar
  • 1,631
58 votes
6 answers
16k views

How to override major mode bindings

Sometimes my global keybindings are overridden by a major mode. An easy example is the following setting in my init file (global-set-key (kbd "C-j") 'newline-and-indent) But annoyingly this ...
nispio's user avatar
  • 8,385
48 votes
2 answers
11k views

What's the difference between a buffer, a file, a window, and a frame?

When posing questions on this site, people sometimes talk about "windows" when they mean "frames," and "buffers" or "files" when they mean "windows." So: Q: What is the difference between a buffer, ...
Dan's user avatar
  • 33.6k
73 votes
5 answers
20k views

How can I find out in which keymap a key is bound?

I have rebound a the 'd' key in gnus-article-mode, but its old behavior is still active when the point is on an attachment. I can see that the rebinding did not take effect there by doing C-h k d, but ...
brab's user avatar
  • 935
20 votes
2 answers
4k views

How to bind C-i as different from TAB?

I want to make Control-i perform indent-region (basically since Xcode has built that muscle memory already). I realise that Control-i and tab are indistinguishable in the Ascii sense, but they are in ...
Mark's user avatar
  • 1,459
10 votes
1 answer
2k views

How to get the raw data for an org-mode agenda without an agenda view?

Q: How can I have org-mode return the raw data for an agenda view without actually creating an agenda view? I'd like to access my agenda for an arbitrary day. However, I do not want to create an ...
Dan's user avatar
  • 33.6k
9 votes
2 answers
4k views

How to modify-face for a specific buffer?

I work with a lot of tabular data files and use stripe-buffer.el make them easier to read. But I also work with more than one, so I'd like to make it easier to distinguish among them as well and want ...
wdkrnls's user avatar
  • 3,777
15 votes
3 answers
7k views

Shift+Up isn't recognized by Emacs in a terminal

Very often I use Shift+Up/Down to select a region in Emacs. It works fine in GUI mode, but when emacs is invoked with -nw option I can select lines only with Shift+Down. The Shift+Up doesn't work, I ...
WeSenseASoulInSearchOfAnswers's user avatar
37 votes
5 answers
5k views

Is there a way to use query-replace from grep/ack/ag output modes?

I'm aware of find-grep-dired, marking the corresponding files and then pressing Q to run dired-do-query-replace-regexp on the marked files. Unfortunately that requires restarting the grep and no ...
dgtized's user avatar
  • 4,289
23 votes
3 answers
5k views

A faster method to obtain `line-number-at-pos` in large buffers

The function line-number-at-pos (when repeated about 50 times) is causing a noticeable slow-down in semi-large buffers -- e.g., 50,000 lines -- when point is near the end of the buffer. By slow-down, ...
lawlist's user avatar
  • 19.6k

15 30 50 per page
1
2 3 4 5
233