unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* reporter: pops up windows, doesn't remove them
@ 2010-04-19 15:53 David Reitter
  0 siblings, 0 replies; only message in thread
From: David Reitter @ 2010-04-19 15:53 UTC (permalink / raw)
  To: emacs-devel@gnu.org devel

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





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-04-19 15:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-19 15:53 reporter: pops up windows, doesn't remove them David Reitter

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