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
15
votes
2 answers

How do you move the pointer up or down multiple lines with Emacs?

I can move my pointer up and down one line with my arrow key just fine in Emacs, so I'd like to redefine C-n and C-p to move up and down 5 lines at a time. I'm just beginning to learn how to use Emacs, and elisp is very alien to me. I tried using…
Peter Ajtai
  • 56,972
  • 13
  • 121
  • 140
15
votes
1 answer

Code folding for LaTeX in Emacs

Is there an Emacs minor-mode (or piece of elisp code) that lets you selectively hide/show environments while in LaTeX mode? For instance, I would like to move to the beginning of a long \begin{figure} block, hit a keystroke, and have the contents of…
ShreevatsaR
  • 38,402
  • 17
  • 102
  • 126
15
votes
7 answers

Lisp Community - Quality tutorials/resources

As many other people interested in learning Lisp, I feel the resources available are not the best for beginners and eventually prevent many new people from learning it. Do you feel it could be created some sort of community, with a website, forum or…
Rui Costa
  • 167
  • 4
15
votes
3 answers

Customize Elisp plist indentation

I don't like how plists are indented in Elisp. ;; current desired Python (for comparison) ;; '(a 1 '(a 1 {'a': 1, ;; b 2 b 2 'b': 2, ;; c 3) c 3) 'c': 3} Tried on M-x emacs-version 24.3.1, ran emacs -Q, typed the…
Mirzhan Irkegulov
  • 17,660
  • 12
  • 105
  • 166
15
votes
6 answers

Emacs Lisp: How to add a folder and all its first level sub-folders to the load-path

If I have a folder structure set up like this: ~/Projects emacs package1 package1-helpers package2 package2-helpers package2-more-helpers package3 package3-helpers How do I…
Alexander Kojevnikov
  • 17,580
  • 5
  • 49
  • 46
15
votes
2 answers

Is there any way to automatically close filename completetion buffers in Emacs?

For example, when you open a file via C-x-C-f, you can TAB complete file names, and if there are more than one possible completions, it will pop open a completion buffer with a list of possible completions. The problem is, after you've opened the…
Rayne
  • 31,473
  • 17
  • 86
  • 101
15
votes
4 answers

Is there a way to install ELPA packages from command line?

I'm interested in standardizing the emacs configurations that a few of us use (~5 people). Is there a way to install ELPA packages from lisp functions that can be included in a script if we know the set of packages we want? All I can find is how to…
hatmatrix
  • 42,883
  • 45
  • 137
  • 231
15
votes
2 answers

Getting Emacs to respect my default shell + options

I'm trying to get my Emacs shell to mimic that of my standard terminal sessions. Basically I would like it to respect the same PATH as well as the command prompt. So far I have a few issues: PATH isn't found, below is the fix I'm using for…
mwilliams
  • 9,946
  • 13
  • 50
  • 71
15
votes
4 answers

How to create an empty file by elisp?

I set an explicit file to customization created via the UI. It's named custom.el. Currently, I use the followed snippets to create this file if not exist. (defconst custom-file (expand-file-name "custom.el" user-emacs-directory)) (unless…
hbin
  • 2,657
  • 1
  • 23
  • 23
15
votes
2 answers

emacs: close buffers list on selection

Is there a configuration hook to make the "Buffers List" buffer automatically closing when a buffer is selected in such window? Each time the buffer list opens and I select a buffer I have to manually close it using C-x C-k and this is annoying,…
fluca1978
  • 3,968
  • 2
  • 15
  • 15
15
votes
2 answers

Relationship between Emacs functions and commands

From what I understand, in Emacs I can run commands such as M-x (which by the way I believe stands for execute-extended-command). This command M-x itself is used to run things like customize_face e.g. by typing M-x customize-face in the minibuffer.…
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
15
votes
2 answers

Command to center screen horizontally around cursor on emacs?

I'm familiar with and use very frequently the C-l (recenter-top-bottom) to Move current line to window center, top, and bottom, successively. I'd like to have an equivalent command to move the current column to window center, left and right…
agentofuser
  • 8,987
  • 11
  • 54
  • 85
14
votes
2 answers

Emacs: menu-bar-mode and tool-bar-mode automatically set to t

I have compiled and built Emacs24 on my system. After that, some of my .emacs customizations have stopped working. The most important problem is this: I have set menu-bar-mode and tool-bar-mode to nil. ;;; No Menu Bar (menu-bar-mode nil) ;;; No tool…
user916315
  • 1,017
  • 2
  • 9
  • 13
14
votes
3 answers

How can I tell in elisp if Emacs is using X?

I have some items in my .emacs that I don't want to run if I ran emacs -nw. How can I tell in elisp if that is the case? (edited to change -nox to -nw --- where was my brain?)
JasonFruit
  • 7,764
  • 5
  • 46
  • 61
14
votes
7 answers

How can I spot subtle Lisp syntax mistakes?

I'm a newbie playing around with Lisp (actually, Emacs Lisp). It's a lot of fun, except when I seem to run into the same syntax mistakes again and again. For instance, here's something I've encountered several times. I have some cond form,…
Marius Andersen
  • 902
  • 7
  • 12