Most Popular

1500 questions
40
votes
3 answers

How to set up elpy to use python3?

When setting up my emacs for a new work environment, I am unable to get the elpy configuration to correctly use python 3. I have installed all of the required packages in /usr/local/bin and have installed them using python3. Right now, when I run…
adam
  • 501
  • 1
  • 4
  • 3
40
votes
2 answers

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 explicit way of doing so. (defun command (a &optional…
Matthew Piziak
  • 6,038
  • 3
  • 31
  • 79
39
votes
3 answers

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 the use case for each would be.
shadowthief
  • 393
  • 1
  • 3
  • 5
39
votes
2 answers

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.
Eleno
  • 1,448
  • 11
  • 17
39
votes
2 answers

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 p I to invalid the cache, but that didn't work.…
Daniel Wu
  • 1,751
  • 2
  • 17
  • 26
38
votes
3 answers

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. So here comes my question: How can I turn off…
Leu_Grady
  • 2,460
  • 1
  • 19
  • 28
38
votes
3 answers

Wrap cell content in an org mode table

I have a table like this: | Verse No | Verse | | | <10> | | 1 | line1 li=> | | 2 | line2 li=> | I would like to view it as | Verse No | Verse | | | <10> | | 1 | line1 line | | |…
user2740
  • 579
  • 1
  • 5
  • 10
38
votes
6 answers

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.emacswiki.org/RecentFiles : (defun undo-kill-buffer…
CodyChan
  • 2,649
  • 1
  • 21
  • 35
38
votes
4 answers

How to switch off the sounds?

Those sounds all the way drive me crazy, but it is uncomfortable to switch off system sounds at all because I need them in other places same time. I didn't find any settings where I could manage the sounds.
Anna Leonenko
  • 483
  • 1
  • 4
  • 7
38
votes
3 answers

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.
Name
  • 7,849
  • 4
  • 41
  • 87
38
votes
2 answers

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 reason why I'm asking is that I'm experimenting with my…
Jakub Arnold
  • 491
  • 1
  • 4
  • 6
37
votes
5 answers

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 keypresses in Emacs? Is there any elisp packages or…
dgtized
  • 4,199
  • 21
  • 41
37
votes
3 answers

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 for Emacs? I don't really care about the…
Ken
  • 371
  • 3
  • 3
37
votes
5 answers

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 longer using git-grep, ack, or ag and switching to use…
dgtized
  • 4,199
  • 21
  • 41
37
votes
3 answers

How do I checkout a file from another commit in Magit

I've got a file foo.txt in branch A, and I want to check out foo.txt from branch B into the index. On the command line, I would do this: $ git checkout B -- foo.txt I want to be able to do this in magit by going to log, finding the commit I'm…
Emoses
  • 593
  • 5
  • 8