Most Popular
1500 questions
57
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,667
- 1
- 13
- 23
57
votes
3 answers
Inline verbatim and code with quotes in Org-mode
In Org-mode I can surround text with = or ~ to place text in inline verbatim or code mode.
However this fails if the text has quotes, and I couldn't find an explanation or workaround in the documentation.
For example:
=hello= Renders as…

Amelio Vazquez-Reina
- 5,197
- 5
- 33
- 47
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,225
- 2
- 36
- 74
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,457
- 3
- 18
- 14
55
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,651
- 4
- 80
- 183
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
- 735
- 1
- 5
- 11
55
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,225
- 2
- 36
- 74
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,666
- 3
- 59
- 87
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
- 6,038
- 3
- 31
- 79
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
- 2
- 9
- 18
52
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,519
- 14
- 18
52
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,570
- 1
- 16
- 30
51
votes
3 answers
Good methods for setting up alarms (audio + visual) triggered by org-mode events?
I would like to have alarms set off based on org-mode events associated with specific times (or start times). Ideally these would be audio and visual, and able to be customised to some extent. I used to use Sauron, but I can't get it to work with…

emacsomancer
- 1,041
- 1
- 9
- 16
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,194
- 10
- 42
- 63