carbon2-commit: Correct the implementation, add a few basic tests for #'skip-chars-quote.
16 years, 3 months
Aidan Kehoe
changeset: 4538:b82fdf7305eef16a68a94d48a5b532a589f0e55b
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Wed Aug 27 21:47:21 2008 +0200
files: lisp/ChangeLog lisp/subr.el tests/ChangeLog tests/automated/regexp-tests.el
description:
Correct the implementation, add a few basic tests for #'skip-chars-quote.
tests/ChangeLog addition:
2008-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/regexp-tests.el:
Add a few basic #'skip-chars-forward, #'skip-chars-backward
tests.
lisp/ChangeLog addition:
2008-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
* subr.el (skip-chars-quote):
Correct the implementation, following the docstring of
#'skip-char-forward more closely rather than the documentation of
character classes in the Lispref.
diff -r af95657e0bfdbc887ab4900b5627cbaaf21e112a -r b82fdf7305eef16a68a94d48a5b532a589f0e55b lisp/ChangeLog
--- a/lisp/ChangeLog Wed Aug 27 00:39:09 2008 +0200
+++ b/lisp/ChangeLog Wed Aug 27 21:47:21 2008 +0200
@@ -1,3 +1,10 @@ 2008-08-23 Aidan Kehoe <kehoea@parhasa
+2008-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * subr.el (skip-chars-quote):
+ Correct the implementation, following the docstring of
+ #'skip-char-forward more closely rather than the documentation of
+ character classes in the Lispref.
+
2008-08-23 Aidan Kehoe <kehoea(a)parhasard.net>
* custom.el: Move #'custom-variable-p to C, since it's now called
diff -r af95657e0bfdbc887ab4900b5627cbaaf21e112a -r b82fdf7305eef16a68a94d48a5b532a589f0e55b lisp/subr.el
--- a/lisp/subr.el Wed Aug 27 00:39:09 2008 +0200
+++ b/lisp/subr.el Wed Aug 27 21:47:21 2008 +0200
@@ -1730,17 +1730,15 @@ Ranges and carets are not treated specia
Ranges and carets are not treated specially. This implementation is
in Lisp; do not use it in performance-critical code."
(let ((list (delete-duplicates (string-to-list string) :test #'=)))
- (when (equal list '((?- ?\[) (?\[ ?\-)))
- (error 'invalid-argument
- "Cannot create `skip-chars-forward' arg from string"
- string))
- (when (memq ?\] list)
- (setq list (cons ?\] (delq ?\] list))))
- (when (eq ?^ (car list))
- (setq list (nconc (cdr list) '(?^))))
- (when (memq ?- list)
- (setq list (delq ?- list)
- list (nconc list (list (second list) ?- (second list) ?-))))
+ (when (/= 1 (length list)) ;; No quoting needed in a string of length 1.
+ (when (eq ?^ (car list))
+ (setq list (nconc (cdr list) '(?^))))
+ (when (memq ?\\ list)
+ (setq list (delq ?\\ list)
+ list (nconc (list ?\\ ?\\) list)))
+ (when (memq ?- list)
+ (setq list (delq ?- list)
+ list (nconc list '(?\\ ?-)))))
(apply #'string list)))
;;; subr.el ends here
diff -r af95657e0bfdbc887ab4900b5627cbaaf21e112a -r b82fdf7305eef16a68a94d48a5b532a589f0e55b tests/ChangeLog
--- a/tests/ChangeLog Wed Aug 27 00:39:09 2008 +0200
+++ b/tests/ChangeLog Wed Aug 27 21:47:21 2008 +0200
@@ -1,3 +1,9 @@ 2008-08-10 Aidan Kehoe <kehoea@parhasa
+2008-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * automated/regexp-tests.el:
+ Add a few basic #'skip-chars-forward, #'skip-chars-backward
+ tests.
+
2008-08-10 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/mule-tests.el (featurep): Update the list of character
diff -r af95657e0bfdbc887ab4900b5627cbaaf21e112a -r b82fdf7305eef16a68a94d48a5b532a589f0e55b tests/automated/regexp-tests.el
--- a/tests/automated/regexp-tests.el Wed Aug 27 00:39:09 2008 +0200
+++ b/tests/automated/regexp-tests.el Wed Aug 27 21:47:21 2008 +0200
@@ -522,6 +522,22 @@ baaaa
2))
)))
+;; Not very comprehensive tests of skip-chars-forward, skip-chars-background:
+
+(with-string-as-buffer-contents
+ "-]-----------------------------][]]------------------------"
+ (skip-chars-forward (skip-chars-quote "-[]"))
+ (Assert (= (point) (point-max)))
+ (skip-chars-backward (skip-chars-quote "-[]"))
+ (Assert (= (point) (point-min)))
+ ;; Testing in passing for an old bug in #'skip-chars-forward where I
+ ;; thought it was impossible to call it with a string containing only ?-
+ ;; and ?]:
+ (Assert (= (skip-chars-forward (skip-chars-quote "-]"))
+ (position ?[ (buffer-string) :test #'=)))
+ ;; This used to error, incorrectly:
+ (Assert (skip-chars-quote "[-")))
+
;; replace-match (REPLACEMENT &optional FIXEDCASE LITERAL STRING STRBUFFER)
;; #### Write some tests! Much functionality is implicitly tested above
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Document XFT support in the FAQ, better describe XEmacs pronunciation.
16 years, 3 months
Aidan Kehoe
changeset: 4539:a5f1da0eb001d20be61bcb1b7499643ff23215a0
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sun Aug 31 13:53:36 2008 +0200
files: man/ChangeLog man/xemacs-faq.texi
description:
Document XFT support in the FAQ, better describe XEmacs pronunciation.
2008-08-31 Aidan Kehoe <kehoea(a)parhasard.net>
* xemacs-faq.texi (Q5.0.7): Add a section on how one can use
antialiased fonts under X11; thank you Giacomo Boffi.
(Q1.0.3): Clarify pronunciation using a serious phonetic
alphabet.
diff -r b82fdf7305eef16a68a94d48a5b532a589f0e55b -r a5f1da0eb001d20be61bcb1b7499643ff23215a0 man/ChangeLog
--- a/man/ChangeLog Wed Aug 27 21:47:21 2008 +0200
+++ b/man/ChangeLog Sun Aug 31 13:53:36 2008 +0200
@@ -1,3 +1,10 @@ 2008-07-26 Ville Skyttä <scop(a)xemacs.o
+2008-08-31 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * xemacs-faq.texi (Q5.0.7): Add a section on how one can use
+ antialiased fonts under X11; thank you Giacomo Boffi.
+ (Q1.0.3): Clarify pronunciation using a serious phonetic
+ alphabet.
+
2008-07-26 Ville Skyttä <scop(a)xemacs.org>
* xemacs/custom.texi, xemacs/frame.texi, xemacs/mule.texi,
diff -r b82fdf7305eef16a68a94d48a5b532a589f0e55b -r a5f1da0eb001d20be61bcb1b7499643ff23215a0 man/xemacs-faq.texi
--- a/man/xemacs-faq.texi Wed Aug 27 21:47:21 2008 +0200
+++ b/man/xemacs-faq.texi Sun Aug 31 13:53:36 2008 +0200
@@ -433,6 +433,7 @@ 5.0: X Window System and Resources
* Q5.0.4:: How can I have the window title area display the full path?
* Q5.0.5:: @samp{xemacs -name junk} doesn't work?
* Q5.0.6:: @samp{-iconic} doesn't work.
+* Q5.0.7:: How can I use antialiased fonts under X11?
5.1: Microsoft Windows
* Q5.1.1:: Does XEmacs rename all the @samp{win32-*} symbols to @samp{w32-*}?
@@ -715,7 +716,10 @@ and was also the last version without in
@node Q1.0.3, Q1.0.4, Q1.0.2, Introduction
@unnumberedsubsec Q1.0.3: How do you pronounce XEmacs?
-The most common pronounciation is @samp{Eks eemax}.
+The most common pronounciation is @samp{Eks eemax}, @samp{Eks'im&ks} in
+Kirshenbaum IPA. (See
+@uref{http://www.kirshenbaum.net/IPA/ascii-ipa.pdf} if you know the IPA
+already and want to know how to map from Kirshenbaum to it.)
@node Q1.0.4, Q1.0.5, Q1.0.3, Introduction
@unnumberedsubsec Q1.0.4: What does XEmacs look like?
@@ -6113,6 +6117,7 @@ 5.0: X Window System and Resources
* Q5.0.4:: How can I have the window title area display the full path?
* Q5.0.5:: @samp{xemacs -name junk} doesn't work?
* Q5.0.6:: @samp{-iconic} doesn't work.
+* Q5.0.7:: How can I use antialiased fonts under X11?
5.1: Microsoft Windows
* Q5.1.1:: Does XEmacs rename all the @samp{win32-*} symbols to @samp{w32-*}?
@@ -6261,7 +6266,7 @@ To make a frame with a particular name u
(make-frame '((name . "the-name")))
@end lisp
-@node Q5.0.6, Q5.1.1, Q5.0.5, External Subsystems
+@node Q5.0.6, Q5.0.7, Q5.0.5, External Subsystems
@unnumberedsubsec Q5.0.6: @samp{-iconic} doesn't work.
When I start up XEmacs using @samp{-iconic} it doesn't work right.
@@ -6276,9 +6281,48 @@ bugs...
bugs...
@end quotation
+@node Q5.0.7, Q5.1.1, Q5.0.6, External Subsystems
+@unnumberedsubsec Q5.0.7: How can I use antialiased fonts under X11?
+
+For this you need a recent beta version, and please consider the caveats
+that apply when using beta software from any source. Rebuild xemacs
+using at least the following options to configure:
+
+(a)samp{./configure --enable-mule --with-xft=emacs,menubars}
+
+For further details on the XEmacs widgets that support XFT, see the
+output of @code{./configure --help}. You may find that you have to
+install some lib[something]-dev packages to provide header files; see
+your packaging system's documentation. Depending on your platform, your
+packaging system will normally be something like RPM, @code{apt} or
+DarwinPorts.
+
+To specify a particular antialiased font, put something like the
+following lines in your @file{~/.Xdefaults} or @file{~.Xresources}
+(using @code{#define} in @file{.Xresources} avoids boring hand
+substitution):
+
+@example
+#define MONO Mono
+#define SANS Sans
+#define PTSIZEM 12
+#define PTSIZES 11
+ XEmacs.default.attributeFont: MONO:size=PTSIZEM
+ XEmacs.bold.attributeFont: MONO:size=PTSIZEM:style=Bold
+ XEmacs.italic.attributeFont: MONO:size=PTSIZEM:style=Oblique
+XEmacs.bold-italic.attributeFont: MONO:size=PTSIZEM:style=Bold Oblique
+ XEmacs.modeline.attributeFont: SANS:size=PTSIZES
+ XEmacs.menubar.font: SANS:size=PTSIZES
+ XEmacs*xftFont: SANS:size=PTSIZES
+@end example
+
+And run @code{xrdb -merge} before starting the new, XFT-enabled xemacs.
+You can choose the available fonts from the list given by
+@code{fc-list}; try @code{xfd -fa FONTNAME-SIZE} to preview a given font.
+
@unnumberedsec 5.1: Microsoft Windows
-@node Q5.1.1, Q5.1.2, Q5.0.6, External Subsystems
+@node Q5.1.1, Q5.1.2, Q5.0.7, External Subsystems
@unnumberedsubsec Q5.1.1: Does XEmacs rename all the @samp{win32-*} symbols to @samp{w32-*}?
In his flavor of Emacs 20, Richard Stallman has renamed all the @samp{win32-*}
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Use EQ() and !EQ() in symbols.c, thank you Robert Delius Royar.
16 years, 3 months
Aidan Kehoe
changeset: 4537:af95657e0bfdbc887ab4900b5627cbaaf21e112a
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Wed Aug 27 00:39:09 2008 +0200
files: src/ChangeLog src/symbols.c
description:
Use EQ() and !EQ() in symbols.c, thank you Robert Delius Royar.
2008-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
* symbols.c (Fuser_variable_p):
(map_varalias_chain):
Use EQ() and !EQ(), don't compare two Lisp_Objects using == and
!=. Fixes the union build, thank you Robert Delius Royar.
diff -r 8748a3f7ceb4d37b2a73b7fcbd8256a05e0b666c -r af95657e0bfdbc887ab4900b5627cbaaf21e112a src/ChangeLog
--- a/src/ChangeLog Sat Aug 23 16:38:51 2008 +0200
+++ b/src/ChangeLog Wed Aug 27 00:39:09 2008 +0200
@@ -1,3 +1,10 @@ 2008-08-23 Aidan Kehoe <kehoea@parhasa
+2008-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * symbols.c (Fuser_variable_p):
+ (map_varalias_chain):
+ Use EQ() and !EQ(), don't compare two Lisp_Objects using == and
+ !=. Fixes the union build, thank you Robert Delius Royar.
+
2008-08-23 Aidan Kehoe <kehoea(a)parhasard.net>
* eval.c (Fuser_variable_p): Moved to symbols.c
diff -r 8748a3f7ceb4d37b2a73b7fcbd8256a05e0b666c -r af95657e0bfdbc887ab4900b5627cbaaf21e112a src/symbols.c
--- a/src/symbols.c Sat Aug 23 16:38:51 2008 +0200
+++ b/src/symbols.c Wed Aug 27 00:39:09 2008 +0200
@@ -2823,7 +2823,7 @@ this error if you really want to avoid t
return Qnil;
}
- assert (make_int (1) == mapped);
+ assert (EQ (make_int (1), mapped));
return Qt;
}
@@ -3247,7 +3247,7 @@ map_varalias_chain (Lisp_Object symbol,
count++)
{
res = (fn) (hare);
- if (Qzero != res)
+ if (!EQ (Qzero, res))
{
return res;
}
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Handle varalias chains, custom variables in #'user-variable-p.
16 years, 3 months
Aidan Kehoe
changeset: 4536:8748a3f7ceb4d37b2a73b7fcbd8256a05e0b666c
parent: 4533:c4fd85dd95bd72e8c7899ed48075c2fb26e365fa
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sat Aug 23 16:38:51 2008 +0200
files: lisp/ChangeLog lisp/custom.el src/ChangeLog src/eval.c src/gc.c src/symbols.c
description:
Handle varalias chains, custom variables in #'user-variable-p.
src/ChangeLog addition:
2008-08-23 Aidan Kehoe <kehoea(a)parhasard.net>
* eval.c (Fuser_variable_p): Moved to symbols.c
* symbols.c (Fcustom_variable_p): Moved here from custom.el.
(user_variable_alias_check_fun): Mapper function used in
`user-variable-p'.
(Fuser_variable_p): Moved here from eval.c, to allow it to examine
the variable alias chain. Expanded to check each entry in the
variable alias chain for signs of being a user variable;
documentation updated, noting the differences between GNU's
behaviour and ours (ours is a little more sensible)
(map_varalias_chain): New.
Given a C function, call it at least once for each symbol in a
symbol's varalias chain, signalling an error if there's a cycle,
and returning immediately if the function returns something other
than Qzero.
(Fdefvaralias): Correct the use of the word "alias" in the
docstring and in the argument name. Motivate this in a
comment. Add support for a DOCSTRING argument, something GNU has
too, and document this
* gc.c (vars_of_gc): Start the docstring of
`garbage-collection-messages' with an asterisk, to indicate that
it's a user variable.
lisp/ChangeLog addition:
2008-08-23 Aidan Kehoe <kehoea(a)parhasard.net>
* custom.el: Move #'custom-variable-p to C, since it's now called
from #'user-variable-p.
diff -r c4fd85dd95bd72e8c7899ed48075c2fb26e365fa -r 8748a3f7ceb4d37b2a73b7fcbd8256a05e0b666c lisp/ChangeLog
--- a/lisp/ChangeLog Wed Aug 20 17:39:56 2008 +0200
+++ b/lisp/ChangeLog Sat Aug 23 16:38:51 2008 +0200
@@ -1,3 +1,8 @@ 2008-08-09 Aidan Kehoe <kehoea@parhasa
+2008-08-23 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * custom.el: Move #'custom-variable-p to C, since it's now called
+ from #'user-variable-p.
+
2008-08-09 Aidan Kehoe <kehoea(a)parhasard.net>
* subr.el (skip-chars-quote): New.
diff -r c4fd85dd95bd72e8c7899ed48075c2fb26e365fa -r 8748a3f7ceb4d37b2a73b7fcbd8256a05e0b666c lisp/custom.el
--- a/lisp/custom.el Wed Aug 20 17:39:56 2008 +0200
+++ b/lisp/custom.el Sat Aug 23 16:38:51 2008 +0200
@@ -514,11 +514,9 @@ LOAD should be either a library file nam
(put symbol 'custom-autoload t)
(custom-add-load symbol load))
-;; This test is also in the C code of `user-variable-p'.
-(defun custom-variable-p (variable)
- "Return non-nil if VARIABLE is a custom variable."
- (or (get variable 'standard-value)
- (get variable 'custom-autoload)))
+;; XEmacs;
+;; #'custom-variable-p is in symbols.c, since it's called from
+;; #'user-variable-p.
;;; Loading files needed to customize a symbol.
;;; This is in custom.el because menu-bar.el needs it for toggle cmds.
diff -r c4fd85dd95bd72e8c7899ed48075c2fb26e365fa -r 8748a3f7ceb4d37b2a73b7fcbd8256a05e0b666c src/ChangeLog
--- a/src/ChangeLog Wed Aug 20 17:39:56 2008 +0200
+++ b/src/ChangeLog Sat Aug 23 16:38:51 2008 +0200
@@ -1,3 +1,27 @@ 2008-08-09 Aidan Kehoe <kehoea@parhasa
+2008-08-23 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * eval.c (Fuser_variable_p): Moved to symbols.c
+ * symbols.c (Fcustom_variable_p): Moved here from custom.el.
+ (user_variable_alias_check_fun): Mapper function used in
+ `user-variable-p'.
+ (Fuser_variable_p): Moved here from eval.c, to allow it to examine
+ the variable alias chain. Expanded to check each entry in the
+ variable alias chain for signs of being a user variable;
+ documentation updated, noting the differences between GNU's
+ behaviour and ours (ours is a little more sensible)
+ (map_varalias_chain): New.
+ Given a C function, call it at least once for each symbol in a
+ symbol's varalias chain, signalling an error if there's a cycle,
+ and returning immediately if the function returns something other
+ than Qzero.
+ (Fdefvaralias): Correct the use of the word "alias" in the
+ docstring and in the argument name. Motivate this in a
+ comment. Add support for a DOCSTRING argument, something GNU has
+ too, and document this
+ * gc.c (vars_of_gc): Start the docstring of
+ `garbage-collection-messages' with an asterisk, to indicate that
+ it's a user variable.
+
2008-08-09 Aidan Kehoe <kehoea(a)parhasard.net>
Integrate Romain Francoise' 2005-09-14 (pre-GPLV3) GNU change,
diff -r c4fd85dd95bd72e8c7899ed48075c2fb26e365fa -r 8748a3f7ceb4d37b2a73b7fcbd8256a05e0b666c src/eval.c
--- a/src/eval.c Wed Aug 20 17:39:56 2008 +0200
+++ b/src/eval.c Sat Aug 23 16:38:51 2008 +0200
@@ -1356,29 +1356,8 @@ Since `defconst' unconditionally assigns
return sym;
}
-DEFUN ("user-variable-p", Fuser_variable_p, 1, 1, 0, /*
-Return t if VARIABLE is intended to be set and modified by users.
-\(The alternative is a variable used internally in a Lisp program.)
-Determined by whether the first character of the documentation
-for the variable is `*'.
-*/
- (variable))
-{
- Lisp_Object documentation = Fget (variable, Qvariable_documentation, Qnil);
-
- return
- ((INTP (documentation) && XINT (documentation) < 0) ||
-
- (STRINGP (documentation) &&
- (string_byte (documentation, 0) == '*')) ||
-
- /* If (STRING . INTEGER), a negative integer means a user variable. */
- (CONSP (documentation)
- && STRINGP (XCAR (documentation))
- && INTP (XCDR (documentation))
- && XINT (XCDR (documentation)) < 0)) ?
- Qt : Qnil;
-}
+/* XEmacs: user-variable-p is in symbols.c, since it needs to mess around
+ with the symbol variable aliases. */
DEFUN ("macroexpand-internal", Fmacroexpand_internal, 1, 2, 0, /*
Return result of expanding macros at top level of FORM.
@@ -6582,7 +6561,6 @@ syms_of_eval (void)
DEFSUBR (Fdefmacro);
DEFSUBR (Fdefvar);
DEFSUBR (Fdefconst);
- DEFSUBR (Fuser_variable_p);
DEFSUBR (Flet);
DEFSUBR (FletX);
DEFSUBR (Fwhile);
diff -r c4fd85dd95bd72e8c7899ed48075c2fb26e365fa -r 8748a3f7ceb4d37b2a73b7fcbd8256a05e0b666c src/gc.c
--- a/src/gc.c Wed Aug 20 17:39:56 2008 +0200
+++ b/src/gc.c Sat Aug 23 16:38:51 2008 +0200
@@ -2166,7 +2166,7 @@ This means that certain objects should b
*/ );
DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages /*
- Non-nil means display messages at start and end of garbage collection.
+*Non-nil means display messages at start and end of garbage collection.
*/ );
garbage_collection_messages = 0;
diff -r c4fd85dd95bd72e8c7899ed48075c2fb26e365fa -r 8748a3f7ceb4d37b2a73b7fcbd8256a05e0b666c src/symbols.c
--- a/src/symbols.c Wed Aug 20 17:39:56 2008 +0200
+++ b/src/symbols.c Sat Aug 23 16:38:51 2008 +0200
@@ -84,6 +84,9 @@ static Lisp_Object *value_slot_past_magi
static Lisp_Object *value_slot_past_magic (Lisp_Object sym);
static Lisp_Object follow_varalias_pointers (Lisp_Object symbol,
Lisp_Object follow_past_lisp_magic);
+static Lisp_Object map_varalias_chain (Lisp_Object symbol,
+ Lisp_Object follow_past_lisp_magic,
+ Lisp_Object (*fn) (Lisp_Object arg));
static Lisp_Object
@@ -2754,6 +2757,78 @@ A nil value for BUFFER is *not* the same
else
return local_info != 0 ? Qt : Qnil;
}
+
+DEFUN ("custom-variable-p", Fcustom_variable_p, 1, 1, 0, /*
+Return non-nil if SYMBOL names a custom variable.
+Does not follow the variable alias chain.
+*/
+ (symbol))
+{
+ return (!(NILP (Fget(symbol, intern ("standard-value"), Qnil)))
+ || !(NILP (Fget(symbol, intern ("custom-autoload"), Qnil)))) ?
+ Qt: Qnil;
+}
+
+static Lisp_Object
+user_variable_alias_check_fun (Lisp_Object symbol)
+{
+ Lisp_Object documentation = Fget (symbol, Qvariable_documentation, Qnil);
+
+ if ((INTP (documentation) && XINT (documentation) < 0) ||
+ (STRINGP (documentation) &&
+ (string_byte (documentation, 0) == '*')) ||
+ /* If (STRING . INTEGER), a negative integer means a user variable. */
+ (CONSP (documentation)
+ && STRINGP (XCAR (documentation))
+ && INTP (XCDR (documentation))
+ && XINT (XCDR (documentation)) < 0) ||
+ !NILP (Fcustom_variable_p (symbol)))
+ {
+ return make_int(1);
+ }
+
+ return Qzero;
+}
+
+DEFUN ("user-variable-p", Fuser_variable_p, 1, 1, 0, /*
+Return t if SYMBOL names a variable intended to be set and modified by users.
+\(The alternative is a variable used internally in a Lisp program.)
+A symbol names a user variable if
+\(1) the first character of its documentation is `*', or
+\(2) it is customizable (`custom-variable-p' gives t), or
+\(3) it names a variable alias that eventually resolves to another user variable.
+
+The GNU Emacs implementation of `user-variable-p' returns nil if there is a
+loop in the chain of symbols. Since this is indistinguishable from the case
+where a symbol names a non-user variable, XEmacs signals a
+`cyclic-variable-indirection' error instead; use `condition-case' to catch
+this error if you really want to avoid this.
+*/
+ (symbol))
+{
+ Lisp_Object mapped;
+
+ if (!SYMBOLP (symbol))
+ {
+ return Qnil;
+ }
+
+ /* Called for its side-effects, we want it to signal if there's a loop. */
+ follow_varalias_pointers (symbol, Qt);
+
+ /* Look through the various aliases. */
+ mapped = map_varalias_chain (symbol, Qt, user_variable_alias_check_fun);
+ if (EQ (Qzero, mapped))
+ {
+ return Qnil;
+ }
+
+ assert (make_int (1) == mapped);
+
+ return Qt;
+}
+
+
/*
@@ -3136,20 +3211,98 @@ follow_varalias_pointers (Lisp_Object sy
return hare;
}
-DEFUN ("defvaralias", Fdefvaralias, 2, 2, 0, /*
+/* Map FN over the chain of variable aliases for SYMBOL. If FN returns
+ something other than Qzero for some link in the chain, return that
+ immediately. Otherwise return Qzero (which is not a symbol).
+
+ FN may be called twice on the same symbol if the varalias chain is
+ cyclic. Prevent this by calling follow_varalias_pointers first for its
+ side-effects.
+
+ Signals a cyclic-variable-indirection error if a cyclic structure is
+ detected. */
+
+static Lisp_Object
+map_varalias_chain (Lisp_Object symbol,
+ Lisp_Object follow_past_lisp_magic,
+ Lisp_Object (*fn) (Lisp_Object arg))
+{
+#define VARALIAS_INDIRECTION_SUSPICION_LENGTH 16
+ Lisp_Object tortoise, hare, val, res;
+ int count;
+
+ assert (fn);
+
+ /* quick out just in case */
+ if (!SYMBOL_VALUE_MAGIC_P (XSYMBOL (symbol)->value))
+ {
+ return (fn)(symbol);
+ }
+
+ /* Compare implementation of indirect_function(). */
+ for (hare = tortoise = symbol, count = 0;
+ val = fetch_value_maybe_past_magic (hare, follow_past_lisp_magic),
+ SYMBOL_VALUE_VARALIAS_P (val);
+ hare = symbol_value_varalias_aliasee (XSYMBOL_VALUE_VARALIAS (val)),
+ count++)
+ {
+ res = (fn) (hare);
+ if (Qzero != res)
+ {
+ return res;
+ }
+
+ if (count < VARALIAS_INDIRECTION_SUSPICION_LENGTH) continue;
+
+ if (count & 1)
+ tortoise = symbol_value_varalias_aliasee
+ (XSYMBOL_VALUE_VARALIAS (fetch_value_maybe_past_magic
+ (tortoise, follow_past_lisp_magic)));
+ if (EQ (hare, tortoise))
+ return Fsignal (Qcyclic_variable_indirection, list1 (symbol));
+ }
+
+ return (fn) (hare);
+}
+
+/*
+
+OED entry, 2nd edition, IPA transliterated using Kirshenbaum:
+
+alias ('eIlI@s, '&lI@s), adv. and n.
+[...]
+B. n. (with pl. aliases.)
+1. Another name, an assumed name.
+1605 Camden Rem. (1614) 147 An Alias or double name cannot preiudice the honest.
+1831 Edin. Rev. LIII. 364 He has been assuming various aliases.
+1861 Macaulay Hist. Eng. V. 92 The monk who was sometimes called Harrison
+and sometimes went by the alias of Johnson.
+
+The alias is the fake name. Let's try to follow that usage in our
+documentation.
+
+*/
+
+DEFUN ("defvaralias", Fdefvaralias, 2, 3, 0, /*
Define a variable as an alias for another variable.
Thenceforth, any operations performed on VARIABLE will actually be
-performed on ALIAS. Both VARIABLE and ALIAS should be symbols.
-If ALIAS is nil, remove any aliases for VARIABLE.
-ALIAS can itself be aliased, and the chain of variable aliases
+performed on ALIASED. Both VARIABLE and ALIASED should be symbols.
+If ALIASED is nil and VARIABLE is an existing alias, remove that alias.
+ALIASED can itself be an alias, and the chain of variable aliases
will be followed appropriately.
If VARIABLE already has a value, this value will be shadowed
until the alias is removed, at which point it will be restored.
Currently VARIABLE cannot be a built-in variable, a variable that
has a buffer-local value in any buffer, or the symbols nil or t.
-\(ALIAS, however, can be any type of variable.)
-*/
- (variable, alias))
+\(ALIASED, however, can be any type of variable.)
+
+Optional argument DOCSTRING is documentation for VARIABLE in its use as an
+alias for ALIASED. The XEmacs help code ignores this documentation, using
+the documentation of ALIASED instead, and the docstring, if specified, is
+not shadowed in the same way that the value is. Only use it if you know
+what you're doing.
+*/
+ (variable, aliased, docstring))
{
struct symbol_value_varalias *bfwd;
Lisp_Object valcontents;
@@ -3159,7 +3312,7 @@ has a buffer-local value in any buffer,
valcontents = XSYMBOL (variable)->value;
- if (NILP (alias))
+ if (NILP (aliased))
{
if (SYMBOL_VALUE_VARALIAS_P (valcontents))
{
@@ -3170,11 +3323,15 @@ has a buffer-local value in any buffer,
return Qnil;
}
- CHECK_SYMBOL (alias);
+ CHECK_SYMBOL (aliased);
+
+ if (!NILP (docstring))
+ Fput (variable, Qvariable_documentation, docstring);
+
if (SYMBOL_VALUE_VARALIAS_P (valcontents))
{
/* transmogrify */
- XSYMBOL_VALUE_VARALIAS (valcontents)->aliasee = alias;
+ XSYMBOL_VALUE_VARALIAS (valcontents)->aliasee = aliased;
return Qnil;
}
@@ -3186,7 +3343,7 @@ has a buffer-local value in any buffer,
bfwd = ALLOC_LCRECORD_TYPE (struct symbol_value_varalias,
&lrecord_symbol_value_varalias);
bfwd->magic.type = SYMVAL_VARALIAS;
- bfwd->aliasee = alias;
+ bfwd->aliasee = aliased;
bfwd->shadowed = valcontents;
valcontents = wrap_symbol_value_magic (bfwd);
@@ -3195,8 +3352,8 @@ has a buffer-local value in any buffer,
}
DEFUN ("variable-alias", Fvariable_alias, 1, 2, 0, /*
-If VARIABLE is aliased to another variable, return that variable.
-VARIABLE should be a symbol. If VARIABLE is not aliased, return nil.
+If VARIABLE is an alias of another variable, return that variable.
+VARIABLE should be a symbol. If VARIABLE is not an alias, return nil.
Variable aliases are created with `defvaralias'. See also
`indirect-variable'.
*/
@@ -3755,6 +3912,8 @@ syms_of_symbols (void)
DEFSUBR (Fkill_local_variable);
DEFSUBR (Fkill_console_local_variable);
DEFSUBR (Flocal_variable_p);
+ DEFSUBR (Fcustom_variable_p);
+ DEFSUBR (Fuser_variable_p);
DEFSUBR (Fdefvaralias);
DEFSUBR (Fvariable_alias);
DEFSUBR (Findirect_variable);
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[COMMIT] Correct some dependencies and the AUTHOR_VERSION, eshell
16 years, 3 months
Aidan Kehoe
Ar an dara lá de mí Méan Fómhair, scríobh Jerry James:
> Could I plead once more with those doing maintenance on the eshell
> package to consider changing the Makefile so that:
>
> EXTRA_SOURCES = esh-groups.el
>
> becomes
>
> GENERATED_LISP = esh-groups.el
>
> which also requires adding this dependency somewhere:
>
> esh-groups.el: esh-module.elc
>
> Currently, esh-groups.el is neither regenerated nor cleaned up
> properly. Thanks,
Done; sorry about the delay, Jerry, and sorry about the superflous releases,
Vin.
APPROVE COMMIT
NOTE: This patch has been committed.
xemacs-packages/eshell/ChangeLog addition:
2008-09-08 Aidan Kehoe <kehoea(a)parhasard.net>
* Makefile:
* Makefile (GENERATED_LISP):
Make AUTHOR_VERSION the Savannah git tag of the last GPLV2'd
version.
Changing esh-groups.el to being GENERATED_LISP, not EXTRA_SOURCES;
add a corresponding dependency. Thank you Jerry James!
XEmacs Packages source patch:
Diff command: cvs -q diff -Nu
Files affected: xemacs-packages/eshell/Makefile
===================================================================
RCS
Index: xemacs-packages/eshell/Makefile
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/eshell/Makefile,v
retrieving revision 1.24
diff -u -u -r1.24 Makefile
--- xemacs-packages/eshell/Makefile 2008/09/04 19:54:39 1.24
+++ xemacs-packages/eshell/Makefile 2008/09/08 06:34:20
@@ -18,8 +18,8 @@
# Boston, MA 02111-1307, USA.
VERSION = 1.15
-# eshell is now integrated in GNU Emacs, versioning may need to change
-AUTHOR_VERSION = 2.4.1
+# The version is the last GPLV2'd Savannah git tag.
+AUTHOR_VERSION = 0fc80a3f6bb3bb59f42e9ff83cc8b89bf90fe658
MAINTAINER = XEmacs Dev Team <xemacs-beta(a)xemacs.org>
PACKAGE = eshell
PKG_TYPE = regular
@@ -36,8 +36,10 @@
DATA_FILES =
DATA_DEST =
-EXTRA_SOURCES = esh-groups.el
+GENERATED_LISP = esh-groups.el
STANDARD_DOCS = t
+
+esh-groups.el: esh-module.elc
include ../../XEmacs.rules
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[PATCH] Port #'window-buffer-height, #'fit-window-to-buffer, & window, buf, functions.
16 years, 3 months
Aidan Kehoe
SUPERSEDES 18615.11829.47801.123441(a)parhasard.net
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1220178406 -7200
# Node ID bd28481bb0e107fc21856a72d58f79539732621e
# Parent b82fdf7305eef16a68a94d48a5b532a589f0e55b
Port #'window-buffer-height, #'fit-window-to-buffer, & window, buf, functions.
lisp/ChangeLog addition:
2008-08-31 Aidan Kehoe <kehoea(a)parhasard.net>
* window.el (only-window-p): New.
Check if WINDOW is the only window in some context, normally its
frame.
(one-window-p):
Implemented this in terms of #'only-window-p, calling it on the
selected window.
(window-buffer-height): Uncomment this, make it work.
(count-screen-lines): Support a BUFFER argument.
(fit-window-to-buffer): Uncomment this, correct its implementation
to work with XEmacs.
* help.el (temp-buffer-resize-mode): New. Name taken from GNU,
implementation our own.
* (resize-temp-buffer-window): New. GNU-compatible alias for
#'shrink-window-if-larger-than-buffer.
* dumped-lisp.el (preloaded-file-list): Move easy-mmode before
help, now that the latter uses #'define-minor-mode.
* frame.el: Point to #'temp-buffer-resize-mode in a comment.
Some of this code is from GNU; help.el CVS version 1.327 of
2007-03-21, window.el CVS version 1.122, of 2007-06-24. Both these
are GPLV2 or later.
diff -r b82fdf7305ee -r bd28481bb0e1 lisp/ChangeLog
--- a/lisp/ChangeLog Wed Aug 27 21:47:21 2008 +0200
+++ b/lisp/ChangeLog Sun Aug 31 12:26:46 2008 +0200
@@ -1,3 +1,26 @@
+2008-08-31 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * window.el (only-window-p): New.
+ Check if WINDOW is the only window in some context, normally its
+ frame.
+ (one-window-p):
+ Implemented this in terms of #'only-window-p, calling it on the
+ selected window.
+ (window-buffer-height): Uncomment this, make it work.
+ (count-screen-lines): Support a BUFFER argument.
+ (fit-window-to-buffer): Uncomment this, correct its implementation
+ to work with XEmacs.
+ * help.el (temp-buffer-resize-mode): New. Name taken from GNU,
+ implementation our own.
+ * (resize-temp-buffer-window): New. GNU-compatible alias for
+ #'shrink-window-if-larger-than-buffer.
+ * dumped-lisp.el (preloaded-file-list): Move easy-mmode before
+ help, now that the latter uses #'define-minor-mode.
+ * frame.el: Point to #'temp-buffer-resize-mode in a comment.
+ Some of this code is from GNU; help.el CVS version 1.327 of
+ 2007-03-21, window.el CVS version 1.122, of 2007-06-24. Both these
+ are GPLV2 or later.
+
2008-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
* subr.el (skip-chars-quote):
diff -r b82fdf7305ee -r bd28481bb0e1 lisp/dumped-lisp.el
--- a/lisp/dumped-lisp.el Wed Aug 27 21:47:21 2008 +0200
+++ b/lisp/dumped-lisp.el Sun Aug 31 12:26:46 2008 +0200
@@ -95,7 +95,6 @@
;; (pureload "profile")
"loadhist" ; Must be dumped before loaddefs is loaded
; Used by help.
- "help"
;; (pureload "hyper-apropos") Soon...
"files"
"lib-complete"
@@ -110,7 +109,8 @@
"register"
"iso8859-1" ; This must be before any modes
; (sets standard syntax table.)
- "easy-mmode" ; Added for 21.5.
+ "easy-mmode" ; Added for 21.5. Used by help.
+ "help"
"easymenu" ; Added for 20.3.
"lisp-mode"
"text-mode"
diff -r b82fdf7305ee -r bd28481bb0e1 lisp/frame.el
--- a/lisp/frame.el Wed Aug 27 21:47:21 2008 +0200
+++ b/lisp/frame.el Sun Aug 31 12:26:46 2008 +0200
@@ -1850,6 +1850,8 @@
:type 'number
:group 'frames)
+;; See also #'temp-buffer-resize-mode in help.el.
+
(defun show-temp-buffer-in-current-frame (buffer)
"For use as the value of `temp-buffer-show-function':
always displays the buffer in the selected frame, regardless of the behavior
diff -r b82fdf7305ee -r bd28481bb0e1 lisp/help.el
--- a/lisp/help.el Wed Aug 27 21:47:21 2008 +0200
+++ b/lisp/help.el Sun Aug 31 12:26:46 2008 +0200
@@ -1878,4 +1878,21 @@
(find-variable (extent-property e 'find-variable-symbol)))
(mouse-track event)))))
+(define-minor-mode temp-buffer-resize-mode
+ "Toggle the mode which makes windows smaller for temporary buffers.
+With prefix argument ARG, turn the resizing of windows displaying temporary
+buffers on if ARG is positive or off otherwise.
+This makes the window the right height for its contents, but never
+less than `window-min-height' nor a higher proportion of its frame than
+`temp-buffer-max-height'. (Note the differing semantics of the latter
+versus GNU Emacs, where `temp-buffer-max-height' is an integer number of
+lines.)
+This applies to `help', `apropos' and `completion' buffers, and some others."
+:global t :group 'help
+ ;; XEmacs; our implementation of this is very different.
+ (setq temp-buffer-shrink-to-fit temp-buffer-resize-mode))
+
+;; GNU name for this function.
+(defalias 'resize-temp-buffer-window 'shrink-window-if-larger-than-buffer)
+
;;; help.el ends here
diff -r b82fdf7305ee -r bd28481bb0e1 lisp/window.el
--- a/lisp/window.el Wed Aug 27 21:47:21 2008 +0200
+++ b/lisp/window.el Sun Aug 31 12:26:46 2008 +0200
@@ -33,16 +33,19 @@
;;;; Window tree functions.
-(defun one-window-p (&optional nomini which-frames which-devices)
- "Return non-nil if the selected window is the only window (in its frame).
-Optional arg NOMINI non-nil means don't count the minibuffer
-even if it is active.
+;; XEmacs addition, to expose WINDOW.
+(defun only-window-p (&optional window nomini which-frames which-devices)
+ "Return non-nil if WINDOW is the only window in some context,
+normally its frame. Optional arg NOMINI non-nil means don't count the
+minibuffer even if it is active.
-By default, only the windows in the selected frame are considered.
-The optional argument WHICH-FRAMES changes this behavior:
-WHICH-FRAMES nil or omitted means count only the selected frame,
+The optional argument WHICH-FRAMES changes the frames that are considered:
+
+WHICH-FRAMES nil or omitted means count only WINDOW's frame,
plus the minibuffer it uses (which may be on another frame).
-WHICH-FRAMES = `visible' means include windows on all visible frames.
+\(But, for all values of WHICH-FRAMES, see the documentation for the
+WHICH-DEVICES argument.)
+WHICH-FRAMES = `visible' means include windows on all visible frames
WHICH-FRAMES = 0 means include windows on all visible and iconified frames.
WHICH-FRAMES = t means include windows on all frames including invisible frames.
If WHICH-FRAMES is any other value, count only the selected frame.
@@ -56,11 +59,19 @@
If a device type, search all devices of that type.
If `window-system', search all devices on window-system consoles.
Any other non-nil value means search all devices."
- (let ((base-window (selected-window)))
- (if (and nomini (eq base-window (minibuffer-window)))
+ (let ((base-window (or window (selected-window))))
+ (if (and nomini (eq base-window
+ (minibuffer-window (window-frame base-window))))
(setq base-window (next-window base-window)))
(eq base-window
(next-window base-window (if nomini 'arg) which-frames which-devices))))
+
+(defun one-window-p (&optional nomini which-frames which-devices)
+ "Return the result of calling `only-window-p' on the selected window.
+
+See that function's documentation for the meaning of the NOMINI,
+WHICH-FRAMES and WHICH-DEVICES arguments."
+ (only-window-p (selected-window) nomini which-frames which-devices))
(defun walk-windows (function &optional minibuf which-frames which-devices)
"Cycle through all visible windows, calling FUNCTION for each one.
@@ -351,24 +362,18 @@
(interactive "p")
(shrink-window arg t))
-; (defun window-buffer-height (window)
-; "Return the height (in screen lines) of the buffer that WINDOW is displaying."
-; (save-excursion
-; (set-buffer (window-buffer window))
-; (goto-char (point-min))
-; (let ((ignore-final-newline
-; ;; If buffer ends with a newline, ignore it when counting height
-; ;; unless point is after it.
-; (and (not (eobp)) (eq ?\n (char-after (1- (point-max)))))))
-; (+ 1 (nth 2 (compute-motion (point-min)
-; '(0 . 0)
-; (- (point-max) (if ignore-final-newline 1 0))
-; (cons 0 100000000)
-; (window-width window)
-; nil
-; window))))))
-
-(defun count-screen-lines (&optional beg end count-final-newline window)
+(defun window-buffer-height (window)
+ "Return the height (in screen lines) of the buffer that WINDOW is displaying."
+ (with-current-buffer (window-buffer window)
+ (max 1
+ (count-screen-lines (point-min) (point-max)
+ ;; If buffer ends with a newline, ignore it when
+ ;; counting height unless point is after it.
+ (eobp)
+ window))))
+;; XEmacs change; accept BUFFER.
+(defun count-screen-lines (&optional beg end count-final-newline
+ window buffer)
"Return the number of screen lines in the region.
The number of screen lines may be different from the number of actual lines,
due to line breaking, display table, etc.
@@ -383,112 +388,120 @@
parameters such as width, horizontal scrolling, and so on. The default is
to use the selected window's parameters.
-Like `vertical-motion', `count-screen-lines' always uses the current buffer,
-regardless of which buffer is displayed in WINDOW. This makes possible to use
-`count-screen-lines' in any buffer, whether or not it is currently displayed
-in some window."
+Optional argument BUFFER is the buffer to check, and defaults to the current
+buffer. See `vertical-motion' for some caveats on the differences between
+this behaviour and that of GNU Emacs."
(unless beg
- (setq beg (point-min)))
+ (setq beg (point-min buffer)))
(unless end
- (setq end (point-max)))
+ (setq end (point-max buffer)))
+ (unless buffer
+ (setq buffer (current-buffer)))
(if (= beg end)
0
(save-excursion
(save-restriction
- (widen)
- (narrow-to-region (min beg end)
- (if (and (not count-final-newline)
- (= ?\n (char-before (max beg end))))
- (1- (max beg end))
- (max beg end)))
- (goto-char (point-min))
- (1+ (vertical-motion (buffer-size) window))))))
+ (let ((old-window-buffer (window-buffer window)))
+ (unwind-protect
+ (progn
+ (set-window-buffer window buffer)
+ (set-buffer buffer)
+ (widen)
+ (narrow-to-region (min beg end)
+ (if (and (not count-final-newline)
+ (= ?\n (char-before (max beg end))))
+ (1- (max beg end))
+ (max beg end)))
+ (goto-char (point-min))
+ (1+ (vertical-motion (buffer-size) window)))
+ (set-window-buffer window old-window-buffer)))))))
-; (defun fit-window-to-buffer (&optional window max-height min-height)
-; "Make WINDOW the right size to display its contents exactly.
-; If WINDOW is omitted or nil, it defaults to the selected window.
-; If the optional argument MAX-HEIGHT is supplied, it is the maximum height
-; the window is allowed to be, defaulting to the frame height.
-; If the optional argument MIN-HEIGHT is supplied, it is the minimum
-; height the window is allowed to be, defaulting to `window-min-height'.
+(defun fit-window-to-buffer (&optional window max-height min-height)
+ "Make WINDOW the right height to display its contents exactly.
+If WINDOW is omitted or nil, it defaults to the selected window.
+If the optional argument MAX-HEIGHT is supplied, it is the maximum height
+ the window is allowed to be, defaulting to the frame height.
+If the optional argument MIN-HEIGHT is supplied, it is the minimum
+ height the window is allowed to be, defaulting to `window-min-height'.
-; The heights in MAX-HEIGHT and MIN-HEIGHT include the mode-line and/or
-; header-line."
-; (interactive)
+The heights in MAX-HEIGHT and MIN-HEIGHT include the mode-line and/or
+header-line."
+ (interactive)
-; (when (null window)
-; (setq window (selected-window)))
-; (when (null max-height)
-; (setq max-height (frame-height (window-frame window))))
+ (when (null window)
+ (setq window (selected-window)))
+ (when (null max-height)
+ (setq max-height (frame-height (window-frame window))))
-; (let* ((buf
-; ;; Buffer that is displayed in WINDOW
-; (window-buffer window))
-; (window-height
-; ;; The current height of WINDOW
-; (window-height window))
-; (desired-height
-; ;; The height necessary to show the buffer displayed by WINDOW
-; ;; (`count-screen-lines' always works on the current buffer).
-; (with-current-buffer buf
-; (+ (count-screen-lines)
-; ;; If the buffer is empty, (count-screen-lines) is
-; ;; zero. But, even in that case, we need one text line
-; ;; for cursor.
-; (if (= (point-min) (point-max))
-; 1 0)
-; ;; For non-minibuffers, count the mode-line, if any
-; (if (and (not (window-minibuffer-p window))
-; mode-line-format)
-; 1 0)
-; ;; Count the header-line, if any
-; (if header-line-format 1 0))))
-; (delta
-; ;; Calculate how much the window height has to change to show
-; ;; desired-height lines, constrained by MIN-HEIGHT and MAX-HEIGHT.
-; (- (max (min desired-height max-height)
-; (or min-height window-min-height))
-; window-height))
-; ;; We do our own height checking, so avoid any restrictions due to
-; ;; window-min-height.
-; (window-min-height 1))
+ (let* ((buf
+ ;; Buffer that is displayed in WINDOW
+ (window-buffer window))
+ (window-height
+ ;; The current height of WINDOW
+ (window-height window))
+ (desired-height
+ ;; The height necessary to show the buffer displayed by WINDOW
+ ;; (`count-screen-lines' always works on the current buffer).
+ ;; XEmacs; it does in GNU, we provide a BUFFER argument, but we're
+ ;; not changing the implementation.
+ (with-current-buffer buf
+ (+ (count-screen-lines)
+ ;; If the buffer is empty, (count-screen-lines) is
+ ;; zero. But, even in that case, we need one text line
+ ;; for cursor.
+ (if (= (point-min) (point-max))
+ 1 0)
+ ;; For non-minibuffers, count the mode-line, if any
+ (if (and (not (window-minibuffer-p window))
+ mode-line-format)
+ 1 0)
+ ;; Count the header-line, if any
+ ;; XEmacs change; we don't have header-line-format.
+ ;; (if header-line-format 1 0))))
+ (if (specifier-instance top-gutter) 1 0))))
+ (delta
+ ;; Calculate how much the window height has to change to show
+ ;; desired-height lines, constrained by MIN-HEIGHT and MAX-HEIGHT.
+ (- (max (min desired-height max-height)
+ (or min-height window-min-height))
+ window-height)))
-; ;; Don't try to redisplay with the cursor at the end
-; ;; on its own line--that would force a scroll and spoil things.
-; (when (with-current-buffer buf
-; (and (eobp) (bolp) (not (bobp))))
-; (set-window-point window (1- (window-point window))))
+ ;; Don't try to redisplay with the cursor at the end
+ ;; on its own line--that would force a scroll and spoil things.
+ (when (with-current-buffer buf
+ (and (eobp) (bolp) (not (bobp))))
+ (set-window-point window (1- (window-point window))))
-; (save-selected-window
-; (select-window window)
+ ;; Adjust WINDOW to the nominally correct size (which may actually
+ ;; be slightly off because of variable height text, etc).
+ (unless (zerop delta)
+ (enlarge-window delta nil window))
-; ;; Adjust WINDOW to the nominally correct size (which may actually
-; ;; be slightly off because of variable height text, etc).
-; (unless (zerop delta)
-; (enlarge-window delta))
-
-; ;; Check if the last line is surely fully visible. If not,
-; ;; enlarge the window.
-; (let ((end (with-current-buffer buf
-; (save-excursion
-; (goto-char (point-max))
-; (when (and (bolp) (not (bobp)))
-; ;; Don't include final newline
-; (backward-char 1))
-; (when truncate-lines
-; ;; If line-wrapping is turned off, test the
-; ;; beginning of the last line for visibility
-; ;; instead of the end, as the end of the line
-; ;; could be invisible by virtue of extending past
-; ;; the edge of the window.
-; (forward-line 0))
-; (point)))))
-; (set-window-vscroll window 0)
-; (while (and (< desired-height max-height)
-; (= desired-height (window-height window))
-; (not (pos-visible-in-window-p end window)))
-; (enlarge-window 1)
-; (setq desired-height (1+ desired-height)))))))
+ ;; Check if the last line is surely fully visible. If not,
+ ;; enlarge the window.
+ (let ((end (with-current-buffer buf
+ (save-excursion
+ (goto-char (point-max))
+ (when (and (bolp) (not (bobp)))
+ ;; Don't include final newline
+ (backward-char 1))
+ (when truncate-lines
+ ;; If line-wrapping is turned off, test the
+ ;; beginning of the last line for visibility
+ ;; instead of the end, as the end of the line
+ ;; could be invisible by virtue of extending past
+ ;; the edge of the window.
+ (forward-line 0))
+ (point))))
+ ;; XEmacs change; bind window-pixel-vscroll-increment, we don't
+ ;; have #'set-window-vscroll.
+ (window-pixel-scroll-increment 0))
+ ; (set-window-vscroll window 0)
+ (while (and (< desired-height max-height)
+ (= desired-height (window-height window))
+ (not (pos-visible-in-window-p end window)))
+ (enlarge-window 1 nil window)
+ (setq desired-height (1+ desired-height))))))
(defun shrink-window-if-larger-than-buffer (&optional window)
"Shrink the WINDOW to be as small as possible to display its contents.
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Port #'window-buffer-height, #'fit-window-to-buffer, & window, buf, functions.
16 years, 3 months
Aidan Kehoe
changeset: 4506:bd28481bb0e107fc21856a72d58f79539732621e
parent: 4504:b82fdf7305eef16a68a94d48a5b532a589f0e55b
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sun Aug 31 12:26:46 2008 +0200
files: lisp/ChangeLog lisp/dumped-lisp.el lisp/frame.el lisp/help.el lisp/window.el
description:
Port #'window-buffer-height, #'fit-window-to-buffer, & window, buf, functions.
lisp/ChangeLog addition:
2008-08-31 Aidan Kehoe <kehoea(a)parhasard.net>
* window.el (only-window-p): New.
Check if WINDOW is the only window in some context, normally its
frame.
(one-window-p):
Implemented this in terms of #'only-window-p, calling it on the
selected window.
(window-buffer-height): Uncomment this, make it work.
(count-screen-lines): Support a BUFFER argument.
(fit-window-to-buffer): Uncomment this, correct its implementation
to work with XEmacs.
* help.el (temp-buffer-resize-mode): New. Name taken from GNU,
implementation our own.
* (resize-temp-buffer-window): New. GNU-compatible alias for
#'shrink-window-if-larger-than-buffer.
* dumped-lisp.el (preloaded-file-list): Move easy-mmode before
help, now that the latter uses #'define-minor-mode.
* frame.el: Point to #'temp-buffer-resize-mode in a comment.
Some of this code is from GNU; help.el CVS version 1.327 of
2007-03-21, window.el CVS version 1.122, of 2007-06-24. Both these
are GPLV2 or later.
diff -r b82fdf7305eef16a68a94d48a5b532a589f0e55b -r bd28481bb0e107fc21856a72d58f79539732621e lisp/ChangeLog
--- a/lisp/ChangeLog Wed Aug 27 21:47:21 2008 +0200
+++ b/lisp/ChangeLog Sun Aug 31 12:26:46 2008 +0200
@@ -1,3 +1,26 @@ 2008-08-27 Aidan Kehoe <kehoea@parhasa
+2008-08-31 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * window.el (only-window-p): New.
+ Check if WINDOW is the only window in some context, normally its
+ frame.
+ (one-window-p):
+ Implemented this in terms of #'only-window-p, calling it on the
+ selected window.
+ (window-buffer-height): Uncomment this, make it work.
+ (count-screen-lines): Support a BUFFER argument.
+ (fit-window-to-buffer): Uncomment this, correct its implementation
+ to work with XEmacs.
+ * help.el (temp-buffer-resize-mode): New. Name taken from GNU,
+ implementation our own.
+ * (resize-temp-buffer-window): New. GNU-compatible alias for
+ #'shrink-window-if-larger-than-buffer.
+ * dumped-lisp.el (preloaded-file-list): Move easy-mmode before
+ help, now that the latter uses #'define-minor-mode.
+ * frame.el: Point to #'temp-buffer-resize-mode in a comment.
+ Some of this code is from GNU; help.el CVS version 1.327 of
+ 2007-03-21, window.el CVS version 1.122, of 2007-06-24. Both these
+ are GPLV2 or later.
+
2008-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
* subr.el (skip-chars-quote):
diff -r b82fdf7305eef16a68a94d48a5b532a589f0e55b -r bd28481bb0e107fc21856a72d58f79539732621e lisp/dumped-lisp.el
--- a/lisp/dumped-lisp.el Wed Aug 27 21:47:21 2008 +0200
+++ b/lisp/dumped-lisp.el Sun Aug 31 12:26:46 2008 +0200
@@ -95,7 +95,6 @@ in dumped-lisp.el and is not itself list
;; (pureload "profile")
"loadhist" ; Must be dumped before loaddefs is loaded
; Used by help.
- "help"
;; (pureload "hyper-apropos") Soon...
"files"
"lib-complete"
@@ -110,7 +109,8 @@ in dumped-lisp.el and is not itself list
"register"
"iso8859-1" ; This must be before any modes
; (sets standard syntax table.)
- "easy-mmode" ; Added for 21.5.
+ "easy-mmode" ; Added for 21.5. Used by help.
+ "help"
"easymenu" ; Added for 20.3.
"lisp-mode"
"text-mode"
diff -r b82fdf7305eef16a68a94d48a5b532a589f0e55b -r bd28481bb0e107fc21856a72d58f79539732621e lisp/frame.el
--- a/lisp/frame.el Wed Aug 27 21:47:21 2008 +0200
+++ b/lisp/frame.el Sun Aug 31 12:26:46 2008 +0200
@@ -1850,6 +1850,8 @@ is first in the list. VISIBLE-ONLY will
:type 'number
:group 'frames)
+;; See also #'temp-buffer-resize-mode in help.el.
+
(defun show-temp-buffer-in-current-frame (buffer)
"For use as the value of `temp-buffer-show-function':
always displays the buffer in the selected frame, regardless of the behavior
diff -r b82fdf7305eef16a68a94d48a5b532a589f0e55b -r bd28481bb0e107fc21856a72d58f79539732621e lisp/help.el
--- a/lisp/help.el Wed Aug 27 21:47:21 2008 +0200
+++ b/lisp/help.el Sun Aug 31 12:26:46 2008 +0200
@@ -1878,4 +1878,21 @@ if none, call mouse-track. "
(find-variable (extent-property e 'find-variable-symbol)))
(mouse-track event)))))
+(define-minor-mode temp-buffer-resize-mode
+ "Toggle the mode which makes windows smaller for temporary buffers.
+With prefix argument ARG, turn the resizing of windows displaying temporary
+buffers on if ARG is positive or off otherwise.
+This makes the window the right height for its contents, but never
+less than `window-min-height' nor a higher proportion of its frame than
+`temp-buffer-max-height'. (Note the differing semantics of the latter
+versus GNU Emacs, where `temp-buffer-max-height' is an integer number of
+lines.)
+This applies to `help', `apropos' and `completion' buffers, and some others."
+:global t :group 'help
+ ;; XEmacs; our implementation of this is very different.
+ (setq temp-buffer-shrink-to-fit temp-buffer-resize-mode))
+
+;; GNU name for this function.
+(defalias 'resize-temp-buffer-window 'shrink-window-if-larger-than-buffer)
+
;;; help.el ends here
diff -r b82fdf7305eef16a68a94d48a5b532a589f0e55b -r bd28481bb0e107fc21856a72d58f79539732621e lisp/window.el
--- a/lisp/window.el Wed Aug 27 21:47:21 2008 +0200
+++ b/lisp/window.el Sun Aug 31 12:26:46 2008 +0200
@@ -33,16 +33,19 @@
;;;; Window tree functions.
-(defun one-window-p (&optional nomini which-frames which-devices)
- "Return non-nil if the selected window is the only window (in its frame).
-Optional arg NOMINI non-nil means don't count the minibuffer
-even if it is active.
-
-By default, only the windows in the selected frame are considered.
-The optional argument WHICH-FRAMES changes this behavior:
-WHICH-FRAMES nil or omitted means count only the selected frame,
+;; XEmacs addition, to expose WINDOW.
+(defun only-window-p (&optional window nomini which-frames which-devices)
+ "Return non-nil if WINDOW is the only window in some context,
+normally its frame. Optional arg NOMINI non-nil means don't count the
+minibuffer even if it is active.
+
+The optional argument WHICH-FRAMES changes the frames that are considered:
+
+WHICH-FRAMES nil or omitted means count only WINDOW's frame,
plus the minibuffer it uses (which may be on another frame).
-WHICH-FRAMES = `visible' means include windows on all visible frames.
+\(But, for all values of WHICH-FRAMES, see the documentation for the
+WHICH-DEVICES argument.)
+WHICH-FRAMES = `visible' means include windows on all visible frames
WHICH-FRAMES = 0 means include windows on all visible and iconified frames.
WHICH-FRAMES = t means include windows on all frames including invisible frames.
If WHICH-FRAMES is any other value, count only the selected frame.
@@ -56,11 +59,19 @@ If a device type, search all devices of
If a device type, search all devices of that type.
If `window-system', search all devices on window-system consoles.
Any other non-nil value means search all devices."
- (let ((base-window (selected-window)))
- (if (and nomini (eq base-window (minibuffer-window)))
+ (let ((base-window (or window (selected-window))))
+ (if (and nomini (eq base-window
+ (minibuffer-window (window-frame base-window))))
(setq base-window (next-window base-window)))
(eq base-window
(next-window base-window (if nomini 'arg) which-frames which-devices))))
+
+(defun one-window-p (&optional nomini which-frames which-devices)
+ "Return the result of calling `only-window-p' on the selected window.
+
+See that function's documentation for the meaning of the NOMINI,
+WHICH-FRAMES and WHICH-DEVICES arguments."
+ (only-window-p (selected-window) nomini which-frames which-devices))
(defun walk-windows (function &optional minibuf which-frames which-devices)
"Cycle through all visible windows, calling FUNCTION for each one.
@@ -351,24 +362,18 @@ No arg means split equally."
(interactive "p")
(shrink-window arg t))
-; (defun window-buffer-height (window)
-; "Return the height (in screen lines) of the buffer that WINDOW is displaying."
-; (save-excursion
-; (set-buffer (window-buffer window))
-; (goto-char (point-min))
-; (let ((ignore-final-newline
-; ;; If buffer ends with a newline, ignore it when counting height
-; ;; unless point is after it.
-; (and (not (eobp)) (eq ?\n (char-after (1- (point-max)))))))
-; (+ 1 (nth 2 (compute-motion (point-min)
-; '(0 . 0)
-; (- (point-max) (if ignore-final-newline 1 0))
-; (cons 0 100000000)
-; (window-width window)
-; nil
-; window))))))
-
-(defun count-screen-lines (&optional beg end count-final-newline window)
+(defun window-buffer-height (window)
+ "Return the height (in screen lines) of the buffer that WINDOW is displaying."
+ (with-current-buffer (window-buffer window)
+ (max 1
+ (count-screen-lines (point-min) (point-max)
+ ;; If buffer ends with a newline, ignore it when
+ ;; counting height unless point is after it.
+ (eobp)
+ window))))
+;; XEmacs change; accept BUFFER.
+(defun count-screen-lines (&optional beg end count-final-newline
+ window buffer)
"Return the number of screen lines in the region.
The number of screen lines may be different from the number of actual lines,
due to line breaking, display table, etc.
@@ -383,112 +388,120 @@ parameters such as width, horizontal scr
parameters such as width, horizontal scrolling, and so on. The default is
to use the selected window's parameters.
-Like `vertical-motion', `count-screen-lines' always uses the current buffer,
-regardless of which buffer is displayed in WINDOW. This makes possible to use
-`count-screen-lines' in any buffer, whether or not it is currently displayed
-in some window."
+Optional argument BUFFER is the buffer to check, and defaults to the current
+buffer. See `vertical-motion' for some caveats on the differences between
+this behaviour and that of GNU Emacs."
(unless beg
- (setq beg (point-min)))
+ (setq beg (point-min buffer)))
(unless end
- (setq end (point-max)))
+ (setq end (point-max buffer)))
+ (unless buffer
+ (setq buffer (current-buffer)))
(if (= beg end)
0
(save-excursion
(save-restriction
- (widen)
- (narrow-to-region (min beg end)
- (if (and (not count-final-newline)
- (= ?\n (char-before (max beg end))))
- (1- (max beg end))
- (max beg end)))
- (goto-char (point-min))
- (1+ (vertical-motion (buffer-size) window))))))
-
-; (defun fit-window-to-buffer (&optional window max-height min-height)
-; "Make WINDOW the right size to display its contents exactly.
-; If WINDOW is omitted or nil, it defaults to the selected window.
-; If the optional argument MAX-HEIGHT is supplied, it is the maximum height
-; the window is allowed to be, defaulting to the frame height.
-; If the optional argument MIN-HEIGHT is supplied, it is the minimum
-; height the window is allowed to be, defaulting to `window-min-height'.
-
-; The heights in MAX-HEIGHT and MIN-HEIGHT include the mode-line and/or
-; header-line."
-; (interactive)
-
-; (when (null window)
-; (setq window (selected-window)))
-; (when (null max-height)
-; (setq max-height (frame-height (window-frame window))))
-
-; (let* ((buf
-; ;; Buffer that is displayed in WINDOW
-; (window-buffer window))
-; (window-height
-; ;; The current height of WINDOW
-; (window-height window))
-; (desired-height
-; ;; The height necessary to show the buffer displayed by WINDOW
-; ;; (`count-screen-lines' always works on the current buffer).
-; (with-current-buffer buf
-; (+ (count-screen-lines)
-; ;; If the buffer is empty, (count-screen-lines) is
-; ;; zero. But, even in that case, we need one text line
-; ;; for cursor.
-; (if (= (point-min) (point-max))
-; 1 0)
-; ;; For non-minibuffers, count the mode-line, if any
-; (if (and (not (window-minibuffer-p window))
-; mode-line-format)
-; 1 0)
-; ;; Count the header-line, if any
-; (if header-line-format 1 0))))
-; (delta
-; ;; Calculate how much the window height has to change to show
-; ;; desired-height lines, constrained by MIN-HEIGHT and MAX-HEIGHT.
-; (- (max (min desired-height max-height)
-; (or min-height window-min-height))
-; window-height))
-; ;; We do our own height checking, so avoid any restrictions due to
-; ;; window-min-height.
-; (window-min-height 1))
-
-; ;; Don't try to redisplay with the cursor at the end
-; ;; on its own line--that would force a scroll and spoil things.
-; (when (with-current-buffer buf
-; (and (eobp) (bolp) (not (bobp))))
-; (set-window-point window (1- (window-point window))))
-
-; (save-selected-window
-; (select-window window)
-
-; ;; Adjust WINDOW to the nominally correct size (which may actually
-; ;; be slightly off because of variable height text, etc).
-; (unless (zerop delta)
-; (enlarge-window delta))
-
-; ;; Check if the last line is surely fully visible. If not,
-; ;; enlarge the window.
-; (let ((end (with-current-buffer buf
-; (save-excursion
-; (goto-char (point-max))
-; (when (and (bolp) (not (bobp)))
-; ;; Don't include final newline
-; (backward-char 1))
-; (when truncate-lines
-; ;; If line-wrapping is turned off, test the
-; ;; beginning of the last line for visibility
-; ;; instead of the end, as the end of the line
-; ;; could be invisible by virtue of extending past
-; ;; the edge of the window.
-; (forward-line 0))
-; (point)))))
-; (set-window-vscroll window 0)
-; (while (and (< desired-height max-height)
-; (= desired-height (window-height window))
-; (not (pos-visible-in-window-p end window)))
-; (enlarge-window 1)
-; (setq desired-height (1+ desired-height)))))))
+ (let ((old-window-buffer (window-buffer window)))
+ (unwind-protect
+ (progn
+ (set-window-buffer window buffer)
+ (set-buffer buffer)
+ (widen)
+ (narrow-to-region (min beg end)
+ (if (and (not count-final-newline)
+ (= ?\n (char-before (max beg end))))
+ (1- (max beg end))
+ (max beg end)))
+ (goto-char (point-min))
+ (1+ (vertical-motion (buffer-size) window)))
+ (set-window-buffer window old-window-buffer)))))))
+
+(defun fit-window-to-buffer (&optional window max-height min-height)
+ "Make WINDOW the right height to display its contents exactly.
+If WINDOW is omitted or nil, it defaults to the selected window.
+If the optional argument MAX-HEIGHT is supplied, it is the maximum height
+ the window is allowed to be, defaulting to the frame height.
+If the optional argument MIN-HEIGHT is supplied, it is the minimum
+ height the window is allowed to be, defaulting to `window-min-height'.
+
+The heights in MAX-HEIGHT and MIN-HEIGHT include the mode-line and/or
+header-line."
+ (interactive)
+
+ (when (null window)
+ (setq window (selected-window)))
+ (when (null max-height)
+ (setq max-height (frame-height (window-frame window))))
+
+ (let* ((buf
+ ;; Buffer that is displayed in WINDOW
+ (window-buffer window))
+ (window-height
+ ;; The current height of WINDOW
+ (window-height window))
+ (desired-height
+ ;; The height necessary to show the buffer displayed by WINDOW
+ ;; (`count-screen-lines' always works on the current buffer).
+ ;; XEmacs; it does in GNU, we provide a BUFFER argument, but we're
+ ;; not changing the implementation.
+ (with-current-buffer buf
+ (+ (count-screen-lines)
+ ;; If the buffer is empty, (count-screen-lines) is
+ ;; zero. But, even in that case, we need one text line
+ ;; for cursor.
+ (if (= (point-min) (point-max))
+ 1 0)
+ ;; For non-minibuffers, count the mode-line, if any
+ (if (and (not (window-minibuffer-p window))
+ mode-line-format)
+ 1 0)
+ ;; Count the header-line, if any
+ ;; XEmacs change; we don't have header-line-format.
+ ;; (if header-line-format 1 0))))
+ (if (specifier-instance top-gutter) 1 0))))
+ (delta
+ ;; Calculate how much the window height has to change to show
+ ;; desired-height lines, constrained by MIN-HEIGHT and MAX-HEIGHT.
+ (- (max (min desired-height max-height)
+ (or min-height window-min-height))
+ window-height)))
+
+ ;; Don't try to redisplay with the cursor at the end
+ ;; on its own line--that would force a scroll and spoil things.
+ (when (with-current-buffer buf
+ (and (eobp) (bolp) (not (bobp))))
+ (set-window-point window (1- (window-point window))))
+
+ ;; Adjust WINDOW to the nominally correct size (which may actually
+ ;; be slightly off because of variable height text, etc).
+ (unless (zerop delta)
+ (enlarge-window delta nil window))
+
+ ;; Check if the last line is surely fully visible. If not,
+ ;; enlarge the window.
+ (let ((end (with-current-buffer buf
+ (save-excursion
+ (goto-char (point-max))
+ (when (and (bolp) (not (bobp)))
+ ;; Don't include final newline
+ (backward-char 1))
+ (when truncate-lines
+ ;; If line-wrapping is turned off, test the
+ ;; beginning of the last line for visibility
+ ;; instead of the end, as the end of the line
+ ;; could be invisible by virtue of extending past
+ ;; the edge of the window.
+ (forward-line 0))
+ (point))))
+ ;; XEmacs change; bind window-pixel-vscroll-increment, we don't
+ ;; have #'set-window-vscroll.
+ (window-pixel-scroll-increment 0))
+ ; (set-window-vscroll window 0)
+ (while (and (< desired-height max-height)
+ (= desired-height (window-height window))
+ (not (pos-visible-in-window-p end window)))
+ (enlarge-window 1 nil window)
+ (setq desired-height (1+ desired-height))))))
(defun shrink-window-if-larger-than-buffer (&optional window)
"Shrink the WINDOW to be as small as possible to display its contents.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
Re: [Q] Add #'only-window-p, like #'one-window-p with explicit window
16 years, 3 months
Aidan Kehoe
Well, we haven’t added window-utils.el, because it turned out not to be
necessary for #'resize-temp-buffer-window support, and the need for
#'resize-temp-buffer-window’s functionality in eshell was the main reason we
wanted to add it in the first place. I wasn’t in a hurry to add
window-utils.el in the absence of a need for it from other code; see
http://mid.gmane.org/18618.29229.994720.901243@parhasard.net , which also
supersedes the below.
Ar an chéad lá de mí Méan Fómhair, scríobh Stephen J. Turnbull:
> QUERY
>
> I know you'd rather use Mercurial than CVS<snort />, but wouldn't this
> be an appropriate addition to xemacs-packages/window-utils.el? Yes,
> you'd have to move `one-window-p' too. I'd really like to get this
> stuff out of core where it just causes unnecessary backward
> incompatibility.
>
> It also might be nice if `one-window-p' were a defsubst, but for that
> to work you'd have to introduce order dependencies in compilation.
>
> Aidan Kehoe writes:
>
> > lisp/ChangeLog addition:
> >
> > 2008-08-30 Aidan Kehoe <kehoea(a)parhasard.net>
> >
> > * window.el (only-window-p): New.
> > Check if WINDOW is the only window in some context, normally its
> > frame.
> > (one-window-p):
> > Implemented this in terms of #'only-window-p, calling it on the
> > selected window.
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches