emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Best practices for writing an Emacs package


From: Akib Azmain Turja
Subject: Best practices for writing an Emacs package
Date: Wed, 26 Oct 2022 00:05:50 +0600

There are certainly some best practices for doing something.  But what
are the best practices for writing and maintaining an Emacs package?

Here are what I already know,

For programming in general,

* Write readable code, so that anyone else can also understand it.
* Write enough comments to explain what's going on.
* Write as many automated tests as possible.
* Use a version control system.
* Maintain a ChangeLog.
* Never publish code with syntax errors.
* Never throw out your computer through a window due to buggy code.

For Emacs packages,

* Write the summary line properly.
* Write package headers properly.
* Use lexical binding.
* Write good commentary.
* Define user options with `defcustom' instead of `defvar'.
* Write docstrings.
* Follow Emacs Lisp coding conventions.
* Never corrupt user data.
* Never left Emacs in a unusable state.
* Never uninstall Emacs due to frustration.

And what else?

-- 
Akib Azmain Turja

Find me on Mastodon at @akib@hostux.social, and on Codeberg (user
"akib").

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]