Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 81E2841488C for ; Sun, 8 Jan 2012 17:12:26 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rg7LERfXxSVe for ; Sun, 8 Jan 2012 17:12:17 -0800 (PST) Received: from mail-yw0-f53.google.com (mail-yw0-f53.google.com [209.85.213.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 4D9AA414342 for ; Sun, 8 Jan 2012 17:12:15 -0800 (PST) Received: by yhpp34 with SMTP id p34so511937yhp.26 for ; Sun, 08 Jan 2012 17:12:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type; bh=BYzlRP6+lbdlVQYRqhPXU0syTFwklmtcj9gx1RYD1qg=; b=KHSPDSH1y6yydVm4qF8hRWW0EjFienOsuC6c1AaeDCIYT4c2Q/kTGpngjqwWABDT9a ibiTAVa5eInwEMUD0KRU8CazO3JyZx4S6jijp2kX0XR1pTPuDaAC7t+bkTDb6egqjggN Oaa0Zy5yBUQFI7Xwj/9FMSTbSe00V7rtKd+po= Received: by 10.236.155.234 with SMTP id j70mr17369773yhk.123.1326071533651; Sun, 08 Jan 2012 17:12:13 -0800 (PST) Received: from localhost (c-68-80-94-73.hsd1.pa.comcast.net. [68.80.94.73]) by mx.google.com with ESMTPS id j16sm54097222anm.9.2012.01.08.17.12.11 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 08 Jan 2012 17:12:11 -0800 (PST) From: Aaron Ecay To: Jameson Graef Rollins , Notmuch Mail Subject: Re: [PATCH 2/4] emacs: add option to notmuch-show-next-open-message to pop out to parent buffer if at end In-Reply-To: <1325986015-22510-3-git-send-email-jrollins@finestructure.net> References: <1325975294-646-4-git-send-email-jrollins@finestructure.net> <1325986015-22510-1-git-send-email-jrollins@finestructure.net> <1325986015-22510-2-git-send-email-jrollins@finestructure.net> <1325986015-22510-3-git-send-email-jrollins@finestructure.net> User-Agent: Notmuch/0.10.1+56~gd709fd6 (http://notmuchmail.org) Emacs/24.0.92.3 (i386-apple-darwin10.8.0) Date: Sun, 08 Jan 2012 20:12:08 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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, 09 Jan 2012 01:12:33 -0000 Jameson, One small, stylistic/nitpicky comment :) On Sat, 7 Jan 2012 17:26:53 -0800, Jameson Graef Rollins wrote: > This will allow for keybindings that achieve a smoother message > processing flow by reducing the number of key presses needed for most > common operations. > --- > emacs/notmuch-show.el | 12 +++++++++--- > 1 files changed, 9 insertions(+), 3 deletions(-) > > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el > index 8bb052e..e7bb958 100644 > --- a/emacs/notmuch-show.el > +++ b/emacs/notmuch-show.el > @@ -1264,17 +1264,23 @@ any effects from previous calls to > (notmuch-show-mark-read) > (notmuch-show-message-adjust)) > > -(defun notmuch-show-next-open-message () > +(defun notmuch-show-next-open-message (&optional pop-at-end) > "Show the next message." > (interactive) > - (let (r) > + (let ((r) > + (parent-buffer notmuch-show-parent-buffer)) No second set of parentheses is needed around r. Also, it is more idiomatic to put the initialized variable (i.e. parent-buffer) before the uninitialized one (r). > (while (and (setq r (notmuch-show-goto-message-next)) > (not (notmuch-show-message-visible-p)))) > (if r > (progn > (notmuch-show-mark-read) > (notmuch-show-message-adjust)) > - (goto-char (point-max))))) > + (if (and parent-buffer pop-at-end) > + (progn > + (kill-this-buffer) > + (switch-to-buffer parent-buffer) > + (forward-line 1)) > + (goto-char (point-max)))))) > > (defun notmuch-show-previous-open-message () > "Show the previous message." > -- > 1.7.7.3 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch -- Aaron Ecay