GNU bug report logs - #19975
25.0.50; Add %s-like descriptor to `format' that treats nil like empty string

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sun, 1 Mar 2015 15:34:01 UTC

Severity: wishlist

Tags: wontfix

Found in version 25.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19975 in the body.
You can then email your comments to 19975 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#19975; Package emacs. (Sun, 01 Mar 2015 15:34:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 01 Mar 2015 15:34:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; Add %s-like descriptor to `format' that treats nil like
 empty string
Date: Sun, 1 Mar 2015 07:32:56 -0800 (PST)
Enhancement request.  Add a new format descriptor to `format' that would
behave just like %s except that a nil argument would be treated as if it
were "".

This is a convenience only, to obviate needing to pass an argument such
as `(if something "foobar" "")' or needing to combine use of `format'
with use of `concat'.

In GNU Emacs 25.0.50.1 (i686-pc-mingw32)
 of 2014-10-20 on LEG570
Bzr revision: 118168 rgm <at> gnu.org-20141020195941-icp42t8ttcnud09g
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking=yes,glyphs CPPFLAGS=-DGLYPH_DEBUG=1'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19975; Package emacs. (Sun, 01 Mar 2015 15:38:02 GMT) Full text and rfc822 format available.

Message #8 received at 19975 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: 19975 <at> debbugs.gnu.org
Subject: RE: bug#19975: 25.0.50; Add %s-like descriptor to `format' that
 treats nil like empty string
Date: Sun, 1 Mar 2015 07:37:23 -0800 (PST)
FYI, this request was inspired by this emacs.stackexchange
question: http://emacs.stackexchange.com/q/9698/105.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19975; Package emacs. (Sun, 01 Mar 2015 16:45:01 GMT) Full text and rfc822 format available.

Message #11 received at 19975 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 19975 <at> debbugs.gnu.org
Subject: Re: bug#19975: 25.0.50;
 Add %s-like descriptor to `format' that treats nil like empty string
Date: Sun, 01 Mar 2015 17:44:46 +0100
Drew Adams <drew.adams <at> oracle.com> writes:

> Enhancement request.  Add a new format descriptor to `format' that would
> behave just like %s except that a nil argument would be treated as if it
> were "".

It's easy enough to use (or foo "").

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19975; Package emacs. (Mon, 02 Mar 2015 07:08:02 GMT) Full text and rfc822 format available.

Message #14 received at 19975 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 19975 <at> debbugs.gnu.org
Subject: RE: bug#19975: 25.0.50; Add %s-like descriptor to `format' that
 treats nil like empty string
Date: Sun, 1 Mar 2015 23:07:13 -0800 (PST)
> > Enhancement request.  Add a new format descriptor to `format' that would
> > behave just like %s except that a nil argument would be treated as if it
> > were "".
> 
> It's easy enough to use (or foo "").

Yes of course "it's easy enough".  That's what we've all been
doing for decades.  It would be even clearer and simpler still
to have a format descriptor for this common use case.

That is what this enhancement request is about - not needing to
write such "easy enough" code.

And of course it is not always (or foo "").
It might well be (if foo "whatever" "").  Or if you prefer,
(let ((bar "whatever")) (or (and foo bar) "")).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19975; Package emacs. (Mon, 02 Mar 2015 08:53:01 GMT) Full text and rfc822 format available.

Message #17 received at 19975 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 19975 <at> debbugs.gnu.org
Subject: Re: bug#19975: 25.0.50;
 Add %s-like descriptor to `format' that treats nil like empty string
Date: Mon, 02 Mar 2015 09:52:20 +0100
Drew Adams <drew.adams <at> oracle.com> writes:

> And of course it is not always (or foo "").
> It might well be (if foo "whatever" "").  Or if you prefer,
> (let ((bar "whatever")) (or (and foo bar) "")).

You can write arbitrary complicated expressions that compute (or foo
"").  What's your point?

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19975; Package emacs. (Sat, 30 Apr 2016 17:11:02 GMT) Full text and rfc822 format available.

Message #20 received at 19975 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 19975 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#19975: 25.0.50;
 Add %s-like descriptor to `format' that treats nil like empty string
Date: Sat, 30 Apr 2016 19:10:11 +0200
Andreas Schwab <schwab <at> linux-m68k.org> writes:

> Drew Adams <drew.adams <at> oracle.com> writes:
>
>> Enhancement request.  Add a new format descriptor to `format' that would
>> behave just like %s except that a nil argument would be treated as if it
>> were "".
>
> It's easy enough to use (or foo "").

Yes, I don't think that we want to clutter up the `format' language with
something as special as this.  Closing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 30 Apr 2016 17:11:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 19975 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 30 Apr 2016 17:11:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 29 May 2016 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 24 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.