[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Jumping to C source from *Help*
From: |
Drew Adams |
Subject: |
RE: Jumping to C source from *Help* |
Date: |
Thu, 15 Apr 2004 09:08:06 -0700 |
FWIW, I still think this is the best change to make:
(defun switch-to-buffer (buffer &optional norecord)
...
(if (window-dedicated-p (selected-window))
(switch-to-buffer-other-window buffer) ; <-- instead of
pop-to-buffer
(old-switch-to-buffer buffer norecord)))
switch-to-buffer-other-window is the same as pop-to-buffer with a local
binding of (pop-up-windows t), so a new window is used. That's the behavior
I want when a dedicated window is involved. And if pop-up-frames is non-nil
(which it is, for me), I get a separate frame - again, the behavior I expect
& want.
Users can of course call whatever functions they like; they need not *try*
to switch to a different buffer in a window that forbids such a switch.
The problem is rather all the calls to switch-to-buffer in the standard
elisp code: about 400 in Emacs 20, no doubt more in Emacs 21. IMO, Emacs (at
least Emacs 20) is somewhat biased toward using Emacs windows, not frames,
so there are built-in calls to switch-to-buffer that can become
inappropriate when using non-nil pop-up-frames and dedicated windows
(frames).
- Drew
-----Original Message-----
From: address@hidden
[mailto:address@hidden Behalf Of
Kim F. Storm
Sent: Thursday, April 15, 2004 9:28 AM
To: Stefan Monnier
Cc: address@hidden; address@hidden; address@hidden
Subject: Re: Jumping to C source from *Help*
Stefan Monnier <address@hidden> writes:
> 3 - Change switch-to-buffer to call pop-to-buffer rather than signal an
> error and leave everything else unchanged.
>
> Option 1 has the problem that it doesn't fix anything in itself and
> requires to change all the packages to use the new function. In general,
> I can't change all those packages, so I'll still have to live with
> spurious errors every once in a while.
>
> Option 3 is better because it's the simplest. Now you might think that
you
> don't like it because it changes the default behavior, but think again:
> it only changes the behavior in the case where you used to get an error
> "Cannot switch buffers in minibuffer window" or
> "Cannot switch buffers in a dedicated window". When was the last time
> you saw such an error message? Most users have never seen this message
> because they don't have dedicated windows and they never hit C-x b
> while they're in the minibuffer.
I see the "cannot switch buffers in minibuffer window" from time to time.
And it always annoys me -- of course I don't want to switch buffer in
the minibuffer window, I obviously want to have the buffer I select to
appear in some ordinary window.
I'd vote for 3 as well.
- Re: Jumping to C source from *Help*, (continued)
- Re: Jumping to C source from *Help*, Miles Bader, 2004/04/20
- Re: Jumping to C source from *Help*, Nick Roberts, 2004/04/20
- Re: Jumping to C source from *Help*, Glenn Morris, 2004/04/20
- Re: Jumping to C source from *Help*, Kim F. Storm, 2004/04/21
- Re: Jumping to C source from *Help*, Stefan Monnier, 2004/04/21
- Re: Jumping to C source from *Help*, Richard Stallman, 2004/04/13
- Re: Jumping to C source from *Help*, Stefan Monnier, 2004/04/13
- Re: Jumping to C source from *Help*, Richard Stallman, 2004/04/14
- Re: Jumping to C source from *Help*, Stefan Monnier, 2004/04/15
- Re: Jumping to C source from *Help*, Kim F. Storm, 2004/04/15
- RE: Jumping to C source from *Help*,
Drew Adams <=
- Re: Jumping to C source from *Help*, Richard Stallman, 2004/04/16
- Re: Jumping to C source from *Help*, David Kastrup, 2004/04/16
- Re: Jumping to C source from *Help*, Richard Stallman, 2004/04/16
- Re: Jumping to C source from *Help*, Stefan Monnier, 2004/04/16
- Re: Jumping to C source from *Help*, Richard Stallman, 2004/04/17
- Re: Jumping to C source from *Help*, Stefan Monnier, 2004/04/19
- Re: Jumping to C source from *Help*, Richard Stallman, 2004/04/18
- Re: Jumping to C source from *Help*, Stefan Monnier, 2004/04/19