1. 11 Nov, 2012 1 commit
  2. 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
  3. 03 Nov, 2012 1 commit
  4. 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
  5. 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
  6. 17 Oct, 2012 1 commit
  7. 08 Oct, 2012 1 commit
  8. 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
  9. 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
  10. 29 Sep, 2012 1 commit
  11. 28 Sep, 2012 1 commit
  12. 25 Sep, 2012 1 commit
    • Chong Yidong's avatar
      Use declare forms, where possible, to mark obsolete functions. · 59f7af81
      Chong Yidong authored
      * lisp/allout.el (allout-passphrase-hint-string): Likewise.
      (allout-init): Use a declare form to mark obsolete.
      
      * lisp/calendar/calendar.el (calendar-version):
      * lisp/calendar/icalendar.el (icalendar-extract-ical-from-buffer)
      (icalendar-convert-diary-to-ical):
      * lisp/cus-edit.el (custom-mode):
      * lisp/ansi-color.el (ansi-color-unfontify-region):
      * lisp/international/latin1-disp.el (latin1-char-displayable-p):
      * lisp/progmodes/cwarn.el (turn-on-cwarn-mode):
      * lisp/progmodes/which-func.el (which-func-update-1): Use
      define-obsolete-function-alias.
      
      * lisp/bookmark.el (bookmark-jump-noselect): Use a declare form to mark
      this function obsolete.
      
      * lisp/calendar/cal-x.el (calendar-two-frame-setup)
      (calendar-only-one-frame-setup, calendar-one-frame-setup):
      * lisp/calendar/calendar.el (american-calendar, european-calendar)
      (calendar-for-loop):
      * lisp/comint.el (comint-dynamic-simple-complete)
      (comint-dynamic-complete-as-filename, comint-unquote-filename):
      * lisp/desktop.el (desktop-load-default):
      * lisp/dired-x.el (dired-omit-here-always)
      (dired-hack-local-variables, dired-default-directory):
      * lisp/emacs-lisp/derived.el (derived-mode-class):
      * lisp/emacs-lisp/timer.el (timer-set-time-with-usecs):
      * lisp/emacs-lock.el (toggle-emacs-lock):
      * lisp/epa.el (epa-display-verify-result):
      * lisp/epg.el (epg-sign-keys, epg-start-sign-keys)
      (epg-passphrase-callback-function):
      * lisp/eshell/esh-util.el (eshell-for):
      * lisp/eshell/eshell.el (eshell-remove-from-window-buffer-names)
      (eshell-add-to-window-buffer-names):
      * lisp/files.el (locate-file-completion):
      * lisp/imenu.el (imenu-example--create-c-index)
      (imenu-example--create-lisp-index)
      (imenu-example--lisp-extract-index-name)
      (imenu-example--name-and-position):
      * lisp/international/mule-cmds.el (princ-list):
      * lisp/international/mule-diag.el (decode-codepage-char):
      * lisp/international/mule-util.el (detect-coding-with-priority):
      * lisp/iswitchb.el (iswitchb-read-buffer):
      * lisp/mail/mailalias.el (mail-complete):
      * lisp/mail/sendmail.el (mail-sent-via):
      * lisp/mouse.el (mouse-popup-menubar-stuff, mouse-popup-menubar)
      (mouse-major-mode-menu):
      * lisp/password-cache.el (password-read-and-add):
      * lisp/pcomplete.el (pcomplete-parse-comint-arguments):
      * lisp/progmodes/sh-script.el (sh-maybe-here-document):
      * lisp/replace.el (query-replace-regexp-eval):
      * lisp/savehist.el (savehist-load):
      * lisp/simple.el (choose-completion-delete-max-match):
      * lisp/term.el (term-dynamic-simple-complete):
      * lisp/vc/ediff-init.el (ediff-check-version):
      * lisp/vc/ediff-wind.el (ediff-choose-window-setup-function-automatically):
      * lisp/vc/vc.el (vc-diff-switches-list):
      * lisp/view.el (view-return-to-alist-update): Likewise.
      
      * lisp/iswitchb.el (iswitchb-read-buffer): Move code of
      iswitchb-define-mode-map here, and delete that obsolete function.
      
      * lisp/subr.el (eval-next-after-load, makehash, insert-string)
      (assoc-ignore-representation, assoc-ignore-case): Use declare to
      mark obsolete.
      (mode-line-inverse-video): Variable deleted.
      
      * lisp/emacs-lisp/byte-run.el (make-obsolete): Doc fix; emphasize that
      this applies to functions.
      
      * lisp/erc/erc.el (erc-send-command): Use define-obsolete-function-alias.
      
      * lisp/international/mule-util.el (string-to-sequence): Remove.
      
      * lisp/net/newst-backend.el (newsticker-cache-filename):
      * lisp/net/newst-treeview.el (newsticker-groups-filename): Fix
      incorrect obsolescence declaration.
      
      * lisp/net/snmp-mode.el (snmp-font-lock-keywords-3): Don't use obsolete
      font-lock-reference-face.
      
      * lisp/url/url-parse.el (url-recreate-url-attributes):
      * lisp/url/url-util.el (url-generate-unique-filename): Use declare to mark
      obsolete.
      
      * src/xdisp.c (mode_line_inverse_video): Delete obsolete variable.
      59f7af81
  13. 24 Sep, 2012 2 commits
    • Stefan Monnier's avatar
      Try to let it compile on other platforms · ad942b63
      Stefan Monnier authored
      * src/profiler.c (evict_lower_half): Fix typo.
      (PROFILER_CPU_SUPPORT): Check and define if cpu-profiler is supported.
      Don't compile the cpu-profiler code, if not supported.
      (malloc_probe): Presume memory_log is non-nil.
      (syms_of_profiler): Don't defsubr functions when they aren't defined.
      * src/lisp.h (sample_profiler_running, gc_probe): Don't declare.
      ad942b63
    • Stefan Monnier's avatar
      Rewrite sampler to use Elisp hash-tables. · 3d80c99f
      Stefan Monnier authored
      * src/profiler.c: Remove filtering functionality.
      (is_in_trace, Qgc): Remove vars.
      (make_log, record_backtrace, Fsample_profiler_log):
      Rewrite, using Elisp hash-tables.
      (approximate_median, evict_lower_half): New functions.
      (cpu_log): Rename from sample_log.
      (cpu_gc_count): New var.
      (Fsample_profiler_reset, Fmemory_profiler_reset): Remove.
      (sigprof_handler): Add count to cpu_gc_count during GC, detected via
      backtrace_list.
      (block_sigprof, unblock_sigprof): Remove.
      (gc_probe, mark_profiler): Remove functions.
      (syms_of_profiler): Staticpro cpu_log and memory_log.
      
      * lisp/profiler.el (profiler-sample-interval): Move before first use.
      Change default to 1ms.
      (profiler-entry=, profiler-backtrace-reverse, profiler-log-fixup-slot)
      (profiler-calltree-elapsed<, profiler-calltree-elapsed>): Remove functions.
      (profiler-entry-format): Don't use type-of.
      (profiler-slot, profiler-log): Remove structs.
      (profiler-log-timestamp, profiler-log-type, profiler-log-diff-p):
      Redefine for new log representation.
      (profiler-log-diff, profiler-log-fixup, profiler-calltree-build-1):
      Rewrite for new log representation.
      (profiler-calltree): Remove `elapsed' fields.
      (profiler-calltree-count<, profiler-report-make-entry-part):
      Remove gc special case.
      (profiler-calltree-find): Use equal.
      (profiler-calltree-walk): Remove `args'; rely on closures instead.
      (profiler-calltree-compute-percentages-1): Remove; inlined.
      (profiler-calltree-compute-percentages): Simplify.
      (profiler-report-log, profiler-report-reversed)
      (profiler-report-order): Use defvar-local.
      (profiler-report-line-format): Remove `elapsed', do a bit of CSE.
      (profiler-report-mode-map): Remove up/down bindings.
      (profiler-report-make-buffer-name): Simplify by CSE.
      (profiler-report-mode): Remove redundant code.
      (profiler-report-expand-entry, profiler-report-collapse-entry):
      Use inhibit-read-only.
      (profiler-report-render-calltree-1): Simplify by CSE.
      (profiler-reset): Rewrite for new subroutines.
      (profiler--report-cpu): Rename from sample-profiler-report.
      (profiler--report-memory): Rename from memory-profiler-report.
      
      * src/alloc.c (Fgarbage_collect): Record itself in backtrace_list.
      Don't set is_in_trace any more.  Don't call mark_profiler.
      Only call gc_probe for the memory profiler.
      (syms_of_alloc): Define Qautomatic_gc.
      
      * src/lisp.h (SXHASH_COMBINE): Move back to...
      * src/fns.c (SXHASH_COMBINE): ...here.
      
      * src/xdisp.c (Qautomatic_redisplay): New constant.
      (redisplay_internal): Record itself in backtrace_list.
      (syms_of_xdisp): Define Qautomatic_redisplay.
      
      * .dir-locals.el (indent-tabs-mode): Remove personal preference.
      3d80c99f
  14. 23 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Simplify and avoid signal-handling races. · 4d7e6e51
      Paul Eggert authored
      * nt/inc/ms-w32.h (emacs_raise): New macro.
      * src/alloc.c (die):
      * src/sysdep.c (emacs_abort) [HAVE_NTGUI]:
      Avoid recursive loop if there's a fatal error in the function itself.
      * src/atimer.c (pending_atimers):
      * src/blockinput.h: Don't include "atimer.h"; no longer needed.
      (interrupt_input_pending): Remove.  All uses removed.
      pending_signals now counts both atimers and ordinary interrupts.
      This is less racy than having three separate pending-signal flags.
      (block_input, unblock_input, totally_unblock_input, unblock_input_to)
      (input_blocked_p):
      Rename from their upper-case counterparts BLOCK_INPUT,
      UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
      INPUT_BLOCKED_P, and turn into functions.  All uses changed.
      This makes it easier to access volatile variables more accurately.
      (BLOCK_INPUT_RESIGNAL): Remove.  All uses replaced by unblock_input ().
      (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
      that's more reliable if the code is buggy and sets
      interrupt_input_blocked to a negative value.  All uses changed.
      * src/atimer.c (deliver_alarm_signal):
      Remove.  No need to deliver this to the parent; any thread can
      handle this signal now.  All uses replaced by underlying handler.
      * src/atimer.c (turn_on_atimers):
      * src/dispnew.c (handle_window_change_signal):
      * src/emacs.c (handle_danger_signal):
      * src/keyboard.c (kbd_buffer_get_event):
      Don't reestablish signal handler; not needed with sigaction.
      * src/blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
      (UNBLOCK_INPUT_TO):
      Rework to avoid unnecessary accesses to volatile variables.
      (UNBLOCK_INPUT_TO): Now a function.
      (totally_unblock_input, unblock_input): New decls.
      * src/data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
      (init_data): Remove.  Necessary stuff now done in init_signal.
      * src/emacs.c, src/xdisp.c: Include "atimer.h", since we invoke atimer functions.
      * src/emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
      (fatal_error_code): Remove; no longer needed.
      (terminate_due_to_signal): Rename from fatal_error_backtrace, since
      it doesn't always backtrace.  All uses changed.  No need to reset
      signal to default, since sigaction and/or die does that for us now.
      Use emacs_raise (FOO), not kill (getpid (), FOO).
      (main): Check more-accurately whether we're dumping.
      Move fatal-error setup to sysdep.c
      * src/floatfns.c: Do not include "syssignal.h"; no longer needed.
      * src/gtkutil.c (xg_get_file_name, xg_get_font):
      Remove no-longer-needed signal-mask manipulation.
      * src/keyboard.c, src/process.c (POLL_FOR_INPUT):
      Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
      * src/keyboard.c (read_avail_input): Remove.
      All uses replaced by gobble_input.
      (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
      (kbd_buffer_store_event_hold, gobble_input):
      (record_asynch_buffer_change) [USABLE_SIGIO]:
      (store_user_signal_events):
      No need to mess with signal mask.
      (gobble_input): If blocking input and there are terminals, simply
      set pending_signals to 1 and return.  All hooks changed to not
      worry about whether input is blocked.
      (process_pending_signals): Clear pending_signals before processing
      them, in case a signal comes in while we're processing.
      By convention callers now test pending_signals before calling us.
      (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
      New functions, to support changes to blockinput.h.
      (handle_input_available_signal): Now extern.
      (reinvoke_input_signal): Remove.  All uses replaced by
      handle_async_input.
      (quit_count): Now volatile, since a signal handler uses it.
      (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.  All
      callers changed.  Block SIGINT only if not already blocked.
      Clear sigmask reliably, even if Fsignal returns, which it can.
      Omit unnecessary accesses to volatile var.
      (quit_throw_to_read_char): No need to restore sigmask.
      * src/keyboard.c (gobble_input, handle_user_signal):
      * src/process.c (wait_reading_process_output):
      Call signal-handling code rather than killing ourselves.
      * src/lisp.h: Include <float.h>, for...
      (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
      (pending_signals): Now volatile.
      (syms_of_data): Now const if IEEE floating point.
      (handle_input_available_signal) [USABLE_SIGIO]:
      (terminate_due_to_signal, record_child_status_change): New decls.
      * src/process.c (create_process): Avoid disaster if memory is exhausted
      while we're processing a vfork, by tightening the critical section
      around the vfork.
      (send_process_frame, process_sent_to, handle_pipe_signal)
      (deliver_pipe_signal): Remove.  No longer needed, as Emacs now
      ignores SIGPIPE.
      (send_process): No need for setjmp/longjmp any more, since the
      SIGPIPE stuff is now gone.  Instead, report an error if errno
      is EPIPE.
      (record_child_status_change): Now extern.  PID and W are now args.
      Return void, not bool.  All callers changed.
      * src/sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
      Remove.  All uses removed.  This bug should be fixed now in a
      different way.
      (wait_for_termination_1): Use waitpid rather than sigsuspend,
      and record the child status change directly.  This avoids the
      need to futz with the signal mask.
      (process_fatal_action): Move here from emacs.c.
      (emacs_sigaction_flags): New function, containing
      much of what used to be in emacs_sigaction_init.
      (emacs_sigaction_init): Use it.  Block nonfatal system signals that are
      caught by emacs, to make races less likely.
      (deliver_process_signal): Rename from handle_on_main_thread.
      All uses changed.
      (BACKTRACE_LIMIT_MAX): Now at top level.
      (thread_backtrace_buffer, threadback_backtrace_pointers):
      New static vars.
      (deliver_thread_signal, deliver_fatal_thread_signal):
      New functions, for more-accurate delivery of thread-specific signals.
      (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
      (deliver_arith_signal): Handle in this thread, not
      in the main thread, since it's triggered by this thread.
      (maybe_fatal_sig): New function.
      (init_signals): New arg DUMPING so that we can be more accurate
      about whether we're dumping.  Caller changed.
      Treat thread-specific signals differently from process-general signals.
      Block all signals while handling fatal error; that's safer.
      xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
      on IEEE hosts.
      When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
      Ignore SIGPIPE unless batch.
      (emacs_backtrace): Output backtrace for the appropriate thread,
      which is not necessarily the main thread.
      * src/syssignal.h: Include <stdbool.h>.
      (emacs_raise): New macro.
      * src/xterm.c (x_connection_signal): Remove; no longer needed
      now that we use sigaction.
      (x_connection_closed): No need to mess with sigmask now.
      (x_initialize): No need to reset SIGPIPE handler here, since
      init_signals does this for us now.
      
      Fixes: debbugs:12471
      4d7e6e51
  15. 22 Sep, 2012 1 commit
    • Eli Zaretskii's avatar
      Fix bug #10159 with crashes in auto-complete package. · 589bd69b
      Eli Zaretskii authored
       src/xdisp.c (next_overlay_string): Initialize it->end_charpos for
       the new overlay string.  Otherwise, the call to composition_compute_stop_pos
       in compute_stop_pos uses a wrong it->end_charpos value, and crashes because
       it runs off the end of the overlay string.
      589bd69b
  16. 17 Sep, 2012 1 commit
    • Daniel Colascione's avatar
      Implement cygw32 · 0fda9b75
      Daniel Colascione authored
      Here, we use the generic window-system configuration system we just
      implemented to support the w32 window-system in the mainline build
      under Cygwin.  (Previously, the w32 window system could only be
      compiled as part of the NT-native Emacs build process.)
      
      The changes in this patch need to be applied atomically in order to
      avoid breaking Emacs.  The changes include:
      
        - Changes throughout the Lisp and C code to not assume that
            NT Emacs and the w32 window system are synonymous.
      
        - Wiring up the regular select(2) event loop to Windows messages
      
        - Cleaning up the w32 drag-and-drop receiving code.
      
        - Exposing Cygwin path conversion functions to elisp.
      
        - Unicode file dialog support when compiling for Cygwin.
      
        - Splitting the w32 term lisp initialization code into code
          applicable to any w32 window-system and code specific to
          system-type windows-nt.
      
        - Integrating the old and new w32 code into the build system.
      0fda9b75
  17. 16 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Remove configure's --without-sync-input option. · 0caaedb1
      Paul Eggert authored
      When auditing signal-handling in preparation for cleaning it up,
      I found that SYNC_INPUT has race conditions and would be a real
      pain to fix.  Since it's an undocumented and deprecated
      configure-time option, now seems like a good time to remove it.
      Also see <http://bugs.gnu.org/11080#16>.
      * configure.ac (SYNC_INPUT, BROKEN_SA_RESTART): Remove.
      * admin/CPP-DEFINES (BROKEN_SA_RESTART, SA_RESTART): Remove.
      * etc/TODO (Make SYNC_INPUT the default): Remove, as the code now
      behaves as if SYNC_INPUT is always true.
      * src/alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
      (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
      (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
      (malloc_hysteresis):
      (check_depth) [XMALLOC_OVERRUN_CHECK]:
      (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
      (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
      (dont_register_blocks, bytes_used_when_reconsidered)
      (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
      (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
      [!SYSTEM_MALLOC && !SYNC_INPUT]:
      Remove. All uses removed.
      (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
      implementation, one that depends on whether the new macro
      XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
      is defined.
      * src/atimer.c (run_timers, handle_alarm_signal):
      * src/keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
      (handle_async_input, process_pending_signals)
      (handle_input_available_signal, init_keyboard):
      * src/nsterm.m (ns_read_socket):
      * src/process.c (wait_reading_process_output):
      * src/regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
      * src/sysdep.c (emacs_sigaction_init) [SA_RESTART]:
      (emacs_write):
      * src/xterm.c (XTread_socket):
      Assume SYNC_INPUT.
      * src/conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
      * src/eval.c (handling_signal): Remove.  All uses removed.
      * src/lisp.h (ELSE_PENDING_SIGNALS): Remove.
      All uses replaced with the SYNC_INPUT version.
      (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
      Remove decls.
      * src/sysdep.c, src/syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
      Now static.
      
      Fixes: debbugs:12450
      0caaedb1
  18. 15 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Port better to POSIX hosts lacking _setjmp. · 0328b6de
      Paul Eggert authored
      * configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols.
      (_setjmp, _longjmp): Remove.
      * src/lisp.h: Include <setjmp.h> here, since we use its symbols here.
      All instances of '#include <setjmp.h>' removed, if the
      only reason for the instance was because "lisp.h" was included.
      (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
      Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
      and _longjmp with the new symbols.  Emacs already uses _setjmp if
      available, so this change affects only POSIXish hosts that have
      sigsetjmp but not _setjmp, such as some versions of Solaris and
      Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
      * src/image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
      (png_load_body) [HAVE_PNG]:
      (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
      (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
      Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
      since PNG requires jmp_buf.  This is the only exception to the
      general rule that we now use sys_setjmp and sys_longjmp.
      This exception is OK since this code does not change the signal
      mask or longjmp out of a signal handler.
      
      Fixes: debbugs:12446
      0328b6de
  19. 14 Sep, 2012 1 commit
  20. 12 Sep, 2012 3 commits
    • Eli Zaretskii's avatar
      Fix a typo that caused crashes in redisplay. · f2016bea
      Eli Zaretskii authored
       src/xdisp.c (compute_stop_pos_backwards): Fix a typo that caused crashes while
       scrolling through multibyte text.
      f2016bea
    • Eli Zaretskii's avatar
      Fix bug #12403 with garbled display under non-zero scroll-margin. · aa36e4d2
      Eli Zaretskii authored
       src/xdisp.c (try_window_reusing_current_matrix): Under bidi
       reordering, locate the cursor by calling set_cursor_from_row; if
       that fails, clear the desired glyph matrix before returning a
       failure indication to the caller.  Fixes leaving garbled display
       when fast scrolling with a down-key when scroll-margin is non-zero.
      aa36e4d2
    • Stefan Monnier's avatar
      * src/eval.c: Add `inhibit-debugger'. · 45b82ad0
      Stefan Monnier authored
      (Qinhibit_debugger): New symbol.
      (call_debugger): Bind it instead of Qdebug_on_error.
      (maybe_call_debugger): Test Vinhibit_debugger.
      (syms_of_eval): Define inhibit-debugger.
      * src/xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
      (syms_of_xdisp): Remove inhibit-debug-on-message.
      * lisp/emacs-lisp/debug.el (debug): Don't bind debug-on-error since
      inhibit-debugger is bound instead.
      45b82ad0
  21. 11 Sep, 2012 3 commits
  22. 05 Sep, 2012 1 commit
  23. 04 Sep, 2012 2 commits
    • Lars Ingebrigtsen's avatar
      Implement `debug-on-message'. · 7f7e0167
      Lars Ingebrigtsen authored
      This allows tracking down what piece of code is outputting stuff in
      the echo area.
      
      * eval.c (call_debugger): Make the function non-static so that we
      can call it from set_message.
      
      * xdisp.c (set_message): Implement the new variable `debug-on-message'.
      (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
      7f7e0167
    • Paul Eggert's avatar
      Simplify redefinition of 'abort' (Bug#12316). · 1088b922
      Paul Eggert authored
      Do not try to redefine the 'abort' function.  Instead, redo
      the code so that it calls 'emacs_abort' rather than 'abort'.
      This removes the need for the NO_ABORT configure-time macro
      and makes it easier to change the abort code to do a backtrace.
      * configure.ac (NO_ABRT): Remove.
      * admin/CPP-DEFINES (NO_ABORT): Remove.
      * nt/inc/ms-w32.h (w32_abort) [HAVE_NTGUI]: Remove.
      * src/.gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
      * src/emacs.c (abort) [!DOS_NT && !NO_ABORT]:
      Remove; sysdep.c's emacs_abort now takes its place.
      * src/lisp.h (emacs_abort): New decl.  All calls from Emacs code to
      'abort' changed to use 'emacs_abort'.
      * src/msdos.c (dos_abort) [defined abort]: Remove; not used.
      (abort) [!defined abort]: Rename to ...
      (emacs_abort): ... new name.
      * src/sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
      the place of the old 'abort' in emacs.c.
      * src/w32.c, src/w32fns.c (abort): Do not #undef.
      * src/w32.c (emacs_abort): Rename from w32_abort.
      1088b922
  24. 03 Sep, 2012 2 commits
  25. 02 Sep, 2012 1 commit
    • Paul Eggert's avatar
      * emacs.c, eval.c: Use bool for boolean. · 1882aa38
      Paul Eggert authored
      * emacs.c (initialized, inhibit_window_system, running_asynch_code):
      (malloc_using_checking) [DOUG_LEA_MALLOC]:
      (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
      (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
      (main, decode_env_path, Fdaemon_initialized):
      * eval.c (call_debugger, Finteractive_p, interactive_p):
      (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
      (maybe_call_debugger, Fbacktrace):
      * process.c (read_process_output, exec_sentinel):
      Use bool for booleans.
      * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
      All callers changed.
      * eval.c (interactive_p): Omit always-true boolean argument
      EXCLUDE_SUBRS_P.  All callers changed.
      * dispextern.h, lisp.h: Reflect above API changes.
      * firstfile.c (dummy): Use the address of 'main', whose signature
      won't change, instead of the address of 'initialize', whose
      signature just changed from int to bool.
      * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
      * msdos.c (fatal_error_in_progress): ... from here.
      * xdisp.c (redisplaying_p): Now a boolean.  Set it to 1 instead
      of incrementing it.
      (redisplay_internal, unwind_redisplay): Simply clear
      REDISPLAYING_P when unwinding, instead of saving its previous,
      always-false value and then restoring it.
      1882aa38
  26. 28 Aug, 2012 2 commits
    • Dmitry Antipov's avatar
      Fix usage of set_buffer_internal. · a3d794a1
      Dmitry Antipov authored
      * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
      * buffer.c (set_buffer_if_live): Use set_buffer_internal.
      * coding.c (decode_coding): Omit redundant test.
      * fileio.c (decide_coding_unwind): Likewise.
      * fns.c (secure_hash): Likewise.
      * insdel.c (modify_region): Likewise.
      * keyboard.c (command_loop_1): Likewise.
      * print.c (PRINTFINISH): Likewise.
      * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
      a3d794a1
    • Paul Eggert's avatar
      * dispnew.c: Use bool for boolean. · 59ea14cd
      Paul Eggert authored
      (frame_garbaged, display_completed, delayed_size_change)
      (fonts_changed_p, add_window_display_history)
      (add_frame_display_history, verify_row_hash)
      (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
      (row_equal_p, realloc_glyph_pool)
      (allocate_matrices_for_frame_redisplay)
      (showing_window_margins_p)
      (adjust_frame_glyphs_for_frame_redisplay)
      (build_frame_matrix_from_leaf_window, make_current)
      (mirrored_line_dance, mirror_line_dance, update_frame)
      (update_window_tree, update_single_window)
      (check_current_matrix_flags, update_window, update_text_area)
      (update_window_line, set_window_update_flags, scrolling_window)
      (update_frame_1, scrolling, buffer_posn_from_coords)
      (do_pending_window_change, change_frame_size)
      (change_frame_size_1, sit_for):
      Use bool for boolean.
      (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
      and remove last int (actually boolean) argument, which was always 0.
      All callers changed.
      * dispextern.h, frame.h, lisp.h: Reflect above API changes.
      * dispextern.h (struct composition_it): Use bool for boolean.
      (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
      (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
      * dired.c (file_name_completion):
      Use bool for boolean.  (This was missed in an earlier change.)
      59ea14cd
  27. 26 Aug, 2012 1 commit
  28. 21 Aug, 2012 1 commit
    • Paul Eggert's avatar
      * alloc.c: Use bool for booleans. · fce31d69
      Paul Eggert authored
      (gc_in_progress, abort_on_gc)
      (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
      (dont_register_blocks) [GC_MALLOC_CHECK]:
      (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
      (check_string_bytes, make_specified_string, memory_full)
      (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_stack, valid_pointer_p, make_pure_string)
      (Fgarbage_collect, survives_gc_p, gc_sweep):
      Use bool for booleans, instead of int.
      (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
      Remove unused local.
      * alloc.c (PURE_POINTER_P):
      * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
      * editfns.c (Fformat):
      * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
      (Fdo_auto_save):
      * fns.c (sweep_weak_table):
      * lisp.h (suppress_checking, push_message, survives_gc_p)
      (make_pure_string, gc_in_progress, abort_on_gc):
      * lread.c (readchar, read1):
      * print.c (Fprin1_to_string):
      * xdisp.c (push_message):
      Use bool for booleans affected directly or indirectly by
      alloc.c's changes.
      fce31d69
  29. 19 Aug, 2012 2 commits