emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A primer on how to fix up `display-buffer' warnings?


From: martin rudalics
Subject: Re: A primer on how to fix up `display-buffer' warnings?
Date: Thu, 30 Jun 2011 08:38:23 +0200
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

> 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
=== 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]