Mercurial > hg > xemacs-beta
changeset 1346:01c57eb70ae9
[xemacs-hg @ 2003-03-09 02:27:27 by ben]
To: xemacs-patches@xemacs.org
i.c: Sleep between calls to check for I/O, since these calls are non-blocking.
behavior.el: Allow other keywords for forward compatibility.
cl-macs.el: Rewrite to eliminate byte-compiler warning when `return' is used
without `finally'.
cmdloop.el: Avoid truncated error messages for `end-of-file' and the like.
cmdloop.el: Avoid char-int error after syncing.
files.el: Eliminate byte-compile warnings.
printer.el: Fix line-width calculations.
#### This used to work. Someone's changes (perhaps by
Michael Sperber?) seem to have messed something up.
simple.el: Use new clear-left-side functions to avoid messages ending up on
the same line as other output.
xemacs.mak: Add override for info/ as well when separate source/build dirs.
xemacs.mak: Order sections in main build process and add comments. Add
additional dependencies to try and prevent later steps from
happening when failures in earlier steps have occurred.
Makefile.in.in: Order sections in main build process and add comments. Add
additional dependencies to try and prevent later steps from
happening when failures in earlier steps have occurred.
alloc.c: Don't arbitrarily clear Vconfigure_info_directory since it
messes up separate build/source dirs.
console.c, console.h, device-msw.c, device.c: Add accidentally omitted msprinter console and data descriptions.
print.c, console-msw.c: Add clear-left-side functionality to help keep stdio/stderr
output from separate sources on separate lines. Generalize
the different kinds of debugging output. Add dpa().
profile.c: Add better docs on Unix/Windows differences.
regex.c: Fix problems with rel-alloc compilation caused by previous patch.
emacs.c: Seg fault rather than abort on Cygwin, since gdb doesn't trap
aborts properly.
console-gtk-impl.h, console-gtk.h, console-msw.h, console-x-impl.h, console-x.h, dialog-gtk.c, dialog-x.c, event-msw.c, frame-gtk.c, frame-x.c, frameslots.h, glyphs-gtk.c, glyphs-x.c, gui-gtk.c, gui-x.c, inline.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, scrollbar-gtk.c, scrollbar-x.c, ui-gtk.c: Delete popup-data object. Delete menubar_data field from frames,
since its usage is frame-specific. Delete menubar-msw.h,
gui-x.h, gui-gtk.h. Clean up handling of lwlib callback data
GCPRO'ing and add missing GCPRO recomputation in widget code.
author | ben |
---|---|
date | Sun, 09 Mar 2003 02:27:46 +0000 |
parents | 3b27da507d56 |
children | 8d350b095c21 |
files | lib-src/ChangeLog lib-src/i.c lisp/ChangeLog lisp/behavior.el lisp/cl-macs.el lisp/cmdloop.el lisp/files.el lisp/font.el lisp/msw-faces.el lisp/printer.el lisp/simple.el nt/ChangeLog nt/xemacs.mak src/ChangeLog src/Makefile.in.in src/alloc.c src/console-gtk-impl.h src/console-gtk.h src/console-msw.c src/console-msw.h src/console-x-impl.h src/console-x.h src/console.c src/console.h src/depend src/device-msw.c src/device.c src/dialog-gtk.c src/dialog-x.c src/emacs.c src/event-msw.c src/frame-gtk.c src/frame-x.c src/frameslots.h src/glyphs-gtk.c src/glyphs-x.c src/gui-gtk.c src/gui-gtk.h src/gui-x.c src/gui-x.h src/inline.c src/lisp.h src/menubar-gtk.c src/menubar-msw.c src/menubar-msw.h src/menubar-x.c src/nas.c src/print.c src/profile.c src/regex.c src/scrollbar-gtk.c src/scrollbar-x.c src/sound.c src/ui-gtk.c |
diffstat | 54 files changed, 902 insertions(+), 636 deletions(-) [+] |
line wrap: on
line diff
--- a/lib-src/ChangeLog Sat Mar 08 22:52:26 2003 +0000 +++ b/lib-src/ChangeLog Sun Mar 09 02:27:46 2003 +0000 @@ -1,3 +1,9 @@ +2003-03-06 Ben Wing <ben@xemacs.org> + + * i.c: + * i.c (pump): + Sleep between calls to check for I/O, since these calls are non-blocking. + 2003-02-16 Steve Youngs <youngs@xemacs.org> * XEmacs 21.5.11 "cabbage" is released.
--- a/lib-src/i.c Sat Mar 08 22:52:26 2003 +0000 +++ b/lib-src/i.c Sun Mar 09 02:27:46 2003 +0000 @@ -1,6 +1,6 @@ /* I-connector utility Copyright (C) 2000 Kirill M. Katsnelson - Copyright (C) 2002 Ben Wing. + Copyright (C) 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -67,9 +67,18 @@ BYTE buffer [256]; DWORD really_read, unused; + /* The docs for ReadFile claim: + + The ReadFile function returns when one of the following is true: a write + operation completes on the write end of the pipe, the number of bytes + requested has been read, or an error occurs. + + But this is just not true. ReadFile never seems to block, and unless we + Sleep(), we will chew up all the CPU time. --ben + */ while (ReadFile (pi->source, buffer, sizeof (buffer), &really_read, NULL) && WriteFile (pi->drain, buffer, really_read, &unused, NULL)) - ; + Sleep (100); return 0; }
--- a/lisp/ChangeLog Sat Mar 08 22:52:26 2003 +0000 +++ b/lisp/ChangeLog Sun Mar 09 02:27:46 2003 +0000 @@ -1,3 +1,34 @@ +2003-03-06 Ben Wing <ben@xemacs.org> + + * behavior.el (define-behavior): + Allow other keywords for forward compatibility. + + * cl-macs.el (loop): + Rewrite to eliminate byte-compiler warning when `return' is used + without `finally'. + + * cmdloop.el (file-error): + Avoid truncated error messages for `end-of-file' and the like. + + * cmdloop.el (read-quoted-char): + Avoid char-int error after syncing. + + * files.el (find-file-noselect): + * files.el (recover-file): + * files.el (recover-session-finish): + Eliminate byte-compile warnings. + + * printer.el (generate-header-line): + Fix line-width calculations. + #### This used to work. Someone's changes (perhaps by + Michael Sperber?) seem to have messed something up. + + * simple.el (clear-message): + * simple.el (append-message): + * simple.el (raw-append-message): + Use new clear-left-side functions to avoid messages ending up on + the same line as other output. + 2003-03-03 Stephen J. Turnbull <stephen@xemacs.org> * files.el (save-abbrevs): Fixup whitespace.
--- a/lisp/behavior.el Sat Mar 08 22:52:26 2003 +0000 +++ b/lisp/behavior.el Sun Mar 09 02:27:46 2003 +0000 @@ -95,7 +95,7 @@ :require :enable :disable) - () + t (let ((entry (list :short-doc cl-short-doc :require cl-require :enable cl-enable :disable cl-disable))) (puthash name entry behavior-hash-table))))
--- a/lisp/cl-macs.el Sat Mar 08 22:52:26 2003 +0000 +++ b/lisp/cl-macs.el Sun Mar 09 02:27:46 2003 +0000 @@ -992,7 +992,16 @@ '--cl-map loop-map-form)) (list* 'while (car ands) while-body))) (if loop-finish-flag - (if (equal epilogue '(nil)) (list loop-result-var) + (if (equal epilogue '(nil)) + ;; XEmacs change: When epilogue is nil and + ;; loop-finish-flag exists, you get a byte-compiler + ;; warning using the original (commented-out) + ;; code below. So instead we create a form that + ;; gives the same result but uses loop-finish-flag. + ;; --ben + ;(list loop-result-var) + (list (list 'if loop-finish-flag + loop-result-var loop-result-var)) (list (list 'if loop-finish-flag (cons 'progn epilogue) loop-result-var))) epilogue))))
--- a/lisp/cmdloop.el Sat Mar 08 22:52:26 2003 +0000 +++ b/lisp/cmdloop.el Sun Mar 09 02:27:46 2003 +0000 @@ -246,13 +246,20 @@ (put 'file-error 'display-error #'(lambda (error-object stream) - (let ((tail (cdr error-object)) - (first t)) - (princ (car tail) stream) - (while (setq tail (cdr tail)) - (princ (if first ": " ", ") stream) - (princ (car tail) stream) - (setq first nil))))) + (let ((type (car error-object)) + (tail (cdr error-object)) + (first t) + (print-message-label 'error)) + (if (eq type 'file-error) + (progn (princ (car tail) stream) + (setq tail (cdr tail))) + (princ (or (gettext (get type 'error-message)) type) + stream)) + (while tail + (princ (if first ": " ", ") stream) + (prin1 (car tail) stream) + (setq tail (cdr tail) + first nil))))) (put 'undefined-keystroke-sequence 'display-error #'(lambda (error-object stream) @@ -594,7 +601,7 @@ ((not first) (setq unread-command-events (list char) done t)) - (t (setq code char + (t (setq code (char-to-int char) done t))) (setq first nil)) (int-to-char code)))
--- a/lisp/files.el Sat Mar 08 22:52:26 2003 +0000 +++ b/lisp/files.el Sun Mar 09 02:27:46 2003 +0000 @@ -1238,7 +1238,7 @@ (number (nthcdr 10 (file-attributes truename))) ; ;; Find any buffer for a file which has same truename. ; (other (and (not buf) (find-buffer-visiting filename))) - (error nil)) + ) ; ;; Let user know if there is a buffer with the same truename. ; (if other @@ -3554,7 +3554,8 @@ (with-output-to-temp-buffer "*Directory*" (buffer-disable-undo standard-output) (save-excursion - (let ((switches dired-listing-switches)) + (let ((switches + (declare-boundp dired-listing-switches))) (if (file-symlink-p file) (setq switches (concat switches "L"))) (set-buffer standard-output) @@ -3634,18 +3635,25 @@ (list temp file-name))) (io-error (save-excursion - (let ((switches dired-listing-switches)) + (let ((switches + (declare-boundp + dired-listing-switches))) (if (file-symlink-p file) (setq switches (concat switches "L"))) (set-buffer standard-output) ;; XEmacs had the following line, not in FSF. (setq default-directory (file-name-directory file)) - ;; Use insert-directory-safely, not insert-directory, - ;; because these files might not exist. In particular, - ;; FILE might not exist if the auto-save file was for - ;; a buffer that didn't visit a file, such as "*mail*". - ;; The code in v20.x called `ls' directly, so we need - ;; to emulate what `ls' did in that case. + ;; Use insert-directory-safely, + ;; not insert-directory, because + ;; these files might not exist. + ;; In particular, FILE might not + ;; exist if the auto-save file + ;; was for a buffer that didn't + ;; visit a file, such as + ;; "*mail*". The code in v20.x + ;; called `ls' directly, so we + ;; need to emulate what `ls' did + ;; in that case. (insert-directory-safely file switches) (insert-directory-safely file-name switches)) (terpri) @@ -3755,10 +3763,10 @@ (interactive) ;; Get the name of the session file to recover from. (let ((file (declare-fboundp (dired-get-filename)))) - (dired-unmark 1) + (declare-fboundp (dired-unmark 1)) ;; #### dired-do-flagged-delete in FSF. ;; This version is for ange-ftp - ;;(dired-do-deletions t) + ;;(declare-fboundp (dired-do-deletions t)) ;; This version is for efs (declare-fboundp (dired-expunge-deletions)) (let ((files (Recover-session-files-from-auto-save-list-file file)))
--- a/lisp/font.el Sat Mar 08 22:52:26 2003 +0000 +++ b/lisp/font.el Sun Mar 09 02:27:46 2003 +0000 @@ -42,7 +42,8 @@ (globally-declare-boundp '(global-face-data - x-font-regexp x-font-regexp-foundry-and-family)) + x-font-regexp x-font-regexp-foundry-and-family + mswindows-font-regexp)) (require 'cl)
--- a/lisp/msw-faces.el Sat Mar 08 22:52:26 2003 +0000 +++ b/lisp/msw-faces.el Sun Mar 09 02:27:46 2003 +0000 @@ -29,6 +29,11 @@ ;; This file does the magic to parse mswindows font names, and make sure that ;; the default and modeline attributes of new frames are specified enough. +(globally-declare-boundp + '(mswindows-font-regexp mswindows-font-regexp-missing-1 + mswindows-font-regexp-missing-2 mswindows-font-regexp-missing-3 + mswindows-font-regexp-missing-4)) + (defun mswindows-init-global-faces () (set-face-font 'gui-element "MS Sans Serif:Regular:8" nil 'mswindows))
--- a/lisp/printer.el Sat Mar 08 22:52:26 2003 +0000 +++ b/lisp/printer.el Sun Mar 09 02:27:46 2003 +0000 @@ -166,7 +166,7 @@ (left-width (- middle-start left-start)) (middle-width (- right-start middle-start)) (right-width (- right-end right-start)) - (winwidth (- (window-width (Print-context-window context)) 1)) + (winwidth (- (window-width (Print-context-window context)) 2)) (spaces1 (max (- (/ (- winwidth middle-width) 2) left-width) 0)) (spaces2 (max (- (- winwidth right-width) (+ left-width spaces1 middle-width))
--- a/lisp/simple.el Sat Mar 08 22:52:26 2003 +0000 +++ b/lisp/simple.el Sun Mar 09 02:27:46 2003 +0000 @@ -3977,6 +3977,7 @@ (when (and (not (fboundp 'display-message)) (not (featurep 'debug))) + (set-device-clear-left-side nil nil) (send-string-to-terminal "\n")) (defvar message-stack nil @@ -4144,8 +4145,12 @@ (remove-message label frame) (let ((inhibit-read-only t)) (erase-buffer " *Echo Area*")) - (if clear-stream - (send-string-to-terminal ?\n stdout-p)) + ;; If outputting to the terminal, make sure we clear the left side. + (when (or clear-stream + (and (eq 'stream (frame-type frame)) + (not (device-left-side-clear-p (frame-device frame))))) + (set-device-clear-left-side (frame-device frame) nil) + (send-string-to-terminal ?\n stdout-p)) (if no-restore nil ; just preparing to put another msg up (if message-stack @@ -4189,12 +4194,19 @@ (defun append-message (label message &optional frame stdout-p) (or frame (setq frame (selected-frame))) + ;; If outputting to the terminal, make sure output from anyone else clears + ;; the left side first, but don't do it ourselves, otherwise we won't be + ;; able to append to an existing message. + (if (eq 'stream (frame-type frame)) + (set-device-clear-left-side (frame-device frame) nil)) ;; Add a new entry to the message-stack, or modify an existing one (let ((top (car message-stack))) (if (eq label (car top)) (setcdr top (concat (cdr top) message)) (push (cons label message) message-stack))) - (raw-append-message message frame stdout-p)) + (raw-append-message message frame stdout-p) + (if (eq 'stream (frame-type frame)) + (set-device-clear-left-side (frame-device frame) t))) ;; Really append the message to the echo area. no fiddling with ;; message-stack.
--- a/nt/ChangeLog Sat Mar 08 22:52:26 2003 +0000 +++ b/nt/ChangeLog Sun Mar 09 02:27:46 2003 +0000 @@ -1,3 +1,20 @@ +2003-03-06 Ben Wing <ben@xemacs.org> + + * xemacs.mak (INFO): New. + * xemacs.mak (PATH_DEFINES): + Add override for info/ as well when separate source/build dirs. + + * xemacs.mak (dump_temacs): + * xemacs.mak (all): + * xemacs.mak (TEMACS_DUMP_DEP): + * xemacs.mak (update-elc): New. + * xemacs.mak (docfile): + * xemacs.mak (update-elc-2): + * xemacs.mak (load-shadows): + Order sections in main build process and add comments. Add + additional dependencies to try and prevent later steps from + happening when failures in earlier steps have occurred. + 2003-03-01 Ben Wing <ben@xemacs.org> * PROBLEMS: Delete.
--- a/nt/xemacs.mak Sat Mar 08 22:52:26 2003 +0000 +++ b/nt/xemacs.mak Sun Mar 09 02:27:46 2003 +0000 @@ -86,6 +86,7 @@ NT=$(SRCROOT)\nt SRC=$(SRCROOT)\src ETC=$(SRCROOT)\etc +INFO=$(SRCROOT)\info BLDLIB_SRC=$(BLDROOT)\lib-src BLDNT=$(BLDROOT)\nt @@ -355,7 +356,7 @@ PATH_DEFINES=-DPATH_PREFIX=\"$(PATH_PREFIX)\" !if $(SEPARATE_BUILD) -PATH_DEFINES=-DPATH_LOADSEARCH=\"$(LISP:\=\\)\" -DPATH_DATA=\"$(ETC:\=\\)\" +PATH_DEFINES=$(PATH_DEFINES) -DPATH_LOADSEARCH=\"$(LISP:\=\\)\" -DPATH_DATA=\"$(ETC:\=\\)\" -DPATH_INFO=\"$(INFO:\=\\)\" !endif ########################### Determine system configuration. @@ -1293,17 +1294,20 @@ ########################### Build rules -# use this rule to build the complete system -all: installation $(OUTDIR)\nul $(LASTFILE) \ - $(LIB_SRC_TOOLS) update-elc $(DUMP_TARGET) \ - update-elc-2 $(LISP)/finder-inf.el load-shadows info +## Use this rule to build the complete system. We need both update-elc +## and update-elc-2 due to the sideways dependency of NEEDTODUMP. See +## src/Makefile.in.in for a more detailed discussion of this. + +all: installation $(OUTDIR)\nul $(LIB_SRC_TOOLS) \ + update-elc update-elc-2 \ + $(LISP)/finder-inf.el load-shadows info $(TEMACS_BROWSE): $(TEMACS_OBJS) @dir /b/s $(OUTDIR)\*.sbr > $(OUTDIR)\bscmake.tmp bscmake -nologo -o$(TEMACS_BROWSE) @$(OUTDIR)\bscmake.tmp -$(DEL) $(OUTDIR)\bscmake.tmp -# dump-id.c file that contains the dump id +## (1) Compile all dependencies of the XEmacs executable $(OUTDIR)\dump-id.obj : $(BLDSRC)\dump-id.c $(CCV) $(TEMACS_CPP_FLAGS) $(BLDSRC)\$(@B).c -Fo$@ $(BROWSERFLAGS) @@ -1316,6 +1320,8 @@ cd $(NT) rc -Fo$@ xemacs.rc +## (2) Link the XEmacs executable + !if $(USE_PORTABLE_DUMPER) TEMACS_DUMP_DEP = $(OUTDIR)\dump-id.obj !else @@ -1331,7 +1337,16 @@ $(RAW_EXE): $(TEMACS_BROWSE) !endif -# Rebuild docfile target +## (3) Update the .elc's needed for dumping + +update-elc: $(RAW_EXE) + $(TEMACS_BATCH) -l $(LISP)\update-elc.el + +## This file is touched by update-elc.el when redumping is necessary. +$(BLDSRC)\NEEDTODUMP: + @echo >$(BLDSRC)\NEEDTODUMP + +## (4) Build the DOC file DOC=$(BLDLIB_SRC)\DOC @@ -1355,12 +1370,7 @@ << !endif -update-elc: $(RAW_EXE) - $(TEMACS_BATCH) -l $(LISP)\update-elc.el - -## This file is touched by update-elc.el when redumping is necessary. -$(BLDSRC)\NEEDTODUMP: - @echo >$(BLDSRC)\NEEDTODUMP +## (5) Dump !if $(USE_PORTABLE_DUMPER) $(DUMP_TARGET): $(NT)\xemacs.rc @@ -1382,11 +1392,14 @@ -$(DEL) $(BLDSRC)\xemacs.dmp !endif -## Update out-of-date .elcs, other than needed for dumping. -update-elc-2: +## (6) Update the remaining .elc's, post-dumping + +update-elc-2: $(DUMP_TARGET) $(XEMACS_BATCH) -no-autoloads -l update-elc-2.el -f batch-update-elc-2 $(LISP) -$(LISP)/finder-inf.el: +## (7) Other random stuff + +$(LISP)/finder-inf.el: update-elc-2 !if !$(QUICK_BUILD) @echo Building finder database ... $(XEMACS_BATCH) -eval "(setq finder-compile-keywords-quiet t)" \ @@ -1394,7 +1407,7 @@ @echo Building finder database ...(done) !endif -load-shadows: +load-shadows: update-elc-2 !if !$(QUICK_BUILD) @echo Testing for Lisp shadows ... @$(XEMACS_BATCH) -f list-load-path-shadows
--- a/src/ChangeLog Sat Mar 08 22:52:26 2003 +0000 +++ b/src/ChangeLog Sun Mar 09 02:27:46 2003 +0000 @@ -1,3 +1,123 @@ +2003-03-06 Ben Wing <ben@xemacs.org> + + * Makefile.in.in (build-the-mofo): + * Makefile.in.in (.NO_PARALLEL): Removed. + * Makefile.in.in (release): Removed. + * Makefile.in.in (update-elc-2): Removed. + * Makefile.in.in (link_deps): + * Makefile.in.in (dump-id.c): New. + * Makefile.in.in (load-shadows): Removed. + * Makefile.in.in (.PHONY): Removed. + * Makefile.in.in (FRC.needtodump): Removed. + * Makefile.in.in (temacs_link_args): + * Makefile.in.in (obj_src): + Order sections in main build process and add comments. Add + additional dependencies to try and prevent later steps from + happening when failures in earlier steps have occurred. + + * alloc.c (disksave_object_finalization): + Don't arbitrarily clear Vconfigure_info_directory since it + messes up separate build/source dirs. + + * console.c (get_console_variant): + * console.c (Fvalid_console_type_p): + * console.c (Fconsole_type): + * console.h (console_variant): + * device-msw.c: + * device.c: + Add accidentally omitted msprinter console and data descriptions. + + * print.c: + * print.c (write_string_to_stdio_stream_1): + * print.c (write_string_to_stdio_stream): + * print.c (write_string_to_external_output_va): + * print.c (stderr_out): + * print.c (stdout_out): + * print.c (debug_out): + * print.c (fatal): + * print.c (write_string_to_alternate_debugging_output): + * print.c (debug_prin1): + * print.c (ext_print_begin): + * print.c (debug_print): + * print.c (dpa): + * print.c (debug_short_backtrace): + * print.c (syms_of_print): + * console-msw.c (write_string_to_mswindows_debugging_output): + Add clear-left-side functionality to help keep stdio/stderr + output from separate sources on separate lines. Generalize + the different kinds of debugging output. Add dpa(). + + * profile.c: + * profile.c (vars_of_profile): + Add better docs on Unix/Windows differences. + + * regex.c: + * regex.c (RE_TRANSLATE_1): + * regex.c (REGEX_ALLOCATE_STACK): + * regex.c (RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS): + * regex.c (RE_SEARCH_RELOCATE_MOVEABLE_DATA_POINTERS): + * regex.c (re_search_2): + * regex.c (re_match_2_internal): + Fix problems with rel-alloc compilation caused by previous patch. + + * emacs.c (assert_failed): + Seg fault rather than abort on Cygwin, since gdb doesn't trap + aborts properly. + + * console-gtk-impl.h: + * console-gtk-impl.h (struct gtk_frame): + * console-gtk.h: + * console-msw.h: + * console-x-impl.h: + * console-x-impl.h (struct x_frame): + * console-x.h: + * dialog-gtk.c: + * dialog-x.c: + * event-msw.c: + * frame-gtk.c: + * frame-gtk.c (allocate_gtk_frame_struct): + * frame-gtk.c (gtk_mark_frame): + * frame-x.c: + * frame-x.c (allocate_x_frame_struct): + * frame-x.c (x_mark_frame): + * frameslots.h: + * glyphs-gtk.c: + * glyphs-x.c: + * glyphs-x.c (x_redisplay_widget): + * glyphs-x.c (x_button_redisplay): + * glyphs-x.c (x_tab_control_redisplay): + * gui-gtk.c: + * gui-x.c: + * gui-x.c (new_lwlib_id): + * gui-x.c (struct widget_value_mapper): + * gui-x.c (snarf_widget_value_mapper): + * gui-x.c (snarf_widget_values_for_gcpro): + * gui-x.c (gcpro_popup_callbacks): + * gui-x.c (ungcpro_popup_callbacks): + * gui-x.c (syms_of_gui_x): + * gui-x.c (reinit_vars_of_gui_x): + * inline.c: + * menubar-gtk.c: + * menubar-gtk.c (FRAME_GTK_MENUBAR_DATA): + * menubar-gtk.c (set_frame_menubar): + * menubar-gtk.c (gtk_update_frame_menubar_internal): + * menubar-msw.c: + * menubar-x.c: + * menubar-x.c (MENUBAR_TYPE): + * menubar-x.c (pre_activate_callback): + * menubar-x.c (set_frame_menubar): + * menubar-x.c (x_update_frame_menubar_internal): + * menubar-x.c (x_free_frame_menubars): + * menubar-x.c (command_builder_find_menu_accelerator): + * menubar-x.c (Faccelerate_menu): + * scrollbar-gtk.c: + * scrollbar-x.c: + * ui-gtk.c: + Delete popup-data object. Delete menubar_data field from frames, + since its usage is frame-specific. Delete menubar-msw.h, + gui-x.h, gui-gtk.h. Clean up handling of lwlib callback data + GCPRO'ing and add missing GCPRO recomputation in widget code. + 2003-03-01 Ben Wing <ben@xemacs.org> * alloc.c:
--- a/src/Makefile.in.in Sat Mar 08 22:52:26 2003 +0000 +++ b/src/Makefile.in.in Sun Mar 09 02:27:46 2003 +0000 @@ -498,53 +498,9 @@ ## -ben .PHONY: build-the-mofo -build-the-mofo: $(DUMP_TARGET) $(mo_file) $(other_files) update-elc-2 $(LISP)/finder-inf.el load-shadows -.NO_PARALLEL: $(DUMP_TARGET) update-elc-2 $(LISP)/finder-inf.el load-shadows - -release: all - -if [ -w $(LISP) ]; then \ - w=`pwd`; cd $(SRC) && $$w/$(RAW_EXE) -nd $(BATCH) -l $(LISP)/inc-vers; \ - else true; fi - -$(dump_temacs) - touch release - -## Update out-of-date .elcs, other than needed for dumping. -.PHONY: update-elc-2 -update-elc-2: - $(XEMACS_BATCH) -no-autoloads -l update-elc-2.el -f batch-update-elc-2 $(LISP) - -$(LISP)/finder-inf.el: - @echo "Building finder database ..." - $(XEMACS_BATCH) -eval "(setq finder-compile-keywords-quiet t)" \ - -l finder -f finder-compile-keywords - @echo "Building finder database ...(done)" +build-the-mofo: update-elc-2 $(mo_file) $(other_files) $(LISP)/finder-inf.el load-shadows -.PHONY: load-shadows -load-shadows: -#ifndef QUICK_BUILD - @echo "Testing for Lisp shadows ..." - @$(XEMACS_BATCH) -f list-load-path-shadows -#endif - -.PHONY: FRC.needtodump -FRC.needtodump: - -## This file is touched by update-elc.el when redumping is necessary. -## We use $(BLDSRC) == `.' here to help keep sync with nt/xemacs.mak, -## where $(BLDSRC) is not `.'. -$(BLDSRC)/NEEDTODUMP: FRC.needtodump - $(TEMACS_BATCH) -l $(LISP)/update-elc.el - -$(DUMP_TARGET): $(RAW_EXE) $(BLDSRC)/NEEDTODUMP $(LIB_SRC)/DOC -#ifdef HEAP_IN_DATA - @$(RM) $@ && touch SATISFIED - $(dump_temacs) - @if test -f SATISFIED; then $(RM) SATISFIED; else $(RM) $@; \ - $(RECURSIVE_MAKE) $@; fi -#else - @$(RM) $@ - $(dump_temacs) -#endif +## (1) Compile all dependencies of the XEmacs executable #ifdef HAVE_X_WINDOWS lwlib_deps = $(lwlib_lib) @@ -560,6 +516,14 @@ link_deps = $(start_files) $(objs) $(otherobjs) $(lwlib_deps) $(dynodump_deps) +$(LIB_SRC)/make-dump-id: + cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-dump-id + +dump-id.c: $(LIB_SRC)/make-dump-id $(link_deps) + $(LIB_SRC)/make-dump-id + +## (2) Link the XEmacs executable + temacs_deps = $(link_deps) $(DUMP_ID) temacs_link_args = \ @@ -569,11 +533,24 @@ $(RAW_EXE): $(temacs_deps) $(LD) $(temacs_link_args) -dump-id.c: $(LIB_SRC)/make-dump-id $(link_deps) - $(LIB_SRC)/make-dump-id +## (3) Update the .elc's needed for dumping + +.PHONY: FRC.needtodump +FRC.needtodump: + +## This file is touched by update-elc.el when redumping is necessary. +## We use $(BLDSRC) == `.' here to help keep sync with nt/xemacs.mak, +## where $(BLDSRC) is not `.'. +$(BLDSRC)/NEEDTODUMP: FRC.needtodump + $(TEMACS_BATCH) -l $(LISP)/update-elc.el + +## (4) Build the DOC file obj_src = $(objs:.o=.c) +$(LIB_SRC)/make-docfile: + cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-docfile + $(LIB_SRC)/DOC: $(LIB_SRC)/make-docfile $(BLDSRC)/NEEDTODUMP $(temacs_deps) #ifdef QUICK_BUILD if test ! -f $@ ; then \ @@ -585,11 +562,48 @@ $(obj_src) $(mallocdocsrc) $(rallocdocsrc) \ $(extra_doc_files) ; fi -$(LIB_SRC)/make-dump-id: - cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-dump-id +## (5) Dump + +$(DUMP_TARGET): $(RAW_EXE) $(BLDSRC)/NEEDTODUMP $(LIB_SRC)/DOC +#ifdef HEAP_IN_DATA + @$(RM) $@ && touch SATISFIED + $(dump_temacs) + @if test -f SATISFIED; then $(RM) SATISFIED; else $(RM) $@; \ + $(RECURSIVE_MAKE) $@; fi +#else + @$(RM) $@ + $(dump_temacs) +#endif + +## (6) Update the remaining .elc's, post-dumping + +.PHONY: update-elc-2 +update-elc-2: $(DUMP_TARGET) + $(XEMACS_BATCH) -no-autoloads -l update-elc-2.el -f batch-update-elc-2 $(LISP) + +## (7) Other random stuff -$(LIB_SRC)/make-docfile: - cd $(LIB_SRC) && $(RECURSIVE_MAKE) make-docfile +$(LISP)/finder-inf.el: update-elc-2 + @echo "Building finder database ..." + $(XEMACS_BATCH) -eval "(setq finder-compile-keywords-quiet t)" \ + -l finder -f finder-compile-keywords + @echo "Building finder database ...(done)" + +.PHONY: load-shadows +load-shadows: update-elc-2 +#ifndef QUICK_BUILD + @echo "Testing for Lisp shadows ..." + @$(XEMACS_BATCH) -f list-load-path-shadows +#endif + +###################### Misc targets + +release: all + -if [ -w $(LISP) ]; then \ + w=`pwd`; cd $(SRC) && $$w/$(RAW_EXE) -nd $(BATCH) -l $(LISP)/inc-vers; \ + else true; fi + -$(dump_temacs) + touch release .PHONY: fastdump fastdump: $(RAW_EXE)
--- a/src/alloc.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/alloc.c Sun Mar 09 02:27:46 2003 +0000 @@ -4285,7 +4285,6 @@ Vdata_directory = Qnil; Vsite_directory = Qnil; Vdoc_directory = Qnil; - Vconfigure_info_directory = Qnil; Vexec_path = Qnil; Vload_path = Qnil; /* Vdump_load_path = Qnil; */
--- a/src/console-gtk-impl.h Sat Mar 08 22:52:26 2003 +0000 +++ b/src/console-gtk-impl.h Sun Mar 09 02:27:46 2003 +0000 @@ -146,7 +146,7 @@ /* Our container widget as a Lisp_Object */ Lisp_Object lisp_visible_widgets[3]; - /*************************** Miscellaneous **************************/ + Lisp_Object menubar_data; /* The icon pixmaps; these are Lisp_Image_Instance objects, or Qnil. */ Lisp_Object icon_pixmap; @@ -183,6 +183,8 @@ #define FRAME_GTK_NUM_TOP_WIDGETS(f) (FRAME_GTK_DATA (f)->num_top_widgets) #define FRAME_GTK_ICONIFIED_P(f) (FRAME_GTK_DATA (f)->iconfigied_p) +#define FRAME_GTK_MENUBAR_DATA(f) (FRAME_GTK_DATA (f)->menubar_data) + #define FRAME_GTK_LISP_WIDGETS(f) (FRAME_GTK_DATA (f)->lisp_visible_widgets) #define FRAME_GTK_ICON_PIXMAP(f) (FRAME_GTK_DATA (f)->icon_pixmap) #define FRAME_GTK_ICON_PIXMAP_MASK(f) (FRAME_GTK_DATA (f)->icon_pixmap_mask)
--- a/src/console-gtk.h Sat Mar 08 22:52:26 2003 +0000 +++ b/src/console-gtk.h Sun Mar 09 02:27:46 2003 +0000 @@ -91,5 +91,12 @@ GtkSelectionData *selection_data, gpointer user_data); +typedef unsigned int GUI_ID; +extern GUI_ID new_gui_id (void); + +extern void gcpro_popup_callbacks (GUI_ID id, Lisp_Object data); +extern void ungcpro_popup_callbacks (GUI_ID id); +extern Lisp_Object get_gcpro_popup_callbacks (GUI_ID id); + #endif /* HAVE_GTK */ #endif /* _XEMACS_DEVICE_X_H_ */
--- a/src/console-msw.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/console-msw.c Sun Mar 09 02:27:46 2003 +0000 @@ -282,7 +282,7 @@ } void -write_string_to_mswindows_debugging_output (Ibyte *str, Bytecount len) +write_string_to_mswindows_debugging_output (const Ibyte *str, Bytecount len) { const Extbyte *extptr; if (initialized && !inhibit_non_essential_printing_operations)
--- a/src/console-msw.h Sat Mar 08 22:52:26 2003 +0000 +++ b/src/console-msw.h Sun Mar 09 02:27:46 2003 +0000 @@ -142,6 +142,11 @@ #ifdef HAVE_MENUBARS int mswindows_char_is_accelerator (struct frame *f, Ichar ch); + +/* Message handlers. Called from window procedure */ +Lisp_Object mswindows_handle_wm_initmenupopup (HMENU hmenu, struct frame *frm); +Lisp_Object mswindows_handle_wm_initmenu (HMENU hmenu, struct frame *f); +Lisp_Object mswindows_handle_wm_command (struct frame *f, WORD command); #endif #ifdef HAVE_TOOLBARS @@ -178,7 +183,8 @@ extern int mswindows_message_outputted; void mswindows_hide_console (void); int mswindows_output_console_string (const Ibyte *ptr, Bytecount len); -void write_string_to_mswindows_debugging_output (Ibyte *str, Bytecount len); +void write_string_to_mswindows_debugging_output (const Ibyte *str, + Bytecount len); #ifdef MULE
--- a/src/console-x-impl.h Sat Mar 08 22:52:26 2003 +0000 +++ b/src/console-x-impl.h Sun Mar 09 02:27:46 2003 +0000 @@ -1,7 +1,7 @@ /* Define X specific console, device, and frame object for XEmacs. Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. - Copyright (C) 1996, 2002 Ben Wing. + Copyright (C) 1996, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -245,7 +245,22 @@ Widget top_widgets[MAX_CONCURRENT_TOP_WIDGETS]; int num_top_widgets; - /*************************** Miscellaneous **************************/ + /* lwlib ID of the tree of widgets corresponding to this popup. We pass + this to lw_map_widget_values() to retrieve all of our Lispy call-data + and accel values that need to be GCPRO'd, and store them in the + following list. (We used to call lw_map_widget_values() during GC + mark, but that isn't compatible with KKCC.) */ + LWLIB_ID menubar_id; + + /* For the frame popup data, this is the last buffer for which the + menubar was displayed. If the buffer has changed, we may have to + update things. */ + Lisp_Object last_menubar_buffer; + + /* This flag tells us if the menubar contents are up-to-date with respect + to the current menubar structure. If we want to actually pull down a + menu and this is false, then we need to update things. */ + char menubar_contents_up_to_date; /* The icon pixmaps; these are Lisp_Image_Instance objects, or Qnil. */ Lisp_Object icon_pixmap; @@ -305,6 +320,11 @@ #define FRAME_X_TOP_WIDGETS(f) (FRAME_X_DATA (f)->top_widgets) #define FRAME_X_NUM_TOP_WIDGETS(f) (FRAME_X_DATA (f)->num_top_widgets) +#define FRAME_X_MENUBAR_ID(f) (FRAME_X_DATA (f)->menubar_id) +#define FRAME_X_LAST_MENUBAR_BUFFER(f) (FRAME_X_DATA (f)->last_menubar_buffer) +#define FRAME_X_MENUBAR_CONTENTS_UP_TO_DATE(f) \ + (FRAME_X_DATA (f)->menubar_contents_up_to_date) + #define FRAME_X_ICON_PIXMAP(f) (FRAME_X_DATA (f)->icon_pixmap) #define FRAME_X_ICON_PIXMAP_MASK(f) (FRAME_X_DATA (f)->icon_pixmap_mask)
--- a/src/console-x.h Sat Mar 08 22:52:26 2003 +0000 +++ b/src/console-x.h Sun Mar 09 02:27:46 2003 +0000 @@ -37,6 +37,7 @@ #include "console.h" #include "xintrinsic.h" +#include "../lwlib/lwlib.h" #include <X11/cursorfont.h> #include <X11/keysym.h> @@ -111,6 +112,26 @@ int signal_if_x_error (Display *dpy, int resumable_p); int x_IO_error_handler (Display *disp); +widget_value *xmalloc_widget_value (void); + +LWLIB_ID new_lwlib_id (void); + +void gcpro_popup_callbacks (LWLIB_ID id); +void ungcpro_popup_callbacks (LWLIB_ID id); +int popup_handled_p (LWLIB_ID id); +void free_popup_widget_value_tree (widget_value *wv); +void popup_selection_callback (Widget widget, LWLIB_ID ignored_id, + XtPointer client_data); +Extbyte *add_accel_and_to_external (Lisp_Object string); +int button_item_to_widget_value (Lisp_Object gui_object_instance, + Lisp_Object gui_item, widget_value *wv, + int allow_text_field_p, int no_keys_p, + int menu_entry_p, int accel_p); +widget_value * gui_items_to_widget_values (Lisp_Object gui_object_instance, + Lisp_Object items, int accel_p); +Extbyte *menu_separator_style_and_to_external (const Ibyte *s); +Lisp_Object widget_value_unwind (Lisp_Object closure); + void x_output_string (struct window *w, struct display_line *dl, Ichar_dynarr *buf, int xpos, int xoffset, int start_pixpos, int width, face_index findex,
--- a/src/console.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/console.c Sun Mar 09 02:27:46 2003 +0000 @@ -247,6 +247,9 @@ if (EQ (type, Qmswindows)) return mswindows_console; + if (EQ (type, Qmsprinter)) + return msprinter_console; + if (EQ (type, Qstream)) return stream_console; @@ -262,7 +265,7 @@ DEFUN ("valid-console-type-p", Fvalid_console_type_p, 1, 1, 0, /* Return t if CONSOLE-TYPE is a valid console type. -Valid types are 'x, 'tty, 'mswindows, 'gtk, and 'stream. +Valid types are 'x, 'tty, 'mswindows, 'msprinter, 'gtk, and 'stream. */ (console_type)) { @@ -390,11 +393,12 @@ DEFUN ("console-type", Fconsole_type, 0, 1, 0, /* Return the console type (e.g. `x' or `tty') of CONSOLE. -Value is `tty' for a tty console (a character-only terminal), +Value is +`tty' for a tty console (a character-only terminal), `x' for a console that is an X display, -`mswindows' for a console that is a Windows NT/95/97 connection, -`pc' for a console that is a direct-write MS-DOS connection (not yet - implemented), +`mswindows' for a console that is an MS Windows connection, +`msprinter' for a console that is an MS Windows printer connection, +`gtk' for a console that is a GTK connection, `stream' for a stream console (which acts like a stdio stream), and `dead' for a deleted console. */
--- a/src/console.h Sat Mar 08 22:52:26 2003 +0000 +++ b/src/console.h Sun Mar 09 02:27:46 2003 +0000 @@ -53,6 +53,7 @@ gtk_console, x_console, mswindows_console, + msprinter_console, stream_console };
--- a/src/depend Sat Mar 08 22:52:26 2003 +0000 +++ b/src/depend Sun Mar 09 02:27:46 2003 +0000 @@ -19,11 +19,11 @@ device-msw.o: $(LISP_H) charset.h conslots.h console-impl.h console-msw-impl.h console-msw.h console-stream.h console.h device-impl.h device.h devslots.h events.h faces.h frame.h intl-auto-encap-win32.h objects-msw.h objects.h redisplay.h sysdep.h systime.h syswindows.h dialog-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h frame-impl.h frame.h frameslots.h gui.h intl-auto-encap-win32.h opaque.h redisplay.h sysfile.h syswindows.h dired-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console-msw.h console.h intl-auto-encap-win32.h ndir.h regex.h syntax.h sysdir.h sysfile.h sysfloat.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h -event-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console-stream-impl.h console-stream.h console.h device-impl.h device.h devslots.h dragdrop.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gui.h intl-auto-encap-win32.h lstream.h menubar-msw.h menubar.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h syswait.h syswindows.h window-impl.h window.h winslots.h +event-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console-stream-impl.h console-stream.h console.h device-impl.h device.h devslots.h dragdrop.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gui.h intl-auto-encap-win32.h lstream.h menubar.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h syswait.h syswindows.h window-impl.h window.h winslots.h frame-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device-impl.h device.h devslots.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs-msw.h glyphs.h intl-auto-encap-win32.h redisplay.h scrollbar.h specifier.h systime.h syswindows.h window-impl.h window.h winslots.h glyphs-msw.o: $(LISP_H) charset.h coding-system-slots.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device-impl.h device.h devslots.h elhash.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h imgproc.h insdel.h intl-auto-encap-win32.h lstream.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syswindows.h window-impl.h window.h winslots.h gui-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h elhash.h events.h frame-impl.h frame.h frameslots.h glyphs.h gui.h intl-auto-encap-win32.h redisplay.h scrollbar.h specifier.h systime.h syswindows.h window-impl.h window.h winslots.h -menubar-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h elhash.h events.h frame-impl.h frame.h frameslots.h gui.h intl-auto-encap-win32.h menubar-msw.h menubar.h opaque.h redisplay.h scrollbar.h systime.h syswindows.h window-impl.h window.h winslots.h +menubar-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h elhash.h events.h frame-impl.h frame.h frameslots.h gui.h intl-auto-encap-win32.h menubar.h opaque.h redisplay.h scrollbar.h systime.h syswindows.h window-impl.h window.h winslots.h objects-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device-impl.h device.h devslots.h elhash.h insdel.h intl-auto-encap-win32.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h opaque.h specifier.h syswindows.h redisplay-msw.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h debug.h device-impl.h device.h devslots.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs-msw.h glyphs.h gutter.h intl-auto-encap-win32.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h systime.h syswindows.h window-impl.h window.h winslots.h scrollbar-msw.o: $(LISP_H) conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device.h elhash.h events.h frame-impl.h frame.h frameslots.h intl-auto-encap-win32.h opaque.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h systime.h syswindows.h window-impl.h window.h winslots.h @@ -38,20 +38,20 @@ EmacsManager.o: $(CONFIG_H) EmacsManager.h EmacsManagerP.h xintrinsicp.h xmmanagerp.h xmotif.h xmprimitivep.h EmacsShell-sub.o: $(CONFIG_H) EmacsShell.h EmacsShellP.h xintrinsic.h xintrinsicp.h EmacsShell.o: $(CONFIG_H) EmacsShell.h ExternalShell.h xintrinsicp.h -balloon-x.o: $(LISP_H) balloon_help.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h xintrinsic.h +balloon-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h balloon_help.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h xintrinsic.h balloon_help.o: $(CONFIG_H) balloon_help.h xintrinsic.h -console-x.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h process.h redisplay.h xintrinsic.h +console-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h process.h redisplay.h xintrinsic.h device-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.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 window-impl.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 charset.h chartab.h commands.h conslots.h console-impl.h console-x-impl.h console-x.h console.h events.h frame-impl.h frame.h frameslots.h gui-x.h gui.h opaque.h redisplay.h scrollbar.h systime.h window.h xintrinsic.h +dialog-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-x-impl.h console-x.h console.h events.h frame-impl.h frame.h frameslots.h gui.h opaque.h redisplay.h scrollbar.h systime.h window.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 charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dragdrop.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gutter.h objects-impl.h objects-x-impl.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar-x.h scrollbar.h specifier.h systime.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h xmu.h -glyphs-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h imgproc.h insdel.h lstream.h objects-impl.h objects-x-impl.h objects-x.h objects.h opaque.h process.h redisplay.h scrollbar.h specifier.h sysfile.h sysproc.h syssignal.h systime.h window-impl.h window.h winslots.h xintrinsic.h xmotif.h xmu.h -gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h events.h frame.h glyphs.h gui-x.h gui.h menubar.h opaque.h redisplay.h scrollbar.h specifier.h systime.h window-impl.h window.h winslots.h xintrinsic.h xmotif.h -intl-x.o: $(LISP_H) console-x.h console.h xintrinsic.h -menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h gui-x.h gui.h keymap.h menubar.h opaque.h redisplay.h scrollbar.h systime.h window-impl.h window.h winslots.h xintrinsic.h -objects-x.o: $(LISP_H) charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h insdel.h objects-impl.h objects-x-impl.h objects-x.h objects.h specifier.h xintrinsic.h +glyphs-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h imgproc.h insdel.h lstream.h objects-impl.h objects-x-impl.h objects-x.h objects.h opaque.h process.h redisplay.h scrollbar.h specifier.h sysfile.h sysproc.h syssignal.h systime.h window-impl.h window.h winslots.h xintrinsic.h xmotif.h xmu.h +gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h events.h frame.h glyphs.h gui.h menubar.h opaque.h redisplay.h scrollbar.h specifier.h systime.h window-impl.h window.h winslots.h xintrinsic.h xmotif.h +intl-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h console-x.h console.h xintrinsic.h +menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h gui.h keymap.h menubar.h opaque.h redisplay.h scrollbar.h systime.h window-impl.h window.h winslots.h xintrinsic.h +objects-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h insdel.h objects-impl.h objects-x-impl.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 charset.h chartab.h coding-system-slots.h conslots.h console-impl.h console-x-impl.h console-x.h console.h debug.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gutter.h mule-ccl.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysproc.h syssignal.h systime.h window-impl.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h -scrollbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h redisplay.h scrollbar-x.h scrollbar.h specifier.h window-impl.h window.h winslots.h xintrinsic.h -select-x.o: $(LISP_H) charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h frame-impl.h frame.h frameslots.h objects-x.h objects.h opaque.h redisplay.h select-common.h select.h systime.h xintrinsic.h xmotif.h +scrollbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h redisplay.h scrollbar-x.h scrollbar.h specifier.h window-impl.h window.h winslots.h xintrinsic.h +select-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h frame-impl.h frame.h frameslots.h objects-x.h objects.h opaque.h redisplay.h select-common.h select.h systime.h xintrinsic.h xmotif.h toolbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h charset.h conslots.h console-impl.h console-x-impl.h console-x.h console.h faces.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar-common.h toolbar.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h xgccache.o: $(LISP_H) hash.h xgccache.h #endif @@ -66,26 +66,26 @@ #if defined(HAVE_GTK) console-gtk.o: $(LISP_H) conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h process.h redisplay.h device-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h gccache-gtk.h glyphs-gtk.h glyphs.h gtk-xemacs.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systime.h window-impl.h window.h winslots.h -dialog-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h events.h frame.h gui-gtk.h gui.h opaque.h redisplay.h scrollbar.h systime.h window.h +dialog-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h events.h frame.h gui.h opaque.h redisplay.h scrollbar.h systime.h window.h emacs-marshals.o: hash.h emacs-widget-accessors.o: event-gtk.o: $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-tty.h console.h device-impl.h device.h devslots.h dragdrop.h elhash.h event-gtk.h event-xlike-inc.c events.h file-coding.h frame-impl.h frame.h frameslots.h gtk-xemacs.h lstream.h objects-gtk.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h sysproc.h syssignal.h systime.h systty.h window.h xintrinsic.h frame-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dragdrop.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h glyphs-gtk.h glyphs.h gtk-xemacs.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h sysdll.h systime.h ui-gtk.h window-impl.h window.h winslots.h gccache-gtk.o: $(LISP_H) gccache-gtk.h hash.h glade.o: bytecode.h -glyphs-gtk.o: $(LISP_H) bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-gtk.h glyphs.h gui-gtk.h gui.h imgproc.h insdel.h lstream.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysdll.h sysfile.h ui-gtk.h window-impl.h window.h winslots.h +glyphs-gtk.o: $(LISP_H) bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-gtk.h glyphs.h gui.h imgproc.h insdel.h lstream.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysdll.h sysfile.h ui-gtk.h window-impl.h window.h winslots.h gtk-glue.o: objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h specifier.h gtk-xemacs.o: $(LISP_H) charset.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h event-gtk.h faces.h frame-impl.h frame.h frameslots.h glyphs.h gtk-xemacs.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h -gui-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h frame.h gui-gtk.h gui.h opaque.h redisplay.h -menubar-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h gui-gtk.h gui.h menubar.h opaque.h redisplay.h scrollbar.h sysdll.h systime.h ui-gtk.h window-impl.h window.h winslots.h +gui-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h frame.h gui.h opaque.h redisplay.h +menubar-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h gui.h menubar.h opaque.h redisplay.h scrollbar.h sysdll.h systime.h ui-gtk.h window-impl.h window.h winslots.h native-gtk-toolbar.o: $(LISP_H) charset.h console-gtk.h console.h faces.h frame.h glyphs-gtk.h glyphs.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window-impl.h window.h winslots.h objects-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h insdel.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h specifier.h redisplay-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h debug.h device-impl.h device.h devslots.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gccache-gtk.h glyphs-gtk.h glyphs.h gutter.h mule-ccl.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysproc.h syssignal.h systime.h window-impl.h window.h winslots.h -scrollbar-gtk.o: $(LISP_H) conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h frame-impl.h frame.h frameslots.h glyphs-gtk.h glyphs.h gui-gtk.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h window-impl.h window.h winslots.h +scrollbar-gtk.o: $(LISP_H) conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h frame-impl.h frame.h frameslots.h glyphs-gtk.h glyphs.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h window-impl.h window.h winslots.h select-gtk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h events.h frame.h opaque.h redisplay.h select-common.h select.h systime.h toolbar-gtk.o: $(LISP_H) conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h frame.h redisplay.h toolbar-common.h ui-byhand.o: gui.h -ui-gtk.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h console-gtk.h console.h device.h elhash.h emacs-marshals.c emacs-widget-accessors.c event-gtk.h events.h faces.h glade.c glyphs-gtk.h glyphs.h gtk-glue.c gui-gtk.h gui.h hash.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h sysdll.h systime.h ui-byhand.c ui-gtk.h window-impl.h window.h winslots.h +ui-gtk.o: $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h console-gtk.h console.h device.h elhash.h emacs-marshals.c emacs-widget-accessors.c event-gtk.h events.h faces.h glade.c glyphs-gtk.h glyphs.h gtk-glue.c gui.h hash.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h sysdll.h systime.h ui-byhand.c ui-gtk.h window-impl.h window.h winslots.h #endif #if defined(HAVE_DATABASE) database.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h database.h sysfile.h @@ -168,9 +168,9 @@ hpplay.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h sound.h imgproc.o: $(LISP_H) imgproc.h indent.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h device.h extents.h faces.h frame.h glyphs.h insdel.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h -inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-gtk.h console-impl.h console-msw.h console.h database.h device-impl.h device.h devslots.h elhash.h events.h extents-impl.h extents.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h intl-auto-encap-win32.h keymap.h lstream.h objects-impl.h objects.h opaque.h process.h rangetab.h redisplay.h scrollbar.h specifier.h syntax.h sysdll.h sysfile.h systime.h syswindows.h toolbar.h tooltalk.h ui-gtk.h window-impl.h window.h winslots.h xintrinsic.h -input-method-motif.o: $(LISP_H) EmacsFrame.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device.h frame-impl.h frame.h frameslots.h redisplay.h xintrinsic.h xmotif.h -input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h redisplay.h scrollbar.h systime.h window-impl.h window.h winslots.h xintrinsic.h +inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h conslots.h console-gtk.h console-impl.h console-msw.h console.h database.h device-impl.h device.h devslots.h elhash.h events.h extents-impl.h extents.h faces.h file-coding.h frame-impl.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h intl-auto-encap-win32.h keymap.h lstream.h objects-impl.h objects.h opaque.h process.h rangetab.h redisplay.h scrollbar.h specifier.h syntax.h sysdll.h sysfile.h systime.h syswindows.h toolbar.h tooltalk.h ui-gtk.h window-impl.h window.h winslots.h xintrinsic.h +input-method-motif.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device.h frame-impl.h frame.h frameslots.h redisplay.h xintrinsic.h xmotif.h +input-method-xlib.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h redisplay.h scrollbar.h systime.h window-impl.h window.h winslots.h xintrinsic.h insdel.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h console.h device.h extents.h frame.h insdel.h line-number.h lstream.h redisplay.h intl-auto-encap-win32.o: $(LISP_H) intl-auto-encap-win32.h syswindows.h intl-encap-win32.o: $(LISP_H) console-msw.h console.h intl-auto-encap-win32.h syswindows.h @@ -215,7 +215,7 @@ sgiplay.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h libst.h sound.h sysfile.h sysproc.h syssignal.h systime.h sheap.o: $(LISP_H) sheap-adjust.h sysfile.h signal.o: $(LISP_H) conslots.h console-impl.h console.h device-impl.h device.h devslots.h events.h frame-impl.h frame.h frameslots.h process.h redisplay.h sysdep.h sysfile.h syssignal.h systime.h -sound.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h intl-auto-encap-win32.h redisplay.h sound.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h xintrinsic.h +sound.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h intl-auto-encap-win32.h redisplay.h sound.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h xintrinsic.h specifier.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h frame.h glyphs.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h window-impl.h window.h winslots.h strcat.o: $(CONFIG_H) strcmp.o: $(CONFIG_H) @@ -231,7 +231,7 @@ terminfo.o: $(CONFIG_H) tests.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h elhash.h lstream.h opaque.h text.o: $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h file-coding.h lstream.h profile.h -toolbar-common.o: $(LISP_H) charset.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h faces.h frame-impl.h frame.h frameslots.h glyphs.h redisplay.h scrollbar.h specifier.h toolbar-common.h toolbar.h window-impl.h window.h winslots.h xintrinsic.h +toolbar-common.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h faces.h frame-impl.h frame.h frameslots.h glyphs.h redisplay.h scrollbar.h specifier.h toolbar-common.h toolbar.h window-impl.h window.h winslots.h xintrinsic.h toolbar.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h frame-impl.h frame.h frameslots.h glyphs.h redisplay.h scrollbar.h specifier.h toolbar.h window-impl.h window.h winslots.h tooltalk.o: $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h elhash.h process.h syssignal.h tooltalk.h tparam.o: $(LISP_H)
--- a/src/device-msw.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/device-msw.c Sun Mar 09 02:27:46 2003 +0000 @@ -79,6 +79,19 @@ sizeof (struct mswindows_device), mswindows_device_data_description_1 }; +static const struct memory_description msprinter_device_data_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct msprinter_device, name) }, + { XD_LISP_OBJECT, offsetof (struct msprinter_device, devmode) }, + { XD_LISP_OBJECT, offsetof (struct msprinter_device, fontlist) }, + { XD_END } +}; + +extern const struct sized_memory_description msprinter_device_data_description; + +const struct sized_memory_description msprinter_device_data_description = { + sizeof (struct msprinter_device), msprinter_device_data_description_1 +}; + static Lisp_Object allocate_devmode (DEVMODEW *src_devmode, int do_copy, Lisp_Object src_name, struct device *d);
--- a/src/device.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/device.c Sun Mar 09 02:27:46 2003 +0000 @@ -87,6 +87,7 @@ extern const struct sized_memory_description gtk_device_data_description; extern const struct sized_memory_description mswindows_device_data_description; +extern const struct sized_memory_description msprinter_device_data_description; extern const struct sized_memory_description x_device_data_description; static const struct memory_description device_data_description_1 []= { @@ -95,6 +96,7 @@ #endif #ifdef HAVE_MS_WINDOWS { XD_STRUCT_PTR, mswindows_console, 1, &mswindows_device_data_description}, + { XD_STRUCT_PTR, msprinter_console, 1, &msprinter_device_data_description}, #endif #ifdef HAVE_X_WINDOWS { XD_STRUCT_PTR, x_console, 1, &x_device_data_description},
--- a/src/dialog-gtk.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/dialog-gtk.c Sun Mar 09 02:27:46 2003 +0000 @@ -33,9 +33,7 @@ #include "window.h" #include "console-impl.h" -#include "console-gtk.h" #include "console-gtk-impl.h" -#include "gui-gtk.h" Lisp_Object Qgtk_make_dialog_box_internal;
--- a/src/dialog-x.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/dialog-x.c Sun Mar 09 02:27:46 2003 +0000 @@ -1,7 +1,7 @@ /* Implements elisp-programmable dialog boxes -- X interface. Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Tinker Systems and INS Engineering Corp. - Copyright (C) 2000, 2002 Ben Wing. + Copyright (C) 2000, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -36,7 +36,6 @@ #include "window.h" #include "console-x-impl.h" -#include "gui-x.h" #include "EmacsFrame.h"
--- a/src/emacs.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/emacs.c Sun Mar 09 02:27:46 2003 +0000 @@ -3702,8 +3702,8 @@ were in the middle of doing something */ /* debugging_breakpoint (); */ #if !defined (ASSERTIONS_DONT_ABORT) -#ifdef _MSC_VER - /* Calling abort() directly just seems to exit, in a way we can't +#if defined (_MSC_VER) || defined (CYGWIN) + /* In VC++, calling abort() directly just seems to exit, in a way we can't trap. (#### The docs say it does raise (SIGABRT), which we should be able to trap. Perhaps we're messing up somewhere? Or perhaps MS is messed up.) @@ -3720,12 +3720,14 @@ software exception ..." without the obvious "OK to terminate", "Cancel to debug"; instead, you just get OK/Cancel, which in fact do those same things. */ + /* In Cygwin, abort() doesn't get trapped properly in gdb but seg faults + do, so we resort to the same trick. */ * ((int *) 0) = 666; /* RaiseException (STATUS_ASSERTION_FAILURE, EXCEPTION_NONCONTINUABLE, 0, 0); */ #else really_abort (); -#endif /* _MSC_VER */ +#endif /* defined (_MSC_VER) || defined (CYGWIN) */ #endif /* !defined (ASSERTIONS_DONT_ABORT) */ inhibit_non_essential_printing_operations = 0; in_assert_failed = 0;
--- a/src/event-msw.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/event-msw.c Sun Mar 09 02:27:46 2003 +0000 @@ -83,7 +83,6 @@ #ifdef HAVE_MENUBARS # include "menubar.h" -# include "menubar-msw.h" #endif #ifdef HAVE_DRAGNDROP
--- a/src/frame-gtk.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/frame-gtk.c Sun Mar 09 02:27:46 2003 +0000 @@ -1,6 +1,6 @@ /* Functions for the X window system. Copyright (C) 1989, 1992-5, 1997 Free Software Foundation, Inc. - Copyright (C) 1995, 1996, 2002 Ben Wing. + Copyright (C) 1995, 1996, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -98,6 +98,7 @@ { XD_LISP_OBJECT, offsetof (struct gtk_frame, icon_pixmap_mask) }, { XD_LISP_OBJECT_ARRAY, offsetof (struct gtk_frame, lisp_visible_widgets), 3 }, + { XD_LISP_OBJECT, offsetof (struct gtk_frame, menubar_data) }, { XD_END } }; @@ -942,12 +943,17 @@ static void allocate_gtk_frame_struct (struct frame *f) { + int i; + /* zero out all slots. */ f->frame_data = xnew_and_zero (struct gtk_frame); /* yeah, except the lisp ones */ FRAME_GTK_ICON_PIXMAP (f) = Qnil; FRAME_GTK_ICON_PIXMAP_MASK (f) = Qnil; + FRAME_GTK_MENUBAR_DATA (f) = Qnil; + for (i = 0; i < 3; i++) + FRAME_GTK_LISP_WIDGETS (f)[i] = Qnil; } @@ -1031,6 +1037,7 @@ { mark_object (FRAME_GTK_ICON_PIXMAP (f)); mark_object (FRAME_GTK_ICON_PIXMAP_MASK (f)); + mark_object (FRAME_GTK_MENUBAR_DATA (f)); mark_object (FRAME_GTK_LISP_WIDGETS (f)[0]); mark_object (FRAME_GTK_LISP_WIDGETS (f)[1]); mark_object (FRAME_GTK_LISP_WIDGETS (f)[2]);
--- a/src/frame-x.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/frame-x.c Sun Mar 09 02:27:46 2003 +0000 @@ -70,6 +70,7 @@ Lisp_Object Qx_resource_name; static const struct memory_description x_frame_data_description_1 [] = { + { XD_LISP_OBJECT, offsetof (struct x_frame, last_menubar_buffer) }, { XD_LISP_OBJECT, offsetof (struct x_frame, icon_pixmap) }, { XD_LISP_OBJECT, offsetof (struct x_frame, icon_pixmap_mask) }, { XD_END } @@ -2119,6 +2120,7 @@ f->frame_data = xnew_and_zero (struct x_frame); /* yeah, except the lisp ones */ + FRAME_X_LAST_MENUBAR_BUFFER (f) = Qnil; FRAME_X_ICON_PIXMAP (f) = Qnil; FRAME_X_ICON_PIXMAP_MASK (f) = Qnil; } @@ -2194,6 +2196,7 @@ static void x_mark_frame (struct frame *f) { + mark_object (FRAME_X_LAST_MENUBAR_BUFFER (f)); mark_object (FRAME_X_ICON_PIXMAP (f)); mark_object (FRAME_X_ICON_PIXMAP_MASK (f)); }
--- a/src/frameslots.h Sat Mar 08 22:52:26 2003 +0000 +++ b/src/frameslots.h Sun Mar 09 02:27:46 2003 +0000 @@ -1,6 +1,6 @@ /* Definitions of marked slots in frames Copyright (C) 1988, 1992, 1993, 1994 Free Software Foundation, Inc. - Copyright (C) 1996, 2002 Ben Wing. + Copyright (C) 1996, 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -118,11 +118,6 @@ /* The current icon for the frame. */ MARKED_SLOT (icon) -#ifdef HAVE_MENUBARS - /* Vector representing the menubar currently displayed. See menubar-x.c. */ - MARKED_SLOT (menubar_data) -#endif - /* specifier values cached in the struct frame: */ #ifdef HAVE_MENUBARS
--- a/src/glyphs-gtk.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/glyphs-gtk.c Sun Mar 09 02:27:46 2003 +0000 @@ -65,7 +65,6 @@ #include "console-gtk-impl.h" #include "glyphs-gtk.h" -#include "gui-gtk.h" #include "objects-gtk-impl.h" #include "ui-gtk.h"
--- a/src/glyphs-x.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/glyphs-x.c Sun Mar 09 02:27:46 2003 +0000 @@ -69,9 +69,6 @@ #include "console-x-impl.h" #include "glyphs-x.h" -#ifdef HAVE_X_WIDGETS -#include "gui-x.h" -#endif #include "objects-x-impl.h" #include "xmu.h" @@ -2202,9 +2199,9 @@ } /* now modify the widget */ - lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), - wv, True); + lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), wv, True); free_widget_value_tree (wv); + gcpro_popup_callbacks (IMAGE_INSTANCE_X_WIDGET_LWID (p)); #endif } @@ -2574,9 +2571,9 @@ IMAGE_INSTANCE_WIDGET_ITEMS (p), 1); /* now modify the widget */ - lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), - wv, True); + lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), wv, True); free_widget_value_tree (wv); + gcpro_popup_callbacks (IMAGE_INSTANCE_X_WIDGET_LWID (p)); } /* get properties of a button */ @@ -2766,6 +2763,7 @@ lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (ii), wv, True); free_widget_value_tree (wv); + gcpro_popup_callbacks (IMAGE_INSTANCE_X_WIDGET_LWID (ii)); } }
--- a/src/gui-gtk.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/gui-gtk.c Sun Mar 09 02:27:46 2003 +0000 @@ -33,7 +33,6 @@ #include "opaque.h" #include "console-gtk-impl.h" -#include "gui-gtk.h" #ifdef HAVE_POPUPS Lisp_Object Qmenu_no_selection_hook;
--- a/src/gui-gtk.h Sat Mar 08 22:52:26 2003 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* General GUI code -- X-specific header file. - Copyright (C) 1993, 1994 Free Software Foundation, Inc. - Copyright (C) 1996 Ben Wing. - -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 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 XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: Not in FSF. */ - -#ifndef _XEMACS_GUI_GTK_H_ -#define _XEMACS_GUI_GTK_H_ - -#include <gtk/gtk.h> - -typedef unsigned int GUI_ID; -extern GUI_ID new_gui_id (void); - -extern void gcpro_popup_callbacks (GUI_ID id, Lisp_Object data); -extern void ungcpro_popup_callbacks (GUI_ID id); -extern Lisp_Object get_gcpro_popup_callbacks (GUI_ID id); - -#endif /* _XEMACS_GUI_GTK_H_ */
--- a/src/gui-x.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/gui-x.c Sun Mar 09 02:27:46 2003 +0000 @@ -39,7 +39,6 @@ #include "redisplay.h" #include "console-x-impl.h" -#include "gui-x.h" #ifdef LWLIB_USES_MOTIF #include "xmotif.h" /* for XmVersion */ @@ -51,7 +50,10 @@ LWLIB_ID new_lwlib_id (void) { - return ++lwlib_id_tick; + lwlib_id_tick++; + if (!lwlib_id_tick) + lwlib_id_tick++; + return lwlib_id_tick; } widget_value * @@ -63,93 +65,75 @@ } -static Lisp_Object -mark_popup_data (Lisp_Object obj) -{ - struct popup_data *data = (struct popup_data *) XPOPUP_DATA (obj); - - mark_object (data->last_menubar_buffer); - return data->protect_me; -} + +/* This contains an alist of (id . protect-me) for GCPRO'ing the callbacks + of the popup menus and dialog boxes. */ +static Lisp_Object Vpopup_callbacks; -static const struct memory_description popup_data_description [] = { - { XD_LISP_OBJECT, offsetof (struct popup_data, last_menubar_buffer) }, - { XD_LISP_OBJECT, offsetof (struct popup_data, protect_me) }, - { XD_END } +struct widget_value_mapper +{ + Lisp_Object protect_me; }; -DEFINE_LRECORD_IMPLEMENTATION ("popup-data", popup_data, - 0, /*dumpable-flag*/ - mark_popup_data, internal_object_printer, - 0, 0, 0, - popup_data_description, - struct popup_data); - -/* This is like FRAME_MENUBAR_DATA (f), but contains an alist of - (id . popup-data) for GCPRO'ing the callbacks of the popup menus - and dialog boxes. */ -static Lisp_Object Vpopup_callbacks; - static int snarf_widget_value_mapper (widget_value *val, void *closure) { - struct popup_data *pdata = (struct popup_data *) closure; + struct widget_value_mapper *z = (struct widget_value_mapper *) closure; if (val->call_data) - pdata->protect_me = Fcons (VOID_TO_LISP (val->call_data), - pdata->protect_me); + z->protect_me = Fcons (VOID_TO_LISP (val->call_data), z->protect_me); if (val->accel) - pdata->protect_me = Fcons (VOID_TO_LISP (val->accel), - pdata->protect_me); + z->protect_me = Fcons (VOID_TO_LISP (val->accel), z->protect_me); return 0; } /* Snarf the callbacks and other Lisp data that are hidden in the lwlib - call-data and accel and stick them into POPUP-DATA for proper marking. */ + call-data and accel associated with id ID and return them for + proper marking. */ -void -snarf_widget_values_for_gcpro (Lisp_Object popup_data) +static Lisp_Object +snarf_widget_values_for_gcpro (LWLIB_ID id) { - struct popup_data *pdata = XPOPUP_DATA (popup_data); + struct widget_value_mapper z; - free_list (pdata->protect_me); - pdata->protect_me = Qnil; + z.protect_me = Qnil; + lw_map_widget_values (id, snarf_widget_value_mapper, &z); + return z.protect_me; +} - if (pdata->id) - lw_map_widget_values (pdata->id, snarf_widget_value_mapper, pdata); -} +/* Given an lwlib id ID associated with a widget tree, make sure that all + Lisp callbacks in the tree are GC-protected. This can be called + multiple times on the same widget tree -- this should be done at + creation time and each time the tree is modified. */ void gcpro_popup_callbacks (LWLIB_ID id) { - struct popup_data *pdata; Lisp_Object lid = make_int (id); - Lisp_Object lpdata; + Lisp_Object this = assq_no_quit (lid, Vpopup_callbacks); - assert (NILP (assq_no_quit (lid, Vpopup_callbacks))); - pdata = alloc_lcrecord_type (struct popup_data, &lrecord_popup_data); - pdata->id = id; - pdata->last_menubar_buffer = Qnil; - pdata->protect_me = Qnil; - pdata->menubar_contents_up_to_date = 0; - lpdata = wrap_popup_data (pdata); + if (!NILP (this)) + { + free_list (XCDR (this)); + XCDR (this) = snarf_widget_values_for_gcpro (id); + } + else + Vpopup_callbacks = Fcons (Fcons (lid, snarf_widget_values_for_gcpro (id)), + Vpopup_callbacks); +} - snarf_widget_values_for_gcpro (lpdata); - - Vpopup_callbacks = Fcons (Fcons (lid, lpdata), Vpopup_callbacks); -} +/* Remove GC-protection from the just-destroyed widget tree associated + with lwlib id ID. */ void ungcpro_popup_callbacks (LWLIB_ID id) { - struct popup_data *pdata; Lisp_Object lid = make_int (id); Lisp_Object this = assq_no_quit (lid, Vpopup_callbacks); + assert (!NILP (this)); - pdata = XPOPUP_DATA (XCDR (this)); - free_list (pdata->protect_me); - pdata->protect_me = Qnil; + free_list (XCDR (this)); Vpopup_callbacks = delq_no_quit (this, Vpopup_callbacks); } @@ -692,7 +676,6 @@ void syms_of_gui_x (void) { - INIT_LRECORD_IMPLEMENTATION (popup_data); } void
--- a/src/gui-x.h Sat Mar 08 22:52:26 2003 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* General GUI code -- X-specific header file. - Copyright (C) 1993, 1994 Free Software Foundation, Inc. - Copyright (C) 1996, 2000, 2002, 2003 Ben Wing. - -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 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 XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: Not in FSF. */ - -/* This file Mule-ized by Ben Wing, 7-8-00. */ - -#ifndef INCLUDED_gui_x_h_ -#define INCLUDED_gui_x_h_ - -#include "../lwlib/lwlib.h" - -widget_value *xmalloc_widget_value (void); - -LWLIB_ID new_lwlib_id (void); - -/* Each frame has one of these, and they are also contained in - Vpopup_callbacks. - It doesn't really need to be an lrecord (it's not lisp-accessible) - but it makes marking slightly more modular. - */ - -struct popup_data -{ - struct lcrecord_header header; - - /* lwlib ID of the tree of widgets corresponding to this popup. We pass - this to lw_map_widget_values() to retrieve all of our Lispy call-data - and accel values that need to be GCPRO'd, and store them in the - following list. (We used to call lw_map_widget_values() during GC - mark, but that isn't compatible with KKCC.) */ - LWLIB_ID id; - - /* List of GC-protected objects. */ - Lisp_Object protect_me; - - /* For the frame popup data, this is the last buffer for which the - menubar was displayed. If the buffer has changed, we may have to - update things. */ - Lisp_Object last_menubar_buffer; - - /* This flag tells us if the menubar contents are up-to-date with respect - to the current menubar structure. If we want to actually pull down a - menu and this is false, then we need to update things. */ - char menubar_contents_up_to_date; -}; - -DECLARE_LRECORD (popup_data, struct popup_data); -#define XPOPUP_DATA(x) XRECORD (x, popup_data, struct popup_data) -#define wrap_popup_data(p) wrap_record (p, popup_data) -#define POPUP_DATAP(x) RECORDP (x, popup_data) -#define CHECK_POPUP_DATA(x) CHECK_RECORD (x, popup_data) - -void snarf_widget_values_for_gcpro (Lisp_Object popup_data); -void gcpro_popup_callbacks (LWLIB_ID id); -void ungcpro_popup_callbacks (LWLIB_ID id); -int popup_handled_p (LWLIB_ID id); -void free_popup_widget_value_tree (widget_value *wv); -void popup_selection_callback (Widget widget, LWLIB_ID ignored_id, - XtPointer client_data); -Extbyte *add_accel_and_to_external (Lisp_Object string); -int button_item_to_widget_value (Lisp_Object gui_object_instance, - Lisp_Object gui_item, widget_value *wv, - int allow_text_field_p, int no_keys_p, - int menu_entry_p, int accel_p); -widget_value * gui_items_to_widget_values (Lisp_Object gui_object_instance, - Lisp_Object items, int accel_p); -Extbyte *menu_separator_style_and_to_external (const Ibyte *s); -Lisp_Object widget_value_unwind (Lisp_Object closure); - -#endif /* INCLUDED_gui_x_h_ */
--- a/src/inline.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/inline.c Sun Mar 09 02:27:46 2003 +0000 @@ -89,7 +89,6 @@ #ifdef HAVE_X_WINDOWS #include "glyphs-x.h" -#include "gui-x.h" #endif #ifdef HAVE_MS_WINDOWS
--- a/src/lisp.h Sat Mar 08 22:52:26 2003 +0000 +++ b/src/lisp.h Sun Mar 09 02:27:46 2003 +0000 @@ -4541,6 +4541,7 @@ void stderr_out (const CIbyte *, ...) PRINTF_ARGS (1, 2); void stderr_out_lisp (const CIbyte *, int nargs, ...); void stdout_out (const CIbyte *, ...) PRINTF_ARGS (1, 2); +void external_out (int dest, const CIbyte *fmt, ...) PRINTF_ARGS (2, 3); void debug_out (const CIbyte *, ...) PRINTF_ARGS (1, 2); DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (fatal (const CIbyte *, ...), 1, 2);
--- a/src/menubar-gtk.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/menubar-gtk.c Sun Mar 09 02:27:46 2003 +0000 @@ -1,7 +1,7 @@ /* Implements an elisp-programmable menubar -- X interface. Copyright (C) 1993, 1994 Free Software Foundation, Inc. Copyright (C) 1995 Tinker Systems and INS Engineering Corp. - Copyright (C) 2002 Ben Wing. + Copyright (C) 2002, 2003 Ben Wing. This file is part of XEmacs. @@ -29,9 +29,8 @@ #include "buffer.h" #include "commands.h" /* zmacs_regions */ -#include "device.h" +#include "device-impl.h" #include "events.h" -#include "device-impl.h" #include "frame-impl.h" #include "gui.h" #include "opaque.h" @@ -39,7 +38,6 @@ #include "window-impl.h" #include "console-gtk-impl.h" -#include "gui-gtk.h" #include "ui-gtk.h" #include "menubar.h" @@ -53,9 +51,9 @@ static GtkWidget *menu_descriptor_to_widget_1 (Lisp_Object descr); -#define FRAME_MENUBAR_DATA(frame) ((frame)->menubar_data) -#define XFRAME_MENUBAR_DATA_LASTBUFF(frame) (XCAR ((frame)->menubar_data)) -#define XFRAME_MENUBAR_DATA_UPTODATE(frame) (XCDR ((frame)->menubar_data)) +#define FRAME_GTK_MENUBAR_DATA(f) (FRAME_GTK_DATA (f)->menubar_data) +#define XFRAME_GTK_MENUBAR_DATA_LASTBUFF(f) XCAR (FRAME_GTK_MENUBAR_DATA (f)) +#define XFRAME_GTK_MENUBAR_DATA_UPTODATE(f) XCDR (FRAME_GTK_MENUBAR_DATA (f)) /* This is a bogus subclass of GtkMenuBar so that the menu never tries @@ -1126,7 +1124,7 @@ unbind_to (count); } - FRAME_MENUBAR_DATA (f) = Fcons (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer, Qt); + FRAME_GTK_MENUBAR_DATA (f) = Fcons (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer, Qt); return (menubar_visible); } @@ -1152,8 +1150,8 @@ */ int menubar_contents_changed = (f->menubar_changed - || NILP (FRAME_MENUBAR_DATA (f)) - || (!EQ (XFRAME_MENUBAR_DATA_LASTBUFF (f), + || NILP (FRAME_GTK_MENUBAR_DATA (f)) + || (!EQ (XFRAME_GTK_MENUBAR_DATA_LASTBUFF (f), XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer))); gboolean menubar_was_visible = GTK_WIDGET_VISIBLE (FRAME_GTK_MENUBAR_WIDGET (f));
--- a/src/menubar-msw.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/menubar-msw.c Sun Mar 09 02:27:46 2003 +0000 @@ -91,7 +91,6 @@ #include "gui.h" #include "lisp.h" #include "menubar.h" -#include "menubar-msw.h" #include "opaque.h" #include "window-impl.h"
--- a/src/menubar-msw.h Sat Mar 08 22:52:26 2003 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* Implements an elisp-programmable menubar -- Win32 - Copyright (C) 1993, 1994 Free Software Foundation, Inc. - Copyright (C) 1995 Tinker Systems and INS Engineering Corp. - Copyright (C) 1997 Kirill M. Katsnelson <kkm@kis.ru> - -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 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 XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* Synched up with: Not in FSF. */ - -/* Author: - Initially written by kkm 12/24/97, - */ - -#ifndef INCLUDED_menubar_msw_h_ -#define INCLUDED_menubar_msw_h_ - - -#ifdef HAVE_MENUBARS - -/* Message handlers. Called from window procedure */ -Lisp_Object mswindows_handle_wm_initmenupopup (HMENU hmenu, struct frame *frm); -Lisp_Object mswindows_handle_wm_initmenu (HMENU hmenu, struct frame *f); -Lisp_Object mswindows_handle_wm_command (struct frame *f, WORD command); - -#endif /* HAVE_MENUBARS */ - -#endif /* INCLUDED_menubar_msw_h_ */ -
--- a/src/menubar-x.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/menubar-x.c Sun Mar 09 02:27:46 2003 +0000 @@ -48,7 +48,6 @@ #include "window-impl.h" #include "console-x-impl.h" -#include "gui-x.h" #include "EmacsFrame.h" #include "../lwlib/lwlib.h" @@ -57,9 +56,6 @@ int deep_p, int first_time_p); -#define FRAME_MENUBAR_DATA(frame) ((frame)->menubar_data) -#define XFRAME_MENUBAR_DATA(frame) XPOPUP_DATA ((frame)->menubar_data) - #define MENUBAR_TYPE 0 #define SUBMENU_TYPE 1 #define POPUP_TYPE 2 @@ -481,9 +477,9 @@ /* Now that we've destructively modified part of the widget value hierarchy, our list of protected callbacks will no longer be valid, so we need to recompute it. */ - snarf_widget_values_for_gcpro (FRAME_MENUBAR_DATA (f)); + gcpro_popup_callbacks (FRAME_X_MENUBAR_ID (f)); } - else if (!POPUP_DATAP (FRAME_MENUBAR_DATA (f))) + else if (!FRAME_X_MENUBAR_ID (f)) return; else { @@ -565,21 +561,12 @@ if (!data || (!data->next && !data->contents)) abort (); - if (NILP (FRAME_MENUBAR_DATA (f))) - { - struct popup_data *mdata = - alloc_lcrecord_type (struct popup_data, &lrecord_popup_data); - - mdata->id = new_lwlib_id (); - mdata->last_menubar_buffer = Qnil; - mdata->protect_me = Qnil; - mdata->menubar_contents_up_to_date = 0; - FRAME_MENUBAR_DATA (f) = wrap_popup_data (mdata); - } + if (!FRAME_X_MENUBAR_ID (f)) + FRAME_X_MENUBAR_ID (f) = new_lwlib_id (); /***** now store into the menubar widget, creating it if necessary *****/ - id = XFRAME_MENUBAR_DATA (f)->id; + id = FRAME_X_MENUBAR_ID (f); if (!FRAME_X_MENUBAR_WIDGET (f)) { Widget parent = FRAME_X_CONTAINER_WIDGET (f); @@ -612,10 +599,10 @@ have been freshly created. They need to be GC-protected, so snarf them now and record them into the popup-data object associated with the frame. */ - snarf_widget_values_for_gcpro (FRAME_MENUBAR_DATA (f)); + gcpro_popup_callbacks (id); - XFRAME_MENUBAR_DATA (f)->menubar_contents_up_to_date = deep_p; - XFRAME_MENUBAR_DATA (f)->last_menubar_buffer = + FRAME_X_MENUBAR_CONTENTS_UP_TO_DATE (f) = deep_p; + FRAME_X_LAST_MENUBAR_BUFFER (f) = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer; return menubar_visible; } @@ -721,8 +708,8 @@ */ int menubar_contents_changed = (f->menubar_changed - || NILP (FRAME_MENUBAR_DATA (f)) - || (!EQ (XFRAME_MENUBAR_DATA (f)->last_menubar_buffer, + || !FRAME_X_MENUBAR_ID (f) + || (!EQ (FRAME_X_LAST_MENUBAR_BUFFER (f), XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f))->buffer))); Boolean menubar_was_visible = XtIsManaged (FRAME_X_MENUBAR_WIDGET (f)); @@ -765,9 +752,10 @@ menubar_widget = FRAME_X_MENUBAR_WIDGET (f); if (menubar_widget) { - LWLIB_ID id = XFRAME_MENUBAR_DATA (f)->id; + LWLIB_ID id = FRAME_X_MENUBAR_ID (f); lw_destroy_all_widgets (id); - XFRAME_MENUBAR_DATA (f)->id = 0; + ungcpro_popup_callbacks (id); + FRAME_X_MENUBAR_ID (f) = 0; } } @@ -1234,7 +1222,7 @@ Lisp_Object matchp; widget_value *val; - LWLIB_ID id = XPOPUP_DATA (f->menubar_data)->id; + LWLIB_ID id = FRAME_X_MENUBAR_ID (f); val = lw_get_all_values (id); if (val) @@ -1323,10 +1311,10 @@ LWLIB_ID id; widget_value *val; - if (NILP (f->menubar_data)) + if (!FRAME_X_MENUBAR_ID (f)) invalid_argument ("Frame has no menubar", Qunbound); - id = XPOPUP_DATA (f->menubar_data)->id; + id = FRAME_X_MENUBAR_ID (f); val = lw_get_all_values (id); val = val->contents; lw_set_menu (FRAME_X_MENUBAR_WIDGET (f), val);
--- a/src/nas.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/nas.c Sun Mar 09 02:27:46 2003 +0000 @@ -852,7 +852,7 @@ fileSize = PAD2(ck.ckSize) - sizeof(RIFF_FOURCC); - while (fileSize >= sizeof(RiffChunk)) + while (fileSize >= (AuInt32) sizeof(RiffChunk)) { if (!readChunk(&ck)) Err();
--- a/src/print.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/print.c Sun Mar 09 02:27:46 2003 +0000 @@ -116,19 +116,20 @@ FILE *termscript; /* Stdio stream being used for copy of all output. */ -static void write_string_to_alternate_debugging_output (Ibyte *str, +static void write_string_to_alternate_debugging_output (const Ibyte *str, Bytecount len); int stdout_needs_newline; +int stdout_clear_before_next_output; /* Basic function to actually write to a stdio stream or TTY console. */ static void -write_string_to_stdio_stream (FILE *stream, struct console *con, - const Ibyte *ptr, Bytecount len, - int must_flush) +write_string_to_stdio_stream_1 (FILE *stream, struct console *con, + const Ibyte *ptr, Bytecount len, + int must_flush) { Extbyte *extptr = 0; Bytecount extlen = 0; @@ -187,15 +188,74 @@ retry_fwrite (extptr, 1, extlen, termscript); fflush (termscript); } - stdout_needs_newline = (ptr[extlen - 1] != '\n'); + stdout_needs_newline = (ptr[len - 1] != '\n'); } } -/* #### The following function should be replaced a call to the - emacs_vsprintf_*() functions. This is the only way to ensure that - I18N3 works properly (many implementations of the *printf() - functions, including the ones included in glibc, do not implement - the %###$ argument-positioning syntax). +/* Write to a stdio stream or TTY console, first clearing the left side + if necessary. */ + +static void +write_string_to_stdio_stream (FILE *stream, struct console *con, + const Ibyte *ptr, Bytecount len, + int must_flush) +{ + if (stdout_clear_before_next_output && + (stream ? stream == stdout || stream == stderr : + CONSOLE_TTY_DATA (con)->is_stdio)) + { + if (stdout_needs_newline) + write_string_to_stdio_stream_1 (stream, con, (Ibyte *) "\n", 1, + must_flush); + stdout_clear_before_next_output = 0; + } + + write_string_to_stdio_stream_1 (stream, con, ptr, len, must_flush); +} + +/* + EXT_PRINT_STDOUT = stdout or its equivalent (may be a + console window under MS Windows) + EXT_PRINT_STDERR = stderr or its equivalent (may be a + console window under MS Windows) + EXT_PRINT_ALTERNATE = an internal character array; see + `alternate-debugging-output' + EXT_PRINT_MSWINDOWS = Under MS Windows, the "debugging output" that + debuggers can hook into; uses OutputDebugString() + system call + EXT_PRINT_ALL = all of the above except stdout +*/ + +enum ext_print + { + EXT_PRINT_STDOUT = 1, + EXT_PRINT_STDERR = 2, + EXT_PRINT_ALTERNATE = 4, + EXT_PRINT_MSWINDOWS = 8, + EXT_PRINT_ALL = 14 + }; + +static void +write_string_to_external_output (const Ibyte *ptr, Bytecount len, + int dest) +{ + if (dest & EXT_PRINT_STDOUT) + write_string_to_stdio_stream (stdout, 0, ptr, len, 1); + if (dest & EXT_PRINT_STDERR) + write_string_to_stdio_stream (stderr, 0, ptr, len, 1); + if (dest & EXT_PRINT_ALTERNATE) + write_string_to_alternate_debugging_output (ptr, len); +#ifdef WIN32_NATIVE + if (dest & EXT_PRINT_MSWINDOWS) + write_string_to_mswindows_debugging_output (ptr, len); +#endif +} + +/* #### The following function should make use of a call to the + emacs_vsprintf_*() functions rather than just using vsprintf. This is + the only way to ensure that I18N3 works properly (many implementations + of the *printf() functions, including the ones included in glibc, do not + implement the %###$ argument-positioning syntax). Note, however, that to do this, we'd have to @@ -204,11 +264,14 @@ called from fatal_error_signal(). 2) (to be really correct) make a new lstream that outputs using - mswindows_output_console_string(). */ + mswindows_output_console_string(). + + 3) A reasonable compromise might be to use emacs_vsprintf() when we're + in a safe state, and when not, use plain vsprintf(). */ static void -std_handle_out_va (FILE *stream, const CIbyte *fmt, va_list args, - int debug_output_as_well) +write_string_to_external_output_va (const CIbyte *fmt, va_list args, + int dest) { Ibyte kludge[8192]; Bytecount kludgelen; @@ -217,15 +280,7 @@ fmt = GETTEXT (fmt); vsprintf ((CIbyte *) kludge, fmt, args); kludgelen = qxestrlen (kludge); - - write_string_to_stdio_stream (stream, 0, kludge, kludgelen, 1); - if (debug_output_as_well) - { - write_string_to_alternate_debugging_output (kludge, kludgelen); -#ifdef WIN32_NATIVE - write_string_to_mswindows_debugging_output (kludge, kludgelen); -#endif - } + write_string_to_external_output (kludge, kludgelen, dest); } /* Output portably to stderr or its equivalent (i.e. may be a console @@ -240,7 +295,7 @@ { va_list args; va_start (args, fmt); - std_handle_out_va (stderr, fmt, args, 0); + write_string_to_external_output_va (fmt, args, EXT_PRINT_STDERR); va_end (args); } @@ -252,7 +307,18 @@ { va_list args; va_start (args, fmt); - std_handle_out_va (stdout, fmt, args, 0); + write_string_to_external_output_va (fmt, args, EXT_PRINT_STDOUT); + va_end (args); +} + +/* Output portably to print destination as specified by DEST. */ + +void +external_out (int dest, const CIbyte *fmt, ...) +{ + va_list args; + va_start (args, fmt); + write_string_to_external_output_va (fmt, args, dest); va_end (args); } @@ -266,7 +332,7 @@ { va_list args; va_start (args, fmt); - std_handle_out_va (stderr, fmt, args, 1); + write_string_to_external_output_va (fmt, args, EXT_PRINT_ALL); va_end (args); } @@ -277,7 +343,7 @@ va_start (args, fmt); stderr_out ("\nXEmacs: fatal error: "); - std_handle_out_va (stderr, fmt, args, 0); + write_string_to_external_output_va (fmt, args, EXT_PRINT_STDERR); stderr_out ("\n"); va_end (args); @@ -1812,7 +1878,7 @@ } static void -write_string_to_alternate_debugging_output (Ibyte *str, Bytecount len) +write_string_to_alternate_debugging_output (const Ibyte *str, Bytecount len) { int extlen; const Extbyte *extptr; @@ -1832,6 +1898,35 @@ alternate_do_string[alternate_do_pointer] = 0; } + +DEFUN ("set-device-clear-left-side", Fset_device_clear_left_side, 2, 2, 0, /* +Set whether to output a newline before the next output to a stream device. +This will happen only if the most recently-outputted character was not +a newline -- i.e. it will make sure the left side is "clear" of text. +*/ + (device, value)) +{ + if (!NILP (device)) + CHECK_LIVE_DEVICE (device); + if (NILP (device) || DEVICE_STREAM_P (XDEVICE (device))) + /* #### This should be per-device */ + stdout_clear_before_next_output = !NILP (value); + return Qnil; +} + +DEFUN ("device-left-side-clear-p", Fdevice_left_side_clear_p, 0, 1, 0, /* +For stream devices, true if the most recent-outputted character was a newline. +*/ + (device)) +{ + if (!NILP (device)) + CHECK_LIVE_DEVICE (device); + if (NILP (device) || DEVICE_STREAM_P (XDEVICE (device))) + /* #### This should be per-device */ + return stdout_needs_newline ? Qt : Qnil; + return Qnil; +} + DEFUN ("external-debugging-output", Fexternal_debugging_output, 1, 3, 0, /* Write CHAR-OR-STRING to stderr or stdout. If optional arg STDOUT-P is non-nil, write to stdout; otherwise, write @@ -1917,9 +2012,14 @@ static int debug_print_level = 15; static int debug_print_readably = -1; -/* Debugging kludge -- unbuffered */ +/* Print an object, `prin1'-style, to various possible debugging outputs. + Make sure it's completely unbuffered so that, in the event of a crash + somewhere, we see as much as possible that happened before it. + + + */ static void -debug_print_no_newline (Lisp_Object debug_print_obj) +debug_prin1 (Lisp_Object debug_print_obj, int flags) { /* This function can GC */ @@ -1938,13 +2038,17 @@ internal_bind_lisp_object (&Vprint_level, make_int (debug_print_level)); /* #### Do we need this? It was in the old code. */ internal_bind_lisp_object (&Vinhibit_quit, Vinhibit_quit); - - print_internal (debug_print_obj, Qexternal_debugging_output, 1); - alternate_do_pointer = 0; - print_internal (debug_print_obj, Qalternate_debugging_output, 1); + + if ((flags & EXT_PRINT_STDOUT) || (flags & EXT_PRINT_STDERR)) + print_internal (debug_print_obj, Qexternal_debugging_output, 1); + if (flags & EXT_PRINT_ALTERNATE) + print_internal (debug_print_obj, Qalternate_debugging_output, 1); #ifdef WIN32_NATIVE - /* Write out to the debugger, as well */ - print_internal (debug_print_obj, Qmswindows_debugging_output, 1); + if (flags & EXT_PRINT_MSWINDOWS) + { + /* Write out to the debugger, as well */ + print_internal (debug_print_obj, Qmswindows_debugging_output, 1); + } #endif unbind_to (specdepth); @@ -2023,6 +2127,31 @@ inhibit_non_essential_printing_operations = 0; } +static void +ext_print_begin (int dest) +{ + if (dest & EXT_PRINT_ALTERNATE) + alternate_do_pointer = 0; + if (dest & (EXT_PRINT_STDERR | EXT_PRINT_STDOUT)) + stdout_clear_before_next_output = 1; +} + +static void +ext_print_end (int dest) +{ + if (dest & (EXT_PRINT_MSWINDOWS | EXT_PRINT_STDERR | EXT_PRINT_STDOUT)) + external_out (dest & (EXT_PRINT_MSWINDOWS | EXT_PRINT_STDERR | + EXT_PRINT_STDOUT), "\n"); +} + +static void +external_debug_print (Lisp_Object object, int dest) +{ + ext_print_begin (dest); + debug_prin1 (object, dest); + ext_print_end (dest); +} + void debug_p3 (Lisp_Object obj) { @@ -2035,8 +2164,7 @@ void debug_print (Lisp_Object debug_print_obj) { - debug_print_no_newline (debug_print_obj); - debug_out ("\n"); + external_debug_print (debug_print_obj, EXT_PRINT_ALL); } /* Getting tired of typing debug_print() ... */ @@ -2047,6 +2175,16 @@ debug_print (debug_print_obj); } +/* Alternate debug printer: Return a char * pointer to the output */ +char *dpa (Lisp_Object debug_print_obj); +char * +dpa (Lisp_Object debug_print_obj) +{ + external_debug_print (debug_print_obj, EXT_PRINT_ALTERNATE); + + return alternate_do_string; +} + /* Debugging kludge -- unbuffered */ /* This function provided for the benefit of the debugger. */ void @@ -2097,7 +2235,7 @@ } if (COMPILED_FUNCTIONP (*bt->function)) { -#if defined(COMPILED_FUNCTION_ANNOTATION_HACK) +#if defined (COMPILED_FUNCTION_ANNOTATION_HACK) Lisp_Object ann = compiled_function_annotation (XCOMPILED_FUNCTION (*bt->function)); #else @@ -2106,7 +2244,7 @@ if (!NILP (ann)) { debug_out ("<compiled-function from "); - debug_print_no_newline (ann); + debug_prin1 (ann, EXT_PRINT_ALL); debug_out (">"); } else @@ -2115,7 +2253,7 @@ } } else - debug_print_no_newline (*bt->function); + debug_prin1 (*bt->function, EXT_PRINT_ALL); first = 0; length--; bt = bt->next; @@ -2145,6 +2283,8 @@ DEFSUBR (Fterpri); DEFSUBR (Fwrite_char); DEFSUBR (Falternate_debugging_output); + DEFSUBR (Fset_device_clear_left_side); + DEFSUBR (Fdevice_left_side_clear_p); DEFSUBR (Fexternal_debugging_output); DEFSUBR (Fopen_termscript); DEFSYMBOL (Qexternal_debugging_output);
--- a/src/profile.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/profile.c Sun Mar 09 02:27:46 2003 +0000 @@ -51,8 +51,15 @@ The basic idea is simple. We set a profiling timer using setitimer (ITIMER_PROF), which generates a SIGPROF every so often. (This runs not in real time but rather when the process is executing or the system is - running on behalf of the process.) When the signal goes off, we see what - we're in, and add 1 to the count associated with that function. + running on behalf of the process -- at least, that is the case under + Unix. Under MS Windows and Cygwin, there is no setitimer(), so we + simulate it using multimedia timers, which run in real time. To make + the results a bit more realistic, we ignore ticks that go off while + blocking on an event wait. Note that Cygwin does provide a simulation + of setitimer(), but it's in real time anyway, since Windows doesn't + provide a way to have process-time timers, and furthermore, it's broken, + so we don't use it.) When the signal goes off, we see what we're in, and + add 1 to the count associated with that function. It would be nice to use the Lisp allocation mechanism etc. to keep track of the profiling information (i.e. to use Lisp hash tables), but we @@ -706,9 +713,12 @@ DEFVAR_INT ("default-profiling-interval", &default_profiling_interval /* Default CPU time in microseconds between profiling sampling. Used when the argument to `start-profiling' is nil or omitted. -Note that the time in question is CPU time (when the program is executing -or the kernel is executing on behalf of the program) and not real time, and -there is usually a machine-dependent limit on how small this value can be. +Under Unix, the time in question is CPU time (when the program is executing +or the kernel is executing on behalf of the program) and not real time. +Under MS Windows and Cygwin, the time is real time, but time spent blocking +while waiting for an event is ignored, to get more accurate results. +Note that there is usually a machine-dependent limit on how small this +value can be. */ ); default_profiling_interval = 1000;
--- a/src/regex.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/regex.c Sun Mar 09 02:27:46 2003 +0000 @@ -81,26 +81,6 @@ #define DEBUG #endif -#ifdef MULE - -Lisp_Object Vthe_lisp_rangetab; - -void -vars_of_regex (void) -{ - Vthe_lisp_rangetab = Fmake_range_table (); - staticpro (&Vthe_lisp_rangetab); -} - -#else /* not MULE */ - -void -vars_of_regex (void) -{ -} - -#endif /* MULE */ - #define RE_TRANSLATE_1(ch) TRT_TABLE_OF (translate, (Ichar) ch) #define TRANSLATE_P(tr) (!NILP (tr)) @@ -108,65 +88,6 @@ #define PTR_TO_OFFSET(d) (MATCHING_IN_FIRST_STRING \ ? (d) - string1 : (d) - (string2 - size1)) -/* Convert an offset from the start of the logical text string formed by - concatenating the two strings together into a character position in the - Lisp buffer or string that the text represents. Knows that - when handling buffer text, the "string" we're passed in is always - BEGV - ZV. */ - -static Charxpos -offset_to_charxpos (Lisp_Object lispobj, int off) -{ - if (STRINGP (lispobj)) - return string_index_byte_to_char (lispobj, off); - else if (BUFFERP (lispobj)) - return bytebpos_to_charbpos (XBUFFER (lispobj), - off + BYTE_BUF_BEGV (XBUFFER (lispobj))); - else - return 0; -} - -#ifdef REL_ALLOC - -/* STRING1 is the value of STRING1 given to re_match_2(). LISPOBJ is - the Lisp object (if any) from which the string is taken. If LISPOBJ - is a buffer, return a relocation offset to be added to all pointers to - string data so that they will be accurate again, after an allocation or - reallocation that potentially relocated the buffer data. -*/ -static Bytecount -offset_post_relocation (Lisp_Object lispobj, char *string1) -{ - struct buffer *buf; - - if (!BUFFERP (lispobj)) - return 0; - return (BYTE_BUF_BYTE_ADDRESS (XBUFFER (lispobj), - BYTE_BUF_BEGV (XBUFFER (lispobj))) - - string1); -} - -#endif /* REL_ALLOC */ - -#ifdef ERROR_CHECK_MALLOC - -/* NOTE that this can run malloc() so you need to adjust afterwards. */ - -static int -bind_regex_malloc_disallowed (int value) -{ - /* Tricky, because the act of binding can run malloc(). */ - int old_regex_malloc_disallowed = regex_malloc_disallowed; - int depth; - regex_malloc_disallowed = 0; - depth = record_unwind_protect_restoring_int (®ex_malloc_disallowed, - old_regex_malloc_disallowed); - regex_malloc_disallowed = value; - return depth; -} - -#endif /* ERROR_CHECK_MALLOC */ - #else /* not emacs */ /* If we are not linking with Emacs proper, @@ -437,11 +358,11 @@ #ifdef REGEX_REL_ALLOC #define REGEX_ALLOCATE_STACK(size) \ - r_alloc ((char **) &failure_stack_ptr, (size)) + r_alloc ((unsigned char **) &failure_stack_ptr, (size)) #define REGEX_REALLOCATE_STACK(source, osize, nsize) \ - r_re_alloc ((char **) &failure_stack_ptr, (nsize)) + r_re_alloc ((unsigned char **) &failure_stack_ptr, (nsize)) #define REGEX_FREE_STACK(ptr) \ - r_alloc_free ((void **) &failure_stack_ptr) + r_alloc_free ((unsigned char **) &failure_stack_ptr) #else /* not REGEX_REL_ALLOC */ @@ -492,6 +413,88 @@ #define true 1 +#ifdef emacs + +#ifdef MULE + +Lisp_Object Vthe_lisp_rangetab; + +void +vars_of_regex (void) +{ + Vthe_lisp_rangetab = Fmake_range_table (); + staticpro (&Vthe_lisp_rangetab); +} + +#else /* not MULE */ + +void +vars_of_regex (void) +{ +} + +#endif /* MULE */ + +/* Convert an offset from the start of the logical text string formed by + concatenating the two strings together into a character position in the + Lisp buffer or string that the text represents. Knows that + when handling buffer text, the "string" we're passed in is always + BEGV - ZV. */ + +static Charxpos +offset_to_charxpos (Lisp_Object lispobj, int off) +{ + if (STRINGP (lispobj)) + return string_index_byte_to_char (lispobj, off); + else if (BUFFERP (lispobj)) + return bytebpos_to_charbpos (XBUFFER (lispobj), + off + BYTE_BUF_BEGV (XBUFFER (lispobj))); + else + return 0; +} + +#ifdef REL_ALLOC + +/* STRING1 is the value of STRING1 given to re_match_2(). LISPOBJ is + the Lisp object (if any) from which the string is taken. If LISPOBJ + is a buffer, return a relocation offset to be added to all pointers to + string data so that they will be accurate again, after an allocation or + reallocation that potentially relocated the buffer data. +*/ +static Bytecount +offset_post_relocation (Lisp_Object lispobj, Ibyte *orig_buftext) +{ + if (!BUFFERP (lispobj)) + return 0; + return (BYTE_BUF_BYTE_ADDRESS (XBUFFER (lispobj), + BYTE_BUF_BEGV (XBUFFER (lispobj))) - + orig_buftext); +} + +#endif /* REL_ALLOC */ + +#ifdef ERROR_CHECK_MALLOC + +/* NOTE that this can run malloc() so you need to adjust afterwards. */ + +static int +bind_regex_malloc_disallowed (int value) +{ + /* Tricky, because the act of binding can run malloc(). */ + int old_regex_malloc_disallowed = regex_malloc_disallowed; + int depth; + regex_malloc_disallowed = 0; + depth = record_unwind_protect_restoring_int (®ex_malloc_disallowed, + old_regex_malloc_disallowed); + regex_malloc_disallowed = value; + return depth; +} + +#endif /* ERROR_CHECK_MALLOC */ + +#endif /* emacs */ + + /* These are the command codes that appear in compiled regular expressions. Some opcodes are followed by argument bytes. A command code can specify any interpretation whatsoever for its @@ -1403,85 +1406,59 @@ #else /* Don't change NULL pointers */ #define ADD_IF_NZ(val) if (val) val += rmdp_offset -#define RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS() \ -do \ -{ \ - Bytecount rmdp_offset = offset_post_relocation (lispobj, string1); \ - \ - if (rmdp_offset) \ - { \ - int i; \ - \ - ADD_IF_NZ (string1); \ - ADD_IF_NZ (string2); \ - ADD_IF_NZ (d); \ - ADD_IF_NZ (dend); \ - ADD_IF_NZ (end1); \ - ADD_IF_NZ (end2); \ - ADD_IF_NZ (end_match_1); \ - ADD_IF_NZ (end_match_2); \ - \ - if (bufp->re_ngroups) \ - { \ - for (i = 0; i < numregs; i++) \ - { \ - ADD_IF_NZ (regstart[i]); \ - ADD_IF_NZ (regend[i]); \ - ADD_IF_NZ (old_regstart[i]); \ - ADD_IF_NZ (old_regend[i]); \ - ADD_IF_NZ (best_regstart[i]); \ - ADD_IF_NZ (best_regend[i]); \ - ADD_IF_NZ (reg_dummy[i]); \ - } \ - } \ - \ - ADD_IF_NZ (match_end); \ - } \ +#define RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS() \ +do \ +{ \ + Bytecount rmdp_offset = offset_post_relocation (lispobj, orig_buftext); \ + \ + if (rmdp_offset) \ + { \ + int i; \ + \ + ADD_IF_NZ (string1); \ + ADD_IF_NZ (string2); \ + ADD_IF_NZ (d); \ + ADD_IF_NZ (dend); \ + ADD_IF_NZ (end1); \ + ADD_IF_NZ (end2); \ + ADD_IF_NZ (end_match_1); \ + ADD_IF_NZ (end_match_2); \ + \ + if (bufp->re_ngroups) \ + { \ + for (i = 0; i < num_regs; i++) \ + { \ + ADD_IF_NZ (regstart[i]); \ + ADD_IF_NZ (regend[i]); \ + ADD_IF_NZ (old_regstart[i]); \ + ADD_IF_NZ (old_regend[i]); \ + ADD_IF_NZ (best_regstart[i]); \ + ADD_IF_NZ (best_regend[i]); \ + ADD_IF_NZ (reg_dummy[i]); \ + } \ + } \ + \ + ADD_IF_NZ (match_end); \ + } \ } while (0) #endif /* !defined (emacs) || !defined (REL_ALLOC) */ #if !defined (emacs) || !defined (REL_ALLOC) #define RE_SEARCH_RELOCATE_MOVEABLE_DATA_POINTERS() #else -#define RE_SEARCH_RELOCATE_MOVEABLE_DATA_POINTERS() \ -do \ -{ \ - Bytecount rmdp_offset = offset_post_relocation (lispobj, str1); \ - \ - if (rmdp_offset) \ - { \ - int i; \ - \ - ADD_IF_NZ (str1); \ - ADD_IF_NZ (str2); \ - ADD_IF_NZ (string1); \ - ADD_IF_NZ (string2); \ - ADD_IF_NZ (d); \ - \ - \ - \ - ADD_IF_NZ (dend); \ - ADD_IF_NZ (end1); \ - ADD_IF_NZ (end2); \ - ADD_IF_NZ (end_match_1); \ - ADD_IF_NZ (end_match_2); \ - \ - if (bufp->re_ngroups) \ - { \ - for (i = 0; i < numregs; i++) \ - { \ - ADD_IF_NZ (regstart[i]); \ - ADD_IF_NZ (regend[i]); \ - ADD_IF_NZ (old_regstart[i]); \ - ADD_IF_NZ (old_regend[i]); \ - ADD_IF_NZ (best_regstart[i]); \ - ADD_IF_NZ (best_regend[i]); \ - ADD_IF_NZ (reg_dummy[i]); \ - } \ - } \ - \ - ADD_IF_NZ (match_end); \ - } \ +#define RE_SEARCH_RELOCATE_MOVEABLE_DATA_POINTERS() \ +do \ +{ \ + Bytecount rmdp_offset = offset_post_relocation (lispobj, orig_buftext); \ + \ + if (rmdp_offset) \ + { \ + ADD_IF_NZ (str1); \ + ADD_IF_NZ (str2); \ + ADD_IF_NZ (string1); \ + ADD_IF_NZ (string2); \ + ADD_IF_NZ (d); \ + } \ } while (0) #endif /* emacs */ @@ -4286,6 +4263,13 @@ re_char *d; #ifdef emacs Internal_Format fmt = buffer_or_other_internal_format (lispobj); +#ifdef REL_ALLOC + Ibyte *orig_buftext = + BUFFERP (lispobj) ? + BYTE_BUF_BYTE_ADDRESS (XBUFFER (lispobj), + BYTE_BUF_BEGV (XBUFFER (lispobj))) : + 0; +#endif #ifdef ERROR_CHECK_MALLOC int depth; #endif @@ -4914,6 +4898,14 @@ #ifdef emacs Internal_Format fmt = buffer_or_other_internal_format (lispobj); +#ifdef REL_ALLOC + Ibyte *orig_buftext = + BUFFERP (lispobj) ? + BYTE_BUF_BYTE_ADDRESS (XBUFFER (lispobj), + BYTE_BUF_BEGV (XBUFFER (lispobj))) : + 0; +#endif + #ifdef ERROR_CHECK_MALLOC int depth = bind_regex_malloc_disallowed (1); #endif @@ -4967,7 +4959,7 @@ /* If the allocations above (or the call to setup_syntax_cache() in re_match_2) caused a rel-alloc relocation, then fix up the data pointers */ - Bytecount offset = offset_post_relocation (lispobj, string1); + Bytecount offset = offset_post_relocation (lispobj, orig_buftext); if (offset) { string1 += offset; @@ -5055,7 +5047,7 @@ BEGIN_REGEX_MALLOC_OK (); QUIT; END_REGEX_MALLOC_OK (); - RE_SEARCH_RELOCATE_MOVEABLE_DATA_POINTERS (); + RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS (); } #endif
--- a/src/scrollbar-gtk.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/scrollbar-gtk.c Sun Mar 09 02:27:46 2003 +0000 @@ -32,7 +32,6 @@ #include "console-gtk-impl.h" #include "glyphs-gtk.h" -#include "gui-gtk.h" #include "scrollbar-gtk.h" static gboolean scrollbar_cb (GtkAdjustment *adj, gpointer user_data);
--- a/src/scrollbar-x.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/scrollbar-x.c Sun Mar 09 02:27:46 2003 +0000 @@ -34,7 +34,6 @@ #include "console-x-impl.h" #include "glyphs-x.h" -#include "gui-x.h" #include "scrollbar-x.h" #include "EmacsFrame.h"
--- a/src/sound.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/sound.c Sun Mar 09 02:27:46 2003 +0000 @@ -346,7 +346,7 @@ #ifdef HAVE_NAS_SOUND if (DEVICE_CONNECTED_TO_NAS_P (d) && STRINGP (sound)) { - const UChar_Binary *soundext; + UChar_Binary *soundext; Bytecount soundextlen; TO_EXTERNAL_FORMAT (LISP_STRING, sound,
--- a/src/ui-gtk.c Sat Mar 08 22:52:26 2003 +0000 +++ b/src/ui-gtk.c Sun Mar 09 02:27:46 2003 +0000 @@ -9,20 +9,20 @@ #include <config.h> #include "lisp.h" + #include "buffer.h" #include "console-gtk.h" #include "device.h" -#include "window.h" -#include "glyphs-gtk.h" -#include "objects-gtk.h" -#include "ui-gtk.h" -#include "faces.h" -#include "gui-gtk.h" -#include "sysdll.h" -#include "hash.h" -#include "events.h" #include "elhash.h" #include "event-gtk.h" +#include "events.h" +#include "faces.h" +#include "glyphs-gtk.h" +#include "hash.h" +#include "objects-gtk.h" +#include "sysdll.h" +#include "ui-gtk.h" +#include "window.h" /* XEmacs specific GTK types */ #include "gtk-glue.c"