1. 31 Aug, 2014 2 commits
  2. 30 Aug, 2014 4 commits
    • Paul Eggert's avatar
      Vector-sorting fixes. · f9caea82
      Paul Eggert authored
      It's not safe to call qsort or qsort_r, since they have undefined
      behavior if the user-specified predicate is not a total order.
      Also, watch out for garbage-collection while sorting vectors.
      * admin/merge-gnulib (GNULIB_MODULES): Add vla.
      * configure.ac (qsort_r): Remove, as we no longer use qsort-like
      functions.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib/vla.h, m4/vararrays.m4: New files, copied from gnulib.
      * lib/stdlib.in.h, m4/stdlib_h.m4: Sync from gnulib, incorporating:
      2014-08-29 qsort_r: new module, for GNU-style qsort_r
      The previous two files' changes are boilerplate generated by
      admin/merge-gnulib, and should not affect Emacs.
      * src/fns.c: Include <vla.h>.
      (sort_vector_predicate) [!HAVE_QSORT_R]: Remove.
      (sort_vector_compare): Remove, replacing with ....
      (inorder, merge_vectors, sort_vector_inplace, sort_vector_copy):
      ... these new functions.
      (sort_vector): Rewrite to use the new functions.
      GCPRO locals, since the predicate can invoke the GC.
      Since it's in-place return void; caller changed.
      (merge): Use 'inorder', for clarity.
      
      Fixes: debbugs:18361
      f9caea82
    • Paul Eggert's avatar
      * sysdep.c (str_collate): Clear errno just before wcscoll(_l). · 88366fcf
      Paul Eggert authored
      One can't hoist this out of the 'if', because intervening calls to
      newlocale, twolower, etc. can change errno.
      88366fcf
    • Eli Zaretskii's avatar
      Minor ChangeLog fixes. · 670e4e48
      Eli Zaretskii authored
      670e4e48
    • Eli Zaretskii's avatar
      Improve error checking and error messages in string-collation functions. · e7027eab
      Eli Zaretskii authored
       src/sysdep.c (str_collate) [__STDC_ISO_10646__]: Improve the
       wording of the error messages.
       (str_collate) [WINDOWSNT]: Signal an error if w32_compare_strings
       sets errno.
       src/w32proc.c (get_lcid_callback): Accept locale specifications
       without the country part, as in "enu" vs "enu_USA".
       (w32_compare_strings): Signal an error if a locale was specified,
       but couldn't be translated into a valid LCID.
      e7027eab
  3. 29 Aug, 2014 7 commits
    • Michael Albinus's avatar
    • Paul Eggert's avatar
      * sysdep.c (str_collate): Do not look at errno after towlower_l. · 7421589f
      Paul Eggert authored
      errno's value is not specified after towlower_l.  Instead, assume
      that towlower_l returns its argument on failure, which is portable
      in practice.
      7421589f
    • Eli Zaretskii's avatar
      Implement case-insensitive and Unicode-compliant collation on MS-Windows. · 21ba51de
      Eli Zaretskii authored
       src/fns.c (Fstring_collate_lessp, Fstring_collate_equalp): Doc fix.
       src/w32proc.c (w32_compare_strings): Accept additional argument
       IGNORE_CASE.  Set up the flags for CompareStringW to ignore case
       if requested.  If w32-collate-ignore-punctuation is non-nil, add
       NORM_IGNORESYMBOLS to the flags.
       (LINGUISTIC_IGNORECASE): Define if not already defined.
       (syms_of_ntproc) <Vw32_collate_ignore_punctuation>: New variable.
       src/sysdep.c (str_collate) [WINDOWSNT]: Adapt to the interface
       change.
       src/w32.h: Adjust prototype of w32_compare_strings.
      
       etc/NEWS: Mention w32-collate-ignore-punctuation.
      
      Fixes: debbugs:18051
      21ba51de
    • Michael Albinus's avatar
      Add optional arguments LOCALE and IGNORE-CASE to collation functions. · b579ae53
      Michael Albinus authored
      * fns.c (Fstring_collate_lessp, Fstring_collate_equalp):
      Add optional arguments LOCALE and IGNORE-CASE.
      
      * lisp.h (str_collate): Adapt argument list.
      
      * sysdep.c (LC_CTYPE, LC_CTYPE_MASK, towlower_l):
      Define substitutes for platforms that lack them.
      (str_collate): Add arguments locale and ignore_case.
      b579ae53
    • Dmitry Antipov's avatar
      Fix ChangeLog entry. · 55412cd9
      Dmitry Antipov authored
      55412cd9
    • Dmitry Antipov's avatar
      Fix last change to support Darwin/OSX (Bug#18354). · 42d819e9
      Dmitry Antipov authored
      * sysdep.c (sort_vector_compare) [DARWIN_OS || __FreeBSD__]:
      Conditionally define to match system's qsort_r signature.
      (sort_vector) [DARWIN_OS || __FreeBSD__]: Likewise in call to qsort_r.
      42d819e9
    • Dmitry Antipov's avatar
      Add vectors support to Fsort. · 1764ec44
      Dmitry Antipov authored
      * configure.ac (AC_CHECK_FUNCS): Check for qsort_r.
      * src/fns.c (sort_vector, sort_vector_compare): New functions.
      (sort_list): Likewise, refactored out of ...
      (Fsort): ... adjusted user.  Mention vectors in docstring.
      (sort_vector_predicate) [!HAVE_QSORT_R]: New variable.
      * src/alloc.c (make_save_int_obj): New function.
      * src/lisp.h (enum Lisp_Save_Type): New member SAVE_TYPE_INT_OBJ.
      (make_save_int_obj): Add prototype.
      * test/automated/fns-tests.el (fns-tests-sort): New test.
      1764ec44
  4. 28 Aug, 2014 4 commits
    • Martin Rudalics's avatar
      cd19ba4c
    • Ken Brown's avatar
      Add support for HYBRID_MALLOC, allowing the use of gmalloc before · ea652500
      Ken Brown authored
      dumping and the system malloc after dumping.  (Bug#18222)
      
      * configure.ac (HYBRID_MALLOC): New macro; define to use gmalloc
      before dumping and the system malloc after dumping.  Define on Cygwin.
      * src/conf_post.h (malloc, realloc, calloc, free) [HYBRID_MALLOC]:
      Define as macros, expanding to hybrid_malloc, etc.
      (HYBRID_GET_CURRENT_DIR_NAME): New macro.
      (get_current_dir_name) [HYBRID_GET_CURRENT_DIR_NAME]: Define as
      macro.
      * src/gmalloc.c: Set up the infrastructure for HYBRID_MALLOC, with a
      full implementation on Cygwin.  Remove Cygwin-specific code that
      is no longer needed.
      (malloc, realloc, calloc, free, aligned_alloc) [HYBRID_MALLOC]:
      Redefine as macros expanding to gmalloc, grealloc, etc.
      (DUMPED, ALLOCATED_BEFORE_DUMPING) [CYGWIN]: New macros.
      (get_current_dir_name) [HYBRID_GET_CURRENT_DIR_NAME]: Undefine.
      (USE_PTHREAD, posix_memalign) [HYBRID_MALLOC]: Don't define.
      (hybrid_malloc, hybrid_calloc, hybrid_free, hybrid_realloc)
      [HYBRID_MALLOC]:
      (hybrid_get_current_dir_name) [HYBRID_GET_CURRENT_DIR_NAME]:
      (hybrid_aligned_alloc) [HYBRID_MALLOC && (HAVE_ALIGNED_ALLOC ||
      HAVE_POSIX_MEMALIGN)]: New functions.
      * src/alloc.c (aligned_alloc) [HYBRID_MALLOC && (ALIGNED_ALLOC ||
      HAVE_POSIX_MEMALIGN)]: Define as macro expanding to
      hybrid_aligned_alloc; declare.
      (USE_ALIGNED_ALLOC) [HYBRID_MALLOC && (ALIGNED_ALLOC ||
      HAVE_POSIX_MEMALIGN)]: Define.
      (refill_memory_reserve) [HYBRID_MALLOC]: Do nothing.
      * src/sysdep.c (get_current_dir_name) [HYBRID_GET_CURRENT_DIR_NAME]:
      Define as macro, expanding to gget_current_dir_name, and define
      the latter.
      * src/emacs.c (main) [HYBRID_MALLOC]: Don't call memory_warnings() or
      malloc_enable_thread().  Don't initialize malloc.
      * src/lisp.h (NONPOINTER_BITS) [CYGWIN]: Define (because GNU_MALLOC is
      no longer defined on Cygwin).
      (refill_memory_reserve) [HYBRID_MALLOC]: Don't declare.
      * src/sheap.c (bss_sbrk_buffer_end): New variable.
      * src/unexcw.c (__malloc_initialized): Remove variable.
      * src/ralloc.c: Throughout, treat HYBRID_MALLOC the same as
      SYSTEM_MALLOC.
      * src/xdisp.c (decode_mode_spec) [HYBRID_MALLOC]: Don't check
      	Vmemory_full.
      ea652500
    • Martin Rudalics's avatar
      Some fixes for scroll bar code. · a7ef7a0e
      Martin Rudalics authored
      * w32term.c (w32_horizontal_scroll_bar_handle_click): In
      `event->y' return entire range (the size of the scroll bar minus
      that of the thumb).
      * xterm.c (xm_scroll_callback, xaw_jump_callback): In `whole'
      return entire range (the scaled size of the scroll bar minus
      that of the slider).  In `portion' return the scaled position of
      the slider.
      (xaw_jump_callback): Restore part of code for vertical scroll
      bar broken in change from 2014-07-27.
      (xaw_scroll_callback): Provide incremental scrolling with
      horizontal scroll bars.
      (x_scroll_bar_handle_click): Fix typo introduced in change from
      2014-07-27.
      * scroll-bar.el (scroll-bar-horizontal-drag-1): Handle new
      interpretation of `portion-whole'.
      a7ef7a0e
    • Paul Eggert's avatar
      * sysdep.c (LC_COLLATE, LC_COLLATE_MASK): Give individual defaults. · cbe070d1
      Paul Eggert authored
      Fixes: debbugs:18051
      cbe070d1
  5. 27 Aug, 2014 5 commits
    • Eli Zaretskii's avatar
      Fix bug #18339 with segfault when $ is typed into empty LaTeX buffer. · 9bac5fd9
      Eli Zaretskii authored
       src/syntax.c (scan_lists): Don't examine positions before BEGV.
      9bac5fd9
    • Paul Eggert's avatar
      Improve robustness of new string-collation code. · 110d87a1
      Paul Eggert authored
      * configure.ac (newlocale): Check for this, not for uselocale.
      * src/sysdep.c (LC_COLLATE, LC_COLLATE_MASK, freelocale, locale_t)
      (newlocale, wcscoll_l): Define substitutes for platforms that
      lack them, so as to simplify the mainline code.
      (str_collate): Simplify the code by assuming the above definitions.
      Use wcscoll_l, not uselocale, as uselocale is too fragile.  For
      example, the old version left the Emacs in the wrong locale if
      wcscoll reported an error.  Use 'int', not ptrdiff_t, for the int
      result.  Report an error if newlocale fails.
      
      Fixes: debbugs:18051
      110d87a1
    • Michael Albinus's avatar
      * lisp.h (str_collate): · 17d94f1b
      Michael Albinus authored
      * sysdep.c (str_collate): Return int.
      (str_collate) [__STDC_ISO_10646__]: Propagate error of wcscoll.
      17d94f1b
    • Dmitry Antipov's avatar
      * src/keyboard.c (Vtop_level_message): Rename to · 28e0124d
      Dmitry Antipov authored
      Vinternal__top_level_message, as suggested by Stefan Monnier in
      http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00493.html
      All related users changed.
      * lisp/startup.el (normal-top-level): Now use internal--top-level-message.
      * doc/lispref/eval.texi (Eval): Mention possible recovery from stack overflow.
      28e0124d
    • Dmitry Antipov's avatar
      Fix some glitches in previous change. · 7fb78a08
      Dmitry Antipov authored
      * sysdep.c (stack_direction): Replace stack_grows_down
      to simplify calculation of stack boundaries.
      (handle_sigsegv): Check whether we really crash somewhere near
      to stack boundary, and handle fatal signal as usual if not.
      (init_sigsegv): Adjust accordingly.
      7fb78a08
  6. 26 Aug, 2014 2 commits
    • Glenn Morris's avatar
      ChangeLog fixes · 93d56561
      Glenn Morris authored
      93d56561
    • Dmitry Antipov's avatar
      Handle C stack overflow caused by too nested Lisp evaluation. · ebd31792
      Dmitry Antipov authored
      * configure.ac: Check for sigaltstack and related sigaction
      support.  Unconditionally check for sigsetjmp and siglongjmp.
      (HAVE_STACK_OVERFLOW_HANDLING): Define if we can support it.
      * src/lisp.h (toplevel) [HAVE_STACK_OVERFLOW_HANDLING]: Declare
      siglongjmp point to transfer control from SIGSEGV handler.
      * src/keyboard.c (return_to_command_loop, recover_top_level_message)
      [HAVE_STACK_OVERFLOW_HANDLING]: New variables.
      (regular_top_level_message): New variable.
      (command_loop) [HAVE_STACK_OVERFLOW_HANDLING]: Handle non-local
      exit from SIGSEGV handler and adjust message displayed by Vtop_level
      if appropriate.
      (syms_of_keyboard): DEFVAR Vtop_level_message and initialize
      new variables described above.
      * src/sysdep.c [HAVE_SYS_RESOURCE_H]: Include sys/resource.h as such.
      (stack_grows_down, sigsegv_stack, handle_sigsegv)
      [HAVE_STACK_OVERFLOW_HANDLING]: New variables and function.
      (init_sigsegv): New function.
      (init_signals): Use it.
      * lisp/startup.el (normal-top-level): Use top-level-message.
      ebd31792
  7. 25 Aug, 2014 5 commits
    • Ken Brown's avatar
      * configure.ac (G_SLICE_ALWAYS_MALLOC): Remove obsolete macro. · 79404e16
      Ken Brown authored
      * src/emacs.c (main): Remove use of obsolete macro
      G_SLICE_ALWAYS_MALLOC.
      79404e16
    • Eli Zaretskii's avatar
      Fix unoptimized build on MSDOS. · 825ca47f
      Eli Zaretskii authored
       msdos/sedlibmk.inp (gl_LIBOBJS): Add execinfo.o.  Reported by Juan
       Manuel Guerrero <juan.guerrero@gmx.de>.
      
       src/conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Don't define.
      825ca47f
    • Eli Zaretskii's avatar
      Implement locale-sensitive string collation for MS-Windows. (Bug#18051) · 015ea0ff
      Eli Zaretskii authored
       src/w32proc.c (get_lcid_callback, get_lcid, w32_compare_strings):
       New functions.
       src/w32.h (w32_compare_strings): Add prototype.
       src/w32.c <g_b_init_compare_string_w>: New global flag.
       (globals_of_w32): Initialize it.
       src/sysdep.c (str_collate) [WINDOWSNT]: Implementation for MS-Windows.
       src/fns.c (Fstring_collate_lessp, Fstring_collate_equalp)
       [WINDOWSNT]: Call str_collate on MS-Windows.
      
       etc/NEWS: Mention that string-collate-* functions are supported on
       MS-Windows as well.
      015ea0ff
    • Dmitry Antipov's avatar
      One more minor cleanup of font subsystem. · 8661ebaa
      Dmitry Antipov authored
      * font.h (struct font_driver): Convert text_extents to
      return void because returned value is never actually used.
      * macfont.c (macfont_text_extents):
      * w32font.c (w32font_text_extents):
      * xftfont.c (xftfont_text_extents): Adjust to return void
      and assume that 'metrics' argument is always non-NULL.
      * ftfont.c (ftfont_text_extents):
      * xfont.c (xfont_text_extents): Likewise.  Avoid redundant memset.
      8661ebaa
    • Paul Eggert's avatar
      Minor cleanups of str_collate fix. · 90c5c877
      Paul Eggert authored
      * fns.c (str_collate): Move decl from here ...
      * lisp.h (str_collate): ... to here.
      * sysdep.c (str_collate): Prune away some of the forest of ifdefs.
      Remove unnecessary casts.  Use SAFE_NALLOCA to avoid
      potential problems with integer overflow.  Don't assume
      setlocale succeeds.  Remove unnecessary test before restoring
      locale via setlocale, and free the copied setlocale string
      when done with it.
      
      Fixes: debbugs:18051
      90c5c877
  8. 24 Aug, 2014 1 commit
    • Michael Albinus's avatar
      Add string collation. · 07b47905
      Michael Albinus authored
      * configure.ac: Check also for the uselocale function. 
      
      * src/fns.c (Fstring_collate_lessp, Fstring_collate_equalp): New DEFUNs.
      
      * src/sysdep.c (str_collate): New function.  (Bug#18051)
      07b47905
  9. 23 Aug, 2014 1 commit
    • Karol Ostrovsky's avatar
      Fix bug #18302 with minor issues in the MSYS2/MinGW64 build. · 0d880e73
      Karol Ostrovsky authored
       configure.ac: Accept "*-mingw*", not just "*-mingw32", as
       canonical name of a MinGW build, because using MSYS2 'uname'
       produces "MINGW64".
      
       src/Makefile.in (emacs$(EXEEXT)): Retry deletion of bootstrap-emacs
       if the initial "rm -f" fails.  This is for MinGW builds, where
       MS-Windows will not allow deleting the executable file of a
       running program.
      0d880e73
  10. 20 Aug, 2014 1 commit
    • Eli Zaretskii's avatar
      Remove 16-bit limitations in scroll bar position reporting on MS-Windows. · a558cd1c
      Eli Zaretskii authored
       src/w32term.c (w32_scroll_bar_handle_click)
       (w32_horizontal_scroll_bar_handle_click)
       (x_scroll_bar_report_motion)
       (x_horizontal_scroll_bar_report_motion): For SB_THUMBPOSITION and
       SB_THUMBTRACK, use the 32-bit position information returned by
       GetScrollInfo, not the 16-bit information returned in the Windows
       message sent to us.
      a558cd1c
  11. 19 Aug, 2014 2 commits
  12. 18 Aug, 2014 2 commits
  13. 17 Aug, 2014 3 commits
  14. 16 Aug, 2014 1 commit