1. 24 Dec, 2012 1 commit
  2. 20 Dec, 2012 2 commits
  3. 17 Dec, 2012 1 commit
    • Stefan Monnier's avatar
      * src/xdisp.c (select_frame_for_redisplay): Use select_window_1 to · 1e101a4b
      Stefan Monnier authored
      propagate redisplay's scrolling (if any) to the right window.
      (redisplay_internal): Use ensure_selected_frame.
      (display_mode_lines): Complete last fix.
      * src/window.c (select_window_1): New func, extracted from select_window.
      (select_window): Use it.
      * src/window.h (select_window_1): Declare.
      1e101a4b
  4. 14 Dec, 2012 2 commits
  5. 13 Dec, 2012 2 commits
    • Paul Eggert's avatar
      * xdisp.c: Minor style fixes. · 893f52d8
      Paul Eggert authored
      (init_iterator): Hoist assignment out of if-expression.
      (markpos_of_region): Callers now test for sign, not for -1.
      893f52d8
    • Dmitry Antipov's avatar
      Minor redisplay optimization when the region length is zero. · 40d1e434
      Dmitry Antipov authored
      * xdisp.c (markpos_of_region): New function.
      (init_iterator): Do not highlight the region of zero length.
      (redisplay_window): Check whether the region is of non-zero length.
      (try_cursor_movement): Allow if the region length is zero.
      (try_window_reusing_current_matrix, try_window_id): Likewise.
      40d1e434
  6. 12 Dec, 2012 1 commit
  7. 11 Dec, 2012 2 commits
    • Eli Zaretskii's avatar
      Fix part of bug #13011 with display of lines that have a box face. · f9d1448f
      Eli Zaretskii authored
       src/xdisp.c (handle_face_prop): Fix logic of computing
       it->start_of_box_run_p.
       (append_space_for_newline): If the glyph row is R2L, reset the
       iterator's end_of_box_run_p flag before prepending the space glyph.
       (extend_face_to_end_of_line): If the glyph row is R2L, reset the
       iterator's start_of_box_run_p flag before prepending the stretch.
       (append_glyph, produce_image_glyph, append_composite_glyph)
       (append_stretch_glyph, append_glyphless_glyph): Reverse the
       left_box_line_p and right_box_line_p flags of the glyph for R2L
       glyph rows.
      f9d1448f
    • Dmitry Antipov's avatar
      Consistently use marker_position and marker_byte_position. · 4c1acb95
      Dmitry Antipov authored
      * fringe.c (Ffringe_bitmaps_at_pos):
      * indent.c (Fvertical_motion):
      * insdel.c (prepare_to_modify_buffer):
      * keyboard.c (make_lispy_position):
      * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
      (window_scroll_pixel_based, displayed_window_lines)
      (Fset_window_configuration):
      * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
      (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
      Replace direct access to marker fields with calls
      to marker_position and/or marker_byte_position.
      4c1acb95
  8. 10 Dec, 2012 1 commit
    • Dmitry Antipov's avatar
      Per-buffer window counters. · 98a07056
      Dmitry Antipov authored
      * buffer.h (struct buffer): New member window_count.
      (buffer_window_count): New function.
      * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
      Initialize window_count.
      (Fkill_buffer): Verify window_count for the buffer being killed.
      (modify_overlay): Do not force redisplay if buffer is not shown
      in any window.
      (init_buffer_once): Initialize window_count for buffer_defaults
      and buffer_local_symbols.
      * window.h (buffer_shared): Remove declaration.
      (wset_buffer): Convert from inline ...
      * window.c (wset_buffer): ... to an ordinary function.
      (adjust_window_count): New function.
      (make_parent_window): Use it.
      * xdisp.c (buffer_shared): Remove.
      (redisplay_internal, redisplay_window): Adjust users.
      (buffer_shared_and_changed): Use per-buffer window counter.
      98a07056
  9. 04 Dec, 2012 1 commit
    • Dmitry Antipov's avatar
      * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state · 350f51ad
      Dmitry Antipov authored
      member.  Adjust users.  Convert mouse_face_past_end, mouse_face_defer
      and mouse_face_hidden members to a bitfields.
      * frame.h (struct frame): Remove set-but-not-used space_width member.
      (FRAME_SPACE_WIDTH): Remove.
      * nsterm.m, w32term.c, xterm.c: Adjust users.
      * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
      member.  Adjust users.  Convert term_initted, delete_in_insert_mode,
      costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
      members to a bitfields.
      350f51ad
  10. 03 Dec, 2012 1 commit
  11. 30 Nov, 2012 1 commit
  12. 29 Nov, 2012 1 commit
    • Dmitry Antipov's avatar
      * xdisp.c (window_outdated): Remove eassert since it hits · 3940b924
      Dmitry Antipov authored
      some suspicious corner cases (see Bug#13007 and Bug#13012).
      (mode_line_update_needed): New function.
      (redisplay_internal, redisplay_window): Use it.
      (ensure_selected_frame): New function.
      (redisplay_internal, unwind_redisplay): Use it.
      (redisplay_internal): Move comment about buffer_shared...
      (buffer_shared_and_changed): ...near to its real use.
      3940b924
  13. 24 Nov, 2012 1 commit
  14. 23 Nov, 2012 1 commit
  15. 22 Nov, 2012 2 commits
    • Dmitry Antipov's avatar
      * alloc.c (Fgarbage_collect): Unblock input after clearing · 5c747675
      Dmitry Antipov authored
      gc_in_progress to avoid note_mouse_highlight glitch with GC.
      * frame.h (FRAME_MOUSE_UPDATE): New macro.
      * msdos.c (IT_frame_up_to_date): Use it here...
      * w32term.c (w32_frame_up_to_date): ...here...
      * xterm.c (XTframe_up_to_date): ...and here...
      * nsterm.m (ns_frame_up_to_date): ...but not here.
      * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
      Adjust users.
      * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
      Do not check whether GC is in progress.
      5c747675
    • Dmitry Antipov's avatar
      * xdisp.c (window_buffer_changed): New function. · 6ceeb5f1
      Dmitry Antipov authored
      (update_menu_bar, update_tool_bar): Use it to
      simplify large 'if' statements.
      (redisplay_internal): Generalize commonly used
      'tail' and 'frame' local variables.
      6ceeb5f1
  16. 21 Nov, 2012 1 commit
  17. 20 Nov, 2012 2 commits
  18. 19 Nov, 2012 1 commit
    • Eli Zaretskii's avatar
      More fixes for bug #12878 with MS-Windows MSVC build. · 88c4a13c
      Eli Zaretskii authored
       src/xdisp.c (start_hourglass) [HAVE_NTGUI]: Don't mix declaration of
       w32_note_current_window with code.  (Backport from trunk.)
       src/w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
       (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
       Define for the MSVC compiler.
       src/w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing
       semi-colon.
      
       nt/inc/stdint.h (PTRDIFF_MIN) [!__GNUC__]: Define for MSVC.
      88c4a13c
  19. 14 Nov, 2012 1 commit
  20. 13 Nov, 2012 1 commit
    • Dmitry Antipov's avatar
      Omit glyphs initialization at startup. · 2a14f83b
      Dmitry Antipov authored
      * dispnew.c (glyphs_initialized_initially_p): Remove.
      (adjust_frame_glyphs_initially): Likewise.  Adjust users.
      (Fredraw_frame): Move actual code from here...
      (redraw_here): ...to here.  Add eassert.  Adjust comment.
      (Fredraw_display): Use redraw_frame.
      * xdisp.c (clear_garbaged_frames): Likewise.
      2a14f83b
  21. 12 Nov, 2012 2 commits
    • Eli Zaretskii's avatar
      Fix bug #12867 with crashes due to large field width in mode-line format. · 32520273
      Eli Zaretskii authored
       src/xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
       passed to pint2str and pint2hrstr to be at most the size of the
       frame's decode_mode_spec_buffer.  This avoids crashes with very
       large values of FIELD_WIDTH argument to decode_mode_spec.
      32520273
    • Dmitry Antipov's avatar
      Simplify by using FOR_EACH_FRAME here and there. · 5b04e9f9
      Dmitry Antipov authored
      * frame.c (next_frame, prev_frame, other_visible_frames)
      (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
      * w32term.c (x_window_to_scroll_bar): Likewise.
      * window.c (window_list): Likewise.
      * xdisp.c (x_consider_frame_title): Likewise.
      * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
      * xfns.c (x_window_to_frame, x_any_window_to_frame)
      (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
      * xmenu.c (menubar_id_to_frame): Likewise.
      * xselect.c (frame_for_x_selection): Likewise.
      * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
      (x_window_to_menu_bar): Likewise.
      * w32fns.c (x_window_to_frame): Likewise.  Adjust comment.
      5b04e9f9
  22. 11 Nov, 2012 1 commit
  23. 06 Nov, 2012 2 commits
    • Eli Zaretskii's avatar
      Fix bug #12811 with scrolling under scroll-up/down-aggressively. · acf93bcf
      Eli Zaretskii authored
       src/xdisp.c (try_scrolling): Fix correction of aggressive-scroll
       amount when the scroll margins are too large.  When scrolling
       backwards in the buffer, give up if cannot reach point or the
       scroll margin within a reasonable number of screen lines.  Fixes
       point position in window under scroll-up/down-aggressively when
       point is positioned many lines beyond the window top/bottom.
      acf93bcf
    • Dmitry Antipov's avatar
      Widely used frame validity and checking functions. · d9f07150
      Dmitry Antipov authored
      * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
      * frame.c (decode_live_frame, decode_any_frame): New functions.
      (delete_frame, Fredirect_frame_focus, Fframe_parameters)
      (Fframe_parameter, Fframe_char_height, Fframe_char_width)
      (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
      (Fframe_pointer_visible_p): Use decode_any_frame.
      (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
      (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
      (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
      (Fframe_focus): Likewise.  Allow zero number of arguments.
      Adjust docstring.
      (frame_buffer_list, frame_buffer_predicate): Remove.
      * lisp.h (frame_buffer_predicate): Remove prototype.
      * buffer.c (Fother_buffer): Use decode_any_frame.
      * xdisp.c (Ftool_bar_lines_needed): Likewise.
      * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
      * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
      (Fclose_font, Ffont_info): Use decode_live_frame.
      * fontset.c (check_fontset_name): Likewise.
      * terminal.c (Fframe_terminal): Likewise.
      * w32fns.c (check_x_frame): Likewise.
      * window.c (Fminibuffer_window, Fwindow_at)
      (Fcurrent_window_configuration): Likewise.
      (Frun_window_configuration_change_hook, Fwindow_resize_apply):
      Likewise.  Allow zero number of arguments.  Adjust docstring.
      * dispnew.c (Fredraw_frame): Likewise.
      * xfaces.c (frame_or_selected_frame): Remove.
      (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
      (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
      (Fframe_face_alist): Use decode_live_frame.
      * xfns.c (check_x_frame): Likewise.
      d9f07150
  24. 03 Nov, 2012 1 commit
  25. 02 Nov, 2012 1 commit
    • Dmitry Antipov's avatar
      Window-related stuff cleanup here and there. · b9e9df47
      Dmitry Antipov authored
      * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
      Use decode_any_window.
      * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
      * xdisp.c (Fformat_mode_line): Likewise.
      * font.c (Ffont_at): Use decode_live_window.
      * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
      * window.c (decode_next_window_args): Likewise.
      (decode_any_window): Remove static.
      * window.h (decode_any_window): Add prototype.
      * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
      * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
      respectively.
      b9e9df47
  26. 20 Oct, 2012 1 commit
    • Paul Eggert's avatar
      Port to OpenBSD 5.1. · 4973679b
      Paul Eggert authored
      * frame.c (Fmouse_position, Fmouse_pixel_position):
      * xdisp.c (produce_stretch_glyph):
      Declare local vars only when they're needed.
      This is clearer and avoids a warning on OpenBSD about unused vars.
      * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
      This is safer, and avoids OpenBSD warnings about unused vars.
      * keyboard.c (record_menu_key): Remove unnecessary decl.
      (poll_timer): Define only if POLL_FOR_INPUT is defined.
      * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
      as our definition clashes with OpenBSD's.
      * xfaces.c (load_face_colors, check_lface_attrs)
      (get_lface_attributes_no_remap, get_lface_attributes)
      (lface_fully_specified_p, x_supports_face_attributes_p)
      (tty_supports_face_attributes_p, face_fontset, realize_face)
      (realize_x_face, realize_tty_face):
      Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
      merely Lisp_Object *.  This is more informative and avoids
      a warning on OpenBSD about accessing beyond an object's size.
      4973679b
  27. 17 Oct, 2012 1 commit
  28. 08 Oct, 2012 1 commit
  29. 01 Oct, 2012 2 commits
    • Paul Eggert's avatar
    • Paul Eggert's avatar
      Prefer plain 'static' to 'static inline'. · b0ab8123
      Paul Eggert authored
      With static functions, modern compilers inline pretty well by
      themselves; advice from programmers often hurts as much as it helps.
      On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
      this change shrinks the text size of the Emacs executable by 1.1%
      without affecting CPU significantly in my benchmark.
      * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
      (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
      (mark_maybe_object, mark_maybe_pointer, bounded_number):
      * buffer.c (bset_abbrev_mode, bset_abbrev_table)
      (bset_auto_fill_function, bset_auto_save_file_format)
      (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
      (bset_bidi_display_reordering, bset_buffer_file_coding_system)
      (bset_cache_long_line_scans, bset_case_fold_search)
      (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
      (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
      (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
      (bset_fringe_indicator_alist, bset_fringes_outside_margins)
      (bset_header_line_format, bset_indicate_buffer_boundaries)
      (bset_indicate_empty_lines, bset_invisibility_spec)
      (bset_left_fringe_width, bset_major_mode, bset_mark)
      (bset_minor_modes, bset_mode_line_format, bset_mode_name)
      (bset_name, bset_overwrite_mode, bset_pt_marker)
      (bset_right_fringe_width, bset_save_length)
      (bset_scroll_bar_width, bset_scroll_down_aggressively)
      (bset_scroll_up_aggressively, bset_selective_display)
      (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
      (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
      (set_buffer_overlays_after):
      * category.c (bset_category_table):
      * charset.c (read_hex):
      * coding.c (produce_composition, produce_charset)
      (handle_composition_annotation, handle_charset_annotation)
      (char_encodable_p):
      * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
      (assign_row, set_frame_matrix_frame, make_current)
      (add_row_entry):
      * eval.c (set_specpdl_symbol, set_specpdl_old_value):
      * fns.c (maybe_resize_hash_table):
      * frame.c (fset_buffer_predicate, fset_minibuffer_window):
      * gmalloc.c (register_heapinfo):
      * image.c (lookup_image_type):
      * intervals.c (set_interval_object, set_interval_left)
      (set_interval_right, copy_interval_parent, rotate_right)
      (rotate_left, balance_possible_root_interval):
      * keyboard.c (kset_echo_string, kset_kbd_queue)
      (kset_keyboard_translate_table, kset_last_prefix_arg)
      (kset_last_repeatable_command, kset_local_function_key_map)
      (kset_overriding_terminal_local_map, kset_real_last_command)
      (kset_system_key_syms, clear_event, set_prop):
      * lread.c (digit_to_number):
      * marker.c (attach_marker, live_buffer, set_marker_internal):
      * nsterm.m (ns_compute_glyph_string_overhangs):
      * process.c (pset_buffer, pset_command)
      (pset_decode_coding_system, pset_decoding_buf)
      (pset_encode_coding_system, pset_encoding_buf, pset_filter)
      (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
      (pset_status, pset_tty_name, pset_type, pset_write_queue):
      * syntax.c (bset_syntax_table, dec_bytepos):
      * terminal.c (tset_param_alist):
      * textprop.c (interval_has_some_properties)
      (interval_has_some_properties_list):
      * window.c (wset_combination_limit, wset_dedicated)
      (wset_display_table, wset_hchild, wset_left_fringe_width)
      (wset_left_margin_cols, wset_new_normal, wset_new_total)
      (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
      (wset_right_fringe_width, wset_right_margin_cols)
      (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
      (wset_vertical_scroll_bar_type, wset_window_parameters):
      * xdisp.c (wset_base_line_number, wset_base_line_pos)
      (wset_column_number_displayed, wset_region_showing)
      (window_box_edges, run_window_scroll_functions)
      (append_glyph_string_lists, prepend_glyph_string_lists)
      (append_glyph_string, set_glyph_string_background_width)
      (append_glyph, append_composite_glyph)
      (take_vertical_position_into_account):
      * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
      (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
      (lface_hash, lface_same_font_attributes_p, lookup_face):
      * xml.c (libxml2_loaded_p):
      * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
      (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
      Now 'static', not 'static inline'.
      
      Fixes: debbugs:12541
      b0ab8123
  30. 30 Sep, 2012 1 commit
    • Eli Zaretskii's avatar
      Support atimers and CPU profiler via profile.c on MS-Windows. · c06c382a
      Eli Zaretskii authored
       src/w32proc.c (sig_mask, crit_sig): New static variables.
       (sys_signal): Support SIGALRM and SIGPROF.
       (sigemptyset, sigaddset, sigfillset, sigprocmask)
       (pthread_sigmask, setpgrp): Moved here from w32.c.  sigaddset,
       sigfillset, and sigprocmask are no longer no-ops.
       (sigismember): New function.
       (struct itimer_data): New definition.
       (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
       (crit_prof): New static variables.
       (MAX_SINGLE_SLEEP): New definition.
       (timer_loop, stop_timer_thread, term_timers, init_timers)
       (start_timer_thread, getitimer, setitimer): New functions.
       (alarm): No longer a no-op, calls setitimer.
       src/w32.c (term_ntproc): Call term_timers.
       (init_ntproc): Make sure all signals are unblocked at startup, to
       erase any traces of dumping.  Call init_timers.
       src/w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
       Windows-specific code to display the hourglass mouse pointer is no
       longer used.
       (w32_wnd_proc): Remove code that handled the WM_TIMER message due
       to hourglass timer expiration.
       (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
       Remove, no longer used.
       (w32_note_current_window, show_hourglass, hide_hourglass): New
       functions, in support of hourglass cursor display similar to other
       window systems.
       (syms_of_w32fns): Don't initialize hourglass_timer.
       src/xdisp.c (start_hourglass, cancel_hourglass): Now used on
       WINDOWSNT as well.
       (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
       src/w32.h (init_timers, term_timers): Add prototypes.
      
       nt/inc/sys/time.h (ITIMER_REAL, ITIMER_PROF): Define.
       (struct itimerval): Define.
       (getitimer, setitimer): Add prototypes.
       nt/inc/ms-w32.h <sigset_t> [_MSVC_VER]: Make the typedef consistent
       with MinGW.
       (SA_RESTART, SIGPROF): Define.
       nt/config.nt (HAVE_SETITIMER): Define to 1.
      c06c382a
  31. 29 Sep, 2012 1 commit