From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 3B33E6DE135C for ; Mon, 10 Oct 2016 11:16:28 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.537 X-Spam-Level: X-Spam-Status: No, score=0.537 tagged_above=-999 required=5 tests=[AWL=-0.115, SPF_NEUTRAL=0.652] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VT_IHZJRlmOG for ; Mon, 10 Oct 2016 11:16:27 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id B287F6DE133F for ; Mon, 10 Oct 2016 11:16:26 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 0300210007F; Mon, 10 Oct 2016 21:17:12 +0300 (EEST) From: Tomi Ollila To: Mark Walters , notmuch@notmuchmail.org, adi@adirat.com Subject: Re: [PATCH v5 2/7] emacs: make the refresh functions more consistent In-Reply-To: <87twckbred.fsf@qmul.ac.uk> References: <1476045223-5238-1-git-send-email-markwalters1009@gmail.com> <1476045223-5238-3-git-send-email-markwalters1009@gmail.com> <87twckbred.fsf@qmul.ac.uk> User-Agent: Notmuch/0.23+16~g6d066d0 (https://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 18:16:28 -0000 On Mon, Oct 10 2016, Mark Walters wrote: > On Sun, 09 Oct 2016, Tomi Ollila wrote: >> On Sun, Oct 09 2016, Mark Walters wrote: >> >>> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el >>> index b2cdace..8b55ca7 100644 >>> --- a/emacs/notmuch-lib.el >>> +++ b/emacs/notmuch-lib.el >>> @@ -416,11 +416,10 @@ of its command symbol." >>> (defun notmuch-refresh-this-buffer () >>> "Refresh the current buffer." >>> (interactive) >>> - (when notmuch-buffer-refresh-function >>> - (if (commandp notmuch-buffer-refresh-function) >>> - ;; Pass prefix argument, etc. >>> - (call-interactively notmuch-buffer-refresh-function) >>> - (funcall notmuch-buffer-refresh-function)))) >>> + (when (and notmuch-buffer-refresh-function >>> + (commandp notmuch-buffer-refresh-function)) >>> + ;; Pass prefix argument, etc. >>> + (call-interactively notmuch-buffer-refresh-function))) > > Hi > > Thanks for the review. > >> If there is going to be more rounds, IMO this (currently wrong, missing >> second argument t) commandp check should be dropped. It is better to >> signal programmer error than silently ignore non-nil variable that is >> not referring to interactive function (the code is also simpler this way). > > Yes I agree. Do you have any preference between just dropping the test, > and putting our own error instead? I'd just drop the test. e.g. (if/when notmuch-buffer-refresh-function (call-interactively notmuch-buffer-refresh-function)) Tomi > >> and a quesstion: the last patch in this series defines this >> refresh all buffers function -- why is it not interactive ? > > Because I forgot to amend the last commit :-) The interactive is in my > tree, and was in what I tested -- I agree it should be. > > Best wishes > > Mark > > >> Otherwise series looks good to me. > > >> >> Tomi