diff options
| author | Karoly Lorentey <lorentey@elte.hu> | 2005-06-15 12:57:51 +0000 |
|---|---|---|
| committer | Karoly Lorentey <lorentey@elte.hu> | 2005-06-15 12:57:51 +0000 |
| commit | ef85512e51f043d73788f00a2aed13cccde0682c (patch) | |
| tree | fc1fa1378533250f260ef8eaa9a84ae882d9df84 /src | |
| parent | 8736257554f49445f7b4402ac7a9436b38ce6452 (diff) | |
| parent | ef88a9999004e6c26148c8d280d6a41f623d7249 (diff) | |
Merged from miles@gnu.org--gnu-2005 (patch 80-82, 350-422)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-350
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-351
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-352
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-353
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-354
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-355
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-356
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-357
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-358
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-359
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-360
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-361
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-362
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-363
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-364
Remove "-face" suffix from widget faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-365
Remove "-face" suffix from custom faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-366
Remove "-face" suffix from change-log faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-367
Remove "-face" suffix from compilation faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-368
Remove "-face" suffix from diff-mode faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-369
lisp/longlines.el (longlines-visible-face): Face removed
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-370
Remove "-face" suffix from woman faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-371
Remove "-face" suffix from whitespace-highlight face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-373
Remove "-face" suffix from show-paren faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-374
Remove "-face" suffix from log-view faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-375
Remove "-face" suffix from smerge faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-376
Remove "-face" suffix from show-tabs faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-377
Remove "-face" suffix from highlight-changes faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-378
Remove "-face" suffix from and downcase info faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-379
Remove "-face" suffix from pcvs faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-380
Update uses of renamed pcvs faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-381
Tweak ChangeLog
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-382
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-383
Remove "-face" suffix from strokes-char face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-384
Remove "-face" suffix from compare-windows face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-385
Remove "-face" suffix from calendar faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-386
Remove "-face" suffix from diary-button face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-387
Remove "-face" suffix from testcover faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-388
Remove "-face" suffix from viper faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-389
Remove "-face" suffix from org faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-390
Remove "-face" suffix from sgml-namespace face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-391
Remove "-face" suffix from table-cell face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-392
Remove "-face" suffix from tex-mode faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-393
Remove "-face" suffix from texinfo-heading face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-394
Remove "-face" suffix from flyspell faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-395
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-396
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-397
Remove "-face" suffix from gomoku faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-398
Remove "-face" suffix from mpuz faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-399
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-400
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-401
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-402
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-403
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-404
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-405
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-406
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-407
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-408
Remove "-face" suffix from Buffer-menu-buffer face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-409
Remove "-face" suffix from antlr-mode faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-410
Remove "-face" suffix from ebrowse faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-411
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-412
Remove "-face" suffix from flymake faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-413
Remove "-face" suffix from idlwave faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-414
Remove "-face" suffix from sh-script faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-415
Remove "-face" suffix from vhdl-mode faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-416
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-417
Remove "-face" suffix from which-func face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-418
Remove "-face" suffix from cperl-mode faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-419
Remove "-face" suffix from ld-script faces
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-420
Fix cperl-mode font-lock problem
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-421
Tweak which-func face
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-422
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-80
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-81
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-82
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-350
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 294 | ||||
| -rw-r--r-- | src/bytecode.c | 3 | ||||
| -rw-r--r-- | src/callproc.c | 33 | ||||
| -rw-r--r-- | src/coding.c | 2 | ||||
| -rw-r--r-- | src/composite.c | 2 | ||||
| -rw-r--r-- | src/config.in | 9 | ||||
| -rw-r--r-- | src/emacs.c | 1 | ||||
| -rw-r--r-- | src/eval.c | 51 | ||||
| -rw-r--r-- | src/fns.c | 4 | ||||
| -rw-r--r-- | src/frame.c | 18 | ||||
| -rw-r--r-- | src/image.c | 86 | ||||
| -rw-r--r-- | src/keyboard.c | 3 | ||||
| -rw-r--r-- | src/lisp.h | 10 | ||||
| -rw-r--r-- | src/macfns.c | 3 | ||||
| -rw-r--r-- | src/macmenu.c | 171 | ||||
| -rw-r--r-- | src/macterm.c | 314 | ||||
| -rw-r--r-- | src/makefile.w32-in | 7 | ||||
| -rw-r--r-- | src/process.c | 40 | ||||
| -rw-r--r-- | src/process.h | 4 | ||||
| -rw-r--r-- | src/s/ms-w32.h | 2 | ||||
| -rw-r--r-- | src/search.c | 96 | ||||
| -rw-r--r-- | src/unexmacosx.c | 1 | ||||
| -rw-r--r-- | src/unexw32.c | 59 | ||||
| -rw-r--r-- | src/w32.c | 8 | ||||
| -rw-r--r-- | src/w32bdf.c | 2 | ||||
| -rw-r--r-- | src/w32fns.c | 82 | ||||
| -rw-r--r-- | src/w32heap.c | 1 | ||||
| -rw-r--r-- | src/w32heap.h | 9 | ||||
| -rw-r--r-- | src/w32menu.c | 3 | ||||
| -rw-r--r-- | src/w32proc.c | 5 | ||||
| -rw-r--r-- | src/w32term.c | 20 | ||||
| -rw-r--r-- | src/window.c | 51 | ||||
| -rw-r--r-- | src/xdisp.c | 112 | ||||
| -rw-r--r-- | src/xfaces.c | 12 | ||||
| -rw-r--r-- | src/xmenu.c | 2 | ||||
| -rw-r--r-- | src/xterm.c | 19 |
36 files changed, 1135 insertions, 404 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index dbcac952b51..46cab9c1cba 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,283 @@ +2005-06-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (mac_compute_glyph_string_overhangs): Don't set + overhangs unless the given glyph type is noncomposite CHAR_GLYPH. + [USE_CARBON_EVENTS] (mac_convert_event_ref): Convert dead key down + events. + (XTread_socket): Don't pass keyboard events with the option + modifier to the system when Vmac_command_key_is_meta is nil or + Vmac_option_modifier is non-nil. + [USE_CARBON_EVENTS] (read_socket_inev): New variable. + [USE_CARBON_EVENTS] (init_command_handler): Fix argument. + [USE_CARBON_EVENTS] (mac_handle_mouse_event): New Carbon event + handler function. + (install_window_handler) [USE_CARBON_EVENTS]: Install it. + (XTread_socket) [USE_CARBON_EVENTS]: Move mouse wheel event + handler part to mac_handle_mouse_event. + +2005-06-14 Juanma Barranquero <lekktu@gmail.com> + + * eval.c (Fdefvaralias): Rename arguments SYMBOL and ALIASED to + NEW-ALIAS and BASE-VARIABLE, respectively. + +2005-06-13 Stefan Monnier <monnier@iro.umontreal.ca> + + * xdisp.c (note_mode_line_or_margin_highlight): Lisp_Object/int mixup. + (get_phys_cursor_geometry, format_mode_line_unwind_data) + (get_line_height_property, x_produce_glyphs): Remove unused vars. + + * coding.c (run_pre_post_conversion_on_str): Remove unused var `buf'. + +2005-06-13 Eli Zaretskii <eliz@gnu.org> + + * w32term.c (x_use_underline_position_properties): New variable. + (x_draw_glyph_string): Remind in a comment to change doc string of + x-use-underline-position-properties if/when underline positioning + is implemented. + (syms_of_w32term): DEFVAR_BOOL x-use-underline-position-properties, + and initialize it to nil. + +2005-06-12 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (NEWOPENFILENAME): New struct. + (Fx_file_dialog): Use it to trick the system into giving us up to + date dialogs on systems that are documented to support it. + Do not set OFN_FILEMUSTEXIST flag if looking for a directory. + +2005-06-12 Eli Zaretskii <eliz@gnu.org> + + * w32fns.c (w32_abort): Use the MB_YESNO dialog instead of + MB_ABORTRETRYIGNORE. Never return, even if DebugBreak does. + +2005-06-11 Eli Zaretskii <eliz@gnu.org> + + * image.c (x_create_x_image_and_pixmap) [HAVE_NTGUI]: Cast 4th arg + to CreateDIBSection to avoid a compiler warning. + (pbm_load): Cast 3rd arg to IMAGE_BACKGROUND to avoid a compiler + warning. + (png_load): Cast return values of fn_png_create_read_struct and + fn_png_create_info_struct, to avoid compiler warnings on W32. + Cast 3rd arg to IMAGE_BACKGROUND and image_background_transparent + to avoid compiler warnings. + (jpeg_load): Cast return value of fn_jpeg_std_error to avoid a + compiler warning on W32. Cast 3rd arg to IMAGE_BACKGROUND to + avoid a compiler warning. + (tiff_load): Cast return values of fn_TIFFOpen and + fn_TIFFClientOpen to avoid compiler warning on W32. Cast 3rd arg + to IMAGE_BACKGROUND to avoid a compiler warning. + (gif_load): Cast return values of fn_DGifOpenFileName and + fn_DGifOpen to avoid compiler warnings on W32. Cast 3rd arg to + IMAGE_BACKGROUND to avoid a compiler warning. + (DrawText) [HAVE_NTGUI || MAC_OS]: If already defined, undef + before redefining. + + * w32bdf.c (create_offscreen_bitmap): Cast `bitsp' to `void **' in + the call to CreateDIBSection, to avoid a compiler warning. + +2005-06-11 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (Fx_file_dialog): Unblock input before falling back to + minibuffer. + * macfns.c (Fx_file_dialog): Likewise. + +2005-06-10 Eli Zaretskii <eliz@gnu.org> + + * makefile.w32-in ($(TEMACS)): Depend on addsection.exe. + +2005-06-10 Juanma Barranquero <lekktu@gmail.com> + + * process.c (syms_of_process) [ADAPTIVE_READ_BUFFERING]: + * w32fns.c (syms_of_w32fns): Fix spellings. + +2005-06-10 Eli Zaretskii <eliz@gnu.org> + + * unexw32.c (COPY_CHUNK, COPY_PROC_CHUNK): Add a new argument + `verbose'; print diagnostic messages only if it is non-zero. + All callers changed to pass a zero value unless DEBUG_DUMP is defined + in the environment. + (copy_executable_and_dump_data): Print section names with %.8s. + +2005-06-10 Masatake YAMATO <jet@gyve.org> + + * xdisp.c (note_mode_line_or_margin_highlight): Call clear_mouse_face + when mouse_face is not given. + Remove unnecessary tabs. + +2005-06-09 Luc Teirlinck <teirllm@auburn.edu> + + * window.c (Fselect_window): Adapt call to Fselect_frame. + + * lisp.h: Update EXFUN of Fselect_frame. + + * keyboard.c (command_loop_1): Adapt call to Fselect_frame. + + * frame.c (Fhandle_switch_frame, Fselect_frame): Delete unused arg + no_enter. + (Fset_mouse_position, Fset_mouse_pixel_position, Ficonify_frame): + Adapt to above change. + +2005-06-10 Juanma Barranquero <lekktu@gmail.com> + + * fns.c (Fmemq, Fmaphash): Doc fixes. + +2005-06-09 Juanma Barranquero <lekktu@gmail.com> + + * xfaces.c (Fdisplay_supports_face_attributes_p): + Fix typo in docstring. + +2005-06-08 Steven Tamm <steventamm@mac.com> + + * unexmacosx.c (copy_data_segment): Copy __la_sym_ptr2 section + used by gcc4 on intel mac. + +2005-06-09 Kim F. Storm <storm@cua.dk> + + * search.c (Fmatch_data): Add optional RESEAT arg. Unchain markers + in REUSE list if non-nil; free them if equal to evaporate. + (Fset_match_data): Add optional RESEAT arg. Unchain markers in LIST + if non-nil; free them if equal to evaporate. Use XCAR/XCDR. + (restore_search_regs): Rename from restore_match_data. Uses changed. + (unwind_set_match_data): New function. + (record_unwind_save_match_data): New function like save-match-data. + + * lisp.h (Fmatch_data, Fset_match_data): Fix EXFUN. + (record_unwind_save_match_data): Add prototype. + (restore_search_regs): Rename from restore_match_data. + + * composite.c (compose_chars_in_text): + * eval.c (do_autoload): + * macmenu.c (set_frame_menubar): + * process.c (read_process_output, exec_sentinel): + * xmenu.c (set_frame_menubar): + * xdisp.c (prepare_menu_bars, update_menu_bar, update_tool_bar): + * w32menu.c (set_frame_menubar): + Use record_unwind_save_match_data. + +2005-06-08 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (get_next_display_element): Alter previous change: + Distinguish Vshow_nonbreak_escape = t or not t. + For t, use escape_glyph once again, as before previous change. + Use space or hyphen for display, instead of the non-ASCII char. + (syms_of_xdisp) <show-nonbreak-escape>: Doc fix. + + * process.c (Fstart_process): Don't touch command_channel_p slot. + + * process.h (struct process): Delete command_channel_p. + +2005-06-07 Masatake YAMATO <jet@gyve.org> + + * xdisp.c (note_mode_line_or_margin_highlight): + Check the overlapping of re-rendering area to avoid flickering. + (note_mouse_highlight): Call clear_mouse_face if PART + is not ON_MODE_LINE nor ON_HEADER_LINE. + +2005-06-07 Kim F. Storm <storm@cua.dk> + + * process.c: Improve commentary for adaptive read buffering. + +2005-06-06 Stefan Monnier <monnier@iro.umontreal.ca> + + * xterm.c (x_create_toolkit_scroll_bar): Use XtNarrowScrollbars + if available. + +2005-06-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * macmenu.c (menu_quit_handler, install_menu_quit_handler): + New functions for popping down menus on C-g. + (set_frame_menubar, mac_menu_show): Call install_menu_quit_handler. + + * macterm.c: Make mac_quit_char_modifiers and mac_quit_char_keycode + non-static. + + * config.in: Add HAVE_CANCELMENUTRACKING. + +2005-06-06 Eli Zaretskii <eliz@gnu.org> + + * w32heap.h (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_PTR): + Remove macros. + + * unexw32.c (RVA_TO_PTR): Move here from w32heap.h. + + * w32proc.c (RVA_TO_PTR): New macro. + + * w32heap.c (RVA_TO_PTR): No need to #undef now. + + * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/w32select.$(O)): + Depend on w32heap.h. + +2005-06-06 Luc Teirlinck <teirllm@auburn.edu> + + * keyboard.c (command_loop_1): Update Vthis_original_command. + +2005-06-06 Richard M. Stallman <rms@gnu.org> + + * xmenu.c (popup_get_selection): Undo previous change. + +2005-06-06 Juri Linkov <juri@jurta.org> + + * xdisp.c (Qno_break_space): New variable. + (syms_of_xdisp): Initialize it. + (get_next_display_element): Add no-break space and soft hypen + codes for iso8859-2 and iso8859-5. Don't add `\' for them. + Use `no-break-space' face for no-break spaces. + +2005-06-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * window.c (delete_window): Handle the case where a h/vchild has + a h/vchild. + +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. @@ -41,11 +321,11 @@ (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. + 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. + 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. @@ -5078,7 +5358,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> @@ -12841,9 +13121,9 @@ * sound.c: Added a partial implementation of play-sound-internal for Microsoft Windows. Added various #ifdef / #else / #endif code blocks to separate the code that will compile under - Microsoft Windows from the code that is specific to Gnu/Linux. + Microsoft Windows from the code that is specific to GNU/Linux. Moved several blocks of code around to make this separation of code - into Windows compatible and Gnu/Linux compatible code blocks easier. + into Windows compatible and GNU/Linux compatible code blocks easier. * makefile.w32-in: Include sound.c and link with WinMM.lib. diff --git a/src/bytecode.c b/src/bytecode.c index e8d006e67d1..6b05a3270d2 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 6027ccdda9f..fe198b0770a 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 @@ -765,7 +766,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) @@ -790,7 +791,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) if (!NILP (buffer)) { if (! 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. */ int size; @@ -807,7 +808,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) requires text-encoding detection. */ if (process_coding.type == coding_type_undecided) { - detect_coding (&process_coding, bufptr, nread); + detect_coding (&process_coding, buf, nread); if (process_coding.composing != COMPOSITION_DISABLED) /* We have not yet allocated the composition data because the coding type was undecided. */ @@ -816,7 +817,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) if (process_coding.cmp_data) process_coding.cmp_data->char_offset = PT; - decode_coding (&process_coding, bufptr, decoding_buf, + decode_coding (&process_coding, buf, decoding_buf, nread, size); if (display_on_the_fly @@ -905,7 +906,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) if (carryover > 0) /* As CARRYOVER should not be that large, we had better avoid overhead of bcopy. */ - BCOPY_SHORT (bufptr + process_coding.consumed, bufptr, + BCOPY_SHORT (buf + process_coding.consumed, buf, carryover); if (process_coding.result == CODING_FINISH_INSUFFICIENT_CMP) { @@ -922,17 +923,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/coding.c b/src/coding.c index f7da394def1..7111862b656 100644 --- a/src/coding.c +++ b/src/coding.c @@ -6056,7 +6056,6 @@ run_pre_post_conversion_on_str (str, coding, encodep) int count = SPECPDL_INDEX (); struct gcpro gcpro1, gcpro2; int multibyte = STRING_MULTIBYTE (str); - struct buffer *buf; Lisp_Object old_deactivate_mark; record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); @@ -6256,6 +6255,7 @@ decode_coding_string (str, coding, nocopy) produced += coding->produced; produced_char += coding->produced_char; if (result == CODING_FINISH_NORMAL + || result == CODING_FINISH_INTERRUPT || (result == CODING_FINISH_INSUFFICIENT_SRC && coding->consumed == 0)) break; diff --git a/src/composite.c b/src/composite.c index f8e655a3685..ff2eed925d1 100644 --- a/src/composite.c +++ b/src/composite.c @@ -628,7 +628,7 @@ compose_chars_in_text (start, end, string) } /* Preserve the match data. */ - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); + record_unwind_save_match_data (); /* If none of ASCII characters have composition functions, we can skip them quickly. */ diff --git a/src/config.in b/src/config.in index dc66c234d03..5fb1f530d44 100644 --- a/src/config.in +++ b/src/config.in @@ -96,6 +96,9 @@ Boston, MA 02111-1307, USA. */ /* Define to 1 if you have the `bzero' function. */ #undef HAVE_BZERO +/* Define to 1 if CancelMenuTracking is available (Mac OSX). */ +#undef HAVE_CANCELMENUTRACKING + /* Define to 1 if you are using the Carbon API on Mac OS X. */ #undef HAVE_CARBON @@ -782,9 +785,9 @@ Boston, MA 02111-1307, USA. */ /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ diff --git a/src/emacs.c b/src/emacs.c index f435a3959a3..a8c64115098 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 8bb201c5df5..445eb283114 100644 --- a/src/eval.c +++ b/src/eval.c @@ -722,35 +722,36 @@ usage: (defmacro NAME ARGLIST [DOCSTRING] [DECL] BODY...) */) DEFUN ("defvaralias", Fdefvaralias, Sdefvaralias, 2, 3, 0, - doc: /* Make SYMBOL a variable alias for symbol ALIASED. -Setting the value of SYMBOL will subsequently set the value of ALIASED, -and getting the value of SYMBOL will return the value ALIASED has. -Third arg DOCSTRING, if non-nil, is documentation for SYMBOL. If it is -omitted or nil, SYMBOL gets the documentation string of ALIASED, or of the -variable at the end of the chain of aliases, if ALIASED is itself an alias. -The return value is ALIASED. */) - (symbol, aliased, docstring) - Lisp_Object symbol, aliased, docstring; + doc: /* Make NEW-ALIAS a variable alias for symbol BASE-VARIABLE. +Setting the value of NEW-ALIAS will subsequently set the value of BASE-VARIABLE, + and getting the value of NEW-ALIAS will return the value BASE-VARIABLE has. +Third arg DOCSTRING, if non-nil, is documentation for NEW-ALIAS. If it is + omitted or nil, NEW-ALIAS gets the documentation string of BASE-VARIABLE, + or of the variable at the end of the chain of aliases, if BASE-VARIABLE is + itself an alias. +The return value is BASE-VARIABLE. */) + (new_alias, base_variable, docstring) + Lisp_Object new_alias, base_variable, docstring; { struct Lisp_Symbol *sym; - CHECK_SYMBOL (symbol); - CHECK_SYMBOL (aliased); + CHECK_SYMBOL (new_alias); + CHECK_SYMBOL (base_variable); - if (SYMBOL_CONSTANT_P (symbol)) + if (SYMBOL_CONSTANT_P (new_alias)) error ("Cannot make a constant an alias"); - sym = XSYMBOL (symbol); + sym = XSYMBOL (new_alias); sym->indirect_variable = 1; - sym->value = aliased; - sym->constant = SYMBOL_CONSTANT_P (aliased); - LOADHIST_ATTACH (symbol); + sym->value = base_variable; + sym->constant = SYMBOL_CONSTANT_P (base_variable); + LOADHIST_ATTACH (new_alias); if (!NILP (docstring)) - Fput (symbol, Qvariable_documentation, docstring); + Fput (new_alias, Qvariable_documentation, docstring); else - Fput (symbol, Qvariable_documentation, Qnil); + Fput (new_alias, Qvariable_documentation, Qnil); - return aliased; + return base_variable; } @@ -1971,7 +1972,7 @@ do_autoload (fundef, funname) GCPRO3 (fun, funname, fundef); /* Preserve the match data. */ - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); + record_unwind_save_match_data (); /* Value saved here is to be restored into Vautoload_queue. */ record_unwind_protect (un_autoload, Vautoload_queue); @@ -3130,10 +3131,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) @@ -3182,8 +3183,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/fns.c b/src/fns.c index e910c87375b..a36789b4a92 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1471,7 +1471,7 @@ The value is actually the tail of LIST whose car is ELT. */) DEFUN ("memq", Fmemq, Smemq, 2, 2, 0, doc: /* Return non-nil if ELT is an element of LIST. -Comparison done with EQ. The value is actually the tail of LIST +Comparison done with `eq'. The value is actually the tail of LIST whose car is ELT. */) (elt, list) Lisp_Object elt, list; @@ -5486,7 +5486,7 @@ DEFUN ("remhash", Fremhash, Sremhash, 2, 2, 0, DEFUN ("maphash", Fmaphash, Smaphash, 2, 2, 0, doc: /* Call FUNCTION for all entries in hash table TABLE. -FUNCTION is called with 2 arguments KEY and VALUE. */) +FUNCTION is called with two arguments, KEY and VALUE. */) (function, table) Lisp_Object function, table; { diff --git a/src/frame.c b/src/frame.c index f86cb0d43da..10318ba7110 100644 --- a/src/frame.c +++ b/src/frame.c @@ -905,7 +905,7 @@ do_switch_frame (frame, track, for_deletion) return frame; } -DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, "e", +DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 1, "e", doc: /* Select the frame FRAME. Subsequent editing commands apply to its selected window. The selection of FRAME lasts until the next time the user does @@ -916,14 +916,14 @@ the command loop, because it still may have the window system's input focus. On a text-only terminal, the next redisplay will display FRAME. This function returns FRAME, or nil if FRAME has been deleted. */) - (frame, no_enter) - Lisp_Object frame, no_enter; + (frame) + Lisp_Object frame; { return do_switch_frame (frame, 1, 0); } -DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 2, "e", +DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 1, "e", doc: /* Handle a switch-frame event EVENT. Switch-frame events are usually bound to this function. A switch-frame event tells Emacs that the window manager has requested @@ -932,8 +932,8 @@ This function selects the selected window of the frame of EVENT. If EVENT is frame object, handle it as if it were a switch-frame event to that frame. */) - (event, no_enter) - Lisp_Object event, no_enter; + (event) + Lisp_Object event; { /* Preserve prefix arg that the command loop just cleared. */ current_kboard->Vprefix_arg = Vcurrent_prefix_arg; @@ -1754,7 +1754,7 @@ before calling this function on it, like this. #if defined (MSDOS) && defined (HAVE_MOUSE) if (FRAME_MSDOS_P (XFRAME (frame))) { - Fselect_frame (frame, Qnil); + Fselect_frame (frame); mouse_moveto (XINT (x), XINT (y)); } #endif @@ -1786,7 +1786,7 @@ before calling this function on it, like this. #if defined (MSDOS) && defined (HAVE_MOUSE) if (FRAME_MSDOS_P (XFRAME (frame))) { - Fselect_frame (frame, Qnil); + Fselect_frame (frame); mouse_moveto (XINT (x), XINT (y)); } #endif @@ -1908,7 +1908,7 @@ If omitted, FRAME defaults to the currently selected frame. */) #if 0 /* This isn't logically necessary, and it can do GC. */ /* Don't let the frame remain selected. */ if (EQ (frame, selected_frame)) - Fhandle_switch_frame (next_frame (frame, Qt), Qnil); + Fhandle_switch_frame (next_frame (frame, Qt)); #endif /* Don't allow minibuf_window to remain on a deleted frame. */ diff --git a/src/image.c b/src/image.c index 15e835fef3b..462294b33b4 100644 --- a/src/image.c +++ b/src/image.c @@ -1972,7 +1972,8 @@ x_create_x_image_and_pixmap (f, width, height, depth, ximg, pixmap) and store its handle in *pixmap. */ *pixmap = CreateDIBSection (hdc, &((*ximg)->info), (depth < 16) ? DIB_PAL_COLORS : DIB_RGB_COLORS, - &((*ximg)->data), NULL, 0); + /* casting avoids a GCC warning */ + (void **)&((*ximg)->data), NULL, 0); /* Realize display palette and garbage all frames. */ release_frame_dc (f, hdc); @@ -5517,7 +5518,8 @@ pbm_load (f, img) /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) - IMAGE_BACKGROUND (img, f, ximg); + /* Casting avoids a GCC warning. */ + IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg); /* Put the image into a pixmap. */ x_put_x_image (f, ximg, img->pixmap, width, height); @@ -5843,9 +5845,11 @@ png_load (f, img) tbr.bytes += sizeof (sig); } - /* Initialize read and info structs for PNG lib. */ - png_ptr = fn_png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, - my_png_error, my_png_warning); + /* Initialize read and info structs for PNG lib. Casting return + value avoids a GCC warning on W32. */ + png_ptr = (png_structp)fn_png_create_read_struct (PNG_LIBPNG_VER_STRING, + NULL, my_png_error, + my_png_warning); if (!png_ptr) { if (fp) fclose (fp); @@ -5853,7 +5857,8 @@ png_load (f, img) return 0; } - info_ptr = fn_png_create_info_struct (png_ptr); + /* Casting return value avoids a GCC warning on W32. */ + info_ptr = (png_infop)fn_png_create_info_struct (png_ptr); if (!info_ptr) { fn_png_destroy_read_struct (&png_ptr, NULL, NULL); @@ -5862,7 +5867,8 @@ png_load (f, img) return 0; } - end_info = fn_png_create_info_struct (png_ptr); + /* Casting return value avoids a GCC warning on W32. */ + end_info = (png_infop)fn_png_create_info_struct (png_ptr); if (!end_info) { fn_png_destroy_read_struct (&png_ptr, &info_ptr, NULL); @@ -6135,8 +6141,9 @@ png_load (f, img) img->width = width; img->height = height; - /* Maybe fill in the background field while we have ximg handy. */ - IMAGE_BACKGROUND (img, f, ximg); + /* Maybe fill in the background field while we have ximg handy. + Casting avoids a GCC warning. */ + IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg); /* Put the image into the pixmap, then free the X image and its buffer. */ x_put_x_image (f, ximg, img->pixmap, width, height); @@ -6145,9 +6152,9 @@ png_load (f, img) /* Same for the mask. */ if (mask_img) { - /* Fill in the background_transparent field while we have the mask - handy. */ - image_background_transparent (img, f, mask_img); + /* Fill in the background_transparent field while we have the + mask handy. Casting avoids a GCC warning. */ + image_background_transparent (img, f, (XImagePtr_or_DC)mask_img); x_put_x_image (f, mask_img, img->mask, img->width, img->height); x_destroy_x_image (mask_img); @@ -6265,8 +6272,8 @@ jpeg_image_p (object) #endif /* HAVE_STLIB_H */ #if defined (HAVE_NTGUI) && !defined (__WIN32__) -/* jpeglib.h will define boolean differently depending on __WIN32__, - so make sure it is defined. */ +/* In older releases of the jpeg library, jpeglib.h will define boolean + differently depending on __WIN32__, so make sure it is defined. */ #define __WIN32__ 1 #endif @@ -6494,8 +6501,9 @@ jpeg_load (f, img) } /* Customize libjpeg's error handling to call my_error_exit when an - error is detected. This function will perform a longjmp. */ - cinfo.err = fn_jpeg_std_error (&mgr.pub); + error is detected. This function will perform a longjmp. + Casting return value avoids a GCC warning on W32. */ + cinfo.err = (struct jpeg_error_mgr *)fn_jpeg_std_error (&mgr.pub); mgr.pub.error_exit = my_error_exit; if ((rc = setjmp (mgr.setjmp_buffer)) != 0) @@ -6606,7 +6614,8 @@ jpeg_load (f, img) /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) - IMAGE_BACKGROUND (img, f, ximg); + /* Casting avoids a GCC warning. */ + IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg); /* Put the image into the pixmap. */ x_put_x_image (f, ximg, img->pixmap, width, height); @@ -6932,8 +6941,9 @@ tiff_load (f, img) return 0; } - /* Try to open the image file. */ - tiff = fn_TIFFOpen (SDATA (file), "r"); + /* Try to open the image file. Casting return value avoids a + GCC warning on W32. */ + tiff = (TIFF *)fn_TIFFOpen (SDATA (file), "r"); if (tiff == NULL) { image_error ("Cannot open `%s'", file, Qnil); @@ -6948,14 +6958,15 @@ tiff_load (f, img) memsrc.len = SBYTES (specified_data); memsrc.index = 0; - tiff = fn_TIFFClientOpen ("memory_source", "r", &memsrc, - (TIFFReadWriteProc) tiff_read_from_memory, - (TIFFReadWriteProc) tiff_write_from_memory, - tiff_seek_in_memory, - tiff_close_memory, - tiff_size_of_memory, - tiff_mmap_memory, - tiff_unmap_memory); + /* Casting return value avoids a GCC warning on W32. */ + tiff = (TIFF *)fn_TIFFClientOpen ("memory_source", "r", &memsrc, + (TIFFReadWriteProc) tiff_read_from_memory, + (TIFFReadWriteProc) tiff_write_from_memory, + tiff_seek_in_memory, + tiff_close_memory, + tiff_size_of_memory, + tiff_mmap_memory, + tiff_unmap_memory); if (!tiff) { @@ -7018,7 +7029,8 @@ tiff_load (f, img) /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) - IMAGE_BACKGROUND (img, f, ximg); + /* Casting avoids a GCC warning on W32. */ + IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg); /* Put the image into the pixmap, then free the X image and its buffer. */ x_put_x_image (f, ximg, img->pixmap, width, height); @@ -7126,6 +7138,11 @@ gif_image_p (object) #ifdef HAVE_GIF #if defined (HAVE_NTGUI) || defined (MAC_OS) +/* winuser.h might define DrawText to DrawTextA or DrawTextW. + Undefine before redefining to avoid a preprocessor warning. */ +#ifdef DrawText +#undef DrawText +#endif /* avoid conflict with QuickdrawText.h */ #define DrawText gif_DrawText #include <gif_lib.h> @@ -7239,8 +7256,9 @@ gif_load (f, img) return 0; } - /* Open the GIF file. */ - gif = fn_DGifOpenFileName (SDATA (file)); + /* Open the GIF file. Casting return value avoids a GCC warning + on W32. */ + gif = (GifFileType *)fn_DGifOpenFileName (SDATA (file)); if (gif == NULL) { image_error ("Cannot open `%s'", file, Qnil); @@ -7256,7 +7274,8 @@ gif_load (f, img) memsrc.len = SBYTES (specified_data); memsrc.index = 0; - gif = fn_DGifOpen(&memsrc, gif_read_from_memory); + /* Casting return value avoids a GCC warning on W32. */ + gif = (GifFileType *)fn_DGifOpen(&memsrc, gif_read_from_memory); if (!gif) { image_error ("Cannot open memory source `%s'", img->spec, Qnil); @@ -7390,7 +7409,8 @@ gif_load (f, img) /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) - IMAGE_BACKGROUND (img, f, ximg); + /* Casting avoids a GCC warning. */ + IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg); /* Put the image into the pixmap, then free the X image and its buffer. */ x_put_x_image (f, ximg, img->pixmap, width, height); @@ -7400,7 +7420,7 @@ gif_load (f, img) return 1; } -#else +#else /* !HAVE_GIF */ #ifdef MAC_OS static int diff --git a/src/keyboard.c b/src/keyboard.c index 2ccf444964b..135c3313a7b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1494,7 +1494,7 @@ command_loop_1 () Is this a good idea? */ if (FRAMEP (internal_last_event_frame) && !EQ (internal_last_event_frame, selected_frame)) - Fselect_frame (internal_last_event_frame, Qnil); + Fselect_frame (internal_last_event_frame); #endif /* If it has changed current-menubar from previous value, really recompute the menubar from the value. */ @@ -1507,6 +1507,7 @@ command_loop_1 () Vthis_command = Qnil; real_this_command = Qnil; + Vthis_original_command = Qnil; /* Read next key sequence; i gets its length. */ i = read_key_sequence (keybuf, sizeof keybuf / sizeof keybuf[0], diff --git a/src/lisp.h b/src/lisp.h index 2e356985cdb..4d84cfa9f64 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2768,6 +2768,7 @@ EXFUN (Fbuffer_disable_undo, 1); EXFUN (Fbuffer_enable_undo, 1); EXFUN (Ferase_buffer, 0); extern Lisp_Object Qoverlayp; +extern Lisp_Object Qevaporate; extern Lisp_Object get_truename_buffer P_ ((Lisp_Object)); extern struct buffer *all_buffers; EXFUN (Fprevious_overlay_change, 1); @@ -2835,11 +2836,12 @@ extern void syms_of_abbrev P_ ((void)); /* defined in search.c */ extern void shrink_regexp_cache P_ ((void)); EXFUN (Fstring_match, 3); -extern void restore_match_data P_ ((void)); -EXFUN (Fmatch_data, 2); -EXFUN (Fset_match_data, 1); +extern void restore_search_regs P_ ((void)); +EXFUN (Fmatch_data, 3); +EXFUN (Fset_match_data, 2); EXFUN (Fmatch_beginning, 1); EXFUN (Fmatch_end, 1); +extern void record_unwind_save_match_data P_ ((void)); EXFUN (Flooking_at, 1); extern int fast_string_match P_ ((Lisp_Object, Lisp_Object)); extern int fast_c_string_match_ignore_case P_ ((Lisp_Object, const char *)); @@ -2954,7 +2956,7 @@ extern Lisp_Object do_switch_frame P_ ((Lisp_Object, int, int)); extern Lisp_Object get_frame_param P_ ((struct frame *, Lisp_Object)); extern Lisp_Object frame_buffer_predicate P_ ((Lisp_Object)); EXFUN (Fframep, 1); -EXFUN (Fselect_frame, 2); +EXFUN (Fselect_frame, 1); EXFUN (Fselected_frame, 0); EXFUN (Fwindow_frame, 1); EXFUN (Fframe_root_window, 1); diff --git a/src/macfns.c b/src/macfns.c index d0dd9b9c072..b26baf3eaf7 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -4375,14 +4375,15 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) break; } NavDialogDispose(dialogRef); + UNBLOCK_INPUT; } else { + UNBLOCK_INPUT; /* Fall back on minibuffer if there was a problem */ file = Fcompleting_read (prompt, intern ("read-file-name-internal"), dir, mustmatch, dir, Qfile_name_history, default_filename, Qnil); } - UNBLOCK_INPUT; } UNGCPRO; diff --git a/src/macmenu.c b/src/macmenu.c index 54393bca594..ee83a5f609f 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 */ @@ -1347,6 +1356,68 @@ update_submenu_strings (first_wv) } +/* Event handler function that pops down a menu on C-g. We can only pop + down menus if CancelMenuTracking is present (OSX 10.3 or later). */ + +#ifdef HAVE_CANCELMENUTRACKING +static pascal OSStatus +menu_quit_handler (nextHandler, theEvent, userData) + EventHandlerCallRef nextHandler; + EventRef theEvent; + void* userData; +{ + UInt32 keyCode; + UInt32 keyModifiers; + extern int mac_quit_char_modifiers; + extern int mac_quit_char_keycode; + + GetEventParameter (theEvent, kEventParamKeyCode, + typeUInt32, NULL, sizeof(UInt32), NULL, &keyCode); + + GetEventParameter (theEvent, kEventParamKeyModifiers, + typeUInt32, NULL, sizeof(UInt32), + NULL, &keyModifiers); + + if (keyCode == mac_quit_char_keycode + && keyModifiers == mac_quit_char_modifiers) + { + MenuRef menu = userData != 0 + ? (MenuRef)userData : AcquireRootMenu (); + + CancelMenuTracking (menu, true, 0); + if (!userData) ReleaseMenu (menu); + return noErr; + } + + return CallNextEventHandler (nextHandler, theEvent); +} +#endif /* HAVE_CANCELMENUTRACKING */ + +/* Add event handler for MENU_HANDLE so we can detect C-g. + If MENU_HANDLE is NULL, install handler for all menus in the menu bar. + If CancelMenuTracking isn't available, do nothing. */ + +static void +install_menu_quit_handler (MenuHandle menu_handle) +{ +#ifdef HAVE_CANCELMENUTRACKING + EventHandlerUPP handler = NewEventHandlerUPP(menu_quit_handler); + UInt32 numTypes = 1; + EventTypeSpec typesList[] = { { kEventClassKeyboard, kEventRawKeyDown } }; + int i = MIN_MENU_ID; + MenuHandle menu = menu_handle ? menu_handle : GetMenuHandle (i); + + while (menu != NULL) + { + InstallMenuEventHandler (menu, handler, GetEventTypeCount (typesList), + typesList, menu_handle, NULL); + if (menu_handle) break; + menu = GetMenuHandle (++i); + } + DisposeEventHandlerUPP (handler); +#endif /* HAVE_CANCELMENUTRACKING */ +} + /* Set the contents of the menubar widgets of frame F. The argument FIRST_TIME is currently ignored; it is set the first time this is called, from initialize_frame_menubar. */ @@ -1404,7 +1475,7 @@ set_frame_menubar (f, first_time, deep_p) because it is not reentrant. */ specbind (Qdebug_on_next_call, Qnil); - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); + record_unwind_save_match_data (); if (NILP (Voverriding_local_map_menu_flag)) { specbind (Qoverriding_terminal_local_map, Qnil); @@ -1566,6 +1637,8 @@ set_frame_menubar (f, first_time, deep_p) DrawMenuBar (); + /* Add event handler so we can detect C-g. */ + install_menu_quit_handler (NULL); free_menubar_widget_value_tree (first_wv); UNBLOCK_INPUT; @@ -1597,7 +1670,43 @@ free_frame_menubar (f) } -/* mac_menu_show actually displays a menu using the panes and items in +static Lisp_Object +pop_down_menu (arg) + Lisp_Object arg; +{ + struct Lisp_Save_Value *p1 = XSAVE_VALUE (Fcar (arg)); + struct Lisp_Save_Value *p2 = XSAVE_VALUE (Fcdr (arg)); + + FRAME_PTR f = p1->pointer; + MenuHandle *menu = p2->pointer; + + BLOCK_INPUT; + + /* Must reset this manually because the button release event is not + passed to Emacs event loop. */ + FRAME_MAC_DISPLAY_INFO (f)->grabbed = 0; + + /* delete all menus */ + { + int i = MIN_POPUP_SUBMENU_ID; + MenuHandle submenu = GetMenuHandle (i); + while (submenu != NULL) + { + DeleteMenu (i); + DisposeMenu (submenu); + submenu = GetMenuHandle (++i); + } + } + + DeleteMenu (POPUP_SUBMENU_ID); + DisposeMenu (*menu); + + UNBLOCK_INPUT; + + return Qnil; +} + +/* Mac_menu_show actually displays a menu using the panes and items in menu_items and returns the value selected from it; we assume input is blocked by the caller. */ @@ -1635,6 +1744,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) = (Lisp_Object *) alloca (menu_items_used * sizeof (Lisp_Object)); int submenu_depth = 0; int first_pane; + int specpdl_count = SPECPDL_INDEX (); *error = NULL; @@ -1808,7 +1918,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) title = ENCODE_MENU_STRING (title); #endif wv_title->name = (char *) SDATA (title); - wv_title->enabled = TRUE; + wv_title->enabled = FALSE; wv_title->title = TRUE; wv_title->button_type = BUTTON_TYPE_NONE; wv_title->help = Qnil; @@ -1821,6 +1931,10 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) submenu_id = MIN_POPUP_SUBMENU_ID; fill_submenu (menu, first_wv->contents); + /* Free the widget_value objects we used to specify the + contents. */ + free_menubar_widget_value_tree (first_wv); + /* Adjust coordinates to be root-window-relative. */ pos.h = x; pos.v = y; @@ -1835,11 +1949,18 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) InsertMenu (menu, -1); + record_unwind_protect (pop_down_menu, + Fcons (make_save_value (f, 0), + make_save_value (&menu, 0))); + + /* Add event handler so we can detect C-g. */ + install_menu_quit_handler (menu); + /* Display the menu. */ menu_item_choice = PopUpMenuSelect (menu, pos.v, pos.h, 0); menu_item_selection = LoWord (menu_item_choice); - /* Get the refcon to find the correct item*/ + /* Get the refcon to find the correct item */ if (menu_item_selection) { MenuHandle sel_menu = GetMenuHandle (HiWord (menu_item_choice)); @@ -1847,35 +1968,10 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) GetMenuItemRefCon (sel_menu, menu_item_selection, &refcon); } } - -#if 0 - /* Clean up extraneous mouse events which might have been generated - during the call. */ - discard_mouse_events (); -#endif - - /* Must reset this manually because the button release event is not - passed to Emacs event loop. */ - FRAME_MAC_DISPLAY_INFO (f)->grabbed = 0; - - /* Free the widget_value objects we used to specify the - contents. */ - free_menubar_widget_value_tree (first_wv); - - /* delete all menus */ - { - int i = MIN_POPUP_SUBMENU_ID; - MenuHandle submenu = GetMenuHandle (i); - while (submenu != NULL) - { - DeleteMenu (i); - DisposeMenu (submenu); - submenu = GetMenuHandle (++i); - } - } - - DeleteMenu (POPUP_SUBMENU_ID); - DisposeMenu (menu); + else if (! for_click) + /* Make "Cancel" equivalent to C-g unless this menu was popped up by + a mouse press. */ + Fsignal (Qquit, Qnil); /* Find the selected item, and its pane, to return the proper value. */ @@ -1931,6 +2027,11 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) } } } + else if (!for_click) + /* Make "Cancel" equivalent to C-g. */ + Fsignal (Qquit, Qnil); + + unbind_to (specpdl_count, Qnil); return Qnil; } diff --git a/src/macterm.c b/src/macterm.c index 890c1a1b9ba..f5c71ab2c24 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -1996,33 +1996,37 @@ static void mac_compute_glyph_string_overhangs (s) struct glyph_string *s; { - Rect r; - MacFontStruct *font = s->font; - - TextFont (font->mac_fontnum); - TextSize (font->mac_fontsize); - TextFace (font->mac_fontface); - - if (s->two_byte_p) - QDTextBounds (s->nchars * 2, (char *)s->char2b, &r); - else + if (s->cmp == NULL + && s->first_glyph->type == CHAR_GLYPH) { - int i; - char *buf = xmalloc (s->nchars); + Rect r; + MacFontStruct *font = s->font; - if (buf == NULL) - SetRect (&r, 0, 0, 0, 0); + TextFont (font->mac_fontnum); + TextSize (font->mac_fontsize); + TextFace (font->mac_fontface); + + if (s->two_byte_p) + QDTextBounds (s->nchars * 2, (char *)s->char2b, &r); else { - for (i = 0; i < s->nchars; ++i) - buf[i] = s->char2b[i].byte2; - QDTextBounds (s->nchars, buf, &r); - xfree (buf); + int i; + char *buf = xmalloc (s->nchars); + + if (buf == NULL) + SetRect (&r, 0, 0, 0, 0); + else + { + for (i = 0; i < s->nchars; ++i) + buf[i] = s->char2b[i].byte2; + QDTextBounds (s->nchars, buf, &r); + xfree (buf); + } } - } - s->right_overhang = r.right > s->width ? r.right - s->width : 0; - s->left_overhang = r.left < 0 ? -r.left : 0; + s->right_overhang = r.right > s->width ? r.right - s->width : 0; + s->left_overhang = r.left < 0 ? -r.left : 0; + } } @@ -7469,6 +7473,11 @@ Lisp_Object Vmac_pass_command_to_system; /* If Non-nil, the Mac "Control" key is passed on to the Mac Toolbox for processing before Emacs sees it. */ Lisp_Object Vmac_pass_control_to_system; + +/* Points to the variable `inev' in the function XTread_socket. It is + used for passing an input event to the function back from a Carbon + event handler. */ +static struct input_event *read_socket_inev = NULL; #endif /* Set in term/mac-win.el to indicate that event loop can now generate @@ -7601,45 +7610,79 @@ mac_get_mouse_btn (EventRef ref) /* Normally, ConvertEventRefToEventRecord will correctly handle all events. However the click of the mouse wheel is not converted to a - mouseDown or mouseUp event. This calls ConvertEventRef, but then - checks to see if it is a mouse up or down carbon event that has not - been converted, and if so, converts it by hand (to be picked up in - the XTread_socket loop). */ + mouseDown or mouseUp event. Likewise for dead key down events. + This calls ConvertEventRef, but then checks to see if it is a mouse + up/down, or a dead key down carbon event that has not been + converted, and if so, converts it by hand (to be picked up in the + XTread_socket loop). */ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) { Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec); - /* Do special case for mouse wheel button. */ - if (!result && GetEventClass (eventRef) == kEventClassMouse) + + if (result) + return result; + + switch (GetEventClass (eventRef)) { - UInt32 kind = GetEventKind (eventRef); - if (kind == kEventMouseDown && !(eventRec->what == mouseDown)) + case kEventClassMouse: + switch (GetEventKind (eventRef)) { + case kEventMouseDown: eventRec->what = mouseDown; - result=1; - } - if (kind == kEventMouseUp && !(eventRec->what == mouseUp)) - { + result = 1; + break; + + case kEventMouseUp: eventRec->what = mouseUp; - result=1; + result = 1; + break; + + default: + break; } - if (result) + + case kEventClassKeyboard: + switch (GetEventKind (eventRef)) { - /* Need where and when. */ - UInt32 mods; - GetEventParameter (eventRef, kEventParamMouseLocation, - typeQDPoint, NULL, sizeof (Point), - NULL, &eventRec->where); - /* Use two step process because new event modifiers are - 32-bit and old are 16-bit. Currently, only loss is - NumLock & Fn. */ - GetEventParameter (eventRef, kEventParamKeyModifiers, - typeUInt32, NULL, sizeof (UInt32), - NULL, &mods); - eventRec->modifiers = mods; + case kEventRawKeyDown: + { + unsigned char char_codes; + UInt32 key_code; + + eventRec->what = keyDown; + GetEventParameter (eventRef, kEventParamKeyMacCharCodes, typeChar, + NULL, sizeof (char), NULL, &char_codes); + GetEventParameter (eventRef, kEventParamKeyCode, typeUInt32, + NULL, sizeof (UInt32), NULL, &key_code); + eventRec->message = char_codes | ((key_code & 0xff) << 8); + result = 1; + } + break; - eventRec->when = EventTimeToTicks (GetEventTime (eventRef)); + default: + break; } + + default: + break; } + + if (result) + { + /* Need where and when. */ + UInt32 mods; + + GetEventParameter (eventRef, kEventParamMouseLocation, typeQDPoint, + NULL, sizeof (Point), NULL, &eventRec->where); + /* Use two step process because new event modifiers are 32-bit + and old are 16-bit. Currently, only loss is NumLock & Fn. */ + GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, + NULL, sizeof (UInt32), NULL, &mods); + eventRec->modifiers = mods; + + eventRec->when = EventTimeToTicks (GetEventTime (eventRef)); + } + return result; } @@ -8209,8 +8252,7 @@ mac_handle_command_event (next_handler, event, data) } static OSErr -init_command_handler (window) - WindowPtr window; +init_command_handler () { OSErr err = noErr; EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}}; @@ -8295,6 +8337,68 @@ mac_handle_window_event (next_handler, event, data) return eventNotHandledErr; } + +static pascal OSStatus +mac_handle_mouse_event (next_handler, event, data) + EventHandlerCallRef next_handler; + EventRef event; + void *data; +{ + OSStatus result; + + switch (GetEventKind (event)) + { + case kEventMouseWheelMoved: + { + WindowPtr wp; + struct frame *f; + EventMouseWheelAxis axis; + SInt32 delta; + Point point; + + result = CallNextEventHandler (next_handler, event); + if (result != eventNotHandledErr || read_socket_inev == NULL) + return result; + + GetEventParameter (event, kEventParamWindowRef, typeWindowRef, + NULL, sizeof (WindowRef), NULL, &wp); + f = mac_window_to_frame (wp); + if (f != mac_focus_frame (&one_mac_display_info)) + break; + + GetEventParameter (event, kEventParamMouseWheelAxis, + typeMouseWheelAxis, NULL, + sizeof (EventMouseWheelAxis), NULL, &axis); + if (axis != kEventMouseWheelAxisY) + break; + + GetEventParameter (event, kEventParamMouseWheelDelta, typeSInt32, + NULL, sizeof (SInt32), NULL, &delta); + GetEventParameter (event, kEventParamMouseLocation, typeQDPoint, + NULL, sizeof (Point), NULL, &point); + read_socket_inev->kind = WHEEL_EVENT; + read_socket_inev->code = 0; + read_socket_inev->modifiers = + (mac_event_to_emacs_modifiers (event) + | ((delta < 0) ? down_modifier : up_modifier)); + SetPortWindowPort (wp); + GlobalToLocal (&point); + XSETINT (read_socket_inev->x, point.h); + XSETINT (read_socket_inev->y, point.v); + XSETFRAME (read_socket_inev->frame_or_window, f); + read_socket_inev->timestamp = + EventTimeToTicks (GetEventTime (event)) * (1000/60); + + return noErr; + } + break; + + default: + break; + } + + return eventNotHandledErr; +} #endif /* USE_CARBON_EVENTS */ @@ -8304,16 +8408,24 @@ install_window_handler (window) { OSErr err = noErr; #if USE_CARBON_EVENTS - EventTypeSpec specs[] = {{kEventClassWindow, kEventWindowUpdate}, - {kEventClassWindow, kEventWindowBoundsChanging}}; - static EventHandlerUPP handle_window_event_UPP = NULL; - - if (handle_window_event_UPP == NULL) - handle_window_event_UPP = NewEventHandlerUPP (mac_handle_window_event); + EventTypeSpec specs_window[] = + {{kEventClassWindow, kEventWindowUpdate}, + {kEventClassWindow, kEventWindowBoundsChanging}}; + EventTypeSpec specs_mouse[] = {{kEventClassMouse, kEventMouseWheelMoved}}; + static EventHandlerUPP handle_window_eventUPP = NULL; + static EventHandlerUPP handle_mouse_eventUPP = NULL; - err = InstallWindowEventHandler (window, handle_window_event_UPP, - GetEventTypeCount (specs), specs, - NULL, NULL); + if (handle_window_eventUPP == NULL) + handle_window_eventUPP = NewEventHandlerUPP (mac_handle_window_event); + if (handle_mouse_eventUPP == NULL) + handle_mouse_eventUPP = NewEventHandlerUPP (mac_handle_mouse_event); + err = InstallWindowEventHandler (window, handle_window_eventUPP, + GetEventTypeCount (specs_window), + specs_window, NULL, NULL); + if (err == noErr) + err = InstallWindowEventHandler (window, handle_mouse_eventUPP, + GetEventTypeCount (specs_mouse), + specs_mouse, NULL, NULL); #endif #if TARGET_API_MAC_CARBON if (mac_do_track_dragUPP == NULL) @@ -8865,68 +8977,19 @@ XTread_socket (sd, expected, hold_quit) #if USE_CARBON_EVENTS /* Handle new events */ if (!mac_convert_event_ref (eventRef, &er)) - switch (GetEventClass (eventRef)) - { - case kEventClassWindow: - if (GetEventKind (eventRef) == kEventWindowBoundsChanged) - { - WindowPtr window_ptr; - GetEventParameter(eventRef, kEventParamDirectObject, - typeWindowRef, NULL, sizeof(WindowPtr), - NULL, &window_ptr); - f = mac_window_to_frame (window_ptr); - if (f && !f->async_iconified) - x_real_positions (f, &f->left_pos, &f->top_pos); - SendEventToEventTarget (eventRef, toolbox_dispatcher); - } - break; - case kEventClassMouse: - if (GetEventKind (eventRef) == kEventMouseWheelMoved) - { - SInt32 delta; - Point point; - struct frame *f = mac_focus_frame (dpyinfo); - WindowPtr window_ptr; - -#if 0 - if (dpyinfo->x_focus_frame == NULL) - { - /* Beep if wheel move occurs when all the frames - are invisible. */ - SysBeep(1); - break; - } -#endif - - GetEventParameter(eventRef, kEventParamMouseWheelDelta, - typeSInt32, NULL, sizeof (SInt32), - NULL, &delta); - GetEventParameter(eventRef, kEventParamMouseLocation, - typeQDPoint, NULL, sizeof (Point), - NULL, &point); - inev.kind = WHEEL_EVENT; - inev.code = 0; - inev.modifiers = (mac_event_to_emacs_modifiers (eventRef) - | ((delta < 0) ? down_modifier - : up_modifier)); - window_ptr = FRAME_MAC_WINDOW (f); - SetPortWindowPort (window_ptr); - GlobalToLocal (&point); - XSETINT (inev.x, point.h); - XSETINT (inev.y, point.v); - XSETFRAME (inev.frame_or_window, - mac_window_to_frame (window_ptr)); - inev.timestamp = EventTimeToTicks (GetEventTime (eventRef))*(1000/60); - } - else - SendEventToEventTarget (eventRef, toolbox_dispatcher); - - break; - - default: - /* Send the event to the appropriate receiver. */ - SendEventToEventTarget (eventRef, toolbox_dispatcher); - } + { + /* There used to be a handler for the kEventMouseWheelMoved + event here. But as of Mac OS X 10.4, this kind of event + is not directly posted to the main event queue by + two-finger scrolling on the trackpad. Instead, some + private event is posted and it is converted to a wheel + event by the default handler for the application target. + The converted one can be received by a Carbon event + handler installed on a window target. */ + read_socket_inev = &inev; + SendEventToEventTarget (eventRef, toolbox_dispatcher); + read_socket_inev = NULL; + } else #endif /* USE_CARBON_EVENTS */ switch (er.what) @@ -9362,7 +9425,10 @@ XTread_socket (sd, expected, hold_quit) if ((!NILP (Vmac_pass_command_to_system) || !(er.modifiers & cmdKey)) && (!NILP (Vmac_pass_control_to_system) - || !(er.modifiers & controlKey))) + || !(er.modifiers & controlKey)) + && (!NILP (Vmac_command_key_is_meta) + && NILP (Vmac_option_modifier) + || !(er.modifiers & optionKey))) if (SendEventToEventTarget (eventRef, toolbox_dispatcher) != eventNotHandledErr) break; @@ -9890,8 +9956,8 @@ MakeMeTheFrontProcess () /***** Code to handle C-g testing *****/ /* Contains the Mac modifier formed from quit_char */ -static mac_quit_char_modifiers = 0; -static mac_quit_char_keycode; +int mac_quit_char_modifiers = 0; +int mac_quit_char_keycode; extern int quit_char; static void diff --git a/src/makefile.w32-in b/src/makefile.w32-in index 5a232e28362..c631852c0f0 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) # @@ -165,7 +167,8 @@ $(EMACS): $(DOC) $(TEMACS) # (it is the preload heap size in MB). # temacs: $(BLD) $(TEMACS) -$(TEMACS): $(TLIB0) $(TLIB1) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES) +$(TEMACS): $(TLIB0) $(TLIB1) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES) \ + ../nt/$(BLD)/addsection.exe $(LINK) $(LINK_OUT)$(TEMACS_TMP) $(FULL_LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS) "../nt/$(BLD)/addsection" "$(TEMACS_TMP)" "$(TEMACS)" EMHEAP 16 echo $(OBJ0) > $(BLD)/buildobj.lst @@ -593,6 +596,7 @@ $(BLD)/emacs.$(O) : \ $(SRC)/termhooks.h \ $(SRC)/w32bdf.h \ $(SRC)/w32gui.h \ + $(SRC)/w32heap.h \ $(SRC)/window.h $(BLD)/eval.$(O) : \ @@ -1428,6 +1432,7 @@ $(BLD)/w32select.$(O): \ $(SRC)/systime.h \ $(SRC)/w32bdf.h \ $(SRC)/w32gui.h \ + $(SRC)/w32heap.h \ $(SRC)/w32term.h $(BLD)/w32reg.$(O): \ diff --git a/src/process.c b/src/process.c index 41e46c53dc9..dd13138e273 100644 --- a/src/process.c +++ b/src/process.c @@ -272,17 +272,19 @@ int update_tick; #define READ_OUTPUT_DELAY_MAX (READ_OUTPUT_DELAY_INCREMENT * 5) #define READ_OUTPUT_DELAY_MAX_MAX (READ_OUTPUT_DELAY_INCREMENT * 7) -/* Number of processes which might be delayed. */ +/* Number of processes which have a non-zero read_output_delay, + and therefore might be delayed for adaptive read buffering. */ static int process_output_delay_count; -/* Non-zero if any process has non-nil process_output_skip. */ +/* Non-zero if any process has non-nil read_output_skip. */ static int process_output_skip; /* Non-nil means to delay reading process output to improve buffering. A value of t means that delay is reset after each send, any other - non-nil value does not reset the delay. */ + non-nil value does not reset the delay. A value of nil disables + adaptive read buffering completely. */ static Lisp_Object Vprocess_adaptive_read_buffering; #else #define process_output_delay_count 0 @@ -1535,7 +1537,6 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) XPROCESS (proc)->childp = Qt; XPROCESS (proc)->plist = Qnil; - XPROCESS (proc)->command_channel_p = Qnil; XPROCESS (proc)->buffer = buffer; XPROCESS (proc)->sentinel = Qnil; XPROCESS (proc)->filter = Qnil; @@ -4319,6 +4320,11 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, #endif #ifdef ADAPTIVE_READ_BUFFERING + /* Set the timeout for adaptive read buffering if any + process has non-nil read_output_skip and non-zero + read_output_delay, and we are not reading output for a + specific wait_channel. It is not executed if + Vprocess_adaptive_read_buffering is nil. */ if (process_output_skip && check_delay > 0) { int usecs = EMACS_USECS (timeout); @@ -4329,6 +4335,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, proc = chan_process[channel]; if (NILP (proc)) continue; + /* Find minimum non-zero read_output_delay among the + processes with non-nil read_output_skip. */ if (XINT (XPROCESS (proc)->read_output_delay) > 0) { check_delay--; @@ -4879,10 +4887,10 @@ read_process_output (proc, channel) { Lisp_Object tem; /* Don't clobber the CURRENT match data, either! */ - tem = Fmatch_data (Qnil, Qnil); - restore_match_data (); - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); - Fset_match_data (tem); + tem = Fmatch_data (Qnil, Qnil, Qnil); + restore_search_regs (); + record_unwind_save_match_data (); + Fset_match_data (tem, Qt); } /* For speed, if a search happens within this code, @@ -4936,7 +4944,7 @@ read_process_output (proc, channel) read_process_output_error_handler); /* If we saved the match data nonrecursively, restore it now. */ - restore_match_data (); + restore_search_regs (); running_asynch_code = outer_running_asynch_code; /* Handling the process output should not deactivate the mark. */ @@ -6340,10 +6348,10 @@ exec_sentinel (proc, reason) if (outer_running_asynch_code) { Lisp_Object tem; - tem = Fmatch_data (Qnil, Qnil); - restore_match_data (); - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); - Fset_match_data (tem); + tem = Fmatch_data (Qnil, Qnil, Qnil); + restore_search_regs (); + record_unwind_save_match_data (); + Fset_match_data (tem, Qt); } /* For speed, if a search happens within this code, @@ -6357,7 +6365,7 @@ exec_sentinel (proc, reason) exec_sentinel_error_handler); /* If we saved the match data nonrecursively, restore it now. */ - restore_match_data (); + restore_search_regs (); running_asynch_code = outer_running_asynch_code; Vdeactivate_mark = odeactivate; @@ -6708,7 +6716,7 @@ init_process () #endif /* HAVE_SOCKETS */ #if defined (DARWIN) || defined (MAC_OSX) - /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive + /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive processes. As such, we only change the default value. */ if (initialized) { @@ -6813,7 +6821,7 @@ The value takes effect when `start-process' is called. */); doc: /* If non-nil, improve receive buffering by delaying after short reads. On some systems, when Emacs reads the output from a subprocess, the output data is read in very small blocks, potentially resulting in very poor performance. -This behaviour can be remedied to some extent by setting this variable to a +This behavior can be remedied to some extent by setting this variable to a non-nil value, as it will automatically delay reading from such processes, to allowing them to produce more output before Emacs tries to read it. If the value is t, the delay is reset after each write to the process; any other diff --git a/src/process.h b/src/process.h index 6e2641d6b06..8e3f9028c0b 100644 --- a/src/process.h +++ b/src/process.h @@ -52,8 +52,6 @@ struct Lisp_Process Lisp_Object buffer; /* Number of this process */ Lisp_Object pid; - /* Non-nil if this is really a command channel */ - Lisp_Object command_channel_p; /* t if this is a real child process. For a net connection, it is a plist based on the arguments to make-network-process. */ Lisp_Object childp; @@ -105,7 +103,7 @@ struct Lisp_Process Initialized from `Vprocess_adaptive_read_buffering'. */ Lisp_Object adaptive_read_buffering; /* Hysteresis to try to read process output in larger blocks. - On some systems, e.g. the Linux kernel, emacs is seen as + On some systems, e.g. GNU/Linux, Emacs is seen as an interactive app also when reading process output, meaning that process output can be read in as little as 1 byte at a time. Value is micro-seconds to delay reading output from 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/search.c b/src/search.c index 73ec3a78e58..c1f2fd77cec 100644 --- a/src/search.c +++ b/src/search.c @@ -2739,7 +2739,7 @@ Zero means the entire text matched by the whole regexp or whole string. */) return match_limit (subexp, 0); } -DEFUN ("match-data", Fmatch_data, Smatch_data, 0, 2, 0, +DEFUN ("match-data", Fmatch_data, Smatch_data, 0, 3, 0, doc: /* Return a list containing all info on what the last search matched. Element 2N is `(match-beginning N)'; element 2N + 1 is `(match-end N)'. All the elements are markers or nil (nil if the Nth pair didn't match) @@ -2751,17 +2751,35 @@ integers \(rather than markers) to represent buffer positions. In this case, and if the last match was in a buffer, the buffer will get stored as one additional element at the end of the list. -If REUSE is a list, reuse it as part of the value. If REUSE is long enough -to hold all the values, and if INTEGERS is non-nil, no consing is done. +If REUSE is a list, reuse it as part of the value. If REUSE is long +enough to hold all the values, and if INTEGERS is non-nil, no consing +is done. + +If optional third arg RESEAT is non-nil, any previous markers on the +REUSE list will be modified to point to nowhere. + +If RESEAT is `evaporate', put markers back on the free list. +Note: No other references to the markers must exist if you use this. Return value is undefined if the last search failed. */) - (integers, reuse) - Lisp_Object integers, reuse; + (integers, reuse, reseat) + Lisp_Object integers, reuse, reseat; { Lisp_Object tail, prev; Lisp_Object *data; int i, len; + if (!NILP (reseat)) + for (tail = reuse; CONSP (tail); tail = XCDR (tail)) + if (MARKERP (XCAR (tail))) + { + if (EQ (reseat, Qevaporate)) + free_marker (XCAR (tail)); + else + unchain_marker (XMARKER (XCAR (tail))); + XSETCAR (tail, Qnil); + } + if (NILP (last_thing_searched)) return Qnil; @@ -2797,10 +2815,10 @@ Return value is undefined if the last search failed. */) /* last_thing_searched must always be Qt, a buffer, or Qnil. */ abort (); - len = 2*(i+1); + len = 2 * i + 2; } else - data[2 * i] = data [2 * i + 1] = Qnil; + data[2 * i] = data[2 * i + 1] = Qnil; } if (BUFFERP (last_thing_searched) && !NILP (integers)) @@ -2834,11 +2852,15 @@ Return value is undefined if the last search failed. */) } -DEFUN ("set-match-data", Fset_match_data, Sset_match_data, 1, 1, 0, +DEFUN ("set-match-data", Fset_match_data, Sset_match_data, 1, 2, 0, doc: /* Set internal data on last search match from elements of LIST. -LIST should have been created by calling `match-data' previously. */) - (list) - register Lisp_Object list; +LIST should have been created by calling `match-data' previously. + +If optional arg RESEAT is non-nil, make markers on LIST point nowhere. +If RESEAT is `evaporate', put the markers back on the free list. +Note: No other references to the markers must exist if you use this. */) + (list, reseat) + register Lisp_Object list, reseat; { register int i; register Lisp_Object marker; @@ -2882,9 +2904,9 @@ LIST should have been created by calling `match-data' previously. */) search_regs.num_regs = length; } - for (i = 0;; i++) + for (i = 0; CONSP (list); i++) { - marker = Fcar (list); + marker = XCAR (list); if (BUFFERP (marker)) { last_thing_searched = marker; @@ -2895,12 +2917,14 @@ LIST should have been created by calling `match-data' previously. */) if (NILP (marker)) { search_regs.start[i] = -1; - list = Fcdr (list); + list = XCDR (list); } else { int from; + Lisp_Object m; + m = marker; if (MARKERP (marker)) { if (XMARKER (marker)->buffer == 0) @@ -2911,17 +2935,38 @@ LIST should have been created by calling `match-data' previously. */) CHECK_NUMBER_COERCE_MARKER (marker); from = XINT (marker); - list = Fcdr (list); - marker = Fcar (list); + if (!NILP (reseat) && MARKERP (m)) + { + if (EQ (reseat, Qevaporate)) + free_marker (m); + else + unchain_marker (XMARKER (m)); + XSETCAR (list, Qnil); + } + + if ((list = XCDR (list), !CONSP (list))) + break; + + m = marker = XCAR (list); + if (MARKERP (marker) && XMARKER (marker)->buffer == 0) XSETFASTINT (marker, 0); CHECK_NUMBER_COERCE_MARKER (marker); search_regs.start[i] = from; search_regs.end[i] = XINT (marker); + + if (!NILP (reseat) && MARKERP (m)) + { + if (EQ (reseat, Qevaporate)) + free_marker (m); + else + unchain_marker (XMARKER (m)); + XSETCAR (list, Qnil); + } } - list = Fcdr (list); + list = XCDR (list); } for (; i < search_regs.num_regs; i++) @@ -2959,7 +3004,7 @@ save_search_regs () /* Called upon exit from filters and sentinels. */ void -restore_match_data () +restore_search_regs () { if (search_regs_saved) { @@ -2977,6 +3022,21 @@ restore_match_data () } } +static Lisp_Object +unwind_set_match_data (list) + Lisp_Object list; +{ + return Fset_match_data (list, Qevaporate); +} + +/* Called to unwind protect the match data. */ +void +record_unwind_save_match_data () +{ + record_unwind_protect (unwind_set_match_data, + Fmatch_data (Qnil, Qnil, Qnil)); +} + /* Quote a string to inactivate reg-expr chars */ DEFUN ("regexp-quote", Fregexp_quote, Sregexp_quote, 1, 1, 0, diff --git a/src/unexmacosx.c b/src/unexmacosx.c index e54dbea448c..1a2c211a09d 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c @@ -695,6 +695,7 @@ copy_data_segment (struct load_command *lc) } else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0 || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0 + || strncmp (sectp->sectname, "__la_sym_ptr2", 16) == 0 || strncmp (sectp->sectname, "__dyld", 16) == 0 || strncmp (sectp->sectname, "__const", 16) == 0 || strncmp (sectp->sectname, "__cfstring", 16) == 0) diff --git a/src/unexw32.c b/src/unexw32.c index b1838644965..ebeb7355673 100644 --- a/src/unexw32.c +++ b/src/unexw32.c @@ -1,5 +1,5 @@ /* unexec for GNU Emacs on Windows NT. - Copyright (C) 1994 Free Software Foundation, Inc. + Copyright (C) 1994, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -325,6 +325,9 @@ relocate_offset (DWORD offset, /* Convert address in executing image to RVA. */ #define PTR_TO_RVA(ptr) ((DWORD)(ptr) - (DWORD) GetModuleHandle (NULL)) +#define RVA_TO_PTR(var,section,filedata) \ + ((void *)(RVA_TO_OFFSET(var,section) + (filedata).file_base)) + #define PTR_TO_OFFSET(ptr, pfile_data) \ ((unsigned char *)(ptr) - (pfile_data)->file_base) @@ -488,27 +491,34 @@ copy_executable_and_dump_data (file_data *p_infile, PIMAGE_SECTION_HEADER dst_section; DWORD offset; int i; + int be_verbose = GetEnvironmentVariable ("DEBUG_DUMP", NULL, 0) > 0; -#define COPY_CHUNK(message, src, size) \ +#define COPY_CHUNK(message, src, size, verbose) \ do { \ unsigned char *s = (void *)(src); \ unsigned long count = (size); \ - printf ("%s\n", (message)); \ - printf ("\t0x%08x Offset in input file.\n", s - p_infile->file_base); \ - printf ("\t0x%08x Offset in output file.\n", dst - p_outfile->file_base); \ - printf ("\t0x%08x Size in bytes.\n", count); \ + if (verbose) \ + { \ + printf ("%s\n", (message)); \ + printf ("\t0x%08x Offset in input file.\n", s - p_infile->file_base); \ + printf ("\t0x%08x Offset in output file.\n", dst - p_outfile->file_base); \ + printf ("\t0x%08x Size in bytes.\n", count); \ + } \ memcpy (dst, s, count); \ dst += count; \ } while (0) -#define COPY_PROC_CHUNK(message, src, size) \ +#define COPY_PROC_CHUNK(message, src, size, verbose) \ do { \ unsigned char *s = (void *)(src); \ unsigned long count = (size); \ - printf ("%s\n", (message)); \ - printf ("\t0x%08x Address in process.\n", s); \ - printf ("\t0x%08x Offset in output file.\n", dst - p_outfile->file_base); \ - printf ("\t0x%08x Size in bytes.\n", count); \ + if (verbose) \ + { \ + printf ("%s\n", (message)); \ + printf ("\t0x%08x Address in process.\n", s); \ + printf ("\t0x%08x Offset in output file.\n", dst - p_outfile->file_base); \ + printf ("\t0x%08x Size in bytes.\n", count); \ + } \ memcpy (dst, s, count); \ dst += count; \ } while (0) @@ -539,13 +549,14 @@ copy_executable_and_dump_data (file_data *p_infile, dst = (unsigned char *) p_outfile->file_base; COPY_CHUNK ("Copying DOS header...", dos_header, - (DWORD) nt_header - (DWORD) dos_header); + (DWORD) nt_header - (DWORD) dos_header, be_verbose); dst_nt_header = (PIMAGE_NT_HEADERS) dst; COPY_CHUNK ("Copying NT header...", nt_header, - (DWORD) section - (DWORD) nt_header); + (DWORD) section - (DWORD) nt_header, be_verbose); dst_section = (PIMAGE_SECTION_HEADER) dst; COPY_CHUNK ("Copying section table...", section, - nt_header->FileHeader.NumberOfSections * sizeof (*section)); + nt_header->FileHeader.NumberOfSections * sizeof (*section), + be_verbose); /* Align the first section's raw data area, and set the header size field accordingly. */ @@ -555,7 +566,9 @@ copy_executable_and_dump_data (file_data *p_infile, for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++) { char msg[100]; - sprintf (msg, "Copying raw data for %s...", section->Name); + /* Windows section names are fixed 8-char strings, only + zero-terminated if the name is shorter than 8 characters. */ + sprintf (msg, "Copying raw data for %.8s...", section->Name); dst_save = dst; @@ -568,7 +581,7 @@ copy_executable_and_dump_data (file_data *p_infile, /* Can always copy the original raw data. */ COPY_CHUNK (msg, OFFSET_TO_PTR (section->PointerToRawData, p_infile), - section->SizeOfRawData); + section->SizeOfRawData, be_verbose); /* Ensure alignment slop is zeroed. */ ROUND_UP_DST_AND_ZERO (dst_nt_header->OptionalHeader.FileAlignment); @@ -577,7 +590,8 @@ copy_executable_and_dump_data (file_data *p_infile, { dst = dst_save + RVA_TO_SECTION_OFFSET (PTR_TO_RVA (data_start), dst_section); - COPY_PROC_CHUNK ("Dumping initialized data...", data_start, data_size); + COPY_PROC_CHUNK ("Dumping initialized data...", + data_start, data_size, be_verbose); dst = dst_save + dst_section->SizeOfRawData; } if (section == bss_section) @@ -586,7 +600,8 @@ copy_executable_and_dump_data (file_data *p_infile, data size as necessary. */ dst = dst_save + RVA_TO_SECTION_OFFSET (PTR_TO_RVA (bss_start), dst_section); - COPY_PROC_CHUNK ("Dumping bss data...", bss_start, bss_size); + COPY_PROC_CHUNK ("Dumping bss data...", bss_start, + bss_size, be_verbose); ROUND_UP_DST (dst_nt_header->OptionalHeader.FileAlignment); dst_section->PointerToRawData = PTR_TO_OFFSET (dst_save, p_outfile); /* Determine new size of raw data area. */ @@ -601,7 +616,8 @@ copy_executable_and_dump_data (file_data *p_infile, section's raw data size as necessary. */ dst = dst_save + RVA_TO_SECTION_OFFSET (PTR_TO_RVA (bss_start_static), dst_section); - COPY_PROC_CHUNK ("Dumping static bss data...", bss_start_static, bss_size_static); + COPY_PROC_CHUNK ("Dumping static bss data...", bss_start_static, + bss_size_static, be_verbose); ROUND_UP_DST (dst_nt_header->OptionalHeader.FileAlignment); dst_section->PointerToRawData = PTR_TO_OFFSET (dst_save, p_outfile); /* Determine new size of raw data area. */ @@ -619,7 +635,8 @@ copy_executable_and_dump_data (file_data *p_infile, section's size to the appropriate size. */ dst = dst_save + RVA_TO_SECTION_OFFSET (PTR_TO_RVA (heap_start), dst_section); - COPY_PROC_CHUNK ("Dumping heap...", heap_start, heap_size); + COPY_PROC_CHUNK ("Dumping heap...", heap_start, heap_size, + be_verbose); ROUND_UP_DST (dst_nt_header->OptionalHeader.FileAlignment); dst_section->PointerToRawData = PTR_TO_OFFSET (dst_save, p_outfile); /* Determine new size of raw data area. */ @@ -654,7 +671,7 @@ copy_executable_and_dump_data (file_data *p_infile, COPY_CHUNK ("Copying remainder of executable...", OFFSET_TO_PTR (offset, p_infile), - p_infile->size - offset); + p_infile->size - offset, be_verbose); /* Final size for new image. */ p_outfile->size = DST_TO_OFFSET (); 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/w32bdf.c b/src/w32bdf.c index 092aff306dc..8d57cbd3523 100644 --- a/src/w32bdf.c +++ b/src/w32bdf.c @@ -604,7 +604,7 @@ create_offscreen_bitmap(HDC hdc, int width, int height, unsigned char **bitsp) info.c[1].rgbRed = info.c[1].rgbGreen = info.c[1].rgbBlue = 255; return CreateDIBSection(hdc, (LPBITMAPINFO)&info, - DIB_RGB_COLORS, bitsp, NULL, 0); + DIB_RGB_COLORS, (void **)bitsp, NULL, 0); } glyph_metric * diff --git a/src/w32fns.c b/src/w32fns.c index b7115601553..6a2f98c4c7d 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -7759,6 +7759,19 @@ file_dialog_callback (hwnd, msg, wParam, lParam) return 0; } +/* Since we compile with _WIN32_WINNT set to 0x0400 (for NT4 compatibility) + we end up with the old file dialogs. Define a big enough struct for the + new dialog to trick GetOpenFileName into giving us the new dialogs on + Windows 2000 and XP. */ +typedef struct +{ + OPENFILENAME real_details; + void * pReserved; + DWORD dwReserved; + DWORD FlagsEx; +} NEWOPENFILENAME; + + DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 5, 0, doc: /* Read file name, prompting with PROMPT in directory DIR. Use a file selection dialog. @@ -7807,39 +7820,58 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) filename[0] = '\0'; { - OPENFILENAME file_details; - + NEWOPENFILENAME new_file_details; + BOOL file_opened = FALSE; + OPENFILENAME * file_details = &new_file_details.real_details; + /* Prevent redisplay. */ specbind (Qinhibit_redisplay, Qt); BLOCK_INPUT; - bzero (&file_details, sizeof (file_details)); - file_details.lStructSize = sizeof (file_details); - file_details.hwndOwner = FRAME_W32_WINDOW (f); + bzero (&new_file_details, sizeof (new_file_details)); + /* Apparently NT4 crashes if you give it an unexpected size. + I'm not sure about Windows 9x, so play it safe. */ + if (w32_major_version > 4 && w32_major_version < 95) + file_details->lStructSize = sizeof (new_file_details); + else + file_details->lStructSize = sizeof (file_details); + + file_details->hwndOwner = FRAME_W32_WINDOW (f); /* Undocumented Bug in Common File Dialog: If a filter is not specified, shell links are not resolved. */ - file_details.lpstrFilter = "All Files (*.*)\0*.*\0Directories\0*|*\0\0"; - file_details.lpstrFile = filename; - file_details.nMaxFile = sizeof (filename); - file_details.lpstrInitialDir = init_dir; - file_details.lpstrTitle = SDATA (prompt); + file_details->lpstrFilter = "All Files (*.*)\0*.*\0Directories\0*|*\0\0"; + file_details->lpstrFile = filename; + file_details->nMaxFile = sizeof (filename); + file_details->lpstrInitialDir = init_dir; + file_details->lpstrTitle = SDATA (prompt); if (! NILP (only_dir_p)) default_filter_index = 2; - file_details.nFilterIndex = default_filter_index; + file_details->nFilterIndex = default_filter_index; - file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR + file_details->Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR | OFN_EXPLORER | OFN_ENABLEHOOK); if (!NILP (mustmatch)) - file_details.Flags |= OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST; + { + /* Require that the path to the parent directory exists. */ + file_details->Flags |= OFN_PATHMUSTEXIST; + /* If we are looking for a file, require that it exists. */ + if (NILP (only_dir_p)) + file_details->Flags |= OFN_FILEMUSTEXIST; + } + + file_details->lpfnHook = (LPOFNHOOKPROC) file_dialog_callback; - file_details.lpfnHook = (LPOFNHOOKPROC) file_dialog_callback; + file_opened = GetOpenFileName (file_details); - if (GetOpenFileName (&file_details)) + UNBLOCK_INPUT; + + if (file_opened) { dostounix_filename (filename); - if (file_details.nFilterIndex == 2) + + if (file_details->nFilterIndex == 2) { /* "Directories" selected - strip dummy file name. */ char * last = strrchr (filename, '/'); @@ -7857,7 +7889,6 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) dir, mustmatch, dir, Qfile_name_history, default_filename, Qnil); - UNBLOCK_INPUT; file = unbind_to (count, file); } @@ -8698,7 +8729,7 @@ fontsets are automatically created. */); DEFVAR_BOOL ("w32-strict-painting", &w32_strict_painting, doc: /* Non-nil means use strict rules for repainting frames. -Set this to nil to get the old behaviour for repainting; this should +Set this to nil to get the old behavior for repainting; this should only be necessary if the default setting causes problems. */); w32_strict_painting = 1; @@ -8890,24 +8921,25 @@ void globals_of_w32fns () #undef abort +void w32_abort (void) NO_RETURN; + void w32_abort() { int button; button = MessageBox (NULL, "A fatal error has occurred!\n\n" - "Select Abort to exit, Retry to debug, Ignore to continue", + "Would you like to attach a debugger?\n\n" + "Select YES to debug, NO to abort Emacs", "Emacs Abort Dialog", MB_ICONEXCLAMATION | MB_TASKMODAL - | MB_SETFOREGROUND | MB_ABORTRETRYIGNORE); + | MB_SETFOREGROUND | MB_YESNO); switch (button) { - case IDRETRY: + case IDYES: DebugBreak (); - break; - case IDIGNORE: - break; - case IDABORT: + exit (2); /* tell the compiler we will never return */ + case IDNO: default: abort (); break; diff --git a/src/w32heap.c b/src/w32heap.c index d947842474f..4c28718a510 100644 --- a/src/w32heap.c +++ b/src/w32heap.c @@ -31,7 +31,6 @@ Boston, MA 02111-1307, USA. #include "w32heap.h" #include "lisp.h" /* for VALMASK */ -#undef RVA_TO_PTR #define RVA_TO_PTR(rva) ((unsigned char *)((DWORD)(rva) + (DWORD)GetModuleHandle (NULL))) /* This gives us the page size and the size of the allocation unit on NT. */ diff --git a/src/w32heap.h b/src/w32heap.h index 7fdf952683c..556c7fb28b4 100644 --- a/src/w32heap.h +++ b/src/w32heap.h @@ -82,15 +82,6 @@ typedef struct file_data { unsigned char *file_base; } file_data; -#define OFFSET_TO_RVA(var,section) \ - (section->VirtualAddress + ((DWORD)(var) - section->PointerToRawData)) - -#define RVA_TO_OFFSET(var,section) \ - (section->PointerToRawData + ((DWORD)(var) - section->VirtualAddress)) - -#define RVA_TO_PTR(var,section,filedata) \ - ((void *)(RVA_TO_OFFSET(var,section) + (filedata).file_base)) - int open_input_file (file_data *p_file, char *name); int open_output_file (file_data *p_file, char *name, unsigned long size); void close_file_data (file_data *p_file); diff --git a/src/w32menu.c b/src/w32menu.c index 8a90eae7ec7..c5af0aae980 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -1443,7 +1443,8 @@ set_frame_menubar (f, first_time, deep_p) because it is not reentrant. */ specbind (Qdebug_on_next_call, Qnil); - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); + record_unwind_save_match_data (); + if (NILP (Voverriding_local_map_menu_flag)) { specbind (Qoverriding_terminal_local_map, Qnil); diff --git a/src/w32proc.c b/src/w32proc.c index 9abee2bf0c2..48b5e2c14a3 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -57,6 +57,11 @@ extern BOOL WINAPI IsValidLocale(LCID, DWORD); #include "syssignal.h" #include "w32term.h" +#define RVA_TO_PTR(var,section,filedata) \ + ((void *)((section)->PointerToRawData \ + + ((DWORD)(var) - (section)->VirtualAddress) \ + + (filedata).file_base)) + /* Control whether spawnve quotes arguments as necessary to ensure correct parsing by child process. Because not all uses of spawnve are careful about constructing argv arrays, we make this behaviour diff --git a/src/w32term.c b/src/w32term.c index 403cec7db7e..57f27d70e4d 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -87,6 +87,10 @@ static int any_help_event_p; /* Last window where we saw the mouse. Used by mouse-autoselect-window. */ static Lisp_Object last_window; +/* Non-zero means make use of UNDERLINE_POSITION font properties. + (Not yet supported, see TODO in x_draw_glyph_string.) */ +int x_use_underline_position_properties; + extern unsigned int msh_mousewheel; extern void free_frame_menubar (); @@ -2488,7 +2492,9 @@ x_draw_glyph_string (s) unsigned long dy = s->height - h; /* TODO: Use font information for positioning and thickness - of underline. See OUTLINETEXTMETRIC, and xterm.c. */ + of underline. See OUTLINETEXTMETRIC, and xterm.c. + Note: If you make this work, don't forget to change the + doc string of x-use-underline-position-properties below. */ if (s->face->underline_defaulted_p) { w32_fill_area (s->f, s->hdc, s->gc->foreground, s->x, @@ -6537,6 +6543,18 @@ the cursor have no effect. */); &w32_use_visible_system_caret, 0)) w32_use_visible_system_caret = 0; + /* We don't yet support this, but defining this here avoids whining + from cus-start.el and other places, like "M-x set-variable". */ + DEFVAR_BOOL ("x-use-underline-position-properties", + &x_use_underline_position_properties, + doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties. +nil means ignore them. If you encounter fonts with bogus +UNDERLINE_POSITION font properties, for example 7x13 on XFree prior +to 4.1, set this to nil. + +NOTE: Not supported on MS-Windows yet. */); + x_use_underline_position_properties = 0; + DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, doc: /* If not nil, Emacs uses toolkit scroll bars. */); Vx_toolkit_scroll_bars = Qt; diff --git a/src/window.c b/src/window.c index 83d99cf67ba..5bfff27f976 100644 --- a/src/window.c +++ b/src/window.c @@ -1454,8 +1454,10 @@ delete_window (window) tem = par->hchild; if (NILP (tem)) tem = par->vchild; - if (NILP (XWINDOW (tem)->next)) + if (NILP (XWINDOW (tem)->next)) { replace_window (parent, tem); + par = XWINDOW (tem); + } /* Since we may be deleting combination windows, we must make sure that not only p but all its children have been marked as deleted. */ @@ -1467,6 +1469,51 @@ delete_window (window) /* Mark this window as deleted. */ p->buffer = p->hchild = p->vchild = Qnil; + if (! NILP (par->parent)) + par = XWINDOW (par->parent); + + /* Check if we have a v/hchild with a v/hchild. In that case remove + one of them. */ + + if (! NILP (par->vchild) && ! NILP (XWINDOW (par->vchild)->vchild)) + { + p = XWINDOW (par->vchild); + par->vchild = p->vchild; + tem = p->vchild; + } + else if (! NILP (par->hchild) && ! NILP (XWINDOW (par->hchild)->hchild)) + { + p = XWINDOW (par->hchild); + par->hchild = p->hchild; + tem = p->hchild; + } + else + p = 0; + + if (p) + { + while (! NILP (tem)) { + XWINDOW (tem)->parent = p->parent; + if (NILP (XWINDOW (tem)->next)) + break; + tem = XWINDOW (tem)->next; + } + if (! NILP (tem)) { + /* The next of the v/hchild we are removing is now the next of the + last child for the v/hchild: + Before v/hchild -> v/hchild -> next1 -> next2 + | + -> next3 + After: v/hchild -> next1 -> next2 -> next3 + */ + XWINDOW (tem)->next = p->next; + if (! NILP (p->next)) + XWINDOW (p->next)->prev = tem; + } + p->next = p->prev = p->vchild = p->hchild = p->buffer = Qnil; + } + + /* Adjust glyph matrices. */ adjust_glyphs (f); UNBLOCK_INPUT; @@ -3189,7 +3236,7 @@ selects the buffer of the selected window before each command. */) so that FRAME_FOCUS_FRAME is moved appropriately as we move around in the state where a minibuffer in a separate frame is active. */ - Fselect_frame (WINDOW_FRAME (w), Qnil); + Fselect_frame (WINDOW_FRAME (w)); } else sf->selected_window = window; diff --git a/src/xdisp.c b/src/xdisp.c index 31a82fefd78..a7ce6159a01 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -350,6 +350,10 @@ Lisp_Object Qtrailing_whitespace; Lisp_Object Qescape_glyph; +/* Name and number of the face used to highlight non-breaking spaces. */ + +Lisp_Object Qno_break_space; + /* The symbol `image' which is the car of the lists used to represent images in Lisp. */ @@ -1881,7 +1885,7 @@ get_phys_cursor_geometry (w, row, glyph, heightp) int *heightp; { struct frame *f = XFRAME (WINDOW_FRAME (w)); - int x, y, wd, h, h0, y0; + int y, wd, h, h0, y0; /* Compute the width of the rectangle to draw. If on a stretch glyph, and `x-stretch-block-cursor' is nil, don't draw a @@ -5081,8 +5085,10 @@ get_next_display_element (it) && it->len == 1) || !CHAR_PRINTABLE_P (it->c) || (!NILP (Vshow_nonbreak_escape) - && (it->c == 0x8ad || it->c == 0x8a0 - || it->c == 0xf2d || it->c == 0xf20))) + && (it->c == 0x8a0 || it->c == 0x8ad + || it->c == 0x920 || it->c == 0x92d + || it->c == 0xe20 || it->c == 0xe2d + || it->c == 0xf20 || it->c == 0xf2d))) : (it->c >= 127 && (!unibyte_display_via_language_environment || it->c == unibyte_char_to_multibyte (it->c))))) @@ -5097,6 +5103,8 @@ get_next_display_element (it) int face_id, lface_id = 0 ; GLYPH escape_glyph; + /* Handle control characters with ^. */ + if (it->c < 128 && it->ctl_arrow_p) { g = '^'; /* default glyph for Control */ @@ -5128,7 +5136,28 @@ get_next_display_element (it) goto display_control; } - escape_glyph = '\\'; /* default for Octal display */ + /* Handle non-break space in the mode where it only gets + highlighting. */ + + if (! EQ (Vshow_nonbreak_escape, Qt) + && (it->c == 0x8a0 || it->c == 0x920 + || it->c == 0xe20 || it->c == 0xf20)) + { + /* Merge the no-break-space face into the current face. */ + face_id = merge_faces (it->f, Qno_break_space, 0, + it->face_id); + + g = it->c = ' '; + XSETINT (it->ctl_chars[0], g); + ctl_len = 1; + goto display_control; + } + + /* Handle sequences that start with the "escape glyph". */ + + /* the default escape glyph is \. */ + escape_glyph = '\\'; + if (it->dp && INTEGERP (DISP_ESCAPE_GLYPH (it->dp)) && GLYPH_CHAR_VALID_P (XFASTINT (DISP_ESCAPE_GLYPH (it->dp)))) @@ -5138,6 +5167,8 @@ get_next_display_element (it) } if (lface_id) { + /* The display table specified a face. + Merge it into face_id and also into escape_glyph. */ escape_glyph = FAST_GLYPH_CHAR (escape_glyph); face_id = merge_faces (it->f, Qt, lface_id, it->face_id); @@ -5149,11 +5180,29 @@ get_next_display_element (it) it->face_id); } + /* Handle soft hyphens in the mode where they only get + highlighting. */ + + if (! EQ (Vshow_nonbreak_escape, Qt) + && (it->c == 0x8ad || it->c == 0x92d + || it->c == 0xe2d || it->c == 0xf2d)) + { + g = it->c = '-'; + XSETINT (it->ctl_chars[0], g); + ctl_len = 1; + goto display_control; + } + + /* Handle non-break space and soft hyphen + with the escape glyph. */ + if (it->c == 0x8a0 || it->c == 0x8ad + || it->c == 0x920 || it->c == 0x92d + || it->c == 0xe20 || it->c == 0xe2d || it->c == 0xf20 || it->c == 0xf2d) { XSETINT (it->ctl_chars[0], escape_glyph); - g = it->c; + g = it->c = ((it->c & 0xf) == 0 ? ' ' : '-'); XSETINT (it->ctl_chars[1], g); ctl_len = 2; goto display_control; @@ -8205,7 +8254,6 @@ 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 @@ -8442,7 +8490,7 @@ prepare_menu_bars () Lisp_Object tail, frame; int count = SPECPDL_INDEX (); - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); + record_unwind_save_match_data (); FOR_EACH_FRAME (tail, frame) { @@ -8565,7 +8613,7 @@ update_menu_bar (f, save_match_data) set_buffer_internal_1 (XBUFFER (w->buffer)); if (save_match_data) - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); + record_unwind_save_match_data (); if (NILP (Voverriding_local_map_menu_flag)) { specbind (Qoverriding_terminal_local_map, Qnil); @@ -8756,7 +8804,7 @@ update_tool_bar (f, save_match_data) /* Save match data, if we must. */ if (save_match_data) - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); + record_unwind_save_match_data (); /* Make sure that we don't accidentally use bogus keymaps. */ if (NILP (Voverriding_local_map_menu_flag)) @@ -19160,7 +19208,7 @@ get_line_height_property (it, prop) struct it *it; Lisp_Object prop; { - Lisp_Object position, val; + Lisp_Object position; if (STRINGP (it->object)) position = make_number (IT_STRING_CHARPOS (*it)); @@ -19511,7 +19559,6 @@ x_produce_glyphs (it) else { Lisp_Object spacing; - int total = 0; it->phys_ascent = it->ascent; it->phys_descent = it->descent; @@ -21480,9 +21527,7 @@ note_mode_line_or_margin_highlight (window, x, y, area) int total_pixel_width; int ignore; - - if (clear_mouse_face (dpyinfo)) - cursor = No_Cursor; + int vpos, hpos; b = Fprevious_single_property_change (make_number (charpos + 1), Qmouse_face, string, Qnil); @@ -21526,15 +21571,30 @@ note_mode_line_or_margin_highlight (window, x, y, area) for (tmp_glyph = glyph - gpos; tmp_glyph != glyph; tmp_glyph++) total_pixel_width += tmp_glyph->pixel_width; - dpyinfo->mouse_face_beg_col = (x - gpos); - dpyinfo->mouse_face_beg_row = (area == ON_MODE_LINE - ? (w->current_matrix)->nrows - 1 - : 0); + /* Pre calculation of re-rendering position */ + vpos = (x - gpos); + hpos = (area == ON_MODE_LINE + ? (w->current_matrix)->nrows - 1 + : 0); + + /* If the re-rendering position is included in the last + re-rendering area, we should do nothing. */ + if ( EQ (window, dpyinfo->mouse_face_window) + && dpyinfo->mouse_face_beg_col <= vpos + && vpos < dpyinfo->mouse_face_end_col + && dpyinfo->mouse_face_beg_row == hpos ) + return; + + if (clear_mouse_face (dpyinfo)) + cursor = No_Cursor; + + dpyinfo->mouse_face_beg_col = vpos; + dpyinfo->mouse_face_beg_row = hpos; dpyinfo->mouse_face_beg_x = original_x_pixel - (total_pixel_width + dx); dpyinfo->mouse_face_beg_y = 0; - dpyinfo->mouse_face_end_col = (x - gpos) + gseq_length; + dpyinfo->mouse_face_end_col = vpos + gseq_length; dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_beg_row; dpyinfo->mouse_face_end_x = 0; @@ -21552,8 +21612,9 @@ note_mode_line_or_margin_highlight (window, x, y, area) if (NILP (pointer)) pointer = Qhand; } + else if ((area == ON_MODE_LINE) || (area == ON_HEADER_LINE)) + clear_mouse_face (dpyinfo); } - define_frame_cursor1 (f, cursor, pointer); } @@ -21606,7 +21667,8 @@ note_mouse_highlight (f, x, y) /* If we were displaying active text in another window, clear that. Also clear if we move out of text area in same window. */ if (! EQ (window, dpyinfo->mouse_face_window) - || (part != ON_TEXT && !NILP (dpyinfo->mouse_face_window))) + || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE + && !NILP (dpyinfo->mouse_face_window))) clear_mouse_face (dpyinfo); /* Not on a window -> return. */ @@ -22723,6 +22785,8 @@ syms_of_xdisp () staticpro (&Qtrailing_whitespace); Qescape_glyph = intern ("escape-glyph"); staticpro (&Qescape_glyph); + Qno_break_space = intern ("no-break-space"); + staticpro (&Qno_break_space); Qimage = intern ("image"); staticpro (&Qimage); QCmap = intern (":map"); @@ -22829,7 +22893,11 @@ The face used for trailing whitespace is `trailing-whitespace'. */); Vshow_trailing_whitespace = Qnil; DEFVAR_LISP ("show-nonbreak-escape", &Vshow_nonbreak_escape, - doc: /* *Non-nil means display escape character before non-break space and hyphen. */); + doc: /* *Control highlighting of non-break space and soft hyphen. +t means highlight the character itself (for non-break space, +use face `non-break-space'. +nil means no highlighting. +other values mean display the escape glyph before the character. */); Vshow_nonbreak_escape = Qt; DEFVAR_LISP ("void-text-area-pointer", &Vvoid_text_area_pointer, diff --git a/src/xfaces.c b/src/xfaces.c index 953276aef83..f55ee7a901f 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -5039,8 +5039,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; @@ -5058,8 +5058,8 @@ If FRAME is omitted or nil, use the selected frame. */) Emacs. That frame is not an X frame. */ f = frame_or_selected_frame (frame, 2); - 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; @@ -6126,7 +6126,7 @@ DEFUN ("display-supports-face-attributes-p", 1, 2, 0, doc: /* Return non-nil if all the face attributes in ATTRIBUTES are supported. The optional argument DISPLAY can be a display name, a frame, or -nil (meaning the selected frame's display) +nil (meaning the selected frame's display). The definition of `supported' is somewhat heuristic, but basically means that a face containing all the attributes in ATTRIBUTES, when merged @@ -6139,7 +6139,7 @@ Point (2) implies that a `:weight black' attribute will be satisfied by any display that can display bold, and a `:foreground \"yellow\"' as long as it can display a yellowish color, but `:slant italic' will _not_ be satisfied by the tty display code's automatic substitution of a `dim' -face for italic. */) +face for italic. */) (attributes, display) Lisp_Object attributes, display; { diff --git a/src/xmenu.c b/src/xmenu.c index 6e46accbe8d..194168e6dfd 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -2030,7 +2030,7 @@ set_frame_menubar (f, first_time, deep_p) because it is not reentrant. */ specbind (Qdebug_on_next_call, Qnil); - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); + record_unwind_save_match_data (); record_unwind_protect (unuse_menu_items, Qnil); if (NILP (Voverriding_local_map_menu_flag)) { diff --git a/src/xterm.c b/src/xterm.c index c24802bab6b..71e1e2de1e8 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -4602,11 +4602,14 @@ x_create_toolkit_scroll_bar (f, bar) char *initial = ""; char *val = initial; XtVaGetValues (widget, XtNscrollVCursor, (XtPointer) &val, +#ifdef XtNarrowScrollbars + XtNarrowScrollbars, (XtPointer) &xaw3d_arrow_scroll, +#endif XtNpickTop, (XtPointer) &xaw3d_pick_top, NULL); - if (val == initial) + if (xaw3d_arrow_scroll || val == initial) { /* ARROW_SCROLL */ xaw3d_arrow_scroll = True; - /* Isn't that just a personal preference ? -sm */ + /* Isn't that just a personal preference ? --Stef */ XtVaSetValues (widget, XtNcursorName, "top_left_arrow", NULL); } } @@ -6789,12 +6792,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; @@ -6802,6 +6799,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, |
