[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Arguing for a nilp function and where to put it
From: |
Michael Albinus |
Subject: |
Re: Arguing for a nilp function and where to put it |
Date: |
Sat, 01 Apr 2023 08:07:30 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Pedro Andres Aranda Gutierrez <paaguti@gmail.com> writes:
Hi Pedro,
> Use case for a nilp function:
>
> I have a buffer-local variable with a default value, and I want to
> allow to (silently) set it to nil (and only to nil) from
> .dir-locals.el or Local Variables.
>
> Currently I have
>
> (defun nilp(v) (unless v t))
>
> and I use it with
>
> (put '<variable> 'safe-local-variable #'nilp)
>
> which is much cleaner than
>
> (put '<variable> 'safe-local-variable (lambda (p) (unless p t)))
>
> every time I need it. I think other people may benefit from having
> this simple function as part of Emacs and I'm not sure whether the
> elisp form would be better than something more lower level like
> integerp and in which file it would reside best.
There is the `null' function, which is what you need.
> /PA
Best regards, Michael.
- Arguing for a nilp function and where to put it, Pedro Andres Aranda Gutierrez, 2023/04/01
- Re: Arguing for a nilp function and where to put it, tomas, 2023/04/01
- Re: Arguing for a nilp function and where to put it,
Michael Albinus <=
- Re: Arguing for a nilp function and where to put it, Eli Zaretskii, 2023/04/01
- Re: Arguing for a nilp function and where to put it, Pedro Andres Aranda Gutierrez, 2023/04/01
- Re: Arguing for a nilp function and where to put it, Roland Winkler, 2023/04/02
- Re: Arguing for a nilp function and where to put it, Richard Stallman, 2023/04/02
- Re: Arguing for a nilp function and where to put it, Emanuel Berg, 2023/04/03
- Re: Arguing for a nilp function and where to put it, Andreas Schwab, 2023/04/03
- Re: Arguing for a nilp function and where to put it, Roland Winkler, 2023/04/03
- Re: Arguing for a nilp function and where to put it, Emanuel Berg, 2023/04/03
- Re: Arguing for a nilp function and where to put it, Richard Stallman, 2023/04/03
- Re: Arguing for a nilp function and where to put it, Emanuel Berg, 2023/04/05