unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* A primer on how to fix up `display-buffer' warnings?
@ 2011-06-29 22:22 Lars Magne Ingebrigtsen
  2011-06-30  6:38 ` martin rudalics
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-06-29 22:22 UTC (permalink / raw)
  To: emacs-devel

It's sometimes difficult to find compilation errors (in sendmail.el this
time) because of reams of new warnings like this:

In mail-other-frame:
sendmail.el:1976:10:Warning: `same-window-regexps' is an obsolete variable (as
    of Emacs 24.1); use 2nd arg of `display-buffer' instead.
sendmail.el:1975:10:Warning: `same-window-buffer-names' is an obsolete
    variable (as of Emacs 24.1); use 2nd arg of `display-buffer' instead.
sendmail.el:1974:10:Warning: `special-display-regexps' is an obsolete variable
    (as of Emacs 24.1); use 2nd arg of `display-buffer' instead.
sendmail.el:1973:10:Warning: `special-display-buffer-names' is an obsolete
    variable (as of Emacs 24.1); use 2nd arg of `display-buffer' instead.
sendmail.el:1972:10:Warning: `pop-up-frames' is an obsolete variable (as of
    Emacs 24.1); use 2nd arg of `display-buffer' instead.

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?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A primer on how to fix up `display-buffer' warnings?
  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
  2011-06-30  8:57   ` Lars Magne Ingebrigtsen
  2011-06-30 17:38   ` Stefan Monnier
  0 siblings, 2 replies; 6+ messages in thread
From: martin rudalics @ 2011-06-30  6:38 UTC (permalink / raw)
  To: emacs-devel

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A primer on how to fix up `display-buffer' warnings?
  2011-06-30  6:38 ` martin rudalics
@ 2011-06-30  8:57   ` Lars Magne Ingebrigtsen
  2011-06-30 17:38   ` Stefan Monnier
  1 sibling, 0 replies; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-06-30  8:57 UTC (permalink / raw)
  To: emacs-devel

martin rudalics <rudalics@gmx.at> writes:

> I attached the fixes for sendmail.el from my window-pub branch.  Please
> have a look.

I see; thanks.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A primer on how to fix up `display-buffer' warnings?
  2011-06-30  6:38 ` martin rudalics
  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
  1 sibling, 2 replies; 6+ messages in thread
From: Stefan Monnier @ 2011-06-30 17:38 UTC (permalink / raw)
  To: martin rudalics; +Cc: emacs-devel

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

There's one problem with it:
we want to first make sure the new code is backward compatible with
old Elisp code, so I'd rather not update the Elisp users yet.
Can we disable the obsolescence warnings for a while (say until we're
close to the 24.1 release)?


        Stefan



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A primer on how to fix up `display-buffer' warnings?
  2011-06-30 17:38   ` Stefan Monnier
@ 2011-06-30 17:52     ` martin rudalics
  2011-07-01  7:12     ` martin rudalics
  1 sibling, 0 replies; 6+ messages in thread
From: martin rudalics @ 2011-06-30 17:52 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

> There's one problem with it:
> we want to first make sure the new code is backward compatible with
> old Elisp code, so I'd rather not update the Elisp users yet.
> Can we disable the obsolescence warnings for a while (say until we're
> close to the 24.1 release)?

OK.  I'll do that.

martin




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: A primer on how to fix up `display-buffer' warnings?
  2011-06-30 17:38   ` Stefan Monnier
  2011-06-30 17:52     ` martin rudalics
@ 2011-07-01  7:12     ` martin rudalics
  1 sibling, 0 replies; 6+ messages in thread
From: martin rudalics @ 2011-07-01  7:12 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

> Can we disable the obsolescence warnings for a while (say until we're
> close to the 24.1 release)?

Done now.

martin




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-07-01  7:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).