|
From: | Anders Lindgren |
Subject: | bug#19576: write-file writes the wrong buffer |
Date: | Tue, 17 Nov 2015 22:52:53 +0100 |
On Tue, Nov 17, 2015 at 02:55:39AM +0200, Juri Linkov wrote:
> >> Conceptually it should be easy to do that. Save/restore current buffer,
> >> selected window and frame. But Alan (concerned about ‘follow-mode’),
> >> Pip (who unfortunately disappeared) and Eli are currently discussing how
> >> to fix ‘window-size-change-functions’ in various other ways as well.
I have a fix for the `window-size-change-functions' problem, which I
posted just over an hour ago (see bug #21869 or #21333). The fix
consists of only invoking w-s-c-f after any change to the echo area size
has been done. This might have some relevance for the current bug. (I
haven't followed the current bug, I'm afraid.) I really need the
go-ahead from Eli before I can commit the fix to the emacs-25 or master
branch.
In general, follow mode is wonderful (I use it all the time),
but
(i) is not sufficiently integrated with the rest of Emacs, and
(ii) is too difficult to use in an emacs -Q.
By (ii), I mean that manually creating the side by side windows and
doing M-x follow-mode is too cumbersome.
follow-delete-other-windows-and-split is not bound to any key sequence
by default. I have my own private commands bound to C-c 2, C-c 3, C-c
4, which enable follow mode in 2, 3, and 4 windows. I also have C-c 0,
which disables follow mode. I think Emacs should have something like
these in its global key map, say on C-x w f. Maybe for Emacs 25.2, or
26.1.
By (i), I mean that other lisp programs cannot use follow mode. For
example, many programs use `window-start' to get the start of the area
they want to work on, when really what they should get is the start of
the "lowest" follow window.
I have, as yet, two
alternative implementations for this:
(i) New functions with names like window*-start (notice the "*"),
written in lisp in window.el;
(ii) Adding an extra parameter to the primitives (mainly in window.c),
so that instead of calling (window-start win), a function would call
(window-start win t).
Buffer local variables to perform the redirection are initialised at
follow-mode start up, and removed at follow-mode termination.
Of the above alternatives, Eli prefers (ii), but I think Juri prefers
(i).
[Prev in Thread] | Current Thread | [Next in Thread] |