The Emacs text editor, one of the main text editors used on Unix and derivative operating systems.

learn more… | top users | synonyms

99
votes
2answers
64k views

How do I display line numbers in Emacs (not in the mode line)?

I know how to display line numbers (and columns) in the mode-line, but I'd like emacs to display the line numbers for all the lines on the left-hand side. I've seen this done in vim and other text ...
62
votes
8answers
41k views

How can I open a file read-only from command line with emacs/vi/vim

Is there a way to tell emacs/vi/vim (from the command line) that I want to view the file in view-mode or read-only. I know how to open a file as read only if emacs/vi/vim is already running.
42
votes
7answers
24k views

emacs: how to indent/unindent region of python code by 4 spaces?

I have a region of python code selected in emacs. What are the most efficient ways to indent and unindent every line in it by 4 spaces? Ideally I'd like something that's not context sensitive (eg. it'...
41
votes
8answers
42k views

Can I create a link to a specific email message in Outlook?

I use Outlook as my email client at work, but I don't want to use it to manage my tasks and todos. (Instead I use plain text files and Emacs org-mode.) Since many todo items start out as mails in my ...
37
votes
2answers
5k views

Jump to first non-whitespace character in line in emacs

I'm looking for the emacs equivalent of vi's ^. How can I move my cursor to the first non-whitespace character in a line?
34
votes
12answers
31k views

Which version of Emacs makes the best use of the Mac GUI? [closed]

On Windows and Ubuntu I use GNU Emacs, but FSF doesn't provide binaries for the Mac I have a decent version that came with Snow Leopard, but just running in the bash terminal. Is there a version ...
33
votes
4answers
8k views

How do you run the previous command in emacs shell?

I am in terminal mode on Ubuntu, and I'm running emacs with 2 buffers open, one is a ruby file, and the other is a shell (opened by typing M-x shell ), and when I switch to the shell buffer, I want to ...
33
votes
3answers
4k views

How to get back to an active minibuffer prompt in emacs without the mouse

In emacs, sometimes I will be in the middle of finding a file or switching buffers or doing something in the minibuffer, and I will click somewhere else for some reason. When I go back, the only way ...
31
votes
3answers
8k views

How to jump back to the last position of the cursor in emacs?

In emacs, when i am editing a program, and miss-input some command and make the cursor jump to somewhere in other files. Is there a short-cut key or command to jump back to the last location of the ...
25
votes
3answers
6k views

emacs does not open a file from argument and syntax highlight does not work

In my latest ubuntu box, When I type for example emacs ~/.bashrc, Emacs will start but not open .bashrc. This is true for any file I pass in. I've used Emacs for several years, and have never ...
23
votes
3answers
10k views

Linewrap in Org-mode of Emacs?

Does Org-mode of Emacs support linewrapping? I know in the "regular" mode of Emacs there will just be a little sideways-u-turn on the right and on the left on the line after, and there's no scrolling ...
23
votes
1answer
4k views

How to get back to insert mode in VIM when you accidentally hit C-x C-s

Given this vim session: % vim test-file.txt iHello there!C-x C-s How do I get back to insert/command mode again? (C-x C-s means Control-x Control-s, not sure if it's normal vi terminology for ...
22
votes
4answers
4k views

Can I create directories that don't exist while creating a new file in emacs?

In emacs, I create a file by visiting it with C-x C-f. Let's say I'd like to create /home/myself/new_directory/file.txt. If new_directory does not exist yet, is there a way to have it get created ...
22
votes
2answers
5k views

Problem with GNU Screen when using Emacs C-x C-s (save-buffer)

When I am using emacs under GNU Screen, if I call C-x C-s screen hangs and does not respond to any keyboard input. I can't reproduce this, but at least one time per day I have to kill my screen ...
21
votes
8answers
7k views

How to make Emacs read buffer from stdin on start?

With Vim I can easily do $ echo 123 | vim - Is it possible to do with Emacs? $ echo 123 | emacs23 ... Emacs starts with a Welcome message $ echo 123 | emacs23 - ... Emacs starts with an empty *...
21
votes
1answer
3k views

How to split Emacs over a dual monitor?

I would like to split Emacs over a double monitor. How do I do that?
21
votes
3answers
8k views

How can I run Mac OSX graphical Emacs in daemon mode?

Short form: I want to run the Mac OSX version of Emacs found on http://emacsformacosx.com/ as a daemon, with graphical and text clients connecting to it as-needed. In detail, here is the workflow I ...
20
votes
3answers
3k views

Edit one file in two different buffers in emacs

I would like to open the file foo.bar twice (or more) in emacs, so I can edit two different parts of it simultaneously. Is it possible? Probably the better question is, how to do it? Is there a way to ...
19
votes
4answers
4k views

Why latest emacs version don't support Windows 7 taskbar?

I have downloaded latest emacs for Windows here, but starting it on Windows 7 shows a taskbar icon that ignores right-click and so can't be pinned I have searched Google and found a lot of bug reports ...
19
votes
5answers
10k views

Is there any *good* HTML-mode for emacs?

I love emacs, and I want to do my web-programming work in it, but I can't find a way to get it to edit HTML properly. I mean it's seriously awful. It will do HTML fine, but not PHP, javascript, etc....
19
votes
3answers
10k views

How to insert tab character in `Text` mode?

I have tried to parse my language_data.txt, which is edited by emacs. The different column is seperated by "\tab". But when I read the file, it is found that the tab characters has been replaced by ...
19
votes
3answers
6k views

C-x C-c not working in Emacs 23.1

I am using Emacs 23.1 with Cygwin but when I try to exit by pressing C-x C-c it says C-x C-g is undefined and I am not able to exit.
19
votes
2answers
9k views

How to turn off Emacs's auto line wrapping for the current session?

How to turn off Emacs's auto line wrapping for the current session? I normally need the automatic wrapping, but when editing a email draft, i don't need that. is there a way to turn it off for a ...
19
votes
2answers
10k views

Getting Gmail in Emacs?

I'm trying to learn Emacs, and I think that getting gmail right in it would be cool. I've tried a but of tutorials online, but I couldn't figure out what a lot of them were talking about. A lot of ...
18
votes
3answers
7k views

Ubuntu: Keep emacs in the terminal

I installed emacs on Ubuntu 10.10 using sudo apt-get install emacs-snapshot-gtk I prefer my emacs in the terminal and everytime I emacs something, it pops up in some fancy GUI window. How do I go ...
18
votes
8answers
37k views

Where is .emacs file?

I downloaded emacs 23.1 from gnu's ftp. untarred it and built it after configuring. I do not find .emacs file in my home directory or anywhere in my system ! Am i missing something ?
17
votes
3answers
8k views

How can I hide the Tool-bar in Emacs persistently?

I have installed emacs23 on Linux Mint 8. I would like to hide the toolbar, and I can do it with Options > Show/Hide > Tool-bar. But the Tool-bar comes back next time I start emacs. How can I hide it ...
17
votes
6answers
6k views

Word count for LaTeX within emacs

I want to count how many words my LaTeX document has in it. I can do this by going to the website for the texcount package and using the web interface there. but that's not ideal. I'd rather have ...
17
votes
5answers
6k views

Syncing Google Calendar [Gcal] and Emacs Org-mode? Is it possible?

It would be amazing if I could sync Gcal and emacs org-mode, is it possible?
16
votes
4answers
9k views

How to awake emacs gui after pressing ctrl+z

I'm using emacs gui in Gnome. After pressing ctrl+z, emacs window is minimized. However, if I bring the window to front, it doesn't respond any key press and mouse event. I searched the web only found ...
15
votes
4answers
4k views

How to find out the current color theme in emacs

While emacs is running, how can I find out which color theme is currently in use?
15
votes
1answer
355 views

Hang on jabber-connect in emacs

I use jabber.el to connect to my work chat server from within emacs. This was working until recently, but now when I run jabber-connect it hangs after prompting for my JID. Emacs locks up until I ...
14
votes
4answers
5k views

How do I re-open a file in emacs?

In older emacs versions I used to type: C-x C-f RET And it would re-open the file currently visited in the buffer. Now (emacs 23.1.1) it opens Dired of the directory.
14
votes
2answers
4k views

Install emacs without sudo?

I have been using vim for years, and I don't really like it. I'd like to try emacs for a while, but it's not installed on any of the linux servers I use regularly. I don't have root so apt-get ...
14
votes
2answers
5k views

How to find out current font used in my Emacs?

How to find out current font used in my Emacs? I'm using GNU Emacs 23.2.1 (x86_64-apple-darwin, NS apple-appkit-1038.29) of 2010-05-08 on black.local `
14
votes
1answer
5k views

Emacs opens files in a new frame when opened with “open -a”

I want to be able to invoke Emacs from the command-line, and either start graphical Emacs if it isn't running or visit a file in an already running Emacs. I tried to do this with emacsclient which I ...
13
votes
10answers
4k views

Emacs equivalent to VIM ci"?

Does emacs have the equivalent of VIMs ci" command? Basically I want to replace the text inside a set of quotation marks. In vim I can ci) or ci] or ci} to "change inner *"...
13
votes
4answers
3k views

emacs: How to return to last position after scroll/page up/down?

After issuing scroll-up or scroll-down in emacs, is there a quick way to return the point to its previous position (assuming I didn't remember to add it to the mark ring)? Alternatively is there any ...
13
votes
3answers
2k views

I'm an Emacs user. How do I learn Vim?

Most of the time, I use Emacs. However, I've decided to try to learn Vim. I'm happy with Emacs, I just am trying to avoid having it turn into Maslow's Hammer. I've seen a few tutorials, but I have ...
13
votes
1answer
1k views

Flyspell save word to dictionary

I'm using flyspell for spell checking in AucTeX. How can I ignore or add a word to the dictionary without using the popup menu and without using the mouse? There's the command flyspell-auto-correct-...
13
votes
3answers
2k views

Torrent client for Emacs

Does anybody know a bittorrent client for Emacs?
13
votes
1answer
2k views

What is emacs keybinding s-u?

When I run revert-buffer in emacs it says: You can run the command `revert-buffer' with s-u I've never seen any keybinding beginning with s- before. What key is that? My emacs version is GNU ...
13
votes
1answer
1k views

Emacs as daemon on OS X with window-system

I'm running gnu emacs 23.3.1 cocoa build on OS X 10.6. I added the following to ~/Library/LaunchAgents/gnu.emacs.daemon.plist so that it will start a daemon and automatically restart emacs if I ...
12
votes
5answers
12k views

How to run 'emacs' in the terminal emulator without a separate window?

I am looking to switch to Emacs from Vim and one thing that is keeping me away is that Emacs opens up a separate window of its own when run under X. Can I get the same behavior for Emacs as it does ...
12
votes
4answers
12k views

How to get code completion in emacs?

Hey, I know that emacs supports code completion. But to be honest I have never been a good FAQ reader, at least for something that I'm completely new to. So I wonder what I need to download and how to ...
12
votes
5answers
961 views

Emacs - Disable Some Minibuffer Messages

In Emacs, there are some cases where I would like to prevent messages from appearing in the minibuffer, mainly pertaining to "Beginning/End of buffer" and "Text is read-only". Is there any way I can ...
12
votes
4answers
6k views

How do I complete file paths in emacs?

Say for instance I'm editing a config file and I want to type in a path. Is there a plugin for emacs that lets you complete a file path in that buffer? I've searched for this and there's like a ...
12
votes
2answers
2k views

Re-file outline tree into new org-mode file?

I'm just getting started with org-mode and imagine a workflow whereby I capture new tasks and notes in an org-mode "inbox" file. For tasks that grow into projects, I would imagine refiling them into a ...
11
votes
1answer
8k views

In Emacs what does M key mean?

I am totally new to emacs and am reading this tutorial and it mentions: M-f Forward one word Which key is M? As such pressing M followed by f types Mf and pressing them together also types some ...
11
votes
3answers
6k views

Disable Windows Key hotkeys when using Virtualbox

I'm currently running a VirtualBox of Arch Linux with Windows 7 x64 as the host. In Arch, I use dwm for window management. As dwm is heavily dependent on hotkeys, I've used the Alt key as its META key ...