diff options
author | Miles Bader <miles@gnu.org> | 2005-06-06 02:39:45 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2005-06-06 02:39:45 +0000 |
commit | fdffd346262841cb194225ea0acd8059c57ec2d4 (patch) | |
tree | d8b3699131f7d1b94bc46c7d8be62af6b8b5ebfe /src | |
parent | a5c508fe3a3f456c987283156315d0384d38fe9e (diff) | |
parent | a9b4333620eb259e974445066a8e64cee0c21d69 (diff) | |
download | emacs-fdffd346262841cb194225ea0acd8059c57ec2d4.tar.gz |
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-57
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 324-352)
- Merge from gnus--rel--5.10
- Update from CVS
- etc/emacs-buffer.gdb: Remove RCS keywords
* gnus--rel--5.10 (patch 70-79)
- Update from CVS
- Merge from emacs--cvs-trunk--0
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 224 | ||||
-rw-r--r-- | src/buffer.c | 39 | ||||
-rw-r--r-- | src/bytecode.c | 3 | ||||
-rw-r--r-- | src/callproc.c | 27 | ||||
-rw-r--r-- | src/ccl.c | 72 | ||||
-rw-r--r-- | src/ccl.h | 7 | ||||
-rw-r--r-- | src/emacs.c | 1 | ||||
-rw-r--r-- | src/eval.c | 15 | ||||
-rw-r--r-- | src/fileio.c | 2 | ||||
-rw-r--r-- | src/fns.c | 6 | ||||
-rw-r--r-- | src/image.c | 22 | ||||
-rw-r--r-- | src/keyboard.c | 6 | ||||
-rw-r--r-- | src/macmenu.c | 16 | ||||
-rw-r--r-- | src/macterm.c | 9 | ||||
-rw-r--r-- | src/makefile.w32-in | 2 | ||||
-rw-r--r-- | src/s/ms-w32.h | 2 | ||||
-rw-r--r-- | src/w32.c | 8 | ||||
-rw-r--r-- | src/xdisp.c | 451 | ||||
-rw-r--r-- | src/xfaces.c | 12 | ||||
-rw-r--r-- | src/xmenu.c | 4 | ||||
-rw-r--r-- | src/xterm.c | 13 |
21 files changed, 646 insertions, 295 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c2cd2dde5f7..6eeb4fc09f5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,153 @@ +2005-06-05 Eli Zaretskii <eliz@gnu.org> + + * w32.c (sys_setsockopt): Change arg 4 to `const void *'. In the + call to pfn_setsockopt, cast optval to `const char *'. + +2005-06-04 Eli Zaretskii <eliz@gnu.org> + + * w32.c (gettimeofday): Use struct _timeb, not struct timeb. + (open_unc_volume): Cast return value of map_w32_filename, to avoid + compiler warnings. + + * s/ms-w32.h (fileno): Don't define if already defined. + + * emacs.c: Include w32heap.h, to avoid compiler warning about sbrk. + + * makefile.w32-in (DOC): Define to point to the generated DOC-X. + +2005-06-04 Richard M. Stallman <rms@gnu.org> + + * xmenu.c (popup_get_selection): Click not in menu deactivates menu. + +2005-06-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * macmenu.c (cleanup_popup_menu): New function. + (Fx_popup_menu): unwind protect cleanup_popup_menu in case + mac_menu_show Quit:s. + (mac_menu_show): Quit on cancel if not popped up on click (i.e. + a dialog). + +2005-06-04 Kim F. Storm <storm@cua.dk> + + * coding.c (decode_coding_string): Handle CODING_FINISH_INTERRUPT. + + * callproc.c (Fcall_process): Don't use alloca to gradually + increase size of buf, as it effectively uses twice the necessary + space on the stack. Instead, pre-allocate buf of full size, and + gradually increase the read size. + + * bytecode.c (BYTE_CODE_QUIT): Check Vthrow_on_input. + + * eval.c (unbind_to): Preserve value of Vquit_flag. + + * xterm.c (handle_one_xevent): Also ignore mouse motion just + before a button release event. + +2005-06-03 Juanma Barranquero <lekktu@gmail.com> + + * xfaces.c (Finternal_lisp_face_equal_p): Really report + on faces in a frame, if the argument FRAME is non-nil. + Improve argument/docstring consistency. + +2005-06-02 Kim F. Storm <storm@cua.dk> + + * xdisp.c (MODE_LINE_NOPROP_LEN): New macro. + (x_consider_frame_title, Fformat_mode_line): Save offset into + mode_line_noprop_buf rather than pointer, in case buffer is relocated. + +2005-06-01 Kim F. Storm <storm@cua.dk> + + * fns.c (mapcar1): Maybe exit loop if original sequence was modified. + +2005-06-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (mac_to_x_fontname, mac_do_list_fonts): Set XLFD + resolution fields for scalable fonts to 0. + + * xfaces.c (build_scalable_font_name): Round pixel size to the + nearest integer. + +2005-06-01 Kim F. Storm <storm@cua.dk> + + * xdisp.c (display_mode_line): Support nested calls to redisplay + and format-mode-line. Set mode_line_target to MODE_LINE_DISPLAY. + +2005-05-31 Stefan Monnier <monnier@iro.umontreal.ca> + + * fileio.c (Finsert_file_contents): + * xdisp.c (note_mode_line_or_margin_highlight): Lisp_Object/int mixup. + +2005-05-31 Kim F. Storm <storm@cua.dk> + + * xdisp.c (mode_line_noprop_buf, mode_line_noprop_buf_end) + (mode_line_noprop_ptr): Rename from frame_title_*. + (store_mode_line_noprop_char): Rename from store_frame_title_char. + (store_mode_line_noprop): Rename from store_frame_title. + (mode_line_target): New enum to specify current output target + for mode line formatting. + (display_mode_element): Test it rather than frame_title_ptr and + mode_line_string_list to determine where output should go. + (mode_line_proptrans_alist, mode_line_string_alist): Make static. + (Vmode_line_unwind_vector): New variable. + (format_mode_line_unwind_data, unwind_format_mode_line): + New functions for unwind protection in mode line formatting. + (x_consider_frame_title): Use them and new local var 'title_start' + to support nested calls to format-mode-line and redisplay. Set + mode_line_target to MODE_LINE_TITLE. + (Fformat_mode_line): Use them and new local var 'string_start' to + support nested calls to format-mode-line and redisplay. Set + mode_line_target to MODE_LINE_NOPROP or MODE_LINE_STRING. + Don't trim trailing dashes. + (decode_mode_spec): Don't make infinite number of trailing dashes + for MODE_LINE_NOPROP and MODE_LINE_STRING targets. + (syms_of_xdisp): Initialize and staticpro mode_line_string_face, + mode_line_string_face_prop, and Vmode_line_unwind_vector. + (init_xdisp): Initialize mode_line_noprop_ptr to start of _buf. + Initialize mode_line_target to MODE_LINE_DISPLAY. + +2005-05-29 Richard M. Stallman <rms@gnu.org> + + * buffer.c (Fbuffer_local_value): Call indirect_variable. + +2005-05-28 Masatake YAMATO <jet@gyve.org> + + * xdisp.c (note_mode_line_or_margin_highlight): Change the + pointer to a hand cursor when hoovering over a mouse-face. + +2005-05-27 Kenichi Handa <handa@m17n.org> + + * xterm.c (x_encode_char): Call check_ccl_update in advance. + + * ccl.c: Now an element of Vccl_program_table is a vector of + length 4, not 3. + (ccl_get_compiled_code): New arg idx. Caller changed. + Adjust for the change of Vccl_program_table. + (setup_ccl_program): Adjust for the change of Vccl_program_table. + (check_ccl_update): New function. + (Fregister_ccl_program): Use ASET to set an element of a vector. + Adjusted for the change of Vccl_program_table. + + * ccl.h (struct ccl_program): New member idx. + (check_ccl_update): Extern it. + +2005-05-27 Juanma Barranquero <lekktu@gmail.com> + + * image.c (Vimage_library_alist): Move from image.el. + (syms_of_image): Defvar it. + (lookup_image_type): Use it. + + * buffer.c (Fbuffer_local_value): Make argument name match its use + in docstring. + +2005-05-26 Juanma Barranquero <lekktu@gmail.com> + + * keyboard.c (Frecursive_edit): Fix typo in docstring. + (Fposn_at_x_y): Make argument name match its use in docstring. + +2005-05-26 Lute Kamstra <lute@gnu.org> + + * eval.c (Frun_hooks): Mention run-mode-hooks in docstring. + 2005-05-24 Masatake YAMATO <jet@gyve.org> * xdisp.c (note_mode_line_or_margin_highlight): Use b and e @@ -26,9 +176,9 @@ 2005-05-23 Masatake YAMATO <jet@gyve.org> - * xdisp.c (note_mode_line_or_margin_highlight): Added code - for mouse-face. Change the type of the first argument from `window' - to `List_Object'. + * xdisp.c (note_mode_line_or_margin_highlight): Add code + for mouse-face. Change the type of the first argument from `window' + to `Lisp_Object'. (note_mouse_highlight): Call note_mode_line_or_margin_highlight with window instead of w. @@ -79,8 +229,7 @@ 2005-05-16 Andreas Schwab <schwab@suse.de> - * unexmacosx.c (unexec_realloc): Move declarations before - statements. + * unexmacosx.c (unexec_realloc): Move declarations before statements. 2005-05-14 Richard M. Stallman <rms@gnu.org> @@ -108,8 +257,8 @@ * emacs.c (main) [MAC_OS8]: Call init_atimer before mac_term_init. - * keyboard.c (readable_events) [USE_TOOLKIT_SCROLL_BARS]: Regard - toolkit scroll bar thumb drag events as squeezable and prevent + * keyboard.c (readable_events) [USE_TOOLKIT_SCROLL_BARS]: + Regard toolkit scroll bar thumb drag events as squeezable and prevent redisplay from being paused by them. * mac.c [!MAC_OSX]: Include keyboard.h and syssignal.h. @@ -117,12 +266,11 @@ [!MAC_OSX] (check_alarm, pause, index): Remove functions. [!MAC_OSX && __MRC__] (sys_strftime): Likewise. [!MAC_OSX] (select): If fd 0 is not set in rfds and some input - event occurs before timeout, behave as if the function were - interrupted. + event occurs before timeout, behave as if the function were interrupted. [!MAC_OSX] (sigblock, sigsetmask, alarm): Simulate SIGALRM handling using Time Manager routines. - [!MAC_OSX] (mac_atimer_task, mac_atimer_qlink, signal_mask): New - variables. + [!MAC_OSX] (mac_atimer_task, mac_atimer_qlink, signal_mask): + New variables. [!MAC_OSX] (mac_atimer_handler, set_mac_atimer, remove_mac_atimer) (setitimer): New functions. @@ -136,8 +284,8 @@ (x_scroll_bar_handle_click): Change type of second argument from int to ControlPartCode. (check_alarm): Remove declaration. - (XTread_Socket) [!TARGET_API_MAC_CARBON]: Don't call it. - (XTread_Socket): Use ControlPartCode instead of SInt16. + (XTread_socket) [!TARGET_API_MAC_CARBON]: Don't call it. + (XTread_socket): Use ControlPartCode instead of SInt16. 2005-05-13 Nozomu Ando <nand@mac.com> @@ -1941,7 +2089,7 @@ 2005-01-13 Kim F. Storm <storm@cua.dk> * xdisp.c (Fformat_mode_line): Fix last change. Remove NO_PROPS arg - (specify 0 for FACE instead). Reorder arg list. Doc fix. + (specify 0 for FACE instead). Reorder arg list. Doc fix. 2005-01-12 Richard M. Stallman <rms@gnu.org> @@ -2092,7 +2240,7 @@ fontp->space_width to FONT_WIDTH so they are valid. * w32fns.c (w32_load_system_font): Set FONT_WIDTH to maximum, not - average width. Set fontp->average_width and fontp->space_width to + average width. Set fontp->average_width and fontp->space_width to their appropriate values. * w32term.c (x_new_font): Set FRAME_COLUMN_WIDTH to @@ -2119,7 +2267,7 @@ * xdisp.c (setup_for_ellipsis, get_next_display_element): Set it->ellipsis_p to 1 or 0. (display_line): Record whether row ends in mid-ellipsis. - (set_cursor_from_row): If ends in ellipsis. find start of it. + (set_cursor_from_row): If ends in ellipsis, find start of it. (cursor_row_p): If PT's at the end of the ellipsis the row ends within, don't display cursor on this row. @@ -2822,7 +2970,7 @@ * fringe.c (update_window_fringes): Prefer truncation bitmaps over angle bitmaps at top/bottom line. - * xdisp.c: Undo recent changes for restoring saved_face_id. Instead, + * xdisp.c: Undo recent changes for restoring saved_face_id. Instead, set it when it->method is set to next_element_from_display_vector. (setup_for_ellipsis): Add LEN argument. Callers changed. Set it->saved_face_id. @@ -3018,7 +3166,7 @@ * xfns.c (Fx_file_dialog): Call popup_activated instead of x_menu_in_use. Call x_menu_set_in_use in Motif version also. - * xterm.h: (x_menu_in_use): Remove. + * xterm.h (x_menu_in_use): Remove. 2004-11-16 Richard M. Stallman <rms@gnu.org> @@ -3152,7 +3300,7 @@ (MR_PARTIALLY_VISIBLE_AT_BOTTOM): New helper macros. (MATRIX_ROW_PARTIALLY_VISIBLE_P): Fix to return false if invisible part of last line is only extra line spacing (so the text on the - line is fully visible). Use helper macros. + line is fully visible). Use helper macros. Add W arg (to use them). All callers changed. (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P) (MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P): Use helper macros. @@ -3833,7 +3981,7 @@ * keyboard.c (timer_resume_idle): New function to resume idle timer without resetting timers on the idle list. - (read_char): Use timer_resume_idle. Remove local var last_idle_start. + (read_char): Use timer_resume_idle. Remove local var last_idle_start. (timer_start_idle, timer_stop_idle): Declare static. (read_key_sequence): Use timer_resume_idle instead of timer_start_idle. @@ -4976,7 +5124,7 @@ 2004-06-11 Kenichi Handa <handa@m17n.org> - * coding.c (decode_coding_string): Check CODING_FINISH_INTERRUPT. + * coding.c (encode_coding_string): Check CODING_FINISH_INTERRUPT. 2004-06-11 Kim F. Storm <storm@cua.dk> @@ -5907,7 +6055,7 @@ elt_prefix combined with Fsingle_key_description. (describe_vector): Declare static. Replace arg `elt_prefix' with `prefix'. Add KEYMAP_P arg. Add local var `elt_prefix'; use it - if !KEYMAP_P. Use Fkey_description with prefix instead of + if !KEYMAP_P. Use Fkey_description with prefix instead of Fsingle_key_description. * keymap.h (Fkey_description): Fix prototype. @@ -6122,7 +6270,7 @@ (display_mode_line): Set mode_line_p before displaying line. (calc_pixel_width_or_height): Declare extern. Add separate :align-to handling. Remove complex cases for fringes and scroll-bars. - Add left, right, and center alignment positions. Add text (area) + Add left, right, and center alignment positions. Add text (area) width/height. Return width or height for image specs. (produce_stretch_glyph): Improve handling of :align-to. Is now relative to left of text area by default, but other base offsets @@ -10430,7 +10578,7 @@ * intervals.h (CHECK_TOTAL_LENGTH): New macro. * intervals.c: Add many calls to CHECK_TOTAL_LENGTH. - * alloc.c: (VALIDATE_LISP_STORAGE): Macro deleted. + * alloc.c (VALIDATE_LISP_STORAGE): Macro deleted. All calls deleted. (lisp_malloc): Do the work here directly. @@ -10589,7 +10737,7 @@ (syms_of_w32fns): Don't intern/staticpro removed vars. * w32term.c: Remove unnecessary extern declarations. - (x_fullscreen_adjust): Remove. Use generic instead. + (x_fullscreen_adjust): Remove. Use generic instead. (x_redisplay_interface): Add w32_frame_parm_handlers member. * w32reg.c (x_get_string_resource): Use XrmDatabase. @@ -11815,9 +11963,9 @@ 2003-01-21 David Ponce <david@dponce.com> * w32term.c (w32_encode_char): For DIM=1 charset, set - ccl->reg[2] to -1 before calling ccl_driver. (Sync. with xterm.c - x_encode_char change by Kenichi Handa <handa@m17n.org> on - 2002-09-30.) + ccl->reg[2] to -1 before calling ccl_driver. + (Sync. with xterm.c x_encode_char change by Kenichi Handa + <handa@m17n.org> on 2002-09-30.) (w32_draw_relief_rect): Declare all args. (w32_define_cursor): New. @@ -14500,7 +14648,7 @@ 2002-06-27 Kim F. Storm <storm@cua.dk> - * xdisp.c: (mode_line_string_list, mode_line_string_face) + * xdisp.c (mode_line_string_list, mode_line_string_face) (mode_line_string_face_prop): New variables. (store_mode_line_string): New function. (display_mode_element): Use store_mode_line_string to @@ -14543,7 +14691,7 @@ 2002-06-24 Juanma Barranquero <lektu@terra.es> - * w32select.c: Include composite.h + * w32select.c: Include composite.h. * w16select.c: Likewise. @@ -15534,7 +15682,7 @@ * config.in: Add HAVE_SHARED_GAME_DIR. - * callproc.c: (Vgame_score_directory): New variable. + * callproc.c (Vgame_score_directory): New variable. (syms_of_callproc) <Vgame_score_directory>: DEFVAR_LISP. 2002-04-10 Richard M. Stallman <rms@gnu.org> @@ -16082,7 +16230,7 @@ * xterm.h (x_session_check_input, x_session_initialize): Declare. - * xterm.c: (XTread_socket): Add call to x_session_check_input and + * xterm.c (XTread_socket): Add call to x_session_check_input and x_session_have_connection. (x_initialize): Add call to x_session_initialize. @@ -16499,10 +16647,10 @@ 2002-02-17 Kim F. Storm <storm@cua.dk> - * frame.c: (Vmouse_highlight): New variable. + * frame.c (Vmouse_highlight): New variable. (syms_of_frame): DEFVAR_LISP it. - * frame.h: (Vmouse_highlight): Declare extern. + * frame.h (Vmouse_highlight): Declare extern. * xterm.h (struct x_display_info): Add mouse_face_hidden. @@ -18027,7 +18175,7 @@ 2001-11-16 Eli Zaretskii <eliz@is.elta.co.il> - * syswait.h: (HAVE_SYS_WAIT_H): Undef for ISC 4.1. Reported by + * syswait.h (HAVE_SYS_WAIT_H): Undef for ISC 4.1. Reported by Andrew Wiseman <a.wiseman@btclick.com>. 2001-11-16 Kim F. Storm <storm@cua.dk> @@ -18715,7 +18863,7 @@ * xterm.c: Fix typo in a comment. - * lisp.h: (gdb_lisp_params): Remove code in #if 0 which is now in + * lisp.h (gdb_lisp_params): Remove code in #if 0 which is now in emacs.c. 2001-10-27 Gerd Moellmann <gerd@gnu.org> @@ -18839,7 +18987,7 @@ 2001-10-24 Pavel Jan,Am(Bk <Pavel@Janik.cz> - * xterm.c: (x_insert_glyphs): Remove unused variables `real_end' + * xterm.c (x_insert_glyphs): Remove unused variables `real_end' and `real_start'. (x_draw_image_foreground): Remove unused variables `mask' and `xgcv'. (glyph_rect): Remove unused variable `area'. @@ -18871,7 +19019,7 @@ (HAVE_BOXES): Fix typo in comment. (push_menu_pane): Fix typo in comment. - * xdisp.c: (display_prop_string_p): Remove unused local declaration + * xdisp.c (display_prop_string_p): Remove unused local declaration of `Qwhen'. (single_display_prop_string_p): Remove unused local declarations of `Qwhen' and `Qmargin'. diff --git a/src/buffer.c b/src/buffer.c index d9769ce10ab..a8daebc3088 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -878,20 +878,23 @@ DEFUN ("buffer-local-value", Fbuffer_local_value, Sbuffer_local_value, 2, 2, 0, doc: /* Return the value of VARIABLE in BUFFER. If VARIABLE does not have a buffer-local binding in BUFFER, the value -is the default binding of variable. */) - (symbol, buffer) - register Lisp_Object symbol; +is the default binding of the variable. */) + (variable, buffer) + register Lisp_Object variable; register Lisp_Object buffer; { register struct buffer *buf; register Lisp_Object result; - CHECK_SYMBOL (symbol); + CHECK_SYMBOL (variable); CHECK_BUFFER (buffer); buf = XBUFFER (buffer); + if (SYMBOLP (variable)) + variable = indirect_variable (variable); + /* Look in local_var_list */ - result = Fassoc (symbol, buf->local_var_alist); + result = Fassoc (variable, buf->local_var_alist); if (NILP (result)) { int offset, idx; @@ -906,7 +909,7 @@ is the default binding of variable. */) idx = PER_BUFFER_IDX (offset); if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) && SYMBOLP (PER_BUFFER_SYMBOL (offset)) - && EQ (PER_BUFFER_SYMBOL (offset), symbol)) + && EQ (PER_BUFFER_SYMBOL (offset), variable)) { result = PER_BUFFER_VALUE (buf, offset); found = 1; @@ -915,7 +918,7 @@ is the default binding of variable. */) } if (!found) - result = Fdefault_value (symbol); + result = Fdefault_value (variable); } else { @@ -923,7 +926,7 @@ is the default binding of variable. */) Lisp_Object current_alist_element; /* What binding is loaded right now? */ - valcontents = SYMBOL_VALUE (symbol); + valcontents = SYMBOL_VALUE (variable); current_alist_element = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); @@ -940,7 +943,7 @@ is the default binding of variable. */) } if (EQ (result, Qunbound)) - return Fsignal (Qvoid_variable, Fcons (symbol, Qnil)); + return Fsignal (Qvoid_variable, Fcons (variable, Qnil)); return result; } @@ -5292,19 +5295,19 @@ This is the same as (default-value 'abbrev-mode). */); doc: /* Default value of `ctl-arrow' for buffers that do not override it. This is the same as (default-value 'ctl-arrow). */); - DEFVAR_LISP_NOPRO ("default-direction-reversed", - &buffer_defaults.direction_reversed, - doc: /* Default value of `direction-reversed' for buffers that do not override it. + DEFVAR_LISP_NOPRO ("default-direction-reversed", + &buffer_defaults.direction_reversed, + doc: /* Default value of `direction-reversed' for buffers that do not override it. This is the same as (default-value 'direction-reversed). */); - DEFVAR_LISP_NOPRO ("default-enable-multibyte-characters", - &buffer_defaults.enable_multibyte_characters, - doc: /* *Default value of `enable-multibyte-characters' for buffers not overriding it. + DEFVAR_LISP_NOPRO ("default-enable-multibyte-characters", + &buffer_defaults.enable_multibyte_characters, + doc: /* *Default value of `enable-multibyte-characters' for buffers not overriding it. This is the same as (default-value 'enable-multibyte-characters). */); - DEFVAR_LISP_NOPRO ("default-buffer-file-coding-system", - &buffer_defaults.buffer_file_coding_system, - doc: /* Default value of `buffer-file-coding-system' for buffers not overriding it. + DEFVAR_LISP_NOPRO ("default-buffer-file-coding-system", + &buffer_defaults.buffer_file_coding_system, + doc: /* Default value of `buffer-file-coding-system' for buffers not overriding it. This is the same as (default-value 'buffer-file-coding-system). */); DEFVAR_LISP_NOPRO ("default-truncate-lines", diff --git a/src/bytecode.c b/src/bytecode.c index d130b3b3d42..80fb5e2208e 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -384,8 +384,11 @@ unmark_byte_stack () do { \ if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \ { \ + Lisp_Object flag = Vquit_flag; \ Vquit_flag = Qnil; \ BEFORE_POTENTIAL_GC (); \ + if (EQ (Vthrow_on_input, flag)) \ + Fthrow (Vthrow_on_input, Qnil); \ Fsignal (Qquit, Qnil); \ AFTER_POTENTIAL_GC (); \ } \ diff --git a/src/callproc.c b/src/callproc.c index c410b5a121b..524f6a6a078 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -218,9 +218,10 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) int fd[2]; int filefd; register int pid; - char buf[16384]; - char *bufptr = buf; - int bufsize = sizeof buf; +#define CALLPROC_BUFFER_SIZE_MIN (16 * 1024) +#define CALLPROC_BUFFER_SIZE_MAX (4 * CALLPROC_BUFFER_SIZE_MIN) + char buf[CALLPROC_BUFFER_SIZE_MAX]; + int bufsize = CALLPROC_BUFFER_SIZE_MIN; int count = SPECPDL_INDEX (); register const unsigned char **new_argv @@ -753,7 +754,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) nread = carryover; while (nread < bufsize - 1024) { - int this_read = emacs_read (fd[0], bufptr + nread, + int this_read = emacs_read (fd[0], buf + nread, bufsize - nread); if (this_read < 0) @@ -779,7 +780,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) { if (NILP (current_buffer->enable_multibyte_characters) && ! CODING_MAY_REQUIRE_DECODING (&process_coding)) - insert_1_both (bufptr, nread, nread, 0, 1, 0); + insert_1_both (buf, nread, nread, 0, 1, 0); else { /* We have to decode the input. */ Lisp_Object buf; @@ -826,17 +827,13 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) if (process_coding.mode & CODING_MODE_LAST_BLOCK) break; +#if (CALLPROC_BUFFER_SIZE_MIN != CALLPROC_BUFFER_SIZE_MAX) /* Make the buffer bigger as we continue to read more data, - but not past 64k. */ - if (bufsize < 64 * 1024 && total_read > 32 * bufsize) - { - char *tempptr; - bufsize *= 2; - - tempptr = (char *) alloca (bufsize); - bcopy (bufptr, tempptr, bufsize / 2); - bufptr = tempptr; - } + but not past CALLPROC_BUFFER_SIZE_MAX. */ + if (bufsize < CALLPROC_BUFFER_SIZE_MAX && total_read > 32 * bufsize) + if ((bufsize *= 2) > CALLPROC_BUFFER_SIZE_MAX) + bufsize = CALLPROC_BUFFER_SIZE_MAX; +#endif if (display_p) { diff --git a/src/ccl.c b/src/ccl.c index 71a08fdf7c7..c5d4e4165c1 100644 --- a/src/ccl.c +++ b/src/ccl.c @@ -55,10 +55,12 @@ Lisp_Object Qcode_conversion_map_id; Lisp_Object Qccl_program_idx; /* Table of registered CCL programs. Each element is a vector of - NAME, CCL_PROG, and RESOLVEDP where NAME (symbol) is the name of - the program, CCL_PROG (vector) is the compiled code of the program, - RESOLVEDP (t or nil) is the flag to tell if symbols in CCL_PROG is - already resolved to index numbers or not. */ + NAME, CCL_PROG, RESOLVEDP, and UPDATEDP, where NAME (symbol) is the + name of the program, CCL_PROG (vector) is the compiled code of the + program, RESOLVEDP (t or nil) is the flag to tell if symbols in + CCL_PROG is already resolved to index numbers or not, UPDATEDP (t + or nil) is the flat to tell if the CCL program is updated after it + was once used. */ Lisp_Object Vccl_program_table; /* Vector of registered hash tables for translation. */ @@ -1850,14 +1852,16 @@ resolve_symbol_ccl_program (ccl) symbols, return Qnil. */ static Lisp_Object -ccl_get_compiled_code (ccl_prog) +ccl_get_compiled_code (ccl_prog, idx) Lisp_Object ccl_prog; + int *idx; { Lisp_Object val, slot; if (VECTORP (ccl_prog)) { val = resolve_symbol_ccl_program (ccl_prog); + *idx = -1; return (VECTORP (val) ? val : Qnil); } if (!SYMBOLP (ccl_prog)) @@ -1869,9 +1873,10 @@ ccl_get_compiled_code (ccl_prog) return Qnil; slot = AREF (Vccl_program_table, XINT (val)); if (! VECTORP (slot) - || ASIZE (slot) != 3 + || ASIZE (slot) != 4 || ! VECTORP (AREF (slot, 1))) return Qnil; + *idx = XINT (val); if (NILP (AREF (slot, 2))) { val = resolve_symbol_ccl_program (AREF (slot, 1)); @@ -1900,7 +1905,7 @@ setup_ccl_program (ccl, ccl_prog) { struct Lisp_Vector *vp; - ccl_prog = ccl_get_compiled_code (ccl_prog); + ccl_prog = ccl_get_compiled_code (ccl_prog, &ccl->idx); if (! VECTORP (ccl_prog)) return -1; vp = XVECTOR (ccl_prog); @@ -1908,6 +1913,13 @@ setup_ccl_program (ccl, ccl_prog) ccl->prog = vp->contents; ccl->eof_ic = XINT (vp->contents[CCL_HEADER_EOF]); ccl->buf_magnification = XINT (vp->contents[CCL_HEADER_BUF_MAG]); + if (ccl->idx >= 0) + { + Lisp_Object slot; + + slot = AREF (Vccl_program_table, ccl->idx); + ASET (slot, 3, Qnil); + } } ccl->ic = CCL_HEADER_MAIN; for (i = 0; i < 8; i++) @@ -1921,6 +1933,33 @@ setup_ccl_program (ccl, ccl_prog) return 0; } + +/* Check if CCL is updated or not. If not, re-setup members of CCL. */ + +int +check_ccl_update (ccl) + struct ccl_program *ccl; +{ + struct Lisp_Vector *vp; + Lisp_Object slot, ccl_prog; + + if (ccl->idx < 0) + return 0; + slot = AREF (Vccl_program_table, ccl->idx); + if (NILP (AREF (slot, 3))) + return 0; + ccl_prog = ccl_get_compiled_code (AREF (slot, 0), &ccl->idx); + if (! VECTORP (ccl_prog)) + return -1; + ccl->size = ASIZE (ccl_prog); + ccl->prog = XVECTOR (ccl_prog)->contents; + ccl->eof_ic = XINT (AREF (ccl_prog, CCL_HEADER_EOF)); + ccl->buf_magnification = XINT (AREF (ccl_prog, CCL_HEADER_BUF_MAG)); + ASET (slot, 3, Qnil); + return 0; +} + + DEFUN ("ccl-program-p", Fccl_program_p, Sccl_program_p, 1, 1, 0, doc: /* Return t if OBJECT is a CCL program name or a compiled CCL program code. See the documentation of `define-ccl-program' for the detail of CCL program. */) @@ -2178,8 +2217,9 @@ Return index number of the registered CCL program. */) if (EQ (name, AREF (slot, 0))) { /* Update this slot. */ - AREF (slot, 1) = ccl_prog; - AREF (slot, 2) = resolved; + ASET (slot, 1, ccl_prog); + ASET (slot, 2, resolved); + ASET (slot, 3, Qt); return make_number (idx); } } @@ -2192,19 +2232,19 @@ Return index number of the registered CCL program. */) new_table = Fmake_vector (make_number (len * 2), Qnil); for (j = 0; j < len; j++) - AREF (new_table, j) - = AREF (Vccl_program_table, j); + ASET (new_table, j, AREF (Vccl_program_table, j)); Vccl_program_table = new_table; } { Lisp_Object elt; - elt = Fmake_vector (make_number (3), Qnil); - AREF (elt, 0) = name; - AREF (elt, 1) = ccl_prog; - AREF (elt, 2) = resolved; - AREF (Vccl_program_table, idx) = elt; + elt = Fmake_vector (make_number (4), Qnil); + ASET (elt, 0, name); + ASET (elt, 1, ccl_prog); + ASET (elt, 2, resolved); + ASET (elt, 3, Qt); + ASET (Vccl_program_table, idx, elt); } Fput (name, Qccl_program_idx, make_number (idx)); diff --git a/src/ccl.h b/src/ccl.h index 5f57f1f7711..6d01beeb6b7 100644 --- a/src/ccl.h +++ b/src/ccl.h @@ -36,6 +36,10 @@ Boston, MA 02111-1307, USA. */ /* Structure to hold information about running CCL code. Read comments in the file ccl.c for the detail of each field. */ struct ccl_program { + int idx; /* Index number of the CCL program. + -1 means that the program was given + by a vector, not by a program + name. */ int size; /* Size of the compiled code. */ Lisp_Object *prog; /* Pointer into the compiled code. */ int ic; /* Instruction Counter (index for PROG). */ @@ -91,6 +95,9 @@ extern Lisp_Object Vfont_ccl_encoder_alist; execution of ccl program CCL_PROG (symbol or vector). */ extern int setup_ccl_program P_ ((struct ccl_program *, Lisp_Object)); +/* Check if CCL is updated or not. If not, re-setup members of CCL. */ +extern int check_ccl_update P_ ((struct ccl_program *)); + extern void ccl_driver P_ ((struct ccl_program *, int *, int *, int, int, Lisp_Object)); diff --git a/src/emacs.c b/src/emacs.c index 65a6d549845..013dd1c8918 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -44,6 +44,7 @@ Boston, MA 02111-1307, USA. */ #include <fcntl.h> #include <windows.h> /* just for w32.h */ #include "w32.h" +#include "w32heap.h" /* for prototype of sbrk */ #endif #include "lisp.h" diff --git a/src/eval.c b/src/eval.c index 7f043daa555..0eb1482ee0b 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2292,7 +2292,7 @@ static Lisp_Object run_hook_with_args P_ ((int, Lisp_Object *, enum run_hooks_condition)); DEFUN ("run-hooks", Frun_hooks, Srun_hooks, 0, MANY, 0, - doc: /* Run each hook in HOOKS. Major mode functions use this. + doc: /* Run each hook in HOOKS. Each argument should be a symbol, a hook variable. These symbols are processed in the order specified. If a hook symbol has a non-nil value, that value may be a function @@ -2300,6 +2300,9 @@ or a list of functions to be called to run the hook. If the value is a function, it is called with no arguments. If it is a list, the elements are called, in order, with no arguments. +Major modes should not use this function directly to run their mode +hook; they should use `run-mode-hooks' instead. + Do not use `make-local-variable' to make a hook variable buffer-local. Instead, use `add-hook' and specify t for the LOCAL argument. usage: (run-hooks &rest HOOKS) */) @@ -3127,10 +3130,10 @@ unbind_to (count, value) int count; Lisp_Object value; { - int quitf = !NILP (Vquit_flag); - struct gcpro gcpro1; + Lisp_Object quitf = Vquit_flag; + struct gcpro gcpro1, gcpro2; - GCPRO1 (value); + GCPRO2 (value, quitf); Vquit_flag = Qnil; while (specpdl_ptr != specpdl + count) @@ -3179,8 +3182,8 @@ unbind_to (count, value) } } - if (NILP (Vquit_flag) && quitf) - Vquit_flag = Qt; + if (NILP (Vquit_flag) && !NILP (quitf)) + Vquit_flag = quitf; UNGCPRO; return value; diff --git a/src/fileio.c b/src/fileio.c index 4a22cc0a59e..813c3033d67 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3750,7 +3750,7 @@ actually used. */) int set_coding_system = 0; Lisp_Object coding_system; int read_quit = 0; - int old_Vdeactivate_mark = Vdeactivate_mark; + Lisp_Object old_Vdeactivate_mark = Vdeactivate_mark; int we_locked_file = 0; if (current_buffer->base_buffer && ! NILP (visit)) diff --git a/src/fns.c b/src/fns.c index ec3c7a7281c..d8018216bd8 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2479,9 +2479,9 @@ mapcar1 (leni, vals, fn, seq) else /* Must be a list, since Flength did not get an error */ { tail = seq; - for (i = 0; i < leni; i++) + for (i = 0; i < leni && CONSP (tail); i++) { - dummy = call1 (fn, Fcar (tail)); + dummy = call1 (fn, XCAR (tail)); if (vals) vals[i] = dummy; tail = XCDR (tail); @@ -2521,7 +2521,7 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */) mapcar1 (leni, args, function, sequence); UNGCPRO; - for (i = leni - 1; i >= 0; i--) + for (i = leni - 1; i > 0; i--) args[i + i] = args[i]; for (i = 1; i < nargs; i += 2) diff --git a/src/image.c b/src/image.c index b61b07876d3..15e835fef3b 100644 --- a/src/image.c +++ b/src/image.c @@ -616,6 +616,10 @@ static struct image_type *image_types; Lisp_Object Vimage_types; +/* An alist of image types and libraries that implement the type. */ + +Lisp_Object Vimage_library_alist; + /* Cache for delayed-loading image types. */ static Lisp_Object Vimage_type_cache; @@ -696,7 +700,7 @@ lookup_image_type (symbol) struct image_type *type; /* We must initialize the image-type if it hasn't been already. */ - if (NILP (Finit_image_library (symbol, Qnil))) + if (NILP (Finit_image_library (symbol, Vimage_library_alist))) return 0; /* unimplemented */ for (type = image_types; type; type = type->next) @@ -7985,6 +7989,8 @@ of `image-library-alist', which see). */) void syms_of_image () { + extern Lisp_Object Qrisky_local_variable; /* Syms_of_xdisp has already run. */ + /* Must be defined now becase we're going to update it below, while defining the supported image types. */ DEFVAR_LISP ("image-types", &Vimage_types, @@ -7993,6 +7999,20 @@ Each element of the list is a symbol for a image type, like 'jpeg or 'png. To check whether it is really supported, use `image-type-available-p'. */); Vimage_types = Qnil; + DEFVAR_LISP ("image-library-alist", &Vimage_library_alist, + doc: /* Alist of image types vs external libraries needed to display them. + +Each element is a list (IMAGE-TYPE LIBRARY...), where the car is a symbol +representing a supported image type, and the rest are strings giving +alternate filenames for the corresponding external libraries. + +Emacs tries to load the libraries in the order they appear on the +list; if none is loaded, the running session of Emacs won't +support the image type. Types 'pbm and 'xbm don't need to be +listed; they're always supported. */); + Vimage_library_alist = Qnil; + Fput (intern ("image-library-alist"), Qrisky_local_variable, Qt); + Vimage_type_cache = Qnil; staticpro (&Vimage_type_cache); diff --git a/src/keyboard.c b/src/keyboard.c index 0e7fb1c2719..31c0b5d709c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1020,7 +1020,7 @@ DEFUN ("recursive-edit", Frecursive_edit, Srecursive_edit, 0, 0, "", doc: /* Invoke the editor command loop recursively. To get out of the recursive edit, a command can do `(throw 'exit nil)'; that tells this function to return. -Alternately, `(throw 'exit t)' makes this function signal an error. +Alternatively, `(throw 'exit t)' makes this function signal an error. This function is called by the editor initialization to begin editing. */) () { @@ -10546,7 +10546,7 @@ The elements of this list correspond to the arguments of DEFUN ("posn-at-x-y", Fposn_at_x_y, Sposn_at_x_y, 2, 4, 0, doc: /* Return position information for pixel coordinates X and Y. By default, X and Y are relative to text area of the selected window. -Optional third arg FRAME_OR_WINDOW non-nil specifies frame or window. +Optional third arg FRAME-OR-WINDOW non-nil specifies frame or window. If optional fourth arg WHOLE is non-nil, X is relative to the left edge of the window. @@ -10846,7 +10846,7 @@ syms_of_keyboard () staticpro (&Qdrag_n_drop); Qsave_session = intern ("save-session"); - staticpro(&Qsave_session); + staticpro (&Qsave_session); Qusr1_signal = intern ("usr1-signal"); staticpro (&Qusr1_signal); diff --git a/src/macmenu.c b/src/macmenu.c index 54393bca594..e97a968d92d 100644 --- a/src/macmenu.c +++ b/src/macmenu.c @@ -602,6 +602,13 @@ list_of_items (pane) } } +static Lisp_Object +cleanup_popup_menu (arg) + Lisp_Object arg; +{ + discard_menu_items (); +} + DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0, doc: /* Pop up a deck-of-cards menu and return user's selection. POSITION is a position specification. This is either a mouse button @@ -647,6 +654,8 @@ cached information about equivalent key sequences. */) int keymaps = 0; int for_click = 0; struct gcpro gcpro1; + int specpdl_count = SPECPDL_INDEX (); + #ifdef HAVE_MENUS if (! NILP (position)) @@ -806,13 +815,13 @@ cached information about equivalent key sequences. */) #ifdef HAVE_MENUS /* Display them in a menu. */ + record_unwind_protect (cleanup_popup_menu, Qnil); BLOCK_INPUT; selection = mac_menu_show (f, xpos, ypos, for_click, keymaps, title, &error_name); UNBLOCK_INPUT; - - discard_menu_items (); + unbind_to (specpdl_count, Qnil); UNGCPRO; #endif /* HAVE_MENUS */ @@ -1931,6 +1940,9 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) } } } + else if (!for_click) + /* Make "Cancel" equivalent to C-g. */ + Fsignal (Qquit, Qnil); return Qnil; } diff --git a/src/macterm.c b/src/macterm.c index e79803f7c4d..13d8fb455d8 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -6277,9 +6277,10 @@ mac_to_x_fontname (name, size, style, charset) strcpy(family, name); } - sprintf(xf, "-%s-%s-%s-%c-normal--%d-%d-75-75-m-%d-%s", + sprintf(xf, "-%s-%s-%s-%c-normal--%d-%d-%d-%d-m-%d-%s", foundry, family, style & bold ? "bold" : "medium", - style & italic ? 'i' : 'r', size, size * 10, size * 10, charset); + style & italic ? 'i' : 'r', size, size * 10, + size ? 75 : 0, size ? 75 : 0, size * 10, charset); result = (char *) xmalloc (strlen (xf) + 1); strcpy (result, xf); @@ -6738,7 +6739,7 @@ mac_do_list_fonts (pattern, maxnames) break; } else if (scl_val[XLFD_SCL_PIXEL_SIZE] > 0 - && (ptr = strstr (font_name_table[i], "-0-0-75-75-m-0-"))) + && (ptr = strstr (font_name_table[i], "-0-0-0-0-m-0-"))) { int former_len = ptr - font_name_table[i]; @@ -6748,7 +6749,7 @@ mac_do_list_fonts (pattern, maxnames) scl_val[XLFD_SCL_PIXEL_SIZE], scl_val[XLFD_SCL_POINT_SIZE], scl_val[XLFD_SCL_AVGWIDTH], - ptr + sizeof ("-0-0-75-75-m-0-") - 1); + ptr + sizeof ("-0-0-0-0-m-0-") - 1); fontname = mac_c_string_match (pattern_regex, scaled, nonspecial, exact); if (!NILP (fontname)) diff --git a/src/makefile.w32-in b/src/makefile.w32-in index bd8b3ba1e36..553ebb72abb 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -42,6 +42,8 @@ TOBJ = $(BLD)/firstfile.$(O) TRES = $(BLD)/emacs.res TLASTLIB = $(BLD)/lastfile.$(A) +DOC = $(OBJDIR)/etc/DOC-X + FULL_LINK_FLAGS = $(LINK_FLAGS) $(TEMACS_EXTRA_LINK) # diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index 709b32f1452..998c1f7cf05 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h @@ -354,7 +354,9 @@ Boston, MA 02111-1307, USA. */ #define fcloseall _fcloseall #define fdopen _fdopen #define fgetchar _fgetchar +#ifndef fileno #define fileno _fileno +#endif #define flushall _flushall #define fputchar _fputchar #define fsync _commit diff --git a/src/w32.c b/src/w32.c index cdc41a8c772..1bb4a91ff03 100644 --- a/src/w32.c +++ b/src/w32.c @@ -1273,7 +1273,7 @@ get_emacs_configuration_options (void) void gettimeofday (struct timeval *tv, struct timezone *tz) { - struct timeb tb; + struct _timeb tb; _ftime (&tb); tv->tv_sec = tb.time; @@ -1777,7 +1777,7 @@ open_unc_volume (const char *path) nr.dwDisplayType = RESOURCEDISPLAYTYPE_SERVER; nr.dwUsage = RESOURCEUSAGE_CONTAINER; nr.lpLocalName = NULL; - nr.lpRemoteName = map_w32_filename (path, NULL); + nr.lpRemoteName = (LPSTR)map_w32_filename (path, NULL); nr.lpComment = NULL; nr.lpProvider = NULL; @@ -3207,7 +3207,7 @@ sys_shutdown (int s, int how) } int -sys_setsockopt (int s, int level, int optname, const char * optval, int optlen) +sys_setsockopt (int s, int level, int optname, const void * optval, int optlen) { if (winsock_lib == NULL) { @@ -3219,7 +3219,7 @@ sys_setsockopt (int s, int level, int optname, const char * optval, int optlen) if (fd_info[s].flags & FILE_SOCKET) { int rc = pfn_setsockopt (SOCK_HANDLE (s), level, optname, - optval, optlen); + (const char *)optval, optlen); if (rc == SOCKET_ERROR) set_errno (); return rc; diff --git a/src/xdisp.c b/src/xdisp.c index 2781d4a1d2c..6ad0bb9166a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -846,8 +846,8 @@ static struct text_pos run_window_scroll_functions P_ ((Lisp_Object, struct text_pos)); static void reconsider_clip_changes P_ ((struct window *, struct buffer *)); static int text_outside_line_unchanged_p P_ ((struct window *, int, int)); -static void store_frame_title_char P_ ((char)); -static int store_frame_title P_ ((const unsigned char *, int, int)); +static void store_mode_line_noprop_char P_ ((char)); +static int store_mode_line_noprop P_ ((const unsigned char *, int, int)); static void x_consider_frame_title P_ ((Lisp_Object)); static void handle_stop P_ ((struct it *)); static int tool_bar_lines_needed P_ ((struct frame *)); @@ -8271,52 +8271,126 @@ echo_area_display (update_frame_p) /*********************************************************************** - Frame Titles + Mode Lines and Frame Titles ***********************************************************************/ +/* A buffer for constructing non-propertized mode-line strings and + frame titles in it; allocated from the heap in init_xdisp and + resized as needed in store_mode_line_noprop_char. */ -/* The frame title buffering code is also used by Fformat_mode_line. - So it is not conditioned by HAVE_WINDOW_SYSTEM. */ +static char *mode_line_noprop_buf; -/* A buffer for constructing frame titles in it; allocated from the - heap in init_xdisp and resized as needed in store_frame_title_char. */ +/* The buffer's end, and a current output position in it. */ -static char *frame_title_buf; +static char *mode_line_noprop_buf_end; +static char *mode_line_noprop_ptr; -/* The buffer's end, and a current output position in it. */ +#define MODE_LINE_NOPROP_LEN(start) \ + ((mode_line_noprop_ptr - mode_line_noprop_buf) - start) + +static enum { + MODE_LINE_DISPLAY = 0, + MODE_LINE_TITLE, + MODE_LINE_NOPROP, + MODE_LINE_STRING +} mode_line_target; + +/* Alist that caches the results of :propertize. + Each element is (PROPERTIZED-STRING . PROPERTY-LIST). */ +static Lisp_Object mode_line_proptrans_alist; + +/* List of strings making up the mode-line. */ +static Lisp_Object mode_line_string_list; -static char *frame_title_buf_end; -static char *frame_title_ptr; +/* Base face property when building propertized mode line string. */ +static Lisp_Object mode_line_string_face; +static Lisp_Object mode_line_string_face_prop; + + +/* Unwind data for mode line strings */ +static Lisp_Object Vmode_line_unwind_vector; -/* Store a single character C for the frame title in frame_title_buf. - Re-allocate frame_title_buf if necessary. */ +static Lisp_Object +format_mode_line_unwind_data (obuf) + struct buffer *obuf; +{ + int i = 0; + Lisp_Object vector; + + /* Reduce consing by keeping one vector in + Vwith_echo_area_save_vector. */ + vector = Vmode_line_unwind_vector; + Vmode_line_unwind_vector = Qnil; + + if (NILP (vector)) + vector = Fmake_vector (make_number (7), Qnil); + + AREF (vector, 0) = make_number (mode_line_target); + AREF (vector, 1) = make_number (MODE_LINE_NOPROP_LEN (0)); + AREF (vector, 2) = mode_line_string_list; + AREF (vector, 3) = mode_line_proptrans_alist; + AREF (vector, 4) = mode_line_string_face; + AREF (vector, 5) = mode_line_string_face_prop; + + if (obuf) + XSETBUFFER (AREF (vector, 6), obuf); + else + AREF (vector, 6) = Qnil; + + return vector; +} + +static Lisp_Object +unwind_format_mode_line (vector) + Lisp_Object vector; +{ + mode_line_target = XINT (AREF (vector, 0)); + mode_line_noprop_ptr = mode_line_noprop_buf + XINT (AREF (vector, 1)); + mode_line_string_list = AREF (vector, 2); + mode_line_proptrans_alist = AREF (vector, 3); + mode_line_string_face = AREF (vector, 4); + mode_line_string_face_prop = AREF (vector, 5); + + if (!NILP (AREF (vector, 6))) + { + set_buffer_internal_1 (XBUFFER (AREF (vector, 6))); + AREF (vector, 6) = Qnil; + } + + Vmode_line_unwind_vector = vector; + return Qnil; +} + + +/* Store a single character C for the frame title in mode_line_noprop_buf. + Re-allocate mode_line_noprop_buf if necessary. */ static void #ifdef PROTOTYPES -store_frame_title_char (char c) +store_mode_line_noprop_char (char c) #else -store_frame_title_char (c) +store_mode_line_noprop_char (c) char c; #endif { /* If output position has reached the end of the allocated buffer, double the buffer's size. */ - if (frame_title_ptr == frame_title_buf_end) + if (mode_line_noprop_ptr == mode_line_noprop_buf_end) { - int len = frame_title_ptr - frame_title_buf; - int new_size = 2 * len * sizeof *frame_title_buf; - frame_title_buf = (char *) xrealloc (frame_title_buf, new_size); - frame_title_buf_end = frame_title_buf + new_size; - frame_title_ptr = frame_title_buf + len; + int len = MODE_LINE_NOPROP_LEN (0); + int new_size = 2 * len * sizeof *mode_line_noprop_buf; + mode_line_noprop_buf = (char *) xrealloc (mode_line_noprop_buf, new_size); + mode_line_noprop_buf_end = mode_line_noprop_buf + new_size; + mode_line_noprop_ptr = mode_line_noprop_buf + len; } - *frame_title_ptr++ = c; + *mode_line_noprop_ptr++ = c; } -/* Store part of a frame title in frame_title_buf, beginning at - frame_title_ptr. STR is the string to store. Do not copy +/* Store part of a frame title in mode_line_noprop_buf, beginning at + mode_line_noprop_ptr. STR is the string to store. Do not copy characters that yield more columns than PRECISION; PRECISION <= 0 means copy the whole string. Pad with spaces until FIELD_WIDTH number of characters have been copied; FIELD_WIDTH <= 0 means don't @@ -8324,7 +8398,7 @@ store_frame_title_char (c) frame title. */ static int -store_frame_title (str, field_width, precision) +store_mode_line_noprop (str, field_width, precision) const unsigned char *str; int field_width, precision; { @@ -8335,19 +8409,23 @@ store_frame_title (str, field_width, precision) nbytes = strlen (str); n += c_string_width (str, nbytes, precision, &dummy, &nbytes); while (nbytes--) - store_frame_title_char (*str++); + store_mode_line_noprop_char (*str++); /* Fill up with spaces until FIELD_WIDTH reached. */ while (field_width > 0 && n < field_width) { - store_frame_title_char (' '); + store_mode_line_noprop_char (' '); ++n; } return n; } +/*********************************************************************** + Frame Titles + ***********************************************************************/ + #ifdef HAVE_WINDOW_SYSTEM /* Set the title of FRAME, if it has changed. The title format is @@ -8367,9 +8445,11 @@ x_consider_frame_title (frame) /* Do we have more than one visible frame on this X display? */ Lisp_Object tail; Lisp_Object fmt; - struct buffer *obuf; + int title_start; + char *title; int len; struct it it; + int count = SPECPDL_INDEX (); for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) { @@ -8388,18 +8468,22 @@ x_consider_frame_title (frame) multiple_frames = CONSP (tail); /* Switch to the buffer of selected window of the frame. Set up - frame_title_ptr so that display_mode_element will output into it; - then display the title. */ - obuf = current_buffer; + mode_line_target so that display_mode_element will output into + mode_line_noprop_buf; then display the title. */ + record_unwind_protect (unwind_format_mode_line, + format_mode_line_unwind_data (current_buffer)); + set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->buffer)); fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; - frame_title_ptr = frame_title_buf; + + mode_line_target = MODE_LINE_TITLE; + title_start = MODE_LINE_NOPROP_LEN (0); init_iterator (&it, XWINDOW (f->selected_window), -1, -1, NULL, DEFAULT_FACE_ID); display_mode_element (&it, 0, -1, -1, fmt, Qnil, 0); - len = frame_title_ptr - frame_title_buf; - frame_title_ptr = NULL; - set_buffer_internal_1 (obuf); + len = MODE_LINE_NOPROP_LEN (title_start); + title = mode_line_noprop_buf + title_start; + unbind_to (count, Qnil); /* Set the title only if it's changed. This avoids consing in the common case where it hasn't. (If it turns out that we've @@ -8408,8 +8492,8 @@ x_consider_frame_title (frame) higher level than this.) */ if (! STRINGP (f->name) || SBYTES (f->name) != len - || bcmp (frame_title_buf, SDATA (f->name), len) != 0) - x_implicitly_set_name (f, make_string (frame_title_buf, len), Qnil); + || bcmp (title, SDATA (f->name), len) != 0) + x_implicitly_set_name (f, make_string (title, len), Qnil); } } @@ -15693,6 +15777,7 @@ display_mode_line (w, face_id, format) { struct it it; struct face *face; + int count = SPECPDL_INDEX (); init_iterator (&it, w, -1, -1, NULL, face_id); prepare_desired_row (it.glyph_row); @@ -15703,6 +15788,11 @@ display_mode_line (w, face_id, format) /* Force the mode-line to be displayed in the default face. */ it.base_face_id = it.face_id = DEFAULT_FACE_ID; + record_unwind_protect (unwind_format_mode_line, + format_mode_line_unwind_data (NULL)); + + mode_line_target = MODE_LINE_DISPLAY; + /* Temporarily make frame's keyboard the current kboard so that kboard-local variables in the mode_line_format will get the right values. */ @@ -15710,6 +15800,8 @@ display_mode_line (w, face_id, format) display_mode_element (&it, 0, 0, 0, format, Qnil, 0); pop_frame_kboard (); + unbind_to (count, Qnil); + /* Fill up with spaces. */ display_string (" ", Qnil, Qnil, 0, 0, &it, 10000, -1, -1, 0); @@ -15732,18 +15824,6 @@ display_mode_line (w, face_id, format) return it.glyph_row->height; } -/* Alist that caches the results of :propertize. - Each element is (PROPERTIZED-STRING . PROPERTY-LIST). */ -Lisp_Object mode_line_proptrans_alist; - -/* List of strings making up the mode-line. */ -Lisp_Object mode_line_string_list; - -/* Base face property when building propertized mode line string. */ -static Lisp_Object mode_line_string_face; -static Lisp_Object mode_line_string_face_prop; - - /* Contribute ELT to the mode line for window IT->w. How it translates into text depends on its data type. @@ -15764,8 +15844,9 @@ static Lisp_Object mode_line_string_face_prop; If RISKY is nonzero, remove (disregard) any properties in any string we encounter, and ignore :eval and :propertize. - If the global variable `frame_title_ptr' is non-NULL, then the output - is passed to `store_frame_title' instead of `display_string'. */ + The global variable `mode_line_target' determines whether the + output is passed to `store_mode_line_noprop', + `store_mode_line_string', or `display_string'. */ static int display_mode_element (it, depth, field_width, precision, elt, props, risky) @@ -15854,21 +15935,27 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) if (literal) { prec = precision - n; - if (frame_title_ptr) - n += store_frame_title (SDATA (elt), -1, prec); - else if (!NILP (mode_line_string_list)) - n += store_mode_line_string (NULL, elt, 1, 0, prec, Qnil); - else - n += display_string (NULL, elt, Qnil, 0, 0, it, - 0, prec, 0, STRING_MULTIBYTE (elt)); + switch (mode_line_target) + { + case MODE_LINE_NOPROP: + case MODE_LINE_TITLE: + n += store_mode_line_noprop (SDATA (elt), -1, prec); + break; + case MODE_LINE_STRING: + n += store_mode_line_string (NULL, elt, 1, 0, prec, Qnil); + break; + case MODE_LINE_DISPLAY: + n += display_string (NULL, elt, Qnil, 0, 0, it, + 0, prec, 0, STRING_MULTIBYTE (elt)); + break; + } break; } while ((precision <= 0 || n < precision) && *this - && (frame_title_ptr - || !NILP (mode_line_string_list) + && (mode_line_target != MODE_LINE_DISPLAY || it->current_x < it->last_visible_x)) { const unsigned char *last = this; @@ -15889,29 +15976,36 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) prec = c_string_width (last, this - last, precision - n, &nchars, &nbytes); - if (frame_title_ptr) - n += store_frame_title (last, 0, prec); - else if (!NILP (mode_line_string_list)) + switch (mode_line_target) { - int bytepos = last - lisp_string; - int charpos = string_byte_to_char (elt, bytepos); - int endpos = (precision <= 0 - ? string_byte_to_char (elt, - this - lisp_string) - : charpos + nchars); - - n += store_mode_line_string (NULL, - Fsubstring (elt, make_number (charpos), - make_number (endpos)), - 0, 0, 0, Qnil); - } - else - { - int bytepos = last - lisp_string; - int charpos = string_byte_to_char (elt, bytepos); - n += display_string (NULL, elt, Qnil, 0, charpos, - it, 0, prec, 0, - STRING_MULTIBYTE (elt)); + case MODE_LINE_NOPROP: + case MODE_LINE_TITLE: + n += store_mode_line_noprop (last, 0, prec); + break; + case MODE_LINE_STRING: + { + int bytepos = last - lisp_string; + int charpos = string_byte_to_char (elt, bytepos); + int endpos = (precision <= 0 + ? string_byte_to_char (elt, + this - lisp_string) + : charpos + nchars); + + n += store_mode_line_string (NULL, + Fsubstring (elt, make_number (charpos), + make_number (endpos)), + 0, 0, 0, Qnil); + } + break; + case MODE_LINE_DISPLAY: + { + int bytepos = last - lisp_string; + int charpos = string_byte_to_char (elt, bytepos); + n += display_string (NULL, elt, Qnil, 0, charpos, + it, 0, prec, 0, + STRING_MULTIBYTE (elt)); + } + break; } } else /* c == '%' */ @@ -15949,44 +16043,51 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) spec = decode_mode_spec (it->w, c, field, prec, &multibyte); - if (frame_title_ptr) - n += store_frame_title (spec, field, prec); - else if (!NILP (mode_line_string_list)) - { - int len = strlen (spec); - Lisp_Object tem = make_string (spec, len); - props = Ftext_properties_at (make_number (charpos), elt); - /* Should only keep face property in props */ - n += store_mode_line_string (NULL, tem, 0, field, prec, props); - } - else + switch (mode_line_target) { - int nglyphs_before, nwritten; - - nglyphs_before = it->glyph_row->used[TEXT_AREA]; - nwritten = display_string (spec, Qnil, elt, - charpos, 0, it, - field, prec, 0, - multibyte); - - /* Assign to the glyphs written above the - string where the `%x' came from, position - of the `%'. */ - if (nwritten > 0) - { - struct glyph *glyph - = (it->glyph_row->glyphs[TEXT_AREA] - + nglyphs_before); - int i; - - for (i = 0; i < nwritten; ++i) - { - glyph[i].object = elt; - glyph[i].charpos = charpos; - } - - n += nwritten; - } + case MODE_LINE_NOPROP: + case MODE_LINE_TITLE: + n += store_mode_line_noprop (spec, field, prec); + break; + case MODE_LINE_STRING: + { + int len = strlen (spec); + Lisp_Object tem = make_string (spec, len); + props = Ftext_properties_at (make_number (charpos), elt); + /* Should only keep face property in props */ + n += store_mode_line_string (NULL, tem, 0, field, prec, props); + } + break; + case MODE_LINE_DISPLAY: + { + int nglyphs_before, nwritten; + + nglyphs_before = it->glyph_row->used[TEXT_AREA]; + nwritten = display_string (spec, Qnil, elt, + charpos, 0, it, + field, prec, 0, + multibyte); + + /* Assign to the glyphs written above the + string where the `%x' came from, position + of the `%'. */ + if (nwritten > 0) + { + struct glyph *glyph + = (it->glyph_row->glyphs[TEXT_AREA] + + nglyphs_before); + int i; + + for (i = 0; i < nwritten; ++i) + { + glyph[i].object = elt; + glyph[i].charpos = charpos; + } + + n += nwritten; + } + } + break; } } else /* c == 0 */ @@ -16157,13 +16258,20 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) /* Pad to FIELD_WIDTH. */ if (field_width > 0 && n < field_width) { - if (frame_title_ptr) - n += store_frame_title ("", field_width - n, 0); - else if (!NILP (mode_line_string_list)) - n += store_mode_line_string ("", Qnil, 0, field_width - n, 0, Qnil); - else - n += display_string ("", Qnil, Qnil, 0, 0, it, field_width - n, - 0, 0, 0); + switch (mode_line_target) + { + case MODE_LINE_NOPROP: + case MODE_LINE_TITLE: + n += store_mode_line_noprop ("", field_width - n, 0); + break; + case MODE_LINE_STRING: + n += store_mode_line_string ("", Qnil, 0, field_width - n, 0, Qnil); + break; + case MODE_LINE_DISPLAY: + n += display_string ("", Qnil, Qnil, 0, 0, it, field_width - n, + 0, 0, 0); + break; + } } return n; @@ -16295,6 +16403,9 @@ are the selected window and the window's buffer). */) struct buffer *old_buffer = NULL; int face_id = -1; int no_props = INTEGERP (face); + int count = SPECPDL_INDEX (); + Lisp_Object str; + int string_start = 0; if (NILP (window)) window = selected_window; @@ -16322,64 +16433,50 @@ are the selected window and the window's buffer). */) face_id = DEFAULT_FACE_ID; if (XBUFFER (buffer) != current_buffer) - { - old_buffer = current_buffer; - set_buffer_internal_1 (XBUFFER (buffer)); - } + old_buffer = current_buffer; + + record_unwind_protect (unwind_format_mode_line, + format_mode_line_unwind_data (old_buffer)); + + if (old_buffer) + set_buffer_internal_1 (XBUFFER (buffer)); init_iterator (&it, w, -1, -1, NULL, face_id); - if (!no_props) + if (no_props) { - mode_line_string_face = face; - mode_line_string_face_prop - = (NILP (face) ? Qnil : Fcons (Qface, Fcons (face, Qnil))); - - /* We need a dummy last element in mode_line_string_list to - indicate we are building the propertized mode-line string. - Using mode_line_string_face_prop here GC protects it. */ - mode_line_string_list - = Fcons (mode_line_string_face_prop, Qnil); - frame_title_ptr = NULL; + mode_line_target = MODE_LINE_NOPROP; + mode_line_string_face_prop = Qnil; + mode_line_string_list = Qnil; + string_start = MODE_LINE_NOPROP_LEN (0); } else { - mode_line_string_face_prop = Qnil; + mode_line_target = MODE_LINE_STRING; mode_line_string_list = Qnil; - frame_title_ptr = frame_title_buf; + mode_line_string_face = face; + mode_line_string_face_prop + = (NILP (face) ? Qnil : Fcons (Qface, Fcons (face, Qnil))); } push_frame_kboard (it.f); display_mode_element (&it, 0, 0, 0, format, Qnil, 0); pop_frame_kboard (); - if (old_buffer) - set_buffer_internal_1 (old_buffer); - - if (!no_props) + if (no_props) { - Lisp_Object str; - mode_line_string_list = Fnreverse (mode_line_string_list); - str = Fmapconcat (intern ("identity"), XCDR (mode_line_string_list), - make_string ("", 0)); - mode_line_string_face_prop = Qnil; - mode_line_string_list = Qnil; - return str; + len = MODE_LINE_NOPROP_LEN (string_start); + str = make_string (mode_line_noprop_buf + string_start, len); } - - len = frame_title_ptr - frame_title_buf; - if (len > 0 && frame_title_ptr[-1] == '-') + else { - /* Mode lines typically ends with numerous dashes; reduce to two dashes. */ - while (frame_title_ptr > frame_title_buf && *--frame_title_ptr == '-') - ; - frame_title_ptr += 3; /* restore last non-dash + two dashes */ - if (len > frame_title_ptr - frame_title_buf) - len = frame_title_ptr - frame_title_buf; + mode_line_string_list = Fnreverse (mode_line_string_list); + str = Fmapconcat (intern ("identity"), mode_line_string_list, + make_string ("", 0)); } - frame_title_ptr = NULL; - return make_string (frame_title_buf, len); + unbind_to (count, Qnil); + return str; } /* Write a null-terminated, right justified decimal representation of @@ -16698,7 +16795,8 @@ decode_mode_spec (w, c, field_width, precision, multibyte) register int i; /* Let lots_of_dashes be a string of infinite length. */ - if (!NILP (mode_line_string_list)) + if (mode_line_target == MODE_LINE_NOPROP || + mode_line_target == MODE_LINE_STRING) return "--"; if (field_width <= 0 || field_width > sizeof (lots_of_dashes)) @@ -21547,7 +21645,7 @@ note_mode_line_or_margin_highlight (window, x, y, area) tmp_glyph->charpos >= XINT (b); tmp_glyph--, gpos++) { - if (tmp_glyph->object != glyph->object) + if (!EQ (tmp_glyph->object, glyph->object)) break; } @@ -21560,7 +21658,7 @@ note_mode_line_or_margin_highlight (window, x, y, area) tmp_glyph->charpos < XINT (e); tmp_glyph++, gseq_length++) { - if (tmp_glyph->object != glyph->object) + if (!EQ (tmp_glyph->object, glyph->object)) break; } @@ -21590,6 +21688,9 @@ note_mode_line_or_margin_highlight (window, x, y, area) 0, 0, 0, &ignore, glyph->face_id, 1); show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); + + if (NILP (pointer)) + pointer = Qhand; } } @@ -22833,9 +22934,14 @@ syms_of_xdisp () mode_line_proptrans_alist = Qnil; staticpro (&mode_line_proptrans_alist); - mode_line_string_list = Qnil; staticpro (&mode_line_string_list); + mode_line_string_face = Qnil; + staticpro (&mode_line_string_face); + mode_line_string_face_prop = Qnil; + staticpro (&mode_line_string_face_prop); + Vmode_line_unwind_vector = Qnil; + staticpro (&Vmode_line_unwind_vector); help_echo_string = Qnil; staticpro (&help_echo_string); @@ -23185,9 +23291,10 @@ init_xdisp () /* Allocate the buffer for frame titles. Also used for `format-mode-line'. */ int size = 100; - frame_title_buf = (char *) xmalloc (size); - frame_title_buf_end = frame_title_buf + size; - frame_title_ptr = NULL; + mode_line_noprop_buf = (char *) xmalloc (size); + mode_line_noprop_buf_end = mode_line_noprop_buf + size; + mode_line_noprop_ptr = mode_line_noprop_buf; + mode_line_target = MODE_LINE_DISPLAY; } help_echo_showing_p = 0; diff --git a/src/xfaces.c b/src/xfaces.c index edff936b08d..97bdd380dee 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -5128,8 +5128,8 @@ lface_equal_p (v1, v2) DEFUN ("internal-lisp-face-equal-p", Finternal_lisp_face_equal_p, Sinternal_lisp_face_equal_p, 2, 3, 0, doc: /* True if FACE1 and FACE2 are equal. -If the optional argument FRAME is given, report on face FACE in that frame. -If FRAME is t, report on the defaults for face FACE (for new frames). +If the optional argument FRAME is given, report on FACE1 and FACE2 in that frame. +If FRAME is t, report on the defaults for FACE1 and FACE2 (for new frames). If FRAME is omitted or nil, use the selected frame. */) (face1, face2, frame) Lisp_Object face1, face2, frame; @@ -5137,8 +5137,8 @@ If FRAME is omitted or nil, use the selected frame. */) int equal_p; Lisp_Object lface1, lface2; - lface1 = lface_from_face_name (NULL, face1, 1); - lface2 = lface_from_face_name (NULL, face2, 1); + lface1 = lface_from_face_name (f, face1, 1); + lface2 = lface_from_face_name (f, face2, 1); equal_p = lface_equal_p (XVECTOR (lface1)->contents, XVECTOR (lface2)->contents); return equal_p ? Qt : Qnil; @@ -6580,12 +6580,12 @@ build_scalable_font_name (f, font, specified_pt) if (font->numeric[XLFD_RESY] != 0) { pt = resy / font->numeric[XLFD_RESY] * specified_pt + 0.5; - pixel_value = font->numeric[XLFD_RESY] / (PT_PER_INCH * 10.0) * pt; + pixel_value = font->numeric[XLFD_RESY] / (PT_PER_INCH * 10.0) * pt + 0.5; } else { pt = specified_pt; - pixel_value = resy / (PT_PER_INCH * 10.0) * pt; + pixel_value = resy / (PT_PER_INCH * 10.0) * pt + 0.5; } /* We may need a font of the different size. */ pixel_value *= font->rescale_ratio; diff --git a/src/xmenu.c b/src/xmenu.c index 9103d32e1c9..826c9330c46 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1235,6 +1235,10 @@ popup_get_selection (initial_event, dpyinfo, id, do_timers) if (event.type == ButtonRelease && dpyinfo->display == event.xbutton.display) { + /* If the click is not on the menu, deactivate the menu. */ + if (x_any_window_to_frame (dpyinfo, event.xexpose.window)) + popup_activated_flag = 0; + dpyinfo->grabbed &= ~(1 << event.xbutton.button); #ifdef USE_MOTIF /* Pretending that the event came from a Btn1Down seems the only way to convince Motif to diff --git a/src/xterm.c b/src/xterm.c index 01612d0d0ae..be61c15afdd 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -906,6 +906,7 @@ x_encode_char (c, char2b, font_info, charset, two_byte_p) /* It's a program. */ struct ccl_program *ccl = font_info->font_encoder; + check_ccl_update (ccl); if (CHARSET_DIMENSION (charset) == 1) { ccl->reg[0] = CHARSET_ID (charset); @@ -6782,12 +6783,6 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) { dpyinfo->grabbed |= (1 << event.xbutton.button); last_mouse_frame = f; - /* Ignore any mouse motion that happened - before this event; any subsequent mouse-movement - Emacs events should reflect only motion after - the ButtonPress. */ - if (f != 0) - f->mouse_moved = 0; if (!tool_bar_p) last_tool_bar_item = -1; @@ -6795,6 +6790,12 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) else dpyinfo->grabbed &= ~(1 << event.xbutton.button); + /* Ignore any mouse motion that happened before this event; + any subsequent mouse-movement Emacs events should reflect + only motion after the ButtonPress/Release. */ + if (f != 0) + f->mouse_moved = 0; + #if defined (USE_X_TOOLKIT) || defined (USE_GTK) f = x_menubar_window_to_frame (dpyinfo, event.xbutton.window); /* For a down-event in the menu bar, |