Skip to main content

Questions tagged [coding-conventions]

Filter by
Sorted by
Tagged with
2 votes
2 answers
87 views

Some functions require a list of parameters that only tell the difference based on nil or non-nil. Is there a way to fill such parameters in a readable and conventional way? For example, add-hook ...
xuhdev's user avatar
  • 1,998
0 votes
1 answer
40 views

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
4 votes
1 answer
516 views

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
0 votes
0 answers
53 views

To enable smart-dash ("an Emacs minor mode which redefines the dash key to insert an underscore within C-style identifiers and a dash otherwise") after falling in love with Kebab/Lisp case, ...
Daanturo's user avatar
  • 312
0 votes
1 answer
170 views

What are best practices for handling long string literals in Emacs Lisp? E.g. (... stuff that causes indentation ... (error "`my-config-alist' mapped command `%s' to `%S' ...
kdb's user avatar
  • 1,591
0 votes
2 answers
296 views

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

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
0 votes
0 answers
142 views

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 ...
gavenkoa's user avatar
  • 3,582
8 votes
2 answers
3k views

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) instead ...
gavenkoa's user avatar
  • 3,582
3 votes
2 answers
264 views

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 ...
Tianxiang Xiong's user avatar
9 votes
2 answers
4k views

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! ...
gavenkoa's user avatar
  • 3,582
4 votes
1 answer
363 views

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 ...
gsl's user avatar
  • 1,852
17 votes
1 answer
922 views

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 ...
Qudit's user avatar
  • 844
2 votes
3 answers
231 views

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 ...
Saravana's user avatar
  • 2,139
10 votes
3 answers
1k views

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 ...
Meaningful Username's user avatar