All Questions

Filter by
Sorted by
Tagged with
28
votes
12answers
7k 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 ...
28
votes
7answers
2k views

Is there a simplified version control system appropriate for non-coders writing in Emacs?

I an academic and I love to do as much of my writing as possible in Emacs. A key thing that is missing for me is the ability to easily review the changes I have made to a text file over time. The ...
28
votes
5answers
37k 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 ...
28
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 * ...
28
votes
2answers
5k 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 ...
28
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-...
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
2answers
10k 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 ...
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
652 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
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
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-...
27
votes
4answers
10k 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 ...
27
votes
2answers
9k 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?
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
2answers
5k views

What's the difference between a buffer, a file, a window, and a frame?

When posing questions on this site, people sometimes talk about "windows" when they mean "frames," and "buffers" or "files" when they mean "windows." So: Q: What is the difference between a buffer, ...
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
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, ...
27
votes
2answers
3k views

Reloading directory-local variables

How do you reload directory-local variables? I would like to modify a .dir-locals.el and have such changes applied to the current Emacs session.
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
5answers
11k 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 ...
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
18k 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
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 ...
26
votes
2answers
5k 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 ...
26
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 ...
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
3answers
5k 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?
26
votes
2answers
5k 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
26
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
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
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
5answers
4k views

How can I get an org-mode outline in a 2nd buffer as a dynamic table of contents?

When I edit large documents, I would like to see where I'm at by seeing the outline (with no-content) in a separate buffer. Like when you read a PDF file there is a TOC on the left. (see below) In ...
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
606 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
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 ...
25
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?
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
6answers
6k views

Switching between window layouts

When I configure a custom layout and then just need to temporary look into one file fullscreen and once I want that layout back - I need manually to reflow it. I would like a plugin/elisp code to ...
24
votes
2answers
5k 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.
24
votes
2answers
2k 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
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 ...
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
5answers
2k views

Re-open *scratch* buffer

If I accidentally closed the scratch buffer in Emacs, how do I create a new scratch buffer?
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 ...

15 30 50 per page