unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* moving window handling into lisp
@ 2009-07-27  8:32 Miles Bader
  2009-07-27 13:37 ` martin rudalics
       [not found] ` <4A87F8B8.6050102@gmx.at>
  0 siblings, 2 replies; 130+ messages in thread
From: Miles Bader @ 2009-07-27  8:32 UTC (permalink / raw)
  To: emacs-devel

I'm kind of confused by what exactly is going to happen with windows
(multiple competing vaguely-not-satisfying-and-confusing-at-least-
to-my-simple-brain proposals...), but my impression is that it's
desirable to have as much in lisp as possible.

[I apologize if some of what I say below duplicates what's been said
before; I often start zoning out when reading these long threads, and
miss stuff!]

The general approach I've always kind of assumed would be followed by
any extension of window handling in emacs has a very simple basis (at
least it _sounds_ simple :):

** Expose the (existing) window tree to lisp

Basically keep the same window objects we have today, but allow lisp
to get a handle on non-leaf window objects (today, AFAICT, lisp can
only ever see leaf windows).

Together with some low-level accessor/modifier functions, e.g. maybe:

   frame-root-window FRAME      => ROOT-WIN
   window-children WINDOW       => (LEFT-CHILD-WIN . RIGHT-CHILD-WIN)
   window-parent WINDOW         => PARENT-WIN
   set-window-children WINDOW LEFT-CHILD-WIN RIGHT-CHILD-WIN
   (etc)

A brief look suggests that much of the traditional window handling
code (`window-list', `other-window', `split-window', `delete-window',
`delete-other-windows', etc) could then be moved into lisp; none of
that code looks very complicated or dangerous.

With traditional user-level window handling functions in lisp,
exploring various higher level window frameworks/abstractions seems to
be easier.

Of course the basic assumption is that what we really want is to make
existing lisp windows a bit more malleable, rather than an entirely
new infrastructure.


** Extending window handling

As a separate layer on top of the above, my vague thinking is that the
various fancy behaviors desired for things like ECB could be
implemented as essentially hooks and window-properties etc that affect
the typical user-level window functions (which are now lisp).

For instance (these are simply rough ideas!):

 * A window-property which says "treat this window as the window root for
   purposes of C-x 1, C-x o, etc".  Note that the new low-level primitive
   functions (which I listed above) _wouldn't_ be affected, and any lisp
   code that wants to see the raw tree, can do so.

 * A window property that says (somehow, not sure of the exact form)
   "When looking for a window leaf (C-x 0, C-x o, etc), use <parent
   window X> instead".

 * A buffer-local hook which gets run after setting a window's buffer to
   that buffer.  (I guess window-configuration-change-hook covers this to
   some degree, but it can be annoying to use)

[The first two properties probably would need some means of specifying
different behaviors for different operations -- what you want to
consider a "leaf" might be different depending on whether the user is
moving amongst windows or deleting them.]

Anyway, those are my vague ideas.  I hope I'm not simply adding to the
confusion...


-miles

-- 
Advice, n. The smallest current coin.




^ permalink raw reply	[flat|nested] 130+ messages in thread
* Re: moving window handling into lisp
@ 2009-08-17 19:06 grischka
  2009-08-18  7:13 ` martin rudalics
  2009-08-18 11:38 ` Lennart Borgman
  0 siblings, 2 replies; 130+ messages in thread
From: grischka @ 2009-08-17 19:06 UTC (permalink / raw)
  To: rudalics; +Cc: emacs-devel

From: martin rudalics
> > In a nutshell: whatever position is manipulated _directly_ is made an
> > integer at the time of the manipulation.  Window borders that are only
> > repositioned as an implicit (proportionate) result of some resizing
> > operation, do the bookkeeping of their position as a fraction that
> > corresponds to the resized ratios.
>
>
> Very neat idea, indeed.  As a matter of fact this should solve the frame
> re-resizing problem completely.

To solve a problem it not only needs the right algorithm but also the
right implementation.

Take for example proportional resizing as it is currently.  If I make a
frame with two windows side by side, 20 and 70 chars wide and if I maximize
the frame, the window widths are now 63 and 113, and if I un-maximize it
again the widths are now 31 and 59.  That clearly is not a problem that
can be solved by ideas, as neat as they may be.  It is plain simple broken
math.

--- grischka





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

end of thread, other threads:[~2009-08-24 13:10 UTC | newest]

Thread overview: 130+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-27  8:32 moving window handling into lisp Miles Bader
2009-07-27 13:37 ` martin rudalics
2009-07-27 13:41   ` Lennart Borgman
2009-07-27 13:45     ` martin rudalics
2009-07-27 13:58       ` Lennart Borgman
2009-07-27 14:35         ` martin rudalics
2009-07-27 14:41           ` Lennart Borgman
2009-07-27 15:02             ` martin rudalics
2009-07-27 15:28               ` Lennart Borgman
2009-07-27 16:52                 ` martin rudalics
2009-07-27 16:58                   ` Lennart Borgman
2009-07-27 18:18                   ` Stefan Monnier
2009-07-28  7:38                     ` martin rudalics
2009-07-28  9:39                       ` Lennart Borgman
2009-07-28 12:25                         ` martin rudalics
     [not found]                           ` <e01d8a50907280532kcff2d1w15567a430668a502@mail.gmail.com>
2009-07-28 13:23                             ` martin rudalics
2009-07-28 13:44                               ` Lennart Borgman
2009-07-29  9:04                                 ` martin rudalics
2009-07-28 13:47                       ` Stefan Monnier
2009-07-28 14:11                         ` Lennart Borgman
2009-07-29  9:05                         ` martin rudalics
2009-07-29 14:05                           ` Stefan Monnier
2009-08-01  2:20                             ` Miles Bader
2009-08-03 21:29                               ` Stefan Monnier
2009-08-11  9:18                             ` martin rudalics
2009-08-11 19:16                               ` Stefan Monnier
2009-08-11 19:29                                 ` Lennart Borgman
2009-08-12  8:57                                   ` martin rudalics
2009-08-12  9:02                                     ` Lennart Borgman
2009-08-12 13:33                                       ` martin rudalics
2009-08-12 15:57                                         ` Lennart Borgman
2009-08-12 17:05                                           ` martin rudalics
2009-08-12 19:39                                             ` Lennart Borgman
2009-08-12 21:10                                               ` Lennart Borgman
2009-08-13  9:55                                                 ` martin rudalics
2009-08-13  9:57                                                   ` Lennart Borgman
2009-08-13 10:25                                                     ` Lennart Borgman
2009-08-13 11:32                                                       ` Lennart Borgman
2009-08-13 12:49                                                         ` Lennart Borgman
2009-08-13 13:56                                                           ` martin rudalics
2009-08-13 16:43                                                             ` Lennart Borgman
2009-08-13 18:07                                                               ` martin rudalics
2009-08-14  1:13                                                                 ` Lennart Borgman
2009-08-14  7:18                                                                   ` martin rudalics
2009-08-14 11:21                                                                     ` Lennart Borgman
2009-08-14 13:21                                                                       ` martin rudalics
2009-08-12  8:56                                 ` martin rudalics
2009-08-13  2:32                                   ` Stefan Monnier
2009-08-13  9:54                                     ` martin rudalics
2009-08-13 17:00                                       ` Stefan Monnier
2009-08-13 18:09                                         ` martin rudalics
2009-08-14  1:47                                           ` Stephen J. Turnbull
2009-08-14  7:17                                             ` martin rudalics
2009-08-14  6:42                                       ` Richard Stallman
2009-08-14  7:18                                         ` martin rudalics
2009-08-14 20:56                                           ` Richard Stallman
2009-08-15 10:12                                             ` martin rudalics
2009-08-15 19:47                                               ` Stefan Monnier
2009-08-14 15:39                                         ` Stefan Monnier
2009-08-14 15:42                                           ` Lennart Borgman
2009-08-14 18:26                                             ` Stefan Monnier
2009-08-15 10:12                                           ` martin rudalics
2009-08-15 11:02                                             ` Lennart Borgman
2009-08-15 12:44                                               ` martin rudalics
2009-08-15 13:35                                                 ` David Kastrup
2009-08-15 13:39                                                   ` Lennart Borgman
2009-08-15 16:11                                                     ` martin rudalics
2009-08-15 16:19                                                       ` Lennart Borgman
2009-08-15 17:37                                                         ` martin rudalics
2009-08-15 18:18                                                           ` Lennart Borgman
2009-08-16 10:25                                                             ` martin rudalics
2009-08-16 11:14                                                               ` Lennart Borgman
2009-08-16 12:12                                                                 ` David Kastrup
2009-08-16 12:19                                                                   ` Lennart Borgman
2009-08-16 15:17                                                                   ` martin rudalics
2009-08-16 16:15                                                                     ` David Kastrup
2009-08-16 19:24                                                                       ` martin rudalics
2009-08-16 12:17                                                                 ` martin rudalics
2009-08-16 12:26                                                                   ` Lennart Borgman
2009-08-16 15:18                                                                     ` martin rudalics
2009-08-15 19:05                                                           ` Stephen J. Turnbull
2009-08-16 10:26                                                             ` martin rudalics
2009-08-16 11:16                                                               ` Lennart Borgman
2009-08-16 12:17                                                                 ` martin rudalics
2009-08-16 12:29                                                                   ` Lennart Borgman
2009-08-16 15:18                                                                     ` martin rudalics
2009-08-16 14:49                                                               ` Stephen J. Turnbull
2009-08-16 15:31                                                                 ` martin rudalics
2009-08-16 16:28                                                                   ` Stephen J. Turnbull
2009-08-16 19:25                                                                     ` martin rudalics
2009-08-15 15:07                                                   ` Jan Djärv
2009-08-15 15:38                                                     ` David Kastrup
2009-08-15 16:07                                                   ` martin rudalics
2009-08-15 18:21                                                     ` Stephen J. Turnbull
2009-08-16 10:25                                                       ` martin rudalics
2009-08-15 19:51                                             ` Stefan Monnier
2009-08-16 10:26                                               ` martin rudalics
2009-08-16 11:18                                                 ` Lennart Borgman
2009-08-16 12:17                                                   ` martin rudalics
2009-08-16 12:30                                                     ` Lennart Borgman
2009-07-27 14:00   ` Miles Bader
2009-07-27 14:36     ` martin rudalics
     [not found] ` <4A87F8B8.6050102@gmx.at>
     [not found]   ` <e01d8a50908160523r12216cffm34060d2793943785@mail.gmail.com>
     [not found]     ` <4A882312.6020106@gmx.at>
     [not found]       ` <e01d8a50908191816p2d9e978dw6aa0623c79dd8699@mail.gmail.com>
     [not found]         ` <4A8D12B3.6070502@gmx.at>
     [not found]           ` <e01d8a50908200219o69f67900lb9fa9368e9aadf62@mail.gmail.com>
     [not found]             ` <4A8D46C9.1010108@gmx.at>
     [not found]               ` <e01d8a50908200622y101e5b2bq9fb5874cbb8c81fe@mail.gmail.com>
     [not found]                 ` <4A8D66D5.3000600@gmx.at>
2009-08-20 15:41                   ` Lennart Borgman
2009-08-20 18:15                     ` martin rudalics
2009-08-20 23:08                       ` Lennart Borgman
2009-08-21 12:40                         ` martin rudalics
2009-08-21 13:58                           ` Lennart Borgman
2009-08-22 11:00                             ` martin rudalics
2009-08-22 13:45                               ` Lennart Borgman
2009-08-22 14:17                                 ` martin rudalics
2009-08-21 19:34                       ` Stefan Monnier
2009-08-22 11:01                         ` martin rudalics
2009-08-21  0:19                     ` Richard Stallman
2009-08-21 12:40                       ` martin rudalics
  -- strict thread matches above, loose matches on Subject: below --
2009-08-17 19:06 grischka
2009-08-18  7:13 ` martin rudalics
2009-08-18 11:38 ` Lennart Borgman
2009-08-19  9:15   ` grischka
2009-08-19 12:45     ` martin rudalics
2009-08-20 11:45       ` grischka
2009-08-20 12:51         ` martin rudalics
2009-08-20 13:05           ` David Kastrup
2009-08-20 15:08             ` martin rudalics
2009-08-20 19:35           ` grischka
2009-08-21 12:22             ` martin rudalics
2009-08-21 19:32               ` Stefan Monnier
2009-08-22  4:55                 ` Stephen J. Turnbull
2009-08-23  1:01                   ` Stefan Monnier
2009-08-24 13:10               ` grischka
2009-08-19 13:01     ` Lennart Borgman

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