Most Popular
1500 questions
37
votes
7 answers
How to pretty-format code (auto-insert newlines, indent, etc)?
I'm using spacemacs but presumably it's emacs knowledge that's required here.
I have a JSON file with a single long line, let's say this JSON from json.org/example:
{"menu": {"id": "file", "value": "File", "popup": {"menuitem": [{"value": "New",…

Emmanuel Touzery
- 961
- 1
- 8
- 17
36
votes
4 answers
Show unbound keys
I want to define some key bindings for my new found usage of helm, amazing mode btw, and I want to do it without overwriting the usage of other keys. I realize that the number of different key combinations is infinite, but is there some way to see…

c-o-d
- 920
- 9
- 19
36
votes
3 answers
How can I see the changes made to a modified buffer since the last save?
Given a modified buffer, how can I diff it with the file backing it on disk to see what I've changed?

nosefrog
- 805
- 7
- 9
36
votes
6 answers
How to set a short-cut for #+BEGIN_SRC #+END_SRC?
I read the org-mode manual but did not find a short cut to insert:
#+BEGIN_SRC
#+END_SRC
I guess I need to create a configuration in ~/.emacs to set a shortcut? Or, is there a shortcut but I did not know?
I use R much in emacs. Is there a way to…

Xianwen Chen
- 461
- 1
- 4
- 4
36
votes
4 answers
When to sharp-quote a lambda expression?
Q: When, if ever, is it useful to sharp-quote a lambda, and when, if ever, must we not sharp-quote a lambda?
People use lambdas in three ways:
plain: (lambda (x) x)
quoted: '(lambda (x) x)
sharp-quoted: #'(lambda (x) x)
This SO thread discusses…

Dan
- 32,980
- 7
- 102
- 169
36
votes
2 answers
org-mode: how to generate clock report for hours worked each day?
org-clock-report is awesome; however, it reports time spent on each task. Is there any custom command that you use to generate a clock report showing hours worked, across tasks, for each day?
The trouble I've encountered is that, I file my TODO…

Covi
- 525
- 1
- 4
- 8
36
votes
2 answers
Is it possible to use both MELPA and MELPA-stable at the same time?
I use melpa-stable as an additional package repository, but one of the packages I like to use (icicles) isn't available on melpa-stable. Is there any way to configure package.el to normally use melpa-stable, but use melpa for a specific subset of…

Timo Geusch
- 508
- 4
- 7
36
votes
2 answers
Understanding of emacs align-regexp
I've read the Emacs documentation for align-regexp but still have difficulty in understanding how it works. What I'm talking about is its prefixed form C-uM-xalign-regexp, not the simple form M-xalign-regexp. Here are my questions:
Does the first…

Just a learner
- 547
- 5
- 11
36
votes
3 answers
What are the major features planned for GNU Emacs 25?
I attempted to install Emacs 24.4 through homebrew with the following command:
brew install emacs --HEAD --use-git-head --cocoa --with-gnutls
It ended up installing (a development build toward what might become) Emacs 25. I haven't been able to…

Connor
- 1,611
- 1
- 21
- 26
35
votes
3 answers
Untrack file without deleting it?
I have a tracked file in a git repository. How do I untrack this file without deleting it using magit?

deadghost
- 827
- 1
- 7
- 13
35
votes
1 answer
Why do regular expressions created with the regex builder use syntax different from the interactive regular expressions?
So, using the regular expression builder (M-x re-builder), finding lines that end in \ takes "\\$", while in search and replace by regex, it only takes "\$". I would have expected the regex builder to build directly usable expressions, so what…

user2699
- 2,231
- 18
- 32
35
votes
3 answers
Proper way to enable minor mode
I have foo-mode and would enable bar-minor-mode for it. So which way is more common and preferable?
A
(add-hook 'foo-mode-hook 'bar-minor-mode)
B
(add-hook 'foo-mode-hook (lambda ()
"Turn on `bar-minor-mode' mode."
…

Netsu
- 555
- 1
- 5
- 9
35
votes
5 answers
Emacs won't load theme on startup
I've installed the solarized theme package via MELPA. I can select one of the two solarized themes via `customize-theme and it activates it. When I save the theme settings it adds the following to my init.el file:
(custom-set-variables
;;…

user2249626
- 671
- 1
- 5
- 6
35
votes
3 answers
ESS plot directly to an Emacs buffer?
Q: how can I get ESS (R) to plot directly to an Emacs buffer?
When interacting with R through ESS, R defaults to spawning a separate graphics window outside of Emacs to draw its plots. (One can, of course, choose other graphical devices, which is…

Dan
- 32,980
- 7
- 102
- 169
35
votes
5 answers
Can I avoid outdated byte-compiled elisp files?
Occasionally, when I start Emacs, I get a message like.
Source file `/home/USER/.emacs.d/elpa/....el' newer than byte-compiled file
Also, I sometimes edit a package I'm developing and forget to
recompile it. When I try to load the new file, it…

Malabarba
- 23,148
- 6
- 79
- 164