From: martin rudalics <rudalics@gmx.at>
To: emacs-devel@gnu.org
Subject: Re: A primer on how to fix up `display-buffer' warnings?
Date: Thu, 30 Jun 2011 08:38:23 +0200 [thread overview]
Message-ID: <4E0C19DF.4000006@gmx.at> (raw)
In-Reply-To: <m3liwki8hg.fsf@quimbies.gnus.org>
[-- Attachment #1: Type: text/plain, Size: 260 bytes --]
> 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
[-- Attachment #2: sendmail.diff --]
[-- Type: text/plain, Size: 5076 bytes --]
=== 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.
next prev parent reply other threads:[~2011-06-30 6:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-29 22:22 A primer on how to fix up `display-buffer' warnings? Lars Magne Ingebrigtsen
2011-06-30 6:38 ` martin rudalics [this message]
2011-06-30 8:57 ` Lars Magne Ingebrigtsen
2011-06-30 17:38 ` Stefan Monnier
2011-06-30 17:52 ` martin rudalics
2011-07-01 7:12 ` martin rudalics
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=4E0C19DF.4000006@gmx.at \
--to=rudalics@gmx.at \
--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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.