help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: naming and/or directly addressing particular windows?


From: Matt Price
Subject: Re: naming and/or directly addressing particular windows?
Date: Wed, 5 Dec 2012 11:11:01 -0500

On Tue, Dec 4, 2012 at 4:01 AM, martin rudalics <rudalics@gmx.at> wrote:
>> in the 'let' expression above, how would I replace \\*foo\\* and *foo*
>> with a regular expression that will match, say,
>>
>> (concat (buffer-name) "-" [:digit:])
>
> Try ".+-[0-9]$" instead of "\\*foo\\*" and "foo-1" instead of "*foo*".

ah, that works, though I was ble to get something slightly more
restrictive working instead:
  (let ((display-buffer-alist
         (cons
          `( ,(rx-to-string `(and ,(buffer-name) "-" (zero-or-more
digit))) (display-buffer-in-main))
          display-buffer-alist)))
    (org-tree-to-indirect-buffer))

>
> Note that if the purpose of your functions is to display buffers always
> approximately at the same location within an Emacs frame, then side
> windows (see the function `display-buffer-in-side-window' and the
> variables `window-sides-vertical' and `window-sides-slots') might be
> more appropriate.
>
> In your case there would be a centered "main window", the "guide window"
> at the left and the "metadata window" at the bottom of the frame.

I can see that would be better.  I seem to have some code working so
leaving it as-is for now but will hopefully return to this question
later.
>
> In any case be always aware of two issues:
>
> (1) A user may delete any window at any time (with a few restrictions).
>     So be prepared that you may have to re-create your windows and give
>     them a name for showing the buffer of your choice.
>
> (2) Emacs and other applications might reuse or split a window at any
>     time, for example, to display information like a warning or a
>     backtrace.
>
> You can fix some of these by making windows dedicated and/or fixing
> their sizes but doing that is not entirely trivial.

Yes, my code is rather fragile as it stands, and is going to need to
protect against those kind of disturbances somehow.  I'll have to
figure these issues out.

for now, I've put my fragile and incomplete code on github so org-mode
users can think about the interface design & make
suggestions/contributions:

https://github.com/titaniumbones/org-writers-room

I really appreciate all your help & hope that something useful comes
out of this!  Thanks again,
Matt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]