unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* C-x 3 (split-window-horizontally) & C-x 1 (delete-other-windows)
@ 2008-05-05 18:16 Sam Steingold
  2008-05-05 18:44 ` Tassilo Horn
  2008-05-06  1:32 ` David Hansen
  0 siblings, 2 replies; 11+ messages in thread
From: Sam Steingold @ 2008-05-05 18:16 UTC (permalink / raw)
  To: emacs-devel

GNU Emacs 23.0.60.4 (x86_64-unknown-linux-gnu, GTK+ Version 2.8.20)
 of 2008-05-05 on nyc-qws-005
 '--with-x-toolkit=gtk' '--prefix=/mnt/office/dev/opt'

When I split the emacs window horizontally and maximize the frame (X
window), I get two 80-char-wide buffers + wide menu bar which can
accommodate even the dired menus, which is very convenient.
I see 2 issues with this arrangement:

1. even though I can imagine that I might want to have one 160-char-wide
   window every once in a while, by far the more common situation would
   be wanting to preserve 2 columns.  Thus I would want C-x 1 to delete
   all other windows in the current column and leave the other column
   intact (as if the other column were a separate frame glued to this
   one side by side)

2. it would be nice to be able to drag the separator between the columns
   with the mouse to resize the windows, much like it is done with the
   vertically split windows (one can drag the mode line).

-- 
Sam Steingold (http://sds.podval.org/) on Fedora Core release 5 (Bordeaux)
http://jihadwatch.org http://camera.org http://pmw.org.il
http://dhimmi.com http://iris.org.il http://openvotingconsortium.org
If at first you don't suck seed, try and suck another seed.




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

* Re: C-x 3 (split-window-horizontally) & C-x 1 (delete-other-windows)
  2008-05-05 18:16 C-x 3 (split-window-horizontally) & C-x 1 (delete-other-windows) Sam Steingold
@ 2008-05-05 18:44 ` Tassilo Horn
  2008-05-05 19:25   ` Stefan Monnier
  2008-05-05 20:13   ` Sam Steingold
  2008-05-06  1:32 ` David Hansen
  1 sibling, 2 replies; 11+ messages in thread
From: Tassilo Horn @ 2008-05-05 18:44 UTC (permalink / raw)
  To: emacs-devel

"Sam Steingold" <ssteingold@janestcapital.com> writes:

Hi Sam,

> When I split the emacs window horizontally and maximize the frame (X
> window), I get two 80-char-wide buffers + wide menu bar which can
> accommodate even the dired menus, which is very convenient.  I see 2
> issues with this arrangement:
>
> 1. even though I can imagine that I might want to have one 160-char-wide
>    window every once in a while, by far the more common situation would
>    be wanting to preserve 2 columns.  Thus I would want C-x 1 to delete
>    all other windows in the current column and leave the other column
>    intact (as if the other column were a separate frame glued to this
>    one side by side)

Yes, that's my preference, too.  I've bound the function
`th-delete-other-windows' to `C-x 1' to get that behavior.

--8<---------------cut here---------------start------------->8---
(require 'windmove)

(defun th-delete-other-windows-vertically ()
  "Delete all windows above or below the current window."
  (interactive)
  (let ((win (selected-window)))
    (save-excursion
      (while (condition-case nil (windmove-up) (error nil))
        (delete-window)
        (select-window win))
      (while (condition-case nil (windmove-down) (error nil))
        (delete-window)
        (select-window win)))))

(defun  th-delete-other-windows-horizontally ()
  "Delete all windows left or right of the current window."
  (interactive)
  (let ((win (selected-window)))
    (save-excursion
      (while (condition-case nil (windmove-left) (error nil))
        (delete-window)
        (select-window win))
      (while (condition-case nil (windmove-right) (error nil))
        (delete-window)
        (select-window win)))))

(defun th-delete-other-windows (&optional arg)
  "If ARG is 1 (no prefix arg given) or 2 delete all windows
which are above or below the current window. If ARG is 3 delete
all windows which are left or right of the current window. If
prefix arg is negative, delete all other windows."
  (interactive "p")
  (cond
   ((< arg 0) (delete-other-windows))
   ((= arg 2) (th-delete-other-windows-vertically))
   ((= arg 3) (th-delete-other-windows-horizontally))
   (t (th-delete-other-windows-vertically))))
--8<---------------cut here---------------end--------------->8---

A bit hackish, but works.

> 2. it would be nice to be able to drag the separator between the columns
>    with the mouse to resize the windows, much like it is done with the
>    vertically split windows (one can drag the mode line).

Well, here that's possible.  The mouse pointer turns to <-> on the right
fringe of the left window.

Bye,
Tassilo




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

* Re: C-x 3 (split-window-horizontally) & C-x 1 (delete-other-windows)
  2008-05-05 18:44 ` Tassilo Horn
@ 2008-05-05 19:25   ` Stefan Monnier
  2008-05-05 20:57     ` martin rudalics
  2008-05-05 20:13   ` Sam Steingold
  1 sibling, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2008-05-05 19:25 UTC (permalink / raw)
  To: emacs-devel

>> When I split the emacs window horizontally and maximize the frame (X
>> window), I get two 80-char-wide buffers + wide menu bar which can
>> accommodate even the dired menus, which is very convenient.  I see 2
>> issues with this arrangement:
>> 
>> 1. even though I can imagine that I might want to have one 160-char-wide
>> window every once in a while, by far the more common situation would
>> be wanting to preserve 2 columns.  Thus I would want C-x 1 to delete
>> all other windows in the current column and leave the other column
>> intact (as if the other column were a separate frame glued to this
>> one side by side)

The proposal to add a notion of `group' of windows (via a `group'
window property) would do exactly what you want, AFAICT, although it's
currently designed with the intention to mimick some IDEs and to provide
features similar to what ECB needs.


        Stefan




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

* Re: C-x 3 (split-window-horizontally) & C-x 1 (delete-other-windows)
  2008-05-05 18:44 ` Tassilo Horn
  2008-05-05 19:25   ` Stefan Monnier
@ 2008-05-05 20:13   ` Sam Steingold
  2008-05-05 20:26     ` Tassilo Horn
  1 sibling, 1 reply; 11+ messages in thread
From: Sam Steingold @ 2008-05-05 20:13 UTC (permalink / raw)
  To: emacs-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Tassilo
| "Sam Steingold" <ssteingold@janestcapital.com> writes:
|
|> 2. it would be nice to be able to drag the separator between the columns
|>    with the mouse to resize the windows, much like it is done with the
|>    vertically split windows (one can drag the mode line).
|
| Well, here that's possible.  The mouse pointer turns to <-> on the right
| fringe of the left window.

I don't see this.
what package enables this behavior?

thanks.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIH2pvPp1Qsf2qnMcRAtaPAKCbsUGApOwOnrBcfJE+z77NwPB3MACeIiVe
SWhh7h8lJ/DJIa9rotD12+A=
=ZdsY
-----END PGP SIGNATURE-----




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

* Re: C-x 3 (split-window-horizontally) & C-x 1 (delete-other-windows)
  2008-05-05 20:13   ` Sam Steingold
@ 2008-05-05 20:26     ` Tassilo Horn
  2008-05-05 20:57       ` martin rudalics
  2008-05-05 21:35       ` Jason Rumney
  0 siblings, 2 replies; 11+ messages in thread
From: Tassilo Horn @ 2008-05-05 20:26 UTC (permalink / raw)
  To: emacs-devel

Sam Steingold <sds@gnu.org> writes:

Hi Sam,

> |> 2. it would be nice to be able to drag the separator between the columns
> |>    with the mouse to resize the windows, much like it is done with the
> |>    vertically split windows (one can drag the mode line).
> |
> | Well, here that's possible.  The mouse pointer turns to <-> on the
> | right fringe of the left window.
>
> I don't see this.
> what package enables this behavior?

You don't need an extra package, but it seems you have to disable
scroll-bar-mode.  (IMO that's a bug, isn't it?)

But even with scroll-bar-mode you can resize the windows by dragging at
the position where both mode-lines meet.

Bye,
Tassilo




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

* Re: C-x 3 (split-window-horizontally) & C-x 1 (delete-other-windows)
  2008-05-05 20:26     ` Tassilo Horn
@ 2008-05-05 20:57       ` martin rudalics
  2008-05-05 21:19         ` David Kastrup
  2008-05-05 21:35       ` Jason Rumney
  1 sibling, 1 reply; 11+ messages in thread
From: martin rudalics @ 2008-05-05 20:57 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: emacs-devel

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

 > You don't need an extra package, but it seems you have to disable
 > scroll-bar-mode.  (IMO that's a bug, isn't it?)

If you use fringes you can try the attached functions.  I once tried to
detect lateral down-mouse-1's on the scroll-bar but gave up soon.  IMHO
Emacs should provide both vertical and horizontal dividers, at least
optionally.  Hence I agree, it's a bug, and - patches welcome.

[-- Attachment #2: drag-vertical-line.el --]
[-- Type: application/emacs-lisp, Size: 3181 bytes --]

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

* Re: C-x 3 (split-window-horizontally) & C-x 1 (delete-other-windows)
  2008-05-05 19:25   ` Stefan Monnier
@ 2008-05-05 20:57     ` martin rudalics
  0 siblings, 0 replies; 11+ messages in thread
From: martin rudalics @ 2008-05-05 20:57 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

 >>>1. even though I can imagine that I might want to have one 160-char-wide
 >>>window every once in a while, by far the more common situation would
 >>>be wanting to preserve 2 columns.  Thus I would want C-x 1 to delete
 >>>all other windows in the current column and leave the other column
 >>>intact (as if the other column were a separate frame glued to this
 >>>one side by side)
 >
 > The proposal to add a notion of `group' of windows (via a `group'
 > window property) would do exactly what you want, AFAICT, although it's
 > currently designed with the intention to mimick some IDEs and to provide
 > features similar to what ECB needs.

I'm currently considering an option called max-window-height|width.
Suggestions welcome.





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

* Re: C-x 3 (split-window-horizontally) & C-x 1 (delete-other-windows)
  2008-05-05 20:57       ` martin rudalics
@ 2008-05-05 21:19         ` David Kastrup
  2008-05-05 21:50           ` martin rudalics
  0 siblings, 1 reply; 11+ messages in thread
From: David Kastrup @ 2008-05-05 21:19 UTC (permalink / raw)
  To: martin rudalics; +Cc: Tassilo Horn, emacs-devel

martin rudalics <rudalics@gmx.at> writes:

>> You don't need an extra package, but it seems you have to disable
>> scroll-bar-mode.  (IMO that's a bug, isn't it?)
>
> If you use fringes you can try the attached functions.  I once tried
> to detect lateral down-mouse-1's on the scroll-bar but gave up soon.

Please don't.  I find it a complete abomination that MS Windows'
scrollbars snap back if you accidentally skid off sideways while
dragging (dragging exactly vertically is rather hard).

Having this operation resize the windows would be even worse.  I don't
want to be forced into having to steady my hand horizontally when doing
a vertical operation.

The annoyance possibly would be less if the larger of the drag offsets
(X or Y) would win out, but that means that the drag mode might jump
from one to the other with a somewhat jarring effect.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




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

* Re: C-x 3 (split-window-horizontally) & C-x 1 (delete-other-windows)
  2008-05-05 20:26     ` Tassilo Horn
  2008-05-05 20:57       ` martin rudalics
@ 2008-05-05 21:35       ` Jason Rumney
  1 sibling, 0 replies; 11+ messages in thread
From: Jason Rumney @ 2008-05-05 21:35 UTC (permalink / raw)
  To: emacs-devel

Tassilo Horn wrote:
> You don't need an extra package, but it seems you have to disable
> scroll-bar-mode.  (IMO that's a bug, isn't it?)
>   

It's not a bug so much as a limitation in some toolkit scrollbars.





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

* Re: C-x 3 (split-window-horizontally) & C-x 1 (delete-other-windows)
  2008-05-05 21:19         ` David Kastrup
@ 2008-05-05 21:50           ` martin rudalics
  0 siblings, 0 replies; 11+ messages in thread
From: martin rudalics @ 2008-05-05 21:50 UTC (permalink / raw)
  To: David Kastrup; +Cc: Tassilo Horn, emacs-devel

 > Please don't.  I find it a complete abomination that MS Windows'
 > scrollbars snap back if you accidentally skid off sideways while
 > dragging (dragging exactly vertically is rather hard).
 >
 > Having this operation resize the windows would be even worse.  I don't
 > want to be forced into having to steady my hand horizontally when doing
 > a vertical operation.

That was my conclusion, indeed.

 > The annoyance possibly would be less if the larger of the drag offsets
 > (X or Y) would win out, but that means that the drag mode might jump
 > from one to the other with a somewhat jarring effect.

I envisioned some sort of "dead angle" where dragging didn't have any
effect.  But the transition would have to be done in some smooth way and
I didn't see any great benefits in this so I gave up.





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

* Re: C-x 3 (split-window-horizontally) & C-x 1 (delete-other-windows)
  2008-05-05 18:16 C-x 3 (split-window-horizontally) & C-x 1 (delete-other-windows) Sam Steingold
  2008-05-05 18:44 ` Tassilo Horn
@ 2008-05-06  1:32 ` David Hansen
  1 sibling, 0 replies; 11+ messages in thread
From: David Hansen @ 2008-05-06  1:32 UTC (permalink / raw)
  To: emacs-devel

On Mon, 05 May 2008 14:16:26 -0400 Sam Steingold wrote:

> 1. even though I can imagine that I might want to have one 160-char-wide
>    window every once in a while, by far the more common situation would
>    be wanting to preserve 2 columns.  Thus I would want C-x 1 to delete
>    all other windows in the current column and leave the other column
>    intact (as if the other column were a separate frame glued to this
>    one side by side)
>

(defun dh-max-window-vertically ()
  (interactive)
  (enlarge-window 4200))

(defun dh-max-window-horizontally ()
  (interactive)
  (enlarge-window-horizontally 4200))

David






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

end of thread, other threads:[~2008-05-06  1:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-05 18:16 C-x 3 (split-window-horizontally) & C-x 1 (delete-other-windows) Sam Steingold
2008-05-05 18:44 ` Tassilo Horn
2008-05-05 19:25   ` Stefan Monnier
2008-05-05 20:57     ` martin rudalics
2008-05-05 20:13   ` Sam Steingold
2008-05-05 20:26     ` Tassilo Horn
2008-05-05 20:57       ` martin rudalics
2008-05-05 21:19         ` David Kastrup
2008-05-05 21:50           ` martin rudalics
2008-05-05 21:35       ` Jason Rumney
2008-05-06  1:32 ` David Hansen

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