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
96
votes
5 answers

How do I configure emacs for editing HTML files that contain Javascript?

I have started the painful first steps of using emacs to edit an HTML file with both HTML tags and javascript content. I have installed nxhtml and tried using it - i.e set up to use nxhtml-mumamo-mode for .html files. But I am not loving it. …
MakeDummy
  • 1,091
  • 2
  • 8
  • 5
96
votes
20 answers

Emacs in Windows

How do you run Emacs in Windows? What is the best flavor of Emacs to use in Windows, and where can I download it? And where is the .emacs file located?
sverrejoh
  • 16,464
  • 13
  • 41
  • 29
96
votes
12 answers

How can I insert current date and time into a file using Emacs?

What commands in Emacs can I use to insert into the text buffer of a file the current date and time? (For example, the equivalent in Notepad is simply pressing F5 which is about the only useful feature for Notepad!)
Ray
  • 187,153
  • 97
  • 222
  • 204
96
votes
1 answer

How to remap the Caps Lock key to Control in OS X 10.8?

I want to use Emacs and need remap the Caps key to Ctrl (switch them). How can I do it?
James.Y
  • 1,427
  • 1
  • 11
  • 16
96
votes
5 answers

Emacs mode for Stack Overflow's markdown

I am using Org-mode in Emacs to handle all my technical documentation. I would like to use Emacs to prepare questions that I have for Stack Overflow. Is there an Emacs mode for that, or even better, an extension for Org-mode to handle Stack Overflow…
blueFast
  • 41,341
  • 63
  • 198
  • 344
95
votes
7 answers

Setting Emacs to Split Buffers Side-by-Side

A lot of Emacs functions automatically split the screen. However, they all do so such that the windows are one on top of the other. Is there any way to make them split such that they are side-by-side by default instead?
Nikwin
  • 6,576
  • 4
  • 35
  • 43
95
votes
9 answers

Reload configurations without restarting Emacs

How do I load the edited .emacs file without restarting Emacs?
memius
  • 4,045
  • 5
  • 26
  • 25
94
votes
7 answers

How do I get to the menu in Emacs in console mode?

If you launch Emacs using the -nw flag to force a console session (rather than an X session if you have X windows running), how do you get to the menu? There are some items held in the menus that are infrequently-enough used on my part that I don't…
warren
  • 32,620
  • 21
  • 85
  • 124
93
votes
9 answers

emacs split into 3 even windows

Quick question: How do I specify the number of characters in a split window? C-x-3 Splits my window into two windows evenly, but a subsequent split will split one of the windows in half. I'd like 3 equal sized windows. The documentation says that…
Dirk
  • 6,774
  • 14
  • 51
  • 73
92
votes
15 answers

Emacs: how to delete text without kill ring?

I'd like to just delete some text so I can yank some other text instead of it. How can I do that? C-w cuts the selected text to kill ring and I end up without the text I wanted to yank. Also, is it possible to yank text directly instead of some text…
mannicken
  • 6,885
  • 4
  • 31
  • 38
91
votes
5 answers

emacs zoom in/zoom out

Is there a way to zoom in and out (dynamically change the font size, quite smoothly) on emacs?
sawa
  • 165,429
  • 45
  • 277
  • 381
90
votes
1 answer

Ido mode is too smart, can I get it to NOT complete a filename?

My problem: I have Ido-mode enabled and I want to edit (for example) a file .emacs in my home directory. I have no .emacs file there, but I do have a .emacs.d, and so ido assumes that I want to enter the directory when I do C-x C-f .emacs RET. I've…
quodlibetor
  • 8,185
  • 4
  • 35
  • 48
89
votes
5 answers

How to detect that emacs is in terminal-mode?

In my .emacs file, I have commands that only makes sense in graphical mode (like (set-frame-size (selected-frame) 166 100)). How do I run these only in graphical mode and not in terminal mode (i.e. emacs -nw). Thanks!
sligocki
  • 6,246
  • 5
  • 38
  • 47
89
votes
2 answers

Magit revert single file

The question is about Magit major mode for Emacs function and less so about how to do this via command line interface. I only have a local Git repository. How would I restore a selected file to its previous version? I believe that the Git command…
user797257
88
votes
13 answers

How to highlight all occurrences of a word in an Emacs buffer?

Notepad++ has a convenient feature: if you select a word in your text (not necessarily a keyword), the word is highlighted throughout the text. Can this be done in Emacs as well? And if so, how? It doesn't necessarily have to work exactly like…
Headcrab
  • 6,838
  • 8
  • 40
  • 45