Questions tagged [emacs]

GNU Emacs is an extensible, customizable, self-documenting text editor, which can be extended with Lisp code. Although Emacs is a general-purpose editor, questions may be on-topic here if they are about extending Emacs itself (usually by writing Emacs Lisp functions) or about specific programming modes. Otherwise (and perhaps also in those cases), consider asking your question on Emacs Stack Exchange.

GNU Emacs is an extensible, customizable text editor. Begun in the mid-1970s as a set of macros on top of TECO, it was re-written using C and Emacs Lisp to provide portability and an extendable interface. It continues to be actively developed today.

Emacs provides context-sensitive editing modes with syntax coloring, is self documenting, has full Unicode support and extensions to do almost anything. It similarly has extensive packaging support through the built-in package.el package.

Emacs' package selection includes color themes, language-specific editing modes, RSS readers, email clients, web browsers, etc. Die-hard Emacs users do almost everything from within Emacs: write, compile, run and debug code; read/compose email; browse the web; do project planning, etc. Some other editors, like Visual Studio or Eclipse, provide Emacs key bindings.

Questions about using and configuring Emacs, not specific to programming, are off-topic for Stack Overflow, but they may be suitable for Emacs Stack Exchange. Questions about extending Emacs using Lisp or other languages, or about programming modes, are usually on-topic here.

Useful Links

Wisdom from Stack Exchange

Books

17686 questions
88
votes
5 answers

A gentle tutorial to Emacs/Swank/Paredit for Clojure

I am moving to Emacs to work on Clojure/Lisp. What is all the information I need to setup on Emacs to be able to do the following? automatic matching/generation of corresponding closing brackets autoindent Lisp/Clojure style, not C++/Java…
user855
  • 19,048
  • 38
  • 98
  • 162
87
votes
15 answers

Pretty printing XML files on Emacs

I use emacs to edit my xml files (nxml-mode) and the files were generated by machine don't have any pretty formatting of the tags. I have searched for pretty printing the entire file with indentation and saving it, but wasn't able to find an…
cnu
  • 36,135
  • 23
  • 65
  • 63
85
votes
5 answers

What is the key sequence for closing the current buffer in Emacs?

If I click on File -> Close, it closes the buffer like I want, but doesn't list a key mapping. What is the key mapping?
Nick Stinemates
  • 41,511
  • 21
  • 59
  • 60
84
votes
10 answers

Edit multiple lines at once in Emacs

I believe TextMate has a mode where if you start typing, the same thing will be entered on all the lines you've selected. Is there something similar to this in Emacs? I'm guessing there's a way rectangles can help me, but I'm not sure how...
allyourcode
  • 21,871
  • 18
  • 78
  • 106
83
votes
11 answers

Emacs - Error when calling (server-start)

I am currently using GNU Emacs 23.0.93.1 in Windows Vista SP1. In my .emacs file I make a call to (server-start) and that is causing an error with the message The directory ~/.emacs.d/server is unsafe. Has anyone seen this and know a fix or…
λ Jonas Gorauskas
  • 6,121
  • 6
  • 45
  • 66
82
votes
3 answers

Splitting a hunk with magit

I have 2 edits very close by (and therefore part of the same hunk), that I'd like to commit separately. Is it possible to split a hunk from within magit?
deepakg
  • 1,700
  • 1
  • 12
  • 10
80
votes
6 answers

With emacs, how to go to the pairing (balancing) parentheses

When cursor on one parentheses, how to jump to the pairing parentheses. Good to work in emacs -nw . Just like % in Vim. ;;After got hint from @Lindy, @Francesco, I found more: C-M-f Move forward over a balanced expression C-M-b Move…
Andrew_1510
  • 12,258
  • 9
  • 51
  • 52
80
votes
1 answer

eval-after-load vs. mode hook

Is there a difference between setting things for a mode using eval-after-load and using the mode hook? I've seen some code where define-key is used inside a major mode hook, and some other code where define-key is used in eval-after-load…
Yoo
  • 17,526
  • 6
  • 41
  • 47
80
votes
4 answers

Package listed in MELPA, but not found in package install

I am currently trying to install ENSIME for emacs 24.3.1 following the instructions at https://github.com/ensime/ensime-emacs under the quick start; I've added (require 'package) (add-to-list 'package-archives '("melpa" .…
user2187656
  • 935
  • 1
  • 7
  • 8
79
votes
4 answers

How can I enable line wrap on word boundaries only in Emacs?

How do I configure Emacs so that line wrapping does not break in the middle of a word?
Yufei Zhao
  • 1,053
  • 3
  • 9
  • 8
78
votes
6 answers

Command to clear shell while using emacs shell

Is there a builtin command to clear shell while using shell in emacs? If not, is there an elisp function to achieve the same?
keeda
  • 2,605
  • 5
  • 28
  • 27
78
votes
12 answers

Emacs mode to edit JSON

Does anybody know a good Emacs mode to edit JSON? An app I am working on uses a JSON based communication protocol and having the data nicely indented and syntax-highlighted would help me a lot in the process of figuring it out.
Ryszard Szopa
  • 5,431
  • 8
  • 33
  • 43
78
votes
4 answers

ropemacs USAGE tutorial

There are many sites with instructions on installing ropemacs, but so far I couldn't find any with instructions on how to use it after it's already installed. I have it installed, or at least it seems so, Emacs has "Rope" menu in it's top menu bar.…
Headcrab
  • 6,838
  • 8
  • 40
  • 45
77
votes
3 answers

Why does emacs create temporary symbolic links for modified files?

When I modify a buffer, Emacs automatically creates a temporary symlink in the same directory as the file being edited (e.g. foo.c): .#foo.c -> user@host.12345:1296583136 where '12345' is Emacs' PID (I don't know what the last number means). Why…
Daniel Schuler
  • 3,130
  • 2
  • 30
  • 28
77
votes
10 answers

Can emacs re-indent a big blob of HTML for me?

When editing HTML in emacs, is there a way to automatically pretty-format a blob of markup, changing something like this:
blah
...into this:
blah
raldi
  • 21,344
  • 33
  • 76
  • 86