all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Politz <politza@hochschule-trier.de>
To: martin rudalics <rudalics@gmx.at>
Cc: 24213@debbugs.gnu.org
Subject: bug#24213: 25.1.50; Fishy use of delete-window in register.el
Date: Wed, 31 Aug 2016 21:04:36 +0200	[thread overview]
Message-ID: <8760qg69q3.fsf@hochschule-trier.de> (raw)
In-Reply-To: <57AEF063.6070907@gmx.at> (martin rudalics's message of "Sat, 13 Aug 2016 12:03:15 +0200")


I finally got around to this.  The changes in the following diff seem to
be all clear cut cases, where the window is created by
display-buffer/pop-to-buffer without any special window-handling logic
attached.  Let me know what you think.  

diff --git a/lisp/finder.el b/lisp/finder.el
index da537a5..7f08024 100644
--- a/lisp/finder.el
+++ b/lisp/finder.el
@@ -455,7 +455,7 @@ finder-exit
   "Exit Finder mode.
 Delete the window and kill all Finder-related buffers."
   (interactive)
-  (ignore-errors (delete-window))
+  (quit-window)
   (let ((buf "*Finder*"))
     (and (get-buffer buf) (kill-buffer buf))))
 
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 67b023d..36f148b 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -2445,13 +2445,9 @@ image-dired-gallery-generate
       (insert "</html>"))))
 
 (defun image-dired-kill-buffer-and-window ()
-  "Kill the current buffer and, if possible, also the window."
+  "Kill the current buffer and quit it's window."
   (interactive)
-  (let ((buffer (current-buffer)))
-    (condition-case nil
-        (delete-window (selected-window))
-      (error nil))
-    (kill-buffer buffer)))
+  (quit-window t))
 
 (defvar image-dired-widget-list nil
   "List to keep track of meta data in edit buffer.")
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index 9cb2ca7..2215e52 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -8272,7 +8272,7 @@ idlwave-quit-help
       (select-window olh-window)
       (idlwave-help-quit))
     (when (window-live-p ri-window)
-      (delete-window ri-window))))
+      (quit-window nil ri-window))))
 
 (defun idlwave-display-calling-sequence (name type class
 					      &optional initial-class)
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index fd2e96a..a96ddae 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -7486,8 +7486,7 @@ verilog-complete-word
 	       (display-completion-list allcomp))
 	     ;; Wait for a key press. Then delete *Completion*  window
 	     (momentary-string-display "" (point))
-	     (delete-window (get-buffer-window (get-buffer "*Completions*")))
-	     )))))
+	     (quit-window nil (get-buffer-window "*Completions*")))))))
 
 (defun verilog-show-completions ()
   "Show all possible completions at current point."
@@ -7506,7 +7505,7 @@ verilog-show-completions
       (display-completion-list allcomp))
     ;; Wait for a key press. Then delete *Completion*  window
     (momentary-string-display "" (point))
-    (delete-window (get-buffer-window (get-buffer "*Completions*")))))
+    (quit-window nil (get-buffer-window "*Completions*"))))
 
 
 (defun verilog-get-default-symbol ()
diff --git a/lisp/startup.el b/lisp/startup.el
index fcdc376..0b21f4f 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1765,9 +1765,7 @@ fancy-startup-tail
 		  (customize-set-variable 'inhibit-startup-screen t)
 		  (customize-mark-to-save 'inhibit-startup-screen)
 		  (custom-save-all))
-		(let ((w (get-buffer-window "*GNU Emacs*")))
-		  (and w (not (one-window-p)) (delete-window w)))
-		(kill-buffer "*GNU Emacs*")))
+		(quit-windows-on "*GNU Emacs*" t)))
      "  ")
     (when (or user-init-file custom-file)
       (let ((checked (create-image "checked.xpm"
diff --git a/lisp/strokes.el b/lisp/strokes.el
index 5a2020d..215f24b 100644
--- a/lisp/strokes.el
+++ b/lisp/strokes.el
@@ -1216,9 +1216,7 @@ strokes-xpm-for-stroke
 
 ;;(defun strokes-edit-quit ()
 ;;  (interactive)
-;;  (or (one-window-p t 0)
-;;      (delete-window))
-;;  (kill-buffer "*Strokes List*"))
+;;  (quit-windows-on "*Strokes List*" t))
 
 ;;(define-derived-mode edit-strokes-mode list-mode
 ;;  "Edit-Strokes"





  reply	other threads:[~2016-08-31 19:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-12 20:22 bug#24213: 25.1.50; Fishy use of delete-window in register.el Andreas Politz
2016-08-13  2:39 ` Leo Liu
2016-08-13  6:43   ` Andreas Politz
2016-08-13  8:25     ` martin rudalics
2016-08-13 12:44       ` npostavs
2016-08-13 12:51         ` Eli Zaretskii
2016-08-13 13:30         ` martin rudalics
2016-08-13  9:50     ` Leo Liu
2016-08-13  8:24   ` martin rudalics
2016-08-13  9:50     ` Leo Liu
2016-08-13  8:24 ` martin rudalics
2016-08-13  8:47   ` Andreas Politz
2016-08-13 10:03     ` martin rudalics
2016-08-31 19:04       ` Andreas Politz [this message]
2016-09-01  7:40         ` martin rudalics
2016-09-01 11:22           ` Andreas Politz
2016-09-01 12:57             ` martin rudalics
2019-09-29 14:58         ` Lars Ingebrigtsen
2019-10-13  3:09           ` Lars Ingebrigtsen

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=8760qg69q3.fsf@hochschule-trier.de \
    --to=politza@hochschule-trier.de \
    --cc=24213@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /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.