From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: A primer on how to fix up `display-buffer' warnings? Date: Thu, 30 Jun 2011 08:38:23 +0200 Message-ID: <4E0C19DF.4000006@gmx.at> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070202030502070704080705" X-Trace: dough.gmane.org 1309417802 17912 80.91.229.12 (30 Jun 2011 07:10:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 30 Jun 2011 07:10:02 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 30 09:09:58 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 1QcBNs-0006Pf-UV for ged-emacs-devel@m.gmane.org; Thu, 30 Jun 2011 09:09:57 +0200 Original-Received: from localhost ([::1]:45826 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcBNr-0004pS-Ne for ged-emacs-devel@m.gmane.org; Thu, 30 Jun 2011 03:09:55 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:48797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcBNY-0004od-7J for emacs-devel@gnu.org; Thu, 30 Jun 2011 03:09:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QcBNV-0002iI-Un for emacs-devel@gnu.org; Thu, 30 Jun 2011 03:09:35 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:53222) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QcBNV-0002hQ-3f for emacs-devel@gnu.org; Thu, 30 Jun 2011 03:09:33 -0400 Original-Received: (qmail invoked by alias); 30 Jun 2011 07:09:29 -0000 Original-Received: from 62-47-57-182.adsl.highway.telekom.at (EHLO [62.47.57.182]) [62.47.57.182] by mail.gmx.net (mp060) with SMTP; 30 Jun 2011 09:09:29 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/26qI/3LX2bm93bQvRLkt8U3lVzsTdDUU6WLvWZO WiS14nSaKrz1Hf User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.165.64.22 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:141202 Archived-At: This is a multi-part message in MIME format. --------------070202030502070704080705 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit > Does anybody have a quick primer on how one is supposed to transform all > these let bindings into the parameter(s) that `display-buffer' expects > now? I attached the fixes for sendmail.el from my window-pub branch. Please have a look. Thanks, martin --------------070202030502070704080705 Content-Type: text/plain; name="sendmail.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sendmail.diff" === modified file 'lisp/mail/sendmail.el' *** lisp/mail/sendmail.el 2011-06-22 23:39:29 +0000 --- lisp/mail/sendmail.el 2011-06-30 06:33:46 +0000 *************** *** 534,544 **** send-actions return-action &rest ignored) (if switch-function ! (let ((special-display-buffer-names nil) ! (special-display-regexps nil) ! (same-window-buffer-names nil) ! (same-window-regexps nil)) ! (funcall switch-function "*mail*"))) (let ((cc (cdr (assoc-string "cc" other-headers t))) (in-reply-to (cdr (assoc-string "in-reply-to" other-headers t))) (body (cdr (assoc-string "body" other-headers t)))) --- 534,540 ---- send-actions return-action &rest ignored) (if switch-function ! (funcall switch-function "*mail*")) (let ((cc (cdr (assoc-string "cc" other-headers t))) (in-reply-to (cdr (assoc-string "in-reply-to" other-headers t))) (body (cdr (assoc-string "body" other-headers t)))) *************** *** 806,824 **** (defun mail-bury (&optional arg) "Bury this mail buffer." ! (let ((newbuf (other-buffer (current-buffer))) ! (return-action mail-return-action) ! some-rmail) ! (bury-buffer (current-buffer)) ! ;; If there is an Rmail buffer, return to it nicely ! ;; even if this message was not started by an Rmail command. ! (unless return-action ! (dolist (buffer (buffer-list)) ! (if (eq (buffer-local-value 'major-mode buffer) 'rmail-mode) ! (setq return-action `(rmail-mail-return ,newbuf))))) ! (if (and (null arg) return-action) ! (apply (car return-action) (cdr return-action)) ! (switch-to-buffer newbuf)))) (defcustom mail-send-hook nil "Hook run just before sending a message." --- 802,812 ---- (defun mail-bury (&optional arg) "Bury this mail buffer." ! (if (and (null arg) mail-return-action) ! (progn ! (bury-buffer (current-buffer)) ! (apply (car mail-return-action) (cdr mail-return-action))) ! (quit-restore-window))) (defcustom mail-send-hook nil "Hook run just before sending a message." *************** *** 1683,1691 **** ;; Put these commands last, to reduce chance of lossage from quitting ;; in middle of loading the file. - ;;;###autoload (add-hook 'same-window-buffer-names (purecopy "*mail*")) - ;;;###autoload (add-hook 'same-window-buffer-names (purecopy "*unsent mail*")) - ;;;###autoload (defun mail (&optional noerase to subject in-reply-to cc replybuffer actions return-action) --- 1671,1676 ---- *************** *** 1737,1747 **** This is how Rmail arranges to mark messages `answered'." (interactive "P") (if (eq noerase 'new) ! (pop-to-buffer (generate-new-buffer "*mail*")) (and noerase (not (get-buffer "*mail*")) (setq noerase nil)) ! (pop-to-buffer "*mail*")) ;; Avoid danger that the auto-save file can't be written. (let ((dir (expand-file-name --- 1722,1732 ---- This is how Rmail arranges to mark messages `answered'." (interactive "P") (if (eq noerase 'new) ! (pop-to-buffer-same-window (generate-new-buffer "*mail*")) (and noerase (not (get-buffer "*mail*")) (setq noerase nil)) ! (pop-to-buffer-same-window "*mail*")) ;; Avoid danger that the auto-save file can't be written. (let ((dir (expand-file-name *************** *** 1914,1937 **** (defun mail-other-window (&optional noerase to subject in-reply-to cc replybuffer sendactions) "Like `mail' command, but display mail buffer in another window." (interactive "P") ! (let ((pop-up-windows t) ! (special-display-buffer-names nil) ! (special-display-regexps nil) ! (same-window-buffer-names nil) ! (same-window-regexps nil)) ! (pop-to-buffer "*mail*")) (mail noerase to subject in-reply-to cc replybuffer sendactions)) ;;;###autoload (defun mail-other-frame (&optional noerase to subject in-reply-to cc replybuffer sendactions) "Like `mail' command, but display mail buffer in another frame." (interactive "P") ! (let ((pop-up-frames t) ! (special-display-buffer-names nil) ! (special-display-regexps nil) ! (same-window-buffer-names nil) ! (same-window-regexps nil)) ! (pop-to-buffer "*mail*")) (mail noerase to subject in-reply-to cc replybuffer sendactions)) ;; Do not add anything but external entries on this page. --- 1899,1912 ---- (defun mail-other-window (&optional noerase to subject in-reply-to cc replybuffer sendactions) "Like `mail' command, but display mail buffer in another window." (interactive "P") ! (pop-to-buffer-other-window "*mail*") (mail noerase to subject in-reply-to cc replybuffer sendactions)) ;;;###autoload (defun mail-other-frame (&optional noerase to subject in-reply-to cc replybuffer sendactions) "Like `mail' command, but display mail buffer in another frame." (interactive "P") ! (pop-to-buffer-other-frame "*mail*") (mail noerase to subject in-reply-to cc replybuffer sendactions)) ;; Do not add anything but external entries on this page. --------------070202030502070704080705--