unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 11276@debbugs.gnu.org
Subject: bug#11276: minibuffers windows can no longer explictly be resized
Date: Thu, 19 Apr 2012 19:18:21 +0200	[thread overview]
Message-ID: <4F9048DD.7010808@gmx.at> (raw)
In-Reply-To: <83zka7iy7t.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1255 bytes --]

 >> First bug.  I forgot that one can invoke `enlarge-window' and
 >> `shrink-window' in the minibuffer window.  I'm not sure though whether these
 >> should have any effect when `resize-mini-windows' is non-nil.
 >
 > For compatibility with previous versions of Emacs, I think it
 > shouldn't, at least not on the emacs-24 branch.

Sorry, my formulation was probably unclear.  In Emas 23 you can often
resize the active minibuffer window manually (via `enlarge-window' or
`adjust-window-trailing-edge') regardless of the setting of
`resize-mini-windows'.  So should we keep that behavior or allow manual
resizing only when `resize-mini-windows' is nil?

 > resize-mini-windows is a misnomer: it actually means "mini-window size
 > is controlled by display engine".  That's why window-sizing commands
 > in previous versions never paid heed to it, only redisplay did.  And
 > that's why, quite counter-intuitively, setting it to _nil_ allows the
 > user to resize the mini-window.

The passive mini-window IIUC.

 > We could make the implementation more in line with the name in future
 > versions, if we want, of course.

That's another issue.

Please try the new patch I attached.  It should mimic the behavior of
Emacs 23 as close as possible.

martin

[-- Attachment #2: resize-mini-window.diff --]
[-- Type: text/plain, Size: 2770 bytes --]

=== modified file 'lisp/mouse.el'
--- lisp/mouse.el	2012-01-19 07:21:25 +0000
+++ lisp/mouse.el	2012-04-19 17:09:19 +0000
@@ -406,9 +406,11 @@
 		       (mouse-on-link-p start)))
 	 (enlarge-minibuffer
 	  (and (eq line 'mode)
-	       (not resize-mini-windows)
-	       (eq (window-frame minibuffer-window) frame)
-	       (not (one-window-p t frame))
+	       ;; Enlarge the minibuffer window iff it's either selected
+	       ;; or `resize-mini-windows' is nil.
+	       (or (not resize-mini-windows)
+		   (eq minibuffer-window (selected-window)))
+	       (not (one-window-p))
 	       (= (nth 1 (window-edges minibuffer-window))
 		  (nth 3 (window-edges window)))))
 	 (which-side

=== modified file 'lisp/window.el'
--- lisp/window.el	2012-04-11 02:36:04 +0000
+++ lisp/window.el	2012-04-19 17:09:12 +0000
@@ -1991,17 +1991,21 @@
 the left.  If the edge can't be moved by DELTA lines or columns,
 move it as far as possible in the desired direction."
   (setq window (window-normalize-window window))
-  (let ((frame (window-frame window))
-	(right window)
-	left this-delta min-delta max-delta)
+  (let* ((frame (window-frame window))
+	 (minibuffer-window (minibuffer-window frame))
+	 (right window)
+	 left this-delta min-delta max-delta)
     ;; Find the edge we want to move.
     (while (and (or (not (window-combined-p right horizontal))
 		    (not (window-right right)))
 		(setq right (window-parent right))))
     (cond
-     ((and (not right) (not horizontal) (not resize-mini-windows)
-	   (eq (window-frame (minibuffer-window frame)) frame))
-      (window--resize-mini-window (minibuffer-window frame) (- delta)))
+     ((and (not right) (not horizontal)
+	   ;; Resize the minibuffer window iff it's either active or
+	   ;; `resize-mini-windows' is nil. 
+	   (or (not resize-mini-windows)
+	       (eq minibuffer-window (selected-window))))
+      (window--resize-mini-window minibuffer-window (- delta)))
      ((or (not (setq left right)) (not (setq right (window-right right))))
       (if horizontal
 	  (error "No window on the right of this one")
@@ -2102,6 +2106,8 @@
    ((zerop delta))
    ((window-size-fixed-p nil horizontal)
     (error "Selected window has fixed size"))
+   ((and (window-minibuffer-p) (not horizontal))
+    (window--resize-mini-window (selected-window) delta))
    ((window--resizable-p nil delta horizontal)
     (window-resize nil delta horizontal))
    (t
@@ -2124,6 +2130,8 @@
    ((zerop delta))
    ((window-size-fixed-p nil horizontal)
     (error "Selected window has fixed size"))
+   ((and (window-minibuffer-p) (not horizontal))
+    (window--resize-mini-window (selected-window) (- delta)))
    ((window--resizable-p nil (- delta) horizontal)
     (window-resize nil (- delta) horizontal))
    (t



  parent reply	other threads:[~2012-04-19 17:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-19  1:04 bug#11276: minibuffers windows can no longer explictly be resized Glenn Morris
2012-04-19  6:56 ` martin rudalics
2012-04-19  7:12   ` Glenn Morris
2012-04-19 10:42     ` martin rudalics
2012-04-19 14:37       ` Eli Zaretskii
2012-04-19 15:13         ` Drew Adams
2012-04-19 17:18         ` martin rudalics [this message]
2012-04-20  7:43           ` Eli Zaretskii
2012-04-20 10:01             ` martin rudalics
2012-04-20 10:16               ` Eli Zaretskii
2012-04-21  1:01               ` Glenn Morris
2012-04-19 14:31   ` Eli Zaretskii
2012-04-19 17:23     ` martin rudalics
2012-04-20  7:47       ` Eli Zaretskii
2012-04-20 10:01         ` martin rudalics
2012-04-20 10:49           ` Eli Zaretskii
2012-04-20 12:05             ` martin rudalics
2012-04-20 14:17               ` Eli Zaretskii
2012-04-20 15:31                 ` martin rudalics
2012-04-19 14:28 ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F9048DD.7010808@gmx.at \
    --to=rudalics@gmx.at \
    --cc=11276@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 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).