1. 30 Jul, 2012 2 commits
    • Dmitry Antipov's avatar
      Convert safe_call to use variable number of arguments. · 6cd7a139
      Dmitry Antipov authored
      * xdisp.c (safe_call): Convert to use varargs.  Adjust users.
      (safe_call2): Fix comment.
      * lisp.h (safe_call): Adjust prototype.
      * coding.c (encode_coding_object): Change to use safe_call2.
      * xfaces.c (merge_face_heights): Change to use safe_call1.
      6cd7a139
    • Paul Eggert's avatar
      Export to GDB most of lisp.h's remaining object-like macros. · 03a660a6
      Paul Eggert authored
      * lisp.h (min, max): Move earlier, because they're used earlier now.
      (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
      (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
      (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
      (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
      (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
      (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
      (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
      (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
      Now constants, for GDB.  They need not be macros.
      (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
      Now constants, for GDB, as well as macros, for static initializers.
      (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
      Move to after the definition of struct Lisp_Char_Table,
      since the former now needs that type defined.
      (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
      (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
      (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
      New enums, for gdb_make_enums_visible.
      (GLYPH_MODE_LINE_FACE): Remove; unused.
      * alloc.c (STRING_BYTES_MAX): Now a constant, now a macro.
      (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
      CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
      enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
      enum maxargs, enum MAX_ALLOCA.
      (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
      (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
      no longer needed, now that they are done in lisp.h.
      03a660a6
  2. 29 Jul, 2012 2 commits
  3. 28 Jul, 2012 1 commit
    • Paul Eggert's avatar
      Use Gnulib stdalign and environ modules (Bug#9772, Bug#9960). · e32a5799
      Paul Eggert authored
      * .bzrignore: Add lib/stdalign.h.
      * config.bat: Do not set NO_DECL_ALIGN; no longer needed.
      Copy lib/stdalign.in.h to lib/stdalign.in-h as needed.
      * configure.ac (HAVE_ATTRIBUTE_ALIGNED): Remove the code that
      fiddles with this, as gnulib now does this for us.
      * admin/merge-gnulib: Add environ, stdalign.
      * m4/environ.m4: New file, from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib/stdalign.in.h, m4/stdalign.m4: New files, from gnulib.
      * sed2v2.inp (HAVE_ATTRIBUTE_ALIGNED): Remove edit.
      * sedlibmk.inp (STDALIGN_H, @GL_GENERATE_STDALIGN_H_TRUE@)
      (GL_GENERATE_STDALIGN_H_FALSE): New edits.
      * nt/config.nt (HAVE_ATTRIBUTE_ALIGNED): Remove.
      * src/alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
      Simplify by using alignof.
      (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
      * src/lisp.h: Include <stdalign.h>.
      (GCALIGNMENT): New macro and constant.
      (DECL_ALIGN): Remove.  All uses replaced by alignas (GCALIGNMENT).
      (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
      (stdalign): New macro, if not already defined.
      e32a5799
  4. 27 Jul, 2012 5 commits
    • Eli Zaretskii's avatar
      Fix failure to compile on Windows due to 2012-07-27T06:04:35Z!dmantipov@yandex.ru. · 3438fe21
      Eli Zaretskii authored
       src/lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
       enumeration constants, as PURE and HEAP are too general, and clash
       with other headers and sources, such as gmalloc.c and the
       MS-Windows system headers.  All users changed.
      3438fe21
    • 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
    • Paul Eggert's avatar
      Improve GDB symbol export. · 4706125e
      Paul Eggert authored
      * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
      arms of an 'if', not using conditional expressions; otherwise GDB
      complains about the types in the unevaluated arm when the argument
      is an integer literal.
      (xgetint): Simplify expression.
      * alloc.c (gdb_make_enums_visible): New constant.  This ports to
      GCC 3.4.2 the export of symbols to GDB.  Problem reported by Eli
      Zaretskii in <http://bugs.gnu.org/1995-05-30T23:07:27Z!kwzh@gnu.org#13>.
      * lisp.h (PUBLISH_TO_GDB): Remove.  All uses removed.  No longer
      needed now that we have gdb_make_enums_visible.
      (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
      (enum enum_USE_LSB_TAG):
      New enum types, packaging up enums that need to be exported to GDB.
      4706125e
    • Dmitry Antipov's avatar
      Utility function to make a list from specified amount of objects. · 694b6c97
      Dmitry Antipov authored
      * lisp.h (enum constype): New datatype.
      (listn): New prototype.
      * alloc.c (listn): New function.
      (Fmemory_use_count, syms_of_alloc): Use it.
      * buffer.c (syms_of_buffer): Likewise.
      * callint.c (syms_of_callint): Likewise.
      * charset.c (define_charset_internal): Likewise.
      * coding.c (syms_of_coding): Likewise.
      * keymap.c (syms_of_keymap): Likewise.
      * search.c (syms_of_search): Likewise.
      * syntax.c (syms_of_syntax): Likewise.
      * w32.c (init_environment): Likewise.
      * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
      * xdisp.c (syms_of_xdisp): Likewise.
      * xfns.c (syms_of_xfns): Likewise.
      694b6c97
    • 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
  5. 26 Jul, 2012 4 commits
    • Paul Eggert's avatar
      Fix export of symbols to GDB. · 5eceb8fb
      Paul Eggert authored
      * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
      (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
      emacs.c, as this is a more-suitable home.  Had this been done earlier
      the fix for 1995-05-30T23:07:27Z!kwzh@gnu.org would have avoided some of the problems noted in
      <http://bugs.gnu.org/1995-05-30T23:07:27Z!kwzh@gnu.org#13> by Eli Zaretskii, as the scope problems
      would have been more obvious.
      * emacs.c (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
      (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
      (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
      Remove; now done in lisp.h.
      * lisp.h (PUBLISH_TO_GDB): New macro.
      (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
      (DATA_SEG_BITS): Use it.
      (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
      (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
      * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
      not be usable in #if.  This simplifies things.
      5eceb8fb
    • Paul Eggert's avatar
      Spelling fix in comment. · 6f3ddb4e
      Paul Eggert authored
      6f3ddb4e
    • Paul Eggert's avatar
      Simplify export of symbols to GDB; fix related .gdbinit bugs. · 1781b9e9
      Paul Eggert authored
      * etc/emacs-buffer.gdb ($tagmask, $valmask): Remove.
      (ygetptr): Adjust to recent changes in lisp.h and emacs.c,
      by using VALMASK instead of $valmask, CHECK_LISP_OBJECT_TYPE
      instead of gdb_use_union, and DATA_SEG_BITS instead of
      gdb_data_seg_bits.  Also, use $ptr.i rather than $ptr.u.val.
      * src/.gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
      $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
      (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
      Adjust to changes in lisp.h and emacs.c, by using
      CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
      of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
      INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
      gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
      instead of gdb_valbits.
      (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
      PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
      instead of gdb_array_mark_flag.
      (xboolvector): Get size from $->size, not $->header.size.
      Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
      (xreload, hook-run, hookpost-run): Remove.
      * src/emacs.c: Include <verify.h>.
      (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
      (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
      Remove.
      (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
      (gdb_USE_LSB_TAG): New enum constants.
      (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
      Also define these as enum constants, so they're visible to GDB.
      (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
      (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
      as constants, so they're visible to GDB.
      * src/lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
      (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
      Now enum constants, not macros, so they're visible to GDB.
      (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
      more convenient now.  All uses changed.
      (VALMASK) [USE_LSB_TAG]: Also define in this case.
      * src/mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
      1781b9e9
    • Stefan Monnier's avatar
      Autoload more carefully from Lisp. Follow aliases for function properties. · 7abaf5cc
      Stefan Monnier authored
      * lisp/subr.el (autoloadp): New function.
      (symbol-file): Use it.
      (function-get): New function.
      * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Use function-get and
      autoload-do-load.
      * lisp/emacs-lisp/lisp-mode.el (lisp-font-lock-syntactic-face-function)
      (lisp-indent-function):
      * lisp/emacs-lisp/gv.el (gv-get):
      * lisp/emacs-lisp/edebug.el (get-edebug-spec, edebug-basic-spec):
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-form):
      * lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-warn):
      * lisp/emacs-lisp/autoload.el (make-autoload, autoload-print-form):
      Use function-get.
      * lisp/emacs-lisp/cl.el: Don't propagate function properties any more.
      
      * src/eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
      add argument, tune behavior, and adjust all callers.
      
      * lisp/speedbar.el (speedbar-add-localized-speedbar-support):
      * lisp/emacs-lisp/disass.el (disassemble-internal):
      * lisp/desktop.el (desktop-load-file):
      * lisp/hel...
      7abaf5cc
  6. 25 Jul, 2012 1 commit
    • Paul Eggert's avatar
      Use typedef for EMACS_INT, EMACS_UINT. · 71f88e00
      Paul Eggert authored
      * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
      than macros.  This simplifies debugging in the usual case, since
      it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
      and it allows expressions involving EMACS_INT casts.
      * .gdbinit (xreload): Simplify by using EMACS_INT cast.
      71f88e00
  7. 24 Jul, 2012 1 commit
    • Dmitry Antipov's avatar
      Simplify copy_overlay. · fa691a83
      Dmitry Antipov authored
      * buffer.c (copy_overlay): Simplify, use build_marker.
      * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
      fa691a83
  8. 23 Jul, 2012 1 commit
    • Dmitry Antipov's avatar
      Cleanup miscellaneous objects allocation and initialization. · d7a7fda3
      Dmitry Antipov authored
      * alloc.c (allocate_misc): Change to static.  Add argument to
      specify the subtype.  Adjust comment and users.
      (build_overlay): New function.
      * buffer.c (copy_overlays, Fmake_overlay): Use it.
      * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
      (allocate_misc): Remove prototype.
      (build_overlay): Add prototype.
      d7a7fda3
  9. 20 Jul, 2012 3 commits
    • Dmitry Antipov's avatar
      Make maybe_gc inline. · dac616ff
      Dmitry Antipov authored
      Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
      * lisp.h (consing_since_gc, gc_relative_threshold)
      (memory_full_cons_threshold): Revert declaration.
      (maybe_gc): Remove prototype, define as inline.
      * alloc.c: Remove old commented-out code.
      (consing_since_gc, gc_relative_threshold)
      (memory_full_cons_threshold): Revert to global.
      (maybe_gc): Remove.
      dac616ff
    • Dmitry Antipov's avatar
      Simple wrapper for make_unibyte_string, adjust font_open_by_name. · d7ea76b4
      Dmitry Antipov authored
      * src/lisp.h (build_unibyte_string): New function.
      * src/dosfns.c, src/fileio.c, src/fns.c, src/ftfont.c, src/process.c:
      * src/sysdep.c, src/w32fns.c, src/xfns.c: Use it.
      * src/font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
      of type Lisp_Object to avoid redundant calls to make_unibyte_string.
      Adjust users accordingly.
      * src/font.h (font_open_by_name): Adjust prototype.
      * admin/coccinelle/unibyte_string.cocci: Semantic patch to convert from
      make_unibyte_string to build_unibyte_string where appropriate.
      d7ea76b4
    • Dmitry Antipov's avatar
      Cleanup calls to Fgarbage_collect. · 765e61e3
      Dmitry Antipov authored
      * lisp.h (maybe_gc): New prototype.
      (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
      Remove declarations.
      * alloc.c (maybe_gc): New function.
      (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
      Make them static.
      * bytecode.c (MAYBE_GC): Use maybe_gc.
      * eval.c (eval_sub, Ffuncall): Likewise.
      * keyboard.c (read_char): Likewise.  Adjust call to maybe_gc
      to avoid dependency from auto-save feature.
      765e61e3
  10. 19 Jul, 2012 1 commit
    • Dmitry Antipov's avatar
      New macro to iterate over all buffers, miscellaneous cleanups. · d17337e5
      Dmitry Antipov authored
      * lisp.h (all_buffers): Remove declaration.
      * buffer.h (all_buffers): Add declaration, with comment.
      (for_each_buffer): New macro.
      * alloc.c (Fgarbage_collect, mark_object): Use it.
      * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
      (init_buffer): Likewise.
      * data.c (Fset_default): Likewise.
      * coding.c (code_conversion_restore): Remove redundant check
      for dead buffer.
      * buffer.c (Fkill_buffer): Likewise.  Remove obsolete comment.
      d17337e5
  11. 18 Jul, 2012 2 commits
    • Stefan Monnier's avatar
      * src/lisp.h (last_undo_boundary): Declare new var. · 464d5a5e
      Stefan Monnier authored
      * src/keyboard.c (command_loop_1): Set it.
      * src/cmds.c (Fself_insert_command): Use it to only remove boundaries that
      were auto-added by the command loop.
      
      Fixes: debbugs:11774
      464d5a5e
    • Dmitry Antipov's avatar
      Return more descriptive data from Fgarbage_collect. · 3ab6e069
      Dmitry Antipov authored
      Suggested by Stefan Monnier in
      http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
      * src/alloc.c (bounded_number): New function.
      (total_buffers, total_vectors): New variable.
      (total_string_size): Rename to total_string_bytes, adjust users.
      (total_vector_size): Rename to total_vector_bytes, adjust users.
      (sweep_vectors): Account total_vectors and total_vector_bytes.
      (Fgarbage_collect): New return value.  Adjust documentation.
      (gc_sweep): Account total_buffers.
      (Fmemory_free, Fmemory_use_counts): Use bounded_number.
      (VECTOR_SIZE): Remove.
      * src/data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
      (Qinterval, Qmisc): New symbols.
      (syms_of_data): Initialize them.
      * src/lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
      (Qcons, Qbuffer): New declarations.
      * lisp/emacs-lisp/chart.el (chart-emacs-storage): Change to
      reflect new format of data returned by Fgarbage_collect.
      3ab6e069
  12. 16 Jul, 2012 1 commit
    • Dmitry Antipov's avatar
      Remove empty and useless init functions. · 6a0dd1d7
      Dmitry Antipov authored
      * lisp.h (init_character_once, init_fns, init_image)
      (init_filelock, init_sound): Remove prototype.
      * character.c (init_character_once): Remove.
      * filelock.c (init_filelock): Likewise.
      * fns.c (init_fns): Likewise.
      * image.c (init_image): Likewise.
      * sound.c (init_sound): Likewise.
      * emacs.c (main): Adjust accordingly.
      6a0dd1d7
  13. 15 Jul, 2012 2 commits
    • Dmitry Antipov's avatar
      Cleanup basic allocation variables and functions. · fff62aa9
      Dmitry Antipov authored
      * alloc.c (ignore_warnings, init_intervals, init_float)
      (init_cons, init_symbol, init_marker): Remove.
      (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
      (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
      (cons_block_index): Initialize to CONS_BLOCK_SIZE.
      (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
      (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
      (staticidx, init_alloc_once, init_strings, free_ablock):
      Remove redundant initialization.
      * fns.c (init_weak_hash_tables): Remove.
      * lisp.h (init_weak_hash_tables): Remove prototype.
      fff62aa9
    • Dmitry Antipov's avatar
      Use zero_vector where appropriate. · 9730daca
      Dmitry Antipov authored
      * alloc.c (zero_vector): Define as Lisp_Object.  Adjust users
      accordingly.
      * lisp.h (zero_vector): New declaration.
      * font.c (null_vector): Remove.
      (syms_of_font): Remove initialization and staticpro.
      (font_list_entities, font_find_for_lface): Change to use zero_vector.
      * keymap.c (Faccessible_keymaps): Likewise.
      9730daca
  14. 12 Jul, 2012 1 commit
    • Glenn Morris's avatar
      Rename init_process rather than working around it on Darwin · b82da769
      Glenn Morris authored
      The old name is also the name of a Mach system call.
      
      * src/process.c (init_process_emacs): Rename from init_process.
      
      * src/lisp.h, src/emacs.c: Update for this name change.
      
      * src/nsgui.h, src/sysselect.h, src/s/darwin.h:
      Remove workaround that is no longer needed.
      b82da769
  15. 11 Jul, 2012 2 commits
    • Dmitry Antipov's avatar
      Minor adjustments to interning code. · e8df9267
      Dmitry Antipov authored
      * lisp.h (intern, intern_c_string): Redefine as static inline
      wrappers for intern_1 and intern_c_string_1, respectively.
      (intern_1, intern_c_string_1): Rename prototypes.
      * lread.c (intern_1, intern_c_string_1): Simplify Vobarray checking.
      * font.c (font_intern_prop): Likewise.  Adjust comment.
      * w32font.c (intern_font_name): Likewise.
      e8df9267
    • Dmitry Antipov's avatar
      Avoid call to strlen in fast_c_string_match_ignore_case. · d923b542
      Dmitry Antipov authored
      * search.c (fast_c_string_match_ignore_case): Change to use
      length argument.  Adjust users accordingly.
      * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
      d923b542
  16. 10 Jul, 2012 1 commit
    • Dmitry Antipov's avatar
      Optimize pure C strings initialization. · 2a0213a6
      Dmitry Antipov authored
      * lisp.h (make_pure_string): Fix prototype.
      (build_pure_c_string): New function, defined as static inline.  This
      provides a better opportunity to optimize away calls to strlen when
      the function is called with compile-time constant argument.
      * alloc.c (make_pure_c_string): Fix comment.  Change to add nchars
      argument, adjust users accordingly.  Use build_pure_c_string where
      appropriate.
      * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
      * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
      * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
      2a0213a6
  17. 09 Jul, 2012 3 commits
    • Paul Eggert's avatar
    • Paul Eggert's avatar
      Minor improvements to make_formatted_string. · 26bccfae
      Paul Eggert authored
      * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
      where int is good enough, as vsprintf returns an int.
      * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
      26bccfae
    • Dmitry Antipov's avatar
      Use make_formatted_string to avoid double length calculation. · a8290ec3
      Dmitry Antipov authored
      * lisp.h (make_formatted_string): New prototype.
      * alloc.c (make_formatted_string): New function.
      * buffer.c (Fgenerate_new_buffer_name): Use it.
      * dbus.c (syms_of_dbusbind): Likewise.
      * editfns.c (Fcurrent_time_zone): Likewise.
      * filelock.c (get_boot_time): Likewise.
      * frame.c (make_terminal_frame, set_term_frame_name)
      (x_report_frame_params): Likewise.
      * image.c (gs_load): Likewise.
      * minibuf.c (get_minibuffer): Likewise.
      * msdos.c (dos_set_window_size): Likewise.
      * process.c (make_process): Likewise.
      * xdisp.c (ensure_echo_area_buffers): Likewise.
      * xsettings.c (apply_xft_settings): Likewise.
      a8290ec3
  18. 07 Jul, 2012 1 commit
  19. 06 Jul, 2012 1 commit
    • 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
  20. 05 Jul, 2012 1 commit
    • Dmitry Antipov's avatar
      Cleanup xmalloc. · 23f86fce
      Dmitry Antipov authored
      * admin/coccinelle/xzalloc.cocci: Semantic patch to convert
      calls to xmalloc with following memset to xzalloc.
      * src/lisp.h (xzalloc): New prototype.  Omit needless casts.
      * src/alloc.c (xzalloc): New function.  Omit needless casts.
      * src/charset.c: Omit needless casts.  Convert all calls to
      malloc with following memset to xzalloc.
      * src/dispnew.c: Likewise.
      * src/fringe.c: Likewise.
      * src/image.c: Likewise.
      * src/sound.c: Likewise.
      * src/term.c: Likewise.
      * src/w32fns.c: Likewise.
      * src/w32font.c: Likewise.
      * src/w32term.c: Likewise.
      * src/xfaces.c: Likewise.
      * src/xfns.c: Likewise.
      * src/xterm.c: Likewise.
      * src/atimer.c: Omit needless casts.
      * src/buffer.c: Likewise.
      * src/callproc.c: Likewise.
      * src/ccl.c: Likewise.
      * src/coding.c: Likewise.
      * src/composite.c: Likewise.
      * src/doc.c: Likewise.
      * src/doprnt.c: Likewise.
      * src/editfns.c: Likewise.
      * src/emacs.c: Likewise.
      * src/eval.c: Likewise.
      * src/filelock.c: Likewise.
      * src/fns.c: Likewise.
      * src/gtkutil.c: Likewise.
      * src/keyboard.c: Likewise.
      * src/lisp.h: Likewise.
      * src/lread.c: Likewise.
      * src/minibuf.c: Likewise.
      * src/msdos.c: Likewise.
      * src/print.c: Likewise.
      * src/process.c: Likewise.
      * src/region-cache.c: Likewise.
      * src/search.c: Likewise.
      * src/sysdep.c: Likewise.
      * src/termcap.c: Likewise.
      * src/terminal.c: Likewise.
      * src/tparam.c: Likewise.
      * src/w16select.c: Likewise.
      * src/w32.c: Likewise.
      * src/w32reg.c: Likewise.
      * src/w32select.c: Likewise.
      * src/w32uniscribe.c: Likewise.
      * src/widget.c: Likewise.
      * src/xdisp.c: Likewise.
      * src/xmenu.c: Likewise.
      * src/xrdb.c: Likewise.
      * src/xselect.c: Likewise.
      23f86fce
  21. 04 Jul, 2012 1 commit
    • Stefan Monnier's avatar
      Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE. · ee28be33
      Stefan Monnier authored
      * src/lisp.h (enum pvec_type): Use fewer bits.
      (PSEUDOVECTOR_SIZE_BITS): New constant.
      (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
      (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
      change in pvec_type.
      (PSEUDOVECTOR_TYPEP): New macro.
      (TYPED_PSEUDOVECTORP): Use it.
      * src/fns.c (internal_equal): Adapt code to extract pvectype.
      * src/emacs.c (gdb_pvec_type): Update type.
      * src/alloc.c (PSEUDOVECTOR_NBYTES): New macro.
      (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
      (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
      (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
      (sweep_vectors): Use it.  Use local var `total_bytes' instead of
      abusing vector->header.next.nbytes.
      (live_vector_p): Use PVEC_TYPE.
      (mark_object): Adapt code to extract pvectype.  Use switch.
      ee28be33
  22. 03 Jul, 2012 3 commits
    • Glenn Morris's avatar
      * src/lisp.h (Fread_file_name): Restore EXFUN · e2017fe2
      Glenn Morris authored
      (it's not a normal DEFUN and did not make it into globals.h).
      e2017fe2
    • Tom Tromey's avatar
      Auto-generate EXFUN using make-docfile · 404dbd37
      Tom Tromey authored
      src
      	* window.c (Fset_window_margins, Fset_window_fringes)
      	(Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
      	* textprop.c (Fprevious_property_change): No longer static.
      	* syntax.c (Fsyntax_table_p): No longer static.
      	* process.c (Fget_process, Fprocess_datagram_address): No longer
      	static.
      	* keymap.c (Flookup_key, Fcopy_keymap): No longer static.
      	* keyboard.c (Fcommand_execute): No longer static.
      	Remove EXFUN.
      	* insdel.c (Fcombine_after_change_execute): No longer static.
      	* image.c (Finit_image_library): No longer static.
      	* fileio.c (Fmake_symbolic_link): No longer static.
      	* eval.c (Ffetch_bytecode): No longer static.
      	* editfns.c (Fuser_full_name): No longer static.
      	* doc.c: (Fdocumentation_property, Fsnarf_documentation): No
      	longer static.
      	* buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
      	static.
      	* dired.c (Ffile_attributes): No longer static.
      	* composite.c (Fcomposition_get_gstring): No longer static.
      	* callproc.c (Fgetenv_internal): No longer static.
      
      	* ccl.h: Remove EXFUNs.
      	* buffer.h: Remove EXFUNs.
      	* dispextern.h: Remove EXFUNs.
      	* intervals.h: Remove EXFUNs.
      	* fontset.h: Remove EXFUN.
      	* font.h: Remove EXFUNs.
      	* dosfns.c (system_process_attributes): Remove EXFUN.
      	* keymap.h: Remove EXFUNs.
      	* lisp.h: Remove EXFUNs.
      	* w32term.h: Remove EXFUNs.
      	* window.h: Remove EXFUNs.
      	* xsettings.h: Remove EXFUN.
      	* xterm.h: Remove EXFUN.
      
      lib-src
      	* make-docfile.c (enum global_type) <FUNCTION>: New constant.
      	(struct global) <value>: New field.
      	(add_global): Add 'value' argument.
      	(compare_globals): Sort functions at the end.
      	(close_emacs_globals): New function.
      	(write_globals): Handle functions.
      	(scan_c_file): Call add_global for DEFUN.
      404dbd37
    • Glenn Morris's avatar
      Speed up generate-new-buffer-name for invisible buffers (bug#1229) · 8e4fd1e1
      Glenn Morris authored
      * src/buffer.c (Fgenerate_new_buffer_name):
      Speed up finding a new buffer for invisible buffers.
      
      * src/lisp.h (Frandom): Make it visible to C.
      8e4fd1e1