help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to find a key in a property list?


From: Kalle Olavi Niemitalo
Subject: Re: How to find a key in a property list?
Date: 23 Mar 2001 16:01:50 +0200

"Stefan Monnier <foo@acm.com>" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> 
writes:

> You could use `widget-plist-member' (properly renamed to `plist-member'
> in the next version of Emacs).

Cool!  I wrote a `kon-prop-pmemq' function just like that
yesterday; now I can make it a conditional alias.

Hmm... XEmacs 20.4 already has `plist-member', but one that
returns only nil or t.  So I'll make the alias prefer
`widget-plist-member'.

> But the best approach is to make sure that you don't need to care
> about the difference between a property that's absent and a property
> which is set to nil.  I.e. do what Elisp wants you to do.

I don't think I can do that.  The package I'm writing describes
property lists to the user:

  Symbol major-mode has no permanent-local property.

  Documentation:
  If the name of a local variable has this property with a non-nil
  value, `kill-all-local-variables' doesn't kill that variable.

It would be wrong to say that "The permanent-local property of
symbol major-mode is nil" when the property is absent.  It
doesn't matter with `permanent-local', but it might matter with
some other property.



reply via email to

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