All Questions

Filter by
Sorted by
Tagged with
39
votes
4answers
8k views

Add change to a previous commit with Magit

I have 2 commits, A then B, ready to be pushed. I realize I forgot to add something in A. How can I add this change to A using Magit? I don't even know which part of the Git documentation I should ...
38
votes
12answers
6k views

How to switch back and forth between two locations in a buffer

Sometimes I find myself frequently alternating between two functions that I am editing in conjunction with each other. In these situations, it is tedious and painful to keep on doing a C-s <...
38
votes
7answers
15k views

Tree-based directory browser?

I love dired, but sometimes (particularly when filming screencasts) I want to see the tree-structure of a directory and its children, a la the tree(1) command. Is there a tree-oriented directory ...
38
votes
9answers
4k views

How can I start learning Emacs Lisp?

Background: I'm mostly a vi user and am converting to Emacs. Past the basics and now use it for writing code in C and some Python with plans to do an R conversion too. I wrote (Common) LISP for ...
38
votes
4answers
15k views

How to exclude files from Projectile?

I am using the helm-projectile setup from prelude and it has been a huge improvement to my workflow. The only remaining issue are auto-generated files (e.g. generated by CMake) which show up during ...
38
votes
2answers
5k views

Intelligent spell-checking in org-mode

By default, the results of running M-x ispell-buffer in org-mode are very disappointing. Ispell looks inside :PROPERTY: drawers, which commonly contain things like :ID: 797495bd-581b-4a42-...
37
votes
4answers
8k views

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 ...
37
votes
3answers
10k views

What's the Magit equivalent of 'git add'?

What is the Magit equivalent of git add [--intent-to-add] <filename> for checking a newly created file into Git?
37
votes
2answers
7k views

Weird shell output when using IPython 5

I just upgraded to the latest version of IPython and now something is wrong when using it in emacs. When using it in a regular terminal it works fine (colors, tab-completion, etc.), however either ...
36
votes
3answers
10k views

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 ...
36
votes
7answers
7k views

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?
36
votes
3answers
6k views

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 ...
36
votes
2answers
15k views

How to convert DOS/Windows newline characters to Unix format within GNU Emacs?

Is there a way to tell GNU Emacs to convert DOS/Windows newline characters in a file to Unix format?
35
votes
5answers
5k views

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 ...
35
votes
5answers
2k views

Recording a GIF screencast of Emacs

I see lots of folks posting animated GIF's showing off Emacs features, but I haven't seen a nice walk through on creating one. Is there any code that tries to link the keyframes of the gif to ...
35
votes
2answers
20k views

How to disable auto-indentation of new lines?

I've recently upgraded emacs to version 24.4.1 and something has changed in the indentation of new lines. When I hit enter I expect just "bare" new line character at point where cursor was present, in ...
35
votes
9answers
12k views

Keeping my .org files in sync across multiple computers

How can I keep my .org files up to date across several computers, perhaps across multiple platforms(linux/windows)? I could keep all the .org files in git for example, but that would require me to ...
35
votes
3answers
8k views

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 ...
35
votes
1answer
13k views

Multicolumn cells in org-mode tables

Is it possible to merge two or more cells in an org-mode table like when using \multicolumn{}{}{} or \multirow{}{}{} in LaTeX? Something like this does not work: |------------+-----------+----------+...
34
votes
7answers
5k views

How to add a prefix to every line?

I have the code below: Hello There I am some code And want to add code in front of it, like: I said Hello I said There I said I am some code So how would I add a prefix to each line?
34
votes
1answer
2k views

What is the difference between a function and a command?

When posting questions and answers here, people sometimes use the terms "function" and "command" interchangeably. In other cases, people only use one of the two terms to discuss specific pieces of ...
33
votes
1answer
3k views

How to make Company mode be case-sensitive on plain Text?

By default, Company mode seems to convert every prediction into lower case. E.g: HelloWorldOfGoo HelloWorldOfEmacs -> Hell [Helloworldofgoo] //Company prediction [...
33
votes
6answers
4k views

How to reopen just killed buffer, like C-S-t in Firefox Browser?

Sometimes I accidentally kill a buffer and want to reopen it, just like C-S-t to undo closed tab in Firefox, but there is no built-in command in Emacs, the defun undo-kill-buffer in http://www....
33
votes
2answers
7k views

How to migrate Markdown files to Emacs org mode format

I've got hundreds of personal notes stored as files in Markdown format, after several years using the VoodooPad personal wiki software for OS X. There's plenty of information available for exporting ...
33
votes
2answers
10k views

How to clear cache of projectile file in spacemacs?

I am using spacemacs and often use the SPC p f key binding to find files in a projectile project. But even after removing a file from a git, SPC p f will show me that deleted file. I tried using SPC ...
33
votes
2answers
2k views

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 ...
32
votes
10answers
7k views

Kill or copy current line with minimal keystrokes

I do C-a C-k C-k to kill the entire line point is on. If I want to copy the line instead of killing it, I can hit C-/ C-/ right after typing the sequence above. Alternatively, I can do C-a C-SPC C-...
32
votes
6answers
13k views

How do I list all key-bindings available in a given buffer?

I am trying out a new major mode, how can I take advantage of Emacs' documentation system to get a listing of key bindings available in that specific buffer?
32
votes
5answers
7k views

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 ...
32
votes
4answers
7k views

How to test REST API with Emacs?

I'm putting together an app, and want to be able to test the api end points. I figured Emacs would be a cool way to go - especially if JSON responses could be parsed and the return data used in ...
32
votes
6answers
6k views

Running spacemacs alongside regular emacs: how to keep a separate .emacs.d

I would like to try spacemacs. But I don't want to switch from my regular emacs configuration just yet, so I would like the configuration that's currently in my .emacs.d to be in one directory, and ...
32
votes
3answers
713 views

What functionality is missing in GNU Emacs when compared to XEmacs?

In terms of functionality, what are the key points that presently distinguish XEmacs from GNU Emacs? To account for the different release schedules the most recent development version of each Emacs ...
31
votes
8answers
2k views

How to select non-contiguous regions in Emacs?

Suppose that I have already selected some text in the current buffer. Is it possible to select another stretch of text, while keeping the previous selection (and so on)? Added: One motivation for ...
31
votes
3answers
12k views

How do I get the current major mode?

If I am editing a .tex file in emacs, by default (for me) the bottom right corner of the frame will say "LaTeX/P". However, I won't get to that mode by typing "M-x LaTeX/P-mode"; I can only get to it ...
31
votes
3answers
2k views

Why is `let' faster with lexical scope?

While reading through the source code for the dolist macro, I ran into the following comment. ;; This is not a reliable test, but it does not matter because both semantics are acceptable, tho one ...
31
votes
5answers
3k views

Is there a way to use query-replace from grep/ack/ag output modes?

I'm aware of find-grep-dired, marking the corresponding files and then pressing Q to run dired-do-query-replace-regexp on the marked files. Unfortunately that requires restarting the grep and no ...
31
votes
3answers
4k views

Org-mode on the phone or on Evernote?

I use Org mode for keeping track of everything; ideas, notes, to-do lists, code snippets, etc. You name it. One problem I have though, is that I can't easily pull up my Org-mode data on my phone, even ...
30
votes
3answers
3k views

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 ...
30
votes
3answers
5k views

Is there an Emacs mode which highlights differences from the committed version?

One feature that Xcode has which I think is pretty neat is a "Comparison" mode, which continually shows differences between the current buffer and the most recent commit. Is there anything like this ...
30
votes
3answers
4k views

How to know when or when not to use the single quote before variable names?

I have the below: (setq some-variable "less") I am confused why I have to use the single quote with boundp but not with bound-and-true-p. Example 1: (when (boundp 'some-variable) (message "...
30
votes
3answers
3k views

When should I use autoload instead of require?

From what I understand require is used to load large chunks of code (something like modules) although it can also load individual functions. Autoload on the other side, only registers functions and ...
30
votes
4answers
3k views

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-...
30
votes
2answers
5k views

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-...
29
votes
6answers
4k views

Effectively using the mark ring

I have used the mark to select regions of a buffer. For example, I know the sequence C-<space> C-s foo can be used to select all text between the current point and the point after a search for ...
29
votes
3answers
6k views

Problems with keybindings when using terminal

I have the following line in init.el: (global-set-key [(control \;)] 'comment-region) It works very well in GUI window, but if emacs is invoked with the -nw option then C-; doesn't comment region, ...
29
votes
2answers
3k views

How to evaluate the variables before adding them to a list?

The below obviously doesn't work and hence this question. How do I correct the below code so that the value of somelist becomes '(("abc" . 123)) ? (setq x "abc") (setq y 123) (setq somelist nil) (...
29
votes
2answers
8k views

package-initialize: wrong type argument : arrayp , nil

while going through the emacs as a c/c++ editor , I came across the following lines of code to include in my ~/.emacs file, to connect to melpa archives for package installation (require 'package) (...
29
votes
2answers
5k views

How can I hide/display LaTeX section just like org-mode does with headlines?

When editing org files, I find it extremely convenient how you can hide and display headlines and their content by just hitting TAB on the headline. For instance, consider the following buffer * ...
29
votes
5answers
2k views

Different indentation styles for different projects

I work on many different C projects with unique indentation styles. How do I get Emacs to do per-project indentation settings without polluting the upstream project trees with .dir-locals.el files? I ...
29
votes
4answers
5k views

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 ...

15 30 50 per page