From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Akib Azmain Turja Newsgroups: gmane.emacs.devel Subject: Best practices for writing an Emacs package Date: Wed, 26 Oct 2022 00:05:50 +0600 Message-ID: <87czafaidd.fsf@disroot.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10657"; mail-complaints-to="usenet@ciao.gmane.io" To: Emacs Developer List Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 25 21:03:02 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1onPCX-0002Wf-Aq for ged-emacs-devel@m.gmane-mx.org; Tue, 25 Oct 2022 21:03:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onPA4-0004fb-6y; Tue, 25 Oct 2022 15:00:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onPA1-0004H1-W1 for emacs-devel@gnu.org; Tue, 25 Oct 2022 15:00:26 -0400 Original-Received: from knopi.disroot.org ([178.21.23.139]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onPA0-0006g0-E9 for emacs-devel@gnu.org; Tue, 25 Oct 2022 15:00:25 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 0ABAE4E730 for ; Tue, 25 Oct 2022 21:00:23 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Original-Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with UTF8SMTP id ZP9KjIxNBp1a for ; Tue, 25 Oct 2022 21:00:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1666724025; bh=oRa9aiKvVeY+TZs5MKR728jely6VUeYcSl+ZbMSBggs=; h=From:To:Subject:Date; b=hKLhFXvmwDsz3XzuB9WRDdYqEV2LXMsgJjfyYJdBKjS1yNm2/RcAIAMrOaJ4/idte v9vd+xPVu36Nhh7o76sE3lEzWjLYmKzrlYLpiL0z16UHtzPC/Mx5yQ/CJPSSMRlHVw Gn0r0TkdK/oapqStn6m8RXl2+fpkYRKg1+dPFJRre17MAjIkAGEAtyaU9Qm/H7C1E2 lZo0jXx6L2lC3HxqPe1/MjohH0762U4ahUqa7YRx6qaD6jlFuROp6hFBG4t/QiT9iM nv5Ofn39LreloX62bxb/yVe/4ycVpqZ/ALBaC853u1DMcOC7rzFYsW1fcIMfSeGEpG bucOwEb6IXsoQ== Received-SPF: pass client-ip=178.21.23.139; envelope-from=akib@disroot.org; helo=knopi.disroot.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298490 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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? =2D-=20 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmNYJX4ACgkQVTX89U2I YWt9lA/+KW7CsFHS4AD2eOj9aS/sIQpEKWjeWpESUcnoM0AdaZPkqbaOzcOBTjiF Fviz0yGdQZZ/qCPFqkQCP+/QoqOj5CqCZkOsbsfM1rv0D2J7vmuwiu27Ko5lpXWM LdAvLvADvnef6yGFx38bIwA5C9Y3lkGprW61yqfG7lbXYy1gducwjzCBBFLsykpO P4ROh9VoVwYjI/Qoa+cq7Y+Cw2eWUhfDiILeLT4vuLtMlCiO2xkMqwLJMJLXqGQB 7Md+LmXc2McdSk4vnCIk/dQtDakOYAkf/UwyfHq1eUBPZTLBkGF2hU64Od6gfEaa apJLnf/JeC36oeBMVqoKCe+gIR5YcnbKuhwLbFrF59xkXJhVAYZvmweh/Hp3NSxV 83TPSb+5s87zE9RDJ12AQVx37wUZ65diKrQqXlR3wKLYJ916oWMFdKgxMqa5Tibf R41xloY6BFyhmKU0DS5F616HI+OA2Jew6pK5Lk/OeLNLe636DRh3Y02M0SZsl+kf dxj1iLPb1M6+rgPLWxp1IVy4DW0QxILv0BqLmwV5hgVBsIXhCxMLnDaXdPPusUV5 1NXxAngu1c2iWc4a3Gdsok4EN+UUArMRKBT9Wjh6BIIbUClWBfUM3QWq0ygCNwam momeoS6gSCyagqCXCaqCSLXobTvIq3xmXTgTmtfp5/sDXyZu7Js= =Jk3B -----END PGP SIGNATURE----- --=-=-=--