From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: Readings for an emacs package maintainer ? Date: Mon, 1 Jun 2009 09:14:20 -0700 Message-ID: References: <87k53wh16c.wl%xma@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1243872879 17959 80.91.229.12 (1 Jun 2009 16:14:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Jun 2009 16:14:39 +0000 (UTC) Cc: emacs-devel@gnu.org To: "'Lennart Borgman'" , "'Xavier Maillard'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 01 18:14:35 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MBA9f-0007mF-8V for ged-emacs-devel@m.gmane.org; Mon, 01 Jun 2009 18:14:31 +0200 Original-Received: from localhost ([127.0.0.1]:38042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MBA9e-000766-Jy for ged-emacs-devel@m.gmane.org; Mon, 01 Jun 2009 12:14:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MBA9X-00072I-J3 for emacs-devel@gnu.org; Mon, 01 Jun 2009 12:14:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MBA9S-0006wK-A6 for emacs-devel@gnu.org; Mon, 01 Jun 2009 12:14:22 -0400 Original-Received: from [199.232.76.173] (port=54761 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MBA9S-0006wB-4f for emacs-devel@gnu.org; Mon, 01 Jun 2009 12:14:18 -0400 Original-Received: from acsinet12.oracle.com ([141.146.126.234]:64373) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MBA9O-0006KD-RH; Mon, 01 Jun 2009 12:14:15 -0400 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by acsinet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n51GDmD3032176 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 1 Jun 2009 16:13:49 GMT Original-Received: from abhmt008.oracle.com (abhmt008.oracle.com [141.146.116.17]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n51GEAds016521; Mon, 1 Jun 2009 16:14:10 GMT Original-Received: from dradamslap1 (/141.144.88.177) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 01 Jun 2009 09:14:05 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Thread-Index: AcnimjWqtSzxygUQRFeN2DGEpwqm/wAN1Ueg X-Source-IP: abhmt008.oracle.com [141.146.116.17] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A010207.4A23FE4E.00A6:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:111251 Archived-At: > Maybe look in the packages Drew develpe and maintain? Please, no (and no flames please). Nothing I do in any libraries is intended as good practice to follow. But thanks for the compliment. ;-) One tip that might help, which you are probably already aware of, is that it is typically better to test for the actual function or variable you need, rather than to test for a particular feature or `emacs-major-version'. IOW, use (fboundp 'some-new-fn) rather than (featurep 'some-feature) or (> (emacs-major-version 21). There are exceptions. In particular, sometimes `emacs-major-version' is the best you can do. There are other tips in the Elisp manual, node Coding Conventions. These, for instance: If a package needs to define an alias or a new function for compatibility with some other version of Emacs, name it with the package prefix, not with the raw name with which it occurs in the other version. Here is an example from Gnus, which provides many examples of such compatibility issues. (defalias 'gnus-point-at-bol (if (fboundp 'point-at-bol) 'point-at-bol 'line-beginning-position)) Redefining or advising an Emacs primitive is a bad idea. It may do the right thing for a particular program, but there is no telling what other programs might break as a result. If a file does replace any of the standard functions or library programs of Emacs, prominent comments at the beginning of the file should say which functions are replaced, and how the behavior of the replacements differs from that of the originals.