all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Shrinking mini windows to one pixel height
Date: Sat, 03 Mar 2018 10:06:18 +0100	[thread overview]
Message-ID: <5A9A658A.5080207@gmx.at> (raw)

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


             reply	other threads:[~2018-03-03  9:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-03  9:06 martin rudalics [this message]
2018-03-03 10:25 ` Shrinking mini windows to one pixel height 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

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=5A9A658A.5080207@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@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 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.