unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Paul Rankin <hello@paulwrankin.com>, 24193@debbugs.gnu.org
Subject: bug#24193: 25.1; `window-min-size' fails for horizontal width when margins >= body text
Date: Tue, 09 Aug 2016 11:49:08 +0200	[thread overview]
Message-ID: <57A9A714.4010600@gmx.at> (raw)
In-Reply-To: <1470734067.1046352.690034953.5B0A54FE@webmail.messagingengine.com>

 > 1. emacs -Q
 > 2. in a frame 80 columns wide...
 > 3. M-: (set-window-margins nil 20 20)
 > 4. C-x 3
 >      => "Window #<window 1 on *scratch*> too small for splitting (2)"
 > 5. M-: (window-min-size nil t)
 >      => 42
 >
 > Expected results:
 >
 > Window should split horizontally. Minimum window width should not be dictated by margin width.
 >
 > Actual results:
 >
 > Margin width dictates minimum window width and prevents window splitting.

Correct.  The Elisp manual states

  -- Function: window-min-size &optional window horizontal ignore
           pixelwise
      This function returns the minimum size of WINDOW.  WINDOW must be
      a valid window and defaults to the selected one.  The optional
      argument HORIZONTAL non-`nil' means to return the minimum number
      of columns of WINDOW; otherwise return the minimum number of
      WINDOW's lines.

      The return value makes sure that all components of WINDOW remain
      fully visible if WINDOW's size were actually set to it.  With
      HORIZONTAL `nil' it includes the mode and header line, the
      horizontal scroll bar and the bottom divider, if present.  With
      HORIZONTAL non-`nil' it includes the margins and fringes, the
      vertical scroll bar and the right divider, if present.

If you want to make a smaller window you have to explicitly specify its
size:

(defun split-window-right-ignore (&optional size)
   (interactive)
   (split-window-right (or size (/ (window-total-width) 2))))

(define-key ctl-x-map "3" 'split-window-right-ignore)

martin





  reply	other threads:[~2016-08-09  9:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09  9:14 bug#24193: 25.1; `window-min-size' fails for horizontal width when margins >= body text Paul Rankin
2016-08-09  9:49 ` martin rudalics [this message]
2016-08-09 10:01   ` Paul Rankin
2016-08-09 10:15     ` martin rudalics
2016-08-09 10:37       ` Paul Rankin
2016-08-09 14:57         ` Eli Zaretskii
2016-08-09 15:18           ` Paul Rankin
2016-08-09 15:53             ` Eli Zaretskii
2016-08-14  5:11               ` Paul Rankin
2016-08-14 14:32                 ` Eli Zaretskii
2016-08-15  8:28                   ` martin rudalics
2016-08-15 10:02                     ` Paul Rankin
2016-08-16  7:35                       ` martin rudalics
2016-08-15 15:03                     ` Eli Zaretskii
2016-08-16  7:35                       ` martin rudalics
2016-08-16 14:19                         ` Eli Zaretskii
2016-09-02  4:06                           ` Paul Rankin
2016-09-02  6:29                             ` martin rudalics
2020-09-04 13:09                             ` Lars Ingebrigtsen
2020-09-04 13:41                               ` Eli Zaretskii
2020-09-04 14:54                               ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-05 12:28                                 ` Lars Ingebrigtsen
2016-08-09 16:08         ` martin rudalics
2016-08-14  5:24           ` Paul Rankin
2016-08-09 14:56 ` 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=57A9A714.4010600@gmx.at \
    --to=rudalics@gmx.at \
    --cc=24193@debbugs.gnu.org \
    --cc=hello@paulwrankin.com \
    /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).