diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8e2b74d5b60..81da604aea5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,18 +1,61 @@ +2004-05-19 Stefan Monnier + + * simple.el (do-auto-fill): Remove unused vars `bol' and `opoint'. + (completion-setup-function): Use with-current-buffer. + Properly save excursion. Simplify. + Don't assume there is necessarily a `mouse-face' property somewhere. + + * progmodes/gud.el (gud-reset): Use unless & with-current-buffer. + + * progmodes/gdb-ui.el (gdb-reset): Use unless. Fix regexp. + + * emacs-lisp/bytecomp.el (byte-compile-log): Use backquotes. + (byte-compile-log-1): Don't call (byte-goto-log-buffer). + Use with-current-buffer. + (byte-goto-log-buffer): Delete. + (byte-compile-log-file): Call compilation-forget-errors. + +2004-05-19 Takaaki Ota (tiny change) + + * net/ldap.el (ldap-search-internal): Avoid mixing standard error + output messages into the search result. + +2004-05-19 Masatake YAMATO + + * wid-edit.el (widget-radio-button-notify): Revert my last + change. Reported by Katsumi Yamaoka . + +2004-05-19 Kenichi Handa + + * international/characters.el: Fix syntax (open/close) of CJK chars. + +2004-05-18 Karl Chen (tiny change) + + * help-mode.el (help-go-back): Don't depend on position of back button. + +2004-05-18 Stefan Monnier + + * files.el (auto-save-file-name-transforms): Make sure ange-ftp temp + files files don't contain an accidental additional /. + + * textmodes/tex-mode.el (tex-compilation-parse-errors): Save excursion + in source buffer. + 2004-05-18 Masatake YAMATO * wid-edit.el (widget-radio-button-notify): Don't pass `widget' - to widget-apply. :action method assumes 2 arguments, not 3. + to widget-apply. :action method assumes 2 arguments, not 3. 2004-05-17 Glenn Morris - * progmodes/f90.el (f90-end-block-re, f90-start-block-re): New - constants. + * progmodes/f90.el (f90-end-block-re, f90-start-block-re): + New constants. (hs-special-modes-alist): Add an f90-mode entry. 2004-05-17 Sam Steingold - * emacs-lisp/cl-indent.el (common-lisp-indent-function-1): Indent - "without-" forms just like "with-" and "do-". Use regexp-opt. + * emacs-lisp/cl-indent.el (common-lisp-indent-function-1): + Indent "without-" forms just like "with-" and "do-". Use regexp-opt. 2004-05-16 Kim F. Storm @@ -20,15 +63,14 @@ 2004-05-15 John Wiegley - * eshell/esh-io.el (eshell-get-target): whitespace changes. + * eshell/esh-io.el (eshell-get-target): Whitespace changes. (eshell-output-object-to-target): Improve output speed 20% by not - calling `eshell-stringify' if something is already known to be a - string. + calling `eshell-stringify' if something is already known to be a string. 2004-05-15 Alex Ott - * textmodes/ispell.el (ispell-local-dictionary-alist): Add - windows-1251 to the choice of coding systems. + * textmodes/ispell.el (ispell-local-dictionary-alist): + Add windows-1251 to the choice of coding systems. (ispell-dictionary-alist-6): Add support for "russianw.aff", encoded in cp1251. @@ -75,7 +117,7 @@ 2004-05-13 Marcelo Toledo - * language/european.el ("Brazilian Portuguese"): Added support for + * language/european.el ("Brazilian Portuguese"): Add support for Brazilian Portuguese. 2004-05-13 John Wiegley @@ -84,8 +126,7 @@ `recentf-mode' if this variable has been customized to t. * eshell/esh-test.el (eshell-test): Call the function - `emacs-version' rather than trying to build a custom version - string. + `emacs-version' rather than trying to build a custom version string. 2004-05-13 Stefan Monnier @@ -775,18 +816,17 @@ * progmodes/fortran.el (fortran-fill): Use local var `bol' rather than duplicate call to `line-beginning-position'. - * progmodes/f90.el (f90-get-present-comment-type): Return - whitespace, as well as comment chars, for consistent filling + * progmodes/f90.el (f90-get-present-comment-type): + Return whitespace, as well as comment chars, for consistent filling of comment blocks. Use `match-string-no-properties'. - (f90-break-line): Do not leave trailing whitespace when filling - comments. + (f90-break-line): Trim trailing whitespace when filling comments. 2004-04-30 Dave Love * calendar/diary-lib.el (diary-outlook-formats): New variable. (diary-from-outlook-internal, diary-from-outlook) - (diary-from-outlook-gnus, diary-from-outlook-rmail): New - functions to import diary entries from Outlook-format + (diary-from-outlook-gnus, diary-from-outlook-rmail): + New functions to import diary entries from Outlook-format appointments in mail messages. 2004-04-29 Stefan Monnier @@ -814,8 +854,7 @@ * progmodes/sql.el (sql-product-alist): Rename variable `sql-product-support'. Add Postgres login parameters. - (sql-set-product, sql-product-feature): Update with renamed - variable. + (sql-set-product, sql-product-feature): Update with renamed variable. (sql-connect-postgres): Add username prompt. (sql-imenu-generic-expression, sql-mode-font-lock-object-name): Make patterns less product specific. @@ -837,8 +876,7 @@ (sql-mode-sqlite-font-lock-keywords) (sql-mode-db2-font-lock-keywords): Default to nil. (sql-product-font-lock): Always highlight ANSI keywords. - (sql-add-product-keywords): Made similar to - `font-lock-add-keywords'. + (sql-add-product-keywords): Made similar to `font-lock-add-keywords'. (sql-send-string): Add function. 2004-04-29 Dave Love @@ -7391,7 +7429,7 @@ See ChangeLog.10 for earlier changes. ;; coding: iso-2022-7bit ;; End: - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2001, 02, 04 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted provided the copyright notice and this notice are preserved. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index f6e2946aa8b..8e20925c70d 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -832,24 +832,22 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." ;; Log something that isn't a warning. (defmacro byte-compile-log (format-string &rest args) - (list 'and - 'byte-optimize - '(memq byte-optimize-log '(t source)) - (list 'let '((print-escape-newlines t) - (print-level 4) - (print-length 4)) - (list 'byte-compile-log-1 - (cons 'format - (cons format-string - (mapcar - (lambda (x) - (if (symbolp x) (list 'prin1-to-string x) x)) - args))))))) + `(and + byte-optimize + (memq byte-optimize-log '(t source)) + (let ((print-escape-newlines t) + (print-level 4) + (print-length 4)) + (byte-compile-log-1 + (format + ,format-string + ,@(mapcar + (lambda (x) (if (symbolp x) (list 'prin1-to-string x) x)) + args)))))) ;; Log something that isn't a warning. (defun byte-compile-log-1 (string) - (save-excursion - (byte-goto-log-buffer) + (with-current-buffer "*Compile-Log*" (goto-char (point-max)) (byte-compile-warning-prefix nil nil) (cond (noninteractive @@ -903,11 +901,6 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." (defvar byte-compile-last-warned-form nil) (defvar byte-compile-last-logged-file nil) -(defun byte-goto-log-buffer () - (set-buffer (get-buffer-create "*Compile-Log*")) - (unless (eq major-mode 'compilation-mode) - (compilation-mode))) - ;; This is used as warning-prefix for the compiler. ;; It is always called with the warnings buffer current. (defun byte-compile-warning-prefix (level entry) @@ -983,6 +976,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." ;; Do this after setting default-directory. (unless (eq major-mode 'compilation-mode) (compilation-mode)) + (compilation-forget-errors) pt)))) ;; Log a message STRING in *Compile-Log*. diff --git a/lisp/files.el b/lisp/files.el index 91da8a4c2c7..99cad16cf5b 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -293,7 +293,7 @@ Normally auto-save files are written under other names." :group 'auto-save) (defcustom auto-save-file-name-transforms - `(("\\`/[^/]*:\\(.+/\\)*\\(.*\\)" + `(("\\`/[^/]*:\\([^/]*/\\)*\\([^/]*\\)\\'" ;; Don't put "\\2" inside expand-file-name, since it will be ;; transformed to "/2" on DOS/Windows. ,(concat temporary-file-directory "\\2") t)) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 00a2634ee8c..68df8d0941e 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,5 +1,7 @@ 2004-05-18 Stefan Monnier + * mm-view.el (mm-insert-inline): Make it work in read-only buffer. + * gnus-win.el (gnus-all-windows-visible-p): Don't consider non-visible windows. diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index f7dfdb60f02..69cbd3d8a1d 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el @@ -1,5 +1,5 @@ ;;; mm-view.el --- functions for viewing MIME objects -;; Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +;; Copyright (C) 1998, 1999, 2000, 01, 2004 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen ;; This file is part of GNU Emacs. @@ -197,7 +197,8 @@ (defun mm-insert-inline (handle text) "Insert TEXT inline from HANDLE." - (let ((b (point))) + (let ((b (point)) + (inhibit-read-only t)) (insert text) (mm-handle-set-undisplayer handle diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 1f1b529c8ef..11656ec368c 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -577,12 +577,11 @@ help buffer." (goto-char position))))) (defun help-go-back () - "Invoke the [back] button (if any) in the Help mode buffer." + "Go back to previous topic in this help buffer." (interactive) - (let ((back-button (button-at (1- (point-max))))) - (if back-button - (button-activate back-button) - (error "No [back] button")))) + (if help-xref-stack + (help-xref-go-back (current-buffer)) + (error "No previous help buffer."))) (defun help-do-xref (pos function args) "Call the help cross-reference function FUNCTION with args ARGS. diff --git a/lisp/international/characters.el b/lisp/international/characters.el index 7af456d1878..ebf2a3af27d 100644 --- a/lisp/international/characters.el +++ b/lisp/international/characters.el @@ -229,6 +229,14 @@ (modify-category-entry generic-char ?|) (setq cns-list (cdr cns-list)))) +(let ((parens "$(G!>!?!@!A!B!C!D!E!F!G!H!I!J!K!L!M!N!O!P!Q!R!S!T!U!V!W!X!Y!Z![!\!]!^!_!`!a!b!c(B") + open close) + (dotimes (i (/ (length parens) 2)) + (setq open (aref parens (* i 2)) + close (aref parens (1+ (* i 2)))) + (modify-syntax-entry open (format "(%c" close)) + (modify-syntax-entry close (format ")%c" open)))) + ;; Cyrillic character set (ISO-8859-5) (modify-category-entry (make-char 'cyrillic-iso8859-5) ?y) @@ -584,16 +592,13 @@ (while chars (modify-syntax-entry (car chars) "w") (setq chars (cdr chars)))) -(modify-syntax-entry ?\$B!J(B "($B!K(B") -(modify-syntax-entry ?\$B!N(B "($B!O(B") -(modify-syntax-entry ?\$B!P(B "($B!Q(B") -(modify-syntax-entry ?\$B!V(B "($B!W(B") -(modify-syntax-entry ?\$B!X(B "($B!Y(B") -(modify-syntax-entry ?\$B!K(B ")$B!J(B") -(modify-syntax-entry ?\$B!O(B ")$B!N(B") -(modify-syntax-entry ?\$B!Q(B ")$B!P(B") -(modify-syntax-entry ?\$B!W(B ")$B!V(B") -(modify-syntax-entry ?\$B!Y(B ")$B!X(B") +(let ((parens "$B!J!K!L!M!N!O!P!Q!R!S!T!U!V!W!X!Y!Z![(B" ) + open close) + (dotimes (i (/ (length parens) 2)) + (setq open (aref parens (* i 2)) + close (aref parens (1+ (* i 2)))) + (modify-syntax-entry open (format "(%c" close)) + (modify-syntax-entry close (format ")%c" open)))) (modify-category-entry (make-char 'japanese-jisx0208 35) ?A) (modify-category-entry (make-char 'japanese-jisx0208 36) ?H) @@ -652,6 +657,14 @@ (modify-category-entry (make-char 'korean-ksc5601 43) ?K) (modify-category-entry (make-char 'korean-ksc5601 44) ?Y) +(let ((parens "$(C!2!3!4!5!6!7!8!9!:!;! + + * modes.texi (Search-based Fontification): Fix typo. + 2004-05-10 Juanma Barranquero * modes.texi (Mode Line Variables): Fix description of diff --git a/lispref/modes.texi b/lispref/modes.texi index 4a8d83ecfa0..d92ea309ed7 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi @@ -2001,7 +2001,7 @@ Find text by calling @var{function}, and highlight the matches it finds using @code{font-lock-keyword-face}. When @var{function} is called, it receives one argument, the limit of -the search; it should searching at point, and not search beyond the +the search; it should begin searching at point, and not search beyond the limit. It should return non-@code{nil} if it succeeds, and set the match data to describe the match that was found. Returning @code{nil} indicates failure of the search. diff --git a/man/search.texi b/man/search.texi index 303074dcf0d..fbc8d24bf23 100644 --- a/man/search.texi +++ b/man/search.texi @@ -724,6 +724,18 @@ determines which characters these are. @xref{Syntax}. @item \W matches any character that is not a word-constituent. +@item \_< +matches the empty string, but only at the beginning of a symbol. A +symbol is a sequence of one or more word or symbol constituent +characters. @samp{\_<} matches at the beginning of the buffer only if +a symbol-constituent character follows. + +@item \_> +matches the empty string, but only at the end of a symbol. A symbol +is a sequence of one or more word or symbol constituent characters. +@samp{\_>} matches at the end of the buffer only if the contents end +with a symbol-constituent character. + @item \s@var{c} matches any character whose syntax is @var{c}. Here @var{c} is a character that designates a particular syntax class: thus, @samp{w} diff --git a/src/.gdbinit b/src/.gdbinit index c976d3633de..3af7e369923 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -186,9 +186,10 @@ Print $ as a buffer-local-value pointer, assuming it is an Emacs Lisp Misc value end define xsymbol - xgetptr $ + set $sym = $ + xgetptr $sym print (struct Lisp_Symbol *) $ptr - xprintsym $ + xprintsym $sym echo \n end document xsymbol @@ -199,7 +200,7 @@ end define xstring xgetptr $ print (struct Lisp_String *) $ptr - output ($->size > 1000) ? 0 : ($->data[0])@($->size_byte < 0 ? $->size & ~gdb_array_mark_flag : $->size_byte) + xprintstr $ echo \n end document xstring @@ -372,12 +373,17 @@ document xscrollbar Print $ as a scrollbar pointer. end +define xprintstr + set $data = $arg0->data + output ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~gdb_array_mark_flag : $arg0->size_byte) +end + define xprintsym xgetptr $arg0 set $sym = (struct Lisp_Symbol *) $ptr xgetptr $sym->xname set $sym_name = (struct Lisp_String *) $ptr - output ($sym_name->data[0])@($sym_name->size_byte < 0 ? $sym_name->size & ~gdb_array_mark_flag : $sym_name->size_byte) + xprintstr $sym_name end document xprintsym Print argument as a symbol. diff --git a/src/ChangeLog b/src/ChangeLog index 7425754e042..c1f0706b928 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,47 @@ +2004-05-19 Jim Blandy + + Add support for new '\_<' and '\_>' regexp operators, matching the + beginning and ends of symbols. + * regex.c (enum syntaxcode): Add Ssymbol. + (init_syntax_once): Set the syntax for '_' to Ssymbol, not Sword. + (re_opcode_t): New opcodes `symbeg' and `symend'. + (print_partial_compiled_pattern): Print the new opcodes properly. + (regex_compile): Parse the new operators. + (analyse_first): Skip symbeg and symend (they match only the empty string). + (mutually_exclusive_p): `symend' is mutually exclusive with \s_ and + \sw; `symbeg' is mutually exclusive with \S_ and \Sw. + (re_match_2_internal): Match symbeg and symend. + + * search.c (trivial_regexp_p): \_ is no longer a trivial regexp. + +2004-05-19 Kim F. Storm + + * .gdbinit (xsymbol): Fix last change. + +2004-05-18 Stefan Monnier + + * .gdbinit (xprintstr): New fun. + (xstring, xprintsym): Use it. + + * w32proc.c (create_child): Use INTMASK. + + * alloc.c (Fgarbage_collect): Do all the marking before flushing + unmarked elements of the undo list. + +2004-05-18 David Ponce + + * print.c (print): Reset print_depth before to call print_object. + +2004-05-18 Jason Rumney + + * w32console.c: Prefix RIF functions with w32con_ to avoid + namespace clash with functions in term.c and w32term.c. + + * w32menu.c (add_menu_item, w32_menu_display_help) + [USE_LISP_UNION_TYPE]: Cast from Lisp_Object using i member. + + * w32term.h (display_x_get_resource, vga_stdcolor_name): Add prototype. + 2004-05-18 Eli Zaretskii * lisp.h (DECL_ALIGN): Remove restriction on MS-DOS systems. @@ -97,12 +141,16 @@ section to frame.c section. (Fxw_display_color_p, Fx_file_dialog): Declare if HAVE_WINDOW_SYSTEM defined. + * macfns.c (Fx_create_frame): Fix int/Lisp_Object mixup. + * macmenu.c (set_frame_menubar): Use NILP to test a lisp value. + * macterm.c (mac_get_emulated_btn, mac_event_to_emacs_modifiers) (mac_get_mouse_btn): Use NILP and EQ to test/compare lisp values. (XTread_socket): Fix int/Lisp_Object mixup. (mac_check_for_quit_char): Fix pointer/Lisp_Object mixup. + * macterm.h (struct frame, struct face, struct image) (display_x_get_resource, Fx_display_color_p) (Fx_display_grayscale_p, Fx_display_planes, x_free_gcs): @@ -246,6 +294,7 @@ around call to ReceiveEvent to avoid certain crashes. 2004-05-07 YAMAMOTO Mitsuharu + * macterm.c (mac_draw_line_to_pixmap, XCreatePixmapFromBitmapData) (mac_fill_rectangle_to_pixmap, mac_draw_rectangle_to_pixmap) (mac_copy_area_to_pixmap, mac_copy_area_with_mask_to_pixmap): diff --git a/src/print.c b/src/print.c index 74f8fad8d15..0e07cd6fdd3 100644 --- a/src/print.c +++ b/src/print.c @@ -1220,7 +1220,6 @@ print (obj, printcharfun, escapeflag) register Lisp_Object printcharfun; int escapeflag; { - print_depth = 0; old_backquote_output = 0; /* Reset print_number_index and Vprint_number_table only when @@ -1240,6 +1239,7 @@ print (obj, printcharfun, escapeflag) start = index = print_number_index; /* Construct Vprint_number_table. This increments print_number_index for the objects added. */ + print_depth = 0; print_preprocess (obj); /* Remove unnecessary objects, which appear only once in OBJ; @@ -1264,6 +1264,7 @@ print (obj, printcharfun, escapeflag) print_number_index = index; } + print_depth = 0; print_object (obj, printcharfun, escapeflag); } diff --git a/src/regex.c b/src/regex.c index a518ef81a0c..0c1343bf584 100644 --- a/src/regex.c +++ b/src/regex.c @@ -2,7 +2,7 @@ 0.12. (Implements POSIX draft P1003.2/D11.2, except for some of the internationalization features.) - Copyright (C) 1993,94,95,96,97,98,99,2000 Free Software Foundation, Inc. + Copyright (C) 1993,94,95,96,97,98,99,2000,04 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -217,7 +217,7 @@ char *realloc (); /* Define the syntax stuff for \<, \>, etc. */ /* Sword must be nonzero for the wordchar pattern commands in re_match_2. */ -enum syntaxcode { Swhitespace = 0, Sword = 1 }; +enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 }; # ifdef SWITCH_ENUM_BUG # define SWITCH_ENUM_CAST(x) ((int)(x)) @@ -398,7 +398,7 @@ init_syntax_once () if (ISALNUM (c)) re_syntax_table[c] = Sword; - re_syntax_table['_'] = Sword; + re_syntax_table['_'] = Ssymbol; done = 1; } @@ -655,6 +655,9 @@ typedef enum wordbound, /* Succeeds if at a word boundary. */ notwordbound, /* Succeeds if not at a word boundary. */ + symbeg, /* Succeeds if at symbol beginning. */ + symend, /* Succeeds if at symbol end. */ + /* Matches any character whose syntax is specified. Followed by a byte which contains a syntax code, e.g., Sword. */ syntaxspec, @@ -1094,6 +1097,14 @@ print_partial_compiled_pattern (start, end) case wordend: fprintf (stderr, "/wordend"); + case symbeg: + printf ("/symbeg"); + break; + + case symend: + printf ("/symend"); + break; + case syntaxspec: fprintf (stderr, "/syntaxspec"); mcnt = *p++; @@ -3398,6 +3409,19 @@ regex_compile (pattern, size, syntax, bufp) BUF_PUSH (wordend); break; + case '_': + if (syntax & RE_NO_GNU_OPS) + goto normal_char; + laststart = b; + PATFETCH (c); + if (c == '<') + BUF_PUSH (symbeg); + else if (c == '>') + BUF_PUSH (symend); + else + FREE_STACK_RETURN (REG_BADPAT); + break; + case 'b': if (syntax & RE_NO_GNU_OPS) goto normal_char; @@ -3890,6 +3914,8 @@ analyse_first (p, pend, fastmap, multibyte) case notwordbound: case wordbeg: case wordend: + case symbeg: + case symend: continue; @@ -4654,14 +4680,20 @@ mutually_exclusive_p (bufp, p1, p2) break; case wordend: - case notsyntaxspec: + return ((re_opcode_t) *p1 == syntaxspec && p1[1] == Sword); + case symend: return ((re_opcode_t) *p1 == syntaxspec - && p1[1] == (op2 == wordend ? Sword : p2[1])); + && (p1[1] == Ssymbol || p1[1] == Sword)); + case notsyntaxspec: + return ((re_opcode_t) *p1 == syntaxspec && p1[1] == p2[1]); case wordbeg: - case syntaxspec: + return ((re_opcode_t) *p1 == notsyntaxspec && p1[1] == Sword); + case symbeg: return ((re_opcode_t) *p1 == notsyntaxspec - && p1[1] == (op2 == wordbeg ? Sword : p2[1])); + && (p1[1] == Ssymbol || p1[1] == Sword)); + case syntaxspec: + return ((re_opcode_t) *p1 == notsyntaxspec && p1[1] == p2[1]); case wordbound: return (((re_opcode_t) *p1 == notsyntaxspec @@ -5803,6 +5835,92 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) } break; + case symbeg: + DEBUG_PRINT1 ("EXECUTING symbeg.\n"); + + /* We FAIL in one of the following cases: */ + + /* Case 1: D is at the end of string. */ + if (AT_STRINGS_END (d)) + goto fail; + else + { + /* C1 is the character before D, S1 is the syntax of C1, C2 + is the character at D, and S2 is the syntax of C2. */ + re_wchar_t c1, c2; + int s1, s2; +#ifdef emacs + int offset = PTR_TO_OFFSET (d); + int charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset); + UPDATE_SYNTAX_TABLE (charpos); +#endif + PREFETCH (); + c2 = RE_STRING_CHAR (d, dend - d); + s2 = SYNTAX (c2); + + /* Case 2: S2 is neither Sword nor Ssymbol. */ + if (s2 != Sword && s2 != Ssymbol) + goto fail; + + /* Case 3: D is not at the beginning of string ... */ + if (!AT_STRINGS_BEG (d)) + { + GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2); +#ifdef emacs + UPDATE_SYNTAX_TABLE_BACKWARD (charpos - 1); +#endif + s1 = SYNTAX (c1); + + /* ... and S1 is Sword or Ssymbol. */ + if (s1 == Sword || s1 == Ssymbol) + goto fail; + } + } + break; + + case symend: + DEBUG_PRINT1 ("EXECUTING symend.\n"); + + /* We FAIL in one of the following cases: */ + + /* Case 1: D is at the beginning of string. */ + if (AT_STRINGS_BEG (d)) + goto fail; + else + { + /* C1 is the character before D, S1 is the syntax of C1, C2 + is the character at D, and S2 is the syntax of C2. */ + re_wchar_t c1, c2; + int s1, s2; +#ifdef emacs + int offset = PTR_TO_OFFSET (d) - 1; + int charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset); + UPDATE_SYNTAX_TABLE (charpos); +#endif + GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2); + s1 = SYNTAX (c1); + + /* Case 2: S1 is neither Ssymbol nor Sword. */ + if (s1 != Sword && s1 != Ssymbol) + goto fail; + + /* Case 3: D is not at the end of string ... */ + if (!AT_STRINGS_END (d)) + { + PREFETCH_NOLIMIT (); + c2 = RE_STRING_CHAR (d, dend - d); +#ifdef emacs + UPDATE_SYNTAX_TABLE_FORWARD (charpos); +#endif + s2 = SYNTAX (c2); + + /* ... and S2 is Sword or Ssymbol. */ + if (s2 == Sword || s2 == Ssymbol) + goto fail; + } + } + break; + case syntaxspec: case notsyntaxspec: not = (re_opcode_t) *(p - 1) == notsyntaxspec; diff --git a/src/search.c b/src/search.c index c60d68b9374..e5e4c3f867a 100644 --- a/src/search.c +++ b/src/search.c @@ -957,7 +957,7 @@ trivial_regexp_p (regexp) { case '|': case '(': case ')': case '`': case '\'': case 'b': case 'B': case '<': case '>': case 'w': case 'W': case 's': - case 'S': case '=': case '{': case '}': + case 'S': case '=': case '{': case '}': case '_': case 'c': case 'C': /* for categoryspec and notcategoryspec */ case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': diff --git a/src/w32console.c b/src/w32console.c index b2d340d579c..74a8fd6338e 100644 --- a/src/w32console.c +++ b/src/w32console.c @@ -53,20 +53,20 @@ extern int read_input_pending (); extern struct frame * updating_frame; extern int meta_key; -static void move_cursor (int row, int col); -static void clear_to_end (void); -void clear_frame (void); -void clear_end_of_line (int); -static void ins_del_lines (int vpos, int n); -void insert_glyphs (struct glyph *start, int len); -void write_glyphs (struct glyph *string, int len); -void delete_glyphs (int n); +static void w32con_move_cursor (int row, int col); +static void w32con_clear_to_end (void); +static void w32con_clear_frame (void); +static void w32con_clear_end_of_line (int); +static void w32con_ins_del_lines (int vpos, int n); +static void w32con_insert_glyphs (struct glyph *start, int len); +static void w32con_write_glyphs (struct glyph *string, int len); +static void w32con_delete_glyphs (int n); void w32_sys_ring_bell (void); -void reset_terminal_modes (void); -void set_terminal_modes (void); -void set_terminal_window (int size); -void update_begin (struct frame * f); -void update_end (struct frame * f); +static void w32con_reset_terminal_modes (void); +static void w32con_set_terminal_modes (void); +static void w32con_set_terminal_window (int size); +static void w32con_update_begin (struct frame * f); +static void w32con_update_end (struct frame * f); static WORD w32_face_attributes (struct frame *f, int face_id); static COORD cursor_coords; @@ -104,7 +104,7 @@ ctrl_c_handler (unsigned long type) /* Move the cursor to (row, col). */ static void -move_cursor (int row, int col) +w32con_move_cursor (int row, int col) { cursor_coords.X = col; cursor_coords.Y = row; @@ -117,17 +117,17 @@ move_cursor (int row, int col) /* Clear from cursor to end of screen. */ static void -clear_to_end (void) +w32con_clear_to_end (void) { struct frame * f = PICK_FRAME (); - clear_end_of_line (FRAME_COLS (f) - 1); - ins_del_lines (cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1); + w32con_clear_end_of_line (FRAME_COLS (f) - 1); + w32con_ins_del_lines (cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1); } /* Clear the frame. */ -void -clear_frame (void) +static void +w32con_clear_frame (void) { struct frame * f = PICK_FRAME (); COORD dest; @@ -144,7 +144,7 @@ clear_frame (void) FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r); FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r); - move_cursor (0, 0); + w32con_move_cursor (0, 0); } @@ -152,8 +152,8 @@ static struct glyph glyph_base[256]; static BOOL ceol_initialized = FALSE; /* Clear from Cursor to end (what's "standout marker"?). */ -void -clear_end_of_line (int end) +static void +w32con_clear_end_of_line (int end) { if (!ceol_initialized) { @@ -164,12 +164,12 @@ clear_end_of_line (int end) } ceol_initialized = TRUE; } - write_glyphs (glyph_base, end - cursor_coords.X); /* fencepost ? */ + w32con_write_glyphs (glyph_base, end - cursor_coords.X); /* fencepost ? */ } /* Insert n lines at vpos. if n is negative delete -n lines. */ -void -ins_del_lines (int vpos, int n) +static void +w32con_ins_del_lines (int vpos, int n) { int i, nb; SMALL_RECT scroll; @@ -212,8 +212,8 @@ ins_del_lines (int vpos, int n) { for (i = scroll.Bottom; i < dest.Y; i++) { - move_cursor (i, 0); - clear_end_of_line (FRAME_COLS (f)); + w32con_move_cursor (i, 0); + w32con_clear_end_of_line (FRAME_COLS (f)); } } } @@ -225,8 +225,8 @@ ins_del_lines (int vpos, int n) { for (i = nb; i < scroll.Top; i++) { - move_cursor (i, 0); - clear_end_of_line (FRAME_COLS (f)); + w32con_move_cursor (i, 0); + w32con_clear_end_of_line (FRAME_COLS (f)); } } } @@ -275,8 +275,8 @@ scroll_line (int dist, int direction) /* If start is zero insert blanks instead of a string at start ?. */ -void -insert_glyphs (register struct glyph *start, register int len) +static void +w32con_insert_glyphs (register struct glyph *start, register int len) { scroll_line (len, RIGHT); @@ -286,16 +286,16 @@ insert_glyphs (register struct glyph *start, register int len) /* Print the first len characters of start, cursor_coords.X adjusted by write_glyphs. */ - write_glyphs (start, len); + w32con_write_glyphs (start, len); } else { - clear_end_of_line (cursor_coords.X + len); + w32con_clear_end_of_line (cursor_coords.X + len); } } -void -write_glyphs (register struct glyph *string, register int len) +static void +w32con_write_glyphs (register struct glyph *string, register int len) { int produced, consumed; DWORD r; @@ -353,7 +353,7 @@ write_glyphs (register struct glyph *string, register int len) } cursor_coords.X += produced; - move_cursor (cursor_coords.Y, cursor_coords.X); + w32con_move_cursor (cursor_coords.Y, cursor_coords.X); } len -= consumed; n -= consumed; @@ -391,8 +391,8 @@ write_glyphs (register struct glyph *string, register int len) } -void -delete_glyphs (int n) +static void +w32con_delete_glyphs (int n) { /* delete chars means scroll chars from cursor_coords.X + n to cursor_coords.X, anything beyond the edge of the screen should @@ -450,8 +450,8 @@ SOUND is nil to use the normal beep. */) return sound; } -void -reset_terminal_modes (void) +static void +w32con_reset_terminal_modes (void) { #ifdef USE_SEPARATE_SCREEN SetConsoleActiveScreenBuffer (prev_screen); @@ -461,8 +461,8 @@ reset_terminal_modes (void) SetConsoleMode (keyboard_handle, prev_console_mode); } -void -set_terminal_modes (void) +static void +w32con_set_terminal_modes (void) { CONSOLE_CURSOR_INFO cci; @@ -484,19 +484,19 @@ set_terminal_modes (void) clumps rather than one-character-at-a-time... we'll start with not moving the cursor while an update is in progress. */ -void -update_begin (struct frame * f) +static void +w32con_update_begin (struct frame * f) { } -void -update_end (struct frame * f) +static void +w32con_update_end (struct frame * f) { SetConsoleCursorPosition (cur_screen, cursor_coords); } -void -set_terminal_window (int size) +static void +w32con_set_terminal_window (int size) { } @@ -574,21 +574,21 @@ initialize_w32_display (void) { CONSOLE_SCREEN_BUFFER_INFO info; - cursor_to_hook = move_cursor; - raw_cursor_to_hook = move_cursor; - clear_to_end_hook = clear_to_end; - clear_frame_hook = clear_frame; - clear_end_of_line_hook = clear_end_of_line; - ins_del_lines_hook = ins_del_lines; - insert_glyphs_hook = insert_glyphs; - write_glyphs_hook = write_glyphs; - delete_glyphs_hook = delete_glyphs; + cursor_to_hook = w32con_move_cursor; + raw_cursor_to_hook = w32con_move_cursor; + clear_to_end_hook = w32con_clear_to_end; + clear_frame_hook = w32con_clear_frame; + clear_end_of_line_hook = w32con_clear_end_of_line; + ins_del_lines_hook = w32con_ins_del_lines; + insert_glyphs_hook = w32con_insert_glyphs; + write_glyphs_hook = w32con_write_glyphs; + delete_glyphs_hook = w32con_delete_glyphs; ring_bell_hook = w32_sys_ring_bell; - reset_terminal_modes_hook = reset_terminal_modes; - set_terminal_modes_hook = set_terminal_modes; - set_terminal_window_hook = set_terminal_window; - update_begin_hook = update_begin; - update_end_hook = update_end; + reset_terminal_modes_hook = w32con_reset_terminal_modes; + set_terminal_modes_hook = w32con_set_terminal_modes; + set_terminal_window_hook = w32con_set_terminal_window; + update_begin_hook = w32con_update_begin; + update_end_hook = w32con_update_end; read_socket_hook = w32_console_read_socket; mouse_position_hook = w32_console_mouse_position; diff --git a/src/w32fns.c b/src/w32fns.c index f56ecc35cc6..c0c66a9591e 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -8090,7 +8090,7 @@ DEFUN ("w32-unregister-hot-key", Fw32_unregister_hot_key, (WPARAM) XINT (XCAR (item)), (LPARAM) item.i)) #else if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY, - (WPARAM) XINT (XCAR (item)), (LPARAM) item.i)) + (WPARAM) XINT (XCAR (item)), (LPARAM) item)) #endif { @@ -8170,7 +8170,7 @@ is set to off if the low bit of NEW-STATE is zero, otherwise on. */) (WPARAM) vk_code, (LPARAM) new_state.i)) #else if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_TOGGLE_LOCK_KEY, - (WPARAM) vk_code, (LPARAM) new_state.i)) + (WPARAM) vk_code, (LPARAM) new_state)) #endif { MSG msg; diff --git a/src/w32menu.c b/src/w32menu.c index 5f8f8a4e5e0..cc0932d7bf5 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -2225,9 +2225,12 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item) /* Set help string for menu item. Leave it as a Lisp_Object until it is ready to be displayed, since GC can happen while menus are active. */ - if (wv->help) - info.dwItemData = (DWORD) wv->help; - + if (!NILP (wv->help)) +#ifdef USE_LISP_UNION_TYPE + info.dwItemData = (DWORD) (wv->help).i; +#else + info.dwItemData = (DWORD) (wv->help); +#endif if (wv->button_type == BUTTON_TYPE_RADIO) { /* CheckMenuRadioItem allows us to differentiate TOGGLE and @@ -2307,7 +2310,12 @@ w32_menu_display_help (HWND owner, HMENU menu, UINT item, UINT flags) info.fMask = MIIM_DATA; get_menu_item_info (menu, item, FALSE, &info); +#ifdef USE_LISP_UNION_TYPE + help = info.dwItemData ? (Lisp_Object) ((EMACS_INT) info.dwItemData) + : Qnil; +#else help = info.dwItemData ? (Lisp_Object) info.dwItemData : Qnil; +#endif } /* Store the help echo in the keyboard buffer as the X toolkit diff --git a/src/w32proc.c b/src/w32proc.c index 842869726df..8452337f7e2 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -1,5 +1,5 @@ /* Process support for GNU Emacs on the Microsoft W32 API. - Copyright (C) 1992, 1995, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1992, 95, 99, 2000, 01, 04 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -367,7 +367,7 @@ create_child (char *exe, char *cmdline, char *env, int is_gui_app, cp->pid = -cp->pid; /* pid must fit in a Lisp_Int */ - cp->pid = XUINT (make_number (cp->pid)); + cp->pid = cp->pid & INTMASK; *pPid = cp->pid; diff --git a/src/w32term.h b/src/w32term.h index f7c4c30064e..284458d4270 100644 --- a/src/w32term.h +++ b/src/w32term.h @@ -252,6 +252,10 @@ extern int unibyte_display_via_language_environment; struct w32_display_info *x_display_info_for_name (); +Lisp_Object display_x_get_resource P_ ((struct w32_display_info *, + Lisp_Object, Lisp_Object, + Lisp_Object, Lisp_Object)); + extern struct w32_display_info *w32_term_init (); extern Lisp_Object w32_list_fonts P_ ((struct frame *, Lisp_Object, int, int)); @@ -717,6 +721,8 @@ struct face; XGCValues *XCreateGC (void *, Window, unsigned long, XGCValues *); struct frame * check_x_frame (Lisp_Object); +Lisp_Object vga_stdcolor_name (int); + EXFUN (Fx_display_color_p, 1); EXFUN (Fx_display_grayscale_p, 1);