all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: martin rudalics <rudalics@gmx.at>
Cc: Christoph Scholtes <cschol2112@googlemail.com>,
	Juanma Barranquero <lekktu@gmail.com>,
	9873@debbugs.gnu.org
Subject: bug#9873: 24.0.90; dired - window changes size when trying to delete more than one file
Date: Mon, 31 Oct 2011 12:11:18 +0200	[thread overview]
Message-ID: <87y5w15v5h.fsf@mail.jurta.org> (raw)
In-Reply-To: <4EAAE35F.4030707@gmx.at> (martin rudalics's message of "Fri, 28 Oct 2011 19:16:15 +0200")

>> Are we waiting for a conclusion whether to set `window-nest' to t by default
>> or to bind it individually where necessary?
>
> Setting it to t by default and _not_ binding it individually will have
> detrimental consequences for people who don't want it always t.  Juanma
> wants it always t because he wants to control the layout of his windows.
> I'm more sloppy in this respect.  Hence if we choose to handle this via
> `window-nest' we should bind that individually.
>
>> Are there other options?
>
> You could try writing a suitable buffer display function ;-)

Below is a new buffer display function created from `dired-pop-to-buffer'
that can be used in all packages that need this functionality like
Dired and Proced (more could be fixed later if this is the right approach):

=== modified file 'lisp/window.el'
--- lisp/window.el	2011-10-30 08:29:56 +0000
+++ lisp/window.el	2011-10-31 10:05:16 +0000
@@ -4851,6 +4851,24 @@ (defun display-buffer-pop-up-window (buf
       (set-window-prev-buffers window nil)
       window)))
 
+(defun display-buffer-pop-up-window-below (buffer alist)
+  "Display BUFFER by popping up a new window below the selected window."
+  (let (
+	;; Stay within the confines of the initial window.
+	;; Don't resize other windows.  (Bug#1806 Bug#9873)
+	(window-nest t)
+	(split-window-preferred-function
+	 (lambda (window)
+	   (or (and (let ((split-height-threshold 0))
+		      (window-splittable-p (selected-window)))
+		    ;; Try to split the selected window vertically if
+		    ;; that's possible.  (Bug#1806)
+		    (split-window-below))
+	       ;; Otherwise, try to split WINDOW sensibly.
+	       (split-window-sensibly window))))
+	pop-up-frames)
+    (display-buffer-pop-up-window buffer alist)))
+
 (defun display-buffer--maybe-pop-up-frame-or-window (buffer alist)
   "Try displaying BUFFER based on `pop-up-frames' or `pop-up-windows'.
 
=== modified file 'lisp/dired.el'
--- lisp/dired.el	2011-10-30 01:56:03 +0000
+++ lisp/dired.el	2011-10-31 10:06:19 +0000
@@ -2873,17 +2873,7 @@ (defun dired-mark-prompt (arg files)
 
 (defun dired-pop-to-buffer (buf)
   "Pop up buffer BUF in a way suitable for Dired."
-  (let ((split-window-preferred-function
-	 (lambda (window)
-	   (or (and (let ((split-height-threshold 0))
-		      (window-splittable-p (selected-window)))
-		    ;; Try to split the selected window vertically if
-		    ;; that's possible.  (Bug#1806)
-		    (split-window-below))
-	       ;; Otherwise, try to split WINDOW sensibly.
-	       (split-window-sensibly window))))
-	pop-up-frames)
-    (pop-to-buffer (get-buffer-create buf)))
+  (pop-to-buffer (get-buffer-create buf) '(display-buffer-pop-up-window-below))
   ;; If dired-shrink-to-fit is t, make its window fit its contents.
   (when dired-shrink-to-fit
     ;; Try to not delete window when we want to display less than

=== modified file 'lisp/proced.el'
--- lisp/proced.el	2011-08-24 18:09:18 +0000
+++ lisp/proced.el	2011-10-31 10:07:56 +0000
@@ -1730,8 +1730,7 @@ (defun proced-send-signal (&optional sig
           (save-window-excursion
             ;; Analogous to `dired-pop-to-buffer'
             ;; Don't split window horizontally.  (Bug#1806)
-            (let (split-width-threshold)
-              (pop-to-buffer (current-buffer)))
+            (pop-to-buffer (current-buffer) '(display-buffer-pop-up-window-below))
             (fit-window-to-buffer (get-buffer-window) nil 1)
             (let* ((completion-ignore-case t)
                    (pnum (if (= 1 (length process-alist))






  reply	other threads:[~2011-10-31 10:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-26  2:03 bug#9873: 24.0.90; dired - window changes size when trying to delete more than one file Christoph Scholtes
2011-10-26  2:16 ` Juanma Barranquero
2011-10-26  2:50   ` Christoph Scholtes
2011-10-26  2:52     ` Juanma Barranquero
2011-10-26  9:22       ` martin rudalics
2011-10-26 11:08         ` Eli Zaretskii
2011-10-26 14:22           ` martin rudalics
2011-10-26 18:30             ` Eli Zaretskii
2011-10-27  9:51               ` martin rudalics
2011-10-27 10:23                 ` Eli Zaretskii
2011-10-27 13:15                   ` martin rudalics
2011-10-27  3:39         ` Christoph Scholtes
2011-10-27  9:53           ` martin rudalics
2011-10-28  8:12             ` Juri Linkov
2011-10-28 17:16               ` martin rudalics
2011-10-31 10:11                 ` Juri Linkov [this message]
2011-10-31 10:27                   ` martin rudalics
2011-11-03 19:42                     ` Juri Linkov
2012-10-04 18:31             ` Juri Linkov
2012-10-04 18:51               ` martin rudalics
2012-10-04 19:40                 ` Juri Linkov
2012-10-05  7:03                   ` martin rudalics

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=87y5w15v5h.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=9873@debbugs.gnu.org \
    --cc=cschol2112@googlemail.com \
    --cc=lekktu@gmail.com \
    --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.