unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: no empty (zero) string predicate in Elisp
Date: Sat, 25 Apr 2015 05:44:06 +0200	[thread overview]
Message-ID: <87h9s4rhx5.fsf@debian.uxu> (raw)

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!

Of course, I can do yet a third file -
my-string-predicate.el - and require that from both
files. But I feel I shouldn't have to. Such basic
things shouldn't have to be solved on a Joe Hacker
basis. It should be included. And not in ELPA,
in Emacs!

I'll report this as a bug unless someone presents
really convincing stuff why it shouldn't be included.
Or, if there is something equivalent - equivalent in
the syntactic sense, I mean - I am aware of

   (= (length str) 0)

and

   (equal "" str)

but it should be a binary operator.

[1] http://user.it.uu.se/~embe8573/conf/emacs-init/w3m/w3m-unisearch.el

-- 
underground experts united
http://user.it.uu.se/~embe8573


             reply	other threads:[~2015-04-25  3:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-25  3:44 Emanuel Berg [this message]
2015-04-25  9:26 ` no empty (zero) string predicate in Elisp Nicolas Petton
2015-05-16  9:23   ` Nicolas Petton
2015-05-16 13:22     ` Bozhidar Batsov
2015-05-16 13:28       ` Bozhidar Batsov
2015-05-16 13:36         ` Bozhidar Batsov
2015-05-16 13:46           ` Eli Zaretskii
2015-05-16 13:43     ` Stefan Monnier
2015-05-16 15:27     ` Drew Adams
     [not found] ` <mailman.1583.1429954907.904.help-gnu-emacs@gnu.org>
2015-04-25 11:22   ` Emanuel Berg
2015-04-25 13:30 ` Stefan Monnier
     [not found] ` <mailman.1591.1429968677.904.help-gnu-emacs@gnu.org>
2015-04-25 14:48   ` Pascal J. Bourguignon
2015-04-26  2:52     ` Stefan Monnier
2015-04-27 10:28       ` zerop: compiler macro vs defsubst (was: no empty (zero) string predicate in Elisp) Nicolas Richard
2015-04-27 12:19         ` zerop: compiler macro vs defsubst Stefan Monnier
     [not found]     ` <mailman.1626.1430016741.904.help-gnu-emacs@gnu.org>
2015-04-26  4:06       ` no empty (zero) string predicate in Elisp Pascal J. Bourguignon
2015-04-26 21:25         ` Stefan Monnier
2015-04-26  4:26       ` Rusi
2015-04-26 12:36   ` Emanuel Berg
2015-04-26 15:03     ` Pascal J. Bourguignon
2015-04-26 18:34       ` Emanuel Berg
2015-04-26 18:59         ` Marcin Borkowski
     [not found]         ` <mailman.1658.1430074770.904.help-gnu-emacs@gnu.org>
2015-04-26 19:06           ` Emanuel Berg
2015-04-26 20:11             ` Marcin Borkowski
     [not found]             ` <mailman.1662.1430079142.904.help-gnu-emacs@gnu.org>
2015-04-27  1:00               ` Emanuel Berg
2015-04-26 17:28     ` Rusi
2015-04-26 18:39       ` Emanuel Berg

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87h9s4rhx5.fsf@debian.uxu \
    --to=embe8573@student.uu.se \
    --cc=help-gnu-emacs@gnu.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).