Commits

cvs  committed 1ccc32a

Import from CVS: tag r21-2-38

  • Participants
  • Parent commits 34f3776
  • Tags r21-2-38

Comments (0)

Files changed (126)

File CHANGES-beta

+to 21.2.38 "Peisino,Ak(B"
+-- Keyboard commands to set code system now work in file-coding
+   Emacsen! -- Jan Vroonhof (actually in 21.2.37)
+-- Calls to the following functions are now better optimized:
+   backward-char backward-word plusp, minusp oddp evenp -- Martin Buchholz
+-- COUNT argument to following functions is now optional:
+   forward-word backward-word mark-word kill-word backward-kill-word 
+   forward-comment delete-char backward-delete-char -- Martin Buchholz
+-- Don't put gutters/tabs on popup windows -- Andy Piper
+-- Fix up info file cross references -- Adrian Aichner
+-- Make `format' 64-bit clean -- Martin Buchholz
+-- unexec changes on Windows -- Martin Buchholz
+-- Make ptys work again on Cygwin -- Philip Aston
+-- GCPRO fixes -- Yoshiki Hayashi, Gunnar Evermann, Martin Buchholz
+-- Fix dumping problems on SGI Irix 6 -- Max Matveev, Martin Buchholz
+-- Make DEBUG_GCPRO work again -- Gunnar Evermann
+-- Pdump fixes -- Olivier Galibert
+-- Case table changes -- Yoshiki Hayashi
+-- Fix remaining tab oddities -- Andy Piper
+-- Fix Windows unexec -- Andy Piper
+-- byte-compiler arithmetic improvements -- Martin Buchholz
+
 to 21.2.37 "Pan"
 -- etags fix -- Stephen Carney
 -- more gutters and tab changes -- Andy Piper
 -- Detect _getpty correctly (for SGIs) -- Martin Buchholz
 -- Several GCPRO bugs found -- Yoshiki Hayashi
 -- `replace-buffer-in-windows' now has the same WHICH-FRAMES and
-   WHICH-DEVICES paratmeters as `delete-windows-on' -- Martin Buchholz
+   WHICH-DEVICES parameters as `delete-windows-on' -- Martin Buchholz
 -- Add support for Compaq C on Alpha Linux -- Martin Buchholz
 -- auto-save fixes -- Yoshiki Hayashi
 -- Removed unused C vars detected by Compaq C -- Martin Buchholz
+2000-12-05  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.38 is released.
+
+2000-11-26  Bj�rn Torkelsson  <torkel@hpc2n.umu.se>
+
+	* configure.in: Only show message about DnD API if compiling with DnD
+
+2000-11-09  Martin Buchholz  <martin@xemacs.org>
+
+	* configure.in: Autodetect elf.h.
+
 2000-11-14  Martin Buchholz <martin@xemacs.org>
 
 	* XEmacs 21.2.37 is released.
 test -n "$YACC" || YACC="yacc"
 
 
-for ac_hdr in   a.out.h   cygwin/version.h   fcntl.h   inttypes.h   libgen.h   locale.h   mach/mach.h   sys/param.h   sys/pstat.h   sys/time.h   sys/timeb.h   sys/un.h   ulimit.h   unistd.h   utime.h 
+for ac_hdr in   a.out.h   elf.h   cygwin/version.h   fcntl.h   inttypes.h   libgen.h   locale.h   mach/mach.h   sys/param.h   sys/pstat.h   sys/time.h   sys/timeb.h   sys/un.h   ulimit.h   unistd.h   utime.h 
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
   dragndrop_proto="$dragndrop_proto OffiX" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"OffiX\" to \$dragndrop_proto"; fi
 fi
 
-echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
-echo "configure:7038: checking if drag and drop API is needed" >&5
 if test "$with_dragndrop" != "no" ; then
+  echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
+echo "configure:7039: checking if drag and drop API is needed" >&5
   if test -n "$dragndrop_proto" ; then
     with_dragndrop=yes
     echo "$ac_t""yes (${dragndrop_proto} )" 1>&6

File configure.in

 dnl checks for header files
 AC_CHECK_HEADERS(dnl
   a.out.h dnl
+  elf.h dnl
   cygwin/version.h dnl
   fcntl.h dnl
   inttypes.h dnl
 
 dnl Autodetect Drag'n'Drop support
 dnl always included if CDE, Offix, or MSWindows are defined
-AC_MSG_CHECKING(if drag and drop API is needed)
 if test "$with_dragndrop" != "no" ; then
+  AC_MSG_CHECKING(if drag and drop API is needed)
   if test -n "$dragndrop_proto" ; then
     with_dragndrop=yes
     AC_MSG_RESULT([yes (${dragndrop_proto} )])

File lib-src/ChangeLog

+2000-12-05  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.38 is released.
+
+2000-11-13  Yoshiki Hayashi  <yoshiki@xemacs.org>
+
+	* Makefile.in.in: Define emacs iff it's necessary.
+
 2000-11-14  Martin Buchholz <martin@xemacs.org>
 
 	* XEmacs 21.2.37 is released.

File lib-src/Makefile.in.in

 ## Where will the generated files like config.h be included from?
 ## This is also why you _must_ use <...> instead of "..." 
 ## when #include'ing generated files.
-cppflags = -Demacs -I. -I../src -I$(srcdir) -I$(top_srcdir)/src $(CPPFLAGS)
+cppflags = -I. -I../src -I$(srcdir) -I$(top_srcdir)/src $(CPPFLAGS)
 cflags   = $(CFLAGS) $(cppflags) $(c_switch_general)
 ldflags  = $(LDFLAGS) $(ld_switch_general) $(ld_libs_general)
 
 	${CC} -c $(cflags) ${srcdir}/../src/alloca.c
 
 regex.o: ${srcdir}/../src/regex.c ${top_srcdir}/src/regex.h
-	$(CC) -c `echo $(cflags) | sed 's/-Demacs/ /'` \
+	$(CC) -c $(cflags) \
 	-DINHIBIT_STRING_HEADER ${top_srcdir}/src/regex.c
 
 etags_args = $(cflags) -DVERSION='"${version}"' ${srcdir}/etags.c \
 	$(CC) $(cflags) ${srcdir}/make-docfile.c $(ldflags) -o $@
 
 digest-doc: ${srcdir}/digest-doc.c
-	$(CC) $(cflags) ${srcdir}/digest-doc.c $(ldflags) -o $@
+	$(CC) -Demacs $(cflags) ${srcdir}/digest-doc.c $(ldflags) -o $@
 
 sorted-doc: ${srcdir}/sorted-doc.c
 	$(CC) $(cflags) ${srcdir}/sorted-doc.c $(ldflags) -o $@
 ## because XEmacs provides built-in timer facilities.
 
 make-path: ${srcdir}/make-path.c ../src/config.h
-	$(CC) $(cflags) ${srcdir}/make-path.c -o $@
+	$(CC) -Demacs $(cflags) ${srcdir}/make-path.c -o $@
 
 ## These are NOT included in INSTALLABLES or UTILITIES.
 ## See ../src/Makefile.in.in.

File lisp/ChangeLog

+2000-12-05  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.38 is released.
+
+2000-12-04  Didier Verna  <didier@xemacs.org>
+
+	* mouse.el (default-mouse-track-set-point-in-window): remove
+	spurious '+' operation detected by Martin.
+
+
+2000-12-01  Martin Buchholz  <martin@xemacs.org>
+
+	* cl-extra.el (coerce):
+	Implement char to integer coercion.
+	Remove extraneous (numberp) test.
+
+	* byte-optimize.el (byte-compile-splice-in-already-compiled-code):
+	Perform lapcode inlining if the value of `byte-optimize' is 'byte.
+	(byte-optimize-predicate):
+	Warn if evaluating constant expression signals an error.
+	(byte-optimize-form): Small simplification.
+
+	* cl-macs.el (cl-do-proclaim): small efficiency improvement.
+
+2000-11-30  Martin Buchholz  <martin@xemacs.org>
+
+	* byte-optimize.el:
+	(byte-optimize-minus):
+	(byte-optimize-plus):
+	(byte-optimize-mult):
+	(byte-optimize-quo):
+	Use (car (last x)) instead of (last x) to get last elt!
+	Use `byte-optimize-predicate' to optimize `%'.
+	Move optimizations for special numeric args to bytecomp.el.
+	* bytecomp.el (byte-compile-associative): Remove.
+	(byte-compile-max): New.
+	(byte-compile-min): New.
+	Properly handle erroneous calls: (max) (min).
+	(byte-compile-plus): New.
+	(byte-compile-minus):
+	It's easiest to handle 0, +1 and -1 args here.
+	(byte-compile-mult): New.
+	It's easiest to handle 1, -1 and 2 args here.
+	(byte-compile-quo):
+	It's easiest to handle 0, +1 and -1 args here.
+	Issue byte-compiler warning when dividing by zero.
+
+	Byte-compiler arithmetic improvements.
+	Better optimize these expressions in the obvious way:
+	(+ x y 1)   -->  varref x varref y add add1
+	(+ x y -1)  -->  varref x varref y add sub1
+	(- x y 0)   -->  (- x y)
+	(- 0 x y)   -->  (- (- x) y)
+	(% 42 19)   --> compile-time constant
+	(/ 42 19)   --> compile-time constant
+	(* (foo) 2) --> foo call dup plus
+
+	Optimize away arithmetic operations (+ x) (* x) (/ x 1)
+	unless (declaim (optimize (safety 3)))
+	or (setq byte-compile-delete-errors nil).
+
+2000-11-28  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* paragraphs.el (paragraph-separate, forward-sentence):  Clarify
+	docstrings.
+
+2000-11-08  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* startup.el (command-line-do-help):  Add documentation of
+	portable dumper switches.
+
+2000-11-22  Andy Piper  <andy@xemacs.org>
+
+	* x-mouse.el (x-init-pointer-shape): use cursor-font explicitly.
+
+	* glyphs.el (init-glyphs): don't use autodetect for strings.
+
+2000-11-28  Martin Buchholz  <martin@xemacs.org>
+
+	* byte-optimize.el (byte-optimize-char-before):
+	(byte-optimize-backward-char):
+	(byte-optimize-backward-word):
+	Fix incorrect optimizations for these sorts of expressions:
+	(let ((x nil)) (backward-char x))
+
+2000-11-21  Martin Buchholz  <martin@xemacs.org>
+
+	* byte-optimize.el:
+	* byte-optimize.el (byte-optimize-backward-char): New.
+	* byte-optimize.el (byte-optimize-backward-word): New.
+	Make backward-word and backward-char as efficient as forward versions.
+
+	* bytecomp.el (byte-compile-no-args-with-one-extra):
+	* bytecomp.el (byte-compile-one-arg-with-one-extra):
+	* bytecomp.el (byte-compile-two-args-with-one-extra):
+	* bytecomp.el (byte-compile-zero-or-one-arg-with-one-extra):
+	* bytecomp.el (byte-compile-one-or-two-args-with-one-extra):
+	* bytecomp.el (byte-compile-two-or-three-args-with-one-extra):
+	Check if extra arg is constant nil, and if so, use byte-coded call.
+
+	* simple.el (backward-word):
+	* simple.el (mark-word):
+	* simple.el (kill-word):
+	* simple.el (backward-kill-word):
+	Make COUNT argument optional, for consistency with forward-char et al.
+
+	* abbrev.el (abbrev-string-to-be-defined):
+	* abbrev.el (inverse-abbrev-string-to-be-defined):
+	* abbrev.el (inverse-add-abbrev):
+	* abbrev.el (expand-region-abbrevs):
+	* buff-menu.el (Buffer-menu-execute):
+	* indent.el (move-to-left-margin):
+	* indent.el (indent-relative):
+	* indent.el (move-to-tab-stop):
+	* info.el (Info-reannotate-node):
+	* lisp-mode.el (lisp-indent-line):
+	* lisp.el (end-of-defun):
+	* lisp.el (move-past-close-and-reindent):
+	* misc.el (copy-from-above-command):
+	* mouse.el (default-mouse-track-scroll-and-set-point):
+	* page.el (forward-page):
+	* paragraphs.el (forward-paragraph):
+	* paragraphs.el (end-of-paragraph-text):
+	* picture.el (picture-forward-column):
+	* picture.el (picture-self-insert):
+	* rect.el (extract-rectangle-line):
+	* simple.el (newline):
+	* simple.el (fixup-whitespace):
+	* simple.el (backward-delete-char-untabify):
+	* simple.el (transpose-chars):
+	* simple.el (transpose-preceding-chars):
+	* simple.el (do-auto-fill):
+	* simple.el (indent-new-comment-line):
+	* simple.el (blink-matching-open):
+	* view-less.el (cleanup-backspaces):
+	* wid-edit.el (widget-transpose-chars):
+	* term/bg-mouse.el (bg-insert-moused-sexp):
+	Use more readable (backward-FOO n) instead of (forward-FOO -n).
+
+	* info.el (Info-fontify-node):
+	* simple.el (backward-delete-function):
+	Use canonical delete-backward-char instead of backward-delete-char.
+
+2000-11-20  Andy Piper  <andy@xemacs.org>
+
+	* gutter-items.el (update-tab-in-gutter): don't barf if there are
+	no buffers.
+
+2000-11-20  Andy Piper  <andy@xemacs.org>
+
+	* gutter-items.el (update-tab-in-gutter): don't give popup frames
+	buffer tabs.
+
+2000-11-18  Martin Buchholz  <martin@xemacs.org>
+
+	* cl-macs.el: Correctly optimize plusp minusp oddp evenp.
+	(proclaim inline...) was shadowing compiler-macros.
+
+2000-11-17  Martin Buchholz  <martin@xemacs.org>
+
+	* bytecomp.el (byte-compile-eval): New.
+	(byte-compile-initial-macro-environment): Use byte-compile-eval.
+	Keeps this promise made in Lispref:
+	"If a file being compiled contains a `defmacro' form, the macro is
+	defined temporarily for the rest of the compilation of that file."
+
+2000-11-09  Martin Buchholz  <martin@xemacs.org>
+
+	* cl.el (floatp-safe):
+	(plusp):
+	(minusp):
+	(oddp):
+	(evenp):
+	(cl-abs):
+	Use a better parameter name than `x'.
+
+	* cl-macs.el (check-type): Make continuable.  Change documentation
+	to require PLACE, but accept any form for compatibility.
+
+	* abbrev.el (define-abbrev): Use check-type.
+	* font-menu.el (font-menu-change-face): Use check-type.
+	* menubar.el (relabel-menu-item): Use check-type.
+	* itimer.el: Fix typo.
+
+2000-11-10  Yoshiki Hayashi  <yoshiki@xemacs.org>
+
+	* info.el (Info-extract-menu-node-name): Comma is a delimiter.
+
 2000-11-14  Martin Buchholz <martin@xemacs.org>
 
 	* XEmacs 21.2.37 is released.
 	* mule/mule-misc.el
 	(coding-keymap): New keymap. Define coding system keyboard
 	commands on file-coding builds too.
-	(coding-system-change-eol-conversion): 
-	(universal-coding-system-argument): 
-	(set-default-coding-systems): 
+	(coding-system-change-eol-conversion):
+	(universal-coding-system-argument):
+	(set-default-coding-systems):
 	(prefer-coding-system): Moved from mule-cmds.el
 	(set-buffer-process-coding-system): Moved from mule-misc.el
 

File lisp/abbrev.el

   "Define an abbrev in TABLE named NAME, to expand to EXPANSION or call HOOK.
 NAME and EXPANSION are strings.  Hook is a function or `nil'.
 To undefine an abbrev, define it with an expansion of `nil'."
-  (unless (or (null expansion) (stringp expansion))
-    (setq expansion (wrong-type-argument 'stringp expansion)))
-
-  (unless (or (null count) (integerp count))
-    (setq count (wrong-type-argument 'fixnump count)))
-
-  (unless (vectorp table)
-    (setq table (wrong-type-argument 'vectorp table)))
-
+  (check-type expansion (or null string))
+  (check-type count (or null integer))
+  (check-type table vector)
   (let* ((sym (intern name table))
          (oexp (and (boundp sym) (symbol-value sym)))
          (ohook (and (fboundp sym) (symbol-function sym))))
        (buffer-substring
 	(point)
 	(if (= arg 0) (mark)
-	  (save-excursion (forward-word (- arg)) (point))))))
+	  (save-excursion (backward-word arg) (point))))))
 
 (defun add-mode-abbrev (arg)
   "Define mode-specific abbrev for last word(s) before point.
 ARG is the argument to `inverse-add-global-abbrev' or
 `inverse-add-mode-abbrev'."
   (save-excursion
-    (forward-word (- arg))
+    (backward-word arg)
     (buffer-substring (point) (progn (forward-word 1) (point)))))
 
 (defun inverse-add-mode-abbrev (arg)
 (defun inverse-add-abbrev (table type arg)
   (let (name nameloc exp)
     (save-excursion
-     (forward-word (- arg))
+     (backward-word arg)
      (setq name (buffer-substring (point) (progn (forward-word 1)
 					       (setq nameloc (point))))))
     (set-text-properties 0 (length name) nil name)
 	(if (abbrev-expansion
 	     (setq string
 		   (buffer-substring
-		    (save-excursion (forward-word -1) (point))
+		    (save-excursion (backward-word) (point))
 		    pnt)))
 	    (if (or noquery (y-or-n-p (format "Expand `%s'? " string)))
 		(expand-abbrev)))))))

File lisp/buff-menu.el

     (let ((buff-menu-buffer (current-buffer))
 	  (buffer-read-only nil))
       (while (search-forward "\nD" nil t)
-	(forward-char -1)
+	(backward-char 1)
 	(let ((buf (Buffer-menu-buffer nil)))
 	  (or (eq buf nil)
 	      (eq buf buff-menu-buffer)
 	    (progn (delete-char 1)
 		   (insert ? ))
 	  (delete-region (point) (progn (forward-line 1) (point)))
- 	  (forward-char -1))))))
+ 	  (backward-char 1))))))
 
 (defun Buffer-menu-select ()
   "Select this line's buffer; also display buffers marked with `>'.

File lisp/byte-optimize.el

 
 ;;; Copyright (c) 1991, 1994 Free Software Foundation, Inc.
 
-;; Author: Jamie Zawinski <jwz@jwz.org>
-;;	Hallvard Furuseth <hbf@ulrik.uio.no>
+;; Authors: Jamie Zawinski <jwz@jwz.org>
+;;          Hallvard Furuseth <hbf@ulrik.uio.no>
+;;          Martin Buchholz <martin@xemacs.org>
 ;; Keywords: internal
 
 ;; This file is part of XEmacs.
 	(progn
 ;;	  (if (equal form new) (error "bogus optimizer -- %s" opt))
 	  (byte-compile-log "  %s\t==>\t%s" form new)
-	  (setq new (byte-optimize-form new for-effect))
-	  new)
+	  (byte-optimize-form new for-effect))
       form)))
 
 
 				(list (apply fun (nreverse constants)))))))))
     form))
 
+;;; It is not safe to optimize calls to arithmetic ops with one arg
+;;; away entirely (actually, it would be safe if we know the sole arg
+;;; is not a marker or if it appears in other arithmetic).
+
+;;; But this degree of paranoia is normally unjustified, so optimize unless
+;;; the user has done (declaim (safety 3)).  Implemented in bytecomp.el.
+
 (defun byte-optimize-plus (form)
-  (setq form (byte-optimize-delay-constants-math form 1 '+))
-  (if (memq 0 form) (setq form (delq 0 (copy-sequence form))))
-  ;;(setq form (byte-optimize-associative-two-args-math form))
-
-  (case (length (cdr form))
-    ((0)				; (+)
-     (condition-case ()
-	 (eval form)
-       (error form)))
-
-    ;; It is not safe to delete the function entirely
-    ;; (actually, it would be safe if we knew the sole arg
-    ;; is not a marker).
-    ;; ((1)
-    ;;  (nth 1 form))
-
-    ((2)				; (+ x y)
-     (byte-optimize-predicate
-      (cond
-       ;; `add1' and `sub1' are a marginally fewer instructions
-       ;; than `plus' and `minus', so use them when possible.
-       ((eq (nth 1 form)  1) `(1+ ,(nth 2 form))) ; (+ 1 x)   -->  (1+ x)
-       ((eq (nth 2 form)  1) `(1+ ,(nth 1 form))) ; (+ x 1)   -->  (1+ x)
-       ((eq (nth 1 form) -1) `(1- ,(nth 2 form))) ; (+ -1 x)  -->  (1- x)
-       ((eq (nth 2 form) -1) `(1- ,(nth 1 form))) ; (+ x -1)  -->  (1- x)
-       (t form))))
-
-    (t (byte-optimize-predicate form))))
-
-(defun byte-optimize-minus (form)
-  ;; Put constants at the end, except the last constant.
-  (setq form (byte-optimize-delay-constants-math form 2 '+))
-  ;; Now only first and last element can be an integer.
-  (let ((last (last (nthcdr 3 form))))
-    (cond ((eq 0 last)
-	   ;; (- x y ... 0)  --> (- x y ...)
-	   (setq form (copy-sequence form))
-	   (setcdr (cdr (cdr form)) (delq 0 (nthcdr 3 form))))
-	  ;; If form is (- CONST foo... CONST), merge first and last.
-	  ((and (numberp (nth 1 form))
-		(numberp last))
-	   (setq form (nconc (list '- (- (nth 1 form) last) (nth 2 form))
-			     (delq last (copy-sequence (nthcdr 3 form))))))))
-
-  (case (length (cdr form))
-    ((0)				; (-)
-     (condition-case ()
-	 (eval form)
-       (error form)))
-
-    ;; It is not safe to delete the function entirely
-    ;; (actually, it would be safe if we knew the sole arg
-    ;; is not a marker).
-    ;; ((1)
-    ;;  (nth 1 form)
-
-    ((2)				; (+ x y)
-     (byte-optimize-predicate
-      (cond
-       ;; `add1' and `sub1' are a marginally fewer instructions than `plus'
-       ;; and `minus', so use them when possible.
-       ((eq (nth 2 form)  1) `(1- ,(nth 1 form))) ; (- x 1)  --> (1- x)
-       ((eq (nth 2 form) -1) `(1+ ,(nth 1 form))) ; (- x -1) --> (1+ x)
-       ((eq (nth 1 form)  0) `(-  ,(nth 2 form))) ; (- 0 x)  --> (- x)
-       (t form))))
-
-    (t (byte-optimize-predicate form))))
+  (byte-optimize-predicate (byte-optimize-delay-constants-math form 1 '+)))
 
 (defun byte-optimize-multiply (form)
   (setq form (byte-optimize-delay-constants-math form 1 '*))
   ;; If there is a constant integer in FORM, it is now the last element.
-  (cond ((null (cdr form)) 1)
-;;; It is not safe to delete the function entirely
-;;; (actually, it would be safe if we know the sole arg
-;;; is not a marker or if it appears in other arithmetic).
-;;;	((null (cdr (cdr form))) (nth 1 form))
-	((let ((last (last form)))
-	   (byte-optimize-predicate
-	    (cond ((eq 0 last)  (cons 'progn (cdr form)))
-		  ((eq 1 last)  (delq 1 (copy-sequence form)))
-		  ((eq -1 last) (list '- (delq -1 (copy-sequence form))))
-		  ((and (eq 2 last)
-			(memq t (mapcar 'symbolp (cdr form))))
-		   (prog1 (setq form (delq 2 (copy-sequence form)))
-		     (while (not (symbolp (car (setq form (cdr form))))))
-		     (setcar form (list '+ (car form) (car form)))))
-		  (form)))))))
+
+  (case (car (last form))
+    ;; (* x y 0) --> (progn x y 0)
+    (0 (cons 'progn (cdr form)))
+    (t (byte-optimize-predicate form))))
+
+(defun byte-optimize-minus (form)
+  ;; Put constants at the end, except the first arg.
+  (setq form (byte-optimize-delay-constants-math form 2 '+))
+  ;; Now only the first and last args can be integers.
+  (let ((last (car (last (nthcdr 3 form)))))
+    (cond
+     ;; If form is (- CONST foo... CONST), merge first and last.
+     ((and (numberp (nth 1 form)) (numberp last))
+      (decf (nth 1 form) last)
+      (butlast form))
+
+     ;; (- 0 x ...)  -->  (- (- x) ...)
+     ((and (eq 0 (nth 1 form)) (>= (length form) 3))
+      `(- (- ,(nth 2 form)) ,@(nthcdr 3 form)))
+
+     (t (byte-optimize-predicate form)))))
 
 (defun byte-optimize-divide (form)
+  ;; Put constants at the end, except the first arg.
   (setq form (byte-optimize-delay-constants-math form 2 '*))
-  ;; If there is a constant integer in FORM, it is now the last element.
-  (let ((last (last (cdr (cdr form)))))
-    (if (numberp last)
-	(cond ((= (length form) 3)
-	       (if (and (numberp (nth 1 form))
-			(not (zerop last))
-			(condition-case nil
-			    (/ (nth 1 form) last)
-			  (error nil)))
-		   (setq form (list 'progn (/ (nth 1 form) last)))))
-	      ((= last 1)
-	       (setq form (butlast form)))
-	      ((numberp (nth 1 form))
-	       (setq form (cons (car form)
-				(cons (/ (nth 1 form) last)
-				      (butlast (cdr (cdr form)))))
-		     last nil))))
+  ;; Now only the first and last args can be integers.
+  (let ((last (car (last (nthcdr 3 form)))))
     (cond
-;;;	  ((null (cdr (cdr form)))
-;;;	   (nth 1 form))
+     ;; If form is (/ CONST foo... CONST), merge first and last.
+     ((and (numberp (nth 1 form)) (numberp last))
+      (condition-case nil
+	  (cons (nth 0 form)
+		(cons (/ (nth 1 form) last)
+		      (butlast (cdr (cdr form)))))
+	(error form)))
+
+     ;; (/ 0 x y) --> (progn x y 0)
      ((eq (nth 1 form) 0)
       (append '(progn) (cdr (cdr form)) '(0)))
-     ((eq last -1)
-      (list '- (if (nthcdr 3 form)
-		   (butlast form)
-		 (nth 1 form))))
-     (form))))
+
+     ;; We don't have to check for divide-by-zero because `/' does.
+     (t (byte-optimize-predicate form)))))
 
 (defun byte-optimize-logmumble (form)
   (setq form (byte-optimize-delay-constants-math form 1 (car form)))
       (setq ok (byte-compile-constp (car rest))
 	    rest (cdr rest)))
     (if ok
-	(condition-case ()
+	(condition-case err
 	    (list 'quote (eval form))
-	  (error form))
+	  (error
+	   (byte-compile-warn "evaluating %s: %s" form err)
+	   form))
 	form)))
 
 (defun byte-optimize-identity (form)
 (put '*   'byte-optimizer 'byte-optimize-multiply)
 (put '-   'byte-optimizer 'byte-optimize-minus)
 (put '/   'byte-optimizer 'byte-optimize-divide)
+(put '%   'byte-optimizer 'byte-optimize-predicate)
 (put 'max 'byte-optimizer 'byte-optimize-associative-math)
 (put 'min 'byte-optimizer 'byte-optimize-associative-math)
 
 (put 'if    'byte-optimizer 'byte-optimize-if)
 (put 'while 'byte-optimizer 'byte-optimize-while)
 
-;; Remove any reason for avoiding `char-before'.
+;; The supply of bytecodes is small and constrained by backward compatibility.
+;; Several functions have byte-coded versions and hence are very efficient.
+;; Related functions which can be expressed in terms of the byte-coded
+;; ones should be transformed into bytecoded calls for efficiency.
+;; This is especially the case for functions with a backward- and
+;; forward- version, but with a bytecode only for the forward one.
+
+;; Some programmers have hand-optimized calls like (backward-char)
+;; into the call (forward-char -1).
+;; But it's so much nicer for the byte-compiler to do this automatically!
+
+;; (char-before) ==> (char-after (1- (point)))
+(put 'char-before   'byte-optimizer 'byte-optimize-char-before)
 (defun byte-optimize-char-before (form)
-  `(char-after (1- ,(or (nth 1 form) '(point))) ,@(cdr (cdr form))))
+  `(char-after
+    ,(cond
+      ((null (nth 1 form))
+       '(1- (point)))
+      ((equal '(point) (nth 1 form))
+       '(1- (point)))
+      (t `(1- (or ,(nth 1 form) (point)))))
+    ,@(cdr (cdr form))))
 
-(put 'char-before 'byte-optimizer 'byte-optimize-char-before)
+;; (backward-char n) ==> (forward-char (- n))
+(put 'backward-char 'byte-optimizer 'byte-optimize-backward-char)
+(defun byte-optimize-backward-char (form)
+  `(forward-char
+    ,(typecase (nth 1 form)
+       (null -1)
+       (integer (- (nth 1 form)))
+       (t `(- (or ,(nth 1 form) 1))))
+    ,@(cdr (cdr form))))
+
+;; (backward-word n) ==> (forward-word (- n))
+(put 'backward-word 'byte-optimizer 'byte-optimize-backward-word)
+(defun byte-optimize-backward-word (form)
+  `(forward-word
+    ,(typecase (nth 1 form)
+       (null -1)
+       (integer (- (nth 1 form)))
+       (t `(- (or ,(nth 1 form) 1))))
+    ,@(cdr (cdr form))))
+
+;; The following would be a valid optimization of the above kind, but
+;; the gain in performance is very small, since the saved funcall is
+;; counterbalanced by the necessity of adding a bytecode for (point).
+;;
+;; Also, users are more likely to have modified the behavior of
+;; delete-char via advice or some similar mechanism.  This is much
+;; less of a problem for the previous functions because it wouldn't
+;; make sense to modify the behaviour of `backward-char' without also
+;; modifying `forward-char', for example.
+
+;; (delete-char n) ==> (delete-region (point) (+ (point) n))
+;; (put 'delete-char 'byte-optimizer 'byte-optimize-delete-char)
+;; (defun byte-optimize-delete-char (form)
+;;   (case (length (cdr form))
+;;     (0 `(delete-region (point) (1+ (point))))
+;;     (1 `(delete-region (point) (+ (point) ,(nth 1 form))))
+;;     (t form)))
 
 ;; byte-compile-negation-optimizer lives in bytecomp.el
 ;(put '/= 'byte-optimizer 'byte-compile-negation-optimizer)
 (put 'atom 'byte-optimizer 'byte-compile-negation-optimizer)
 (put 'nlistp 'byte-optimizer 'byte-compile-negation-optimizer)
 
-
 (defun byte-optimize-funcall (form)
   ;; (funcall '(lambda ...) ...) ==> ((lambda ...) ...)
   ;; (funcall 'foo ...) ==> (foo ...)
 
 (defun byte-compile-splice-in-already-compiled-code (form)
   ;; form is (byte-code "..." [...] n)
-  (if (not (memq byte-optimize '(t lap)))
+  (if (not (memq byte-optimize '(t byte)))
       (byte-compile-normal-call form)
     (byte-inline-lapcode
      (byte-decompile-bytecode-1 (nth 1 form) (nth 2 form) t))

File lisp/bytecomp.el

 
 (defvar byte-compiler-error-flag)
 
+;;; A form of eval that includes the currently defined macro definitions.
+;;; This helps implement the promise made in the Lispref:
+;;;
+;;; "If a file being compiled contains a `defmacro' form, the macro is
+;;; defined temporarily for the rest of the compilation of that file."
+(defun byte-compile-eval (form)
+  (let ((save-macro-environment nil))
+    (unwind-protect
+	(loop for (sym . def) in byte-compile-macro-environment do
+	  (push
+	   (if (fboundp sym) (cons sym (symbol-function sym)) sym)
+	   save-macro-environment)
+	  (fset sym (cons 'macro def))
+	  finally return (eval form))
+      (dolist (elt save-macro-environment)
+	(if (symbolp elt)
+	    (fmakunbound elt)
+	  (fset (car elt) (cdr elt)))))))
+
 (defconst byte-compile-initial-macro-environment
   '((byte-compiler-options . (lambda (&rest forms)
 			       (apply 'byte-compiler-options-handler forms)))
     (eval-when-compile . (lambda (&rest body)
-			   (list 'quote (eval (cons 'progn body)))))
+			   (list 'quote (byte-compile-eval (cons 'progn body)))))
     (eval-and-compile . (lambda (&rest body)
-			  (eval (cons 'progn body))
+			  (byte-compile-eval (cons 'progn body))
 			  (cons 'progn body))))
   "The default macro-environment passed to macroexpand by the compiler.
 Placing a macro here will cause a macro to have different semantics when
 
 (defmacro byte-defop-compiler (function &optional compile-handler)
   ;; add a compiler-form for FUNCTION.
-  ;; If function is a symbol, then the variable "byte-SYMBOL" must name
-  ;; the opcode to be used.  If function is a list, the first element
+  ;; If FUNCTION is a symbol, then the variable "byte-SYMBOL" must name
+  ;; the opcode to be used.  If is a list, the first element
   ;; is the function and the second element is the bytecode-symbol.
   ;; COMPILE-HANDLER is the function to use to compile this byte-op, or
   ;; may be the abbreviations 0, 1, 2, 3, 0-1, 1-2, 2-3, 0+1, 1+1, 2+1,
 (byte-defop-compiler-rmsfun member	2)
 (byte-defop-compiler-rmsfun assq	2)
 
-(byte-defop-compiler max		byte-compile-associative)
-(byte-defop-compiler min		byte-compile-associative)
-(byte-defop-compiler (+ byte-plus)	byte-compile-associative)
-(byte-defop-compiler (* byte-mult)	byte-compile-associative)
-
 ;;####(byte-defop-compiler move-to-column	1)
 (byte-defop-compiler-1 interactive byte-compile-noop)
 (byte-defop-compiler-1 domain byte-compile-domain)
 (defun byte-compile-no-args-with-one-extra (form)
   (case (length (cdr form))
     (0 (byte-compile-no-args form))
-    (1 (byte-compile-normal-call form))
+    (1 (if (eq nil (nth 1 form))
+	   (byte-compile-no-args (butlast form))
+	 (byte-compile-normal-call form)))
     (t (byte-compile-subr-wrong-args form "0-1"))))
 
 (defun byte-compile-one-arg-with-one-extra (form)
   (case (length (cdr form))
     (1 (byte-compile-one-arg form))
-    (2 (byte-compile-normal-call form))
+    (2 (if (eq nil (nth 2 form))
+	   (byte-compile-one-arg (butlast form))
+	 (byte-compile-normal-call form)))
     (t (byte-compile-subr-wrong-args form "1-2"))))
 
 (defun byte-compile-two-args-with-one-extra (form)
   (case (length (cdr form))
     (2 (byte-compile-two-args form))
-    (3 (byte-compile-normal-call form))
+    (3 (if (eq nil (nth 3 form))
+	   (byte-compile-two-args (butlast form))
+	 (byte-compile-normal-call form)))
     (t (byte-compile-subr-wrong-args form "2-3"))))
 
 (defun byte-compile-zero-or-one-arg-with-one-extra (form)
   (case (length (cdr form))
     (0 (byte-compile-one-arg (append form '(nil))))
     (1 (byte-compile-one-arg form))
-    (2 (byte-compile-normal-call form))
+    (2 (if (eq nil (nth 2 form))
+	   (byte-compile-one-arg (butlast form))
+	 (byte-compile-normal-call form)))
     (t (byte-compile-subr-wrong-args form "0-2"))))
 
 (defun byte-compile-one-or-two-args-with-one-extra (form)
   (case (length (cdr form))
     (1 (byte-compile-two-args (append form '(nil))))
     (2 (byte-compile-two-args form))
-    (3 (byte-compile-normal-call form))
+    (3 (if (eq nil (nth 3 form))
+	   (byte-compile-two-args (butlast form))
+	 (byte-compile-normal-call form)))
     (t (byte-compile-subr-wrong-args form "1-3"))))
 
 (defun byte-compile-two-or-three-args-with-one-extra (form)
   (case (length (cdr form))
     (2 (byte-compile-three-args (append form '(nil))))
     (3 (byte-compile-three-args form))
-    (4 (byte-compile-normal-call form))
+    (4 (if (eq nil (nth 4 form))
+	   (byte-compile-three-args (butlast form))
+	 (byte-compile-normal-call form)))
     (t (byte-compile-subr-wrong-args form "2-4"))))
 
 (defun byte-compile-no-args-with-two-extra (form)
 (defun byte-compile-discard ()
   (byte-compile-out 'byte-discard 0))
 
-;; Compile a function that accepts one or more args and is right-associative.
-;; We do it by left-associativity so that the operations
-;; are done in the same order as in interpreted code.
-;(defun byte-compile-associative (form)
-;  (if (cdr form)
-;      (let ((opcode (get (car form) 'byte-opcode))
-;	    (args (copy-sequence (cdr form))))
-;	(byte-compile-form (car args))
-;	(setq args (cdr args))
-;	(while args
-;	  (byte-compile-form (car args))
-;	  (byte-compile-out opcode 0)
-;	  (setq args (cdr args))))
-;    (byte-compile-constant (eval form))))
-
-;; Compile a function that accepts one or more args and is right-associative.
-;; We do it by left-associativity so that the operations
-;; are done in the same order as in interpreted code.
-(defun byte-compile-associative (form)
-  (let ((args (cdr form))
-	(opcode (get (car form) 'byte-opcode)))
+(defun byte-compile-max (form)
+  (let ((args (cdr form)))
     (case (length args)
-      (0 (byte-compile-constant (eval form)))
+      (0 (byte-compile-subr-wrong-args form "1 or more"))
+      (1 (byte-compile-form (car args))
+	 (when (not byte-compile-delete-errors)
+	   (byte-compile-out 'byte-dup 0)
+	   (byte-compile-out 'byte-max 0)))
       (t (byte-compile-form (car args))
-	 (dolist (arg (cdr args))
-	   (byte-compile-form arg)
-	   (byte-compile-out opcode 0))))))
+	 (dolist (elt (cdr args))
+	   (byte-compile-form elt)
+	   (byte-compile-out 'byte-max 0))))))
+
+(defun byte-compile-min (form)
+  (let ((args (cdr form)))
+    (case (length args)
+      (0 (byte-compile-subr-wrong-args form "1 or more"))
+      (1 (byte-compile-form (car args))
+	 (when (not byte-compile-delete-errors)
+	   (byte-compile-out 'byte-dup 0)
+	   (byte-compile-out 'byte-min 0)))
+      (t (byte-compile-form (car args))
+	 (dolist (elt (cdr args))
+	   (byte-compile-form elt)
+	   (byte-compile-out 'byte-min 0))))))
 
 
 ;; more complicated compiler macros
 (byte-defop-compiler fset)
 (byte-defop-compiler insert)
 (byte-defop-compiler-1 function byte-compile-function-form)
-(byte-defop-compiler-1 - byte-compile-minus)
-(byte-defop-compiler (/ byte-quo) byte-compile-quo)
+(byte-defop-compiler max)
+(byte-defop-compiler min)
+(byte-defop-compiler (+ byte-plus)	byte-compile-plus)
+(byte-defop-compiler-1 -		byte-compile-minus)
+(byte-defop-compiler (* byte-mult)	byte-compile-mult)
+(byte-defop-compiler (/ byte-quo)	byte-compile-quo)
 (byte-defop-compiler nconc)
 (byte-defop-compiler-1 beginning-of-line)
 
       (byte-compile-out 'byte-concatN nargs))
      ((byte-compile-normal-call form)))))
 
+(defun byte-compile-plus (form)
+  (let ((args (cdr form)))
+    (case (length args)
+      (0 (byte-compile-constant 0))
+      (1 (byte-compile-plus (append form '(0))))
+      (t (byte-compile-form (car args))
+	 (dolist (elt (cdr args))
+	   (case elt
+	     (0  (when (not byte-compile-delete-errors)
+		   (byte-compile-constant 0)
+		   (byte-compile-out 'byte-plus 0)))
+	     (+1 (byte-compile-out 'byte-add1 0))
+	     (-1 (byte-compile-out 'byte-sub1 0))
+	     (t
+	      (byte-compile-form elt)
+	      (byte-compile-out 'byte-plus 0))))))))
+
 (defun byte-compile-minus (form)
   (let ((args (cdr form)))
     (case (length args)
 	 (byte-compile-out 'byte-negate 0))
       (t (byte-compile-form (car args))
 	 (dolist (elt (cdr args))
-	   (byte-compile-form elt)
-	   (byte-compile-out 'byte-diff 0))))))
+	   (case elt
+	     (0  (when (not byte-compile-delete-errors)
+		   (byte-compile-constant 0)
+		   (byte-compile-out 'byte-diff 0)))
+	     (+1 (byte-compile-out 'byte-sub1 0))
+	     (-1 (byte-compile-out 'byte-add1 0))
+	     (t
+	      (byte-compile-form elt)
+	      (byte-compile-out 'byte-diff 0))))))))
+
+(defun byte-compile-mult (form)
+  (let ((args (cdr form)))
+    (case (length args)
+      (0 (byte-compile-constant 1))
+      (1 (byte-compile-mult (append form '(1))))
+      (t (byte-compile-form (car args))
+	 (dolist (elt (cdr args))
+	   (case elt
+	     (1  (when (not byte-compile-delete-errors)
+		   (byte-compile-constant 1)
+		   (byte-compile-out 'byte-mult 0)))
+	     (-1 (byte-compile-out 'byte-negate 0))
+	     (2  (byte-compile-out 'byte-dup 0)
+		 (byte-compile-out 'byte-plus 0))
+	     (t
+	      (byte-compile-form elt)
+	      (byte-compile-out 'byte-mult 0))))))))
 
 (defun byte-compile-quo (form)
   (let ((args (cdr form)))
 	 (byte-compile-out 'byte-quo 0))
       (t (byte-compile-form (car args))
 	 (dolist (elt (cdr args))
-	   (byte-compile-form elt)
-	   (byte-compile-out 'byte-quo 0))))))
+	   (case elt
+	     (+1 (when (not byte-compile-delete-errors)
+		   (byte-compile-constant 1)
+		   (byte-compile-out 'byte-quo 0)))
+	     (-1 (byte-compile-out 'byte-negate 0))
+	     (t
+	      (when (and (numberp elt) (= elt 0))
+		(byte-compile-warn "Attempt to divide by zero: %s" form))
+	      (byte-compile-form elt)
+	      (byte-compile-out 'byte-quo 0))))))))
 
 (defun byte-compile-nconc (form)
   (let ((args (cdr form)))

File lisp/cl-extra.el

 	((eq type 'array) (if (arrayp x) x (vconcat x)))
 	((and (eq type 'character) (stringp x) (= (length x) 1)) (aref x 0))
 	((and (eq type 'character) (symbolp x)) (coerce (symbol-name x) type))
-	((and (eq type 'character) (numberp x) (char-or-char-int-p x)
-	      (int-char x)))
+	((and (eq type 'character) (char-int-p x)) (int-char x))
+	((and (eq type 'integer) (characterp x)) (char-int x))
 	((eq type 'float) (float x))
 	((eq type 'bit-vector) (if (bit-vector-p x) x
 				 (apply 'bit-vector (append x nil))))

File lisp/cl-macs.el

 
 	((eq (car-safe spec) 'optimize)
 	 (let ((speed (assq (nth 1 (assq 'speed (cdr spec)))
-			    '((0 nil) (1 t) (2 t) (3 t))))
+			    '((0 . nil) (1 . t) (2 . t) (3 . t))))
 	       (safety (assq (nth 1 (assq 'safety (cdr spec)))
-			     '((0 t) (1 t) (2 t) (3 nil)))))
-	   (if speed (setq cl-optimize-speed (car speed)
-			   byte-optimize (nth 1 speed)))
-	   (if safety (setq cl-optimize-safety (car safety)
-			    byte-compile-delete-errors (nth 1 safety)))))
+			     '((0 . t) (1 . t) (2 . t) (3 . nil)))))
+	   (when speed
+	     (setq cl-optimize-speed (car speed)
+		   byte-optimize (cdr speed)))
+	   (when safety
+	     (setq cl-optimize-safety (car safety)
+		   byte-compile-delete-errors (cdr safety)))))
 
 	((and (eq (car-safe spec) 'warn) (boundp 'byte-compile-warnings))
 	 (if (eq byte-compile-warnings t)
   (eval (cl-make-type-test 'object type)))
 
 ;;;###autoload
-(defmacro check-type (form type &optional string)
-  "Verify that FORM is of type TYPE; signal an error if not.
+(defmacro check-type (place type &optional string)
+  "Verify that PLACE is of type TYPE; signal a continuable error if not.
 STRING is an optional description of the desired type."
-  (and (or (not (cl-compiling-file))
-	   (< cl-optimize-speed 3) (= cl-optimize-safety 3))
-       (let* ((temp (if (cl-simple-expr-p form 3) form (gensym)))
-	      (body (list 'or (cl-make-type-test temp type)
-			  (list 'signal '(quote wrong-type-argument)
-				(list 'list (or string (list 'quote type))
-				      temp (list 'quote form))))))
-	 (if (eq temp form) (list 'progn body nil)
-	   (list 'let (list (list temp form)) body nil)))))
+  (when (or (not (cl-compiling-file))
+	    (< cl-optimize-speed 3)
+	    (= cl-optimize-safety 3))
+    (let* ((temp (if (cl-simple-expr-p place 3) place (gensym)))
+	   (test (cl-make-type-test temp type))
+	   (signal-error `(signal 'wrong-type-argument
+				  ,(list 'list (or string (list 'quote type))
+					 temp (list 'quote place))))
+	   (body
+	    (condition-case nil
+		`(while (not ,test)
+		   ,(macroexpand `(setf ,place ,signal-error)))
+	      (error
+	       `(if ,test (progn ,signal-error nil))))))
+      (if (eq temp place)
+	  body
+	`(let ((,temp ,place)) ,body)))))
 
 ;;;###autoload
 (defmacro assert (form &optional show-args string &rest args)
    (fifth 'nth 4 x) (sixth 'nth 5 x) (seventh 'nth 6 x)
    (eighth 'nth 7 x) (ninth 'nth 8 x) (tenth 'nth 9 x)
    (rest 'cdr x) (endp 'null x) (plusp '> x 0) (minusp '< x 0)
+   (oddp  'eq (list 'logand x 1) 1)
+   (evenp 'eq (list 'logand x 1) 0)
    (caar car car) (cadr car cdr) (cdar cdr car) (cddr cdr cdr)
    (caaar car caar) (caadr car cadr) (cadar car cdar)
    (caddr car cddr) (cdaar cdr caar) (cdadr cdr cadr)
 (proclaim '(inline floatp-safe acons map concatenate notany notevery
 ;; XEmacs change
 		   cl-set-elt revappend nreconc
-		   plusp minusp oddp evenp
 		   ))
 
 ;;; Things that are side-effect-free.  Moved to byte-optimize.el
 
 ;;; Numbers.
 
-(defun floatp-safe (x)
-  "Return t if OBJECT is a floating point number.
-On Emacs versions that lack floating-point support, this function
-always returns nil."
-  ;;(and (numberp x) (not (integerp x)))
-  ;; XEmacs: use floatp.  XEmacs is always compiled with
-  ;; floating-point, anyway.
-  (floatp x))
+(defun floatp-safe (object)
+  "Return t if OBJECT is a floating point number."
+  (floatp object))
 
-(defun plusp (x)
+(defun plusp (number)
   "Return t if NUMBER is positive."
-  (> x 0))
+  (> number 0))
 
-(defun minusp (x)
+(defun minusp (number)
   "Return t if NUMBER is negative."
-  (< x 0))
+  (< number 0))
 
-(defun oddp (x)
+(defun oddp (integer)
   "Return t if INTEGER is odd."
-  (eq (logand x 1) 1))
+  (eq (logand integer 1) 1))
 
-(defun evenp (x)
+(defun evenp (integer)
   "Return t if INTEGER is even."
-  (eq (logand x 1) 0))
+  (eq (logand integer 1) 0))
 
-(defun cl-abs (x)
-  "Return the absolute value of ARG."
-  (if (>= x 0) x (- x)))
+(defun cl-abs (number)
+  "Return the absolute value of NUMBER."
+  (if (>= number 0) number (- number)))
 (or (fboundp 'abs) (defalias 'abs 'cl-abs))   ; This is built-in to Emacs 19
 
 (defvar *random-state* (vector 'cl-random-state-tag -1 30 (cl-random-time)))

File lisp/faces.el

 If the optional FRAME argument is provided, change only
 in that frame; otherwise change each frame."
   (while (not (find-face face))
-    (setq face (signal 'wrong-type-argument (list 'facep face))))
+    (setq face (wrong-type-argument 'facep face)))
   (let ((bitmap-path (ecase (console-type)
 		       (x         x-bitmap-file-path)
 		       (mswindows mswindows-bitmap-file-path)))
 		   (and (listp pixmap) (= (length pixmap) 3)))))
 	(setq pixmap (signal 'wrong-type-argument
 			     (list 'stipple-pixmap-p pixmap)))))
-    (while (and frame (not (framep frame)))
-      (setq frame (signal 'wrong-type-argument (list 'framep frame))))
+    (check-type frame (or null frame))
     (set-face-background-pixmap face instantiator frame)))
 
 

File lisp/font-menu.el

 (defun font-menu-change-face (face
 			      from-family from-weight from-size
 			      to-family   to-weight   to-size)
-  (or (symbolp face) (setq face (wrong-type-argument 'symbolp face)))
+  (check-type face symbol)
   (let* ((dcache (device-fonts-cache))
 	 (font-data (font-menu-font-data face dcache))
 	 (face-family (aref font-data 1))

File lisp/glyphs.el

 				 [jpeg :data nil] 2)))
        ,@(if (featurep 'png) '(("\\.png\\'" [png :file nil] 2)))
        ,@(if (featurep 'png) '(("\\`\211PNG" [png :data nil] 2)))
-       ("" [autodetect :data nil] 2))))
+       ("" [string :data nil] 2)
+       ("" [nothing]))))
   ;; #### this should really be formatted-string, not string but we
   ;; don't have it implemented yet
   ;;

File lisp/gutter-items.el

 (defun update-tab-in-gutter (frame &optional force-selection)
   "Update the tab control in the gutter area."
     ;; dedicated frames don't get tabs
-  (unless (window-dedicated-p (frame-selected-window frame))
+  (unless (or (window-dedicated-p (frame-selected-window frame))
+	      (frame-property frame 'popup))
     (when (specifier-instance default-gutter-visible-p frame)
       (unless (and gutter-buffers-tab
 		   (eq (default-gutter-position)
 		       gutter-buffers-tab-orientation))
 	(add-tab-to-gutter))
       (when (valid-image-instantiator-format-p 'tab-control frame)
-	(set-glyph-image
-	 gutter-buffers-tab
-	 (vector 'tab-control :descriptor "Buffers" :face buffers-tab-face
-		 :orientation gutter-buffers-tab-orientation
-		 (if (or (eq gutter-buffers-tab-orientation 'top)
-			 (eq gutter-buffers-tab-orientation 'bottom))
-		     :pixel-width :pixel-height)
-		 (if (or (eq gutter-buffers-tab-orientation 'top)
-			 (eq gutter-buffers-tab-orientation 'bottom))
-		     '(gutter-pixel-width) '(gutter-pixel-height))
-		 :items (buffers-tab-items nil frame force-selection))
-	 frame)
-	;; set-glyph-image will not make the gutter dirty
-	(set-specifier-dirty-flag 
-	 (eval (intern (concat 
-			(symbol-name gutter-buffers-tab-orientation) 
-			"-gutter"))))))))
+	(let ((items (buffers-tab-items nil frame force-selection)))
+	  (when items
+	    (set-glyph-image
+	     gutter-buffers-tab
+	     (vector 'tab-control :descriptor "Buffers" :face buffers-tab-face
+		     :orientation gutter-buffers-tab-orientation
+		     (if (or (eq gutter-buffers-tab-orientation 'top)
+			     (eq gutter-buffers-tab-orientation 'bottom))
+			 :pixel-width :pixel-height)
+		     (if (or (eq gutter-buffers-tab-orientation 'top)
+			     (eq gutter-buffers-tab-orientation 'bottom))
+			 '(gutter-pixel-width) '(gutter-pixel-height)) 
+		     :items items)
+	     frame)
+	    ;; set-glyph-image will not make the gutter dirty
+	    (set-specifier-dirty-flag 
+	     (eval (intern (concat 
+			    (symbol-name gutter-buffers-tab-orientation) 
+			    "-gutter"))))))))))
 
 ;; A myriad of different update hooks all doing slightly different things
 (add-one-shot-hook 

File lisp/indent.el

 		(let ((tabend (* (/ (current-column) tab-width) tab-width)))
 		  (while (and (> (current-column) tabend)
 			      (eq (char-before (point)) ?\ ))
-		    (forward-char -1))
+		    (backward-char 1))
 		  (delete-region (point) before))))))))
 
 ;(define-key global-map "\t" 'indent-for-tab-command)

File lisp/info.el

 	    ;; Kludge.
 	    ;; Allow dots in node name not followed by whitespace.
 	    (re-search-forward
-	     (concat "\\(([^)]+)[^."
+	     (concat "\\(([^)]+)[^.,"
 		     (if multi-line "" "\n")
 		     "]*\\|\\([^.,\t"
 		     (if multi-line "" "\n")
 	    (forward-char 1)
 	    (insert "\n")
 	    (just-one-space)
-	    (backward-delete-char 1)
+	    (delete-backward-char 1)
 	    (setq p (point)
 		  len 0))))
       (toggle-read-only 1)

File lisp/itimer.el

 (defun itimer-live-p (object)
   "Return non-nil if OBJECT is an itimer and is active.
 ``Active'' means Emacs will run it when it expires.
-`activate-timer' must be called on an itimer to make it active.
+`activate-itimer' must be called on an itimer to make it active.
 Itimers started with `start-itimer' are automatically active."
   (and (itimerp object) (memq object itimer-list)))
 

File lisp/lisp-mode.el

       (if (and (looking-at "\\s<") (not (looking-at "\\s<\\s<")))
 	  ;; Single-semicolon comment lines should be indented
 	  ;; as comment lines, not as code.
-	  (progn (indent-for-comment) (forward-char -1))
+	  (progn (indent-for-comment) (backward-char 1))
 	(if (listp indent) (setq indent (car indent)))
 	(setq shift-amt (- indent (current-column)))
 	(if (zerop shift-amt)

File lisp/lisp.el

 			  (end-of-line 1)
 			  (beginning-of-defun-raw 1)))
 		    nil
-		  (or (bobp) (forward-char -1))
+		  (or (bobp) (backward-char 1))
 		  (beginning-of-defun-raw -1))
 		(setq first nil)
 		(forward-list 1)
   "Move past next `)', delete indentation before it, then indent after it."
   (interactive)
   (up-list 1)
-  (forward-char -1)
+  (backward-char 1)
   (while (save-excursion		; this is my contribution
 	   (let ((before-paren (point)))
 	     (back-to-indentation)

File lisp/menubar.el

 under the toplevel \"File\" menu.  (\"Menu\" \"Foo\" \"Item\") means the
 menu item called \"Item\" under the \"Foo\" submenu of \"Menu\".
 NEW-NAME is the string that the menu item will be printed as from now on."
-  (or (stringp new-name)
-      (setq new-name (wrong-type-argument 'stringp new-name)))
+  (check-type new-name string)
   (let* ((menubar current-menubar)
          (pair (find-menu-item menubar path))
          (item (car pair))

File lisp/mouse.el

       (let* ((edges (window-pixel-edges window))
 	     (row (event-y-pixel event))
 	     (text-start (nth 1 edges))
-	     (text-end (+ (nth 3 edges))))
+	     (text-end (nth 3 edges)))
 	(if (or (< row text-start)
 		(> row text-end))
 	    nil ;; Scroll

File lisp/page.el

     (and (save-excursion (re-search-backward page-delimiter nil t))
 	 (= (match-end 0) (point))
 	 (goto-char (match-beginning 0)))
-    (forward-char -1)
+    (backward-char 1)
     (if (re-search-backward page-delimiter nil t)
 	;; We found one--move to the end of it.
 	(goto-char (match-end 0))

File lisp/paragraphs.el

 	  nil
 	(setq start (point))
 	;; Move back over paragraph-separating lines.
-	(forward-char -1) (beginning-of-line)
+	(backward-char 1) (beginning-of-line)
 	(while (and (not (bobp))
 		    (progn (move-to-left-margin)
 			   (looking-at paragraph-separate)))
 (defun end-of-paragraph-text ()
   (let ((opoint (point)))
     (forward-paragraph 1)
-    (if (eq (char-before (point)) ?\n) (forward-char -1))
+    (if (eq (char-before (point)) ?\n) (backward-char 1))
     (if (<= (point) opoint)
 	(progn
 	  (forward-char 1)

File lisp/picture.el

     ;; but we might as well let the user move across them.
     (and (< arg 0)
 	 (> (current-column) target-column)
-	 (forward-char -1))))
+	 (backward-char 1))))
 
 (defun picture-backward-column (arg)
   "Move cursor left, making whitespace if necessary.
     (delete-char -1)
     ;; FSF changes the following to last-command-event.
     (insert last-command-char)
-    (forward-char -1)
+    (backward-char 1)
     (picture-move)
     ;; XEmacs addition:
     (setq zmacs-region-stays nil)))

File lisp/rect.el

     (goto-char start)
     (while (search-forward "\t" end t)
       (let ((width (- (current-column)
-		      (save-excursion (forward-char -1)
+		      (save-excursion (backward-char 1)
 				      (current-column)))))
 	(setq line (concat (substring line 0 (- (point) end 1))
 			   (spaces-string width)

File lisp/simple.el

   (save-excursion
     (delete-horizontal-space)
     (if (or (looking-at "^\\|\\s)")
-	    (save-excursion (forward-char -1)
+	    (save-excursion (backward-char 1)
 			    (looking-at "$\\|\\s(\\|\\s'")))
 	nil
       (insert ?\ ))))
       (while (and (> count 0) (not (bobp)))
 	(if (eq (char-before (point)) ?\t) ; XEmacs
 	    (let ((col (current-column)))
-	      (forward-char -1)
+	      (backward-char 1)
 	      (setq col (- col (current-column)))
 	      (insert-char ?\ col)
 	      (delete-char 1)))
-	(forward-char -1)
+	(backward-char 1)
 	(setq count (1- count)))))
   (delete-backward-char arg killp)
   ;; XEmacs: In overwrite mode, back over columns while clearing them out,
   :type 'boolean
   :group 'editing-basics)
 
-(defcustom backward-delete-function 'backward-delete-char
+(defcustom backward-delete-function 'delete-backward-char
   "*Function called to delete backwards on a delete keypress.
 If `delete-key-deletes-forward' is nil, `backward-or-forward-delete-char'
 calls this function to erase one character backwards.  Default value
-is 'backward-delete-char, with 'backward-delete-char-untabify being a
+is `delete-backward-char', with `backward-delete-char-untabify' being a
 popular alternate setting."
   :type 'function
   :group 'editing-basics)
 and drag it forward past ARG other characters (backward if ARG negative).
 If no argument and at end of line, the previous two chars are exchanged."
   (interactive "*P")
-  (and (null arg) (eolp) (forward-char -1))
+  (and (null arg) (eolp) (backward-char 1))
   (transpose-subr 'forward-char (prefix-numeric-value arg)))
 
 ;;; A very old implementation of transpose-chars from the old days ...
 and drag it forward past ARG other characters (backward if ARG negative).
 If no argument and not at start of line, the previous two chars are exchanged."
   (interactive "*P")
-  (and (null arg) (not (bolp)) (forward-char -1))
+  (and (null arg) (not (bolp)) (backward-char 1))
   (transpose-subr 'forward-char (prefix-numeric-value arg)))
 
 
  	  (forward-char 1)))))
 
 
-;; XEmacs - extra parameter
-(defun backward-word (arg &optional buffer)
-  "Move backward until encountering the end of a word.
-With argument, do this that many times.
-In programs, it is faster to call `forward-word' with negative arg."
-  (interactive "_p") ; XEmacs
-  (forward-word (- arg) buffer))
-
-(defun mark-word (arg)
-  "Set mark arg words away from point."
+(defun backward-word (&optional count buffer)
+  "Move point backward COUNT words (forward if COUNT is negative).
+Normally t is returned, but if an edge of the buffer is reached,
+point is left there and nil is returned.
+
+COUNT defaults to 1, and BUFFER defaults to the current buffer."
+  (interactive "_p")
+  (forward-word (- (or count 1)) buffer))
+
+(defun mark-word (&optional count)
+  "Mark the text from point until encountering the end of a word.
+With optional argument COUNT, mark COUNT words."
   (interactive "p")
-  (mark-something 'mark-word 'forward-word arg))
-
-;; XEmacs modified
-(defun kill-word (arg)
+  (mark-something 'mark-word 'forward-word count))
+
+(defun kill-word (&optional count)
   "Kill characters forward until encountering the end of a word.
+With optional argument COUNT, do this that many times."
+  (interactive "*p")
+  (kill-region (point) (save-excursion (forward-word count) (point))))
+
+(defun backward-kill-word (&optional count)
+  "Kill characters backward until encountering the end of a word.
 With argument, do this that many times."
   (interactive "*p")
-  (kill-region (point) (save-excursion (forward-word arg) (point))))
-
-(defun backward-kill-word (arg)
-  "Kill characters backward until encountering the end of a word.
-With argument, do this that many times."
-  (interactive "*p") ; XEmacs
-  (kill-word (- arg)))
+  (kill-word (- (or count 1))))
 
 (defun current-word (&optional strict)
   "Return the word point is on (or a nearby word) as a string.
 				(and (not (bobp))
 				     (not bounce)
 				     sentence-end-double-space
-				     (save-excursion (forward-char -1)
+				     (save-excursion (backward-char 1)
 						     (and (looking-at "\\. ")
 							  (not (looking-at "\\.  "))))))
 		       (setq first nil)
 ;			      (and (not (bobp))
 ;				   (not bounce)
 ;				   sentence-end-double-space
-;				   (save-excursion (forward-char -1)
+;				   (save-excursion (backward-char 1)
 ;						   (and (looking-at "\\. ")
 ;							(not (looking-at "\\.  "))))))
 ;		     (setq first nil)
 	    (and comment-end (not (equal comment-end ""))
   ;	       (if (not comment-multi-line)
 		     (progn
-		       (forward-char -1)
+		       (backward-char 1)
 		       (insert comment-end)
 		       (forward-char 1))
   ;		 (setq comment-column (+ comment-column (length comment-start))
 	    (if (not (eolp))
 		(setq comment-end ""))
 	    (insert ?\n)
-	    (forward-char -1)
+	    (backward-char 1)
 	    (indent-for-comment)
 	    (save-excursion
 	      ;; Make sure we delete the newline inserted above.
        ;; Verify an even number of quoting characters precede the close.
        (= 1 (logand 1 (- (point)
 			 (save-excursion
-			   (forward-char -1)
+			   (backward-char 1)
 			   (skip-syntax-backward "/\\")
 			   (point)))))
        (let* ((oldpos (point))

File lisp/startup.el

 In addition, the")
        "The"))
     (princ " following options are accepted:
+  -sd                   Show dump ID.  Ignored when configured without --pdump.
+  -nd                   Don't load the dump file.  Roughly like old temacs.
+                        Ignored when configured without --pdump.
   -t <device>           Use TTY <device> instead of the terminal for input
                         and output.  This implies the -nw option.
   -nw                   Inhibit the use of any window-system-specific
   -vanilla		Equivalent to -q -no-site-file -no-early-packages.
   -q                    Same as -no-init-file.
   -user-init-file <file> Use <file> as init file.
-  -user-init-directory <directory> use <directory> as init directory.
+  -user-init-directory <directory> Use <directory> as init directory.
   -user <user>          Load user's init file instead of your own.
                         Equivalent to -user-init-file ~<user>/.emacs
                                       -user-init-directory ~<user>/.xemacs/

File lisp/term/bg-mouse.el

       (indent-according-to-mode))
      ;; In Lisp assume double-quote is closing; in Text assume opening.
      ;; Why?  Because it does the right thing most often.
-     ((save-excursion (forward-char -1)
+     ((save-excursion (backward-char 1)
 		      (and (not (looking-at "\\s\""))
 			   (looking-at "[`'\"\\]\\|\\s(")))
       nil)

File lisp/view-less.el

     (while (= (following-char) ?\C-h)
       (delete-char 1))
     (while (search-forward "\C-h" nil t)
-      (forward-char -2)
+      (backward-char 2)
       (cond ((looking-at "_\C-h\\|\\(.\\)\C-h\\1\\||\C-h\\^")
 	     (delete-char 2))
 	    ((looking-at ".\C-h_\\|\\^\C-h|")

File lisp/wid-edit.el

 	  (t
 	   (when (and (null arg)
 		      (= last-non-space (point)))
-	     (forward-char -1))
+	     (backward-char 1))
 	   (transpose-chars arg)))))
 
 (defcustom widget-complete-field (lookup-key global-map "\M-\t")

File lisp/x-mouse.el

       nil
     (set-glyph-image text-pointer-glyph
 	  (or (x-get-resource "textPointer" "Cursor" 'string device nil 'warn)
-	      "xterm"))
+	      [cursor-font :data "xterm"]))
     (set-glyph-image selection-pointer-glyph
 	  (or (x-get-resource "selectionPointer" "Cursor" 'string device
 			      nil 'warn)
-	      "top_left_arrow"))
+	      [cursor-font :data "top_left_arrow"]))
     (set-glyph-image nontext-pointer-glyph
 	  (or (x-get-resource "spacePointer" "Cursor" 'string device nil 'warn)
-	      "xterm")) ; was "crosshair"
+	      [cursor-font :data "xterm"])) ; was "crosshair"
     (set-glyph-image modeline-pointer-glyph
 	  (or (x-get-resource "modeLinePointer" "Cursor" 'string device
 			      nil 'warn)
 ;;	      "fleur"))
-	      "sb_v_double_arrow"))
+	      [cursor-font :data "sb_v_double_arrow"]))
     (set-glyph-image gc-pointer-glyph
 	  (or (x-get-resource "gcPointer" "Cursor" 'string device nil 'warn)
-	      "watch"))
+	      [cursor-font :data "watch"]))
     (when (featurep 'scrollbar)
       (set-glyph-image
        scrollbar-pointer-glyph
        (or (x-get-resource "scrollbarPointer" "Cursor" 'string device
 			   nil 'warn)
-	   "top_left_arrow")))
+	   ;; bizarrely if we don't specify the specific locale (x) this
+	   ;; gets instantiated on the stream device. Bad puppy.
+	   [cursor-font :data "top_left_arrow"]) 'global '(default x)))
     (set-glyph-image busy-pointer-glyph
 	  (or (x-get-resource "busyPointer" "Cursor" 'string device nil 'warn)
-	      "watch"))
+	      [cursor-font :data "watch"]))
     (set-glyph-image toolbar-pointer-glyph
 	  (or (x-get-resource "toolBarPointer" "Cursor" 'string device
 			      nil 'warn)
-	      "left_ptr"))
+	      [cursor-font :data "left_ptr"]))
     (set-glyph-image divider-pointer-glyph
 	  (or (x-get-resource "dividerPointer" "Cursor" 'string device
 			      nil 'warn)
-	      "sb_h_double_arrow"))
+	      [cursor-font :data "sb_h_double_arrow"]))
     (let ((fg
 	   (x-get-resource "pointerColor" "Foreground" 'string device
 			   nil 'warn)))

File lwlib/ChangeLog

+2000-12-05  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.38 is released.
+
+2000-11-30  Andy Piper  <andy@xemacs.org>
+
+	* lwlib-Xm.c (xm_update_label): Hack to stop %_ labels until
+	someone fixes it properly.
+
+2000-11-24  Andy Piper  <andy@xemacs.org>
+
+	* xlwtabsP.h: add visible flag, realRows and remove displayChildren.
+
+	* xlwtabs.c (TabVisible): new macro. Consults visible flag.
+	(TabsInit): remove displayChildren, add realRows.
+	(TabsConstraintInitialize): ditto.
+	(TabsResize): ditto.
+	(TabsGeometryManager): ditto.
+	(TabsChangeManaged): ditto.
+	(TabsSelect): ditto.
+	(TabsPage): ditto.
+	(TabsHighlight): ditto.
+	(DrawTabs): ditto.
+	(TabLayout): Caclulate rows for all children and whether they
+	should be visible or not..
+	(TabsShuffleRows): shuffle rows based on both real and displayed
+	rows. Adjust visibility of all children.
+	(PreferredSize): ditto.
+
+2000-11-19  Martin Buchholz  <martin@xemacs.org>
+
+	* xlwtabs.c (TabsResize): Don't delete `tab', mark unused instead.
+
+2000-11-18  Martin Buchholz  <martin@xemacs.org>
+
+	* xlwmenu.c (make_windows_if_needed): 
+	(XlwMenuRealize): 
+	The proper type for `mask' is `unsigned long', not `int'.
+
+2000-11-18  Martin Buchholz  <martin@xemacs.org>
+
+	* xlwtabs.c (defaultAccelerators): Add #### to unused var.
+	(TabsResize): Remove unused var.
+	* xlwmenu.c (XlwMenuInitialize): Remove unused vars.
+	* lwlib-Xlw.c (xlw_update_one_widget): Add #### for probable bug.
+
 2000-11-14  Martin Buchholz <martin@xemacs.org>
 
 	* XEmacs 21.2.37 is released.

File lwlib/lwlib-Xlw.c

       else
 	mw = (XlwMenuWidget)widget;
       XtSetArg (al [0], XtNmenu, val);
-      XtSetValues (widget, al, 1);
+      XtSetValues (widget, al, 1); /* #### mw unused! */
     }
 #endif
 #ifdef LWLIB_SCROLLBARS_LUCID

File lwlib/lwlib-Xm.c

 
   if (val->value)
     {
+      /* #### Temporary fix. I though Motif was supposed to grok %_
+         type things. */
+      lw_remove_accelerator_spec (val->value);
+  
 #ifdef LWLIB_DIALOGS_MOTIF
       /*
        * Sigh.  The main text of a label is the name field for menubar

File lwlib/xlwmenu.c

   int start_at;
   XSetWindowAttributes xswa;
   Widget p;
-  int mask;
+  unsigned long mask;
   int depth;
   Visual *visual;
   window_state *windows;
 {
   /* Get the GCs and the widget size */
   XlwMenuWidget mw = (XlwMenuWidget)new;
-
-  XSetWindowAttributes xswa;
-  int mask;
-
   Window window = RootWindowOfScreen (DefaultScreenOfDisplay (XtDisplay (mw)));
   Display *display = XtDisplay (mw);
 
   make_shadow_gcs      (mw);
   extract_font_extents (mw);
 
-  xswa.background_pixel = mw->core.background_pixel;
-  xswa.border_pixel     = mw->core.border_pixel;
-  mask = CWBackPixel | CWBorderPixel;
-
   mw->menu.popped_up              = False;
   mw->menu.pointer_grabbed        = False;
   mw->menu.next_release_must_exit = False;
 {
   XlwMenuWidget mw = (XlwMenuWidget)w;
   XSetWindowAttributes xswa;
-  int mask;
+  unsigned long mask;
 
   (*xlwMenuWidgetClass->core_class.superclass->core_class.realize)
     (w, valueMask, attributes);

File lwlib/xlwtabs.c

  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */
 
- /* Synched up with: Tabs.c 1.27 */
+ /* Synched up with: Tabs.c 1.27.  
+
+ #### This file contains essential XEmacs related fixes to the original
+ verison of the Tabs widget. Be VERY careful about syncing if you ever
+ update to a more recent version. In general this is probably now a
+ bad idea. */
 
  /*
  * Tabs.c - Index Tabs composite widget
 	<Key>KP_Down:		highlight(down)	\n\
 	<Key> :			page(select)	\n\
 	 " ;
-static	XtAccelerators	defaultAccelerators ;
+static	XtAccelerators	defaultAccelerators ; /* #### Never used */
 
 #define	offset(field)	XtOffsetOf(TabsRec, tabs.field)
 static XtResource resources[] = {
 #define	assert(e)
 #endif
 
-
+#define TabsNumChildren(tw) (((TabsWidget)tw)->composite.num_children)
+#define TabVisible(tab) \
+	(XtIsManaged(tab) && \
+	 ((TabsConstraints)((tab)->core.constraints))->tabs.visible)
 
 
 /****************************************************************
     TabsWidget newTw = (TabsWidget)new;
 
     newTw->tabs.numRows = 0 ;
-    newTw->tabs.displayChildren = 0;
+    newTw->tabs.realRows = 0;
 
     GetPreferredSizes(newTw) ;
 
 {
 	TabsConstraints tab = (TabsConstraints) new->core.constraints ;
 	tab->tabs.greyAlloc = False ;	/* defer allocation of pixel */
+	tab->tabs.visible = False ;
 
 	getBitmapInfo((TabsWidget)XtParent(new), tab) ;
 	TabWidth(new) ;
 	int		i ;
 	int		num_children = tw->composite.num_children ;
 	Widget		*childP ;
-	TabsConstraints tab ;
+	TabsConstraints tab ; /* #### unused */
 	Dimension	cw,ch,bw ;
 
 	/* Our size has now been dictated by the parent.  Lay out the
 	{
 	  /* Loop through the tabs and assign rows & x positions */
 	  (void) TabLayout(tw, tw->core.width, tw->core.height, NULL, False) ;
-	  num_children = tw->tabs.displayChildren;
+	  num_children = TabsNumChildren (tw);
 
 	  /* assign a top widget, bring it to bottom row. */
 	  TabsShuffleRows(tw) ;
 	  for(i=0, childP=tw->composite.children;
 		i < num_children;
 		++i, ++childP)
-	    if( XtIsManaged(*childP) )
+	    if( TabVisible(*childP) )
 	    {
 	      tab = (TabsConstraints) (*childP)->core.constraints ;
 	      bw = (*childP)->core.border_width ;
 	      Widget	*childP = tw->composite.children ;
 	      int	i,bw ;
 	      w->core.border_width = req->border_width ;
-	      for(i=tw->tabs.displayChildren; --i >= 0; ++childP)
-		if( XtIsManaged(*childP) )
+	      for(i=TabsNumChildren (tw); --i >= 0; ++childP)
+		if( TabVisible(*childP) )
 		{
 		  bw = (*childP)->core.border_width ;
 		  XtConfigureWidget(*childP, s,tw->tabs.tab_total+s,
        */
       if( tw->tabs.topWidget != NULL && XtIsRealized(tw->tabs.topWidget) )
       {
-	for(i=tw->tabs.displayChildren; --i >= 0; ++childP)
+	for(i=TabsNumChildren (tw); --i >= 0; ++childP)
 	  if( !XtIsRealized(*childP) )
 	    XtRealizeWidget(*childP) ;
 
 	 * widget to be top of stacking order with XawTabsSetTop().
 	 */
 	for(i=0, childP=tw->composite.children;
-	      i < tw->tabs.displayChildren;
+	      i < TabsNumChildren (tw);
 	      ++i, ++childP)
-	  if( XtIsManaged(*childP) )
+	  if( TabVisible(*childP) )
 	  {
 	    TabsConstraints tab = (TabsConstraints)(*childP)->core.constraints;
 	    if( x > tab->tabs.x  &&  x < tab->tabs.x + tab->tabs.width  &&
 	Widget		newtop = NULL;
 	Widget		*childP ;
 	int		idx ;
-	int		nc = tw->tabs.displayChildren ;
+	int		nc = TabsNumChildren (tw) ;
 
 	if( nc <= 0 )
 	  return ;
 	Widget		newhl = NULL;
 	Widget		*childP ;
 	int		idx ;
-	int		nc = tw->tabs.displayChildren ;
+	int		nc = TabsNumChildren (tw) ;
 
 	if( nc <= 0 )
 	  return ;
 	y = tw->tabs.numRows == 1 ? TABDELTA : 0 ;
 	for(i=0; i<tw->tabs.numRows; ++i, y += th)
 	{
- 	  for( j=tw->tabs.displayChildren, childP=tw->composite.children;
+ 	  for( j=TabsNumChildren (tw), childP=tw->composite.children;
   	      --j >= 0; ++childP )
-	    if( XtIsManaged(*childP) )
+	    if( TabVisible(*childP) )
 	    {
 	      tab = (TabsConstraints)(*childP)->core.constraints;
 	      if( tab->tabs.row == i && *childP != tw->tabs.topWidget )