Re: [PATCH 2/4] emacs: add option to notmuch-show-next-open-message to pop out to parent buffer if at end

Subject: Re: [PATCH 2/4] emacs: add option to notmuch-show-next-open-message to pop out to parent buffer if at end

Date: Sun, 08 Jan 2012 20:12:08 -0500

To: Jameson Graef Rollins, Notmuch Mail

Cc:

From: Aaron Ecay


Jameson,

One small, stylistic/nitpicky comment :)

On Sat,  7 Jan 2012 17:26:53 -0800, Jameson Graef Rollins <jrollins@finestructure.net> 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

Thread: