Documentation updates, plus a few random changes. Applies on top of
my previous patches.
C ChangeLog:
1998-05-01 Hrvoje Niksic <hniksic(a)srce.hr>
* data.c (Fneq): Fix docstring.
(arithcompare_many): Slightly simplify.
Lisp ChangeLog:
1998-05-01 Hrvoje Niksic <hniksic(a)srce.hr>
* byte-optimize.el (byte-boolean-vars): Removed.
(byte-optimize-lapcode): Use `built-in-variable-type' instead of
lookup through `byte-boolean-vars'.
man/ChangeLog:
1998-05-02 Hrvoje Niksic <hniksic(a)srce.hr>
* lispref/numbers.texi (Comparison of Numbers): Document multi-arg
comparison functions.
--- lisp/byte-optimize.el.orig Fri May 1 20:21:08 1998
+++ lisp/byte-optimize.el Fri May 1 21:49:08 1998
@@ -1396,29 +1396,41 @@
;;; old-pop-ups are not EQ when really they are. So we have to know what
;;; the BOOL variables are, and not perform this optimization on them.
;;;
-(defconst byte-boolean-vars
- '(abbrev-all-caps purify-flag find-file-compare-truenames
- find-file-use-truenames find-file-visit-truename
- find-file-existing-other-name byte-metering-on
- zmacs-regions zmacs-region-active-p zmacs-region-stays
- atomic-extent-goto-char-p suppress-early-error-handler
- noninteractive ignore-kernel debug-on-quit debug-on-next-call
- modifier-keys-are-sticky x-allow-sendevents vms-stmlf-recfm
- disable-auto-save-when-buffer-shrinks indent-tabs-mode
- load-in-progress load-warn-when-source-newer load-warn-when-source-only
- load-ignore-elc-files load-force-doc-strings
- fail-on-bucky-bit-character-escapes popup-menu-titles
- menubar-show-keybindings completion-ignore-case
- canna-empty-info canna-through-info canna-underline
- canna-inhibit-hankakukana x-handle-non-fully-specified-fonts
- print-escape-newlines print-readably
- delete-exited-processes truncate-partial-width-windows
- visible-bell no-redraw-on-reenter cursor-in-echo-area
- inhibit-warning-display parse-sexp-ignore-comments words-include-escapes
- scroll-on-clipped-lines pop-up-frames pop-up-windows)
- "DEFVAR_BOOL variables. Giving these any non-nil value sets them to t.
-If this does not enumerate all DEFVAR_BOOL variables, the byte-optimizer
-may generate incorrect code.")
+
+;;; This used to hold a large list of boolean variables, which had to
+;;; be updated every time a new DEFVAR_BOOL is added, making it very
+;;; hard to maintain. Such a list is not necessary under XEmacs,
+;;; where we can use `built-in-variable-type' to query for boolean
+;;; variables.
+
+;(defconst byte-boolean-vars
+; '(abbrev-all-caps purify-flag find-file-compare-truenames
+; find-file-use-truenames delete-auto-save-files byte-metering-on
+; x-seppuku-on-epipe zmacs-regions zmacs-region-active-p
+; zmacs-region-stays atomic-extent-goto-char-p
+; suppress-early-error-handler-backtrace noninteractive
+; inhibit-early-packages inhibit-autoloads debug-paths
+; inhibit-site-lisp debug-on-quit debug-on-next-call
+; modifier-keys-are-sticky x-allow-sendevents
+; mswindows-dynamic-frame-resize focus-follows-mouse
+; inhibit-input-event-recording enable-multibyte-characters
+; disable-auto-save-when-buffer-shrinks
+; allow-deletion-of-last-visible-frame indent-tabs-mode
+; load-in-progress load-warn-when-source-newer
+; load-warn-when-source-only load-ignore-elc-files
+; load-force-doc-strings fail-on-bucky-bit-character-escapes
+; popup-menu-titles menubar-show-keybindings completion-ignore-case
+; canna-empty-info canna-through-info canna-underline
+; canna-inhibit-hankakukana enable-multibyte-characters
+; re-short-flag x-handle-non-fully-specified-fonts
+; print-escape-newlines print-readably delete-exited-processes
+; windowed-process-io visible-bell no-redraw-on-reenter
+; cursor-in-echo-area inhibit-warning-display
+; column-number-start-at-one parse-sexp-ignore-comments
+; words-include-escapes scroll-on-clipped-lines)
+; "DEFVAR_BOOL variables. Giving these any non-nil value sets them to t.
+;If this does not enumerate all DEFVAR_BOOL variables, the byte-optimizer
+;may generate incorrect code.")
(defun byte-optimize-lapcode (lap &optional for-effect)
"Simple peephole optimizer. LAP is both modified and returned."
@@ -1497,7 +1509,8 @@
((and (eq 'byte-varref (car lap2))
(eq (cdr lap1) (cdr lap2))
(memq (car lap1) '(byte-varset byte-varbind)))
- (if (and (setq tmp (memq (car (cdr lap2)) byte-boolean-vars))
+ (if (and (setq tmp (eq (built-in-variable-type (car (cdr lap2)))
+ 'boolean))
(not (eq (car lap0) 'byte-constant)))
nil
(setq keep-going t)
@@ -1803,7 +1816,8 @@
(eq (car (car (setq tmp (cdr (memq (cdr lap2) lap)))))
'byte-varref)
(eq (cdr (car tmp)) (cdr lap1))
- (not (memq (car (cdr lap1)) byte-boolean-vars)))
+ (not (eq (built-in-variable-type (car (cdr lap1)))
+ 'boolean)))
;;(byte-compile-log-lap " Pulled %s to end of loop" (car tmp))
(let ((newtag (byte-compile-make-tag)))
(byte-compile-log-lap
--- src/data.c.orig Fri May 1 19:49:50 1998
+++ src/data.c Sat May 2 00:13:04 1998
@@ -187,7 +187,7 @@
even though they are not the same object and are in fact of different
types. This is ABSOLUTELY AND UTTERLY HORRENDOUS but is necessary to
preserve byte-code compatibility with v19. This kludge is known as the
-\"char-to-int confoundance disease\" and appears in a number of other
+\"char-int confoundance disease\" and appears in a number of other
functions with `old-foo' equivalents.
Do not use this function!
@@ -374,9 +374,9 @@
DEFUN ("characterp", Fcharacterp, 1, 1, 0, /*
Return t if OBJECT is a character.
-Unlike in XEmacs v19 and Emacs, a character is its own primitive type.
+Unlike in XEmacs v19 and FSF Emacs, a character is its own primitive type.
Any character can be converted into an equivalent integer using
-`char-to-int'. To convert the other way, use `int-to-char'; however,
+`char-int'. To convert the other way, use `int-char'; however,
only some integers can be converted into characters. Such an integer
is called a `char-int'; see `char-int-p'.
@@ -434,7 +434,7 @@
DEFUN ("char-int-p", Fchar_int_p, 1, 1, 0, /*
Return t if OBJECT is an integer that can be converted into a character.
-See `char-to-int'.
+See `char-int'.
*/
(object))
{
@@ -1017,16 +1017,15 @@
arithcompare_many (enum arith_comparison comparison,
int nargs, Lisp_Object *args)
{
- REGISTER int argnum;
- for (argnum = 1; argnum < nargs; argnum++)
- if (EQ (arithcompare (args[argnum-1], args[argnum], comparison), Qnil))
+ for (; --nargs > 0; args++)
+ if (NILP (arithcompare (*args, *(args + 1), comparison)))
return Qnil;
return Qt;
}
DEFUN ("=", Feqlsign, 1, MANY, 0, /*
-Return t if all the arguments are equal.
+Return t if all the arguments are numerically equal.
The arguments may be numbers, characters or markers.
*/
(int nargs, Lisp_Object *args))
@@ -1071,7 +1070,7 @@
}
DEFUN ("/=", Fneq, 1, MANY, 0, /*
-Return t if the sequence of arguments is monotonically increasing.
+Return t if no two arguments are numerically equal.
The arguments may be numbers, characters or markers.
*/
(int nargs, Lisp_Object *args))
--- man/lispref/numbers.texi.orig Sat May 2 01:00:01 1998
+++ man/lispref/numbers.texi Sat May 2 01:00:49 1998
@@ -240,7 +240,7 @@
Here's a function to do this:
@example
-(defvar fuzz-factor 1.0e-6)
+(defconst fuzz-factor 1.0e-6)
(defun approx-equal (x y)
(or (and (= x 0) (= y 0))
(< (/ (abs (- x y))
@@ -257,40 +257,79 @@
limited range of integer values.
@end quotation
-@defun = number-or-marker1 number-or-marker2
-This function tests whether its arguments are numerically equal, and
-returns @code{t} if so, @code{nil} otherwise.
+In addition to numbers, all of the following functions also accept
+characters and markers as arguments, and treat them as their number
+equivalents.
+
+@defun = number &rest more-numbers
+This function returns @code{t} if all of its arguments are numerically
+equal, @code{nil} otherwise.
+
+@example
+(= 5)
+ @result{} t
+(= 5 6)
+ @result{} nil
+(= 5 5.0)
+ @result{} t
+(= 5 5 6)
+ @result{} nil
+@end example
@end defun
-@defun /= number-or-marker1 number-or-marker2
-This function tests whether its arguments are numerically not equal. It
-returns @code{t} if so, and @code{nil} otherwise.
+@defun /= number &rest more-numbers
+This function returns @code{t} if no two arguments are numerically
+equal, @code{nil} otherwise.
+
+@example
+(/= 5 6)
+ @result{} t
+(/= 5 5 6)
+ @result{} nil
+(/= 5 6 1)
+ @result{} t
+@end example
@end defun
-@defun < number-or-marker1 number-or-marker2
-This function tests whether its first argument is strictly less than
-its second argument. It returns @code{t} if so, @code{nil} otherwise.
+@defun < number &rest more-numbers
+This function returns @code{t} if the sequence of its arguments is
+monotonically increasing, @code{nil} otherwise.
+
+@example
+(< 5 6)
+ @result{} t
+(< 5 6 6)
+ @result{} nil
+(< 5 6 7)
+ @result{} t
+@end example
@end defun
-@defun <= number-or-marker1 number-or-marker2
-This function tests whether its first argument is less than or equal
-to its second argument. It returns @code{t} if so, @code{nil}
-otherwise.
+@defun <= number &rest more-numbers
+This function returns @code{t} if the sequence of its arguments is
+monotonically nondecreasing, @code{nil} otherwise.
+
+@example
+(<= 5 6)
+ @result{} t
+(<= 5 6 6)
+ @result{} t
+(<= 5 6 5)
+ @result{} nil
+@end example
@end defun
-@defun > number-or-marker1 number-or-marker2
-This function tests whether its first argument is strictly greater
-than its second argument. It returns @code{t} if so, @code{nil}
-otherwise.
+@defun > number &rest more-numbers
+This function returns @code{t} if the sequence of its arguments is
+monotonically increasing, @code{nil} otherwise.
@end defun
-@defun >= number-or-marker1 number-or-marker2
-This function tests whether its first argument is greater than or
-equal to its second argument. It returns @code{t} if so, @code{nil}
-otherwise.
+@defun >= number &rest more-numbers
+This function returns @code{t} if the sequence of its arguments is
+monotonically nonincreasing, @code{nil} otherwise.
@end defun
-@defun max number-or-marker &rest numbers-or-markers
+@defun max number &rest more-numbers
This function returns the largest of its arguments.
@example
@@ -303,7 +342,7 @@
@end example
@end defun
-@defun min number-or-marker &rest numbers-or-markers
+@defun min number &rest more-numbers
This function returns the smallest of its arguments.
@example
--
Hrvoje Niksic <hniksic(a)srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Oh lord won't you buy me a color TV...