From 7cb010ed71e28e79bdce5e22ce6f257ca991a008 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Tue, 18 May 2004 19:48:51 +0000 Subject: [PATCH 01/28] Prefix RIF functions with w32con_ to avoid namespace clash with term.c. --- src/w32console.c | 124 +++++++++++++++++++++++------------------------ 1 file changed, 62 insertions(+), 62 deletions(-) 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; From 24ee97634d3480b3a441c2d8e7029547572891be Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Tue, 18 May 2004 19:53:08 +0000 Subject: [PATCH 02/28] (add_menu_item, w32_menu_display_help) [USE_LISP_UNION_TYPE]: Cast from Lisp_Object using i member. --- src/w32menu.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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 From f3c4ec7415591e0b3f563dcafb8aa41491ba5cca Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Tue, 18 May 2004 19:55:30 +0000 Subject: [PATCH 03/28] (display_x_get_resource, vga_stdcolor_name): Add prototype. --- src/ChangeLog | 10 ++++++++++ src/w32term.h | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 7425754e042..736358ee951 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +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. diff --git a/src/w32term.h b/src/w32term.h index a9cdacf49d4..580ae08f772 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)); @@ -719,6 +723,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); From 6dd6baa5df0cb0370b713e40e2143487a6a8ab38 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Tue, 18 May 2004 20:26:26 +0000 Subject: [PATCH 04/28] Fix last change for non USE_LISP_UNION_TYPE case. --- src/w32fns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; From acba5cae3e7cfadd80c89e8a22860113504d1379 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 18 May 2004 22:09:25 +0000 Subject: [PATCH 05/28] (create_child): Use INTMASK. --- src/w32proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; From 70abfe909d17e13686401dbaf90e57d3096cfafa Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 19 May 2004 00:12:49 +0000 Subject: [PATCH 06/28] Fix syntax (open/close) of CJK characters. --- lisp/ChangeLog | 5 +++++ lisp/international/characters.el | 33 ++++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8e2b74d5b60..1fae99e8c59 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-05-19 Kenichi Handa + + * international/characters.el: Fix syntax (open/close) of CJK + characters. + 2004-05-18 Masatake YAMATO * wid-edit.el (widget-radio-button-notify): Don't pass `widget' 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!:!;! Date: Wed, 19 May 2004 00:24:15 +0000 Subject: [PATCH 07/28] (tex-compilation-parse-errors): Save excursion in source buffer. --- lisp/textmodes/tex-mode.el | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 6e129987ec1..28bf9f6cf28 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -1944,21 +1944,22 @@ for the error messages." (or (null last-filename) (not (string-equal last-filename filename)))) (error-location - (save-excursion - (if (equal filename (concat tex-zap-file ".tex")) - (set-buffer tex-last-buffer-texed) - (set-buffer (find-file-noselect filename))) - (if new-file - (progn (goto-line linenum) (setq last-position nil)) - (goto-char last-position) - (forward-line (- linenum last-linenum))) - ;; first try a forward search for the error text, - ;; then a backward search limited by the last error. - (let ((starting-point (point))) - (or (re-search-forward error-text nil t) - (re-search-backward error-text last-position t) - (goto-char starting-point))) - (point-marker)))) + (with-current-buffer + (if (equal filename (concat tex-zap-file ".tex")) + tex-last-buffer-texed + (find-file-noselect filename)) + (save-excursion + (if new-file + (progn (goto-line linenum) (setq last-position nil)) + (goto-char last-position) + (forward-line (- linenum last-linenum))) + ;; first try a forward search for the error text, + ;; then a backward search limited by the last error. + (let ((starting-point (point))) + (or (re-search-forward error-text nil t) + (re-search-backward error-text last-position t) + (goto-char starting-point))) + (point-marker))))) (goto-char this-error) (if (and compilation-error-list (or (and find-at-least From b1e5937ca1bb2202e372e2d35122ad10077e5a61 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 May 2004 00:30:43 +0000 Subject: [PATCH 08/28] (auto-save-file-name-transforms): Make sure ange-ftp temp files files don't contain an accidental additional /. --- lisp/files.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) From 933cd61ed486b4900d8771c958f00cffad2f6c48 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 May 2004 00:56:46 +0000 Subject: [PATCH 09/28] (help-go-back): Don't depend on position of back button. --- lisp/help-mode.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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. From 3c8c8c277e0edc58d4d22d53f3a83e2dc770b0bb Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 May 2004 01:09:14 +0000 Subject: [PATCH 10/28] (mm-insert-inline): Make it work in read-only buffer. --- lisp/gnus/mm-view.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 From 0001e96851d9ea2060d12c5305c6818e222e0b34 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 May 2004 01:22:06 +0000 Subject: [PATCH 11/28] (xprintstr): New fun. (xstring, xprintsym): Use it. --- src/.gdbinit | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/.gdbinit b/src/.gdbinit index 33f02f4edc0..3660155f62d 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -199,7 +199,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 +372,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. From 15aa77901c5a249717dbac8a26ed6990d1e895bd Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Wed, 19 May 2004 02:16:56 +0000 Subject: [PATCH 12/28] * wid-edit.el (widget-radio-button-notify): Revert my last change. Reported by Katsumi Yamaoka . --- lisp/ChangeLog | 5 +++++ lisp/wid-edit.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1fae99e8c59..999c4393514 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +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 diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index b1a89e4fbef..33f1f06ba9a 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -2294,7 +2294,7 @@ Return an alist of (TYPE MATCH)." (defun widget-radio-button-notify (widget child &optional event) ;; Tell daddy. - (widget-apply (widget-get widget :parent) :action event)) + (widget-apply (widget-get widget :parent) :action widget event)) ;;; The `radio-button-choice' Widget. From 9a6a4c407912354dec8722ff58fc0dc0e6633af7 Mon Sep 17 00:00:00 2001 From: David Ponce Date: Wed, 19 May 2004 07:38:57 +0000 Subject: [PATCH 13/28] (print): Reset print_depth before to call print_object. --- src/ChangeLog | 4 ++++ src/print.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 736358ee951..386a346afa0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +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 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); } From 0d8c2e5cc3344ca9be97ee6f98a507430c61bcd2 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Wed, 19 May 2004 09:41:38 +0000 Subject: [PATCH 14/28] *** empty log message *** --- src/ChangeLog | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 386a346afa0..6fcd3fa477c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-05-19 Kim F. Storm + + * .gdbinit (xsymbol): Fix last change. + 2004-05-18 David Ponce * print.c (print): Reset print_depth before to call print_object. @@ -10,7 +14,7 @@ * 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. + * w32term.h (display_x_get_resource, vga_stdcolor_name): Add prototype. 2004-05-18 Eli Zaretskii @@ -111,12 +115,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): @@ -260,6 +268,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): From cfcde636bec28b07aa50eee1e0dcc672b98efdd1 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Wed, 19 May 2004 09:49:33 +0000 Subject: [PATCH 15/28] (xsymbol): Fix last change. --- src/.gdbinit | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/.gdbinit b/src/.gdbinit index 3660155f62d..fe9ddf7dbb7 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 From 022cb16265e269894d725c50c6de3e6d19cd5b41 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 19 May 2004 14:27:21 +0000 Subject: [PATCH 16/28] (Search-based Fontification): Fix typo. --- lispref/ChangeLog | 4 ++++ lispref/modes.texi | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index c46f718b5c7..c2f4f188496 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,7 @@ +2004-05-19 Thien-Thi Nguyen + + * 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. From 29f89fe7ea0a0942202b4d8f56d816e0f7720796 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 May 2004 16:32:59 +0000 Subject: [PATCH 17/28] (trivial_regexp_p): \_ is no longer a trivial regexp. --- src/search.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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': From 669fa600c6d72a2c343a195a0061c72a3ddb6169 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 May 2004 16:38:34 +0000 Subject: [PATCH 18/28] 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. --- src/ChangeLog | 26 ++++++++++ src/regex.c | 132 +++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 151 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 6fcd3fa477c..c1f0706b928 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,7 +1,33 @@ +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. 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; From e4ad9cf1999c5a0a2b8eb9c6df0e3bfcfbe58199 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 May 2004 18:49:52 +0000 Subject: [PATCH 19/28] *** empty log message *** --- lisp/ChangeLog | 56 ++++++++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 999c4393514..a7ec49e6709 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -5,24 +5,35 @@ 2004-05-19 Kenichi Handa - * international/characters.el: Fix syntax (open/close) of CJK - characters. + * 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 @@ -30,15 +41,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. @@ -85,7 +95,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 @@ -94,8 +104,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 @@ -785,18 +794,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 @@ -824,8 +832,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. @@ -847,8 +854,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 From 6ccc7fbc5de4e8f6e058c6dd2553a86bb6ef9843 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 May 2004 18:50:38 +0000 Subject: [PATCH 20/28] Describe the new \_< and \_> operators. --- man/search.texi | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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} From b88a41d0064828aab6c75d7a8c6f543022fa5dd5 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 May 2004 18:53:13 +0000 Subject: [PATCH 21/28] (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. --- lisp/emacs-lisp/bytecomp.el | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) 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*. From 91ba19536ab21ff58849f38a7921e43f32cf0ca8 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 May 2004 18:55:51 +0000 Subject: [PATCH 22/28] (defun-cvs-mode): Fix capitalization of error message. --- lisp/pcvs.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/pcvs.el b/lisp/pcvs.el index 8cb21828d69..9e518d791ec 100644 --- a/lisp/pcvs.el +++ b/lisp/pcvs.el @@ -764,7 +764,7 @@ before calling the real function `" (symbol-name fun-1) "'.\n") (interactive) (cvs-mode! ',fun-1))))) - (t (error "unknown style %s in `defun-cvs-mode'" style))))) + (t (error "Unknown style %s in `defun-cvs-mode'" style))))) (defun-cvs-mode cvs-mode-kill-process () "Kill the temporary buffer and associated process." From d490ebbe49f75a5041e97621a72a55fe033226f7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 May 2004 18:58:21 +0000 Subject: [PATCH 23/28] (gdb-reset): Use unless. Fix regexp. --- lisp/progmodes/gdb-ui.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 19c57979130..1fa6f8f2645 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -1728,15 +1728,15 @@ This arrangement depends on the value of `gdb-many-windows'." "Exit a debugging session cleanly by killing the gdb buffers and resetting the source buffers." (dolist (buffer (buffer-list)) - (if (not (eq buffer gud-comint-buffer)) - (with-current-buffer buffer - (if (memq gud-minor-mode '(gdba pdb)) - (if (string-match "^\*.+*$" (buffer-name)) - (kill-buffer nil) - (gdb-remove-breakpoint-icons (point-min) (point-max) t) - (setq gud-minor-mode nil) - (kill-local-variable 'tool-bar-map) - (setq gud-running nil)))))) + (unless (eq buffer gud-comint-buffer) + (with-current-buffer buffer + (if (memq gud-minor-mode '(gdba pdb)) + (if (string-match "\\`\\*.+\\*\\'" (buffer-name)) + (kill-buffer nil) + (gdb-remove-breakpoint-icons (point-min) (point-max) t) + (setq gud-minor-mode nil) + (kill-local-variable 'tool-bar-map) + (setq gud-running nil)))))) (when (markerp gdb-overlay-arrow-position) (move-marker gdb-overlay-arrow-position nil) (setq gdb-overlay-arrow-position nil)) @@ -2013,5 +2013,5 @@ BUFFER nil or omitted means use the current buffer." (provide 'gdb-ui) -;;; arch-tag: e9fb00c5-74ef-469f-a088-37384caae352 +;; arch-tag: e9fb00c5-74ef-469f-a088-37384caae352 ;;; gdb-ui.el ends here From 27149c587cdfede04c2cda8edc9c37eefb853dfa Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 May 2004 19:00:02 +0000 Subject: [PATCH 24/28] (gud-reset): Use unless & with-current-buffer. --- lisp/progmodes/gud.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 84dec78d895..eb0b887bdf3 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -2554,12 +2554,11 @@ It is saved for when this flag is not set.") (defun gud-reset () (dolist (buffer (buffer-list)) - (if (not (eq buffer gud-comint-buffer)) - (save-excursion - (set-buffer buffer) - (when gud-minor-mode - (setq gud-minor-mode nil) - (kill-local-variable 'tool-bar-map)))))) + (unless (eq buffer gud-comint-buffer) + (with-current-buffer buffer + (when gud-minor-mode + (setq gud-minor-mode nil) + (kill-local-variable 'tool-bar-map)))))) (defun gud-display-frame () "Find and obey the last filename-and-line marker from the debugger. From f0975dfd6c191017c026655bd04611a4d50aaca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jan=C3=ADk?= Date: Wed, 19 May 2004 19:06:54 +0000 Subject: [PATCH 25/28] Avoid mixing standard error output messages into the search result. --- lisp/net/ldap.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el index 55af47e6a87..f093fb1cbcc 100644 --- a/lisp/net/ldap.el +++ b/lisp/net/ldap.el @@ -554,7 +554,7 @@ an alist of attribute/value pairs." (setq arglist (nconc arglist (list (format "-z%s" sizelimit))))) (eval `(call-process ldap-ldapsearch-prog nil - buf + `(,buf nil) nil ,@arglist ,@ldap-ldapsearch-args From 621a3f6266f9a2ea1e04701c66238cf4b54c2a1f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 May 2004 19:10:19 +0000 Subject: [PATCH 26/28] (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. --- lisp/simple.el | 72 ++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 38 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 7b9c20c3e17..f76c6662725 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3392,15 +3392,14 @@ Setting this variable automatically makes it local to the current buffer.") ;; (Actually some major modes use a different auto-fill function, ;; but this one is the default one.) (defun do-auto-fill () - (let (fc justify bol give-up + (let (fc justify give-up (fill-prefix fill-prefix)) (if (or (not (setq justify (current-justification))) (null (setq fc (current-fill-column))) (and (eq justify 'left) (<= (current-column) fc)) - (save-excursion (beginning-of-line) - (setq bol (point)) - (and auto-fill-inhibit-regexp + (and auto-fill-inhibit-regexp + (save-excursion (beginning-of-line) (looking-at auto-fill-inhibit-regexp)))) nil ;; Auto-filling not required (if (memq justify '(full center right)) @@ -3423,16 +3422,15 @@ Setting this variable automatically makes it local to the current buffer.") ;; Determine where to split the line. (let* (after-prefix (fill-point - (let ((opoint (point))) - (save-excursion - (beginning-of-line) - (setq after-prefix (point)) - (and fill-prefix - (looking-at (regexp-quote fill-prefix)) - (setq after-prefix (match-end 0))) - (move-to-column (1+ fc)) - (fill-move-to-break-point after-prefix) - (point))))) + (save-excursion + (beginning-of-line) + (setq after-prefix (point)) + (and fill-prefix + (looking-at (regexp-quote fill-prefix)) + (setq after-prefix (match-end 0))) + (move-to-column (1+ fc)) + (fill-move-to-break-point after-prefix) + (point)))) ;; See whether the place we found is any good. (if (save-excursion @@ -4265,16 +4263,15 @@ of the differing parts is, by contrast, slightly highlighted." :group 'completion) (defun completion-setup-function () - (save-excursion - (let ((mainbuf (current-buffer)) - (mbuf-contents (minibuffer-contents))) - ;; When reading a file name in the minibuffer, - ;; set default-directory in the minibuffer - ;; so it will get copied into the completion list buffer. - (if minibuffer-completing-file-name - (with-current-buffer mainbuf - (setq default-directory (file-name-directory mbuf-contents)))) - (set-buffer standard-output) + (let ((mainbuf (current-buffer)) + (mbuf-contents (minibuffer-contents))) + ;; When reading a file name in the minibuffer, + ;; set default-directory in the minibuffer + ;; so it will get copied into the completion list buffer. + (if minibuffer-completing-file-name + (with-current-buffer mainbuf + (setq default-directory (file-name-directory mbuf-contents)))) + (with-current-buffer standard-output (completion-list-mode) (make-local-variable 'completion-reference-buffer) (setq completion-reference-buffer mainbuf) @@ -4283,24 +4280,23 @@ of the differing parts is, by contrast, slightly highlighted." ;; use the number of chars before the start of the ;; last file name component. (setq completion-base-size - (save-excursion - (set-buffer mainbuf) - (goto-char (point-max)) - (skip-chars-backward "^/") - (- (point) (minibuffer-prompt-end)))) + (with-current-buffer mainbuf + (save-excursion + (goto-char (point-max)) + (skip-chars-backward "^/") + (- (point) (minibuffer-prompt-end))))) ;; Otherwise, in minibuffer, the whole input is being completed. - (save-match-data - (if (minibufferp mainbuf) - (setq completion-base-size 0)))) - ;; Put faces on first uncommon characters and common parts. + (if (minibufferp mainbuf) + (setq completion-base-size 0))) + ;; Put faces on first uncommon characters and common parts. (when completion-base-size - (let* ((common-string-length (length - (substring mbuf-contents - completion-base-size))) + (let* ((common-string-length + (- (length mbuf-contents) completion-base-size)) (element-start (next-single-property-change (point-min) 'mouse-face)) - (element-common-end (+ element-start common-string-length)) + (element-common-end + (+ (or element-start nil) common-string-length)) (maxp (point-max))) (while (and element-start (< element-common-end maxp)) (when (and (get-char-property element-start 'mouse-face) @@ -4764,5 +4760,5 @@ works by saving the value of `buffer-invisibility-spec' and setting it to nil." (provide 'simple) -;;; arch-tag: 24af67c0-2a49-44f6-b3b1-312d8b570dfd +;; arch-tag: 24af67c0-2a49-44f6-b3b1-312d8b570dfd ;;; simple.el ends here From 2aa4a7297965487334ee3ad40de9c7ca7f09eb87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jan=C3=ADk?= Date: Wed, 19 May 2004 19:11:54 +0000 Subject: [PATCH 27/28] *** empty log message *** --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a7ec49e6709..f67ffcd8875 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +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 From 47ff5b284043393f79f231f0c6bd005a542721cb Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 May 2004 19:19:44 +0000 Subject: [PATCH 28/28] *** empty log message *** --- lisp/ChangeLog | 21 +++++++++++++++++++-- lisp/gnus/ChangeLog | 2 ++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f67ffcd8875..81da604aea5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,20 @@ +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 @@ -5,7 +22,7 @@ 2004-05-19 Masatake YAMATO - * wid-edit.el (widget-radio-button-notify): Revert my last + * wid-edit.el (widget-radio-button-notify): Revert my last change. Reported by Katsumi Yamaoka . 2004-05-19 Kenichi Handa @@ -7412,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/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.