Questions tagged [elisp-conventions]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
47 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 ...
1
vote
1answer
38 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 ...
2
votes
1answer
21 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 ...
2
votes
1answer
127 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 ...
3
votes
2answers
74 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 ...
4
votes
1answer
387 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 ...
17
votes
2answers
2k 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 ...