1. 30 Sep, 2016 5 commits
    • Vasilij Schneidermann's avatar
      New user option 'debugger-stack-frame-as-list' · d1890a3a
      Vasilij Schneidermann authored
      * src/eval.c (syms_of_eval) <debugger-stack-frame-as-list>: New
      variable.
      * lisp/cus-start.el (standard): Add debugger-stack-frame-as-list.
      * lisp/emacs-lisp/debug.el (debugger-setup-buffer): Adjust
      backtrace processing for the value of debugger-stack-frame-as-list.
      * lisp/emacs-lisp/edebug.el (edebug-backtrace): Adjust backtrace
      processing for the value of debugger-stack-frame-as-list.
      * doc/lispref/debugging.texi (Internals of Debugger): Document
      debugger-stack-frame-as-list.
      * etc/NEWS: Mention 'debugger-stack-frame-as-list'.
      d1890a3a
    • Eli Zaretskii's avatar
      97f35401
    • Aurelien Aptel's avatar
      d9ce9c8f
    • Eli Zaretskii's avatar
      Avoid compiler warnings in image.c on MS-Windows · 6133d656
      Eli Zaretskii authored
      * src/image.c (DrawText, g_type_init) [WINDOWSNT]: Avoid compiler
      warning about unused macros.
      6133d656
    • Paul Eggert's avatar
      Fix problems found by static checking --with-ns · 3c2c5026
      Paul Eggert authored
      This is for Fedora 24 when configured with --enable-gcc-warnings.
      Although it does not fix all the problems, it fixes many of them.
      * src/frame.c (XParseGeometry):
      * src/nsterm.m (mouseDown:):
      Mark locals with UNINIT to pacify --enable-gcc-warnings.
      * src/image.c (PIX_MASK_DRAW, DefaultDepthOfScreen):
      Remove unused macros.
      (slurp_file xbm_scan, xbm_read_bitmap_data, xbm_load_image)
      (xbm_file_p, xbm_load, xpm_scan, xpm_make_color_table_v)
      (xpm_put_color_table_v, xpm_get_color_table_v)
      (xpm_make_color_table_h, xpm_put_color_table_h)
      (xpm_get_color_table_h, xpm_load_image, xpm_load)
      (pbm_next_char, pbm_scan_number, pbm_load, svg_load)
      (svg_load_image):
      * src/nsfns.m (x_get_string_resource):
      * src/nsimage.m (ns_image_from_XBM):
      Fix pointer signedness problems.
      * src/image.c (xpm_load_image, x_build_heuristic_mask, pbm_load)
      (imagemagick_load_image): Omit unused locals.
      * src/nsfns.m (ns_send_types, ns_return_types, ns_drag_types)
      (Fx_open_connection):
      * src/nsfont.m (ns_antialias_threshold):
      Move extern decl to nsterm.h so it can be checked.
      * src/nsmenu.m (svcsMenu, dockMenu):
      Move to the only file that uses them, so they can be static.
      * src/nsterm.h (find_and_call_menu_selection):
      * src/nsterm.m (x_set_frame_alpha):
      Omit duplicate decls.
      * src/nsterm.h (ns_dump_glyphstring): Mark as EXTERNALLY_VISIBLE.
      * src/nsfns.m (ns_tooltip, ns_display_info_for_name)
      (ns_set_name_as_filename, x_set_menu_bar_lines)
      (x_set_tool_bar_lines, x_set_internal_border_width):
      * src/nsterm.m (ns_drag_types, ns_draw_text_decoration):
      Now static.
      * src/nsfns.m (ns_lisp_to_cursor_type, ns_cursor_type_to_lisp):
      * src/nsterm.m (ns_free_indexed_color, ns_color_to_lisp):
      Remove; unused.
      * src/nsfont.m (ns_dump_glyphstring):
      * src/nsterm.m (hide_bell, ns_get_color, ns_color_to_lisp)
      (ns_clear_frame, keyDown:):
      Fix signedness problem with printf arg.
      * src/nsterm.h (ns_input_events, ns_finish_events):
      * src/nsterm.m (ns_finish_events, hide_bell):
      Prototype the decls.
      * src/nsterm.m (NSMenuDidBeginTrackingNotification):
      Omit unnecessary decl.
      (dockMenu):
      (mainMenu) [NS_IMPL_COCOA]: Now static, and in this file.
      (ns_dumpglyphs_box_or_relief, changeFont:, initFrameFromEmacs:)
      (toggleFullScreen:): Use FACE_FROM_ID instead of
      FACE_FROM_ID_OR_NULL in contexts where the caller expects the
      result to be non-null.
      (applicationShouldTerminate:): Fix misleading indentation.
      3c2c5026
  2. 24 Sep, 2016 1 commit
    • Paul Eggert's avatar
      Improve integer overflow handling a bit · b3e1b382
      Paul Eggert authored
      * src/charset.c (read_hex): Use INT_LEFT_SHIFT_OVERFLOW for clarity.
      The machine code is the same on my platform.
      * src/doprnt.c (doprnt):
      * src/emacs-module.c (module_funcall):
      * src/font.c (font_intern_prop):
      * src/keyboard.c (Frecursion_depth):
      * src/lread.c (read1):
      Use WRAPV macros instead of checking overflow by hand.
      * src/editfns.c (hi_time, time_arith, decode_time_components):
      * src/emacs-module.c (Fmodule_load):
      Simplify by using FIXNUM_OVERFLOW_P.
      * src/emacs-module.c: Include intprops.h.
      * src/xdisp.c (percent99): New function.
      (decode_mode_spec): Use it to simplify overflow avoidance and
      formatting of %p and %P.
      b3e1b382
  3. 23 Sep, 2016 5 commits
    • Eli Zaretskii's avatar
      Improve the doc string of 'format' · 7cb120eb
      Eli Zaretskii authored
      * src/editfns.c (Fformat): Fix ambiguity in the doc string's usage
      of a literal period.  (Bug#24407)
      
      This was backported from master
      (cherry picked from commit 71238966)
      7cb120eb
    • Martin Rudalics's avatar
      Fix (next-frame nil t) crash (Bug#24281) · 16e62077
      Martin Rudalics authored
      * src/frame.c (candidate_frame): Check minibuf argument before
      comparing it to zero (Bug#24281).
      
      This was backported from master
      (cherry picked from commit dc491c3d)
      16e62077
    • Noam Postavsky's avatar
      Fix debugging of string-match-p errors · 3f539c00
      Noam Postavsky authored
      * src/eval.c (call_debugger): Bind inhibit-changing-match-data to nil so
      that debugger code that needs to do regexp match won't break
      (Bug #23949, Bug #24166, Bug#16294).
      
      This was backported from master
      (cherry picked from commit 7fb75680)
      3f539c00
    • Eli Zaretskii's avatar
      Fix 'vertical-motion' and 'posn-at-point' under 'visual-line-mode' · df4f8125
      Eli Zaretskii authored
      * src/xdisp.c (move_it_in_display_line_to): Don't assume we can
      wrap on a whitespace character if it's followed by another
      whitespace character.  When returning under WORD_WRAP for a screen
      line that is continued, restore to wrap point when atpos/atx
      position would be displayed on the next screen line due to
      line-wrap.  (Bug#23570)
      
      This is backported from master
      (cherry picked from commit 99848b37)
      df4f8125
    • Eli Zaretskii's avatar
      Update commentary of STRING_CHAR and FETCH_MULTIBYTE_CHAR · 2b8c5f0b
      Eli Zaretskii authored
      * src/character.h (STRING_CHAR):
      * src/buffer.h (FETCH_MULTIBYTE_CHAR): Update commentary: these
      two macros no longer do any character unification, so the caveats
      in those comments are no longer pertinent.
      2b8c5f0b
  4. 20 Sep, 2016 1 commit
    • Paul Eggert's avatar
      Use flexmembers on IBM XL C for AIX · d9741b61
      Paul Eggert authored
      This removes a workaround where Emacs did not use flexible
      array members when compiled with IBM XL C.  Instead, avoid
      the problem by making the aliasing issues more obvious to
      this compiler.
      * admin/merge-gnulib: Don’t remove m4/flexmember.m4.
      * m4/flexmember.m4: Copy from gnulib.
      * configure.ac (AC_C_FLEXIBLE_ARRAY_MEMBER): Remove workaround.
      * src/alloc.c (allocate_string_data): Rephrase to avoid aliasing
      problem that would otherwise mess up code generated for flexible
      array members by IBM XL C for AIX, V12.1.
      * src/conf_post.h (FLEXIBLE_ARRAY_MEMBER): Remove; now done
      by gnulib code.
      d9741b61
  5. 17 Sep, 2016 3 commits
  6. 16 Sep, 2016 1 commit
  7. 15 Sep, 2016 1 commit
    • Paul Eggert's avatar
      Prefer now-standard int width macros · 0bbf00c7
      Paul Eggert authored
      * src/data.c (ULL_WIDTH):
      * src/lisp.h (EMACS_INT_WIDTH, BITS_PER_BITS_WORD):
      * src/lread.c (read_integer):
      * src/term.c (produce_glyphless_glyph):
      * src/xterm.c (x_send_scroll_bar_event):
      Use *_WIDTH macros instead of CHAR_BIT * sizeof.
      * src/data.c (ULL_WIDTH): Rename from BITS_PER_ULL for consistency
      with the *_WIDTH standard macros.  All uses changed.
      * src/gmalloc.c (INT_BIT): Remove.  All uses replaced with INT_WIDTH.
      * src/lisp.h (EMACS_INT_WIDTH): Rename from BITS_PER_EMACS_INT
      for consistency with the *_WIDTH standard macros.  All uses changed.
      (BITS_PER_CHAR): Remove; all uses replaced by CHAR_BIT.  This must
      be the same as CHAR_WIDTH and avoids confusion with Elisp
      char-width, which counts columns not bits.
      (BITS_PER_SHORT): Remove; all uses replaced by SHRT_WIDTH.
      (BITS_PER_LONG): Remove; all uses replaced by LONG_WIDTH.
      * src/lread.c: Do not include limits.h since CHAR_BIT is no longer
      used directly.
      0bbf00c7
  8. 14 Sep, 2016 2 commits
    • Eli Zaretskii's avatar
      Avoid compiler warning on MS-Windows due to clone_file · fc77d046
      Eli Zaretskii authored
      * src/fileio.c (clone_file): Condition on !WINDOWSNT, since the
      call to it is not compiled in that build, and having it defined
      causes compiler warnings.
      fc77d046
    • Eli Zaretskii's avatar
      Avoid aborts in GC due to abort_on_gc · 5ad238bf
      Eli Zaretskii authored
      * src/lisp.h:
      * src/print.c (Fprin1_to_string):
      * src/eval.c (signal_or_quit):
      * src/alloc.c (garbage_collect_1): Remove declarations, setting,
      and testing the value of abort_on_gc.  It is no longer needed, and
      using it causes rare aborts in GC for no good reason.  (Bug#23912)
      5ad238bf
  9. 13 Sep, 2016 1 commit
  10. 12 Sep, 2016 4 commits
  11. 11 Sep, 2016 2 commits
    • Noam Postavsky's avatar
      Fix comments on window height macros · ea0f750e
      Noam Postavsky authored
      * src/window.h (WINDOW_MODE_LINE_HEIGHT, WINDOW_HEADER_LINE_HEIGHT): Fix
      confusing claim that "height is in pixels and in lines"; in fact it's in
      pixels.
      ea0f750e
    • Paul Eggert's avatar
      copy-file now uses GNU/Linux file cloning · 9b21d9f9
      Paul Eggert authored
      From a suggestion by Kieran Colford (see Bug#23904).
      * configure.ac: Check for linux/fs.h.
      * src/fileio.c [HAVE_LINUX_FS_H]: Include sys/ioctl.h and linux/fs.h.
      (clone_file): New function.
      (Fcopy_file): Use it.
      9b21d9f9
  12. 10 Sep, 2016 1 commit
  13. 09 Sep, 2016 4 commits
    • Michal Nazarewicz's avatar
      Remove dead loop iterations in regex.c · 0e7eb640
      Michal Nazarewicz authored
      RE_CHAR_TO_MULTIBYTE(c) yields c for ASCII characters and a byte8
      character for c ≥ 0x80.  Furthermore, CHAR_BYTE8_P(c) is true only
      for byte8 characters.  This means that
      
      	c = RE_CHAR_TO_MULTIBYTE (ch);
      	if (! CHAR_BYTE8_P (c) && re_iswctype (c, cc))
      
      is equivalent to:
      
      	c = c;
      	if (! false && re_iswctype (c, cc))
      
      for 0 ⪬ c < 0x80, and
      
      	c = BYTE8_TO_CHAR (c);
      	if (! true && re_iswctype (c, cc))
      
      for 0x80 ⪬ c < 0x100.  In other words, the loop never executes for
      c ≥ 0x80 and RE_CHAR_TO_MULTIBYTE call is unnecessary for c < 0x80.
      
      * src/regex.c (regex_compile): Simplyfy a for loop by eliminating
      dead iterations and unnecessary macro calls.
      0e7eb640
    • Michal Nazarewicz's avatar
      Replace decimalnump with alphanumericp · c579b28f
      Michal Nazarewicz authored
      decimalnump was used in regex.c only in ISALNUM macro which ored it with
      alphabeticp.  Because both of those functions require Unicode general
      category lookup, this resulted in unnecessary lookups (if alphabeticp
      return false decimalp had to perform another lookup).  Drop decimalnump
      in favour of alphanumericp which combines decimelnump with alphabeticp.
      
      * src/character.c (decimalnump): Remove in favour of…
      (alphanumericp): …new function.
      
      * src/regex.c (ISALNUM): Use alphanumericp.
      c579b28f
    • Michal Nazarewicz's avatar
      Remove inaccurate comment in regex.c · b1c4c005
      Michal Nazarewicz authored
      * src/regex.c (regex_compile): Remove comment indicating that wctype of
      some character classes may be negative.  All wctypes are in fact
      non-negative.
      b1c4c005
    • Michal Nazarewicz's avatar
      STRING_CHAR does not unify characters; update documentation · 3ffc5f44
      Michal Nazarewicz authored
      * src/character.h (STRING_CHAR): Update doc.
      * src/buffer.h (FETCH_MULTIBYTE_CHAR): Update doc.  While at it, change
      the function to use BYTE_POS_ADDR instead of open-coding it.
      3ffc5f44
  14. 08 Sep, 2016 1 commit
    • Paul Eggert's avatar
      Port flexible array members to GCC + valgrind · d2f1971d
      Paul Eggert authored
      These changes are needed to conform to the C standard's rule for
      allocating structs containing flexible array members.  C11 says
      that malloc (offsetof (struct s, m) + n) does not suffice to
      allocate a struct with an n-byte tail; instead, malloc’s arg
      should be rounded up to the nearest multiple of alignof (struct s).
      Although this is arguably a defect in C11, gcc -O2 + valgrind
      sometimes complains when this rule is violated, and when debugging
      it’s better to keep valgrind happy.
      For details please see the thread containing the message at:
      https://gcc.gnu.org/ml/gcc-patches/2016-09/msg00416.html
      * lib-src/ebrowse.c, src/alloc.c, src/image.c, src/process.c:
      Include flexmember.h.
      * lib-src/ebrowse.c (add_sym, add_member, make_namespace)
      (register_namespace_alias):
      * src/alloc.c (SDATA_SIZE, allocate_string_data):
      * src/image.c (xpm_cache_color, imagemagick_create_cache):
      * src/process.c (Fmake_network_process):
      Use FLEXSIZEOF instead of offsetof and addition.
      * src/alloc.c (SDATA_SIZE, vector_alignment):
      Use FLEXALIGNOF instead of sizeof (ptrdiff_t).
      * src/lisp.h (ALIGNOF_STRUCT_LISP_VECTOR):
      Remove, as alloc.c can now calculate this on its own.
      d2f1971d
  15. 07 Sep, 2016 1 commit
    • Paul Eggert's avatar
      Use DEV_TTY more consistently · 5d2ac743
      Paul Eggert authored
      * src/conf_post.h (DEV_TTY): Move from here ...
      * src/keyboard.c, src/keyboard.h: ... to here, as it doesn’t need
      to be visible everywhere.  Make it a constant.
      * src/keyboard.c (handle_interrupt, Fset_quit_char):
      * src/process.c (create_process): Prefer DEV_TTY to "/dev/tty".
      5d2ac743
  16. 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
  17. 05 Sep, 2016 2 commits
    • Eli Zaretskii's avatar
      Avoid assertion violations when scrolling narrowed buffer · 6acff252
      Eli Zaretskii authored
      * src/window.c (window_scroll_pixel_based):
      * src/xdisp.c (pos_visible_p): Don't allow simulated redisplay to
      start outside the accessible portion of the buffer.  This avoids
      assertion violations when some Lisp narrows the buffer to less
      than the current window, and then attempts to scroll the buffer.
      6acff252
    • Eli Zaretskii's avatar
      Treat SIGINT correctly in GUI sessions on MS-Windows · cfaf18a2
      Eli Zaretskii authored
      * src/w32proc.c (sys_signal): Don't reject SIGINT, as it is
      supported by MS runtime.
      * src/term.c (DEV_TTY): Move from here ...
      * src/conf_post.h (DEV_TTY): ... to here.  Separate definitions
      for WINDOWSNT and for the rest.
      * src/keyboard.c (handle_interrupt_signal): Use DEV_TTY instead of
      a literal "/dev/tty".
      
      * etc/NEWS: Mention the behavior change.
      cfaf18a2
  18. 04 Sep, 2016 1 commit
  19. 02 Sep, 2016 2 commits
    • Stefan Monnier's avatar
      Check actual contents before promting about changed file · 5a4bffb6
      Stefan Monnier authored
      * lisp/userlock.el (userlock--check-content-unchanged)
      (userlock--ask-user-about-supersession-threat): New functions.
      * src/filelock.c (lock_file): Use them to avoid spurious prompting.
      * doc/lispref/buffers.texi (Modification Time): Update doc of
      ask-user-about-supersession-threat.
      5a4bffb6
    • Paul Eggert's avatar
      Don’t create fd >= FD_SETSIZE · a5509099
      Paul Eggert authored
      This avoids a potential crash if too many subprocesses (Bug#24325).
      * src/process.c [HAVE_SETRLIMIT]: Include <sys/resource.h>.
      (init_process_emacs): If ulimit -n is greater than FD_SETSIZE,
      set it to FD_SETSIZE.
      a5509099
  20. 01 Sep, 2016 1 commit