From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general 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 13:18:26 +0800 Message-ID: <87ty5drmcd.fsf@gnu.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1323235133 3243 80.91.229.12 (7 Dec 2011 05:18:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 7 Dec 2011 05:18:53 +0000 (UTC) Cc: ding@gnus.org, emacs-devel@gnu.org To: Katsumi Yamaoka Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 07 06:18:49 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RY9u4-0000kL-LG for ged-emacs-devel@m.gmane.org; Wed, 07 Dec 2011 06:18:48 +0100 Original-Received: from localhost ([::1]:59874 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RY9u3-0007lN-N8 for ged-emacs-devel@m.gmane.org; Wed, 07 Dec 2011 00:18:47 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:45428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RY9u1-0007l3-1J for emacs-devel@gnu.org; Wed, 07 Dec 2011 00:18:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RY9u0-00071h-0T for emacs-devel@gnu.org; Wed, 07 Dec 2011 00:18:44 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:50850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RY9tz-00071c-RX for emacs-devel@gnu.org; Wed, 07 Dec 2011 00:18:43 -0500 Original-Received: from [155.69.19.189] (port=40534 helo=furball) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1RY9tp-0000yB-Tx; Wed, 07 Dec 2011 00:18:34 -0500 In-Reply-To: (Katsumi Yamaoka's message of "Wed, 07 Dec 2011 08:51:04 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:146529 gmane.emacs.gnus.general:80644 Archived-At: Katsumi Yamaoka writes: > But there's no such function in old Emacsen nor XEmacsen. Cf. > http://news.gmane.org/group/gmane.emacs.gnus.general/thread=80641 Sorry about that. > - (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)))) If pop-to-buffer-same-window is not available, you can just use pop-to-buffer. In previous version of Emacs, the mail buffer is treated specially via same-window-buffer-names, so pop-to-buffer will do the right thing.