diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2005-09-04 03:48:17 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2005-09-04 03:48:17 +0000 |
commit | fbf349734468d48b421c3d03074bb66dfcf3115b (patch) | |
tree | 0a7d1ee844b6c591a5a499d23e35931945106e5a /src | |
parent | f0caabd962b662cccbea472995d86af718cc8d0b (diff) | |
parent | 4b5fa40e1f1ba3cafde672863a0331311d1c2695 (diff) | |
download | emacs-fbf349734468d48b421c3d03074bb66dfcf3115b.tar.gz |
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Patches applied:
* lorentey@elte.hu--2004/emacs--cvs-trunk--0--base-0
tag of miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-474
* lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-1
Add CVS metadata files.
* lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-2
Update from CVS.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-393
Diffstat (limited to 'src')
291 files changed, 3006 insertions, 1751 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index 66b9e64ec7a..462b6a86c5f 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -129,20 +129,24 @@ define pitx end if ($it->what == IT_CHARACTER) if ($it->len == 1 && $it->c >= ' ' && it->c < 255) - printf "ch='%c'", $it->c + printf " ch='%c'", $it->c else - printf "ch=[%d,%d]", $it->c, $it->len + printf " ch=[%d,%d]", $it->c, $it->len end else if ($it->what == IT_IMAGE) - printf "IMAGE=%d", $it->image_id + printf " IMAGE=%d", $it->image_id else + printf " " output $it->what end end if ($it->method != GET_FROM_BUFFER) printf " next=" output $it->method + if ($it->method == GET_FROM_STRING) + printf "[%d]", $it->current.string_pos.charpos + end end printf "\n" if ($it->region_beg_charpos >= 0) diff --git a/src/ChangeLog b/src/ChangeLog index d70edd2fbf9..09a3ba2d825 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,577 @@ +2005-09-01 Stefan Monnier <monnier@iro.umontreal.ca> + + * dispnew.c (window_to_frame_hpos, update_window): + Avoid gcc warning about unused variable `f'. + +2005-08-31 Jason Rumney <jasonr@gnu.org> + + * w32menu.c (add_menu_item): If unicode_append_menu returns an + error, revert to using AppendMenu. + +2005-08-31 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * image.c (PIX_MASK_DRAW, PIX_MASK_RETAIN): Remove argument. + All uses changed. + [MAC_OS] (XPutPixel, XGetPixel): Add efficient versions for common + cases. + (x_create_x_image_and_pixmap) [MAC_OS]: Don't call x_destroy_x_image. + [MAC_OS] (find_image_fsspec) [!MAC_OSX]: Don't use FSRef. + Use posix_pathname_to_fsspec. + [MAC_OS] (xpm_load_image): Fill in background_transparent field + while we have mask. + + * macgui.h [!TARGET_API_MAC_CARBON] (GetPixDepth): New define. + + * macterm.h (PIX_MASK_DRAW, PIX_MASK_RETAIN): Move defines to image.c. + +2005-08-29 Stefan Monnier <monnier@iro.umontreal.ca> + + * syntax.c (update_syntax_table): Properly reproduce the special +1 + setting of e_property at the end of the buffer when bumping into the + INTERVALS_AT_ONCE limit. + +2005-08-27 Eli Zaretskii <eliz@gnu.org> + + * emacs.c (USAGE1): Fix the description of the -Q option. + +2005-08-26 Stefan Monnier <monnier@iro.umontreal.ca> + + * xdisp.c (pos_visible_p): Yet another int/Lisp_Object mixup (YAILOM). + +2005-08-26 Kim F. Storm <storm@cua.dk> + + * xdisp.c (resize_mini_window): Fix 2005-08-20 change. + Don't move PT to new window start. + +2005-08-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * keyboard.c (kbd_buffer_get_event) [MAC_OS]: Make events for + ICONIFY/DEICONIFY_EVENT. + + * macterm.c (mac_copy_area, mac_copy_area_with_mask): + Restore background color. + (mac_handle_visibility_change): New function. + (x_make_frame_invisible, x_iconify_frame) + (XTread_socket) [!USE_CARBON_EVENTS]: Use it. + [USE_CARBON_EVENTS] (mac_handle_window_event) + (install_window_handler): Handle visibility change events. + (x_make_frame_visible): Don't reposition window if it is iconified + or asked for visible before. Select and uncollapse window when it + is made visible. + (x_make_frame_invisible): Don't reset x_highlight_frame. + (x_iconify_frame): Likewise. Make invisible frame visible before + it is iconified. + (read_socket_inev): Move variable outside #if USE_CARBON_EVENTS. + (do_window_update): Don't change visibility of invisible frame. + +2005-08-22 Juri Linkov <juri@jurta.org> + + * term.c (turn_on_face): Check for TS_set_foreground and + TS_set_background depending on standout_mode. Simplify. + +2005-08-21 Kim F. Storm <storm@cua.dk> + + * fringe.c (update_window_fringes): Only put TOP and BOTTOM + bitmaps on fully visible rows. + + * fringe.c (update_window_fringes): Replace FORCE_P arg with + KEEP_CURRENT_P arg; if non-zero, don't update current row fringes, + and return 0. + + * xdisp.c (redisplay_window): Call update_window_fringes with + KEEP_CURRENT_P non-0 if we are going to refresh fringes later. + +2005-08-20 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (display_echo_area_1): Get display start pos from w->start. + (resize_mini_window): Set w->start, and PT, so as to display the tail + end of the buffer, if it doesn't all fit. + +2005-08-18 Kim F. Storm <storm@cua.dk> + + * xdisp.c (calc_pixel_width_or_height): Use actual display + resolution when available instead of Vdisplay_pixels_per_inch. + +2005-08-17 Kim F. Storm <storm@cua.dk> + + * xdisp.c (pos_visible_p): Adjust X value if window is hscrolled. + + * dispnew.c (buffer_posn_from_coords): Check that target row is + within matrix. + +2005-08-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_wm_set_icon_pixmap): Move GTK specific code to + xg_set_frame_icon and call it. + + * gtkutil.c (xg_set_frame_icon): New function. + + * gtkutil.h (xg_set_frame_icon): Declare it. + +2005-08-16 Kim F. Storm <storm@cua.dk> + + * dispnew.c (increment_row_positions): Skip non-enabled rows. + + * window.c (SAVED_WINDOW_VECTOR_SIZE): Remove dangerous define. + (Fcurrent_window_configuration): Use VECSIZE macro instead. + +2005-08-15 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (message3_nolog): Clear echo_message_buffer. + +2005-08-15 Kim F. Storm <storm@cua.dk> + + * lisp.h (QUIT) [!SYNC_INPUT]: Throw t to Vthrow_on_input. + + * process.c (deactivate_process, status_notify, read_process_output) + (update_status, status_convert, decode_status, allocate_pty) + (make_process, remove_process, list_processes_1) + (create_process_1, unwind_request_sigio, read_process_output) + (send_process, keyboard_bit_set): Declare static. + (Fdelete_process): Simplify. Pass process to status_notify, so we + don't try to read output from it. + (status_notify): New arg deleting_process--don't try to read + output from that process. + + * lisp.h (deactivate_process, status_notify, read_process_output): + Remove prototypes. + +2005-08-14 Richard M. Stallman <rms@gnu.org> + + * image.c (syms_of_image): Init Qxbm, Qpbm before calling + define_image_type. + +2005-08-13 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_get_pixbuf_from_pix_and_mask): New function. + (xg_get_image_for_pixmap): Move some code to + xg_get_pixbuf_from_pix_and_mask, and call it. + + * gtkutil.h (xg_get_pixbuf_from_pix_and_mask): Declare. + + * xterm.c (x_wm_set_icon_pixmap): Call xg_get_pixbuf_from_pix_and_mask + to get an GTK icon and set it with GTK functions to avoid having GTK + override an icon set with just X functions. + +2005-08-11 Richard M. Stallman <rms@gnu.org> + + * image.c (syms_of_image): Init image_types here, and call + define_image_type. + (init_image): Not here. + +2005-08-09 Richard M. Stallman <rms@gnu.org> + + * bytecode.c (BYTE_CODE_QUIT): Throw t to Vthrow_on_input. + + * lisp.h (QUIT): Throw t to Vthrow_on_input. + +2005-08-09 Thien-Thi Nguyen <ttn@gnu.org> + + * floatfns.c (Fexpt): Use floats for negative exponent. + +2005-08-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_modify_menubar_widgets): Remove semicolon that + should not be there, causing menu display errors with GTK 2.6.9. + +2005-08-07 Richard M. Stallman <rms@gnu.org> + + * floatfns.c (Fexpt): Undo previous change. + + * dispnew.c (Fframe_or_buffer_changed_p): Take an arg + so it can be used with various state vectors. + + * emacs.c (endif): Convert -script into -scriptload. + (standard_args): Add -scriptload. Allow -basic-display with one dash. + + * fns.c (syms_of_fns): Add `emacs' to features. + + * term.c (set_terminal_modes): If no TS_termcap_modes string, + output newlines to scroll the old screen contents off the screen. + +2005-08-06 Thien-Thi Nguyen <ttn@gnu.org> + + * floatfns.c (Fexpt): Use floats for negative exponent. + Reported by D Goel. + +2005-08-02 Richard M. Stallman <rms@gnu.org> + + * frame.c (Fframe_char_width): Doc fix. + +2005-07-30 Juanma Barranquero <lekktu@gmail.com> + + * xdisp.c (syms_of_xdisp) <redisplay-end-trigger-functions>: + Defvar it. + +2005-07-28 Juanma Barranquero <lekktu@gmail.com> + + * w32fns.c (my_set_window_pos, my_show_window): Don't declare. + (my_create_window, my_create_tip_window): Make static. + + * w32term.c (my_show_window, my_set_window_pos, my_set_focus) + (my_set_foreground_window, my_destroy_window): Make static. + +2005-07-26 Paul Eggert <eggert@cs.ucla.edu> + + Merge gnulib getopt implementation into Emacs. + + * s/cygwin.h (C_SWITCH_SYSTEM): Remove, since gettext.h is + now part of lib-src. + +2005-07-26 Stefan Monnier <monnier@iro.umontreal.ca> + + * eval.c (Fdefvar): Allow (defvar enable-multibyte-characters). + +2005-07-25 Jason Rumney <jasonr@gnu.org> + + * w32menu.c (w32_menu_display_help): Suppress tooltip when + navigating menus with the keyboard. + +2005-07-23 Richard M. Stallman <rms@gnu.org> + + * insdel.c (syms_of_insdel): staticpro combine_after_change_buffer. + + * bytecode.c (MAYBE_GC): Test gc_cons_threshold and + gc_relative_threshold, one by one. + + * keyboard.c (read_char): Test gc_cons_threshold. + (syms_of_keyboard): staticpro Qecho_area_clear_hook. + + * eval.c (Feval, Ffuncall): Test gc_cons_threshold and + gc_relative_threshold, one by one. + + * alloc.c (gc_cons_threshold): Not static. + (gc_cons_combined_threshold): Var deleted. + (gc_relative_threshold): New variable. + (Fgarbage_collect, init_alloc_once): Compute gc_relative_threshold + instead of gc_cons_combined_threshold. + + * lisp.h (gc_cons_threshold, gc_relative_threshold): Declare. + (gc_cons_combined_threshold): Declaration deleted. + +2005-07-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c: Don't include stdlib.h or string.h. + (Fdo_applescript, Fmac_file_name_to_posix) + (Fmac_file_name_to_posix): Doc fixes. + [TARGET_API_MAC_CARBON] (Fmac_get_preference) + (Fmac_code_convert_string): Likewise. + [MAC_OSX] (init_mac_osx_environment): Fall back on terminal mode + if the executable is not contained in a bundle. + + * macfns.c: Don't include stdlib.h or string.h. Include atimer.h. + (gray_width, gray_height): Remove defines. + (gray_bits, gray_bitmap_width, gray_bitmap_height) + (gray_bitmap_bits): Remove variables. + (lispy_function_keys): Remove extern. + (free_frame_menubar): Add extern. + (x_window_to_frame): Remove function. + (unwind_create_tip_frame): Add declaration. + (x_set_name_internal): New function. + (x_set_name, x_set_title): Use it. + (Fx_create_frame, Fx_display_grayscale_p, Fx_display_pixel_width) + (Fx_display_pixel_height, Fx_display_planes) + (Fx_display_color_cells, Fx_server_max_request_size) + (Fx_server_vendor, Fx_server_version, Fx_display_screens) + (Fx_display_mm_height, Fx_display_mm_width) + (Fx_display_backing_store, Fx_display_visual_class) + (Fx_display_save_under, Fx_synchronize, Fx_show_tip): Doc fixes. + + * macmenu.c (Fx_popup_menu, Fx_popup_dialog): Doc fixes. + + * macselect.c (Fx_own_selection_internal): Follow error conventions. + (Fx_get_selection_internal, Fx_selection_owner_p) + (Fx_selection_exists_p): Doc fixes. + (syms_of_macselect) <selection-converter-alist>: Likewise. + +2005-07-21 Juanma Barranquero <lekktu@gmail.com> + + * buffer.c (syms_of_buffer) <cursor-type>: Doc fix. + + * ccl.c (Fregister_ccl_program): Fix typos in docstring. + (Fccl_execute_on_string): Likewise; add usage info. + + * composite.c (Fcompose_region_internal) + (Fcompose_string_internal): + Improve argument/docstring consistency. + + * minibuf.c (Fminibuffer_prompt_end, Feval_minibuffer): + Fix typos in docstrings. + + * textprop.c (Fnext_char_property_change) + (Fprevious_char_property_change): Doc fixes. + + * window.c (Fset_window_margins, Fset_window_fringes): + Improve argument/docstring consistency. + + * xfaces.c (Finternal_lisp_face_p): Doc fix. + +2005-07-21 Andreas Schwab <schwab@suse.de> + + * eval.c (restore_stack_limits): Return a value. + +2005-07-20 Juanma Barranquero <lekktu@gmail.com> + + * eval.c (Fdefvar): Doc fix. + +2005-07-20 Kim F. Storm <storm@cua.dk> + + * fileio.c (Fdo_auto_save, do_auto_save_unwind): + Use make_save_value to unwind protect stream. + + * lread.c (Fload, load_unwind): + Use make_save_value to unwind protect stream. + +2005-07-19 Juanma Barranquero <lekktu@gmail.com> + + * eval.c (Fprog2, Fcalled_interactively_p), + (syms_of_eval) <debug-on-quit>: Doc fixes. + (syms_of_eval) <max-specpdl-size>: + (Finteractive_p): Fix typos in docstrings. + +2005-07-19 Kim F. Storm <storm@cua.dk> + + * w32fns.c (Vx_hand_shape): Variable removed. + (syms_of_w32fns): Intern and staticpro Qw32_charset_default. + +2005-07-19 Kenichi Handa <handa@m17n.org> + + * fns.c (Fstring_as_multibyte): Escape backslashes in the docstring. + +2005-07-18 Stefan Monnier <monnier@iro.umontreal.ca> + + * buffer.h (Fgenerate_new_buffer_name): Declare (for use in coding.c). + +2005-07-18 Kim F. Storm <storm@cua.dk> + + * frame.h (struct frame): New member already_hscrolled_p. + + * xdisp.c (redisplay_internal): Only try to hscroll each frame once + to avoid redisplay looping hscrolling back and forth ad infinitum. + +2005-07-18 Juri Linkov <juri@jurta.org> + + * buffer.c (scroll-up-aggressively, scroll-down-aggressively): + * keymap.c (Fminor_mode_key_binding): + * macterm.c (mac-emulate-three-button-mouse): + Delete duplicate duplicate words. + +2005-07-18 Ken Raeburn <raeburn@gnu.org> + + * minibuf.c (Ftest_completion): Fix odd syntax in test. + +2005-07-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (x_set_cursor_color): Use XSetBackground and XSetForeground. + + * macgui.h (struct _XGC): New struct. + (GC): Use it. + (GCForeground, GCBackground, GCFont): Use X11 mask values. + (XCreateGC, XParseGeometry): Move externs to macterm.h. + + * macterm.c (x_bitmap_icon, x_make_frame_visible): Remove declarations. + (XSetFont): Add declaration. + (mac_set_forecolor, mac_set_backcolor, mac_set_colors): + Remove functions. + (GC_FORE_COLOR, GC_BACK_COLOR, GC_FONT, MAC_WINDOW_NORMAL_GC): + New defines. + (XDrawLine, mac_draw_line_to_pixmap, XClearWindow) + (mac_draw_bitmap, XCreatePixmapFromBitmapData, XFillRectangle) + (mac_draw_rectangle, mac_draw_string_common, mac_scroll_area): + Use them. + (mac_erase_rectangle): New function. + (XClearArea, x_draw_fringe_bitmap, x_clear_glyph_string_rect) + (x_draw_stretch_glyph_string): Use it. + (XChangeGC, XCreateGC, XGetGCValues, XSetForeground) + (XSetBackground, XSetFont): Adjust for new GC implementation. + (x_draw_fringe_bitmap, x_draw_box_rect): Use GC to set colors. + (XTset_vertical_scroll_bar): Clear area under scroll bar. + + * macterm.h (struct mac_display_info): Change types of + scratch_cursor_gc black_relief.gc, and white_relief.gc to GC. + (XCreateGC, XParseGeometry): Move externs from macgui.h. + + * xfaces.c [MAC_OS] (XCreateGC): Remove extern. + +2005-07-16 Richard M. Stallman <rms@gnu.org> + + * buffer.c (Fmake_overlay): Doc fix. + +2005-07-16 Eli Zaretskii <eliz@gnu.org> + + * w32proc.c (syms_of_ntproc): staticpro Qhigh, Qlow, + Vw32_valid_locale_ids, and Vw32_valid_codepages. + +2005-07-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c [TARGET_API_MAC_CARBON] (Fmac_code_convert_string): + Use Fstring_as_unibyte instead of string_make_unibyte. + +2005-07-15 Richard M. Stallman <rms@gnu.org> + + * xdisp.c (select_frame_for_redisplay): Use find_symbol_value. + +2005-07-15 Kim F. Storm <storm@cua.dk> + + * xdisp.c: Fix redisplay loop in last change. + (IT_POS_VALID_AFTER_MOVE_P): New macro. + (move_it_vertically_backward, move_it_by_lines): Use it. + +2005-07-14 Jason Rumney <jasonr@gnu.org> + + * w32.c (init_environment): Default HOME directory to user's + appdata directory if possible. + +2005-07-14 Kim F. Storm <storm@cua.dk> + + * .gdbinit (pitx): Fix output format. Print string charpos. + + * lread.c (syms_of_lread): Initialize seen_list. + + * search.c (syms_of_search): Staticpro searchbuf.whitespace_regexp. + + * syntax.c (syms_of_syntax): Staticpro lisp objects in gl_state. + Staticpro re_match_object. + +2005-07-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macselect.c (get_scrap_target_type_list): Avoid NULL pointer + dereference. + + * macterm.c (mac_window_to_frame): Remove duplicate define. + +2005-07-14 Kenichi Handa <handa@m17n.org> + + * coding.c (code_convert_region_unwind): ARG is changed to a cons. + (code_convert_region): Adjust for the above change. + (set_conversion_work_buffer): If the work buffer is already in + use, generate a new buffer and return it. Otherwise return Qnil. + (run_pre_post_conversion_on_str): Adjust for the above change. + (run_pre_write_conversin_on_c_str): Likewise. + +2005-07-13 Kim F. Storm <storm@cua.dk> + + * xdisp.c (start_display): Don't reseat to next visible line start + if current start position is in a string or image. + (move_it_vertically_backward): Be sure to move out of strings and + images when moving it2 forward. + (move_it_by_lines): When moving forward, move to next buffer + position if we end up in a string or image. When moving backward, + count rows moved over when moving to start of current row in case + row starts in middle of a string or image. Also move further + backward if we end up in a string or image. + (try_cursor_movement): If overlay string spans multiple lines, + move backward to set cursor on start of an overlay string. + (cursor_row_p): Row is ok if cursor is at newline from string, but + string starts on this line (so we always position cursor at start + of string). + + * indent.c (Fvertical_motion): If start position is on an image, + don't move back if we move too far (that's almost certain to happen). + + * xdisp.c (cursor_row_fully_visible_p): Allow partially visible + row in minibuffer windows. + (try_window): Don't check margins in minibuffer windows. + +2005-07-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c: Don't include stdlib.h or composite.h. + (x_use_underline_position_properties, last_mouse_press_frame) + (x_noop_count, Qvendor_specific_keysyms): Remove unused variables. + (syms_of_macterm, mac_initialize): Don't initialize them. + (waiting_for_input, initial_argv, initial_argc) + (Vcommand_line_args, Vx_no_window_manager, errno, window_scroll) + (set_frame_menubar, path_from_vol_dir_name): Remove externs. + (extra_keyboard_modifiers): Fix type in extern. + (x_window_to_frame, x_window_to_scroll_bar): Remove declarations. + (x_scroll_bar_report_motion): Add argument types to declaration. + (mac_compute_glyph_string_overhangs): Add declaration. + (disable_mouse_highlight): Remove unused variable. + [USE_TOOLKIT_SCROLL_BARS] (construct_scroll_bar_click) + (x_scroll_bar_handle_press, x_scroll_bar_handle_release) + (x_scroll_bar_handle_drag): Remove argument `timestamp'. + All callers changed. + [USE_TOOLKIT_SCROLL_BARS] (construct_scroll_bar_click): Don't set + timestamp. + [USE_CARBON_EVENTS] (mac_handle_mouse_event): Likewise. + (x_scroll_bar_create, XTset_vertical_scroll_bar): Show scroll bar + only when its width is less than the height. + (XTredeem_scroll_bar): Sync with xterm.c. + (font_name_table, font_name_table_size, font_name_count): + Make static. + (drag_and_drop_file_list): Remove variable. Previous use is now + local to function. + (do_ae_open_documents): Move DRAG_N_DROP event construction part + from XTread_socket. + (XTread_socket): Consolidate setting of event timestamp. + Move DRAG_N_DROP event construction part to do_ae_open_documents. + Support extra_keyboard_modifiers. + + * xfaces.c (try_font_list) [MAC_OS]: Try font family name + beginning with that for ASCII. + +2005-07-13 Stefan Monnier <monnier@iro.umontreal.ca> + + * alloc.c (gc_cons_combined_threshold, Vgc_cons_percentage): New vars. + (Fgarbage_collect, init_alloc_once): Set gc_cons_combined_threshold. + (syms_of_alloc): Declare gc-cons-percentage. + + * eval.c (Feval, Ffuncall): + * keyboard.c (read_char): + * bytecode.c (MAYBE_GC): Use gc_cons_combined_threshold. + + * lisp.h (gc_cons_combined_threshold): Declare. + +2005-07-12 Kim F. Storm <storm@cua.dk> + + * coding.c (Qprocess_argument): + * coding.h (Qprocess_argument): Remove unused var. + + * xselect.c (intern): Remove dup. intern and staticpro for QTIMESTAMP. + +2005-07-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c [!TARGET_API_MAC_CARBON]: Include charset.h, coding.h, and + Endian.h. + [!MAC_OSX] (fchmod, fchown): New functions. + (mac_get_code_from_arg): Don't accept Lisp integer as argument. + Use SBYTES and EndianU32_BtoN. + (mac_get_object_from_code): Return 4 byte string even if argument + is 0. Use make_unibyte_string and EndianU32_NtoB. + (Fmac_get_file_creator, Fmac_get_file_type, Fmac_set_file_creator) + (Fmac_set_file_type): Fix documents and argument declarations. + Don't specify kFSCatInfoNodeFlags. Support Mac OS Classic. + +2005-07-11 Stefan Monnier <monnier@iro.umontreal.ca> + + * window.c (Frecenter): Yet another int/Lisp_Object mixup (YAILOM). + +2005-07-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfaces.c (x_update_menu_appearance): Use fontSet resource for + Lucid if X_I18N, font otherwise. + +2005-07-10 Steven Tamm <steventamm@mac.com> + + * mac.c (Fmac_get_file_type, Fmac_get_file_creator): Add. + (Fmac_set_file_type, Fmac_set_file_creator): Add. + (mac_get_object_from_code, mac_get_code_from_arg): Add. + +2005-07-10 Richard M. Stallman <rms@gnu.org> + + * lread.c (Qeval_buffer_list, Veval_buffer_list): New vars. + (syms_of_lread): Set up eval-buffer-list. + (Feval_buffer, Feval_region): Bind eval-buffer-list. + +2005-07-08 Richard M. Stallman <rms@gnu.org> + + * eval.c (Fdefvar): Allow defvaring a constant to itself quoted. + +2005-07-08 Kim F. Storm <storm@cua.dk> + + * keyboard.c (menu_bar_items): Don't GCPRO menu_bar_items_vector here. + (syms_of_keyboard): Initialize and staticpro menu_bar_items_vector. + 2005-07-07 Kim F. Storm <storm@cua.dk> * window.c (Frecenter): Fix last change (set iarg before use). @@ -11,7 +585,7 @@ * w32console.c (initialize_w32_display): Detect when the console dimensions are insane, and default to 80x25 instead. - (w32_use_full_screen_buffer): default to NIL. + (w32_use_full_screen_buffer): Default to NIL. 2005-07-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> @@ -19,8 +593,8 @@ VERTICAL_BORDER_FACE_ID for vertical border line. (mac_encode_char): Call check_ccl_update in advance. (mac_to_x_fontname, x_font_name_to_mac_font_name) - (init_font_name_table, mac_do_list_fonts, XLoadQueryFont): Don't - assume that font family length is less than 32. + (init_font_name_table, mac_do_list_fonts, XLoadQueryFont): + Don't assume that font family length is less than 32. (x_compute_min_glyph_bounds): Make static. (x_load_font): Never set fonts_changed_p to zero. @@ -71,8 +645,7 @@ 2005-07-01 Masatake YAMATO <jet@gyve.org> - * emacs.c (main): Passing ADD_NO_RANDOMIZE to - `personality'. + * emacs.c (main): Passing ADD_NO_RANDOMIZE to `personality'. 2005-06-30 Juri Linkov <juri@jurta.org> @@ -200,7 +773,7 @@ 2005-06-22 Miles Bader <miles@gnu.org> - * xfaces.c (Qvertical_border): Renamed from `Qvertical_divider'. + * xfaces.c (Qvertical_border): Rename from `Qvertical_divider'. (realize_basic_faces, syms_of_xfaces): Update references to it. * dispextern.h (enum face_id): Rename `VERTICAL_DIVIDER_FACE_ID' to `VERTICAL_BORDER_FACE_ID'. @@ -239,8 +812,8 @@ 2005-06-17 Richard M. Stallman <rms@gnu.org> - * xdisp.c (get_next_display_element): Reverse - test of Vshow_nonbreak_escape. + * xdisp.c (get_next_display_element): + Reverse test of Vshow_nonbreak_escape. * term.c (produce_special_glyphs): Use spec_glyph_lookup_face. (Ftty_no_underline): New function. diff --git a/src/Makefile.in b/src/Makefile.in index d118557db37..2e4b4f6ad76 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,6 +1,6 @@ # Makefile for GNU Emacs. -# Copyright (C) 1985, 87, 88, 93, 94, 95, 99, 2000, 01, 03, 2004 -# Free Software Foundation, Inc. +# Copyright (C) 1985, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. # This file is part of GNU Emacs. diff --git a/src/abbrev.c b/src/abbrev.c index 8cb87f2c884..84054892910 100644 --- a/src/abbrev.c +++ b/src/abbrev.c @@ -1,6 +1,6 @@ /* Primitives for word-abbrev mode. - Copyright (C) 1985, 1986, 1993, 1996, 1998, 2001,02,03,04 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1993, 1996, 1998, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/alloc.c b/src/alloc.c index dddfda828e6..3861d87c3d8 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -172,10 +172,16 @@ EMACS_INT misc_objects_consed; EMACS_INT intervals_consed; EMACS_INT strings_consed; -/* Number of bytes of consing since GC before another GC should be done. */ +/* Minimum number of bytes of consing since GC before next GC. */ EMACS_INT gc_cons_threshold; +/* Similar minimum, computed from Vgc_cons_percentage. */ + +EMACS_INT gc_relative_threshold; + +static Lisp_Object Vgc_cons_percentage; + /* Nonzero during GC. */ int gc_in_progress; @@ -4899,6 +4905,24 @@ returns nil, because real GC can't be done. */) if (gc_cons_threshold < 10000) gc_cons_threshold = 10000; + if (FLOATP (Vgc_cons_percentage)) + { /* Set gc_cons_combined_threshold. */ + EMACS_INT total = 0; + + total += total_conses * sizeof (struct Lisp_Cons); + total += total_symbols * sizeof (struct Lisp_Symbol); + total += total_markers * sizeof (union Lisp_Misc); + total += total_string_size; + total += total_vector_size * sizeof (Lisp_Object); + total += total_floats * sizeof (struct Lisp_Float); + total += total_intervals * sizeof (struct interval); + total += total_strings * sizeof (struct Lisp_String); + + gc_relative_threshold = total * XFLOAT_DATA (Vgc_cons_percentage); + } + else + gc_relative_threshold = 0; + if (garbage_collection_messages) { if (message_p || minibuf_level > 0) @@ -5988,6 +6012,8 @@ init_alloc_once () staticidx = 0; consing_since_gc = 0; gc_cons_threshold = 100000 * sizeof (Lisp_Object); + gc_relative_threshold = 0; + #ifdef VIRT_ADDR_VARIES malloc_sbrk_unused = 1<<22; /* A large number */ malloc_sbrk_used = 100000; /* as reasonable as any number */ @@ -6019,7 +6045,15 @@ allocated since the last garbage collection. All data types count. Garbage collection happens automatically only when `eval' is called. By binding this temporarily to a large number, you can effectively -prevent garbage collection during a part of the program. */); +prevent garbage collection during a part of the program. +See also `gc-cons-percentage'. */); + + DEFVAR_LISP ("gc-cons-percentage", &Vgc_cons_percentage, + doc: /* *Portion of the heap used for allocation. +Garbage collection can happen automatically once this portion of the heap +has been allocated since the last garbage collection. +If this portion is smaller than `gc-cons-threshold', this is ignored. */); + Vgc_cons_percentage = make_float (0.1); DEFVAR_INT ("pure-bytes-used", &pure_bytes_used, doc: /* Number of bytes of sharable Lisp data allocated so far. */); diff --git a/src/atimer.c b/src/atimer.c index 9ac6d529b99..f8ed1b265ec 100644 --- a/src/atimer.c +++ b/src/atimer.c @@ -1,5 +1,5 @@ /* Asynchronous timers. - Copyright (C) 2000, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/atimer.h b/src/atimer.h index 5057eb2be24..d5ad9c674d5 100644 --- a/src/atimer.h +++ b/src/atimer.h @@ -1,5 +1,5 @@ /* Asynchronous timers. - Copyright (C) 2000, 2003 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/blockinput.h b/src/blockinput.h index 36559715533..0eaebbe34df 100644 --- a/src/blockinput.h +++ b/src/blockinput.h @@ -1,5 +1,6 @@ /* blockinput.h - interface to blocking complicated interrupt-driven input. - Copyright (C) 1989, 1993, 2004 Free Software Foundation, Inc. + Copyright (C) 1989, 1993, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/buffer.c b/src/buffer.c index 43727ce7b9d..30626f11a24 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1,6 +1,7 @@ /* Buffer manipulation primitives for GNU Emacs. - Copyright (C) 1985, 86, 87, 88, 89, 93, 94, 95, 97, 98, 99, - 2000, 01, 02, 03, 04, 2005 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, + 1995, 1997, 1998, 1999, 2000, 2001, 2002, + 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -3557,10 +3558,12 @@ DEFUN ("make-overlay", Fmake_overlay, Smake_overlay, 2, 5, 0, doc: /* Create a new overlay with range BEG to END in BUFFER. If omitted, BUFFER defaults to the current buffer. BEG and END may be integers or markers. -The fourth arg FRONT-ADVANCE, if non-nil, makes the -front delimiter advance when text is inserted there. -The fifth arg REAR-ADVANCE, if non-nil, makes the -rear delimiter advance when text is inserted there. */) +The fourth arg FRONT-ADVANCE, if non-nil, makes the marker +for the front of the overlay advance when text is inserted there +(which means the text *is not* included in the overlay). +The fifth arg REAR-ADVANCE, if non-nil, makes the marker +for the rear of the overlay advance when text is inserted there +(which means the text *is* included in the overlay). */) (beg, end, buffer, front_advance, rear_advance) Lisp_Object beg, end, buffer; Lisp_Object front_advance, rear_advance; @@ -5727,7 +5730,7 @@ that fraction of the window's height from the bottom of the window. When the value is 0.0, point goes at the bottom line, which in the simple case that you moved off with C-f means scrolling just one line. 1.0 means point goes at the top, so that in that simple case, the window -window scrolls by a full window height. Meaningful values are +scrolls by a full window height. Meaningful values are between 0.0 and 1.0, inclusive. */); DEFVAR_PER_BUFFER ("scroll-down-aggressively", @@ -5740,7 +5743,7 @@ that fraction of the window's height from the top of the window. When the value is 0.0, point goes at the top line, which in the simple case that you moved off with C-b means scrolling just one line. 1.0 means point goes at the bottom, so that in that simple case, the window -window scrolls by a full window height. Meaningful values are +scrolls by a full window height. Meaningful values are between 0.0 and 1.0, inclusive. */); /*DEFVAR_LISP ("debug-check-symbol", &Vcheck_symbol, @@ -5928,15 +5931,15 @@ is a member of the list. */); doc: /* Cursor to use when this buffer is in the selected window. Values are interpreted as follows: - t use the cursor specified for the frame - nil don't display a cursor - box display a filled box cursor - hollow display a hollow box cursor - bar display a vertical bar cursor with default width - (bar . WIDTH) display a vertical bar cursor with width WIDTH - hbar display a horizontal bar cursor with default height + t use the cursor specified for the frame + nil don't display a cursor + box display a filled box cursor + hollow display a hollow box cursor + bar display a vertical bar cursor with default width + (bar . WIDTH) display a vertical bar cursor with width WIDTH + hbar display a horizontal bar cursor with default height (hbar . HEIGHT) display a horizontal bar cursor with height HEIGHT - ANYTHING ELSE display a hollow box cursor. + ANYTHING ELSE display a hollow box cursor When the buffer is displayed in a nonselected window, this variable has no effect; the cursor appears as a hollow box. */); diff --git a/src/buffer.h b/src/buffer.h index 8d170c87567..2387af65a47 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -1,6 +1,6 @@ /* Header file for the buffer manipulation primitives. - Copyright (C) 1985,86,93,94,95,97,98,99,2000,01,03,04 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -855,6 +855,7 @@ EXFUN (Fget_file_buffer, 1); EXFUN (Fnext_overlay_change, 1); EXFUN (Fdelete_overlay, 1); EXFUN (Fbuffer_local_value, 2); +EXFUN (Fgenerate_new_buffer_name, 2); /* Functions to call before and after each text change. */ extern Lisp_Object Vbefore_change_functions; diff --git a/src/bytecode.c b/src/bytecode.c index 73b8f60a1a8..e5a3e7b2a7c 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -1,6 +1,6 @@ /* Execution of byte code produced by bytecomp.el. - Copyright (C) 1985, 1986, 1987, 1988, 1993, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1993, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -355,13 +355,14 @@ unmark_byte_stack () /* Garbage collect if we have consed enough since the last time. We do this at every branch, to avoid loops that never GC. */ -#define MAYBE_GC() \ - if (consing_since_gc > gc_cons_threshold) \ - { \ - BEFORE_POTENTIAL_GC (); \ - Fgarbage_collect (); \ - AFTER_POTENTIAL_GC (); \ - } \ +#define MAYBE_GC() \ + if (consing_since_gc > gc_cons_threshold \ + && consing_since_gc > gc_relative_threshold) \ + { \ + BEFORE_POTENTIAL_GC (); \ + Fgarbage_collect (); \ + AFTER_POTENTIAL_GC (); \ + } \ else /* Check for jumping out of range. */ @@ -388,7 +389,7 @@ unmark_byte_stack () Vquit_flag = Qnil; \ BEFORE_POTENTIAL_GC (); \ if (EQ (Vthrow_on_input, flag)) \ - Fthrow (Vthrow_on_input, Qnil); \ + Fthrow (Vthrow_on_input, Qt); \ Fsignal (Qquit, Qnil); \ AFTER_POTENTIAL_GC (); \ } \ diff --git a/src/callint.c b/src/callint.c index 10db39ddce4..5979e495ac3 100644 --- a/src/callint.c +++ b/src/callint.c @@ -1,6 +1,6 @@ /* Call a Lisp function interactively. - Copyright (C) 1985, 86, 93, 94, 95, 1997, 2000, 02, 03, 2004 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1993, 1994, 1995, 1997, 2000, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/callproc.c b/src/callproc.c index b78fae1d075..47930819c07 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -1,6 +1,6 @@ /* Synchronous subprocess invocation for GNU Emacs. Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, - 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/casefiddle.c b/src/casefiddle.c index b063ef7510a..454d184b99b 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c @@ -1,6 +1,6 @@ /* GNU Emacs case conversion functions. - Copyright (C) 1985,94,97,98,99, 2001, 2002, 2004, 2005 - Free Software Foundation, Inc. + Copyright (C) 1985, 1994, 1997, 1998, 1999, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/casetab.c b/src/casetab.c index 448a236f565..874bb7599f0 100644 --- a/src/casetab.c +++ b/src/casetab.c @@ -1,5 +1,6 @@ /* GNU Emacs routines to deal with case tables. - Copyright (C) 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/ccl.c b/src/ccl.c index b6381f7a0cb..562215218bc 100644 --- a/src/ccl.c +++ b/src/ccl.c @@ -1,7 +1,7 @@ /* CCL (Code Conversion Language) interpreter. Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN. - Copyright (C) 2001, 2002 Free Software Foundation, Inc. Licensed to the Free Software Foundation. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -2209,7 +2209,7 @@ DEFUN ("ccl-execute-on-string", Fccl_execute_on_string, Sccl_execute_on_string, 3, 5, 0, doc: /* Execute CCL-PROGRAM with initial STATUS on STRING. -CCL-PROGRAM is a symbol registered by register-ccl-program, +CCL-PROGRAM is a symbol registered by `register-ccl-program', or a compiled code generated by `ccl-compile' (for backward compatibility, in this case, the execution is slower). @@ -2230,7 +2230,8 @@ It returns the contents of write buffer as a string, If the optional 5th arg UNIBYTE-P is non-nil, the returned string is a unibyte string. By default it is a multibyte string. -See the documentation of `define-ccl-program' for the detail of CCL program. */) +See the documentation of `define-ccl-program' for the detail of CCL program. +usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBYTE-P) */) (ccl_prog, status, str, contin, unibyte_p) Lisp_Object ccl_prog, status, str, contin, unibyte_p; { @@ -2297,8 +2298,8 @@ See the documentation of `define-ccl-program' for the detail of CCL program. */ DEFUN ("register-ccl-program", Fregister_ccl_program, Sregister_ccl_program, 2, 2, 0, - doc: /* Register CCL program CCL_PROG as NAME in `ccl-program-table'. -CCL_PROG should be a compiled CCL program (vector), or nil. + doc: /* Register CCL program CCL-PROG as NAME in `ccl-program-table'. +CCL-PROG should be a compiled CCL program (vector), or nil. If it is nil, just reserve NAME as a CCL program name. Return index number of the registered CCL program. */) (name, ccl_prog) diff --git a/src/charset.c b/src/charset.c index e7b6897ea98..3676c9b8a71 100644 --- a/src/charset.c +++ b/src/charset.c @@ -1,7 +1,7 @@ /* Basic multilingual character support. Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN. Licensed to the Free Software Foundation. - Copyright (C) 2001, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/charset.h b/src/charset.h index 43791baf0c5..a5cdca21bbb 100644 --- a/src/charset.h +++ b/src/charset.h @@ -1,7 +1,7 @@ /* Header for multibyte character handler. Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN. Licensed to the Free Software Foundation. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -1,5 +1,6 @@ /* Cursor motion subroutines for GNU Emacs. - Copyright (C) 1985, 1995 Free Software Foundation, Inc. + Copyright (C) 1985, 1995, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. based primarily on public domain code written by Chris Torek This file is part of GNU Emacs. @@ -1,5 +1,6 @@ /* Cursor motion calculation definitions for GNU Emacs - Copyright (C) 1985, 1989 Free Software Foundation, Inc. + Copyright (C) 1985, 1989, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/cmds.c b/src/cmds.c index 7940f3cf216..cc5bd90cca7 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -1,6 +1,6 @@ /* Simple built-in editing commands. - Copyright (C) 1985, 93, 94, 95, 96, 97, 1998, 2001, 02, 03 - Free Software Foundation, Inc. + Copyright (C) 1985, 1993, 1994, 1995, 1996, 1997, 1998, 2001, 2002, + 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/coding.c b/src/coding.c index 808f1e7d9c2..9d2d04af6cb 100644 --- a/src/coding.c +++ b/src/coding.c @@ -1,7 +1,7 @@ /* Coding system handler (conversion, detection, and etc). Copyright (C) 1995,97,1998,2002,2003 Electrotechnical Laboratory, JAPAN. Licensed to the Free Software Foundation. - Copyright (C) 2001,2002,2003 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -365,7 +365,7 @@ Lisp_Object Qsafe_chars; Lisp_Object Qvalid_codes; extern Lisp_Object Qinsert_file_contents, Qwrite_region; -Lisp_Object Qcall_process, Qcall_process_region, Qprocess_argument; +Lisp_Object Qcall_process, Qcall_process_region; Lisp_Object Qstart_process, Qopen_network_stream; Lisp_Object Qtarget_idx; @@ -5349,12 +5349,17 @@ static int shrink_conversion_region_threshhold = 1024; } \ } while (0) +/* ARG is (CODING . BUFFER) where CODING is what to be set in + Vlast_coding_system_used and BUFFER if non-nil is a buffer to + kill. */ static Lisp_Object code_convert_region_unwind (arg) Lisp_Object arg; { inhibit_pre_post_conversion = 0; - Vlast_coding_system_used = arg; + Vlast_coding_system_used = XCAR (arg); + if (! NILP (XCDR (arg))) + Fkill_buffer (XCDR (arg)); return Qnil; } @@ -5607,7 +5612,7 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace) Lisp_Object new; record_unwind_protect (code_convert_region_unwind, - Vlast_coding_system_used); + Fcons (Vlast_coding_system_used, Qnil)); /* We should not call any more pre-write/post-read-conversion functions while this pre-write-conversion is running. */ inhibit_pre_post_conversion = 1; @@ -5975,7 +5980,7 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace) TEMP_SET_PT_BOTH (from, from_byte); prev_Z = Z; record_unwind_protect (code_convert_region_unwind, - Vlast_coding_system_used); + Fcons (Vlast_coding_system_used, Qnil)); saved_coding_system = Vlast_coding_system_used; Vlast_coding_system_used = coding->symbol; /* We should not call any more pre-write/post-read-conversion @@ -6021,17 +6026,31 @@ static Lisp_Object Vcode_conversion_workbuf_name; /* Set the current buffer to the working buffer prepared for code-conversion. MULTIBYTE specifies the multibyteness of the - buffer. */ + buffer. Return the buffer we set if it must be killed after use. + Otherwise return Qnil. */ -static struct buffer * +static Lisp_Object set_conversion_work_buffer (multibyte) int multibyte; { - Lisp_Object buffer; + Lisp_Object buffer, buffer_to_kill; struct buffer *buf; buffer = Fget_buffer_create (Vcode_conversion_workbuf_name); buf = XBUFFER (buffer); + if (buf == current_buffer) + { + /* As we are already in the work buffer, we must generate a new + buffer for the work. */ + Lisp_Object name; + + name = Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name, Qnil); + buffer = buffer_to_kill = Fget_buffer_create (name); + buf = XBUFFER (buffer); + } + else + buffer_to_kill = Qnil; + delete_all_overlays (buf); buf->directory = current_buffer->directory; buf->read_only = Qnil; @@ -6044,7 +6063,7 @@ set_conversion_work_buffer (multibyte) Fwiden (); del_range_2 (BEG, BEG_BYTE, Z, Z_BYTE, 0); buf->enable_multibyte_characters = multibyte ? Qt : Qnil; - return buf; + return buffer_to_kill; } Lisp_Object @@ -6057,10 +6076,9 @@ run_pre_post_conversion_on_str (str, coding, encodep) struct gcpro gcpro1, gcpro2; int multibyte = STRING_MULTIBYTE (str); Lisp_Object old_deactivate_mark; + Lisp_Object buffer_to_kill; record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); - record_unwind_protect (code_convert_region_unwind, - Vlast_coding_system_used); /* It is not crucial to specbind this. */ old_deactivate_mark = Vdeactivate_mark; GCPRO2 (str, old_deactivate_mark); @@ -6068,7 +6086,9 @@ run_pre_post_conversion_on_str (str, coding, encodep) /* We must insert the contents of STR as is without unibyte<->multibyte conversion. For that, we adjust the multibyteness of the working buffer to that of STR. */ - set_conversion_work_buffer (multibyte); + buffer_to_kill = set_conversion_work_buffer (multibyte); + record_unwind_protect (code_convert_region_unwind, + Fcons (Vlast_coding_system_used, buffer_to_kill)); insert_from_string (str, 0, 0, SCHARS (str), SBYTES (str), 0); @@ -6111,6 +6131,7 @@ run_pre_write_conversin_on_c_str (str, size, nchars, nbytes, coding) struct buffer *cur = current_buffer; Lisp_Object old_deactivate_mark, old_last_coding_system_used; Lisp_Object args[3]; + Lisp_Object buffer_to_kill; /* It is not crucial to specbind this. */ old_deactivate_mark = Vdeactivate_mark; @@ -6120,7 +6141,7 @@ run_pre_write_conversin_on_c_str (str, size, nchars, nbytes, coding) /* We must insert the contents of STR as is without unibyte<->multibyte conversion. For that, we adjust the multibyteness of the working buffer to that of STR. */ - set_conversion_work_buffer (coding->src_multibyte); + buffer_to_kill = set_conversion_work_buffer (coding->src_multibyte); insert_1_both (*str, nchars, nbytes, 0, 0, 0); UNGCPRO; inhibit_pre_post_conversion = 1; @@ -6144,6 +6165,8 @@ run_pre_write_conversin_on_c_str (str, size, nchars, nbytes, coding) coding->src_multibyte = ! NILP (current_buffer->enable_multibyte_characters); set_buffer_internal (cur); + if (! NILP (buffer_to_kill)) + Fkill_buffer (buffer_to_kill); } diff --git a/src/coding.h b/src/coding.h index 4081b7f2028..158ebbf289f 100644 --- a/src/coding.h +++ b/src/coding.h @@ -1,7 +1,7 @@ /* Header for coding system handler. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN. Licensed to the Free Software Foundation. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -628,7 +628,7 @@ extern int code_convert_region P_ ((int, int, int, int, struct coding_system *, extern Lisp_Object run_pre_post_conversion_on_str P_ ((Lisp_Object, struct coding_system *, int)); -extern void run_pre_write_conversin_on_c_str P_ ((unsigned char **, int *, +extern void run_pre_write_conversin_on_c_str P_ ((unsigned char **, int *, int, int, struct coding_system *)); @@ -666,7 +666,7 @@ extern Lisp_Object eol_mnemonic_undecided; #ifdef emacs extern Lisp_Object Qfile_coding_system; -extern Lisp_Object Qcall_process, Qcall_process_region, Qprocess_argument; +extern Lisp_Object Qcall_process, Qcall_process_region; extern Lisp_Object Qstart_process, Qopen_network_stream; extern Lisp_Object Qwrite_region; diff --git a/src/commands.h b/src/commands.h index 9486467e2fe..7ad593577ad 100644 --- a/src/commands.h +++ b/src/commands.h @@ -1,5 +1,6 @@ /* Definitions needed by most editing commands. - Copyright (C) 1985, 1994 Free Software Foundation, Inc. + Copyright (C) 1985, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/composite.c b/src/composite.c index dffac5c01f9..daa6dceb3c6 100644 --- a/src/composite.c +++ b/src/composite.c @@ -1,7 +1,7 @@ /* Composite sequence support. Copyright (C) 1999 Electrotechnical Laboratory, JAPAN. Licensed to the Free Software Foundation. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -716,8 +716,8 @@ DEFUN ("compose-region-internal", Fcompose_region_internal, Compose text in the region between START and END. Optional 3rd and 4th arguments are COMPONENTS and MODIFICATION-FUNC for the composition. See `compose-region' for more detail. */) - (start, end, components, mod_func) - Lisp_Object start, end, components, mod_func; + (start, end, components, modification_func) + Lisp_Object start, end, components, modification_func; { validate_region (&start, &end); if (!NILP (components) @@ -726,7 +726,7 @@ for the composition. See `compose-region' for more detail. */) && !STRINGP (components)) CHECK_VECTOR (components); - compose_text (XINT (start), XINT (end), components, mod_func, Qnil); + compose_text (XINT (start), XINT (end), components, modification_func, Qnil); return Qnil; } @@ -737,8 +737,8 @@ DEFUN ("compose-string-internal", Fcompose_string_internal, Compose text between indices START and END of STRING. Optional 4th and 5th arguments are COMPONENTS and MODIFICATION-FUNC for the composition. See `compose-string' for more detail. */) - (string, start, end, components, mod_func) - Lisp_Object string, start, end, components, mod_func; + (string, start, end, components, modification_func) + Lisp_Object string, start, end, components, modification_func; { CHECK_STRING (string); CHECK_NUMBER (start); @@ -749,7 +749,7 @@ for the composition. See `compose-string' for more detail. */) || XINT (end) > SCHARS (string)) args_out_of_range (start, end); - compose_text (XINT (start), XINT (end), components, mod_func, string); + compose_text (XINT (start), XINT (end), components, modification_func, string); return string; } diff --git a/src/composite.h b/src/composite.h index 9dfe597631e..26cf13d27d4 100644 --- a/src/composite.h +++ b/src/composite.h @@ -1,7 +1,7 @@ /* Header for composite sequence handler. Copyright (C) 1999 Electrotechnical Laboratory, JAPAN. Licensed to the Free Software Foundation. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/config.in b/src/config.in index f4ab9fbb3dd..dc2c07667fb 100644 --- a/src/config.in +++ b/src/config.in @@ -191,6 +191,12 @@ Boston, MA 02110-1301, USA. */ /* Define to 1 if you have the `getloadavg' function. */ #undef HAVE_GETLOADAVG +/* Define to 1 if you have the <getopt.h> header file. */ +#undef HAVE_GETOPT_H + +/* Define to 1 if you have the `getopt_long_only' function. */ +#undef HAVE_GETOPT_LONG_ONLY + /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE @@ -785,9 +791,9 @@ Boston, MA 02110-1301, 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. */ @@ -846,6 +852,10 @@ Boston, MA 02110-1301, USA. */ /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES +/* Define to rpl_ if the getopt replacement functions and variables should be + used. */ +#undef __GETOPT_PREFIX + /* Define like PROTOTYPES; this can be used by system headers. */ #undef __PROTOTYPES diff --git a/src/cxux-crt0.s b/src/cxux-crt0.s index 615837eaeb4..71076eb8b5f 100644 --- a/src/cxux-crt0.s +++ b/src/cxux-crt0.s @@ -1,6 +1,6 @@ /* * External symbol setup file for GNU Emacs on CX/UX - * Copyright (C) 1990 Free Software Foundation, Inc. + * Copyright (C) 1990, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. * * This file is part of GNU Emacs. * diff --git a/src/data.c b/src/data.c index 09cb6c8b40a..b187a3e748a 100644 --- a/src/data.c +++ b/src/data.c @@ -1,6 +1,6 @@ /* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter. - Copyright (C) 1985,86,88,93,94,95,97,98,99, 2000, 2001, 03, 2004 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, 2000, + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/dired.c b/src/dired.c index 55f96d28888..927276e15c0 100644 --- a/src/dired.c +++ b/src/dired.c @@ -1,6 +1,6 @@ /* Lisp functions for making directory listings. - Copyright (C) 1985, 1986, 1993, 1994, 1999, 2000, 2001, 2004, 2005 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1993, 1994, 1999, 2000, 2001, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -131,7 +131,7 @@ Lisp_Object directory_files_internal_unwind (dh) Lisp_Object dh; { - DIR *d = (DIR *) ((XINT (XCAR (dh)) << 16) + XINT (XCDR (dh))); + DIR *d = (DIR *) XSAVE_VALUE (dh)->pointer; closedir (d); return Qnil; } @@ -155,7 +155,6 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format) int count = SPECPDL_INDEX (); struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; DIRENTRY *dp; - int retry_p; /* Because of file name handlers, these functions might call Ffuncall, and cause a GC. */ @@ -189,12 +188,6 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format) /* Now *bufp is the compiled form of MATCH; don't call anything which might compile a new regexp until we're done with the loop! */ - /* Do this opendir after anything which might signal an error; if - an error is signaled while the directory stream is open, we - have to make sure it gets closed, and setting up an - unwind_protect to do so would be a pain. */ - retry: - d = opendir (SDATA (dirfilename)); if (d == NULL) report_file_error ("Opening directory", Fcons (directory, Qnil)); @@ -203,8 +196,7 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format) file-attributes on filenames, both of which can throw, so we must do a proper unwind-protect. */ record_unwind_protect (directory_files_internal_unwind, - Fcons (make_number (((unsigned long) d) >> 16), - make_number (((unsigned long) d) & 0xffff))); + make_save_value (d, 0)); directory_nbytes = SBYTES (directory); re_match_object = Qt; @@ -222,10 +214,15 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format) errno = 0; dp = readdir (d); + if (dp == NULL && (0 #ifdef EAGAIN - if (dp == NULL && errno == EAGAIN) - continue; + || errno == EAGAIN +#endif +#ifdef EINTR + || errno == EINTR #endif + )) + { QUIT; continue; } if (dp == NULL) break; @@ -316,22 +313,11 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format) } } - retry_p = 0; -#ifdef EINTR - retry_p |= errno == EINTR; -#endif - closedir (d); /* Discard the unwind protect. */ specpdl_ptr = specpdl + count; - if (retry_p) - { - list = Qnil; - goto retry; - } - if (NILP (nosort)) list = Fsort (Fnreverse (list), attrs ? Qfile_attributes_lessp : Qstring_lessp); @@ -519,8 +505,7 @@ file_name_completion (file, dirname, all_flag, ver_flag) report_file_error ("Opening directory", Fcons (dirname, Qnil)); record_unwind_protect (directory_files_internal_unwind, - Fcons (make_number (((unsigned long) d) >> 16), - make_number (((unsigned long) d) & 0xffff))); + make_save_value (d, 0)); /* Loop reading blocks */ /* (att3b compiler bug requires do a null comparison this way) */ @@ -532,8 +517,19 @@ file_name_completion (file, dirname, all_flag, ver_flag) #ifdef VMS dp = (*readfunc) (d); #else + errno = 0; dp = readdir (d); + if (dp == NULL && (0 +# ifdef EAGAIN + || errno == EAGAIN +# endif +# ifdef EINTR + || errno == EINTR +# endif + )) + { QUIT; continue; } #endif + if (!dp) break; len = NAMLEN (dp); diff --git a/src/dispextern.h b/src/dispextern.h index ac9c007bc4d..1c802e9e332 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1,6 +1,6 @@ /* Interface definitions for display code. - Copyright (C) 1985,93,94,97,98,99, 2000,01,02,03, 2004, 2005 - Free Software Foundation, Inc. + Copyright (C) 1985, 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, + 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/dispnew.c b/src/dispnew.c index 4924ce2217b..2cb661c6ba7 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -1,6 +1,7 @@ /* Updating of data structures for redisplay. - Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, + 1997, 1998, 1999, 2000, 2001, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -1171,6 +1172,9 @@ increment_row_positions (row, delta, delta_bytes) MATRIX_ROW_END_CHARPOS (row) += delta; MATRIX_ROW_END_BYTEPOS (row) += delta_bytes; + if (!row->enabled_p) + return; + /* Increment positions in glyphs. */ for (area = 0; area < LAST_AREA; ++area) for (i = 0; i < row->used[area]; ++i) @@ -3309,9 +3313,7 @@ window_to_frame_hpos (w, hpos) struct window *w; int hpos; { - struct frame *f = XFRAME (w->frame); - - xassert (!FRAME_WINDOW_P (f)); + xassert (!FRAME_WINDOW_P (XFRAME (w->frame))); hpos += WINDOW_LEFT_EDGE_COL (w); return hpos; } @@ -4099,10 +4101,8 @@ update_window (w, force_p) extern Lisp_Object do_mouse_tracking; struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); #if GLYPH_DEBUG - struct frame *f = XFRAME (WINDOW_FRAME (w)); - /* Check that W's frame doesn't have glyph matrices. */ - xassert (FRAME_WINDOW_P (f)); + xassert (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w)))); #endif /* Check pending input the first time so that we can quickly return. */ @@ -5806,8 +5806,9 @@ buffer_posn_from_coords (w, x, y, pos, object, dx, dy, width, height) } #endif - row = MATRIX_ROW (w->current_matrix, it.vpos); - if (row->enabled_p) + if (it.vpos < w->current_matrix->nrows + && (row = MATRIX_ROW (w->current_matrix, it.vpos), + row->enabled_p)) { if (it.hpos < row->used[TEXT_AREA]) { @@ -6488,68 +6489,106 @@ usage: (sit-for SECONDS &optional NODISP OLD-NODISP) */) /* A vector of size >= 2 * NFRAMES + 3 * NBUFFERS + 1, containing the session's frames, frame names, buffers, buffer-read-only flags, and - buffer-modified-flags, and a trailing sentinel (so we don't need to - add length checks). */ + buffer-modified-flags. */ static Lisp_Object frame_and_buffer_state; DEFUN ("frame-or-buffer-changed-p", Fframe_or_buffer_changed_p, - Sframe_or_buffer_changed_p, 0, 0, 0, + Sframe_or_buffer_changed_p, 0, 1, 0, doc: /* Return non-nil if the frame and buffer state appears to have changed. -The state variable is an internal vector containing all frames and buffers, +VARIABLE is a variable name whose value is either nil or a state vector +that will be updated to contain all frames and buffers, aside from buffers whose names start with space, -along with the buffers' read-only and modified flags, which allows a fast -check to see whether the menu bars might need to be recomputed. +along with the buffers' read-only and modified flags. This allows a fast +check to see whether buffer menus might need to be recomputed. If this function returns non-nil, it updates the internal vector to reflect -the current state. */) - () +the current state. + +If VARIABLE is nil, an internal variable is used. Users should not +pass nil for VARIABLE. */) + (variable) + Lisp_Object variable; { - Lisp_Object tail, frame, buf; - Lisp_Object *vecp; + Lisp_Object state, tail, frame, buf; + Lisp_Object *vecp, *end; int n; - vecp = XVECTOR (frame_and_buffer_state)->contents; + if (! NILP (variable)) + { + CHECK_SYMBOL (variable); + state = Fsymbol_value (variable); + if (! VECTORP (state)) + goto changed; + } + else + state = frame_and_buffer_state; + + vecp = XVECTOR (state)->contents; + end = vecp + XVECTOR (state)->size; + FOR_EACH_FRAME (tail, frame) { + if (vecp == end) + goto changed; if (!EQ (*vecp++, frame)) goto changed; + if (vecp == end) + goto changed; if (!EQ (*vecp++, XFRAME (frame)->name)) goto changed; } - /* Check that the buffer info matches. - No need to test for the end of the vector - because the last element of the vector is lambda - and that will always cause a mismatch. */ + /* Check that the buffer info matches. */ for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) { buf = XCDR (XCAR (tail)); /* Ignore buffers that aren't included in buffer lists. */ if (SREF (XBUFFER (buf)->name, 0) == ' ') continue; + if (vecp == end) + goto changed; if (!EQ (*vecp++, buf)) goto changed; + if (vecp == end) + goto changed; if (!EQ (*vecp++, XBUFFER (buf)->read_only)) goto changed; + if (vecp == end) + goto changed; if (!EQ (*vecp++, Fbuffer_modified_p (buf))) goto changed; } + if (vecp == end) + goto changed; /* Detect deletion of a buffer at the end of the list. */ if (EQ (*vecp, Qlambda)) return Qnil; + + /* Come here if we decide the data has changed. */ changed: - /* Start with 1 so there is room for at least one lambda at the end. */ + /* Count the size we will need. + Start with 1 so there is room for at least one lambda at the end. */ n = 1; FOR_EACH_FRAME (tail, frame) n += 2; for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) n += 3; - /* Reallocate the vector if it's grown, or if it's shrunk a lot. */ - if (n > XVECTOR (frame_and_buffer_state)->size - || n + 20 < XVECTOR (frame_and_buffer_state)->size / 2) + /* Reallocate the vector if data has grown to need it, + or if it has shrunk a lot. */ + if (! VECTORP (state) + || n > XVECTOR (state)->size + || n + 20 < XVECTOR (state)->size / 2) /* Add 20 extra so we grow it less often. */ - frame_and_buffer_state = Fmake_vector (make_number (n + 20), Qlambda); - vecp = XVECTOR (frame_and_buffer_state)->contents; + { + state = Fmake_vector (make_number (n + 20), Qlambda); + if (! NILP (variable)) + Fset (variable, state); + else + frame_and_buffer_state = state; + } + + /* Record the new data in the (possibly reallocated) vector. */ + vecp = XVECTOR (state)->contents; FOR_EACH_FRAME (tail, frame) { *vecp++ = frame; @@ -6567,12 +6606,12 @@ the current state. */) } /* Fill up the vector with lambdas (always at least one). */ *vecp++ = Qlambda; - while (vecp - XVECTOR (frame_and_buffer_state)->contents - < XVECTOR (frame_and_buffer_state)->size) + while (vecp - XVECTOR (state)->contents + < XVECTOR (state)->size) *vecp++ = Qlambda; /* Make sure we didn't overflow the vector. */ - if (vecp - XVECTOR (frame_and_buffer_state)->contents - > XVECTOR (frame_and_buffer_state)->size) + if (vecp - XVECTOR (state)->contents + > XVECTOR (state)->size) abort (); return Qt; } diff --git a/src/disptab.h b/src/disptab.h index 30b2a7a7486..41f4bcbfdbf 100644 --- a/src/disptab.h +++ b/src/disptab.h @@ -1,5 +1,5 @@ /* Things for GLYPHS and glyph tables. - Copyright (C) 1993 Free Software Foundation, Inc. + Copyright (C) 1993, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/doc.c b/src/doc.c index 6d8b625affe..6d54aeceacd 100644 --- a/src/doc.c +++ b/src/doc.c @@ -1,6 +1,6 @@ /* Record indices of function doc strings stored in a file. - Copyright (C) 1985, 86,93,94,95,97,98,99,2000,04 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/doprnt.c b/src/doprnt.c index 1cfc5aecee6..5d824038faf 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -1,7 +1,7 @@ /* Output like sprintf to a buffer of specified size. Also takes args differently: pass one pointer to an array of strings in addition to the format string which is separate. - Copyright (C) 1985 Free Software Foundation, Inc. + Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/dosfns.c b/src/dosfns.c index 6192836e970..c256595cc13 100644 --- a/src/dosfns.c +++ b/src/dosfns.c @@ -1,7 +1,7 @@ /* MS-DOS specific Lisp utilities. Coded by Manabu Higashida, 1991. Major changes May-July 1993 Morten Welinder (only 10% original code left) - Copyright (C) 1991, 1993, 1996, 1997, 1998, 2001 - Free Software Foundation, Inc. + Copyright (C) 1991, 1993, 1996, 1997, 1998, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/dosfns.h b/src/dosfns.h index 594c3d980c6..40aaf524e23 100644 --- a/src/dosfns.h +++ b/src/dosfns.h @@ -2,8 +2,8 @@ Coded by Manabu Higashida, 1991. Modified by Morten Welinder, 1993-1994. - Copyright (C) 1991, 1994, 1995, 1997, 1999 - Free Software Foundation, Inc. + Copyright (C) 1991, 1994, 1995, 1997, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/ecrt0.c b/src/ecrt0.c index 95b69b11c01..5ee24dfae8c 100644 --- a/src/ecrt0.c +++ b/src/ecrt0.c @@ -1,5 +1,6 @@ /* C code startup routine. - Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1992, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/editfns.c b/src/editfns.c index 05888fd4843..da4533d2537 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -1,6 +1,7 @@ /* Lisp functions pertaining to editing. - Copyright (C) 1985, 1986, 1987, 1989, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1989, 1993, 1994, 1995, 1996, + 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/emacs.c b/src/emacs.c index af23f8b9136..8724cbf2928 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1,6 +1,6 @@ /* Fully extensible Emacs, running on Unix, intended for GNU. - Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2001, - 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999, + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -267,7 +267,7 @@ Initialization options:\n\ --no-site-file do not load site-start.el\n\ --no-splash do not display a splash screen on startup\n\ --no-window-system, -nw do not communicate with X, ignoring $DISPLAY\n\ ---quick, -Q equivalent to -q --no-site-file\n\ +--quick, -Q equivalent to -q --no-site-file --no-splash\n\ --script FILE run FILE as an Emacs Lisp script\n\ --terminal, -t DEVICE use DEVICE for terminal I/O\n\ --unibyte, --no-multibyte run Emacs in unibyte mode\n\ @@ -1154,9 +1154,9 @@ main (argc, argv if (argmatch (argv, argc, "-script", "--script", 3, &junk, &skip_args)) { noninteractive = 1; /* Set batch mode. */ - /* Convert --script to -l, un-skip it, and sort again so that -l will be - handled in proper sequence. */ - argv[skip_args - 1] = "-l"; + /* Convert --script to --scriptload, un-skip it, and sort again + so that it will be handled in proper sequence. */ + argv[skip_args - 1] = "-scriptload"; skip_args -= 2; sort_args (argc, argv); } @@ -1837,7 +1837,7 @@ struct standard_args standard_args[] = { "-itype", 0, 15, 0 }, { "-iconic", "--iconic", 15, 0 }, { "-D", "--basic-display", 12, 0}, - { "--basic-display", 0, 12, 0}, + { "-basic-display", 0, 12, 0}, { "-bg", "--background-color", 10, 1 }, { "-background", 0, 10, 1 }, { "-fg", "--foreground-color", 10, 1 }, @@ -1871,6 +1871,7 @@ struct standard_args standard_args[] = { "-directory", 0, 0, 1 }, { "-l", "--load", 0, 1 }, { "-load", 0, 0, 1 }, + { "-scriptload", "--scriptload", 0, 1 }, { "-f", "--funcall", 0, 1 }, { "-funcall", 0, 0, 1 }, { "-eval", "--eval", 0, 1 }, diff --git a/src/epaths.in b/src/epaths.in index be91cb485ae..ee965cb7615 100644 --- a/src/epaths.in +++ b/src/epaths.in @@ -1,6 +1,6 @@ /* Hey Emacs, this is -*- C -*- code! */ -/* Copyright (C) 1993, 1995, 1997, 1999, 2001 - Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995, 1997, 1999, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/eval.c b/src/eval.c index f625258229e..a867d00150e 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1,6 +1,6 @@ /* Evaluator for GNU Emacs Lisp interpreter. Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1999, 2000, 2001, - 2002, 2004, 2005 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -235,6 +235,7 @@ restore_stack_limits (data) { max_specpdl_size = XINT (XCAR (data)); max_lisp_eval_depth = XINT (XCDR (data)); + return Qnil; } /* Call the Lisp debugger, giving it argument ARG. */ @@ -471,10 +472,10 @@ usage: (prog1 FIRST BODY...) */) } DEFUN ("prog2", Fprog2, Sprog2, 2, UNEVALLED, 0, - doc: /* Eval X, Y and BODY sequentially; value from Y. -The value of Y is saved during the evaluation of the remaining args, -whose values are discarded. -usage: (prog2 X Y BODY...) */) + doc: /* Eval FORM1, FORM2 and BODY sequentially; value from FORM2. +The value of FORM2 is saved during the evaluation of the +remaining args, whose values are discarded. +usage: (prog2 FORM1 FORM2 BODY...) */) (args) Lisp_Object args; { @@ -564,8 +565,8 @@ usage: (function ARG) */) DEFUN ("interactive-p", Finteractive_p, Sinteractive_p, 0, 0, 0, doc: /* Return t if the function was run directly by user input. -This means that the function was called with call-interactively (which -includes being called as the binding of a key) +This means that the function was called with `call-interactively' +\(which includes being called as the binding of a key) and input is currently coming from the keyboard (not in keyboard macro), and Emacs is not running in batch mode (`noninteractive' is nil). @@ -586,14 +587,14 @@ unconditionally for that argument. (`p' is a good way to do this.) */) DEFUN ("called-interactively-p", Fcalled_interactively_p, Scalled_interactively_p, 0, 0, 0, - doc: /* Return t if the function using this was called with call-interactively. + doc: /* Return t if the function using this was called with `call-interactively'. This is used for implementing advice and other function-modifying features of Emacs. The cleanest way to test whether your function was called with -`call-interactively', the way to do that is by adding an extra -optional argument, and making the `interactive' spec specify non-nil -unconditionally for that argument. (`p' is a good way to do this.) */) +`call-interactively' is by adding an extra optional argument, +and making the `interactive' spec specify non-nil unconditionally +for that argument. (`p' is a good way to do this.) */) () { return interactive_p (1) ? Qt : Qnil; @@ -779,7 +780,7 @@ The return value is BASE-VARIABLE. */) DEFUN ("defvar", Fdefvar, Sdefvar, 1, UNEVALLED, 0, - doc: /* Define SYMBOL as a variable. + doc: /* Define SYMBOL as a variable, and return SYMBOL. You are not required to define a variable in order to use it, but the definition can supply documentation and an initial value in a way that tags can recognize. @@ -806,10 +807,6 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) register Lisp_Object sym, tem, tail; sym = Fcar (args); - if (SYMBOL_CONSTANT_P (sym)) - error ("Constant symbol `%s' specified in defvar", - SDATA (SYMBOL_NAME (sym))); - tail = Fcdr (args); if (!NILP (Fcdr (Fcdr (tail)))) error ("Too many arguments"); @@ -817,6 +814,18 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) tem = Fdefault_boundp (sym); if (!NILP (tail)) { + if (SYMBOL_CONSTANT_P (sym)) + { + /* For upward compatibility, allow (defvar :foo (quote :foo)). */ + Lisp_Object tem = Fcar (tail); + if (! (CONSP (tem) + && EQ (XCAR (tem), Qquote) + && CONSP (XCDR (tem)) + && EQ (XCAR (XCDR (tem)), sym))) + error ("Constant symbol `%s' specified in defvar", + SDATA (SYMBOL_NAME (sym))); + } + if (NILP (tem)) Fset_default (sym, Feval (Fcar (tail))); else @@ -2085,7 +2094,8 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0, return form; QUIT; - if (consing_since_gc > gc_cons_threshold) + if (consing_since_gc > gc_cons_threshold + && consing_since_gc > gc_relative_threshold) { GCPRO1 (form); Fgarbage_collect (); @@ -2785,7 +2795,8 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */) register int i; QUIT; - if (consing_since_gc > gc_cons_threshold) + if (consing_since_gc > gc_cons_threshold + && consing_since_gc > gc_relative_threshold) Fgarbage_collect (); if (++lisp_eval_depth > max_lisp_eval_depth) @@ -2851,8 +2862,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */) val = (*XSUBR (fun)->function) (internal_args[0]); goto done; case 2: - val = (*XSUBR (fun)->function) (internal_args[0], - internal_args[1]); + val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1]); goto done; case 3: val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1], @@ -2860,8 +2870,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */) goto done; case 4: val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1], - internal_args[2], - internal_args[3]); + internal_args[2], internal_args[3]); goto done; case 5: val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1], @@ -3387,7 +3396,7 @@ void syms_of_eval () { DEFVAR_INT ("max-specpdl-size", &max_specpdl_size, - doc: /* *Limit on number of Lisp variable bindings & unwind-protects. + doc: /* *Limit on number of Lisp variable bindings and `unwind-protect's. If Lisp code tries to increase the total number past this amount, an error is signaled. You can safely use a value considerably larger than the default value, @@ -3484,10 +3493,8 @@ It does not apply to errors handled by `condition-case'. */); Vdebug_ignored_errors = Qnil; DEFVAR_BOOL ("debug-on-quit", &debug_on_quit, - doc: /* *Non-nil means enter debugger if quit is signaled (C-g, for example). -Does not apply if quit is handled by a `condition-case'. -When you evaluate an expression interactively, this variable -is temporarily non-nil if `eval-expression-debug-on-quit' is non-nil. */); + doc: /* *Non-nil means enter debugger if quit is signaled (C-g, for example). +Does not apply if quit is handled by a `condition-case'. */); debug_on_quit = 0; DEFVAR_BOOL ("debug-on-next-call", &debug_on_next_call, diff --git a/src/fileio.c b/src/fileio.c index 769dc14e77d..53b989f52e2 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -1,6 +1,7 @@ /* File IO for GNU Emacs. - Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, + 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -5820,13 +5821,13 @@ auto_save_1 () } static Lisp_Object -do_auto_save_unwind (stream) /* used as unwind-protect function */ - Lisp_Object stream; +do_auto_save_unwind (arg) /* used as unwind-protect function */ + Lisp_Object arg; { + FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer; auto_saving = 0; - if (!NILP (stream)) - fclose ((FILE *) (XFASTINT (XCAR (stream)) << 16 - | XFASTINT (XCDR (stream)))); + if (stream != NULL) + fclose (stream); return Qnil; } @@ -5871,8 +5872,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) int auto_saved = 0; int do_handled_files; Lisp_Object oquit; - FILE *stream; - Lisp_Object lispstream; + FILE *stream = NULL; int count = SPECPDL_INDEX (); int orig_minibuffer_auto_raise = minibuffer_auto_raise; int old_message_p = 0; @@ -5924,24 +5924,10 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) } stream = fopen (SDATA (listfile), "w"); - if (stream != NULL) - { - /* Arrange to close that file whether or not we get an error. - Also reset auto_saving to 0. */ - lispstream = Fcons (Qnil, Qnil); - XSETCARFASTINT (lispstream, (EMACS_UINT)stream >> 16); - XSETCDRFASTINT (lispstream, (EMACS_UINT)stream & 0xffff); - } - else - lispstream = Qnil; - } - else - { - stream = NULL; - lispstream = Qnil; } - record_unwind_protect (do_auto_save_unwind, lispstream); + record_unwind_protect (do_auto_save_unwind, + make_save_value (stream, 0)); record_unwind_protect (do_auto_save_unwind_1, make_number (minibuffer_auto_raise)); minibuffer_auto_raise = 0; diff --git a/src/filelock.c b/src/filelock.c index de348f61a90..fc6839f5f88 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -1,6 +1,6 @@ /* Lock files for editing. - Copyright (C) 1985, 86, 87, 93, 94, 96, 98, 1999, 2000, 2001 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1993, 1994, 1996, 1998, 1999, 2000, 2001, + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/filemode.c b/src/filemode.c index 130cbace773..6257c6a7664 100644 --- a/src/filemode.c +++ b/src/filemode.c @@ -1,5 +1,6 @@ /* filemode.c -- make a string describing file modes - Copyright (C) 1985, 1990, 1993 Free Software Foundation, Inc. + Copyright (C) 1985, 1990, 1993, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/firstfile.c b/src/firstfile.c index cf6dbf3e888..b16f3a3dc44 100644 --- a/src/firstfile.c +++ b/src/firstfile.c @@ -1,5 +1,5 @@ /* Mark beginning of data space to dump as pure, for GNU Emacs. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/floatfns.c b/src/floatfns.c index 529e7b76e39..79574e0a69b 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -1,5 +1,6 @@ /* Primitive operations on floating point for GNU Emacs Lisp interpreter. - Copyright (C) 1988, 1993, 1994, 1999, 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 1988, 1993, 1994, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -460,7 +461,8 @@ DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0, CHECK_NUMBER_OR_FLOAT (arg1); CHECK_NUMBER_OR_FLOAT (arg2); if (INTEGERP (arg1) /* common lisp spec */ - && INTEGERP (arg2)) /* don't promote, if both are ints */ + && INTEGERP (arg2) /* don't promote, if both are ints, and */ + && 0 <= XINT (arg2)) /* we are sure the result is not fractional */ { /* this can be improved by pre-calculating */ EMACS_INT acc, x, y; /* some binary powers of x then accumulating */ Lisp_Object val; diff --git a/src/fns.c b/src/fns.c index f1e83f727a5..1e26ec9a392 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1,6 +1,7 @@ /* Random utility Lisp functions. - Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, + 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -1153,13 +1154,13 @@ Beware, this often doesn't really do what you think it does. It is similar to (decode-coding-string STRING 'emacs-mule-unix). If you're not sure, whether to use `string-as-multibyte' or `string-to-multibyte', use `string-to-multibyte'. Beware: - (aref (string-as-multibyte "\201") 0) -> 129 (aka ?\201) - (aref (string-as-multibyte "\300") 0) -> 192 (aka ?\300) - (aref (string-as-multibyte "\300\201") 0) -> 192 (aka ?\300) - (aref (string-as-multibyte "\300\201") 1) -> 129 (aka ?\201) + (aref (string-as-multibyte "\\201") 0) -> 129 (aka ?\\201) + (aref (string-as-multibyte "\\300") 0) -> 192 (aka ?\\300) + (aref (string-as-multibyte "\\300\\201") 0) -> 192 (aka ?\\300) + (aref (string-as-multibyte "\\300\\201") 1) -> 129 (aka ?\\201) but - (aref (string-as-multibyte "\201\300") 0) -> 2240 - (aref (string-as-multibyte "\201\300") 1) -> <error> */) + (aref (string-as-multibyte "\\201\\300") 0) -> 2240 + (aref (string-as-multibyte "\\201\\300") 1) -> <error> */) (string) Lisp_Object string; { @@ -5832,7 +5833,7 @@ syms_of_fns () DEFVAR_LISP ("features", &Vfeatures, doc: /* A list of symbols which are the features of the executing emacs. Used by `featurep' and `require', and altered by `provide'. */); - Vfeatures = Qnil; + Vfeatures = Fcons (intern ("emacs"), Qnil); Qsubfeatures = intern ("subfeatures"); staticpro (&Qsubfeatures); diff --git a/src/fontset.c b/src/fontset.c index e3bb1ced2f4..4529e6c2134 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -1,7 +1,7 @@ /* Fontset handler. - Copyright (C) 2004 Free Software Foundation, Inc. Copyright (C) 1995, 1997, 2000 Electrotechnical Laboratory, JAPAN. Licensed to the Free Software Foundation. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/fontset.h b/src/fontset.h index 7d2def16cfc..3a4932af6c0 100644 --- a/src/fontset.h +++ b/src/fontset.h @@ -1,6 +1,7 @@ /* Header for fontset handler. Copyright (C) 1995, 1997, 2000 Electrotechnical Laboratory, JAPAN. Licensed to the Free Software Foundation. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/frame.c b/src/frame.c index 864ec625c2c..ecbae7f593f 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1,6 +1,6 @@ /* Generic frame functions. - Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2003, 2004, 2005 - Free Software Foundation. + Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -2582,8 +2582,7 @@ DEFUN ("frame-char-width", Fframe_char_width, Sframe_char_width, 0, 1, 0, doc: /* Width in pixels of characters in the font in frame FRAME. If FRAME is omitted, the selected frame is used. -The width is the same for all characters, because -currently Emacs supports only fixed-width fonts. +On a graphical screen, the width is the standard width of the default font. For a terminal screen, the value is always 1. */) (frame) Lisp_Object frame; diff --git a/src/frame.h b/src/frame.h index 81d3477121e..838b61bb703 100644 --- a/src/frame.h +++ b/src/frame.h @@ -1,5 +1,6 @@ /* Define frame-object for GNU Emacs. - Copyright (C) 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -443,6 +444,10 @@ struct frame realized. Reset to zero whenever the default face changes. Used to see the difference between a font change and face change. */ unsigned default_face_done_p : 1; + + /* Set to non-zero if this frame has already been hscrolled during + current redisplay. */ + unsigned already_hscrolled_p : 1; }; #ifdef MULTI_KBOARD @@ -808,13 +813,13 @@ extern Lisp_Object selected_frame; Display-related Macros ***********************************************************************/ -/* Canonical y-unit on frame F. +/* Canonical y-unit on frame F. This value currently equals the line height of the frame (which is the height of the default font of F). */ #define FRAME_LINE_HEIGHT(F) ((F)->line_height) -/* Canonical x-unit on frame F. +/* Canonical x-unit on frame F. This value currently equals the average width of the default font of F. */ #define FRAME_COLUMN_WIDTH(F) ((F)->column_width) diff --git a/src/fringe.c b/src/fringe.c index 7731c0302e9..25de5aa604e 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -1,6 +1,7 @@ /* Fringe handling (split from xdisp.c). - Copyright (C) 1985,86,87,88,93,94,95,97,98,99,2000,01,02,03,04 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1997, + 1998, 1999, 2000, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -777,13 +778,14 @@ draw_window_fringes (w, no_fringe) /* Recalculate the bitmaps to show in the fringes of window W. - If FORCE_P is 0, only mark rows with modified bitmaps for update in - redraw_fringe_bitmaps_p; else mark all rows for update. */ + Only mark rows with modified bitmaps for update in redraw_fringe_bitmaps_p. + + If KEEP_CURRENT_P is 0, update current_matrix too. */ int -update_window_fringes (w, force_p) +update_window_fringes (w, keep_current_p) struct window *w; - int force_p; + int keep_current_p; { struct glyph_row *row, *cur = 0; int yb = window_text_bottom_y (w); @@ -849,7 +851,8 @@ update_window_fringes (w, force_p) { if (!done_top) { - if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer))) + if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer)) + && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row)) row->indicate_bob_p = !NILP (boundary_top); else row->indicate_top_line_p = !NILP (arrow_top); @@ -858,7 +861,8 @@ update_window_fringes (w, force_p) if (!done_bot) { - if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer))) + if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer)) + && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row)) row->indicate_eob_p = !NILP (boundary_bot), done_bot = 1; else if (y + row->height >= yb) row->indicate_bottom_line_p = !NILP (arrow_bot), done_bot = 1; @@ -943,8 +947,7 @@ update_window_fringes (w, force_p) else right = NO_FRINGE_BITMAP; - if (force_p - || row->y != cur->y + if (row->y != cur->y || row->visible_height != cur->visible_height || row->ends_at_zv_p != cur->ends_at_zv_p || left != cur->left_fringe_bitmap @@ -953,11 +956,15 @@ update_window_fringes (w, force_p) || right_face_id != cur->right_fringe_face_id || cur->redraw_fringe_bitmaps_p) { - redraw_p = row->redraw_fringe_bitmaps_p = cur->redraw_fringe_bitmaps_p = 1; - cur->left_fringe_bitmap = left; - cur->right_fringe_bitmap = right; - cur->left_fringe_face_id = left_face_id; - cur->right_fringe_face_id = right_face_id; + redraw_p = row->redraw_fringe_bitmaps_p = 1; + if (!keep_current_p) + { + cur->redraw_fringe_bitmaps_p = 1; + cur->left_fringe_bitmap = left; + cur->right_fringe_bitmap = right; + cur->left_fringe_face_id = left_face_id; + cur->right_fringe_face_id = right_face_id; + } } if (row->overlay_arrow_bitmap != cur->overlay_arrow_bitmap) @@ -975,7 +982,7 @@ update_window_fringes (w, force_p) row[-1].redraw_fringe_bitmaps_p = cur[-1].redraw_fringe_bitmaps_p = 1; } - return redraw_p; + return redraw_p && !keep_current_p; } diff --git a/src/getloadavg.c b/src/getloadavg.c index 191f7d4244f..a2ae9bc310b 100644 --- a/src/getloadavg.c +++ b/src/getloadavg.c @@ -1,6 +1,6 @@ /* Get the system load averages. - Copyright (C) 1985, 86, 87, 88, 89, 91, 92, 93, 1994, 1995, 1997, 2003 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1989, 1991, 1992, 1993, 1994, 1995, + 1997, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with gnulib. Bugs can be reported to bug-gnulib@gnu.org. diff --git a/src/getpagesize.h b/src/getpagesize.h index 20f19279cd0..ed47f80b0e0 100644 --- a/src/getpagesize.h +++ b/src/getpagesize.h @@ -1,5 +1,6 @@ /* Emulate getpagesize on systems that lack it. - Copyright (C) 1986, 1992, 1995, 2001 Free Software Foundation, Inc. + Copyright (C) 1986, 1992, 1995, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/gmalloc.c b/src/gmalloc.c index 08de77df0e0..55aedb7801b 100644 --- a/src/gmalloc.c +++ b/src/gmalloc.c @@ -5,7 +5,8 @@ /* The malloc headers and source files from the C library follow here. */ /* Declarations for `malloc' and friends. - Copyright 1990, 91, 92, 93, 95, 96, 99 Free Software Foundation, Inc. + Copyright (C) 1990, 1991, 1992, 1993, 1995, 1996, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. Written May 1989 by Mike Haertel. This library is free software; you can redistribute it and/or diff --git a/src/gtkutil.c b/src/gtkutil.c index 1cb1004f576..3b590e0faed 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1,6 +1,5 @@ /* Functions for creating and updating GTK widgets. - Copyright (C) 2003 - Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -240,6 +239,64 @@ xg_create_default_cursor (dpy) return gdk_cursor_new_for_display (gdpy, GDK_LEFT_PTR); } +/* Apply GMASK to GPIX and return a GdkPixbuf with an alpha channel. */ + +static GdkPixbuf * +xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap) + GdkPixmap *gpix; + GdkPixmap *gmask; + GdkColormap *cmap; +{ + int x, y, width, height, rowstride, mask_rowstride; + GdkPixbuf *icon_buf, *tmp_buf; + guchar *pixels; + guchar *mask_pixels; + + gdk_drawable_get_size (gpix, &width, &height); + tmp_buf = gdk_pixbuf_get_from_drawable (NULL, gpix, cmap, + 0, 0, 0, 0, width, height); + icon_buf = gdk_pixbuf_add_alpha (tmp_buf, FALSE, 0, 0, 0); + g_object_unref (G_OBJECT (tmp_buf)); + + if (gmask) + { + GdkPixbuf *mask_buf = gdk_pixbuf_get_from_drawable (NULL, + gmask, + NULL, + 0, 0, 0, 0, + width, height); + guchar *pixels = gdk_pixbuf_get_pixels (icon_buf); + guchar *mask_pixels = gdk_pixbuf_get_pixels (mask_buf); + int rowstride = gdk_pixbuf_get_rowstride (icon_buf); + int mask_rowstride = gdk_pixbuf_get_rowstride (mask_buf); + int y; + + for (y = 0; y < height; ++y) + { + guchar *iconptr, *maskptr; + int x; + + iconptr = pixels + y * rowstride; + maskptr = mask_pixels + y * mask_rowstride; + + for (x = 0; x < width; ++x) + { + /* In a bitmap, RGB is either 255/255/255 or 0/0/0. Checking + just R is sufficient. */ + if (maskptr[0] == 0) + iconptr[3] = 0; /* 0, 1, 2 is R, G, B. 3 is alpha. */ + + iconptr += rowstride/width; + maskptr += mask_rowstride/width; + } + } + + g_object_unref (G_OBJECT (mask_buf)); + } + + return icon_buf; +} + /* For the image defined in IMG, make and return a GtkImage. For displays with 8 planes or less we must make a GdkPixbuf and apply the mask manually. Otherwise the highlightning and dimming the tool bar code in GTK does @@ -312,60 +369,15 @@ xg_get_image_for_pixmap (f, img, widget, old_widget) } else { + /* This is a workaround to make icons look good on pseudo color displays. Apparently GTK expects the images to have an alpha channel. If they don't, insensitive and activated icons will look bad. This workaround does not work on monochrome displays, and is not needed on true color/static color displays (i.e. 16 bits and higher). */ - int x, y, width, height, rowstride, mask_rowstride; - GdkPixbuf *icon_buf, *tmp_buf; - guchar *pixels; - guchar *mask_pixels; - - gdk_drawable_get_size (gpix, &width, &height); - tmp_buf = gdk_pixbuf_get_from_drawable (NULL, - gpix, - gtk_widget_get_colormap (widget), - 0, 0, 0, 0, width, height); - icon_buf = gdk_pixbuf_add_alpha (tmp_buf, FALSE, 0, 0, 0); - g_object_unref (G_OBJECT (tmp_buf)); - - if (gmask) - { - GdkPixbuf *mask_buf = gdk_pixbuf_get_from_drawable (NULL, - gmask, - NULL, - 0, 0, 0, 0, - width, height); - guchar *pixels = gdk_pixbuf_get_pixels (icon_buf); - guchar *mask_pixels = gdk_pixbuf_get_pixels (mask_buf); - int rowstride = gdk_pixbuf_get_rowstride (icon_buf); - int mask_rowstride = gdk_pixbuf_get_rowstride (mask_buf); - int y; - - for (y = 0; y < height; ++y) - { - guchar *iconptr, *maskptr; - int x; - - iconptr = pixels + y * rowstride; - maskptr = mask_pixels + y * mask_rowstride; - - for (x = 0; x < width; ++x) - { - /* In a bitmap, RGB is either 255/255/255 or 0/0/0. Checking - just R is sufficient. */ - if (maskptr[0] == 0) - iconptr[3] = 0; /* 0, 1, 2 is R, G, B. 3 is alpha. */ - - iconptr += rowstride/width; - maskptr += mask_rowstride/width; - } - } - - g_object_unref (G_OBJECT (mask_buf)); - } + GdkColormap *cmap = gtk_widget_get_colormap (widget); + GdkPixbuf *icon_buf = xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap); if (! old_widget) old_widget = GTK_IMAGE (gtk_image_new_from_pixbuf (icon_buf)); @@ -940,6 +952,24 @@ xg_set_background_color (f, bg) } +/* Set the frame icon to ICON_PIXMAP/MASK. This must be done with GTK + functions so GTK does not overwrite the icon. */ + +void +xg_set_frame_icon (f, icon_pixmap, icon_mask) + FRAME_PTR f; + Pixmap icon_pixmap; + Pixmap icon_mask; +{ + GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f)); + GdkPixmap *gpix = gdk_pixmap_foreign_new_for_display (gdpy, icon_pixmap); + GdkPixmap *gmask = gdk_pixmap_foreign_new_for_display (gdpy, icon_mask); + GdkPixbuf *gp = xg_get_pixbuf_from_pix_and_mask (gpix, gmask, NULL); + + gtk_window_set_icon (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), gp); +} + + /*********************************************************************** Dialog functions @@ -2607,7 +2637,7 @@ xg_modify_menubar_widgets (menubar, f, val, deep_p, xg_update_menubar (menubar, f, &list, list, 0, val->contents, select_cb, highlight_cb, cl_data); - if (deep_p); + if (deep_p) { widget_value *cur; diff --git a/src/gtkutil.h b/src/gtkutil.h index 08ba9ee1314..aea4ee9e7cf 100644 --- a/src/gtkutil.h +++ b/src/gtkutil.h @@ -1,6 +1,5 @@ /* Definitions and headers for GTK widgets. - Copyright (C) 2003 - Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -200,6 +199,10 @@ extern void x_wm_set_size_hint P_ ((FRAME_PTR f, int user_position)); extern void xg_set_background_color P_ ((FRAME_PTR f, unsigned long bg)); +extern void xg_set_frame_icon P_ ((FRAME_PTR f, + Pixmap icon_pixmap, + Pixmap icon_mask)); + /* Mark all callback data that are Lisp_object:s during GC. */ extern void xg_mark_data P_ ((void)); diff --git a/src/image.c b/src/image.c index 928ec0437aa..6ec0734e785 100644 --- a/src/image.c +++ b/src/image.c @@ -1,6 +1,6 @@ /* Functions for image support on window system. - Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 98, 99, 2000,01,02,03,04 - Free Software Foundation. + Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -54,8 +54,8 @@ typedef struct x_bitmap_record Bitmap_Record; #define RGB_PIXEL_COLOR unsigned long -#define PIX_MASK_RETAIN(f) 0 -#define PIX_MASK_DRAW(f) 1 +#define PIX_MASK_RETAIN 0 +#define PIX_MASK_DRAW 1 #endif /* HAVE_X_WINDOWS */ @@ -71,8 +71,8 @@ typedef struct w32_bitmap_record Bitmap_Record; #define RGB_PIXEL_COLOR COLORREF -#define PIX_MASK_RETAIN(f) 0 -#define PIX_MASK_DRAW(f) 1 +#define PIX_MASK_RETAIN 0 +#define PIX_MASK_DRAW 1 #define FRAME_X_VISUAL(f) FRAME_X_DISPLAY_INFO (f)->visual #define x_defined_color w32_defined_color @@ -112,6 +112,11 @@ typedef struct mac_bitmap_record Bitmap_Record; #define RGB_PIXEL_COLOR unsigned long +/* A black pixel in a mask bitmap/pixmap means ``draw a source + pixel''. A white pixel means ``retain the current pixel''. */ +#define PIX_MASK_DRAW RGB_TO_ULONG(0,0,0) +#define PIX_MASK_RETAIN RGB_TO_ULONG(255,255,255) + #define FRAME_X_VISUAL(f) FRAME_X_DISPLAY_INFO (f)->visual #define x_defined_color mac_defined_color #define DefaultDepthOfScreen(screen) (one_mac_display_info.n_planes) @@ -181,19 +186,43 @@ XPutPixel (ximage, x, y, pixel) int x, y; unsigned long pixel; { - CGrafPtr old_port; - GDHandle old_gdh; - RGBColor color; + PixMapHandle pixmap = GetGWorldPixMap (ximage); + short depth = GetPixDepth (pixmap); - GetGWorld (&old_port, &old_gdh); - SetGWorld (ximage, NULL); + if (depth == 32) + { + char *base_addr = GetPixBaseAddr (pixmap); + short row_bytes = GetPixRowBytes (pixmap); - color.red = RED16_FROM_ULONG (pixel); - color.green = GREEN16_FROM_ULONG (pixel); - color.blue = BLUE16_FROM_ULONG (pixel); - SetCPixel (x, y, &color); + ((unsigned long *) (base_addr + y * row_bytes))[x] = pixel; + } + else if (depth == 1) + { + char *base_addr = GetPixBaseAddr (pixmap); + short row_bytes = GetPixRowBytes (pixmap); - SetGWorld (old_port, old_gdh); + if (pixel == PIX_MASK_DRAW) + base_addr[y * row_bytes + x / 8] |= (1 << 7) >> (x & 7); + else + base_addr[y * row_bytes + x / 8] &= ~((1 << 7) >> (x & 7)); + } + else + { + CGrafPtr old_port; + GDHandle old_gdh; + RGBColor color; + + GetGWorld (&old_port, &old_gdh); + SetGWorld (ximage, NULL); + + color.red = RED16_FROM_ULONG (pixel); + color.green = GREEN16_FROM_ULONG (pixel); + color.blue = BLUE16_FROM_ULONG (pixel); + + SetCPixel (x, y, &color); + + SetGWorld (old_port, old_gdh); + } } static unsigned long @@ -201,17 +230,40 @@ XGetPixel (ximage, x, y) XImagePtr ximage; int x, y; { - CGrafPtr old_port; - GDHandle old_gdh; - RGBColor color; + PixMapHandle pixmap = GetGWorldPixMap (ximage); + short depth = GetPixDepth (pixmap); - GetGWorld (&old_port, &old_gdh); - SetGWorld (ximage, NULL); + if (depth == 32) + { + char *base_addr = GetPixBaseAddr (pixmap); + short row_bytes = GetPixRowBytes (pixmap); - GetCPixel (x, y, &color); + return ((unsigned long *) (base_addr + y * row_bytes))[x]; + } + else if (depth == 1) + { + char *base_addr = GetPixBaseAddr (pixmap); + short row_bytes = GetPixRowBytes (pixmap); - SetGWorld (old_port, old_gdh); - return RGB_TO_ULONG (color.red >> 8, color.green >> 8, color.blue >> 8); + if (base_addr[y * row_bytes + x / 8] & (1 << (~x & 7))) + return PIX_MASK_DRAW; + else + return PIX_MASK_RETAIN; + } + else + { + CGrafPtr old_port; + GDHandle old_gdh; + RGBColor color; + + GetGWorld (&old_port, &old_gdh); + SetGWorld (ximage, NULL); + + GetCPixel (x, y, &color); + + SetGWorld (old_port, old_gdh); + return RGB_TO_ULONG (color.red >> 8, color.green >> 8, color.blue >> 8); + } } static void @@ -1300,7 +1352,7 @@ image_background_transparent (img, f, mask) } img->background_transparent - = (four_corners_best (mask, img->width, img->height) == PIX_MASK_RETAIN (f)); + = (four_corners_best (mask, img->width, img->height) == PIX_MASK_RETAIN); if (free_mask) Destroy_Image (mask, prev); @@ -2003,7 +2055,6 @@ x_create_x_image_and_pixmap (f, width, height, depth, ximg, pixmap) *pixmap = XCreatePixmap (display, window, width, height, depth); if (*pixmap == NO_PIXMAP) { - x_destroy_x_image (*ximg); *ximg = NULL; image_error ("Unable to create X pixmap", Qnil, Qnil); return 0; @@ -2166,10 +2217,8 @@ find_image_fsspec (specified_file, file, fss) Lisp_Object specified_file, *file; FSSpec *fss; { -#if TARGET_API_MAC_CARBON +#if MAC_OSX FSRef fsr; -#else - Str255 mac_pathname; #endif OSErr err; @@ -2178,15 +2227,12 @@ find_image_fsspec (specified_file, file, fss) return fnfErr; /* file or directory not found; incomplete pathname */ /* Try to open the image file. */ -#if TARGET_API_MAC_CARBON +#if MAC_OSX err = FSPathMakeRef (SDATA (*file), &fsr, NULL); if (err == noErr) err = FSGetCatalogInfo (&fsr, kFSCatInfoNone, NULL, NULL, fss, NULL); #else - if (posix_to_mac_pathname (SDATA (*file), mac_pathname, MAXPATHLEN+1) == 0) - return fnfErr; - c2pstr (mac_pathname); - err = FSMakeFSSpec (0, 0, mac_pathname, fss); + err = posix_pathname_to_fsspec (SDATA (*file), fss); #endif return err; } @@ -3850,24 +3896,24 @@ xpm_load (f, img) Only XPM version 3 (without any extensions) is supported. */ static int xpm_scan P_ ((unsigned char **, unsigned char *, - unsigned char **, int *)); + unsigned char **, int *)); static Lisp_Object xpm_make_color_table_v P_ ((void (**) (Lisp_Object, unsigned char *, int, Lisp_Object), Lisp_Object (**) (Lisp_Object, unsigned char *, int))); static void xpm_put_color_table_v P_ ((Lisp_Object, unsigned char *, - int, Lisp_Object)); + int, Lisp_Object)); static Lisp_Object xpm_get_color_table_v P_ ((Lisp_Object, - unsigned char *, int)); + unsigned char *, int)); static Lisp_Object xpm_make_color_table_h P_ ((void (**) (Lisp_Object, unsigned char *, int, Lisp_Object), Lisp_Object (**) (Lisp_Object, unsigned char *, int))); static void xpm_put_color_table_h P_ ((Lisp_Object, unsigned char *, - int, Lisp_Object)); + int, Lisp_Object)); static Lisp_Object xpm_get_color_table_h P_ ((Lisp_Object, - unsigned char *, int)); + unsigned char *, int)); static int xpm_str_to_color_key P_ ((char *)); static int xpm_load_image P_ ((struct frame *, struct image *, - unsigned char *, unsigned char *)); + unsigned char *, unsigned char *)); /* Tokens returned from xpm_scan. */ @@ -3896,49 +3942,49 @@ xpm_scan (s, end, beg, len) { /* Skip white-space. */ while (*s < end && (c = *(*s)++, isspace (c))) - ; + ; /* gnus-pointer.xpm uses '-' in its identifier. - sb-dir-plus.xpm uses '+' in its identifier. */ + sb-dir-plus.xpm uses '+' in its identifier. */ if (isalpha (c) || c == '_' || c == '-' || c == '+') - { - *beg = *s - 1; - while (*s < end && - (c = **s, isalnum (c) || c == '_' || c == '-' || c == '+')) - ++*s; - *len = *s - *beg; - return XPM_TK_IDENT; - } + { + *beg = *s - 1; + while (*s < end && + (c = **s, isalnum (c) || c == '_' || c == '-' || c == '+')) + ++*s; + *len = *s - *beg; + return XPM_TK_IDENT; + } else if (c == '"') - { - *beg = *s; - while (*s < end && **s != '"') - ++*s; - *len = *s - *beg; - if (*s < end) - ++*s; - return XPM_TK_STRING; - } + { + *beg = *s; + while (*s < end && **s != '"') + ++*s; + *len = *s - *beg; + if (*s < end) + ++*s; + return XPM_TK_STRING; + } else if (c == '/') - { - if (*s < end && **s == '*') - { - /* C-style comment. */ - ++*s; - do - { - while (*s < end && *(*s)++ != '*') - ; - } - while (*s < end && **s != '/'); - if (*s < end) - ++*s; - } - else - return c; - } + { + if (*s < end && **s == '*') + { + /* C-style comment. */ + ++*s; + do + { + while (*s < end && *(*s)++ != '*') + ; + } + while (*s < end && **s != '/'); + if (*s < end) + ++*s; + } + else + return c; + } else - return c; + return c; } return XPM_TK_EOF; @@ -3988,9 +4034,9 @@ xpm_make_color_table_h (put_func, get_func) *put_func = xpm_put_color_table_h; *get_func = xpm_get_color_table_h; return make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE), - make_float (DEFAULT_REHASH_SIZE), - make_float (DEFAULT_REHASH_THRESHOLD), - Qnil, Qnil, Qnil); + make_float (DEFAULT_REHASH_SIZE), + make_float (DEFAULT_REHASH_THRESHOLD), + Qnil, Qnil, Qnil); } static void @@ -4016,7 +4062,7 @@ xpm_get_color_table_h (color_table, chars_start, chars_len) { struct Lisp_Hash_Table *table = XHASH_TABLE (color_table); int i = hash_lookup (table, make_unibyte_string (chars_start, chars_len), - NULL); + NULL); return i >= 0 ? HASH_VALUE (table, i) : Qnil; } @@ -4065,17 +4111,17 @@ xpm_load_image (f, img, contents, end) #define match() \ LA1 = xpm_scan (&s, end, &beg, &len) -#define expect(TOKEN) \ - if (LA1 != (TOKEN)) \ - goto failure; \ - else \ +#define expect(TOKEN) \ + if (LA1 != (TOKEN)) \ + goto failure; \ + else \ match () -#define expect_ident(IDENT) \ +#define expect_ident(IDENT) \ if (LA1 == XPM_TK_IDENT \ - && strlen ((IDENT)) == len && memcmp ((IDENT), beg, len) == 0) \ - match (); \ - else \ + && strlen ((IDENT)) == len && memcmp ((IDENT), beg, len) == 0) \ + match (); \ + else \ goto failure if (!(end - s >= 9 && memcmp (s, "/* XPM */", 9) == 0)) @@ -4096,7 +4142,7 @@ xpm_load_image (f, img, contents, end) memcpy (buffer, beg, len); buffer[len] = '\0'; if (sscanf (buffer, "%d %d %d %d", &width, &height, - &num_colors, &chars_per_pixel) != 4 + &num_colors, &chars_per_pixel) != 4 || width <= 0 || height <= 0 || num_colors <= 0 || chars_per_pixel <= 0) goto failure; @@ -4107,17 +4153,17 @@ xpm_load_image (f, img, contents, end) best_key = XPM_COLOR_KEY_C; else if (!NILP (Fx_display_grayscale_p (frame))) best_key = (XFASTINT (Fx_display_planes (frame)) > 2 - ? XPM_COLOR_KEY_G : XPM_COLOR_KEY_G4); + ? XPM_COLOR_KEY_G : XPM_COLOR_KEY_G4); else best_key = XPM_COLOR_KEY_M; color_symbols = image_spec_value (img->spec, QCcolor_symbols, NULL); if (chars_per_pixel == 1) color_table = xpm_make_color_table_v (&put_color_table, - &get_color_table); + &get_color_table); else color_table = xpm_make_color_table_h (&put_color_table, - &get_color_table); + &get_color_table); while (num_colors-- > 0) { @@ -4128,71 +4174,71 @@ xpm_load_image (f, img, contents, end) expect (XPM_TK_STRING); if (len <= chars_per_pixel || len >= BUFSIZ + chars_per_pixel) - goto failure; + goto failure; memcpy (buffer, beg + chars_per_pixel, len - chars_per_pixel); buffer[len - chars_per_pixel] = '\0'; str = strtok (buffer, " \t"); if (str == NULL) - goto failure; + goto failure; key = xpm_str_to_color_key (str); if (key < 0) - goto failure; + goto failure; do - { - color = strtok (NULL, " \t"); - if (color == NULL) - goto failure; + { + color = strtok (NULL, " \t"); + if (color == NULL) + goto failure; - while (str = strtok (NULL, " \t")) - { - next_key = xpm_str_to_color_key (str); - if (next_key >= 0) - break; - color[strlen (color)] = ' '; - } + while (str = strtok (NULL, " \t")) + { + next_key = xpm_str_to_color_key (str); + if (next_key >= 0) + break; + color[strlen (color)] = ' '; + } - if (key == XPM_COLOR_KEY_S) - { - if (NILP (symbol_color)) - symbol_color = build_string (color); - } - else if (max_key < key && key <= best_key) - { - max_key = key; - max_color = color; - } - key = next_key; - } + if (key == XPM_COLOR_KEY_S) + { + if (NILP (symbol_color)) + symbol_color = build_string (color); + } + else if (max_key < key && key <= best_key) + { + max_key = key; + max_color = color; + } + key = next_key; + } while (str); color_val = Qnil; if (!NILP (color_symbols) && !NILP (symbol_color)) - { - Lisp_Object specified_color = Fassoc (symbol_color, color_symbols); - - if (CONSP (specified_color) && STRINGP (XCDR (specified_color))) - if (xstricmp (SDATA (XCDR (specified_color)), "None") == 0) - color_val = Qt; - else if (x_defined_color (f, SDATA (XCDR (specified_color)), - &cdef, 0)) - color_val = make_number (cdef.pixel); - } + { + Lisp_Object specified_color = Fassoc (symbol_color, color_symbols); + + if (CONSP (specified_color) && STRINGP (XCDR (specified_color))) + if (xstricmp (SDATA (XCDR (specified_color)), "None") == 0) + color_val = Qt; + else if (x_defined_color (f, SDATA (XCDR (specified_color)), + &cdef, 0)) + color_val = make_number (cdef.pixel); + } if (NILP (color_val) && max_key > 0) - if (xstricmp (max_color, "None") == 0) - color_val = Qt; - else if (x_defined_color (f, max_color, &cdef, 0)) - color_val = make_number (cdef.pixel); + if (xstricmp (max_color, "None") == 0) + color_val = Qt; + else if (x_defined_color (f, max_color, &cdef, 0)) + color_val = make_number (cdef.pixel); if (!NILP (color_val)) - (*put_color_table) (color_table, beg, chars_per_pixel, color_val); + (*put_color_table) (color_table, beg, chars_per_pixel, color_val); expect (','); } if (!x_create_x_image_and_pixmap (f, width, height, 0, - &ximg, &img->pixmap) + &ximg, &img->pixmap) || !x_create_x_image_and_pixmap (f, width, height, 1, - &mask_img, &img->mask)) + &mask_img, &img->mask)) { image_error ("Out of memory (%s)", img->spec, Qnil); goto error; @@ -4203,21 +4249,21 @@ xpm_load_image (f, img, contents, end) expect (XPM_TK_STRING); str = beg; if (len < width * chars_per_pixel) - goto failure; + goto failure; for (x = 0; x < width; x++, str += chars_per_pixel) - { - Lisp_Object color_val = - (*get_color_table) (color_table, str, chars_per_pixel); - - XPutPixel (ximg, x, y, - (INTEGERP (color_val) ? XINT (color_val) - : FRAME_FOREGROUND_PIXEL (f))); - XPutPixel (mask_img, x, y, - (!EQ (color_val, Qt) ? PIX_MASK_DRAW (f) - : (have_mask = 1, PIX_MASK_RETAIN (f)))); - } + { + Lisp_Object color_val = + (*get_color_table) (color_table, str, chars_per_pixel); + + XPutPixel (ximg, x, y, + (INTEGERP (color_val) ? XINT (color_val) + : FRAME_FOREGROUND_PIXEL (f))); + XPutPixel (mask_img, x, y, + (!EQ (color_val, Qt) ? PIX_MASK_DRAW + : (have_mask = 1, PIX_MASK_RETAIN))); + } if (y + 1 < height) - expect (','); + expect (','); } img->width = width; @@ -4227,6 +4273,10 @@ xpm_load_image (f, img, contents, end) x_destroy_x_image (ximg); if (have_mask) { + /* Fill in the background_transparent field while we have the + mask handy. */ + image_background_transparent (img, f, mask_img); + x_put_x_image (f, mask_img, img->mask, width, height); x_destroy_x_image (mask_img); } @@ -4272,19 +4322,19 @@ xpm_load (f, img) file = x_find_image_file (file_name); GCPRO1 (file); if (!STRINGP (file)) - { - image_error ("Cannot find image file `%s'", file_name, Qnil); - UNGCPRO; - return 0; - } + { + image_error ("Cannot find image file `%s'", file_name, Qnil); + UNGCPRO; + return 0; + } contents = slurp_file (SDATA (file), &size); if (contents == NULL) - { - image_error ("Error loading XPM image `%s'", img->spec, Qnil); - UNGCPRO; - return 0; - } + { + image_error ("Error loading XPM image `%s'", img->spec, Qnil); + UNGCPRO; + return 0; + } success_p = xpm_load_image (f, img, contents, contents + size); xfree (contents); @@ -4296,7 +4346,7 @@ xpm_load (f, img) data = image_spec_value (img->spec, QCdata, NULL); success_p = xpm_load_image (f, img, SDATA (data), - SDATA (data) + SBYTES (data)); + SDATA (data) + SBYTES (data)); } return success_p; @@ -4973,7 +5023,7 @@ x_disable_image (f, img) #ifdef MAC_OS #define XCreateGC_pixmap(dpy, pixmap) XCreateGC (dpy, NULL, 0, NULL) -#define MaskForeground(f) PIX_MASK_DRAW (f) +#define MaskForeground(f) PIX_MASK_DRAW #else #define XCreateGC_pixmap(dpy, pixmap) XCreateGC (dpy, pixmap, 0, NULL) #define MaskForeground(f) WHITE_PIX_DEFAULT (f) @@ -5121,7 +5171,7 @@ x_build_heuristic_mask (f, img, how) for (y = 0; y < img->height; ++y) for (x = 0; x < img->width; ++x) XPutPixel (mask_img, x, y, (XGetPixel (ximg, x, y) != bg - ? PIX_MASK_DRAW (f) : PIX_MASK_RETAIN (f))); + ? PIX_MASK_DRAW : PIX_MASK_RETAIN)); /* Fill in the background_transparent field while we have the mask handy. */ image_background_transparent (img, f, mask_img); @@ -6123,7 +6173,7 @@ png_load (f, img) if (channels == 4) { if (mask_img) - XPutPixel (mask_img, x, y, *p > 0 ? PIX_MASK_DRAW (f) : PIX_MASK_RETAIN (f)); + XPutPixel (mask_img, x, y, *p > 0 ? PIX_MASK_DRAW : PIX_MASK_RETAIN); ++p; } } @@ -8025,6 +8075,11 @@ syms_of_image () { extern Lisp_Object Qrisky_local_variable; /* Syms_of_xdisp has already run. */ + /* Initialize this only once, since that's what we do with Vimage_types + and they are supposed to be in sync. Initializing here gives correct + operation on GNU/Linux of calling dump-emacs after loading some images. */ + image_types = NULL; + /* Must be defined now becase we're going to update it below, while defining the supported image types. */ DEFVAR_LISP ("image-types", &Vimage_types, @@ -8050,6 +8105,17 @@ listed; they're always supported. */); Vimage_type_cache = Qnil; staticpro (&Vimage_type_cache); + Qpbm = intern ("pbm"); + staticpro (&Qpbm); + ADD_IMAGE_TYPE(Qpbm); + + Qxbm = intern ("xbm"); + staticpro (&Qxbm); + ADD_IMAGE_TYPE(Qxbm); + + define_image_type (&xbm_type, 1); + define_image_type (&pbm_type, 1); + QCascent = intern (":ascent"); staticpro (&QCascent); QCmargin = intern (":margin"); @@ -8094,14 +8160,6 @@ listed; they're always supported. */); staticpro (&QCpt_height); #endif /* HAVE_GHOSTSCRIPT */ - Qpbm = intern ("pbm"); - staticpro (&Qpbm); - ADD_IMAGE_TYPE(Qpbm); - - Qxbm = intern ("xbm"); - staticpro (&Qxbm); - ADD_IMAGE_TYPE(Qxbm); - #if defined (HAVE_XPM) || defined (MAC_OS) Qxpm = intern ("xpm"); staticpro (&Qxpm); @@ -8163,11 +8221,6 @@ meaning don't clear the cache. */); void init_image () { - image_types = NULL; - - define_image_type (&xbm_type, 1); - define_image_type (&pbm_type, 1); - #ifdef MAC_OS /* Animated gifs use QuickTime Movie Toolbox. So initialize it here. */ EnterMovies (); diff --git a/src/indent.c b/src/indent.c index 2dc113a9086..68544e8059d 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1,6 +1,6 @@ /* Indentation functions. Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1998, 2000, 2001, - 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -2076,6 +2076,7 @@ whether or not it is currently displayed in some window. */) { int it_start; int oselective; + int start_on_image_p; SET_TEXT_POS (pt, PT, PT_BYTE); start_display (&it, w, pt); @@ -2087,6 +2088,7 @@ whether or not it is currently displayed in some window. */) while the end position is really at some X > 0, the same X that PT had. */ it_start = IT_CHARPOS (it); + start_on_image_p = (it.method == GET_FROM_IMAGE); reseat_at_previous_visible_line_start (&it); it.current_x = it.hpos = 0; /* Temporarily disable selective display so we don't move too far */ @@ -2096,8 +2098,10 @@ whether or not it is currently displayed in some window. */) it.selective = oselective; /* Move back if we got too far. This may happen if - truncate-lines is on and PT is beyond right margin. */ - if (IT_CHARPOS (it) > it_start && XINT (lines) > 0) + truncate-lines is on and PT is beyond right margin. + It may also happen if it_start is on an image -- + in that case, don't go back. */ + if (IT_CHARPOS (it) > it_start && XINT (lines) > 0 && !start_on_image_p) move_it_by_lines (&it, -1, 0); it.vpos = 0; diff --git a/src/indent.h b/src/indent.h index 39db7b8cf5f..6026be827e8 100644 --- a/src/indent.h +++ b/src/indent.h @@ -1,5 +1,6 @@ /* Definitions for interface to indent.c - Copyright (C) 1985, 1986 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/insdel.c b/src/insdel.c index 4760342c56b..fd416037241 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1,6 +1,6 @@ /* Buffer insertion/deletion and gap motion for GNU Emacs. - Copyright (C) 1985, 86,93,94,95,97,98, 1999, 2000, 01, 2003, 2005 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -2393,6 +2393,7 @@ void syms_of_insdel () { staticpro (&combine_after_change_list); + staticpro (&combine_after_change_buffer); combine_after_change_list = Qnil; combine_after_change_buffer = Qnil; diff --git a/src/intervals.c b/src/intervals.c index cb60061fdce..07845f95666 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -1,5 +1,6 @@ /* Code for doing intervals. - Copyright (C) 1993, 1994, 1995, 1997, 1998, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1995, 1997, 1998, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -790,14 +791,14 @@ update_interval (i, pos) /* Move right. */ if (pos < INTERVAL_LAST_POS (i) + TOTAL_LENGTH (i->right)) { - i->right->position = INTERVAL_LAST_POS (i) + - LEFT_TOTAL_LENGTH (i->right); + i->right->position = INTERVAL_LAST_POS (i) + + LEFT_TOTAL_LENGTH (i->right); i = i->right; /* Move to the right child */ } else if (NULL_PARENT (i)) - error ("Point after end of properties"); + error ("Point %d after end of properties", pos); else - i = INTERVAL_PARENT (i); + i = INTERVAL_PARENT (i); continue; } else diff --git a/src/intervals.h b/src/intervals.h index 374f8984167..418520b5c25 100644 --- a/src/intervals.h +++ b/src/intervals.h @@ -1,5 +1,6 @@ /* Definitions and global variables for intervals. - Copyright (C) 1993, 1994, 2000, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 2000, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/keyboard.c b/src/keyboard.c index d2d5919fc85..74f8d7d51e0 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1,6 +1,7 @@ /* Keyboard and mouse input; editor command loop. - Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, 1995, 1996, 1997, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, 1995, + 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -4010,7 +4011,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu) kbd_fetch_ptr = event + 1; } #endif -#if defined (HAVE_X11) || defined (HAVE_NTGUI) +#if defined (HAVE_X11) || defined (HAVE_NTGUI) || defined (MAC_OS) else if (event->kind == ICONIFY_EVENT) { /* Make an event (iconify-frame (FRAME)). */ @@ -7001,8 +7002,6 @@ menu_bar_items (old) int i; - struct gcpro gcpro1; - /* In order to build the menus, we need to call the keymap accessors. They all call QUIT. But this function is called during redisplay, during which a quit is fatal. So inhibit @@ -7018,8 +7017,6 @@ menu_bar_items (old) menu_bar_items_vector = Fmake_vector (make_number (24), Qnil); menu_bar_items_index = 0; - GCPRO1 (menu_bar_items_vector); - /* Build our list of keymaps. If we recognize a function key and replace its escape sequence in keybuf with its symbol, or if the sequence starts with a mouse @@ -7123,7 +7120,6 @@ menu_bar_items (old) menu_bar_items_index = i; Vinhibit_quit = oquit; - UNGCPRO; return menu_bar_items_vector; } @@ -11167,6 +11163,9 @@ syms_of_keyboard () menu_bar_one_keymap_changed_items = Qnil; staticpro (&menu_bar_one_keymap_changed_items); + menu_bar_items_vector = Qnil; + staticpro (&menu_bar_items_vector); + defsubr (&Sevent_convert_list); defsubr (&Sread_key_sequence); defsubr (&Sread_key_sequence_vector); @@ -11443,6 +11442,7 @@ might happen repeatedly and make Emacs nonfunctional. */); doc: /* Normal hook run when clearing the echo area. */); #endif Qecho_area_clear_hook = intern ("echo-area-clear-hook"); + staticpro (&Qecho_area_clear_hook); SET_SYMBOL_VALUE (Qecho_area_clear_hook, Qnil); DEFVAR_LISP ("lucid-menu-bar-dirty-flag", &Vlucid_menu_bar_dirty_flag, diff --git a/src/keyboard.h b/src/keyboard.h index 10b64dfe488..0063922787f 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -1,5 +1,6 @@ /* Declarations useful when processing input. - Copyright (C) 1985, 1986, 1987, 1993 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1993, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/keymap.c b/src/keymap.c index 17c55cfd2d6..9d67f4400c0 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1,6 +1,7 @@ /* Manipulation of keymaps - Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1998, 1999, 2000, - 2001, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, + 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -1654,7 +1655,7 @@ bindings; see the description of `lookup-key' for more details about this. */) DEFUN ("minor-mode-key-binding", Fminor_mode_key_binding, Sminor_mode_key_binding, 1, 2, 0, doc: /* Find the visible minor mode bindings of KEY. -Return an alist of pairs (MODENAME . BINDING), where MODENAME is the +Return an alist of pairs (MODENAME . BINDING), where MODENAME is the symbol which names the minor mode binding KEY, and BINDING is KEY's definition in that mode. In particular, if KEY has no minor-mode bindings, return nil. If the first binding is a diff --git a/src/keymap.h b/src/keymap.h index 4fcbffbed5a..bcf14abcd89 100644 --- a/src/keymap.h +++ b/src/keymap.h @@ -1,5 +1,5 @@ /* Functions to manipulate keymaps. - Copyright (C) 2001, 2005 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/lastfile.c b/src/lastfile.c index d03dc2c8346..a229d94fd6a 100644 --- a/src/lastfile.c +++ b/src/lastfile.c @@ -1,5 +1,5 @@ /* Mark end of data space to dump as pure, for GNU Emacs. - Copyright (C) 1985 Free Software Foundation, Inc. + Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/lisp.h b/src/lisp.h index 5c0e9b561ad..8f37c715c29 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1,6 +1,6 @@ /* Fundamental definitions for GNU Emacs Lisp interpreter. Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -1797,7 +1797,7 @@ extern int interrupt_input_pending; Lisp_Object flag = Vquit_flag; \ Vquit_flag = Qnil; \ if (EQ (Vthrow_on_input, flag)) \ - Fthrow (Vthrow_on_input, Qnil); \ + Fthrow (Vthrow_on_input, Qt); \ Fsignal (Qquit, Qnil); \ } \ else if (interrupt_input_pending) \ @@ -1813,7 +1813,7 @@ extern int interrupt_input_pending; Lisp_Object flag = Vquit_flag; \ Vquit_flag = Qnil; \ if (EQ (Vthrow_on_input, flag)) \ - Fthrow (Vthrow_on_input, Qnil); \ + Fthrow (Vthrow_on_input, Qt); \ Fsignal (Qquit, Qnil); \ } \ } while (0) @@ -1876,10 +1876,12 @@ extern Lisp_Object Vascii_canon_table, Vascii_eqv_table; extern int consing_since_gc; -/* Threshold for doing another gc. */ +/* Thresholds for doing another gc. */ extern EMACS_INT gc_cons_threshold; +extern EMACS_INT gc_relative_threshold; + /* Structure for recording stack slots that need marking. */ /* This is a chain of structures, each of which points at a Lisp_Object variable @@ -3024,12 +3026,9 @@ extern int wait_reading_process_output P_ ((int, int, int, int, Lisp_Object, struct Lisp_Process *, int)); -extern void deactivate_process P_ ((Lisp_Object)); extern void add_keyboard_wait_descriptor P_ ((int)); extern void delete_keyboard_wait_descriptor P_ ((int)); extern void close_process_descs P_ ((void)); -extern void status_notify P_ ((void)); -extern int read_process_output P_ ((Lisp_Object, int)); extern void init_process P_ ((void)); extern void syms_of_process P_ ((void)); extern void setup_process_coding_systems P_ ((Lisp_Object)); diff --git a/src/lread.c b/src/lread.c index f159e98d4e9..94fb5ddb155 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1,6 +1,7 @@ /* Lisp parsing and input streams. - Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, 1995, 1997, 1998, - 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, 1995, + 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -86,6 +87,7 @@ Lisp_Object Qvariable_documentation, Vvalues, Vstandard_input, Vafter_load_alist Lisp_Object Qascii_character, Qload, Qload_file_name; Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; Lisp_Object Qinhibit_file_name_operation; +Lisp_Object Qeval_buffer_list, Veval_buffer_list; extern Lisp_Object Qevent_symbol_element_mask; extern Lisp_Object Qfile_exists_p; @@ -674,7 +676,6 @@ Return t if file exists. */) { register FILE *stream; register int fd = -1; - register Lisp_Object lispstream; int count = SPECPDL_INDEX (); Lisp_Object temp; struct gcpro gcpro1; @@ -904,10 +905,7 @@ Return t if file exists. */) } GCPRO1 (file); - lispstream = Fcons (Qnil, Qnil); - XSETCARFASTINT (lispstream, (EMACS_UINT)stream >> 16); - XSETCDRFASTINT (lispstream, (EMACS_UINT)stream & 0xffff); - record_unwind_protect (load_unwind, lispstream); + record_unwind_protect (load_unwind, make_save_value (stream, 0)); record_unwind_protect (load_descriptor_unwind, load_descriptor_list); specbind (Qload_file_name, found); specbind (Qinhibit_file_name_operation, Qnil); @@ -957,11 +955,12 @@ Return t if file exists. */) } static Lisp_Object -load_unwind (stream) /* used as unwind-protect function in load */ - Lisp_Object stream; +load_unwind (arg) /* used as unwind-protect function in load */ + Lisp_Object arg; { - fclose ((FILE *) (XFASTINT (XCAR (stream)) << 16 - | XFASTINT (XCDR (stream)))); + FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer; + if (stream != NULL) + fclose (stream); if (--load_in_progress < 0) load_in_progress = 0; return Qnil; } @@ -1453,6 +1452,7 @@ This function preserves the position of point. */) if (NILP (filename)) filename = XBUFFER (buf)->filename; + specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list)); specbind (Qstandard_output, tem); record_unwind_protect (save_excursion_restore, save_excursion_save ()); BUF_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf))); @@ -1488,6 +1488,7 @@ This function does not move point. */) else tem = printflag; specbind (Qstandard_output, tem); + specbind (Qeval_buffer_list, Fcons (cbuf, Veval_buffer_list)); /* readevalloop calls functions which check the type of start and end. */ readevalloop (cbuf, 0, XBUFFER (cbuf)->filename, Feval, @@ -3962,6 +3963,10 @@ to load. See also `load-dangerous-libraries'. */); Vbytecomp_version_regexp = build_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)"); + DEFVAR_LISP ("eval-buffer-list", &Veval_buffer_list, + doc: /* List of buffers being read from by calls to `eval-buffer' and `eval-region'. */); + Veval_buffer_list = Qnil; + /* Vsource_directory was initialized in init_lread. */ load_descriptor_list = Qnil; @@ -4003,11 +4008,15 @@ to load. See also `load-dangerous-libraries'. */); Qload_file_name = intern ("load-file-name"); staticpro (&Qload_file_name); + Qeval_buffer_list = intern ("eval-buffer-list"); + staticpro (&Qeval_buffer_list); + staticpro (&dump_path); staticpro (&read_objects); read_objects = Qnil; staticpro (&seen_list); + seen_list = Qnil; Vloads_in_progress = Qnil; staticpro (&Vloads_in_progress); diff --git a/src/m/7300.h b/src/m/7300.h index fa95b3d9c4e..bb261c9188a 100644 --- a/src/m/7300.h +++ b/src/m/7300.h @@ -1,5 +1,5 @@ /* machine description file for AT&T UNIX PC model 7300 - Copyright (C) 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Modified for this machine by mtxinu!rtech!gonzo!daveb This file is part of GNU Emacs. diff --git a/src/m/acorn.h b/src/m/acorn.h index 66978329d75..399fb7c9249 100644 --- a/src/m/acorn.h +++ b/src/m/acorn.h @@ -1,5 +1,5 @@ /* Machine description file for Acorn RISCiX machines. - Copyright (C) 1994, 2002 Free Software Foundation, Inc. + Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/alliant-2800.h b/src/m/alliant-2800.h index cf0afd90bb5..b59322e3d0c 100644 --- a/src/m/alliant-2800.h +++ b/src/m/alliant-2800.h @@ -1,5 +1,5 @@ /* alliant-2800.h - Alliant FX/2800 machine running Concentrix 2800. - Copyright (C) 1990, 2002 Free Software Foundation, Inc. + Copyright (C) 1990, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/alliant.h b/src/m/alliant.h index a32e514271d..cbc5734ab31 100644 --- a/src/m/alliant.h +++ b/src/m/alliant.h @@ -1,5 +1,6 @@ /* alliant.h Alliant machine running system version 2 or 3. - Copyright (C) 1985, 1986, 1987, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. Note that for version 1 of the Alliant system you should use alliant1.h instead of this file. Use alliant4.h for version 4. diff --git a/src/m/alpha.h b/src/m/alpha.h index aff6182270f..41fefaf20fd 100644 --- a/src/m/alpha.h +++ b/src/m/alpha.h @@ -1,5 +1,6 @@ /* machine description file For the alpha chip. - Copyright (C) 1994, 1997, 1999, 2002 Free Software Foundation, Inc. + Copyright (C) 1994, 1997, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/altos.h b/src/m/altos.h index e3cf0898773..743752d99ec 100644 --- a/src/m/altos.h +++ b/src/m/altos.h @@ -1,5 +1,6 @@ /* altos machine description file Altos 3068 Unix System V Release 2 - Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/amdahl.h b/src/m/amdahl.h index 8b32a2e64d1..89d4b6cb6f7 100644 --- a/src/m/amdahl.h +++ b/src/m/amdahl.h @@ -1,5 +1,6 @@ /* amdahl machine description file - Copyright (C) 1987, 1999, 2002 Free Software Foundation, Inc. + Copyright (C) 1987, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/amdx86-64.h b/src/m/amdx86-64.h index 61b18dcc319..2d7d86ce7c3 100644 --- a/src/m/amdx86-64.h +++ b/src/m/amdx86-64.h @@ -1,5 +1,5 @@ /* machine description file for AMD x86-64. - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/apollo.h b/src/m/apollo.h index 8fa91c004c5..4aa62b0b209 100644 --- a/src/m/apollo.h +++ b/src/m/apollo.h @@ -1,5 +1,6 @@ /* machine description file for Apollo machine. - Copyright (C) 1985, 1986, 1994, 2002, Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/arm.h b/src/m/arm.h index 1ebcf3be4a4..358445e0649 100644 --- a/src/m/arm.h +++ b/src/m/arm.h @@ -1,5 +1,5 @@ /* Machine description file for ARM-based non-RISCiX machines. - Copyright (C) 1994, 2002 Free Software Foundation, Inc. + Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/att3b.h b/src/m/att3b.h index 949e6b1d01b..757b47d3f37 100644 --- a/src/m/att3b.h +++ b/src/m/att3b.h @@ -1,5 +1,5 @@ /* Machine-dependent configuration for GNU Emacs for AT&T 3b machines. - Copyright (C) 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Modified by David Robinson (daver@csvax.caltech.edu) 6/6/86 diff --git a/src/m/aviion.h b/src/m/aviion.h index 13a262423b0..b9a2932ef07 100644 --- a/src/m/aviion.h +++ b/src/m/aviion.h @@ -1,5 +1,6 @@ /* machine description file for Data General AViiON. - Copyright (C) 1985, 1986, 1991, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1991, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/celerity.h b/src/m/celerity.h index 0b0bb020122..639d680afdb 100644 --- a/src/m/celerity.h +++ b/src/m/celerity.h @@ -1,5 +1,6 @@ /* machine description file for Celerity. - Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/clipper.h b/src/m/clipper.h index 5da09e02fb8..af9f67d8a37 100644 --- a/src/m/clipper.h +++ b/src/m/clipper.h @@ -1,5 +1,6 @@ /* machine description file for clipper - Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/cnvrgnt.h b/src/m/cnvrgnt.h index cb344f98f7f..48727bedbe3 100644 --- a/src/m/cnvrgnt.h +++ b/src/m/cnvrgnt.h @@ -1,5 +1,5 @@ /* machine description file for convergent S series. - Copyright (C) 1989, 2002 Free Software Foundation, Inc. + Copyright (C) 1989, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/convex.h b/src/m/convex.h index 97b291743dc..b7fcc71b1c3 100644 --- a/src/m/convex.h +++ b/src/m/convex.h @@ -1,5 +1,6 @@ /* machine description file for Convex (all models). - Copyright (C) 1987, 1994, 2002 Free Software Foundation, Inc. + Copyright (C) 1987, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/cydra5.h b/src/m/cydra5.h index e2813dc2a4b..9806fc30a47 100644 --- a/src/m/cydra5.h +++ b/src/m/cydra5.h @@ -1,5 +1,6 @@ /* machine description file for Cydrome's CYDRA 5 mini super computer - Copyright (C) 1988, 1999, 2002 Free Software Foundation, Inc. + Copyright (C) 1988, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/delta88k.h b/src/m/delta88k.h index ab0a48a4e31..517a0f1744b 100644 --- a/src/m/delta88k.h +++ b/src/m/delta88k.h @@ -1,5 +1,6 @@ /* Machine description file for Motorola System V/88 machines - Copyright (C) 1985, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/dpx2.h b/src/m/dpx2.h index 7a24c3940d3..8d1ceb3db06 100644 --- a/src/m/dpx2.h +++ b/src/m/dpx2.h @@ -1,5 +1,6 @@ /* machine description for Bull DPX/2 range - Copyright (C) 1985, 1986, 1999, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/dual.h b/src/m/dual.h index 253c12bec52..134a5e7720e 100644 --- a/src/m/dual.h +++ b/src/m/dual.h @@ -1,5 +1,6 @@ /* machine description file for Dual machines using unisoft port. - Copyright (C) 1985 Free Software Foundation, Inc. + Copyright (C) 1985, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/elxsi.h b/src/m/elxsi.h index f8de3609690..f702dcf0de2 100644 --- a/src/m/elxsi.h +++ b/src/m/elxsi.h @@ -1,5 +1,6 @@ /* machine description file for Elxsi machine (running enix). - Copyright (C) 1986, 1992, 2002 Free Software Foundation, Inc. + Copyright (C) 1986, 1992, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. Adapted by John Salmon This file is part of GNU Emacs. diff --git a/src/m/ews4800.h b/src/m/ews4800.h index dcb46bf83d8..b377bdeddaa 100644 --- a/src/m/ews4800.h +++ b/src/m/ews4800.h @@ -1,5 +1,6 @@ /* m- file for NEC EWS4800 RISC series. - Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/gould-np1.h b/src/m/gould-np1.h index 4a267865085..1c784f28f4e 100644 --- a/src/m/gould-np1.h +++ b/src/m/gould-np1.h @@ -1,5 +1,5 @@ /* machine description file for Gould NP1 with UTX/32 3.0 (first release for NP1) - Copyright (C) 1986 Free Software Foundation, Inc. + Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/hp800.h b/src/m/hp800.h index 64243f4be31..2f661989a15 100644 --- a/src/m/hp800.h +++ b/src/m/hp800.h @@ -1,5 +1,5 @@ /* machine description file for hp9000 series 800 machines. - Copyright (C) 1987, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1987, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/hp9000s300.h b/src/m/hp9000s300.h index 8886aec204c..e0b3a5ce5c3 100644 --- a/src/m/hp9000s300.h +++ b/src/m/hp9000s300.h @@ -1,5 +1,5 @@ /* machine description file for hp9000 series 200 or 300 on either HPUX or BSD. - Copyright (C) 1985, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/i860.h b/src/m/i860.h index 66ca2b8fa66..0ecf9e62087 100644 --- a/src/m/i860.h +++ b/src/m/i860.h @@ -1,5 +1,6 @@ /* machine description file for i860. - Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/ia64.h b/src/m/ia64.h index 33d843c773f..af790946afa 100644 --- a/src/m/ia64.h +++ b/src/m/ia64.h @@ -1,5 +1,5 @@ /* machine description file for the IA-64 architecture. - Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by David Mosberger <davidm@hpl.hp.com> This file is part of GNU Emacs. diff --git a/src/m/ibm370aix.h b/src/m/ibm370aix.h index b958656c3e4..3d954ae9d19 100644 --- a/src/m/ibm370aix.h +++ b/src/m/ibm370aix.h @@ -1,5 +1,6 @@ /* m/ file for IBM 370 running AIX. - Copyright (C) 1993, 1994, 2001 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/ibmps2-aix.h b/src/m/ibmps2-aix.h index d2202d65472..539de924d17 100644 --- a/src/m/ibmps2-aix.h +++ b/src/m/ibmps2-aix.h @@ -1,5 +1,5 @@ /* machine description file for ibm ps/2 aix386. - Copyright (C) 1989, 2002 Free Software Foundation, Inc. + Copyright (C) 1989, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/ibmrs6000.h b/src/m/ibmrs6000.h index b76d03bc0b7..9559f1ae62a 100644 --- a/src/m/ibmrs6000.h +++ b/src/m/ibmrs6000.h @@ -1,5 +1,5 @@ /* R2 AIX machine/system dependent defines - Copyright (C) 1988, 2002 Free Software Foundation, Inc. + Copyright (C) 1988, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/ibmrt-aix.h b/src/m/ibmrt-aix.h index b9ea0e6208f..44bfd77c1d0 100644 --- a/src/m/ibmrt-aix.h +++ b/src/m/ibmrt-aix.h @@ -1,5 +1,6 @@ /* RTPC AIX machine/system dependent defines - Copyright (C) 1988, 1999, 2002 Free Software Foundation, Inc. + Copyright (C) 1988, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/ibmrt.h b/src/m/ibmrt.h index 1388a46b001..f6c23d9d919 100644 --- a/src/m/ibmrt.h +++ b/src/m/ibmrt.h @@ -1,5 +1,5 @@ /* RTPC machine dependent defines - Copyright (C) 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/ibms390.h b/src/m/ibms390.h index af7fbb8dfbf..323ef33f633 100644 --- a/src/m/ibms390.h +++ b/src/m/ibms390.h @@ -1,5 +1,6 @@ /* machine description file template. - Copyright (C) 1985, 1986, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/intel386.h b/src/m/intel386.h index c63dae7af0b..238015fd345 100644 --- a/src/m/intel386.h +++ b/src/m/intel386.h @@ -1,5 +1,5 @@ /* Machine description file for intel 386. - Copyright (C) 1987, 2002 Free Software Foundation, Inc. + Copyright (C) 1987, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/iris4d.h b/src/m/iris4d.h index a13a6f8c2ff..93fe2062674 100644 --- a/src/m/iris4d.h +++ b/src/m/iris4d.h @@ -1,5 +1,5 @@ /* machine description file for Iris-4D machines. Use with s/irix*.h. - Copyright (C) 1987, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1987, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/irist.h b/src/m/irist.h index 71726977b23..b40ffb5dff9 100644 --- a/src/m/irist.h +++ b/src/m/irist.h @@ -1,6 +1,7 @@ /* machine description file for Silicon Graphics Iris 2500 Turbos; also possibly for non-turbo Irises with system release 2.5. - Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/isi-ov.h b/src/m/isi-ov.h index 9b35f03ea70..416335d1bff 100644 --- a/src/m/isi-ov.h +++ b/src/m/isi-ov.h @@ -1,5 +1,6 @@ /* machine description file for ISI 68000's - Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/m68k.h b/src/m/m68k.h index 9fdcf1511b8..7b2ffa81351 100644 --- a/src/m/m68k.h +++ b/src/m/m68k.h @@ -1,5 +1,6 @@ /* Machine description file for generic Motorola 68k. - Copyright (C) 1985, 1995, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1995, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/macppc.h b/src/m/macppc.h index 36022af3e52..9e4297df3b7 100644 --- a/src/m/macppc.h +++ b/src/m/macppc.h @@ -1,5 +1,6 @@ /* machine description file For the powerpc Macintosh. - Copyright (C) 1994, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1994, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/masscomp.h b/src/m/masscomp.h index 4582e29b6bd..01fddc751f1 100644 --- a/src/m/masscomp.h +++ b/src/m/masscomp.h @@ -1,5 +1,5 @@ /* machine description file for Masscomp 5000 series running RTU, ucb universe. - Copyright (C) 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/mega68.h b/src/m/mega68.h index ba7ee6b48d4..ef1623ca460 100644 --- a/src/m/mega68.h +++ b/src/m/mega68.h @@ -1,5 +1,5 @@ /* machine description file for Megatest 68000's. - Copyright (C) 1985 Free Software Foundation, Inc. + Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/mg1.h b/src/m/mg1.h index 47d34f43768..4e4b3525d6e 100644 --- a/src/m/mg1.h +++ b/src/m/mg1.h @@ -1,5 +1,5 @@ /* machine description file for Whitechapel Computer Works MG1 (ns16000 based). - Copyright (C) 1985, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. MG-1 version by L.M.McLoughlin This file is part of GNU Emacs. diff --git a/src/m/mips-siemens.h b/src/m/mips-siemens.h index f00790210c9..fc1a8a2e0d6 100644 --- a/src/m/mips-siemens.h +++ b/src/m/mips-siemens.h @@ -1,5 +1,6 @@ /* m- file for Mips machines. - Copyright (C) 1987,1992,1993,95,2002,03 Free Software Foundation, Inc. + Copyright (C) 1987, 1992, 1993, 1995, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file contains some changes for our SVR4 based SINIX-Mips 5.4. I hope this is helpful to port the emacs to our RM?00 series and diff --git a/src/m/mips.h b/src/m/mips.h index e868423642c..28a35e02677 100644 --- a/src/m/mips.h +++ b/src/m/mips.h @@ -1,5 +1,6 @@ /* m- file for Mips machines. - Copyright (C) 1987, 1992, 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1987, 1992, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/news.h b/src/m/news.h index 1d2585c09a0..dec413c3f9e 100644 --- a/src/m/news.h +++ b/src/m/news.h @@ -1,5 +1,6 @@ /* machine description file for Sony's NEWS workstations, NEWS-OS 3.0. - Copyright (C) 1985, 1986, 1989, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1989, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/next.h b/src/m/next.h index 2f2952e10f4..dfb3cd11cbf 100644 --- a/src/m/next.h +++ b/src/m/next.h @@ -1,5 +1,5 @@ /* Configuration file for the NeXT machine. - Copyright (C) 1990, 2002 Free Software Foundation, Inc. + Copyright (C) 1990, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/nh3000.h b/src/m/nh3000.h index 7be5c5dc7db..42255473020 100644 --- a/src/m/nh3000.h +++ b/src/m/nh3000.h @@ -1,7 +1,7 @@ /* machine description for Harris Night Hawk Series 1200 and Series 3000 MC68030-based systems (FPP on these is custom). These systems are also known as "ecx" and "gcx". - Copyright (C) 1994, 2002 Free Software Foundation, Inc. + Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/nh4000.h b/src/m/nh4000.h index 3d8794b2802..04068f0c065 100644 --- a/src/m/nh4000.h +++ b/src/m/nh4000.h @@ -1,6 +1,6 @@ /* machine description for Harris NightHawk 88k based machines (includes nh4000 and nh5000 machines). - Copyright (C) 1994, 2002 Free Software Foundation, Inc. + Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/ns16000.h b/src/m/ns16000.h index 07fff86502b..49f514ced06 100644 --- a/src/m/ns16000.h +++ b/src/m/ns16000.h @@ -1,5 +1,5 @@ /* machine description file for ns16000. - Copyright (C) 1985 Free Software Foundation, Inc. + Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/ns32000.h b/src/m/ns32000.h index 9a135fe2d9f..858630b74ab 100644 --- a/src/m/ns32000.h +++ b/src/m/ns32000.h @@ -1,5 +1,6 @@ /* machine description file for National Semiconductor 32000, running Genix. - Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/nu.h b/src/m/nu.h index 8ca03155314..1e5518e451f 100644 --- a/src/m/nu.h +++ b/src/m/nu.h @@ -1,5 +1,5 @@ /* machine description file for TI Nu machines using system V. - Copyright (C) 1986 Free Software Foundation, Inc. + Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/orion.h b/src/m/orion.h index e4fa8529664..a73b357d50f 100644 --- a/src/m/orion.h +++ b/src/m/orion.h @@ -1,5 +1,5 @@ /* machine description file for HLH Orion. - Copyright (C) 1985, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/orion105.h b/src/m/orion105.h index d0adaba70ec..e75a8e67a84 100644 --- a/src/m/orion105.h +++ b/src/m/orion105.h @@ -1,5 +1,5 @@ /* machine description file for HLH Orion 1/05 (Clipper). - Copyright (C) 1985 Free Software Foundation, Inc. + Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Lee McLoughlin <lmjm%doc.imperial.ac.uk@nss.cs.ucl.ac.uk> This file is part of GNU Emacs. diff --git a/src/m/pfa50.h b/src/m/pfa50.h index be430d25fdc..50e79b623ca 100644 --- a/src/m/pfa50.h +++ b/src/m/pfa50.h @@ -1,5 +1,6 @@ /* Machine description file for PFU A-series. - Copyright (C) 1988, 1999, 2002 Free Software Foundation, Inc. + Copyright (C) 1988, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/plexus.h b/src/m/plexus.h index a2f6cc545a0..10826a70bc2 100644 --- a/src/m/plexus.h +++ b/src/m/plexus.h @@ -1,5 +1,5 @@ /* machine description file for the Plexus running System V.2. - Copyright (C) 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/powermac.h b/src/m/powermac.h index c41003ae61c..14b2e110734 100644 --- a/src/m/powermac.h +++ b/src/m/powermac.h @@ -1,5 +1,5 @@ /* Machine description file for Apple Power Macintosh - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/powerpcle.h b/src/m/powerpcle.h index 34096a37d18..1dfd2df25b4 100644 --- a/src/m/powerpcle.h +++ b/src/m/powerpcle.h @@ -1,5 +1,5 @@ /* machine description file for PowerPC. - Copyright (C) 1987, 2002 Free Software Foundation, Inc. + Copyright (C) 1987, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/pyramid.h b/src/m/pyramid.h index 7e0db61ec59..12010087a58 100644 --- a/src/m/pyramid.h +++ b/src/m/pyramid.h @@ -1,5 +1,6 @@ /* machine description file for pyramid. - Copyright (C) 1985, 1986 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/sequent-ptx.h b/src/m/sequent-ptx.h index 57d255a861e..3c22639e3b2 100644 --- a/src/m/sequent-ptx.h +++ b/src/m/sequent-ptx.h @@ -1,5 +1,6 @@ /* machine description file for SEQUENT machines running DYNIX/ptx - Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/sequent.h b/src/m/sequent.h index 7c572f54f68..f082880b4fc 100644 --- a/src/m/sequent.h +++ b/src/m/sequent.h @@ -1,5 +1,6 @@ /* machine description file for SEQUENT BALANCE machines - Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/sparc.h b/src/m/sparc.h index 6926aced07b..20ec53c1344 100644 --- a/src/m/sparc.h +++ b/src/m/sparc.h @@ -1,5 +1,5 @@ /* machine description file for Sun 4 SPARC. - Copyright (C) 1987, 2002 Free Software Foundation, Inc. + Copyright (C) 1987, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/sps7.h b/src/m/sps7.h index 3bd0c94bccd..422d2470aaa 100644 --- a/src/m/sps7.h +++ b/src/m/sps7.h @@ -1,5 +1,6 @@ /* machine description file for Bull SPS-7. - Copyright (C) 1986, 1999 Free Software Foundation, Inc. + Copyright (C) 1986, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/sr2k.h b/src/m/sr2k.h index 83dbf4941ff..875f428dc1f 100644 --- a/src/m/sr2k.h +++ b/src/m/sr2k.h @@ -1,5 +1,5 @@ /* machine description file for Hitachi SR2001/SR2201 machines. - Copyright (C) 1996, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1996, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/stride.h b/src/m/stride.h index f176a7642a7..ff900d49b38 100644 --- a/src/m/stride.h +++ b/src/m/stride.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on Stride Micro System-V.2.2 - Copyright (C) 1985, 1986, 1999 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/sun1.h b/src/m/sun1.h index 7ab81218705..810bad7fd58 100644 --- a/src/m/sun1.h +++ b/src/m/sun1.h @@ -1,5 +1,6 @@ /* machine description file for Sun 68000's - Copyright (C) 1985, 1986 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/sun2.h b/src/m/sun2.h index 452fdfc7c01..9df032049e3 100644 --- a/src/m/sun2.h +++ b/src/m/sun2.h @@ -1,7 +1,8 @@ /* machine description file for Sun 68000's OPERATING SYSTEM version 2. Note that "sun2.h" refers to the operating system version, not the CPU model number. See the MACHINES file for details. - Copyright (C) 1985, 1986 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/sun386.h b/src/m/sun386.h index 782e10925ef..5970f90b98b 100644 --- a/src/m/sun386.h +++ b/src/m/sun386.h @@ -2,7 +2,7 @@ "sun2.h", but since that file is heavily cpu-specific, it was easier not to include it. - Copyright (C) 1988 Free Software Foundation, Inc. + Copyright (C) 1988, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/symmetry.h b/src/m/symmetry.h index 262d6474757..4954f596442 100644 --- a/src/m/symmetry.h +++ b/src/m/symmetry.h @@ -1,5 +1,6 @@ /* machine description file for SEQUENT SYMMETRY machines - Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/tad68k.h b/src/m/tad68k.h index 4c904aaf569..b8b3859f407 100644 --- a/src/m/tad68k.h +++ b/src/m/tad68k.h @@ -1,5 +1,5 @@ /* Machine-dependent configuration for GNU Emacs for Tadpole 68k machines - Copyright (C) 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/tahoe.h b/src/m/tahoe.h index 988624839b4..47db3f93deb 100644 --- a/src/m/tahoe.h +++ b/src/m/tahoe.h @@ -1,5 +1,5 @@ /* machine description file for tahoe. - Copyright (C) 1985, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/targon31.h b/src/m/targon31.h index 08ecb681bd9..5ac18648387 100644 --- a/src/m/targon31.h +++ b/src/m/targon31.h @@ -1,5 +1,6 @@ /* targon31 machine description file - Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/tek4300.h b/src/m/tek4300.h index 164df72210a..a84135291cb 100644 --- a/src/m/tek4300.h +++ b/src/m/tek4300.h @@ -1,5 +1,5 @@ /* machine description file for tek4300. - Copyright (C) 1988, 2002 Free Software Foundation, Inc. + Copyright (C) 1988, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/tekxd88.h b/src/m/tekxd88.h index 7af3dab6a07..4db981a8096 100644 --- a/src/m/tekxd88.h +++ b/src/m/tekxd88.h @@ -1,7 +1,7 @@ /* Configuration file for the Tektronix XD88 running UTekV 3.2e, contributed by Kaveh Ghazi (ghazi@caip.rutgers.edu) 1/15/93. You probably need to use gnu make (version 3.63 or higher.) - Copyright (C) 1993, 2002 Free Software Foundation, Inc. + Copyright (C) 1993, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/template.h b/src/m/template.h index c088efff81a..c7ce2c2cb1f 100644 --- a/src/m/template.h +++ b/src/m/template.h @@ -1,5 +1,6 @@ /* machine description file template. - Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/tower32.h b/src/m/tower32.h index c5f34d065ea..cd4ab96de11 100644 --- a/src/m/tower32.h +++ b/src/m/tower32.h @@ -1,5 +1,5 @@ /* machine description file for the NCR Tower 32 running System V.2. - Copyright (C) 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/tower32v3.h b/src/m/tower32v3.h index 927dfca93d9..2c1e55c0023 100644 --- a/src/m/tower32v3.h +++ b/src/m/tower32v3.h @@ -1,5 +1,5 @@ /* machine description file for the NCR Tower 32 running System V.3. - Copyright (C) 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/ustation.h b/src/m/ustation.h index e7068f3cd86..c62d37d6429 100644 --- a/src/m/ustation.h +++ b/src/m/ustation.h @@ -1,5 +1,6 @@ /* machine description file for U-station (Nihon Unisys, SS5E; Sumitomo Denkoh, U-Station E30). - Copyright (C) 1986, 1999, 2002 Free Software Foundation, Inc. + Copyright (C) 1986, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/vax.h b/src/m/vax.h index 22fda95abc5..d414d6b57e7 100644 --- a/src/m/vax.h +++ b/src/m/vax.h @@ -1,5 +1,6 @@ /* machine description file for vax. - Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/wicat.h b/src/m/wicat.h index bd8fcefe99c..78842f32a43 100644 --- a/src/m/wicat.h +++ b/src/m/wicat.h @@ -1,5 +1,5 @@ /* machine description file for WICAT machines. - Copyright (C) 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/windowsnt.h b/src/m/windowsnt.h index 39c7baa9de6..cf48ca8aa88 100644 --- a/src/m/windowsnt.h +++ b/src/m/windowsnt.h @@ -1,6 +1,7 @@ /* Machine description file for Windows NT. - Copyright (C) 1993, 1994, 2002 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/m/xps100.h b/src/m/xps100.h index c6e54710bd6..3a851aa9ebd 100644 --- a/src/m/xps100.h +++ b/src/m/xps100.h @@ -1,7 +1,8 @@ /* xps100.h for the Honeywell XPS100 running UNIX System V.2 Mark J. Hewitt (mjh@uk.co.kernel) - Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/mac.c b/src/mac.c index ef136ab6512..0d8c99ffb1e 100644 --- a/src/mac.c +++ b/src/mac.c @@ -1,5 +1,6 @@ /* Unix emulation routines for GNU Emacs on the Mac OS. - Copyright (C) 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -34,10 +35,9 @@ Boston, MA 02110-1301, USA. */ #include "macterm.h" -#if TARGET_API_MAC_CARBON #include "charset.h" #include "coding.h" -#else /* not TARGET_API_MAC_CARBON */ +#if !TARGET_API_MAC_CARBON #include <Files.h> #include <MacTypes.h> #include <TextUtils.h> @@ -53,17 +53,16 @@ Boston, MA 02110-1301, USA. */ #include <Processes.h> #include <EPPC.h> #include <MacLocales.h> +#include <Endian.h> #endif /* not TARGET_API_MAC_CARBON */ #include <utime.h> #include <dirent.h> #include <sys/types.h> #include <sys/stat.h> -#include <string.h> #include <pwd.h> #include <grp.h> #include <sys/param.h> -#include <stdlib.h> #include <fcntl.h> #if __MWERKS__ #include <unistd.h> @@ -1021,7 +1020,7 @@ xrm_cfproperty_list_to_value (plist) CFTypeID type_id = CFGetTypeID (plist); if (type_id == CFStringGetTypeID ()) - return cfstring_to_lisp (plist); + return cfstring_to_lisp (plist); else if (type_id == CFNumberGetTypeID ()) { CFStringRef string; @@ -2490,6 +2489,22 @@ chmod (const char *path, mode_t mode) int +fchmod (int fd, mode_t mode) +{ + /* say it always succeed for now */ + return 0; +} + + +int +fchown (int fd, uid_t owner, gid_t group) +{ + /* say it always succeed for now */ + return 0; +} + + +int dup (int oldd) { #ifdef __MRC__ @@ -3388,12 +3403,278 @@ initialize_applescript () } -void terminate_applescript() +void +terminate_applescript() { OSADispose (as_scripting_component, as_script_context); CloseComponent (as_scripting_component); } +/* Convert a lisp string to the 4 byte character code. */ + +OSType +mac_get_code_from_arg(Lisp_Object arg, OSType defCode) +{ + OSType result; + if (NILP(arg)) + { + result = defCode; + } + else + { + /* check type string */ + CHECK_STRING(arg); + if (SBYTES (arg) != 4) + { + error ("Wrong argument: need string of length 4 for code"); + } + result = EndianU32_BtoN (*((UInt32 *) SDATA (arg))); + } + return result; +} + +/* Convert the 4 byte character code into a 4 byte string. */ + +Lisp_Object +mac_get_object_from_code(OSType defCode) +{ + UInt32 code = EndianU32_NtoB (defCode); + + return make_unibyte_string ((char *)&code, 4); +} + + +DEFUN ("mac-get-file-creator", Fmac_get_file_creator, Smac_get_file_creator, 1, 1, 0, + doc: /* Get the creator code of FILENAME as a four character string. */) + (filename) + Lisp_Object filename; +{ + OSErr status; +#ifdef MAC_OSX + FSRef fref; +#else + FSSpec fss; +#endif + OSType cCode; + Lisp_Object result = Qnil; + CHECK_STRING (filename); + + if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) { + return Qnil; + } + filename = Fexpand_file_name (filename, Qnil); + + BLOCK_INPUT; +#ifdef MAC_OSX + status = FSPathMakeRef(SDATA(ENCODE_FILE(filename)), &fref, NULL); +#else + status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (filename)), &fss); +#endif + + if (status == noErr) + { +#ifdef MAC_OSX + FSCatalogInfo catalogInfo; + + status = FSGetCatalogInfo(&fref, kFSCatInfoFinderInfo, + &catalogInfo, NULL, NULL, NULL); +#else + FInfo finder_info; + + status = FSpGetFInfo (&fss, &finder_info); +#endif + if (status == noErr) + { +#ifdef MAC_OSX + result = mac_get_object_from_code(((FileInfo*)&catalogInfo.finderInfo)->fileCreator); +#else + result = mac_get_object_from_code (finder_info.fdCreator); +#endif + } + } + UNBLOCK_INPUT; + if (status != noErr) { + error ("Error while getting file information."); + } + return result; +} + +DEFUN ("mac-get-file-type", Fmac_get_file_type, Smac_get_file_type, 1, 1, 0, + doc: /* Get the type code of FILENAME as a four character string. */) + (filename) + Lisp_Object filename; +{ + OSErr status; +#ifdef MAC_OSX + FSRef fref; +#else + FSSpec fss; +#endif + OSType cCode; + Lisp_Object result = Qnil; + CHECK_STRING (filename); + + if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) { + return Qnil; + } + filename = Fexpand_file_name (filename, Qnil); + + BLOCK_INPUT; +#ifdef MAC_OSX + status = FSPathMakeRef(SDATA(ENCODE_FILE(filename)), &fref, NULL); +#else + status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (filename)), &fss); +#endif + + if (status == noErr) + { +#ifdef MAC_OSX + FSCatalogInfo catalogInfo; + + status = FSGetCatalogInfo(&fref, kFSCatInfoFinderInfo, + &catalogInfo, NULL, NULL, NULL); +#else + FInfo finder_info; + + status = FSpGetFInfo (&fss, &finder_info); +#endif + if (status == noErr) + { +#ifdef MAC_OSX + result = mac_get_object_from_code(((FileInfo*)&catalogInfo.finderInfo)->fileType); +#else + result = mac_get_object_from_code (finder_info.fdType); +#endif + } + } + UNBLOCK_INPUT; + if (status != noErr) { + error ("Error while getting file information."); + } + return result; +} + +DEFUN ("mac-set-file-creator", Fmac_set_file_creator, Smac_set_file_creator, 1, 2, 0, + doc: /* Set creator code of file FILENAME to CODE. +If non-nil, CODE must be a 4-character string. Otherwise, 'EMAx' is +assumed. Return non-nil if successful. */) + (filename, code) + Lisp_Object filename, code; +{ + OSErr status; +#ifdef MAC_OSX + FSRef fref; +#else + FSSpec fss; +#endif + OSType cCode; + CHECK_STRING (filename); + + cCode = mac_get_code_from_arg(code, 'EMAx'); + + if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) { + return Qnil; + } + filename = Fexpand_file_name (filename, Qnil); + + BLOCK_INPUT; +#ifdef MAC_OSX + status = FSPathMakeRef(SDATA(ENCODE_FILE(filename)), &fref, NULL); +#else + status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (filename)), &fss); +#endif + + if (status == noErr) + { +#ifdef MAC_OSX + FSCatalogInfo catalogInfo; + FSRef parentDir; + status = FSGetCatalogInfo(&fref, kFSCatInfoFinderInfo, + &catalogInfo, NULL, NULL, &parentDir); +#else + FInfo finder_info; + + status = FSpGetFInfo (&fss, &finder_info); +#endif + if (status == noErr) + { +#ifdef MAC_OSX + ((FileInfo*)&catalogInfo.finderInfo)->fileCreator = cCode; + status = FSSetCatalogInfo(&fref, kFSCatInfoFinderInfo, &catalogInfo); + /* TODO: on Mac OS 10.2, we need to touch the parent dir, FNNotify? */ +#else + finder_info.fdCreator = cCode; + status = FSpSetFInfo (&fss, &finder_info); +#endif + } + } + UNBLOCK_INPUT; + if (status != noErr) { + error ("Error while setting creator information."); + } + return Qt; +} + +DEFUN ("mac-set-file-type", Fmac_set_file_type, Smac_set_file_type, 2, 2, 0, + doc: /* Set file code of file FILENAME to CODE. +CODE must be a 4-character string. Return non-nil if successful. */) + (filename, code) + Lisp_Object filename, code; +{ + OSErr status; +#ifdef MAC_OSX + FSRef fref; +#else + FSSpec fss; +#endif + OSType cCode; + CHECK_STRING (filename); + + cCode = mac_get_code_from_arg(code, 0); /* Default to empty code*/ + + if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) { + return Qnil; + } + filename = Fexpand_file_name (filename, Qnil); + + BLOCK_INPUT; +#ifdef MAC_OSX + status = FSPathMakeRef(SDATA(ENCODE_FILE(filename)), &fref, NULL); +#else + status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (filename)), &fss); +#endif + + if (status == noErr) + { +#ifdef MAC_OSX + FSCatalogInfo catalogInfo; + FSRef parentDir; + status = FSGetCatalogInfo(&fref, kFSCatInfoFinderInfo, + &catalogInfo, NULL, NULL, &parentDir); +#else + FInfo finder_info; + + status = FSpGetFInfo (&fss, &finder_info); +#endif + if (status == noErr) + { +#ifdef MAC_OSX + ((FileInfo*)&catalogInfo.finderInfo)->fileType = cCode; + status = FSSetCatalogInfo(&fref, kFSCatInfoFinderInfo, &catalogInfo); + /* TODO: on Mac OS 10.2, we need to touch the parent dir, FNNotify? */ +#else + finder_info.fdType = cCode; + status = FSpSetFInfo (&fss, &finder_info); +#endif + } + } + UNBLOCK_INPUT; + if (status != noErr) { + error ("Error while setting creator information."); + } + return Qt; +} + /* Compile and execute the AppleScript SCRIPT and return the error status as function value. A zero is returned if compilation and @@ -3484,12 +3765,12 @@ do_applescript (char *script, char **result) DEFUN ("do-applescript", Fdo_applescript, Sdo_applescript, 1, 1, 0, - doc: /* Compile and execute AppleScript SCRIPT and retrieve and return the result. + doc: /* Compile and execute AppleScript SCRIPT and return the result. If compilation and execution are successful, the resulting script value is returned as a string. Otherwise the function aborts and displays the error message returned by the AppleScript scripting component. */) - (script) + (script) Lisp_Object script; { char *result, *temp; @@ -3529,16 +3810,15 @@ component. */) DEFUN ("mac-file-name-to-posix", Fmac_file_name_to_posix, Smac_file_name_to_posix, 1, 1, 0, - doc: /* Convert Macintosh filename to Posix form. */) - (mac_filename) - Lisp_Object mac_filename; + doc: /* Convert Macintosh FILENAME to Posix form. */) + (filename) + Lisp_Object filename; { char posix_filename[MAXPATHLEN+1]; - CHECK_STRING (mac_filename); + CHECK_STRING (filename); - if (mac_to_posix_pathname (SDATA (mac_filename), posix_filename, - MAXPATHLEN)) + if (mac_to_posix_pathname (SDATA (filename), posix_filename, MAXPATHLEN)) return build_string (posix_filename); else return Qnil; @@ -3547,16 +3827,15 @@ DEFUN ("mac-file-name-to-posix", Fmac_file_name_to_posix, DEFUN ("posix-file-name-to-mac", Fposix_file_name_to_mac, Sposix_file_name_to_mac, 1, 1, 0, - doc: /* Convert Posix filename to Mac form. */) - (posix_filename) - Lisp_Object posix_filename; + doc: /* Convert Posix FILENAME to Mac form. */) + (filename) + Lisp_Object filename; { char mac_filename[MAXPATHLEN+1]; - CHECK_STRING (posix_filename); + CHECK_STRING (filename); - if (posix_to_mac_pathname (SDATA (posix_filename), mac_filename, - MAXPATHLEN)) + if (posix_to_mac_pathname (SDATA (filename), mac_filename, MAXPATHLEN)) return build_string (mac_filename); else return Qnil; @@ -3571,8 +3850,8 @@ DEFUN ("mac-get-preference", Fmac_get_preference, Smac_get_preference, 1, 4, 0, doc: /* Return the application preference value for KEY. KEY is either a string specifying a preference key, or a list of key strings. If it is a list, the (i+1)-th element is used as a key for -the CFDictionary value obtained by the i-th element. If lookup is -failed at some stage, nil is returned. +the CFDictionary value obtained by the i-th element. Return nil if +lookup is failed at some stage. Optional arg APPLICATION is an application ID string. If omitted or nil, that stands for the current application. @@ -3603,7 +3882,7 @@ CFDictionary. If HASH-BOUND is a negative integer or nil, always generate alists. If HASH-BOUND >= 0, generate an alist if the number of keys in the dictionary is smaller than HASH-BOUND, and a hash table otherwise. */) - (key, application, format, hash_bound) + (key, application, format, hash_bound) Lisp_Object key, application, format, hash_bound; { CFStringRef app_id, key_str; @@ -3840,9 +4119,8 @@ charset string, or an integer as a CFStringEncoding value. On Mac OS X 10.2 and later, you can do Unicode Normalization by specifying the optional argument NORMALIZATION-FORM with a symbol NFD, NFKD, NFC, NFKC, HFS+D, or HFS+C. -On successful conversion, returns the result string, else returns -nil. */) - (string, source, target, normalization_form) +On successful conversion, return the result string, else return nil. */) + (string, source, target, normalization_form) Lisp_Object string, source, target, normalization_form; { Lisp_Object result = Qnil; @@ -3862,7 +4140,11 @@ nil. */) src_encoding = get_cfstring_encoding_from_lisp (source); tgt_encoding = get_cfstring_encoding_from_lisp (target); - string = string_make_unibyte (string); + /* We really want string_to_unibyte, but since it doesn't exist yet, we + use string_as_unibyte which works as well, except for the fact that + it's too permissive (it doesn't check that the multibyte string only + contain single-byte chars). */ + string = Fstring_as_unibyte (string); if (src_encoding != kCFStringEncodingInvalidId && tgt_encoding != kCFStringEncodingInvalidId) str = CFStringCreateWithBytes (NULL, SDATA (string), SBYTES (string), @@ -3897,7 +4179,7 @@ nil. */) DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table, Smac_clear_font_name_table, 0, 0, 0, doc: /* Clear the font name table. */) - () + () { check_mac (); mac_clear_font_name_table (); @@ -4197,8 +4479,13 @@ init_mac_osx_environment () app_bundle_pathname. */ bundle = CFBundleGetMainBundle (); - if (!bundle) - return; + if (!bundle || CFBundleGetIdentifier (bundle) == NULL) + { + /* We could not find the bundle identifier. For now, prevent + the fatal error by bringing it up in the terminal. */ + inhibit_window_system = 1; + return; + } bundleURL = CFBundleCopyBundleURL (bundle); if (!bundleURL) @@ -4361,6 +4648,10 @@ syms_of_mac () #endif defsubr (&Smac_clear_font_name_table); + defsubr (&Smac_set_file_creator); + defsubr (&Smac_set_file_type); + defsubr (&Smac_get_file_creator); + defsubr (&Smac_get_file_type); defsubr (&Sdo_applescript); defsubr (&Smac_file_name_to_posix); defsubr (&Sposix_file_name_to_mac); diff --git a/src/macfns.c b/src/macfns.c index b9f7e2bed5f..160eb1f7774 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -1,5 +1,5 @@ /* Graphical user interface functions for Mac OS. - Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -21,58 +21,34 @@ Boston, MA 02110-1301, USA. */ /* Contributed by Andrew Choi (akochoi@mac.com). */ #include <config.h> - #include <stdio.h> #include <math.h> -#include <limits.h> -#include <errno.h> #include "lisp.h" -#include "charset.h" #include "macterm.h" #include "frame.h" #include "window.h" #include "buffer.h" -#include "dispextern.h" -#include "fontset.h" #include "intervals.h" +#include "dispextern.h" #include "keyboard.h" #include "blockinput.h" -#include "epaths.h" -#include "termhooks.h" +#include <epaths.h> +#include "charset.h" #include "coding.h" +#include "fontset.h" #include "systime.h" +#include "termhooks.h" +#include "atimer.h" -/* #include "bitmaps/gray.xbm" */ -#define gray_width 2 -#define gray_height 2 -static unsigned char gray_bits[] = { - 0x01, 0x02}; - -/*#include <commdlg.h> -#include <shellapi.h>*/ #include <ctype.h> #include <sys/types.h> #include <sys/stat.h> +#include <limits.h> +#include <errno.h> #include <sys/param.h> -#include <stdlib.h> -#include <string.h> - -/*extern void free_frame_menubar (); -extern double atof (); -extern int w32_console_toggle_lock_key (int vk_code, Lisp_Object new_state); -extern int quit_char;*/ - -extern char *lispy_function_keys[]; - -/* The gray bitmap `bitmaps/gray'. This is done because macterm.c uses - it, and including `bitmaps/gray' more than once is a problem when - config.h defines `static' as an empty replacement string. */ - -int gray_bitmap_width = gray_width; -int gray_bitmap_height = gray_height; -unsigned char *gray_bitmap_bits = gray_bits; +extern void free_frame_menubar (); /* Non-zero means we're allowed to display an hourglass cursor. */ @@ -109,46 +85,13 @@ Lisp_Object Vx_no_window_manager; Lisp_Object Vx_pixel_size_width_font_regexp; -/* Evaluate this expression to rebuild the section of syms_of_macfns - that initializes and staticpros the symbols declared below. Note - that Emacs 18 has a bug that keeps C-x C-e from being able to - evaluate this expression. - -(progn - ;; Accumulate a list of the symbols we want to initialize from the - ;; declarations at the top of the file. - (goto-char (point-min)) - (search-forward "/\*&&& symbols declared here &&&*\/\n") - (let (symbol-list) - (while (looking-at "Lisp_Object \\(Q[a-z_]+\\)") - (setq symbol-list - (cons (buffer-substring (match-beginning 1) (match-end 1)) - symbol-list)) - (forward-line 1)) - (setq symbol-list (nreverse symbol-list)) - ;; Delete the section of syms_of_... where we initialize the symbols. - (search-forward "\n /\*&&& init symbols here &&&*\/\n") - (let ((start (point))) - (while (looking-at "^ Q") - (forward-line 2)) - (kill-region start (point))) - ;; Write a new symbol initialization section. - (while symbol-list - (insert (format " %s = intern (\"" (car symbol-list))) - (let ((start (point))) - (insert (substring (car symbol-list) 1)) - (subst-char-in-region start (point) ?_ ?-)) - (insert (format "\");\n staticpro (&%s);\n" (car symbol-list))) - (setq symbol-list (cdr symbol-list))))) - - */ - -/*&&& symbols declared here &&&*/ Lisp_Object Qnone; Lisp_Object Qsuppress_icon; Lisp_Object Qundefined_color; Lisp_Object Qcancel_timer; +/* In dispnew.c */ + extern Lisp_Object Vwindow_system_version; #if 0 /* Use xstricmp instead. */ @@ -243,40 +186,11 @@ check_x_display_info (frame) return dpyinfo; } - -/* Return the Emacs frame-object corresponding to a mac window. - It could be the frame's main window or an icon window. */ - -/* This function can be called during GC, so use GC_xxx type test macros. */ - -struct frame * -x_window_to_frame (dpyinfo, wdesc) - struct mac_display_info *dpyinfo; - WindowPtr wdesc; -{ - Lisp_Object tail, frame; - struct frame *f; - - for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) - { - frame = XCAR (tail); - if (!GC_FRAMEP (frame)) - continue; - f = XFRAME (frame); - if (!FRAME_W32_P (f) || FRAME_MAC_DISPLAY_INFO (f) != dpyinfo) - continue; - /*if (f->output_data.w32->hourglass_window == wdesc) - return f;*/ - - /* MAC_TODO: Check tooltips when supported. */ - if (FRAME_MAC_WINDOW (f) == wdesc) - return f; - } - return 0; -} + static Lisp_Object unwind_create_frame P_ ((Lisp_Object)); +static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object)); void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); @@ -302,6 +216,8 @@ static Lisp_Object x_default_scroll_bar_color_parameter P_ ((struct frame *, extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *)); + + /* Store the screen positions of frame F into XPTR and YPTR. These are the positions of the containing window manager window, not Emacs's own window. */ @@ -1570,9 +1486,10 @@ x_set_cursor_color (f, arg, oldval) { BLOCK_INPUT; /* Update frame's cursor_gc. */ - f->output_data.mac->cursor_gc->foreground = fore_pixel; - f->output_data.mac->cursor_gc->background = pixel; - + XSetBackground (FRAME_MAC_DISPLAY (f), + f->output_data.mac->cursor_gc, pixel); + XSetForeground (FRAME_MAC_DISPLAY (f), + f->output_data.mac->cursor_gc, fore_pixel); UNBLOCK_INPUT; if (FRAME_VISIBLE_P (f)) @@ -1833,8 +1750,49 @@ x_set_tool_bar_lines (f, value, oldval) } + +/* Set the Mac window title to NAME for frame F. */ + +static void +x_set_name_internal (f, name) + FRAME_PTR f; + Lisp_Object name; +{ + if (FRAME_MAC_WINDOW (f)) + { + if (STRING_MULTIBYTE (name)) +#if TARGET_API_MAC_CARBON + name = ENCODE_UTF_8 (name); +#else + name = ENCODE_SYSTEM (name); +#endif + + BLOCK_INPUT; + + { +#if TARGET_API_MAC_CARBON + CFStringRef windowTitle = + cfstring_create_with_utf8_cstring (SDATA (name)); + + SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle); + CFRelease (windowTitle); +#else + Str255 windowTitle; + if (strlen (SDATA (name)) < 255) + { + strcpy (windowTitle, SDATA (name)); + c2pstr (windowTitle); + SetWTitle (FRAME_MAC_WINDOW (f), windowTitle); + } +#endif + } + + UNBLOCK_INPUT; + } +} + /* Change the name of frame F to NAME. If NAME is nil, set F's name to - w32_id_name. + mac_id_name. If EXPLICIT is non-zero, that indicates that lisp code is setting the name; if NAME is a string, set F's name to NAME and set @@ -1864,7 +1822,7 @@ x_set_name (f, name, explicit) else if (f->explicit_name) return; - /* If NAME is nil, set the name to the w32_id_name. */ + /* If NAME is nil, set the name to the mac_id_name. */ if (NILP (name)) { /* Check for no change needed in this very common case @@ -1888,37 +1846,7 @@ x_set_name (f, name, explicit) if (! NILP (f->title)) name = f->title; - if (FRAME_MAC_WINDOW (f)) - { - if (STRING_MULTIBYTE (name)) -#if TARGET_API_MAC_CARBON - name = ENCODE_UTF_8 (name); -#else - name = ENCODE_SYSTEM (name); -#endif - - BLOCK_INPUT; - - { -#if TARGET_API_MAC_CARBON - CFStringRef windowTitle = - cfstring_create_with_utf8_cstring (SDATA (name)); - - SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle); - CFRelease (windowTitle); -#else - Str255 windowTitle; - if (strlen (SDATA (name)) < 255) - { - strcpy (windowTitle, SDATA (name)); - c2pstr (windowTitle); - SetWTitle (FRAME_MAC_WINDOW (f), windowTitle); - } -#endif - } - - UNBLOCK_INPUT; - } + x_set_name_internal (f, name); } /* This function should be called when the user's lisp code has @@ -1969,38 +1897,10 @@ x_set_title (f, name, old_name) if (NILP (name)) name = f->name; + else + CHECK_STRING (name); - if (FRAME_MAC_WINDOW (f)) - { - if (STRING_MULTIBYTE (name)) -#if TARGET_API_MAC_CARBON - name = ENCODE_UTF_8 (name); -#else - name = ENCODE_SYSTEM (name); -#endif - - BLOCK_INPUT; - - { -#if TARGET_API_MAC_CARBON - CFStringRef windowTitle = - cfstring_create_with_utf8_cstring (SDATA (name)); - - SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle); - CFRelease (windowTitle); -#else - Str255 windowTitle; - if (strlen (SDATA (name)) < 255) - { - strcpy (windowTitle, SDATA (name)); - c2pstr (windowTitle); - SetWTitle (FRAME_MAC_WINDOW (f), windowTitle); - } -#endif - } - - UNBLOCK_INPUT; - } + x_set_name_internal (f, name); } void @@ -2469,7 +2369,7 @@ unwind_create_frame (frame) DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, 1, 1, 0, - doc: /* Make a new window, which is called a \"frame\" in Emacs terms. + doc: /* Make a new window, which is called a "frame" in Emacs terms. Returns an Emacs frame object. ALIST is an alist of frame parameters. If the parameters specify that the frame should not have a minibuffer, @@ -2478,7 +2378,7 @@ then `default-minibuffer-frame' must be a frame whose minibuffer can be shared by the new frame. This function is an internal primitive--use `make-frame' instead. */) - (parms) + (parms) Lisp_Object parms; { struct frame *f; @@ -2803,7 +2703,7 @@ x_get_focus_frame (frame) DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, doc: /* Internal function called by `color-defined-p', which see. */) - (color, frame) + (color, frame) Lisp_Object color, frame; { XColor foo; @@ -2819,7 +2719,7 @@ DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, doc: /* Internal function called by `color-values', which see. */) - (color, frame) + (color, frame) Lisp_Object color, frame; { XColor foo; @@ -2842,7 +2742,7 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0, doc: /* Internal function called by `display-color-p', which see. */) - (display) + (display) Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); @@ -2855,12 +2755,12 @@ DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0, DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p, 0, 1, 0, - doc: /* Return t if the X display supports shades of gray. + doc: /* Return t if DISPLAY supports shades of gray. Note that color displays do support shades of gray. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); @@ -2873,11 +2773,11 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width, 0, 1, 0, - doc: /* Returns the width in pixels of the X display DISPLAY. + doc: /* Returns the width in pixels of DISPLAY. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); @@ -2887,11 +2787,11 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-display-pixel-height", Fx_display_pixel_height, Sx_display_pixel_height, 0, 1, 0, - doc: /* Returns the height in pixels of the X display DISPLAY. + doc: /* Returns the height in pixels of DISPLAY. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); @@ -2901,11 +2801,11 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes, 0, 1, 0, - doc: /* Returns the number of bitplanes of the display DISPLAY. + doc: /* Returns the number of bitplanes of DISPLAY. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); @@ -2915,11 +2815,11 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells, 0, 1, 0, - doc: /* Returns the number of color cells of the display DISPLAY. + doc: /* Returns the number of color cells of DISPLAY. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); @@ -2931,11 +2831,11 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-server-max-request-size", Fx_server_max_request_size, Sx_server_max_request_size, 0, 1, 0, - doc: /* Returns the maximum request size of the server of display DISPLAY. + doc: /* Returns the maximum request size of the server of DISPLAY. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); @@ -2944,18 +2844,18 @@ If omitted or nil, that stands for the selected frame's display. */) } DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, - doc: /* Returns the vendor ID string of the Mac OS system (Apple). + doc: /* Returns the "vendor ID" string of the Mac OS system (Apple). The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { return build_string ("Apple Computers"); } DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, - doc: /* Returns the version numbers of the server of display DISPLAY. + doc: /* Returns the version numbers of the Mac OS system. The value is a list of three integers: the major and minor version numbers, and the vendor-specific release number. See also the function `x-server-vendor'. @@ -2963,7 +2863,7 @@ number. See also the function `x-server-vendor'. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { int mac_major_version; @@ -2988,22 +2888,22 @@ If omitted or nil, that stands for the selected frame's display. */) } DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0, - doc: /* Return the number of screens on the server of display DISPLAY. + doc: /* Return the number of screens on the server of DISPLAY. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { return make_number (1); } DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0, - doc: /* Return the height in millimeters of the X display DISPLAY. + doc: /* Return the height in millimeters of DISPLAY. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { /* MAC_TODO: this is an approximation, and only of the main display */ @@ -3014,11 +2914,11 @@ If omitted or nil, that stands for the selected frame's display. */) } DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0, - doc: /* Return the width in millimeters of the X display DISPLAY. + doc: /* Return the width in millimeters of DISPLAY. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { /* MAC_TODO: this is an approximation, and only of the main display */ @@ -3030,12 +2930,12 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-display-backing-store", Fx_display_backing_store, Sx_display_backing_store, 0, 1, 0, - doc: /* Returns an indication of whether display DISPLAY does backing store. + doc: /* Returns an indication of whether DISPLAY does backing store. The value may be `always', `when-mapped', or `not-useful'. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { return intern ("not-useful"); @@ -3043,14 +2943,14 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-display-visual-class", Fx_display_visual_class, Sx_display_visual_class, 0, 1, 0, - doc: /* Returns the visual class of the display DISPLAY. + doc: /* Returns the visual class of DISPLAY. The value is one of the symbols `static-gray', `gray-scale', `static-color', `pseudo-color', `true-color', or `direct-color'. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); @@ -3074,11 +2974,11 @@ If omitted or nil, that stands for the selected frame's display. */) DEFUN ("x-display-save-under", Fx_display_save_under, Sx_display_save_under, 0, 1, 0, - doc: /* Returns t if the display DISPLAY supports the save-under feature. + doc: /* Returns t if DISPLAY supports the save-under feature. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display. */) - (display) + (display) Lisp_Object display; { return Qnil; @@ -3168,7 +3068,7 @@ DISPLAY is the name of the display to connect to. Optional second arg XRM-STRING is a string of resources in xrdb format. If the optional third arg MUST-SUCCEED is non-nil, terminate Emacs if we can't open the connection. */) - (display, xrm_string, must_succeed) + (display, xrm_string, must_succeed) Lisp_Object display, xrm_string, must_succeed; { unsigned char *xrm_option; @@ -3213,8 +3113,8 @@ DEFUN ("x-close-connection", Fx_close_connection, doc: /* Close the connection to DISPLAY's server. For DISPLAY, specify either a frame or a display name (a string). If DISPLAY is nil, that stands for the selected frame's display. */) - (display) - Lisp_Object display; + (display) + Lisp_Object display; { struct mac_display_info *dpyinfo = check_x_display_info (display); int i; @@ -3240,7 +3140,7 @@ If DISPLAY is nil, that stands for the selected frame's display. */) DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0, doc: /* Return the list of display names that Emacs has connections to. */) - () + () { Lisp_Object tail, result; @@ -3252,13 +3152,8 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0, } DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0, - doc: /* If ON is non-nil, report errors as soon as the erring request is made. -If ON is nil, allow buffering of requests. -This is a noop on Mac OS systems. -The optional second argument DISPLAY specifies which display to act on. -DISPLAY should be either a frame or a display name (a string). -If DISPLAY is omitted or nil, that stands for the selected frame's display. */) - (on, display) + doc: /* This is a noop on Mac OS systems. */) + (on, display) Lisp_Object display, on; { return Qnil; @@ -3317,7 +3212,7 @@ DEFUN ("x-delete-window-property", Fx_delete_window_property, Sx_delete_window_property, 1, 2, 0, doc: /* Remove window property PROP from X window of FRAME. FRAME nil or omitted means use the selected frame. Value is PROP. */) - (prop, frame) + (prop, frame) Lisp_Object prop, frame; { #if 0 /* MAC_TODO : port window properties to Mac */ @@ -3345,7 +3240,7 @@ DEFUN ("x-window-property", Fx_window_property, Sx_window_property, If FRAME is nil or omitted, use the selected frame. Value is nil if FRAME hasn't a property with name PROP or if PROP has no string value. */) - (prop, frame) + (prop, frame) Lisp_Object prop, frame; { #if 0 /* MAC_TODO : port window properties to Mac */ @@ -3947,7 +3842,7 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, doc: /* Show STRING in a "tooltip" window on frame FRAME. -A tooltip window is a small X window displaying a string. +A tooltip window is a small window displaying a string. FRAME nil or omitted means use the selected frame. @@ -3957,7 +3852,7 @@ change the tooltip's appearance. Automatically hide the tooltip after TIMEOUT seconds. TIMEOUT nil means use the default timeout of 5 seconds. -If the list of frame parameters PARAMS contains a `left' parameters, +If the list of frame parameters PARMS contains a `left' parameter, the tooltip is displayed at that x-position. Otherwise it is displayed at the mouse position, with offset DX added (default is 5 if DX isn't specified). Likewise for the y-position; if a `top' frame @@ -4215,7 +4110,7 @@ Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file selection box, if specified. Ensure that file exists if MUSTMATCH is non-nil. If ONLY-DIR-P is non-nil, the user can only select directories. */) - (prompt, dir, default_filename, mustmatch, only_dir_p) + (prompt, dir, default_filename, mustmatch, only_dir_p) Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p; { struct frame *f = SELECTED_FRAME (); diff --git a/src/macgui.h b/src/macgui.h index d9948278d1b..607890317e1 100644 --- a/src/macgui.h +++ b/src/macgui.h @@ -1,5 +1,6 @@ /* Definitions and headers for communication on the Mac OS. - Copyright (C) 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -86,6 +87,10 @@ typedef GWorldPtr Pixmap; #define FACE_DEFAULT (~0) +#if !TARGET_API_MAC_CARBON +#define GetPixDepth(pmh) ((*(pmh))->pixelSize) +#endif + /* Emulate XCharStruct. */ typedef struct _XCharStruct @@ -180,15 +185,24 @@ typedef struct _XGCValues XFontStruct *font; } XGCValues; -typedef XGCValues *GC; +typedef struct _XGC +{ + /* Original value. */ + XGCValues xgcv; + + /* Cached data members follow. */ + + /* QuickDraw foreground color. */ + RGBColor fore_color; -extern XGCValues * -XCreateGC (void *, Window, unsigned long, XGCValues *); + /* QuickDraw background color. */ + RGBColor back_color; +} *GC; -#define GCForeground 0x01 -#define GCBackground 0x02 -#define GCFont 0x03 -#define GCGraphicsExposures 0 +#define GCForeground (1L<<2) +#define GCBackground (1L<<3) +#define GCFont (1L<<14) +#define GCGraphicsExposures 0 /* Bit Gravity */ @@ -248,8 +262,6 @@ typedef struct { #define PBaseSize (1L << 8) /* program specified base for incrementing */ #define PWinGravity (1L << 9) /* program specified window gravity */ -extern int XParseGeometry (); - typedef struct { int x, y; unsigned width, height; diff --git a/src/macmenu.c b/src/macmenu.c index ab266f6f0b5..a68ff04e405 100644 --- a/src/macmenu.c +++ b/src/macmenu.c @@ -1,5 +1,6 @@ /* Menu support for GNU Emacs on the for Mac OS. - Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -611,37 +612,48 @@ cleanup_popup_menu (arg) 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 -event or a list ((XOFFSET YOFFSET) WINDOW) where XOFFSET and YOFFSET -are positions in pixels from the top left corner of WINDOW's frame -\(WINDOW may be a frame object instead of a window). This controls the -position of the center of the first line in the first pane of the -menu, not the top left of the menu as a whole. If POSITION is t, it -means to use the current mouse position. +POSITION is a position specification. This is either a mouse button event +or a list ((XOFFSET YOFFSET) WINDOW) +where XOFFSET and YOFFSET are positions in pixels from the top left +corner of WINDOW. (WINDOW may be a window or a frame object.) +This controls the position of the top left of the menu as a whole. +If POSITION is t, it means to use the current mouse position. MENU is a specifier for a menu. For the simplest case, MENU is a keymap. The menu items come from key bindings that have a menu string as well as -a definition; actually, the \"definition\" in such a key binding looks like +a definition; actually, the "definition" in such a key binding looks like \(STRING . REAL-DEFINITION). To give the menu a title, put a string into the keymap as a top-level element. If REAL-DEFINITION is nil, that puts a nonselectable string in the menu. Otherwise, REAL-DEFINITION should be a valid key binding definition. -You can also use a list of keymaps as MENU. Then each keymap makes a -separate pane. When MENU is a keymap or a list of keymaps, the return -value is a list of events. +You can also use a list of keymaps as MENU. + Then each keymap makes a separate pane. -Alternatively, you can specify a menu of multiple panes with a list of -the form (TITLE PANE1 PANE2...), where each pane is a list of -form (TITLE ITEM1 ITEM2...). -Each ITEM is normally a cons cell (STRING . VALUE); but a string can -appear as an item--that makes a nonselectable line in the menu. +When MENU is a keymap or a list of keymaps, the return value is the +list of events corresponding to the user's choice. Note that +`x-popup-menu' does not actually execute the command bound to that +sequence of events. + +Alternatively, you can specify a menu of multiple panes + with a list of the form (TITLE PANE1 PANE2...), +where each pane is a list of form (TITLE ITEM1 ITEM2...). +Each ITEM is normally a cons cell (STRING . VALUE); +but a string can appear as an item--that makes a nonselectable line +in the menu. With this form of menu, the return value is VALUE from the chosen item. If POSITION is nil, don't display the menu at all, just precalculate the -cached information about equivalent key sequences. */) - (position, menu) +cached information about equivalent key sequences. + +If the user gets rid of the menu without making a valid choice, for +instance by clicking the mouse away from a valid choice or by typing +keyboard input, then this normally results in a quit and +`x-popup-menu' does not return. But if POSITION is a mouse button +event (indicating that the user invoked the menu with the mouse) then +no quit occurs and `x-popup-menu' returns nil. */) + (position, menu) Lisp_Object position, menu; { Lisp_Object keymap, tem; @@ -840,7 +852,7 @@ If POSITION is t, it means to use the frame the mouse is on. The dialog box appears in the middle of the specified frame. CONTENTS specifies the alternatives to display in the dialog box. -It is a list of the form (TITLE ITEM1 ITEM2...). +It is a list of the form (DIALOG ITEM1 ITEM2...). Each ITEM is a cons cell (STRING . VALUE). The return value is VALUE from the chosen item. @@ -850,8 +862,12 @@ on the left of the dialog box and all following items on the right. \(By default, approximately half appear on each side.) If HEADER is non-nil, the frame title for the box is "Information", -otherwise it is "Question". */) - (position, contents, header) +otherwise it is "Question". + +If the user gets rid of the dialog box without making a valid choice, +for instance using the window manager, then this produces a quit and +`x-popup-dialog' does not return. */) + (position, contents, header) Lisp_Object position, contents, header; { FRAME_PTR f = NULL; diff --git a/src/macros.c b/src/macros.c index 6f854018d6a..8167e274dab 100644 --- a/src/macros.c +++ b/src/macros.c @@ -1,5 +1,6 @@ /* Keyboard macros. - Copyright (C) 1985, 1986, 1993, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1993, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/macros.h b/src/macros.h index d9b99b9984e..7acd46dc2ed 100644 --- a/src/macros.h +++ b/src/macros.h @@ -1,5 +1,5 @@ /* Definitions for keyboard macro interpretation in GNU Emacs. - Copyright (C) 1985 Free Software Foundation, Inc. + Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/macselect.c b/src/macselect.c index b519950eb75..63221ba3a90 100644 --- a/src/macselect.c +++ b/src/macselect.c @@ -371,7 +371,7 @@ get_scrap_target_type_list (scrap) err = GetScrapFlavorCount (scrap, &count); if (err == noErr) flavor_info = xmalloc (sizeof (ScrapFlavorInfo) * count); - if (err == noErr && flavor_info) + if (flavor_info) { err = GetScrapFlavorInfoList (scrap, &count, flavor_info); if (err != noErr) @@ -380,6 +380,8 @@ get_scrap_target_type_list (scrap) flavor_info = NULL; } } + if (flavor_info == NULL) + count = 0; #endif for (rest = Vselection_converter_alist; CONSP (rest); rest = XCDR (rest)) { @@ -710,7 +712,7 @@ anything that the functions on `selection-converter-alist' know about. */) { check_mac (); CHECK_SYMBOL (selection_name); - if (NILP (selection_value)) error ("selection-value may not be nil"); + if (NILP (selection_value)) error ("SELECTION-VALUE may not be nil"); x_own_selection (selection_name, selection_value); return selection_value; } @@ -722,11 +724,11 @@ anything that the functions on `selection-converter-alist' know about. */) DEFUN ("x-get-selection-internal", Fx_get_selection_internal, Sx_get_selection_internal, 2, 3, 0, - doc: /* Return text selected from some Mac window. + doc: /* Return text selected from some Mac application. SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. TYPE is the type of data desired, typically `STRING'. TIME_STAMP is ignored on Mac. */) - (selection_symbol, target_type, time_stamp) + (selection_symbol, target_type, time_stamp) Lisp_Object selection_symbol, target_type, time_stamp; { Lisp_Object val = Qnil; @@ -819,7 +821,7 @@ Disowning it means there is no such selection. */) DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p, 0, 1, 0, - doc: /* Whether the current Emacs process owns the given Selection. + doc: /* Whether the current Emacs process owns the given SELECTION. The arg should be the name of the selection in question, typically one of the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. For convenience, the symbol nil is the same as `PRIMARY', @@ -864,7 +866,7 @@ and t is the same as `SECONDARY'. */) DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p, 0, 1, 0, - doc: /* Whether there is an owner for the given Selection. + doc: /* Whether there is an owner for the given SELECTION. The arg should be the name of the selection in question, typically one of the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. For convenience, the symbol nil is the same as `PRIMARY', @@ -1075,7 +1077,7 @@ a desired type to which the selection should be converted; and the local selection value (whatever was given to `x-own-selection'). The function should return the value to send to the Scrap Manager -\(a string). A return value of nil +\(must be a string). A return value of nil means that the conversion could not be done. A return value which is the symbol `NULL' means that a side-effect was executed, diff --git a/src/macterm.c b/src/macterm.c index 303557daca1..d6dbecfe800 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -1,5 +1,6 @@ /* Implementation of GUI terminal on the Mac OS. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -22,10 +23,10 @@ Boston, MA 02110-1301, USA. */ #include <config.h> #include <signal.h> + #include <stdio.h> -#include <stdlib.h> + #include "lisp.h" -#include "charset.h" #include "blockinput.h" #include "macterm.h" @@ -62,8 +63,6 @@ Boston, MA 02110-1301, USA. */ #include "systty.h" #include "systime.h" -#include "atimer.h" -#include "keymap.h" #include <ctype.h> #include <errno.h> @@ -71,7 +70,8 @@ Boston, MA 02110-1301, USA. */ #include <sys/stat.h> #include <sys/param.h> -#include "keyboard.h" +#include "charset.h" +#include "coding.h" #include "frame.h" #include "dispextern.h" #include "fontset.h" @@ -82,9 +82,10 @@ Boston, MA 02110-1301, USA. */ #include "disptab.h" #include "buffer.h" #include "window.h" +#include "keyboard.h" #include "intervals.h" -#include "composite.h" -#include "coding.h" +#include "atimer.h" +#include "keymap.h" /* Set of macros that handle mapping of Mac modifier keys to emacs. */ #define macCtrlKey (NILP (Vmac_reverse_ctrl_meta) ? controlKey : \ @@ -94,8 +95,6 @@ Boston, MA 02110-1301, USA. */ (NILP (Vmac_command_key_is_meta) ? optionKey : cmdKey) \ : controlKey) #define macAltKey (NILP (Vmac_command_key_is_meta) ? cmdKey : optionKey) - -#define mac_window_to_frame(wp) (((mac_output *) GetWRefCon (wp))->mFP) /* Non-nil means Emacs uses toolkit scroll bars. */ @@ -114,15 +113,6 @@ 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. */ - -int x_use_underline_position_properties; - -/* Non-zero means draw block and hollow cursor as wide as the glyph - under it. For example, if a block cursor is over a tab, it will be - drawn as wide as that tab on the display. */ - - /* This is a chain of structures for all the X displays currently in use. */ @@ -148,8 +138,6 @@ struct mac_display_info one_mac_display_info; extern struct frame *updating_frame; -extern int waiting_for_input; - /* This is a frame waiting to be auto-raised, within XTread_socket. */ struct frame *pending_autoraise_frame; @@ -177,7 +165,6 @@ struct frame *pending_autoraise_frame; /* Where the mouse was last time we reported a mouse event. */ static Rect last_mouse_glyph; -static Lisp_Object last_mouse_press_frame; /* The scroll bar in which the last X motion event occurred. @@ -211,45 +198,24 @@ static int volatile input_signal_count; static int input_signal_count; #endif -/* Used locally within XTread_socket. */ - -static int x_noop_count; - -/* Initial values of argv and argc. */ - -extern char **initial_argv; -extern int initial_argc; - -extern Lisp_Object Vcommand_line_args, Vsystem_name; - -/* Tells if a window manager is present or not. */ - -extern Lisp_Object Vx_no_window_manager; - -extern int errno; +extern Lisp_Object Vsystem_name; /* A mask of extra modifier bits to put into every keyboard char. */ -extern int extra_keyboard_modifiers; +extern EMACS_INT extra_keyboard_modifiers; /* The keysyms to use for the various modifiers. */ static Lisp_Object Qalt, Qhyper, Qsuper, Qmodifier_value; -static Lisp_Object Qvendor_specific_keysyms; - -#if 0 -extern XrmDatabase x_load_resources P_ ((Display *, char *, char *, char *)); -#endif - extern int inhibit_window_system; #if __MRC__ && !TARGET_API_MAC_CARBON QDGlobals qd; /* QuickDraw global information structure. */ #endif +#define mac_window_to_frame(wp) (((mac_output *) GetWRefCon (wp))->mFP) -struct frame * x_window_to_frame (struct mac_display_info *, WindowPtr); struct mac_display_info *mac_display_info_for_display (Display *); static void x_update_window_end P_ ((struct window *, int, int)); static int x_io_error_quitter P_ ((Display *)); @@ -289,17 +255,23 @@ static void x_flush P_ ((struct frame *f)); static void x_update_begin P_ ((struct frame *)); static void x_update_window_begin P_ ((struct window *)); static void x_after_update_window_line P_ ((struct glyph_row *)); +static void x_scroll_bar_report_motion P_ ((struct frame **, Lisp_Object *, + enum scroll_bar_part *, + Lisp_Object *, Lisp_Object *, + unsigned long *)); -static int is_emacs_window (WindowPtr); +static int is_emacs_window P_ ((WindowPtr)); -int x_bitmap_icon (struct frame *, Lisp_Object); -void x_make_frame_visible (struct frame *); - -extern void window_scroll (Lisp_Object, int, int, int); +static void XSetFont P_ ((Display *, GC, XFontStruct *)); /* Defined in macmenu.h. */ extern void menubar_selection_callback (FRAME_PTR, int); -extern void set_frame_menubar (FRAME_PTR, int, int); + +#define GC_FORE_COLOR(gc) (&(gc)->fore_color) +#define GC_BACK_COLOR(gc) (&(gc)->back_color) +#define GC_FONT(gc) ((gc)->xgcv.font) +#define MAC_WINDOW_NORMAL_GC(w) (((mac_output *) GetWRefCon (w))->normal_gc) + /* X display function emulation */ @@ -312,51 +284,6 @@ XFreePixmap (display, pixmap) } -/* Set foreground color for subsequent QuickDraw commands. Assume - graphic port has already been set. */ - -static void -mac_set_forecolor (unsigned long color) -{ - RGBColor fg_color; - - fg_color.red = RED16_FROM_ULONG (color); - fg_color.green = GREEN16_FROM_ULONG (color); - fg_color.blue = BLUE16_FROM_ULONG (color); - - RGBForeColor (&fg_color); -} - - -/* Set background color for subsequent QuickDraw commands. Assume - graphic port has already been set. */ - -static void -mac_set_backcolor (unsigned long color) -{ - RGBColor bg_color; - - bg_color.red = RED16_FROM_ULONG (color); - bg_color.green = GREEN16_FROM_ULONG (color); - bg_color.blue = BLUE16_FROM_ULONG (color); - - RGBBackColor (&bg_color); -} - -/* Set foreground and background color for subsequent QuickDraw - commands. Assume that the graphic port has already been set. */ - -static void -mac_set_colors (gc, bg_save) - GC gc; - RGBColor *bg_save; -{ - if (bg_save) - GetBackColor (bg_save); - mac_set_forecolor (gc->foreground); - mac_set_backcolor (gc->background); -} - /* Mac version of XDrawLine. */ static void @@ -366,16 +293,12 @@ XDrawLine (display, w, gc, x1, y1, x2, y2) GC gc; int x1, y1, x2, y2; { - RGBColor old_bg; - SetPortWindowPort (w); - mac_set_colors (gc, &old_bg); + RGBForeColor (GC_FORE_COLOR (gc)); MoveTo (x1, y1); LineTo (x2, y2); - - RGBBackColor (&old_bg); } void @@ -391,7 +314,7 @@ mac_draw_line_to_pixmap (display, p, gc, x1, y1, x2, y2) GetGWorld (&old_port, &old_gdh); SetGWorld (p, NULL); - mac_set_colors (gc, NULL); + RGBForeColor (GC_FORE_COLOR (gc)); LockPixels (GetGWorldPixMap (p)); MoveTo (x1, y1); @@ -401,32 +324,38 @@ mac_draw_line_to_pixmap (display, p, gc, x1, y1, x2, y2) SetGWorld (old_port, old_gdh); } -/* Mac version of XClearArea. */ -void -XClearArea (display, w, x, y, width, height, exposures) - Display *display; +static void +mac_erase_rectangle (w, gc, x, y, width, height) WindowPtr w; + GC gc; int x, y; unsigned int width, height; - int exposures; { - struct mac_output *mwp = (mac_output *) GetWRefCon (w); Rect r; - XGCValues xgc; - RGBColor old_bg; - - xgc.foreground = mwp->x_compatible.foreground_pixel; - xgc.background = mwp->x_compatible.background_pixel; SetPortWindowPort (w); - mac_set_colors (&xgc, &old_bg); + RGBBackColor (GC_BACK_COLOR (gc)); SetRect (&r, x, y, x + width, y + height); EraseRect (&r); - RGBBackColor (&old_bg); + RGBBackColor (GC_BACK_COLOR (MAC_WINDOW_NORMAL_GC (w))); +} + + +/* Mac version of XClearArea. */ + +void +XClearArea (display, w, x, y, width, height, exposures) + Display *display; + WindowPtr w; + int x, y; + unsigned int width, height; + int exposures; +{ + mac_erase_rectangle (w, MAC_WINDOW_NORMAL_GC (w), x, y, width, height); } /* Mac version of XClearWindow. */ @@ -436,15 +365,9 @@ XClearWindow (display, w) Display *display; WindowPtr w; { - struct mac_output *mwp = (mac_output *) GetWRefCon (w); - XGCValues xgc; - - xgc.foreground = mwp->x_compatible.foreground_pixel; - xgc.background = mwp->x_compatible.background_pixel; - SetPortWindowPort (w); - mac_set_colors (&xgc, NULL); + RGBBackColor (GC_BACK_COLOR (MAC_WINDOW_NORMAL_GC (w))); #if TARGET_API_MAC_CARBON { @@ -472,7 +395,6 @@ mac_draw_bitmap (display, w, gc, x, y, width, height, bits, overlay_p) { BitMap bitmap; Rect r; - RGBColor old_bg; bitmap.rowBytes = sizeof(unsigned short); bitmap.baseAddr = (char *)bits; @@ -480,7 +402,8 @@ mac_draw_bitmap (display, w, gc, x, y, width, height, bits, overlay_p) SetPortWindowPort (w); - mac_set_colors (gc, &old_bg); + RGBForeColor (GC_FORE_COLOR (gc)); + RGBBackColor (GC_BACK_COLOR (gc)); SetRect (&r, x, y, x + width, y + height); #if TARGET_API_MAC_CARBON @@ -493,7 +416,7 @@ mac_draw_bitmap (display, w, gc, x, y, width, height, bits, overlay_p) overlay_p ? srcOr : srcCopy, 0); #endif /* not TARGET_API_MAC_CARBON */ - RGBBackColor (&old_bg); + RGBBackColor (GC_BACK_COLOR (MAC_WINDOW_NORMAL_GC (w))); } @@ -599,12 +522,16 @@ XCreatePixmapFromBitmapData (display, w, data, width, height, fg, bg, depth) char *data; unsigned int width, height; unsigned long fg, bg; - unsigned int depth; /* not used */ + unsigned int depth; { Pixmap pixmap; BitMap bitmap; CGrafPtr old_port; GDHandle old_gdh; + static GC gc = NULL; /* not reentrant */ + + if (gc == NULL) + gc = XCreateGC (display, w, 0, NULL); pixmap = XCreatePixmap (display, w, width, height, depth); if (pixmap == NULL) @@ -613,8 +540,10 @@ XCreatePixmapFromBitmapData (display, w, data, width, height, fg, bg, depth) GetGWorld (&old_port, &old_gdh); SetGWorld (pixmap, NULL); mac_create_bitmap_from_bitmap_data (&bitmap, data, width, height); - mac_set_forecolor (fg); - mac_set_backcolor (bg); + XSetForeground (display, gc, fg); + XSetBackground (display, gc, bg); + RGBForeColor (GC_FORE_COLOR (gc)); + RGBBackColor (GC_BACK_COLOR (gc)); LockPixels (GetGWorldPixMap (pixmap)); #if TARGET_API_MAC_CARBON CopyBits (&bitmap, GetPortBitMapForCopyBits (pixmap), @@ -642,16 +571,13 @@ XFillRectangle (display, w, gc, x, y, width, height) unsigned int width, height; { Rect r; - RGBColor old_bg; SetPortWindowPort (w); - mac_set_colors (gc, &old_bg); + RGBForeColor (GC_FORE_COLOR (gc)); SetRect (&r, x, y, x + width, y + height); PaintRect (&r); /* using foreground color of gc */ - - RGBBackColor (&old_bg); } @@ -670,7 +596,7 @@ mac_fill_rectangle_to_pixmap (display, p, gc, x, y, width, height) GetGWorld (&old_port, &old_gdh); SetGWorld (p, NULL); - mac_set_colors (gc, NULL); + RGBForeColor (GC_FORE_COLOR (gc)); SetRect (&r, x, y, x + width, y + height); LockPixels (GetGWorldPixMap (p)); @@ -693,16 +619,13 @@ mac_draw_rectangle (display, w, gc, x, y, width, height) unsigned int width, height; { Rect r; - RGBColor old_bg; SetPortWindowPort (w); - mac_set_colors (gc, &old_bg); + RGBForeColor (GC_FORE_COLOR (gc)); SetRect (&r, x, y, x + width + 1, y + height + 1); FrameRect (&r); /* using foreground color of gc */ - - RGBBackColor (&old_bg); } @@ -723,7 +646,7 @@ mac_draw_rectangle_to_pixmap (display, p, gc, x, y, width, height) GetGWorld (&old_port, &old_gdh); SetGWorld (p, NULL); - mac_set_colors (gc, NULL); + RGBForeColor (GC_FORE_COLOR (gc)); SetRect (&r, x, y, x + width + 1, y + height + 1); LockPixels (GetGWorldPixMap (p)); @@ -745,9 +668,6 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode, char *buf; int nchars, mode, bytes_per_char; { - RGBColor old_bg; - - SetPortWindowPort (w); #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 UInt32 textFlags, savedFlags; if (!NILP(Vmac_use_core_graphics)) { @@ -756,17 +676,22 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode, } #endif - mac_set_colors (gc, &old_bg); + SetPortWindowPort (w); + + RGBForeColor (GC_FORE_COLOR (gc)); + if (mode != srcOr) + RGBBackColor (GC_BACK_COLOR (gc)); - TextFont (gc->font->mac_fontnum); - TextSize (gc->font->mac_fontsize); - TextFace (gc->font->mac_fontface); + TextFont (GC_FONT (gc)->mac_fontnum); + TextSize (GC_FONT (gc)->mac_fontsize); + TextFace (GC_FONT (gc)->mac_fontface); TextMode (mode); MoveTo (x, y); DrawText (buf, 0, nchars * bytes_per_char); - RGBBackColor (&old_bg); + if (mode != srcOr) + RGBBackColor (GC_BACK_COLOR (MAC_WINDOW_NORMAL_GC (w))); #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 if (!NILP(Vmac_use_core_graphics)) SwapQDTextFlags(savedFlags); @@ -871,6 +796,8 @@ mac_copy_area (display, src, dest, gc, src_x, src_y, width, height, dest_x, &src_r, &dest_r, srcCopy, 0); #endif /* not TARGET_API_MAC_CARBON */ UnlockPixels (GetGWorldPixMap (src)); + + RGBBackColor (GC_BACK_COLOR (MAC_WINDOW_NORMAL_GC (dest))); } @@ -909,26 +836,10 @@ mac_copy_area_with_mask (display, src, mask, dest, gc, src_x, src_y, #endif /* not TARGET_API_MAC_CARBON */ UnlockPixels (GetGWorldPixMap (mask)); UnlockPixels (GetGWorldPixMap (src)); -} - - -#if 0 -/* Convert a pair of local coordinates to global (screen) coordinates. - Assume graphic port has been properly set. */ -static void -local_to_global_coord (short *h, short *v) -{ - Point p; - p.h = *h; - p.v = *v; - - LocalToGlobal (&p); - - *h = p.h; - *v = p.v; + RGBBackColor (GC_BACK_COLOR (MAC_WINDOW_NORMAL_GC (dest))); } -#endif + /* Mac replacement for XCopyArea: used only for scrolling. */ @@ -953,31 +864,17 @@ mac_scroll_area (display, w, gc, src_x, src_y, width, height, dest_x, dest_y) Rect src_r, dest_r; SetPort (w); -#if 0 - mac_set_colors (gc, NULL); -#endif SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height); -#if 0 - /* Need to use global coordinates and screenBits since src and dest - areas overlap in general. */ - local_to_global_coord (&src_r.left, &src_r.top); - local_to_global_coord (&src_r.right, &src_r.bottom); - local_to_global_coord (&dest_r.left, &dest_r.top); - local_to_global_coord (&dest_r.right, &dest_r.bottom); - - CopyBits (&qd.screenBits, &qd.screenBits, &src_r, &dest_r, srcCopy, 0); -#else /* In Color QuickDraw, set ForeColor and BackColor as follows to avoid color mapping in CopyBits. Otherwise, it will be slow. */ ForeColor (blackColor); BackColor (whiteColor); CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0); - mac_set_colors (gc, NULL); -#endif + RGBBackColor (GC_BACK_COLOR (MAC_WINDOW_NORMAL_GC (w))); #endif /* not TARGET_API_MAC_CARBON */ } @@ -1067,28 +964,37 @@ mac_copy_area_with_mask_to_pixmap (display, src, mask, dest, gc, src_x, src_y, /* Mac replacement for XChangeGC. */ static void -XChangeGC (void * ignore, XGCValues* gc, unsigned long mask, - XGCValues *xgcv) +XChangeGC (display, gc, mask, xgcv) + Display *display; + GC gc; + unsigned long mask; + XGCValues *xgcv; { if (mask & GCForeground) - gc->foreground = xgcv->foreground; + XSetForeground (display, gc, xgcv->foreground); if (mask & GCBackground) - gc->background = xgcv->background; + XSetBackground (display, gc, xgcv->background); if (mask & GCFont) - gc->font = xgcv->font; + XSetFont (display, gc, xgcv->font); } /* Mac replacement for XCreateGC. */ -XGCValues * -XCreateGC (void * ignore, Window window, unsigned long mask, - XGCValues *xgcv) +GC +XCreateGC (display, window, mask, xgcv) + Display *display; + Window window; + unsigned long mask; + XGCValues *xgcv; { - XGCValues *gc = (XGCValues *) xmalloc (sizeof (XGCValues)); - bzero (gc, sizeof (XGCValues)); + GC gc = xmalloc (sizeof (*gc)); - XChangeGC (ignore, gc, mask, xgcv); + if (gc) + { + bzero (gc, sizeof (*gc)); + XChangeGC (display, gc, mask, xgcv); + } return gc; } @@ -1108,10 +1014,18 @@ XFreeGC (display, gc) /* Mac replacement for XGetGCValues. */ static void -XGetGCValues (void* ignore, XGCValues *gc, - unsigned long mask, XGCValues *xgcv) +XGetGCValues (display, gc, mask, xgcv) + Display *display; + GC gc; + unsigned long mask; + XGCValues *xgcv; { - XChangeGC (ignore, xgcv, mask, gc); + if (mask & GCForeground) + xgcv->foreground = gc->xgcv.foreground; + if (mask & GCBackground) + xgcv->background = gc->xgcv.background; + if (mask & GCFont) + xgcv->font = gc->xgcv.font; } @@ -1123,7 +1037,13 @@ XSetForeground (display, gc, color) GC gc; unsigned long color; { - gc->foreground = color; + if (gc->xgcv.foreground != color) + { + gc->xgcv.foreground = color; + gc->fore_color.red = RED16_FROM_ULONG (color); + gc->fore_color.green = GREEN16_FROM_ULONG (color); + gc->fore_color.blue = BLUE16_FROM_ULONG (color); + } } @@ -1135,7 +1055,25 @@ XSetBackground (display, gc, color) GC gc; unsigned long color; { - gc->background = color; + if (gc->xgcv.background != color) + { + gc->xgcv.background = color; + gc->back_color.red = RED16_FROM_ULONG (color); + gc->back_color.green = GREEN16_FROM_ULONG (color); + gc->back_color.blue = BLUE16_FROM_ULONG (color); + } +} + + +/* Mac replacement for XSetFont. */ + +static void +XSetFont (display, gc, font) + Display *display; + GC gc; + XFontStruct *font; +{ + gc->xgcv.font = font; } @@ -1182,19 +1120,6 @@ XSetWindowBackground (display, w, color) #endif } - -/* Mac replacement for XSetFont. */ - -static void -XSetFont (display, gc, font) - Display *display; - GC gc; - XFontStruct *font; -{ - gc->font = font; -} - - /* x_sync is a no-op on Mac. */ void x_sync (f) @@ -1345,7 +1270,6 @@ mac_draw_vertical_window_border (w, x, y0, y1) f->output_data.mac->normal_gc, x, y0, x, y1); } - /* End update of window W (which is equal to updated_window). Draw vertical borders between horizontally adjacent windows, and @@ -1357,7 +1281,7 @@ mac_draw_vertical_window_border (w, x, y0, y1) W may be a menu bar pseudo-window in case we don't have X toolkit support. Such windows don't have a cursor, so don't display it - here. */ + here. */ static void x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p) @@ -1390,14 +1314,6 @@ x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p) dpyinfo->mouse_face_window = Qnil; } -#if 0 - /* Unhide the caret. This won't actually show the cursor, unless it - was visible before the corresponding call to HideCaret in - x_update_window_begin. */ - if (w32_use_visible_system_caret) - SendMessage (w32_system_caret_hwnd, WM_EMACS_SHOW_CARET, 0, 0); -#endif - updated_window = NULL; } @@ -1483,19 +1399,18 @@ x_after_update_window_line (desired_row) height > 0)) { int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y)); + /* Internal border is drawn below the tool bar. */ if (WINDOWP (f->tool_bar_window) && w == XWINDOW (f->tool_bar_window)) y -= width; BLOCK_INPUT; - XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), 0, y, width, height, 0); XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), FRAME_PIXEL_WIDTH (f) - width, y, width, height, 0); - UNBLOCK_INPUT; } } @@ -1515,7 +1430,6 @@ x_draw_fringe_bitmap (w, row, p) struct frame *f = XFRAME (WINDOW_FRAME (w)); Display *display = FRAME_MAC_DISPLAY (f); WindowPtr window = FRAME_MAC_WINDOW (f); - XGCValues gcv; GC gc = f->output_data.mac->normal_gc; struct face *face = p->face; int rowY; @@ -1539,9 +1453,6 @@ x_draw_fringe_bitmap (w, row, p) if (p->bx >= 0 && !p->overlay_p) { - XGCValues gcv; - gcv.foreground = face->background; - #if 0 /* MAC_TODO: stipple */ /* In case the same realized face is used for fringes and for something displayed in the text (e.g. face `region' on @@ -1553,9 +1464,7 @@ x_draw_fringe_bitmap (w, row, p) XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background); #endif - XFillRectangle (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), - &gcv, - p->bx, p->by, p->nx, p->ny); + mac_erase_rectangle (window, face->gc, p->bx, p->by, p->nx, p->ny); #if 0 /* MAC_TODO: stipple */ if (!face->stipple) @@ -1566,21 +1475,24 @@ x_draw_fringe_bitmap (w, row, p) if (p->which) { unsigned short *bits = p->bits + p->dh; + XGCValues gcv; - gcv.foreground = (p->cursor_p - ? (p->overlay_p ? face->background - : f->output_data.mac->cursor_pixel) - : face->foreground); - gcv.background = face->background; - - mac_draw_bitmap (display, window, &gcv, p->x, p->y, + XGetGCValues (display, face->gc, GCForeground, &gcv); + XSetForeground (display, face->gc, + (p->cursor_p + ? (p->overlay_p ? face->background + : f->output_data.mac->cursor_pixel) + : face->foreground)); + mac_draw_bitmap (display, window, face->gc, p->x, p->y, p->wd, p->h, bits, p->overlay_p); + XSetForeground (display, face->gc, gcv.foreground); } mac_reset_clipping (display, window); } + /* This is called when starting Emacs and when restarting after suspend. When starting Emacs, no window is mapped. And nothing must be done to Emacs's own window if it is suspended (though that @@ -1599,6 +1511,7 @@ XTreset_terminal_modes () { } + /*********************************************************************** Display Iterator @@ -1786,6 +1699,7 @@ mac_encode_char (c, char2b, font_info, two_byte_p) ***********************************************************************/ + static void x_set_glyph_string_clipping P_ ((struct glyph_string *)); static void x_set_glyph_string_gc P_ ((struct glyph_string *)); static void x_draw_glyph_string_background P_ ((struct glyph_string *, @@ -1794,6 +1708,7 @@ static void x_draw_glyph_string_foreground P_ ((struct glyph_string *)); static void x_draw_composite_glyph_string_foreground P_ ((struct glyph_string *)); static void x_draw_glyph_string_box P_ ((struct glyph_string *)); static void x_draw_glyph_string P_ ((struct glyph_string *)); +static void mac_compute_glyph_string_overhangs P_ ((struct glyph_string *)); static void x_set_cursor_gc P_ ((struct glyph_string *)); static void x_set_mode_line_face_gc P_ ((struct glyph_string *)); static void x_set_mouse_face_gc P_ ((struct glyph_string *)); @@ -2045,10 +1960,7 @@ x_clear_glyph_string_rect (s, x, y, w, h) struct glyph_string *s; int x, y, w, h; { - XGCValues xgcv; - - xgcv.foreground = s->gc->background; - XFillRectangle (s->display, s->window, &xgcv, x, y, w, h); + mac_erase_rectangle (s->window, s->gc, x, y, w, h); } @@ -2636,27 +2548,29 @@ x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width, { XGCValues xgcv; - xgcv.foreground = s->face->box_color; + XGetGCValues (s->display, s->gc, GCForeground, &xgcv); + XSetForeground (s->display, s->gc, s->face->box_color); mac_set_clip_rectangle (s->display, s->window, clip_rect); /* Top. */ - XFillRectangle (s->display, s->window, &xgcv, + XFillRectangle (s->display, s->window, s->gc, left_x, top_y, right_x - left_x + 1, width); /* Left. */ if (left_p) - XFillRectangle (s->display, s->window, &xgcv, + XFillRectangle (s->display, s->window, s->gc, left_x, top_y, width, bottom_y - top_y + 1); /* Bottom. */ - XFillRectangle (s->display, s->window, &xgcv, + XFillRectangle (s->display, s->window, s->gc, left_x, bottom_y - width + 1, right_x - left_x + 1, width); /* Right. */ if (right_p) - XFillRectangle (s->display, s->window, &xgcv, + XFillRectangle (s->display, s->window, s->gc, right_x - width + 1, top_y, width, bottom_y - top_y + 1); + XSetForeground (s->display, s->gc, xgcv.foreground); mac_reset_clipping (s->display, s->window); } @@ -3075,13 +2989,7 @@ x_draw_stretch_glyph_string (s) } else #endif /* MAC_TODO */ - { - XGCValues xgcv; - XGetGCValues (s->display, gc, GCForeground | GCBackground, &xgcv); - XSetForeground (s->display, gc, xgcv.background); - XFillRectangle (s->display, s->window, gc, x, y, w, h); - XSetForeground (s->display, gc, xgcv.foreground); - } + mac_erase_rectangle (s->window, gc, x, y, w, h); mac_reset_clipping (s->display, s->window); } @@ -3397,7 +3305,6 @@ XTring_bell () } } - /* Specify how many text lines, from the top of the window, should be affected by insert-lines and delete-lines operations. @@ -3832,43 +3739,6 @@ x_get_keysym_name (keysym) -#if 0 -/* Mouse clicks and mouse movement. Rah. */ - -/* Prepare a mouse-event in *RESULT for placement in the input queue. - - If the event is a button press, then note that we have grabbed - the mouse. */ - -static Lisp_Object -construct_mouse_click (result, event, f) - struct input_event *result; - EventRecord *event; - struct frame *f; -{ - Point mouseLoc; - - result->kind = MOUSE_CLICK_EVENT; - result->code = 0; /* only one mouse button */ - result->timestamp = event->when; - result->modifiers = event->what == mouseDown ? down_modifier : up_modifier; - - mouseLoc = event->where; - - SetPortWindowPort (FRAME_MAC_WINDOW (f)); - - GlobalToLocal (&mouseLoc); - XSETINT (result->x, mouseLoc.h); - XSETINT (result->y, mouseLoc.v); - - XSETFRAME (result->frame_or_window, f); - - result->arg = Qnil; - return Qnil; -} -#endif - - /* Function to report a mouse movement to the mainstream Emacs code. The input handler calls this. @@ -3924,18 +3794,11 @@ note_mouse_movement (frame, pos) } } -/* This is used for debugging, to turn off note_mouse_highlight. */ - -int disable_mouse_highlight; - - /************************************************************************ Mouse Face ************************************************************************/ -static struct scroll_bar *x_window_to_scroll_bar (); -static void x_scroll_bar_report_motion (); static int glyph_rect P_ ((struct frame *f, int, int, Rect *)); @@ -4147,20 +4010,16 @@ static OSStatus install_scroll_bar_timer P_ ((void)); static OSStatus set_scroll_bar_timer P_ ((EventTimerInterval)); static int control_part_code_to_scroll_bar_part P_ ((ControlPartCode)); static void construct_scroll_bar_click P_ ((struct scroll_bar *, int, - unsigned long, struct input_event *)); static OSErr get_control_part_bounds P_ ((ControlHandle, ControlPartCode, Rect *)); static void x_scroll_bar_handle_press P_ ((struct scroll_bar *, ControlPartCode, - unsigned long, struct input_event *)); static void x_scroll_bar_handle_release P_ ((struct scroll_bar *, - unsigned long, struct input_event *)); static void x_scroll_bar_handle_drag P_ ((WindowPtr, struct scroll_bar *, - Point, unsigned long, - struct input_event *)); + Point, struct input_event *)); static void x_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *, int, int, int)); @@ -4259,10 +4118,9 @@ control_part_code_to_scroll_bar_part (part_code) } static void -construct_scroll_bar_click (bar, part, timestamp, bufp) +construct_scroll_bar_click (bar, part, bufp) struct scroll_bar *bar; int part; - unsigned long timestamp; struct input_event *bufp; { bufp->kind = SCROLL_BAR_CLICK_EVENT; @@ -4270,7 +4128,6 @@ construct_scroll_bar_click (bar, part, timestamp, bufp) bufp->arg = Qnil; bufp->part = part; bufp->code = 0; - bufp->timestamp = timestamp; XSETINT (bufp->x, 0); XSETINT (bufp->y, 0); bufp->modifiers = 0; @@ -4294,10 +4151,9 @@ get_control_part_bounds (ch, part_code, rect) } static void -x_scroll_bar_handle_press (bar, part_code, timestamp, bufp) +x_scroll_bar_handle_press (bar, part_code, bufp) struct scroll_bar *bar; ControlPartCode part_code; - unsigned long timestamp; struct input_event *bufp; { int part = control_part_code_to_scroll_bar_part (part_code); @@ -4307,7 +4163,7 @@ x_scroll_bar_handle_press (bar, part_code, timestamp, bufp) if (part != scroll_bar_handle) { - construct_scroll_bar_click (bar, part, timestamp, bufp); + construct_scroll_bar_click (bar, part, bufp); HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code); set_scroll_bar_timer (SCROLL_BAR_FIRST_DELAY); } @@ -4318,14 +4174,13 @@ x_scroll_bar_handle_press (bar, part_code, timestamp, bufp) } static void -x_scroll_bar_handle_release (bar, timestamp, bufp) +x_scroll_bar_handle_release (bar, bufp) struct scroll_bar *bar; - unsigned long timestamp; struct input_event *bufp; { if (last_scroll_bar_part != scroll_bar_handle || !GC_NILP (bar->dragging)) - construct_scroll_bar_click (bar, scroll_bar_end_scroll, timestamp, bufp); + construct_scroll_bar_click (bar, scroll_bar_end_scroll, bufp); HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), 0); set_scroll_bar_timer (kEventDurationForever); @@ -4336,11 +4191,10 @@ x_scroll_bar_handle_release (bar, timestamp, bufp) } static void -x_scroll_bar_handle_drag (win, bar, mouse_pos, timestamp, bufp) +x_scroll_bar_handle_drag (win, bar, mouse_pos, bufp) WindowPtr win; struct scroll_bar *bar; Point mouse_pos; - unsigned long timestamp; struct input_event *bufp; { ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); @@ -4360,13 +4214,13 @@ x_scroll_bar_handle_drag (win, bar, mouse_pos, timestamp, bufp) top_range = (XINT (bar->track_height) - (r.bottom - r.top)) * (1.0 + (float) GetControlViewSize (ch) / GetControl32BitMaximum (ch)) + .5; - + if (top < 0) top = 0; if (top > top_range) top = top_range; - construct_scroll_bar_click (bar, scroll_bar_handle, timestamp, bufp); + construct_scroll_bar_click (bar, scroll_bar_handle, bufp); XSETINT (bufp->x, top); XSETINT (bufp->y, top_range); } @@ -4404,7 +4258,7 @@ x_scroll_bar_handle_drag (win, bar, mouse_pos, timestamp, bufp) else if (part != last_scroll_bar_part || scroll_bar_timer_event_posted_p) { - construct_scroll_bar_click (bar, part, timestamp, bufp); + construct_scroll_bar_click (bar, part, bufp); last_scroll_bar_part = part; HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code); set_scroll_bar_timer (SCROLL_BAR_CONTINUOUS_DELAY); @@ -4475,11 +4329,11 @@ x_scroll_bar_create (w, top, left, width, height, disp_top, disp_height) r.bottom = disp_top + disp_height; #if TARGET_API_MAC_CARBON - ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", 1, 0, 0, 0, - kControlScrollBarProc, (long) bar); + ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height, + 0, 0, 0, kControlScrollBarProc, (long) bar); #else - ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", 1, 0, 0, 0, - scrollBarProc, (long) bar); + ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height, + 0, 0, 0, scrollBarProc, (long) bar); #endif SET_SCROLL_BAR_CONTROL_HANDLE (bar, ch); @@ -4604,10 +4458,12 @@ x_scroll_bar_remove (bar) UNBLOCK_INPUT; } + /* Set the handle of the vertical scroll bar for WINDOW to indicate that we are displaying PORTION characters out of a total of WHOLE characters, starting at POSITION. If WINDOW has no scroll bar, create one. */ + static void XTset_vertical_scroll_bar (w, portion, whole, position) struct window *w; @@ -4684,13 +4540,10 @@ XTset_vertical_scroll_bar (w, portion, whole, position) && XINT (bar->width) == sb_width && XINT (bar->height) == height)) { - /* Clear areas not covered by the scroll bar because it's not as - wide as the area reserved for it . This makes sure a - previous mode line display is cleared after C-x 2 C-x 1, for - example. */ - int area_width = WINDOW_SCROLL_BAR_AREA_WIDTH (w); + /* Since toolkit scroll bars are smaller than the space reserved + for them on the frame, we have to clear "under" them. */ XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), - left, top, area_width, height, 0); + left, top, width, height, 0); #if 0 if (sb_left + sb_width >= FRAME_PIXEL_WIDTH (f)) @@ -4702,7 +4555,8 @@ XTset_vertical_scroll_bar (w, portion, whole, position) MoveControl (ch, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, disp_top); SizeControl (ch, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, disp_height); - ShowControl (ch); + if (sb_width < disp_height) + ShowControl (ch); /* Remember new settings. */ XSETINT (bar->left, sb_left); @@ -4805,6 +4659,7 @@ XTredeem_scroll_bar (window) struct window *window; { struct scroll_bar *bar; + struct frame *f; /* We can't redeem this window's scroll bar if it doesn't have one. */ if (NILP (window->vertical_scroll_bar)) @@ -4813,36 +4668,33 @@ XTredeem_scroll_bar (window) bar = XSCROLL_BAR (window->vertical_scroll_bar); /* Unlink it from the condemned list. */ - { - FRAME_PTR f = XFRAME (WINDOW_FRAME (window)); - - if (NILP (bar->prev)) - { - /* If the prev pointer is nil, it must be the first in one of - the lists. */ - if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar)) - /* It's not condemned. Everything's fine. */ - return; - else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), - window->vertical_scroll_bar)) - FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next; - else - /* If its prev pointer is nil, it must be at the front of - one or the other! */ - abort (); - } - else - XSCROLL_BAR (bar->prev)->next = bar->next; + f = XFRAME (WINDOW_FRAME (window)); + if (NILP (bar->prev)) + { + /* If the prev pointer is nil, it must be the first in one of + the lists. */ + if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar)) + /* It's not condemned. Everything's fine. */ + return; + else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), + window->vertical_scroll_bar)) + FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next; + else + /* If its prev pointer is nil, it must be at the front of + one or the other! */ + abort (); + } + else + XSCROLL_BAR (bar->prev)->next = bar->next; - if (! NILP (bar->next)) - XSCROLL_BAR (bar->next)->prev = bar->prev; + if (! NILP (bar->next)) + XSCROLL_BAR (bar->next)->prev = bar->prev; - bar->next = FRAME_SCROLL_BARS (f); - bar->prev = Qnil; - XSETVECTOR (FRAME_SCROLL_BARS (f), bar); - if (! NILP (bar->next)) - XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); - } + bar->next = FRAME_SCROLL_BARS (f); + bar->prev = Qnil; + XSETVECTOR (FRAME_SCROLL_BARS (f), bar); + if (! NILP (bar->next)) + XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); } /* Remove all scroll bars on FRAME that haven't been saved since the @@ -4981,8 +4833,8 @@ x_scroll_bar_note_movement (bar, y_pos, t) #endif /* !USE_TOOLKIT_SCROLL_BARS */ -/* Return information to the user about the current position of the - mouse on the scroll bar. */ +/* Return information to the user about the current position of the mouse + on the scroll bar. */ static void x_scroll_bar_report_motion (fp, bar_window, part, x, y, time) @@ -5500,6 +5352,7 @@ mac_get_window_bounds (f, inner, outer) } + /* Calculate the absolute position in frame F from its current recorded position values and gravity. */ @@ -5731,7 +5584,6 @@ x_set_mouse_pixel_position (f, pix_x, pix_y) UNBLOCK_INPUT; #endif } - /* focus shifting, raising and lowering. */ @@ -5758,6 +5610,7 @@ x_unfocus_frame (f) } /* Raise frame F. */ + void x_raise_frame (f) struct frame *f; @@ -5771,6 +5624,7 @@ x_raise_frame (f) } /* Lower frame F. */ + void x_lower_frame (f) struct frame *f; @@ -5796,6 +5650,53 @@ XTframe_raise_lower (f, raise_flag) /* Change of visibility. */ +static void +mac_handle_visibility_change (f) + struct frame *f; +{ + WindowPtr wp = FRAME_MAC_WINDOW (f); + int visible = 0, iconified = 0; + struct input_event buf; + + if (IsWindowVisible (wp)) + if (IsWindowCollapsed (wp)) + iconified = 1; + else + visible = 1; + + if (!f->async_visible && visible) + { + if (f->iconified) + { + /* wait_reading_process_output will notice this and update + the frame's display structures. If we were made + invisible, we should not set garbaged, because that stops + redrawing on Update events. */ + SET_FRAME_GARBAGED (f); + + EVENT_INIT (buf); + buf.kind = DEICONIFY_EVENT; + XSETFRAME (buf.frame_or_window, f); + kbd_buffer_store_event (&buf); + } + else if (! NILP (Vframe_list) && ! NILP (XCDR (Vframe_list))) + /* Force a redisplay sooner or later to update the + frame titles in case this is the second frame. */ + record_asynch_buffer_change (); + } + else if (f->async_visible && !visible) + if (iconified) + { + EVENT_INIT (buf); + buf.kind = ICONIFY_EVENT; + XSETFRAME (buf.frame_or_window, f); + kbd_buffer_store_event (&buf); + } + + f->async_visible = visible; + f->async_iconified = iconified; +} + /* This tries to wait until the frame is really visible. However, if the window manager asks the user where to position the frame, this will return before the user finishes doing that. @@ -5820,29 +5721,32 @@ x_make_frame_visible (f) before the window gets really visible. */ if (! FRAME_ICONIFIED_P (f) && ! f->output_data.mac->asked_for_visible) - x_set_offset (f, f->left_pos, f->top_pos, 0); - - f->output_data.mac->asked_for_visible = 1; - #if TARGET_API_MAC_CARBON - if (!(FRAME_SIZE_HINTS (f)->flags & (USPosition | PPosition))) - { - struct frame *sf = SELECTED_FRAME (); - if (!FRAME_MAC_P (sf)) - RepositionWindow (FRAME_MAC_WINDOW (f), NULL, - kWindowCenterOnMainScreen); - else - RepositionWindow (FRAME_MAC_WINDOW (f), - FRAME_MAC_WINDOW (sf), + if (!(FRAME_SIZE_HINTS (f)->flags & (USPosition | PPosition))) + { + struct frame *sf = SELECTED_FRAME (); + if (!FRAME_MAC_P (sf)) + RepositionWindow (FRAME_MAC_WINDOW (f), NULL, + kWindowCenterOnMainScreen); + else + RepositionWindow (FRAME_MAC_WINDOW (f), + FRAME_MAC_WINDOW (sf), #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 - kWindowCascadeStartAtParentWindowScreen + kWindowCascadeStartAtParentWindowScreen #else - kWindowCascadeOnParentWindowScreen + kWindowCascadeOnParentWindowScreen #endif - ); - x_real_positions (f, &f->left_pos, &f->top_pos); - } + ); + x_real_positions (f, &f->left_pos, &f->top_pos); + } + else #endif + x_set_offset (f, f->left_pos, f->top_pos, 0); + + f->output_data.mac->asked_for_visible = 1; + + SelectWindow (FRAME_MAC_WINDOW (f)); + CollapseWindow (FRAME_MAC_WINDOW (f), false); ShowWindow (FRAME_MAC_WINDOW (f)); } @@ -5901,9 +5805,14 @@ void x_make_frame_invisible (f) struct frame *f; { + /* A deactivate event does not occur when the last visible frame is + made invisible. So if we clear the highlight here, it will not + be rehighlighted when it is made visible. */ +#if 0 /* Don't keep the highlight on an invisible frame. */ if (FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame == f) FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame = 0; +#endif BLOCK_INPUT; @@ -5916,17 +5825,11 @@ x_make_frame_invisible (f) HideWindow (FRAME_MAC_WINDOW (f)); - /* We can't distinguish this from iconification - just by the event that we get from the server. - So we can't win using the usual strategy of letting - FRAME_SAMPLE_VISIBILITY set this. So do it by hand, - and synchronize with the server to make sure we agree. */ - f->visible = 0; - FRAME_ICONIFIED_P (f) = 0; - f->async_visible = 0; - f->async_iconified = 0; - UNBLOCK_INPUT; + +#if !USE_CARBON_EVENTS + mac_handle_visibility_change (f); +#endif } /* Change window state from mapped to iconified. */ @@ -5935,21 +5838,37 @@ void x_iconify_frame (f) struct frame *f; { + OSErr err; + + /* A deactivate event does not occur when the last visible frame is + iconified. So if we clear the highlight here, it will not be + rehighlighted when it is deiconified. */ +#if 0 /* Don't keep the highlight on an invisible frame. */ if (FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame == f) FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame = 0; +#endif -#if 0 - /* Review: Since window is still visible in dock, still allow updates? */ if (f->async_iconified) return; -#endif BLOCK_INPUT; - CollapseWindow (FRAME_MAC_WINDOW (f), true); + FRAME_SAMPLE_VISIBILITY (f); + + if (! FRAME_VISIBLE_P (f)) + ShowWindow (FRAME_MAC_WINDOW (f)); + + err = CollapseWindow (FRAME_MAC_WINDOW (f), true); UNBLOCK_INPUT; + + if (err != noErr) + error ("Can't notify window manager of iconification"); + +#if !USE_CARBON_EVENTS + mac_handle_visibility_change (f); +#endif } @@ -6179,9 +6098,9 @@ x_get_font_info (f, font_idx) } /* the global font name table */ -char **font_name_table = NULL; -int font_name_table_size = 0; -int font_name_count = 0; +static char **font_name_table = NULL; +static int font_name_table_size = 0; +static int font_name_count = 0; /* Alist linking character set strings to Mac text encoding and Emacs coding system. */ @@ -7338,7 +7257,7 @@ x_load_font (f, fontname, size) /* Set global flag fonts_changed_p to non-zero if the font loaded has a character with a smaller width than any other character - before, or if the font loaded has a smalle>r height than any + before, or if the font loaded has a smaller height than any other font loaded before. If this happens, it will make a glyph matrix reallocation necessary. */ fonts_changed_p |= x_compute_min_glyph_bounds (f); @@ -7435,22 +7354,6 @@ x_find_ccl_program (fontp) #define MIN_DOC_SIZE 64 #define MAX_DOC_SIZE 32767 -#if 0 -/* sleep time for WaitNextEvent */ -#define WNE_SLEEP_AT_SUSPEND 10 -#define WNE_SLEEP_AT_RESUME 1 - -/* the flag appl_is_suspended is used both for determining the sleep - time to be passed to WaitNextEvent and whether the cursor should be - drawn when updating the display. The cursor is turned off when - Emacs is suspended. Redrawing it is unnecessary and what needs to - be done depends on whether the cursor lies inside or outside the - redraw region. So we might as well skip drawing it when Emacs is - suspended. */ -static Boolean app_is_suspended = false; -static long app_sleep_time = WNE_SLEEP_AT_RESUME; -#endif - #define EXTRA_STACK_ALLOC (256 * 1024) #define ARGV_STRING_LIST_ID 129 @@ -7485,19 +7388,17 @@ 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; +#endif /* 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. */ + used for passing an input event to the function back from + Carbon/Apple event handlers. */ static struct input_event *read_socket_inev = NULL; -#endif /* Set in term/mac-win.el to indicate that event loop can now generate drag and drop events. */ Lisp_Object Qmac_ready_for_drag_n_drop; -Lisp_Object drag_and_drop_file_list; - Point saved_menu_event_location; /* Apple Events */ @@ -7777,37 +7678,30 @@ do_window_update (WindowPtr win) { if (f->async_visible == 0) { + /* Update events may occur when a frame gets iconified. */ +#if 0 f->async_visible = 1; f->async_iconified = 0; SET_FRAME_GARBAGED (f); - - /* An update event is equivalent to MapNotify on X, so report - visibility changes properly. */ - if (! NILP(Vframe_list) && ! NILP (XCDR (Vframe_list))) - /* Force a redisplay sooner or later to update the - frame titles in case this is the second frame. */ - record_asynch_buffer_change (); +#endif } else - { + { Rect r; - #if TARGET_API_MAC_CARBON - { - RgnHandle region = NewRgn (); + RgnHandle region = NewRgn (); - GetPortVisibleRegion (GetWindowPort (win), region); - GetRegionBounds (region, &r); - expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top); - UpdateControls (win, region); - DisposeRgn (region); - } + GetPortVisibleRegion (GetWindowPort (win), region); + GetRegionBounds (region, &r); + expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top); + UpdateControls (win, region); + DisposeRgn (region); #else r = (*win->visRgn)->rgnBBox; expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top); UpdateControls (win, win->visRgn); #endif - } + } } EndUpdate (win); @@ -7833,20 +7727,12 @@ static void do_app_resume () { /* Window-activate events will do the job. */ -#if 0 - app_is_suspended = false; - app_sleep_time = WNE_SLEEP_AT_RESUME; -#endif } static void do_app_suspend () { /* Window-deactivate events will do the job. */ -#if 0 - app_is_suspended = true; - app_sleep_time = WNE_SLEEP_AT_SUSPEND; -#endif } @@ -8347,6 +8233,17 @@ mac_handle_window_event (next_handler, event, data) return noErr; } break; + + case kEventWindowShown: + case kEventWindowHidden: + case kEventWindowExpanded: + case kEventWindowCollapsed: + result = CallNextEventHandler (next_handler, event); + + mac_handle_visibility_change (mac_window_to_frame (wp)); + return noErr; + + break; } return eventNotHandledErr; @@ -8400,8 +8297,6 @@ mac_handle_mouse_event (next_handler, event, data) 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; } @@ -8424,7 +8319,11 @@ install_window_handler (window) #if USE_CARBON_EVENTS EventTypeSpec specs_window[] = {{kEventClassWindow, kEventWindowUpdate}, - {kEventClassWindow, kEventWindowBoundsChanging}}; + {kEventClassWindow, kEventWindowBoundsChanging}, + {kEventClassWindow, kEventWindowShown}, + {kEventClassWindow, kEventWindowHidden}, + {kEventClassWindow, kEventWindowExpanded}, + {kEventClassWindow, kEventWindowCollapsed}}; EventTypeSpec specs_mouse[] = {{kEventClassMouse, kEventMouseWheelMoved}}; static EventHandlerUPP handle_window_eventUPP = NULL; static EventHandlerUPP handle_mouse_eventUPP = NULL; @@ -8475,11 +8374,6 @@ do_ae_open_application(const AppleEvent *pae, AppleEvent *preply, long prefcon) } -/* Defined in mac.c. */ -extern int -path_from_vol_dir_name (char *, int, short, long, char *); - - /* Called when we receive an AppleEvent with an ID of "kAEOpenDocuments". This routine gets the direct parameter, extracts the FSSpecs in it, and puts their names on a list. */ @@ -8503,6 +8397,9 @@ do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon) DescType actual_type; Size actual_size; SelectionRange position; + Lisp_Object file_list = Qnil; + + xassert (read_socket_inev); err = AEGetParamDesc (message, keyDirectObject, typeAEList, &the_desc); if (err != noErr) @@ -8510,10 +8407,10 @@ do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon) err = AEGetParamPtr (message, keyAEPosition, typeChar, &actual_type, &position, sizeof(SelectionRange), &actual_size); if (err == noErr) - drag_and_drop_file_list = Fcons (list3 (make_number (position.lineNum + 1), - make_number (position.startRange + 1), - make_number (position.endRange + 1)), - drag_and_drop_file_list); + file_list = Fcons (list3 (make_number (position.lineNum + 1), + make_number (position.startRange + 1), + make_number (position.endRange + 1)), + file_list); /* Check to see that we got all of the required parameters from the event descriptor. For an 'odoc' event this should just be the @@ -8567,12 +8464,49 @@ do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon) sizeof (unix_path_name) - 1) == noErr) #endif /* x-dnd functions expect undecoded filenames. */ - drag_and_drop_file_list = - Fcons (make_unibyte_string (unix_path_name, - strlen (unix_path_name)), - drag_and_drop_file_list); + file_list = Fcons (make_unibyte_string (unix_path_name, + strlen (unix_path_name)), + file_list); } } + + /* Build a DRAG_N_DROP_EVENT type event as is done in + constuct_drag_n_drop in w32term.c. */ + if (!NILP (file_list)) + { + struct frame *f = mac_focus_frame (&one_mac_display_info); + WindowPtr wp; + Lisp_Object frame; + + read_socket_inev->kind = DRAG_N_DROP_EVENT; + read_socket_inev->code = 0; + read_socket_inev->modifiers = 0; + + XSETINT (read_socket_inev->x, 0); + XSETINT (read_socket_inev->y, 0); + + XSETFRAME (frame, f); + read_socket_inev->frame_or_window = Fcons (frame, file_list); + +#if 0 + /* Regardless of whether Emacs was suspended or in the + foreground, ask it to redraw its entire screen. Otherwise + parts of the screen can be left in an inconsistent + state. */ + wp = FRAME_MAC_WINDOW (f); + if (wp) +#if TARGET_API_MAC_CARBON + { + Rect r; + + GetWindowPortBounds (wp, &r); + InvalWindowRect (wp, &r); + } +#else /* not TARGET_API_MAC_CARBON */ + InvalRect (&(wp->portRect)); +#endif /* not TARGET_API_MAC_CARBON */ +#endif + } } error_exit: @@ -8665,11 +8599,12 @@ mac_do_receive_drag (WindowPtr window, void *handlerRefCon, ItemReference theItem; HFSFlavor data; Size size = sizeof (HFSFlavor); + Lisp_Object file_list; if (GetFrontWindowOfClass (kMovableModalWindowClass, false)) return dragNotAcceptedErr; - drag_and_drop_file_list = Qnil; + file_list = Qnil; GetDragMouse (theDrag, &mouse, 0L); CountDragItems (theDrag, &items); for (index = 1; index <= items; index++) @@ -8695,15 +8630,14 @@ mac_do_receive_drag (WindowPtr window, void *handlerRefCon, sizeof (unix_path_name) - 1) == noErr) #endif /* x-dnd functions expect undecoded filenames. */ - drag_and_drop_file_list = - Fcons (make_unibyte_string (unix_path_name, - strlen (unix_path_name)), - drag_and_drop_file_list); + file_list = Fcons (make_unibyte_string (unix_path_name, + strlen (unix_path_name)), + file_list); } } /* If there are items in the list, construct an event and post it to the queue like an interrupt using kbd_buffer_store_event. */ - if (!NILP (drag_and_drop_file_list)) + if (!NILP (file_list)) { struct input_event event; Lisp_Object frame; @@ -8720,7 +8654,7 @@ mac_do_receive_drag (WindowPtr window, void *handlerRefCon, XSETINT (event.x, mouse.h); XSETINT (event.y, mouse.v); XSETFRAME (frame, f); - event.frame_or_window = Fcons (frame, drag_and_drop_file_list); + event.frame_or_window = Fcons (frame, file_list); event.arg = Qnil; /* Post to the interrupt queue */ kbd_buffer_store_event (&event); @@ -8979,6 +8913,7 @@ XTread_socket (sd, expected, hold_quit) { int do_help = 0; struct frame *f; + unsigned long timestamp; /* It is necessary to set this (additional) argument slot of an event to nil because keyboard.c protects incompletely @@ -8989,6 +8924,12 @@ XTread_socket (sd, expected, hold_quit) inev.arg = Qnil; #if USE_CARBON_EVENTS + timestamp = GetEventTime (eventRef) / kEventDurationMillisecond; +#else + timestamp = er.when * (1000 / 60); /* ticks to milliseconds */ +#endif + +#if USE_CARBON_EVENTS /* Handle new events */ if (!mac_convert_event_ref (eventRef, &er)) { @@ -9089,8 +9030,6 @@ XTread_socket (sd, expected, hold_quit) #endif XSETINT (inev.x, mouse_loc.h); XSETINT (inev.y, mouse_loc.v); - inev.timestamp = er.when * (1000 / 60); - /* ticks to milliseconds */ if (dpyinfo->grabbed && tracked_scroll_bar || ch != 0 @@ -9124,10 +9063,9 @@ XTread_socket (sd, expected, hold_quit) &er, &inev); else if (er.what == mouseDown) x_scroll_bar_handle_press (bar, control_part_code, - inev.timestamp, &inev); + &inev); else - x_scroll_bar_handle_release (bar, inev.timestamp, - &inev); + x_scroll_bar_handle_release (bar, &inev); #else /* not USE_TOOLKIT_SCROLL_BARS */ x_scroll_bar_handle_click (bar, control_part_code, &er, &inev); @@ -9301,8 +9239,7 @@ XTread_socket (sd, expected, hold_quit) if (dpyinfo->grabbed && tracked_scroll_bar) #ifdef USE_TOOLKIT_SCROLL_BARS x_scroll_bar_handle_drag (wp, tracked_scroll_bar, - mouse_pos, er.when * (1000 / 60), - &inev); + mouse_pos, &inev); #else /* not USE_TOOLKIT_SCROLL_BARS */ x_scroll_bar_note_movement (tracked_scroll_bar, mouse_pos.v @@ -9390,11 +9327,10 @@ XTread_socket (sd, expected, hold_quit) EVENT_INIT (event); event.kind = NO_EVENT; - x_scroll_bar_handle_release (tracked_scroll_bar, - er.when * (1000 / 60), - &event); + x_scroll_bar_handle_release (tracked_scroll_bar, &event); if (event.kind != NO_EVENT) { + event.timestamp = timestamp; kbd_buffer_store_event_hold (&event, hold_quit); count++; } @@ -9470,6 +9406,7 @@ XTread_socket (sd, expected, hold_quit) event.kind = LANGUAGE_CHANGE_EVENT; event.arg = Qnil; event.code = current_key_script; + event.timestamp = timestamp; kbd_buffer_store_event (&event); count++; } @@ -9534,58 +9471,18 @@ XTread_socket (sd, expected, hold_quit) #else inev.modifiers = mac_to_emacs_modifiers (er.modifiers); #endif + inev.modifiers |= (extra_keyboard_modifiers + & (meta_modifier | alt_modifier + | hyper_modifier | super_modifier)); XSETFRAME (inev.frame_or_window, mac_focus_frame (dpyinfo)); - inev.timestamp = er.when * (1000 / 60); /* ticks to milliseconds */ break; case kHighLevelEvent: - drag_and_drop_file_list = Qnil; - - AEProcessAppleEvent(&er); - - /* Build a DRAG_N_DROP_EVENT type event as is done in - constuct_drag_n_drop in w32term.c. */ - if (!NILP (drag_and_drop_file_list)) - { - struct frame *f = mac_focus_frame (dpyinfo); - WindowPtr wp; - Lisp_Object frame; - - inev.kind = DRAG_N_DROP_EVENT; - inev.code = 0; - inev.timestamp = er.when * (1000 / 60); - /* ticks to milliseconds */ -#if USE_CARBON_EVENTS - inev.modifiers = mac_event_to_emacs_modifiers (eventRef); -#else - inev.modifiers = mac_to_emacs_modifiers (er.modifiers); -#endif - - XSETINT (inev.x, 0); - XSETINT (inev.y, 0); - - XSETFRAME (frame, f); - inev.frame_or_window = Fcons (frame, drag_and_drop_file_list); - -#if 0 - /* Regardless of whether Emacs was suspended or in the - foreground, ask it to redraw its entire screen. - Otherwise parts of the screen can be left in an - inconsistent state. */ - wp = FRAME_MAC_WINDOW (f); - if (wp) -#if TARGET_API_MAC_CARBON - { - Rect r; + read_socket_inev = &inev; + AEProcessAppleEvent (&er); + read_socket_inev = NULL; + break; - GetWindowPortBounds (wp, &r); - InvalWindowRect (wp, &r); - } -#else /* not TARGET_API_MAC_CARBON */ - InvalRect (&(wp->portRect)); -#endif /* not TARGET_API_MAC_CARBON */ -#endif - } default: break; } @@ -9595,6 +9492,7 @@ XTread_socket (sd, expected, hold_quit) if (inev.kind != NO_EVENT) { + inev.timestamp = timestamp; kbd_buffer_store_event_hold (&inev, hold_quit); count++; } @@ -9634,6 +9532,29 @@ XTread_socket (sd, expected, hold_quit) pending_autoraise_frame = 0; } +#if !USE_CARBON_EVENTS + /* Check which frames are still visible. We do this here because + there doesn't seem to be any direct notification from the Window + Manager that the visibility of a window has changed (at least, + not in all cases). */ + { + Lisp_Object tail, frame; + + FOR_EACH_FRAME (tail, frame) + { + struct frame *f = XFRAME (frame); + + /* The tooltip has been drawn already. Avoid the + SET_FRAME_GARBAGED in mac_handle_visibility_change. */ + if (EQ (frame, tip_frame)) + continue; + + if (FRAME_MAC_P (f)) + mac_handle_visibility_change (f); + } + } +#endif + UNBLOCK_INPUT; return count; } @@ -10067,7 +9988,7 @@ mac_check_for_quit_char () kbd_buffer_store_event (&e); } } -#endif /* MAC_OSX */ +#endif /* MAC_OSX */ static void init_menu_bar () @@ -10171,7 +10092,6 @@ mac_initialize () bottom */ baud_rate = 19200; - x_noop_count = 0; last_tool_bar_item = -1; any_help_event_p = 0; @@ -10243,12 +10163,6 @@ syms_of_macterm () staticpro (&last_mouse_scroll_bar); last_mouse_scroll_bar = Qnil; - staticpro (&Qvendor_specific_keysyms); - Qvendor_specific_keysyms = intern ("vendor-specific-keysyms"); - - staticpro (&last_mouse_press_frame); - last_mouse_press_frame = Qnil; - Qmac_ready_for_drag_n_drop = intern ("mac-ready-for-drag-n-drop"); staticpro (&Qmac_ready_for_drag_n_drop); @@ -10260,14 +10174,6 @@ syms_of_macterm () Vx_toolkit_scroll_bars = Qnil; #endif - 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. */); - x_use_underline_position_properties = 0; - staticpro (&last_mouse_motion_frame); last_mouse_motion_frame = Qnil; @@ -10292,7 +10198,7 @@ useful for non-standard keyboard layouts. */); doc: /* t means that when the option-key is held down while pressing the mouse button, the click will register as mouse-2 and while the command-key is held down, the click will register as mouse-3. -'reverse means that the the option-key will register for mouse-3 +'reverse means that the option-key will register for mouse-3 and the command-key will register for mouse-2. nil means that no emulation should be done and the modifiers should be placed on the mouse-1 event. */); diff --git a/src/macterm.h b/src/macterm.h index ea5f7db6084..948fa486aba 100644 --- a/src/macterm.h +++ b/src/macterm.h @@ -1,5 +1,6 @@ /* Display module for Mac OS. - Copyright (C) 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -38,11 +39,6 @@ Boston, MA 02110-1301, USA. */ #define BLACK_PIX_DEFAULT(f) RGB_TO_ULONG(0,0,0) #define WHITE_PIX_DEFAULT(f) RGB_TO_ULONG(255,255,255) -/* A black pixel in a mask bitmap/pixmap means ``draw a source - pixel''. A white pixel means ``retain the current pixel''. */ -#define PIX_MASK_DRAW(f) BLACK_PIX_DEFAULT(f) -#define PIX_MASK_RETAIN(f) WHITE_PIX_DEFAULT(f) - #define FONT_WIDTH(f) ((f)->max_bounds.width) #define FONT_HEIGHT(f) ((f)->ascent + (f)->descent) #define FONT_BASE(f) ((f)->ascent) @@ -149,7 +145,7 @@ struct mac_display_info int smallest_font_height; /* Reusable Graphics Context for drawing a cursor in a non-default face. */ - XGCValues *scratch_cursor_gc; + GC scratch_cursor_gc; /* These variables describe the range of text currently shown in its mouse-face, together with the window they apply to. As long as @@ -388,7 +384,7 @@ struct mac_output { /* Relief GCs, colors etc. */ struct relief { - XGCValues *gc; + GC gc; unsigned long pixel; int allocated_p; } @@ -598,6 +594,8 @@ EXFUN (Fx_display_color_p, 1); EXFUN (Fx_display_grayscale_p, 1); EXFUN (Fx_display_planes, 1); extern void x_free_gcs P_ ((struct frame *)); +extern int XParseGeometry P_ ((char *, int *, int *, unsigned int *, + unsigned int *)); /* Defined in macterm.c. */ @@ -611,6 +609,7 @@ extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, WindowPtr, char *, unsigned long, unsigned long, unsigned int)); extern void XFreePixmap P_ ((Display *, Pixmap)); +extern GC XCreateGC P_ ((Display *, Window, unsigned long, XGCValues *)); extern void XSetForeground P_ ((Display *, GC, unsigned long)); extern void XSetBackground P_ ((Display *, GC, unsigned long)); extern void XSetWindowBackground P_ ((Display *, WindowPtr, unsigned long)); diff --git a/src/makefile.w32-in b/src/makefile.w32-in index a4084046fac..1ee232949d9 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -1,5 +1,6 @@ # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API. -# Copyright (c) 2000-2001, 2004 Free Software Foundation, Inc. +# Copyright (C) 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. # # This file is part of GNU Emacs. # diff --git a/src/marker.c b/src/marker.c index d6029c79c9d..11b077761e5 100644 --- a/src/marker.c +++ b/src/marker.c @@ -1,5 +1,6 @@ /* Markers: examining, setting and deleting. - Copyright (C) 1985, 1997, 1998, 2003 Free Software Foundation, Inc. + Copyright (C) 1985, 1997, 1998, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/md5.c b/src/md5.c index 039213fd76b..4f055447eac 100644 --- a/src/md5.c +++ b/src/md5.c @@ -1,6 +1,7 @@ /* Functions to compute MD5 message digest of files or memory blocks. according to the definition of MD5 in RFC 1321 from April 1992. - Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1999, 2000, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of the GNU Emacs. The GNU C Library is free software; you can redistribute it and/or diff --git a/src/md5.h b/src/md5.h index 229da8daa8d..adcc6bf48f6 100644 --- a/src/md5.h +++ b/src/md5.h @@ -1,6 +1,7 @@ /* Declaration of functions and data types used for MD5 sum computing library functions. - Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1999, 2000, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. The GNU C Library is free software; you can redistribute it and/or diff --git a/src/mem-limits.h b/src/mem-limits.h index aac8a396172..d7ac6a3e366 100644 --- a/src/mem-limits.h +++ b/src/mem-limits.h @@ -1,5 +1,6 @@ /* Includes for memory limit warnings. - Copyright (C) 1990, 93, 94, 95, 1996, 2004 Free Software Foundation, Inc. + Copyright (C) 1990, 1993, 1994, 1995, 1996, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/minibuf.c b/src/minibuf.c index e04be1465ed..8f07a4603c4 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1,6 +1,6 @@ /* Minibuffer input and completion. - Copyright (C) 1985,86,93,94,95,96,97,98,99,2000,01,03,04,05 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -350,7 +350,7 @@ BUFFER can be a buffer or a buffer name. */) DEFUN ("minibuffer-prompt-end", Fminibuffer_prompt_end, Sminibuffer_prompt_end, 0, 0, 0, doc: /* Return the buffer position of the end of the minibuffer prompt. -Return (point-min) if current buffer is not a mini-buffer. */) +Return (point-min) if current buffer is not a minibuffer. */) () { /* This function is written to be most efficient when there's a prompt. */ @@ -1019,7 +1019,7 @@ DEFUN ("eval-minibuffer", Feval_minibuffer, Seval_minibuffer, 1, 2, 0, Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS is a string to insert in the minibuffer before reading. \(INITIAL-CONTENTS can also be a cons of a string and an integer. Such -arguments are used as in `read-from-minibuffer') */) +arguments are used as in `read-from-minibuffer'.) */) (prompt, initial_contents) Lisp_Object prompt, initial_contents; { @@ -1763,7 +1763,7 @@ the values STRING, PREDICATE and `lambda'. */) || NILP (alist)) { tem = Fassoc_string (string, alist, completion_ignore_case ? Qt : Qnil); - if NILP (tem) + if (NILP (tem)) return Qnil; } else if (VECTORP (alist)) diff --git a/src/mktime.c b/src/mktime.c index c61f1463564..025f54d95c2 100644 --- a/src/mktime.c +++ b/src/mktime.c @@ -1,5 +1,6 @@ /* Convert a `struct tm' to a time_t value. - Copyright (C) 1993, 94, 95, 96, 97, 98, 99 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. Contributed by Paul Eggert (eggert@twinsun.com). NOTE: The canonical source of this file is maintained with the GNU C Library. diff --git a/src/msdos.c b/src/msdos.c index 07ee522f98f..4ea4ab0cf1d 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -1,6 +1,6 @@ /* MS-DOS specific C utilities. -*- coding: raw-text -*- - Copyright (C) 1993, 94, 95, 96, 97, 1999, 2000, 01, 2003 - Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, + 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/msdos.h b/src/msdos.h index 7f2f013fd13..b6c6aca1493 100644 --- a/src/msdos.h +++ b/src/msdos.h @@ -1,5 +1,6 @@ /* MS-DOS specific C utilities, interface. - Copyright (C) 1993, 2001 Free Software Foundation, Inc. + Copyright (C) 1993, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/prefix-args.c b/src/prefix-args.c index 8c4043f83cb..c2f6303786f 100644 --- a/src/prefix-args.c +++ b/src/prefix-args.c @@ -1,5 +1,5 @@ /* prefix-args.c - echo each argument, prefixed by a string. - Copyright (C) 1992 Free Software Foundation, Inc. + Copyright (C) 1992, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/print.c b/src/print.c index 6150ff2efe6..65c48b6d82b 100644 --- a/src/print.c +++ b/src/print.c @@ -1,6 +1,7 @@ /* Lisp object printing and output streams. - Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, - 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, + 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/process.c b/src/process.c index 3879821c2fa..f23b8368f6d 100644 --- a/src/process.c +++ b/src/process.c @@ -1,6 +1,7 @@ /* Asynchronous subprocess control for GNU Emacs. - Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1998, 1999, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, + 1996, 1998, 1999, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -293,7 +294,10 @@ static Lisp_Object Vprocess_adaptive_read_buffering; #include "sysselect.h" -extern int keyboard_bit_set P_ ((SELECT_TYPE *)); +static int keyboard_bit_set P_ ((SELECT_TYPE *)); +static void deactivate_process P_ ((Lisp_Object)); +static void status_notify P_ ((struct Lisp_Process *)); +static int read_process_output P_ ((Lisp_Object, int)); /* If we support a window system, turn on the code to poll periodically to detect C-g. It isn't actually used when doing interrupt input. */ @@ -390,9 +394,9 @@ static char pty_name[24]; /* Compute the Lisp form of the process status, p->status, from the numeric status that was returned by `wait'. */ -Lisp_Object status_convert (); +static Lisp_Object status_convert (); -void +static void update_status (p) struct Lisp_Process *p; { @@ -406,7 +410,7 @@ update_status (p) /* Convert a process status word in Unix format to the list that we use internally. */ -Lisp_Object +static Lisp_Object status_convert (w) WAITTYPE w; { @@ -425,7 +429,7 @@ status_convert (w) /* Given a status-list, extract the three pieces of information and store them individually through the three pointers. */ -void +static void decode_status (l, symbol, code, coredump) Lisp_Object l; Lisp_Object *symbol; @@ -504,7 +508,7 @@ status_message (p) The file name of the terminal corresponding to the pty is left in the variable pty_name. */ -int +static int allocate_pty () { register int c, i; @@ -589,7 +593,7 @@ allocate_pty () } #endif /* HAVE_PTYS */ -Lisp_Object +static Lisp_Object make_process (name) Lisp_Object name; { @@ -633,7 +637,7 @@ make_process (name) return val; } -void +static void remove_process (proc) register Lisp_Object proc; { @@ -767,23 +771,27 @@ nil, indicating the current buffer's process. */) (process) register Lisp_Object process; { + register struct Lisp_Process *p; + process = get_process (process); - XPROCESS (process)->raw_status_low = Qnil; - XPROCESS (process)->raw_status_high = Qnil; - if (NETCONN_P (process)) + p = XPROCESS (process); + + p->raw_status_low = Qnil; + p->raw_status_high = Qnil; + if (NETCONN1_P (p)) { - XPROCESS (process)->status = Fcons (Qexit, Fcons (make_number (0), Qnil)); - XSETINT (XPROCESS (process)->tick, ++process_tick); - status_notify (); + p->status = Fcons (Qexit, Fcons (make_number (0), Qnil)); + XSETINT (p->tick, ++process_tick); + status_notify (p); } - else if (XINT (XPROCESS (process)->infd) >= 0) + else if (XINT (p->infd) >= 0) { Fkill_process (process, Qnil); /* Do this now, since remove_process will make sigchld_handler do nothing. */ - XPROCESS (process)->status + p->status = Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil)); - XSETINT (XPROCESS (process)->tick, ++process_tick); - status_notify (); + XSETINT (p->tick, ++process_tick); + status_notify (p); } remove_process (process); return Qnil; @@ -1237,7 +1245,7 @@ IP address. Returns nil if format of ADDRESS is invalid. */) } #endif -Lisp_Object +static Lisp_Object list_processes_1 (query_only) Lisp_Object query_only; { @@ -1707,7 +1715,7 @@ start_process_unwind (proc) return Qnil; } -void +static void create_process_1 (timer) struct atimer *timer; { @@ -2530,7 +2538,7 @@ OPTION is not a supported option, return nil instead; otherwise return t. */) /* A version of request_sigio suitable for a record_unwind_protect. */ -Lisp_Object +static Lisp_Object unwind_request_sigio (dummy) Lisp_Object dummy; { @@ -4221,7 +4229,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, /* It's okay for us to do this and then continue with the loop, since timeout has already been zeroed out. */ clear_waiting_for_input (); - status_notify (); + status_notify (NULL); } } @@ -4739,7 +4747,7 @@ read_process_output_error_handler (error) The characters read are decoded according to PROC's coding-system for decoding. */ -int +static int read_process_output (proc, channel) Lisp_Object proc; register int channel; @@ -5130,7 +5138,7 @@ send_process_trap () This function can evaluate Lisp code and can garbage collect. */ -void +static void send_process (proc, buf, len, object) volatile Lisp_Object proc; unsigned char *volatile buf; @@ -5724,7 +5732,7 @@ process_send_signal (process, signo, current_group, nomsg) p->status = Qrun; XSETINT (p->tick, ++process_tick); if (!nomsg) - status_notify (); + status_notify (NULL); break; #endif /* ! defined (SIGCONT) */ case SIGINT: @@ -6392,8 +6400,9 @@ exec_sentinel (proc, reason) This is usually done while Emacs is waiting for keyboard input but can be done at other times. */ -void -status_notify () +static void +status_notify (deleting_process) + struct Lisp_Process *deleting_process; { register Lisp_Object proc, buffer; Lisp_Object tail, msg; @@ -6429,6 +6438,7 @@ status_notify () && ! EQ (p->status, Qlisten) && ! EQ (p->command, Qt) /* Network process not stopped. */ && XINT (p->infd) >= 0 + && p != deleting_process && read_process_output (proc, XINT (p->infd)) > 0); buffer = p->buffer; @@ -6624,7 +6634,7 @@ delete_keyboard_wait_descriptor (desc) /* Return nonzero if *MASK has a bit set that corresponds to one of the keyboard input descriptors. */ -int +static int keyboard_bit_set (mask) SELECT_TYPE *mask; { diff --git a/src/process.h b/src/process.h index a58b08a197e..cadc9b7031c 100644 --- a/src/process.h +++ b/src/process.h @@ -1,5 +1,6 @@ /* Definitions for asynchronous process control in GNU Emacs. - Copyright (C) 1985, 1994 Free Software Foundation, Inc. + Copyright (C) 1985, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/puresize.h b/src/puresize.h index 2e7637c6724..7951f7ecbf2 100644 --- a/src/puresize.h +++ b/src/puresize.h @@ -1,5 +1,5 @@ /* How much read-only Lisp storage a dumped Emacs needs. - Copyright (C) 1993, 2002 Free Software Foundation, Inc. + Copyright (C) 1993, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/ralloc.c b/src/ralloc.c index 824fb536fc1..35a8cb9c58a 100644 --- a/src/ralloc.c +++ b/src/ralloc.c @@ -1,5 +1,6 @@ /* Block-relocating memory allocator. - Copyright (C) 1993, 1995, 2000 Free Software Foundation, Inc. + Copyright (C) 1993, 1995, 2000, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/regex.c b/src/regex.c index c82bdb0edd9..fd18864110b 100644 --- a/src/regex.c +++ b/src/regex.c @@ -2,7 +2,8 @@ 0.12. (Implements POSIX draft P1003.2/D11.2, except for some of the internationalization features.) - Copyright (C) 1993,94,95,96,97,98,99,2000,04 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/regex.h b/src/regex.h index 89532b7ee9f..557700dc93d 100644 --- a/src/regex.h +++ b/src/regex.h @@ -1,7 +1,8 @@ /* Definitions for data structures and routines for the regular expression library, version 0.12. - Copyright (C) 1985,89,90,91,92,93,95,2000 Free Software Foundation, Inc. + Copyright (C) 1985, 1989, 1990, 1991, 1992, 1993, 1995, 2000, 2002, + 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/region-cache.c b/src/region-cache.c index 22eac35ca86..d49278eb886 100644 --- a/src/region-cache.c +++ b/src/region-cache.c @@ -1,6 +1,6 @@ /* Caching facts about regions of the buffer, for optimization. - Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1995 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1995, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/region-cache.h b/src/region-cache.h index 5c27d00740f..51d2ceb1e62 100644 --- a/src/region-cache.h +++ b/src/region-cache.h @@ -1,5 +1,6 @@ /* Header file: Caching facts about regions of the buffer, for optimization. - Copyright (C) 1985, 1986, 1993, 1995 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1993, 1995, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/aix3-1.h b/src/s/aix3-1.h index 8fe7bd8fa24..eedfe3d15be 100644 --- a/src/s/aix3-1.h +++ b/src/s/aix3-1.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on IBM AIX version 3.1 - Copyright (C) 1985, 1986, 1990, 1999 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1990, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/bsd4-1.h b/src/s/bsd4-1.h index 7316841e212..f36bc016ca8 100644 --- a/src/s/bsd4-1.h +++ b/src/s/bsd4-1.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on bsd 4.1. - Copyright (C) 1985, 1986, 1999 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/bsd4-2.h b/src/s/bsd4-2.h index 386ab1bbbe5..f4e60b0fdbd 100644 --- a/src/s/bsd4-2.h +++ b/src/s/bsd4-2.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on bsd 4.2 - Copyright (C) 1985, 1986, 1994 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/bsd4-3.h b/src/s/bsd4-3.h index bbb2715bdf7..37d6a63e984 100644 --- a/src/s/bsd4-3.h +++ b/src/s/bsd4-3.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on bsd 4.3 - Copyright (C) 1985, 1986 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/cxux.h b/src/s/cxux.h index 2af6d006095..118d93d579c 100644 --- a/src/s/cxux.h +++ b/src/s/cxux.h @@ -1,5 +1,5 @@ /* Header file for Harris CXUX. - Copyright (C) 1994 Free Software Foundation, Inc. + Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/cygwin.h b/src/s/cygwin.h index 0094ef793dc..921cff35bc7 100644 --- a/src/s/cygwin.h +++ b/src/s/cygwin.h @@ -1,7 +1,8 @@ /* Template for system description header files. This file describes the parameters that system description files should define or not. - Copyright (C) 1985, 1986, 1992, 1999 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1992, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -123,8 +124,6 @@ Boston, MA 02110-1301, USA. */ emacs lisp pointers */ #define DATA_SEG_BITS 0x20000000 #define LINKER $(CC) -Wl,--image-base,DATA_SEG_BITS -/* gettext.h is in a strange place */ -#define C_SWITCH_SYSTEM -I/usr/share/gettext /* Use terminfo instead of termcap. Fewer environment variables to go wrong, more terminal types. */ diff --git a/src/s/darwin.h b/src/s/darwin.h index fea5b4c282d..fad445d7557 100644 --- a/src/s/darwin.h +++ b/src/s/darwin.h @@ -1,5 +1,5 @@ /* System description header file for Darwin (Mac OS X). - Copyright (C) 2001, 02, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/dgux.h b/src/s/dgux.h index fb01b539f27..82956a900d9 100644 --- a/src/s/dgux.h +++ b/src/s/dgux.h @@ -1,6 +1,7 @@ /* Definitions file for GNU Emacs running on Data General's DG/UX version 4.32 upto and including 5.4.1. - Copyright (C) 1994, 1999 Free Software Foundation, Inc. + Copyright (C) 1994, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/dgux4.h b/src/s/dgux4.h index d866d63e6ce..35834ad4da2 100644 --- a/src/s/dgux4.h +++ b/src/s/dgux4.h @@ -1,6 +1,6 @@ /* Definitions file for GNU Emacs running on Data General's DG/UX Release 4.10 and above. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/dgux5-4-3.h b/src/s/dgux5-4-3.h index a95420595a1..7ec88a435eb 100644 --- a/src/s/dgux5-4-3.h +++ b/src/s/dgux5-4-3.h @@ -1,6 +1,6 @@ /* Definitions file for GNU Emacs running on Data General's DG/UX version 5.4 Release 3.00 and above. - Copyright (C) 1994 Free Software Foundation, Inc. + Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/dgux5-4r2.h b/src/s/dgux5-4r2.h index c2c7461a204..3f059c32c24 100644 --- a/src/s/dgux5-4r2.h +++ b/src/s/dgux5-4r2.h @@ -1,6 +1,6 @@ /* Definitions file for GNU Emacs running on Data General's DG/UX 5.4 Release 2.xx systems. - Copyright (C) 1994 Free Software Foundation, Inc. + Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/freebsd.h b/src/s/freebsd.h index dc26eb9f399..83949fd2819 100644 --- a/src/s/freebsd.h +++ b/src/s/freebsd.h @@ -1,8 +1,8 @@ /* System description header for FreeBSD systems. This file describes the parameters that system description files should define or not. - Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, + 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h index 2563496af5c..f87dcaded1b 100644 --- a/src/s/gnu-linux.h +++ b/src/s/gnu-linux.h @@ -1,5 +1,6 @@ /* This file is the configuration file for Linux-based GNU systems - Copyright (C) 1985, 86, 92, 94, 96, 1999, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1992, 1994, 1996, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/gnu.h b/src/s/gnu.h index 79e5a88a7b9..0da816c32d3 100644 --- a/src/s/gnu.h +++ b/src/s/gnu.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on the GNU Hurd. - Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/hpux.h b/src/s/hpux.h index 665b1f3063d..30ade71bf20 100644 --- a/src/s/hpux.h +++ b/src/s/hpux.h @@ -1,6 +1,7 @@ /* Definitions file for GNU Emacs running on HPUX release 7.0. Based on AT&T System V.2. - Copyright (C) 1985, 1986, 1999 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/iris3-5.h b/src/s/iris3-5.h index 8815bb56f39..a3b6c8ad0ad 100644 --- a/src/s/iris3-5.h +++ b/src/s/iris3-5.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on Silicon Graphics 3.5 - Copyright (C) 1987, 1999 Free Software Foundation, Inc. + Copyright (C) 1987, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/iris3-6.h b/src/s/iris3-6.h index 64187428c29..1d8b96cc23f 100644 --- a/src/s/iris3-6.h +++ b/src/s/iris3-6.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on Silicon Graphics system 3.6. - Copyright (C) 1987, 1999 Free Software Foundation, Inc. + Copyright (C) 1987, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/irix3-3.h b/src/s/irix3-3.h index 60dd6d49c79..a613779913a 100644 --- a/src/s/irix3-3.h +++ b/src/s/irix3-3.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on Silicon Graphics Irix system 3.3. - Copyright (C) 1987, 1990, 1999 Free Software Foundation, Inc. + Copyright (C) 1987, 1990, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/lynxos.h b/src/s/lynxos.h index 55de8cba6f9..614735d290d 100644 --- a/src/s/lynxos.h +++ b/src/s/lynxos.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on LynxOS-3.0.1 - Copyright (C) 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index c4697db34db..b1989318fba 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h @@ -1,5 +1,6 @@ /* System description file for Windows NT. - Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1995, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/msdos.h b/src/s/msdos.h index 5a0cbba5959..9469b33227f 100644 --- a/src/s/msdos.h +++ b/src/s/msdos.h @@ -1,6 +1,7 @@ /* System description file for MS-DOS - Copyright (C) 1993, 1996, 1997, 2001 Free Software Foundation, Inc. + Copyright (C) 1993, 1996, 1997, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/newsos5.h b/src/s/newsos5.h index c674bfc559d..d2bed2189be 100644 --- a/src/s/newsos5.h +++ b/src/s/newsos5.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on Sony's NEWS-OS 5.0.2 - Copyright (C) 1992, 1994 Free Software Foundation, Inc. + Copyright (C) 1992, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/nextstep.h b/src/s/nextstep.h index 9253e6acffc..0c0b01c10bd 100644 --- a/src/s/nextstep.h +++ b/src/s/nextstep.h @@ -1,5 +1,6 @@ /* Configuration file for the NeXTstep system. - Copyright (C) 1990, 1995 Free Software Foundation, Inc. + Copyright (C) 1990, 1995, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/ptx.h b/src/s/ptx.h index e490ba659a2..1411dee70d8 100644 --- a/src/s/ptx.h +++ b/src/s/ptx.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on Sequent DYNIX/ptx 1.x/2.x - Copyright (C) 1987, 1990, 1999 Free Software Foundation, Inc. + Copyright (C) 1987, 1990, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/riscix1-1.h b/src/s/riscix1-1.h index ccfa5704b85..aee5d6ddc58 100644 --- a/src/s/riscix1-1.h +++ b/src/s/riscix1-1.h @@ -1,5 +1,5 @@ /* Definitions file for GNU Emacs running on RISCiX 1.1 (bsd 4.3) - Copyright (C) 1994 Free Software Foundation, Inc. + Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/riscix12.h b/src/s/riscix12.h index b0e00e780cc..625b667d7b5 100644 --- a/src/s/riscix12.h +++ b/src/s/riscix12.h @@ -1,5 +1,5 @@ /* Definitions file for GNU Emacs running on RISCiX 1.2 (bsd 4.3) - Copyright (C) 1994 Free Software Foundation, Inc. + Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/rtu.h b/src/s/rtu.h index 92afbaf6328..b2d0c16e59a 100644 --- a/src/s/rtu.h +++ b/src/s/rtu.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on RTU 3.0, ucb universe. - Copyright (C) 1986, 1999 Free Software Foundation, Inc. + Copyright (C) 1986, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/sco4.h b/src/s/sco4.h index 757eb0b57b0..627007e9a52 100644 --- a/src/s/sco4.h +++ b/src/s/sco4.h @@ -1,5 +1,6 @@ /* System description file for SCO 3.2v4. - Copyright (C) 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/sco5.h b/src/s/sco5.h index e490a91b608..9fbbf072a12 100644 --- a/src/s/sco5.h +++ b/src/s/sco5.h @@ -1,5 +1,5 @@ /* System description file for SCO 3.2v5. - Copyright (C) 1996, 2002 Free Software Foundation, Inc. + Copyright (C) 1996, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/template.h b/src/s/template.h index 5ef1049164d..0610e16473a 100644 --- a/src/s/template.h +++ b/src/s/template.h @@ -1,7 +1,8 @@ /* Template for system description header files. This file describes the parameters that system description files should define or not. - Copyright (C) 1985, 1986, 1992, 1999 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1992, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/umax.h b/src/s/umax.h index 1741b1d04e3..f4923f33053 100644 --- a/src/s/umax.h +++ b/src/s/umax.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on UMAX 4.2 - Copyright (C) 1985, 1986 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/unipl5-2.h b/src/s/unipl5-2.h index 05d162239a8..cca703adb82 100644 --- a/src/s/unipl5-2.h +++ b/src/s/unipl5-2.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on UniSoft's UniPlus 5.2 - Copyright (C) 1985, 1986, 1999 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/usg5-0.h b/src/s/usg5-0.h index 21b469dcd55..5f9943f8477 100644 --- a/src/s/usg5-0.h +++ b/src/s/usg5-0.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on AT&T's System V.0 - Copyright (C) 1985, 1986, 1999 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/usg5-2-2.h b/src/s/usg5-2-2.h index dff90efb225..b090f3c32b6 100644 --- a/src/s/usg5-2-2.h +++ b/src/s/usg5-2-2.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on AT&T's System V Release 2.2 - Copyright (C) 1985, 1986, 1999 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/usg5-2.h b/src/s/usg5-2.h index 0da477276fd..e63bddfc060 100644 --- a/src/s/usg5-2.h +++ b/src/s/usg5-2.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on AT&T's System V Release 2.0 - Copyright (C) 1985, 1986, 1999 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/usg5-3.h b/src/s/usg5-3.h index 285bae670df..12259936928 100644 --- a/src/s/usg5-3.h +++ b/src/s/usg5-3.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on AT&T's System V Release 3 - Copyright (C) 1987, 1999 Free Software Foundation, Inc. + Copyright (C) 1987, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/usg5-4.h b/src/s/usg5-4.h index 4edda95b39c..b8c2f8d9fa2 100644 --- a/src/s/usg5-4.h +++ b/src/s/usg5-4.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running on AT&T's System V Release 4 - Copyright (C) 1987, 1990, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1987, 1990, 1999, 2000, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/vms.h b/src/s/vms.h index 9afd69b8539..e3c9dc725c0 100644 --- a/src/s/vms.h +++ b/src/s/vms.h @@ -1,5 +1,5 @@ /* system description header for VMS - Copyright (C) 1986 Free Software Foundation, Inc. + Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/s/xenix.h b/src/s/xenix.h index 763a10956ff..e67b897faff 100644 --- a/src/s/xenix.h +++ b/src/s/xenix.h @@ -1,5 +1,6 @@ /* Definitions file for GNU Emacs running SCO Xenix 386 Release 2.2 - Copyright (C) 1988, 1999 Free Software Foundation, Inc. + Copyright (C) 1988, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/scroll.c b/src/scroll.c index f73f6f4fa80..04db528cc64 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -1,5 +1,6 @@ /* Calculate what line insertion or deletion to do, and do it, - Copyright (C) 1985, 1986, 1990, 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1990, 1993, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/search.c b/src/search.c index 6beaa2d4186..aa7f6fda699 100644 --- a/src/search.c +++ b/src/search.c @@ -1,6 +1,6 @@ /* String search routines for GNU Emacs. - Copyright (C) 1985, 86,87,93,94,97,98, 1999, 2004 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1993, 1994, 1997, 1998, 1999, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -3085,6 +3085,7 @@ syms_of_search () searchbufs[i].regexp = Qnil; searchbufs[i].whitespace_regexp = Qnil; staticpro (&searchbufs[i].regexp); + staticpro (&searchbufs[i].whitespace_regexp); searchbufs[i].next = (i == REGEXP_CACHE_SIZE-1 ? 0 : &searchbufs[i+1]); } searchbuf_head = &searchbufs[0]; diff --git a/src/sheap.c b/src/sheap.c index b7f01d448a8..635c3dc0144 100644 --- a/src/sheap.c +++ b/src/sheap.c @@ -1,8 +1,7 @@ /* simulate sbrk() with an array in .bss, for unexec() support for Cygwin; complete rewrite of xemacs Cygwin unexec() code - Copyright (C) 2004 - Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/sound.c b/src/sound.c index 93e456cbc48..1e6a17d0275 100644 --- a/src/sound.c +++ b/src/sound.c @@ -1,5 +1,6 @@ /* sound.c -- sound support. - Copyright (C) 1998, 1999, 2001 Free Software Foundation. + Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/strftime.c b/src/strftime.c index 41566ec868e..88a54b7bee4 100644 --- a/src/strftime.c +++ b/src/strftime.c @@ -1,5 +1,5 @@ -/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2000,2003 - Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with gnulib. Bugs can be reported to bug-gnulib@gnu.org. diff --git a/src/sunfns.c b/src/sunfns.c index 6a16e6cc08f..8de639b7480 100644 --- a/src/sunfns.c +++ b/src/sunfns.c @@ -1,5 +1,6 @@ /* Functions for Sun Windows menus and selection buffer. - Copyright (C) 1987, 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1987, 1999, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is probably totally obsolete. In any case, the FSF is unwilling to support it. We agreed to include it in our distribution diff --git a/src/syntax.c b/src/syntax.c index 480fa6de82a..2043cff63d6 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -1,5 +1,6 @@ /* GNU Emacs routines to deal with syntax tables; also word and list parsing. - Copyright (C) 1985, 87, 93, 94, 95, 97, 1998, 1999, 2004 Free Software Foundation, Inc. + Copyright (C) 1985, 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2002, + 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -132,7 +133,7 @@ update_syntax_table (charpos, count, init, object) { Lisp_Object tmp_table; int cnt = 0, invalidate = 1; - INTERVAL i, oldi; + INTERVAL i; if (init) { @@ -163,7 +164,7 @@ update_syntax_table (charpos, count, init, object) gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset; goto update; } - oldi = i = count > 0 ? gl_state.forward_i : gl_state.backward_i; + i = count > 0 ? gl_state.forward_i : gl_state.backward_i; /* We are guaranteed to be called with CHARPOS either in i, or further off. */ @@ -248,7 +249,8 @@ update_syntax_table (charpos, count, init, object) } else { - gl_state.b_property = i->position + LENGTH (i) - gl_state.offset; + gl_state.b_property + = i->position + LENGTH (i) - gl_state.offset; gl_state.backward_i = i; } return; @@ -257,7 +259,12 @@ update_syntax_table (charpos, count, init, object) { if (count > 0) { - gl_state.e_property = i->position + LENGTH (i) - gl_state.offset; + gl_state.e_property + = i->position + LENGTH (i) - gl_state.offset + /* e_property at EOB is not set to ZV but to ZV+1, so that + we can do INC(from);UPDATE_SYNTAX_TABLE_FORWARD without + having to check eob between the two. */ + + (NULL_INTERVAL_P (next_interval (i)) ? 1 : 0); gl_state.forward_i = i; } else @@ -3168,6 +3175,14 @@ syms_of_syntax () staticpro (&Vsyntax_code_object); + staticpro (&gl_state.object); + staticpro (&gl_state.global_code); + staticpro (&gl_state.current_syntax_table); + staticpro (&gl_state.old_prop); + + /* Defined in regex.c */ + staticpro (&re_match_object); + Qscan_error = intern ("scan-error"); staticpro (&Qscan_error); Fput (Qscan_error, Qerror_conditions, diff --git a/src/syntax.h b/src/syntax.h index 581b4a783e0..c29e26c20b5 100644 --- a/src/syntax.h +++ b/src/syntax.h @@ -1,5 +1,6 @@ /* Declarations having to do with GNU Emacs syntax tables. - Copyright (C) 1985, 93, 94, 97, 1998 Free Software Foundation, Inc. + Copyright (C) 1985, 1993, 1994, 1997, 1998, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/sysdep.c b/src/sysdep.c index 7f0c363f7c4..9ffb167bdf0 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -1,6 +1,6 @@ /* Interfaces to system-dependent kernel and library entries. Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/sysselect.h b/src/sysselect.h index 0030e737bc2..d57527f9ed1 100644 --- a/src/sysselect.h +++ b/src/sysselect.h @@ -1,5 +1,5 @@ /* sysselect.h - System-dependent definitions for the select function. - Copyright (C) 1995 Free Software Foundation, Inc. + Copyright (C) 1995, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/syssignal.h b/src/syssignal.h index 2f8aa43f2f6..1e9c0dbb38a 100644 --- a/src/syssignal.h +++ b/src/syssignal.h @@ -1,5 +1,6 @@ /* syssignal.h - System-dependent definitions for signals. - Copyright (C) 1993, 1999 Free Software Foundation, Inc. + Copyright (C) 1993, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/systime.h b/src/systime.h index cf2bc0b084b..12d8d406d8e 100644 --- a/src/systime.h +++ b/src/systime.h @@ -1,5 +1,6 @@ /* systime.h - System-dependent definitions for time manipulations. - Copyright (C) 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/systty.h b/src/systty.h index b322ca60087..af9f5e3aa88 100644 --- a/src/systty.h +++ b/src/systty.h @@ -1,5 +1,6 @@ /* systty.h - System-dependent definitions for terminals. - Copyright (C) 1993, 1994 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/syswait.h b/src/syswait.h index 78057e3fed4..37d59d68ac5 100644 --- a/src/syswait.h +++ b/src/syswait.h @@ -1,5 +1,6 @@ /* Define wait system call interface for Emacs. - Copyright (C) 1993, 1994, 1995, 2000 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1995, 2000, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/term.c b/src/term.c index e340edb6c17..77720779baf 100644 --- a/src/term.c +++ b/src/term.c @@ -1,6 +1,6 @@ /* Terminal control module for terminals described by TERMCAP - Copyright (C) 1985, 86, 87, 93, 94, 95, 98, 2000, 2001, 2002, 2005 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1998, 2000, 2001, + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -245,6 +245,17 @@ tty_set_terminal_modes (struct device *display) if (tty->output) { + if (tty->TS_termcap_modes) + OUTPUT (tty, tty->TS_termcap_modes); + else + { + /* Output enough newlines to scroll all the old screen contents + off the screen, so it won't be overwritten and lost. */ + int i; + for (i = 0; i < FRAME_LINES (XFRAME (selected_frame)); i++) + putchar ('\n'); + } + OUTPUT_IF (tty, tty->TS_termcap_modes); OUTPUT_IF (tty, tty->TS_cursor_visible); OUTPUT_IF (tty, tty->TS_keypad_mode); @@ -1846,24 +1857,20 @@ turn_on_face (f, face_id) if (tty->TN_max_colors > 0) { - char *p; + char *ts, *p; - if (fg >= 0 && tty->TS_set_foreground) + ts = tty->standout_mode ? tty->TS_set_background : tty->TS_set_foreground; + if (fg >= 0 && ts) { - if (tty->standout_mode) - p = tparam (tty->TS_set_background, NULL, 0, (int) fg); - else - p = tparam (tty->TS_set_foreground, NULL, 0, (int) fg); + p = tparam (ts, NULL, 0, (int) fg); OUTPUT (tty, p); xfree (p); } - if (bg >= 0 && tty->TS_set_background) + ts = tty->standout_mode ? tty->TS_set_foreground : tty->TS_set_background; + if (bg >= 0 && ts) { - if (tty->standout_mode) - p = tparam (tty->TS_set_foreground, NULL, 0, (int) bg); - else - p = tparam (tty->TS_set_background, NULL, 0, (int) bg); + p = tparam (ts, NULL, 0, (int) bg); OUTPUT (tty, p); xfree (p); } diff --git a/src/termcap.c b/src/termcap.c index 5f2fa55556a..2f6f324eada 100644 --- a/src/termcap.c +++ b/src/termcap.c @@ -1,6 +1,6 @@ /* Work-alike for termcap, plus extra features. - Copyright (C) 1985, 86, 93, 94, 95, 2000, 2001 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1993, 1994, 1995, 2000, 2001, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/termchar.h b/src/termchar.h index 1f6580b91f3..87072136317 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -1,5 +1,6 @@ /* Flags and parameters describing terminal's characteristics. - Copyright (C) 1985, 1986 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/termhooks.h b/src/termhooks.h index 5b411c6ab78..3fea7c366fb 100644 --- a/src/termhooks.h +++ b/src/termhooks.h @@ -1,5 +1,6 @@ -/* Parameters and display hooks for output devices - Copyright (C) 1985,86,93,94,2003 Free Software Foundation, Inc. +/* Parameters and display hooks for output devices. + Copyright (C) 1985, 1986, 1993, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/terminfo.c b/src/terminfo.c index 8f040d10c68..5c0aa1ccf05 100644 --- a/src/terminfo.c +++ b/src/terminfo.c @@ -1,5 +1,6 @@ /* Interface from Emacs to terminfo. - Copyright (C) 1985, 1986 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/termopts.h b/src/termopts.h index 94d3f3bb9d7..2e5da3c9948 100644 --- a/src/termopts.h +++ b/src/termopts.h @@ -1,5 +1,6 @@ /* Flags and parameters describing user options for handling the terminal. - Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1990, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/textprop.c b/src/textprop.c index 718051e38f2..fa9b0e498c5 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -1,6 +1,6 @@ /* Interface code for dealing with text properties. - Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -719,7 +719,7 @@ it finds a change in some text property, or the beginning or end of an overlay, and returns the position of that. If none is found, the function returns (point-max). -If the optional third argument LIMIT is non-nil, don't search +If the optional second argument LIMIT is non-nil, don't search past position LIMIT; return LIMIT if nothing is found before LIMIT. */) (position, limit) Lisp_Object position, limit; @@ -744,7 +744,7 @@ finds a change in some text property, or the beginning or end of an overlay, and returns the position of that. If none is found, the function returns (point-max). -If the optional third argument LIMIT is non-nil, don't search +If the optional second argument LIMIT is non-nil, don't search past position LIMIT; return LIMIT if nothing is found before LIMIT. */) (position, limit) Lisp_Object position, limit; diff --git a/src/tparam.c b/src/tparam.c index e05f01f4911..e593589d5cb 100644 --- a/src/tparam.c +++ b/src/tparam.c @@ -1,5 +1,6 @@ /* Merge parameters into a termcap entry string. - Copyright (C) 1985, 87, 93, 95, 2000 Free Software Foundation, Inc. + Copyright (C) 1985, 1987, 1993, 1995, 2000, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/uaf.h b/src/uaf.h index 71ae7267147..7863c41227e 100644 --- a/src/uaf.h +++ b/src/uaf.h @@ -1,5 +1,5 @@ /* GNU Emacs VMS UAF definition file. - Copyright (C) 1986 Free Software Foundation, Inc. + Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/undo.c b/src/undo.c index 13ee40130a9..9839906ca7e 100644 --- a/src/undo.c +++ b/src/undo.c @@ -1,6 +1,6 @@ /* undo handling for GNU Emacs. - Copyright (C) 1990, 1993, 1994, 2000, 2002, 2004, 2005 - Free Software Foundation, Inc. + Copyright (C) 1990, 1993, 1994, 2000, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/unexaix.c b/src/unexaix.c index 4c9f2727e88..071f09898ed 100644 --- a/src/unexaix.c +++ b/src/unexaix.c @@ -1,5 +1,6 @@ /* Dump an executable image. - Copyright (C) 1985, 1986, 1987, 1988, 1999 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/unexalpha.c b/src/unexalpha.c index aa32f411fcb..069c39b398b 100644 --- a/src/unexalpha.c +++ b/src/unexalpha.c @@ -1,6 +1,7 @@ /* Unexec for DEC alpha. schoepf@sc.ZIB-Berlin.DE (Rainer Schoepf). - Copyright (C) 1994, 2000 Free Software Foundation, Inc. + Copyright (C) 1994, 2000, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/unexapollo.c b/src/unexapollo.c index d9bff963695..f1481d684a3 100644 --- a/src/unexapollo.c +++ b/src/unexapollo.c @@ -1,5 +1,6 @@ /* unexapollo.c -- COFF File UNEXEC for GNU Emacs on Apollo SR10.x - Copyright (C) 1988, 1994 Free Software Foundation, Inc. + Copyright (C) 1988, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/unexconvex.c b/src/unexconvex.c index cbd1dd29fda..6f05e4ae938 100644 --- a/src/unexconvex.c +++ b/src/unexconvex.c @@ -7,7 +7,8 @@ think about it, or about whether other Emacs maintenance might break it. - Copyright (C) 1985, 1986, 1988 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1988, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/unexcw.c b/src/unexcw.c index 77d5866136b..cfd87781a16 100644 --- a/src/unexcw.c +++ b/src/unexcw.c @@ -1,8 +1,7 @@ /* unexec() support for Cygwin; complete rewrite of xemacs Cygwin unexec() code - Copyright (C) 2004 - Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/unexec.c b/src/unexec.c index bf231b00626..ebf813306da 100644 --- a/src/unexec.c +++ b/src/unexec.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1985,86,87,88,92,93,94 Free Software Foundation, Inc. +/* Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/unexelf.c b/src/unexelf.c index 9e8b827a754..ee563b36a97 100644 --- a/src/unexelf.c +++ b/src/unexelf.c @@ -1,5 +1,5 @@ -/* Copyright (C) 1985,86,87,88,90,92,1999,2000,01,2003 - Free Software Foundation, Inc. +/* Copyright (C) 1985, 1986, 1987, 1988, 1990, 1992, 1999, 2000, 2001, + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/unexenix.c b/src/unexenix.c index 94ac3eb821d..159c0b2f6d8 100644 --- a/src/unexenix.c +++ b/src/unexenix.c @@ -6,7 +6,8 @@ we don't plan to think about it, or about whether other Emacs maintenance might break it. - Copyright (C) 1988, 1994 Free Software Foundation, Inc. + Copyright (C) 1988, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/unexmacosx.c b/src/unexmacosx.c index a191c0721e5..9db9622f6f5 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c @@ -1,5 +1,5 @@ /* Dump Emacs in Mach-O format for use on Mac OS X. - Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/unexmips.c b/src/unexmips.c index 53b40f62742..212f7ed5926 100644 --- a/src/unexmips.c +++ b/src/unexmips.c @@ -6,7 +6,8 @@ we don't plan to think about it, or about whether other Emacs maintenance might break it. - Copyright (C) 1988, 1994 Free Software Foundation, Inc. + Copyright (C) 1988, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/unexnext.c b/src/unexnext.c index 2a0b66bc868..b374dd8e9b8 100644 --- a/src/unexnext.c +++ b/src/unexnext.c @@ -1,5 +1,6 @@ /* Dump Emacs in macho format. - Copyright (C) 1990, 1993 Free Software Foundation, Inc. + Copyright (C) 1990, 1993, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. Written by Bradley Taylor (btaylor@next.com). This file is part of GNU Emacs. diff --git a/src/unexsni.c b/src/unexsni.c index 0c67af899d5..d6b3ae68969 100644 --- a/src/unexsni.c +++ b/src/unexsni.c @@ -1,6 +1,6 @@ /* Unexec for Siemens machines running Sinix (modified SVR4). - Copyright (C) 1985, 1986, 1987, 1988, 1990, 1992, 1993, 1994, 1995 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1990, 1992, 1993, 1994, 1995, 2002, + 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/unexsunos4.c b/src/unexsunos4.c index 9ad06b6adaf..5e221050f36 100644 --- a/src/unexsunos4.c +++ b/src/unexsunos4.c @@ -1,5 +1,6 @@ /* Unexec for Sunos 4 using shared libraries. - Copyright (C) 1990, 1994, 1999 Free Software Foundation, Inc. + Copyright (C) 1990, 1994, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/unexw32.c b/src/unexw32.c index 5380ca5c8f7..bc462c18a10 100644 --- a/src/unexw32.c +++ b/src/unexw32.c @@ -1,5 +1,5 @@ /* unexec for GNU Emacs on Windows NT. - Copyright (C) 1994, 2005 Free Software Foundation, Inc. + Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/vm-limit.c b/src/vm-limit.c index 1840eb61c0c..0c12dec9b04 100644 --- a/src/vm-limit.c +++ b/src/vm-limit.c @@ -1,5 +1,6 @@ /* Functions for memory limit warnings. - Copyright (C) 1990, 1992 Free Software Foundation, Inc. + Copyright (C) 1990, 1992, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/w16select.c b/src/w16select.c index 406f0a1b884..b0c30eb58d8 100644 --- a/src/w16select.c +++ b/src/w16select.c @@ -1,5 +1,6 @@ /* 16-bit Windows Selection processing for emacs on MS-Windows - Copyright (C) 1996, 1997, 2001 Free Software Foundation. + Copyright (C) 1996, 1997, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/w32.c b/src/w32.c index 77959037913..c7f6e3172f9 100644 --- a/src/w32.c +++ b/src/w32.c @@ -1,5 +1,6 @@ /* Utility and Unix shadow routines for GNU Emacs on the Microsoft W32 API. - Copyright (C) 1994, 1995, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -20,8 +21,6 @@ Boston, MA 02110-1301, USA. Geoff Voelker (voelker@cs.washington.edu) 7-29-94 */ - - #include <stddef.h> /* for offsetof */ #include <stdlib.h> #include <stdio.h> @@ -73,6 +72,7 @@ Boston, MA 02110-1301, USA. #define _ANONYMOUS_STRUCT #endif #include <windows.h> +#include <shlobj.h> #ifdef HAVE_SOCKETS /* TCP connection support, if kernel can do it */ #include <sys/socket.h> @@ -100,6 +100,9 @@ Boston, MA 02110-1301, USA. #include "w32heap.h" #include "systime.h" +typedef HRESULT (WINAPI * ShGetFolderPath_fn) + (IN HWND, IN int, IN HANDLE, IN DWORD, OUT char *); + void globals_of_w32 (); extern Lisp_Object Vw32_downcase_file_names; @@ -903,7 +906,9 @@ init_environment (char ** argv) static const char * const tempdirs[] = { "$TMPDIR", "$TEMP", "$TMP", "c:/" }; + int i; + const int imax = sizeof (tempdirs) / sizeof (tempdirs[0]); /* Make sure they have a usable $TMPDIR. Many Emacs functions use @@ -942,6 +947,8 @@ init_environment (char ** argv) LPBYTE lpval; DWORD dwType; char locale_name[32]; + struct stat ignored; + char default_home[MAX_PATH]; static struct env_entry { @@ -964,6 +971,35 @@ init_environment (char ** argv) {"LANG", NULL}, }; + /* For backwards compatibility, check if a .emacs file exists in C:/ + If not, then we can try to default to the appdata directory under the + user's profile, which is more likely to be writable. */ + if (stat ("C:/.emacs", &ignored) < 0) + { + HRESULT profile_result; + /* Dynamically load ShGetFolderPath, as it won't exist on versions + of Windows 95 and NT4 that have not been updated to include + MSIE 5. Also we don't link with shell32.dll by default. */ + HMODULE shell32_dll; + ShGetFolderPath_fn get_folder_path; + shell32_dll = GetModuleHandle ("shell32.dll"); + get_folder_path = (ShGetFolderPath_fn) + GetProcAddress (shell32_dll, "SHGetFolderPathA"); + + if (get_folder_path != NULL) + { + profile_result = get_folder_path (NULL, CSIDL_APPDATA, NULL, + 0, default_home); + + /* If we can't get the appdata dir, revert to old behaviour. */ + if (profile_result == S_OK) + env_vars[0].def_value = default_home; + } + + /* Unload shell32.dll, it is not needed anymore. */ + FreeLibrary (shell32_dll); + } + /* Get default locale info and use it for LANG. */ if (GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_SABBREVLANGNAME | LOCALE_USE_CP_ACP, diff --git a/src/w32.h b/src/w32.h index 622a2256f0f..2981e5bb979 100644 --- a/src/w32.h +++ b/src/w32.h @@ -2,7 +2,7 @@ #define EMACS_W32_H /* Support routines for the NT version of Emacs. - Copyright (C) 1994 Free Software Foundation, Inc. + Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/w32bdf.c b/src/w32bdf.c index e8612c7b5d6..10780f2f0c9 100644 --- a/src/w32bdf.c +++ b/src/w32bdf.c @@ -1,5 +1,5 @@ /* Implementation of BDF font handling on the Microsoft W32 API. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/w32bdf.h b/src/w32bdf.h index ca8a5f368cb..9d3d306d56f 100644 --- a/src/w32bdf.h +++ b/src/w32bdf.h @@ -1,5 +1,5 @@ /* Definitions and header for handling BDF fonts on the Microsoft W32 API. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/w32console.c b/src/w32console.c index 0ebda179667..a81591fb96f 100644 --- a/src/w32console.c +++ b/src/w32console.c @@ -1,5 +1,6 @@ /* Terminal hooks for GNU Emacs on the Microsoft W32 API. - Copyright (C) 1992, 1999 Free Software Foundation, Inc. + Copyright (C) 1992, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/w32fns.c b/src/w32fns.c index eedc06dda12..93469418137 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -1,6 +1,6 @@ /* Graphical user interface functions for the Microsoft W32 API. - Copyright (C) 1989, 1992, 93, 94, 95, 96, 97, 98, 99, 2000, 01, 04 - Free Software Foundation, Inc. + Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -153,7 +153,7 @@ int display_hourglass_p; over text or in the modeline. */ Lisp_Object Vx_pointer_shape, Vx_nontext_pointer_shape, Vx_mode_pointer_shape; -Lisp_Object Vx_hourglass_pointer_shape, Vx_window_horizontal_drag_shape, Vx_hand_shape; +Lisp_Object Vx_hourglass_pointer_shape, Vx_window_horizontal_drag_shape; /* The shape when over mouse-sensitive text. */ @@ -395,10 +395,10 @@ x_window_to_frame (dpyinfo, wdesc) } -BOOL my_show_window P_ ((struct frame *, HWND, int)); -void my_set_window_pos P_ ((HWND, HWND, int, int, int, int, UINT)); static Lisp_Object unwind_create_frame P_ ((Lisp_Object)); static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object)); +static void my_create_window P_ ((struct frame *)); +static void my_create_tip_window P_ ((struct frame *)); /* TODO: Native Input Method support; see x_create_im. */ void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); @@ -3847,7 +3847,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) return 0; } -void +static void my_create_window (f) struct frame * f; { @@ -3863,7 +3863,7 @@ my_create_window (f) indirectly via the Window thread, as we do not need to process Window messages for the tooltip. Creating tooltips indirectly also creates deadlocks when tooltips are created for menu items. */ -void +static void my_create_tip_window (f) struct frame *f; { @@ -8760,6 +8760,8 @@ versions of Windows) characters. */); staticpro (&Qw32_charset_ansi); Qw32_charset_ansi = intern ("w32-charset-ansi"); staticpro (&Qw32_charset_symbol); + Qw32_charset_default = intern ("w32-charset-default"); + staticpro (&Qw32_charset_default); Qw32_charset_symbol = intern ("w32-charset-symbol"); staticpro (&Qw32_charset_shiftjis); Qw32_charset_shiftjis = intern ("w32-charset-shiftjis"); diff --git a/src/w32gui.h b/src/w32gui.h index 1fd145cd026..644adcea924 100644 --- a/src/w32gui.h +++ b/src/w32gui.h @@ -1,5 +1,5 @@ /* Definitions and headers for communication on the Microsoft W32 API. - Copyright (C) 1995 Free Software Foundation, Inc. + Copyright (C) 1995, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/w32heap.c b/src/w32heap.c index 7de08bb2b4e..a0c50da5506 100644 --- a/src/w32heap.c +++ b/src/w32heap.c @@ -1,5 +1,5 @@ /* Heap management routines for GNU Emacs on the Microsoft W32 API. - Copyright (C) 1994 Free Software Foundation, Inc. + Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/w32heap.h b/src/w32heap.h index 259d0bf9ede..1b3b815b115 100644 --- a/src/w32heap.h +++ b/src/w32heap.h @@ -1,5 +1,5 @@ /* Heap management routines (including unexec) for GNU Emacs on Windows NT. - Copyright (C) 1994 Free Software Foundation, Inc. + Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/w32inevt.c b/src/w32inevt.c index cc7c5e1e612..ffa2cd0989a 100644 --- a/src/w32inevt.c +++ b/src/w32inevt.c @@ -1,5 +1,6 @@ /* Input event support for Emacs on the Microsoft W32 API. - Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc. + Copyright (C) 1992, 1993, 1995, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/w32inevt.h b/src/w32inevt.h index f811c96c313..e0a9428720f 100644 --- a/src/w32inevt.h +++ b/src/w32inevt.h @@ -1,5 +1,5 @@ /* Input routines for GNU Emacs on the Microsoft W32 API. - Copyright (C) 1995 Free Software Foundation, Inc. + Copyright (C) 1995, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/w32menu.c b/src/w32menu.c index 065355f8755..d441d14b259 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -1,5 +1,6 @@ /* Menu support for GNU Emacs on the Microsoft W32 API. - Copyright (C) 1986,88,93,94,96,98,1999,2003 Free Software Foundation, Inc. + Copyright (C) 1986, 1988, 1993, 1994, 1996, 1998, 1999, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -2320,7 +2321,23 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item) item != NULL ? (UINT) item : (UINT) wv->call_data, utf16_string); - if (fuFlags & MF_OWNERDRAW) + if (!return_value) + { + /* On W9x/ME, unicode menus are not supported, though AppendMenuW + apparently does exist at least in some cases and appears to be + stubbed out to do nothing. out_string is UTF-8, but since + our standard menus are in English and this is only going to + happen the first time a menu is used, the encoding is + of minor importance compared with menus not working at all. */ + return_value = + AppendMenu (menu, fuFlags, + item != NULL ? (UINT) item: (UINT) wv->call_data, + out_string); + /* Don't use unicode menus in future. */ + unicode_append_menu = NULL; + } + + if (unicode_append_menu && (fuFlags & MF_OWNERDRAW)) local_free (out_string); } else @@ -2418,8 +2435,11 @@ w32_menu_display_help (HWND owner, HMENU menu, UINT item, UINT flags) struct frame *f = x_window_to_frame (&one_w32_display_info, owner); Lisp_Object frame, help; - /* No help echo on owner-draw menu items. */ - if (flags & MF_OWNERDRAW || flags & MF_POPUP) + /* No help echo on owner-draw menu items, or when the keyboard is used + to navigate the menus, since tooltips are distracting if they pop + up elsewhere. */ + if (flags & MF_OWNERDRAW || flags & MF_POPUP + || !(flags & MF_MOUSESELECT)) help = Qnil; else { diff --git a/src/w32proc.c b/src/w32proc.c index 0e3f8f2fd47..628a763c675 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -1,5 +1,6 @@ /* Process support for GNU Emacs on the Microsoft W32 API. - Copyright (C) 1992, 95, 99, 2000, 01, 04 Free Software Foundation, Inc. + Copyright (C) 1992, 1995, 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -2146,6 +2147,8 @@ syms_of_ntproc () { Qhigh = intern ("high"); Qlow = intern ("low"); + staticpro (&Qhigh); + staticpro (&Qlow); #ifdef HAVE_SOCKETS defsubr (&Sw32_has_winsock); @@ -2241,6 +2244,9 @@ the truename of a file can be slow. */); Note that this option is only useful for files on NTFS volumes, where hard links are supported. Moreover, it slows down `file-attributes' noticeably. */); Vw32_get_true_file_attributes = Qt; + + staticpro (&Vw32_valid_locale_ids); + staticpro (&Vw32_valid_codepages); } /* end of ntproc.c */ diff --git a/src/w32reg.c b/src/w32reg.c index a70835ac303..40d84df3d14 100644 --- a/src/w32reg.c +++ b/src/w32reg.c @@ -1,5 +1,6 @@ /* Emulate the X Resource Manager through the registry. - Copyright (C) 1990, 1993, 1994 Free Software Foundation. + Copyright (C) 1990, 1993, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/w32select.c b/src/w32select.c index db29c078149..3556c62a35f 100644 --- a/src/w32select.c +++ b/src/w32select.c @@ -1,5 +1,6 @@ /* Selection processing for Emacs on the Microsoft W32 API. - Copyright (C) 1993, 1994, 2004 Free Software Foundation. + Copyright (C) 1993, 1994, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/w32term.c b/src/w32term.c index abf8e377ef1..4e7ed968b8d 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -1,6 +1,6 @@ /* Implementation of GUI terminal on the Microsoft W32 API. - Copyright (C) 1989, 93, 94, 95, 96, 1997, 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. + Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -272,6 +272,11 @@ static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int, enum text_cursor_kinds)); static void w32_clip_to_row P_ ((struct window *, struct glyph_row *, int, HDC)); +static BOOL my_show_window P_ ((struct frame *, HWND, int)); +static void my_set_window_pos P_ ((HWND, HWND, int, int, int, int, UINT)); +static void my_set_focus P_ ((struct frame *, HWND)); +static void my_set_foreground_window P_ ((HWND)); +static void my_destroy_window P_ ((struct frame *, HWND)); static Lisp_Object Qvendor_specific_keysyms; @@ -3632,7 +3637,7 @@ my_create_scrollbar (f, bar) /*#define ATTACH_THREADS*/ -BOOL +static BOOL my_show_window (FRAME_PTR f, HWND hwnd, int how) { #ifndef ATTACH_THREADS @@ -3643,7 +3648,7 @@ my_show_window (FRAME_PTR f, HWND hwnd, int how) #endif } -void +static void my_set_window_pos (HWND hwnd, HWND hwndAfter, int x, int y, int cx, int cy, UINT flags) { @@ -3661,7 +3666,7 @@ my_set_window_pos (HWND hwnd, HWND hwndAfter, #endif } -void +static void my_set_focus (f, hwnd) struct frame * f; HWND hwnd; @@ -3670,14 +3675,15 @@ my_set_focus (f, hwnd) (WPARAM) hwnd, 0); } -void +static void my_set_foreground_window (hwnd) HWND hwnd; { SendMessage (hwnd, WM_EMACS_SETFOREGROUND, (WPARAM) hwnd, 0); } -void + +static void my_destroy_window (f, hwnd) struct frame * f; HWND hwnd; diff --git a/src/w32term.h b/src/w32term.h index 1557a45653f..34932c44d3b 100644 --- a/src/w32term.h +++ b/src/w32term.h @@ -1,5 +1,6 @@ /* Definitions and headers for communication on the Microsoft W32 API. - Copyright (C) 1995, 2001 Free Software Foundation, Inc. + Copyright (C) 1995, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/w32xfns.c b/src/w32xfns.c index ba705d9498d..46a71b942c7 100644 --- a/src/w32xfns.c +++ b/src/w32xfns.c @@ -1,5 +1,6 @@ /* Functions taken directly from X sources for use with the Microsoft W32 API. - Copyright (C) 1989, 1992, 1993, 1994, 1995, 1999 Free Software Foundation. + Copyright (C) 1989, 1992, 1993, 1994, 1995, 1999, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/widget.c b/src/widget.c index fdd927cb175..0386890d93b 100644 --- a/src/widget.c +++ b/src/widget.c @@ -1,5 +1,6 @@ /* The emacs frame widget. - Copyright (C) 1992, 1993, 2000 Free Software Foundation, Inc. + Copyright (C) 1992, 1993, 2000, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/widget.h b/src/widget.h index 174a6a720de..00d743234c0 100644 --- a/src/widget.h +++ b/src/widget.h @@ -1,5 +1,5 @@ /* The emacs frame widget public header file. - Copyright (C) 1993 Free Software Foundation, Inc. + Copyright (C) 1993, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/widgetprv.h b/src/widgetprv.h index ce087e825cb..2027b4f602d 100644 --- a/src/widgetprv.h +++ b/src/widgetprv.h @@ -1,5 +1,5 @@ /* The emacs frame widget private header file. - Copyright (C) 1993 Free Software Foundation, Inc. + Copyright (C) 1993, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/window.c b/src/window.c index c0cf06d5e46..3140bbaf001 100644 --- a/src/window.c +++ b/src/window.c @@ -1,7 +1,7 @@ /* Window creation, deletion and examination for GNU Emacs. Does not include redisplay. Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 2000, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -5626,8 +5626,6 @@ struct saved_window Lisp_Object scroll_bar_width, vertical_scroll_bar_type; }; -#define SAVED_WINDOW_VECTOR_SIZE 24 /* Arg to Fmake_vector */ - #define SAVED_WINDOW_N(swv,n) \ ((struct saved_window *) (XVECTOR ((swv)->contents[(n)]))) @@ -6207,7 +6205,7 @@ redirection (see `redirect-frame-focus'). */) data->saved_windows = tem; for (i = 0; i < n_windows; i++) XVECTOR (tem)->contents[i] - = Fmake_vector (make_number (SAVED_WINDOW_VECTOR_SIZE), Qnil); + = Fmake_vector (make_number (VECSIZE (struct saved_window)), Qnil); save_window_save (FRAME_ROOT_WINDOW (f), XVECTOR (tem), 0); XSETWINDOW_CONFIGURATION (tem, data); return (tem); @@ -6248,33 +6246,33 @@ Second arg LEFT-WIDTH specifies the number of character cells to reserve for the left marginal area. Optional third arg RIGHT-WIDTH does the same for the right marginal area. A nil width parameter means no margin. */) - (window, left, right) - Lisp_Object window, left, right; + (window, left_width, right_width) + Lisp_Object window, left_width, right_width; { struct window *w = decode_window (window); /* Translate negative or zero widths to nil. Margins that are too wide have to be checked elsewhere. */ - if (!NILP (left)) + if (!NILP (left_width)) { - CHECK_NUMBER (left); - if (XINT (left) <= 0) - left = Qnil; + CHECK_NUMBER (left_width); + if (XINT (left_width) <= 0) + left_width = Qnil; } - if (!NILP (right)) + if (!NILP (right_width)) { - CHECK_NUMBER (right); - if (XINT (right) <= 0) - right = Qnil; + CHECK_NUMBER (right_width); + if (XINT (right_width) <= 0) + right_width = Qnil; } - if (!EQ (w->left_margin_cols, left) - || !EQ (w->right_margin_cols, right)) + if (!EQ (w->left_margin_cols, left_width) + || !EQ (w->right_margin_cols, right_width)) { - w->left_margin_cols = left; - w->right_margin_cols = right; + w->left_margin_cols = left_width; + w->right_margin_cols = right_width; adjust_window_margins (w); @@ -6319,22 +6317,22 @@ the command `set-fringe-style'. If optional fourth arg OUTSIDE-MARGINS is non-nil, draw the fringes outside of the display margins. By default, fringes are drawn between display marginal areas and the text area. */) - (window, left, right, outside_margins) - Lisp_Object window, left, right, outside_margins; + (window, left_width, right_width, outside_margins) + Lisp_Object window, left_width, right_width, outside_margins; { struct window *w = decode_window (window); - if (!NILP (left)) - CHECK_NATNUM (left); - if (!NILP (right)) - CHECK_NATNUM (right); + if (!NILP (left_width)) + CHECK_NATNUM (left_width); + if (!NILP (right_width)) + CHECK_NATNUM (right_width); - if (!EQ (w->left_fringe_width, left) - || !EQ (w->right_fringe_width, right) + if (!EQ (w->left_fringe_width, left_width) + || !EQ (w->right_fringe_width, right_width) || !EQ (w->fringes_outside_margins, outside_margins)) { - w->left_fringe_width = left; - w->right_fringe_width = right; + w->left_fringe_width = left_width; + w->right_fringe_width = right_width; w->fringes_outside_margins = outside_margins; adjust_window_margins (w); diff --git a/src/window.h b/src/window.h index 7e34ddee26c..4ca46b20af5 100644 --- a/src/window.h +++ b/src/window.h @@ -1,6 +1,6 @@ /* Window definitions for GNU Emacs. - Copyright (C) 1985,86,93,95,97,98,99, 2000,01,03,04 - Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1993, 1995, 1997, 1998, 1999, 2000, 2001, + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/xdisp.c b/src/xdisp.c index 1754598f929..a32cb70f436 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1,6 +1,7 @@ /* Display generation from window structure and buffer text. - Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, + 1997, 1998, 1999, 2000, 2001, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -231,7 +232,7 @@ extern Lisp_Object Qhelp_echo; Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map; Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions; -Lisp_Object Qredisplay_end_trigger_functions; +Lisp_Object Qredisplay_end_trigger_functions, Vredisplay_end_trigger_functions; Lisp_Object Qinhibit_point_motion_hooks; Lisp_Object QCeval, QCfile, QCdata, QCpropertize; Lisp_Object Qfontified; @@ -1333,6 +1334,9 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p) current_header_line_height = current_mode_line_height = -1; + if (visible_p && XFASTINT (w->hscroll) > 0) + *x -= XFASTINT (w->hscroll); + return visible_p; } @@ -2395,7 +2399,9 @@ start_display (it, w, pos) init_iterator (it, w, CHARPOS (pos), BYTEPOS (pos), row, DEFAULT_FACE_ID); it->first_vpos = first_vpos; - if (!it->truncate_lines_p) + /* Don't reseat to previous visible line start if current start + position is in a string or image. */ + if (it->method == GET_FROM_BUFFER && !it->truncate_lines_p) { int start_at_line_beg_p; int first_y = it->current_y; @@ -5858,6 +5864,15 @@ next_element_from_composition (it) Moving an iterator without producing glyphs ***********************************************************************/ +/* Check if iterator is at a position corresponding to a valid buffer + position after some move_it_ call. */ + +#define IT_POS_VALID_AFTER_MOVE_P(it) \ + ((it)->method == GET_FROM_STRING \ + ? IT_STRING_CHARPOS (*it) == 0 \ + : 1) + + /* Move iterator IT to a specified buffer or X position within one line on the display without producing glyphs. @@ -6366,8 +6381,12 @@ move_it_vertically_backward (it, dy) y-distance. */ it2 = *it; it2.max_ascent = it2.max_descent = 0; - move_it_to (&it2, start_pos, -1, -1, it2.vpos + 1, - MOVE_TO_POS | MOVE_TO_VPOS); + do + { + move_it_to (&it2, start_pos, -1, -1, it2.vpos + 1, + MOVE_TO_POS | MOVE_TO_VPOS); + } + while (!IT_POS_VALID_AFTER_MOVE_P (&it2)); xassert (IT_CHARPOS (*it) >= BEGV); it3 = it2; @@ -6565,21 +6584,45 @@ move_it_by_lines (it, dvpos, need_y_p) last_height = 0; } else if (dvpos > 0) - move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS); + { + move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS); + if (!IT_POS_VALID_AFTER_MOVE_P (it)) + move_it_to (it, IT_CHARPOS (*it) + 1, -1, -1, -1, MOVE_TO_POS); + } else { struct it it2; int start_charpos, i; /* Start at the beginning of the screen line containing IT's - position. */ + position. This may actually move vertically backwards, + in case of overlays, so adjust dvpos accordingly. */ + dvpos += it->vpos; move_it_vertically_backward (it, 0); + dvpos -= it->vpos; /* Go back -DVPOS visible lines and reseat the iterator there. */ start_charpos = IT_CHARPOS (*it); - for (i = -dvpos; i && IT_CHARPOS (*it) > BEGV; --i) + for (i = -dvpos; i > 0 && IT_CHARPOS (*it) > BEGV; --i) back_to_previous_visible_line_start (it); reseat (it, it->current.pos, 1); + + /* Move further back if we end up in a string or an image. */ + while (!IT_POS_VALID_AFTER_MOVE_P (it)) + { + /* First try to move to start of display line. */ + dvpos += it->vpos; + move_it_vertically_backward (it, 0); + dvpos -= it->vpos; + if (IT_POS_VALID_AFTER_MOVE_P (it)) + break; + /* If start of line is still in string or image, + move further back. */ + back_to_previous_visible_line_start (it); + reseat (it, it->current.pos, 1); + dvpos--; + } + it->current_x = it->hpos = 0; /* Above call may have moved too far if continuation lines @@ -7044,6 +7087,9 @@ message3_nolog (m, nbytes, multibyte) set_message (NULL, m, nbytes, multibyte); if (minibuffer_auto_raise) Fraise_frame (frame); + /* Assume we are not echoing. + (If we are, echo_now will override this.) */ + echo_message_buffer = Qnil; } else clear_message (1, 1); @@ -7587,13 +7633,16 @@ display_echo_area_1 (a1, a2, a3, a4) int window_height_changed_p = 0; /* Do this before displaying, so that we have a large enough glyph - matrix for the display. */ + matrix for the display. If we can't get enough space for the + whole text, display the last N lines. That works by setting w->start. */ window_height_changed_p = resize_mini_window (w, 0); + /* Use the starting position chosen by resize_mini_window. */ + SET_TEXT_POS_FROM_MARKER (start, w->start); + /* Display. */ clear_glyph_matrix (w->desired_matrix); XSETWINDOW (window, w); - SET_TEXT_POS (start, BEG, BEG_BYTE); try_window (window, start, 0); return window_height_changed_p; @@ -7649,8 +7698,14 @@ resize_mini_window_1 (a1, exactly, a3, a4) /* Resize mini-window W to fit the size of its contents. EXACT:P means size the window exactly to the size needed. Otherwise, it's - only enlarged until W's buffer is empty. Value is non-zero if - the window height has been changed. */ + only enlarged until W's buffer is empty. + + Set W->start to the right place to begin display. If the whole + contents fit, start at the beginning. Otherwise, start so as + to make the end of the contents appear. This is particularly + important for y-or-n-p, but seems desirable generally. + + Value is non-zero if the window height has been changed. */ int resize_mini_window (w, exact_p) @@ -7662,6 +7717,11 @@ resize_mini_window (w, exact_p) xassert (MINI_WINDOW_P (w)); + /* By default, start display at the beginning. */ + set_marker_both (w->start, w->buffer, + BUF_BEGV (XBUFFER (w->buffer)), + BUF_BEGV_BYTE (XBUFFER (w->buffer))); + /* Don't resize windows while redisplaying a window; it would confuse redisplay functions when the size of the window they are displaying changes from under them. Such a resizing can happen, @@ -7725,7 +7785,7 @@ resize_mini_window (w, exact_p) if (height > max_height) { height = max_height; - init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID); + init_iterator (&it, w, ZV, ZV_BYTE, NULL, DEFAULT_FACE_ID); move_it_vertically_backward (&it, (height - 1) * unit); start = it.current.pos; } @@ -10050,7 +10110,9 @@ select_frame_for_redisplay (frame) (BUFFER_LOCAL_VALUEP (val) || SOME_BUFFER_LOCAL_VALUEP (val))) && XBUFFER_LOCAL_VALUE (val)->check_frame) - Fsymbol_value (sym); + /* Use find_symbol_value rather than Fsymbol_value + to avoid an error if it is void. */ + find_symbol_value (sym); for (tail = XFRAME (old)->param_alist; CONSP (tail); tail = XCDR (tail)) if (CONSP (XCAR (tail)) @@ -10061,7 +10123,7 @@ select_frame_for_redisplay (frame) (BUFFER_LOCAL_VALUEP (val) || SOME_BUFFER_LOCAL_VALUEP (val))) && XBUFFER_LOCAL_VALUE (val)->check_frame) - Fsymbol_value (sym); + find_symbol_value (sym); } @@ -10135,6 +10197,16 @@ redisplay_internal (preserve_echo_area) ++redisplaying_p; specbind (Qinhibit_free_realized_faces, Qnil); + { + Lisp_Object tail, frame; + + FOR_EACH_FRAME (tail, frame) + { + struct frame *f = XFRAME (frame); + f->already_hscrolled_p = 0; + } + } + retry: pause = 0; reconsider_clip_changes (w, current_buffer); @@ -10569,8 +10641,12 @@ redisplay_internal (preserve_echo_area) if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f)) { /* See if we have to hscroll. */ - if (hscroll_windows (f->root_window)) - goto retry; + if (!f->already_hscrolled_p) + { + f->already_hscrolled_p = 1; + if (hscroll_windows (f->root_window)) + goto retry; + } /* Prevent various kinds of signals during display update. stdio is not robust about handling @@ -11301,7 +11377,7 @@ cursor_row_fully_visible_p (w, force_p, current_matrix_p) window_height = window_box_height (w); if (row->height >= window_height) { - if (!force_p || w->vscroll) + if (!force_p || MINI_WINDOW_P (w) || w->vscroll) return 1; } return 0; @@ -11831,7 +11907,10 @@ try_cursor_movement (window, startp, scroll_step) while (!row->mode_line_p && (MATRIX_ROW_START_CHARPOS (row) > PT || (MATRIX_ROW_START_CHARPOS (row) == PT - && MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P (row))) + && (MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P (row) + || (/* STARTS_IN_MIDDLE_OF_STRING_P (row) */ + row > w->current_matrix->rows + && (row-1)->ends_in_newline_from_string_p)))) && (row->y > top_scroll_margin || CHARPOS (startp) == BEGV)) { @@ -12661,10 +12740,9 @@ redisplay_window (window, just_this_one_p) #ifdef HAVE_WINDOW_SYSTEM if (FRAME_WINDOW_P (f) - && update_window_fringes (w, 0) - && !just_this_one_p - && (used_current_matrix_p || overlay_arrow_seen) - && !w->pseudo_window_p) + && update_window_fringes (w, (just_this_one_p + || (!used_current_matrix_p && !overlay_arrow_seen) + || w->pseudo_window_p))) { update_begin (f); BLOCK_INPUT; @@ -12741,7 +12819,8 @@ try_window (window, pos, check_margins) } /* Don't let the cursor end in the scroll margins. */ - if (check_margins) + if (check_margins + && !MINI_WINDOW_P (w)) { int this_scroll_margin, cursor_height; @@ -15006,10 +15085,12 @@ cursor_row_p (w, row) if (PT == MATRIX_ROW_END_CHARPOS (row)) { /* If the row ends with a newline from a string, we don't want - the cursor there (if the row is continued it doesn't end in a - newline). */ + the cursor there, but we still want it at the start of the + string if the string starts in this row. + If the row is continued it doesn't end in a newline. */ if (CHARPOS (row->end.string_pos) >= 0) - cursor_row_p = row->continued_p; + cursor_row_p = (row->continued_p + || PT >= MATRIX_ROW_START_CHARPOS (row)); else if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row)) { /* If the row ends in middle of a real character, @@ -17566,6 +17647,15 @@ calc_pixel_width_or_height (res, it, prop, font, width_p, align_to) if (pixels > 0) { double ppi; +#ifdef HAVE_WINDOW_SYSTEM + if (FRAME_WINDOW_P (it->f) + && (ppi = (width_p + ? FRAME_X_DISPLAY_INFO (it->f)->resx + : FRAME_X_DISPLAY_INFO (it->f)->resy), + ppi > 0)) + return OK_PIXELS (ppi / pixels); +#endif + if ((ppi = NUMVAL (Vdisplay_pixels_per_inch), ppi > 0) || (CONSP (Vdisplay_pixels_per_inch) && (ppi = (width_p @@ -23001,7 +23091,7 @@ of the top or bottom of the window. */); scroll_margin = 0; DEFVAR_LISP ("display-pixels-per-inch", &Vdisplay_pixels_per_inch, - doc: /* Pixels per inch on current display. + doc: /* Pixels per inch value for non-window system displays. Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI). */); Vdisplay_pixels_per_inch = make_float (72.0); @@ -23088,6 +23178,12 @@ and its new display-start position. Note that the value of `window-end' is not valid when these functions are called. */); Vwindow_scroll_functions = Qnil; + DEFVAR_LISP ("redisplay-end-trigger-functions", &Vredisplay_end_trigger_functions, + doc: /* Functions called when redisplay of a window reaches the end trigger. +Each function is called with two arguments, the window and the end trigger value. +See `set-window-redisplay-end-trigger'. */); + Vredisplay_end_trigger_functions = Qnil; + DEFVAR_BOOL ("mouse-autoselect-window", &mouse_autoselect_window, doc: /* *Non-nil means autoselect window with mouse pointer. */); mouse_autoselect_window = 0; diff --git a/src/xfaces.c b/src/xfaces.c index 0667d3823c7..06022383cb9 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -1,6 +1,6 @@ /* xfaces.c -- "Face" primitives. - Copyright (C) 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation. + Copyright (C) 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -786,8 +786,6 @@ x_free_gc (f, gc) #ifdef MAC_OS /* Mac OS emulation of GCs */ -extern XGCValues *XCreateGC (void *, Window, unsigned long, XGCValues *); - static INLINE GC x_create_gc (f, mask, xgcv) struct frame *f; @@ -3926,7 +3924,7 @@ Value is a vector of face attributes. */) DEFUN ("internal-lisp-face-p", Finternal_lisp_face_p, Sinternal_lisp_face_p, 1, 2, 0, doc: /* Return non-nil if FACE names a face. -If optional second parameter FRAME is non-nil, check for the +If optional second argument FRAME is non-nil, check for the existence of a frame-local face with name FACE on that frame. Otherwise check for the existence of a global face. */) (face, frame) @@ -4735,7 +4733,12 @@ x_update_menu_appearance (f) const char *suffix = "List"; Bool motif = True; #else +#if defined HAVE_X_I18N + + const char *suffix = "Set"; +#else const char *suffix = ""; +#endif Bool motif = False; #endif #if defined HAVE_X_I18N @@ -6757,14 +6760,21 @@ try_font_list (f, attrs, family, registry, fonts, prefer_face_family) nfonts = try_alternative_families (f, try_family, registry, fonts); #ifdef MAC_OS - /* When realizing the default face and a font spec does not matched - exactly, Emacs looks for ones with the same registry as the - default font. On the Mac, this is mac-roman, which does not work - if the family is -etl-fixed, e.g. The following widens the - choices and fixes that problem. */ - if (nfonts == 0 && STRINGP (try_family) && STRINGP (registry) - && xstricmp (SDATA (registry), "mac-roman") == 0) - nfonts = try_alternative_families (f, try_family, Qnil, fonts); + if (nfonts == 0 && STRINGP (try_family) && STRINGP (registry)) + if (xstricmp (SDATA (registry), "mac-roman") == 0) + /* When realizing the default face and a font spec does not + matched exactly, Emacs looks for ones with the same registry + as the default font. On the Mac, this is mac-roman, which + does not work if the family is -etl-fixed, e.g. The + following widens the choices and fixes that problem. */ + nfonts = try_alternative_families (f, try_family, Qnil, fonts); + else if (SBYTES (try_family) > 0 + && SREF (try_family, SBYTES (try_family) - 1) != '*') + /* Some Central European/Cyrillic font family names have the + Roman counterpart name as their prefix. */ + nfonts = try_alternative_families (f, concat2 (try_family, + build_string ("*")), + registry, fonts); #endif if (EQ (try_family, family)) diff --git a/src/xfns.c b/src/xfns.c index f629ee31aef..11f4c2eadb1 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -1,6 +1,6 @@ /* Functions for the X window system. Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation. + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/xmenu.c b/src/xmenu.c index 321e6deb7c6..4abf89655df 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1,6 +1,6 @@ /* X Communication module for terminals which understand the X protocol. - Copyright (C) 1986, 1988, 1993, 1994, 1996, 1999, 2000, 2001, 2003, 2004, - 2005 Free Software Foundation, Inc. + Copyright (C) 1986, 1988, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/xrdb.c b/src/xrdb.c index 248e5eba64d..822fb6e2624 100644 --- a/src/xrdb.c +++ b/src/xrdb.c @@ -1,5 +1,6 @@ /* Deal with the X Resource Manager. - Copyright (C) 1990, 1993, 1994, 2000, 2001 Free Software Foundation. + Copyright (C) 1990, 1993, 1994, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/xselect.c b/src/xselect.c index e7c6d57f870..432365fdb63 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -1,6 +1,6 @@ /* X Selection processing for Emacs. - Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004 - Free Software Foundation. + Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -2986,7 +2986,6 @@ A value of 0 means wait as long as necessary. This is initialized from the QTEXT = intern ("TEXT"); staticpro (&QTEXT); QCOMPOUND_TEXT = intern ("COMPOUND_TEXT"); staticpro (&QCOMPOUND_TEXT); QUTF8_STRING = intern ("UTF8_STRING"); staticpro (&QUTF8_STRING); - QTIMESTAMP = intern ("TIMESTAMP"); staticpro (&QTIMESTAMP); QDELETE = intern ("DELETE"); staticpro (&QDELETE); QMULTIPLE = intern ("MULTIPLE"); staticpro (&QMULTIPLE); QINCR = intern ("INCR"); staticpro (&QINCR); diff --git a/src/xsmfns.c b/src/xsmfns.c index 88bc416e5d9..fc427a29790 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c @@ -1,6 +1,6 @@ /* Session management module for systems which understand the X Session management protocol. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/xterm.c b/src/xterm.c index aa0ea804ae6..04f9b895742 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1,6 +1,6 @@ /* X Communication module for terminals which understand the X protocol. Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -9285,7 +9285,14 @@ x_wm_set_icon_pixmap (f, pixmap_id) #endif } -#ifdef USE_X_TOOLKIT /* same as in x_wm_set_window_state. */ + +#ifdef USE_GTK + { + xg_set_frame_icon (f, icon_pixmap, icon_mask); + return; + } + +#elif defined (USE_X_TOOLKIT) /* same as in x_wm_set_window_state. */ { Arg al[1]; @@ -9295,12 +9302,12 @@ x_wm_set_icon_pixmap (f, pixmap_id) XtSetValues (f->output_data.x->widget, al, 1); } -#else /* not USE_X_TOOLKIT */ +#else /* not USE_X_TOOLKIT && not USE_GTK */ f->output_data.x->wm_hints.flags |= (IconPixmapHint | IconMaskHint); XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints); -#endif /* not USE_X_TOOLKIT */ +#endif /* not USE_X_TOOLKIT && not USE_GTK */ } void diff --git a/src/xterm.h b/src/xterm.h index 835434d0901..aa615d06a17 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1,6 +1,6 @@ /* Definitions and headers for communication with X protocol. - Copyright (C) 1989, 1993, 1994, 1998, 1999, 2000,01,02,03,04 - Free Software Foundation, Inc. + Copyright (C) 1989, 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. |