Most Popular

1500 questions
11
votes
5 answers

How to enter view-only mode when browsing Emacs source code from help?

When I browse Emacs help for functions via C-h f, I often want to peek into the Elisp/C implementation. I want to enter view-mode automatically when I access source code this way to avoid unnecessary modification. Is there a hook or function I can…
rationalrevolt
  • 213
  • 1
  • 4
11
votes
3 answers

Use several Emacs configurations/versions simultaneously

I want to use several emacs configurations/versions simultaneously so that no configuration disturbs each other, each with their own configuration directory and elpa repository. I heard about the trick with symlinking ~/.emacs.d and ~/.emacs, but…
user17303
11
votes
2 answers

Search through the values of all variables in Emacs

I'd like to find which variables contain a certain value. Is there a way to do a regex search through the values of every variable in Emacs?
izkon
  • 1,798
  • 10
  • 23
11
votes
1 answer

formatting constexpr if in c++-mode

I recently started using C++17, which brings constexpr if. This however screws up c++-modes default indentation. // emacs 25.3.2 with --no-init if constexpr (n == 1) { // Why? } else if constexpr (n == 2) { // This is a mess... } else { …
topisani
  • 113
  • 4
11
votes
1 answer

Strange behaviour on evil-delete

When I use Emacs with Evil mode for some time, I sometimes get to a point, where I have no choice to what I want to delete when pressing d (or calling evil-delete). The current line gets deleted without that I have pressed d for the line a second…
Michael Dahl
  • 111
  • 5
11
votes
1 answer

How do I specify a custom face with font-lock-defaults?

If I define font lock keywords using existing faces, I can highlight the string 'foo'. (defconst my-mode-font-lock-keywords (list (cons "foo" 'font-lock-type-face))) (define-derived-mode my-mode fundamental-mode "My mode" "A demo mode." …
Wilfred Hughes
  • 6,890
  • 2
  • 29
  • 59
11
votes
1 answer

Command to copy and delete subtree in org-mode

Is there a command in org-mode that copies and deletes a whole bullet point (with its content)? I use that as a way to move tasks into other sections. So in other words: * Task A Content ** Task B Content * Task C I want to be able to easily…
Tohiko
  • 1,589
  • 1
  • 10
  • 22
11
votes
2 answers

How to remap backward-delete and help command while using Emacs from a terminal emulator?

I was using Emacs on CentOS 7 from the MobaXterm terminal on Windows 7, but the backspace key instead of backward-deleting a character invokes the prefix command C-h. According to EmacsWiki, I tried to put the following lines in…
Joseph Tesfaye
  • 389
  • 2
  • 13
11
votes
4 answers

How to make M-x and C-h f share the history?

It's quite common that I'll look through a command's documentation with C-h f, and then invoke the command with M-x immediately afterwards. Right now, the shortest way I've found to “invoke the last view command” is to copy its name (either from the…
Malabarba
  • 22,878
  • 6
  • 78
  • 163
11
votes
3 answers

How to wrap given text around region

I often have a situation where I need to apply text around a region. For HTML and simple cases there are libraries for this already. But what about the general case? I'd like to be asked what I'm gonna insert beginning and end of the region.
mike3996
  • 463
  • 4
  • 15
11
votes
1 answer

Define Control+Shift keys without kbd

I'm trying to add some functionality to someone else's package, and so I'd like to respect their patterns. Unfortunately, one of these patterns is to not use kbd. I need to bind a function to C-S-b, but I can't figure out how. I know how to do this…
Malabarba
  • 22,878
  • 6
  • 78
  • 163
11
votes
1 answer

Using function keys as "sticky" modifier keys

Is there a way to use a function key (like ) as a sort of super-key-down event and then have the next keystroke (f.ex. s) then be interpeted as s-s? In other words, this will be similar to sticky modifier keys, but just for emacs, not the os…
Var87
  • 331
  • 1
  • 7
11
votes
4 answers

How to make emacs align and indent a bibtex entry?

I want bibtex-mode to align and properly indent fields. I copied a bibtex entry for the following article into Emacs: (Article source here) But, with a simple paste, the alignment is lost in Emacs and the indentation is messed up: The TAB key…
Viesturs
  • 805
  • 8
  • 19
11
votes
1 answer

unicode.txt slowness

Moving around point (using the cursor keys) in Xah’s unicode.txt in fundamental-mode is noticeably slower than in an ordinary text file. Are the many non-ASCII characters the issue? Anything else? About: GNU Emacs 25.2.1 (x86_64-w64-mingw32) of…
feklee
  • 1,029
  • 5
  • 17
11
votes
1 answer

org-mode captions not supported for EXAMPLE blocks?

Please consider the following, self-contained .org file MVE, which I hope is self-explanatory: #+OPTIONS: toc:nil Figure [[captions-work-for-src-blocks]] shows that captions are correctly exported for SRC blocks. The second figure, in an EXAMPLE…
Reb.Cabin
  • 711
  • 6
  • 19