Gnus development mailing list
 help / color / mirror / Atom feed
From: Bill Wohler <wohler@newt.com>
Cc: mh-e-devel@lists.sourceforge.net
Subject: Customize :package-version keyword
Date: Tue, 18 Apr 2006 17:10:08 -0700	[thread overview]
Message-ID: <3518.1145405408@olgas.newt.com> (raw)

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

             reply	other threads:[~2006-04-19  0:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-19  0:10 Bill Wohler [this message]
2006-04-22  0:14 ` Lars Magne Ingebrigtsen
2006-04-22  1:16   ` Bill Wohler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3518.1145405408@olgas.newt.com \
    --to=wohler@newt.com \
    --cc=mh-e-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).