[Top][All Lists]

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

RE: Readings for an emacs package maintainer ?

From: Drew Adams
Subject: RE: Readings for an emacs package maintainer ?
Date: Mon, 1 Jun 2009 09:14:20 -0700

> 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

 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)

 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.

reply via email to

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