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 067626DE11C0 for ; Fri, 7 Oct 2016 07:51:18 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.453 X-Spam-Level: X-Spam-Status: No, score=0.453 tagged_above=-999 required=5 tests=[AWL=0.474, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] 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 rA0d2wtApk-6 for ; Fri, 7 Oct 2016 07:51:17 -0700 (PDT) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by arlo.cworth.org (Postfix) with ESMTPS id B8BD56DE1149 for ; Fri, 7 Oct 2016 07:51:16 -0700 (PDT) Received: by mail-wm0-f67.google.com with SMTP id 123so3329364wmb.3 for ; Fri, 07 Oct 2016 07:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adirat-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=Vw0ngMxFurEqz7BFayIfPDilQhHPIWSN5dMWzEnZItM=; b=iyW89Z1AbfvQ3Rai/jaeD8yCHQ7svo1NJ3CxCWL+8MQNgXXXg12k0bPGB2MW3qi8fN NvCjnbGYvD3iKjb6A8X/gQMfmeC5CCxDhZub14D/lDr0mDOrTQIX5Gdbb3T4pBsAI8jX SxefbO2ldOwjEwGgLb8ubz9O+bCyD1CdSmLiv5GR29EgkbeaG9dlMLmK5ADku309gvuN UEDaZrCE5mHR8ObmgfAhEK1QvtrUGq03c7zZCwdASXdwEF7zBjR3Pq7XJVQnkheKW2JM nu3wCkQcVY5sno4A4smyZLgvi3jHPfLI9SzTg0xG63Vmz+A8ktvCrWi+c5ECeIEEwbds 4OlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=Vw0ngMxFurEqz7BFayIfPDilQhHPIWSN5dMWzEnZItM=; b=ktpXhFlH/0zLB5vAHk+U4sUbIn/Te1oOLOGeUA4WTY4lzgJX/fKbkVn5nLsFuApV+o rOlFYhBn9KV6NfdThzFJGXVn+kTIaGbgpMkmQH269MCyjda22PxX4LhNbuGUz+Z3rUmV PUS1m21oqU9mwg5RqEzftuKLXUMf3zt1BuFk2tlDsubP3iBDHyzzzzUGcGnbMaaNM/uV uDI5oskDQa5XEujLmWzEmTdzTWqA8qxjhsFN0+NNDKWfv8Ct6+W1uY3lV2TiDevIjztp GcDRrjGPRpyuUZbwGItK4Q2WasD5O0WIZofghQwbLMFa7R7Wvpk2i9XbyWesPBBa5URF 9U+g== X-Gm-Message-State: AA6/9RlWOGtoqVE1vhbGujPeDspwzpS6ryNWIvRhk+Uzj5h1TlJENMW05smA75FeLJDxqQ== X-Received: by 10.194.116.167 with SMTP id jx7mr17082236wjb.218.1475851874677; Fri, 07 Oct 2016 07:51:14 -0700 (PDT) Received: from adi-pc-linux ([80.97.64.55]) by smtp.gmail.com with ESMTPSA id us3sm20049110wjb.32.2016.10.07.07.51.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Oct 2016 07:51:13 -0700 (PDT) From: Ioan-Adrian Ratiu To: Mark Walters , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: make the refresh code more consistent In-Reply-To: <1475790122-21539-1-git-send-email-markwalters1009@gmail.com> References: <87twcpb3dq.fsf@adiPC.i-did-not-set--mail-host-address--so-tickle-me> <1475790122-21539-1-git-send-email-markwalters1009@gmail.com> Date: Fri, 07 Oct 2016 17:49:42 +0300 Message-ID: <87mviggqnt.fsf@ni.com> 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: Fri, 07 Oct 2016 14:51:18 -0000 On Thu, 06 Oct 2016, Mark Walters wrote: > The current refresh code is a little haphazard with some of the > refresh functions called interactively, and some not. Some of the > refresh functions take arguments and they aren't consistent. > > This makes all the functions have the same form. > --- > > This might be a sensible change to make before the series > id:20161006134227.17194-1-adi@adirat.com (or merge into that series). > > I think the refresh functions should all be called non-interactively > as that will make it easier to pass arguments, and they should also > take the same arguments (though they can feel free to ignore them). Thank you for this, I'll pull it as is in my patch series and rebase my patches on top of it and send v4 tonight. Regards, Ionel > > Best wishes > > Mark > > > emacs/notmuch-hello.el | 2 +- > emacs/notmuch-lib.el | 22 ++++++++++++---------- > emacs/notmuch-show.el | 2 +- > emacs/notmuch-tree.el | 5 ++--- > emacs/notmuch.el | 2 +- > 5 files changed, 17 insertions(+), 16 deletions(-) > > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el > index d582bff..97280ca 100644 > --- a/emacs/notmuch-hello.el > +++ b/emacs/notmuch-hello.el > @@ -604,7 +604,7 @@ with `notmuch-hello-query-counts'." > > (defimage notmuch-hello-logo ((:type png :file "notmuch-logo.png"))) > > -(defun notmuch-hello-update (&optional no-display) > +(defun notmuch-hello-update (&optional ignore no-display) > "Update the current notmuch view." > ;; Lazy - rebuild everything. > (notmuch-hello no-display)) > diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el > index b2cdace..2d27e56 100644 > --- a/emacs/notmuch-lib.el > +++ b/emacs/notmuch-lib.el > @@ -410,23 +410,25 @@ of its command symbol." > (pop-to-buffer (help-buffer))))) > > (defvar notmuch-buffer-refresh-function nil > - "Function to call to refresh the current buffer.") > + "Function to call to refresh the current buffer. > + > +It will be called with two arguments: the first is the prefix > +argument when notmuch-refresh-this-buffer is called > +interactively, the second requests that the refresh call not > +display the buffer.") > (make-variable-buffer-local 'notmuch-buffer-refresh-function) > > -(defun notmuch-refresh-this-buffer () > +(defun notmuch-refresh-this-buffer (prefix) > "Refresh the current buffer." > - (interactive) > + (interactive "P") > (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)))) > + (funcall notmuch-buffer-refresh-function prefix))) > > -(defun notmuch-poll-and-refresh-this-buffer () > +(defun notmuch-poll-and-refresh-this-buffer (prefix) > "Invoke `notmuch-poll' to import mail, then refresh the current buffer." > - (interactive) > + (interactive "P") > (notmuch-poll) > - (notmuch-refresh-this-buffer)) > + (notmuch-refresh-this-buffer prefix)) > > (defun notmuch-prettify-subject (subject) > ;; This function is used by `notmuch-search-process-filter' which > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el > index f2487ab..1772d10 100644 > --- a/emacs/notmuch-show.el > +++ b/emacs/notmuch-show.el > @@ -1358,7 +1358,7 @@ This includes: > ;; Go to the previously open message. > (notmuch-show-goto-message current))) > > -(defun notmuch-show-refresh-view (&optional reset-state) > +(defun notmuch-show-refresh-view (&optional reset-state ignore) > "Refresh the current view. > > Refreshes the current view, observing changes in display > diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el > index 1555812..c347712 100644 > --- a/emacs/notmuch-tree.el > +++ b/emacs/notmuch-tree.el > @@ -271,7 +271,6 @@ FUNC." > (define-key map "x" 'notmuch-tree-quit) > (define-key map "A" 'notmuch-tree-archive-thread) > (define-key map "a" 'notmuch-tree-archive-message-then-next) > - (define-key map "=" 'notmuch-tree-refresh-view) > (define-key map "z" 'notmuch-tree-to-tree) > (define-key map "n" 'notmuch-tree-next-matching-message) > (define-key map "p" 'notmuch-tree-prev-matching-message) > @@ -571,9 +570,9 @@ message will be \"unarchived\", i.e. the tag changes in > (when (window-live-p notmuch-tree-message-window) > (notmuch-tree-show-message-in))) > > -(defun notmuch-tree-refresh-view () > +(defun notmuch-tree-refresh-view (&rest ignore) > "Refresh view." > - (interactive) > + (interactive "P") > (let ((inhibit-read-only t) > (basic-query notmuch-tree-basic-query) > (query-context notmuch-tree-query-context) > diff --git a/emacs/notmuch.el b/emacs/notmuch.el > index 888672b..ee1bb54 100644 > --- a/emacs/notmuch.el > +++ b/emacs/notmuch.el > @@ -982,7 +982,7 @@ the configured default sort order." > (set-process-query-on-exit-flag proc nil)))) > (run-hooks 'notmuch-search-hook))) > > -(defun notmuch-search-refresh-view () > +(defun notmuch-search-refresh-view (&rest ignore) > "Refresh the current view. > > Kills the current buffer and runs a new search with the same > -- > 2.1.4 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch