Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [elisp-conventions]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
20 views

Can packages rebind keys globally?

I observe a strange behavior in "my" emacs. For some reason the <next> (aka pgdn) key and the <prior> (aka pgup) key are bound to (pager-page-up) and (pager-page-down), ...
Christian Herenz's user avatar
0 votes
1 answer
48 views

Is there a keybind prefix that is reserved for personal use?

I always was apprehensive about defining custom keybindings because it's so easy to run into conflicts. And lo, when I finally bound org-agenda because it's just too useful not to have it bound, I run ...
Reverent Lapwing's user avatar
7 votes
7 answers
2k views

elisp: Why does + without parameters return 0?

In elisp + function without parameters gives 0, (+) ==> 0. * function without parameters give 1: (*) ==> 1. Only (/) gives error: wrong number of arguments. But in Python entering + without ...
zeynel's user avatar
  • 371
2 votes
1 answer
135 views

Composing Prefix Commands

There are several commands in Emacs that work as prefixes to other commands, changing the behavior of the next command in some way. The most well-known example is the commands that set up the "...
mtraceur's user avatar
  • 356
4 votes
1 answer
145 views

Buffer Name Surrounded by Asterisks (*)

For example, *scratch*, *Messages*. Is this some kind of convention? If so, what does it mean?
shynur's user avatar
  • 5,318
4 votes
1 answer
168 views

“Obarray” Got Its Name From ...?

What does the name “obarray” stand for? Obarray seems to be a property unique to Elisp that is not found in other Lisp-like languages. So its name probably came up with by the early Emacs developers;...
shynur's user avatar
  • 5,318
4 votes
1 answer
82 views

Idiomatic way to access values of an alist

The theme modus-vivendi exports an alist of named colors: (deftheme modus-vivendi "Elegant, highly legible and customizable dark theme. Conforms with the highest legibility standard for color ...
firstname gklsodascb's user avatar
4 votes
1 answer
472 views

Why do people add their initials to the names of tailor-made functions added to their config file?

Is it a namespace trick to prevent future problems? I noticed a pattern in the Emacs community. When people create some tailor made function and insert it on their init files, they use a convention on ...
Pedro Delfino's user avatar
7 votes
2 answers
1k views

Underscore in if-let

I often find myself wanting to do something like this: (if-let* ((foo (get-foo)) (_ (conditionp foo)) (bar (get-bar-from-foo foo))) ...) As an alternative to: (let ((foo (get-...
C4ffeine Add1ct's user avatar
0 votes
2 answers
188 views

Idiomatic conversion of non-nil to explicit t

Is there an idiomatic/commonly used/established convention to convert non-nil values to t that other Elisp programmers are likely to recognize? Sometimes I have a non-nil value, say from calling ...
chwarr's user avatar
  • 105
2 votes
1 answer
33 views

Giving faces compliant names

The description of defface in (info "(elisp) Defining Faces") says that the name of a face should not end in -face. But most faces declared in font-lock.el do use the suffix -face. How does this fit ...
Andreas Matthias's user avatar
2 votes
1 answer
77 views

How to automate user-testing with elisp?

Is it possible to automate testing user input? An example of this could be multiple editing operations, undo, saving, reverting the buffer etc. Then checking the buffer contents is what the test ...
ideasman42's user avatar
  • 8,826
4 votes
1 answer
1k views

Difference between pcase-let & cl-destructuring-bind?

I noticed both pcase-let and cl-destructuring-bind seem to perform the same operation. Is there any difference or reason to use one instead of the other? eg: (pcase-let ((`(,filename ,buf) (pop ...
ideasman42's user avatar
  • 8,826
3 votes
2 answers
131 views

When writing a new major mode, should it add itself to auto-mode-alist?

I am defining a new major mode, foo-mode, which is closely and only associated with .foo files. Should foo-mode.el fiddle with auto-mode-alist to add this association, or is that the user's ...
Jack Kelly's user avatar
6 votes
1 answer
1k views

Double hyphen in Elisp function names

Why do some people use -- in their function names? Here's an example from elfeed-search.el: (defun elfeed-search--header () "Returns the string to be used as the Elfeed header." (if (eql (car ...
american-ninja-warrior's user avatar
20 votes
2 answers
4k views

Convention about using C-x or C-c as prefix keys

What are the conventions for using C-x, C-c, or M- as prefix keys? For example: is C-x, etc., for saving or visiting buffers? Is C-c, etc., for text editing? Background Maybe this is a silly ...
anquegi's user avatar
  • 749