All Questions

28
votes
8answers
4k views

Emacs on a tablet?

Q: can Emacs be installed/used on a tablet with a minimum number of tears? I had been under the assumption that Emacs ran on basically everything. However, after some poking around, it looks like ...
28
votes
4answers
4k 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 ...
28
votes
2answers
3k views

Make visual-line-mode more compatible with org-mode

visual-line-mode is very useful to wrap lines with the window size changing without inserting any newlines. But in org-mode, it also wraps the headline and source blocks which is a little bit annoying....
28
votes
1answer
5k views

How can I replicate Vim's code folding?

Code folding in Emacs Sometimes I want to fold a block of text. In Vim you have easy folding without fuzz. Without to add any special characters like "markers" or specific regex like {{{. I would ...
28
votes
3answers
644 views

How can I print an Emacs frame?

The function ps-print-buffer-with-faces prints an Emacs buffer. Is there a way to print a frame with more than one buffer in it? I would like to print an Emacs calc frame both with the RPN stack and ...
27
votes
12answers
6k views

Organize the content of ~/.emacs.d/init.el and ~/emacs.d?

When we add more and more lines into ~/.emacs.d/init.el for various purposes (for python-mode, for emacs-eclim, for ...), the file becomes lengthy and less readable. Is there a way to help organize ...
27
votes
4answers
4k views

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

Is it possible to export content of subtrees without their headings?

I draft documents in org-mode and export them to LaTeX, HTML, etc. as needed. I frequently use the tag :no_export: whenever I don't want a certain subtree to show up in the output. What I also want ...
27
votes
3answers
5k views

What are the options to play music from within Emacs?

I have a bunch of music (.mp3) files on my disk, and I would like to play them from within Emacs. I tried EMMS, but it seems rather bloated. I'm curious about other possibilities, with comparison of ...
27
votes
5answers
7k views

How can I get fuzzy code completion

When using ReSharper in Visual Studio symbols can be auto-completed using fuzzy matching instead of prefix matching. For example if I'm looking for a function named DoSomethingAmazing I could write ...
27
votes
2answers
4k 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 * ...
27
votes
2answers
4k views

Do I still need GNU ELPA if I have MELPA?

This has always confused me, since people are saying that MELPA does have newer versions of packages, but it's not really clear, if GNU ELPA is just a subset of MELPA, or if I do need both? The ...
27
votes
2answers
4k views

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

Prebuilt Ubuntu Emacs “25.1”

Where can I find pre-built Emacs for what Ubuntu calls emacs 25.1?
26
votes
3answers
6k views

How to make Emacs render HTML without having to save the file?

If you have ever used JS Bin, you know that as you type your code (HTML, CSS, Javascript) on the right is updated to fit what you typed. I have found this to be one of the most useful tools for making ...
26
votes
5answers
16k views

How do I display line numbers in emacs (not in the mode line)?

I know how to display line numbers (and columns) in the mode-line, but I'd like emacs to display the line numbers for all the lines on the left-hand side. I've seen this done in vim and other text ...
26
votes
2answers
8k views

How can I discard changes to unstaged files using magit?

Is there a way to issue the command: git checkout NameOfFile on a modified and unstaged file from within MAGIT?
26
votes
2answers
4k views

New line in Title of an org-mode exported html document

I use org-mode to document stuff and usually export it to pdf (via latex) and html. If the \\ characters are at the end of a line, it forces a newline character when exporting to both pdf and html. ...
26
votes
4answers
4k views

How can I simulate an arbitary key event from Elisp?

Is it possible to simulate an arbitrary key event from elisp? I am aware of ways that I can find the binding for a given key, and then call that command interactively, but what if that key event is ...
26
votes
4answers
2k views

Editing files with one-sentence-per-line

A bit of background. I’m trying to version-control my latex documents, and the effectiveness of this initiative would be greatly improved if I adopt a one-sentence-per-line approach. For instance, ...
26
votes
2answers
9k views

exec-path and $PATH

I have seen examples online where people add paths to the default path in Emacs with: (add-to-list 'exec-path "/usr/local/bin/") I am new to Elisp, and I think I understand what the statement above ...
25
votes
5answers
34k views

How can I set default font in Emacs?

I can't set Inconsolata as default font in Emacs 24.4 Linux. I changed the font in the menu -> Save options. The font changed but after a restart the font is the same as it was by default. Added ...
25
votes
3answers
7k views

What's the difference between push and add-to-list?

I've found that different packages in their installation instructions use either push or add-to-list (For example adding a directory to load-path) and I was wondering what the difference is and what ...
25
votes
3answers
9k views

What is the easiest way to search all useful files inside a single project?

What is the easiest way to search for a regexp throughout the contents all files in the current project, skipping files that are not useful? Useless files are things like compiled files, imported ...
25
votes
3answers
3k views

What's the difference between the different vim implementations?

I'm aware of several different vim implementations in Emacs. There's evil-mode, viper, vimpulse and vim-mode. Are there others? How do they compare? I note that there are a lot of evil-* packages on ...
25
votes
4answers
2k views

How to auto-save buffers when Emacs loses focus?

I recently had a Sublime Text user try out Emacs for a while, and he was interested in getting the same auto-save behavior in Emacs. Basically, he wanted all buffers to be saved whenever the frame ...
25
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 ...
25
votes
3answers
4k views

How to change Emacs windows from vertical split to horizontal split?

Window A ++++++++ Window B Is there a way to switch to Window A : Window B Is there a way to switch view without closing windows?
25
votes
3answers
28k views

Where is official 64-bit Emacs for Windows? (The manual said there is!)

I usually download Emacs for Windows from the official GNU site: http://ftp.gnu.org/gnu/emacs/windows/ The latest version is: emacs-24.5-bin-i686-mingw32.zip I'm curious that why there's no 64-bit? ...
25
votes
1answer
589 views

What are all the ways of launching a shell from inside emacs and what are their various properties?

I know of at least four possibilities: eshell term ansi-term shell What's the complete list of tools built-in to emacs to launch a shell, and what benefits and drawbacks do they offer?
25
votes
2answers
4k views

Git rm from magit

This is a very basic but I have been unable to find the answer on the web. Is it possible to git rm, i.e. to remove a tracked file, from magit? Thanks
25
votes
2answers
2k views

Extending org-mode with more markups

I want to add a markup and formatting for such markup, i.e. <kbd>...</kbd> with a box surrounds such markup. I also want the mark up to be compatible with (setq org-hide-emphasis-markers t)...
25
votes
5answers
7k views

Emacsdaemon and Emacsclient on Mac

OS: OS X 10.9.5, Mavericks GNU Emacs 24.3.1 (x86_64-apple-darwin13.1.0, Carbon Version 1.6.0 AppKit 1265.19) of 2014-04-03 on Rainers-MacBook-Pro-3.local I installed emacs via homebrew from ...
24
votes
5answers
10k views

How to shift a selected area of text in Emacs by a certain number of spaces?

I am writing python code so shifting/moving blocks of lines is important to avoid going through each line individually. How can I do this without an add-on? Is there a type of operation keystroke ...
24
votes
4answers
2k views

How do I measure performance of elisp code?

How do I measure the performance of my elisp code? What tools / external packages are available for me to measure time taken? In addition to total time, can I see a profile that shows time taken per-...
24
votes
2answers
1k views

How to clear a cell in an org-mode table?

Is there a built-in command to delete the contents of a cell in a single keystroke within an org-mode table? Note, I don't want to delete the row, just the cell contents. | some text | ==> | ...
24
votes
2answers
4k views

Optional parameter defaults

Emacs Lisp does not have syntactical support for non-nil defaults of optional parameters. What is the recommended idiom for supplying these parameters? To clarify my point, here is one overly ...
24
votes
3answers
5k views

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 () ...
24
votes
2answers
2k views

Reset custom variable to default value programmatically

Q: Using Elisp, how can I reset a variable to its default value without knowing what that value is? I tried to figure out how to do this by bringing up the Customize interface for a variable I set to ...
24
votes
1answer
2k views

How to stash individual files with magit

git is capable of stashing of individual hunks. With --patch, you can interactively select hunks from the diff between HEAD and the working tree to be stashed. The stash entry is constructed such ...
24
votes
2answers
1k views

Can functions access their name?

In C there is the magic variable __func__ that holds the current function name. In Bash, there is an array FUNCNAME holding the names of all functions in the calling stack !!! Is there a similar ...
24
votes
1answer
2k views

What algorithm does sort use?

I need to add a single integer to a list that's already sorted, such that it goes in the right place. My first tought was something like (sort (cons newelt list) #'<) However, given that list is ...
24
votes
1answer
763 views

How can I quickly toggle between a file and a *scratch* buffer having the same major mode?

At times while working on a code, it's useful to quickly open a *scratch* buffer to paste a snippet from that code file. If I am working on a Perl script, I would like to quickly open a *scratch* ...
24
votes
6answers
2k views

Opposite of fill-paragraph

Emacs has the function fill-paragraph. Is there any function which will do the opposite of that? I have a paragraph which is already filled and instead I want it in a plain single line?
24
votes
3answers
4k views

How do I make pressing <RET> in helm-find-files open the directory?

When I run #'helm-find-files, and move point to a directory, pressing <ret> results in opening that directory in dired mode. One has to press C-j to enter that directory in Helm. I'd like to ...
24
votes
1answer
3k views

Set the background of org-exported <code> blocks according to theme

I export org-mode files quite often, and almost all of them have code in them. When I do export code, it ends up coloring the text depending on my theme, however, I switch between a dark theme and a ...
23
votes
2answers
4k views

How to check in elisp if a string is a substring of another string?

How to check if a string s1 is a substring of another string s2? For example (test-substring "f t" "df tj") --> t, (test-substring "ft" "df tj") --> nil.
23
votes
5answers
2k views

Re-open *scratch* buffer

If I accidentally closed the scratch buffer in Emacs, how do I create a new scratch buffer?
23
votes
5answers
4k views

Show org-mode hyperlink as plain text

Although it is convenient how org-mode shows hyperlinks, there are times when I want to see the underlying plain text, e.g. [[./file.org][Title]]. How can I do this? I know about org-insert-link, but ...

15 30 50 per page