[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: no empty (zero) string predicate in Elisp
From: |
Nicolas Petton |
Subject: |
Re: no empty (zero) string predicate in Elisp |
Date: |
Sat, 25 Apr 2015 11:26:39 +0200 |
Emanuel Berg writes:
> In one of my w3m extensions [1] I have
>
> (defun empty-string-p (str)
> (string= str "") )
>
> which obviously has nothing to do with w3m. Well, it's
> been known to happen. I can live with having it there.
>
> However, the next time I want to use it in some other
> file the byte-compiler tells me
>
> In end of data: wrap-search.el:98:1:Warning: the
> function `empty-string-p' is not known to
> be defined.
>
> OK, I get that away with
>
> (require 'w3m-unisearch) ; get empty-string-p
>
> But now I have a mention of w3m, in a file that has
> nothing to do with w3m, to get empty-string-p, which
> has nothing to do with w3m!
Hi!
You can use `string-empty-p' from subr-x.el or `seq-empty-p' from
seq.el (which works on all sequence data types).
seq.el will be included in Emacs 25.1, but in the meantime you can
install it from GNU Elpa.
Cheers,
Nico
--
Nicolas Petton
http://nicolas-petton.fr
signature.asc
Description: PGP signature
- no empty (zero) string predicate in Elisp, Emanuel Berg, 2015/04/24
- Re: no empty (zero) string predicate in Elisp,
Nicolas Petton <=
- Message not available
- Re: no empty (zero) string predicate in Elisp, Stefan Monnier, 2015/04/25
- Message not available
- Message not available
- Re: no empty (zero) string predicate in Elisp, Pascal J. Bourguignon, 2015/04/26
- Re: no empty (zero) string predicate in Elisp, Stefan Monnier, 2015/04/26
- Message not available
- Re: no empty (zero) string predicate in Elisp, Rusi, 2015/04/26
Message not available