1. 01 Jan, 2019 1 commit
  2. 03 Jun, 2018 1 commit
    • Paul Eggert's avatar
      Centralize Bug#30931 fix · 51ee8bc4
      Paul Eggert authored
      * src/marker.c (detach_marker): New function.
      * src/editfns.c (save_restriction_restore):
      * src/insdel.c (signal_before_change): Use it.
      
      (cherry picked from commit 6f66a43d)
      51ee8bc4
  3. 01 Jan, 2018 1 commit
  4. 13 Sep, 2017 1 commit
    • Paul Eggert's avatar
      Prefer HTTPS to FTP and HTTP in documentation · bc511a64
      Paul Eggert authored
      Most of this change is to boilerplate commentary such as license URLs.
      This change was prompted by ftp://ftp.gnu.org's going-away party,
      planned for November.  Change these FTP URLs to https://ftp.gnu.org
      instead.  Make similar changes for URLs to other organizations moving
      away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
      fsf.org when this works, as this will further help defend against
      man-in-the-middle attacks (for this part I omitted the MS-DOS and
      MS-Windows sources and the test tarballs to keep the workload down).
      HTTPS is not fully working to lists.gnu.org so I left those URLs alone
      for now.
      bc511a64
  5. 01 Jan, 2017 1 commit
  6. 06 Sep, 2016 1 commit
    • Eli Zaretskii's avatar
      Avoid assertion violations when using marker positions · 644f77b5
      Eli Zaretskii authored
      * src/intervals.c (set_point_from_marker): If MARKER comes from
      another buffer, recalculate its byte position before using it to
      set point.
      * src/marker.c (set_marker_internal): If POSITION is a marker from
      another buffer, recalculate its byte position before using it.
      (Bug#24368)
      644f77b5
  7. 01 May, 2016 1 commit
  8. 30 Apr, 2016 1 commit
  9. 10 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Rework C source files to avoid ^( · 7352c6c6
      Paul Eggert authored
      Work around Bug#22884 by rewording comments and strings to avoid ‘(’
      at the start of a line unless it starts a function.  This change
      is a short-term hack; in the longer run we plan to fix cc-mode’s
      performance for C files that have ‘(’ at the start of a line in a
      comment or string.
      7352c6c6
  10. 01 Jan, 2016 1 commit
  11. 01 Jan, 2015 2 commits
  12. 02 Sep, 2014 1 commit
    • Dmitry Antipov's avatar
      * buffer.h (decode_buffer): New function. · 77ea21cd
      Dmitry Antipov authored
      * buffer.c (Fbuffer_name, Fbuffer_file_name, Fbuffer_base_buffer)
      (Fbuffer_local_variables, Fbuffer_modified_p, Fbuffer_modified_tick)
      (Fbuffer_chars_modified_tick, Fdelete_all_overlays):
      * data.c (Flocal_variables_p):
      * fileio.c (Fverify_visited_file_modtime):
      * marker.c (live_buffer): Use it.
      77ea21cd
  13. 01 Jan, 2014 1 commit
  14. 16 Aug, 2013 1 commit
    • Xue Fuqiao's avatar
      Remove documentation of undefined behavior. · 2bede2ed
      Xue Fuqiao authored
      * doc/lispref/positions.texi (Character Motion):
      * doc/lispref/markers.texi (Moving Markers):
      (Creating Markers): Comment out undefined behavior.
      
      * src/marker.c (set_marker): Remove documentation of undefined behavior.
      2bede2ed
  15. 14 Aug, 2013 2 commits
  16. 17 Jun, 2013 1 commit
    • Paul Eggert's avatar
      Use functions, not macros, for XINT etc. · 84575e67
      Paul Eggert authored
      In lisp.h, prefer functions to function-like macros, and
      constants to object-like macros, when either will do.  This:
       . simplifies use, as there's no more need to worry about
         arguments' side effects being evaluated multiple times.
       . makes the code easier to debug on some platforms.
      However, when using gcc -O0, keep using function-like macros
      for a few critical operations, for performance reasons.
      This sort of thing isn't needed with gcc -Og, but -Og
      is a GCC 4.8 feature and isn't widely-enough available yet.
      Also, move functions from lisp.h to individual modules when possible.
      From a suggestion by Andreas Schwab in <http://bugs.gnu.org/11935#68>.
      * alloc.c (XFLOAT_INIT, set_symbol_name):
      * buffer.c (CHECK_OVERLAY):
      * chartab.c (CHECK_CHAR_TABLE, set_char_table_ascii)
      (set_char_table_parent):
      * coding.c (CHECK_NATNUM_CAR, CHECK_NATNUM_CDR):
      * data.c (BOOLFWDP, INTFWDP, KBOARD_OBJFWDP, OBJFWDP, XBOOLFWD)
      (XKBOARD_OBJFWD, XINTFWD, XOBJFWD, CHECK_SUBR, set_blv_found)
      (blv_value, set_blv_value, set_blv_where, set_blv_defcell)
      (set_blv_valcell):
      * emacs.c (setlocale) [!HAVE_SETLOCALE]:
      * eval.c (specpdl_symbol, specpdl_old_value, specpdl_where)
      (specpdl_arg, specpdl_func, backtrace_function, backtrace_nargs)
      (backtrace_args, backtrace_debug_on_exit):
      * floatfns.c (CHECK_FLOAT):
      * fns.c (CHECK_HASH_TABLE, CHECK_LIST_END)
      (set_hash_key_and_value, set_hash_next, set_hash_next_slot)
      (set_hash_hash, set_hash_hash_slot, set_hash_index)
      (set_hash_index_slot):
      * keymap.c (CHECK_VECTOR_OR_CHAR_TABLE):
      * marker.c (CHECK_MARKER):
      * textprop.c (CHECK_STRING_OR_BUFFER):
      * window.c (CHECK_WINDOW_CONFIGURATION):
      Move here from lisp.h, and make these functions static rather than
      extern inline.
      * buffer.c (Qoverlayp):
      * data.c (Qsubrp):
      * fns.c (Qhash_table_p):
      * window.c (Qwindow_configuration_p):
      Now static.
      * lisp.h: Remove the abovementioned defns and decls.
      
      * configure.ac (WARN_CFLAGS): Remove -Wbad-function-cast,
      as it generates bogus warnings about reasonable casts of calls.
      * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]:
      Remove enum lsb_bits; no longer needed.
      (allocate_misc, free_misc): Don't use XMISCTYPE as an lvalue.
      * buffer.c (Qoverlap):
      * data.c (Qsubrp):
      * fns.c (Qhash_table_p):
      Now extern, so lisp.h can use these symbols.
      * dispextern.h: Include character.h, for MAX_CHAR etc.
      (GLYPH, GLYPH_CHAR, GLYPH_FACE, SET_GLYPH_CHAR, SET_GLYPH_FACE)
      (SET_GLYPH, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
      (SET_GLYPH_FROM_GLYPH_CODE, GLYPH_MODE_LINE_FACE, GLYPH_CHAR_VALID_P)
      (GLYPH_CODE_P): Move here from lisp.h.
      (GLYPH_CHAR, GLYPH_FACE, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
      (GLYPH_CHAR_VALID_P, GLYPH_CODE_P): Now functions, not macros.
      (GLYPH_MODE_LINE_FACE): Now enums, not macros.
      * eval.c (Fautoload): Cast XUNTAG output to intptr_t, since
      XUNTAG now returns void *.
      * lisp.h (lisp_h_XLI, lisp_h_XIL, lisp_h_CHECK_LIST_CONS)
      (lisp_h_CHECK_NUMBER CHECK_SYMBOL, lisp_h_CHECK_TYPE)
      (lisp_h_CONSP, lisp_h_EQ, lisp_h_FLOATP, lisp_h_INTEGERP)
      (lisp_h_MARKERP, lisp_h_MISCP, lisp_h_NILP)
      (lisp_h_SET_SYMBOL_VAL, lisp_h_SYMBOL_CONSTANT_P)
      (lisp_h_SYMBOL_VAL, lisp_h_SYMBOLP, lisp_h_VECTORLIKEP)
      (lisp_h_XCAR, lisp_h_XCDR, lisp_h_XCONS, lisp_h_XHASH)
      (lisp_h_XPNTR, lisp_h_XSYMBOL):
      New macros, renamed from their sans-lisp_h_ counterparts.
      (XLI, XIL, CHECK_LIST_CONS, CHECK_NUMBER CHECK_SYMBOL)
      (CHECK_TYPE, CONSP, EQ, FLOATP, INTEGERP, MARKERP)
      (MISCP, NILP, SET_SYMBOL_VAL, SYMBOL_CONSTANT_P, SYMBOL_VAL, SYMBOLP)
      (VECTORLIKEP, XCAR, XCDR, XCONS, XHASH, XPNTR, XSYMBOL):
      If compiling via GCC without optimization, define these as macros
      in addition to inline functions.
      To disable this, compile with -DINLINING=0.
      (LISP_MACRO_DEFUN, LISP_MACRO_DEFUN_VOID): New macros.
      (check_cons_list) [!GC_CHECK_CONS_LIST]: Likewise.
      (make_number, XFASTINT, XINT, XTYPE, XUNTAG): Likewise, but
      hand-optimize only in the USE_LSB_TAG case, as GNUish hosts do that.
      (INTMASK, VALMASK): Now macros, since static values cannot be
      accessed from extern inline functions.
      (VALMASK): Also a constant, for benefit of old GDB.
      (LISP_INT_TAG_P): Remove; no longer needed as the only caller
      is INTEGERP, which can fold it in.
      (XLI, XIL, XHASH, XTYPE,XINT, XFASTINT, XUINT)
      (make_number, XPNTR, XUNTAG, EQ, XCONS, XVECTOR, XSTRING, XSYMBOL)
      (XFLOAT, XPROCESS, XWINDOW, XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE)
      (XSUB_CHAR_TABLE, XBOOL_VECTOR, make_lisp_ptr, CHECK_TYPE)
      (CHECK_STRING_OR_BUFFER, XCAR, XCDR, XSETCAR, XSETCDR, CAR, CDR)
      (CAR_SAFE, CDR_SAFE, STRING_MULTIBYTE, SDATA, SSDATA, SREF, SSET)
      (SCHARS, STRING_BYTES, SBYTES, STRING_SET_CHARS, STRING_COPYIN, AREF)
      (ASIZE, ASET, CHAR_TABLE_REF_ASCII, CHAR_TABLE_REF)
      (CHAR_TABLE_SET, CHAR_TABLE_EXTRA_SLOTS, SYMBOL_VAL, SYMBOL_ALIAS)
      (SYMBOL_BLV, SYMBOL_FWD, SET_SYMBOL_VAL, SET_SYMBOL_ALIAS)
      (SET_SYMBOL_BLV, SET_SYMBOL_FWD, SYMBOL_NAME, SYMBOL_INTERNED_P)
      (SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P, SYMBOL_CONSTANT_P)
      (XHASH_TABLE, HASH_TABLE_P, CHECK_HASH_TABLE, HASH_KEY, HASH_VALUE)
      (HASH_NEXT, HASH_HASH, HASH_INDEX, HASH_TABLE_SIZE)
      (XMISC, XMISCANY, XMARKER, XOVERLAY, XSAVE_VALUE, XFWDTYPE)
      (XINTFWD, XBOOLFWD, XOBJFWD, XBUFFER_OBJFWD, XKBOARD_OBJFWD)
      (XFLOAT_DATA, XFLOAT_INIT, NILP, NUMBERP, NATNUMP)
      (RANGED_INTEGERP, CONSP, FLOATP, MISCP, STRINGP, SYMBOLP)
      (INTEGERP, VECTORLIKEP, VECTORP, OVERLAYP)
      (MARKERP, SAVE_VALUEP, AUTOLOADP, INTFWDP, BOOLFWDP, OBJFWDP)
      (BUFFER_OBJFWDP, KBOARD_OBJFWDP, PSEUDOVECTOR_TYPEP)
      (PSEUDOVECTORP, WINDOW_CONFIGURATIONP, PROCESSP, WINDOWP)
      (TERMINALP, SUBRP, COMPILEDP, BUFFERP, CHAR_TABLE_P)
      (SUB_CHAR_TABLE_P, BOOL_VECTOR_P, FRAMEP, IMAGEP, ARRAYP)
      (CHECK_LIST, CHECK_LIST_CONS, CHECK_LIST_END, CHECK_STRING)
      (CHECK_STRING_CAR, CHECK_CONS, CHECK_SYMBOL, CHECK_CHAR_TABLE)
      (CHECK_VECTOR, CHECK_VECTOR_OR_STRING, CHECK_ARRAY)
      (CHECK_VECTOR_OR_CHAR_TABLE, CHECK_BUFFER, CHECK_WINDOW)
      (CHECK_WINDOW_CONFIGURATION, CHECK_PROCESS, CHECK_SUBR)
      (CHECK_NUMBER, CHECK_NATNUM, CHECK_MARKER, XFLOATINT)
      (CHECK_FLOAT, CHECK_NUMBER_OR_FLOAT, CHECK_OVERLAY)
      (CHECK_NUMBER_CAR, CHECK_NUMBER_CDR, CHECK_NATNUM_CAR)
      (CHECK_NATNUM_CDR, FUNCTIONP, SPECPDL_INDEX, LOADHIST_ATTACH)
      Now functions.
      (check_cons_list) [!GC_CHECK_CONS_LIST]: New empty function.
      (LISP_MAKE_RVALUE, TYPEMASK): Remove; no longer needed.
      (VALMASK): Define in one place rather than in two, merging the
      USE_LSB_TAG parts; this is simpler.
      (aref_addr, gc_aset, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM)
      (max, min, struct Lisp_String, UNSIGNED_CMP, ASCII_CHAR_P):
      Move up, to avoid use before definition.
      Also include "globals.h" earlier, for the same reason.
      (make_natnum): New function.
      (XUNTAG): Now returns void *, not intptr_t, as this means fewer casts.
      (union Lisp_Fwd, BOOLFWDP, BOOL_VECTOR_P, BUFFER_OBJFWDP, BUFFERP)
      (CHAR_TABLE_P, CHAR_TABLE_REF_ASCII, CONSP, FLOATP, INTEGERP, INTFWDP)
      (KBOARD_OBJFWDP, MARKERP, MISCP, NILP, OBJFWDP, OVERLAYP, PROCESSP)
      (PSEUDOVECTORP, SAVE_VALUEP, STRINGP, SUB_CHAR_TABLE_P, SUBRP, SYMBOLP)
      (VECTORLIKEP, WINDOWP, Qoverlayp, char_table_ref, char_table_set)
      (char_table_translate, Qarrayp, Qbufferp, Qbuffer_or_string_p)
      (Qchar_table_p, Qconsp, Qfloatp, Qintegerp, Qlambda, Qlistp, Qmarkerp)
      (Qnil, Qnumberp, Qsubrp, Qstringp, Qsymbolp, Qvectorp)
      (Qvector_or_char_table_p, Qwholenump, Ffboundp, wrong_type_argument)
      (initialized, Qhash_table_p, extract_float, Qprocessp, Qwindowp)
      (Qwindow_configuration_p, Qimage): New forward declarations.
      (XSETFASTINT): Simplify by rewriting in terms of make_natnum.
      (STRING_COPYIN): Remove; unused.
      (XCAR_AS_LVALUE, XCDR_AS_LVALUE): Remove these macros, replacing with ...
      (xcar_addr, xcdr_addr): New functions.  All uses changed.
      (IEEE_FLOATING_POINT): Now a constant, not a macro.
      (GLYPH, GLYPH_CHAR, GLYPH_FACE, SET_GLYPH_CHAR, SET_GLYPH_FACE)
      (SET_GLYPH, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
      (SET_GLYPH_FROM_GLYPH_CODE, GLYPH_MODE_LINE_FACE, GLYPH_CHAR_VALID_P)
      (GLYPH_CODE_P): Move to dispextern.h, to avoid define-before-use.
      (TYPE_RANGED_INTEGERP): Simplify.
      (Qsubrp, Qhash_table_p, Qoverlayp): New extern decls.
      (setlocale, fixup_locale, synchronize_system_messages_locale)
      (synchronize_system_time_locale) [!HAVE_SETLOCALE]:
      Now empty functions, not macros.
      (functionp): Return bool, not int.
      * window.c (Qwindow_configuration_p): Now extern,
      so window.h can use it.
      * window.h (Qwindowp): Move decl back to lisp.h.
      84575e67
  17. 19 Feb, 2013 1 commit
  18. 11 Feb, 2013 1 commit
    • Dmitry Antipov's avatar
      * marker.c (set_marker_internal): If desired position is passed · f74de345
      Dmitry Antipov authored
      as a marker, avoid call to buf_charpos_to_bytepos.
      * window.c (Fset_window_point): Omit redundant type checking.
      (Fset_window_start): Likewise.  Format comment.
      (window_scroll_pixel_based): Use set_marker_restricted_both
      with character and byte positions obtained from an iterator.
      (Fset_window_configuration): Use set_marker_restricted_both.
      * xdisp.c (message_dolog): Likewise.
      f74de345
  19. 01 Jan, 2013 1 commit
  20. 20 Dec, 2012 1 commit
    • Dmitry Antipov's avatar
      Avoid calls to CHAR_TO_BYTE if byte position is known. · 13002885
      Dmitry Antipov authored
      * editfns.c (make_buffer_string_both): Use move_gap_both.
      (Fbuffer_string): Use make_buffer_string_both.
      * marker.c (buf_charpos_to_bytepos): Convert to eassert.
      Adjust comment.
      (buf_bytepos_to_charpos): Likewise.
      (charpos_to_bytepos): Remove.
      * fileio.c (Finsert_file_contents): Use move_gap_both.
      * search.c (Freplace_match): Likewise.
      * process.c (process_send_region): Likewise. Use convenient
      names for byte positions.
      * lisp.h (charpos_to_bytepos): Remove prototype.
      * indent.c (scan_for_column): Use CHAR_TO_BYTE.
      * insdel.c (move_gap): Likewise.
      13002885
  21. 11 Oct, 2012 2 commits
    • Paul Eggert's avatar
      lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans. · 7cded46f
      Paul Eggert authored
      * lread.c (load_each_byte, new_backquote_flag, readchar)
      (read_filtered_event, lisp_file_lexically_bound_p)
      (safe_to_load_version, Fload, complete_filename_p, openp)
      (build_load_history, readevalloop, read_escape, read1)
      (string_to_number, read_vector, read_list):
      * macros.c (Fstart_kbd_macro):
      * marker.c (CONSIDER):
      * menu.c (parse_single_submenu, digest_single_submenu)
      (find_and_return_menu_selection, Fx_popup_menu):
      * minibuf.c (read_minibuf_noninteractive, read_minibuf)
      (Ftry_completion):
      * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
      (ns_menu_show):
      * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
      (xmenu_show, xdialog_show):
      Use bool for booleans.
      * lread.c (safe_to_load_version): Rename from safe_to_load_p,
      as it's not a predicate.  All uses changed.  Omit unnecessary
      buffer termination.
      7cded46f
    • Paul Eggert's avatar
      fd2f90cf
  22. 01 Oct, 2012 1 commit
    • 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
  23. 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
  24. 11 Sep, 2012 1 commit
  25. 04 Sep, 2012 1 commit
    • 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
  26. 29 Jul, 2012 1 commit
    • Dmitry Antipov's avatar
      Generalize marker debugging code under MARKER_DEBUG and use eassert. · e2688e4a
      Dmitry Antipov authored
      * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
      (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
      (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
      (replace_range, replace_range_2, del_range_2): Change to eassert.
      * marker.c (byte_char_debug_check): Adjust style.
      e2688e4a
  27. 27 Jul, 2012 2 commits
    • Dmitry Antipov's avatar
      Revert last save_excursion_save and save_excursion_restore changes. · eeaea515
      Dmitry Antipov authored
      * alloc.c, editfns.c, marker.c, lisp.h: Revert.
      Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
      eeaea515
    • Dmitry Antipov's avatar
      Fast save_excursion_save and save_excursion_restore. · 6195f384
      Dmitry Antipov authored
      * lisp.h (struct Lisp_Excursion): New data type.
      (PVEC_EXCURSION): New pseudovector type.
      (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
      to deal with it.  Adjust comments.
      (init_marker, attach_marker): New prototype.
      (unchain_marker): Adjust prototype.
      * marker.c (attach_marker): Change to global.
      (init_marker): New function.
      * alloc.c (Fmake_marker, build_marker): Use it.
      (build_marker): More easserts.
      (mark_object): Handle struct Lisp_Excursion.
      * editfns.c (save_excursion_save, save_excursion_restore):
      Reimplement to use struct Lisp_Excursion.  Add comments.
      6195f384
  28. 22 Jul, 2012 1 commit
    • Dmitry Antipov's avatar
      Simplify and cleanup markers positioning code. · d36d71df
      Dmitry Antipov authored
      * marker.c (attach_marker): More useful eassert.
      (live_buffer, set_marker_internal): New function.
      (Fset_marker, set_marker_restricted): Use set_marker_internal.
      (set_marker_both, set_marker_restricted_both): Use live_buffer.
      d36d71df
  29. 09 Jul, 2012 1 commit
    • Dmitry Antipov's avatar
      Move marker debugging code under MARKER_DEBUG. · f1f924b6
      Dmitry Antipov authored
      * marker.c (MARKER_DEBUG): Move marker debugging code under
      #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
      for bootstrap with --enable-checking (~3x slowdown reported
      by Juanma Barranquero <lekktu@gmail.com>).
      (verify_bytepos): Move under #ifdef MARKER_DEBUG.
      f1f924b6
  30. 06 Jul, 2012 5 commits
    • Dmitry Antipov's avatar
      Fix marker debugging code. · 9d44f8ce
      Dmitry Antipov authored
      * marker.c (byte_char_debug_check): Do not perform the check
      if buffer is not multibyte.
      (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Call
      byte_char_debug_check with correct arguments.
      9d44f8ce
    • Dmitry Antipov's avatar
      Compile marker debugging code only if ENABLE_CHECKING is defined. · 90fc4786
      Dmitry Antipov authored
      * marker.c (byte_char_debug_check, count_markers): Use
      only if ENABLE_CHECKING is defined.
      (byte_debug_flag): Remove.
      (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
      Always call byte_char_debug_check if ENABLE_CHECKING is defined.
      90fc4786
    • Dmitry Antipov's avatar
      Avoid code repetition in marker-related functions. · 4e57b342
      Dmitry Antipov authored
      * marker.c (attach_marker): New function.
      (Fset_marker, set_marker_restricted, set_marker_both)
      (set_marker_restricted_both): Use it.
      (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
      Consistently rename charno to charpos.
      (marker_position): Add eassert.
      (marker_byte_position): Convert to eassert.
      4e57b342
    • Dmitry Antipov's avatar
      * buffer.c (unchain_overlay): Simplify. Add comment. · 7b7ae965
      Dmitry Antipov authored
      * marker.c (unchain_marker): Simplify.  Fix comments.
      7b7ae965
    • Dmitry Antipov's avatar
      Introduce fast path for the widely used marker operation. · 657924ff
      Dmitry Antipov authored
      * alloc.c (build_marker): New function.
      * lisp.h (build_marker): New prototype.
      * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
      * composite.c (autocmp_chars): Likewise.
      * editfns.c (buildmark): Remove.
      (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
      (save_restriction_save): Use build_marker.
      * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
      * window.c (save_window_save): Likewise.
      657924ff
  31. 05 Jul, 2012 1 commit
  32. 16 Jun, 2012 1 commit
    • Andreas Schwab's avatar
      * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline. · e5560ff7
      Andreas Schwab authored
      (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
      * character.c (_fetch_multibyte_char_p): Remove.
      * alloc.c: Include "character.h" before "buffer.h".
      * bidi.c: Likewise.
      * buffer.c: Likewise.
      * bytecode.c: Likewise.
      * callint.c: Likewise.
      * callproc.c: Likewise.
      * casefiddle.c: Likewise.
      * casetab.c: Likewise.
      * category.c: Likewise.
      * cmds.c: Likewise.
      * coding.c: Likewise.
      * composite.c: Likewise.
      * dired.c: Likewise.
      * dispnew.c: Likewise.
      * doc.c: Likewise.
      * dosfns.c: Likewise.
      * editfns.c: Likewise.
      * emacs.c: Likewise.
      * fileio.c: Likewise.
      * filelock.c: Likewise.
      * font.c: Likewise.
      * fontset.c: Likewise.
      * fringe.c: Likewise.
      * indent.c: Likewise.
      * insdel.c: Likewise.
      * intervals.c: Likewise.
      * keyboard.c: Likewise.
      * keymap.c: Likewise.
      * lread.c: Likewise.
      * macros.c: Likewise.
      * marker.c: Likewise.
      * minibuf.c: Likewise.
      * nsfns.m: Likewise.
      * nsmenu.m: Likewise.
      * print.c: Likewise.
      * process.c: Likewise.
      * regex.c: Likewise.
      * region-cache.c: Likewise.
      * search.c: Likewise.
      * syntax.c: Likewise.
      * term.c: Likewise.
      * textprop.c: Likewise.
      * undo.c: Likewise.
      * unexsol.c: Likewise.
      * w16select.c: Likewise.
      * w32fns.c: Likewise.
      * w32menu.c: Likewise.
      * window.c: Likewise.
      * xdisp.c: Likewise.
      * xfns.c: Likewise.
      * xmenu.c: Likewise.
      * xml.c: Likewise.
      * xselect.c: Likewise.
      e5560ff7