window configurations no longer (since 21.5) include windows
Henry S. Thompson
ht at inf.ed.ac.uk
Mon Apr 7 09:15:22 EDT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Michael Sperber writes:
> Thanks for working on this!
You're welcome.
> Two questions:
>> ;;; Code:
>>
>> + ;; Protect two crucial functions from the impact of advice
>> + ;; (Any others need to be treated similarly?)
>> + ;; ht at inf.ed.ac.uk Sun Mar 16 09:27:35 2008
>> +
>> + (unless (fboundp 'orig-split-window)
>> + (fset 'orig-split-window (symbol-function 'split-window)))
>> +
>> + (unless (fboundp 'orig-delete-window)
>> + (fset 'orig-delete-window (symbol-function 'delete-window)))
>> +
>
> What specifically is this bit for? Did you see concrete instances of
> advice for `split-window' and `delete-window' that would break the
> window-configuration code?
Yes, for sure, in ecb. And I think this is justified in any case, as
historically the functions now in xemacs-window.el which involved
deleting or splitting windows were implemented in C, and did their
deletions and splits in C, so advising delete-window or split-window
didn't affect them. By making window-xemacs use private versions of
those functions, that functionality is preserved.
>> + (defmacro save-window-excursion/mapping (&rest body)
>> + "Execute BODY, preserving window sizes and contents.
>> + Restores which buffer appears in which window, where display starts,
>> + as well as the current buffer.
>> + Does not restore the value of point in current buffer.
>> + On non-error return, value is cons of BODY value and list of
>> + remapped windows (see set-window-configuration/mapping for
>> + more on remapping)."
>
> Do we really the need the cons return value?
No. Go ahead and remove it. I just did it for plug-to-plug
compatibility, as it were.
> It seems the return value of `save-window-excursion' is rarely
> used---I'd rather just return the mapping, and the let the user
> preserve the return value if necessary?
Yup.
> (I didn't see a use for `save-window-excursion/mapping' in your ECB
> patch, which is why I'm asking.)
Indeed. Turns out that set-window-excursion/mapping is much more
useful/likely to get used, I think.
ht
- --
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ht at inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
iD8DBQFH+h5qkjnJixAXWBoRAqyNAJwLJxo71vR5LwdKOhYzFDPx/yTdGQCfeIrR
IxAg2JVcP3nvykwf66ipPdQ=
=0/C5
-----END PGP SIGNATURE-----
More information about the XEmacs-Beta
mailing list