Gnus development mailing list
 help / color / mirror / Atom feed
* Customize :package-version keyword
@ 2006-04-19  0:10 Bill Wohler
  2006-04-22  0:14 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Bill Wohler @ 2006-04-19  0:10 UTC (permalink / raw)
  Cc: mh-e-devel

Lars,

Reiner asked me to introduce to you the new :package-version keyword I
recently introduced to Emacs.

The :version keyword (used in defcustom, defgroup, and defface) isn't
very helpful for packages such as MH-E (and probably Gnus as well) which
have releases more often than Emacs. For example, MH-E has had two major
releases and a score of minor releases.

After broaching this subject on emacs-devel
(http://article.gmane.org/gmane.emacs.devel/51453), I ended up
implementing :package-version using ideas provided by Richard. If you
add, for example,

  :package-version '(MH-E . "8.0")

to a variable, and update the new variable
customize-package-emacs-version-alist like this:

  (if (boundp 'customize-package-emacs-version-alist)
      (add-to-list 'customize-package-emacs-version-alist
		   '(MH-E ("6.0" . "22.1") ("6.1" . "22.1") ("7.0" . "22.1")
			  ("7.1" . "22.1") ("7.2" . "22.1") ("7.3" . "22.1")
			  ("7.4" . "22.1") ("8.0" . "22.1"))))

then customize-changed-options will show your options. You also have a
nice table for historical reference. Richard declined to implement a
function at this time to show changed options for a particular package.
The idea was to be able to add the keyword now so that it can be used in
the future.

To provide backwards compatibility, I wrote wrappers for defcustom,
defgroup, and defface which suppress the new keyword on systems that do
not support it (see emacs/lisp/mh-e/mh-e.el). I named them defcustom-mh,
defgroup-mh, and defface-mh (also on Richard's urging) so that they
would be recognized by find-function-search-for-symbol (invoked by
clicking on the filename link in a *Help* buffer). See
http://article.gmane.org/gmane.emacs.devel/52523 for a discussion on
that. Stefan fixed a small bug in that function so that my definitions
could be found. Unfortunately, this link will be broken in other
Emacsen which do not benefit from Stefan's patch.

Naming the wrappers in this fashion also allows them to be recognized by
custom-make-dependencies as long as you load your file with the
definition of those macros.

Finally, to provide highlighting to the developers, I added a call to
mh-font-lock-add-keywords (also in mh-e.el) which is an alias to
font-lock-add-keywords on GNU Emacs, and nil on XEmacs (so the
highlighting doesn't work there).

I think the advantage of adding :package-version keyword now far
outweighs the minor disadvantages of giving up the file link in older
versions of Emacs and syntax highlighting on XEmacs.

Feel free to grab our code.

-- 
Bill Wohler <wohler@newt.com>  http://www.newt.com/wohler/  GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-04-22  1:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-19  0:10 Customize :package-version keyword Bill Wohler
2006-04-22  0:14 ` Lars Magne Ingebrigtsen
2006-04-22  1:16   ` Bill Wohler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).