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
3
votes
3 answers

Configuring a Yasnippet for two scenarios -- (1) region is active; (2) region is not active

In conjunction with a user-configuration of (delete-selection-mode 1), is there a way to consolidate the two following Yasnippets into just one snippet so that it will work differently depending upon whether the region is active. For example: (if…
lawlist
  • 13,099
  • 3
  • 49
  • 158
3
votes
5 answers

Lisp location in emacs

Where can I find the all Emacs' elisp scripts? I don't mean scripts users developed or installed themselves, but the common elisp script already there. For example, if I have a function like describe-char or insert-file, how can I find the file…
Pierre B
  • 654
  • 2
  • 6
  • 15
3
votes
1 answer

Package load problems with el-get installed emacs-jedi

I've followed these instructions with el-get to try to install emacs-jedi (and the other needed packages), but no luck. In my .emacs file, I've added the following lines: ;; .emacs ;; Load package repositories (require 'package) (add-to-list…
ely
  • 74,674
  • 34
  • 147
  • 228
3
votes
7 answers

Recursively splitting a list into two using LISP

Using LISP, i need to create a function that splits a list into two lists. The first list consists of 1st, 3rd, 5th, 7th, etc elements and the second list consists of 2nd, 4th, 6th, etc elements. Output Examples: (SPLIT-LIST ( )) => (NIL…
shle2821
  • 1,856
  • 1
  • 19
  • 26
3
votes
2 answers

Elisp: make symbol-function return the source?

Here's the setup: (defun square (x) (* x x)) ;; square (symbol-function 'square) ;; (lambda (x) (* x x)) (byte-compile 'square) ;; #[(x) "\211_\207" [x] 2] (symbol-function 'square) ;; #[(x) "\211_\207" [x] 2] Is there a way to get the source…
abo-abo
  • 20,038
  • 3
  • 50
  • 71
3
votes
3 answers

Passing a function to a parameter in elisp

I added the following code to my .emacs file. (defun delete-right-window () (interactive) (windmove-right) (delete-window)) (defun delete-left-window () (interactive) (windmove-left) (delete-window)) (defun delete-below-window () …
ntalbs
  • 28,700
  • 8
  • 66
  • 83
3
votes
2 answers

EMACS: Auto run a function when open a new buffer

How can I auto run a function when open a new buffer, say text-scale-adjust.
Truong Ha
  • 10,468
  • 11
  • 40
  • 45
3
votes
3 answers

How to add a ℃ in org-mode which can be correctly exported to latex

I tried sometimes and realized that exporter can recognize $1100^{\circ}C$ and 1000^\circ, but can not recognize 1000^\circC and 1000^\circ C correctly, so which is the best way to add a ℃? I would not like to use $1100^{\circ}C$, because it need to…
Leu_Grady
  • 498
  • 3
  • 15
3
votes
2 answers

Weird escape sequences in Emacs elisp backtrace

When I use toggle-debug-on-error, and look at the backtrace generated in a Backtrace buffer, there are lot's of key-escapes that don't seem like they should be there, example: Debugger entered--Lisp error: (invalid-read-syntax "#") read(#
Stian Håklev
  • 1,240
  • 2
  • 14
  • 26
3
votes
3 answers

Elisp: any disadvantages of using put/get instead of defvar?

I have a function that moves to the end of line, but when already at end of line, moves back to the last point where it was called before. This requires the value of that last point to be stored somewhere. Currently I'm storing this point in e.g…
abo-abo
  • 20,038
  • 3
  • 50
  • 71
3
votes
1 answer

Elisp defadvice around clarification

Documentation for defadvice says: around-advice is wrapped around the execution of the function This explanation is not clear to me. So I decided to test, how it works, using this code: (defun fun () (message "hi")) (fun) (defadvice fun (around…
user4035
  • 22,508
  • 11
  • 59
  • 94
3
votes
1 answer

Make Emacs eshell / echo newlines behave like in a regular terminal

I noticed that when you ask, say, echo to not output the trailing newline in an Emacs eshell, it still does add it. For example, from Bash: $ echo -n "a" | sha1sum 86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 - From Emacs' eshell: $ echo -n "a" |…
3
votes
1 answer

Does emacs offer hide show for html mode

Does emacs have a hide-show code fold-ability for html? I have it when I'm using org mode, but can't seem to find it on the nXML/html side.
user97954
  • 121
  • 5
3
votes
1 answer

What do you put in your standard etags --regex=.. calls?

When I write some elisp code for a new Emacs "foo-mode" that contains a line like (fset 'foo (if safe-mode 'fast-over-open-gently 'fast-over-open-everything-and-not-care))) and later index the code with etags foo-mode.el, etags will not index the…
phs
  • 541
  • 3
  • 18
3
votes
2 answers

Emacs and jump between repositories

I'm now using the awesome package "find-file-in-repository" to jump between files in different repositories, using ido to smartly complete the file path. However one problem that I'm facing is that I constantly work on maybe 10 different…
andrea_crotti
  • 3,004
  • 2
  • 28
  • 33
1 2 3
99
100