From: kazuhiko Date: Wed, 6 Dec 2000 03:15:54 +0000 (+0000) Subject: Sync with r21-2-38 X-Git-Tag: r21-2-38-utf-2000-0_17-1~960 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b10ee70be2e0ce31599b05e9d58f83fc92141de0;p=chise%2Fxemacs-chise.git- Sync with r21-2-38 --- diff --git a/CHANGES-beta b/CHANGES-beta index d00ae9a..3665438 100644 --- a/CHANGES-beta +++ b/CHANGES-beta @@ -1,3 +1,25 @@ +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 @@ -19,7 +41,7 @@ to 21.2.37 "Pan" -- 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 diff --git a/ChangeLog b/ChangeLog index 9df5083..22d7bb4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,18 @@ * configure.in: Add new option `--with-utf-2000'; define `UTF2000' if it is specified. +2000-12-05 Martin Buchholz + + * XEmacs 21.2.38 is released. + +2000-11-26 Bj-Aƶrn Torkelsson $)B + + * configure.in: Only show message about DnD API if compiling with DnD + +2000-11-09 Martin Buchholz + + * configure.in: Autodetect elf.h. + 2000-11-14 Martin Buchholz * XEmacs 21.2.37 is released. diff --git a/configure b/configure index 7f6679f..717befc 100755 --- a/configure +++ b/configure @@ -3426,7 +3426,7 @@ done 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 @@ -7035,9 +7035,9 @@ EOF 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:7040: 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:7041: 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 diff --git a/configure.in b/configure.in index 58b3db1..405cf6c 100644 --- a/configure.in +++ b/configure.in @@ -2339,6 +2339,7 @@ AC_PROG_YACC 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 @@ -2959,8 +2960,8 @@ fi 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} )]) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index cc9cbcd..c05cfc7 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -11,6 +11,14 @@ * update-elc.sh (ignore_dirs): Ignore lisp/utf-2000 subdirectory. +2000-12-05 Martin Buchholz + + * XEmacs 21.2.38 is released. + +2000-11-13 Yoshiki Hayashi + + * Makefile.in.in: Define emacs iff it's necessary. + 2000-11-14 Martin Buchholz * XEmacs 21.2.37 is released. diff --git a/lib-src/Makefile.in.in b/lib-src/Makefile.in.in index 2a64d1d..33dd10c 100644 --- a/lib-src/Makefile.in.in +++ b/lib-src/Makefile.in.in @@ -160,7 +160,7 @@ ld_libs_general=@ld_libs_general@ ## 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) @@ -281,7 +281,7 @@ alloca.o: ${top_srcdir}/src/alloca.c ${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 \ @@ -319,7 +319,7 @@ make-docfile: ${srcdir}/make-docfile.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 $@ @@ -378,7 +378,7 @@ mmencode : ${srcdir}/mmencode.c ## 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. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9b8a4f0..738aed3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -470,6 +470,194 @@ * files.el (insert-file-contents-literally): Treat file as binary; call file-name-handlers. [sync with Emacs 20.3.10] +2000-12-05 Martin Buchholz + + * XEmacs 21.2.38 is released. + +2000-12-04 Didier Verna + + * mouse.el (default-mouse-track-set-point-in-window): remove + spurious '+' operation detected by Martin. + + +2000-12-01 Martin Buchholz + + * 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 + + * 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 + + * paragraphs.el (paragraph-separate, forward-sentence): Clarify + docstrings. + +2000-11-08 Stephen J. Turnbull + + * startup.el (command-line-do-help): Add documentation of + portable dumper switches. + +2000-11-22 Andy Piper + + * 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 + + * 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 + + * 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 + + * gutter-items.el (update-tab-in-gutter): don't barf if there are + no buffers. + +2000-11-20 Andy Piper + + * gutter-items.el (update-tab-in-gutter): don't give popup frames + buffer tabs. + +2000-11-18 Martin Buchholz + + * cl-macs.el: Correctly optimize plusp minusp oddp evenp. + (proclaim inline...) was shadowing compiler-macros. + +2000-11-17 Martin Buchholz + + * 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 + + * 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 + + * info.el (Info-extract-menu-node-name): Comma is a delimiter. + 2000-11-14 Martin Buchholz * XEmacs 21.2.37 is released. @@ -487,9 +675,9 @@ * 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 diff --git a/lisp/abbrev.el b/lisp/abbrev.el index eaf3c8b..75ce53b 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -88,15 +88,9 @@ of the form (ABBREVNAME EXPANSION HOOK USECOUNT)." "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)))) @@ -426,7 +420,7 @@ ARG is the argument to `add-global-abbrev' or `add-mode-abbrev'." (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. @@ -484,7 +478,7 @@ the user declines to confirm redefining an existing abbrev." 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) @@ -511,7 +505,7 @@ Expands the abbreviation after defining it." (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) @@ -554,7 +548,7 @@ If called from a Lisp program, arguments are START END &optional NOQUERY." (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))))))) diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index 5e62c34..482dcc7 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el @@ -303,7 +303,7 @@ and then move up one line. Prefix arg means move that many lines." (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) @@ -312,7 +312,7 @@ and then move up one line. Prefix arg means move that many lines." (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 `>'. diff --git a/lisp/byte-optimize.el b/lisp/byte-optimize.el index 6f9f8f4..b6c1daa 100644 --- a/lisp/byte-optimize.el +++ b/lisp/byte-optimize.el @@ -2,8 +2,9 @@ ;;; Copyright (c) 1991, 1994 Free Software Foundation, Inc. -;; Author: Jamie Zawinski -;; Hallvard Furuseth +;; Authors: Jamie Zawinski +;; Hallvard Furuseth +;; Martin Buchholz ;; Keywords: internal ;; This file is part of XEmacs. @@ -566,8 +567,7 @@ (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))) @@ -699,124 +699,62 @@ (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)))) + (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. + (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 last constant. + ;; Put constants at the end, except the first arg. (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)))) + ;; 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)) - (t (byte-optimize-predicate form)))) + ;; (- 0 x ...) --> (- (- x) ...) + ((and (eq 0 (nth 1 form)) (>= (length form) 3)) + `(- (- ,(nth 2 form)) ,@(nthcdr 3 form))) -(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))))))) + (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))) @@ -848,9 +786,11 @@ (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) @@ -905,6 +845,7 @@ (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) @@ -1074,18 +1015,72 @@ (put 'if 'byte-optimizer 'byte-optimize-if) (put 'while 'byte-optimizer 'byte-optimize-while) -;; Remove any reason for avoiding `char-before'. -(defun byte-optimize-char-before (form) - `(char-after (1- ,(or (nth 1 form) '(point))) ,@(cdr (cdr form)))) +;; 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. -(put 'char-before 'byte-optimizer 'byte-optimize-char-before) +;; 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 + ,(cond + ((null (nth 1 form)) + '(1- (point))) + ((equal '(point) (nth 1 form)) + '(1- (point))) + (t `(1- (or ,(nth 1 form) (point))))) + ,@(cdr (cdr form)))) + +;; (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 ...) @@ -1255,7 +1250,7 @@ (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)) diff --git a/lisp/bytecomp.el b/lisp/bytecomp.el index eb55143..03bcb44 100644 --- a/lisp/bytecomp.el +++ b/lisp/bytecomp.el @@ -443,13 +443,32 @@ on the specbind stack. The cdr of each cell is an integer bitmask.") (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 @@ -2771,8 +2790,8 @@ If FORM is a lambda or a macro, byte-compile it as a function." (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, @@ -2962,11 +2981,6 @@ If FORM is a lambda or a macro, byte-compile it as a function." (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) @@ -3045,40 +3059,52 @@ If FORM is a lambda or a macro, byte-compile it as a function." (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) @@ -3110,33 +3136,31 @@ If FORM is a lambda or a macro, byte-compile it as a function." (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 @@ -3146,8 +3170,12 @@ If FORM is a lambda or a macro, byte-compile it as a function." (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) @@ -3222,6 +3250,23 @@ If FORM is a lambda or a macro, byte-compile it as a function." (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) @@ -3230,8 +3275,33 @@ If FORM is a lambda or a macro, byte-compile it as a function." (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))) @@ -3242,8 +3312,16 @@ If FORM is a lambda or a macro, byte-compile it as a function." (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))) diff --git a/lisp/cl-extra.el b/lisp/cl-extra.el index 97ca310..2acba6a 100644 --- a/lisp/cl-extra.el +++ b/lisp/cl-extra.el @@ -76,8 +76,8 @@ TYPE is a Common Lisp type specifier." ((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)))) diff --git a/lisp/cl-macs.el b/lisp/cl-macs.el index 6eddb94..5a9ab08 100644 --- a/lisp/cl-macs.el +++ b/lisp/cl-macs.el @@ -1434,13 +1434,15 @@ values. For compatibility, (values A B C) is a synonym for (list A B C)." ((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) @@ -2440,18 +2442,26 @@ TYPE is a Common Lisp-style type specifier." (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) @@ -2750,6 +2760,8 @@ surrounded by (block NAME ...)." (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) @@ -2764,7 +2776,6 @@ surrounded by (block NAME ...)." (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 diff --git a/lisp/cl.el b/lisp/cl.el index 03cfdf1..33c554c 100644 --- a/lisp/cl.el +++ b/lisp/cl.el @@ -337,34 +337,29 @@ The name is made by appending a number to PREFIX, default \"G\"." ;;; 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 plusp (x) +(defun floatp-safe (object) + "Return t if OBJECT is a floating point number." + (floatp object)) + +(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))) diff --git a/lisp/faces.el b/lisp/faces.el index 953025b..d14b45b 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1636,7 +1636,7 @@ expected in this case, other types of image data will not work. 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))) @@ -1661,8 +1661,7 @@ in that frame; otherwise change each frame." (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))) diff --git a/lisp/font-menu.el b/lisp/font-menu.el index d1cb509..80b78dc 100644 --- a/lisp/font-menu.el +++ b/lisp/font-menu.el @@ -405,7 +405,7 @@ or if you change your font path, you can call this to re-initialize the menus." (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)) diff --git a/lisp/glyphs.el b/lisp/glyphs.el index 4e31321..c150670 100644 --- a/lisp/glyphs.el +++ b/lisp/glyphs.el @@ -1023,7 +1023,8 @@ If unspecified in a particular domain, `nontext-pointer-glyph' is used.") [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 ;; diff --git a/lisp/gutter-items.el b/lisp/gutter-items.el index d5676d3..fab1de4 100644 --- a/lisp/gutter-items.el +++ b/lisp/gutter-items.el @@ -325,30 +325,33 @@ redefining the function `format-buffers-menu-line'." (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 diff --git a/lisp/indent.el b/lisp/indent.el index 5c642cf..8208126 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -470,7 +470,7 @@ Use \\[edit-tab-stops] to edit them interactively." (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) diff --git a/lisp/info.el b/lisp/info.el index bc8f765..3186cdb 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -2008,7 +2008,7 @@ NAME may be an abbreviation of the reference name." ;; Kludge. ;; Allow dots in node name not followed by whitespace. (re-search-forward - (concat "\\(([^)]+)[^." + (concat "\\(([^)]+)[^.," (if multi-line "" "\n") "]*\\|\\([^.,\t" (if multi-line "" "\n") @@ -3103,7 +3103,7 @@ The locations are of the format used in Info-history, i.e. (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) diff --git a/lisp/itimer.el b/lisp/itimer.el index 5199917..705df24 100644 --- a/lisp/itimer.el +++ b/lisp/itimer.el @@ -167,7 +167,7 @@ This is a macro." (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))) diff --git a/lisp/lisp-mode.el b/lisp/lisp-mode.el index d0278b1..8fcec45 100644 --- a/lisp/lisp-mode.el +++ b/lisp/lisp-mode.el @@ -545,7 +545,7 @@ rigidly along with this one." (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) diff --git a/lisp/lisp.el b/lisp/lisp.el index 4226730..c0db1a2 100644 --- a/lisp/lisp.el +++ b/lisp/lisp.el @@ -206,7 +206,7 @@ the open-parenthesis that starts a defun; see `beginning-of-defun'." (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) @@ -279,7 +279,7 @@ before and after, depending on the surrounding characters." "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) diff --git a/lisp/menubar.el b/lisp/menubar.el index a971530..44c5b6a 100644 --- a/lisp/menubar.el +++ b/lisp/menubar.el @@ -361,8 +361,7 @@ the menu hierarchy. (\"File\" \"Save\") means the menu item called \"Save\" 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)) diff --git a/lisp/mouse.el b/lisp/mouse.el index 67bea91..0c76138 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -748,7 +748,7 @@ at the initial click position." (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 diff --git a/lisp/page.el b/lisp/page.el index 196a30a..77502b9 100644 --- a/lisp/page.el +++ b/lisp/page.el @@ -53,7 +53,7 @@ A page boundary is any line whose beginning matches the regexp (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)) diff --git a/lisp/paragraphs.el b/lisp/paragraphs.el index 0d209a9..f26eb42 100644 --- a/lisp/paragraphs.el +++ b/lisp/paragraphs.el @@ -188,7 +188,7 @@ to which the end of the previous line belongs, or the end of the buffer." 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))) @@ -335,7 +335,7 @@ negative arg -N means kill forward to Nth end of paragraph." (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) diff --git a/lisp/picture.el b/lisp/picture.el index a2b3a21..c618b7a 100644 --- a/lisp/picture.el +++ b/lisp/picture.el @@ -90,7 +90,7 @@ With argument, move that many columns." ;; 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. @@ -207,7 +207,7 @@ Do \\[command-apropos] `picture-movement' to see those commands." (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))) diff --git a/lisp/rect.el b/lisp/rect.el index 75ba30c..6f42ee4 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -201,7 +201,7 @@ deleted." (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) diff --git a/lisp/simple.el b/lisp/simple.el index eb9ebee..51cc77d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -305,7 +305,7 @@ Leave one space or none, according to the context." (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 ?\ )))) @@ -422,11 +422,11 @@ and KILLP is t if a prefix arg was specified." (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, @@ -440,11 +440,11 @@ If nil, the DEL key will erase one character backwards." :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) @@ -2346,7 +2346,7 @@ With prefix arg ARG, effect is to take character before point 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 ... @@ -2356,7 +2356,7 @@ With prefix arg ARG, effect is to take character before point 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))) @@ -2731,31 +2731,32 @@ not end the comment. Blank lines do not get comments." (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)) + (mark-something 'mark-word 'forward-word count)) -;; XEmacs modified -(defun kill-word (arg) +(defun kill-word (&optional count) "Kill characters forward until encountering the end of a word. -With argument, do this that many times." +With optional argument COUNT, do this that many times." (interactive "*p") - (kill-region (point) (save-excursion (forward-word arg) (point)))) + (kill-region (point) (save-excursion (forward-word count) (point)))) -(defun backward-kill-word (arg) +(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") ; XEmacs - (kill-word (- arg))) + (interactive "*p") + (kill-word (- (or count 1)))) (defun current-word (&optional strict) "Return the word point is on (or a nearby word) as a string. @@ -2852,7 +2853,7 @@ indicating whether soft newlines should be inserted.") (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) @@ -2977,7 +2978,7 @@ indicating whether soft newlines should be inserted.") ; (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) @@ -3143,7 +3144,7 @@ unless optional argument SOFT is non-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)) @@ -3153,7 +3154,7 @@ unless optional argument SOFT is non-nil." (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. @@ -3318,7 +3319,7 @@ when it is off screen." ;; 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)) diff --git a/lisp/startup.el b/lisp/startup.el index a63465f..2fcc7ae 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -227,6 +227,9 @@ command line options plus the following: 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 Use TTY instead of the terminal for input and output. This implies the -nw option. -nw Inhibit the use of any window-system-specific @@ -242,7 +245,7 @@ In addition, the") -vanilla Equivalent to -q -no-site-file -no-early-packages. -q Same as -no-init-file. -user-init-file Use as init file. - -user-init-directory use as init directory. + -user-init-directory Use as init directory. -user Load user's init file instead of your own. Equivalent to -user-init-file ~/.emacs -user-init-directory ~/.xemacs/ diff --git a/lisp/term/bg-mouse.el b/lisp/term/bg-mouse.el index e75f35e..cc4291a 100644 --- a/lisp/term/bg-mouse.el +++ b/lisp/term/bg-mouse.el @@ -201,7 +201,7 @@ Sexp is inserted into the buffer at point (where the text cursor is)." (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) diff --git a/lisp/view-less.el b/lisp/view-less.el index bc41a17..7dd3e30 100644 --- a/lisp/view-less.el +++ b/lisp/view-less.el @@ -289,7 +289,7 @@ turned into (+)." (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|") diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 3f22c46..dfcdbe4 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -1350,7 +1350,7 @@ With optional ARG, move across that many fields." (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") diff --git a/lisp/x-mouse.el b/lisp/x-mouse.el index 3db5e6c..ca38faa 100644 --- a/lisp/x-mouse.el +++ b/lisp/x-mouse.el @@ -101,39 +101,41 @@ to the cut buffer." 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))) diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog index 776a3b8..07d6f5d 100644 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog @@ -1,3 +1,49 @@ +2000-12-05 Martin Buchholz + + * XEmacs 21.2.38 is released. + +2000-11-30 Andy Piper + + * lwlib-Xm.c (xm_update_label): Hack to stop %_ labels until + someone fixes it properly. + +2000-11-24 Andy Piper + + * 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 + + * xlwtabs.c (TabsResize): Don't delete `tab', mark unused instead. + +2000-11-18 Martin Buchholz + + * xlwmenu.c (make_windows_if_needed): + (XlwMenuRealize): + The proper type for `mask' is `unsigned long', not `int'. + +2000-11-18 Martin Buchholz + + * 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 * XEmacs 21.2.37 is released. diff --git a/lwlib/lwlib-Xlw.c b/lwlib/lwlib-Xlw.c index 71b4959..bfb2dfa 100644 --- a/lwlib/lwlib-Xlw.c +++ b/lwlib/lwlib-Xlw.c @@ -549,7 +549,7 @@ xlw_update_one_widget (widget_instance* instance, Widget widget, else mw = (XlwMenuWidget)widget; XtSetArg (al [0], XtNmenu, val); - XtSetValues (widget, al, 1); + XtSetValues (widget, al, 1); /* #### mw unused! */ } #endif #ifdef LWLIB_SCROLLBARS_LUCID diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c index c3580e7..28dc5f8 100644 --- a/lwlib/lwlib-Xm.c +++ b/lwlib/lwlib-Xm.c @@ -219,6 +219,10 @@ xm_update_label (widget_instance* instance, Widget widget, widget_value* val) 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 diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c index 5fadadf..1d89c0b 100644 --- a/lwlib/xlwmenu.c +++ b/lwlib/xlwmenu.c @@ -2325,7 +2325,7 @@ make_windows_if_needed (XlwMenuWidget mw, int n) int start_at; XSetWindowAttributes xswa; Widget p; - int mask; + unsigned long mask; int depth; Visual *visual; window_state *windows; @@ -3004,10 +3004,6 @@ XlwMenuInitialize (Widget request, Widget new, ArgList args, { /* 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); @@ -3044,10 +3040,6 @@ XlwMenuInitialize (Widget request, Widget new, ArgList args, 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; @@ -3085,7 +3077,7 @@ XlwMenuRealize (Widget w, Mask *valueMask, XSetWindowAttributes *attributes) { XlwMenuWidget mw = (XlwMenuWidget)w; XSetWindowAttributes xswa; - int mask; + unsigned long mask; (*xlwMenuWidgetClass->core_class.superclass->core_class.realize) (w, valueMask, attributes); diff --git a/lwlib/xlwtabs.c b/lwlib/xlwtabs.c index aa96450..65af1ee 100644 --- a/lwlib/xlwtabs.c +++ b/lwlib/xlwtabs.c @@ -18,7 +18,12 @@ 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 @@ -122,7 +127,7 @@ static char accelTable[] = " #augment\n\ KP_Down: highlight(down) \n\ : page(select) \n\ " ; -static XtAccelerators defaultAccelerators ; +static XtAccelerators defaultAccelerators ; /* #### Never used */ #define offset(field) XtOffsetOf(TabsRec, tabs.field) static XtResource resources[] = { @@ -401,7 +406,10 @@ WidgetClass tabsWidgetClass = (WidgetClass)&tabsClassRec; #define assert(e) #endif - +#define TabsNumChildren(tw) (((TabsWidget)tw)->composite.num_children) +#define TabVisible(tab) \ + (XtIsManaged(tab) && \ + ((TabsConstraints)((tab)->core.constraints))->tabs.visible) /**************************************************************** @@ -430,7 +438,7 @@ TabsInit(Widget request, Widget new, ArgList args, Cardinal *num_args) TabsWidget newTw = (TabsWidget)new; newTw->tabs.numRows = 0 ; - newTw->tabs.displayChildren = 0; + newTw->tabs.realRows = 0; GetPreferredSizes(newTw) ; @@ -486,6 +494,7 @@ TabsConstraintInitialize(Widget request, Widget new, { 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) ; @@ -530,7 +539,7 @@ TabsResize(Widget w) 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 @@ -550,7 +559,7 @@ TabsResize(Widget w) { /* 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) ; @@ -567,7 +576,7 @@ TabsResize(Widget w) 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 ; @@ -932,8 +941,8 @@ TabsGeometryManager(Widget w, XtWidgetGeometry *req, XtWidgetGeometry *reply) 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, @@ -1001,7 +1010,7 @@ TabsChangeManaged(Widget w) */ 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) ; @@ -1066,9 +1075,9 @@ TabsSelect(Widget w, XEvent *event, String *params, Cardinal *num_params) * 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 && @@ -1092,7 +1101,7 @@ TabsPage(Widget w, XEvent *event, String *params, Cardinal *num_params) Widget newtop = NULL; Widget *childP ; int idx ; - int nc = tw->tabs.displayChildren ; + int nc = TabsNumChildren (tw) ; if( nc <= 0 ) return ; @@ -1156,7 +1165,7 @@ TabsHighlight(Widget w, XEvent *event, String *params, Cardinal *num_params) Widget newhl = NULL; Widget *childP ; int idx ; - int nc = tw->tabs.displayChildren ; + int nc = TabsNumChildren (tw) ; if( nc <= 0 ) return ; @@ -1394,9 +1403,9 @@ DrawTabs(TabsWidget tw, Bool labels) y = tw->tabs.numRows == 1 ? TABDELTA : 0 ; for(i=0; itabs.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 ) @@ -1705,16 +1714,13 @@ TabWidth(Widget w) static int TabLayout(TabsWidget tw, int wid, int hgt, Dimension *reply_height, Bool query_only) { - int i, row ; + int i, row, done = 0, display_rows = 0 ; int num_children = tw->composite.num_children ; Widget *childP ; Dimension w ; Position x,y ; TabsConstraints tab ; - if (!query_only) - tw->tabs.displayChildren = 0; - /* Algorithm: loop through children, assign X positions. If a tab * would extend beyond the right edge, start a new row. After all * rows are assigned, make a second pass and assign Y positions. @@ -1733,10 +1739,14 @@ TabLayout(TabsWidget tw, int wid, int hgt, Dimension *reply_height, Bool query_o { tab = (TabsConstraints) (*childP)->core.constraints ; w = tab->tabs.width ; + if( x + w > wid ) { /* new row */ - if (y + tw->tabs.tab_height > hgt) - break; - ++row ; + if (y + tw->tabs.tab_height > hgt && !done) + { + display_rows = row; + done = 1; + } + ++row; x = INDENT ; y += tw->tabs.tab_height ; } @@ -1746,12 +1756,14 @@ TabLayout(TabsWidget tw, int wid, int hgt, Dimension *reply_height, Bool query_o tab->tabs.row = row ; } x += w + SPACING ; - if (!query_only) - tw->tabs.displayChildren++; + if (!query_only && !done) + tab->tabs.visible = 1; + } /* If there was only one row, increase the height by TABDELTA */ - if( ++row == 1 ) + if( ++display_rows == 1 ) { + row++; y = TABDELTA ; if( !query_only ) for(i=num_children, childP=tw->composite.children; @@ -1765,17 +1777,18 @@ TabLayout(TabsWidget tw, int wid, int hgt, Dimension *reply_height, Bool query_o y += tw->tabs.tab_height ; } else - row = y = 0 ; + display_rows = row = y = 0 ; if( !query_only ) { tw->tabs.tab_total = y ; - tw->tabs.numRows = row ; + tw->tabs.numRows = display_rows ; + tw->tabs.realRows = row; } if( reply_height != NULL ) *reply_height = y ; - return row ; + return display_rows ; } @@ -1826,7 +1839,7 @@ TabsShuffleRows(TabsWidget tw) { TabsConstraints tab ; int move ; - int nrows ; + int real_rows, display_rows ; Widget *childP ; Dimension th = tw->tabs.tab_height ; Position bottom ; @@ -1834,7 +1847,7 @@ TabsShuffleRows(TabsWidget tw) /* There must be a top widget. If not, assign one. */ if( tw->tabs.topWidget == NULL && tw->composite.children != NULL ) - for(i=tw->composite.num_children, childP=tw->composite.children; + for(i=TabsNumChildren (tw), childP=tw->composite.children; --i >= 0; ++childP) if( XtIsManaged(*childP) ) { @@ -1844,26 +1857,31 @@ TabsShuffleRows(TabsWidget tw) if( tw->tabs.topWidget != NULL ) { - nrows = tw->tabs.numRows ; - assert( nrows > 0 ) ; + display_rows = tw->tabs.numRows ; + real_rows = tw->tabs.realRows ; + assert( display_rows >= real_rows ) ; - if( nrows > 1 ) + if( real_rows > 1 ) { tab = (TabsConstraints) tw->tabs.topWidget->core.constraints ; assert( tab != NULL ) ; - /* how far to move top row */ - move = nrows - tab->tabs.row ; + /* How far to move top row. The selected tab must be on + the bottom row of the *visible* rows. */ + move = (real_rows + 1 - display_rows) - tab->tabs.row ; + if (move < 0) + move = real_rows - move; bottom = tw->tabs.tab_total - th ; - for(i=tw->tabs.displayChildren, childP=tw->composite.children; + for(i=tw->composite.num_children, childP=tw->composite.children; --i >= 0; ++childP) if( XtIsManaged(*childP) ) { tab = (TabsConstraints) (*childP)->core.constraints ; - tab->tabs.row = (tab->tabs.row + move) % nrows ; + tab->tabs.row = (tab->tabs.row + move) % real_rows ; tab->tabs.y = bottom - tab->tabs.row * th ; + tab->tabs.visible = (tab->tabs.row < display_rows); } } } @@ -1877,7 +1895,6 @@ TabsShuffleRows(TabsWidget tw) * * This function requires that max_cw, max_ch already be set. */ - static int PreferredSize( TabsWidget tw, diff --git a/lwlib/xlwtabsP.h b/lwlib/xlwtabsP.h index ca1b1e5..d28fd53 100644 --- a/lwlib/xlwtabsP.h +++ b/lwlib/xlwtabsP.h @@ -93,7 +93,7 @@ typedef struct { Dimension child_width, child_height; /* child size, including borders */ Dimension max_cw, max_ch ; /* max child preferred size */ Cardinal numRows ; - Cardinal displayChildren ; + Cardinal realRows; /* XEmacs addition */ XtGeometryMask last_query_mode; Boolean needs_layout ; Pixmap grey50 ; /* TODO: cache this elsewhere */ @@ -129,6 +129,7 @@ typedef struct _TabsConstraintsPart { /* private state */ Pixel grey ; Boolean greyAlloc ; + Boolean visible; /* XEmacs change */ Dimension width ; /* tab width */ Position x,y ; /* tab base position */ short row ; /* tab row */ diff --git a/man/ChangeLog b/man/ChangeLog index 0ba2252..5bd2293 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,87 @@ +2000-12-05 Martin Buchholz + + * XEmacs 21.2.38 is released. + +2000-12-01 Martin Buchholz + + * lispref/compile.texi: + Document differences between compiler and interpreter. + +2000-11-29 Stephen J. Turnbull + + * internals/index.texi: + internals/internals.texi: + Change "X Windows" to "the X Window System" randomly. + * internals/internals.texi (Glyphs): fiddling, move lwlib to new node. + (Lucid Widget Library): new node, added new text, ASCII art, subnode + structure. + * xemacs/frame.texi (GUI Components): new node. + * xemacs/packages.texi: minor updates. + +2000-11-10 Stephen J. Turnbull + + * info.texi (Creating an Info File): Fix typos in xrefs. + +2000-11-08 Stephen J. Turnbull + + * xemacs/cmdargs.texi (Command Switches): Add documentation of + portable dumper switches. Other minor edits. + +2000-11-21 Martin Buchholz + + * lispref/positions.texi (Word Motion): + forward-word arg is now optional. + backward-word arg is now optional. + Remove vile comment advising lisp programmer to use (forward-word -1) + instead of (backward-word 1). + * lispref/syntax.texi (Parsing Expressions): + Similarly for forward-comment. + * lispref/text.texi (Deletion): + Similarly for delete-char. + Similarly for delete-backward-char. + +2000-11-09 Martin Buchholz + + * cl.texi (Assertions): + Remove claim that elisp doesn't have continuable errors. + Document check-type as being continuable. + +2000-11-14 Adrian Aichner + + * xemacs/calendar.texi (Calendar/Diary): Correct INFO-FILE-NAME + from elisp to lispref and from emacs to xemacs in relevant ?xefs. + This should also serve as a reminder for future merges with GNU + Emacs. + Unify PRINTED-MANUAL-TITLE to "XEmacs Lisp Reference Manual" and + "XEmacs User's Manual" for lispref and xemacs respectively. + +2000-11-14 Adrian Aichner + + * lispref/abbrevs.texi (Abbrevs): Ditto. + * lispref/backups.texi (Auto-Saving): Ditto. + * lispref/backups.texi (Reverting): Ditto. + * lispref/display.texi (The Echo Area): Ditto. + * lispref/help.texi (Documentation Basics): Ditto. + * lispref/help.texi (Help Functions): Ditto. + * lispref/keymaps.texi (Scanning Keymaps): Ditto. + * lispref/locals.texi (Standard Buffer-Local Variables): Ditto. + * lispref/modes.texi (Auto Major Mode): Ditto. + * lispref/positions.texi (List Motion): Ditto. + * lispref/searching.texi (Regexp Search): Ditto. + * lispref/symbols.texi (Symbol Components): Ditto. + * lispref/tips.texi (Comment Tips): Ditto. + * lispref/tips.texi (Library Headers): Ditto. + +2000-11-14 Adrian Aichner + + * internals/internals.texi (The Buffer Object): Ditto. + +2000-11-14 Adrian Aichner + + * cl.texi (Hash Tables): Ditto. + * texinfo.texi (Other Info Files): Ditto. + * xemacs-faq.texi (Q1.0.14): Ditto. + 2000-11-14 Martin Buchholz * XEmacs 21.2.37 is released. diff --git a/man/cl.texi b/man/cl.texi index 27d6d72..7e8125a 100644 --- a/man/cl.texi +++ b/man/cl.texi @@ -1073,7 +1073,7 @@ exactly equivalent to @code{(setq x y)}, and @code{setq} itself is strictly speaking redundant now that @code{setf} exists. Many programmers continue to prefer @code{setq} for setting simple variables, though, purely for stylistic or historical reasons. -The macro @code{(setf x y)} actually expands to @code{(setq x y)}, +The form @code{(setf x y)} actually expands to @code{(setq x y)}, so there is no performance penalty for using it in compiled code. @item @@ -4581,7 +4581,7 @@ This is equivalent to @code{(nconc (mapcar* 'cons @var{keys} @var{values}) @noindent Hash tables are now implemented directly in the C code and documented in -@ref{Hash Tables,,, lispref, XEmacs Lisp Programmer's Manual}. +@ref{Hash Tables,,, lispref, XEmacs Lisp Reference Manual}. @ignore A @dfn{hash table} is a data structure that maps ``keys'' onto @@ -5099,20 +5099,19 @@ will also include all non-constant arguments of the top-level (assert (> x 10) t "x is too small: %d") @end example -This usage of @var{show-args} is an extension to Common Lisp. In +This usage of @var{show-args} is a change to Common Lisp. In true Common Lisp, the second argument gives a list of @var{places} which can be @code{setf}'d by the user before continuing from the -error. Since Emacs Lisp does not support continuable errors, it -makes no sense to specify @var{places}. +error. @end defspec -@defspec check-type form type [string] -This form verifies that @var{form} evaluates to a value of type +@defspec check-type place type &optional string +This form verifies that @var{place} evaluates to a value of type @var{type}. If so, it returns @code{nil}. If not, @code{check-type} -signals a @code{wrong-type-argument} error. The default error message -lists the erroneous value along with @var{type} and @var{form} -themselves. If @var{string} is specified, it is included in the -error message in place of @var{type}. For example: +signals a continuable @code{wrong-type-argument} error. The default +error message lists the erroneous value along with @var{type} and +@var{place} themselves. If @var{string} is specified, it is included in +the error message in place of @var{type}. For example: @example (check-type x (integer 1 *) "a positive integer") @@ -5121,10 +5120,10 @@ error message in place of @var{type}. For example: @xref{Type Predicates}, for a description of the type specifiers that may be used for @var{type}. -Note that in Common Lisp, the first argument to @code{check-type} -must be a @var{place} suitable for use by @code{setf}, because -@code{check-type} signals a continuable error that allows the -user to modify @var{place}. +Note that as in Common Lisp, the first argument to @code{check-type} +should be a @var{place} suitable for use by @code{setf}, because +@code{check-type} signals a continuable error that allows the user to +modify @var{place}, most simply by returning a value from the debugger. @end defspec The following error-related macro is also defined: diff --git a/man/info.texi b/man/info.texi index 6a12f76..8df0772 100644 --- a/man/info.texi +++ b/man/info.texi @@ -3,7 +3,7 @@ @setfilename ../info/info.info @settitle Info @comment %**end of header -@comment $Id: info.texi,v 1.4.2.5 2000/09/13 10:57:18 martinb Exp $ +@comment $Id: info.texi,v 1.4.2.6 2000/11/29 08:27:28 stephent Exp $ @dircategory Texinfo documentation system @direntry @@ -886,10 +886,10 @@ function @code{Info-directory} is called. @xref{Top,, Overview of Texinfo, texinfo, Texinfo}, to learn how to write a Texinfo file. -@xref{Creating an Info File,,, texinfo, Texinfo}, to learn how to create -an Info file from a Texinfo file. +@xref{Create an Info File, , Creating an Info File, texinfo, Texinfo}, +to learn how to create an Info file from a Texinfo file. -@xref{Installing an Info File,,, texinfo, Texinfo}, to learn how to -install an Info file after you have created one. +@xref{Install an Info File, , Installing an Info File, texinfo, Texinfo}, +to learn how to install an Info file after you have created one. @bye diff --git a/man/internals/index.texi b/man/internals/index.texi index 4a27571..6423f10 100644 --- a/man/internals/index.texi +++ b/man/internals/index.texi @@ -19,7 +19,7 @@ @c pindex is used for .el files and Unix programs -@node Index, , Interface to X Windows, Top +@node Index, , Interface to the X Window System, Top @unnumbered Index @ignore diff --git a/man/internals/internals.texi b/man/internals/internals.texi index d7e67c5..a59e3c1 100644 --- a/man/internals/internals.texi +++ b/man/internals/internals.texi @@ -135,7 +135,7 @@ This Info file contains v1.0 of the XEmacs Internals Manual. * Specifiers:: * Menus:: * Subprocesses:: -* Interface to X Windows:: +* Interface to the X Window System:: * Index:: @detailmenu @@ -7178,19 +7178,19 @@ Many are accessible indirectly in Lisp programs via Lisp primitives. @table @code @item name The buffer name is a string that names the buffer. It is guaranteed to -be unique. @xref{Buffer Names,,, lispref, XEmacs Lisp Programmer's +be unique. @xref{Buffer Names,,, lispref, XEmacs Lisp Reference Manual}. @item save_modified This field contains the time when the buffer was last saved, as an -integer. @xref{Buffer Modification,,, lispref, XEmacs Lisp Programmer's +integer. @xref{Buffer Modification,,, lispref, XEmacs Lisp Reference Manual}. @item modtime This field contains the modification time of the visited file. It is set when the file is written or read. Every time the buffer is written to the file, this field is compared to the modification time of the -file. @xref{Buffer Modification,,, lispref, XEmacs Lisp Programmer's +file. @xref{Buffer Modification,,, lispref, XEmacs Lisp Reference Manual}. @item auto_save_modified @@ -7202,39 +7202,39 @@ the last time the buffer was displayed in a window. @item undo_list This field points to the buffer's undo list. @xref{Undo,,, lispref, -XEmacs Lisp Programmer's Manual}. +XEmacs Lisp Reference Manual}. @item syntax_table_v This field contains the syntax table for the buffer. @xref{Syntax -Tables,,, lispref, XEmacs Lisp Programmer's Manual}. +Tables,,, lispref, XEmacs Lisp Reference Manual}. @item downcase_table This field contains the conversion table for converting text to lower -case. @xref{Case Tables,,, lispref, XEmacs Lisp Programmer's Manual}. +case. @xref{Case Tables,,, lispref, XEmacs Lisp Reference Manual}. @item upcase_table This field contains the conversion table for converting text to upper -case. @xref{Case Tables,,, lispref, XEmacs Lisp Programmer's Manual}. +case. @xref{Case Tables,,, lispref, XEmacs Lisp Reference Manual}. @item case_canon_table This field contains the conversion table for canonicalizing text for case-folding search. @xref{Case Tables,,, lispref, XEmacs Lisp -Programmer's Manual}. +Reference Manual}. @item case_eqv_table This field contains the equivalence table for case-folding search. -@xref{Case Tables,,, lispref, XEmacs Lisp Programmer's Manual}. +@xref{Case Tables,,, lispref, XEmacs Lisp Reference Manual}. @item display_table This field contains the buffer's display table, or @code{nil} if it doesn't have one. @xref{Display Tables,,, lispref, XEmacs Lisp -Programmer's Manual}. +Reference Manual}. @item markers This field contains the chain of all markers that currently point into the buffer. Deletion of text in the buffer, and motion of the buffer's gap, must check each of these markers and perhaps update it. -@xref{Markers,,, lispref, XEmacs Lisp Programmer's Manual}. +@xref{Markers,,, lispref, XEmacs Lisp Reference Manual}. @item backed_up This field is a flag that tells whether a backup file has been made for @@ -7243,7 +7243,7 @@ the visited file of this buffer. @item mark This field contains the mark for the buffer. The mark is a marker, hence it is also included on the list @code{markers}. @xref{The Mark,,, -lispref, XEmacs Lisp Programmer's Manual}. +lispref, XEmacs Lisp Reference Manual}. @item mark_active This field is non-@code{nil} if the buffer's mark is active. @@ -7253,12 +7253,12 @@ This field contains the association list describing the variables local in this buffer, and their values, with the exception of local variables that have special slots in the buffer object. (Those slots are omitted from this table.) @xref{Buffer-Local Variables,,, lispref, XEmacs Lisp -Programmer's Manual}. +Reference Manual}. @item modeline_format This field contains a Lisp object which controls how to display the mode line for this buffer. @xref{Modeline Format,,, lispref, XEmacs Lisp -Programmer's Manual}. +Reference Manual}. @item base_buffer This field holds the buffer's base buffer (if it is an indirect buffer), @@ -8723,12 +8723,13 @@ Not yet documented. Glyphs are graphical elements that can be displayed in XEmacs buffers or gutters. We use the term graphical element here in the broadest possible -sense since glyphs can be as mundane as text to as arcane as a native +sense since glyphs can be as mundane as text or as arcane as a native tab widget. In XEmacs, glyphs represent the uninstantiated state of graphical elements, i.e. they hold all the information necessary to produce an -image on-screen but the image does not exist at this stage. +image on-screen but the image need not exist at this stage, and multiple +screen images can be instantiated from a single glyph. Glyphs are lazily instantiated by calling one of the glyph functions. This usually occurs within redisplay when @@ -8746,7 +8747,7 @@ and every usage - and this would be extremely memory and cpu intensive. Widget-glyphs (a.k.a native widgets) are not cached in this way. This is because widget-glyph image-instances on screen are toolkit windows, and thus cannot be reused in multiple XEmacs domains. Thus widget-glyphs are -cached on a window basis. +cached on an XEmacs window basis. Any action on a glyph first consults the cache before actually instantiating a widget. @@ -8757,28 +8758,10 @@ To Do @section Widget-Glyphs in the X Environment -Widget-glyphs under X make heavy use of lwlib for manipulating the -native toolkit objects. This is primarily so that different toolkits can -be supported for widget-glyphs, just as they are supported for features -such as menubars etc. - -Lwlib is extremely poorly documented and quite hairy so here is my -understanding of what goes on. - -Lwlib maintains a set of widget_instances which mirror the hierarchical -state of Xt widgets. I think this is so that widgets can be updated and -manipulated generically by the lwlib library. For instance -update_one_widget_instance can cope with multiple types of widget and -multiple types of toolkit. Each element in the widget hierarchy is updated -from its corresponding widget_instance by walking the widget_instance -tree recursively. - -This has desirable properties such as lw_modify_all_widgets which is -called from @file{glyphs-x.c} and updates all the properties of a widget -without having to know what the widget is or what toolkit it is from. -Unfortunately this also has hairy properties such as making the lwlib -code quite complex. And of course lwlib has to know at some level what -the widget is and how to set its properties. +Widget-glyphs under X make heavy use of lwlib (@pxref{Lucid Widget +Library}) for manipulating the native toolkit objects. This is primarily +so that different toolkits can be supported for widget-glyphs, just as +they are supported for features such as menubars etc. @node Specifiers, Menus, Glyphs, Top @chapter Specifiers @@ -8837,7 +8820,7 @@ a function to call (either @code{eval} or @code{call-interactively}) and its argument, which is the callback function or form given in the menu's description. -@node Subprocesses, Interface to X Windows, Menus, Top +@node Subprocesses, Interface to the X Window System, Menus, Top @chapter Subprocesses The fields of a process are: @@ -8910,10 +8893,139 @@ The name of the terminal that the subprocess is using, or @code{nil} if it is using pipes. @end table -@node Interface to X Windows, Index , Subprocesses, Top -@chapter Interface to X Windows +@node Interface to the X Window System, Index, Subprocesses, Top +@chapter Interface to the X Window System -Not yet documented. +Mostly undocumented. + +@menu +* Lucid Widget Library:: An interface to various widget sets. +@end menu + +@node Lucid Widget Library, , , Interface to the X Window System +@section Lucid Widget Library + +Lwlib is extremely poorly documented and quite hairy. The author(s) +blame that on X, Xt, and Motif, with some justice, but also sufficient +hypocrisy to avoid drawing the obvious conclusion about their own work. + +The Lucid Widget Library is composed of two more or less independent +pieces. The first, as the name suggests, is a set of widgets. These +widgets are intended to resemble and improve on widgets provided in the +Motif toolkit but not in the Athena widgets, including menubars and +scrollbars. Recent additions by Andy Piper integrate some ``modern'' +widgets by Edward Falk, including checkboxes, radio buttons, progress +gauges, and index tab controls (aka notebooks). + +The second piece of the Lucid widget library is a generic interface to +several toolkits for X (including Xt, the Athena widget set, and Motif, +as well as the Lucid widgets themselves) so that core XEmacs code need +not know which widget set has been used to build the graphical user +interface. + +@menu +* Generic Widget Interface:: The lwlib generic widget interface. +* Scrollbars:: +* Menubars:: +* Checkboxes and Radio Buttons:: +* Progress Bars:: +* Tab Controls:: +@end menu + +@node Generic Widget Interface, Scrollbars, , Lucid Widget Library +@subsection Generic Widget Interface + +In general in any toolkit a widget may be a composite object. In Xt, +all widgets have an X window that they manage, but typically a complex +widget will have widget children, each of which manages a subwindow of +the parent widget's X window. These children may themselves be +composite widgets. Thus a widget is actually a tree or hierarchy of +widgets. + +For each toolkit widget, lwlib maintains a tree of @code{widget_values} +which mirror the hierarchical state of Xt widgets (including Motif, +Athena, 3D Athena, and Falk's widget sets). Each @code{widget_value} +has @code{contents} member, which points to the head of a linked list of +its children. The linked list of siblings is chained through the +@code{next} member of @code{widget_value}. + +@example + +-----------+ + | composite | + +-----------+ + | + | contents + V + +-------+ next +-------+ next +-------+ + | child |----->| child |----->| child | + +-------+ +-------+ +-------+ + | + | contents + V + +-------------+ next +-------------+ + | grand child |----->| grand child | + +-------------+ +-------------+ + +The @code{widget_value} hierarchy of a composite widget with two simple +children and one composite child. +@end example + +The @code{widget_instance} structure maintains the inverse view of the +tree. As for the @code{widget_value}, siblings are chained through the +@code{next} member. However, rather than naming children, the +@code{widget_instance} tree links to parents. + +@example + +-----------+ + | composite | + +-----------+ + A + | parent + | + +-------+ next +-------+ next +-------+ + | child |----->| child |----->| child | + +-------+ +-------+ +-------+ + A + | parent + | + +-------------+ next +-------------+ + | grand child |----->| grand child | + +-------------+ +-------------+ + +The @code{widget_value} hierarchy of a composite widget with two simple +children and one composite child. +@end example + +This permits widgets derived from different toolkits to be updated and +manipulated generically by the lwlib library. For instance +@code{update_one_widget_instance} can cope with multiple types of widget +and multiple types of toolkit. Each element in the widget hierarchy is +updated from its corresponding @code{widget_value} by walking the +@code{widget_value} tree. This has desirable properties. For example, +@code{lw_modify_all_widgets} is called from @file{glyphs-x.c} and +updates all the properties of a widget without having to know what the +widget is or what toolkit it is from. Unfortunately this also has its +hairy properties; the lwlib code quite complex. And of course lwlib has +to know at some level what the widget is and how to set its properties. + +The @code{widget_instance} structure also contains a pointer to the root +of its tree. Widget instances are further confi + + +@node Scrollbars, Menubars, Generic Widget Interface, Lucid Widget Library +@subsection Scrollbars + +@node Menubars, Checkboxes and Radio Buttons, Scrollbars, Lucid Widget Library +@subsection Menubars + +@node Checkboxes and Radio Buttons, Progress Bars, Menubars, Lucid Widget Library +@subsection Checkboxes and Radio Buttons + +@node Progress Bars, Tab Controls, Checkboxes and Radio Buttons, Lucid Widget Library +@subsection Progress Bars + +@node Tab Controls, , Progress Bars, Lucid Widget Library +@subsection Tab Controls @include index.texi diff --git a/man/lispref/abbrevs.texi b/man/lispref/abbrevs.texi index 1736cbe..2c7381c 100644 --- a/man/lispref/abbrevs.texi +++ b/man/lispref/abbrevs.texi @@ -30,7 +30,7 @@ Therefore, it is safe to use them in an extremely nonstandard way. @xref{Creating Symbols}. For the user-level commands for abbrevs, see @ref{Abbrevs,, Abbrev -Mode, emacs, The XEmacs Reference Manual}. +Mode, xemacs, The XEmacs User's Manual}. @menu * Abbrev Mode:: Setting up XEmacs for abbreviation. diff --git a/man/lispref/backups.texi b/man/lispref/backups.texi index e1c0a18..6dbcb22 100644 --- a/man/lispref/backups.texi +++ b/man/lispref/backups.texi @@ -358,9 +358,9 @@ called @dfn{auto-saving}. Auto-saving prevents you from losing more than a limited amount of work if the system crashes. By default, auto-saves happen every 300 keystrokes, or after around 30 seconds of idle time. @xref{Auto-Save, Auto-Save, Auto-Saving: Protection Against -Disasters, emacs, The XEmacs Reference Manual}, for information on auto-save -for users. Here we describe the functions used to implement auto-saving -and the variables that control them. +Disasters, xemacs, The XEmacs Lisp Reference Manual}, for information on +auto-save for users. Here we describe the functions used to implement +auto-saving and the variables that control them. @defvar buffer-auto-save-file-name This buffer-local variable is the name of the file used for @@ -579,7 +579,7 @@ name. If you have made extensive changes to a file and then change your mind about them, you can get rid of them by reading in the previous version of the file with the @code{revert-buffer} command. @xref{Reverting, , -Reverting a Buffer, emacs, The XEmacs Reference Manual}. +Reverting a Buffer, xemacs, The XEmacs Lisp Reference Manual}. @deffn Command revert-buffer &optional check-auto-save noconfirm preserve-modes This command replaces the buffer text with the text of the visited diff --git a/man/lispref/compile.texi b/man/lispref/compile.texi index 7db86b7..e6426ae 100644 --- a/man/lispref/compile.texi +++ b/man/lispref/compile.texi @@ -46,6 +46,7 @@ byte compilation. * Eval During Compile:: Code to be evaluated when you compile. * Compiled-Function Objects:: The data type used for byte-compiled functions. * Disassembly:: Disassembling byte-code; how to read byte-code. +* Different Behavior:: When compiled code gives different results. @end menu @node Speed of Byte-Code @@ -784,3 +785,33 @@ The @code{silly-loop} function is somewhat more complex: @end example +@node Different Behavior +@section Different Behavior + +The intent is that compiled byte-code and the corresponding code +executed by the Lisp interpreter produce identical results. However, +there are some circumstances where the results will differ. + +@itemize @bullet +@item +Arithmetic operations may be rearranged for efficiency or compile-time +evaluation. When floating point numbers are involved, this may produce +different values or an overflow. +@item +Some arithmetic operations may be optimized away. For example, the +expression @code{(+ x)} may be optimized to simply @code{x}. If the +value of @code{x} is a marker, then the value will be a marker instead +of an integer. If the value of @samp{x} is a cons cell, then the +interpreter will issue an error, while the bytecode will not. + +If you're trying to use @samp{(+ @var{object} 0)} to convert +@var{object} to integer, consider using an explicit conversion function, +which is clearer and guaranteed to work. +Instead of @samp{(+ @var{marker} 0)}, use @samp{(marker-position @var{marker})}. +Instead of @samp{(+ @var{char} 0)}, use @samp{(char-int @var{char})}. +@end itemize + +For maximal equivalence between interpreted and compiled code, the +variables @code{byte-compile-delete-errors} and +@code{byte-compile-optimize} can be set to @code{nil}, but this is not +recommended. diff --git a/man/lispref/display.texi b/man/lispref/display.texi index 043f4e4..2efc741 100644 --- a/man/lispref/display.texi +++ b/man/lispref/display.texi @@ -167,9 +167,9 @@ The @dfn{echo area} is used for displaying messages made with the @code{message} primitive, and for echoing keystrokes. It is not the same as the minibuffer, despite the fact that the minibuffer appears (when active) in the same place on the screen as the echo area. The -@cite{XEmacs Reference Manual} specifies the rules for resolving conflicts +@cite{XEmacs Lisp Reference Manual} specifies the rules for resolving conflicts between the echo area and the minibuffer for use of that screen space -(@pxref{Minibuffer,, The Minibuffer, emacs, The XEmacs Reference Manual}). +(@pxref{Minibuffer,, The Minibuffer, xemacs, The XEmacs Lisp Reference Manual}). Error messages appear in the echo area; see @ref{Errors}. You can write output in the echo area by using the Lisp printing diff --git a/man/lispref/help.texi b/man/lispref/help.texi index 9ab8294..88ec58f 100644 --- a/man/lispref/help.texi +++ b/man/lispref/help.texi @@ -94,7 +94,7 @@ information to read the documentation from the appropriate file; this is transparent to the user. For information on the uses of documentation strings, see @ref{Help, , -Help, emacs, The XEmacs Reference Manual}. +Help, xemacs, The XEmacs Reference Manual}. @c Wordy to prevent overfull hbox. --rjc 15mar92 The @file{emacs/lib-src} directory contains two utilities that you can @@ -456,7 +456,7 @@ XEmacs buffers are usually displayed). XEmacs provides a variety of on-line help functions, all accessible to the user as subcommands of the prefix @kbd{C-h}, or on some keyboards, @kbd{help}. For more information about them, see @ref{Help, , Help, -emacs, The XEmacs Reference Manual}. Here we describe some +emacs, The XEmacs Lisp Reference Manual}. Here we describe some program-level interfaces to the same information. @deffn Command apropos regexp &optional do-all predicate diff --git a/man/lispref/keymaps.texi b/man/lispref/keymaps.texi index a509fdf..d082258 100644 --- a/man/lispref/keymaps.texi +++ b/man/lispref/keymaps.texi @@ -1520,8 +1520,8 @@ If @var{noindirect} is non-@code{nil}, @code{where-is-internal} doesn't follow indirect keymap bindings. This makes it possible to search for an indirect definition itself. -This function is used by @code{where-is} (@pxref{Help, , Help, emacs, -The XEmacs Reference Manual}). +This function is used by @code{where-is} (@pxref{Help, , Help, xemacs, +The XEmacs Lisp Reference Manual}). @smallexample @group diff --git a/man/lispref/lispref.texi b/man/lispref/lispref.texi index 5003ef5..18f6365 100644 --- a/man/lispref/lispref.texi +++ b/man/lispref/lispref.texi @@ -473,8 +473,14 @@ Loading Byte Compilation -* Compilation Functions:: Byte compilation functions. -* Disassembly:: Disassembling byte-code; how to read byte-code. +* Speed of Byte-Code:: An example of speedup from byte compilation. +* Compilation Functions:: Byte compilation functions. +* Docs and Compilation:: Dynamic loading of documentation strings. +* Dynamic Loading:: Dynamic loading of individual functions. +* Eval During Compile:: Code to be evaluated when you compile. +* Compiled-Function Objects:: The data type used for byte-compiled functions. +* Disassembly:: Disassembling byte-code; how to read byte-code. +* Different Behavior:: When compiled code gives different results. Debugging Lisp Programs diff --git a/man/lispref/locals.texi b/man/lispref/locals.texi index 2d3ed27..0539ade 100644 --- a/man/lispref/locals.texi +++ b/man/lispref/locals.texi @@ -68,7 +68,7 @@ define such variables for their internal use; we don't list them here. @pxref{Usual Display} @item comment-column -@pxref{Comments,,, emacs, The XEmacs User's Manual} +@pxref{Comments,,, xemacs, The XEmacs User's Manual} @item default-directory @pxref{System Environment} @@ -80,7 +80,7 @@ define such variables for their internal use; we don't list them here. @pxref{Auto Filling} @item goal-column -@pxref{Moving Point,,, emacs, The XEmacs User's Manual} +@pxref{Moving Point,,, xemacs, The XEmacs User's Manual} @item left-margin @pxref{Indentation} diff --git a/man/lispref/modes.texi b/man/lispref/modes.texi index 5db9648..ad3b31f 100644 --- a/man/lispref/modes.texi +++ b/man/lispref/modes.texi @@ -502,7 +502,7 @@ list at the end of the file and in the @samp{-*-} line. The variable If you run @code{normal-mode} interactively, the argument @var{find-file} is normally @code{nil}. In this case, @code{normal-mode} unconditionally processes any local variables list. -@xref{File variables, , Local Variables in Files, emacs, The XEmacs +@xref{File variables, , Local Variables in Files, xemacs, The XEmacs Reference Manual}, for the syntax of the local variables section of a file. @cindex file mode specification error @@ -542,7 +542,7 @@ line, on the visited file name (using @code{auto-mode-alist}), or on the value of a local variable. However, this function does not look for the @samp{mode:} local variable near the end of a file; the @code{hack-local-variables} function does that. @xref{Choosing Modes, , -How Major Modes are Chosen, emacs, The XEmacs Reference Manual}. +How Major Modes are Chosen, xemacs, The XEmacs Lisp Reference Manual}. @end defun @defopt default-major-mode diff --git a/man/lispref/positions.texi b/man/lispref/positions.texi index 85e05a7..7804917 100644 --- a/man/lispref/positions.texi +++ b/man/lispref/positions.texi @@ -193,28 +193,27 @@ In an interactive call, @var{count} is the numeric prefix argument. These functions for parsing words use the syntax table to decide whether a given character is part of a word. @xref{Syntax Tables}. -@deffn Command forward-word count &optional buffer +@deffn Command forward-word &optional count buffer This function moves point forward @var{count} words (or backward if @var{count} is negative). Normally it returns @code{t}. If this motion encounters the beginning or end of the buffer, or the limits of the accessible portion when narrowing is in effect, point stops there and -the value is @code{nil}. @var{buffer} defaults to the current buffer if -omitted. +the value is @code{nil}. + +@var{count} defaults to @code{1} and @var{buffer} defaults to the +current buffer. In an interactive call, @var{count} is set to the numeric prefix argument. @end deffn -@deffn Command backward-word count &optional buffer +@deffn Command backward-word &optional count buffer This function is just like @code{forward-word}, except that it moves backward until encountering the front of a word, rather than forward. @var{buffer} defaults to the current buffer if omitted. In an interactive call, @var{count} is set to the numeric prefix argument. - -This function is rarely used in programs, as it is more efficient to -call @code{forward-word} with a negative argument. @end deffn @defvar words-include-escapes @@ -612,7 +611,7 @@ expressions (also called @dfn{sexps} in connection with moving across them in XEmacs). The syntax table controls how these functions interpret various characters; see @ref{Syntax Tables}. @xref{Parsing Expressions}, for lower-level primitives for scanning sexps or parts of -sexps. For user-level commands, see @ref{Lists and Sexps,,, emacs, XEmacs +sexps. For user-level commands, see @ref{Lists and Sexps,,, xemacs, XEmacs Reference Manual}. @deffn Command forward-list &optional arg diff --git a/man/lispref/searching.texi b/man/lispref/searching.texi index a8ec820..22df2d7 100644 --- a/man/lispref/searching.texi +++ b/man/lispref/searching.texi @@ -652,8 +652,8 @@ beyond the minimum needed to end a sentence. In XEmacs, you can search for the next match for a regexp either incrementally or not. Incremental search commands are described in the -@cite{The XEmacs Reference Manual}. @xref{Regexp Search, , Regular Expression -Search, emacs, The XEmacs Reference Manual}. Here we describe only the search +@cite{The XEmacs Lisp Reference Manual}. @xref{Regexp Search, , Regular Expression +Search, xemacs, The XEmacs Lisp Reference Manual}. Here we describe only the search functions useful in programs. The principal one is @code{re-search-forward}. diff --git a/man/lispref/symbols.texi b/man/lispref/symbols.texi index 268648d..3091876 100644 --- a/man/lispref/symbols.texi +++ b/man/lispref/symbols.texi @@ -115,7 +115,8 @@ the four cells of the symbol @code{buffer-file-name}: @noindent Because this symbol is the variable which holds the name of the file being visited in the current buffer, the value cell contents we see are -the name of the source file of this chapter of the XEmacs Lisp Manual. +the name of the source file of this chapter of the XEmacs Lisp Reference +Manual. The property list cell contains the list @code{(variable-documentation 29529)} which tells the documentation functions where to find the documentation string for the variable @code{buffer-file-name} in the diff --git a/man/lispref/syntax.texi b/man/lispref/syntax.texi index 2bbbdd6..2b75bc0 100644 --- a/man/lispref/syntax.texi +++ b/man/lispref/syntax.texi @@ -666,13 +666,13 @@ end of a comment. This limitation no longer exists. You can use @code{forward-comment} to move forward or backward over one comment or several comments. -@defun forward-comment count &optional buffer +@defun forward-comment &optional count buffer This function moves point forward across @var{count} comments (backward, if @var{count} is negative). If it finds anything other than a comment or whitespace, it stops, leaving point at the place where it stopped. -It also stops after satisfying @var{count}. +It also stops after satisfying @var{count}. @var{count} defaults to @code{1}. - Optional argument @var{buffer} defaults to the current buffer. +Optional argument @var{buffer} defaults to the current buffer. @end defun To move forward over all comments and whitespace following point, use diff --git a/man/lispref/text.texi b/man/lispref/text.texi index b4ec428..233e73c 100644 --- a/man/lispref/text.texi +++ b/man/lispref/text.texi @@ -476,10 +476,11 @@ This command deletes the text in @var{buffer} in the region defined by argument @var{buffer} is @code{nil}, the current buffer is assumed. @end deffn -@deffn Command delete-char count &optional killp +@deffn Command delete-char &optional count killp This command deletes @var{count} characters directly after point, or -before point if @var{count} is negative. If @var{killp} is -non-@code{nil}, then it saves the deleted characters in the kill ring. +before point if @var{count} is negative. @var{count} defaults to @code{1}. +If @var{killp} is non-@code{nil}, then it saves the deleted characters +in the kill ring. In an interactive call, @var{count} is the numeric prefix argument, and @var{killp} is the unprocessed prefix argument. Therefore, if a prefix @@ -490,11 +491,12 @@ the kill ring. The value returned is always @code{nil}. @end deffn -@deffn Command delete-backward-char count &optional killp +@deffn Command delete-backward-char &optional count killp @cindex delete previous char This command deletes @var{count} characters directly before point, or -after point if @var{count} is negative. If @var{killp} is -non-@code{nil}, then it saves the deleted characters in the kill ring. +after point if @var{count} is negative. @var{count} defaults to 1. +If @var{killp} is non-@code{nil}, then it saves the deleted characters +in the kill ring. In an interactive call, @var{count} is the numeric prefix argument, and @var{killp} is the unprocessed prefix argument. Therefore, if a prefix diff --git a/man/lispref/tips.texi b/man/lispref/tips.texi index eb4be94..a8ce727 100644 --- a/man/lispref/tips.texi +++ b/man/lispref/tips.texi @@ -534,7 +534,7 @@ The indentation commands of the Lisp modes in XEmacs, such as @kbd{M-;} (@code{indent-for-comment}) and @key{TAB} (@code{lisp-indent-line}) automatically indent comments according to these conventions, depending on the number of semicolons. @xref{Comments,, -Manipulating Comments, emacs, The XEmacs Reference Manual}. +Manipulating Comments, xemacs, The XEmacs User's Manual}. @node Library Headers @section Conventional Headers for XEmacs Libraries diff --git a/man/texinfo.texi b/man/texinfo.texi index 73037d2..321f488 100644 --- a/man/texinfo.texi +++ b/man/texinfo.texi @@ -1,5 +1,5 @@ \input texinfo.tex @c -*-texinfo-*- -@c $Id: texinfo.texi,v 1.8.2.4 1999/12/05 19:02:24 martinb Exp $ +@c $Id: texinfo.texi,v 1.8.2.5 2000/11/14 23:29:15 adrian Exp $ @c %**start of header @c All text is ignored before the setfilename. @@ -5158,16 +5158,16 @@ The format looks like this:@refill @end example For example, to refer directly to the @samp{Outlining} and -@samp{Rebinding} nodes in the @cite{Emacs Manual}, you would write a -menu like this:@refill +@samp{Rebinding} nodes in the @cite{XEmacs User's Manual}, you would +write a menu like this:@refill @example @group @@menu -* Outlining: (emacs)Outline Mode. The major mode for - editing outlines. -* Rebinding: (emacs)Rebinding. How to redefine the - meaning of a key. +* Outlining: (xemacs)Outline Mode. The major mode for + editing outlines. +* Rebinding: (xemacs)Rebinding. How to redefine the + meaning of a key. @@end menu @end group @end example diff --git a/man/xemacs-faq.texi b/man/xemacs-faq.texi index d683baa..4f4bdab 100644 --- a/man/xemacs-faq.texi +++ b/man/xemacs-faq.texi @@ -7,7 +7,7 @@ @finalout @titlepage @title XEmacs FAQ -@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2000/11/02 21:51:16 $ +@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2000/11/14 23:29:27 $ @sp 1 @author Tony Rossini @author Ben Wing @@ -713,7 +713,7 @@ XEmacs port, but never went any farther. No, but Alexander Nikolaev is working on it. @node Q1.0.14, Q1.1.1, Q1.0.13, Introduction -@unnumberedsubsec Q1.0.14: Where can I obtain a printed copy of the XEmacs users manual? +@unnumberedsubsec Q1.0.14: Where can I obtain a printed copy of the XEmacs User's Manual? Pre-printed manuals are not available. If you are familiar with TeX, you can generate your own manual from the XEmacs sources. diff --git a/man/xemacs/calendar.texi b/man/xemacs/calendar.texi index dce562a..b0b0172 100644 --- a/man/xemacs/calendar.texi +++ b/man/xemacs/calendar.texi @@ -15,7 +15,7 @@ mode is Calendar mode. particular date; @kbd{Buttons3} brings up a menu of commonly used calendar features that are independent of any particular date. To exit the calendar, type @kbd{q}. @xref{Calendar, Customizing the Calendar -and Diary,, elisp, The Emacs Lisp Reference Manual}, for customization +and Diary,, lispref, The XEmacs Lisp Reference Manual}, for customization information about the calendar and diary. @menu diff --git a/man/xemacs/cmdargs.texi b/man/xemacs/cmdargs.texi index 3863203..b21b596 100644 --- a/man/xemacs/cmdargs.texi +++ b/man/xemacs/cmdargs.texi @@ -11,7 +11,7 @@ XEmacs under the X window system, you can also use a number of standard Xt command line arguments. Command line arguments are not usually needed for editing with Emacs; new users can skip this section. -Many editors are designed to be started afresh each time you want to + Many editors are designed to be started afresh each time you want to edit. You start the editor to edit one file; then exit the editor. The next time you want to edit either another file or the same one, you start the editor again. Under these circumstances, it makes sense to use a @@ -28,9 +28,14 @@ command line arguments for specifying a file when Emacs is started are seldom needed. Emacs accepts command-line arguments that specify files to visit, -functions to call, and other activities and operating modes. If you are -running XEmacs under the X window system, a number of standard -Xt command line arguments are available as well. +functions to call, and other activities and operating modes. If you +are running XEmacs under the X window system, a number of standard Xt +command line arguments are available, as well as a few X parameters +that are XEmacs-specific. + + Options with long names with a single initial hyphen are also +recognized with the GNU double initial hyphen syntax. (The reverse +is not true.) The following subsections list: @itemize @bullet @@ -78,7 +83,8 @@ Insert the contents of @var{file} into the current buffer. This is like what @kbd{M-x insert-buffer} does; @xref{Misc File Ops}. @item -kill -Exit from Emacs without asking for confirmation. +Exit from Emacs without asking for confirmation. Always the last +argument processed, no matter where it appears in the command line. @item -version @itemx -V @@ -99,7 +105,19 @@ command line. If more than one of them appears, they must appear in the order in which they appear in this table. @table @samp -@item -t @var{file} +@item --show-dump-id +@itemx -sd +Print the ID for the new portable dumper's dump file on the terminal and +exit. (Prints an error message and exits if XEmacs was not configured +@samp{--pdump}.) + +@item --no-dump-file +@itemx -nd +Don't load the dump file. Roughly equivalent to old temacs. (Ignored if +XEmacs was not configured @samp{--pdump}.) + +@item --terminal @var{file} +@itemx -t @var{file} Use @var{file} instead of the terminal for input and output. This implies the @samp{-nw} option, documented below. @@ -121,7 +139,8 @@ causes Emacs to kill itself after all command switches have been processed. In addition, auto-saving is not done except in buffers for which it has been explicitly requested. -@item -nw +@item --no-windows +@itemx -nw Start up XEmacs in TTY mode (using the TTY XEmacs was started from), rather than trying to connect to an X display. Note that this happens automatically if the @samp{DISPLAY} environment variable is not set. @@ -167,7 +186,7 @@ and the various user-specific initialization files. @itemx -u @var{user} Equivalent to @samp{-user-init-file ~@var{user}/.xemacs/init.el -user-init-directory ~@var{user}/.xemacs}, or @samp{-user-init-file -~@var{user}/.emacs -user-init-directory ~@var{user}/.xemacs}. whichever +~@var{user}/.emacs -user-init-directory ~@var{user}/.xemacs}, whichever init file comes first. @xref{Init File}. @end table diff --git a/man/xemacs/frame.texi b/man/xemacs/frame.texi index 8dff083..5919818 100644 --- a/man/xemacs/frame.texi +++ b/man/xemacs/frame.texi @@ -45,12 +45,12 @@ If you are running XEmacs under a graphical windowing system, a menu bar at the top of the frame makes shortcuts to several of the commands available (@pxref{Pull-down Menus}). @item -If you are running XEmacs under a graphical windowing system, a +Under a graphical windowing system, a toolbar at the top of the frame, just under the menu bar if it exists, provides ``one-touch'' shortcuts to several commands. (Not yet documented.) @item -If you are running XEmacs under a graphical windowing system, a +Under a graphical windowing system, a gutter at the top (under the toolbar) and/or bottom of the frame provides advanced GUI facilities like tab controls for rapid switching among related windows and progress bars for time-consuming operations @@ -80,9 +80,12 @@ visible in all XEmacs windows containing that buffer. @menu * Point:: The place in the text where editing commands operate. * Echo Area:: Short messages appear at the bottom of the frame. -* Mode Line:: Interpreting the mode line. +* Mode Line:: Interpreting the mode line. +* GUI Components:: Menubar, toolbars, gutters. * XEmacs under X:: Some information on using XEmacs under the X Window System. +* XEmacs under MS Windows:: Some information on using XEmacs under + Microsoft Windows. @end menu @node Point, Echo Area, Frame, Frame @@ -169,7 +172,7 @@ appears after the prompt. You can always get out of the minibuffer by typing @kbd{C-g}. @xref{Minibuffer}. @end itemize -@node Mode Line, XEmacs under X, Echo Area, Frame +@node Mode Line, GUI Components, Echo Area, Frame @comment node-name, next, previous, up @section The Mode Line @cindex mode line @@ -272,7 +275,187 @@ the terminal supports it); @code{nil} means no inverse video. The default is @code{t}. For X frames, simply set the foreground and background colors appropriately. -@node XEmacs under X, , Mode Line, Frame +@node GUI Components, XEmacs under X, Mode Line, Frame +@comment node-name, next, previous, up +@section GUI Components + +When executed in a graphical windowing environment such as the X Window +System or Microsoft Windows, XEmacs displays several graphical user +interface components such as scrollbars, menubars, toolbars, and +gutters. By default there is a vertical scrollbar at the right of each +frame, and at the top of the frame there is a menubar, a toolbar, and a +gutter, in that order. Gutters can contain any of several widgets, but +the default configuration puts a set of "notebook tabs" which you can +use as a shortcut for selecting any of several related buffers in a +given frame. Operating the GUI components is "obvious": click on the +menubar to pull down a menu, on a button in the toolbar to invoke a +function, and on a tab in the gutter to switch buffers. + +@menu +* Menubar Basics:: How XEmacs uses the menubar. +* Scrollbar Basics:: How XEmacs uses scrollbars. +* Toolbar Basics:: How XEmacs uses toolbars. +* Gutter Basics:: How XEmacs uses gutters. +* Inhibiting:: What if you don't like GUI? +* Customizing:: Position, orientation, and appearance of GUI objects. +@end menu + +@node Menubar Basics, Scrollbar Basics, , GUI Components +@comment node-name, next, previous, up +@section The XEmacs Menubar + +The XEmacs menubar is intended to be conformant to the usual conventions +for menubars, although conformance is not yet perfect. The menu at the +extreme right is the @samp{Help} menu, which should always be +available. It provides access to all the XEmacs help facilities +available through @kbd{C-h}, as well as samples of various configuration +files like @samp{~/.Xdefaults} and @samp{~/.emacs}. At the extreme left +is the @samp{Files} menu, which provides the usual file reading, +writing, and printing operations, as well as operations like revert +buffer from most recent save. The next menu from the left is the +@samp{Edit} menu, which provides the @samp{Undo} operation as well as +cutting and pasting, searching, and keyboard macro definition and +execution. + +@c #### w3.el and VM should get cross-references here. +XEmacs provides a very dynamic environment, and the Lisp language makes +for highly flexible applications. The menubar reflects this: many menus +(eg, the @samp{Buffers} menu, @pxref{Buffers Menu}) contain items +determined by the current state of XEmacs, and most major modes and many +minor modes add items to menus and even whole menus to the menubar. In +fact, some applications like w3.el and VM provide so many menus that +they define a whole new menubar and add a button that allows convenient +switching between the ``XEmacs menubar'' and the ``application +menubar''. Such applications normally bind themselves to a particular +frame, and this switching only takes place on frames where such an +application is active (ie, the current window of the frame is displaying +a buffer in the appropriate major mode). + +Other menus which are typically available are the @samp{Options}, +@samp{Tools}, @samp{Buffers}, @samp{Apps}, and @samp{Mule} menus. For +detailed descriptions of these menus, @ref{Pull-down Menus}. (In 21.2 +XEmacsen, the @samp{Mule} menu will be moved under @samp{Options}.) + +@node Scrollbar Basics, Toolbar Basics, Menubar Basics, GUI Components +@comment node-name, next, previous, up +@section XEmacs Scrollbars + +XEmacs scrollbars provide the usual interface. Arrow buttons at either +end allow for line by line scrolling, including autorepeat. Clicking in +the scrollbar itself provides scrolling by windowsfull, depending on +which side of the slider is clicked. The slider itself may be dragged +for smooth scrolling. + +The position of the slider corresponds to the position of the window in +the buffer. In particular, the length of the slider is proportional to +the fraction of the buffer which appears in the window. + +The presence of the scrollbars is under control of the application or +may be customized by the user. By default a vertical scrollbar is +present in all windows (except the minibuffer), and there is no +horizontal scrollbar. + +@node Toolbar Basics, Gutter Basics, Scrollbar Basics, GUI Components +@comment node-name, next, previous, up +@section XEmacs Toolbars + +XEmacs has a default toolbar which provides shortcuts for some of the +commonly used operations (such as opening files) and applications (such +as the Info manual reader). Operations which require arguments will pop +up dialogs to get them. + +The position of the default toolbar can be customized. Also, several +toolbars may be present simultaneously (in different positions). VM, +for example, provides an application toolbar which shortcuts for +mail-specific operations like sending, saving, and deleting messages. + +@node Gutter Basics, Inhibiting, Toolbar Basics, GUI Components +@comment node-name, next, previous, up +@section XEmacs Gutters + +Gutters are the most flexible of the GUI components described in this +section. In theory, the other GUI components could be implemented by +customizing a gutter, but in practice the other components were +introduced earlier and have their own special implementations. Gutters +tend to be more transient than the other components. Buffer tabs, for +example, change every time the selected buffer in the frame changes. +And for progress gauges a gutter to contain the gauge is typically +created on the fly when needed, then destroyed when the operation whose +staus is being displayed is completed. + +Buffer tabs, having somewhat complex behavior, deserve a closer look. +By default, a row of buffer tabs is displayed at the top of every frame. +(The tabs could be placed in the bottom gutter, but would be oriented +the same way and look rather odd. The horizontal orientation makes +putting them in a side gutter utterly impractical.) The buffer +displayed in the current window of a frame can be changed to a specific +buffer by clicking [mouse-1] on the corresponding tab in the gutter. + +Each tab contains the name of its buffer. The tab for the current +buffer in each frame is displayed in raised relief. The list of buffers +chosen for display in the buffer tab row is derived by filtering the +buffer list (like the @code{Buffers} menu). The list starts out with +all existing buffers, with more recently selected buffers coming earlier +in the list. + +Then "uninteresting" buffers, like internal XEmacs buffers, the +@code{*Message Log*} buffer, and so on are deleted from the list. Next, +the frame's selected buffer is determined. Buffers with a different +major mode from the selected buffer are removed from the list. Finally, +if the list is too long, the least recently used buffers are deleted +from the list. By default up to 6 most recently used buffers with the +same mode are displayed on tabs in the gutter. + +@node Inhibiting, Customizing, Gutter Basics, GUI Components +@comment node-name, next, previous, up +@section Inhibiting Display of GUI Components + +Use of GUI facilities is a personal thing. Almost everyone agrees that +drawing via keyboard-based "turtle graphics" is acceptable to hardly +anyone if a mouse is available, but conversely emulating a keyboard with +a screenful of buttons is a painful experience. But between those +extremes the complete novice will require a fair amount of time before +toolbars and menus become dispensable, but many an "Ancien Haquer" sees +them as a complete waste of precious frame space that could be filled +with text. + +Display of all of the GUI components created by XEmacs can be inhibited +through the use of Customize. Customize can be accessed through +@samp{Options | Customize} in the menu bar, or via @kbd{M-x customize}. +Then navigate through the Customize tree to @samp{Emacs | Environment}. +Scrollbar and toolbar visibility is controlled via the @samp{Display} +group, options @samp{Scrollbars visible} and @samp{Toolbar visible} +respectively. Gutter visibility is controlled by group @samp{Gutter}, +option @samp{Visible}. + +Or they can be controlled directly by @kbd{M-x customize-variable}, by +changing the values of the variables @code{menubar-visible-p}, +@code{scrollbars-visible-p}, @code{toolbar-visible-p}, or +@code{gutter-buffers-tab-visible-p} respectively. (The strange form of +the last variable is due to the fact that gutters are often used to +display transient widgets like progress gauges, which you probably don't +want to inhibit. It is more likely that you want to inhibit the default +display of the buffers tab widget, which is what that variable controls. +This interface is subject to change depending on developer experience +and user feedback.) + +Control of frame configuration can controlled automatically according to +various parameters such as buffer or frame because these are +@dfn{specifiers} @ref{Specifiers, , , lispref}. Using these features +requires programming in Lisp; Customize is not yet that sophisticated. +Also, components that appear in various positions and orientations can +have display suppressed according to position. @kbd{C-h a visible-p} +gives a list of variables which can be customized. E.g., to control the +visibility of specifically the left-side toolbar only, customize +@code{left-toolbar-visible-p}. + +@node Customizing, , Inhibiting, GUI Components +@comment node-name, next, previous, up +@section Changing the Position, Orientation, and Appearance of GUI Components + + #### Not documented yet. + +@node XEmacs under X, XEmacs under MS Windows, GUI Components, Frame @section Using XEmacs Under the X Window System @comment node-name, next, previous, up @@ -355,3 +538,15 @@ the name of the current frame (a frame's name is distinct from its title; the name is used for resource lookup, among other things, and the title is simply what appears above the window.) @end itemize + +@node XEmacs under MS Windows, , XEmacs under X, Frame +@section Using XEmacs Under Microsoft Windows +@comment node-name, next, previous, up + +Use of XEmacs under MS Windows is not separately documented here, but +most operations available under the X Window System are also available +with MS Windows. + +Where possible, native MS Windows GUI components and capabilities are +used in XEmacs. + diff --git a/man/xemacs/packages.texi b/man/xemacs/packages.texi index ccd8f07..f263aac 100644 --- a/man/xemacs/packages.texi +++ b/man/xemacs/packages.texi @@ -626,7 +626,7 @@ Another interface over patch. CVS frontend. @item prog-modes -Miscellaneous single-file lisp files for various programming languages. +Miscellaneous Lisp libraries for various programming languages. @item scheme Front-end support for Inferior Scheme. @@ -635,11 +635,10 @@ Front-end support for Inferior Scheme. Support for editing shell scripts. @item vc -Version Control for Free systems. +Version control for free systems. @item vc-cc -Version Control for ClearCase. This package must be installed prior -to building XEmacs [broken as of XEmacs 20.5-beta19]. +Version control for ClearCase. @item vhdl Support for VHDL. diff --git a/nt/ChangeLog b/nt/ChangeLog index 90971b2..a4aee30 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2000-12-05 Martin Buchholz + + * XEmacs 21.2.38 is released. + 2000-11-14 Martin Buchholz * XEmacs 21.2.37 is released. diff --git a/src/ChangeLog b/src/ChangeLog index e398197..ff179da 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -2654,6 +2654,310 @@ (Vcharset_thai_tis620): Likewise. (Vcharset_katakana_jisx0201): Likewise. +2000-12-05 Martin Buchholz + + * XEmacs 21.2.38 is released. + +2000-12-05 Martin Buchholz + + * symsinit.h: Add init_postgresql_from_environment. + +2000-12-04 Yoshiki Hayashi + + * regex.c: Convert to clean C. + +2000-12-05 Dan Holmsand + + * realpath.c: + Don't #include sysfile.h. Revert to duplicating PATH_MAX + initialization. + (sys_readlink): renamed to system_readlink to avoid conflict with + the other sys_readlink. + +2000-12-04 Hiroaki Abe + + * dumper.c (pdump_file_get): Correct uses of pdump_fd. + +2000-12-04 Stephen J. Turnbull + + * postgresql.c (init_postgresql_from_environment): new function. + (vars_of_postgresql): Move code initializing Lisp variables out and + into init_postgresql_from_environment. + emacs.c (main_1): Call init_postgresql_from_environment if and only + if running a dumped XEmacs. + +2000-08-31 Dan Holmsand + + * buffer.c: Make find-file-compare-truenames default to true on + windows. + + * realpath.c (win32_abs_start): + (cygwin_readlink): + (win32_readlink): New functions. + (xrealpath): Return really real filenames on windows. + + * fileio.c (Ffile_truename): Make file-truename work on windows. + +2000-11-29 Didier Verna + + * faces.c (MAYBE_UNFROB_BACKGROUND_PIXMAP): new macro. + * faces.c (update_face_cachel_data): use it. + * faces.c (add_face_cachel): use it. Complete background pixmap + frobbing in face cache if `update_face_cachel_data' has not done so. + +2000-11-29 Yoshiki Hayashi + + * search.c (string_match_1): Don't set last_thing_searched + when search failed. + +2000-11-27 Yoshiki Hayashi + + * buffer.c: Include casetab.h + (common_init_complex_vars_of_buffer): Use new case-table object. + * buffer.h: Include casetab.h + * buffer.h (MAKE_TRT_TABLE): Use generic char-table. + (DOWNCASE_TABLE_OF): Ditto. + * bufslots.h: Remove char-tables and add case-table. + * casetab.c: Include casetab.h + (CASE_TABLE_P): Removed. + (mark_case_table): New function. + (allocate_case_table): New function. + (Fcase_table_p): Use new case-table. + (case_table_char): New function. + (Fget_case_table): Ditto. + (Fput_case_table): Ditto. + (Fput_case_table_pair): Ditto. + (Fcopy_case_table): Ditto. + (Fcurrent_case_table): Return case-table. + (Fstandard_case_table): Return case-table. + (Fset_case_table): Fix doc-string. + (set_case_table): Use case-table + (syms_of_casetab): DEFSUBR new functions. + (complex_vars_of_casetab): Set up standard case-table. + * casetab.h: New file. + * editfns.c: Include casetab.h + (Fcompare_buffer_substrings): Use case-table. + * inline.c: Include casetab.h + * lisp.h: Remove bogus extern. + * lrecord.h (lrecord_type): Add lrecord_type_case_table. + * search.c: Include casetab.h + (TRANSLATE_ASCII): Removed. + (TRANSLATE): Unconditionally translate character. + (looking_at_1): Use case-table. + (string_match_1): Ditto. + (fast_string_match): Ditto. + (search_command): Ditto. + (search_buffer): Separate boyer_moore. Check whether + boyer_moore is poosible. + (simple_search): New function. + (boyer_moore): Separated from search_buffer. Translate char. + +2000-11-24 Yoshiki Hayashi + + * regex.c (RE_TR_ASCII): Removed. + (RE_TRANSLATE): Unconditionally use TRT_TABLE. + (PATFETCH): Call PATFETCH_RAW. + (PATFETCH_RAW): Fetch Emchar. + (PATUNFETCH): Decrement charptr. + (GET_BUFFER_SPACE): Rename b to buf_end. + (BUF_PUSH): Ditto. + (BUF_PUSH_2): Ditto. + (BUF_PUSH_3): Ditto. + (EXTEND_BUFFER): Ditto. + (SET_LIST_BIT): Ditto. + (regex_compile): Ditto. Translate non ASCII char. + (compile_range): Ditto. + (re_search_2): Ditto. + (re_match_2_internal): Compare Emchar. + (bcmp_translate): Ditto. + +2000-11-29 Stephen J. Turnbull + + * lisp.h (basic char/int typedefs): comment improvement. + +2000-11-24 Stephen J. Turnbull + + * emacs.c (main_1): unconditional pdump unstomping; don't save and + unstomp inhibit_site_lisp. Improve comments. + +2000-11-22 Stephen J. Turnbull + + * mule-charset.c (Fcharset_property): improve type checking, comments. + +2000-11-28 Andy Piper + + * redisplay-output.c (redisplay_output_subwindow): make sure we do + clipped display for windows in the gutter also. + (redisplay_display_boxes_in_window_p): change semantics of return + codes to be more intuitive. + + * gutter.h: declare display_boxes_in_gutter_p. + + * gutter.c (display_boxes_in_gutter_p): new function for + redisplay. + +2000-11-22 Andy Piper + + * glyphs-x.c (image_instantiator_format_create_glyphs_x): change + autodetect domain. + +2000-11-21 Yoshiki Hayashi + + * callproc.c (Fold_call_process_internal): + * gpm.c (Freceive_gpm_event): + (tty_get_foreign_selection): Might be just warning supression. + * fileio.c (Fwrite_region_internal): + (Fset_visited_file_modtime): + * keymap.c (event_matches_key_specifier_p): + Initialize GCPROed variable. + + * menubar-x.c (command_builder_find_menu_accelerator): + Initialize before use. + +2000-11-23 Andy Piper + + * unexcw.c (unexec): make the resulting executable executable. + +2000-11-21 Martin Buchholz + + * doc.c (get_doc_string): + Use size_t, not int, for result of XSTRING_LENGTH. + + * cmds.c (Fdelete_char): + * cmds.c (Fpoint_at_eol): + * cmds.c (Fself_insert_command): + Use EMACS_INT, not int, for result of XINT. + Someday, someone will want to insert more than 2**31 identical characters. + + * cmds.c (Fdelete_char): + * cmds.c (Fdelete_backward_char): + * syntax.c (Fforward_word): + * syntax.c (Fforward_comment): + Make COUNT argument optional, for consistency with forward-char et al. + +2000-11-22 Martin Buchholz + + * lisp.h: + * print.c (long_to_string): + Return a useful value: the pointer at end of data written. + + * doprnt.c: + Use `static const char * const' for constant strings. + (union printf_arg): Delete `i', `ui' members. + (get_doprnt_args): + (emacs_doprnt_1): + Fix LP64 platform bug: (format "%d" most-positive-fixnum) ==> "-1" + Do all printf-ing via the `l' specifier. + Use EMACS_INT instead of int. + Optimize. + +2000-11-20 Didier Verna + + * faces.c (update_face_cachel_data): don't frob the background + pixmap when the window is being created. The face is needed but + does not exist yet. + +2000-11-20 Andy Piper + + * unexcw.c (copy_executable_and_dump_data_section): Only do bss + messing with a debug environment. + +2000-11-20 Martin Buchholz + + * emacs.c (__sti__iflPNGFile_c___): Pedantically correct prototype. + +2000-11-20 Martin Buchholz + + * casetab.c (Fcase_table_p): Fix compile error and crash. + +2000-11-18 Philip Aston + + * s/cygwin32.h: Cygwin has SVR4-like pty support. + +2000-11-18 Martin Buchholz + + * fileio.c (Fexpand_file_name): GCPRO bug! Protect `handler'. + * filelock.c (lock_file): GCPRO bug! Initialize all GCPROed vars! + +2000-11-17 Martin Buchholz + + * config.h.in: Define HAVE_ELF_H if elf.h exists. + * unexelf.c: Use HAVE_ELF_H. + * unexelfsgi.c: Fix bug with dumped xemacs stdout/stderr not working. + I copied FSF Emacs 20.7 unexelf.c to unexelfsgi.c and ANSIfied it. + Max Matveev removed non-SGI-relevant parts and tested. + Greg Harrington provided a machine + for testing. + So this is an unexelfsgi.c from a different line of development. + +2000-11-16 Yoshiki Hayashi + + * regex.c (RE_TR_ASCII): New function. + (RE_TRANSLATE): Call it. + +2000-11-16 Yoshiki Hayashi + + * buffer.h (TRT_TABLE_OF): Remove assert. + (IN_TRT_TABLE_DOMAIN): Removed. + +2000-11-16 Gunnar Evermann + + * free-hook.c (log_gcpro): + (show_gcprohist): Add support for GCPRO5. + +2000-11-08 Stephen J. Turnbull + + * emacs.c (main_1): Improve -sd error message when --pdump=no. + +2000-11-16 Olivier Galibert + + * symeval.h: Declare flush_all_buffer_local_cache. + + * symbols.c: Change XD_LO_RESET_NIL into XD_LISP_OBJECTs. + (flush_buffer_local_cache): Added. + (flush_all_buffer_local_cache): Added. + + * lrecord.h: Remove unused XD_LO_RESET_NIL. + + * dumper.c (pdump_register_sub): Remove unused XD_LO_RESET_NIL. + (pdump_dump_data): Ditto. + (pdump_reloc_one): Ditto. + (pdump): Remove unused pdump_qnil. Flush buffer local caches + before dumping. + + +2000-11-14 Yoshiki Hayashi + + * buffer.c: Remove if 0'ed entry. + * buffer.h: Rewrite TRT to use char-table. + * bufslots.h: Remove mirror tables. + * casetab.c: Remove mirror tables. + (CASE_TABLE_P): New macro. + (Fcase_table_p): Element of a case table is string or char-table. + (make_mirror_trt_table): Removed. + (set_case_table): Setup char-table from strings for backward + compatibility. + * dired.c (Fdirectory_files): + * dired-msw.c: (mswindows_get_files): + * lisp.h: Change prototype of re_pattern_buffer. + * regex.c: (RE_TRANSLATE): New macro. + (TRANSLATE_P): Ditto. + Change translate to type RE_TRANSLATE_TYPE. + * regex.h: Define RE_TRANSLATE_TYPE + * search.c (TRANSLATE): New macro. + (TRANSLATE_ASCII): New macro. + Translate table is changed to Lisp_Object. + (signal_failure): Inhibit return. + +2000-11-14 Yoshiki Hayashi + + * device-msw.c: + * eldap.c: + * event-Xt.c: + * event-stream.c: + * print.c: + Do UNGCPRO before return. + 2000-11-14 Martin Buchholz * XEmacs 21.2.37 is released. @@ -2696,7 +3000,7 @@ (recompute_one_cached_specifier_in_window): always recompute if flag set. (recompute_one_cached_specifier_in_frame): ditto. - + * specifier.h (struct specifier_caching): add recompute flag. 2000-10-24 Andy Piper @@ -2751,9 +3055,9 @@ * minibuf.c (Fall_completions): Delete old non-functional code for FSF fourth argument. - * frame.c (frame_matches_frame_spec): + * frame.c (frame_matches_frame_spec): Renamed from `frame_matches_frametype'. Update all callers. - (device_matches_device_spec): + (device_matches_device_spec): Renamed from 'device_matches_console_spec'. Update all callers. * doc.c (Fsubstitute_command_keys): @@ -2762,7 +3066,7 @@ * casetab.c (check_case_table): Simpler code. * window.c (Freplace_buffer_in_windows): - Give this the same WHICH-FRAMES and WHICH-DEVICES parameters + Give this the same WHICH-FRAMES and WHICH-DEVICES parameters (and similar implementation) as Fdelete_windows_on. Update all callers. @@ -3147,15 +3451,15 @@ * sgiplay.c (play_internal): C++ compilability. * alloc.c (SWEEP_FIXED_TYPE_BLOCK): Remove unused var `SFTB_prev'. - * callproc.c (Fold_call_process_internal): + * callproc.c (Fold_call_process_internal): Remove unused vars `env', `first'. - * scrollbar.c (update_scrollbar_instance): + * scrollbar.c (update_scrollbar_instance): #### unused var `current_window'. * redisplay-tty.c: Put currently unused vars insert_mode_on, etc. within #ifdef NOT_YET. * emacs.c: #### unused vars `initial_argc', `initial_argv'. * dialog-x.c (dbox_descriptor_to_widget_value): ### unused var `title'. - * specifier.c (specifier_instance): + * specifier.c (specifier_instance): #### unused var `tag'. Use WINDOW_BUFFER, FRAME_DEVICE instead of their expansion. @@ -3233,9 +3537,9 @@ 2000-10-17 Martin Buchholz * miscplay.c (sndcnv8S_2mono): - (sndcnv2monounsigned): - (sndcnvULaw_2linear): - (sndcnv16swap): + (sndcnv2monounsigned): + (sndcnvULaw_2linear): + (sndcnv16swap): Remove implementation-defined behavior. 2000-10-12 Martin Buchholz @@ -3314,8 +3618,8 @@ (BYTE_ASCII_P): Use bit ops for char-signedness safety. (BYTE_C0_P): Use bit ops for char-signedness safety. (BYTE_C1_P): Use bit ops for char-signedness safety. - (CHARSET_BY_LEADING_BYTE): - (CHARSET_BY_ATTRIBUTES): + (CHARSET_BY_LEADING_BYTE): + (CHARSET_BY_ATTRIBUTES): Always use inline function. Use type_checking_assert. Hide chlook. @@ -3324,7 +3628,7 @@ Modify to work with both ASCII and non-ASCII characters. Improve docs and variable names. Replace over-clever fall-through switch with a simple loop. - (Lstream_get_emchar_1): + (Lstream_get_emchar_1): Replace over-clever fall-through switch with a simple loop. * menubar-x.c (menu_item_descriptor_to_widget_value_1): @@ -3405,8 +3709,8 @@ * s/decosf1-3.h: Remove #include of stropts.h * s/ptx.h: Remove #include of stropts.h * s/usg5-4.h: Remove #include of stropts.h - * sysproc.h: - * config.h.in: + * sysproc.h: + * config.h.in: Use stropts.h, not sys/stropts.h. Use strtio.h, not sys/strtio.h. @@ -3593,12 +3897,12 @@ called_from_delete_device bogus arg, and hence, remove this function. Just use other_visible_frames(). - * window.c (Fnext_window): + * window.c (Fnext_window): Prettify docstring. Since next_frame() is guaranteed to return a frame, remove check for nil inserted in previous patch. - (Fprevious_window): - Prettify docstring. + (Fprevious_window): + Prettify docstring. Make code look more like Fnext_window. (window_loop): Respect the `console' arg when iterating through windows. @@ -3663,7 +3967,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 Warning fix. Avoid buffer overrun on very long file name. - * input-method-xlib.c (XIM_init_device): + * input-method-xlib.c (XIM_init_device): 6th parameter of XRegisterIMInstantiateCallback has different pointer types on different OSes, so simply cast to (void *). @@ -3674,7 +3978,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 Simply return NULL for compatibility with dlopen. * sysdll.c: Conform to XEmacs coding standards. - * sysdep.c (get_pty_max_bytes): + * sysdep.c (get_pty_max_bytes): Support pty input lines longer than 512 bytes on HP-UX 10.20. 2000-08-31 Martin Buchholz @@ -3778,7 +4082,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * data.c (indirect_function): Rename ERRORP to non-misleading VOID_FUNCTION_ERRORP. - * eval.c (function_argcount): + * eval.c (function_argcount): Use original function when signaling errors. 2000-08-18 Andy Piper @@ -3855,7 +4159,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 of the code). remove duplicate header includes. * s\cygwin32.h, s\mingw32.h: remove stray NO_ARG_ARRAY. - + * s\cygwin32.h, s\mingw32.h, m\windowsnt.h: don't define LOAD_AVE_TYPE/LOAD_AVE_CVT because we have no useful load average. @@ -3880,7 +4184,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * Makefile.in.in (release): Remove stray @. - + * buffer.c (directory_is_current_directory): * dired-msw.c (mswindows_get_files): * dired.c: @@ -3892,18 +4196,18 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 (e.g. SCO). * callproc.c (egetenv): GC docs. - + * console-msw.h: * console-msw.h (struct mswindows_dialog_id): * lrecord.h (lrecord_type): New object for use with MSW dialogs. - + * console.h (struct console_methods): New enable/disable frame methods, for proper modal dialogs. - + * device-msw.c (msprinter_default_printer): Fix to follow proper Mule conventions. - + * device-msw.c: * device-msw.c (signal_open_printer_error): * device-msw.c (msprinter_init_device): @@ -3920,7 +4224,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * extents.c (Fextents_at): * extents.c (symbol_to_glyph_layout): [[[[2]]]] Use structured errors. - + * dialog-msw.c: * dialog-msw.c (mswindows_is_dialog_msg): * dialog-msw.c (mark_mswindows_dialog_id): @@ -3929,7 +4233,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * dialog-msw.c (syms_of_dialog_mswindows): Define new object to clean up marking; use it as a dialog identifier. Call new delete-dialog-box-hook. - + * dialog-x.c (dbox_selection_callback): * dialog-x.c (dbox_descriptor_to_widget_value): * dialog-x.c (x_make_dialog_box_internal): @@ -3940,17 +4244,17 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * dialog.c (syms_of_dialog): * dialog.c (vars_of_dialog): Define new delete-dialog-box-hook, for use w/modal dialog boxes. - + * eval.c: * eval.c (signal_call_debugger): when noninteractive, output stack traces on the console instead of in a (never-seen) buffer. - + * eval.c (signal_type_error): * eval.c (invalid_argument_2): * lisp.h: new funs for use w/structured errors. - + * event-Xt.c: * event-Xt.c (x_to_emacs_keysym): * event-Xt.c (describe_event): @@ -3961,10 +4265,10 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * event-msw.c (vars_of_event_mswindows): rename {x,mswindows}-debug-events to debug-{}-events for consistency with other debug-foo variables. - + * event-stream.c: document next-event more clearly. - + * fileio.c (Ffile_name_directory): * fileio.c (Ffile_name_nondirectory): * fileio.c (Funhandled_file_name_directory): @@ -3989,7 +4293,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * fileio.c (auto_save_1): (1). (2). fix up gcpro's. - + * frame-msw.c: * frame-msw.c (mswindows_init_frame_1): * frame-msw.c (mswindows_enable_frame): @@ -3999,24 +4303,24 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * frame-msw.c (console_type_create_frame_mswindows): (2). implement new enable/disable frame methods. - + * frame-x.c: * frame-x.c (x_enable_frame): * frame-x.c (console_type_create_frame_x): implement new enable/disable frame methods. - + * frame.c: * frame.c (Fdisable_frame): * frame.c (syms_of_frame): * frame.h (struct frame): implement new enable/disable frame methods/functions. - + * general-slots.h: add initial-focus. - + * glyphs-msw.c (mswindows_widget_instantiate): comment that initial-focus should be implemented. - + * glyphs-widget.c: * glyphs-widget.c (check_valid_instantiator): * glyphs-widget.c (check_valid_orientation): @@ -4039,7 +4343,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 (2). support (unimplemented) keyword initial-focus. reindent long macros. - + * glyphs-x.c (x_redisplay_widget): * glyphs-x.c (x_button_instantiate): * glyphs-x.c (x_button_redisplay): @@ -4057,40 +4361,40 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * menubar-x.c (menu_item_descriptor_to_widget_value_1): add new flag to gui-parsing routines to indicate whether accelerator specs should be supported. - + * glyphs.c (syms_of_glyphs): use DEFSYMBOL. - + * glyphs.h (struct Lisp_Image_Instance): * glyphs.h (IMAGE_INSTANCE_WANTS_INITIAL_FOCUS): add initial-focus flag. - + * gui.c: * gui.c (syms_of_gui): * gui.c (vars_of_gui): clean up menu-no-selection-hook. - + * gui.h: support delete-dialog-box-hook. - + * lread.c (Fload_internal): * lread.c (locate_file_in_directory_mapper): (1). - + * lrecord.h: * lrecord.h (struct toolbar_button): * lrecord.h (syms_of_toolbar): document how to create a new object. - + * menubar-msw.c (mswindows_char_is_accelerator): may be called on frames w/o menus. * menubar.c (vars_of_menubar): clean up :filter docs. - + * nt.c (readdir): * ntproc.c: (1). - + * process-nt.c: * process-nt.c (validate_signal_number): * process-nt.c (signal_cannot_launch): @@ -4101,7 +4405,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * process-nt.c (syms_of_process_nt): (2). delete quote-handling. call new lisp code that does it better. - + * process-unix.c (connect_to_file_descriptor): * process-unix.c (allocate_pty): * process-unix.c (unix_send_process): @@ -4109,11 +4413,11 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * process-unix.c (unix_open_network_stream): * process-unix.c (unix_open_multicast_group): (1). (2). - + * process.c: * process.c (Fstart_process_internal): (2). need to canonicalize process path even if absolute. - + * select-msw.c (symbol_to_ms_cf): * select-msw.c (ms_cf_to_symbol): * select-msw.c (cf_is_autofreed): @@ -4122,35 +4426,35 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * select.c (syms_of_select): * select.h: support dibv5, fix bugs. (from Mike Alexander) - + * select.c (Fget_selection_internal): * select.c (select_convert_out): - + * sysdep.c: * sysdep.c (xemacs_stat): renamed. - + * sysdep.c (mkdir): * sysdep.c (rmdir): but keep original stat() here because we provide encapsulation around these funs. - + * sysfile.h: * sysfile.h (fstat): remove stat garbage. - + * syswindows.h: fix X/MSW conflict. don't include tchar.h. it's inappropriate because it makes compile-time distinctions when we want runtime distinctions. (we provide our own tchar replacements) - + * toolbar.c: use default object printer for toolbar-button. - + * unexcw.c: make sure we don't encapsulate. - + * window.c (vars_of_window): emphasize that temp-buffer-show-hook is obsolete. @@ -4159,16 +4463,16 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * glyphs.c (image_instance_hash): HASH2 wants EMACS_INT args. (Fimage_instance_subwindow_id): make_int wants EMACS_INT arg. - * events.c (Fevent_timestamp_lessp): + * events.c (Fevent_timestamp_lessp): Not 64-bit clean. Use EMACS_INT, not int. 2000-06-05 Andrew Begel * lrecord.h (lrecord_types): Changed lrecord_type_count to an unsigned int and changed the last enum to - lrecord_type_last_built_in_type. + lrecord_type_last_built_in_type. (lrecord_implementations_table): changed prototype to know how - long the array is supposed to be. + long the array is supposed to be. (lrecord_type_count): new unsigned int to keep track of the current number of lisp lrecord types. (DEFINE_EXTERNAL_LRECORD): @@ -4200,14 +4504,14 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 2000-08-03 Martin Buchholz - * callproc.c (Fcall_process_internal): - (Fcall_process_internal): + * callproc.c (Fcall_process_internal): + (Fcall_process_internal): * process-unix.c (unix_create_process): Save and restore the value of errno, so that error messages are accurate. 2000-08-01 Martin Buchholz - * elhash.c (print_hash_table): + * elhash.c (print_hash_table): Fix printing of hash tables to also use `key-and-value' instead of `t'. Prettify docstrings and indentation. @@ -4261,7 +4565,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * config.h.in: Make existence of s&m files optional. - + * s/bsd386.h: Remove HAVE_GETLOADAVG. * s/freebsd.h: Remove HAVE_GETLOADAVG. * s/gnu.h: Remove HAVE_GETLOADAVG. @@ -4341,7 +4645,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * window.c (Fset_window_configuration): add comment. - * redisplay-output.c (compare_runes): + * redisplay-output.c (compare_runes): (redisplay_output_subwindow): redisplay rather than update subwindow. (redisplay_output_layout): ditto. @@ -4491,7 +4795,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * *.[ch] (XSETOBJ): remove unused middle argument. lisp-disunion.h: correct wrap_object() to one argument. - + 2000-07-15 Ben Wing * s/cygwin32.h: @@ -4507,7 +4811,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * Makefile.in.in (sheap_objs): * Makefile.in.in (objs): added win32.o, cosmetic cleanups. - + * alloc.c (Fmake_byte_code): [[[1]]]: Changes for new LIST_LOOP, EXTERNAL_LIST_LOOP, etc. macros which declare their own args now. @@ -5141,8 +5445,8 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 (msprinter_canonicalize_device_connection): Added. * device-msw.c (msprinter_default_printer): - (Fmswingows_get_default_printer): - (signal_enum_priner_error): + (Fmswingows_get_default_printer): + (signal_enum_priner_error): (Fmswingows_printer_list): Added. 2000-07-19 Martin Buchholz @@ -5151,7 +5455,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 2000-07-19 Martin Buchholz - * select-x.c (x_handle_selection_request): + * select-x.c (x_handle_selection_request): Text selected in xemacs and pasted into xterm failed to appear. Spelling fixes and cosmetic changes. @@ -5250,17 +5554,17 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * select-x.c (motif_clipboard_cb): Use select_convert_out. Rewrote error checking - previously this called abort! - + * select-x.c (x_own_selection): Changed comment. - + * select-x.c (x_handle_selection_request): Use select_convert_out. Don't mess with selection-alist; it's an internal variable of select.c. - + * select-x.c (x_get_foreign_selection): Use select_convert_in. - + * select-x.c (x_handle_selection_clear): Use get-selection-timestamp, rather than messing with selection-alist. - + * select-msw.c (mswindows_get_foreign_selection): Use TO_INTERNAL_FORMAT rather than hacking. @@ -5282,7 +5586,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * console.h (available_selection_types_method): New. * console.h (register_selection_data_type_method): New. * console.h (selection_data_type_name): New. - + * console-msw.h (mswindows_destroy_selection): Declare it. New function & alist to track GlobalAlloc()'d handles that need releasing when the clipboard data gets replaced or emptied. @@ -5291,7 +5595,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * lisp.h, general.c (Qappend): New symbol representing a `how-to-add' mode. - + * select.c (own-selection-internal): * select.c (selection-exists-p): * select.c (available-selection-types): New. @@ -5358,8 +5662,8 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 default minibuffer frame on a printer device. * frame-msw.c (apply_dc_geometry): Added. - (msprinter_start_page): - (msprinter_init_frame_3): + (msprinter_start_page): + (msprinter_init_frame_3): (msprinter_eject_page): Use it. * console-msw.h (struct msprinter_frame): Added pix_left and top, @@ -5379,7 +5683,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 2000-07-09 Martin Buchholz * config.h.in: Remove SMART_INCLUDE hackery. - + PostgreSQL hacking: * config.h.in: Don't use SMART_INCLUDE. @@ -5417,7 +5721,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * device-msw.c (hash_devmode): * device-msw.c (Fmsprinter_settings_despecialize): use Qmswindows_tstr, not Qctext. - + * vm-limit.c (check_memory_limits): avoid infinite loop printing warning messages. @@ -5459,7 +5763,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * console-msw.h (struct mswindows_device): Removed unnecessary cached device geometry values. Added update_tick and an accessor macro. - (Lisp_Devmode): Added lrecord declaration. + (Lisp_Devmode): Added lrecord declaration. (struct msprinter_device): Contain devmode as a Lisp object. Added mswindows_get_selected_frame_hwnd(); @@ -5468,27 +5772,27 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * device-msw.c (mswindows_init_device): Do not initialize geometry cache. Initialize update tick. (mswindows_device_system_metrics): Ask the device for its geometry. - (global_free_2_maybe): - (devmode_to_hglobal): - (handle_printer_changes): - (ensure_not_printing): - (print_dialog_worker): - (Fmsprinter_print_setup_dialog): - (Fmsprinter_print_dialog): - (plist_get_margin): - (plist_set_margin): + (global_free_2_maybe): + (devmode_to_hglobal): + (handle_printer_changes): + (ensure_not_printing): + (print_dialog_worker): + (Fmsprinter_print_setup_dialog): + (Fmsprinter_print_dialog): + (plist_get_margin): + (plist_set_margin): (Fmsprinter_page_setup_dialog): Added functions. - (sync_printer_with_devmode): - (handle_devmode_changes): - (Fmsprinter_get_settings): - (Fmsprinter_select_settings): + (sync_printer_with_devmode): + (handle_devmode_changes): + (Fmsprinter_get_settings): + (Fmsprinter_select_settings): (Fmsprinter_apply_settings): - (allocate_devmode): - (Fmsprinter_settings_copy): - (Fmsprinter_settings_despecialize): - (print_devmode): - (finalize_devmode): - (equal_devmode): + (allocate_devmode): + (Fmsprinter_settings_copy): + (Fmsprinter_settings_despecialize): + (print_devmode): + (finalize_devmode): + (equal_devmode): (hash_devmode): Added functions (syms_of_device_mswindows): Init devmode lrecord class. @@ -5499,9 +5803,9 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * frame-msw.c (mswindows_get_selected_frame_hwnd): Added. (msprinter_init_frame_3): - (msprinter_frame_property): + (msprinter_frame_property): (msprinter_internal_frame_property_p): - (msprinter_frame_properties): + (msprinter_frame_properties): (msprinter_set_frame_properties): Removed 'orientation and 'duplex print job properties (will move to device settings). @@ -5609,26 +5913,26 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * nt.c (mswindows_stat): prefix mswindows_ instead of attempting to directly override the library functions. fix declarations. - + * nt.h: include syswindows.h. move some sysdep.h stuff here. - + * ntheap.h: include syswindows.h, not . * ntplay.c: clean up headers. - + * sysdep.c: clean up headers. - + * sysdep.c (sys_fstat): * sysdep.c (sys_stat): call mswindows versions when appropriate. - + * sysdep.h: move mswin decls to nt.h. - + * syswindows.h: add long comment describing appropriate use of the various windows headers. @@ -5641,21 +5945,21 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * Makefile.in.in (release): Correction to make sure xemacs.exe always dumped when correct. - + * alloca.c: * balloon_help.c: [[[[3]]]]: Conditionalize on actual problem, not WINDOWSNT. - + * buffer.c (set_buffer_internal): [[[[2]]]]: Remove HAVE_FEP code. * buffer.c (init_initial_directory): [3]. - + * bytecode.c: [[[[4]]]]: limits.h standardly included in lisp.h; remove from individual files. - + * callproc.c: * callproc.c (call_process_cleanup): * callproc.c (Fold_call_process_internal): @@ -5674,11 +5978,11 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * config.h.in: [2]. - + * console-msw.c: mswindows_message_outputted added for use in allowing startup errors on the console to be seen. - + * console-msw.c (msw_ensure_console_allocated): * console-msw.c (msw_output_console_string): * console-msw.c (DHEADER): @@ -5691,18 +5995,18 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * console-msw.c (DSYMBOL): * console-msw.c (DSYMNAME): Fix warnings. - + * console-stream.c (stream_init_console): Fix text/binary problems. - + * device-msw.c: * device-msw.c (mswindows_finish_init_device): * device-msw.c (mswindows_delete_device): [1]. - + * device.c (handle_asynch_device_change): [3]. - + * dgif_lib.c: * dgif_lib.c (DGifOpenFileName): * dgif_lib.c (DGifOpenFileHandle): @@ -5710,31 +6014,31 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * dgif_lib.c (DGifGetPixel): Added config.h/lisp.h, fix up includes. [1]. - + * dired-msw.c: [4]. - + * dired.c: * dired.c (file_name_completion): * dired.c (Ffile_attributes): * dired.c (syms_of_dired): [1]. - + * dumper.c: * dumper.c (pdump_file_unmap): * dumper.c (pdump_load): [1]. - + * editfns.c: * editfns.c (Ftemp_directory): * editfns.c (user_login_name): * editfns.c (Fuser_real_login_name): * editfns.c (get_home_directory): [1]. - + * elhash.c (finish_marking_weak_hash_tables): [[[[5]]]]: Fix GCC warnings. - + * emacs.c: * emacs.c (mswindows_handle_hardware_exceptions): * emacs.c (make_arg_list_1): @@ -5743,20 +6047,20 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * emacs.c (Fdump_emacs): [1]. Fix problems with nested crashes, add long comment. - + * event-Xt.c (init_event_Xt_late): [1]. - + * event-msw.c: * event-msw.c (mswindows_dde_callback): * event-msw.c (mswindows_handle_sticky_modifiers): * event-msw.c (mswindows_wnd_proc): [1]. [5]. - + * events.c (character_to_event): [1]. - + * fileio.c: * fileio.c (Ffile_name_directory): * fileio.c (Ffile_name_nondirectory): @@ -5773,63 +6077,63 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 [1]. [4]. [[[[7]]]]: Move CORRECT_DIR_SEPS to s\windowsnt.h. - + Expand getdefdir defn. Fix bogus rename() comment. [[[[6]]]]: Fix Windows includes w.r.t. removed nt\inc. Attempt to use standard XEmacs include files, e.g. sysfile.h, rather than system-specific includes. - + * fns.c: * fns.c (Fsubseq): [5]. [6]. - + * frame.c (vars_of_frame): [1]. - + * getloadavg.c: * getloadavg.c (getloadavg): [1]. [6]. #ifdef XEMACS not defined on Cygwin. Remove this; no need for it. (We don't use it elsewhere in the code; just add a comment.) - + * gif_io.c: [6]. Add config.h. - + * glyphs-msw.c: * glyphs-msw.c (mswindows_resource_instantiate): [1]. - + * glyphs-x.c (x_native_layout_instantiate): [5]. - + * gui-msw.c (Fmswindows_shell_execute): [1]. - + * insdel.c: [4]. - + * lisp.h: [4]. [5]. - + * lread.c (locate_file_in_directory_mapper): [1]. - + * lstream.c: [4]. - + * mem-limits.h: * mem-limits.h (get_lim_data): [1]. - + * menubar-msw.c: [4]. - + * ndir.h: [1]. - + * nt.c: * nt.c (getwd): * nt.c (closedir): @@ -5837,70 +6141,70 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * nt.c (mswindows_executable_type): [1]. [6]. Fix closedir() defn. - + * nt.h: [[[[8]]]]: *_OK defs moved to sysfile.h. - + * ntproc.c: [6]. [7]. - + * objects-x.c: [4]. - + * print.c: * print.c (std_handle_out_external): [1]. [4]. - + * process-nt.c: * process-nt.c (nt_create_process): [6]. try to fix process quoting somewhat. - + * process-unix.c (unix_create_process): [1]. - + * process.c: * process.c (vars_of_process): Add Vnull_device. - + * process.h: [1]. - + * realpath.c: * realpath.c (xrealpath): [1]. - + * redisplay-tty.c (init_tty_for_redisplay): [3]. - + * redisplay.c: [4]. [6]. - + * scrollbar-msw.c: [4]. - + * sheap.c: * sheap.c (more_static_core): * sheap.c (report_sheap_usage): [5]. [6]. - + * signal.c: * signal.c (alarm_signal): - [1]. [6]. - + [1]. [6]. + * sound.c: [6]. - + * strftime.c: * strftime.c (zone_name): [1]. [5]. - + * symsinit.h (init_sunpro): [1]. - + * syscommctrl.h: commctrl.h not in Cygwin b20.1. - + * sysdep.c: * sysdep.c (endif): * sysdep.c (sys_subshell): @@ -5916,58 +6220,58 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * sysdep.c (sys_rename): * sysdep.c (get_process_times_1): [1]. [6]. - + * sysdep.h: [1]. - + * sysdir.h: * sysdir.h (DIRENTRY_NONEMPTY): [1]. [6]. - + * sysdll.c (dll_init): * sysdll.h: [1]. - + * sysfile.h: [1]. [6]. [8]. added text/binary defs. - + * sysfloat.h: [1]. - + * sysproc.h: * sysproc.h (EDESTADDRREQ): * sysproc.h (poll_fds_for_input): [1]. [6]. - + * syspwd.h: [6]. - + * syssignal.h: [1]. - + * systime.h: [1]. [6]. - + * systty.h: [1]. - + * syswindows.h: [1]. Always define WIN32_LEAN_AND_MEAN. - + * unexcw.c (unexec): [5]. - + * unexec.c: * unexec.c (copy_text_and_data): * unexec.c (adjust_lnnoptrs): [1]. - + * unexnt.c: * unexnt.c (_start): [1]. - + 2000-06-07 Ben Wing * mule-mcpath.c, mule-mcpath.h: Removed. Old, crufty code that @@ -5983,13 +6287,13 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * s\cygwin32.h: [1]. [5]. Don't use extern with fun defs. - + * s\mingw32.h: [1]. [7]. Remove nt\inc include. Remove getdisk, getdefdir. (The former is unused, the latter expanded in fileio.h.) - + * s\windowsnt.h: * s\windowsnt.h (WIN32_NATIVE): * s\windowsnt.h (HAVE_STRCASECMP): @@ -6008,7 +6312,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * m\windowsnt.h: [1]. Remove bogus/unused NO_SOCK_SIGIO. - + 2000-06-08 Hrvoje Niksic * lisp.h (set_string_char): Call set_string_byte with a Bufbyte, @@ -6042,32 +6346,32 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 2000-05-30 Andy Piper - * window.c (allocate_window): - (make_dummy_parent): + * window.c (allocate_window): + (make_dummy_parent): (Fset_window_configuration): use new hashtable type. - * glyphs.h (IMAGE_UNSPECIFIED_GEOMETRY): - (struct image_instantiator_methods): + * glyphs.h (IMAGE_UNSPECIFIED_GEOMETRY): + (struct image_instantiator_methods): (struct Lisp_Image_Instance): make instance geometry signed. - * glyphs.c (instantiate_image_instantiator): - (image_instance_query_geometry): - (image_instance_layout): - (image_instance_layout): - (query_string_geometry): - (text_query_geometry): - (image_instantiate): - (image_instantiate): - (cache_subwindow_instance_in_frame_maybe): + * glyphs.c (instantiate_image_instantiator): + (image_instance_query_geometry): + (image_instance_layout): + (image_instance_layout): + (query_string_geometry): + (text_query_geometry): + (image_instantiate): + (image_instantiate): + (cache_subwindow_instance_in_frame_maybe): (subwindow_query_geometry): make instance geometry signed. - * glyphs-widget.c (widget_query_geometry): - (widget_layout): - (button_query_geometry): - (tree_view_query_geometry): - (tab_control_query_geometry): - (layout_query_geometry): - (layout_layout): + * glyphs-widget.c (widget_query_geometry): + (widget_layout): + (button_query_geometry): + (tree_view_query_geometry): + (tab_control_query_geometry): + (layout_query_geometry): + (layout_layout): (native_layout_layout): make instance geometry signed. 2000-05-29 Olivier Galibert @@ -6168,7 +6472,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * event-Xt.c: * event-Xt.c (vars_of_event_Xt): move modifier-keys-are-sticky to event-stream.c. - + * event-msw.c: * event-msw.c (mswindows_enqueue_mouse_button_event): * event-msw.c (key_needs_default_processing_p): @@ -6182,14 +6486,14 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * event-msw.c (mswindows_modifier_state): * event-msw.c (emacs_mswindows_handle_magic_event): implement sticky modifiers. - + * event-stream.c: * event-stream.c (vars_of_event_stream): move modifier-keys-are-sticky here. * lisp.h: add CHECK_FUNCTION. - + * rangetab.c: implement map-range-table. @@ -6220,16 +6524,16 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * buffer.c (dfc_convert_to/from_internal_format): * buffer.c (reinit_vars_of_buffer): Fix conversion functions to allow reentrancy. - + * console-msw.c: * console-msw.c (mswindows_output_last_error): New fun, generally useful -- output a human-readable version of GetLastError() on the console. - + * console-msw.h: * console-msw.h (struct mswindows_frame): Changes for DeferWindowPos. Declare mswindows_output_last_error(). - + * console-stream.c (stream_output_begin): * console-stream.c (stream_output_end): * console-stream.c (stream_output_vertical_divider): @@ -6237,10 +6541,10 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * console-stream.c (stream_flash): * console-stream.c (console_type_create_stream): Delete blank stream methods, not needed. - + * console.h (struct console_methods): Split begin/end methods into window and frame. - + * event-msw.c: * event-msw.c (mswindows_handle_paint): * event-msw.c (output_alt_keyboard_state): @@ -6248,32 +6552,32 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * event-msw.c (vars_of_event_mswindows): Comment about problems with ignored-expose. Define mswindows-debug-events; not really implemented. - + * frame-msw.c (mswindows_init_frame_1): random cleanups. - + * glyphs-msw.c: * glyphs-msw.c (begin_defer_window_pos): * glyphs-msw.c (mswindows_unmap_subwindow): * glyphs-msw.c (mswindows_map_subwindow): * glyphs-msw.c (mswindows_resize_subwindow): Use DeferWindowPos to reduce flashing when mapping/unmapping. - + * glyphs.c (make_image_instance_1): Fix crash. - + * gutter.c (Fredisplay_gutter_area): Use new begin/end methods. - + * lisp.h (Dynarr_new2): New creation fun. - + * redisplay-msw.c: * redisplay-msw.c (mswindows_frame_output_begin): * redisplay-msw.c (mswindows_frame_output_end): * redisplay-msw.c (console_type_create_redisplay_mswindows): New begin/end methods -- handle DeferWindowPos. - + * redisplay-output.c (redisplay_move_cursor): * redisplay-output.c (redraw_cursor_in_window): * redisplay-output.c (redisplay_update_line): @@ -6312,13 +6616,13 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * emacs.c (shut_down_emacs): * emacs.c (assert_failed): various improvements in fatal error handling. - + * eval.c: move preparing_for_armageddon to emacs.c. - + * lisp.h: declare fatal_error_in_progress. - + * print.c: * print.c (std_handle_out_external): * print.c (std_handle_out_va): @@ -6326,18 +6630,18 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * print.c (stdout_out): use console under mswin when no standard output. don't do code conversion during fatal error. - + * scrollbar.c (Fscrollbar_page_up): * scrollbar.c (Fscrollbar_page_down): fix missing else. reindent. 2000-05-11 Jan Vroonhof - Emergency fix. - - * glyphs.h (GLYPH_CACHEL_DESCENT): - (GLYPH_CACHEL_DESCENT): - (GLYPH_CACHEL_DESCENT): + Emergency fix. + + * glyphs.h (GLYPH_CACHEL_DESCENT): + (GLYPH_CACHEL_DESCENT): + (GLYPH_CACHEL_DESCENT): * glyphs.h (GLYPH_CACHEL_ASCENT): Match parameters to variables used in case these are inline functions. Use more absurd values to error check. @@ -6357,15 +6661,15 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 Define new fun `mswindows-message-box'. #### I will merge this into `popup-dialog-box'; just give me a bit of time. - + * general.c: * general.c (syms_of_general): Some new symbols used in `mswindows-message-box'. - + * glyphs.c: * glyphs.c (Fset_image_instance_property): put warning in this fun. - + * glyphs.h: * glyphs.h (GLYPH_CACHEL_WIDTH): * glyphs.h (GLYPH_CACHEL_ASCENT): @@ -6374,7 +6678,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 define error-checking versions to try to catch a bug i've seen -- redisplay gets in an infinite loop because the glyph width of the continuation glyph is 65535. - + * lisp.h: Extern message-box stuff. @@ -6383,7 +6687,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * window.c (Fset_window_configuration): Use EQUAL not EQ for subwindow caches to make them work a bit better. (Something is still very broken.) - + 2000-05-11 Yoshiki Hayashi @@ -6406,14 +6710,14 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * buffer.c (complex_vars_of_buffer): update modeline-format doc. - + * device.h: comment about how DFW_DEVICE should be merged with DOMAIN_DEVICE. - + * emacs.c: timeline of all released versions of Emacs, for use in creating authorship comments and in synching up. - + * glyphs-widget.c (image_instantiator_buttons): * glyphs-widget.c (image_instantiator_edit_fields): * glyphs-widget.c (image_instantiator_combo_box): @@ -6425,7 +6729,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * glyphs-widget.c (image_instantiator_layout): * glyphs-widget.c (image_instantiator_native_layout): rename decode_domain method to governing_domain. - + * glyphs.c: * glyphs.c (Fvalid_image_instantiator_format_p): doc update. * glyphs.c (add_entry_to_device_ii_format_list): @@ -6461,12 +6765,12 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * glyphs.c (specifier_vars_of_glyphs): totally rewrite the doc string for current-display-table. (Apparently Hrjove implemented in 1998 a design I wrote up in 1996, but didn't update the doc string.) - + * glyphs.h: clean up a doc string. * glyphs.h (governing_domain): * glyphs.h (struct image_instantiator_methods): changes for governing_domain stuff. - + * gutter.c: * gutter.c (Fgutter_specifier_p): * gutter.c (Fgutter_size_specifier_p): @@ -6476,16 +6780,16 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * objects.c (Ffont_specifier_p): * objects.c (Fface_boolean_specifier_p): doc strings moved to make-*-specifier. - + * redisplay.c (add_disp_table_entry_runes_1): * redisplay.c (generate_fstring_runes): * redisplay.c (screen): add random comments and doc strings. - + * specifier.c: * specifier.c (Fmake_specifier): major overhaul of this doc string. - + * specifier.c (Fvalid_specifier_domain_p): comment about the bogosity of image instances being domains. * specifier.c (decode_domain): @@ -6496,7 +6800,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 move doc string to make-generic-specifier. * specifier.c (VALID_SINGLE_DISPTABLE_INSTANTIATOR_P): rebackslashify. - + * specifier.h: * specifier.h (DOMAIN_FRAME): * specifier.h (DOMAIN_LIVE_P): @@ -6504,11 +6808,11 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 rebackslashify. add comments about problems with these macros. prototype for decode_domain. - + * toolbar.c: * toolbar.c (Ftoolbar_specifier_p): move doc string to `make-toolbar-specifier'. - + * window.c (window_unmap_subwindows_cache_mapper): ************************************************************* allow for nil. THIS SHOULD FIX A REAL CRASH THAT MANY PEOPLE @@ -6543,8 +6847,8 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 2000-05-08 Jan Vroonhof Patch by Bill Perry. - - * scrollbar.c (Fscrollbar_page_up): Conditionalize on type of call + + * scrollbar.c (Fscrollbar_page_up): Conditionalize on type of call back data instead of #ifdef. (Fscrollbar_page_down): ditto. @@ -6552,7 +6856,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * buffer.h: Kludge for defining Qmswindows_tstr. - + * nt.c: * nt.c (open_input_file): * nt.c (open_output_file): @@ -6562,11 +6866,11 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 which is bad because they are used by process-nt.c, and unexnt won't be around when portable dumping). Synched the above routines with FSF 20.6. - + * nt.h: Removed ifdef'd out bogus code. Fixed some prototypes. - + * nt.h (file_data): * nt.h (OFFSET_TO_RVA): * nt.h (RVA_TO_OFFSET): @@ -6574,7 +6878,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 Moved the memory-mapped-file structures, macros and prototypes here, to parallel nt.c. ntheap.h should really be removed entirely, and it's a non-portable-dumper specific file. - + * ntheap.h (round_to_next): Moved the memory-mapped-file structures, macros and prototypes to nt.h. @@ -6600,14 +6904,14 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 changes). Eliminate our old `nt-quote-process-args' mechanism. Synch up nt_create_process with FSF 20.6 sys_spawnve. Move compare_env here from ntproc.c. - + * process.c (Fprocess_send_region): Takes an optional fourth argument, BUFFER, which should fix some problems with call-process. - + * syscommctrl.h: Move ICC_BAR_CLASSES here from syswindows.h, to avoid a warning. - + * syswindows.h: Move ICC_BAR_CLASSES to syscommctrl.h. Add preliminary macros for MSWindows/Mule. More to come. @@ -6720,7 +7024,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 (XIMAGE_INSTANCE_DISPLAY_X): (XIMAGE_INSTANCE_DISPLAY_Y): (XIMAGE_INSTANCE_DISPLAY_WIDTH): - (XIMAGE_INSTANCE_DISPLAY_HEIGHT): new accessors. + (XIMAGE_INSTANCE_DISPLAY_HEIGHT): new accessors. remove subwindow_cachel structure and function references. (image_instance_type_to_mask): inline from glyphs.c @@ -6769,7 +7073,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * ntplay.c: use new syswindows.h and syscommctrl.h header. * nt.c: ditto. * console-msw.h: ditto. - + * redisplay-tty.c (tty_output_display_block): remove layout references. * glyphs-msw.c (mswindows_widget_instantiate): use the domain @@ -6805,7 +7109,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 (struct Lisp_Image_Instance): ditto. Add initialized flag. (IMAGE_INSTANCE_INITIALIZED): new accessor. (XIMAGE_INSTANCE_INITIALIZED): ditto. - + 2000-04-25 Andy Piper * glyphs-widget.c (image_instantiator_buttons): @@ -7008,27 +7312,27 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * console-msw.h (FRAME_MSWINDOWS_WIDGET_HASH_TABLE1): there are now three hash tables for callbacks. mswindows_enqueue_dispatch_event is no longer static. - + * dialog-x.c (maybe_run_dbox_text_callback): * dialog-x.c (dbox_descriptor_to_widget_value): switch to new cons3 form for callbacks. - + * glyphs-msw.c (mswindows_register_gui_item): * glyphs-msw.c (mswindows_widget_instantiate): * glyphs-msw.c (add_tree_item): * glyphs-msw.c (add_tab_item): new image instance parameter, so it can be passed to callback-ex. respect :callback-ex as well as :callback. - + * glyphs-widget.c (VALID_GUI_KEYWORDS): add :callback-ex. - + * glyphs.c (print_image_instance): prettify, e.g. now prints widget type. - + * gui-x.h: certain funs have new image instance parameter. - + * gui.c: * gui.c (get_gui_callback): * gui.c (gui_item_add_keyval_pair): @@ -7041,14 +7345,14 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * gui.c (syms_of_gui): recognize callback-ex in a number of places. also, fix the annoying "can't get out of yes-no dialog" bug. - + * gui.h: * gui.h (struct Lisp_Gui_Item): recognize callback-ex in a number of places. * menubar-x.c (menu_item_descriptor_to_widget_value_1): new parameter in button_item_to_widget_value. - + * glyphs-x.c (x_update_widget): * glyphs-x.c (x_button_instantiate): * glyphs-x.c (x_button_update): @@ -7058,16 +7362,16 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * glyphs-x.c (x_tab_control_instantiate): * glyphs-x.c (x_label_instantiate): new image instance parameter in various places. - + * event-Xt.c: * event-Xt.c (enqueue_Xt_dispatch_event): this fun gets exported. - + * gui-msw.c: * gui-msw.c (mswindows_handle_gui_wm_command): handle both :callback and :callback-ex, and generate our own event because it's one of the callback-ex arguments. - + * gui-x.c: * gui-x.c (popup_selection_callback): handle both :callback and :callback-ex, and generate our own @@ -7080,7 +7384,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * fns.c (Freplace_list): fix small typo in doc string. - + * lisp.h: declare enqueue_Xt_dispatch_event. @@ -7090,18 +7394,18 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 * buffer.c (Frecord_buffer): * buffer.c (syms_of_buffer): delete record-buffer-hook. - + * fns.c: * fns.c (Freplace_list): * fns.c (syms_of_fns): new primitive replace-list. - + * frameslots.h: slot for old buffer-alist. - + * lisp.h: exfun replace-list. - + * redisplay.c: * redisplay.c (redisplay_frame): * redisplay.c (syms_of_redisplay): @@ -7146,10 +7450,10 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 2000-04-20 Martin Buchholz - * filelock.c (fill_in_lock_file_name): + * filelock.c (fill_in_lock_file_name): ANSIfy. Check for IS_ANY_SEP instead of '/'. - (lock_file_1): + (lock_file_1): Avoid generating gratuitous garbage. Call user_login_name() directly. Never check errno without first seeing that system call failed. (unlock_file): Add GCPRO. @@ -7158,14 +7462,14 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 2000-04-19 Martin Buchholz - * sysdep.c (get_pty_max_bytes): + * sysdep.c (get_pty_max_bytes): Fix hangs on DEC OSF 4.0 when (process-send-string) sends strings longer than 252 bytes. * md5.c: Unconditionally include ANSI header - * glyphs-x.c (convert_EImage_to_XImage): - * lisp-union.h (union Lisp_Object): + * glyphs-x.c (convert_EImage_to_XImage): + * lisp-union.h (union Lisp_Object): Use consistently the syntax #ifdef FEATURE, not #if FEATURE. 2000-04-13 Yoshiki Hayashi @@ -7238,7 +7542,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 geometry. (mswindows_create_resized_bitmap): Ditto. (mswindows_create_resized_mask): Ditto. - + * redisplay-msw.c (mswindows_output_dibitmap): Stretch real mask and bitmap to their surface size. @@ -7271,7 +7575,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 2000-04-06 Colin Rafferty * lisp.h (FLEXIBLE_ARRAY_STRUCT_SIZEOF): Created. - + * fns.c (size_bit_vector): * alloc.c (size_vector): (make_vector_internal): @@ -7372,7 +7676,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 Note: Some of these were committed by accident as part of other patches. - + * regex.c (regex_compile): Avoid compiler warnings. * ntproc.c (sys_spawnve): Avoid compiler warnings. @@ -7422,7 +7726,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 new error code. Break compilation until finished. (play_sound_data): error code. - * nativesound.h (play_sound_file): + * nativesound.h (play_sound_file): (play_sound_data): Prototype in new header. 2000-03-31 Andy Piper @@ -7433,7 +7737,7 @@ Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245 2000-03-03 Jan Vroonhof - * scrollbar-x.c (x_update_vertical_scrollbar_callback): + * scrollbar-x.c (x_update_vertical_scrollbar_callback): (x_update_horizontal_scrollbar_callback): Return if no mirror was found. Scrollbar event probably belonged to some old config. diff --git a/src/buffer.c b/src/buffer.c index ce9f92b..953397a 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -70,6 +70,7 @@ Boston, MA 02111-1307, USA. */ #include "buffer.h" #include "chartab.h" +#include "casetab.h" #include "commands.h" #include "elhash.h" #include "extents.h" @@ -697,28 +698,6 @@ reset_buffer_local_variables (struct buffer *b, int first_time) } #include "bufslots.h" #undef MARKED_SLOT -#if 0 -#define STRING256_P(obj) \ - (STRINGP (obj) && XSTRING_CHAR_LENGTH (obj) == 256) - /* If the standard case table has been altered and invalidated, - fix up its insides first. */ - if (!(STRING256_P(Vascii_upcase_table) && - STRING256_P(Vascii_canon_table) && - STRING256_P(Vascii_eqv_table))) - { - Fset_standard_case_table (Vascii_downcase_table); - } - b->downcase_table = Vascii_downcase_table; - b->upcase_table = Vascii_upcase_table; - b->case_canon_table = Vascii_canon_table; - b->case_eqv_table = Vascii_eqv_table; -#ifdef MULE - b->mirror_downcase_table = Vmirror_ascii_downcase_table; - b->mirror_upcase_table = Vmirror_ascii_upcase_table; - b->mirror_case_canon_table = Vmirror_ascii_canon_table; - b->mirror_case_eqv_table = Vmirror_ascii_eqv_table; -#endif -#endif } @@ -2243,7 +2222,11 @@ doesn't work with hard links (nothing does). See also the variable `find-file-use-truenames'. */ ); +#if defined(CYGWIN) || defined(WIN32_NATIVE) + find_file_compare_truenames = 1; +#else find_file_compare_truenames = 0; +#endif DEFVAR_BOOL ("find-file-use-truenames", &find_file_use_truenames /* If this is true, then a buffer's visited file-name will always be @@ -2443,16 +2426,8 @@ common_init_complex_vars_of_buffer (void) defs->mode_name = QSFundamental; defs->abbrev_table = Qnil; /* real default setup by Lisp code */ - defs->downcase_table = Vascii_downcase_table; - defs->upcase_table = Vascii_upcase_table; - defs->case_canon_table = Vascii_canon_table; - defs->case_eqv_table = Vascii_eqv_table; + defs->case_table = Vstandard_case_table; #ifdef MULE - defs->mirror_downcase_table = Vmirror_ascii_downcase_table; - defs->mirror_upcase_table = Vmirror_ascii_upcase_table; - defs->mirror_case_canon_table = Vmirror_ascii_canon_table; - defs->mirror_case_eqv_table = Vmirror_ascii_eqv_table; - defs->category_table = Vstandard_category_table; #endif /* MULE */ defs->syntax_table = Vstandard_syntax_table; @@ -2515,10 +2490,7 @@ common_init_complex_vars_of_buffer (void) buffer_local_flags.generated_modeline_string = always_local_no_default; buffer_local_flags.keymap = resettable; - buffer_local_flags.downcase_table = resettable; - buffer_local_flags.upcase_table = resettable; - buffer_local_flags.case_canon_table = resettable; - buffer_local_flags.case_eqv_table = resettable; + buffer_local_flags.case_table = resettable; buffer_local_flags.syntax_table = resettable; #ifdef MULE buffer_local_flags.category_table = resettable; diff --git a/src/buffer.h b/src/buffer.h index 9923e9f..dc89a68 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -35,6 +35,9 @@ Boston, MA 02111-1307, USA. */ #include "character.h" #include "multibyte.h" +#include "casetab.h" +#include "chartab.h" + /************************************************************************/ /* */ /* definition of Lisp buffer object */ @@ -1366,54 +1369,33 @@ int map_over_sharing_buffers (struct buffer *buf, already guaranteed that the character values are all in the range 0 - 255. Bad lossage will happen otherwise. */ -# define MAKE_TRT_TABLE() Fmake_string (make_int (256), make_char (0)) -# define TRT_TABLE_AS_STRING(table) XSTRING_DATA (table) -# define TRT_TABLE_CHAR_1(table, ch) \ - string_char (XSTRING (table), (Charcount) ch) -# define SET_TRT_TABLE_CHAR_1(table, ch1, ch2) \ - set_string_char (XSTRING (table), (Charcount) ch1, ch2) - -#ifdef MULE -# define MAKE_MIRROR_TRT_TABLE() make_opaque (OPAQUE_CLEAR, 256) -# define MIRROR_TRT_TABLE_AS_STRING(table) ((Bufbyte *) XOPAQUE_DATA (table)) -# define MIRROR_TRT_TABLE_CHAR_1(table, ch) \ - ((Emchar) (MIRROR_TRT_TABLE_AS_STRING (table)[ch])) -# define SET_MIRROR_TRT_TABLE_CHAR_1(table, ch1, ch2) \ - (MIRROR_TRT_TABLE_AS_STRING (table)[ch1] = (Bufbyte) (ch2)) -#endif - -# define IN_TRT_TABLE_DOMAIN(c) (((EMACS_UINT) (c)) <= 255) - -#ifdef MULE -#define MIRROR_DOWNCASE_TABLE_AS_STRING(buf) \ - MIRROR_TRT_TABLE_AS_STRING (buf->mirror_downcase_table) -#define MIRROR_UPCASE_TABLE_AS_STRING(buf) \ - MIRROR_TRT_TABLE_AS_STRING (buf->mirror_upcase_table) -#define MIRROR_CANON_TABLE_AS_STRING(buf) \ - MIRROR_TRT_TABLE_AS_STRING (buf->mirror_case_canon_table) -#define MIRROR_EQV_TABLE_AS_STRING(buf) \ - MIRROR_TRT_TABLE_AS_STRING (buf->mirror_case_eqv_table) -#else -#define MIRROR_DOWNCASE_TABLE_AS_STRING(buf) \ - TRT_TABLE_AS_STRING (buf->downcase_table) -#define MIRROR_UPCASE_TABLE_AS_STRING(buf) \ - TRT_TABLE_AS_STRING (buf->upcase_table) -#define MIRROR_CANON_TABLE_AS_STRING(buf) \ - TRT_TABLE_AS_STRING (buf->case_canon_table) -#define MIRROR_EQV_TABLE_AS_STRING(buf) \ - TRT_TABLE_AS_STRING (buf->case_eqv_table) -#endif +#define MAKE_TRT_TABLE() Fmake_char_table (Qgeneric) +INLINE_HEADER Emchar TRT_TABLE_CHAR_1 (Lisp_Object table, Emchar c); +INLINE_HEADER Emchar +TRT_TABLE_CHAR_1 (Lisp_Object table, Emchar ch) +{ + Lisp_Object TRT_char; + TRT_char = get_char_table (ch, XCHAR_TABLE (table)); + if (NILP (TRT_char)) + return ch; + else + return XCHAR (TRT_char); +} +#define SET_TRT_TABLE_CHAR_1(table, ch1, ch2) \ + Fput_char_table (make_char (ch1), make_char (ch2), table); INLINE_HEADER Emchar TRT_TABLE_OF (Lisp_Object trt, Emchar c); INLINE_HEADER Emchar TRT_TABLE_OF (Lisp_Object trt, Emchar c) { - return IN_TRT_TABLE_DOMAIN (c) ? TRT_TABLE_CHAR_1 (trt, c) : c; + return TRT_TABLE_CHAR_1 (trt, c); } /* Macros used below. */ -#define DOWNCASE_TABLE_OF(buf, c) TRT_TABLE_OF (buf->downcase_table, c) -#define UPCASE_TABLE_OF(buf, c) TRT_TABLE_OF (buf->upcase_table, c) +#define DOWNCASE_TABLE_OF(buf, c) \ + TRT_TABLE_OF (XCASE_TABLE_DOWNCASE (buf->case_table), c) +#define UPCASE_TABLE_OF(buf, c) \ + TRT_TABLE_OF (XCASE_TABLE_UPCASE (buf->case_table), c) /* 1 if CH is upper case. */ diff --git a/src/bufslots.h b/src/bufslots.h index 660127b..2b622c7 100644 --- a/src/bufslots.h +++ b/src/bufslots.h @@ -121,33 +121,13 @@ Boston, MA 02111-1307, USA. */ /* Function to call when insert space past fill column. */ MARKED_SLOT (auto_fill_function); - /* Case table for case-conversion in this buffer. - This char-table maps each char into its lower-case version. */ - MARKED_SLOT (downcase_table); + /* Case table for case-conversion in this buffer. */ + MARKED_SLOT (case_table); + /* It contais following char-tables: */ + /* Char-table maps each char into its lower-case version. */ /* Char-table mapping each char to its upper-case version. */ - MARKED_SLOT (upcase_table); - /* Char-table for conversion for case-folding search. */ - MARKED_SLOT (case_canon_table); /* Char-table of equivalences for case-folding search. */ - MARKED_SLOT (case_eqv_table); - -#ifdef MULE - /* #### The purpose of these bogos is to deal with the fact that - the Boyer-Moore and regex searching routines don't know how to - deal with translating multi-byte characters. Fixing this is hard, - so instead we maintain these mirror tables that have all incorrect - mappings (see casetab.c) sanitized out of them. If we don't do - this, we may get weird and unpredictable results in the presence - of extended chars and extended mappings, and it could even lead - to a crash. - - #### Eventually we should deal with this properly. */ - MARKED_SLOT (mirror_downcase_table); - MARKED_SLOT (mirror_upcase_table); - MARKED_SLOT (mirror_case_canon_table); - MARKED_SLOT (mirror_case_eqv_table); -#endif /* #### This ought to be a specifier: */ /* Non-nil means do not display continuation lines. */ diff --git a/src/callproc.c b/src/callproc.c index 35a62a7..e5766ba 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -221,8 +221,8 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you buffer's current directory. We can't just have the child check for an error when it does the chdir, since it's in a vfork. */ - NGCPRO2 (current_dir, path); /* Caller gcprotects args[] */ current_dir = current_buffer->directory; + NGCPRO2 (current_dir, path); /* Caller gcprotects args[] */ current_dir = Funhandled_file_name_directory (current_dir); current_dir = expand_and_dir_to_file (current_dir, Qnil); #if 0 diff --git a/src/casetab.c b/src/casetab.c index 4bb1cde..656a592 100644 --- a/src/casetab.c +++ b/src/casetab.c @@ -30,29 +30,83 @@ Boston, MA 02111-1307, USA. */ /* Modified for Mule by Ben Wing. */ -/* #### We do not currently deal properly with translating non-ASCII - (including Latin-1!) characters under Mule. Getting this right is - *hard*, way fucking hard. So we at least preserve consistency by - sanitizing all the case tables to remove translations that would - get us into trouble and possibly result in inconsistent internal - text, which would likely lead to crashes. */ +/* Case table consists of four char-table. Those are for downcase, + upcase, canonical and equivalent respectively. + + It's entry is like this: + + downcase: a -> a, A -> a. + upcase: a -> A, A -> a. (The latter is for NOCASEP.) + canon: a -> a, A -> a. + eqv: a -> A, A -> a. +*/ #include #include "lisp.h" #include "buffer.h" #include "opaque.h" +#include "chartab.h" +#include "casetab.h" -Lisp_Object Qcase_tablep; -Lisp_Object Vascii_downcase_table, Vascii_upcase_table; -Lisp_Object Vascii_canon_table, Vascii_eqv_table; -#ifdef MULE -Lisp_Object Vmirror_ascii_downcase_table, Vmirror_ascii_upcase_table; -Lisp_Object Vmirror_ascii_canon_table, Vmirror_ascii_eqv_table; -#endif +Lisp_Object Qcase_tablep, Qdowncase, Qupcase; +Lisp_Object Vstandard_case_table; static void compute_trt_inverse (Lisp_Object trt, Lisp_Object inverse); +Lisp_Object case_table_char (Lisp_Object ch, Lisp_Object table); + +#define STRING256_P(obj) ((STRINGP (obj) && XSTRING_CHAR_LENGTH (obj) == 256)) + +static Lisp_Object +mark_case_table (Lisp_Object obj) +{ + Lisp_Case_Table *ct = XCASE_TABLE (obj); + + mark_object (CASE_TABLE_DOWNCASE (ct)); + mark_object (CASE_TABLE_UPCASE (ct)); + mark_object (CASE_TABLE_CANON (ct)); + mark_object (CASE_TABLE_EQV (ct)); + return Qnil; +} + +static void +print_case_table (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) +{ + Lisp_Case_Table *ct = XCASE_TABLE (obj); + char buf[200]; + if (print_readably) + error ("printing unreadable object #header.uid); + write_c_string ("#", ct->header.uid); + write_c_string (buf, printcharfun); +} + +static const struct lrecord_description case_table_description [] = { + { XD_LISP_OBJECT, offsetof (Lisp_Case_Table, downcase_table) }, + { XD_LISP_OBJECT, offsetof (Lisp_Case_Table, upcase_table) }, + { XD_LISP_OBJECT, offsetof (Lisp_Case_Table, case_canon_table) }, + { XD_LISP_OBJECT, offsetof (Lisp_Case_Table, case_eqv_table) }, + { XD_END } +}; -#define STRING256_P(obj) (STRINGP (obj) && XSTRING_CHAR_LENGTH (obj) == 256) +DEFINE_LRECORD_IMPLEMENTATION ("case-table", case_table, + mark_case_table, print_case_table, 0, + 0, 0, case_table_description, Lisp_Case_Table); + +static Lisp_Object +allocate_case_table (void) +{ + Lisp_Object val; + Lisp_Case_Table *ct = + alloc_lcrecord_type (Lisp_Case_Table, &lrecord_case_table); + + SET_CASE_TABLE_DOWNCASE (ct, Qnil); + SET_CASE_TABLE_UPCASE (ct, Qnil); + SET_CASE_TABLE_CANON (ct, Qnil); + SET_CASE_TABLE_EQV (ct, Qnil); + + XSETCASE_TABLE (val, ct); + return val; +} DEFUN ("case-table-p", Fcase_table_p, 1, 1, 0, /* Return t if OBJECT is a case table. @@ -60,28 +114,151 @@ See `set-case-table' for more information on these data structures. */ (object)) { - Lisp_Object down, up, canon, eqv; - if (!CONSP (object)) return Qnil; down = XCAR (object); object = XCDR (object); - if (!CONSP (object)) return Qnil; up = XCAR (object); object = XCDR (object); - if (!CONSP (object)) return Qnil; canon = XCAR (object); object = XCDR (object); - if (!CONSP (object)) return Qnil; eqv = XCAR (object); - - return (STRING256_P (down) - && (NILP (up) || STRING256_P (up)) - && ((NILP (canon) && NILP (eqv)) - || (STRING256_P (canon) - && (NILP (eqv) || STRING256_P (eqv)))) - ? Qt : Qnil); + if (CASE_TABLEP (object)) + return Qt; + else + { + Lisp_Object down, up, canon, eqv; + if (!CONSP (object)) + return Qnil; + down = XCAR (object); object = XCDR (object); + if (!CONSP (object)) + return Qnil; + up = XCAR (object); object = XCDR (object); + if (!CONSP (object)) + return Qnil; + canon = XCAR (object); object = XCDR (object); + if (!CONSP (object)) + return Qnil; + eqv = XCAR (object); + + return ((STRING256_P (down) + && (NILP (up) || STRING256_P (up)) + && ((NILP (canon) && NILP (eqv)) + || STRING256_P (canon)) + && (NILP (eqv) || STRING256_P (eqv))) + ? Qt : Qnil); + + } } static Lisp_Object check_case_table (Lisp_Object object) { + /* This function can GC */ while (NILP (Fcase_table_p (object))) object = wrong_type_argument (Qcase_tablep, object); return object; } +Lisp_Object +case_table_char (Lisp_Object ch, Lisp_Object table) +{ + Lisp_Object ct_char; + ct_char = get_char_table (XCHAR (ch), XCHAR_TABLE (table)); + if (NILP (ct_char)) + return ch; + else + return ct_char; +} + +DEFUN ("get-case-table", Fget_case_table, 3, 3, 0, /* +Return CHAR-CASE version of CHARACTER in CASE-TABLE. + +CHAR-CASE is either downcase or upcase. +*/ + (char_case, character, case_table)) +{ + CHECK_CHAR (character); + CHECK_CASE_TABLE (case_table); + if (EQ (char_case, Qdowncase)) + return case_table_char (character, XCASE_TABLE_DOWNCASE (case_table)); + else if (EQ (char_case, Qupcase)) + return case_table_char (character, XCASE_TABLE_UPCASE (case_table)); + else + signal_simple_error ("Char case must be downcase or upcase", char_case); + + return Qnil; /* Not reached. */ +} + +DEFUN ("put-case-table", Fput_case_table, 4, 4, 0, /* +Set CHAR-CASE version of CHARACTER to be VALUE in CASE-TABLE. + +CHAR-CASE is either downcase or upcase. +See also `put-case-table-pair'. +*/ + (char_case, character, value, case_table)) +{ + CHECK_CHAR (character); + CHECK_CHAR (value); + + if (EQ (char_case, Qdowncase)) + { + Fput_char_table (character, value, XCASE_TABLE_DOWNCASE (case_table)); + /* This one is not at all intuitive. */ + Fput_char_table (character, value, XCASE_TABLE_UPCASE (case_table)); + Fput_char_table (character, value, XCASE_TABLE_CANON (case_table)); + Fput_char_table (value, value, XCASE_TABLE_CANON (case_table)); + Fput_char_table (value, character, XCASE_TABLE_EQV (case_table)); + Fput_char_table (character, value, XCASE_TABLE_EQV (case_table)); + } + else if (EQ (char_case, Qupcase)) + { + Fput_char_table (character, value, XCASE_TABLE_UPCASE (case_table)); + Fput_char_table (character, character, XCASE_TABLE_DOWNCASE (case_table)); + Fput_char_table (character, character, XCASE_TABLE_CANON (case_table)); + Fput_char_table (value, character, XCASE_TABLE_CANON (case_table)); + Fput_char_table (value, character, XCASE_TABLE_EQV (case_table)); + Fput_char_table (character, value, XCASE_TABLE_EQV (case_table)); + } + else + signal_simple_error ("Char case must be downcase or upcase", char_case); + + return Qnil; +} + +DEFUN ("put-case-table-pair", Fput_case_table_pair, 3, 3, 0, /* +Make UC and LC a pair of inter-case-converting letters in CASE-TABLE. +UC is an uppercase character and LC is a downcase character. +*/ + (uc, lc, case_table)) +{ + CHECK_CHAR (uc); + CHECK_CHAR (lc); + CHECK_CASE_TABLE (case_table); + + Fput_char_table (lc, lc, XCASE_TABLE_DOWNCASE (case_table)); + Fput_char_table (uc, lc, XCASE_TABLE_UPCASE (case_table)); + Fput_char_table (uc, lc, XCASE_TABLE_DOWNCASE (case_table)); + Fput_char_table (lc, uc, XCASE_TABLE_UPCASE (case_table)); + + Fput_char_table (lc, lc, XCASE_TABLE_CANON (case_table)); + Fput_char_table (uc, lc, XCASE_TABLE_CANON (case_table)); + Fput_char_table (uc, lc, XCASE_TABLE_EQV (case_table)); + Fput_char_table (lc, uc, XCASE_TABLE_EQV (case_table)); + return Qnil; +} + +DEFUN ("copy-case-table", Fcopy_case_table, 1, 1, 0, /* +Return a new case table which is a copy of CASE-TABLE +*/ + (case_table)) +{ + Lisp_Object new_obj; + CHECK_CASE_TABLE (case_table); + + new_obj = allocate_case_table (); + XSET_CASE_TABLE_DOWNCASE + (new_obj, Fcopy_char_table (XCASE_TABLE_DOWNCASE (case_table))); + XSET_CASE_TABLE_UPCASE + (new_obj, Fcopy_char_table (XCASE_TABLE_UPCASE (case_table))); + XSET_CASE_TABLE_CANON + (new_obj, Fcopy_char_table (XCASE_TABLE_CANON (case_table))); + XSET_CASE_TABLE_EQV + (new_obj, Fcopy_char_table (XCASE_TABLE_EQV (case_table))); + return new_obj; +} + DEFUN ("current-case-table", Fcurrent_case_table, 0, 1, 0, /* Return the case table of BUFFER, which defaults to the current buffer. */ @@ -89,10 +266,7 @@ Return the case table of BUFFER, which defaults to the current buffer. { struct buffer *buf = decode_buffer (buffer, 0); - return list4 (buf->downcase_table, - buf->upcase_table, - buf->case_canon_table, - buf->case_eqv_table); + return buf->case_table; } DEFUN ("standard-case-table", Fstandard_case_table, 0, 0, 0, /* @@ -101,19 +275,17 @@ This is the one used for new buffers. */ ()) { - return list4 (Vascii_downcase_table, - Vascii_upcase_table, - Vascii_canon_table, - Vascii_eqv_table); + return Vstandard_case_table; } static Lisp_Object set_case_table (Lisp_Object table, int standard); - DEFUN ("set-case-table", Fset_case_table, 1, 1, 0, /* Select CASE-TABLE as the new case table for the current buffer. -A case table is a list (DOWNCASE UPCASE CANONICALIZE EQUIVALENCES) +A case table is a case-table object or list + (DOWNCASE UPCASE CANONICALIZE EQUIVALENCES) where each element is either nil or a string of length 256. +The latter is provided for backward-compatibility. DOWNCASE maps each character to its lower-case equivalent. UPCASE maps each character to its upper-case equivalent; if lower and upper case characters are in 1-1 correspondence, @@ -126,14 +298,11 @@ EQUIVALENCES is a map that cyclicly permutes each equivalence class (of characters with the same canonical equivalent); it may be nil, in which case it is deduced from CANONICALIZE. -BUG: Under XEmacs/Mule, translations to or from non-ASCII characters - (this includes chars in the range 128 - 255) are ignored by - the string/buffer-searching routines. Thus, `case-fold-search' - will not correctly conflate a-umlaut and A-umlaut even if the - case tables call for this. +See also `get-case-table', `put-case-table' and `put-case-table-pair'. */ (case_table)) { + /* This function can GC */ return set_case_table (case_table, 0); } @@ -143,116 +312,107 @@ See `set-case-table' for more info on case tables. */ (case_table)) { + /* This function can GC */ return set_case_table (case_table, 1); } -#ifdef MULE - -static Lisp_Object -make_mirror_trt_table (Lisp_Object table) -{ - Lisp_Object new_table; - - if (!STRING256_P (table)) - { -#ifdef DEBUG_XEMACS - /* This should be caught farther up. */ - abort (); -#else - signal_simple_error ("Invalid translate table", table); -#endif - } - - new_table = MAKE_MIRROR_TRT_TABLE (); - { - int i; - - for (i = 0; i < 256; i++) - { - Emchar newval = string_char (XSTRING (table), i); - if ((i >= 128 && newval != i) - || (i < 128 && newval >= 128)) - { - newval = (Emchar) i; - } - SET_MIRROR_TRT_TABLE_CHAR_1 (new_table, i, newval); - } - } - return new_table; -} - -#endif /* MULE */ - static Lisp_Object set_case_table (Lisp_Object table, int standard) { - Lisp_Object down, up, canon, eqv, tail = table; + /* This function can GC */ struct buffer *buf = standard ? XBUFFER(Vbuffer_defaults) : current_buffer; check_case_table (table); - down = XCAR (tail); tail = XCDR (tail); - up = XCAR (tail); tail = XCDR (tail); - canon = XCAR (tail); tail = XCDR (tail); - eqv = XCAR (tail); - - if (NILP (up)) + if (CASE_TABLEP (table)) { - up = MAKE_TRT_TABLE (); - compute_trt_inverse (down, up); - } + if (standard) + Vstandard_case_table = table; - if (NILP (canon)) + buf->case_table = table; + } + else { - REGISTER Charcount i; + /* For backward compatibility. */ + Lisp_Object down, up, canon, eqv, tail = table; + Lisp_Object temp; + int i; + + down = XCAR (tail); tail = XCDR (tail); + up = XCAR (tail); tail = XCDR (tail); + canon = XCAR (tail); tail = XCDR (tail); + eqv = XCAR (tail); + + temp = down; + down = MAKE_TRT_TABLE (); + for (i = 0; i < 256; i++) + SET_TRT_TABLE_CHAR_1 (down, i, string_char (XSTRING (temp), i)); - canon = MAKE_TRT_TABLE (); + if (NILP (up)) + { + up = MAKE_TRT_TABLE (); + compute_trt_inverse (down, up); + } + else + { + temp = up; + up = MAKE_TRT_TABLE (); + for (i = 0; i < 256; i++) + SET_TRT_TABLE_CHAR_1 (up, i, string_char (XSTRING (temp), i)); + } + if (NILP (canon)) + { + canon = MAKE_TRT_TABLE (); + + /* Set up the CANON table; for each character, + this sequence of upcasing and downcasing ought to + get the "preferred" lowercase equivalent. */ + for (i = 0; i < 256; i++) + SET_TRT_TABLE_CHAR_1 (canon, i, + TRT_TABLE_CHAR_1 + (down, + TRT_TABLE_CHAR_1 + (up, + TRT_TABLE_CHAR_1 (down, i)))); + } + else + { + temp = canon; + canon = MAKE_TRT_TABLE (); + for (i = 0; i < 256; i++) + SET_TRT_TABLE_CHAR_1 (canon, i, string_char (XSTRING (temp), i)); + } - /* Set up the CANON vector; for each character, - this sequence of upcasing and downcasing ought to - get the "preferred" lowercase equivalent. */ - for (i = 0; i < 256; i++) - SET_TRT_TABLE_CHAR_1 (canon, i, - TRT_TABLE_CHAR_1 - (down, - TRT_TABLE_CHAR_1 - (up, - TRT_TABLE_CHAR_1 (down, i)))); - } + if (NILP (eqv)) + { + eqv = MAKE_TRT_TABLE (); + compute_trt_inverse (canon, eqv); + } + else + { + temp = eqv; + eqv = MAKE_TRT_TABLE (); + for (i = 0; i < 256; i++) + SET_TRT_TABLE_CHAR_1 (eqv, i, string_char (XSTRING (temp), i)); + } - if (NILP (eqv)) - { - eqv = MAKE_TRT_TABLE (); + if (standard) + { + XSET_CASE_TABLE_DOWNCASE (Vstandard_case_table, down); + XSET_CASE_TABLE_UPCASE (Vstandard_case_table, up); + XSET_CASE_TABLE_CANON (Vstandard_case_table, canon); + XSET_CASE_TABLE_EQV (Vstandard_case_table, eqv); + } - compute_trt_inverse (canon, eqv); + buf->case_table = allocate_case_table (); + XSET_CASE_TABLE_DOWNCASE (buf->case_table, down); + XSET_CASE_TABLE_UPCASE (buf->case_table, up); + XSET_CASE_TABLE_CANON (buf->case_table, canon); + XSET_CASE_TABLE_EQV (buf->case_table, eqv); } - if (standard) - { - Vascii_downcase_table = down; - Vascii_upcase_table = up; - Vascii_canon_table = canon; - Vascii_eqv_table = eqv; -#ifdef MULE - Vmirror_ascii_downcase_table = make_mirror_trt_table (down); - Vmirror_ascii_upcase_table = make_mirror_trt_table (up); - Vmirror_ascii_canon_table = make_mirror_trt_table (canon); - Vmirror_ascii_eqv_table = make_mirror_trt_table (eqv); -#endif - } - buf->downcase_table = down; - buf->upcase_table = up; - buf->case_canon_table = canon; - buf->case_eqv_table = eqv; -#ifdef MULE - buf->mirror_downcase_table = make_mirror_trt_table (down); - buf->mirror_upcase_table = make_mirror_trt_table (up); - buf->mirror_case_canon_table = make_mirror_trt_table (canon); - buf->mirror_case_eqv_table = make_mirror_trt_table (eqv); -#endif - - return table; + return buf->case_table; } /* Given a translate table TRT, store the inverse mapping into INVERSE. @@ -285,11 +445,19 @@ compute_trt_inverse (Lisp_Object trt, Lisp_Object inverse) void syms_of_casetab (void) { + INIT_LRECORD_IMPLEMENTATION (case_table); + defsymbol (&Qcase_tablep, "case-table-p"); + defsymbol (&Qdowncase, "downcase"); + defsymbol (&Qupcase, "upcase"); DEFSUBR (Fcase_table_p); + DEFSUBR (Fget_case_table); + DEFSUBR (Fput_case_table); + DEFSUBR (Fput_case_table_pair); DEFSUBR (Fcurrent_case_table); DEFSUBR (Fstandard_case_table); + DEFSUBR (Fcopy_case_table); DEFSUBR (Fset_case_table); DEFSUBR (Fset_standard_case_table); } @@ -300,21 +468,13 @@ complex_vars_of_casetab (void) REGISTER Emchar i; Lisp_Object tem; - staticpro (&Vascii_downcase_table); - staticpro (&Vascii_upcase_table); - staticpro (&Vascii_canon_table); - staticpro (&Vascii_eqv_table); + staticpro (&Vstandard_case_table); -#ifdef MULE - staticpro (&Vmirror_ascii_downcase_table); - staticpro (&Vmirror_ascii_upcase_table); - staticpro (&Vmirror_ascii_canon_table); - staticpro (&Vmirror_ascii_eqv_table); -#endif + Vstandard_case_table = allocate_case_table (); tem = MAKE_TRT_TABLE (); - Vascii_downcase_table = tem; - Vascii_canon_table = tem; + XSET_CASE_TABLE_DOWNCASE (Vstandard_case_table, tem); + XSET_CASE_TABLE_CANON (Vstandard_case_table, tem); /* Under Mule, can't do set_string_char() until Vcharset_control_1 and Vcharset_ascii are initialized. */ @@ -325,15 +485,9 @@ complex_vars_of_casetab (void) SET_TRT_TABLE_CHAR_1 (tem, i, lowered); } -#ifdef MULE - tem = make_mirror_trt_table (tem); - Vmirror_ascii_downcase_table = tem; - Vmirror_ascii_canon_table = tem; -#endif - tem = MAKE_TRT_TABLE (); - Vascii_upcase_table = tem; - Vascii_eqv_table = tem; + XSET_CASE_TABLE_UPCASE (Vstandard_case_table, tem); + XSET_CASE_TABLE_EQV (Vstandard_case_table, tem); for (i = 0; i < 256; i++) { @@ -342,10 +496,4 @@ complex_vars_of_casetab (void) SET_TRT_TABLE_CHAR_1 (tem, i, flipped); } - -#ifdef MULE - tem = make_mirror_trt_table (tem); - Vmirror_ascii_upcase_table = tem; - Vmirror_ascii_eqv_table = tem; -#endif } diff --git a/src/cmds.c b/src/cmds.c index 82e7568..881bb63 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -196,7 +196,7 @@ This function does not move point. (count, buffer)) { struct buffer *buf = decode_buffer (buffer, 1); - int n; + EMACS_INT n; if (NILP (count)) n = 1; @@ -224,7 +224,7 @@ If BUFFER is nil, the current buffer is assumed. return Qnil; } -DEFUN ("delete-char", Fdelete_char, 1, 2, "*p\nP", /* +DEFUN ("delete-char", Fdelete_char, 0, 2, "*p\nP", /* Delete the following COUNT characters (previous, with negative COUNT). Optional second arg KILLP non-nil means kill instead (save in kill ring). Interactively, COUNT is the prefix arg, and KILLP is set if @@ -235,10 +235,15 @@ COUNT was explicitly specified. /* This function can GC */ Bufpos pos; struct buffer *buf = current_buffer; - int n; + EMACS_INT n; - CHECK_INT (count); - n = XINT (count); + if (NILP (count)) + n = 1; + else + { + CHECK_INT (count); + n = XINT (count); + } pos = BUF_PT (buf) + n; if (NILP (killp)) @@ -265,7 +270,7 @@ COUNT was explicitly specified. return Qnil; } -DEFUN ("delete-backward-char", Fdelete_backward_char, 1, 2, "*p\nP", /* +DEFUN ("delete-backward-char", Fdelete_backward_char, 0, 2, "*p\nP", /* Delete the previous COUNT characters (following, with negative COUNT). Optional second arg KILLP non-nil means kill instead (save in kill ring). Interactively, COUNT is the prefix arg, and KILLP is set if @@ -274,8 +279,17 @@ COUNT was explicitly specified. (count, killp)) { /* This function can GC */ - CHECK_INT (count); - return Fdelete_char (make_int (- XINT (count)), killp); + EMACS_INT n; + + if (NILP (count)) + n = 1; + else + { + CHECK_INT (count); + n = XINT (count); + } + + return Fdelete_char (make_int (- n), killp); } static void internal_self_insert (Emchar ch, int noautofill); @@ -290,7 +304,7 @@ If a prefix arg COUNT is specified, the character is inserted COUNT times. /* This function can GC */ Emchar ch; Lisp_Object c; - int n; + EMACS_INT n; CHECK_NATNUM (count); n = XINT (count); diff --git a/src/config.h.in b/src/config.h.in index 49ee0a4..0eec507 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -208,6 +208,7 @@ void *alloca (); configure.in. */ #undef HAVE_MCHECK_H #undef HAVE_A_OUT_H +#undef HAVE_ELF_H #undef HAVE_CYGWIN_VERSION_H #undef HAVE_FCNTL_H #undef HAVE_INTTYPES_H diff --git a/src/depend b/src/depend index 2b6563e..3be2d1e 100644 --- a/src/depend +++ b/src/depend @@ -7,52 +7,52 @@ LISP_UNION_H=lisp-disunion.h #endif LISP_H=lisp.h general-slots.h lrecord.h config.h symeval.h symsinit.h $(LISP_UNION_H) #if defined(HAVE_MS_WINDOWS) -console-msw.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-msw.h console.h events.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h syscommctrl.h systime.h syswindows.h -device-msw.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-msw.h console-stream.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysdep.h systime.h syswindows.h toolbar.h window.h winslots.h -dialog-msw.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-msw.h console.h device.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h redisplay.h scrollbar.h specifier.h syscommctrl.h syswindows.h toolbar.h window.h winslots.h -dired-msw.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h ndir.h nt.h regex.h sysdir.h sysfile.h sysproc.h systime.h syswindows.h -event-msw.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-msw.h console-tty.h console.h device.h dragdrop.h events-mod.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h menubar-msw.h menubar.h mule-charset.h multibyte.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h select.h specifier.h syscommctrl.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h toolbar.h window.h winslots.h -frame-msw.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-msw.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h -glyphs-msw.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-msw.h console.h device.h elhash.h faces.h file-coding.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h imgproc.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-msw.h objects.h opaque.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysfile.h syswindows.h toolbar.h window.h winslots.h -gui-msw.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-msw.h console.h device.h elhash.h events.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h -menubar-msw.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h commands.h conslots.h console-msw.h console.h device.h elhash.h events.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h menubar-msw.h menubar.h mule-charset.h multibyte.h opaque.h redisplay.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h -objects-msw.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-msw.h console.h device.h hash.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-msw.h objects.h specifier.h syscommctrl.h syswindows.h -redisplay-msw.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-msw.h console.h debug.h device.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h gutter.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-ccl.h mule-charset.h multibyte.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysdep.h systime.h syswindows.h toolbar.h window.h winslots.h +console-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-msw.h console.h events.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h syscommctrl.h systime.h syswindows.h +device-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-msw.h console-stream.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysdep.h systime.h syswindows.h toolbar.h window.h winslots.h +dialog-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-msw.h console.h device.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h redisplay.h scrollbar.h specifier.h syscommctrl.h syswindows.h toolbar.h window.h winslots.h +dired-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h ndir.h nt.h regex.h sysdir.h sysfile.h sysproc.h systime.h syswindows.h +event-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-msw.h console-tty.h console.h device.h dragdrop.h events-mod.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h menubar-msw.h menubar.h mule-charset.h multibyte.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h select.h specifier.h syscommctrl.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h toolbar.h window.h winslots.h +frame-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-msw.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h +glyphs-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-msw.h console.h device.h elhash.h faces.h file-coding.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h imgproc.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-msw.h objects.h opaque.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysfile.h syswindows.h toolbar.h window.h winslots.h +gui-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-msw.h console.h device.h elhash.h events.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h +menubar-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h conslots.h console-msw.h console.h device.h elhash.h events.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h menubar-msw.h menubar.h mule-charset.h multibyte.h opaque.h redisplay.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h +objects-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-msw.h console.h device.h hash.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-msw.h objects.h specifier.h syscommctrl.h syswindows.h +redisplay-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-msw.h console.h debug.h device.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h gutter.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-ccl.h mule-charset.h multibyte.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysdep.h systime.h syswindows.h toolbar.h window.h winslots.h scrollbar-msw.o: $(LISP_H) char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-msw.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h -select-msw.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-msw.h console.h device.h file-coding.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h redisplay.h scrollbar.h select.h specifier.h syscommctrl.h syswindows.h toolbar.h window.h winslots.h -toolbar-msw.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-msw.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syscommctrl.h syswindows.h toolbar.h window.h winslots.h +select-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-msw.h console.h device.h file-coding.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h redisplay.h scrollbar.h select.h specifier.h syscommctrl.h syswindows.h toolbar.h window.h winslots.h +toolbar-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-msw.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syscommctrl.h syswindows.h toolbar.h window.h winslots.h #endif #if defined(HAVE_X_WINDOWS) balloon-x.o: $(LISP_H) balloon_help.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-x.h console.h device.h mule-charset.h xintrinsic.h -console-x.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-x.h console.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h process.h redisplay.h xintrinsic.h -device-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-x.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h sysfile.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmu.h -dialog-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h -frame-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-x.h console.h device.h dragdrop.h events-mod.h events.h extents.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h gutter.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar-x.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h -glyphs-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-x.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h imgproc.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-x.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h toolbar.h window.h winslots.h xintrinsic.h xmu.h -gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h -menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h keymap.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h menubar.h mule-charset.h multibyte.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h -objects-x.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-x.h console.h device.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-x.h objects.h specifier.h xintrinsic.h -redisplay-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-x.h console.h debug.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h gutter.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-ccl.h mule-charset.h multibyte.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysproc.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h +console-x.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-x.h console.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h process.h redisplay.h xintrinsic.h +device-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-x.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h sysfile.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmu.h +dialog-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h +frame-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-x.h console.h device.h dragdrop.h events-mod.h events.h extents.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h gutter.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar-x.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h +glyphs-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-x.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h imgproc.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-x.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h toolbar.h window.h winslots.h xintrinsic.h xmu.h +gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h +menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h keymap.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h menubar.h mule-charset.h multibyte.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h +objects-x.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-x.h console.h device.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-x.h objects.h specifier.h xintrinsic.h +redisplay-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-x.h console.h debug.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h gutter.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-ccl.h mule-charset.h multibyte.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysproc.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h scrollbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h mule-charset.h redisplay.h scrollbar-x.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h -select-x.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-x.h objects.h opaque.h redisplay.h scrollbar.h select.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h -toolbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h +select-x.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-x.h objects.h opaque.h redisplay.h scrollbar.h select.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h +toolbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h #endif #if defined(HAVE_TTY) -console-tty.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-stream.h console-tty.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systty.h toolbar.h window.h winslots.h -device-tty.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-stream.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h +console-tty.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-stream.h console-tty.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systty.h toolbar.h window.h winslots.h +device-tty.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-stream.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h event-tty.o: $(LISP_H) char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h frame-tty.o: $(LISP_H) char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h objects-tty.o: $(LISP_H) char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-tty.h console.h device.h insdel.h mule-charset.h objects-tty.h objects.h specifier.h syssignal.h systty.h -redisplay-tty.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h +redisplay-tty.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h #endif #if defined(HAVE_DATABASE) -database.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h database.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h sysfile.h +database.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h database.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h sysfile.h #endif #if defined(MULE) -mule-canna.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h file-coding.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h -mule-ccl.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h file-coding.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-ccl.h mule-charset.h multibyte.h -mule-charset.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h elhash.h faces.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-ccl.h mule-charset.h multibyte.h -mule-wnnfns.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h sysdep.h window.h winslots.h +mule-canna.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h file-coding.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h +mule-ccl.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h file-coding.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-ccl.h mule-charset.h multibyte.h +mule-charset.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h elhash.h faces.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-ccl.h mule-charset.h multibyte.h +mule-wnnfns.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h sysdep.h window.h winslots.h mule.o: $(LISP_H) regex.h #endif #if defined(EXTERNAL_WIDGET) @@ -62,123 +62,123 @@ ExternalShell.o: ExternalShell.h ExternalShellP.h config.h extw-Xlib.h extw-Xt.h extw-Xlib.o: config.h extw-Xlib.h extw-Xt.o: config.h extw-Xlib.h extw-Xt.h #endif -EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h +EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h EmacsManager.o: EmacsManager.h EmacsManagerP.h config.h xintrinsicp.h xmmanagerp.h EmacsShell-sub.o: EmacsShell.h EmacsShellP.h config.h xintrinsic.h xintrinsicp.h EmacsShell.o: EmacsShell.h ExternalShell.h config.h xintrinsicp.h -abbrev.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h syntax.h window.h winslots.h -alloc.o: $(LISP_H) alloc.h backtrace.h buffer.h bufslots.h bytecode.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-stream.h console.h device.h dumper.h elhash.h events.h extents.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systime.h toolbar.h window.h winslots.h +abbrev.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h syntax.h window.h winslots.h +alloc.o: $(LISP_H) alloc.h backtrace.h buffer.h bufslots.h bytecode.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-stream.h console.h device.h dumper.h elhash.h events.h extents.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systime.h toolbar.h window.h winslots.h alloca.o: config.h balloon_help.o: balloon_help.h config.h xintrinsic.h blocktype.o: $(LISP_H) blocktype.h -buffer.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h conslots.h console.h device.h elhash.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h process.h redisplay.h scrollbar.h select.h specifier.h syntax.h sysdep.h sysfile.h toolbar.h window.h winslots.h -bytecode.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h syntax.h -callint.o: $(LISP_H) buffer.h bufslots.h bytecode.h char-1byte.h char-lb.h char-ucs.h character.h commands.h events.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h systime.h window.h winslots.h -callproc.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h commands.h file-coding.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h nt.h process.h redisplay.h scrollbar.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswindows.h window.h winslots.h -casefiddle.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h syntax.h -casetab.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h -chartab.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h syntax.h +buffer.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h conslots.h console.h device.h elhash.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h process.h redisplay.h scrollbar.h select.h specifier.h syntax.h sysdep.h sysfile.h toolbar.h window.h winslots.h +bytecode.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h syntax.h +callint.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h events.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h systime.h window.h winslots.h +callproc.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h file-coding.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h nt.h process.h redisplay.h scrollbar.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswindows.h window.h winslots.h +casefiddle.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h syntax.h +casetab.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h +chartab.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h syntax.h cm.o: $(LISP_H) char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-tty.h console.h device.h frame.h frameslots.h glyphs.h gui.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h syssignal.h systty.h toolbar.h window.h winslots.h -cmdloop.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h -cmds.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h syntax.h +cmdloop.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h +cmds.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h syntax.h console-stream.o: $(LISP_H) char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h -console.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h -data.o: $(LISP_H) buffer.h bufslots.h bytecode.h char-1byte.h char-lb.h char-ucs.h character.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h sysfloat.h syssignal.h +console.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h +data.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h sysfloat.h syssignal.h debug.o: $(LISP_H) bytecode.h debug.h -device.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs.h gui.h keymap.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h toolbar.h window.h winslots.h +device.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs.h gui.h keymap.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h toolbar.h window.h winslots.h dgif_lib.o: $(LISP_H) gifrlib.h sysfile.h dialog.o: $(LISP_H) char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -dired.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h commands.h elhash.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h ndir.h opaque.h regex.h sysdep.h sysdir.h sysfile.h syspwd.h systime.h -doc.o: $(LISP_H) buffer.h bufslots.h bytecode.h char-1byte.h char-lb.h char-ucs.h character.h insdel.h keymap.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h sysfile.h -doprnt.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h +dired.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h elhash.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h ndir.h opaque.h regex.h sysdep.h sysdir.h sysfile.h syspwd.h systime.h +doc.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h insdel.h keymap.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h sysfile.h +doprnt.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h dragdrop.o: $(LISP_H) dragdrop.h dumper.o: $(LISP_H) alloc.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-stream.h console.h dump-id.h dumper.h elhash.h mule-charset.h nt.h specifier.h sysfile.h syswindows.h dynarr.o: $(LISP_H) ecrt0.o: config.h -editfns.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syspwd.h systime.h toolbar.h window.h winslots.h -eldap.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h eldap.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h sysdep.h +editfns.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syspwd.h systime.h toolbar.h window.h winslots.h +eldap.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h eldap.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h sysdep.h elhash.o: $(LISP_H) bytecode.h elhash.h -emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h commands.h conslots.h console.h device.h dump-id.h dumper.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h nt.h paths.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h sysfile.h syssignal.h systime.h systty.h syswindows.h toolbar.h window.h winslots.h -emodules.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h emodules.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h toolbar.h window.h winslots.h +emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h conslots.h console.h device.h dump-id.h dumper.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h nt.h paths.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h sysfile.h syssignal.h systime.h systty.h syswindows.h toolbar.h window.h winslots.h +emodules.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h emodules.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h toolbar.h window.h winslots.h esd.o: $(LISP_H) miscplay.h -eval.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h char-1byte.h char-lb.h char-ucs.h character.h commands.h conslots.h console.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h -event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h Emacs.ad.h EmacsFrame.h blocktype.h buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-tty.h console-x.h console.h device.h dragdrop.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-x.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h -event-stream.o: $(LISP_H) blocktype.h buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h commands.h conslots.h console.h device.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h lstream.h macros.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h menubar.h mule-charset.h multibyte.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h winslots.h +eval.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h conslots.h console.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h +event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h Emacs.ad.h EmacsFrame.h blocktype.h buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-tty.h console-x.h console.h device.h dragdrop.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects-x.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h +event-stream.o: $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h conslots.h console.h device.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h lstream.h macros.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h menubar.h mule-charset.h multibyte.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h winslots.h event-unixoid.o: $(LISP_H) char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-stream.h console-tty.h console.h device.h events.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h process.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h -events.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-tty.h console-x.h console.h device.h events-mod.h events.h extents.h frame.h frameslots.h glyphs.h gui.h keymap.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h -extents.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h debug.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h insdel.h keymap.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h process.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -faces.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -file-coding.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h elhash.h file-coding.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-ccl.h mule-charset.h multibyte.h opaque.h -fileio.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h ndir.h redisplay.h scrollbar.h specifier.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h systime.h toolbar.h window.h winslots.h -filelock.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h ndir.h paths.h sysdir.h sysfile.h syspwd.h syssignal.h +events.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-tty.h console-x.h console.h device.h events-mod.h events.h extents.h frame.h frameslots.h glyphs.h gui.h keymap.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h +extents.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h debug.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h insdel.h keymap.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h process.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +faces.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +file-coding.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h elhash.h file-coding.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-ccl.h mule-charset.h multibyte.h opaque.h +fileio.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h ndir.h redisplay.h scrollbar.h specifier.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h systime.h toolbar.h window.h winslots.h +filelock.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h ndir.h paths.h sysdir.h sysfile.h syspwd.h syssignal.h filemode.o: $(LISP_H) sysfile.h floatfns.o: $(LISP_H) sysfloat.h syssignal.h -fns.o: $(LISP_H) buffer.h bufslots.h bytecode.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h systime.h toolbar.h window.h winslots.h -font-lock.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h syntax.h -frame.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h events.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h menubar.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h +fns.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h systime.h toolbar.h window.h winslots.h +font-lock.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h syntax.h +frame.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h events.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h menubar.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h free-hook.o: $(LISP_H) hash.h general.o: $(LISP_H) getloadavg.o: $(LISP_H) sysfile.h gif_io.o: config.h gifrlib.h sysfile.h -glyphs-eimage.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h faces.h file-coding.h frame.h frameslots.h gifrlib.h glyphs.h gui.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h toolbar.h window.h winslots.h -glyphs-widget.o: $(LISP_H) buffer.h bufslots.h bytecode.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects.h opaque.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -glyphs.o: $(LISP_H) blocktype.h buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +glyphs-eimage.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h faces.h file-coding.h frame.h frameslots.h gifrlib.h glyphs.h gui.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h toolbar.h window.h winslots.h +glyphs-widget.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects.h opaque.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +glyphs.o: $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h gmalloc.o: config.h getpagesize.h gpmevent.o: $(LISP_H) char-1byte.h char-lb.h char-ucs.h character.h commands.h conslots.h console-tty.h console.h device.h events-mod.h events.h gpmevent.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h process.h sysdep.h sysproc.h syssignal.h systime.h systty.h -gui.o: $(LISP_H) buffer.h bufslots.h bytecode.h char-1byte.h char-lb.h char-ucs.h character.h elhash.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h -gutter.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +gui.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h elhash.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h +gutter.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h hash.o: $(LISP_H) hash.h hftctl.o: $(LISP_H) hpplay.o: $(LISP_H) nativesound.h imgproc.o: $(LISP_H) imgproc.h -indent.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-msw.h console.h database.h device.h eldap.h elhash.h events.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h keymap.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects.h opaque.h postgresql.h process.h rangetab.h redisplay.h scrollbar.h specifier.h syntax.h syscommctrl.h systime.h syswindows.h toolbar.h tooltalk.h window.h winslots.h xintrinsic.h +indent.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-msw.h console.h database.h device.h eldap.h elhash.h events.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h keymap.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects.h opaque.h postgresql.h process.h rangetab.h redisplay.h scrollbar.h specifier.h syntax.h syscommctrl.h systime.h syswindows.h toolbar.h tooltalk.h window.h winslots.h xintrinsic.h input-method-motif.o: $(LISP_H) EmacsFrame.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h -input-method-xfs.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h -input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h -insdel.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +input-method-xfs.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h +input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h +insdel.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h intl.o: $(LISP_H) bytecode.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h mule-charset.h -keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h elhash.h events-mod.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h +keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h elhash.h events-mod.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h libsst.o: $(LISP_H) libsst.h -line-number.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h line-number.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h +line-number.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h line-number.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h linuxplay.o: $(LISP_H) miscplay.h nativesound.h sysfile.h syssignal.h -lread.o: $(LISP_H) buffer.h bufslots.h bytecode.h char-1byte.h char-lb.h char-ucs.h character.h elhash.h file-coding.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h sysfile.h sysfloat.h -lstream.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h sysfile.h -macros.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h keymap.h macros.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h +lread.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h elhash.h file-coding.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h sysfile.h sysfloat.h +lstream.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h sysfile.h +macros.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h keymap.h macros.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h malloc.o: config.h getpagesize.h -marker.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h -md5.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h file-coding.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h -menubar.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h keymap.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h menubar.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -minibuf.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h commands.h conslots.h console-stream.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h +marker.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h +md5.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h file-coding.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h +menubar.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h keymap.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h menubar.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +minibuf.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h conslots.h console-stream.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h miscplay.o: $(LISP_H) miscplay.h sysfile.h syssignal.h nas.o: $(LISP_H) sysdep.h syssignal.h nt.o: $(LISP_H) ndir.h nt.h ntheap.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h ntheap.o: $(LISP_H) ntheap.h syswindows.h ntplay.o: $(LISP_H) nativesound.h nt.h sysfile.h syswindows.h -ntproc.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-msw.h console.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h nt.h ntheap.h process.h syscommctrl.h sysfile.h sysproc.h syssignal.h systime.h syswait.h syswindows.h -objects.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +ntproc.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-msw.h console.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h nt.h ntheap.h process.h syscommctrl.h sysfile.h sysproc.h syssignal.h systime.h syswait.h syswindows.h +objects.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h offix.o: offix-cursors.h offix-types.h offix.h xintrinsic.h opaque.o: $(LISP_H) opaque.h -postgresql.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h postgresql.h sysdep.h -print.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-msw.h console-stream.h console-tty.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysfile.h syssignal.h systty.h syswindows.h toolbar.h window.h winslots.h -process-nt.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-msw.h console.h hash.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h nt.h process.h procimpl.h syscommctrl.h sysdep.h syswindows.h -process-unix.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h hash.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h -process.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h commands.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h hash.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h +postgresql.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h postgresql.h sysdep.h +print.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-msw.h console-stream.h console-tty.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysfile.h syssignal.h systty.h syswindows.h toolbar.h window.h winslots.h +process-nt.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-msw.h console.h hash.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h nt.h process.h procimpl.h syscommctrl.h sysdep.h syswindows.h +process-unix.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h hash.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h +process.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h hash.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h profile.o: $(LISP_H) backtrace.h bytecode.h elhash.h hash.h syssignal.h systime.h ralloc.o: $(LISP_H) getpagesize.h rangetab.o: $(LISP_H) rangetab.h -realpath.o: config.h -redisplay-output.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -redisplay.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h commands.h conslots.h console-tty.h console.h debug.h device.h elhash.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h gutter.h insdel.h line-number.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h menubar.h mule-charset.h multibyte.h objects.h process.h redisplay.h scrollbar.h specifier.h sysfile.h syssignal.h systty.h toolbar.h window.h winslots.h -regex.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h regex.h syntax.h -scrollbar.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h commands.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h gutter.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -search.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h regex.h syntax.h -select.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects.h opaque.h redisplay.h scrollbar.h select.h specifier.h toolbar.h window.h winslots.h +realpath.o: $(LISP_H) syswindows.h +redisplay-output.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +redisplay.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h conslots.h console-tty.h console.h debug.h device.h elhash.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h gutter.h insdel.h line-number.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h menubar.h mule-charset.h multibyte.h objects.h process.h redisplay.h scrollbar.h specifier.h sysfile.h syssignal.h systty.h toolbar.h window.h winslots.h +regex.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h regex.h syntax.h +scrollbar.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h gutter.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +search.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h insdel.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h regex.h syntax.h +select.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects.h opaque.h redisplay.h scrollbar.h select.h specifier.h toolbar.h window.h winslots.h sgiplay.o: $(LISP_H) libst.h sheap.o: $(LISP_H) sheap-adjust.h signal.o: $(LISP_H) char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h winslots.h -sound.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-x.h console.h device.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h nativesound.h redisplay.h sysdep.h sysfile.h sysproc.h systime.h xintrinsic.h -specifier.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +sound.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-x.h console.h device.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h nativesound.h redisplay.h sysdep.h sysfile.h sysproc.h systime.h xintrinsic.h +specifier.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h strcat.o: config.h strcmp.o: config.h strcpy.o: config.h @@ -186,18 +186,18 @@ strftime.o: $(LISP_H) sunOS-fix.o: config.h sunplay.o: $(LISP_H) nativesound.h sysdep.h syssignal.h sunpro.o: $(LISP_H) -symbols.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h elhash.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h -syntax.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h syntax.h -sysdep.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h ndir.h nt.h ntheap.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysdir.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h toolbar.h window.h winslots.h +symbols.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h elhash.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h +syntax.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h syntax.h +sysdep.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h ndir.h nt.h ntheap.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysdir.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h toolbar.h window.h winslots.h sysdll.o: config.h sysdll.h termcap.o: $(LISP_H) char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h mule-charset.h terminfo.o: config.h -tests.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h -text-coding.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h elhash.h file-coding.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-ccl.h mule-charset.h multibyte.h opaque.h -toolbar.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h -tooltalk.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h elhash.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h process.h syssignal.h tooltalk.h +tests.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h opaque.h +text-coding.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h elhash.h file-coding.h insdel.h lstream.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-ccl.h mule-charset.h multibyte.h opaque.h +toolbar.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +tooltalk.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h elhash.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h process.h syssignal.h tooltalk.h tparam.o: config.h -undo.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h extents.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h +undo.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h extents.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h unexaix.o: $(LISP_H) getpagesize.h unexalpha.o: config.h unexapollo.o: config.h @@ -214,8 +214,8 @@ unexmips.o: config.h getpagesize.h unexnt.o: $(LISP_H) nt.h ntheap.h syswindows.h unexsunos4.o: config.h vm-limit.o: $(LISP_H) mem-limits.h -widget.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h -win32.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h syswindows.h -window.o: $(LISP_H) buffer.h bufslots.h char-1byte.h char-lb.h char-ucs.h character.h commands.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h +widget.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h +win32.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h syswindows.h +window.o: $(LISP_H) buffer.h bufslots.h casetab.h char-1byte.h char-lb.h char-ucs.h character.h chartab.h commands.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h mb-1byte.h mb-lb.h mb-multibyte.h mb-utf-8.h mule-charset.h multibyte.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xgccache.o: $(LISP_H) hash.h xgccache.h xmu.o: config.h diff --git a/src/device-msw.c b/src/device-msw.c index 6e63f9a..da2727c 100644 --- a/src/device-msw.c +++ b/src/device-msw.c @@ -1019,6 +1019,7 @@ Return value is the currently selected settings object. ldm_current->printer_name = xstrdup (ldm_new->printer_name); } + UNGCPRO; return DEVICE_MSPRINTER_DEVMODE (d); } diff --git a/src/dired-msw.c b/src/dired-msw.c index 9e4b2b5..73dfe42 100644 --- a/src/dired-msw.c +++ b/src/dired-msw.c @@ -187,7 +187,7 @@ mswindows_get_files (char *dirfile, int nowild, Lisp_Object pattern, /* PATTERN might be a flawed regular expression. Rather than catching and signalling our own errors, we just call compile_pattern to do the work for us. */ - bufp = compile_pattern (pattern, 0, 0, 0, ERROR_ME); + bufp = compile_pattern (pattern, 0, Qnil, 0, ERROR_ME); } /* Now *bufp is the compiled form of PATTERN; don't call anything which might compile a new regexp until we're done with the loop! */ diff --git a/src/dired.c b/src/dired.c index 69142b7..48f9a28 100644 --- a/src/dired.c +++ b/src/dired.c @@ -110,7 +110,7 @@ If FILES-ONLY is the symbol t, then only the "files" in the directory /* MATCH might be a flawed regular expression. Rather than catching and signalling our own errors, we just call compile_pattern to do the work for us. */ - bufp = compile_pattern (match, 0, 0, 0, ERROR_ME); + bufp = compile_pattern (match, 0, Qnil, 0, ERROR_ME); } /* Now *bufp is the compiled form of MATCH; don't call anything diff --git a/src/doc.c b/src/doc.c index 88e95af..1a76998 100644 --- a/src/doc.c +++ b/src/doc.c @@ -168,7 +168,6 @@ get_doc_string (Lisp_Object filepos) /* !!#### This function has not been Mule-ized */ REGISTER int fd; REGISTER char *name_nonreloc = 0; - int minsize; EMACS_INT position; Lisp_Object file, tem; Lisp_Object name_reloc = Qnil; @@ -197,6 +196,7 @@ get_doc_string (Lisp_Object filepos) tem = Ffile_name_absolute_p (file); if (NILP (tem)) { + size_t minsize; /* XEmacs: Move this check here. OK if called during loadup to load byte code instructions. */ if (!STRINGP (Vdoc_directory)) diff --git a/src/doprnt.c b/src/doprnt.c index 222ca80..74d4c27 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -31,13 +31,12 @@ Boston, MA 02111-1307, USA. */ #include "buffer.h" #include "lstream.h" -static const char *valid_flags = "-+ #0"; - -static const char *valid_converters = "diouxXfeEgGcsS"; -static const char *int_converters = "dic"; -static const char *unsigned_int_converters = "ouxX"; -static const char *double_converters = "feEgG"; -static const char *string_converters = "sS"; +static const char * const valid_flags = "-+ #0"; +static const char * const valid_converters = "dic" "ouxX" "feEgG" "sS"; +static const char * const int_converters = "dic"; +static const char * const unsigned_int_converters = "ouxX"; +static const char * const double_converters = "feEgG"; +static const char * const string_converters = "sS"; typedef struct printf_spec printf_spec; struct printf_spec @@ -66,8 +65,6 @@ struct printf_spec typedef union printf_arg printf_arg; union printf_arg { - int i; - unsigned int ui; long l; unsigned long ul; double d; @@ -237,11 +234,11 @@ parse_doprnt_spec (const Bufbyte *format, Bytecount format_length) { switch (ch) { - case '-': spec.minus_flag = 1; break; - case '+': spec.plus_flag = 1; break; - case ' ': spec.space_flag = 1; break; + case '-': spec.minus_flag = 1; break; + case '+': spec.plus_flag = 1; break; + case ' ': spec.space_flag = 1; break; case '#': spec.number_flag = 1; break; - case '0': spec.zero_flag = 1; break; + case '0': spec.zero_flag = 1; break; default: abort (); } NEXT_ASCII_BYTE (ch); @@ -380,26 +377,24 @@ get_doprnt_args (printf_spec_dynarr *specs, va_list vargs) ch = spec->converter; - /* int even if ch == 'c': "the type used in va_arg is supposed to - match the actual type **after default promotions**." */ - if (strchr (int_converters, ch)) { - if (spec->h_flag) - arg.i = va_arg (vargs, int /* short */); - else if (spec->l_flag) + if (spec->l_flag) arg.l = va_arg (vargs, long); else - arg.i = va_arg (vargs, int); + /* int even if ch == 'c' or spec->h_flag: + "the type used in va_arg is supposed to match the + actual type **after default promotions**." + Hence we read an int, not a short, if spec->h_flag. */ + arg.l = va_arg (vargs, int); } else if (strchr (unsigned_int_converters, ch)) { - if (spec->h_flag) - arg.ui = va_arg (vargs, unsigned int /* unsigned short */); - else if (spec->l_flag) + if (spec->l_flag) arg.ul = va_arg (vargs, unsigned long); else - arg.ui = va_arg (vargs, unsigned int); + /* unsigned int even if ch == 'c' or spec->h_flag */ + arg.ul = (unsigned long) va_arg (vargs, unsigned int); } else if (strchr (double_converters, ch)) arg.d = va_arg (vargs, double); @@ -445,7 +440,7 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, specs = parse_doprnt_spec (format_nonreloc, format_length); if (largs) { - /* allow too many args for string, but not too few */ + /* allow too many args for string, but not too few */ if (nargs < get_args_needed (specs)) signal_error (Qwrong_number_of_arguments, list3 (Qformat, @@ -466,8 +461,9 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, /* Copy the text before */ if (!NILP (format_reloc)) /* refetch in case of GC below */ format_nonreloc = XSTRING_DATA (format_reloc); - doprnt_1 (stream, format_nonreloc + spec->text_before, - spec->text_before_len, 0, -1, 0, 0); + + doprnt_1 (stream, format_nonreloc + spec->text_before, + spec->text_before_len, 0, -1, 0, 0); ch = spec->converter; @@ -498,17 +494,17 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, else { nextspec->minwidth = XINT (obj); - if (XINT(obj) < 0) + if (XINT (obj) < 0) { spec->minus_flag = 1; nextspec->minwidth = - nextspec->minwidth; } } - nextspec->minus_flag = spec->minus_flag; - nextspec->plus_flag = spec->plus_flag; - nextspec->space_flag = spec->space_flag; + nextspec->minus_flag = spec->minus_flag; + nextspec->plus_flag = spec->plus_flag; + nextspec->space_flag = spec->space_flag; nextspec->number_flag = spec->number_flag; - nextspec->zero_flag = spec->zero_flag; + nextspec->zero_flag = spec->zero_flag; } continue; } @@ -586,26 +582,13 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, arg.d = XFLOATINT (obj); else { - int val; - if (FLOATP (obj)) - val = XINT (Ftruncate (obj)); - else - val = XINT (obj); + obj = Ftruncate (obj); + if (strchr (unsigned_int_converters, ch)) - { - if (spec->l_flag) - arg.ul = (unsigned long) val; - else - arg.ui = (unsigned int) val; - } + arg.ul = (unsigned long) XINT (obj); else - { - if (spec->l_flag) - arg.l = (long) val; - else - arg.i = val; - } + arg.l = XINT (obj); } } @@ -616,10 +599,7 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, Bytecount charlen; Bufbyte charbuf[MAX_EMCHAR_LEN]; - if (spec->l_flag) - a = (Emchar) arg.l; - else - a = (Emchar) arg.i; + a = (Emchar) arg.l; if (!valid_char_p (a)) error ("invalid character value %d to %%c spec", a); @@ -628,11 +608,11 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, doprnt_1 (stream, charbuf, charlen, spec->minwidth, -1, spec->minus_flag, spec->zero_flag); } - else { char text_to_print[500]; char constructed_spec[100]; + char *p = constructed_spec; /* Partially reconstruct the spec and use sprintf() to format the string. */ @@ -643,23 +623,16 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, spec->precision = min (spec->precision, (int) (sizeof (text_to_print) - 50)); - constructed_spec[0] = 0; - strcat (constructed_spec, "%"); - if (spec->plus_flag) - strcat (constructed_spec, "+"); - if (spec->space_flag) - strcat (constructed_spec, " "); - if (spec->number_flag) - strcat (constructed_spec, "#"); + *p++ = '%'; + if (spec->plus_flag) *p++ = '+'; + if (spec->space_flag) *p++ = ' '; + if (spec->number_flag) *p++ = '#'; + if (spec->precision >= 0 && !spec->minwidth) { - strcat (constructed_spec, "."); - long_to_string (constructed_spec + strlen (constructed_spec), - spec->precision); + *p++ = '.'; + p = long_to_string (p, spec->precision); } -#if 0 - sprintf (constructed_spec + strlen (constructed_spec), "%c", ch); -#endif /* sprintf the mofo */ /* we have to use separate calls to sprintf(), rather than @@ -667,31 +640,21 @@ emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, of the arguments */ if (strchr (double_converters, ch)) { - sprintf (constructed_spec + strlen (constructed_spec), - "%c", ch); + *p++ = ch; + *p++ = '\0'; sprintf (text_to_print, constructed_spec, arg.d); } - else if (strchr (unsigned_int_converters, ch)) - { - sprintf (constructed_spec + strlen (constructed_spec), - "%c", ch); - if (spec->l_flag) - sprintf (text_to_print, constructed_spec, arg.ul); - else - sprintf (text_to_print, constructed_spec, arg.ui); - } else { if (spec->zero_flag && spec->minwidth) - sprintf (constructed_spec + strlen (constructed_spec), - "0%d%c", spec->minwidth, ch); + sprintf (p, "0%dl%c", spec->minwidth, ch); else - sprintf (constructed_spec + strlen (constructed_spec), - "%c", ch); - if (spec->l_flag) - sprintf (text_to_print, constructed_spec, arg.l); + sprintf (p, "l%c", ch); + + if (strchr (unsigned_int_converters, ch)) + sprintf (text_to_print, constructed_spec, arg.ul); else - sprintf (text_to_print, constructed_spec, arg.i); + sprintf (text_to_print, constructed_spec, arg.l); } doprnt_1 (stream, (Bufbyte *) text_to_print, diff --git a/src/dumper.c b/src/dumper.c index 4aa59b5..93083da 100644 --- a/src/dumper.c +++ b/src/dumper.c @@ -168,7 +168,6 @@ typedef struct static pdump_entry_list pdump_object_table[256]; static pdump_entry_list pdump_opaque_data_list; static pdump_struct_list pdump_struct_table; -static pdump_entry_list_elmt *pdump_qnil; static int pdump_alert_undump_object[256]; @@ -357,7 +356,6 @@ pdump_register_sub (const void *data, const struct lrecord_description *desc, in case XD_INT: case XD_LONG: case XD_BYTECOUNT: - case XD_LO_RESET_NIL: case XD_INT_RESET: case XD_LO_LINK: break; @@ -542,16 +540,6 @@ pdump_dump_data (pdump_entry_list_elmt *elmt, const struct lrecord_description * case XD_LONG: case XD_BYTECOUNT: break; - case XD_LO_RESET_NIL: - { - EMACS_INT num = desc[pos].data1; - int j; - if (XD_IS_INDIRECT (num)) - num = pdump_get_indirect_count (num, desc, elmt->obj); - for (j=0; jsave_offset; - break; - } case XD_INT_RESET: { EMACS_INT val = desc[pos].data1; @@ -673,7 +661,6 @@ pdump_reloc_one (void *data, EMACS_INT delta, const struct lrecord_description * break; } case XD_LISP_OBJECT_ARRAY: - case XD_LO_RESET_NIL: { EMACS_INT num = desc[pos].data1; int j; @@ -905,6 +892,8 @@ pdump (void) int none; dump_header hd; + flush_all_buffer_local_cache (); + /* These appear in a DEFVAR_LISP, which does a staticpro() */ t_console = Vterminal_console; t_frame = Vterminal_frame; @@ -962,7 +951,6 @@ pdump (void) max_size = 0; pdump_scan_by_alignment (pdump_allocate_offset); - pdump_qnil = pdump_get_entry (XRECORD_LHEADER (Qnil)); pdump_buf = xmalloc (max_size); /* Avoid use of the `open' macro. We want the real function. */ @@ -1238,9 +1226,9 @@ static int pdump_file_get(const char *path) pdump_mallocadr = xmalloc(pdump_length+255); pdump_free = pdump_file_free; pdump_start = (char *)((255 + (unsigned long)pdump_mallocadr) & ~255); - read (pdump_fd, pdump_start, pdump_length); + read (fd, pdump_start, pdump_length); - close (pdump_fd); + close (fd); return 1; } #endif /* !WIN32_NATIVE */ diff --git a/src/editfns.c b/src/editfns.c index 7a8df46..a8e04a0 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -36,6 +36,7 @@ Boston, MA 02111-1307, USA. */ #include "frame.h" #include "insdel.h" #include "window.h" +#include "casetab.h" #include "chartab.h" #include "line-number.h" @@ -1717,7 +1718,7 @@ determines whether case is significant or ignored. REGISTER Charcount len1, len2, length, i; struct buffer *bp1, *bp2; Lisp_Object trt = ((!NILP (current_buffer->case_fold_search)) ? - current_buffer->case_canon_table : Qnil); + XCASE_TABLE_CANON (current_buffer->case_table) : Qnil); /* Find the first buffer and its substring. */ diff --git a/src/eldap.c b/src/eldap.c index c118529..70a8603 100644 --- a/src/eldap.c +++ b/src/eldap.c @@ -701,8 +701,6 @@ or `replace'. ATTR is the LDAP attribute type to modify. Lisp_Object values = Qnil; struct gcpro gcpro1, gcpro2; - GCPRO2 (current, values); - /* Do all the parameter checking */ CHECK_LIVE_LDAP (ldap); ld = XLDAP (ldap)->ld; @@ -720,6 +718,8 @@ or `replace'. ATTR is the LDAP attribute type to modify. ldap_mods = alloca_array (LDAPMod, len); ldap_mods_ptrs = alloca_array (LDAPMod *, 1 + len); i = 0; + + GCPRO2 (current, values); EXTERNAL_LIST_LOOP (mods, mods) { current = XCAR (mods); diff --git a/src/emacs.c b/src/emacs.c index c8e3b40..980c2fb 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -342,15 +342,19 @@ unsigned int lim_data; Some LISP-visible command-line options are set by XEmacs _before_ the data is dumped in building a --pdump XEmacs, but used _after_ it is - restored in normal operation. Thus the restored values overwrite the - values XEmacs is getting at run-time. Such variables must be saved + restored in normal operation. Thus the dump-time values overwrite the + values XEmacs is getting at runtime. Such variables must be saved before loading the dumpfile, and restored afterward. - This is done immediately before and after pdump_load() in main_1(). - See that function for the current list of protected variables. + Therefore these variables may not be initialized in vars_of_emacs(). - Note that if the variable is never DEFVAR'd, saving/restoring is not - needed. + The save/restore is done immediately before and after pdump_load() in + main_1(). See that function for the current list of protected variables. + + Note that saving/restoring is only necessary for a few variables that are + o command line arguments effective at runtime (as opposed to dump-time), + o parsed before pdump_load, and + o exported to Lisp via a DEFVAR. */ /* Nonzero means running XEmacs without interactive terminal. */ @@ -821,7 +825,22 @@ argmatch (char **argv, int argc, char *sstr, char *lstr, #define main_1 STACK_TRACE_EYE_CATCHER /* This function is not static, so that the compiler is less likely to - inline it, which would make it not show up in stack traces. */ + inline it, which would make it not show up in stack traces. + + The restart argument is a flag that indicates that main_1 is now + being called for the second time in this invocation of xemacs; this can + only happen in an xemacs that is not loaded with dumped data (temacs + with the conventional dumper or xemacs -nd with the pdumper). See + Frun_emacs_from_temacs(). + + restart interacts with initialized as follows (per Olivier Galibert): + + It's perverted. + + initialized==0 => temacs + initialized!=0 && restart!=0 => run-temacs + initialized!=0 && restart==0 => xemacs/post pdump_load() +*/ DECLARE_DOESNT_RETURN (main_1 (int, char **, char **, int)); DOESNT_RETURN main_1 (int argc, char **argv, char **envp, int restart) @@ -930,7 +949,7 @@ main_1 (int argc, char **argv, char **envp, int restart) #ifdef PDUMP printf ("%08x\n", dump_id); #else - printf ("*ERROR**\n"); + printf ("Portable dumper not configured; -sd just forces exit.\n"); #endif exit (0); } @@ -1149,17 +1168,13 @@ main_1 (int argc, char **argv, char **envp, int restart) Boy, this is ugly, but how else to do it? */ - /* noninteractive1 is protected by noninteractive, which is not - LISP-visible */ + /* noninteractive1 is saved in noninteractive, which isn't LISP-visible */ int inhibit_early_packages_save = inhibit_early_packages; int inhibit_autoloads_save = inhibit_autoloads; int debug_paths_save = debug_paths; -#ifdef INHIBIT_SITE_LISP - int inhibit_site_lisp_save = inhibit_site_lisp; -#endif -#ifdef INHIBIT_SITE_MODULES + /* #### Give inhibit-site-lisp a command switch? If so, uncomment: */ + /* int inhibit_site_lisp_save = inhibit_site_lisp; */ int inhibit_site_modules_save = inhibit_site_modules; -#endif initialized = pdump_load (argv[0]); @@ -1168,12 +1183,9 @@ main_1 (int argc, char **argv, char **envp, int restart) inhibit_early_packages = inhibit_early_packages_save; inhibit_autoloads = inhibit_autoloads_save; debug_paths = debug_paths_save; -#ifdef INHIBIT_SITE_LISP - inhibit_site_lisp = inhibit_site_lisp_save; -#endif -#ifdef INHIBIT_SITE_MODULES + /* #### Give inhibit-site-lisp a command switch? If so, uncomment: */ + /* inhibit_site_lisp = inhibit_site_lisp_save; */ inhibit_site_modules = inhibit_site_modules_save; -#endif if (initialized) run_temacs_argc = -1; @@ -1625,6 +1637,11 @@ main_1 (int argc, char **argv, char **envp, int restart) make_opaque_ptr() perhaps a few others. + + NB: Initialization or assignment should not be done here to certain + variables settable from the command line. See the comment above + the call to pdump_load() in main_1(). This caveat should only + apply to vars_of_emacs(). */ /* Now allow Fprovide() statements to be made. */ @@ -1969,7 +1986,7 @@ main_1 (int argc, char **argv, char **envp, int restart) } #endif #ifdef PDUMP - } else if (!restart) { + } else if (!restart) { /* after successful pdump_load() */ reinit_alloc_once_early (); reinit_symbols_once_early (); reinit_opaque_once_early (); @@ -2085,13 +2102,18 @@ main_1 (int argc, char **argv, char **envp, int restart) if (initialized) { - /* Stuff that needs to be reset at run time. Order below should - not matter. */ + /* Stuff that should not be done at dump time, including stuff that + needs to be reset at run time. Order below should not matter. + + Many initializations taken from the environment should go here. */ reinit_alloc (); reinit_eval (); #ifdef MULE_REGEXP reinit_mule_category (); #endif +#ifdef HAVE_POSTGRESQL + init_postgresql_from_environment(); +#endif } /* Now do further initialization/setup of stuff that is not needed by the @@ -3721,8 +3743,9 @@ The configured initial path for info documentation. * cores on us when re-started from the dumped executable. * This will have to go for 21.1 -- OG. */ -void __sti__iflPNGFile_c___(void); -void __sti__iflPNGFile_c___() +void __sti__iflPNGFile_c___ (void); +void +__sti__iflPNGFile_c___ (void) { } diff --git a/src/event-Xt.c b/src/event-Xt.c index ddbb49d..2eb2fca 100644 --- a/src/event-Xt.c +++ b/src/event-Xt.c @@ -1350,10 +1350,10 @@ x_event_to_emacs_event (XEvent *x_event, Lisp_Event *emacs_event) Lisp_Object l_dndlist = Qnil, l_item = Qnil; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; - GCPRO4 (l_type, l_data, l_dndlist, l_item); - if (! frame) return 0; /* not for us */ + + GCPRO4 (l_type, l_data, l_dndlist, l_item); XSETFRAME (emacs_event->channel, frame); emacs_event->event_type = misc_user_event; diff --git a/src/event-msw.c b/src/event-msw.c index a09c81f..ee3595f 100644 --- a/src/event-msw.c +++ b/src/event-msw.c @@ -2794,8 +2794,6 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam) case CBN_SELCHANGE: if (!NILP (mswindows_handle_gui_wm_command (frame, cid, id))) return 0; - case BN_SETFOCUS: - } /* menubars always must come last since the hashtables do not always exist*/ diff --git a/src/event-stream.c b/src/event-stream.c index 68e6c12..d6a5cfe 100644 --- a/src/event-stream.c +++ b/src/event-stream.c @@ -3372,7 +3372,7 @@ modify them. { Vrecent_keys_ring = make_vector (recent_keys_ring_size, Qnil); /* And return nothing in particular. */ - return make_vector (0, Qnil); + RETURN_UNGCPRO (make_vector (0, Qnil)); } if (NILP (XVECTOR_DATA (Vrecent_keys_ring)[recent_keys_ring_index])) @@ -3430,7 +3430,6 @@ Set the maximum number of events to be stored internally. Lisp_Object new_vector = Qnil; int i, j, nkeys, start, min; struct gcpro gcpro1; - GCPRO1 (new_vector); CHECK_INT (size); if (XINT (size) <= 0) @@ -3438,12 +3437,13 @@ Set the maximum number of events to be stored internally. if (XINT (size) == recent_keys_ring_size) return size; + GCPRO1 (new_vector); new_vector = make_vector (XINT (size), Qnil); if (NILP (Vrecent_keys_ring)) { Vrecent_keys_ring = new_vector; - return size; + RETURN_UNGCPRO (size); } if (NILP (XVECTOR_DATA (Vrecent_keys_ring)[recent_keys_ring_index])) diff --git a/src/faces.c b/src/faces.c index a134312..ffab20d 100644 --- a/src/faces.c +++ b/src/faces.c @@ -1154,22 +1154,6 @@ face_cachel_charset_font_metric_info (struct face_cachel *cachel, } } -/* Called when the updated flag has been cleared on a cachel. */ - -void -update_face_cachel_data (struct face_cachel *cachel, - Lisp_Object domain, - Lisp_Object face) -{ - if (XFACE (face)->dirty || UNBOUNDP (cachel->face)) - { - int default_face = EQ (face, Vdefault_face); - cachel->face = face; - - /* We normally only set the _specified flags if the value was - actually bound. The exception is for the default face where - we always set it since it is the ultimate fallback. */ - #define FROB(field) \ do { \ Lisp_Object new_val = \ @@ -1188,31 +1172,125 @@ update_face_cachel_data (struct face_cachel *cachel, cachel->field##_specified = (bound || default_face); \ } while (0) +/* + * A face's background pixmap will override the face's + * background color. But the background pixmap of the + * default face should not override the background color of + * a face if the background color has been specified or + * inherited. + * + * To accomplish this we remove the background pixmap of the + * cachel and mark it as having been specified so that cachel + * merging won't override it later. + */ +#define MAYBE_UNFROB_BACKGROUND_PIXMAP \ +do \ +{ \ + if (! default_face \ + && cachel->background_specified \ + && ! cachel->background_pixmap_specified) \ + { \ + cachel->background_pixmap = Qunbound; \ + cachel->background_pixmap_specified = 1; \ + } \ +} while (0) + + +/* Add a cachel for the given face to the given window's cache. */ + +static void +add_face_cachel (struct window *w, Lisp_Object face) +{ + int must_finish_frobbing = ! WINDOW_FACE_CACHEL (w, DEFAULT_INDEX); + struct face_cachel new_cachel; + Lisp_Object domain; + + reset_face_cachel (&new_cachel); + XSETWINDOW (domain, w); + update_face_cachel_data (&new_cachel, domain, face); + Dynarr_add (w->face_cachels, new_cachel); + + /* The face's background pixmap have not yet been frobbed (see comment + int update_face_cachel_data), so we have to do it now */ + if (must_finish_frobbing) + { + int default_face = EQ (face, Vdefault_face); + struct face_cachel *cachel + = Dynarr_atp (w->face_cachels, Dynarr_length (w->face_cachels) - 1); + + FROB (background_pixmap); + MAYBE_UNFROB_BACKGROUND_PIXMAP; + } +} + +/* Called when the updated flag has been cleared on a cachel. + This function returns 1 if the caller must finish the update (see comment + below), 0 otherwise. +*/ + +void +update_face_cachel_data (struct face_cachel *cachel, + Lisp_Object domain, + Lisp_Object face) +{ + if (XFACE (face)->dirty || UNBOUNDP (cachel->face)) + { + int default_face = EQ (face, Vdefault_face); + cachel->face = face; + + /* We normally only set the _specified flags if the value was + actually bound. The exception is for the default face where + we always set it since it is the ultimate fallback. */ + FROB (foreground); FROB (background); FROB (display_table); - FROB (background_pixmap); - /* - * A face's background pixmap will override the face's - * background color. But the background pixmap of the - * default face should not override the background color of - * a face if the background color has been specified or - * inherited. - * - * To accomplish this we remove the background pixmap of the - * cachel and mark it as having been specified so that cachel - * merging won't override it later. - */ - if (! default_face - && cachel->background_specified - && ! cachel->background_pixmap_specified) + /* #### WARNING: the background pixmap property of faces is currently + the only one dealing with images. The problem we have here is that + frobbing the background pixmap might lead to image instantiation + which in turn might require that the cache we're building be up to + date, hence a crash. Here's a typical scenario of this: + + - a new window is created and it's face cache elements are + initialized through a call to reset_face_cachels[1]. At that point, + the cache for the default and modeline faces (normaly taken care of + by redisplay itself) are null. + - the default face has a background pixmap which needs to be + instantiated right here, as a consequence of cache initialization. + - the background pixmap image happens to be instantiated as a string + (this happens on tty's for instance). + - In order to do this, we need to compute the string geometry. + - In order to do this, we might have to access the window's default + face cache. But this is the cache we're building right now, it is + null. + - BARF !!!!! + + To sum up, this means that it is in general unsafe to instantiate + images before face cache updating is complete (appart from image + related face attributes). The solution we use below is to actually + detect whether we're building the window's face_cachels for the first + time, and simply NOT frob the background pixmap in that case. If + other image-related face attributes are ever implemented, they should + be protected the same way right here. + + One note: + * See comment in `default_face_font_info' in face.c. Who wrote it ? + Maybe we have the begining of an answer here ? + + Footnotes: + [1] See comment at the top of `allocate_window' in window.c. + + -- didier + */ + if (! WINDOWP (domain) + || WINDOW_FACE_CACHEL (DOMAIN_XWINDOW (domain), DEFAULT_INDEX)) { - cachel->background_pixmap = Qunbound; - cachel->background_pixmap_specified = 1; + FROB (background_pixmap); + MAYBE_UNFROB_BACKGROUND_PIXMAP; } - #undef FROB +#undef MAYBE_UNFROB_BACKGROUND_PIXMAP ensure_face_cachel_contains_charset (cachel, domain, Vcharset_ascii); @@ -1317,20 +1395,6 @@ reset_face_cachel (struct face_cachel *cachel) cachel->background_pixmap = Qunbound; } -/* Add a cachel for the given face to the given window's cache. */ - -static void -add_face_cachel (struct window *w, Lisp_Object face) -{ - struct face_cachel new_cachel; - Lisp_Object window; - - reset_face_cachel (&new_cachel); - XSETWINDOW (window, w); - update_face_cachel_data (&new_cachel, window, face); - Dynarr_add (w->face_cachels, new_cachel); -} - /* Retrieve the index to a cachel for window W that corresponds to the specified face. If necessary, add a new element to the cache. */ diff --git a/src/fileio.c b/src/fileio.c index a726938..5a6d477 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -748,7 +748,7 @@ See also the function `substitute-in-file-name'. */ (name, default_directory)) { - /* This function can GC. GC-checked 2000-07-11 ben */ + /* This function can GC. GC-checked 2000-11-18 */ Bufbyte *nm; Bufbyte *newdir, *p, *o; @@ -761,14 +761,14 @@ See also the function `substitute-in-file-name'. struct passwd *pw; #endif /* WIN32_NATIVE */ int length; - Lisp_Object handler; + Lisp_Object handler = Qnil; #ifdef CYGWIN char *user; #endif - struct gcpro gcpro1, gcpro2; + struct gcpro gcpro1, gcpro2, gcpro3; /* both of these get set below */ - GCPRO2 (name, default_directory); + GCPRO3 (name, default_directory, handler); CHECK_STRING (name); @@ -776,11 +776,8 @@ See also the function `substitute-in-file-name'. call the corresponding file handler. */ handler = Ffind_file_name_handler (name, Qexpand_file_name); if (!NILP (handler)) - { - UNGCPRO; - return call3_check_string (handler, Qexpand_file_name, name, - default_directory); - } + RETURN_UNGCPRO (call3_check_string (handler, Qexpand_file_name, + name, default_directory)); /* Use the buffer's default-directory if DEFAULT_DIRECTORY is omitted. */ if (NILP (default_directory)) @@ -792,10 +789,8 @@ See also the function `substitute-in-file-name'. { handler = Ffind_file_name_handler (default_directory, Qexpand_file_name); if (!NILP (handler)) - { - UNGCPRO; - return call3 (handler, Qexpand_file_name, name, default_directory); - } + RETURN_UNGCPRO (call3 (handler, Qexpand_file_name, + name, default_directory)); } o = XSTRING_DATA (default_directory); @@ -1322,14 +1317,30 @@ No component of the resulting pathname will be a symbolic link, as we just use our own version in realpath.c. */ for (;;) { - p = (Extbyte *) memchr (p + 1, '/', elen - (p + 1 - path)); - if (p) - *p = 0; + Extbyte *pos; + +#ifdef WIN32_NATIVE + if (IS_DRIVE (p[0]) && IS_DEVICE_SEP (p[1]) + && IS_DIRECTORY_SEP (p[2])) + /* don't test c: on windows */ + p = p+2; + else if (IS_DIRECTORY_SEP (p[0]) && IS_DIRECTORY_SEP (p[1])) + /* start after // */ + p = p+1; +#endif + for (pos = p + 1; pos < path + elen; pos++) + if (IS_DIRECTORY_SEP (*pos)) + { + *(p = pos) = 0; + break; + } + if (p != pos) + p = 0; if (xrealpath ((char *) path, resolved_path)) { if (p) - *p = '/'; + *p = DIRECTORY_SEP; else break; @@ -1348,13 +1359,13 @@ No component of the resulting pathname will be a symbolic link, as { int plen = elen - (p - path); - if (rlen > 1 && resolved_path[rlen - 1] == '/') + if (rlen > 1 && IS_DIRECTORY_SEP (resolved_path[rlen - 1])) rlen = rlen - 1; if (plen + rlen + 1 > countof (resolved_path)) goto toolong; - resolved_path[rlen] = '/'; + resolved_path[rlen] = DIRECTORY_SEP; memcpy (resolved_path + rlen + 1, p + 1, plen + 1 - 1); } break; @@ -1367,12 +1378,12 @@ No component of the resulting pathname will be a symbolic link, as { Lisp_Object resolved_name; int rlen = strlen (resolved_path); - if (elen > 0 && XSTRING_BYTE (expanded_name, elen - 1) == '/' - && !(rlen > 0 && resolved_path[rlen - 1] == '/')) + if (elen > 0 && IS_DIRECTORY_SEP (XSTRING_BYTE (expanded_name, elen - 1)) + && !(rlen > 0 && IS_DIRECTORY_SEP (resolved_path[rlen - 1]))) { if (rlen + 1 > countof (resolved_path)) goto toolong; - resolved_path[rlen++] = '/'; + resolved_path[rlen++] = DIRECTORY_SEP; resolved_path[rlen] = '\0'; } TO_INTERNAL_FORMAT (DATA, (resolved_path, rlen), @@ -3394,7 +3405,7 @@ to the value of CODESYS. If this is nil, no code conversion occurs. message ("Wrote %s", XSTRING_DATA (visit_file)); else { - Lisp_Object fsp; + Lisp_Object fsp = Qnil; struct gcpro nngcpro1; NNGCPRO1 (fsp); @@ -3735,7 +3746,7 @@ An argument specifies the modification time value to use } else { - Lisp_Object filename; + Lisp_Object filename = Qnil; struct stat st; Lisp_Object handler; struct gcpro gcpro1, gcpro2, gcpro3; diff --git a/src/filelock.c b/src/filelock.c index 308565b..531000e 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -320,6 +320,7 @@ lock_file (Lisp_Object fn) return; XSETBUFFER (old_current_buffer, current_buffer); + subject_buf = Qnil; GCPRO3 (fn, subject_buf, old_current_buffer); orig_fn = fn; fn = Fexpand_file_name (fn, Qnil); diff --git a/src/free-hook.c b/src/free-hook.c index 5022b57..4dbd9ba 100644 --- a/src/free-hook.c +++ b/src/free-hook.c @@ -491,6 +491,8 @@ log_gcpro (char *file, int line, struct gcpro *value, blocktype type) if (value == gcprolist->next->next) goto OK; if (! gcprolist->next->next) abort (); if (value == gcprolist->next->next->next) goto OK; + if (! gcprolist->next->next->next) abort (); + if (value == gcprolist->next->next->next->next) goto OK; abort (); OK:; } @@ -587,6 +589,7 @@ show_gcprohist (void) gcprohist[j].type == gcpro2_type ? "GCPRO2" : gcprohist[j].type == gcpro3_type ? "GCPRO3" : gcprohist[j].type == gcpro4_type ? "GCPRO4" : + gcprohist[j].type == gcpro5_type ? "GCPRO5" : gcprohist[j].type == ungcpro_type ? "UNGCPRO" : "???"), gcprohist[j].value); } diff --git a/src/glyphs-x.c b/src/glyphs-x.c index ed706f9..9a0e296 100644 --- a/src/glyphs-x.c +++ b/src/glyphs-x.c @@ -2954,6 +2954,17 @@ image_instantiator_format_create_glyphs_x (void) IIFORMAT_HAS_METHOD (autodetect, validate); IIFORMAT_HAS_METHOD (autodetect, normalize); IIFORMAT_HAS_METHOD (autodetect, possible_dest_types); + /* #### autodetect is flawed IMO: + 1. It makes the assumption that you can detect whether the user + wanted a cursor or a string based on the data, since the data is a + string you have to prioritise cursors. Instead we will force users + to pick the appropriate image type, this is what we do under + MS-Windows anyway. + 2. It doesn't fit with the new domain model - you cannot tell which + domain it needs to be instantiated in until you've actually + instantiated it, which mucks up caching. + 3. It only copes with cursors and strings which seems bogus. */ + IIFORMAT_HAS_SHARED_METHOD (autodetect, governing_domain, subwindow); IIFORMAT_HAS_METHOD (autodetect, instantiate); IIFORMAT_VALID_CONSOLE (x, autodetect); diff --git a/src/gpmevent.c b/src/gpmevent.c index a3c3d46..40ebaca 100644 --- a/src/gpmevent.c +++ b/src/gpmevent.c @@ -112,7 +112,7 @@ This function is the process handler for the GPM connection. Gpm_Event ev; int modifiers = 0; int button = 1; - Lisp_Object fake_event; + Lisp_Object fake_event = Qnil; Lisp_Event *event = NULL; struct gcpro gcpro1; static int num_events; @@ -217,9 +217,9 @@ tty_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type struct device *d = decode_device (Qnil); int fd = DEVICE_INFD (d); char c = 3; - Lisp_Object output_stream; - Lisp_Object terminal_stream; - Lisp_Object output_string; + Lisp_Object output_stream = Qnil; + Lisp_Object terminal_stream = Qnil ; + Lisp_Object output_string = Qnil; struct gcpro gcpro1,gcpro2,gcpro3; GCPRO3(output_stream,terminal_stream,output_string); diff --git a/src/gutter.c b/src/gutter.c index 72fb052..c250589 100644 --- a/src/gutter.c +++ b/src/gutter.c @@ -218,6 +218,41 @@ get_gutter_coords (struct frame *f, enum gutter_pos pos, int *x, int *y, } } +/* + display_boxes_in_gutter_p + + Determine whether the required display_glyph_area is completely + inside the gutter. -1 means the display_box is not in the gutter. 1 + means the display_box and the display_glyph_area are in the + window. 0 means the display_box is in the gutter but the + display_glyph_area is not. */ +int display_boxes_in_gutter_p (struct frame *f, struct display_box* db, + struct display_glyph_area* dga) +{ + enum gutter_pos pos; + GUTTER_POS_LOOP (pos) + { + if (FRAME_GUTTER_VISIBLE (f, pos)) + { + int x, y, width, height; + get_gutter_coords (f, pos, &x, &y, &width, &height); + if (db->xpos + dga->xoffset >= x + && + db->ypos + dga->yoffset >= y + && + db->xpos + dga->xoffset + dga->width <= x + width + && + db->ypos + dga->yoffset + dga->height <= y + height) + return 1; + else if (db->xpos >= x && db->ypos >= y + && db->xpos + db->width <= x + width + && db->ypos + db->height <= y + height) + return 0; + } + } + return -1; +} + /* Convert the gutter specifier into something we can actually display. */ static Lisp_Object construct_window_gutter_spec (struct window* w, @@ -389,7 +424,8 @@ output_gutter (struct frame *f, enum gutter_pos pos, int force) (f->extents_changed && w->gutter_extent_modiff[pos])) { #ifdef DEBUG_GUTTERS - printf ("gutter redisplay triggered by %s\n", force ? "force" : + printf ("gutter redisplay [%dx%d@%d+%d] triggered by %s,\n", + width, height, x, y, force ? "force" : f->faces_changed ? "f->faces_changed" : f->frame_changed ? "f->frame_changed" : f->gutter_changed ? "f->gutter_changed" : diff --git a/src/gutter.h b/src/gutter.h index 1f642bc..0cd951f 100644 --- a/src/gutter.h +++ b/src/gutter.h @@ -65,6 +65,8 @@ void redraw_exposed_gutters (struct frame *f, int x, int y, int width, void reset_gutter_display_lines (struct frame* f); void gutter_extent_signal_changed_region_maybe (Lisp_Object obj, Bufpos start, Bufpos end); +int display_boxes_in_gutter_p (struct frame *f, struct display_box* db, + struct display_glyph_area* dga); #define WINDOW_GUTTER_BORDER_WIDTH(w, pos) \ (INTP ((w)->gutter_border_width[pos]) ? XINT ((w)->gutter_border_width[pos]) : 0) diff --git a/src/inline.c b/src/inline.c index d3824d2..3db3be5 100644 --- a/src/inline.c +++ b/src/inline.c @@ -44,6 +44,7 @@ Boston, MA 02111-1307, USA. */ #include "lisp.h" #include "buffer.h" #include "bytecode.h" +#include "casetab.h" #include "chartab.h" #include "console.h" #include "device.h" diff --git a/src/keymap.c b/src/keymap.c index 1d6ef6e..cd66cef 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1542,7 +1542,7 @@ key_desc_list_to_event (Lisp_Object list, Lisp_Object event, int event_matches_key_specifier_p (Lisp_Event *event, Lisp_Object key_specifier) { - Lisp_Object event2; + Lisp_Object event2 = Qnil; int retval; struct gcpro gcpro1; diff --git a/src/lisp.h b/src/lisp.h index a23c5bc..1e51d03 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -280,17 +280,16 @@ void assert_failed (const char *, int, const char *); /* basic char/int typedefs */ /* ------------------------------- */ -/* The definitions we put here use typedefs to convey additional meaning to - types that by themselves are pretty general. Stuff pointed to by a +/* The definitions we put here use typedefs to attribute specific meaning + to types that by themselves are pretty general. Stuff pointed to by a char * or unsigned char * will nearly always be one of four types: a) pointer to internally-formatted text; b) pointer to text in some external format, which can be defined as all formats other than the internal one; c) pure ASCII text; d) binary data that is not meant to be interpreted as text. [A fifth possible type "e) a general pointer - to memory" should be replaced with void *.] By using these more specific - types in lieu of the general ones, you clear up greatly the confusions - that inevitably will occur when it's not clearly known the semantics of - a char * argument being studied. */ + to memory" should be replaced with void *.] Using these more specific + types rather than the general ones helps avoid the confusions that + occur when the semantics of a char * argument being studied are unclear. */ typedef unsigned char UChar; @@ -2734,7 +2733,7 @@ void write_string_1 (const Bufbyte *, Bytecount, Lisp_Object); void print_cons (Lisp_Object, Lisp_Object, int); void print_vector (Lisp_Object, Lisp_Object, int); void print_string (Lisp_Object, Lisp_Object, int); -void long_to_string (char *, long); +char *long_to_string (char *, long); void print_internal (Lisp_Object, Lisp_Object, int); void print_symbol (Lisp_Object, Lisp_Object, int); void print_float (Lisp_Object, Lisp_Object, int); @@ -2772,7 +2771,7 @@ Bytind bi_find_next_newline_no_quit (struct buffer *, Bytind, int); Bytind bi_find_next_emchar_in_string (Lisp_String*, Emchar, Bytind, EMACS_INT); Bufpos find_before_next_newline (struct buffer *, Bufpos, Bufpos, int); struct re_pattern_buffer *compile_pattern (Lisp_Object, struct re_registers *, - char *, int, Error_behavior); + Lisp_Object, int, Error_behavior); Bytecount fast_string_match (Lisp_Object, const Bufbyte *, Lisp_Object, Bytecount, Bytecount, int, Error_behavior, int); @@ -3186,9 +3185,8 @@ extern Lisp_Object Qwrong_type_argument, Qyes_or_no_p; /*--------------- prototypes for variables of type Lisp_Object ------------*/ -extern Lisp_Object Vactivate_menubar_hook, Vascii_canon_table; -extern Lisp_Object Vascii_downcase_table, Vascii_eqv_table; -extern Lisp_Object Vascii_upcase_table, Vautoload_queue, Vblank_menubar; +extern Lisp_Object Vactivate_menubar_hook; +extern Lisp_Object Vautoload_queue, Vblank_menubar; extern Lisp_Object Vcharset_ascii, Vcharset_composite, Vcharset_control_1; extern Lisp_Object Vcharset_latin_iso8859_1, Vcharset_greek_iso8859_7; extern Lisp_Object Vcharset_cyrillic_iso8859_5, Vcharset_hebrew_iso8859_8; @@ -3213,8 +3211,6 @@ extern Lisp_Object Vload_file_name_internal; extern Lisp_Object Vload_file_name_internal_the_purecopy, Vload_history; extern Lisp_Object Vload_path, Vmark_even_if_inactive, Vmenubar_configuration; extern Lisp_Object Vminibuf_preprompt, Vminibuf_prompt, Vminibuffer_zero; -extern Lisp_Object Vmirror_ascii_canon_table, Vmirror_ascii_downcase_table; -extern Lisp_Object Vmirror_ascii_eqv_table, Vmirror_ascii_upcase_table; extern Lisp_Object Vmodule_directory, Vmswindows_downcase_file_names; extern Lisp_Object Vmswindows_get_true_file_attributes, Vobarray; extern Lisp_Object Vprint_length, Vprint_level, Vprocess_environment; diff --git a/src/lrecord.h b/src/lrecord.h index 6ae8581..0acf348 100644 --- a/src/lrecord.h +++ b/src/lrecord.h @@ -217,6 +217,7 @@ enum lrecord_type lrecord_type_pgresult, lrecord_type_devmode, lrecord_type_mswindows_dialog_id, + lrecord_type_case_table, lrecord_type_last_built_in_type /* must be last */ }; @@ -361,10 +362,6 @@ extern int gc_in_progress; An array of Lisp objects or pointers to lrecords. The third element is the count. - XD_LO_RESET_NIL - Lisp objects which will be reset to Qnil when dumping. Useful for cleaning - up caches. - XD_LO_LINK Link in a linked list of objects of the same type. @@ -419,7 +416,6 @@ extern int gc_in_progress; enum lrecord_description_type { XD_LISP_OBJECT_ARRAY, XD_LISP_OBJECT, - XD_LO_RESET_NIL, XD_LO_LINK, XD_OPAQUE_PTR, XD_STRUCT_PTR, diff --git a/src/menubar-x.c b/src/menubar-x.c index 34932dd..49c23a5 100644 --- a/src/menubar-x.c +++ b/src/menubar-x.c @@ -1236,7 +1236,7 @@ command_builder_find_menu_accelerator (struct command_builder *builder) if (menubar_widget && CONSP (Vmenu_accelerator_modifiers)) { - Lisp_Object fake; + Lisp_Object fake = Qnil; Lisp_Object last = Qnil; struct gcpro gcpro1; Lisp_Object matchp; diff --git a/src/mule-charset.c b/src/mule-charset.c index 7dc68f2..eff242e 100644 --- a/src/mule-charset.c +++ b/src/mule-charset.c @@ -2039,8 +2039,9 @@ DEFINE_LRECORD_IMPLEMENTATION ("charset", charset, mark_charset, print_charset, 0, 0, 0, charset_description, Lisp_Charset); -/* Make a new charset. */ +/* Make a new charset. */ +/* #### SJT Should generic properties be allowed? */ static Lisp_Object make_charset (Charset_ID id, Lisp_Object name, unsigned short chars, unsigned char dimension, @@ -2560,6 +2561,7 @@ Return the name of charset CHARSET. return XCHARSET_NAME (Fget_charset (charset)); } +/* #### SJT Should generic properties be allowed? */ DEFUN ("make-charset", Fmake_charset, 3, 3, 0, /* Define a new character set. This function is for use with Mule support. @@ -2932,7 +2934,7 @@ Return dimension of CHARSET. } DEFUN ("charset-property", Fcharset_property, 2, 2, 0, /* -Return property PROP of CHARSET. +Return property PROP of CHARSET, a charset object or symbol naming a charset. Recognized properties are those listed in `make-charset', as well as 'name and 'doc-string. */ @@ -2960,10 +2962,8 @@ Recognized properties are those listed in `make-charset', as well as if (EQ (prop, Qreverse_direction_charset)) { Lisp_Object obj = CHARSET_REVERSE_DIRECTION_CHARSET (cs); - if (NILP (obj)) - return Qnil; - else - return XCHARSET_NAME (obj); + /* #### Is this translation OK? If so, error checking sufficient? */ + return CHARSETP (obj) ? XCHARSET_NAME (obj) : obj; } signal_simple_error ("Unrecognized charset property name", prop); return Qnil; /* not reached */ diff --git a/src/postgresql.c b/src/postgresql.c index 00ca1ae..66807a3 100644 --- a/src/postgresql.c +++ b/src/postgresql.c @@ -1698,8 +1698,6 @@ syms_of_postgresql(void) void vars_of_postgresql(void) { - char *p; - Fprovide (Qpostgresql); #ifdef HAVE_POSTGRESQLV7 Fprovide (intern ("postgresqlv7")); @@ -1711,6 +1709,97 @@ Default Postgres client coding system. */ ); #endif + DEFVAR_LISP ("pg:host", &VXPGHOST /* +Default PostgreSQL server name. +If not set, the server running on the local host is used. The +initial value is set from the PGHOST environment variable. +*/ ); + + DEFVAR_LISP ("pg:user", &VXPGUSER /* +Default PostgreSQL user name. +This value is used when connecting to a database for authentication. +The initial value is set from the PGUSER environment variable. +*/ ); + + DEFVAR_LISP ("pg:options", &VXPGOPTIONS /* +Default PostgreSQL user name. +This value is used when connecting to a database for authentication. +The initial value is set from the PGUSER environment variable. +*/ ); + + DEFVAR_LISP ("pg:port", &VXPGPORT /* +Default port to connect to PostgreSQL backend. +This value is used when connecting to a database. +The initial value is set from the PGPORT environment variable. +*/ ); + + DEFVAR_LISP ("pg:tty", &VXPGTTY /* +Default debugging TTY. +There is no useful setting of this variable in the XEmacs Lisp API. +The initial value is set from the PGTTY environment variable. +*/ ); + + DEFVAR_LISP ("pg:database", &VXPGDATABASE /* +Default database to connect to. +The initial value is set from the PGDATABASE environment variable. +*/ ); + + DEFVAR_LISP ("pg:realm", &VXPGREALM /* +Default kerberos realm to use for authentication. +The initial value is set from the PGREALM environment variable. +*/ ); + +#ifdef MULE + /* It's not clear whether this is any use. My intent is to + autodetect the coding system from the database. */ + DEFVAR_LISP ("pg:client-encoding", &VXPGCLIENTENCODING /* +Default client encoding to use. +The initial value is set from the PGCLIENTENCODING environment variable. +*/ ); +#endif + +#if !defined(HAVE_POSTGRESQLV7) + DEFVAR_LISP ("pg:authtype", &VXPGAUTHTYPE /* +Default authentication to use. +The initial value is set from the PGAUTHTYPE environment variable. + +WARNING: This variable has gone away in versions of PostgreSQL newer +than 6.5. +*/ ); +#endif + + DEFVAR_LISP ("pg:geqo", &VXPGGEQO /* +Genetic Query Optimizer options. +The initial value is set from the PGGEQO environment variable. +*/ ); + + DEFVAR_LISP ("pg:cost-index", &VXPGCOSTINDEX /* +Default cost index options. +The initial value is set from the PGCOSTINDEX environment variable. +*/ ); + + DEFVAR_LISP ("pg:cost-heap", &VXPGCOSTHEAP /* +Default cost heap options. +The initial value is set from the PGCOSTHEAP environment variable. +*/ ); + + DEFVAR_LISP ("pg:tz", &VXPGTZ /* +Default timezone to use. +The initial value is set from the PGTZ environment variable. +*/ ); + + DEFVAR_LISP ("pg:date-style", &VXPGDATESTYLE /* +Default date style to use. +The initial value is set from the PGDATESTYLE environment variable. +*/ ); +} + +/* These initializations should not be done at dump-time. */ +void +init_postgresql_from_environment(void) +{ + char *p; + if ((p = getenv ("PGHOST"))) { VXPGHOST = build_ext_string (p, PG_OS_CODING); @@ -1719,11 +1808,6 @@ Default Postgres client coding system. { VXPGHOST = Qnil; } - DEFVAR_LISP ("pg:host", &VXPGHOST /* -Default PostgreSQL server name. -If not set, the server running on the local host is used. The -initial value is set from the PGHOST environment variable. -*/ ); if ((p = getenv ("PGUSER"))) { @@ -1733,11 +1817,6 @@ initial value is set from the PGHOST environment variable. { VXPGUSER = Qnil; } - DEFVAR_LISP ("pg:user", &VXPGUSER /* -Default PostgreSQL user name. -This value is used when connecting to a database for authentication. -The initial value is set from the PGUSER environment variable. -*/ ); if ((p = getenv ("PGOPTIONS"))) { @@ -1747,11 +1826,6 @@ The initial value is set from the PGUSER environment variable. { VXPGOPTIONS = Qnil; } - DEFVAR_LISP ("pg:options", &VXPGOPTIONS /* -Default PostgreSQL user name. -This value is used when connecting to a database for authentication. -The initial value is set from the PGUSER environment variable. -*/ ); if ((p = getenv ("PGPORT"))) { @@ -1761,11 +1835,6 @@ The initial value is set from the PGUSER environment variable. { VXPGPORT = Qnil; } - DEFVAR_LISP ("pg:port", &VXPGPORT /* -Default port to connect to PostgreSQL backend. -This value is used when connecting to a database. -The initial value is set from the PGPORT environment variable. -*/ ); if ((p = getenv ("PGTTY"))) { @@ -1775,11 +1844,6 @@ The initial value is set from the PGPORT environment variable. { VXPGTTY = Qnil; } - DEFVAR_LISP ("pg:tty", &VXPGTTY /* -Default debugging TTY. -There is no useful setting of this variable in the XEmacs Lisp API. -The initial value is set from the PGTTY environment variable. -*/ ); if ((p = getenv ("PGDATABASE"))) { @@ -1789,10 +1853,6 @@ The initial value is set from the PGTTY environment variable. { VXPGDATABASE = Qnil; } - DEFVAR_LISP ("pg:database", &VXPGDATABASE /* -Default database to connect to. -The initial value is set from the PGDATABASE environment variable. -*/ ); if ((p = getenv ("PGREALM"))) { @@ -1802,10 +1862,6 @@ The initial value is set from the PGDATABASE environment variable. { VXPGREALM = Qnil; } - DEFVAR_LISP ("pg:realm", &VXPGREALM /* -Default kerberos realm to use for authentication. -The initial value is set from the PGREALM environment variable. -*/ ); #ifdef MULE /* It's not clear whether this is any use. My intent is to @@ -1818,10 +1874,6 @@ The initial value is set from the PGREALM environment variable. { VXPGCLIENTENCODING = Qnil; } - DEFVAR_LISP ("pg:client-encoding", &VXPGCLIENTENCODING /* -Default client encoding to use. -The initial value is set from the PGCLIENTENCODING environment variable. -*/ ); #endif #if !defined(HAVE_POSTGRESQLV7) @@ -1833,13 +1885,6 @@ The initial value is set from the PGCLIENTENCODING environment variable. { VXPGAUTHTYPE = Qnil; } - DEFVAR_LISP ("pg:authtype", &VXPGAUTHTYPE /* -Default authentication to use. -The initial value is set from the PGAUTHTYPE environment variable. - -WARNING: This variable has gone away in versions of PostgreSQL newer -than 6.5. -*/ ); #endif if ((p = getenv ("PGGEQO"))) @@ -1850,10 +1895,6 @@ than 6.5. { VXPGGEQO = Qnil; } - DEFVAR_LISP ("pg:geqo", &VXPGGEQO /* -Genetic Query Optimizer options. -The initial value is set from the PGGEQO environment variable. -*/ ); if ((p = getenv ("PGCOSTINDEX"))) { @@ -1863,10 +1904,6 @@ The initial value is set from the PGGEQO environment variable. { VXPGCOSTINDEX = Qnil; } - DEFVAR_LISP ("pg:cost-index", &VXPGCOSTINDEX /* -Default cost index options. -The initial value is set from the PGCOSTINDEX environment variable. -*/ ); if ((p = getenv ("PGCOSTHEAP"))) { @@ -1876,10 +1913,6 @@ The initial value is set from the PGCOSTINDEX environment variable. { VXPGCOSTHEAP = Qnil; } - DEFVAR_LISP ("pg:cost-heap", &VXPGCOSTHEAP /* -Default cost heap options. -The initial value is set from the PGCOSTHEAP environment variable. -*/ ); if ((p = getenv ("PGTZ"))) { @@ -1889,10 +1922,6 @@ The initial value is set from the PGCOSTHEAP environment variable. { VXPGTZ = Qnil; } - DEFVAR_LISP ("pg:tz", &VXPGTZ /* -Default timezone to use. -The initial value is set from the PGTZ environment variable. -*/ ); if ((p = getenv ("PGDATESTYLE"))) { @@ -1902,8 +1931,5 @@ The initial value is set from the PGTZ environment variable. { VXPGDATESTYLE = Qnil; } - DEFVAR_LISP ("pg:date-style", &VXPGDATESTYLE /* -Default date style to use. -The initial value is set from the PGDATESTYLE environment variable. -*/ ); } + diff --git a/src/print.c b/src/print.c index 73f0960..cdb75af 100644 --- a/src/print.c +++ b/src/print.c @@ -935,18 +935,19 @@ float_to_string (char *buf, double data) } #endif /* LISP_FLOAT_TYPE */ -/* Print NUMBER to BUFFER. This is equivalent to sprintf(buffer, - "%ld", number), only much faster. +/* Print NUMBER to BUFFER. + This is equivalent to sprintf (buffer, "%ld", number), only much faster. BUFFER should accept 24 bytes. This should suffice for the longest numbers on 64-bit machines, including the `-' sign and the trailing - \0. */ -void + '\0'. Returns a pointer to the trailing '\0'. */ +char * long_to_string (char *buffer, long number) { #if (SIZEOF_LONG != 4) && (SIZEOF_LONG != 8) /* Huh? */ sprintf (buffer, "%ld", number); + return buffer + strlen (buffer); #else /* (SIZEOF_LONG == 4) || (SIZEOF_LONG == 8) */ char *p = buffer; int force = 0; @@ -984,6 +985,7 @@ long_to_string (char *buffer, long number) #undef FROB *p++ = number + '0'; *p = '\0'; + return p; #endif /* (SIZEOF_LONG == 4) || (SIZEOF_LONG == 8) */ } @@ -1420,6 +1422,7 @@ print_symbol (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) write_char_internal ("#", printcharfun); print_internal (XCDR (tem), printcharfun, escapeflag); write_char_internal ("#", printcharfun); + UNGCPRO; return; } else diff --git a/src/realpath.c b/src/realpath.c index be14a42..94b4699 100644 --- a/src/realpath.c +++ b/src/realpath.c @@ -23,18 +23,14 @@ Boston, MA 02111-1307, USA. */ /* Synched up with: Not in FSF. */ #include - -#include -#include -#include +#include "lisp.h" #include -#include #ifdef HAVE_UNISTD_H #include #endif -#if defined (HAVE_SYS_PARAM_H) +#if defined (HAVE_SYS_PARAM_H) && !defined (WIN32_NATIVE) #include #endif @@ -44,6 +40,133 @@ Boston, MA 02111-1307, USA. */ #include /* for S_IFLNK */ +/* First char after start of absolute filename. */ +#define ABS_START(name) (name + ABS_LENGTH (name)) + +#if defined (WIN32_NATIVE) +/* Length of start of absolute filename. */ +# define ABS_LENGTH(name) (win32_abs_start (name)) +static int win32_abs_start (const char * name); +/* System dependent version of readlink. */ +# define system_readlink win32_readlink +#else +# ifdef CYGWIN +# define ABS_LENGTH(name) (IS_DIRECTORY_SEP (*name) ? \ + (IS_DIRECTORY_SEP (name[1]) ? 2 : 1) : 0) +# define system_readlink cygwin_readlink +# else +# define ABS_LENGTH(name) (IS_DIRECTORY_SEP (*name) ? 1 : 0) +# define system_readlink readlink +# endif /* CYGWIN */ +#endif /* WIN32_NATIVE */ + +#if defined (WIN32_NATIVE) || defined (CYGWIN) +#include "syswindows.h" +/* Emulate readlink on win32 - finds real name (i.e. correct case) of + a file. UNC servers and shares are lower-cased. Directories must be + given without trailing '/'. One day, this could read Win2K's + reparse points. */ +static int +win32_readlink (const char * name, char * buf, int size) +{ + WIN32_FIND_DATA find_data; + HANDLE dir_handle = NULL; + int len = 0; + int err = 0; + const char* lastname; + int count = 0; + const char* tmp; + char* res = NULL; + + assert (*name); + + /* Sort of check we have a valid filename. */ + if (strpbrk (name, "*?|<>\"") || strlen (name) >= MAX_PATH) + { + errno = EIO; + return -1; + } + + /* Find start of filename */ + lastname = name + strlen (name); + while (lastname > name && !IS_DIRECTORY_SEP (lastname[-1])) + --lastname; + + /* Count slashes in unc path */ + if (ABS_LENGTH (name) == 2) + for (tmp = name; *tmp; tmp++) + if (IS_DIRECTORY_SEP (*tmp)) + count++; + + if (count >= 2 && count < 4) + { + /* UNC server or share name: just copy lowercased name. */ + res = find_data.cFileName; + for (tmp = lastname; *tmp; tmp++) + *res++ = tolower (*tmp); + *res = '\0'; + } + else + dir_handle = FindFirstFile (name, &find_data); + + if (res || dir_handle != INVALID_HANDLE_VALUE) + { + if ((len = strlen (find_data.cFileName)) < size) + { + if (strcmp (lastname, find_data.cFileName) == 0) + /* Signal that the name is already OK. */ + err = EINVAL; + else + memcpy (buf, find_data.cFileName, len + 1); + } + else + err = ENAMETOOLONG; + if (!res) FindClose (dir_handle); + } + else + err = ENOENT; + + errno = err; + return err ? -1 : len; +} +#endif /* WIN32_NATIVE || CYGWIN */ + +#ifdef CYGWIN +/* Call readlink and try to find out the correct case for the file. */ +static int +cygwin_readlink (const char * name, char * buf, int size) +{ + int n = readlink (name, buf, size); + if (n < 0) + { + /* The file may exist, but isn't a symlink. Try to find the + right name. */ + char* tmp = alloca (cygwin_posix_to_win32_path_list_buf_size (name)); + cygwin_posix_to_win32_path_list (name, tmp); + n = win32_readlink (tmp, buf, size); + } + return n; +} +#endif /* CYGWIN */ + +#ifdef WIN32_NATIVE +#ifndef ELOOP +#define ELOOP 10062 /* = WSAELOOP in winsock.h */ +#endif +/* Length of start of absolute filename. */ +static int +win32_abs_start (const char * name) +{ + if (isalpha (*name) && IS_DEVICE_SEP (name[1]) + && IS_DIRECTORY_SEP (name[2])) + return 3; + else if (IS_DIRECTORY_SEP (*name)) + return IS_DIRECTORY_SEP (name[1]) ? 2 : 1; + else + return 0; +} +#endif /* WIN32_NATIVE */ + #if !defined (HAVE_GETCWD) && defined (HAVE_GETWD) #undef getcwd #define getcwd(buffer, len) getwd (buffer) @@ -68,78 +191,63 @@ xrealpath (const char *path, char resolved_path []) char copy_path[PATH_MAX]; char *new_path = resolved_path; char *max_path; -#ifdef S_IFLNK +#if defined (S_IFLNK) || defined (WIN32_NATIVE) int readlinks = 0; char link_path[PATH_MAX]; int n; + int abslen = ABS_LENGTH (path); #endif /* Make a copy of the source path since we may need to modify it. */ strcpy (copy_path, path); path = copy_path; max_path = copy_path + PATH_MAX - 2; + #ifdef WIN32_NATIVE - /* - ** In NT we have two different cases: (1) the path name begins - ** with a drive letter, e.g., "C:"; and (2) the path name begins - ** with just a slash, which roots to the current drive. In the - ** first case we are going to leave things alone, in the second - ** case we will prepend the drive letter to the given path. - ** Note: So far in testing, I'm only seeing case #1, even though - ** I've tried to get the other cases to happen. - ** August Hill, 31 Aug 1997. - ** - ** Check for a driver letter...C:/... - */ - if (*(path + 1) == ':') + /* Check for c:/... or //server/... */ + if (abslen == 2 || abslen == 3) { - strncpy(new_path, path, 3); - new_path += 3; - path += 3; + strncpy (new_path, path, abslen); + new_path += abslen; + path += abslen; } - - /* - ** No drive letter, but a beginning slash? Prepend the drive - ** letter... - */ - else if (*path == '/') + /* No drive letter, but a beginning slash? Prepend drive letter. */ + else if (abslen == 1) { getcwd (new_path, PATH_MAX - 1); new_path += 3; path++; } - - /* - ** Just a path name, prepend the current directory - */ + /* Just a path name, prepend the current directory */ else { getcwd (new_path, PATH_MAX - 1); - new_path += strlen(new_path); - if (new_path[-1] != '/') - *new_path++ = '/'; + new_path += strlen (new_path); + if (!IS_DIRECTORY_SEP (new_path[-1])) + *new_path++ = DIRECTORY_SEP; } - #else /* If it's a relative pathname use getcwd for starters. */ - if (*path != '/') + if (abslen == 0) { getcwd (new_path, PATH_MAX - 1); - new_path += strlen(new_path); - if (new_path[-1] != '/') - *new_path++ = '/'; + new_path += strlen (new_path); + if (!IS_DIRECTORY_SEP (new_path[-1])) + *new_path++ = DIRECTORY_SEP; } else { - *new_path++ = '/'; - path++; + /* Copy first directory sep. May have two on cygwin. */ + strncpy (new_path, path, abslen); + new_path += abslen; + path += abslen; } #endif /* Expand each slash-separated pathname component. */ while (*path != '\0') { /* Ignore stray "/". */ - if (*path == '/') + if (IS_DIRECTORY_SEP (*path)) { path++; continue; @@ -148,7 +256,7 @@ xrealpath (const char *path, char resolved_path []) if (*path == '.') { /* Ignore ".". */ - if (path[1] == '\0' || path[1] == '/') + if (path[1] == '\0' || IS_DIRECTORY_SEP (path[1])) { path++; continue; @@ -156,23 +264,24 @@ xrealpath (const char *path, char resolved_path []) /* Handle ".." */ if (path[1] == '.' && - (path[2] == '\0' || path[2] == '/')) + (path[2] == '\0' || IS_DIRECTORY_SEP (path[2]))) { path += 2; /* Ignore ".." at root. */ - if (new_path == resolved_path + 1) + if (new_path == ABS_START (resolved_path)) continue; /* Handle ".." by backing up. */ - while ((--new_path)[-1] != '/') - ; + --new_path; + while (!IS_DIRECTORY_SEP (new_path[-1])) + --new_path; continue; } } /* Safely copy the next pathname component. */ - while (*path != '\0' && *path != '/') + while (*path != '\0' && !IS_DIRECTORY_SEP (*path)) { if (path > max_path) { @@ -182,10 +291,10 @@ xrealpath (const char *path, char resolved_path []) *new_path++ = *path++; } -#ifdef S_IFLNK +#if defined (S_IFLNK) || defined (WIN32_NATIVE) /* See if latest pathname component is a symlink. */ *new_path = '\0'; - n = readlink (resolved_path, link_path, PATH_MAX - 1); + n = system_readlink (resolved_path, link_path, PATH_MAX - 1); if (n < 0) { @@ -204,14 +313,14 @@ xrealpath (const char *path, char resolved_path []) /* Note: readlink doesn't add the null byte. */ link_path[n] = '\0'; - - if (*link_path == '/') + + if (ABS_LENGTH (link_path) > 0) /* Start over for an absolute symlink. */ - new_path = resolved_path; + new_path = resolved_path + ABS_LENGTH (link_path) - 1; else /* Otherwise back up over this component. */ - while (*(--new_path) != '/') - ; + for (--new_path; !IS_DIRECTORY_SEP (*new_path); --new_path) + assert (new_path > resolved_path); /* Safe sex check. */ if (strlen(path) + n >= PATH_MAX) @@ -225,15 +334,21 @@ xrealpath (const char *path, char resolved_path []) strcpy(copy_path, link_path); path = copy_path; } -#endif /* S_IFLNK */ - *new_path++ = '/'; +#endif /* S_IFLNK || WIN32_NATIVE */ + *new_path++ = DIRECTORY_SEP; } /* Delete trailing slash but don't whomp a lone slash. */ - if (new_path != resolved_path + 1 && new_path[-1] == '/') + if (new_path != ABS_START (resolved_path) && IS_DIRECTORY_SEP (new_path[-1])) new_path--; /* Make sure it's null terminated. */ *new_path = '\0'; + +#ifdef WIN32_NATIVE + if (ABS_LENGTH (resolved_path) == 3) + /* Lowercase drive letter. */ + *resolved_path = tolower (*resolved_path); +#endif return resolved_path; } diff --git a/src/redisplay-output.c b/src/redisplay-output.c index 6f2e65a..df280d7 100644 --- a/src/redisplay-output.c +++ b/src/redisplay-output.c @@ -40,6 +40,7 @@ Boston, MA 02111-1307, USA. */ #include "glyphs.h" #include "redisplay.h" #include "faces.h" +#include "gutter.h" static int compare_runes (struct window *w, struct rune *crb, struct rune *drb); @@ -1263,7 +1264,12 @@ redisplay_output_subwindow (struct window *w, sdga.height = IMAGE_INSTANCE_HEIGHT (p); sdga.width = IMAGE_INSTANCE_WIDTH (p); - if (redisplay_display_boxes_in_window_p (w, db, &sdga) < 0) + if (redisplay_display_boxes_in_window_p (w, db, &sdga) == 0 + || + /* We only want to do full subwindow display for windows that + are completely in the gutter, otherwise we must clip to be + safe. */ + display_boxes_in_gutter_p (XFRAME (w->frame), db, &sdga) <= 0) { map_subwindow (image_instance, db->xpos, db->ypos, dga); } @@ -1823,9 +1829,9 @@ redisplay_normalize_display_box (struct display_box* dest, /***************************************************************************** redisplay_display_boxes_in_window_p - Determine whether the require display_glyph_area is completely inside - the window. 0 means the display_box is not in the window. 1 means the - display_box and the display_glyph_area are in the window. -1 means + Determine whether the required display_glyph_area is completely inside + the window. -1 means the display_box is not in the window. 1 means the + display_box and the display_glyph_area are in the window. 0 means the display_box is in the window but the display_glyph_area is not. ****************************************************************************/ static int @@ -1841,8 +1847,8 @@ redisplay_display_boxes_in_window_p (struct window* w, if (db->xpos < left || db->ypos < top || db->xpos + db->width > right || db->ypos + db->height > bottom) - /* We are not displaying in a window at all */ - return 0; + /* We are not displaying in a window at all */ + return -1; if (db->xpos + dga->xoffset >= left && @@ -1853,7 +1859,7 @@ redisplay_display_boxes_in_window_p (struct window* w, db->ypos + dga->yoffset + dga->height <= bottom) return 1; - return -1; + return 0; } /***************************************************************************** diff --git a/src/redisplay.h b/src/redisplay.h index 27fc7e1..51d5297 100644 --- a/src/redisplay.h +++ b/src/redisplay.h @@ -139,7 +139,7 @@ struct rune union /* Information specific to the type of rune */ { - /* #### GLyps are are. Is it really necessary to waste 8 bytes on every + /* #### GLyphs are rare. Is it really necessary to waste 8 bytes on every rune for that?! */ /* DGLYPH */ struct diff --git a/src/regex.c b/src/regex.c index 9b7877e..1fa8680 100644 --- a/src/regex.c +++ b/src/regex.c @@ -104,7 +104,10 @@ complex_vars_of_regex (void) { } -#endif /* not MULE */ +#endif /* MULE */ + +#define RE_TRANSLATE(ch) TRT_TABLE_OF (translate, (Emchar) ch) +#define TRANSLATE_P(tr) (!NILP (tr)) #else /* not emacs */ @@ -173,11 +176,14 @@ init_syntax_once (void) } } -#endif /* not SYNTAX_TABLE */ +#endif /* SYNTAX_TABLE */ #define SYNTAX_UNSAFE(ignored, c) re_syntax_table[c] -#endif /* not emacs */ +#define RE_TRANSLATE(c) translate[(unsigned char) (c)] +#define TRANSLATE_P(tr) tr + +#endif /* emacs */ /* Under XEmacs, this is needed because we don't define it elsewhere. */ #ifdef SWITCH_ENUM_BUG @@ -288,8 +294,8 @@ init_syntax_once (void) #ifndef _AIX /* Already did AIX, up at the top. */ void *alloca (); #endif /* not _AIX */ -#endif /* not HAVE_ALLOCA_H */ -#endif /* not __GNUC__ */ +#endif /* HAVE_ALLOCA_H */ +#endif /* __GNUC__ */ #endif /* not alloca */ @@ -304,7 +310,7 @@ void *alloca (); /* No need to do anything to free, after alloca. */ #define REGEX_FREE(arg) ((void)0) /* Do nothing! But inhibit gcc warning. */ -#endif /* not REGEX_MALLOC */ +#endif /* REGEX_MALLOC */ /* Define how to allocate the failure stack. */ @@ -333,8 +339,8 @@ void *alloca (); /* No need to explicitly free anything. */ #define REGEX_FREE_STACK(arg) -#endif /* not REGEX_MALLOC */ -#endif /* not REL_ALLOC */ +#endif /* REGEX_MALLOC */ +#endif /* REL_ALLOC */ /* True if `size1' is non-NULL and PTR is pointing anywhere inside @@ -359,6 +365,9 @@ void *alloca (); #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) +/* Type of source-pattern and string chars. */ +typedef const unsigned char re_char; + typedef char boolean; #define false 0 #define true 1 @@ -554,7 +563,7 @@ typedef enum #ifdef DEBUG static void -extract_number (int *dest, unsigned char *source) +extract_number (int *dest, re_char *source) { int temp = SIGN_EXTEND_CHAR (*(source + 1)); *dest = *source & 0377; @@ -657,11 +666,11 @@ print_fastmap (char *fastmap) the START pointer into it and ending just before the pointer END. */ static void -print_partial_compiled_pattern (unsigned char *start, unsigned char *end) +print_partial_compiled_pattern (re_char *start, re_char *end) { int mcnt, mcnt2; - unsigned char *p = start; - unsigned char *pend = end; + unsigned char *p = (unsigned char *) start; + re_char *pend = end; if (start == NULL) { @@ -939,7 +948,7 @@ print_partial_compiled_pattern (unsigned char *start, unsigned char *end) static void print_compiled_pattern (struct re_pattern_buffer *bufp) { - unsigned char *buffer = bufp->buffer; + re_char *buffer = bufp->buffer; print_partial_compiled_pattern (buffer, buffer + bufp->used); printf ("%ld bytes used/%ld bytes allocated.\n", bufp->used, @@ -965,8 +974,8 @@ print_compiled_pattern (struct re_pattern_buffer *bufp) static void -print_double_string (const char *where, const char *string1, int size1, - const char *string2, int size2) +print_double_string (re_char *where, re_char *string1, int size1, + re_char *string2, int size2) { if (where == NULL) printf ("(null)"); @@ -1000,7 +1009,7 @@ print_double_string (const char *where, const char *string1, int size1, #define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) #define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) -#endif /* not DEBUG */ +#endif /* DEBUG */ /* Set by `re_set_syntax' to the current regexp syntax to recognize. Can also be assigned to arbitrarily: each pattern buffer stores its own @@ -1123,7 +1132,7 @@ int re_max_failures = 2000; union fail_stack_elt { - unsigned char *pointer; + re_char *pointer; int integer; }; @@ -1132,8 +1141,8 @@ typedef union fail_stack_elt fail_stack_elt_t; typedef struct { fail_stack_elt_t *stack; - unsigned size; - unsigned avail; /* Offset of next open position. */ + size_t size; + size_t avail; /* Offset of next open position. */ } fail_stack_type; #define FAIL_STACK_EMPTY() (fail_stack.avail == 0) @@ -1309,7 +1318,7 @@ typedef struct DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\ PUSH_FAILURE_INT (highest_active_reg); \ \ - DEBUG_PRINT2 (" Pushing pattern 0x%lx: ", (long) pattern_place); \ + DEBUG_PRINT2 (" Pushing pattern 0x%lx: \n", (long) pattern_place); \ DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \ PUSH_FAILURE_POINTER (pattern_place); \ \ @@ -1385,7 +1394,7 @@ typedef struct saved NULL, thus retaining our current position in the string. */ \ string_temp = POP_FAILURE_POINTER (); \ if (string_temp != NULL) \ - str = (const char *) string_temp; \ + str = string_temp; \ \ DEBUG_PRINT2 (" Popping string 0x%lx: `", (long) str); \ DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \ @@ -1410,10 +1419,10 @@ typedef struct DEBUG_PRINT2 (" info: 0x%lx\n", \ * (long *) ®_info[this_reg]); \ \ - regend[this_reg] = (const char *) POP_FAILURE_POINTER (); \ + regend[this_reg] = POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" end: 0x%lx\n", (long) regend[this_reg]); \ \ - regstart[this_reg] = (const char *) POP_FAILURE_POINTER (); \ + regstart[this_reg] = POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" start: 0x%lx\n", (long) regstart[this_reg]); \ } \ \ @@ -1476,7 +1485,7 @@ typedef union while (0) /* Registers are set to a sentinel when they haven't yet matched. */ -static char reg_unset_dummy; +static unsigned char reg_unset_dummy; #define REG_UNSET_VALUE (®_unset_dummy) #define REG_UNSET(e) ((e) == REG_UNSET_VALUE) @@ -1487,10 +1496,9 @@ static char reg_unset_dummy; string passed to us by the user to an unsigned char that we can use as an array index (in, e.g., `translate'). */ #define PATFETCH(c) \ - do {if (p == pend) return REG_EEND; \ - assert (p < pend); \ - c = (unsigned char) *p++; \ - if (translate) c = (unsigned char) translate[c]; \ + do { \ + PATFETCH_RAW (c); \ + c = TRANSLATE (c); \ } while (0) /* Fetch the next character in the uncompiled pattern, with no @@ -1498,11 +1506,12 @@ static char reg_unset_dummy; #define PATFETCH_RAW(c) \ do {if (p == pend) return REG_EEND; \ assert (p < pend); \ - c = (unsigned char) *p++; \ + c = charptr_emchar (p); \ + INC_CHARPTR (p); \ } while (0) /* Go backwards one character in the pattern. */ -#define PATUNFETCH p-- +#define PATUNFETCH DEC_CHARPTR (p) #ifdef MULE @@ -1511,8 +1520,8 @@ static char reg_unset_dummy; assert (p < pend); \ emch = charptr_emchar ((const Bufbyte *) p); \ INC_CHARPTR (p); \ - if (translate && emch < 0x80) \ - emch = (Emchar) (unsigned char) translate[emch]; \ + if (TRANSLATE_P (translate) && emch < 0x80) \ + emch = (Emchar) (unsigned char) RE_TRANSLATE (emch); \ } while (0) #define PATFETCH_RAW_EXTENDED(emch) \ @@ -1554,18 +1563,18 @@ static char reg_unset_dummy; #define PATFETCH_RAW_EITHER(emch) PATFETCH_RAW (emch) #define PATUNFETCH_EITHER PATUNFETCH -#endif /* not MULE */ +#endif /* MULE */ /* If `translate' is non-null, return translate[D], else just D. We cast the subscript to translate because some data is declared as `char *', to avoid warnings when a string constant is passed. But when we use a character as a subscript we must make it unsigned. */ -#define TRANSLATE(d) (translate ? translate[(unsigned char) (d)] : (d)) +#define TRANSLATE(d) (TRANSLATE_P (translate) ? RE_TRANSLATE (d) : (d)) #ifdef MULE #define TRANSLATE_EXTENDED_UNSAFE(emch) \ - (translate && emch < 0x80 ? translate[emch] : (emch)) + (TRANSLATE_P (translate) && emch < 0x80 ? RE_TRANSLATE (emch) : (emch)) #endif @@ -1576,14 +1585,14 @@ static char reg_unset_dummy; /* Make sure we have at least N more bytes of space in buffer. */ #define GET_BUFFER_SPACE(n) \ - while (b - bufp->buffer + (n) > bufp->allocated) \ + while (buf_end - bufp->buffer + (n) > bufp->allocated) \ EXTEND_BUFFER () /* Make sure we have one more byte of buffer space and then add C to it. */ #define BUF_PUSH(c) \ do { \ GET_BUFFER_SPACE (1); \ - *b++ = (unsigned char) (c); \ + *buf_end++ = (unsigned char) (c); \ } while (0) @@ -1591,8 +1600,8 @@ static char reg_unset_dummy; #define BUF_PUSH_2(c1, c2) \ do { \ GET_BUFFER_SPACE (2); \ - *b++ = (unsigned char) (c1); \ - *b++ = (unsigned char) (c2); \ + *buf_end++ = (unsigned char) (c1); \ + *buf_end++ = (unsigned char) (c2); \ } while (0) @@ -1600,9 +1609,9 @@ static char reg_unset_dummy; #define BUF_PUSH_3(c1, c2, c3) \ do { \ GET_BUFFER_SPACE (3); \ - *b++ = (unsigned char) (c1); \ - *b++ = (unsigned char) (c2); \ - *b++ = (unsigned char) (c3); \ + *buf_end++ = (unsigned char) (c1); \ + *buf_end++ = (unsigned char) (c2); \ + *buf_end++ = (unsigned char) (c3); \ } while (0) @@ -1615,13 +1624,15 @@ static char reg_unset_dummy; #define STORE_JUMP2(op, loc, to, arg) \ store_op2 (op, loc, (to) - (loc) - 3, arg) -/* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */ +/* Like `STORE_JUMP', but for inserting. Assume `buf_end' is the + buffer end. */ #define INSERT_JUMP(op, loc, to) \ - insert_op1 (op, loc, (to) - (loc) - 3, b) + insert_op1 (op, loc, (to) - (loc) - 3, buf_end) -/* Like `STORE_JUMP2', but for inserting. Assume `b' is the buffer end. */ +/* Like `STORE_JUMP2', but for inserting. Assume `buf_end' is the + buffer end. */ #define INSERT_JUMP2(op, loc, to, arg) \ - insert_op2 (op, loc, (to) - (loc) - 3, arg, b) + insert_op2 (op, loc, (to) - (loc) - 3, arg, buf_end) /* This is not an arbitrary limit: the arguments which represent offsets @@ -1636,7 +1647,7 @@ static char reg_unset_dummy; being larger than MAX_BUF_SIZE, then flag memory exhausted. */ #define EXTEND_BUFFER() \ do { \ - unsigned char *old_buffer = bufp->buffer; \ + re_char *old_buffer = bufp->buffer; \ if (bufp->allocated == MAX_BUF_SIZE) \ return REG_ESIZE; \ bufp->allocated <<= 1; \ @@ -1648,7 +1659,7 @@ static char reg_unset_dummy; /* If the buffer moved, move all the pointers into it. */ \ if (old_buffer != bufp->buffer) \ { \ - b = (b - old_buffer) + bufp->buffer; \ + buf_end = (buf_end - old_buffer) + bufp->buffer; \ begalt = (begalt - old_buffer) + bufp->buffer; \ if (fixup_alt_jump) \ fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\ @@ -1705,7 +1716,7 @@ typedef struct /* Set the bit for character C in a bit vector. */ #define SET_LIST_BIT(c) \ - (b[((unsigned char) (c)) / BYTEWIDTH] \ + (buf_end[((unsigned char) (c)) / BYTEWIDTH] \ |= 1 << (((unsigned char) c) % BYTEWIDTH)) #ifdef MULE @@ -1762,18 +1773,19 @@ static void insert_op1 (re_opcode_t op, unsigned char *loc, int arg, unsigned char *end); static void insert_op2 (re_opcode_t op, unsigned char *loc, int arg1, int arg2, unsigned char *end); -static boolean at_begline_loc_p (const char *pattern, const char *p, +static boolean at_begline_loc_p (re_char *pattern, re_char *p, reg_syntax_t syntax); -static boolean at_endline_loc_p (const char *p, const char *pend, int syntax); +static boolean at_endline_loc_p (re_char *p, re_char *pend, int syntax); static boolean group_in_compile_stack (compile_stack_type compile_stack, regnum_t regnum); -static reg_errcode_t compile_range (const char **p_ptr, const char *pend, - char *translate, reg_syntax_t syntax, +static reg_errcode_t compile_range (re_char **p_ptr, re_char *pend, + RE_TRANSLATE_TYPE translate, + reg_syntax_t syntax, unsigned char *b); #ifdef MULE -static reg_errcode_t compile_extended_range (const char **p_ptr, - const char *pend, - char *translate, +static reg_errcode_t compile_extended_range (re_char **p_ptr, + re_char *pend, + RE_TRANSLATE_TYPE translate, reg_syntax_t syntax, Lisp_Object rtab); #endif /* MULE */ @@ -1786,10 +1798,10 @@ static boolean common_op_match_null_string_p (unsigned char **p, unsigned char *end, register_info_type *reg_info); static int bcmp_translate (const unsigned char *s1, const unsigned char *s2, - REGISTER int len, char *translate); + REGISTER int len, RE_TRANSLATE_TYPE translate); static int re_match_2_internal (struct re_pattern_buffer *bufp, - const char *string1, int size1, - const char *string2, int size2, int pos, + re_char *string1, int size1, + re_char *string2, int size2, int pos, struct re_registers *regs, int stop); #ifndef MATCH_MAY_ALLOCATE @@ -1808,11 +1820,11 @@ static fail_stack_type fail_stack; but never make them smaller. */ static int regs_allocated_size; -static const char ** regstart, ** regend; -static const char ** old_regstart, ** old_regend; -static const char **best_regstart, **best_regend; +static re_char ** regstart, ** regend; +static re_char ** old_regstart, ** old_regend; +static re_char **best_regstart, **best_regend; static register_info_type *reg_info; -static const char **reg_dummy; +static re_char **reg_dummy; static register_info_type *reg_info_dummy; /* Make the register vectors big enough for NUM_REGS registers, @@ -1823,14 +1835,14 @@ regex_grow_registers (int num_regs) { if (num_regs > regs_allocated_size) { - RETALLOC_IF (regstart, num_regs, const char *); - RETALLOC_IF (regend, num_regs, const char *); - RETALLOC_IF (old_regstart, num_regs, const char *); - RETALLOC_IF (old_regend, num_regs, const char *); - RETALLOC_IF (best_regstart, num_regs, const char *); - RETALLOC_IF (best_regend, num_regs, const char *); + RETALLOC_IF (regstart, num_regs, re_char *); + RETALLOC_IF (regend, num_regs, re_char *); + RETALLOC_IF (old_regstart, num_regs, re_char *); + RETALLOC_IF (old_regend, num_regs, re_char *); + RETALLOC_IF (best_regstart, num_regs, re_char *); + RETALLOC_IF (best_regend, num_regs, re_char *); RETALLOC_IF (reg_info, num_regs, register_info_type); - RETALLOC_IF (reg_dummy, num_regs, const char *); + RETALLOC_IF (reg_dummy, num_regs, re_char *); RETALLOC_IF (reg_info_dummy, num_regs, register_info_type); regs_allocated_size = num_regs; @@ -1862,7 +1874,7 @@ regex_grow_registers (int num_regs) return (free (compile_stack.stack), value) static reg_errcode_t -regex_compile (const char *pattern, int size, reg_syntax_t syntax, +regex_compile (re_char *pattern, int size, reg_syntax_t syntax, struct re_pattern_buffer *bufp) { /* We fetch characters from PATTERN here. We declare these as int @@ -1874,20 +1886,20 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, REGISTER EMACS_INT c, c1; /* A random temporary spot in PATTERN. */ - const char *p1; + re_char *p1; /* Points to the end of the buffer, where we should append. */ - REGISTER unsigned char *b; + REGISTER unsigned char *buf_end; /* Keeps track of unclosed groups. */ compile_stack_type compile_stack; /* Points to the current (ending) position in the pattern. */ - const char *p = pattern; - const char *pend = pattern + size; + re_char *p = pattern; + re_char *pend = pattern + size; /* How to translate the characters in the pattern. */ - char *translate = bufp->translate; + RE_TRANSLATE_TYPE translate = bufp->translate; /* Address of the count-byte of the most recently inserted `exactn' command. This makes it possible to tell if a new exact-match @@ -1905,7 +1917,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, /* Place in the uncompiled pattern (i.e., the {) to which to go back if the interval is invalid. */ - const char *beg_interval; + re_char *beg_interval; /* Address of the place where a forward jump should go to the end of the containing expression. Each alternative of an `or' -- except the @@ -1972,7 +1984,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, bufp->allocated = INIT_BUF_SIZE; } - begalt = b = bufp->buffer; + begalt = buf_end = bufp->buffer; /* Loop through the uncompiled pattern until we're at the end. */ while (p != pend) @@ -2103,10 +2115,10 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, 9: end of pattern. */ GET_BUFFER_SPACE (6); - INSERT_JUMP (jump, laststart, b + 3); - b += 3; + INSERT_JUMP (jump, laststart, buf_end + 3); + buf_end += 3; INSERT_JUMP (on_failure_jump, laststart, laststart + 6); - b += 3; + buf_end += 3; } else if (zero_times_ok) { @@ -2117,10 +2129,10 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, 9: end of pattern. */ GET_BUFFER_SPACE (6); - INSERT_JUMP (jump, laststart, b + 3); - b += 3; - STORE_JUMP (on_failure_jump, b, laststart + 3); - b += 3; + INSERT_JUMP (jump, laststart, buf_end + 3); + buf_end += 3; + STORE_JUMP (on_failure_jump, buf_end, laststart + 3); + buf_end += 3; } else { @@ -2130,8 +2142,8 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, 6: end of pattern. */ GET_BUFFER_SPACE (3); - STORE_JUMP (on_failure_jump, b, laststart); - b += 3; + STORE_JUMP (on_failure_jump, buf_end, laststart); + buf_end += 3; } } else @@ -2140,10 +2152,11 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, boolean keep_string_p = false; if (many_times_ok) - { /* More than one repetition is allowed, so put in at the - end a backward relative jump from `b' to before the next - jump we're going to put in below (which jumps from - laststart to after this jump). + { /* More than one repetition is allowed, so put in + at the end a backward relative jump from + `buf_end' to before the next jump we're going + to put in below (which jumps from laststart to + after this jump). But if we are at the `*' in the exact sequence `.*\n', insert an unconditional jump backwards to the ., @@ -2161,29 +2174,30 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, character after the `*'. Do we have to do something analogous here for null bytes, because of RE_DOT_NOT_NULL? */ - if (TRANSLATE (*(p - 2)) == TRANSLATE ('.') + if (*(p - 2) == '.' && zero_times_ok - && p < pend && TRANSLATE (*p) == TRANSLATE ('\n') + && p < pend && *p == '\n' && !(syntax & RE_DOT_NEWLINE)) { /* We have .*\n. */ - STORE_JUMP (jump, b, laststart); + STORE_JUMP (jump, buf_end, laststart); keep_string_p = true; } else /* Anything else. */ - STORE_JUMP (maybe_pop_jump, b, laststart - 3); + STORE_JUMP (maybe_pop_jump, buf_end, laststart - 3); /* We've added more stuff to the buffer. */ - b += 3; + buf_end += 3; } - /* On failure, jump from laststart to b + 3, which will be the - end of the buffer after this jump is inserted. */ + /* On failure, jump from laststart to buf_end + 3, + which will be the end of the buffer after this jump + is inserted. */ GET_BUFFER_SPACE (3); INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump : on_failure_jump, - laststart, b + 3); - b += 3; + laststart, buf_end + 3); + buf_end += 3; if (!zero_times_ok) { @@ -2194,7 +2208,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, we hit that loop. */ GET_BUFFER_SPACE (3); INSERT_JUMP (dummy_failure_jump, laststart, laststart + 6); - b += 3; + buf_end += 3; } } pending_exact = 0; @@ -2203,7 +2217,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, case '.': - laststart = b; + laststart = buf_end; BUF_PUSH (anychar); break; @@ -2223,7 +2237,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, opcode, the length count, and the bitset; 34 bytes in all. */ GET_BUFFER_SPACE (34); - laststart = b; + laststart = buf_end; /* We test `*p == '^' twice, instead of using an if statement, so we only need one BUF_PUSH. */ @@ -2238,10 +2252,10 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH); /* Clear the whole map. */ - memset (b, 0, (1 << BYTEWIDTH) / BYTEWIDTH); + memset (buf_end, 0, (1 << BYTEWIDTH) / BYTEWIDTH); /* charset_not matches newline according to a syntax bit. */ - if ((re_opcode_t) b[-2] == charset_not + if ((re_opcode_t) buf_end[-2] == charset_not && (syntax & RE_HAT_LISTS_NOT_NEWLINE)) SET_LIST_BIT ('\n'); @@ -2251,18 +2265,18 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, { /* There are extended chars here, which means we need to start over and shift to unified range-table format. */ - if (b[-2] == charset) - b[-2] = charset_mule; + if (buf_end[-2] == charset) + buf_end[-2] = charset_mule; else - b[-2] = charset_mule_not; - b--; + buf_end[-2] = charset_mule_not; + buf_end--; p = p1; /* go back to the beginning of the charset, after a possible ^. */ rtab = Vthe_lisp_rangetab; Fclear_range_table (rtab); /* charset_not matches newline according to a syntax bit. */ - if ((re_opcode_t) b[-1] == charset_mule_not + if ((re_opcode_t) buf_end[-1] == charset_mule_not && (syntax & RE_HAT_LISTS_NOT_NEWLINE)) SET_EITHER_BIT ('\n'); } @@ -2273,7 +2287,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, { if (p == pend) FREE_STACK_RETURN (REG_EBRACK); - PATFETCH_EITHER (c); + PATFETCH (c); #ifdef MULE if (c >= 0x80 && !has_extended_chars) @@ -2292,7 +2306,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, { if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); - PATFETCH_EITHER (c1); + PATFETCH (c1); #ifdef MULE if (c1 >= 0x80 && !has_extended_chars) { @@ -2321,7 +2335,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, operator. */ if (c == '-' && !(p - 2 >= pattern && p[-2] == '[') - && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^') + && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^') && *p != ']') { reg_errcode_t ret; @@ -2337,7 +2351,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, syntax, rtab); else #endif /* MULE */ - ret = compile_range (&p, pend, translate, syntax, b); + ret = compile_range (&p, pend, translate, syntax, buf_end); if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); } @@ -2359,7 +2373,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, syntax, rtab); else #endif /* MULE */ - ret = compile_range (&p, pend, translate, syntax, b); + ret = compile_range (&p, pend, translate, syntax, buf_end); if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); } @@ -2378,12 +2392,9 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, for (;;) { - /* Do not do PATFETCH_EITHER() here. We want - to just see if the bytes match particular - strings, and we put them all back if not. - - #### May need to be changed once trt tables - are working. */ + /* #### This code is unused. + Correctness is not checked after TRT + table change. */ PATFETCH (c); if (c == ':' || c == ']' || p == pend || c1 == CHAR_CLASS_MAX_LENGTH) @@ -2392,7 +2403,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, } str[c1] = '\0'; - /* If isn't a word bracketed by `[:' and:`]': + /* If isn't a word bracketed by `[:' and `:]': undo the ending character, the letters, and leave the leading `:' and `[' (but set bits for them). */ if (c == ':' && *p == ']') @@ -2466,16 +2477,16 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, int bytes_needed = unified_range_table_bytes_needed (rtab); GET_BUFFER_SPACE (bytes_needed); - unified_range_table_copy_data (rtab, b); - b += unified_range_table_bytes_used (b); + unified_range_table_copy_data (rtab, buf_end); + buf_end += unified_range_table_bytes_used (buf_end); break; } #endif /* MULE */ /* Discard any (non)matching list bytes that are all 0 at the end of the map. Decrease the map-length byte too. */ - while ((int) b[-1] > 0 && b[b[-1] - 1] == 0) - b[-1]--; - b += b[-1]; + while ((int) buf_end[-1] > 0 && buf_end[buf_end[-1] - 1] == 0) + buf_end[-1]--; + buf_end += buf_end[-1]; } break; @@ -2535,10 +2546,10 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, if (!(syntax & RE_NO_SHY_GROUPS) && p != pend - && TRANSLATE(*p) == TRANSLATE('?')) + && *p == '?') { p++; - PATFETCH(c); + PATFETCH (c); switch (c) { case ':': /* shy groups */ @@ -2572,7 +2583,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer; COMPILE_STACK_TOP.fixup_alt_jump = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0; - COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer; + COMPILE_STACK_TOP.laststart_offset = buf_end - bufp->buffer; COMPILE_STACK_TOP.regnum = r; /* We will eventually replace the 0 with the number of @@ -2582,7 +2593,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, if (r <= MAX_REGNUM) { COMPILE_STACK_TOP.inner_group_offset - = b - bufp->buffer + 2; + = buf_end - bufp->buffer + 2; BUF_PUSH_3 (start_memory, r, 0); } @@ -2590,7 +2601,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, fixup_alt_jump = 0; laststart = 0; - begalt = b; + begalt = buf_end; /* If we've reached MAX_REGNUM groups, then this open won't actually generate any code, so we'll have to clear pending_exact explicitly. */ @@ -2619,7 +2630,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, /* We allocated space for this jump when we assigned to `fixup_alt_jump', in the `handle_alt' case below. */ - STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1); + STORE_JUMP (jump_past_alt, fixup_alt_jump, buf_end - 1); } /* See similar code for backslashed left paren above. */ @@ -2677,9 +2688,9 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, /* Insert before the previous alternative a jump which jumps to this alternative if the former fails. */ GET_BUFFER_SPACE (3); - INSERT_JUMP (on_failure_jump, begalt, b + 6); + INSERT_JUMP (on_failure_jump, begalt, buf_end + 6); pending_exact = 0; - b += 3; + buf_end += 3; /* The alternative before this one has a jump after it which gets executed if it gets matched. Adjust that @@ -2698,17 +2709,17 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, bytes which we'll fill in when we get to after `c'. */ if (fixup_alt_jump) - STORE_JUMP (jump_past_alt, fixup_alt_jump, b); + STORE_JUMP (jump_past_alt, fixup_alt_jump, buf_end); /* Mark and leave space for a jump after this alternative, to be filled in later either by next alternative or when know we're at the end of a series of alternatives. */ - fixup_alt_jump = b; + fixup_alt_jump = buf_end; GET_BUFFER_SPACE (3); - b += 3; + buf_end += 3; laststart = 0; - begalt = b; + begalt = buf_end; break; @@ -2781,7 +2792,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, if (syntax & RE_CONTEXT_INVALID_OPS) FREE_STACK_RETURN (REG_BADRPT); else if (syntax & RE_CONTEXT_INDEP_OPS) - laststart = b; + laststart = buf_end; else goto unfetch_interval; } @@ -2792,8 +2803,8 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, if (upper_bound == 0) { GET_BUFFER_SPACE (3); - INSERT_JUMP (jump, laststart, b + 3); - b += 3; + INSERT_JUMP (jump, laststart, buf_end + 3); + buf_end += 3; } /* Otherwise, we have a nontrivial interval. When @@ -2818,16 +2829,16 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, because `re_compile_fastmap' needs to know. Jump to the `jump_n' we might insert below. */ INSERT_JUMP2 (succeed_n, laststart, - b + 5 + (upper_bound > 1) * 5, + buf_end + 5 + (upper_bound > 1) * 5, lower_bound); - b += 5; + buf_end += 5; /* Code to initialize the lower bound. Insert before the `succeed_n'. The `5' is the last two bytes of this `set_number_at', plus 3 bytes of the following `succeed_n'. */ - insert_op2 (set_number_at, laststart, 5, lower_bound, b); - b += 5; + insert_op2 (set_number_at, laststart, 5, lower_bound, buf_end); + buf_end += 5; if (upper_bound > 1) { /* More than one repetition is allowed, so @@ -2837,9 +2848,9 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, When we've reached this during matching, we'll have matched the interval once, so jump back only `upper_bound - 1' times. */ - STORE_JUMP2 (jump_n, b, laststart + 5, + STORE_JUMP2 (jump_n, buf_end, laststart + 5, upper_bound - 1); - b += 5; + buf_end += 5; /* The location we want to set is the second parameter of the `jump_n'; that is `b-2' as @@ -2855,9 +2866,10 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, We insert this at the beginning of the loop so that if we fail during matching, we'll reinitialize the bounds. */ - insert_op2 (set_number_at, laststart, b - laststart, - upper_bound - 1, b); - b += 5; + insert_op2 (set_number_at, laststart, + buf_end - laststart, + upper_bound - 1, buf_end); + buf_end += 5; } } pending_exact = 0; @@ -2889,7 +2901,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, break; case 's': - laststart = b; + laststart = buf_end; PATFETCH (c); /* XEmacs addition */ if (c >= 0x80 || syntax_spec_code[c] == 0377) @@ -2898,7 +2910,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, break; case 'S': - laststart = b; + laststart = buf_end; PATFETCH (c); /* XEmacs addition */ if (c >= 0x80 || syntax_spec_code[c] == 0377) @@ -2909,7 +2921,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, #ifdef MULE /* 97.2.17 jhod merged in to XEmacs from mule-2.3 */ case 'c': - laststart = b; + laststart = buf_end; PATFETCH_RAW (c); if (c < 32 || c > 127) FREE_STACK_RETURN (REG_ECATEGORY); @@ -2917,7 +2929,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, break; case 'C': - laststart = b; + laststart = buf_end; PATFETCH_RAW (c); if (c < 32 || c > 127) FREE_STACK_RETURN (REG_ECATEGORY); @@ -2929,13 +2941,13 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, case 'w': - laststart = b; + laststart = buf_end; BUF_PUSH (wordchar); break; case 'W': - laststart = b; + laststart = buf_end; BUF_PUSH (notwordchar); break; @@ -2966,20 +2978,23 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - if (syntax & RE_NO_BK_REFS) - goto normal_char; + { + regnum_t reg; + if (syntax & RE_NO_BK_REFS) + goto normal_char; - c1 = c - '0'; + reg = c - '0'; - if (c1 > regnum) - FREE_STACK_RETURN (REG_ESUBREG); + if (reg > regnum) + FREE_STACK_RETURN (REG_ESUBREG); - /* Can't back reference to a subexpression if inside of it. */ - if (group_in_compile_stack (compile_stack, c1)) - goto normal_char; + /* Can't back reference to a subexpression if inside of it. */ + if (group_in_compile_stack (compile_stack, reg)) + goto normal_char; - laststart = b; - BUF_PUSH_2 (duplicate, c1); + laststart = buf_end; + BUF_PUSH_2 (duplicate, reg); + } break; @@ -3008,14 +3023,13 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, { /* XEmacs: modifications here for Mule. */ /* `q' points to the beginning of the next char. */ - const char *q = p - 1; - INC_CHARPTR (q); + re_char *q = p; /* If no exactn currently being built. */ if (!pending_exact /* If last exactn not at current position. */ - || pending_exact + *pending_exact + 1 != b + || pending_exact + *pending_exact + 1 != buf_end /* We have only one byte following the exactn for the count. */ || ((unsigned int) (*pending_exact + (q - p)) >= @@ -3033,21 +3047,30 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, { /* Start building a new exactn. */ - laststart = b; + laststart = buf_end; BUF_PUSH_2 (exactn, 0); - pending_exact = b - 1; + pending_exact = buf_end - 1; } +#ifndef MULE BUF_PUSH (c); (*pending_exact)++; +#else + { + Bytecount bt_count; + Bufbyte tmp_buf[MAX_EMCHAR_LEN]; + int i; - while (p < q) - { - PATFETCH (c); - BUF_PUSH (c); - (*pending_exact)++; - } + bt_count = set_charptr_emchar (tmp_buf, c); + + for (i = 0; i < bt_count; i++) + { + BUF_PUSH (tmp_buf[i]); + (*pending_exact)++; + } + } +#endif break; } } /* switch (c) */ @@ -3057,7 +3080,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, /* Through the pattern now. */ if (fixup_alt_jump) - STORE_JUMP (jump_past_alt, fixup_alt_jump, b); + STORE_JUMP (jump_past_alt, fixup_alt_jump, buf_end); if (!COMPILE_STACK_EMPTY) FREE_STACK_RETURN (REG_EPAREN); @@ -3070,7 +3093,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, free (compile_stack.stack); /* We have succeeded; set the length of the buffer. */ - bufp->used = b - bufp->buffer; + bufp->used = buf_end - bufp->buffer; #ifdef DEBUG if (debug) @@ -3114,7 +3137,7 @@ regex_compile (const char *pattern, int size, reg_syntax_t syntax, = (fail_stack_elt_t *) realloc (fail_stack.stack, (fail_stack.size * sizeof (fail_stack_elt_t))); -#endif /* not emacs */ +#endif /* emacs */ } regex_grow_registers (num_regs); @@ -3184,9 +3207,9 @@ insert_op2 (re_opcode_t op, unsigned char *loc, int arg1, int arg2, least one character before the ^. */ static boolean -at_begline_loc_p (const char *pattern, const char *p, reg_syntax_t syntax) +at_begline_loc_p (re_char *pattern, re_char *p, reg_syntax_t syntax) { - const char *prev = p - 2; + re_char *prev = p - 2; boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\'; return @@ -3201,11 +3224,11 @@ at_begline_loc_p (const char *pattern, const char *p, reg_syntax_t syntax) at least one character after the $, i.e., `P < PEND'. */ static boolean -at_endline_loc_p (const char *p, const char *pend, int syntax) +at_endline_loc_p (re_char *p, re_char *pend, int syntax) { - const char *next = p; + re_char *next = p; boolean next_backslash = *next == '\\'; - const char *next_next = p + 1 < pend ? p + 1 : 0; + re_char *next_next = p + 1 < pend ? p + 1 : 0; return /* Before a subexpression? */ @@ -3247,12 +3270,12 @@ group_in_compile_stack (compile_stack_type compile_stack, regnum_t regnum) `regex_compile' itself. */ static reg_errcode_t -compile_range (const char **p_ptr, const char *pend, char *translate, - reg_syntax_t syntax, unsigned char *b) +compile_range (re_char **p_ptr, re_char *pend, RE_TRANSLATE_TYPE translate, + reg_syntax_t syntax, unsigned char *buf_end) { unsigned this_char; - const char *p = *p_ptr; + re_char *p = *p_ptr; int range_start, range_end; if (p == pend) @@ -3292,7 +3315,8 @@ compile_range (const char **p_ptr, const char *pend, char *translate, #ifdef MULE static reg_errcode_t -compile_extended_range (const char **p_ptr, const char *pend, char *translate, +compile_extended_range (re_char **p_ptr, re_char *pend, + RE_TRANSLATE_TYPE translate, reg_syntax_t syntax, Lisp_Object rtab) { Emchar this_char, range_start, range_end; @@ -3418,7 +3442,7 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) /* Reset for next path. */ path_can_be_null = true; - p = fail_stack.stack[--fail_stack.avail].pointer; + p = (unsigned char *) fail_stack.stack[--fail_stack.avail].pointer; continue; } @@ -3467,10 +3491,10 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) /* And all extended characters must be allowed, too. */ for (j = 0x80; j < 0xA0; j++) fastmap[j] = 1; -#else /* ! MULE */ +#else /* not MULE */ for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++) fastmap[j] = 1; -#endif /* ! MULE */ +#endif /* MULE */ for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))) @@ -3631,14 +3655,14 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) } #endif } -#else /* ! MULE */ +#else /* not MULE */ for (j = 0; j < (1 << BYTEWIDTH); j++) if (SYNTAX_UNSAFE (XCHAR_TABLE (regex_emacs_buffer->mirror_syntax_table), j) == (enum syntaxcode) k) fastmap[j] = 1; -#endif /* ! MULE */ +#endif /* MULE */ break; @@ -3676,14 +3700,14 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) } #endif } -#else /* ! MULE */ +#else /* not MULE */ for (j = 0; j < (1 << BYTEWIDTH); j++) if (SYNTAX_UNSAFE (XCHAR_TABLE (regex_emacs_buffer->mirror_syntax_table), j) != (enum syntaxcode) k) fastmap[j] = 1; -#endif /* ! MULE */ +#endif /* MULE */ break; #ifdef MULE @@ -3913,19 +3937,21 @@ typedef int Charcount; stack overflow). */ int -re_search_2 (struct re_pattern_buffer *bufp, const char *string1, - int size1, const char *string2, int size2, int startpos, +re_search_2 (struct re_pattern_buffer *bufp, const char *str1, + int size1, const char *str2, int size2, int startpos, int range, struct re_registers *regs, int stop) { int val; + re_char *string1 = (re_char *) str1; + re_char *string2 = (re_char *) str2; REGISTER char *fastmap = bufp->fastmap; - REGISTER char *translate = bufp->translate; + REGISTER RE_TRANSLATE_TYPE translate = bufp->translate; int total_size = size1 + size2; int endpos = startpos + range; #ifdef REGEX_BEGLINE_CHECK int anchored_at_begline = 0; #endif - const unsigned char *d; + re_char *d; Charcount d_size; /* Check for out-of-range STARTPOS. */ @@ -3997,12 +4023,8 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *string1, DEC_CHARPTR(d); /* Ok, since startpos != size1. */ d_size = charcount_to_bytecount (d, 1); - if (translate) -#ifdef MULE - while (range > lim && (*d >= 0x80 || translate[*d] != '\n')) -#else - while (range > lim && translate[*d] != '\n') -#endif + if (TRANSLATE_P (translate)) + while (range > lim && *d != '\n') { d += d_size; /* Speedier INC_CHARPTR(d) */ d_size = charcount_to_bytecount (d, 1); @@ -4039,13 +4061,20 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *string1, /* Written out as an if-else to avoid testing `translate' inside the loop. */ - if (translate) - while (range > lim && -#ifdef MULE - *d < 0x80 && -#endif - !fastmap[(unsigned char)translate[*d]]) + if (TRANSLATE_P (translate)) + while (range > lim) { +#ifdef MULE + Emchar buf_ch; + + buf_ch = charptr_emchar (d); + buf_ch = RE_TRANSLATE (buf_ch); + if (buf_ch >= 0200 || fastmap[(unsigned char) buf_ch]) + break; +#else + if (fastmap[(unsigned char)RE_TRANSLATE (*d)]) + break; +#endif /* MULE */ d_size = charcount_to_bytecount (d, 1); range -= d_size; d += d_size; /* Speedier INC_CHARPTR(d) */ @@ -4062,15 +4091,17 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *string1, } else /* Searching backwards. */ { - unsigned char c = (size1 == 0 || startpos >= size1 - ? string2[startpos - size1] - : string1[startpos]); + Emchar c = (size1 == 0 || startpos >= size1 + ? charptr_emchar (string2 + startpos - size1) + : charptr_emchar (string1 + startpos)); + c = TRANSLATE (c); #ifdef MULE - if (c < 0x80 && !fastmap[(unsigned char) TRANSLATE (c)]) + if (!(c >= 0200 || fastmap[(unsigned char) c])) + goto advance; #else - if (!fastmap[(unsigned char) TRANSLATE (c)]) -#endif + if (!fastmap[(unsigned char) c]) goto advance; +#endif } } @@ -4183,9 +4214,9 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *string1, FREE_VAR (reg_dummy); \ FREE_VAR (reg_info_dummy); \ } while (0) -#else +#else /* not MATCH_MAY_ALLOCATE */ #define FREE_VARIABLES() ((void)0) /* Do nothing! But inhibit gcc warning. */ -#endif /* not MATCH_MAY_ALLOCATE */ +#endif /* MATCH_MAY_ALLOCATE */ /* These values must meet several constraints. They must not be valid register values; since we have a limit of 255 registers (because @@ -4206,7 +4237,7 @@ int re_match (struct re_pattern_buffer *bufp, const char *string, int size, int pos, struct re_registers *regs) { - int result = re_match_2_internal (bufp, NULL, 0, string, size, + int result = re_match_2_internal (bufp, NULL, 0, (re_char *) string, size, pos, regs, size); alloca (0); return result; @@ -4232,7 +4263,8 @@ re_match_2 (struct re_pattern_buffer *bufp, const char *string1, int size1, const char *string2, int size2, int pos, struct re_registers *regs, int stop) { - int result = re_match_2_internal (bufp, string1, size1, string2, size2, + int result = re_match_2_internal (bufp, (re_char *) string1, size1, + (re_char *) string2, size2, pos, regs, stop); alloca (0); return result; @@ -4241,8 +4273,8 @@ re_match_2 (struct re_pattern_buffer *bufp, const char *string1, /* This is a separate function so that we can force an alloca cleanup afterwards. */ static int -re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, - int size1, const char *string2, int size2, int pos, +re_match_2_internal (struct re_pattern_buffer *bufp, re_char *string1, + int size1, re_char *string2, int size2, int pos, struct re_registers *regs, int stop) { /* General temporaries. */ @@ -4251,14 +4283,14 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, int should_succeed; /* XEmacs change */ /* Just past the end of the corresponding string. */ - const char *end1, *end2; + re_char *end1, *end2; /* Pointers into string1 and string2, just past the last characters in each to consider matching. */ - const char *end_match_1, *end_match_2; + re_char *end_match_1, *end_match_2; /* Where we are in the data, and the end of the current string. */ - const char *d, *dend; + re_char *d, *dend; /* Where we are in the pattern, and the end of the pattern. */ unsigned char *p = bufp->buffer; @@ -4266,10 +4298,10 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, /* Mark the opcode just after a start_memory, so we can test for an empty subpattern when we get to the stop_memory. */ - unsigned char *just_past_start_mem = 0; + re_char *just_past_start_mem = 0; /* We use this to map every character in the string. */ - char *translate = bufp->translate; + RE_TRANSLATE_TYPE translate = bufp->translate; /* Failure point stack. Each place that can handle a failure further down the line pushes a failure point on this stack. It consists of @@ -4311,7 +4343,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, stopped matching the regnum-th subexpression. (The zeroth register keeps track of what the whole pattern matches.) */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ - const char **regstart, **regend; + re_char **regstart, **regend; #endif /* If a group that's operated upon by a repetition operator fails to @@ -4320,7 +4352,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, are when we last see its open-group operator. Similarly for a register's end. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ - const char **old_regstart, **old_regend; + re_char **old_regstart, **old_regend; #endif /* The is_active field of reg_info helps us keep track of which (possibly @@ -4339,7 +4371,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, turn happens only if we have not yet matched the entire string. */ unsigned best_regs_set = false; #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ - const char **best_regstart, **best_regend; + re_char **best_regstart, **best_regend; #endif /* Logically, this is `best_regend[0]'. But we don't want to have to @@ -4350,14 +4382,14 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, the end of the best match so far in a separate variable. We initialize this to NULL so that when we backtrack the first time and need to test it, it's not garbage. */ - const char *match_end = NULL; + re_char *match_end = NULL; /* This helps SET_REGS_MATCHED avoid doing redundant work. */ int set_regs_matched_done = 0; /* Used when we pop values we don't care about. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ - const char **reg_dummy; + re_char **reg_dummy; register_info_type *reg_info_dummy; #endif @@ -4385,14 +4417,14 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, array indexing. We should fix this. */ if (bufp->re_nsub) { - regstart = REGEX_TALLOC (num_regs, const char *); - regend = REGEX_TALLOC (num_regs, const char *); - old_regstart = REGEX_TALLOC (num_regs, const char *); - old_regend = REGEX_TALLOC (num_regs, const char *); - best_regstart = REGEX_TALLOC (num_regs, const char *); - best_regend = REGEX_TALLOC (num_regs, const char *); + regstart = REGEX_TALLOC (num_regs, re_char *); + regend = REGEX_TALLOC (num_regs, re_char *); + old_regstart = REGEX_TALLOC (num_regs, re_char *); + old_regend = REGEX_TALLOC (num_regs, re_char *); + best_regstart = REGEX_TALLOC (num_regs, re_char *); + best_regend = REGEX_TALLOC (num_regs, re_char *); reg_info = REGEX_TALLOC (num_regs, register_info_type); - reg_dummy = REGEX_TALLOC (num_regs, const char *); + reg_dummy = REGEX_TALLOC (num_regs, re_char *); reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type); if (!(regstart && regend && old_regstart && old_regend && reg_info @@ -4432,7 +4464,6 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, MATCHED_SOMETHING (reg_info[mcnt]) = 0; EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0; } - /* We move `string1' into `string2' if the latter's empty -- but not if `string1' is null. */ if (size2 == 0 && string1 != NULL) @@ -4474,7 +4505,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, dend = end_match_2; } - DEBUG_PRINT1 ("The compiled pattern is: "); + DEBUG_PRINT1 ("The compiled pattern is: \n"); DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend); DEBUG_PRINT1 ("The string to match is: `"); DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2); @@ -4672,22 +4703,40 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, /* This is written out as an if-else so we don't waste time testing `translate' inside the loop. */ - if (translate) + if (TRANSLATE_P (translate)) { do { +#ifdef MULE + Emchar pat_ch, buf_ch; + Bytecount pat_len; + PREFETCH (); - if (translate[(unsigned char) *d++] != (char) *p++) + pat_ch = charptr_emchar (p); + buf_ch = charptr_emchar (d); + if (RE_TRANSLATE (buf_ch) != pat_ch) goto fail; + + pat_len = charcount_to_bytecount (p, 1); + p += pat_len; + INC_CHARPTR (d); + + mcnt -= pat_len; +#else /* not MULE */ + PREFETCH (); + if ((unsigned char) RE_TRANSLATE (*d++) != *p++) + goto fail; + mcnt--; +#endif } - while (--mcnt); + while (mcnt > 0); } else { do { PREFETCH (); - if (*d++ != (char) *p++) goto fail; + if (*d++ != *p++) goto fail; } while (--mcnt); } @@ -4962,7 +5011,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, followed by the numeric value of as the register number. */ case duplicate: { - REGISTER const char *d2, *dend2; + REGISTER re_char *d2, *dend2; int regno = *p++; /* Get which register to match against. */ DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno); @@ -5010,7 +5059,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, /* Compare that many; failure if mismatch, else move past them. */ - if (translate + if (TRANSLATE_P (translate) ? bcmp_translate ((unsigned char *) d, (unsigned char *) d2, mcnt, translate) : memcmp (d, d2, mcnt)) @@ -5098,7 +5147,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, EXTRACT_NUMBER_AND_INCR (mcnt, p); DEBUG_PRINT3 (" %d (to 0x%lx):\n", mcnt, (long) (p + mcnt)); - PUSH_FAILURE_POINT (p + mcnt, (char *) 0, -2); + PUSH_FAILURE_POINT (p + mcnt, (unsigned char *) 0, -2); break; @@ -5318,7 +5367,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, `pop_failure_point'. */ unsigned dummy_low_reg, dummy_high_reg; unsigned char *pdummy; - const char *sdummy = NULL; + re_char *sdummy = NULL; DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n"); POP_FAILURE_POINT (sdummy, pdummy, @@ -5354,7 +5403,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n"); /* It doesn't matter what we push for the string here. What the code at `fail' tests is the value for the pattern. */ - PUSH_FAILURE_POINT ((unsigned char *) 0, (char *) 0, -2); + PUSH_FAILURE_POINT ((unsigned char *) 0, (unsigned char *) 0, -2); goto unconditional_jump; @@ -5367,7 +5416,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n"); /* See comments just above at `dummy_failure_jump' about the two zeroes. */ - PUSH_FAILURE_POINT ((unsigned char *) 0, (char *) 0, -2); + PUSH_FAILURE_POINT ((unsigned char *) 0, (unsigned char *) 0, -2); break; /* Have to succeed matching what follows at least n times. @@ -5623,7 +5672,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1, SET_REGS_MATCHED (); d++; break; -#endif /* not emacs */ +#endif /* emacs */ default: abort (); @@ -5933,15 +5982,34 @@ common_op_match_null_string_p (unsigned char **p, unsigned char *end, bytes; nonzero otherwise. */ static int -bcmp_translate (const unsigned char *s1, const unsigned char *s2, - REGISTER int len, char *translate) +bcmp_translate (re_char *s1, re_char *s2, + REGISTER int len, RE_TRANSLATE_TYPE translate) { REGISTER const unsigned char *p1 = s1, *p2 = s2; +#ifdef MULE + const unsigned char *p1_end = s1 + len; + const unsigned char *p2_end = s2 + len; + + while (p1 != p1_end && p2 != p2_end) + { + Emchar p1_ch, p2_ch; + + p1_ch = charptr_emchar (p1); + p2_ch = charptr_emchar (p2); + + if (RE_TRANSLATE (p1_ch) + != RE_TRANSLATE (p2_ch)) + return 1; + INC_CHARPTR (p1); + INC_CHARPTR (p2); + } +#else /* not MULE */ while (len) { - if (translate[*p1++] != translate[*p2++]) return 1; + if (RE_TRANSLATE (*p1++) != RE_TRANSLATE (*p2++)) return 1; len--; } +#endif /* MULE */ return 0; } @@ -5974,7 +6042,7 @@ re_compile_pattern (const char *pattern, int length, /* Match anchors at newline. */ bufp->newline_anchor = 1; - ret = regex_compile (pattern, length, re_syntax_options, bufp); + ret = regex_compile ((unsigned char *) pattern, length, re_syntax_options, bufp); if (!ret) return NULL; @@ -6019,7 +6087,7 @@ re_comp (const char *s) /* Match anchors at newlines. */ re_comp_buf.newline_anchor = 1; - ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf); + ret = regex_compile ((unsigned char *)s, strlen (s), re_syntax_options, &re_comp_buf); if (!ret) return NULL; @@ -6125,7 +6193,7 @@ regcomp (regex_t *preg, const char *pattern, int cflags) /* POSIX says a null character in the pattern terminates it, so we can use strlen here in compiling the pattern. */ - ret = regex_compile (pattern, strlen (pattern), syntax, preg); + ret = regex_compile ((unsigned char *) pattern, strlen (pattern), syntax, preg); /* POSIX doesn't distinguish between an unmatched open-group and an unmatched close-group: both are REG_EPAREN. */ diff --git a/src/regex.h b/src/regex.h index 08d8bd9..5fce8b3 100644 --- a/src/regex.h +++ b/src/regex.h @@ -23,6 +23,12 @@ #ifndef INCLUDED_regex_h_ #define INCLUDED_regex_h_ +#ifdef emacs +#define RE_TRANSLATE_TYPE Lisp_Object +#else +#define RE_TRANSLATE_TYPE char * +#endif /* emacs */ + /* POSIX says that must be included (by the caller) before . */ @@ -329,7 +335,7 @@ struct re_pattern_buffer comparing them, or zero for no translation. The translation is applied to a pattern when it is compiled and to a string when it is matched. */ - char *translate; + RE_TRANSLATE_TYPE translate; /* Number of subexpressions found by the compiler. */ size_t re_nsub; diff --git a/src/s/cygwin32.h b/src/s/cygwin32.h index 8a2c246..4b01e7f 100644 --- a/src/s/cygwin32.h +++ b/src/s/cygwin32.h @@ -179,6 +179,12 @@ double logb (double); #define NO_MATHERR +/* + * Define HAVE_PTYS if the system supports pty devices. + */ + +#define HAVE_PTYS + /* define MAIL_USE_FLOCK if the mailer uses flock to interlock access to /usr/spool/mail/$USER. The alternative is that a lock file named diff --git a/src/search.c b/src/search.c index 7738cde..169e1d7 100644 --- a/src/search.c +++ b/src/search.c @@ -38,13 +38,18 @@ Boston, MA 02111-1307, USA. */ #include #include "regex.h" +#include "casetab.h" +#include "chartab.h" +#define TRANSLATE(table, pos) \ + (!NILP (table) ? TRT_TABLE_OF (table, (Emchar) pos) : pos) #define REGEXP_CACHE_SIZE 20 /* If the regexp is non-nil, then the buffer contains the compiled form of that regexp, suitable for searching. */ -struct regexp_cache { +struct regexp_cache +{ struct regexp_cache *next; Lisp_Object regexp; struct re_pattern_buffer buf; @@ -104,9 +109,16 @@ Lisp_Object Vskip_chars_range_table; static void set_search_regs (struct buffer *buf, Bufpos beg, Charcount len); static void save_search_regs (void); +static Bufpos simple_search (struct buffer *buf, Bufbyte *base_pat, + Bytecount len, Bytind pos, Bytind lim, + EMACS_INT n, Lisp_Object trt); +static Bufpos boyer_moore (struct buffer *buf, Bufbyte *base_pat, + Bytecount len, Bytind pos, Bytind lim, + EMACS_INT n, Lisp_Object trt, + Lisp_Object inverse_trt, int charset_base); static Bufpos search_buffer (struct buffer *buf, Lisp_Object str, Bufpos bufpos, Bufpos buflim, EMACS_INT n, int RE, - unsigned char *trt, unsigned char *inverse_trt, + Lisp_Object trt, Lisp_Object inverse_trt, int posix); static void @@ -128,7 +140,7 @@ matcher_overflow (void) static int compile_pattern_1 (struct regexp_cache *cp, Lisp_Object pattern, - char *translate, struct re_registers *regp, int posix, + Lisp_Object translate, struct re_registers *regp, int posix, Error_behavior errb) { const char *val; @@ -167,7 +179,7 @@ compile_pattern_1 (struct regexp_cache *cp, Lisp_Object pattern, struct re_pattern_buffer * compile_pattern (Lisp_Object pattern, struct re_registers *regp, - char *translate, int posix, Error_behavior errb) + Lisp_Object translate, int posix, Error_behavior errb) { struct regexp_cache *cp, **cpp; @@ -175,7 +187,7 @@ compile_pattern (Lisp_Object pattern, struct re_registers *regp, { cp = *cpp; if (!NILP (Fstring_equal (cp->regexp, pattern)) - && cp->buf.translate == translate + && EQ (cp->buf.translate, translate) && cp->posix == posix) break; @@ -210,8 +222,9 @@ Lisp_Object Qsearch_failed; static Lisp_Object signal_failure (Lisp_Object arg) { - Fsignal (Qsearch_failed, list1 (arg)); - return Qnil; + for (;;) + Fsignal (Qsearch_failed, list1 (arg)); + return Qnil; /* Not reached. */ } /* Convert the search registers from Bytinds to Bufpos's. Needs to be @@ -286,8 +299,7 @@ looking_at_1 (Lisp_Object string, struct buffer *buf, int posix) CHECK_STRING (string); bufp = compile_pattern (string, &search_regs, (!NILP (buf->case_fold_search) - ? (char *) MIRROR_DOWNCASE_TABLE_AS_STRING (buf) - : 0), + ? XCASE_TABLE_DOWNCASE (buf->case_table) : Qnil), posix, ERROR_ME); QUIT; @@ -386,8 +398,8 @@ string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start, bufp = compile_pattern (regexp, &search_regs, (!NILP (buf->case_fold_search) - ? (char *) MIRROR_DOWNCASE_TABLE_AS_STRING (buf) - : 0), 0, ERROR_ME); + ? XCASE_TABLE_DOWNCASE (buf->case_table) : Qnil), + 0, ERROR_ME); QUIT; { Bytecount bis = charcount_to_bytecount (XSTRING_DATA (string), s); @@ -456,10 +468,8 @@ fast_string_match (Lisp_Object regexp, const Bufbyte *nonreloc, bufp = compile_pattern (regexp, 0, (case_fold_search - ? (char *) - /* #### evil current-buffer dependency */ - MIRROR_DOWNCASE_TABLE_AS_STRING (current_buffer) - : 0), + ? XCASE_TABLE_DOWNCASE (current_buffer->case_table) + : Qnil), 0, errb); if (!bufp) return -1; /* will only do this when errb != ERROR_ME */ @@ -1025,11 +1035,11 @@ search_command (Lisp_Object string, Lisp_Object limit, Lisp_Object noerror, np = search_buffer (buf, string, BUF_PT (buf), lim, n, RE, (!NILP (buf->case_fold_search) - ? MIRROR_CANON_TABLE_AS_STRING (buf) - : 0), + ? XCASE_TABLE_CANON (buf->case_table) + : Qnil), (!NILP (buf->case_fold_search) - ? MIRROR_EQV_TABLE_AS_STRING (buf) - : 0), posix); + ? XCASE_TABLE_EQV (buf->case_table) + : Qnil), posix); if (np <= 0) { @@ -1107,25 +1117,14 @@ trivial_regexp_p (Lisp_Object regexp) POSIX is nonzero if we want full backtracking (POSIX style) for this pattern. 0 means backtrack only enough to get a valid match. */ - static Bufpos search_buffer (struct buffer *buf, Lisp_Object string, Bufpos bufpos, - Bufpos buflim, EMACS_INT n, int RE, unsigned char *trt, - unsigned char *inverse_trt, int posix) + Bufpos buflim, EMACS_INT n, int RE, Lisp_Object trt, + Lisp_Object inverse_trt, int posix) { /* This function has been Mule-ized, except for the trt table handling. */ Bytecount len = XSTRING_LENGTH (string); Bufbyte *base_pat = XSTRING_DATA (string); - REGISTER EMACS_INT *BM_tab; - EMACS_INT *BM_tab_base; - REGISTER int direction = ((n > 0) ? 1 : -1); - REGISTER Bytecount dirlen; - EMACS_INT infinity; - Bytind limit; - EMACS_INT k; - Bytecount stride_for_teases = 0; - REGISTER Bufbyte *pat = 0; - REGISTER Bufbyte *cursor, *p_limit, *ptr2; REGISTER EMACS_INT i, j; Bytind p1, p2; Bytecount s1, s2; @@ -1151,7 +1150,7 @@ search_buffer (struct buffer *buf, Lisp_Object string, Bufpos bufpos, { struct re_pattern_buffer *bufp; - bufp = compile_pattern (string, &search_regs, (char *) trt, posix, + bufp = compile_pattern (string, &search_regs, trt, posix, ERROR_ME); /* Get pointers and sizes of the two strings @@ -1242,318 +1241,657 @@ search_buffer (struct buffer *buf, Lisp_Object string, Bufpos bufpos, return bufpos; } else /* non-RE case */ - /* #### Someone really really really needs to comment the workings - of this junk somewhat better. - - BTW "BM" stands for Boyer-Moore, which is one of the standard - string-searching algorithms. It's the best string-searching - algorithm out there, provided that: - - a) You're not fazed by algorithm complexity. (Rabin-Karp, which - uses hashing, is much much easier to code but not as fast.) - b) You can freely move backwards in the string that you're - searching through. - - As the comment below tries to explain (but garbles in typical - programmer-ese), the idea is that you don't have to do a - string match at every successive position in the text. For - example, let's say the pattern is "a very long string". We - compare the last character in the string (`g') with the - corresponding character in the text. If it mismatches, and - it is, say, `z', then we can skip forward by the entire - length of the pattern because `z' does not occur anywhere - in the pattern. If the mismatching character does occur - in the pattern, we can usually still skip forward by more - than one: e.g. if it is `l', then we can skip forward - by the length of the substring "ong string" -- i.e. the - largest end section of the pattern that does not contain - the mismatched character. So what we do is compute, for - each possible character, the distance we can skip forward - (the "stride") and use it in the string matching. This - is what the BM_tab holds. */ { -#ifdef C_ALLOCA - EMACS_INT BM_tab_space[0400]; - BM_tab = &BM_tab_space[0]; -#else - BM_tab = alloca_array (EMACS_INT, 256); -#endif + int charset_base = -1; + int boyer_moore_ok = 1; + Bufbyte *pat = 0; + Bufbyte *patbuf = alloca_array (Bufbyte, len * MAX_EMCHAR_LEN); + pat = patbuf; +#ifdef MULE + while (len > 0) + { + Bufbyte tmp_str[MAX_EMCHAR_LEN]; + Emchar c, translated, inverse; + Bytecount orig_bytelen, new_bytelen, inv_bytelen; + + /* If we got here and the RE flag is set, it's because + we're dealing with a regexp known to be trivial, so the + backslash just quotes the next character. */ + if (RE && *base_pat == '\\') + { + len--; + base_pat++; + } + c = charptr_emchar (base_pat); + translated = TRANSLATE (trt, c); + inverse = TRANSLATE (inverse_trt, c); + + orig_bytelen = charcount_to_bytecount (base_pat, 1); + inv_bytelen = set_charptr_emchar (tmp_str, inverse); + new_bytelen = set_charptr_emchar (tmp_str, translated); + + + if (new_bytelen != orig_bytelen || inv_bytelen != orig_bytelen) + boyer_moore_ok = 0; + if (translated != c || inverse != c) + { + /* Keep track of which character set row + contains the characters that need translation. */ + int charset_base_code = c & ~CHAR_FIELD3_MASK; + if (charset_base == -1) + charset_base = charset_base_code; + else if (charset_base != charset_base_code) + /* If two different rows appear, needing translation, + then we cannot use boyer_moore search. */ + boyer_moore_ok = 0; + } + memcpy (pat, tmp_str, new_bytelen); + pat += new_bytelen; + base_pat += orig_bytelen; + len -= orig_bytelen; + } +#else /* not MULE */ + while (--len >= 0) + { + /* If we got here and the RE flag is set, it's because + we're dealing with a regexp known to be trivial, so the + backslash just quotes the next character. */ + if (RE && *base_pat == '\\') + { + len--; + base_pat++; + } + *pat++ = TRANSLATE (trt, *base_pat++); + } +#endif /* MULE */ + len = pat - patbuf; + pat = base_pat = patbuf; + if (boyer_moore_ok) + return boyer_moore (buf, base_pat, len, pos, lim, n, + trt, inverse_trt, charset_base); + else + return simple_search (buf, base_pat, len, pos, lim, n, trt); + } +} + +/* Do a simple string search N times for the string PAT, + whose length is LEN/LEN_BYTE, + from buffer position POS/POS_BYTE until LIM/LIM_BYTE. + TRT is the translation table. + + Return the character position where the match is found. + Otherwise, if M matches remained to be found, return -M. + + This kind of search works regardless of what is in PAT and + regardless of what is in TRT. It is used in cases where + boyer_moore cannot work. */ + +static Bufpos +simple_search (struct buffer *buf, Bufbyte *base_pat, Bytecount len_byte, + Bytind idx, Bytind lim, EMACS_INT n, Lisp_Object trt) +{ + int forward = n > 0; + Bytecount buf_len = 0; /* Shut up compiler. */ + + if (lim > idx) + while (n > 0) { - Bufbyte *patbuf = alloca_array (Bufbyte, len); - pat = patbuf; - while (--len >= 0) + while (1) { - /* If we got here and the RE flag is set, it's because we're - dealing with a regexp known to be trivial, so the backslash - just quotes the next character. */ - if (RE && *base_pat == '\\') + Bytecount this_len = len_byte; + Bytind this_idx = idx; + Bufbyte *p = base_pat; + if (idx >= lim) + goto stop; + + while (this_len > 0) + { + Emchar pat_ch, buf_ch; + Bytecount pat_len; + + pat_ch = charptr_emchar (p); + buf_ch = BI_BUF_FETCH_CHAR (buf, this_idx); + + buf_ch = TRANSLATE (trt, buf_ch); + + if (buf_ch != pat_ch) + break; + + pat_len = charcount_to_bytecount (p, 1); + p += pat_len; + this_len -= pat_len; + INC_BYTIND (buf, this_idx); + } + if (this_len == 0) { - len--; - base_pat++; + buf_len = this_idx - idx; + idx = this_idx; + break; } - *pat++ = (trt ? trt[*base_pat++] : *base_pat++); + INC_BYTIND (buf, idx); } - len = pat - patbuf; - pat = base_pat = patbuf; + n--; } - /* The general approach is that we are going to maintain that we know */ - /* the first (closest to the present position, in whatever direction */ - /* we're searching) character that could possibly be the last */ - /* (furthest from present position) character of a valid match. We */ - /* advance the state of our knowledge by looking at that character */ - /* and seeing whether it indeed matches the last character of the */ - /* pattern. If it does, we take a closer look. If it does not, we */ - /* move our pointer (to putative last characters) as far as is */ - /* logically possible. This amount of movement, which I call a */ - /* stride, will be the length of the pattern if the actual character */ - /* appears nowhere in the pattern, otherwise it will be the distance */ - /* from the last occurrence of that character to the end of the */ - /* pattern. */ - /* As a coding trick, an enormous stride is coded into the table for */ - /* characters that match the last character. This allows use of only */ - /* a single test, a test for having gone past the end of the */ - /* permissible match region, to test for both possible matches (when */ - /* the stride goes past the end immediately) and failure to */ - /* match (where you get nudged past the end one stride at a time). */ - - /* Here we make a "mickey mouse" BM table. The stride of the search */ - /* is determined only by the last character of the putative match. */ - /* If that character does not match, we will stride the proper */ - /* distance to propose a match that superimposes it on the last */ - /* instance of a character that matches it (per trt), or misses */ - /* it entirely if there is none. */ - - dirlen = len * direction; - infinity = dirlen - (lim + pos + len + len) * direction; - if (direction < 0) - pat = (base_pat += len - 1); - BM_tab_base = BM_tab; - BM_tab += 0400; - j = dirlen; /* to get it in a register */ - /* A character that does not appear in the pattern induces a */ - /* stride equal to the pattern length. */ - while (BM_tab_base != BM_tab) + else + while (n < 0) + { + while (1) + { + Bytecount this_len = len_byte; + Bytind this_idx = idx; + Bufbyte *p; + if (idx <= lim) + goto stop; + p = base_pat + len_byte; + + while (this_len > 0) + { + Emchar pat_ch, buf_ch; + + DEC_CHARPTR (p); + DEC_BYTIND (buf, this_idx); + pat_ch = charptr_emchar (p); + buf_ch = BI_BUF_FETCH_CHAR (buf, this_idx); + + buf_ch = TRANSLATE (trt, buf_ch); + + if (buf_ch != pat_ch) + break; + + this_len -= charcount_to_bytecount (p, 1); + } + if (this_len == 0) + { + buf_len = idx - this_idx; + idx = this_idx; + break; + } + DEC_BYTIND (buf, idx); + } + n++; + } + stop: + if (n == 0) + { + Bufpos beg, end, retval; + if (forward) { - *--BM_tab = j; - *--BM_tab = j; - *--BM_tab = j; - *--BM_tab = j; + beg = bytind_to_bufpos (buf, idx - buf_len); + retval = end = bytind_to_bufpos (buf, idx); } - i = 0; - while (i != infinity) + else { - j = pat[i]; i += direction; - if (i == dirlen) i = infinity; - if (trt != 0) - { - k = (j = trt[j]); - if (i == infinity) - stride_for_teases = BM_tab[j]; - BM_tab[j] = dirlen - i; - /* A translation table is accompanied by its inverse -- see */ - /* comment following downcase_table for details */ + retval = beg = bytind_to_bufpos (buf, idx); + end = bytind_to_bufpos (buf, idx + buf_len); + } + set_search_regs (buf, beg, end - beg); + + return retval; + } + else if (n > 0) + return -n; + else + return n; +} + +/* Do Boyer-Moore search N times for the string PAT, + whose length is LEN/LEN_BYTE, + from buffer position POS/POS_BYTE until LIM/LIM_BYTE. + DIRECTION says which direction we search in. + TRT and INVERSE_TRT are translation tables. + + This kind of search works if all the characters in PAT that have + nontrivial translation are the same aside from the last byte. This + makes it possible to translate just the last byte of a character, + and do so after just a simple test of the context. + + If that criterion is not satisfied, do not call this function. */ + +static Bufpos +boyer_moore (struct buffer *buf, Bufbyte *base_pat, Bytecount len, + Bytind pos, Bytind lim, EMACS_INT n, Lisp_Object trt, + Lisp_Object inverse_trt, int charset_base) +{ + /* #### Someone really really really needs to comment the workings + of this junk somewhat better. + + BTW "BM" stands for Boyer-Moore, which is one of the standard + string-searching algorithms. It's the best string-searching + algorithm out there, provided that: + + a) You're not fazed by algorithm complexity. (Rabin-Karp, which + uses hashing, is much much easier to code but not as fast.) + b) You can freely move backwards in the string that you're + searching through. + + As the comment below tries to explain (but garbles in typical + programmer-ese), the idea is that you don't have to do a + string match at every successive position in the text. For + example, let's say the pattern is "a very long string". We + compare the last character in the string (`g') with the + corresponding character in the text. If it mismatches, and + it is, say, `z', then we can skip forward by the entire + length of the pattern because `z' does not occur anywhere + in the pattern. If the mismatching character does occur + in the pattern, we can usually still skip forward by more + than one: e.g. if it is `l', then we can skip forward + by the length of the substring "ong string" -- i.e. the + largest end section of the pattern that does not contain + the mismatched character. So what we do is compute, for + each possible character, the distance we can skip forward + (the "stride") and use it in the string matching. This + is what the BM_tab holds. */ + REGISTER EMACS_INT *BM_tab; + EMACS_INT *BM_tab_base; + REGISTER Bytecount dirlen; + EMACS_INT infinity; + Bytind limit; + Bytecount stride_for_teases = 0; + REGISTER EMACS_INT i, j; + Bufbyte *pat, *pat_end; + REGISTER Bufbyte *cursor, *p_limit, *ptr2; + Bufbyte simple_translate[0400]; + REGISTER int direction = ((n > 0) ? 1 : -1); +#ifdef MULE + Bufbyte translate_prev_byte = 0; + Bufbyte translate_anteprev_byte = 0; +#endif +#ifdef C_ALLOCA + EMACS_INT BM_tab_space[0400]; + BM_tab = &BM_tab_space[0]; +#else + BM_tab = alloca_array (EMACS_INT, 256); +#endif + + /* The general approach is that we are going to maintain that we + know the first (closest to the present position, in whatever + direction we're searching) character that could possibly be + the last (furthest from present position) character of a + valid match. We advance the state of our knowledge by + looking at that character and seeing whether it indeed + matches the last character of the pattern. If it does, we + take a closer look. If it does not, we move our pointer (to + putative last characters) as far as is logically possible. + This amount of movement, which I call a stride, will be the + length of the pattern if the actual character appears nowhere + in the pattern, otherwise it will be the distance from the + last occurrence of that character to the end of the pattern. + As a coding trick, an enormous stride is coded into the table + for characters that match the last character. This allows + use of only a single test, a test for having gone past the + end of the permissible match region, to test for both + possible matches (when the stride goes past the end + immediately) and failure to match (where you get nudged past + the end one stride at a time). + + Here we make a "mickey mouse" BM table. The stride of the + search is determined only by the last character of the + putative match. If that character does not match, we will + stride the proper distance to propose a match that + superimposes it on the last instance of a character that + matches it (per trt), or misses it entirely if there is + none. */ + + dirlen = len * direction; + infinity = dirlen - (lim + pos + len + len) * direction; + /* Record position after the end of the pattern. */ + pat_end = base_pat + len; + if (direction < 0) + base_pat = pat_end - 1; + BM_tab_base = BM_tab; + BM_tab += 0400; + j = dirlen; /* to get it in a register */ + /* A character that does not appear in the pattern induces a + stride equal to the pattern length. */ + while (BM_tab_base != BM_tab) + { + *--BM_tab = j; + *--BM_tab = j; + *--BM_tab = j; + *--BM_tab = j; + } + /* We use this for translation, instead of TRT itself. We + fill this in to handle the characters that actually occur + in the pattern. Others don't matter anyway! */ + xzero (simple_translate); + for (i = 0; i < 0400; i++) + simple_translate[i] = i; + i = 0; + while (i != infinity) + { + Bufbyte *ptr = base_pat + i; + i += direction; + if (i == dirlen) + i = infinity; + if (!NILP (trt)) + { +#ifdef MULE + Emchar ch, untranslated; + int this_translated = 1; - while ((j = inverse_trt[j]) != k) - BM_tab[j] = dirlen - i; + /* Is *PTR the last byte of a character? */ + if (pat_end - ptr == 1 || BUFBYTE_FIRST_BYTE_P (ptr[1])) + { + Bufbyte *charstart = ptr; + while (!BUFBYTE_FIRST_BYTE_P (*charstart)) + charstart--; + untranslated = charptr_emchar (charstart); + if (charset_base == (untranslated & ~CHAR_FIELD3_MASK)) + { + ch = TRANSLATE (trt, untranslated); + if (!BUFBYTE_FIRST_BYTE_P (*ptr)) + { + translate_prev_byte = ptr[-1]; + if (!BUFBYTE_FIRST_BYTE_P (translate_prev_byte)) + translate_anteprev_byte = ptr[-2]; + } + } + else + { + this_translated = 0; + ch = *ptr; + } + } + else + { + ch = *ptr; + this_translated = 0; } + if (ch > 0400) + j = ((unsigned char) ch | 0200); else + j = (unsigned char) ch; + + if (i == infinity) + stride_for_teases = BM_tab[j]; + BM_tab[j] = dirlen - i; + /* A translation table is accompanied by its inverse -- + see comment following downcase_table for details */ + if (this_translated) + { + Emchar starting_ch = ch; + EMACS_INT starting_j = j; + while (1) + { + ch = TRANSLATE (inverse_trt, ch); + if (ch > 0400) + j = ((unsigned char) ch | 0200); + else + j = (unsigned char) ch; + + /* For all the characters that map into CH, + set up simple_translate to map the last byte + into STARTING_J. */ + simple_translate[j] = starting_j; + if (ch == starting_ch) + break; + BM_tab[j] = dirlen - i; + } + } +#else + EMACS_INT k; + j = *ptr; + k = (j = TRANSLATE (trt, j)); + if (i == infinity) + stride_for_teases = BM_tab[j]; + BM_tab[j] = dirlen - i; + /* A translation table is accompanied by its inverse -- + see comment following downcase_table for details */ + + while ((j = TRANSLATE (inverse_trt, j)) != k) { - if (i == infinity) - stride_for_teases = BM_tab[j]; + simple_translate[j] = k; BM_tab[j] = dirlen - i; } - /* stride_for_teases tells how much to stride if we get a */ - /* match on the far character but are subsequently */ - /* disappointed, by recording what the stride would have been */ - /* for that character if the last character had been */ - /* different. */ +#endif } - infinity = dirlen - infinity; - pos += dirlen - ((direction > 0) ? direction : 0); - /* loop invariant - pos points at where last char (first char if reverse) - of pattern would align in a possible match. */ - while (n != 0) + else { - /* It's been reported that some (broken) compiler thinks that - Boolean expressions in an arithmetic context are unsigned. - Using an explicit ?1:0 prevents this. */ - if ((lim - pos - ((direction > 0) ? 1 : 0)) * direction < 0) - return n * (0 - direction); - /* First we do the part we can by pointers (maybe nothing) */ - QUIT; - pat = base_pat; - limit = pos - dirlen + direction; - /* XEmacs change: definitions of CEILING_OF and FLOOR_OF - have changed. See buffer.h. */ - limit = ((direction > 0) - ? BI_BUF_CEILING_OF (buf, limit) - 1 - : BI_BUF_FLOOR_OF (buf, limit + 1)); - /* LIMIT is now the last (not beyond-last!) value - POS can take on without hitting edge of buffer or the gap. */ - limit = ((direction > 0) - ? min (lim - 1, min (limit, pos + 20000)) - : max (lim, max (limit, pos - 20000))); - if ((limit - pos) * direction > 20) + j = *ptr; + + if (i == infinity) + stride_for_teases = BM_tab[j]; + BM_tab[j] = dirlen - i; + } + /* stride_for_teases tells how much to stride if we get a + match on the far character but are subsequently + disappointed, by recording what the stride would have been + for that character if the last character had been + different. */ + } + infinity = dirlen - infinity; + pos += dirlen - ((direction > 0) ? direction : 0); + /* loop invariant - pos points at where last char (first char if + reverse) of pattern would align in a possible match. */ + while (n != 0) + { + Bytind tail_end; + Bufbyte *tail_end_ptr; + /* It's been reported that some (broken) compiler thinks + that Boolean expressions in an arithmetic context are + unsigned. Using an explicit ?1:0 prevents this. */ + if ((lim - pos - ((direction > 0) ? 1 : 0)) * direction < 0) + return n * (0 - direction); + /* First we do the part we can by pointers (maybe + nothing) */ + QUIT; + pat = base_pat; + limit = pos - dirlen + direction; + /* XEmacs change: definitions of CEILING_OF and FLOOR_OF + have changed. See buffer.h. */ + limit = ((direction > 0) + ? BI_BUF_CEILING_OF (buf, limit) - 1 + : BI_BUF_FLOOR_OF (buf, limit + 1)); + /* LIMIT is now the last (not beyond-last!) value POS can + take on without hitting edge of buffer or the gap. */ + limit = ((direction > 0) + ? min (lim - 1, min (limit, pos + 20000)) + : max (lim, max (limit, pos - 20000))); + tail_end = BI_BUF_CEILING_OF (buf, pos); + tail_end_ptr = BI_BUF_BYTE_ADDRESS (buf, tail_end); + + if ((limit - pos) * direction > 20) + { + p_limit = BI_BUF_BYTE_ADDRESS (buf, limit); + ptr2 = (cursor = BI_BUF_BYTE_ADDRESS (buf, pos)); + /* In this loop, pos + cursor - ptr2 is the surrogate + for pos */ + while (1) /* use one cursor setting as long as i can */ { - p_limit = BI_BUF_BYTE_ADDRESS (buf, limit); - ptr2 = (cursor = BI_BUF_BYTE_ADDRESS (buf, pos)); - /* In this loop, pos + cursor - ptr2 is the surrogate for pos */ - while (1) /* use one cursor setting as long as i can */ + if (direction > 0) /* worth duplicating */ { - if (direction > 0) /* worth duplicating */ - { - /* Use signed comparison if appropriate - to make cursor+infinity sure to be > p_limit. - Assuming that the buffer lies in a range of addresses - that are all "positive" (as ints) or all "negative", - either kind of comparison will work as long - as we don't step by infinity. So pick the kind - that works when we do step by infinity. */ - if ((EMACS_INT) (p_limit + infinity) > - (EMACS_INT) p_limit) - while ((EMACS_INT) cursor <= - (EMACS_INT) p_limit) - cursor += BM_tab[*cursor]; - else - while ((EMACS_UINT) cursor <= - (EMACS_UINT) p_limit) - cursor += BM_tab[*cursor]; - } + /* Use signed comparison if appropriate to make + cursor+infinity sure to be > p_limit. + Assuming that the buffer lies in a range of + addresses that are all "positive" (as ints) + or all "negative", either kind of comparison + will work as long as we don't step by + infinity. So pick the kind that works when + we do step by infinity. */ + if ((EMACS_INT) (p_limit + infinity) > + (EMACS_INT) p_limit) + while ((EMACS_INT) cursor <= + (EMACS_INT) p_limit) + cursor += BM_tab[*cursor]; else - { - if ((EMACS_INT) (p_limit + infinity) < - (EMACS_INT) p_limit) - while ((EMACS_INT) cursor >= - (EMACS_INT) p_limit) - cursor += BM_tab[*cursor]; - else - while ((EMACS_UINT) cursor >= - (EMACS_UINT) p_limit) - cursor += BM_tab[*cursor]; - } - /* If you are here, cursor is beyond the end of the searched region. */ - /* This can happen if you match on the far character of the pattern, */ - /* because the "stride" of that character is infinity, a number able */ - /* to throw you well beyond the end of the search. It can also */ - /* happen if you fail to match within the permitted region and would */ - /* otherwise try a character beyond that region */ - if ((cursor - p_limit) * direction <= len) - break; /* a small overrun is genuine */ - cursor -= infinity; /* large overrun = hit */ - i = dirlen - direction; - if (trt != 0) - { - while ((i -= direction) + direction != 0) - if (pat[i] != trt[*(cursor -= direction)]) - break; - } + while ((EMACS_UINT) cursor <= + (EMACS_UINT) p_limit) + cursor += BM_tab[*cursor]; + } + else + { + if ((EMACS_INT) (p_limit + infinity) < + (EMACS_INT) p_limit) + while ((EMACS_INT) cursor >= + (EMACS_INT) p_limit) + cursor += BM_tab[*cursor]; else + while ((EMACS_UINT) cursor >= + (EMACS_UINT) p_limit) + cursor += BM_tab[*cursor]; + } + /* If you are here, cursor is beyond the end of the + searched region. This can happen if you match on + the far character of the pattern, because the + "stride" of that character is infinity, a number + able to throw you well beyond the end of the + search. It can also happen if you fail to match + within the permitted region and would otherwise + try a character beyond that region */ + if ((cursor - p_limit) * direction <= len) + break; /* a small overrun is genuine */ + cursor -= infinity; /* large overrun = hit */ + i = dirlen - direction; + if (!NILP (trt)) + { + while ((i -= direction) + direction != 0) { - while ((i -= direction) + direction != 0) - if (pat[i] != *(cursor -= direction)) - break; - } - cursor += dirlen - i - direction; /* fix cursor */ - if (i + direction == 0) - { +#ifdef MULE + Emchar ch; cursor -= direction; + /* Translate only the last byte of a character. */ + if ((cursor == tail_end_ptr + || BUFBYTE_FIRST_BYTE_P (cursor[1])) + && (BUFBYTE_FIRST_BYTE_P (cursor[0]) + || (translate_prev_byte == cursor[-1] + && (BUFBYTE_FIRST_BYTE_P (translate_prev_byte) + || translate_anteprev_byte == cursor[-2])))) + ch = simple_translate[*cursor]; + else + ch = *cursor; + if (pat[i] != ch) + break; +#else + if (pat[i] != TRANSLATE (trt, *(cursor -= direction))) + break; +#endif + } + } + else + { + while ((i -= direction) + direction != 0) + if (pat[i] != *(cursor -= direction)) + break; + } + cursor += dirlen - i - direction; /* fix cursor */ + if (i + direction == 0) + { + cursor -= direction; - { - Bytind bytstart = (pos + cursor - ptr2 + - ((direction > 0) - ? 1 - len : 0)); - Bufpos bufstart = bytind_to_bufpos (buf, bytstart); - Bufpos bufend = bytind_to_bufpos (buf, bytstart + len); + { + Bytind bytstart = (pos + cursor - ptr2 + + ((direction > 0) + ? 1 - len : 0)); + Bufpos bufstart = bytind_to_bufpos (buf, bytstart); + Bufpos bufend = bytind_to_bufpos (buf, bytstart + len); - set_search_regs (buf, bufstart, bufend - bufstart); - } + set_search_regs (buf, bufstart, bufend - bufstart); + } - if ((n -= direction) != 0) - cursor += dirlen; /* to resume search */ - else - return ((direction > 0) - ? search_regs.end[0] : search_regs.start[0]); - } + if ((n -= direction) != 0) + cursor += dirlen; /* to resume search */ else - cursor += stride_for_teases; /* we lose - */ + return ((direction > 0) + ? search_regs.end[0] : search_regs.start[0]); } - pos += cursor - ptr2; + else + cursor += stride_for_teases; /* we lose - */ } - else - /* Now we'll pick up a clump that has to be done the hard */ - /* way because it covers a discontinuity */ + pos += cursor - ptr2; + } + else + /* Now we'll pick up a clump that has to be done the hard + way because it covers a discontinuity */ + { + /* XEmacs change: definitions of CEILING_OF and FLOOR_OF + have changed. See buffer.h. */ + limit = ((direction > 0) + ? BI_BUF_CEILING_OF (buf, pos - dirlen + 1) - 1 + : BI_BUF_FLOOR_OF (buf, pos - dirlen)); + limit = ((direction > 0) + ? min (limit + len, lim - 1) + : max (limit - len, lim)); + /* LIMIT is now the last value POS can have + and still be valid for a possible match. */ + while (1) { - /* XEmacs change: definitions of CEILING_OF and FLOOR_OF - have changed. See buffer.h. */ - limit = ((direction > 0) - ? BI_BUF_CEILING_OF (buf, pos - dirlen + 1) - 1 - : BI_BUF_FLOOR_OF (buf, pos - dirlen)); - limit = ((direction > 0) - ? min (limit + len, lim - 1) - : max (limit - len, lim)); - /* LIMIT is now the last value POS can have - and still be valid for a possible match. */ - while (1) + /* This loop can be coded for space rather than + speed because it will usually run only once. + (the reach is at most len + 21, and typically + does not exceed len) */ + while ((limit - pos) * direction >= 0) + /* *not* BI_BUF_FETCH_CHAR. We are working here + with bytes, not characters. */ + pos += BM_tab[*BI_BUF_BYTE_ADDRESS (buf, pos)]; + /* now run the same tests to distinguish going off + the end, a match or a phony match. */ + if ((pos - limit) * direction <= len) + break; /* ran off the end */ + /* Found what might be a match. + Set POS back to last (first if reverse) char pos. */ + pos -= infinity; + i = dirlen - direction; + while ((i -= direction) + direction != 0) { - /* This loop can be coded for space rather than */ - /* speed because it will usually run only once. */ - /* (the reach is at most len + 21, and typically */ - /* does not exceed len) */ - while ((limit - pos) * direction >= 0) - /* *not* BI_BUF_FETCH_CHAR. We are working here - with bytes, not characters. */ - pos += BM_tab[*BI_BUF_BYTE_ADDRESS (buf, pos)]; - /* now run the same tests to distinguish going off the */ - /* end, a match or a phony match. */ - if ((pos - limit) * direction <= len) - break; /* ran off the end */ - /* Found what might be a match. - Set POS back to last (first if reverse) char pos. */ - pos -= infinity; - i = dirlen - direction; - while ((i -= direction) + direction != 0) - { - pos -= direction; - if (pat[i] != (((Bufbyte *) trt) - /* #### Does not handle TRT right */ - ? trt[*BI_BUF_BYTE_ADDRESS (buf, pos)] - : *BI_BUF_BYTE_ADDRESS (buf, pos))) - break; - } - /* Above loop has moved POS part or all the way - back to the first char pos (last char pos if reverse). - Set it once again at the last (first if reverse) char. */ - pos += dirlen - i- direction; - if (i + direction == 0) - { - pos -= direction; +#ifdef MULE + Emchar ch; + Bufbyte *ptr; +#endif + pos -= direction; +#ifdef MULE + ptr = BI_BUF_BYTE_ADDRESS (buf, pos); + if ((ptr == tail_end_ptr + || BUFBYTE_FIRST_BYTE_P (ptr[1])) + && (BUFBYTE_FIRST_BYTE_P (ptr[0]) + || (translate_prev_byte == ptr[-1] + && (BUFBYTE_FIRST_BYTE_P (translate_prev_byte) + || translate_anteprev_byte == ptr[-2])))) + ch = simple_translate[*ptr]; + else + ch = *ptr; + if (pat[i] != ch) + break; + +#else + if (pat[i] != TRANSLATE (trt, + *BI_BUF_BYTE_ADDRESS (buf, pos))) + break; +#endif + } + /* Above loop has moved POS part or all the way back + to the first char pos (last char pos if reverse). + Set it once again at the last (first if reverse) + char. */ + pos += dirlen - i- direction; + if (i + direction == 0) + { + pos -= direction; - { - Bytind bytstart = (pos + - ((direction > 0) - ? 1 - len : 0)); - Bufpos bufstart = bytind_to_bufpos (buf, bytstart); - Bufpos bufend = bytind_to_bufpos (buf, bytstart + len); + { + Bytind bytstart = (pos + + ((direction > 0) + ? 1 - len : 0)); + Bufpos bufstart = bytind_to_bufpos (buf, bytstart); + Bufpos bufend = bytind_to_bufpos (buf, bytstart + len); - set_search_regs (buf, bufstart, bufend - bufstart); - } + set_search_regs (buf, bufstart, bufend - bufstart); + } - if ((n -= direction) != 0) - pos += dirlen; /* to resume search */ - else - return ((direction > 0) - ? search_regs.end[0] : search_regs.start[0]); - } + if ((n -= direction) != 0) + pos += dirlen; /* to resume search */ else - pos += stride_for_teases; + return ((direction > 0) + ? search_regs.end[0] : search_regs.start[0]); } - } - /* We have done one clump. Can we continue? */ - if ((lim - pos) * direction < 0) - return (0 - n) * direction; + else + pos += stride_for_teases; + } } - return bytind_to_bufpos (buf, pos); + /* We have done one clump. Can we continue? */ + if ((lim - pos) * direction < 0) + return (0 - n) * direction; } + return bytind_to_bufpos (buf, pos); } /* Record beginning BEG and end BEG + LEN diff --git a/src/symbols.c b/src/symbols.c index 7599d00..bb0fae0 100644 --- a/src/symbols.c +++ b/src/symbols.c @@ -995,8 +995,10 @@ static const struct lrecord_description symbol_value_forward_description[] = { }; static const struct lrecord_description symbol_value_buffer_local_description[] = { - { XD_LISP_OBJECT, offsetof (struct symbol_value_buffer_local, default_value) }, - { XD_LO_RESET_NIL, offsetof (struct symbol_value_buffer_local, current_value), 3 }, + { XD_LISP_OBJECT, offsetof (struct symbol_value_buffer_local, default_value) }, + { XD_LISP_OBJECT, offsetof (struct symbol_value_buffer_local, current_value) }, + { XD_LISP_OBJECT, offsetof (struct symbol_value_buffer_local, current_buffer) }, + { XD_LISP_OBJECT, offsetof (struct symbol_value_buffer_local, current_alist_element) }, { XD_END } }; @@ -1395,6 +1397,71 @@ set_up_buffer_local_cache (Lisp_Object sym, store_symval_forwarding (sym, bfwd->current_value, new_val); } + +/* SYM is a buffer-local variable, and BFWD is its buffer-local structure. + Flush the cache. BFWD->CURRENT_BUFFER will be nil after this operation. +*/ + +static void +flush_buffer_local_cache (Lisp_Object sym, + struct symbol_value_buffer_local *bfwd) +{ + if (NILP (bfwd->current_buffer)) + /* Cache is already flushed. */ + return; + + /* Flush out the old cache. */ + write_out_buffer_local_cache (sym, bfwd); + + bfwd->current_alist_element = Qnil; + bfwd->current_buffer = Qnil; + + /* Now store default the value into the current-value slot. + We don't simply write it there, because the current-value + slot might be a forwarding pointer, in which case we need + to instead write the value into the C variable. + + We might also want to call a magic function. + + So instead, we call this function. */ + store_symval_forwarding (sym, bfwd->current_value, bfwd->default_value); +} + +/* Flush all the buffer-local variable caches. Whoever has a + non-interned buffer-local variable will be spanked. Whoever has a + magic variable that interns or uninterns symbols... I don't even + want to think about it. +*/ + +void +flush_all_buffer_local_cache (void) +{ + Lisp_Object *syms = XVECTOR_DATA (Vobarray); + long count = XVECTOR_LENGTH (Vobarray); + long i; + + for (i=0; i 0 ? BUF_ZV (buf) : BUF_BEGV (buf)); + BUF_SET_PT (buf, n > 0 ? BUF_ZV (buf) : BUF_BEGV (buf)); return Qnil; } - BUF_SET_PT (buf, val); - return Qt; } static void scan_sexps_forward (struct buffer *buf, @@ -648,14 +659,14 @@ find_end_of_comment (struct buffer *buf, Bufpos from, Bufpos stop, int mask) ever complains about this function not working properly, take a look at those changes. --ben */ -DEFUN ("forward-comment", Fforward_comment, 1, 2, 0, /* +DEFUN ("forward-comment", Fforward_comment, 0, 2, 0, /* Move forward across up to COUNT comments, or backwards if COUNT is negative. Stop scanning if we find something other than a comment or whitespace. Set point to where scanning stops. If COUNT comments are found as expected, with nothing except whitespace between them, return t; otherwise return nil. Point is set in either case. -Optional argument BUFFER defaults to the current buffer. +COUNT defaults to 1, and BUFFER defaults to the current buffer. */ (count, buffer)) { @@ -667,8 +678,13 @@ Optional argument BUFFER defaults to the current buffer. struct buffer *buf = decode_buffer (buffer, 0); Lisp_Char_Table *mirrortab = XCHAR_TABLE (buf->mirror_syntax_table); - CHECK_INT (count); - n = XINT (count); + if (NILP (count)) + n = 1; + else + { + CHECK_INT (count); + n = XINT (count); + } from = BUF_PT (buf); diff --git a/src/unexcw.c b/src/unexcw.c index a39fbc2..774c0fa 100644 --- a/src/unexcw.c +++ b/src/unexcw.c @@ -53,7 +53,11 @@ unexec (char *, char *, void *, void *, void *) ((((unsigned long)addr) + ALLOC_UNIT) & ALLOC_MASK) /* Note that all sections must be aligned on a 0x1000 boundary so this is the minimum size that our dummy bss can be. */ +#ifdef BROKEN_GDB #define BSS_PAD_SIZE 0x1000 +#else +#define BSS_PAD_SIZE 0 +#endif /* To prevent zero-initialized variables from being placed into the bss section, use non-zero values to represent an uninitialized state. */ @@ -121,7 +125,7 @@ void unexec (char *out_name, char *in_name, void *start_data, } if ((a_new = open (new_name, O_WRONLY | O_TRUNC | O_CREAT | OPEN_BINARY, - CREAT_MODE)) < 0) + 0755)) < 0) { PERROR (new_name); } @@ -306,6 +310,9 @@ copy_executable_and_dump_data_section (int a_out, int a_new) lseek (a_new, 0, SEEK_SET); /* write file header */ f_hdr.f_symptr += file_sz_change; +#ifndef BROKEN_GDB + f_hdr.f_nscns--; +#endif printf("writing file header\n"); if (write(a_new, &f_hdr, sizeof(f_hdr)) != sizeof(f_hdr)) @@ -333,7 +340,7 @@ copy_executable_and_dump_data_section (int a_out, int a_new) { PERROR("failed to write text header"); } - +#ifdef BROKEN_GDB /* Write small bss section. */ if (!sections_reversed) { @@ -345,7 +352,7 @@ copy_executable_and_dump_data_section (int a_out, int a_new) PERROR("failed to write bss header"); } } - +#endif /* write new data header */ printf("writing .data header\n"); @@ -353,7 +360,7 @@ copy_executable_and_dump_data_section (int a_out, int a_new) { PERROR("failed to write data header"); } - +#ifdef BROKEN_GDB /* Write small bss section. */ if (sections_reversed) { @@ -365,7 +372,7 @@ copy_executable_and_dump_data_section (int a_out, int a_new) PERROR("failed to write bss header"); } } - +#endif printf("writing following data header\n"); f_nextdata.s_scnptr += file_sz_change; if (f_nextdata.s_lnnoptr != 0) f_nextdata.s_lnnoptr += file_sz_change; @@ -392,7 +399,14 @@ copy_executable_and_dump_data_section (int a_out, int a_new) PERROR("failed to write data header"); } } - +#ifndef BROKEN_GDB + /* dump bss to maintain offsets */ + memset(&f_bss, 0, sizeof(f_bss)); + if (write(a_new, &f_bss, sizeof(f_bss)) != sizeof(f_bss)) + { + PERROR("failed to write bss header"); + } +#endif size=lseek(a_new, 0, SEEK_CUR); CHECK_AOUT_POS(size); diff --git a/src/unexelf.c b/src/unexelf.c index f1da87a..54c48e1 100644 --- a/src/unexelf.c +++ b/src/unexelf.c @@ -424,7 +424,7 @@ extern void fatal (const char *, ...); #include #include #include -#if !defined (__NetBSD__) && !defined (__OpenBSD__) +#ifdef HAVE_ELF_H #include #endif #include diff --git a/src/unexelfsgi.c b/src/unexelfsgi.c index ad54ccf..ee93167 100644 --- a/src/unexelfsgi.c +++ b/src/unexelfsgi.c @@ -1,38 +1,27 @@ /* Copyright (C) 1985, 1986, 1987, 1988, 1990, 1992, 1999, 2000 Free Software Foundation, Inc. -This file is part of XEmacs. + This file is part of XEmacs. -XEmacs is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. + XEmacs is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + GNU Emacs is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. -You should have received a copy of the GNU General Public License -along with GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. + You should have received a copy of the GNU General Public License + along with GNU Emacs; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. -In other words, you are welcome to use, share and improve this program. -You are forbidden to forbid anyone else to use, share and improve -what you give them. Help stamp out software-hoarding! */ + In other words, you are welcome to use, share and improve this + program. You are forbidden to forbid anyone else to use, share and + improve what you give them. Help stamp out software-hoarding! */ -/* 2000-10-31: Martin Buchholz - - I noticed that xemacs on Irix 6.5 could not write to stderr, e.g. - (external-debugging-output "\n") - would produce NO output. - temacs worked fine, so this was clearly a dumping problem. - - So I copied over the latest available unexelf.c from FSF Emacs, - and installed it as unexelfsgi.c in XEmacs. - In addition, I converted it to "Clean C", resulting in this file. -*/ /* * unexec.c - Convert a running program into an a.out file. @@ -44,375 +33,40 @@ what you give them. Help stamp out software-hoarding! */ * Modified heavily since then. * * Synopsis: - * unexec (new_name, old_name, data_start, bss_start, entry_address) - * char *new_name, *old_name; - * unsigned data_start, bss_start, entry_address; - * - * Takes a snapshot of the program and makes an a.out format file in the - * file named by the string argument new_name. - * If old_name is non-NULL, the symbol table will be taken from the given file. - * On some machines, an existing old_name file is required. - * - * The boundaries within the a.out file may be adjusted with the data_start - * and bss_start arguments. Either or both may be given as 0 for defaults. + * void + * unexec (char *new_name, + * char *old_name, + * uintptr_t data_start, + * uintptr_t bss_start, + * uintptr_t entry_address) * - * Data_start gives the boundary between the text segment and the data - * segment of the program. The text segment can contain shared, read-only - * program code and literal data, while the data segment is always unshared - * and unprotected. Data_start gives the lowest unprotected address. - * The value you specify may be rounded down to a suitable boundary - * as required by the machine you are using. + * The basic idea is that we start with an ELF file which contains + * .bss (uninitialized global data) section which is normally not in + * the file. As we load lisp the variables, which were first set to 0, + * will change their values. We want to save those changed values into + * another ELF file, which will become a new xemacs image. To do this, + * we need to change several structures in the ELF file. * - * Bss_start indicates how much of the data segment is to be saved in the - * a.out file and restored when the program is executed. It gives the lowest - * unsaved address, and is rounded up to a page boundary. The default when 0 - * is given assumes that the entire data segment is to be stored, including - * the previous data and bss as well as any additional storage allocated with - * break (2). + * First of all, we need to change the programm header which tells + * the linker how to load stuff into memory so that data will come + * from the file and not from the /dev/zero. To do this, we find the + * segment, which is marked as loadable (type PT_LOAD) and which + * covers the old .bss section. We will next change the filesz and + * memsz for that segment to extend over the new data section. * - * The new file is set up to start at entry_address. - * - */ - -/* Even more heavily modified by james@bigtex.cactus.org of Dell Computer Co. - * ELF support added. + * Next we have to make sure that section header for the stuff which + * used to be uninitialized is changed to be initialized and to come + * from the file. To do this, we change the size and the type of the old + * .bss section (and all other section of the type SHT_NOBITS) to cover the + * new section and to be of type SHT_PROCBITS. * - * Basic theory: the data space of the running process needs to be - * dumped to the output file. Normally we would just enlarge the size - * of .data, scooting everything down. But we can't do that in ELF, - * because there is often something between the .data space and the - * .bss space. + * We also insert a new SHT_NOBITS section to keep some tools, which expect + * .bss happy. * - * In the temacs dump below, notice that the Global Offset Table - * (.got) and the Dynamic link data (.dynamic) come between .data1 and - * .bss. It does not work to overlap .data with these fields. - * - * The solution is to create a new .data segment. This segment is - * filled with data from the current process. Since the contents of - * various sections refer to sections by index, the new .data segment - * is made the last in the table to avoid changing any existing index. - - * This is an example of how the section headers are changed. "Addr" - * is a process virtual address. "Offset" is a file offset. - -raid:/nfs/raid/src/dist-18.56/src> dump -h temacs - -temacs: - - **** SECTION HEADER TABLE **** -[No] Type Flags Addr Offset Size Name - Link Info Adralgn Entsize - -[1] 1 2 0x80480d4 0xd4 0x13 .interp - 0 0 0x1 0 - -[2] 5 2 0x80480e8 0xe8 0x388 .hash - 3 0 0x4 0x4 - -[3] 11 2 0x8048470 0x470 0x7f0 .dynsym - 4 1 0x4 0x10 - -[4] 3 2 0x8048c60 0xc60 0x3ad .dynstr - 0 0 0x1 0 - -[5] 9 2 0x8049010 0x1010 0x338 .rel.plt - 3 7 0x4 0x8 - -[6] 1 6 0x8049348 0x1348 0x3 .init - 0 0 0x4 0 - -[7] 1 6 0x804934c 0x134c 0x680 .plt - 0 0 0x4 0x4 - -[8] 1 6 0x80499cc 0x19cc 0x3c56f .text - 0 0 0x4 0 - -[9] 1 6 0x8085f3c 0x3df3c 0x3 .fini - 0 0 0x4 0 - -[10] 1 2 0x8085f40 0x3df40 0x69c .rodata - 0 0 0x4 0 - -[11] 1 2 0x80865dc 0x3e5dc 0xd51 .rodata1 - 0 0 0x4 0 - -[12] 1 3 0x8088330 0x3f330 0x20afc .data - 0 0 0x4 0 - -[13] 1 3 0x80a8e2c 0x5fe2c 0x89d .data1 - 0 0 0x4 0 - -[14] 1 3 0x80a96cc 0x606cc 0x1a8 .got - 0 0 0x4 0x4 - -[15] 6 3 0x80a9874 0x60874 0x80 .dynamic - 4 0 0x4 0x8 - -[16] 8 3 0x80a98f4 0x608f4 0x449c .bss - 0 0 0x4 0 - -[17] 2 0 0 0x608f4 0x9b90 .symtab - 18 371 0x4 0x10 - -[18] 3 0 0 0x6a484 0x8526 .strtab - 0 0 0x1 0 - -[19] 3 0 0 0x729aa 0x93 .shstrtab - 0 0 0x1 0 - -[20] 1 0 0 0x72a3d 0x68b7 .comment - 0 0 0x1 0 - -raid:/nfs/raid/src/dist-18.56/src> dump -h xemacs - -xemacs: - - **** SECTION HEADER TABLE **** -[No] Type Flags Addr Offset Size Name - Link Info Adralgn Entsize - -[1] 1 2 0x80480d4 0xd4 0x13 .interp - 0 0 0x1 0 - -[2] 5 2 0x80480e8 0xe8 0x388 .hash - 3 0 0x4 0x4 - -[3] 11 2 0x8048470 0x470 0x7f0 .dynsym - 4 1 0x4 0x10 - -[4] 3 2 0x8048c60 0xc60 0x3ad .dynstr - 0 0 0x1 0 - -[5] 9 2 0x8049010 0x1010 0x338 .rel.plt - 3 7 0x4 0x8 - -[6] 1 6 0x8049348 0x1348 0x3 .init - 0 0 0x4 0 - -[7] 1 6 0x804934c 0x134c 0x680 .plt - 0 0 0x4 0x4 - -[8] 1 6 0x80499cc 0x19cc 0x3c56f .text - 0 0 0x4 0 - -[9] 1 6 0x8085f3c 0x3df3c 0x3 .fini - 0 0 0x4 0 - -[10] 1 2 0x8085f40 0x3df40 0x69c .rodata - 0 0 0x4 0 - -[11] 1 2 0x80865dc 0x3e5dc 0xd51 .rodata1 - 0 0 0x4 0 - -[12] 1 3 0x8088330 0x3f330 0x20afc .data - 0 0 0x4 0 - -[13] 1 3 0x80a8e2c 0x5fe2c 0x89d .data1 - 0 0 0x4 0 - -[14] 1 3 0x80a96cc 0x606cc 0x1a8 .got - 0 0 0x4 0x4 - -[15] 6 3 0x80a9874 0x60874 0x80 .dynamic - 4 0 0x4 0x8 - -[16] 8 3 0x80c6800 0x7d800 0 .bss - 0 0 0x4 0 - -[17] 2 0 0 0x7d800 0x9b90 .symtab - 18 371 0x4 0x10 - -[18] 3 0 0 0x87390 0x8526 .strtab - 0 0 0x1 0 - -[19] 3 0 0 0x8f8b6 0x93 .shstrtab - 0 0 0x1 0 - -[20] 1 0 0 0x8f949 0x68b7 .comment - 0 0 0x1 0 - -[21] 1 3 0x80a98f4 0x608f4 0x1cf0c .data - 0 0 0x4 0 - - * This is an example of how the file header is changed. "Shoff" is - * the section header offset within the file. Since that table is - * after the new .data section, it is moved. "Shnum" is the number of - * sections, which we increment. - * - * "Phoff" is the file offset to the program header. "Phentsize" and - * "Shentsz" are the program and section header entries sizes respectively. - * These can be larger than the apparent struct sizes. - -raid:/nfs/raid/src/dist-18.56/src> dump -f temacs - -temacs: - - **** ELF HEADER **** -Class Data Type Machine Version -Entry Phoff Shoff Flags Ehsize -Phentsize Phnum Shentsz Shnum Shstrndx - -1 1 2 3 1 -0x80499cc 0x34 0x792f4 0 0x34 -0x20 5 0x28 21 19 - -raid:/nfs/raid/src/dist-18.56/src> dump -f xemacs - -xemacs: - - **** ELF HEADER **** -Class Data Type Machine Version -Entry Phoff Shoff Flags Ehsize -Phentsize Phnum Shentsz Shnum Shstrndx - -1 1 2 3 1 -0x80499cc 0x34 0x96200 0 0x34 -0x20 5 0x28 22 19 - - * These are the program headers. "Offset" is the file offset to the - * segment. "Vaddr" is the memory load address. "Filesz" is the - * segment size as it appears in the file, and "Memsz" is the size in - * memory. Below, the third segment is the code and the fourth is the - * data: the difference between Filesz and Memsz is .bss - -raid:/nfs/raid/src/dist-18.56/src> dump -o temacs - -temacs: - ***** PROGRAM EXECUTION HEADER ***** -Type Offset Vaddr Paddr -Filesz Memsz Flags Align - -6 0x34 0x8048034 0 -0xa0 0xa0 5 0 - -3 0xd4 0 0 -0x13 0 4 0 - -1 0x34 0x8048034 0 -0x3f2f9 0x3f2f9 5 0x1000 - -1 0x3f330 0x8088330 0 -0x215c4 0x25a60 7 0x1000 - -2 0x60874 0x80a9874 0 -0x80 0 7 0 - -raid:/nfs/raid/src/dist-18.56/src> dump -o xemacs - -xemacs: - ***** PROGRAM EXECUTION HEADER ***** -Type Offset Vaddr Paddr -Filesz Memsz Flags Align - -6 0x34 0x8048034 0 -0xa0 0xa0 5 0 - -3 0xd4 0 0 -0x13 0 4 0 - -1 0x34 0x8048034 0 -0x3f2f9 0x3f2f9 5 0x1000 - -1 0x3f330 0x8088330 0 -0x3e4d0 0x3e4d0 7 0x1000 - -2 0x60874 0x80a9874 0 -0x80 0 7 0 - - - */ - -/* Modified by wtien@urbana.mcd.mot.com of Motorola Inc. - * - * The above mechanism does not work if the unexeced ELF file is being - * re-layout by other applications (such as `strip'). All the applications - * that re-layout the internal of ELF will layout all sections in ascending - * order of their file offsets. After the re-layout, the data2 section will - * still be the LAST section in the section header vector, but its file offset - * is now being pushed far away down, and causes part of it not to be mapped - * in (ie. not covered by the load segment entry in PHDR vector), therefore - * causes the new binary to fail. - * - * The solution is to modify the unexec algorithm to insert the new data2 - * section header right before the new bss section header, so their file - * offsets will be in the ascending order. Since some of the section's (all - * sections AFTER the bss section) indexes are now changed, we also need to - * modify some fields to make them point to the right sections. This is done - * by macro PATCH_INDEX. All the fields that need to be patched are: - * - * 1. ELF header e_shstrndx field. - * 2. section header sh_link and sh_info field. - * 3. symbol table entry st_shndx field. - * - * The above example now should look like: - - **** SECTION HEADER TABLE **** -[No] Type Flags Addr Offset Size Name - Link Info Adralgn Entsize - -[1] 1 2 0x80480d4 0xd4 0x13 .interp - 0 0 0x1 0 - -[2] 5 2 0x80480e8 0xe8 0x388 .hash - 3 0 0x4 0x4 - -[3] 11 2 0x8048470 0x470 0x7f0 .dynsym - 4 1 0x4 0x10 - -[4] 3 2 0x8048c60 0xc60 0x3ad .dynstr - 0 0 0x1 0 - -[5] 9 2 0x8049010 0x1010 0x338 .rel.plt - 3 7 0x4 0x8 - -[6] 1 6 0x8049348 0x1348 0x3 .init - 0 0 0x4 0 - -[7] 1 6 0x804934c 0x134c 0x680 .plt - 0 0 0x4 0x4 - -[8] 1 6 0x80499cc 0x19cc 0x3c56f .text - 0 0 0x4 0 - -[9] 1 6 0x8085f3c 0x3df3c 0x3 .fini - 0 0 0x4 0 - -[10] 1 2 0x8085f40 0x3df40 0x69c .rodata - 0 0 0x4 0 - -[11] 1 2 0x80865dc 0x3e5dc 0xd51 .rodata1 - 0 0 0x4 0 - -[12] 1 3 0x8088330 0x3f330 0x20afc .data - 0 0 0x4 0 - -[13] 1 3 0x80a8e2c 0x5fe2c 0x89d .data1 - 0 0 0x4 0 - -[14] 1 3 0x80a96cc 0x606cc 0x1a8 .got - 0 0 0x4 0x4 - -[15] 6 3 0x80a9874 0x60874 0x80 .dynamic - 4 0 0x4 0x8 - -[16] 1 3 0x80a98f4 0x608f4 0x1cf0c .data - 0 0 0x4 0 - -[17] 8 3 0x80c6800 0x7d800 0 .bss - 0 0 0x4 0 - -[18] 2 0 0 0x7d800 0x9b90 .symtab - 19 371 0x4 0x10 - -[19] 3 0 0 0x87390 0x8526 .strtab - 0 0 0x1 0 - -[20] 3 0 0 0x8f8b6 0x93 .shstrtab - 0 0 0x1 0 - -[21] 1 0 0 0x8f949 0x68b7 .comment - 0 0 0x1 0 - + * Finally we need to patch up some references to the section + * indexes since we change the order and undo the relocation info to + * be the same as it was "before" because we actually used the data + * from the memory which were changed by the run-time linker. */ #ifndef emacs @@ -430,7 +84,7 @@ extern void fatal (const char *, ...); #include #include #include -#if !defined (__NetBSD__) && !defined (__OpenBSD__) +#ifdef HAVE_ELF_H #include #endif #include @@ -442,85 +96,6 @@ extern void fatal (const char *, ...); #include /* for HDRR declaration */ #endif /* __sgi */ -#if defined (__alpha__) && !defined (__NetBSD__) && !defined (__OpenBSD__) -/* Declare COFF debugging symbol table. This used to be in - /usr/include/sym.h, but this file is no longer included in Red Hat - 5.0 and presumably in any other glibc 2.x based distribution. */ -typedef struct { - short magic; - short vstamp; - int ilineMax; - int idnMax; - int ipdMax; - int isymMax; - int ioptMax; - int iauxMax; - int issMax; - int issExtMax; - int ifdMax; - int crfd; - int iextMax; - long cbLine; - long cbLineOffset; - long cbDnOffset; - long cbPdOffset; - long cbSymOffset; - long cbOptOffset; - long cbAuxOffset; - long cbSsOffset; - long cbSsExtOffset; - long cbFdOffset; - long cbRfdOffset; - long cbExtOffset; -} HDRR, *pHDRR; -#define cbHDRR sizeof(HDRR) -#define hdrNil ((pHDRR)0) -#endif - -#ifdef __NetBSD__ -/* - * NetBSD does not have normal-looking user-land ELF support. - */ -# if defined __alpha__ || defined __sparc_v9__ -# define ELFSIZE 64 -# else -# define ELFSIZE 32 -# endif -# include - -# ifndef PT_LOAD -# define PT_LOAD Elf_pt_load -# if 0 /* was in pkgsrc patches for 20.7 */ -# define SHT_PROGBITS Elf_sht_progbits -# endif -# define SHT_SYMTAB Elf_sht_symtab -# define SHT_DYNSYM Elf_sht_dynsym -# define SHT_NULL Elf_sht_null -# define SHT_NOBITS Elf_sht_nobits -# define SHT_REL Elf_sht_rel -# define SHT_RELA Elf_sht_rela - -# define SHN_UNDEF Elf_eshn_undefined -# define SHN_ABS Elf_eshn_absolute -# define SHN_COMMON Elf_eshn_common -# endif /* !PT_LOAD */ - -# ifdef __alpha__ -# include -# define HDRR struct ecoff_symhdr -# define pHDRR HDRR * -# endif /* __alpha__ */ - -#ifdef __mips__ /* was in pkgsrc patches for 20.7 */ -# define SHT_MIPS_DEBUG DT_MIPS_FLAGS -# define HDRR struct Elf_Shdr -#endif /* __mips__ */ -#endif /* __NetBSD__ */ - -#ifdef __OpenBSD__ -# include -#endif - #if __GNU_LIBRARY__ - 0 >= 6 # include /* get ElfW etc */ #endif @@ -546,31 +121,7 @@ typedef struct { #endif /* Get the address of a particular section or program header entry, - * accounting for the size of the entries. - */ -/* - On PPC Reference Platform running Solaris 2.5.1 - the plt section is also of type NOBI like the bss section. - (not really stored) and therefore sections after the bss - section start at the plt offset. The plt section is always - the one just before the bss section. - Thus, we modify the test from - if (NEW_SECTION_H (nn).sh_offset >= new_data2_offset) - to - if (NEW_SECTION_H (nn).sh_offset >= - OLD_SECTION_H (old_bss_index-1).sh_offset) - This is just a hack. We should put the new data section - before the .plt section. - And we should not have this routine at all but use - the libelf library to read the old file and create the new - file. - The changed code is minimal and depends on prep set in m/prep.h - Erik Deumens - Quantum Theory Project - University of Florida - deumens@qtp.ufl.edu - Apr 23, 1996 - */ + * accounting for the size of the entries. */ #define OLD_SECTION_H(n) \ (*(ElfW(Shdr) *) ((byte *) old_section_h + old_file_h->e_shentsize * (n))) @@ -583,8 +134,9 @@ typedef struct { #define PATCH_INDEX(n) \ do { \ - if ((int) (n) >= old_bss_index) \ + if ((int) (n) >= growme_index) \ (n)++; } while (0) + typedef unsigned char byte; /* Round X up to a multiple of Y. */ @@ -607,7 +159,7 @@ round_up (ElfW(Addr) x, ElfW(Addr) y) static int find_section (char *name, - char *section_names, + const char *section_names, char *file_name, ElfW(Ehdr) *old_file_h, ElfW(Shdr) *old_section_h, @@ -623,17 +175,14 @@ find_section (char *name, #endif if (!strcmp (section_names + OLD_SECTION_H (idx).sh_name, name)) - break; - } - if (idx == old_file_h->e_shnum) - { - if (noerror) - return -1; - else - fatal ("Can't find %s in %s.\n", name, file_name); + return idx; } - return idx; + /* If we're here, we found nothing or return did not work */ + if ( ! noerror) + fatal ("Can't find %s in %s.\n", name, file_name); + + return -1; } /* **************************************************************** @@ -652,158 +201,97 @@ unexec (char *new_name, uintptr_t bss_start, uintptr_t entry_address) { - int new_file, old_file, new_file_size; + int old_file; - /* Pointers to the base of the image of the two files. */ + struct stat stat_buf; caddr_t old_base, new_base; - /* Pointers to the file, program and section headers for the old and new - * files. - */ - ElfW(Ehdr) *old_file_h, *new_file_h; - ElfW(Phdr) *old_program_h, *new_program_h; - ElfW(Shdr) *old_section_h, *new_section_h; - - /* Point to the section name table in the old file */ - char *old_section_names; - - ElfW(Addr) old_bss_addr, new_bss_addr; - ElfW(Word) old_bss_size, new_data2_size; - ElfW(Off) new_data2_offset; - ElfW(Addr) new_data2_addr; + ElfW(Ehdr) *old_file_h, * new_file_h; + ElfW(Phdr) *old_program_h, * new_program_h; + ElfW(Shdr) *old_section_h, * new_section_h; + ElfW(Shdr) * growme = NULL, * grown = NULL; + ElfW(Addr) old_bss_addr = 0, new_data2_addr = 0; + int growme_index = -1; int n, nn; - int old_bss_index, old_sbss_index; - int old_data_index, new_data2_index; - int old_mdebug_index; - struct stat stat_buf; - - /* Open the old file & map it into the address space. */ + const char *old_section_names; + int old_mdebug_index, old_data_index; + int new_bss_addr, new_data2_size, new_data2_offset, new_file, new_file_size; - old_file = open (old_name, O_RDONLY); - - if (old_file < 0) - fatal ("Can't open %s for reading: errno %d\n", old_name, errno); + /* Open the old file */ + if ( (old_file = open (old_name, O_RDONLY)) < 0 ) + fatal ("Can't open %s for reading: errno %d\n", old_name, errno); if (fstat (old_file, &stat_buf) == -1) - fatal ("Can't fstat (%s): errno %d\n", old_name, errno); - - old_base = (caddr_t) mmap ((caddr_t) 0, stat_buf.st_size, - PROT_READ, MAP_SHARED, old_file, 0); + fatal ("Can't fstat (%s): errno %d\n", old_name, errno); - if (old_base == (caddr_t) -1) - fatal ("Can't mmap (%s): errno %d\n", old_name, errno); - -#ifdef DEBUG - fprintf (stderr, "mmap (%s, %x) -> %x\n", old_name, stat_buf.st_size, - old_base); -#endif + /* map old file into the address space. */ + if ( (old_base = (caddr_t) mmap ((caddr_t) 0, stat_buf.st_size, + PROT_READ, MAP_SHARED, old_file, 0)) < 0 ) + fatal ("Can't mmap (%s): errno %d\n", old_name, errno); - /* Get pointers to headers & section names */ - - old_file_h = (ElfW(Ehdr) *) old_base; + old_file_h = (ElfW(Ehdr) *) old_base; old_program_h = (ElfW(Phdr) *) ((byte *) old_base + old_file_h->e_phoff); old_section_h = (ElfW(Shdr) *) ((byte *) old_base + old_file_h->e_shoff); - old_section_names = (char *) old_base - + OLD_SECTION_H (old_file_h->e_shstrndx).sh_offset; - - /* Find the mdebug section, if any. */ - - old_mdebug_index = find_section (".mdebug", old_section_names, - old_name, old_file_h, old_section_h, 1); - - /* Find the old .bss section. Figure out parameters of the new - * data2 and bss sections. - */ - - old_bss_index = find_section (".bss", old_section_names, - old_name, old_file_h, old_section_h, 0); - - old_sbss_index = find_section (".sbss", old_section_names, - old_name, old_file_h, old_section_h, 1); - if (old_sbss_index != -1) - if (OLD_SECTION_H (old_sbss_index).sh_type == SHT_PROGBITS) - old_sbss_index = -1; - - if (old_sbss_index == -1) - { - old_bss_addr = OLD_SECTION_H (old_bss_index).sh_addr; - old_bss_size = OLD_SECTION_H (old_bss_index).sh_size; - new_data2_index = old_bss_index; - } - else - { - old_bss_addr = OLD_SECTION_H (old_sbss_index).sh_addr; - old_bss_size = OLD_SECTION_H (old_bss_index).sh_size - + OLD_SECTION_H (old_sbss_index).sh_size; - new_data2_index = old_sbss_index; - } + old_section_names = (const char *) old_base + + OLD_SECTION_H (old_file_h->e_shstrndx).sh_offset; + + /* Find a section which we will grow by looking for the SHT_NOBITS + * section with ALLOCATE flag and with the biggest address. */ + for (n = 1; n < old_file_h->e_shnum; n++) { + ElfW(Shdr) * sh = & OLD_SECTION_H(n); + + if ((sh->sh_type == SHT_NOBITS) && (sh->sh_flags & SHF_ALLOC)) { + if ( old_bss_addr < sh->sh_addr ) { + growme = sh; + growme_index = n; + new_data2_addr = old_bss_addr = sh->sh_addr; + } + } + } - /* Find the old .data section. Figure out parameters of - the new data2 and bss sections. */ + if (growme == NULL ) + fatal ("Can't find a section to grow\n", 0, 0); old_data_index = find_section (".data", old_section_names, old_name, old_file_h, old_section_h, 0); -#if defined (emacs) || !defined (DEBUG) new_bss_addr = (ElfW(Addr)) sbrk (0); -#else - new_bss_addr = old_bss_addr + old_bss_size + 0x1234; -#endif - new_data2_addr = old_bss_addr; new_data2_size = new_bss_addr - old_bss_addr; new_data2_offset = OLD_SECTION_H (old_data_index).sh_offset + - (new_data2_addr - OLD_SECTION_H (old_data_index).sh_addr); - -#ifdef DEBUG - fprintf (stderr, "old_bss_index %d\n", old_bss_index); - fprintf (stderr, "old_bss_addr %x\n", old_bss_addr); - fprintf (stderr, "old_bss_size %x\n", old_bss_size); - fprintf (stderr, "new_bss_addr %x\n", new_bss_addr); - fprintf (stderr, "new_data2_addr %x\n", new_data2_addr); - fprintf (stderr, "new_data2_size %x\n", new_data2_size); - fprintf (stderr, "new_data2_offset %x\n", new_data2_offset); -#endif - - if ((unsigned) new_bss_addr < (unsigned) old_bss_addr + old_bss_size) - fatal (".bss shrank when undumping???\n", 0, 0); + (new_data2_addr - OLD_SECTION_H (old_data_index).sh_addr); - /* Set the output file to the right size and mmap it. Set - * pointers to various interesting objects. stat_buf still has - * old_file data. - */ + if ( new_bss_addr < old_bss_addr + growme->sh_size ) + fatal (".bss shrank when undumping???\n", 0, 0); - new_file = open (new_name, O_RDWR | O_CREAT, 0666); - if (new_file < 0) - fatal ("Can't creat (%s): errno %d\n", new_name, errno); + /* Set the output file to the right size and mmap it. */ + if ( (new_file = open (new_name, O_RDWR | O_CREAT, 0666)) < 0 ) + fatal ("Can't create (%s): errno %d\n", new_name, errno); - new_file_size = stat_buf.st_size + old_file_h->e_shentsize + new_data2_size; + new_file_size = stat_buf.st_size + old_file_h->e_shentsize + new_data2_size; if (ftruncate (new_file, new_file_size)) - fatal ("Can't ftruncate (%s): errno %d\n", new_name, errno); + fatal ("Can't ftruncate (%s): errno %d\n", new_name, errno); -#ifdef UNEXEC_USE_MAP_PRIVATE new_base = (caddr_t) mmap ((caddr_t) 0, new_file_size, PROT_READ | PROT_WRITE, - MAP_PRIVATE, new_file, 0); +#ifdef UNEXEC_USE_MAP_PRIVATE + MAP_PRIVATE, #else - new_base = (caddr_t) mmap ((caddr_t) 0, new_file_size, - PROT_READ | PROT_WRITE, - MAP_SHARED, new_file, 0); + MAP_SHARED, #endif + new_file, 0); if (new_base == (caddr_t) -1) - fatal ("Can't mmap (%s): errno %d\n", new_name, errno); + fatal ("Can't mmap (%s): errno %d\n", new_name, errno); new_file_h = (ElfW(Ehdr) *) new_base; new_program_h = (ElfW(Phdr) *) ((byte *) new_base + old_file_h->e_phoff); - new_section_h = (ElfW(Shdr) *) - ((byte *) new_base + old_file_h->e_shoff + new_data2_size); + new_section_h = (ElfW(Shdr) *) ((byte *) new_base + old_file_h->e_shoff + + new_data2_size); /* Make our new file, program and section headers as copies of the - * originals. - */ - + * originals. */ memcpy (new_file_h, old_file_h, old_file_h->e_ehsize); memcpy (new_program_h, old_program_h, old_file_h->e_phnum * old_file_h->e_phentsize); @@ -812,245 +300,148 @@ unexec (char *new_name, PATCH_INDEX (new_file_h->e_shstrndx); /* Fix up file header. We'll add one section. Section header is - * further away now. - */ - + * further away now. */ new_file_h->e_shoff += new_data2_size; new_file_h->e_shnum += 1; + /* Fix up a new program header by extending the writable data + * segment so that the bss area is covered too. Find that segment by + * looking for one that starts before and ends after the .bss and is + * PT_LOADable. */ + for (n = new_file_h->e_phnum - 1; n >= 0; n--) { + ElfW(Phdr) * ph = & NEW_PROGRAM_H(n); #ifdef DEBUG - fprintf (stderr, "Old section offset %x\n", old_file_h->e_shoff); - fprintf (stderr, "Old section count %d\n", old_file_h->e_shnum); - fprintf (stderr, "New section offset %x\n", new_file_h->e_shoff); - fprintf (stderr, "New section count %d\n", new_file_h->e_shnum); + printf ("%d @ %0x + %0x against %0x + %0x", + n, ph->p_vaddr, ph->p_memsz,growme->sh_addr, growme->sh_size); #endif + if ((ph->p_type == PT_LOAD) && + (ph->p_vaddr <= growme->sh_addr) && + ((ph->p_vaddr+ph->p_memsz) >= (growme->sh_addr + growme->sh_size))) { + /* Make sure that the size includes any padding before the + * old .bss section. */ + ph->p_memsz = ph->p_filesz = new_bss_addr - ph->p_vaddr; +#ifdef DEBUG + puts (" That's the one!"); +#endif + break; + } +#ifdef DEBUG + putchar ('\n'); +#endif + } - /* Fix up a new program header. Extend the writable data segment so - * that the bss area is covered too. Find that segment by looking - * for a segment that ends just before the .bss area. Make sure - * that no segments are above the new .data2. Put a loop at the end - * to adjust the offset and address of any segment that is above - * data2, just in case we decide to allow this later. - */ - - for (n = new_file_h->e_phnum - 1; n >= 0; n--) - { - /* Compute maximum of all requirements for alignment of section. */ - ElfW(Word) alignment = (NEW_PROGRAM_H (n)).p_align; - if ((OLD_SECTION_H (old_bss_index)).sh_addralign > alignment) - alignment = OLD_SECTION_H (old_bss_index).sh_addralign; - -#ifdef __sgi - /* According to r02kar@x4u2.desy.de (Karsten Kuenne) - and oliva@gnu.org (Alexandre Oliva), on IRIX 5.2, we - always get "Program segment above .bss" when dumping - when the executable doesn't have an sbss section. */ - if (old_sbss_index != -1) -#endif /* __sgi */ - if (NEW_PROGRAM_H (n).p_vaddr + NEW_PROGRAM_H (n).p_filesz - > (old_sbss_index == -1 - ? old_bss_addr - : round_up (old_bss_addr, alignment))) - fatal ("Program segment above .bss in %s\n", old_name, 0); - - if (NEW_PROGRAM_H (n).p_type == PT_LOAD - && (round_up ((NEW_PROGRAM_H (n)).p_vaddr - + (NEW_PROGRAM_H (n)).p_filesz, - alignment) - == round_up (old_bss_addr, alignment))) - break; - } if (n < 0) - fatal ("Couldn't find segment next to .bss in %s\n", old_name, 0); + fatal ("Couldn't find segment which covers %s", + old_section_names + growme->sh_name); + + /* Walk through all section headers, insert the new data2 section + * right before the new bss section. */ + for (n = 1, nn = 1; n < (int) old_file_h->e_shnum; n++, nn++) { + ElfW(Shdr) * nsec = & NEW_SECTION_H(nn); + ElfW(Shdr) * osec = & OLD_SECTION_H(n); + + /* If this is the section we want to grow, insert the new data + * section before it. */ + if ( osec == growme ) { + /* Steal the data section header for this data2 section but + * use the * 'grow' section's alignment. This * will assure + * that the new section * always be placed in the same spot + * * as the old section by any other * application. */ + ElfW(Shdr) * od = &OLD_SECTION_H(old_data_index); + + memcpy (nsec, od, new_file_h->e_shentsize); + + nsec->sh_addr = new_data2_addr; + nsec->sh_offset = new_data2_offset; + nsec->sh_size = new_data2_size; + nsec->sh_addralign = osec->sh_addralign; + + /* Copy over what we have in memory now. */ + memcpy (nsec->sh_offset + new_base, (caddr_t) osec->sh_addr, + new_data2_size); + nn++; + grown = nsec++; + } - /* Make sure that the size includes any padding before the old .bss - section. */ - NEW_PROGRAM_H (n).p_filesz = new_bss_addr - NEW_PROGRAM_H (n).p_vaddr; - NEW_PROGRAM_H (n).p_memsz = NEW_PROGRAM_H (n).p_filesz; + memcpy (nsec, osec, old_file_h->e_shentsize); + + if ( osec == growme ) { + /* The new bss section's size is zero, and its file offset + * and virtual address should be off by NEW_DATA2_SIZE. */ + nsec->sh_offset = grown->sh_offset + new_data2_size; + nsec->sh_addr = grown->sh_addr + new_data2_size; + + /* Let the new bss section address alignment be the same as + * the section address alignment followed the old bss + * section, so this section will be placed in exactly the + * same place. */ + nsec->sh_addralign = osec->sh_addralign; + nsec->sh_size = 0; + } else { + /* Any section that was originally placed AFTER the bss + * section should now be off by NEW_DATA2_SIZE. */ + if ( round_up (nsec->sh_offset, growme->sh_addralign) >= + new_data2_offset) + nsec->sh_offset += new_data2_size; + } -#if 0 /* Maybe allow section after data2 - does this ever happen? */ - for (n = new_file_h->e_phnum - 1; n >= 0; n--) - { - if (NEW_PROGRAM_H (n).p_vaddr - && NEW_PROGRAM_H (n).p_vaddr >= new_data2_addr) - NEW_PROGRAM_H (n).p_vaddr += new_data2_size - old_bss_size; + /* Any section that was originally placed after the section * + * header table should now be off by the size of one section + * header table entry. */ + if (nsec->sh_offset > new_file_h->e_shoff) + nsec->sh_offset += new_file_h->e_shentsize; - if (NEW_PROGRAM_H (n).p_offset >= new_data2_offset) - NEW_PROGRAM_H (n).p_offset += new_data2_size; - } -#endif - - /* Fix up section headers based on new .data2 section. Any section - * whose offset or virtual address is after the new .data2 section - * gets its value adjusted. .bss size becomes zero and new address - * is set. data2 section header gets added by copying the existing - * .data header and modifying the offset, address and size. - */ - for (old_data_index = 1; old_data_index < (int) old_file_h->e_shnum; - old_data_index++) - if (!strcmp (old_section_names + OLD_SECTION_H (old_data_index).sh_name, - ".data")) - break; - if (old_data_index == old_file_h->e_shnum) - fatal ("Can't find .data in %s.\n", old_name, 0); - - /* Walk through all section headers, insert the new data2 section right - before the new bss section. */ - for (n = 1, nn = 1; n < (int) old_file_h->e_shnum; n++, nn++) - { - caddr_t src; - /* If it is (s)bss section, insert the new data2 section before it. */ - /* new_data2_index is the index of either old_sbss or old_bss, that was - chosen as a section for new_data2. */ - if (n == new_data2_index) - { - /* Steal the data section header for this data2 section. */ - memcpy (&NEW_SECTION_H (nn), &OLD_SECTION_H (old_data_index), - new_file_h->e_shentsize); - - NEW_SECTION_H (nn).sh_addr = new_data2_addr; - NEW_SECTION_H (nn).sh_offset = new_data2_offset; - NEW_SECTION_H (nn).sh_size = new_data2_size; - /* Use the bss section's alignment. This will assure that the - new data2 section always be placed in the same spot as the old - bss section by any other application. */ - NEW_SECTION_H (nn).sh_addralign = OLD_SECTION_H (n).sh_addralign; - - /* Now copy over what we have in the memory now. */ - memcpy (NEW_SECTION_H (nn).sh_offset + new_base, - (caddr_t) OLD_SECTION_H (n).sh_addr, - new_data2_size); - nn++; - } - - memcpy (&NEW_SECTION_H (nn), &OLD_SECTION_H (n), - old_file_h->e_shentsize); - - if (n == old_bss_index - /* The new bss and sbss section's size is zero, and its file offset - and virtual address should be off by NEW_DATA2_SIZE. */ - || n == old_sbss_index - ) - { - /* NN should be `old_s?bss_index + 1' at this point. */ - NEW_SECTION_H (nn).sh_offset = - NEW_SECTION_H (new_data2_index).sh_offset + new_data2_size; - NEW_SECTION_H (nn).sh_addr = - NEW_SECTION_H (new_data2_index).sh_addr + new_data2_size; - /* Let the new bss section address alignment be the same as the - section address alignment followed the old bss section, so - this section will be placed in exactly the same place. */ - NEW_SECTION_H (nn).sh_addralign = OLD_SECTION_H (nn).sh_addralign; - NEW_SECTION_H (nn).sh_size = 0; - } - else - { - /* Any section that was original placed AFTER the bss - section should now be off by NEW_DATA2_SIZE. */ -#ifdef SOLARIS_POWERPC - /* On PPC Reference Platform running Solaris 2.5.1 - the plt section is also of type NOBI like the bss section. - (not really stored) and therefore sections after the bss - section start at the plt offset. The plt section is always - the one just before the bss section. - It would be better to put the new data section before - the .plt section, or use libelf instead. - Erik Deumens, deumens@qtp.ufl.edu. */ - if (NEW_SECTION_H (nn).sh_offset - >= OLD_SECTION_H (old_bss_index-1).sh_offset) - NEW_SECTION_H (nn).sh_offset += new_data2_size; -#else - if (round_up (NEW_SECTION_H (nn).sh_offset, - OLD_SECTION_H (old_bss_index).sh_addralign) - >= new_data2_offset) - NEW_SECTION_H (nn).sh_offset += new_data2_size; -#endif - /* Any section that was originally placed after the section - header table should now be off by the size of one section - header table entry. */ - if (NEW_SECTION_H (nn).sh_offset > new_file_h->e_shoff) - NEW_SECTION_H (nn).sh_offset += new_file_h->e_shentsize; - } /* If any section hdr refers to the section after the new .data - section, make it refer to next one because we have inserted - a new section in between. */ - - PATCH_INDEX (NEW_SECTION_H (nn).sh_link); - /* For symbol tables, info is a symbol table index, - so don't change it. */ - if (NEW_SECTION_H (nn).sh_type != SHT_SYMTAB - && NEW_SECTION_H (nn).sh_type != SHT_DYNSYM) - PATCH_INDEX (NEW_SECTION_H (nn).sh_info); - - if (old_sbss_index != -1) - if (!strcmp (old_section_names + NEW_SECTION_H (nn).sh_name, ".sbss")) - { - NEW_SECTION_H (nn).sh_offset = - round_up (NEW_SECTION_H (nn).sh_offset, - NEW_SECTION_H (nn).sh_addralign); - NEW_SECTION_H (nn).sh_type = SHT_PROGBITS; + * section, make it refer to next one because we have inserted a + * new section in between. */ + PATCH_INDEX (nsec->sh_link); + + /* For symbol tables, info is a symbol table index, so don't + * change it. */ + if (nsec->sh_type != SHT_SYMTAB && nsec->sh_type != SHT_DYNSYM) + PATCH_INDEX (nsec->sh_info); + + /* Any section which used to be NOBITS will now becomes PROGBITS + * if it's ALLOC-atable, unless, of cause, it's not the one we + * decided to grow */ + if ( (osec->sh_type == SHT_NOBITS) && (osec->sh_flags & SHF_ALLOC) && + (osec != growme ) ) { + nsec->sh_type = SHT_PROGBITS; + } + + /* Now, start to copy the content of sections */ + if ( nsec->sh_type != SHT_NULL || nsec->sh_type != SHT_NOBITS ) { + + /* Write out the sections. .data and .data1 (and data2, + * called ".data" in the strings table) get copied from the + * current process instead of the old file. */ + caddr_t src = old_base + osec->sh_offset; + const char * secname = old_section_names + nsec->sh_name; + const char * names[] = { + ".data",".sdata", ".lit4", ".lit8", ".sdata1", ".data1", + ".sbss", NULL}; + int i; + + for ( i=0; names[i] != NULL; i++ ) { + if ( ! strcmp (secname, names[i]) ) { + src = (caddr_t) osec->sh_addr; + break; + } } - /* Now, start to copy the content of sections. */ - if (NEW_SECTION_H (nn).sh_type == SHT_NULL - || NEW_SECTION_H (nn).sh_type == SHT_NOBITS) - continue; - - /* Write out the sections. .data and .data1 (and data2, called - ".data" in the strings table) get copied from the current process - instead of the old file. */ - if (!strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data") - || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), - ".sdata") - || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), - ".lit4") - || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), - ".lit8") - || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), - ".sdata1") - || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), - ".data1") - || !strcmp (old_section_names + NEW_SECTION_H (nn).sh_name, - ".sbss")) - src = (caddr_t) OLD_SECTION_H (n).sh_addr; - else - src = old_base + OLD_SECTION_H (n).sh_offset; - - memcpy (NEW_SECTION_H (nn).sh_offset + new_base, src, - NEW_SECTION_H (nn).sh_size); + memcpy (nsec->sh_offset + new_base, src, nsec->sh_size); + } -#ifdef __alpha__ - /* Update Alpha COFF symbol table: */ - if (strcmp (old_section_names + OLD_SECTION_H (n).sh_name, ".mdebug") - == 0) - { - pHDRR symhdr = (pHDRR) (NEW_SECTION_H (nn).sh_offset + new_base); - - symhdr->cbLineOffset += new_data2_size; - symhdr->cbDnOffset += new_data2_size; - symhdr->cbPdOffset += new_data2_size; - symhdr->cbSymOffset += new_data2_size; - symhdr->cbOptOffset += new_data2_size; - symhdr->cbAuxOffset += new_data2_size; - symhdr->cbSsOffset += new_data2_size; - symhdr->cbSsExtOffset += new_data2_size; - symhdr->cbFdOffset += new_data2_size; - symhdr->cbRfdOffset += new_data2_size; - symhdr->cbExtOffset += new_data2_size; - } -#endif /* __alpha__ */ + old_mdebug_index = find_section (".mdebug", old_section_names, + old_name, old_file_h, old_section_h, 1); #if defined (__sony_news) && defined (_SYSTYPE_SYSV) - if (NEW_SECTION_H (nn).sh_type == SHT_MIPS_DEBUG - && old_mdebug_index != -1) - { - int diff = NEW_SECTION_H(nn).sh_offset - - OLD_SECTION_H(old_mdebug_index).sh_offset; - HDRR *phdr = (HDRR *)(NEW_SECTION_H (nn).sh_offset + new_base); - - if (diff) - { + if (nsec->sh_type == SHT_MIPS_DEBUG && old_mdebug_index != -1) { + int diff = nsec->sh_offset-OLD_SECTION_H(old_mdebug_index).sh_offset; + HDRR *phdr = (HDRR *)(nsec->sh_offset + new_base); + + if (diff) { phdr->cbLineOffset += diff; phdr->cbDnOffset += diff; phdr->cbPdOffset += diff; @@ -1062,29 +453,29 @@ unexec (char *new_name, phdr->cbFdOffset += diff; phdr->cbRfdOffset += diff; phdr->cbExtOffset += diff; - } - } + } + } #endif /* __sony_news && _SYSTYPE_SYSV */ #if __sgi - /* Adjust the HDRR offsets in .mdebug and copy the - line data if it's in its usual 'hole' in the object. - Makes the new file debuggable with dbx. - patches up two problems: the absolute file offsets - in the HDRR record of .mdebug (see /usr/include/syms.h), and - the ld bug that gets the line table in a hole in the - elf file rather than in the .mdebug section proper. - David Anderson. davea@sgi.com Jan 16,1994. */ - if (n == old_mdebug_index) - { + /* Adjust the HDRR offsets in .mdebug and copy the line data if + * it's in its usual 'hole' in the object. Makes the new file + * debuggable with dbx. patches up two problems: the absolute + * file offsets in the HDRR record of .mdebug (see + * /usr/include/syms.h), and the ld bug that gets the line table + * in a hole in the elf file rather than in the .mdebug section + * proper. + * + * David Anderson. davea@sgi.com Jan 16,1994 */ #define MDEBUGADJUST(__ct,__fileaddr) \ if (n_phdrr->__ct > 0) \ { \ n_phdrr->__fileaddr += movement; \ } - HDRR * o_phdrr = (HDRR *)((byte *)old_base + OLD_SECTION_H (n).sh_offset); - HDRR * n_phdrr = (HDRR *)((byte *)new_base + NEW_SECTION_H (nn).sh_offset); + if (n == old_mdebug_index) { + HDRR * o_phdrr = (HDRR *)((byte *)old_base + osec->sh_offset); + HDRR * n_phdrr = (HDRR *)((byte *)new_base + nsec->sh_offset); unsigned movement = new_data2_size; MDEBUGADJUST (idnMax, cbDnOffset); @@ -1097,142 +488,112 @@ unexec (char *new_name, MDEBUGADJUST (ifdMax, cbFdOffset); MDEBUGADJUST (crfd, cbRfdOffset); MDEBUGADJUST (iextMax, cbExtOffset); - /* The Line Section, being possible off in a hole of the object, - requires special handling. */ - if (n_phdrr->cbLine > 0) - { - if (o_phdrr->cbLineOffset > (OLD_SECTION_H (n).sh_offset - + OLD_SECTION_H (n).sh_size)) - { - /* line data is in a hole in elf. do special copy and adjust - for this ld mistake. - */ + + /* The Line Section, being possible off in a hole of the + * object, requires special handling. */ + if (n_phdrr->cbLine > 0) { + if (o_phdrr->cbLineOffset > + osec->sh_offset+ osec->sh_size){ + /* line data is in a hole in elf. do special copy + * and adjust for this ld mistake. */ n_phdrr->cbLineOffset += movement; memcpy (n_phdrr->cbLineOffset + new_base, o_phdrr->cbLineOffset + old_base, n_phdrr->cbLine); - } - else - { - /* somehow line data is in .mdebug as it is supposed to be. */ + } else { + /* somehow line data is in .mdebug as it is supposed + * to be. */ MDEBUGADJUST (cbLine, cbLineOffset); - } - } - } + } + } + } #endif /* __sgi */ - - /* If it is the symbol table, its st_shndx field needs to be patched. */ - if (NEW_SECTION_H (nn).sh_type == SHT_SYMTAB - || NEW_SECTION_H (nn).sh_type == SHT_DYNSYM) - { - ElfW(Shdr) *spt = &NEW_SECTION_H (nn); - unsigned int num = spt->sh_size / spt->sh_entsize; - ElfW(Sym) * sym = (ElfW(Sym) *) (NEW_SECTION_H (nn).sh_offset + - new_base); - for (; num--; sym++) - { - if ((sym->st_shndx == SHN_UNDEF) - || (sym->st_shndx == SHN_ABS) - || (sym->st_shndx == SHN_COMMON)) - continue; + /* If it is the symbol table, its st_shndx field needs to be + * patched. */ + if (nsec->sh_type == SHT_SYMTAB || nsec->sh_type == SHT_DYNSYM) { + unsigned int num = nsec->sh_size / nsec->sh_entsize; + ElfW(Sym) * sym = (ElfW(Sym) *)(nsec->sh_offset + new_base); + byte *symnames = ((byte *) new_base + + NEW_SECTION_H (nsec->sh_link).sh_offset); + + for (; num--; sym++) { + const char * symnam = (char *) (symnames + sym->st_name); + + /* Update the symbol values of _edata and _end. */ + if (strcmp (symnam, "_end") == 0 + || strcmp (symnam, "end") == 0 + || strcmp (symnam, "_edata") == 0 + || strcmp (symnam, "edata") == 0) + memcpy (&sym->st_value, &new_bss_addr,sizeof (new_bss_addr)); + + + if ((sym->st_shndx == SHN_UNDEF) || (sym->st_shndx == SHN_ABS) + || (sym->st_shndx == SHN_COMMON) + || (sym->st_shndx >= SHN_LOPROC && + sym->st_shndx <= SHN_HIPROC)) + continue; PATCH_INDEX (sym->st_shndx); - } - } - } - - /* Update the symbol values of _edata and _end. */ - for (n = new_file_h->e_shnum - 1; n; n--) - { - byte *symnames; - ElfW(Sym) *symp, *symendp; - - if (NEW_SECTION_H (n).sh_type != SHT_DYNSYM - && NEW_SECTION_H (n).sh_type != SHT_SYMTAB) - continue; - - symnames = ((byte *) new_base - + NEW_SECTION_H (NEW_SECTION_H (n).sh_link).sh_offset); - symp = (ElfW(Sym) *) (NEW_SECTION_H (n).sh_offset + new_base); - symendp = (ElfW(Sym) *) ((byte *)symp + NEW_SECTION_H (n).sh_size); - - for (; symp < symendp; symp ++) - if (strcmp ((char *) (symnames + symp->st_name), "_end") == 0 - || strcmp ((char *) (symnames + symp->st_name), "end") == 0 - || strcmp ((char *) (symnames + symp->st_name), "_edata") == 0 - || strcmp ((char *) (symnames + symp->st_name), "edata") == 0) - memcpy (&symp->st_value, &new_bss_addr, sizeof (new_bss_addr)); - } + } + } + } /* This loop seeks out relocation sections for the data section, so - that it can undo relocations performed by the runtime linker. */ - for (n = new_file_h->e_shnum - 1; n; n--) - { + * that it can undo relocations performed by the runtime linker. */ + for (n = new_file_h->e_shnum - 1; n; n--) { ElfW(Shdr) section = NEW_SECTION_H (n); - switch (section.sh_type) { - default: - break; - case SHT_REL: - case SHT_RELA: - /* This code handles two different size structs, but there should - be no harm in that provided that r_offset is always the first - member. */ - nn = section.sh_info; - if (!strcmp (old_section_names + NEW_SECTION_H (nn).sh_name, ".data") - || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name), - ".sdata") - || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name), - ".lit4") - || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name), - ".lit8") - || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name), - ".sdata1") - || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name), - ".data1")) - { - ElfW(Addr) offset = NEW_SECTION_H (nn).sh_addr - - NEW_SECTION_H (nn).sh_offset; - caddr_t reloc = old_base + section.sh_offset, end; - for (end = reloc + section.sh_size; reloc < end; - reloc += section.sh_entsize) - { - ElfW(Addr) addr = ((ElfW(Rel) *) reloc)->r_offset - offset; + + if ( section.sh_type == SHT_REL || section.sh_type == SHT_RELA ) { + /* This code handles two different size structs, but there + * should be no harm in that provided that r_offset is + * always the first member. */ + ElfW(Shdr) * info = & NEW_SECTION_H(section.sh_info); + const char * nm = old_section_names + info->sh_name; + + if (!strcmp (nm, ".data") || !strcmp (nm, ".sdata") + || !strcmp (nm, ".lit4") || !strcmp (nm, ".lit8") + || !strcmp (nm, ".sdata1") || !strcmp (nm, ".data1")) { + ElfW(Addr) offset = info->sh_addr - info->sh_offset; + caddr_t end, reloc = old_base + section.sh_offset; + + for (end = reloc + section.sh_size; reloc < end; + reloc += section.sh_entsize) { + ElfW(Addr) addr = ((ElfW(Rel) *) reloc)->r_offset - offset; #ifdef __alpha__ - /* The Alpha ELF binutils currently have a bug that - sometimes results in relocs that contain all - zeroes. Work around this for now... */ - if (((ElfW(Rel) *) reloc)->r_offset == 0) - continue; + /* The Alpha ELF binutils currently have a bug that + * sometimes results in relocs that contain all + * zeroes. Work around this for now... */ + if (((ElfW(Rel) *) reloc)->r_offset == 0) + continue; #endif - memcpy (new_base + addr, old_base + addr, sizeof(ElfW(Addr))); + memcpy (new_base + addr, old_base + addr, + sizeof(ElfW(Addr))); } } - break; } - } + } #ifdef UNEXEC_USE_MAP_PRIVATE if (lseek (new_file, 0, SEEK_SET) == -1) - fatal ("Can't rewind (%s): errno %d\n", new_name, errno); + fatal ("Can't rewind (%s): errno %d\n", new_name, errno); if (write (new_file, new_base, new_file_size) != new_file_size) - fatal ("Can't write (%s): errno %d\n", new_name, errno); + fatal ("Can't write (%s): errno %d\n", new_name, errno); #endif /* Close the files and make the new file executable. */ - if (close (old_file)) - fatal ("Can't close (%s): errno %d\n", old_name, errno); + fatal ("Can't close (%s): errno %d\n", old_name, errno); if (close (new_file)) - fatal ("Can't close (%s): errno %d\n", new_name, errno); + fatal ("Can't close (%s): errno %d\n", new_name, errno); if (stat (new_name, &stat_buf) == -1) - fatal ("Can't stat (%s): errno %d\n", new_name, errno); + fatal ("Can't stat (%s): errno %d\n", new_name, errno); n = umask (777); umask (n); stat_buf.st_mode |= 0111 & ~n; if (chmod (new_name, stat_buf.st_mode) == -1) - fatal ("Can't chmod (%s): errno %d\n", new_name, errno); + fatal ("Can't chmod (%s): errno %d\n", new_name, errno); } diff --git a/tests/ChangeLog b/tests/ChangeLog index 4accfc3..ee7e52d 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,35 @@ +2000-12-05 Martin Buchholz + + * XEmacs 21.2.38 is released. + +2000-12-01 Martin Buchholz + + * automated/test-harness.el (test-harness-from-buffer): Throw away + all warnings, even those not influenced by byte-compiler-warnings. + +2000-11-30 Martin Buchholz + + * automated/lisp-tests.el: + Test byte-compiler arithmetic optimizations. + +2000-11-27 Yoshiki Hayashi + + * automated/case-tests.el: Add more tests. + +2000-11-24 Yoshiki Hayashi + + * automated/regexp-tests.el: New file. + +2000-11-22 Martin Buchholz + + * automated/lisp-tests.el: + Add 64-bit-correctness format tests. + Don't quote the first arg to Check-Error. + +2000-11-14 Yoshiki Hayashi + + * automated/case-tests.el: New file. + 2000-11-14 Martin Buchholz * XEmacs 21.2.37 is released. diff --git a/tests/automated/lisp-tests.el b/tests/automated/lisp-tests.el index c4d22b1..7d6f321 100644 --- a/tests/automated/lisp-tests.el +++ b/tests/automated/lisp-tests.el @@ -335,6 +335,39 @@ (Assert (= two (max one two two))) (Assert (= two (max two two one))))) +;; The byte compiler has special handling for these constructs: +(let ((three 3) (five 5)) + (Assert (= (+ three five 1) 9)) + (Assert (= (+ 1 three five) 9)) + (Assert (= (+ three five -1) 7)) + (Assert (= (+ -1 three five) 7)) + (Assert (= (+ three 1) 4)) + (Assert (= (+ three -1) 2)) + (Assert (= (+ -1 three) 2)) + (Assert (= (+ -1 three) 2)) + (Assert (= (- three five 1) -3)) + (Assert (= (- 1 three five) -7)) + (Assert (= (- three five -1) -1)) + (Assert (= (- -1 three five) -9)) + (Assert (= (- three 1) 2)) + (Assert (= (- three 2 1) 0)) + (Assert (= (- 2 three 1) -2)) + (Assert (= (- three -1) 4)) + (Assert (= (- three 0) 3)) + (Assert (= (- three 0 five) -2)) + (Assert (= (- 0 three 0 five) -8)) + (Assert (= (- 0 three five) -8)) + (Assert (= (* three 2) 6)) + (Assert (= (* three -1 five) -15)) + (Assert (= (* three 1 five) 15)) + (Assert (= (* three 0 five) 0)) + (Assert (= (* three 2 five) 30)) + (Assert (= (/ three 1) 3)) + (Assert (= (/ three -1) -3)) + (Assert (= (/ (* five five) 2 2) 6)) + (Assert (= (/ 64 five 2) 6))) + + ;;----------------------------------------------------- ;; Logical bit-twiddling operations ;;----------------------------------------------------- @@ -757,7 +790,7 @@ ;; The following 2 functions used to crash XEmacs via mapcar1(). ;; We don't test the actual values of the mapcar, since they're undefined. -(Assert +(Assert (let ((x (list (cons 1 1) (cons 2 2) (cons 3 3)))) (mapcar (lambda (y) @@ -768,7 +801,7 @@ (car y)) ; sorry, hard landing x))) -(Assert +(Assert (let ((x (list (cons 1 1) (cons 2 2) (cons 3 3)))) (mapcar (lambda (y) @@ -832,7 +865,7 @@ (Assert (equal (split-string ",foo,,bar," ",+") '("" "foo" "bar" ""))) (Assert (not (string-match "\\(\\.\\=\\)" "."))) -(Assert (string= "" (let ((str "test string")) +(Assert (string= "" (let ((str "test string")) (if (string-match "^.*$" str) (replace-match "\\U" t nil str))))) (with-temp-buffer @@ -946,9 +979,9 @@ (Assert (equal (subseq '(1 2 3) 0) '(1 2 3))) (Assert (equal (subseq '(1 2 3 4) -3 nil) '(2 3 4))) -(Check-Error 'wrong-type-argument (subseq 3 2)) -(Check-Error 'args-out-of-range (subseq [1 2 3] -42)) -(Check-Error 'args-out-of-range (subseq [1 2 3] 0 42)) +(Check-Error wrong-type-argument (subseq 3 2)) +(Check-Error args-out-of-range (subseq [1 2 3] -42)) +(Check-Error args-out-of-range (subseq [1 2 3] 0 42)) ;;----------------------------------------------------- ;; Time-related tests @@ -1023,3 +1056,18 @@ (Assert (string= (format "%01.3d" 10) "10")) (Assert (string= (format "%1.3d" 10) "10")) (Assert (string= (format "%3.1d" 10) " 10")) + +;;; Check for 64-bit cleanness on LP64 platforms. +(Assert (= (read (format "%d" most-positive-fixnum)) most-positive-fixnum)) +(Assert (= (read (format "%ld" most-positive-fixnum)) most-positive-fixnum)) +(Assert (= (read (format "%u" most-positive-fixnum)) most-positive-fixnum)) +(Assert (= (read (format "%lu" most-positive-fixnum)) most-positive-fixnum)) +(Assert (= (read (format "%d" most-negative-fixnum)) most-negative-fixnum)) +(Assert (= (read (format "%ld" most-negative-fixnum)) most-negative-fixnum)) + +;;; "%u" is undocumented, and Emacs Lisp has no unsigned type. +;;; What to do if "%u" is used with a negative number? +;;; The most reasonable thing seems to be to print an un-read-able number. +;;; The printed value might be useful to a human, if not to Emacs Lisp. +(Check-Error invalid-read-syntax (read (format "%u" most-negative-fixnum))) +(Check-Error invalid-read-syntax (read (format "%u" -1))) diff --git a/tests/automated/test-harness.el b/tests/automated/test-harness.el index 52093f4..8fcec7e 100644 --- a/tests/automated/test-harness.el +++ b/tests/automated/test-harness.el @@ -236,8 +236,11 @@ The output file's name is made by appending `c' to the end of FILENAME." (princ "\nTesting Compiled Lisp\n\n") (let (code) (condition-case error-info - (setq code (let ((byte-compile-warnings nil)) - (byte-compile (test-harness-read-from-buffer inbuffer)))) + (setq code + ;; our lisp code is often intentionally dubious, + ;; so throw away _all_ the byte compiler warnings. + (letf (((symbol-function 'byte-compile-warn) 'ignore)) + (byte-compile (test-harness-read-from-buffer inbuffer)))) (error (princ (format "Unexpected error %S while byte-compiling code\n" error-info)))) diff --git a/version.sh b/version.sh index 78e3f2d..cd34ceb 100644 --- a/version.sh +++ b/version.sh @@ -2,8 +2,8 @@ emacs_is_beta=t emacs_major_version=21 emacs_minor_version=2 -emacs_beta_version=37 -xemacs_codename="Pan" +emacs_beta_version=38 +xemacs_codename="Peisino,Ak(B" infodock_major_version=4 infodock_minor_version=0 infodock_build_version=8