All Questions

24
votes
2answers
3k views

Add operating system clipboard to kill ring

Often I find myself copying a code snippet into my operating system's clipboard from the internet. Then, I take the following simple steps: Switch to my Emacs window Find the place where I want to ...
11
votes
2answers
403 views

For what languages is `syntax-ppss` appropriate?

I've been looking at a way of detecting whether point is on a comment by looking at how the current buffer is fontified. Smartparens defines sp-point-in-comment, which relies on syntax-ppss. However, ...
8
votes
6answers
646 views

How to search the Emacs Lisp Reference Manual?

Sometimes describe- or apropos- are not enough. How can I search the Emacs Lisp Reference Manual (C-h i m elisp) from within emacs?
54
votes
4answers
12k views

Fundamentals of multiple-cursors

I recently learned about multiple-cursors, and it looks like a very useful package. I went through the documentation on the original repo, but the commands still look a bit obscure to me. I then ...
29
votes
6answers
6k 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?
3
votes
3answers
1k views

How do I connect to IRC using Emacs?

I want to get onto the #Emacs channel on Freenode. How do I do it?
26
votes
6answers
10k 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?
58
votes
17answers
28k views

How do I switch buffers quickly?

In vanilla Emacs, I have to do C-x b and then manually type out the buffer name to switch. If I forget the name of the buffer, I have to hit TAB to list possible completions. Is there anything I can ...
0
votes
3answers
546 views

How do I bind Caps Lock to Control on Windows? [closed]

What are my options for making my Caps Lock key a Control key? Can this be done within Emacs?
10
votes
1answer
355 views

Truncate beginning of right-aligned column in org table

I have a column in an org-mode table that contains long file names. The interesting part of the filename is the last few characters rather than the first. For example, given the files below: /data/...
17
votes
2answers
477 views

How can I use the SE flavor of Markdown in emacs?

I would like to use the SE flavor of markdown in my emacs. The default Markdown mode has some features (backticks and indentation mark code, # makes a header and > also changes the font) but I ...
13
votes
1answer
726 views

How to control in which window a buffer is displayed?

Q: how can I control which window org-deadline uses to display the calendar? org-deadline temporarily pops up the calendar buffer in a window when setting a deadline, and then closes it again after ...
2
votes
1answer
163 views

Can I toggle fringe-mode when entering / exiting edebug?

Paraphrasing a question I previously asked on SuperUser because, IMO, the answer found there does not resolve the issue. Question For the most part I prefer to disable Emacs' fringe. (I customize ...
28
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 "...
5
votes
3answers
4k views

Recursively find all files from a folder containing a regexp in the filename, using helm

How can I find all files from a folder and its subfolders recursively, containing a regexp in the filename, using helm? For example: how to search for all files with the extension .el and containing ...
47
votes
2answers
12k views

What are the differences between autocomplete and company mode?

There seem to be two major autocompletion extensions for emacs: autocomplete and company mode. What are some of the practical differences between the two and when would I want to use one over the ...
6
votes
1answer
255 views

Make AUCTeX compile each \include to a separate file

In LaTeX it is customary to put the content of different chapters into different files which are then pulled into a master file using \include{FILENAME} statements. One can then use the \includeonly{...
9
votes
1answer
262 views

How to prevent tramp locations from interfering in history?

I have an issue where if I try to perform some random Emacs operations such as org-capture, or renaming a file to a different (local) directory in dired, Emacs attempts to contact a different machine ...
1
vote
1answer
540 views

How to use global prefix command key in define mode-map keybinding?

I have a global prefix command key define like following: (unless (boundp 'help-document-map) (define-prefix-command 'help-document-map)) ;; (define-key my-programming-prefix-k (kbd "h") 'help-...
9
votes
2answers
1k views

project specific init file

I have some customizations for emacs that I'd like to use for a single project, but not affect emacs globally. Is there any way I can have emacs load a specific init file when launched from a certain ...
1
vote
2answers
2k views

What are possible real use cases of the Emacs “psychotherapist” mode? [closed]

It is well known that when you type M-x doctor, a kind of AI program prompt you to write about your problems, as a psychotherapist does. Some said it's an easter egg, but it seems it goes beyond the ...
10
votes
1answer
3k views

Get content of a buffer

So buffer-string gets the content of the current buffer. But it doesn't allow specifying other buffers. How can I get around that? Do I need something like save-window-excursion to make it work?
3
votes
1answer
203 views

Can I modify whitespace mode to distinguish hard and soft newlines?

Currently, whitespace.el shows me newline characters by changing the display table to show a $ at the end of lines. I don't actually find this useful, so I disable it while I enjoy the many other ...
12
votes
1answer
1k views

Asynchronously wait for output from a comint process

First of all, a disclaimer. I have researched this many times, and I am pretty sure that I have already found the answer one way or another, but I just don't understand it. My problem is the ...
8
votes
2answers
2k views

How can I customize the compile command?

In one of my projects I need to run make package install when building instead of make. It remembers the last compile command I used, but resets to make -k every time emacs starts up. How can I ...
4
votes
2answers
439 views

How to remove alias from the eshell?

I recently created the alias in eshell: alias hello 'echo "Hello World"' So now whenever I type hello: I am very used to creating temporary alias in the Terminal for more subtle use. And then ...
2
votes
1answer
473 views

How to better control Emacs buffers in StumpWM?

I have been using Emacs more and more, to the point that I would like to start using StumpWM as my default window manager with it, so that I can integrate the missing bits of my workflow that ...
6
votes
1answer
743 views

Listing SCHEDULED headlines from an org file ordered by date

A few months ago, I converted my init file into an org file, and I’ve since been using it as a way to organize my blog posts. I won’t go into too much detail here, suffice to say that this is a huge ...
5
votes
1answer
299 views

elisp widgets: Modifying an editable-field's value real time when changing another one

This is cross-post from Stack Overflow I have a simple widget setup: (setq gobgen-widget-name (widget-create 'editable-field :size 25 :format "Name: ...
5
votes
0answers
62 views

In what circumstances will edebug produce different behaviour?

I'm trying to debug this julia-mode indentation issue using edebug. The elisp I'm running is here and the bug only occurs on Emacs 23.3. TAB is bound to julia-latexsub-or-indent. I can reproduce the ...
18
votes
3answers
859 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 ...
4
votes
2answers
824 views

Supporting images/diagrams in exported org-mode presentations

I'm currently preparing a presentation which I've outlined in org-mode and I'm having difficulty in including diagrams in the exported HTML. I'm currently using org-reveal but I'm happy to use another ...
5
votes
2answers
382 views

What is the best way to reload git stashed changes you've popped while file is open in buffer?

When I'm viewing a file and then pop a stash which modifies that file in the working tree using git stash pop in either bash or eshell, what is the best way to immediately see those changes in the ...
6
votes
1answer
953 views

yasnippet: how to expand a snippet from a string and have the fields recognized?

Q: how do I get yasnippet to expand a text string correctly (recognizing snippet fields) from inside elisp code? A very simple snippet is a just a string of characters with some control characters ...
5
votes
1answer
113 views

Difference between posix-search-forward and search-forward-regexp (need example)

In emacs lisp, there's the function posix-search-forward http://www.gnu.org/software/emacs/manual/html_node/elisp/POSIX-Regexps.html. Does anyone have a full example showing its difference from ...
4
votes
1answer
669 views

Why do sql-mode and sql-interactive-mode not highlight strings the same way?

Here is a screenshot showing the difference between sql-interactive-mode (top) and sql-mode (bottom). Why does the string not get highlighted properly in sql-interactive-mode? (Note - this also ...
10
votes
1answer
180 views

Are there any pre-existing benchmark suites for Emacs itself?

(This question is not about writing benchmarks/profiling elisp code, for that, see this question.) Do any benchmark suites exist for Emacs performance? I'm looking for something equivalent to the V8 ...
59
votes
4answers
6k views

How can I find out in which keymap a key is bound?

I have rebound a the 'd' key in gnus-article-mode, but its old behavior is still active when the point is on an attachment. I can see that the rebinding did not take effect there by doing C-h k d, but ...
4
votes
1answer
496 views

Make helm window the only window

Sometimes when I am using helm, I want to make the helm completion buffer as big as possible. I know that helm-enlarge-window will make the window grow by 1 line, but this is awkward and still doesn't ...
17
votes
1answer
902 views

How can I restart emacs and preserve my open buffers and interactive history?

As a follow-up to What's the fastest way to reload my .emacs file when I make changes so all my affected buffers will pick up those changes? It was suggested that the restart question should be ...
12
votes
1answer
892 views

How do I automatically load a mode for a specific set of file extensions?

I'd like to load the yaml-mode for any files named *.yml or *.yaml.
27
votes
2answers
2k views

What's the fastest way to reload my .emacs file when I make changes so all my affected buffers will pick up those changes?

I'm aware of C-x C-e which is eval-last-sexp and M-x eval-buffer, but these aren't always sufficient to pick up all changes. Sometimes you need to actually close buffers that are in the modes who have ...
5
votes
5answers
3k views

How to run a previous command in an Emacs shell?

Of course when I am in Terminal and I press the up arrow key, it goes to the previous command. However, when I hit the M-x keys and type shell an integrated shell comes up in Emacs: However, if I ...
4
votes
4answers
309 views

Prevent abbrev-mode from expanding on underscore

Abbrev-mode seems to think an underscore signals a new word, which is not the case in many programming languages. I want it to expand after spaces, newlines, and tabs; not after underscores. Is there ...
5
votes
3answers
357 views

Cycle between windows in all frames

I currently use the following custom command to navigate between windows and frames: (defun nispio/other-window (&optional arg) "With prefix argument, select the next frame. Otherwise, select ...
4
votes
1answer
393 views

ESS indentation of parentheses after =?

Indentation in ESS is occasionally a little kooky, and I'm trying to figure out if the kookiness is a bug or a feature. How does one get proper indentation of parentheses after an "=" sign in ESS (...
16
votes
3answers
959 views

Set column widths in `ibuffer`

Is there a way to customize the widths of the columns in ibuffer? Specifically, I want to widen the Name column to be able to read more of the buffer names before they get truncated. I have tried ...
7
votes
1answer
122 views

Batch loading binary files

I just discovered vlf-mode (View Large Files) and I am using it to view a large binary file in hexl-mode and read certain metadata from headers within the file. It works great, with one exception. ...
7
votes
1answer
640 views

Creating permalinks for sections in HTML exported from org-mode

By default when org-mode documents are exported to HTML, the section and sub-section links look like file:///path/to/export/location/doc.html#sec-1-1 The problem is that the above link won't point ...
9
votes
4answers
2k views

Recursively open files matching regexp in marked directories

Generally speaking, I would like to be able to open all files within a given set of directories (and their subdirectories) where the filename matches a given regexp. For example /home/nispio/...

15 30 50 per page