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
76
votes
17 answers

How can I make Emacs start-up faster?

I use Emacs v. 22 (the console version, either remotely with PuTTY or locally with Konsole) as my primary text editor on Linux. It takes a while to load up each time I start it though, probably almost a second, although I never timed it. I tend to…
Paul
  • 6,435
  • 4
  • 34
  • 45
76
votes
15 answers

What are the efficiencies afforded by Emacs or Vim vs Eclipse?

I started coding around 5 years ago. I was introduced through Java and Eclipse which both have substantial stigma attached in the programming community. A number of people at the company I currently intern at prefer emacs or vim. I can't see how a…
gav
  • 29,022
  • 23
  • 65
  • 90
75
votes
3 answers

Filtering text through a shell command in Emacs

In vi[m] there is the ! command which lets me pipe text through a shell command -- like sort or indent -- and get the filtered text back into the buffer. Is there an equivalent in emacs?
Rohit
  • 7,449
  • 9
  • 45
  • 55
74
votes
3 answers

How can I check if a file exists using Emacs Lisp?

I would like emacs to mark files that are generated as read-only when they're opened. The part of the puzzle that I'm missing is how to check if a file "exists". I currently have the following: ;; ;; get file extension ;; (defun get-ext…
Richard Corden
  • 21,389
  • 8
  • 58
  • 85
74
votes
5 answers

How to make Emacs terminal colors the same as Emacs GUI colors?

I program with Emacs on Ubuntu (Hardy Heron at the moment), and I like the default text coloration in the Emacs GUI. However, the default text coloration when Emacs is run in the terminal is different and garish. How do I make the colors in the…
Zak
74
votes
7 answers

Emacs command for searching in files

I want to search in all files from the current folder for macro CODE_INIT_PARAMETERS. I can do Alt + X occur, Return CODE_INIT_PARAMETERS Return, but this shows only entries from open buffers. Is there a way to search all files from current folder,…
grayasm
  • 973
  • 2
  • 10
  • 14
72
votes
1 answer

In Emacs, how to go back to previous line position after using semantic Jump to Symbol?

I know how to go to a variable definition in Emacs using semantic-mode. It works well in a single file (I think it doesn't work if the definition is in another file). Using C-c , j, I can go to the definition of the variable, but, how do I jump back…
swdev
  • 4,997
  • 8
  • 64
  • 106
72
votes
12 answers

What do you expect from a package manager for Emacs?

Although several thousand Emacs Lisp libraries exist, GNU Emacs, until version 24.1 did not have an (internal) package manager. I guess that most users would agree that it is currently rather inconvenient to find, install and especially keep…
tarsius
  • 8,147
  • 5
  • 32
  • 46
72
votes
15 answers

How do I create an empty file in emacs?

How can I create an empty file from emacs, ideally from within a dired buffer? For example, I've just opened a Python module in dired mode, created a new directory, opened that in dired, and now need to add an empty __init__.py file in the…
Singletoned
  • 5,089
  • 3
  • 30
  • 32
72
votes
5 answers

Preserve window layout in Emacs

I have setup my windows in a certain way. How do I save this setting to be invoked later?
hekevintran
  • 22,822
  • 32
  • 111
  • 180
72
votes
3 answers

How do I change the highlight color for selected text with Emacs / deftheme?

I'm using Emacs 24; I've installed the zenburn theme, which is great, except I cannot see the selection highlight easily with the highlight color provided by zenburn: By "selection" color, I mean the color of text that I've selected by setting a…
Rob
  • 25,984
  • 32
  • 109
  • 155
72
votes
5 answers

Change Emacs syntax highlighting colors

I'm running Emacs, editing files in C++ mode and PHP mode. I love syntax highlighting as a concept, but the default colors are a travesty. I can barely read some of them: way too dark. What is the easiest way to change their values? I can't seem to…
adum
  • 2,890
  • 3
  • 25
  • 30
71
votes
7 answers

Disabling underscore-to-subscript in Emacs Org-Mode export

When I export to PDF via org-mode (C-c C-e d), any words with underscores end up being partially converted to subscript. How can I prevent this from happening? I found this article on the subject: Disabling Underscore subscript in Emacs Tex…
zpinter
  • 2,232
  • 2
  • 23
  • 29
71
votes
3 answers

How do I make Emacs show blank spaces?

How can I make Emacs show blank spaces (like a space, a tab, a line-jump, etc). Many other editors like Kate and Eclipse have this feature and I find it very useful to see when code is indent-broken because of mix of spaces and tabs (particularly…
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
70
votes
7 answers

How can I preview markdown in Emacs in real time?

I'm using spacemacs and I'm looking for a plugin to preview markdown in real time. I have found a plugin markdown-preview-eww, but it requires a gem and I prefer not to install ruby. The markdown-mode just exports md to html, and it can't preview…
honmaple
  • 889
  • 1
  • 8
  • 12