emacs-devel
[Top][All Lists]
Advanced

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

reporter: pops up windows, doesn't remove them


From: David Reitter
Subject: reporter: pops up windows, doesn't remove them
Date: Mon, 19 Apr 2010 11:53:46 -0400

I found two issues with reporter.el, `reporter-submit-bug-report'.

With "*mail*" in same-window-buffer-names, and `pop-up-windows' non-nil, and 
called from a frame with one window displaying buffer foo, this function will 
switch to the mail buffer in the window, then split it and pop up a second 
window below with foo.  Unfortunately, when the mail buffer is deleted, the 
newly popped up remains, and we have a frame with two windows displaying foo.  
That's inconvenient.

Second, the design of `reporter-submit-bug-report' overrides 
`same-window-buffer-names' for one set of calls to 
pop-to-buffer/display-buffer, but doesn't already do so for the call to 
`reporter-compose-outgoing'.  I think it should be consistent.  If it does 
override it, then for all calls.  This takes care of the above problem (as a 
workaround), as in the patch below.  As an alternative, one could consistently 
respect the user settings and only intervene if necessary (as it does now), but 
then one should take care of the first point above.  

Do you want me to file a bug, commit the change below, or do nothing?


diff --git a/lisp/mail/reporter.el b/lisp/mail/reporter.el
index 877cc5a..0f09629 100644
--- a/lisp/mail/reporter.el
+++ b/lisp/mail/reporter.el
@@ -319,6 +319,8 @@ This function does not send a message; it uses the given 
information
 to initialize a message, which the user can then edit and finally send
 \(or decline to send).  The variable `mail-user-agent' controls which
 mail-sending package is used for editing and sending the message."
+    (let (same-window-buffer-names same-window-regexps)
+      ;; `reporter-compose-outgoing' may pop up the window.
   (let ((reporter-eval-buffer (current-buffer))
        final-resting-place
        after-sep-pos
@@ -334,11 +336,10 @@ mail-sending package is used for editing and sending the 
message."
     ;; do the work
     (require 'sendmail)
     ;; If mailbuf did not get made visible before, make it visible now.
-    (let (same-window-buffer-names same-window-regexps)
       (pop-to-buffer mailbuf)
       ;; Just in case the original buffer is not visible now, bring it
       ;; back somewhere
-      (and pop-up-windows (display-buffer reporter-eval-buffer)))
+      (and pop-up-windows (display-buffer reporter-eval-buffer))
     (goto-char (point-min))
     (mail-position-on-field "to")
     (insert address)
@@ -385,7 +386,7 @@ mail-sending package is used for editing and sending the 
message."
           )
       (message "Please enter your report.  Type %s to send, %s to abort."
               sendkey abortkey))
-    ))
+    )))
 
 (defun reporter-bug-hook ()
   "Prohibit sending mail if empty bug report."





reply via email to

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