unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Alan E. Davis" <lngndvs@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Question on splitting windows
Date: Wed, 10 Aug 2011 06:58:19 -0700	[thread overview]
Message-ID: <CAF-1L2SnLrAA7gHmgyxx7SnLceOwA_foPD8TQKx+hA8aa-TD6Q@mail.gmail.com> (raw)
In-Reply-To: <CAF-1L2TLyqGZcDMH459isH5WhWeBOiLhoQvyEdcV2aZQXzoJrw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1817 bytes --]

I'm out of my element, but years ago  I used a couple of little utilities
for switching windows in a console (now I would call it a frame).  Perhaps
it could be adapted to side by side windows.

For the top and bottom version one of the windows would be exaggerated, and
the other one shrunk to two or three lines only.   The utilities would
either swap the buffers, so the shrunken one would move into the large
window, where the cursor was now positioned on the previously shrunken
buffer, and visa versa.  This way, two buffers could be kept open in one
frame.
The utility I preferred would leave the buffers in the same windows, but
move the cursor, and swap the sizes.

These are simple and effective approaches.  Certainly they could be
improved, and perhaps adapted to the current problem.  I would like to use
such a utility with Org-mode, to switch back and forth between the agenda
buffer and the window where the todo items are following.   Or other
purposes.

I'll attach the utility called "flip-flop-and-change-windows."   The utility
"swap window-positions" was written by, I think, Steven Gildea, many moons
ago.   I apologize for the terminological morass I resorted to above.  At
this point, I'm so far away from doing any programming that I haven't had
time to sit and think it through.  Hope it's helpful.

Alan Davis



On Thu, Aug 4, 2011 at 1:18 PM, Frederik <freak.fred@gmail.com> wrote:

> >> I agree -- it's quite a good pointer, but splitting horizontally would
> >> be even better...
> >>
> >> Thanks & regards
> >
> > You can muck with split-width-threshold and split-height-threshold to
> > make behave the way you want.
> >
>
> Jup, that's it. Thanks!
>
> The docstring of `split-window-sensibly' is most helpful:
> C-h f split-window-sensibly RET
>
> Regards
>
>
> --
> Frederik
>
>
>

[-- Attachment #1.2: Type: text/html, Size: 2441 bytes --]

[-- Attachment #2: flip-flop-and-change-windows.el --]
[-- Type: text/x-emacs-lisp, Size: 575 bytes --]

;;; Taken from .emacs.el Mon Jun 12 21:33:40 1995  AED, and rewritten with (let...
(defun flip-flop-and-change-windows ()
  "Swap window sizes; move into the other window.  This function
enables one to have two windows visible, but with one reduced to two lines."
   (interactive)
   (let ((current-window-height (window-height)) 
	 (new-window-height nil)
	 (delta-window-height nil))
     (other-window 1)
     (setq new-window-height (window-height))
     (setq delta-window-height (- current-window-height new-window-height))
     (enlarge-window delta-window-height)))


[-- Attachment #3: swap-windows.el --]
[-- Type: text/x-emacs-lisp, Size: 946 bytes --]

(defun swap-window-positions ()
  "Swap the positions of this window and the next one.
gildea Nov 88"
  (interactive)
  (let ((other-window (next-window (selected-window) 'no-minibuf)))
    (let ((other-window-buffer (window-buffer other-window))
	  (other-window-hscroll (window-hscroll other-window))
	  (other-window-point (window-point other-window))
	  (other-window-start (window-start other-window)))
      (set-window-buffer other-window (current-buffer))
      (set-window-hscroll other-window (window-hscroll (selected-window)))
      (set-window-point other-window (point))
      (set-window-start other-window (window-start (selected-window)))
      (set-window-buffer (selected-window) other-window-buffer)
      (set-window-hscroll (selected-window) other-window-hscroll)
      (set-window-point (selected-window) other-window-point)
      (set-window-start (selected-window) other-window-start))
    (select-window other-window)))

  parent reply	other threads:[~2011-08-10 13:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-04  9:21 Question on splitting windows Frederik
2011-08-04 14:59 ` Drew Adams
2011-08-04 15:06   ` Jai Dayal
2011-08-04 15:23     ` Vijay Lakshminarayanan
2011-08-04 15:46     ` Frederik
2011-08-04 19:43       ` Eric Abrahamsen
2011-08-04 20:18         ` Frederik
     [not found]           ` <CAF-1L2TLyqGZcDMH459isH5WhWeBOiLhoQvyEdcV2aZQXzoJrw@mail.gmail.com>
2011-08-10 13:58             ` Alan E. Davis [this message]
     [not found]     ` <87sjphw6cl.fsf@gmail.com>
2011-08-04 16:26       ` Jai Dayal
2011-08-04 18:30         ` Vijay Lakshminarayanan

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=CAF-1L2SnLrAA7gHmgyxx7SnLceOwA_foPD8TQKx+hA8aa-TD6Q@mail.gmail.com \
    --to=lngndvs@gmail.com \
    --cc=help-gnu-emacs@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.
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).