unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org
Subject: Re: [PATCH] emacs: tweak error buffer handling
Date: Tue, 25 Dec 2012 23:05:51 +0200	[thread overview]
Message-ID: <m2y5glvo40.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <1356209345-11712-1-git-send-email-markwalters1009@gmail.com>

On Sat, Dec 22 2012, Mark Walters <markwalters1009@gmail.com> wrote:

> view-mode-enter changed between emacs 23 and emacs 24: the current
> code makes the error buffer disappear in emacs 24 on quitting it (ie
> pressing q) but this just kills the buffer without closing the split
> window in emacs 23.
>
> This patch makes the error buffer window disappear in emacs 23
> too. Since the view-mode-enter function changed we have to test for
> version and do the correct thing in each case.
> ---
>
> This seems to work but I have only tested on 23.4 and 24.2

I run emacs 23.1.1 to get the documentation of view-mode-enter
there. So, this patch instructs to delete WINDOW when exiting
view mode...

Documentation of pop-to-buffer says:

"Select buffer BUFFER-OR-NAME in some window, preferably a different one."

What if pop-up-windows's value is nil -- the content of current window
is replaced with this view stuff -- and when exiting view mode, the
window will be deleted ? What happens with emacs 24 in this case ?

Tomi

> Best wishes
>
> Mark
>
>
>
>  emacs/notmuch-lib.el |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
> index 77a591d..0407f8a 100644
> --- a/emacs/notmuch-lib.el
> +++ b/emacs/notmuch-lib.el
> @@ -324,15 +324,17 @@ the user dismisses it."
>  
>    (let ((buf (get-buffer-create "*Notmuch errors*")))
>      (with-current-buffer buf
> -      (view-mode-enter nil #'kill-buffer)
> +      (pop-to-buffer buf)
> +      (view-mode-enter (when (< emacs-major-version 24)
> +			   (cons (selected-window) (cons nil t)))
> +		       #'kill-buffer)
>        (let ((inhibit-read-only t))
>  	(goto-char (point-max))
>  	(unless (bobp)
>  	  (insert "\n"))
>  	(insert msg)
>  	(unless (bolp)
> -	  (insert "\n"))))
> -    (pop-to-buffer buf)))
> +	  (insert "\n"))))))
>  
>  (defun notmuch-check-async-exit-status (proc msg)
>    "If PROC exited abnormally, pop up an error buffer and signal an error.
> -- 
> 1.7.9.1
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

  reply	other threads:[~2012-12-25 21:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-22 20:49 [PATCH] emacs: tweak error buffer handling Mark Walters
2012-12-25 21:05 ` Tomi Ollila [this message]
2012-12-26 22:27   ` Mark Walters
2012-12-27 23:04     ` Austin Clements
2012-12-28  9:03       ` Mark Walters
2012-12-28 12:44         ` David Bremner
2012-12-28 19:48           ` [PATCH] emacs: Use the minibuffer for CLI error reporting Austin Clements
2012-12-29 18:00             ` Mark Walters
2013-01-03  0:44               ` Austin Clements
2013-01-03 23:21                 ` David Bremner
2013-01-03  0:50             ` [PATCH v2] " Austin Clements
2013-01-03 21:47               ` [PATCH v3] " Austin Clements
2013-01-03 22:48                 ` Mark Walters
2013-01-06 21:12                   ` Austin Clements
2013-01-05 21:33                 ` Tomi Ollila
2013-01-07  2:54                 ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2y5glvo40.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=markwalters1009@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).