[Top][All Lists]

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

Re: compilation-goto-locus, pop-up-windows, same-window-regexps

From: Alex Schroeder
Subject: Re: compilation-goto-locus, pop-up-windows, same-window-regexps
Date: Mon, 24 Mar 2003 21:35:06 +0100
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.3.50

Richard Stallman <address@hidden> writes:

>     >     I used to think that C-x r w 1 (store window config in register) was
>     >     the way to get back easily to complex window configurations, but it
>     >     turned out to not work.  For one, it remembered buffer positions,
>     >
>     > Perhaps we should add a way of restoring a window configuration
>     > that does not restore the positions.
>     I don't think that is enough, because when I want a "Gnus" window,
>     that window might hold the group buffer, the summary buffer, an
>     article, or a new message I am writing.
> I don't see precisely how that relates to the issue; could you spell
> out the connection?

"store window config in register" stores both the buffer and the
position per window.  The way I work, I care neither about the exact
position *nor* about the exact buffer in the context of Gnus.  The
reason is that I have a window for "reading mail", in it, different
buffers are shown at different times (group, summary, article,
message).  When I start working, I store the window configuration in
a register.  Later, I compiled code (which splits a window) and read
some mail (which splits the window), etc.  And now I want to restore
the window configuration.  In the Gnus window, however, I don't want
to see the buffer that was shown there at the time I stored the
window configuration.  I want to see the buffer that is most
appropriate (the one furthest down in the hierarchy) buffer.  In
fact, It should do something along the lines of my switch-to-gnus

    (defun switch-to-gnus ()
      "Switch to a Gnus related buffer.
    Candidates are buffers starting with
     *mail or *reply or *wide reply
    If no candidate exists, start Gnus."
      (let (candidate
            (tests '(("^\\*\\(mail\\|\\(wide \\)?reply\\)" . 1)
                     ("^\\*Article" . 2)
                     ("^\\*Summary" . 3)
                     ("^\\*Group" . 4))))
        (dolist (buf (buffer-list))
          (dolist (test tests)
            (when (and (string-match (car test) (buffer-name buf))
                       (or (not priority) (< (cdr test) priority))
                       (> (buffer-size buf) 0))
              (setq candidate buf
                    priority (cdr test)))))
        (if (buffer-live-p candidate)
            (switch-to-buffer candidate)

As you can see, this problem is difficult to solve in a generic way,
because the same problem arises when I work in a multi-file project.
When I want to undo the effect of window splitting due to compilation
and grepping, I really want to get the most recently used buffer for
the project -- not the buffer current at the time a window
configuration was stored in a register.

This is why I feel that Emacs should not touch the window
configuration if the user has indicated via some variable that the
window configuration is very important.


reply via email to

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