Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: Chong Yidong <cyd@gnu.org>
Cc: ding@gnus.org, emacs-devel@gnu.org
Subject: Re: /srv/bzr/emacs/trunk r106599: message.el (message-pop-to-buffer): Use pop-to-buffer-same-window for last change.
Date: Wed, 07 Dec 2011 08:51:04 +0900	[thread overview]
Message-ID: <b4mk469tg2f.fsf@jpl.org> (raw)
In-Reply-To: <E1RX1do-00036n-01@vcs.savannah.gnu.org>

Chong Yidong wrote:
>   message.el (message-pop-to-buffer): Use pop-to-buffer-same-window
> for last change.
[...]

But there's no such function in old Emacsen nor XEmacsen.  Cf.
http://news.gmane.org/group/gmane.emacs.gnus.general/thread=80641

The main reason using it is to pop up a frame according to
'special-display-regexps' and friends, I guess.  So, I tried
a function that emulates `pop-to-buffer-same-window':

--- message.el~	2011-12-04 22:06:42.984375000 +0000
+++ message.el	2011-12-06 23:45:56.875000000 +0000
@@ -6388,7 +6388,15 @@
 			       "Message already being composed; erase? ")
 			    (message nil))))
 	    (error "Message being composed")))
-      (funcall (or switch-function #'pop-to-buffer-same-window) name)
+      (cond (switch-function
+	     (funcall switch-function name))
+	    ((fboundp 'pop-to-buffer-same-window)
+	     (pop-to-buffer-same-window name))
+	    (t
+	     (save-window-excursion
+	       (pop-to-buffer name))
+	     (unless (get-buffer-window name t)
+	       (set-window-buffer nil name))))
       (set-buffer name))
     (erase-buffer)
     (message-mode)))

Does this get a passing mark?
Tested with Emacs 23.3 and XEmacs 21.4.22.



       reply	other threads:[~2011-12-06 23:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1RX1do-00036n-01@vcs.savannah.gnu.org>
2011-12-06 23:51 ` Katsumi Yamaoka [this message]
2011-12-07  5:18   ` Chong Yidong
2011-12-07  6:08     ` Katsumi Yamaoka

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

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

  git send-email \
    --in-reply-to=b4mk469tg2f.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=cyd@gnu.org \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.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.
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 NNTP newsgroup(s).