all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Shrinking mini windows to one pixel height
@ 2018-03-03  9:06 martin rudalics
  2018-03-03 10:25 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: martin rudalics @ 2018-03-03  9:06 UTC (permalink / raw)
  To: emacs-devel

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

I just noticed that one can resize mini windows down to one pixel
which is maybe not what users want.  To reproduce with emacs -Q simply
type C-h f and drag the modeline of the only window down with the
mouse.  With some insistence you can make the minibuffer window almost
disappear.

A trivial patch is attached.  I think it should go to the release
branch but maybe the problem is too cosmetic for that.

Thanks, martin

[-- Attachment #2: window.el.diff --]
[-- Type: text/plain, Size: 670 bytes --]

--- a/lisp/window.el
+++ b/lisp/window.el
@@ -2730,13 +2730,14 @@ window--resize-mini-window
     (let* ((frame (window-frame window))
 	   (root (frame-root-window frame))
 	   (height (window-pixel-height window))
-	   (min-delta
+           (char-height (frame-char-height frame))
+           (min-delta
 	    (- (window-pixel-height root)
 	       (window-min-size root nil nil t))))
       ;; Sanitize DELTA.
       (cond
-       ((<= (+ height delta) 0)
-	(setq delta (- (frame-char-height (window-frame window)) height)))
+       ((<= (+ height delta) char-height)
+	(setq delta (- char-height height)))
        ((> delta min-delta)
 	(setq delta min-delta)))
 


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-03-03 17:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-03  9:06 Shrinking mini windows to one pixel height martin rudalics
2018-03-03 10:25 ` Eli Zaretskii
2018-03-03 11:28   ` martin rudalics
2018-03-03 12:03     ` Dmitry Gutov
2018-03-03 13:42       ` martin rudalics
2018-03-03 17:07       ` Drew Adams
2018-03-03 12:58     ` Eli Zaretskii
2018-03-03 13:42       ` martin rudalics

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.