1. 10 Sep, 2016 1 commit
    • Noam Postavsky's avatar
      Don't require isearch-update before isearch-done · 68f4b529
      Noam Postavsky authored
      It is useful to be able to call `isearch-done' unconditionally to
      ensure a non-isearching state.
      
      * lisp/isearch.el (isearch-done): Check that `isearch--current-buffer'
      is a live buffer before using it (Bug #21091).
      * test/lisp/isearch-tests.el (isearch--test-done): Test it.
      68f4b529
  2. 09 Sep, 2016 7 commits
    • Simen Heggestøyl's avatar
      * lisp/emacs-lisp/ring.el: Use lexical-binding · 367f8568
      Simen Heggestøyl authored
      * lisp/emacs-lisp/ring.el (ring-elements): Don't use the RESULT
      argument of `dotimes' when the iteration variable isn't referred by
      it.
      (ring-member): Don't pass nil as the RESULT argument of `dotimes'
      since it's the default.
      367f8568
    • Michal Nazarewicz's avatar
      Split regex character class test into smaller chunks · 8634efa3
      Michal Nazarewicz authored
      Having one test for all character classes it is not always trivial to
      determine which class is failing.  This happens when failure is caused
      by ‘(should (equal (point) (point-max)))’ not being met.
      
      With per-character class tests, it is immidiatelly obvious which test
      causes issues plus tests for all classes are run even if some of them
      fail.
      
      * test/src/regex-tests.el (regex-character-classes): Delete and split
      into…
      (regex-tests-alnum-character-class, regex-tests-alpha-character-class,
      regex-tests-ascii-character-class, regex-tests-blank-character-class,
      regex-tests-cntrl-character-class, regex-tests-digit-character-class,
      regex-tests-graph-character-class, regex-tests-lower-character-class,
      regex-tests-multibyte-character-class,
      regex-tests-nonascii-character-class,
      regex-tests-print-character-class, regex-tests-punct-character-class,
      regex-tests-space-character-class,
      regex-tests-unibyte-character-class,
      regex-tests-upper-character-class, regex-tests-word-character-class,
      regex-tests-xdigit-character-class): …new tests.
      8634efa3
    • Michal Nazarewicz's avatar
      Don’t allocate char-table’s extra slots in regexp-out-charset · 4516130d
      Michal Nazarewicz authored
      * lisp/emacs-lisp/regexp-opt.el (regexp-opt-charset): Do not use
      'case-table as charmap char-table’s property.  The function has nothing
      to do with casing and in addition using 'case-table causes unnecessary
      extra slots to be allocated which ‘regexp-opt-charset’ does not use.
      4516130d
    • 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
  3. 08 Sep, 2016 4 commits
    • Simen Heggestøyl's avatar
      Add tests for ring.el · e951aa14
      Simen Heggestøyl authored
      * test/lisp/emacs-lisp/ring-tests.el: New file with tests for ring.el.
      e951aa14
    • Martin Rudalics's avatar
      New file test/src/marker-tests.el · ba5d3239
      Martin Rudalics authored
      ba5d3239
    • 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
    • Paul Eggert's avatar
      Update from gnulib · 12a7e0f8
      Paul Eggert authored
      This incorporates:
      2016-09-07 flexmember: new macro FLEXALIGNOF
      2016-09-07 flexmember: port better to GCC + valgrind
      2016-08-18 Port modules to use getprogname explicitly
      2016-09-02 manywarnings: add -fno-common
      * admin/merge-gnulib (GNULIB_TOOL_FLAGS): Don’t avoid flexmember,
      since time_rz now uses part of it.  Instead, remove m4/flexmember.m4.
      * configure.ac (AC_C_FLEXIBLE_ARRAY_MEMBER): Define away,
      since Emacs assumes C99 and therefore removes m4/flexmember.m4.
      * lib/euidaccess.c, lib/group-member.c, lib/time_rz.c:
      * m4/manywarnings.m4: Copy from gnulib.
      * lib/flexmember.h: New file, from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      12a7e0f8
  4. 07 Sep, 2016 6 commits
  5. 06 Sep, 2016 3 commits
  6. 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
  7. 04 Sep, 2016 4 commits
    • Alan Third's avatar
      Fix synthetic bold on macOS retina displays · 62e4dc46
      Alan Third authored
      * src/macfont.m (macfont_draw): Multiply the synthetic bold scaling
      factor by the OS window backing scale factor.
      62e4dc46
    • Tino Calancha's avatar
      image-dired: Report when a necessary executable is not found · ca473907
      Tino Calancha authored
      See discussion on:
      https://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00552.html
      * lisp/image-dired.el (image-dired-cmd-rotate-original-program)
      (image-dired-cmd-create-thumbnail-program)
      (image-dired-cmd-create-temp-image-program)
      (image-dired-cmd-rotate-thumbnail-program)
      (image-dired-cmd-write-exif-data-program)
      (image-dired-cmd-read-exif-data-program):
      Use executable-find to set the defaut value of this option.
      (image-dired-cmd-rotate-original-program): Idem.
      Search for program 'convert' if 'jpegtran' is not available.
      (image-dired-cmd-rotate-original-options):
      Set the default value consistent with the executable in
      image-dired-cmd-rotate-original-program.
      (image-dired-create-thumb, image-dired-display-image)
      (image-dired-rotate-thumbnail, image-dired-rotate-original)
      (image-dired-set-exif-data, image-dired-get-exif-data):
      Throw and error when the executable used in the function is missing.
      (image-dired-next-line, image-dired-previous-line):
      Use 'forward-line'.
      ca473907
    • Tino Calancha's avatar
      image-type-from-file-name: Perform a case insensitive match · 2db3307e
      Tino Calancha authored
      Fix Bug#24317
      * lisp/image.el (image-type-from-file-name): Bind case-fold-search
      to a non-nil value to force a case insensitive match.
      * lisp/image-dired.el (image-dired-rotate-original):
      Use image-type (Bug#24317).
      (image-dired-get-exif-file-name): Idem.
      Set 'no-exif-data-found' and 'data' in same setq call.
      Use file-attribute-modification-time.
      2db3307e
    • Tino Calancha's avatar
      image-increase-size: Fix non-interactive calls · 7c16c89c
      Tino Calancha authored
      * lisp/image.el (image-increase-size, image-decrease-size):
      Compute a floating point division.
      Problem reported in:
      https://lists.gnu.org/archive/html/emacs-devel/2016-09/msg00067.html
      7c16c89c
  8. 03 Sep, 2016 2 commits
    • Robert Cochran's avatar
      Fix uses of (call-interactively) in lisp/emacs-lisp/checkdoc.el · 2ad16e4b
      Robert Cochran authored
      Passing the prefix argument as the 3rd argument to 'call-interactively'
      causes the prefix argument to be interpreted as events, which is not
      only wrong, but also causes a type error, as 'current-prefix-arg' can
      never be a vector as 'call-interactively' expects.  'call-interactively'
      automatically passes its prefix argument to the called function, so just
      do that, eliminating faulty behavior.
      
      * lisp/emacs-lisp/checkdoc.el (checkdoc-ispell):
      (checkdoc-ispell-current-buffer):
      (checkdoc-ispell-interactive):
      (checkdoc-ispell-message-text):
      (checkdoc-ispell-start):
      (checkdoc-ispell-continue):
      (checkdoc-ispell-comments):
      (checkdoc-ispell-defun):
      Do not pass 'current-prefix-arg' to 'call-interactively' as an event
      vector; merely allow it to propagate forward to the interactive call.
      2ad16e4b
    • Richard Stallman's avatar
      Fix mail-combine-fields · 5fbba6cc
      Richard Stallman authored
      * lisp/mail/sendmail.el (mail-combine-fields): Call `save-excursion' to
      avoid losing our place in the search loop.
      5fbba6cc
  9. 02 Sep, 2016 3 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
    • Michael Albinus's avatar
      Make a reference to fakecygpty in the Tramp manual · 7dc4c3ba
      Michael Albinus authored
      * doc/misc/tramp.texi (Windows setup hints): Make a reference to
      fakecygpty on the Emacs Wiki.
      (Frequently Asked Questions): Fix url.
      7dc4c3ba
    • 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
  10. 01 Sep, 2016 5 commits
  11. 31 Aug, 2016 3 commits
    • Eli Zaretskii's avatar
      Improve testing of etags · 64507149
      Eli Zaretskii authored
      * test/manual/etags/y-src/cccp.c:
      * test/manual/etags/y-src/parse.c: Correct #line directives to
      allow testing invalidate_nodes in etags.c.
      * test/manual/etags/ETAGS.good_1:
      * test/manual/etags/ETAGS.good_2:
      * test/manual/etags/ETAGS.good_3:
      * test/manual/etags/ETAGS.good_4:
      * test/manual/etags/ETAGS.good_5:
      * test/manual/etags/ETAGS.good_6:
      * test/manual/etags/CTAGS.good: Adapt to changes in test files.
      64507149
    • Eli Zaretskii's avatar
    • Paul Eggert's avatar
      Fix etags problems found by static checking · 9166d402
      Paul Eggert authored
      * lib-src/etags.c (invalidate_nodes, put_entry):
      Remove now-unnecessary tests for null pointers.  Simplify.
      (put_entries): Rewrite to avoid GCC 6.2 warning about
      dereferencing null pointer.
      9166d402