Most Popular
1500 questions
56
votes
9 answers
Using Emacs as a full-featured C/C++ IDE
I have been trying off and on for over a year now to use Emacs as a C/C++ IDE. I have only been marginally successful thus far, but have run into a few brick walls along the way. Currently I am trying to use CEDET, but I am having a rough time…

nispio
- 8,175
- 2
- 35
- 73
56
votes
6 answers
How to replace an element of an alist?
I have this by default in my auto-mode-alist:
("\\.js\\'" . javascript-mode)
(even with emacs -Q). I'd like to substitute js2-mode for javascript-mode. Of course, I could use assq-delete-all and then add-to-list again, but I'm wondering whether…

mbork
- 1,647
- 1
- 13
- 23
55
votes
9 answers
How do I find text across many open buffers?
Lets say I have 10 buffers open, and I want to find all occurrences of blah in all 10 buffers. How would I do this?

nixeagle
- 2,407
- 3
- 17
- 14
55
votes
3 answers
How do I use emacsclient to connect to a remote emacs instance?
I'd like to be able to run emacs on one computer:
server $ emacs --daemon
And then connect to it from another:
local $ emacsclient -c server
Is this possible? If so, how?

liszt
- 725
- 1
- 5
- 10
55
votes
6 answers
Can I use org-mode to structure my .emacs or other .el configuration file?
My .emacs configuration file gets bigger and bigger and I'd like to get a better overview and structuring by adding headings, subheadings and being able to hide or show them like I can do with Emacs org-mode.
I noticed that I can activate org-mode…

MostlyHarmless
- 1,395
- 2
- 13
- 14
55
votes
4 answers
Practical benefits of new advice system in Emacs 24.4
Emacs 24.4 comes with a new advice system. The NEWS file says:
** New package nadvice.el offers lighter-weight advice facilities.
It is layered as:
*** add-function/remove-function, which can be used to add/remove code on
any function-carrying…

itsjeyd
- 14,586
- 3
- 58
- 87
55
votes
3 answers
How do I get the current major mode?
If I am editing a .tex file in emacs, by default (for me) the bottom right corner of the frame will say "LaTeX/P". However, I won't get to that mode by typing "M-x LaTeX/P-mode"; I can only get to it by typing "M-x latex-mode".
Other than Googling…

john smith
- 653
- 1
- 5
- 5
54
votes
6 answers
How to override major mode bindings
Sometimes my global keybindings are overridden by a major mode. An easy example is the following setting in my init file
(global-set-key (kbd "C-j") 'newline-and-indent)
But annoyingly this keybinding is hidden by the "Lisp Interaction" major mode…

nispio
- 8,175
- 2
- 35
- 73
53
votes
2 answers
OTF ligature support in Emacs
PragmataPro is a typeface that comes with a number of programming ligatures. My understanding is that these are OpenType face (OTF) ligatures.
I am aware that Emacs supports programmatic replacement of character combinations (for example -> to ⟶ or…

Matthew Piziak
- 5,958
- 3
- 29
- 77
53
votes
3 answers
How to save a keyboard macro as a Lisp function?
Very frequently I would need to perform the set of steps requiring multiple key strokes. For the same session those steps can be recorded in a keyboard macro.
An example is saving a frequently executed search/replace operation as a keyboard macro.…

Kaushal Modi
- 25,203
- 3
- 74
- 179
52
votes
8 answers
How to treat underscore as part of the word?
I use Emacs + evil mode.
When I position the cursor on e (in normal state) in a chunk of text such as abc_def_ghi, ciw (change inner word) changes only the def part of the string, while Vim would change the entire abc_def_ghi.
How can I force evil…

Kossak
- 1,159
- 1
- 9
- 18
51
votes
3 answers
Magit split hunk into two hunks
There's a question on SO about splitting hunks using magit, and the two solutions given are to either stage the region (mark a region, hit stage), or to shrink/grow all hunks using + & -. That's not what I'm after.
In magit's status buffer, I want…

Squidly
- 1,499
- 14
- 17
51
votes
7 answers
How to use an external program as the default way to open PDFs from Emacs?
When I M-x find-file a PDF, it is opened in Emacs. While this is nice, Emacs' PDF viewer lacks many features that I need and I would prefer to open PDFs in an external program instead. How can I configure Emacs to use an external program as the…

tmalsburg
- 2,540
- 1
- 14
- 29
50
votes
6 answers
How to get intelligent auto-completion in C++?
Emacs cannot compete with another other IDE if it doesn’t have an auto completion function. Auto-complete simply makes me a more efficient programmer. I know of the Auto Complete Mode extension, but it does not work with C++.
How can I achieve…

programking
- 7,064
- 9
- 41
- 62
49
votes
6 answers
Can cursor jump back to the previous position?
Can I make my cursor in a buffer jump back to its last position? (preferrably without having to mark the previous position)
For example, C-a jumps to the beginning of the current line, can I jump back to where it was before?
For example, when C-x…

Tim
- 4,987
- 7
- 31
- 60