Questions tagged [elisp]

Emacs Lisp is the extension language for the GNU Emacs text editor, and in fact, most of the functionality of Emacs is implemented using Emacs Lisp. Users generally customize Emacs' behavior by adding Emacs Lisp statements to their `~/.emacs`, or writing separate packages.

Emacs Lisp is the extension language for the GNU Emacs text editor, and in fact, most of the functionality of Emacs is implemented using Emacs Lisp. Users generally customize Emacs' behavior by adding Emacs Lisp statements to their ~/.emacs or ~/.emacs.d/init.el file, or writing separate packages. A guide to learning Emacs Lisp for non-programmers can be found here.

Emacs Lisp differs from most other lisps in two main ways:

  1. It has special features for scanning and parsing text, as well as features for handling files, buffers, arrays, displays, and subprocesses. This is due to the fact that it is designed to be used in a text editor.
  2. It uses primarily dynamic scope as opposed to lexical scope. This was done very intentionally, the reasons are well explained in the 1981 paper on Emacs. Lexical scope has been introduced only recently and, while not yet widely adopted, is expected to become increasingly important in future versions according to the manual.

Wisdom from the Stack

Emacs on Stack Exchange

3773 questions
16
votes
3 answers

[org-mode]: repeating task in every Mon, Wed, Fri at 18:00, need help with sexp

As I had written in title, I need a little help with improvement of this sexp: * TODO remeber about thingie. SCHEDULED: <%%(or (= 1 (calendar-day-of-week date)) (= 3 (calendar-day-of-week date)) (= 5…
zeroDivisible
  • 4,041
  • 8
  • 40
  • 62
16
votes
2 answers

Elisp: How to save data in a file?

I want to save data to a file in my elisp program. I have a multi-dimensional list that I want to save to a file, so I can restore it the next time my program runs. What's the easiest / best way to do this? I realise, of course, that I can simply…
Enfors
  • 960
  • 2
  • 14
  • 25
16
votes
3 answers

How to turn off electric-indent-mode for specific Major mode?

I have few Major modes (like: Yaml and NXML) that I don't want electric-indent-mode (I want it for C like languages) but I'm unable to turn if off. To enable I have: (electric-indent-mode 1) from documentation (for variable…
jcubic
  • 61,973
  • 54
  • 229
  • 402
16
votes
6 answers

Troubleshooting techniques for Emacs and Emacs Lisp

I've been a fairly regular emacs user for about 4 years, but I'm still a newbie when it comes to customizing emacs and troubleshooting elisp. Recently, I've started customizing emacs as my ruby development environment and I've learned a few…
Rohith
  • 2,043
  • 1
  • 17
  • 42
16
votes
6 answers

maintaining multiple emacs configurations at the same time

I want to maintain multiple emacs configurations like emacs-prelude, emacs-starter-kit, and my own custom emacs configuration simultaneously on same user account on same pc. for that i have setup directories like .emacs1.d, .emacs2.d,…
Archit
  • 913
  • 1
  • 10
  • 20
16
votes
3 answers

Why does an elisp local variable keep its value in this case?

Could someone explain to me what's going on in this very simple code snippet? (defun test-a () (let ((x '(nil))) (setcar x (cons 1 (car x))) x)) Upon a calling (test-a) for the first time, I get the expected result: ((1)). But to my…
abo-abo
  • 20,038
  • 3
  • 50
  • 71
16
votes
2 answers

Emacs - Using "Select All" in Function (how to find the function bound to a key)

I'm trying to figure out Elisp, and I've hit a roadblock. I want a function that will Indent the entire file. Right now, I'm selecting the whole file (C-x h) and then doing M-x indent-region (which does have a shortcut key). I'd like to combine…
MattBelanger
  • 5,280
  • 6
  • 37
  • 34
16
votes
2 answers

Assign IDs to every entry in Org-mode

Org-mode has a bundled extension called org-id, that implements global unique IDs for org-mode files. Every entry (a headline with its body) can have an ID property in its :PROPERTIES: drawer. New ID for a single entry can be assigned with a…
Mirzhan Irkegulov
  • 17,660
  • 12
  • 105
  • 166
16
votes
12 answers

Do you have a mnemonic for remembering the meaning of car and cdr?

Most of my Lisp experience comes from Elisp. As such, I find myself writing Lisp only on occasion. By the time I come back to it, I often forget the difference between car and cdr and need to reference the docs to jog my memory. What kinds of…
Ryan McGeary
  • 235,892
  • 13
  • 95
  • 104
16
votes
2 answers

Emacs: How can I eliminate whitespace-mode in auto-complete pop-ups?

Here is a screenshot of what is going wrong: As you can see, the whitespace characters are getting in the way of auto-complete's pop-up text and making things look really terrible. When really, I'd like it to look like this: Is there anyone out…
emish
  • 2,813
  • 5
  • 28
  • 34
16
votes
4 answers

Are there any emacs key combinations reserved for custom commands?

If I want to create a custom key combination to run a command, are there any keyboard shortcuts reserved for this? I always find it difficult to decide on which shortcut to override because I'm not sure what commands I shouldn't override and which…
Jason Baker
  • 192,085
  • 135
  • 376
  • 510
16
votes
2 answers

Make a key behave as another key

I want certain keys and key combinations to behave as other keys or key combinations in Emacs. For example, I want F5 to behave as a substitute for C-c for every possible combination involving it, or C-S- as C-. Is it possible to do that without…
Mirzhan Irkegulov
  • 17,660
  • 12
  • 105
  • 166
16
votes
3 answers

Org-mode: embed links to info files

I maintain a diary (internal blog containing thoughts to remember) in org-mode, and sometimes, as i study Emacs, i store learned skills and tricks with references to info files. Currently i do the following. I open the needed info file, press c to…
Mirzhan Irkegulov
  • 17,660
  • 12
  • 105
  • 166
16
votes
5 answers

What is the best YAML parser in elisp?

I want to read config in YAML with elisp code. Searched but didn't find ready-to-use parser in elisp. Did I miss something useful?
Vivodo
  • 1,542
  • 2
  • 17
  • 31
15
votes
2 answers

Emacs: how to find a variable by its value?

I have some value and know that some Emacs variable holds it. How to find, which variable has this value in it? The value can be a symbol, integer or string, and the variable may hold the value itself, but a list which contains a value. Example. A…
Mirzhan Irkegulov
  • 17,660
  • 12
  • 105
  • 166