1. 14 Nov, 2013 3 commits
    • Kazuhiro Ito's avatar
      Fix bug #15892 with link failures of the Cygwin w32 build. · c9f63070
      Kazuhiro Ito authored
       src/keyboard.c (make_ctrl_char) [HAVE_NTGUI]: Now externally visible
       for Cygwin w32 build.
       src/xdisp.c (erase_phys_cursor) [HAVE_NTGUI]: Now externally visible
       for Cygwin w32 build.
      c9f63070
    • Paul Eggert's avatar
      Simplify, port and tune bool vector implementation. · 2cf00efc
      Paul Eggert authored
      * configure.ac (BITSIZEOF_SIZE_T, SIZEOF_SIZE_T): Remove.
      * src/alloc.c (bool_vector_exact_payload_bytes)
      (bool_vector_payload_bytes): Remove.
      (bool_vector_fill): Return its argument.
      * src/alloc.c (bool_vector_fill):
      * src/lread.c (read1):
      * src/print.c (print_object):
      Simplify by using bool_vector_bytes.
      * src/alloc.c (make_uninit_bool_vector):
      New function, broken out from Fmake_bool_vector.
      (Fmake_bool_vector): Use it.  Use tail call.
      (make_uninit_bool_vector, vector_nbytes): Simplify size calculations.
      * src/data.c (BITS_PER_ULL): New constant.
      (ULLONG_MAX, count_one_bits_ll): Fall back on long counterparts
      if long long versions don't exist.
      (shift_right_ull): New function.
      (count_one_bits_word): New function, replacing popcount_bits_word
      macro.  Don't assume that bits_word is no wider than long long.
      (count_one_bits_word, count_trailing_zero_bits):
      Don't assume that bits_word is no wider than long long.
      * src/data.c (bool_vector_binop_driver, bool_vector_not):
      * src/fns.c (Fcopy_sequence):
      * src/lread.c (read1):
      Create an uninitialized destination, to avoid needless work.
      (internal_equal): Simplify.
      (Ffillarray): Prefer tail call.
      * src/data.c (bool_vector_binop_driver): Don't assume bit vectors always
      contain at least one word.
      (bits_word_to_host_endian): Prefer if to #if.  Don't assume
      chars are narrower than ints.
      * src/data.c (Fbool_vector_count_matches, Fbool_vector_count_matches_at):
      * src/fns.c (Fcopy_sequence):
      Simplify and tune.
      * src/lisp.h (bits_word, BITS_WORD_MAX, BITS_PER_BITS_WORD):
      Don't try to port to hosts where bits_word values have holes; the
      code wouldn't work there anyway.  Verify this assumption, though.
      (bool_vector_bytes): New function.
      (make_uninit_bool_vector): New decl.
      (bool_vector_fill): Now returns Lisp_Object.
      2cf00efc
    • Paul Eggert's avatar
      Prefer tail calls. · d672ac3c
      Paul Eggert authored
      * lib-src/ebrowse.c (xstrdup):
      * lib-src/etags.c (savenstr):
      * lwlib/lwlib.c (safe_strdup):
      * src/xfns.c (xic_create_fontsetname):
      * src/xrdb.c (gethomedir): Prefer tail calls.
      * lib-src/etags.c (concat): Omit unnecessary assignment.
      d672ac3c
  2. 12 Nov, 2013 3 commits
  3. 11 Nov, 2013 3 commits
  4. 09 Nov, 2013 3 commits
  5. 08 Nov, 2013 4 commits
    • Jan Djärv's avatar
      * lisp/faces.el (describe-face): Add distant-foreground. · 5b97b4c0
      Jan Djärv authored
      * src/xfaces.c (lface_fully_specified_p): Let distant-foreground be
      unspecified.
      (realize_default_face): Remove assignment to distant-foreground if
      unspecified.
      
      Fixes: debbugs:15815
      5b97b4c0
    • Paul Eggert's avatar
      Merge from gnulib. · 220a304a
      Paul Eggert authored
      This incorporates:
      2013-11-08 extern-inline: port better to OS X 10.9
      2013-11-08 fpending: fix regression on DragonFly BSD
      * lib/fpending.h, m4/extern-inline.m4, m4/fpending.m4:
      Update from gnulib.
      220a304a
    • Eli Zaretskii's avatar
      Switch cache-long-scans to t by default. · 080db47f
      Eli Zaretskii authored
       src/xdisp.c (message_dolog): Make sure the *Messages* buffer has its
       cache-long-scans disabled, since we don't want to call
       prepare_to_modify_buffer (in insert_1_both) for each message we
       display.
       src/buffer.h (bset_cache_long_scans): New INLINE function, moved
       from buffer.c.  Improve commentary to the buffer field setter
       functions.
       src/buffer.c (bset_cache_long_scans): Static function deleted.
       Improve commentary to the buffer field setter functions.
       (init_buffer_once): Default for cache-long-scans changed to t.
       (Bug#15797)
      080db47f
    • Paul Eggert's avatar
      * chartab.c (make_sub_char_table): Fix size typo. · 7f1913b2
      Paul Eggert authored
      This bug was introduced in my 2013-06-21 change, and caused
      struct Lisp_Sub_Char_Table objects to be given too many slots,
      which broke 'make -C admin/unidata'.
      
      Fixes: debbugs:15825
      7f1913b2
  6. 07 Nov, 2013 2 commits
    • Jan Djärv's avatar
      Import macfont changes from mac-port 4.5. · 5ee29210
      Jan Djärv authored
      * macfont.h (kCTVersionNumber10_9): Define if not defined.
      
      * macfont.m (mac_font_copy_default_descriptors_for_language)
      (mac_font_copy_default_name_for_charset_and_languages): Declare.
      (cf_charset_table): big-5-0 has uniquifier 0x4EDC.
      (macfont_language_default_font_names): New.
      (macfont_list): Rearrange language/charset code.
      (macfont_close): Don't check for macfont_info->cache.
      (mac_ctfont_create_preferred_family_for_attributes): New font
      selection code, call
      mac_font_copy_default_name_for_charset_and_languages.
      (mac_font_copy_default_descriptors_for_language)
      (mac_font_copy_default_name_for_charset_and_languages): New functions.
      5ee29210
    • Paul Eggert's avatar
      Port to C11 aligned_alloc, and fix some integer overflows. · aea07e2c
      Paul Eggert authored
      * configure.ac (GMALLOC_OBJ): Initialize to empty if !system_malloc
      and doug_lea_malloc.
      (aligned_alloc): Test for existence if !GMALLOC_OBJ and not darwin.
      (posix_memalign): Test for existence only if !GMALLOC_OBJ and
      not darwin and !aligned_alloc.
      * src/alloc.c (USE_ALIGNED_ALLOC): New symbol.
      (USE_POSIX_MEMALIGN): Remove.  All uses replaced with USE_ALIGNED_ALLOC,
      and use of posix_memalign replaced with aligned_alloc.
      (aligned_alloc): New function, defined or declared as needed.
      * src/conf_post.h (HAVE_POSIX_MEMALIGN) [DARWIN_OS]:
      Don't undef; configure.ac now does this.
      * src/gmalloc.c (aligned_alloc) [MSDOS]: New decl.
      (calloc, aligned_alloc): Check for integer overflow.
      (aligned_alloc): Rename from memalign.  All uses changed.
      (memalign): New function, an alias for aligned_alloc.
      aea07e2c
  7. 06 Nov, 2013 6 commits
  8. 05 Nov, 2013 12 commits
    • Stefan Monnier's avatar
      * src/xdisp.c (prepare_menu_bars): Mark static. · 9e6e9826
      Stefan Monnier authored
      * src/lisp.h (prepare_menu_bars): Don't declare.
      * src/xselect.c (x_handle_selection_clear):
      * src/callproc.c (call_process): Remove redundant call to prepare_menu_bars.
      9e6e9826
    • Paul Eggert's avatar
      * keyboard.c (Fcommand_error_default_function): Fix pointer signedness · 7544a9d3
      Paul Eggert authored
      glitch.  Eliminate 'sz' prefix; Hungarian notation is not helpful here.
      7544a9d3
    • Stefan Monnier's avatar
      * src/keyboard.c (Fcommand_error_default_function): Rename from · 2e670b95
      Stefan Monnier authored
      Fdefault_error_output.
      2e670b95
    • Jarek Czekalski's avatar
      * src/keyboard.c (Fdefault_error_output): New function, extracted from · 2ea0d614
      Jarek Czekalski authored
      cmd_error_internal.
      (syms_of_keyboard): Use it for Vcommand_error_function.
      2ea0d614
    • Stefan Monnier's avatar
      * src/eval.c (handlerlist_sentinel): New variable. · 70de5e86
      Stefan Monnier authored
      (init_eval): Use it to ensure handlerlist is non-NULL.
      (unwind_to_catch): Make sure we never set handlerlist to NULL.
      (Fsignal): Adjust NULLness test of handlerlist.
      * src/lisp.h (PUSH_HANDLER): Assume handlerlist is non-NULL.
      
      Fixes: debbugs:15802
      70de5e86
    • Eli Zaretskii's avatar
      Fix bug #15148 with garbled display in Dired when cache-long-scans is ON. · d57f4dde
      Eli Zaretskii authored
       src/callproc.c (call_process): Call prepare_to_modify_buffer before
       decoding text read from the sub-process, as the decoded stuff will
       be inserted into the buffer.  This will invalidate the various
       caches maintained for the buffer.
      d57f4dde
    • Xue Fuqiao's avatar
      Doc fix. · 29aa2b71
      Xue Fuqiao authored
      * doc/lispref/display.texi (Glyphs): Add an index for glyph code.
      
      * src/xdisp.c (syms_of_xdisp): Mention the active display table in doc
      string of glyphless-char-display.
      29aa2b71
    • Jan Djärv's avatar
      * nsfns.m (ns_get_name_from_ioreg): New function. · ceb486d4
      Jan Djärv authored
      (ns_screen_name): Don't use deprecated CGDisplayIOServicePort on
      OSX >= 10.9.  Use ns_get_name_from_ioreg.
      ceb486d4
    • Paul Eggert's avatar
      Spelling fixes. · a67c4ae0
      Paul Eggert authored
      a67c4ae0
    • Paul Eggert's avatar
      Simplify and port recent bool vector changes. · df5b4930
      Paul Eggert authored
      * configure.ac (BITSIZEOF_SIZE_T, SIZEOF_SIZE_T):
      New symbols to configure.
      * src/alloc.c (ROUNDUP): Move here from lisp.h, since it's now used
      only in this file.  Use a more-efficient implementation if the
      second argument is a power of 2.
      (ALIGN): Rewrite in terms of ROUNDUP.  Make it a function.
      Remove no-longer-necessary compile-time checks.
      (bool_vector_exact_payload_bytes): New function.
      (bool_vector_payload_bytes): Remove 2nd arg; callers that need
      exact payload changed to call the new function.  Do not assume
      that the arg or result fits in ptrdiff_t.
      (bool_vector_fill): New function.
      (Fmake_bool_vector): Use it.  Don't assume bit counts fit
      in ptrdiff_t.
      (vroundup_ct): Don't assume arg fits in size_t.
      * src/category.c (SET_CATEGORY_SET): Remove.  All callers now just
      invoke set_category_set.
      (set_category_set): 2nd arg is now EMACS_INT and 3rd is now bool.
      All callers changed.  Use bool_vector_set.
      * src/category.h (XCATEGORY_SET): Remove; no longer needed.
      (CATEGORY_MEMBER): Now a function.  Rewrite in terms of
      bool_vector_bitref.
      * src/data.c (Faref): Use bool_vector_ref.
      (Faset): Use bool_vector_set.
      (bits_word_to_host_endian): Don't assume you can shift by CHAR_BIT.
      (Fbool_vector_not, Fbool_vector_count_matches)
      (Fbool_vector_count_matches_at): Don't assume CHAR_BIT == 8.
      * src/fns.c (concat): Use bool_vector_ref.
      (Ffillarray): Use bool_vector_fill.
      (mapcar1): Use bool_vector_ref.
      (sxhash_bool_vector): Hash words, not bytes.
      * src/lisp.h (BOOL_VECTOR_BITS_PER_CHAR): Now a macro as well as
      a constant, since it's now used in #if.
      (bits_word, BITS_WORD_MAX, BITS_PER_BITS_WORD): Fall back on
      unsigned char on unusual architectures, so that we no longer
      assume that the number of bits per bits_word is a power of two or
      is a multiple of 8 or of CHAR_BIT.
      (Qt): Add forward decl.
      (struct Lisp_Bool_Vector): Don't assume EMACS_INT is aligned
      at least as strictly as bits_word.
      (bool_vector_data, bool_vector_uchar_data): New accessors.
      All data structure accesses changed to use them.
      (bool_vector_words, bool_vector_bitref, bool_vector_ref)
      (bool_vector_set): New functions.
      (bool_vector_fill): New decl.
      (ROUNDUP): Move to alloc.c as described above.
      df5b4930
    • Paul Eggert's avatar
      Fix recent gnutls changes. · 69369809
      Paul Eggert authored
      * gnutls.c (Fgnutls_boot): Don't assume C99.
      * process.c (wait_reading_process_output): Fix typo in recent change.
      69369809
    • Ted Zlatanov's avatar
      Several GnuTLS fixes for log level and initialization. · 194b4d9f
      Ted Zlatanov authored
      * gnutls.c (emacs_gnutls_handle_error): Adjust log level for EAGAIN.
      (Fgnutls_boot): Set process gnutls_p later, after initialization.
      
      * process.c (wait_reading_process_output, read_process_output)
      (send_process): Check gnutls_state is not NULL.
      194b4d9f
  9. 04 Nov, 2013 4 commits
    • Jan Djärv's avatar
      Fix memory leaks in NS version. · c8b09927
      Jan Djärv authored
      * src/macfont.m (CG_SET_FILL_COLOR_WITH_GC_FOREGROUND)
      (CG_SET_FILL_COLOR_WITH_GC_BACKGROUND)
      (CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND): Fix memory leak.
      
      * src/nsfns.m (Fx_create_frame): Fix memory leak.
      
      * src/nsterm.h (EmacsApp): Add shouldKeepRunning and isFirst for
      OSX >= 10.9.
      
      * src/nsterm.m (init, run, stop:): New methods in EmacsApp for
      OSX >= 10.9 to prevent memory leak of GCD dispatch source.
      c8b09927
    • Eli Zaretskii's avatar
      be80645a
    • Eli Zaretskii's avatar
      Fix bug #15260 with building and installing Emacs in non-ASCII directories. · d0065ff1
      Eli Zaretskii authored
       src/xdisp.c (message3_nolog, message_with_string): Encode the string
       before writing it to the terminal in a non-interactive session.
       src/lread.c (openp): If both FILENAME and SUFFIX are unibyte, make
       sure we concatenate them into a unibyte string.
       src/fileio.c (make_temp_name): Encode PREFIX, and decode the
       resulting temporary name before returning it to the caller.
       (Fexpand_file_name): If NAME is pure-ASCII and DEFAULT_DIRECTORY
       is a unibyte string, convert NAME to a unibyte string to ensure
       that the result is also a unibyte string.
       src/emacs.c (init_cmdargs): Use build_unibyte_string to make sure we
       create unibyte strings from default paths and directory/file
       names.
       src/coding.h (ENCODE_FILE): Do not attempt to encode a unibyte
       string.
       src/callproc.c (init_callproc): Use build_unibyte_string to make
       sure we create unibyte strings from default paths and
       directory/file names.
       src/buffer.c (init_buffer): Don't store default-directory of
       *scratch* in multibyte form.  The original problem which led to
       that is described in
       http://lists.gnu.org/archive/html/emacs-pretest-bug/2004-11/msg00532.html,
       but it was solved long ago.
      
       lisp/startup.el (normal-top-level): Move setting eol-mnemonic-unix,
       eol-mnemonic-mac, eol-mnemonic-dos, and also setup of the locale
       environment and decoding all of the default-directory's to here
       from command-line.
       (command-line): Decode also argv[0].
       lisp/loadup.el: Error out if default-directory is a multibyte string
       when we are dumping.
       lisp/Makefile.in (emacs): Don't set LC_ALL=C.
      
       leim/Makefile.in (RUN_EMACS): Don't set LC_ALL=C.
      
       configure.ac: Don't disallow builds in non-ASCII directories.
      d0065ff1
    • Paul Eggert's avatar
      Port to stricter C99 platforms. · 91f2d272
      Paul Eggert authored
      Especially, C99 prohibits nesting a struct X inside struct Y if
      struct X has a flexible array member.
      Also, merge from gnulib, incorporating:
      2013-11-03 intprops: port to Oracle Studio c99
      * lib/intprops.h: Update from gnulib.
      * src/alloc.c (struct sdata): New type.
      (sdata): Implement in terms of struct sdata.
      Remove u member; all uses replaced by next_vector, set_next_vector.
      (SDATA_SELECTOR, SDATA_DATA, SDATA_DATA_OFFSET): Adjust to sdata change.
      (SDATA_DATA_OFFSET): Now a constant, not a macro.
      (struct sblock): Rename first_data member to data, which is now
      a flexible array member.  All uses changed.
      (next_vector, set_next_vector, large_vector_vec): New functions.
      (vector_alignment): New constant.
      (roundup_size): Make it a multiple of ALIGNOF_STRUCT_LISP_VECTOR, too.
      (struct large-vector): Now merely a NEXT member, since the old approach
      ran afoul of stricter C99.  All uses changed to use
      large_vector_vec or large_vector_offset.
      (large_vector_offset): New constant.
      * src/dispnew.c: Include tparam.h, for tgetent.
      Do not include term.h; no longer needed.
      * src/gnutls.c (Fgnutls_boot): Don't continue after calling a _Noreturn.
      * src/lisp.h (ENUM_BF) [__SUNPRO_C && __STDC__]: Use unsigned int.
      (struct Lisp_Vector): Use a flexible array member for contents,
      instead of a union with a member that is an array of size 1.
      All uses changed.
      (ALIGNOF_STRUCT_LISP_VECTOR): New constant, to make up for the
      fact that the struct no longer contains a union.
      (struct Lisp_Misc_Any, struct Lisp_Marker, struct Lisp_Overlay)
      (struct Lisp_Save_Value, struct Lisp_Free):
      Use unsigned, not int, for spacers, to avoid c99 warning.
      (union specbinding): Use unsigned, not bool, for bitfield, as
      bool is not portable to pre-C99 hosts.
      91f2d272