emacs-devel
[Top][All Lists]
Advanced

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

Re: Fixing numerous `message' bugs..


From: David Kastrup
Subject: Re: Fixing numerous `message' bugs..
Date: Tue, 11 Dec 2007 00:02:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

Dave Goel <address@hidden> writes:

>> (message "%s" (or x ""))
>>
>> will work instead of the proposed (message t x) 
>
> (a) This looks like a neat "trick", but is confusing code.  Code
> should be readable and as manifest as possible, and not rely on such
> "hidden" tricks.  On the obfuscation scale, this is far worse than
> something as innocuous as (or foo (error bar)), and note that some
> authors even oppose that..
>
> (b) This code also relies on an undocumented feature of `message' - that
> "" as the first argument makes it behave almost the same as if the
> argument were nil.

Undocumented?


    If the first argument is nil or the empty string, the function clears
    any existing message; this lets the minibuffer contents show.  See
    also `current-message'.

It is not the first argument, though, that is "" here.

> (c) Also note that (message "") is not exactly the same as (message
> nil), because they return different values.  
>
>> and considering that it rarely occurs (I think I should have got
>> most cases),
>
> Most, but not all.

Which one is missing?  Note that you still have to hunt all of them
down.

>> I don't think it is really worth the trouble.
>
> Hm, but where is the trouble?  This is a backward-compatible change.

But it is a surprising one, inconsistent with `format'.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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