All Questions

20
votes
1answer
2k views

Choose files to stage of a new directory with magit

If you create a new directory, its files won't show up with magit-status, only the new directory is in the list of Untracked items. Currently I have to magit-stage-item the new directory and then ...
20
votes
2answers
355 views

Is there a function to insert the correct `(kbd “…”)` by pressing the key?

I'm bored of looking up key names for the kbd function, is there a way to automatically insert the correct key name just by pressing the key? So for example I want something to do this: I'm typing (...
20
votes
4answers
3k views

Hide *compilation* window

It is annoying to see the compilation window appear when it is successful. How to remove that automatically? I want to see it though if it is not successful.
20
votes
4answers
2k views

Easiest way to downgrade a package installed via MELPA

Sometimes, package updates from MELPA can break some part of emacs and when that happens I'd like to be able to revert back to using an older version of the package. Right now, I can do it in two ...
20
votes
4answers
7k views

Shrink/Zoom/Scale images in image-mode

With Emacs' doc-view-mode I can easily shrink/zoom/etc PDFs, however, I would like to be able to do the same thing with images. Currently when I open an image I cannot adjust the zoom level to fit it ...
20
votes
1answer
1k views

Magit equivalent for “git remote -v” (list remotes)

I'm wondering if there is a magit equivalent to git remote -v to list remotes and their URL's defined on a git repository. The magit remotes popup offers options to add, remove, rename, and set url, ...
20
votes
3answers
3k views

How to display the content of minibuffer in the middle of the emacs frame?

When working on a maximized Emacs frame, having the content of the minibuffer / echo area display at the bottom of the screen can be hard to see, but also causes to lose focus on the text being edited ...
20
votes
1answer
2k views

How can I use eww as a renderer for mu4e?

Emacs 24.4 came with native eww browser. What is the proper way to use eww as a renderer for mu4e messages?
20
votes
2answers
4k views

Command that formats (prettifies) Elisp code

Let's say I have a function that looks like the following (as is often the case when printing elisp output). (defun my-example-function () (let ((a (do-something)) (b (do-something))) (setq someone ...
20
votes
3answers
3k views

Different themes for terminal and graphical frames when using Emacs daemon

I'm trying to achieve the following behavior in Emacs24: I like to use a different theme (solarized-dark vs. solarized-light) depending on whether I connect to the running server with a terminal ...
20
votes
1answer
472 views

how to prevent faces from bleeding onto surrounding areas of buffer?

Q: How do I keep org-mode link faces from bleeding over into the ... selective display characters at the end of a folded header? This is a visual tick that drives me a little nutty. When, in org-...
20
votes
2answers
282 views

Display list of words along bottom of frame?

I'd like to display 3 lists of words on separate lines horizontally along the bottom (although top would work too) of every emacs frame I have open. I've thought of 6 ways to do this, and they all ...
19
votes
2answers
14k views

How to change the cursor type and color?

I would like to change the cursor, like in Terminal, from the block to the I-Beam cursor. From this: To this: How would I do this? Also, on a side note, how do I change the color of the cursor?
19
votes
3answers
1k views

Swap two variables in Elisp

Suppose I have (setq a 1 b 2) How can I elegantly swap the values of a and b without using a temporary variable?
19
votes
4answers
3k views

Flycheck with file relative eslint executable

A lot of projects I work on install eslint as a dev dependency, with a custom set of eslint plugins. Right now, flycheck uses the globally installed version of eslint rather than the version of eslint ...
19
votes
3answers
6k views

When/why should I use progn?

I have seen progn being used quite a lot as I browse the configuration files of experienced Emacs users. I found this nice explanation of progn, but what I am really curious about is, what is the ...
19
votes
1answer
9k views

How do I install GnuTLS for Emacs 25.1 on Windows?

I just upgraded Emacs on my Windows 10 machine from 24.5 to 25.1. For Emacs 24.5 I had GnuTLS correctly setup and for 25.1 I did what I thought I remembered I did: Got prebuilt Emacs binaries from ...
19
votes
1answer
3k views

Emacs doesn't paste in Evil's Visual mode with every OS clipboard

Setup: GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32) of 2015-07-25 on KAEL Compiled from EmacsW64. Package Evil, using the latest version of Evil from MELPA Windows 7 x64 bit. Situation: ...
19
votes
2answers
2k views

Is it possible to remove '\emsp' from clock report but preserve indentation?

Is it possible to replace '\emsp' with just plain spaces? I.e, In Clock reports, there are a lot of these '\emsp's. (See example below.) I'm able to get rid of them by setting ':indent nil'. But ...
19
votes
3answers
5k views

How to use skewer-mode?

I am currently struggling to use skewer-mode in Emacs. I downloaded and installed skewer-mode via MELPA, so all the dependencies should be inplace. For testing purposes I even downloaded the boidsjs ...
19
votes
1answer
793 views

Org Mode: Prevent editing of text within collapsed subtree

Is it possible to prevent editing of text within a collapsed subtree in Org Mode? That is, I would like to make it impossible to edit the hidden text. This seems like something that should exist but I ...
19
votes
7answers
1k views

Dired “quick-view” key to preview the file at point

I would like to create a function that does a "quick view" of a file the is under point in dired. The way that I would like for this to work is that I hold down a function key, which then makes the ...
19
votes
4answers
1k views

How to set emacs as the default file manager?

Some programs like firefox have buttons that when clicked open a file manager for browsing files. How do I make it to open in emacs with dired mode on Debian Linux?
19
votes
5answers
6k views

How do I change portions of a custom theme?

I'm using one of the pre-defined custom themes that come bundled with Spacemacs (zenburn). How can I modify specific portions of the theme, for example just change the font color used for comments ?
19
votes
1answer
3k views

GitHub Markdown Mode

Is there an Emacs mode for GitHub Flavored Markdown? GitHub Flavored Markdown adds a number of features to traditional Markdown: underscore handling, url autolinking, strikethrough, and tables. It ...
19
votes
2answers
693 views

How to scroll through all available matching interactive (M-x) commands using Helm rather than just my history?

I'm using Helm to perform completions for my interactive commands, but it only lets me cycle through those commands which I have used in the past (i.e. 4 Candidate(s)). I don't want this behavior, ...
19
votes
1answer
2k views

How to distinguish C-i from TAB?

Normally, for historic reasons, emacs treats the TAB keycode and the C-i key as the same, cf. the emacs lisp documentation on function keys or abo-abo's answer on the question "What is the difference ...
19
votes
2answers
2k views

When are org-mode attachments preferable to file hyperlinks?

As far as I can tell, org-mode attachments solve the same problem as do file hyperlinks but in a clunkier way. In what situations would attachments be the superior solution?
19
votes
3answers
981 views

How to gracefully handle errors in init file

I would like a way to catch errors when running my init file, and then handle them gracefully. A lot of my most important customizations and keybindings show up at the end of my init file to make sure ...
19
votes
2answers
2k views

How can I improve startup time despite many packages?

TL;DR I have such a huge amount of packages that it's hurting my startup time. If you don't believe that could be the case, read on. My Emacs startup time is quite small. I don't use use-package, I ...
19
votes
2answers
2k views

How to choose between nil and 0, or t and 1 when setting variables or enabling modes

I understand that nil, 0 and/or -1 are used for disabling some features and t, 1 and/or +1 are used for enabling some features. When assigning variables or enabling/disabling minor modes, which ...
19
votes
2answers
2k views

What options are there for doing spell-checking in emacs

Because I'm currently doing a lot of non-programming tasks in Emacs, spell-checking became one of my major concerns once again. I noticed that there is no question related to the options for spell-...
19
votes
1answer
5k views

Display PDF images in org-mode

Note: This question was asked here before, with no success. Org-mode’s ability to display inline images is fantastic for writing my weekly scientific reports. I can include graphs, link them with ...
19
votes
1answer
2k views

How does one use flyspell in org buffers without flyspell triggering on tangled code blocks?

Imagine an org buffer in Emacs like: * Title Some text describing the title and the codew (sic) and whatnot. #+BEGIN_SRC emacs_lisp (setq backup-by-copying t) #+END_SRC I want flyspell to check ...
19
votes
1answer
2k views

Are there any benefits of compiling Emacs with one graphical toolkit opposed to another?

It seems the options are gtk, gtk2, gtk3, lucid or athena, motif. Of course, there are visual differences and one toolkit may be more to your tastes than others. Apart from that, are there any other ...
18
votes
5answers
12k views

How to disable line wrapping in Spacemacs?

I have limited emacs experience. Tried to find a solution to disable line wrapping in Spacemacs but couldn't find any. The solution to this problem in Vim is to execute set nowrap. But it's not ...
18
votes
2answers
3k views

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?
18
votes
4answers
1k views

Automatically re-indenting elisp code when adding or removing code before an indented block

Say I have a elisp code like: (+ 2 3▮(+ 3 4)) Is there a way to automatically re-indent the sexp after the cursor, when I add or remove symbols? So after pressing SPC 4 SPC, I would ...
18
votes
6answers
5k views

Get all regexp matches in buffer as a list

On the Code Golf Stack Exchange site today, I found this answer in Clojure to the question "Get all links on a webpage". (->> (slurp "http://www.stroustrup.com") (re-seq #"(?:http://)?www(...
18
votes
9answers
729 views

How would you explain Emacs to a non-technical person?

In the spirit of How can I explain the meaning of LaTeX to my grandma? Emacs is wonderful editor for any text-based purpose—this much is clear to those of us who use it. Often times I'm trying to ...
18
votes
4answers
12k views

Best ways of generating UML from within Emacs

There are a bunch of integration options between Emacs and UML tools, like org-mode's plantuml embedding, a plantuml major mode etc. Of course I can try them out but I'm wondering what other people ...
18
votes
3answers
5k views

Set up Emacs on Windows to start a single instance and open files in the existing instance

I am particularly interested in the full Windows experience including: Automatically starting a server if one is not already started How to call emacs so that it utilizes the server (e.g. from ...
18
votes
2answers
16k views

How to view and edit pdf files in emacs?

I heard that we can view pdf files in emacs. Is it done by converting pdf files to plain texts first? Can we view pdf files at its fullness in emacs? can we edit pdf files in emacs? Thanks.
18
votes
4answers
7k views

How to setup default windows at startup?

Every time I open up Emacs I tend to set up 3 windows by doing C-x 3 (split-window-right) and then C-x2 (split-window-below). After that I have to switch to each window to open the files I want to ...
18
votes
1answer
2k views

How to specify default header arguments in orgmode code blocks

I'm tying to set default header arguments to the code blocks within my org file, like this: #+PROPERTY: header-args :session *my_python_session* #+PROPERTY: header-args :results silent #+PROPERTY: ...
18
votes
2answers
909 views

Removing smart quotes automatically

Especially when copying text from things like Google docs, I would like Emacs to automatically remove smart double quotes, smart single quotes, and all manner of em-dash and en-dash characters, ...
18
votes
2answers
3k views

A faster method to obtain `line-number-at-pos` in large buffers

The function line-number-at-pos (when repeated about 50 times) is causing a noticeable slow-down in semi-large buffers -- e.g., 50,000 lines -- when point is near the end of the buffer. By slow-down, ...
18
votes
1answer
1k views

How to widen helm buffer names in `helm-buffers-list`?

One of the things I find annoying in emacs-helm is the size of the column showing buffer names in helm-buffers-list. I have searched the documentation and couldn't find how to customize the width of ...
18
votes
4answers
9k views

How to update packages installed with use-package

I'm using use-package to install and configure packages (most of these packages are in melpa). Is there a clean automated way of keeping all these packages up-to-date ? If not, what is the best work ...
18
votes
1answer
486 views

How can I bring back `nil`?

I've accidentally run the following: (unintern variable) where variable's value was nil. How do I get nil back without restarting Emacs?

15 30 50 per page