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
63
votes
6 answers

How to create new file from dired mode?

I want to create a new file in dired mode. Is there "create new file" command in dired mode ? For example, When I type "c" in dired mode, it creates "untitled.txt". It's very simple , but I can't find it.
Kei Minagawa
  • 4,395
  • 3
  • 25
  • 43
63
votes
5 answers

Enabling go mode for emacs

I don't seem to be able to enable a go mode for emacs. C mode doesn't work without semicolons. The best I have found is the JavaScript mode by Karl Landstrom, since JavaScript also doesn't require semicolons.
user181548
63
votes
2 answers

How to make all org-files under a folder added in agenda-list automatically?

I am using org-mode to write notes and org-agenda to organize all notes, especially to search some info. by keyword or tag. C-c a m can search some files by tag inputed, C-c a s by keyword ,those functions from org-agenda are well to utilize,…
Zoe Rowa
  • 1,329
  • 1
  • 11
  • 21
62
votes
1 answer

How to write an emacs mode for a new language?

I would like to write an Emacs major mode for a 4GL. Can someone show me a tutorial? As far as I googled I was able to find only this broken: link http://two-wugs.net/emacs/mode-tutorial.html
Prabu
  • 2,313
  • 2
  • 28
  • 31
62
votes
4 answers

Set custom keybinding for specific Emacs mode

Though I know how to set a global key-binding in Emacs, I find it hard to even Google out the code for a local (minor-mode specific) key-binding. For instance, I have this code in my .emacs: ;; PDFLaTeX from AucTeX (global-set-key (kbd "C-c M-p") …
aL3xa
  • 35,415
  • 18
  • 79
  • 112
62
votes
11 answers

How do you learn proper Emacs?

I am about to learn Emacs, have been through the tutorial and borrowed the O'Reilly book on Emacs. But the question still is - how do you learn good Emacs workflow? I guess, you don't use Emacs as you'd use, for example, Vim. This question seems…
vang3lis
62
votes
5 answers

Compare markdown and org-mode

I use Emacs for years, and nowadays, I write a lot of files in org mode, such as notes, plans/conclusions or something else. However but most website support markdown-style instead of org-style. StackOverflow is an example. :) Can someone tell me…
chao787
  • 1,760
  • 3
  • 18
  • 20
61
votes
3 answers

Appending characters to the end of each line in Emacs

Assume I have a text file with content 1 123 12 12345 If I want to add an 'a' in the beginning of each line I can simply use string-rectangle (C-x r t), but what if I want to append an 'a' to the end of each line, after which the file should…
ZelluX
  • 69,107
  • 19
  • 71
  • 104
61
votes
5 answers

How to switch between visible buffers in emacs?

If I am in split-screen viewing 2 different buffers on Emacs and the cursor is on the top buffer, what's a quick way to move the cursor to the bottom buffer? Bonus question: if I know a command, is there an easy way to identify what key-combo it's…
George Mauer
  • 117,483
  • 131
  • 382
  • 612
60
votes
12 answers

Hiding ^M in Emacs

Sometimes I need to read log files that have ^M (control-M) in the line endings. I can do a global replace to get rid of them, but then something more is logged to the log file and, of course, they all come back. Setting Unix-style or dos-style…
Russell
60
votes
3 answers

Emacs: regular expression replacing to change case

Every once in a while I want to replace all instances of values like: with i.e. do a regular expression replace of all things inside angle brackets with its lowercase equivalent. Anyone got a nice snippet of Lisp that does this?…
Dominic Rodger
  • 97,747
  • 36
  • 197
  • 212
60
votes
21 answers

Why Emacs/Vim/Textmate? Isn't Xcode good enough?

Hi I mostly do C++, Objective-C programming. And I found Xcode plus an auto completion/macro plugin (Completion Dictionary) quite adequate. However, all people seem to praise over their pure text editors. I tried Textmate for a bit; liked its…
ivanTheTerrible
  • 2,836
  • 4
  • 25
  • 25
60
votes
7 answers

emacs lisp, how to get buffer major mode?

I have tried to search Google and look in the manual, but still cannot find how to get major mode of a buffer object. Can you help me with an example or a reference. Thanks only solution I could find was to query major-mode after changing the…
Anycorn
  • 50,217
  • 42
  • 167
  • 261
60
votes
3 answers

How to disable the beep in emacs on Windows

Hi I'm new to Emacs and I downloaded GNU emacs on my windows machine. I just finished the short tutorial but I found there's a beep sound whenever I hit the beginning/end of a file and in many other cases, which is a little disturbing to me. I…
LWZ
  • 11,670
  • 22
  • 61
  • 79
60
votes
1 answer

How to see the file's encoding in emacs?

I don't find the encoding of current file, how to display it? You can see there are some Chinese characters in the file, but I don't know what the encoding it is. Is there any way to let it always show on the emacs GUI?
Freewind
  • 193,756
  • 157
  • 432
  • 708