all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: rswgnu@gmail.com, emacs-devel <emacs-devel@gnu.org>
Subject: Re: Any way to prevent window splits for a window or a major-mode
Date: Sat, 02 Dec 2017 11:17:05 +0100	[thread overview]
Message-ID: <5A227DA1.9060200@gmx.at> (raw)
In-Reply-To: <CA+OMD9j-ahd5iYjRQ=+hbP6nw5n6FLYg-VqzESOCnytuMDWKCA@mail.gmail.com>

 > For a window, I would like to be able to mark it so it is never split.

The most simple approach is the one Drew mentioned, something like

(set-window-parameter nil 'split-window #'ignore)

for the selected window.  But this might be too strong with functions
(like `display-buffer') that expect a window to be splittable if it's
just large enough.  So fixing the window size by setting its buffer's
`window-size-fixed' variable or the window's 'window-preserved-size'
parameter as Eric suggested could be more appropriate.  But maybe you
should tell us more about the case where you need such a property -
`split-window' is just the Emacs paradigm for creating a new window
adjacent to an existing one.

 > For a major mode, I would like to say for any windows displaying buffers in
 > this major mode, don't split them.
 >
 > Is there a simple way to program that?

You will have to put a function on `window-configuration-change-hook'
which runs through every window and, if it displays a buffer in that
major mode, sets the 'split-window' parameter of that window to 'ignore'
or preserves that window's size.  And obviously the major mode hook
would have to add/remove that parameter for every window showing a
buffer where that mode is turned on/off.

martin



  parent reply	other threads:[~2017-12-02 10:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01 21:35 Any way to prevent window splits for a window or a major-mode Robert Weiner
2017-12-01 21:40 ` Eric Abrahamsen
2017-12-01 21:57 ` Drew Adams
2017-12-02 10:17 ` martin rudalics [this message]
2017-12-04 13:44   ` Robert Weiner
2017-12-05  8:53     ` martin rudalics
2017-12-05 17:04       ` Robert Weiner
2017-12-06  8:56         ` martin rudalics
2017-12-06 15:44           ` Robert Weiner
2017-12-07  9:27             ` martin rudalics
  -- strict thread matches above, loose matches on Subject: below --
2017-12-05 22:45 Robert Weiner
2017-12-06  8:56 ` martin rudalics
2017-12-06 18:11 ` Richard Stallman

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=5A227DA1.9060200@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@gnu.org \
    --cc=rswgnu@gmail.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 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.