Most Popular
1500 questions
11
votes
3 answers
Is there a better way to handle multiline docstrings in elisp?
I hate the way that elisp (not sure if LISP in general) handles multiline docstrings.
(defun foo ()
"This is
a multi
liner
docstring"
(do-stuff))
I sure do wish that I could do something like
(defun foo ()
(eval-when-compile
(concat
…

Krazy Glew
- 242
- 2
- 8
11
votes
3 answers
A way to insert a predefined text into Magit's commit message window?
We have a convention that every commit message begins with an issue number.
I'd like to be able to programmatically insert the issue number part (computed by a separate function) into the commit window of Magit, when it first opens (that is, on…

9000
- 497
- 2
- 15
11
votes
2 answers
How can I unbind all symbol definitions with a certain prefix?
I'm changing up the API of my package pretty frequently, but company-mode pulls every defined symbol (as it should) in its completions. I don't want to accidentally use an unbound name, so how can I unbind all variables and functions that start…

Sean Allred
- 6,861
- 16
- 85
11
votes
3 answers
How to change Org-mode babel tangle write to file way as append instead of override by default?
By default, Org-mode will override current babel src block content on file
original content (when the file already has content).
For example, I have an org-mode file content as the bellowing block:
#+BEGIN_SRC org
,* config file
,** config…

stardiviner
- 1,888
- 26
- 45
11
votes
3 answers
Is it possible to auto-correct spelling “on space”?
I was about to post the question but then I saw it on Stack Overflow while searching for auto-correct possibilities. The linked question has no answers, so I thought it'd have more luck on this site. Here's the text:
I wish there were a way so that…

Tymric
- 762
- 1
- 6
- 15
11
votes
5 answers
Avoiding overwriting global key bindings
Okay, this is a persistent problem for me. As I continue to use emacs more and more, I'm starting to customize it to my needs by installing the packages(and/or defining functions) and the one big problem I face when I configure a package is:- what…

Chakravarthy Raghunandan
- 3,132
- 2
- 18
- 42
11
votes
3 answers
Autocompletion when creating Internal Links in Org-mode
In Org-mode, when creating internal links, we have to type full name of the section heading to which we want to link.
Is it possible that the heading name gets automatically filled in when we are creating a new internal link? When creating a new…

shivams
- 366
- 3
- 16
11
votes
2 answers
Jump to documentation buffer with company-mode
I have recently switched from auto-complete-mode to company-mode and I having fun. Recently I had to write some Emacs Lisp code. I start typing my function, completion candidates are shown, I press F1 and the documentation opens up in another…

petrux
- 665
- 1
- 5
- 18
11
votes
1 answer
Evil mode and regular expressions
In Vim, if I want search for all variable names LX where X is a number, I can simply type /L\d. However, this doesn't seem to work with evil.
Is there another syntax for regular expressions in Evil mode, or will I have to fall back on some Emacs…

Michelrandahl
- 213
- 2
- 7
11
votes
1 answer
Insert code chunk in R Markdown with yasnippet and polymode
I am trying to write a yasnippet to insert code chunks into an R Markdown file. I use polymode to have multiple major modes (markdown, ESS[S]) in a single file. This is my snippet:
# -*- mode: snippet -*-
# name: chunk
# key: chunk
# --
\`\`\`{r…

Kara Woo
- 422
- 3
- 9
11
votes
1 answer
Insert current date with yasnippet
Since several years I've been using this snippet to insert a date into buffer:
# -*- coding: utf-8 -*-
# name: date
# key: date
# --
`(insert (format-time-string "%Y-%m-%d"))`$0
However nowadays I get this annoying warning:
Warning (yasnippet):…

user673592
- 839
- 7
- 17
11
votes
1 answer
Exporting highlighted source code to pdf in Org-Mode
I'm trying to export some python code with syntax highlighted to a pdf, from org-mode. Even though I can export to html without any issues I could not find a way to export it to pdf.
n.b. I'm using spacemacs but also tried without success with…

user13328
- 111
- 1
- 3
11
votes
2 answers
Search/replace-like feature for swapping text
I frequently find myself trying to replace e.g. foo with bar and bar with foo in a buffer.
The way I usually do it is either:
3 query-replaces: aaa -> @@@, bbb -> aaa, @@@ -> bbb
give up on automation and just do the replacement by hand
I suppose…

T. Verron
- 4,233
- 1
- 22
- 55
11
votes
2 answers
Can I split emacs the window 4 ways (vertically and horizontally) in a 4 grid layout with different files in each?
I just started using emacs and since I have been using Sublime Text for a while, I am used to the four-grid-layout with 4 windows stacked horizontally and vertically. I have been able to split the screen horizontally only. How do I split it 4 ways?

twodee
- 163
- 1
- 1
- 7
11
votes
1 answer
Show something in active mode line instead of all mode lines
I set up an org-timer indicator in the mode line with this.
(setq-default
mode-line-format
(quote
(
;; org-timer
(:eval
(unless (not org-timer-countdown-timer)
(propertize (let* ((rtime (decode-time
…

stardiviner
- 1,888
- 26
- 45