Re: [PATCH] emacs: tree/show remove duplicate function

Subject: Re: [PATCH] emacs: tree/show remove duplicate function

Date: Tue, 15 Jul 2014 08:14:46 +0100

To: David Bremner, notmuch@notmuchmail.org

Cc:

From: Mark Walters


On Tue, 15 Jul 2014, David Bremner <david@tethera.net> wrote:
> Mark Walters <markwalters1009@gmail.com> writes:
>> +		   (cond ((eq major-mode 'notmuch-show-mode)
>> +			  (notmuch-show-get-message-properties))
>> +			 ((eq major-mode 'notmuch-tree-mode)
>> +			  (notmuch-tree-get-message-properties))))
>
> I see this already existed, but it looks weird to me to have a two test
> cond with no else. Is it intentional to have the code drop through and
> do nothing if neither case matches?  It seems like it might be better to
> signal an error.

I can definitely do that. But as a comparison
notmuch-search-get-result and notmuch-search-find-thread-id "work" in
any buffer in the sense of returning nil but not complaining so perhaps
the current version is more consistent. 

Plausibly a comment and an explicit nil case would be clearer for the other modes.

Best wishes

Mark




Thread: