From: Matt Price <moptop99@gmail.com>
To: martin rudalics <rudalics@gmx.at>
Cc: help-gnu-emacs@gnu.org
Subject: Re: naming and/or directly addressing particular windows?
Date: Mon, 3 Dec 2012 14:58:50 -0500 [thread overview]
Message-ID: <CAN_Dec8Yey2+w09Ub4bcqgJQ0sPUMoDj6E5SfHhVJLLgjjVSNg@mail.gmail.com> (raw)
In-Reply-To: <50BCE495.4020604@gmx.at>
On Mon, Dec 3, 2012 at 12:42 PM, martin rudalics <rudalics@gmx.at> wrote:
>
> You frequently select a window for the sole purpose to apply
> `split-window-horizontally' to it. But it's better to use
> `select-window' exclusively for editing its buffer.
>
> I would recommend to rewrite this part as
>
> (let* ((main (split-window nil width t))
> (metadata (split-window main (- width) t)))
> (set-window-name (selected-window) "guide")
> (set-window-name main "main")
> (set-window-name metadata "metadata"))
>
wow, that's so much cleaner. again. thanks.
>> If you have any more hints for this next problem -- forcing an
>> indirect buffer to open in a particular window -- I'd be very
>> grateful.
>
> As a start try playing around with these:
>
> (defun display-buffer-in-foo (buffer alist)
> "Try displaying BUFFER in a window named *foo*."
> (let ((window (window-with-name "*foo*")))
> (when window
> (window--display-buffer
> buffer window 'reuse alist display-buffer-mark-dedicated))))
>
> (let ((display-buffer-alist
> (cons
> '("\\*foo\\*" (display-buffer-in-foo))
> display-buffer-alist)))
> (pop-to-buffer (get-buffer-create "*foo*")))
in the 'let' expression above, how would I replace \\*foo\\* and *foo*
with a regular expression that will match, say,
(concat (buffer-name) "-" [:digit:])
? I'm not quite clear on using regexes in emacs. thanks again so
much! I know I'm asking a lot of questions, I *am* trying things in
between but am getting stymied pretty quickly each time.
Matt
>
> martin
next prev parent reply other threads:[~2012-12-03 19:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-02 17:46 naming and/or directly addressing particular windows? martin rudalics
2012-12-03 12:38 ` Matt Price
2012-12-03 17:42 ` martin rudalics
2012-12-03 19:58 ` Matt Price [this message]
2012-12-03 20:58 ` Jambunathan K
2012-12-04 13:52 ` Matt Price
2012-12-04 9:01 ` martin rudalics
2012-12-05 16:11 ` Matt Price
-- strict thread matches above, loose matches on Subject: below --
2012-12-01 15:22 Matt Price
2012-12-01 15:59 ` Drew Adams
2012-12-02 5:31 ` Matt Price
2012-12-01 16:58 ` Eduardo Ochs
2012-12-02 2:41 ` Matt Price
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAN_Dec8Yey2+w09Ub4bcqgJQ0sPUMoDj6E5SfHhVJLLgjjVSNg@mail.gmail.com \
--to=moptop99@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=rudalics@gmx.at \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.