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
12
votes
1 answer

Java-Mode Argument Indenting in Emacs

My java-mode in emacs wants to indent function arguments like this: someLongFunctionName( argumentNumberOne, argumentNumberTwo, argumentNumberThree, …
fieldtensor
  • 3,972
  • 4
  • 27
  • 43
12
votes
3 answers

add-to-list 'load-path doesn't seem to work

Whenever I see some installation instruction for an emacs package it always suggests to use add-to-list 'load-path it never works for me. For some reason and I have to use load-file. For example, this will not work: (add-to-list 'load-path…
rabidmachine9
  • 7,775
  • 11
  • 46
  • 59
12
votes
1 answer

Preview in AUCTex problem

I'm trying to use emacs+auctex to write my internship report. But I found that the preview feature doesn't work. In fact I have made it work when using ubuntu 10.04, but now I have a new computer with 11.04 and I have problems with preview. For…
darkjh
  • 2,821
  • 7
  • 35
  • 43
12
votes
1 answer

EOF exception while reading clojure file

When I run the web application in the ring jetty server, I got EOF exception, I can't fix this, since there is no clue on which line the error has occurred. I'm using compojure and hiccup on my clojure code. I'm using Emacs 23 as editor. Here is the…
Abimaran Kugathasan
  • 31,165
  • 11
  • 75
  • 105
12
votes
4 answers

How can I change a list of plain lines into headlines/TODO items?

If I paste in a block of text composed of separated lines, is there any way to convert each of those lines into either headlines or TODO list items? So: item item item becomes: * item * item * item without my having to type [Meta][Return] at the…
Dmitri
  • 2,658
  • 2
  • 25
  • 41
12
votes
1 answer

Dired: One confirmation for all selected files and directories

Use-case: Mark for deletion target files and directories at the dired buffer; Execute 'dired-do-flagged-delete' (type 'x'); Result: I'm asked about confirmation for every non-empty directory being removed. Question: is there easy way to say 'yes'…
denis.zhdanov
  • 3,734
  • 20
  • 25
12
votes
1 answer

Emacs: globally enable whitespace-mode

I want globally enable whitespace-mode. I have tried this in my .emacs: (require 'whitespace) (setq-default whitespace-style '(face trailing lines empty indentation::space)) (setq-default whitespace-line-column 80) (setq global-whitespace-mode…
Vladimir Mihailenco
  • 3,382
  • 2
  • 24
  • 38
12
votes
0 answers

In mosh how can I scrollback in the terminal and use mouse in emacs, less etc

I want to use mouse-wheel in emacs and also scroll-back in the terminal history. When I do mosh --no-init I can scroll-back in the terminal history but I cannot use mouse wheel in the emacs. Instead if I do only mosh without --no-init flag I can use…
alper
  • 2,919
  • 9
  • 53
  • 102
12
votes
3 answers

Emacs command to insert and indent line above cursor

I frequently find myself typing on a line, when I realize I need(ed) a variable definition (or something similar) on the line above. What I would like is to press C-return from anywhere on a line and have the cursor move to a newly inserted blank…
thebjorn
  • 26,297
  • 11
  • 96
  • 138
12
votes
4 answers

How can I random sort lines in a buffer?

I have a buffer of words and phrases in sorted order and I would like to have the lines sorted in a random order. How would I do this with either an emacs builtin function or with elisp? For example, given bar elisp emacs foo hello world the quick…
user568866
12
votes
2 answers

ESS to call different installations of R

I am not sure if this has already been answered here on stack-overflow. I had Emacs-ESS installed on my Unix machine and when ever I start up emacs, particular version of R gets loaded. I now have some new R packages that I wanted to test before…
Sashi Kiran Challa
  • 905
  • 1
  • 11
  • 21
12
votes
2 answers

Emacs regular expression: what \< and \> can do that \b cannot do?

Regexp Backslash - GNU Emacs Manual says that \< matches at the beginning of a word, \> matches at the end of a word, and \b matches a word boundary. \b is just as in other non-Emacs regular expressions. But it seems that \< and \> are particular to…
Yoo
  • 17,526
  • 6
  • 41
  • 47
12
votes
2 answers

How to set relative line numbers in Doom Emacs

I know that you can toggle line numbers with the key combination SPC + t + l but it changes back to absolute line numbers when restarting Doom Emacs. How can I configure Doom Emacs to set relative line numbers every time I start emacs?
n1ks
  • 2,188
  • 2
  • 12
  • 12
12
votes
4 answers

Semi-modal editing / auto prefixing keys

Most emacs modes include some sort of prefix to activate their features. For example, when using GUD "next" is "C-c C-n". Of these modes, many provide special buffers where one can use a single key to activate some functionality (just 'n' or 'p' to…
fdr
  • 391
  • 1
  • 8
12
votes
3 answers

how to write to a file in emacs

I want the emacs lisp code to append some data to a log file from emacs. The log file is large so I don't want to read it into memory. I just need to open the log file, append some data to it, close it. I never need to see or manually edit the…
ja.
  • 1,329
  • 9
  • 14