Most Popular

1500 questions
25
votes
1 answer

Elisp for applying command to only the selected region

Say, I have some code like this: (defun some-function () (interactive) ;; do something ) Now I want some-function to operate only on the selected region in the buffer ? How can I do that ? Also, can there be two separate code path for doing…
Sibi
  • 3,603
  • 2
  • 22
  • 35
25
votes
7 answers

Emacs and command line $PATH disagreements on OSX

Having some issues with PATH settings on Emacs that are affecting my Haskell environment: I'm using ZSH, and when I go to the command line and call echo $PATH, it returns:…
Galder Zamarreño
  • 1,527
  • 2
  • 12
  • 21
25
votes
5 answers

Browser-style 'tabs' for emacs?

I would like tabs like firefox but for emacs. I found this: http://emacswiki.org/emacs/TabBarMode But it just add to each buffer (window in Emacs terminology) a bar that shows currently open buffers. I would like a tab to be able to hold multiple…
Leo Ufimtsev
  • 4,488
  • 3
  • 22
  • 45
24
votes
6 answers

Get all regexp matches in buffer as a list

On the Code Golf Stack Exchange site today, I found this answer in Clojure to the question "Get all links on a webpage". (->> (slurp "http://www.stroustrup.com") (re-seq #"(?:http://)?www(?:[./#\+-]\w*)+")) Without the fancy macro, it's just…
nanny
  • 5,704
  • 18
  • 38
24
votes
3 answers

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 that other settings don't get applied over the…
nispio
  • 8,175
  • 2
  • 35
  • 73
24
votes
1 answer

Curiosity: What does progn stands for?

According to Emacs documentation: progn is a special form in `C source code'. (progn BODY...) Eval BODY forms sequentially and return value of last one. What does progn stands for (or its origin)? Useage: Is it equivalent to Clojure's -> macro?
Nick
  • 4,423
  • 4
  • 24
  • 41
24
votes
2 answers

Is there any way to order helm results by commonly used?

It seems that the order of helm results is never useful... I either have to navigate through the long list or keep typing until I've narrowed the list enough. Is there any way to sort the results in order of usage frequency? Edit: That is, the most…
aiguofer
  • 588
  • 3
  • 14
24
votes
2 answers

How to view and edit pdf files in emacs?

I heard that we can view pdf files in emacs. Is it done by converting pdf files to plain texts first? Can we view pdf files at its fullness in emacs? can we edit pdf files in emacs? Thanks.
Tim
  • 4,987
  • 7
  • 31
  • 60
24
votes
1 answer

What piece of code in Emacs makes `line-number-mode` print "??" as line number in buffers with long lines?

I'm using line-number-mode to have an indicator of the current line in my modeline, however for large files or rather, files with long lines, it starts displaying two question marks instead of a line number. I've digged a bit and found out that…
wasamasa
  • 21,803
  • 1
  • 65
  • 97
24
votes
2 answers

How to specify default header arguments in orgmode code blocks

I'm tying to set default header arguments to the code blocks within my org file, like this: #+PROPERTY: header-args :session *my_python_session* #+PROPERTY: header-args :results silent #+PROPERTY: header-args :tangle yes My code blocks look like…
andreas-h
  • 1,559
  • 13
  • 22
24
votes
5 answers

Emacs Blue color too dark

Emacs blue (on dark background) is too dark. classA is readable with difficulty in the example below: How to fix the dark blue colour?
Viesturs
  • 805
  • 8
  • 19
24
votes
3 answers

orgmode agenda view doesn´t display any results

I´m new to emacs and especially org-mode, and I am testing it´s different possibilies. When trying the schedule-function with TODO, I don´t get any results displayed in the weekly or daily list. * TODO Get schwifty SCHEDULED: <2017-09-03 So> I…
Kubo
  • 375
  • 2
  • 6
24
votes
3 answers

How can I get undo behavior in Evil similar to Vim's?

The default undo behavior in Evil is too coarse-grained because it considers anything taking place between entering insert mode and leaving it as one edit operation. When you enter a whole paragraph of text during one insert and then execute undo,…
tmalsburg
  • 2,540
  • 1
  • 14
  • 29
24
votes
1 answer

What am I giving up by activating CUA mode?

CUA mode is very close to the workflow I am used to outside Emacs, so I am tempted to activate it. But I have learned that Emacs may have useful gems hidden in its ways, and CUA mode seems something that was attached later on. I know the benefits of…
gsl
  • 1,742
  • 17
  • 34
24
votes
3 answers

How to choose between nil and 0, or t and 1 when setting variables or enabling modes

I understand that nil, 0 and/or -1 are used for disabling some features and t, 1 and/or +1 are used for enabling some features. When assigning variables or enabling/disabling minor modes, which should I choose? I have seen all of these variations…
greduan
  • 343
  • 2
  • 6