jed-users mailing list

[2007 Date Index] [2007 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: jed start with n files in n windows?


On 23.11.07, Ulli Horlacher wrote:
> On Thu 2007-11-22 (16:53), Ulli Horlacher wrote:
> > I want to start jed with n files in n separate windows.

> Ok, I have now written this function:

> define autosplit() {
>   variable buf;

>   if (nwindows() > 1) return;

>   loop (buffer_list()) {
>     buf = ();
>     % skip internal/special buffers and already displayed buffers
>     !if ((buf[0] == ' ') or (buf[0] == '*') or buffer_visible(buf)) {
>       splitwindow;
>       sw2buf(buf);
>     }
>   }
> }

> which is called by startup_hook(). This does the trick :-)

> One small problem is left: with more than 2 windows the new window size 
> gets smaller and smaller. How could I make them the same size?

E.g. with fit_window() or window_set_rows() 
from http://jedmodes.sf.net/mode/bufutils/

This untested code snipped might do it::

  variable n = buffer_list()
  loop (n) {
    buf = ();
    % skip internal/special buffers and already displayed buffers
    !if ((buf[0] == ' ') or (buf[0] == '*') or buffer_visible(buf)) {
      splitwindow;
      sw2buf(buf);
      window_set_rows(1.0/n);
    }

GM

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2007 date index] [2007 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]