We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [coding-conventions]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
106 views

Are super and hyper key modifier permitted in major/minor modes?

I looked to (info "(elisp)Key Binding Conventions") and (info "(elisp)Keymaps and Minor Modes") and (info "(elisp)Major Mode Conventions") and didn't found any restriction to use H- and s- modifier in ...
6
votes
2answers
1k views

add-to-list vs add-hook?

What is the difference between add-to-list vs add-hook? For example I see in progmodes/make-mode.el: (add-hook 'completion-at-point-functions #'makefile-completions-at-point nil t) ...
3
votes
2answers
112 views

When to return nil vs. signal error?

This may be a more general programming question that just for Emacs Lisp, but I'm wondering when a function should signal an error vs. return nil. Raising an error is "failing loudly", which is ...
8
votes
2answers
2k views

Why does `eval-when-compile` run at file load and byte-compiled to .elc?

Common idiom to workaround macro expansion or resolve warning about undefined variables during byte-compilation: (eval-when-compile (require 'cl-lib)) But this require ... compiled into .elc file! ...
4
votes
1answer
163 views

When to split long elisp files to separate files? [closed]

Some Lisp programmers advocate keeping code mainly into one file, following the concepts of Literate Programming in the Large, (note: the video is more about the method than Axiom, an open source ...
14
votes
1answer
638 views

Why do elisp files have end of file comments?

Why do elisp files usually end with ;;; file.el ends here? Is there some historical reason why this was useful? I've seen it recommended in elisp style guides and I still see it in modern elisp ...
2
votes
3answers
155 views

Macros prefixed with 'with'

Many emacs macros are prefixed with 'with' keyword in elisp. In an imperative language like python, with statement is used to create a temporary variable like this, with controlled_execution() as ...
8
votes
3answers
766 views

Closing parenthesis on own line unacceptable? [closed]

I've been using Emacs for quite a number of years now, but I only recently stumbled over the coding standards. There it is stated: Don't make a habit of putting close-parentheses on lines by ...