Highest scored questions
27,659 questions
179
votes
10
answers
120k
views
How do I reload a file in a buffer?
I usually work on files which are updated in the file system via version control. What's a quick way to reload a file without having to C-x C-f the file again and getting asked if I want to reload it?
137
votes
4
answers
21k
views
What are the practical differences between the various Emacs Package Repositories?
I notice that there are several different repositories that often contain the same software. Why would I want to prefer:
GNU ELPA
Marmalade
MELPA
over the others? Since any one repository does not ...
132
votes
14
answers
86k
views
How to switch between windows quickly?
How do I switch between windows quickly?
I often have multiple windows open and need to switch between them. Right now, I use C-x o to get to the one I want. Is there a more efficient workflow ...
124
votes
3
answers
42k
views
How to merge Git conflicts in Emacs
My recent Git merge has resulted in a large number of conflicts. My current approach is to search for the next occurence of '<<<' and then perform the merge by standard text editing.
...
124
votes
6
answers
24k
views
Are there any advantages to using ~/.emacs.d/init.el instead of ~/.emacs?
I've normally used ~/.emacs for my config file, but I've noticed others using ~/.emacs.d/init.el. Are there advantages to the init.el location? Any disadvantages?
116
votes
9
answers
49k
views
How can I get a ruler at column 80?
As a programmer, I want to see a ruler at a specific column (usually 80), both so I see when I cross that column, but also to see how close I am getting to it so I can reformat my code early.
The ...
113
votes
3
answers
39k
views
How to Restore File System Access in macOS Catalina
I updated to macOS Catalina which requires the user through pop-ups to allow any app trying to access the file system for the first time.
No such pop-up is appearing for Emacs. Running the script ...
109
votes
5
answers
49k
views
What is the difference between Aquamacs and other Mac versions of Emacs?
Macintosh users have several choices of pre-built Emacs. I am aware of the following versions:
YAMAMOTO Mitsuharu's Emacs Mac Port
David Caldwell's Emacs for Mac OS X
Vincent Goulet's Emacs Modified ...
108
votes
12
answers
19k
views
How do I prevent extremely long lines making Emacs slow?
I see hugely varied performance depending on how many newlines there are in the file I'm visiting.
Here's an example. I have two JSON files:
$ wget https://github.com/Wilfred/ReVo-utilities/blob/...
108
votes
4
answers
45k
views
How do I get a fancier mode line that uses solid colors and triangles?
People occasionally post screenshots with modelines that have solid colors and triangles:
How do I replicate this effect?
107
votes
7
answers
48k
views
Quickly insert source blocks in org mode
org-mode has the ability to render source code, with blocks of the following syntax:
#+NAME: <name>
#+BEGIN_SRC <language> <switches> <header arguments>
<body>
#+...
103
votes
6
answers
47k
views
Reading and writing email with emacs
How can we use emacs to read and write email?
This question is intended to provide a canonical landing point for users wanting to deal with email using emacs.
Please post only one package/solution ...
97
votes
5
answers
36k
views
Edit file with super-user rights
When you have to edit system files, it's an usual situation that you launched Emacs with a normal user before, so the file will be write-protected. What can I do to gain root privileges? I mean ...
95
votes
6
answers
48k
views
How to maximize my Emacs frame on start-up?
Is there a way to maximize my window on start-up?
Currently, I hit Control++Up on my keyboard but it is very bothersome to do that every time.
I am using Emacs 24.4 on Ubuntu 12.04.
92
votes
25
answers
62k
views
How do I switch buffers quickly?
In vanilla Emacs, I have to do C-x b and then manually type out the buffer name to switch. If I forget the name of the buffer, I have to hit TAB to list possible completions. Is there anything I can ...
91
votes
5
answers
22k
views
Advantages of setting variables with setq instead of custom.el?
I see a lot of people (extension authors and others) give configuration examples with setq:
(setq foo 'bar)
These parameters are often defined with defcustom, making them available for customization ...
79
votes
14
answers
45k
views
How to start emacs with a custom user-emacs-directory
I'm working on a custom and small Emacs configuration that I want to share with some friends as a git repository for them to use as a baseline for their own future configurations.
For this I need ...
76
votes
9
answers
93k
views
How do I display line numbers in emacs (not in the mode line)?
I know how to display line numbers (and columns) in the mode-line, but I'd like emacs to display the line numbers for all the lines on the left-hand side. I've seen this done in vim and other text ...
75
votes
4
answers
19k
views
Add change to a previous commit with Magit
I have 2 commits, A then B, ready to be pushed. I realize I forgot to add something in A.
How can I add this change to A using Magit? I don't even know which part of the Git documentation I should ...
73
votes
10
answers
43k
views
How to proceed on package.el signature check failure
I just tried to install ascii-art-to-unicode from the gnu repository (http://elpa.gnu.org/) via list-packages. I get the following error:
package--check-signature: Failed to verify signature
...
73
votes
4
answers
37k
views
How to quickly copy/move file in Emacs Dired?
In Dired mode, I can m mark files and R to move them to a destination.
Some times the destination path is too long. With the destination open in a split window, is there a way to move files quicker? ...
73
votes
2
answers
36k
views
How to convert DOS/Windows newline characters to Unix format within GNU Emacs?
Is there a way to tell GNU Emacs to convert DOS/Windows newline characters in a file to Unix format?
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 ...
71
votes
5
answers
48k
views
How do you create a robust Python IDE with Emacs (as the Text editor)
Emacs is an excellent editor - however it is said "to program you first need an IDE" - so how would you build an IDE in the extensively customizable Emacs for PYTHON with all the features of modern ...
70
votes
2
answers
15k
views
How can I open a specific revision of a file with Magit?
Is it possible to open a specific revision of a file in Emacs with Magit without changing the current branch?
I have rebased some local changes to a revision where the modified functions were ...
70
votes
10
answers
16k
views
How can I start learning Emacs Lisp?
Background:
I'm mostly a vi user and am converting to Emacs.
Past the basics and now use it for writing code in C and some Python with plans to do an R conversion too.
I wrote (Common) LISP for ...
70
votes
8
answers
7k
views
What should/shouldn't I do when keeping .emacs and .emacs.d in version control?
Like many people, I manage a lot of my dotfiles via a version control repository (Mercurial on Bitbucket, private, in my case). This is handy when setting up a new machine or propagating ...
69
votes
8
answers
37k
views
How do I list all key-bindings available in a given buffer?
I am trying out a new major mode, how can I take advantage of Emacs' documentation system to get a listing of key bindings available in that specific buffer?
69
votes
2
answers
13k
views
How to list branches with Magit
How do I list the branches of a repository in Magit (i.e., the equivalent of git branch --list)? I expected to find this in the branch popup, but it seems to be neither there nor was I able to find it ...
67
votes
4
answers
24k
views
How to migrate Markdown files to Emacs org mode format
I've got hundreds of personal notes stored as files in Markdown format, after several years using the VoodooPad personal wiki software for OS X.
There's plenty of information available for exporting ...
67
votes
4
answers
24k
views
Fundamentals of multiple-cursors
I recently learned about multiple-cursors, and it looks like a very useful package. I went through the documentation on the original repo, but the commands still look a bit obscure to me.
I then ...
65
votes
4
answers
20k
views
How to easily cherry pick with magit?
I've been using magit for a few months now and I like it a lot. But one thing I still do it in a terminal is cherry picking.
What is a simple way to do this?
65
votes
4
answers
10k
views
Debugging a frozen Emacs
I am using mew for my e-mail. I need to use TLS with my email provider for SMTP. However, when I try to invoke that, Emacs freezes.
I would like to take this opportunity to learn more about Emacs ...
65
votes
2
answers
21k
views
What do I do when Emacs is frozen? [duplicate]
What should I do when Emacs stops responding?
My current "emacs-is-frozen" protocol looks like this:
Spam C-g (it sometimes works)
Wait for a while.
pkill -9 emacs
What alternate steps could I try ...
65
votes
8
answers
2k
views
How can I use Emacs to edit questions, answers, and comments here?
Emacs as a StackExchange client?
How can I use Emacs to edit questions, answers, and comments here on the Emacs Stack Exchange site?
Broadly, what possible methods exist?
Kill and yank
This works, ...
64
votes
3
answers
24k
views
What's the Magit equivalent of 'git add'?
What is the Magit equivalent of git add [--intent-to-add] <filename> for checking a newly created file into Git?
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 ...
61
votes
5
answers
12k
views
What options are there for writing better non-programming text in Emacs?
This is a fork from the question What options are there for doing spell-checking in Emacs?
Because I'm currently doing a lot of non-programming tasks in Emacs I'm wondering whether Emacs can support ...
61
votes
6
answers
34k
views
How to exclude files from Projectile?
I am using the helm-projectile setup from prelude and it has been a huge improvement to my workflow. The only remaining issue are auto-generated files (e.g. generated by CMake) which show up during ...
61
votes
1
answer
8k
views
Can I checkout a given commit from magit's log view?
I'm exploring a git repository history using magit's log view using l l. Can I checkout a given commit from there without going to terminal?
60
votes
5
answers
17k
views
Change a branch's upstream with Magit
When you push a branch with Magit (with P P) and the branch has no
upstream, Magit asks you the name of the branch you want to push to.
That's great.
Once you set the upstream for a branch, however, ...
59
votes
3
answers
27k
views
How can I troubleshoot a very slow Emacs?
I am writing a document and I have a problem with Emacs' performance that I think appeared just yesterday. I haven't made any alterations in my init file or installed any new packages.
The problem is ...
59
votes
2
answers
20k
views
What are the differences between autocomplete and company mode?
There seem to be two major autocompletion extensions for emacs: autocomplete and company mode. What are some of the practical differences between the two and when would I want to use one over the ...
58
votes
3
answers
30k
views
How do I get the current major mode?
If I am editing a .tex file in emacs, by default (for me) the bottom right corner of the frame will say "LaTeX/P". However, I won't get to that mode by typing "M-x LaTeX/P-mode"; I can only get to it ...
58
votes
1
answer
4k
views
How to view diff when emacs suggests to recover this file?
Sometimes it happens: emacs prompts you about recovering unsaved changes to a file, but you cannot remember if you want those changes or not.
Starting at the recover-this-file buffer, is there a way ...
57
votes
6
answers
12k
views
How to replace an element of an alist?
I have this by default in my auto-mode-alist:
("\\.js\\'" . javascript-mode)
(even with emacs -Q). I'd like to substitute js2-mode for javascript-mode. Of course, I could use assq-delete-all and ...
57
votes
9
answers
14k
views
How do I find text across many open buffers?
Lets say I have 10 buffers open, and I want to find all occurrences of blah in all 10 buffers. How would I do this?
57
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 ...
57
votes
3
answers
17k
views
Inline verbatim and code with quotes in Org-mode
In Org-mode I can surround text with = or ~ to place text in inline verbatim or code mode.
However this fails if the text has quotes, and I couldn't find an explanation or workaround in the ...
57
votes
9
answers
36k
views
Using Emacs as a full-featured C/C++ IDE
I have been trying off and on for over a year now to use Emacs as a C/C++ IDE. I have only been marginally successful thus far, but have run into a few brick walls along the way. Currently I am ...