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 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

18 questions
7
votes
1 answer

Defining key sequences in Evil-mode Emacs

I couldn't find any instructions on defining key sequences in the Evil doc. The example given by the developers only covers a single key. (define-key evil-normal-state "w" 'foo) What do I need to do, if I want to define "gv" in the normal mode or…
Mark T.
  • 73
  • 1
  • 3
5
votes
2 answers

Emacs: mute messages ("echo area")

I do lots of automatizing in Emacs, by stacking commands that I know from using manually. That is a method I recommend, because it doesn't take much effort: you use Emacs as you ordinarily would, and now and then it pops to your head, "hey, I'm…
Emanuel Berg
  • 6,763
  • 7
  • 43
  • 65
4
votes
3 answers

Emacs - Changing show-paren-mode Areas

I like show-paren-mode in Emacs, but I would really like to change the highlighting behavior for closing brackets. That is, I want the opening bracket to be highlighted when the point is on the closing bracket. The default behavior highlights the…
user22531
3
votes
1 answer

How to attach elisp function source code in Emacs?

I could use M-x find-function to find the source code of some elisp functions if the function is not written in C code. But since I am using a Debian binary package of Emacs , some of the source code is omitted and only the byte-compiled .elc files…
Hongxu Chen
  • 5,828
  • 8
  • 27
  • 32
3
votes
1 answer

Hide "Mail" in emacs mode line

This is small stuff but I haven't been able to figure it out: How do I hide "Mail" from the mode line in emacs?
MajorBriggs
  • 1,191
  • 5
  • 12
  • 23
2
votes
1 answer

How do I skip special buffers when killing the current buffer?

I have some code in my .emacs that prevents it from showing some pre-defined special buffers when I'm using previous-buffer and next-buffer: (defadvice next-buffer (after avoid-messages-buffer-in-next-buffer) (when (string= "*Messages*"…
Stefano Palazzo
  • 608
  • 6
  • 20
2
votes
0 answers

Why isn't Gnus scoring emails based on the To: or Cc: headers?

I use Gnus v5.13 in GNU Emacs 24.1.1 to read my email, and I'm having a trouble getting a simple score file to work. Essentially, I want any mail that's sent to (or copies) a particular email address to be given a higher score. My example score…
Mark Longair
  • 121
  • 3
2
votes
1 answer

Emacs: query-replace, regular expression, reuse of search result

How do I combine something like query-replace with a regular expression search-and-replace that in part reuses the search result? In my case, how to transform The programmers are "sort of" confident that the subroutines "load_students" and…
Emanuel Berg
  • 6,763
  • 7
  • 43
  • 65
2
votes
1 answer

In terminal, I can search to end of log faster than the data gets there

[The Question] Is there some way to have the pipe/tee/write combo write lines immediately? ... if it can be done, what is the trade-off? [The Backdrop] My script sends a keypress to the terminal, which is running app. That keypress causes app to…
Peter.O
  • 32,426
  • 28
  • 115
  • 163
2
votes
1 answer

Color of emacs margins

With the following in my .emacs I get narrow margins in text-mode buffers: (defun my-set-margins () "Set margins in current buffer." (setq left-margin-width 30) (setq right-margin-width 30)) (add-hook 'text-mode-hook 'my-set-margins) How can…
MajorBriggs
  • 1,191
  • 5
  • 12
  • 23
1
vote
1 answer

Emacs: mode-local macro with dashes and dots

In Emacs, how can I make a macro, that is local to the HTML mode, and uses dashes and dots? Take a look at the Elisp below: (define-abbrev-table 'html-mode-abbrev-table '(("..." "…") ; won't work ("---" "—") ; won't work …
Emanuel Berg
  • 6,763
  • 7
  • 43
  • 65
1
vote
1 answer

emacs change point color to current foreground

I'm trying to customize my emacs so that the point color is the same as the foreground on of the character I'm standing on. I have this now: (defun fixpoint () "awesome stuff happening to point" (interactive) (set-cursor-color…
Silverrocker
  • 1,815
  • 1
  • 15
  • 23
1
vote
1 answer

Emacs function on set of files

Is there a way implemented in Emacs to apply a function on a set of files? (Or, if not, do you know of such an extension?) For example, if you have a project in a directory (say, scripts to compile and run, the source, and an XML database). You want…
Emanuel Berg
  • 6,763
  • 7
  • 43
  • 65
0
votes
1 answer

How do I set key binding for set mark in emacs?

I'm new to emacs and newer to lisp I'm trying to set Meta + spacebar to set the mark for highlighting text (at current cursor position). searching around online and experimenting I've ended up with the command (global-set-key (kbd "M-SPC")…
user1854496
  • 133
  • 6
0
votes
1 answer

Colorful notes in emacs

Similar to org mode, for taking colorful notes in Emacs, I would like to define some special characters (used in the beginning of the lines) to tell Emacs which colors (foreground/background) should be used for highlighting the entire current line.…
askman
  • 33
  • 1
  • 1
  • 4
1
2