emacs-devel
[Top][All Lists]
Advanced

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

Re: Test for `save-abbrevs' improvement


From: Kevin Rodgers
Subject: Re: Test for `save-abbrevs' improvement
Date: Fri, 17 Feb 2006 09:41:16 -0800 (PST)

Juanma Barranquero <address@hidden> wrote:
> On 2/17/06, Juanma Barranquero <address@hidden> wrote:
> 
> > I don't use Customize), but I think I'll end using
> >
> >   (rassoc '(silently) (get 'save-abbrevs 'custom-type))

No, you don't want to match (function silently), only (const silently),
and then only if it is actually a choice widget:

(let ((custom-type (get 'save-abbrevs 'custom-type)))
  (and (consp custom-type)
       (eq (car custom-type) 'choice)
       (member '(const silently) custom-type)))

>   (and (listp (get 'save-abbrevs 'custom-type)) 'silently)

That looks completely wrong to me.  What are you trying to express?

> really, as the custom-type is 'boolean in 21.1. Oh well.

What?  I thought your goal was to determine whether or not save-abbrevs
could be meaningfully set to silently.  If it has type boolean, nil is
the only distinguished value and silently is just another non-nil value.

> All in all, though the "test for functionality, not Emacs version"
> mantra is a good suggestion, it breaks sometimes. In my .emacs I
> advise `list-faces-display' to add to it the "C-u means ask for
> regexp" feature of 22.X, but only if it is not there already. I didn't
> find any way easier than:
> 
> (let ((code (symbol-function #'list-faces-display)))
>   (when (and (byte-code-function-p code)
>              (null (aref code 0)))
>     ;; Stuff for pre-22.X versions
>     ;; ...
>     ))
> 
> Ugh.

Isn't there something like:

(and (fboundp 'function-arity)
     (> (function-arity 'list-faces-display) 0))

-- 
Kevin


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

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