]> git.eshelyaron.com Git - emacs.git/log
emacs.git
6 years agoFix up for bignums after merge from trunk
Tom Tromey [Fri, 10 Aug 2018 00:02:00 +0000 (18:02 -0600)]
Fix up for bignums after merge from trunk

* src/character.c (char_width): Use XFIXNUM.
* src/editfns.c (styled_format): Use XFIXNUM, XUFIXNUM.
* src/fns.c (Fproper_list_p): Use make_fixnum.

6 years agoMerge remote-tracking branch 'origin/master' into feature/bignum
Tom Tromey [Thu, 9 Aug 2018 23:56:53 +0000 (17:56 -0600)]
Merge remote-tracking branch 'origin/master' into feature/bignum

6 years agoUse mpz_sgn rather than comparisons against 0
Tom Tromey [Thu, 9 Aug 2018 19:21:45 +0000 (13:21 -0600)]
Use mpz_sgn rather than comparisons against 0

* src/data.c (Fmod): Use mpz_sgn.
* src/lisp.h (NATNUMP): Use mpz_sgn.

6 years agoDo not use GMP_NUMB_BITS
Andy Moreton [Thu, 9 Aug 2018 19:19:15 +0000 (13:19 -0600)]
Do not use GMP_NUMB_BITS

* src/alloc.c (make_number): Use mp_bits_per_limb, not GMP_NUMB_BITS.

6 years agoUpdate src/{ns,mac}*.m to use bignum-compatible macros
Charles A. Roelli [Thu, 9 Aug 2018 14:00:20 +0000 (16:00 +0200)]
Update src/{ns,mac}*.m to use bignum-compatible macros

* src/nsterm.m:
* src/nsselect.m:
* src/nsmenu.m:
* src/nsimage.m:
* src/nsfont.m:
* src/nsfns.m:
* src/macfont.m: Replace
"make_number" -> "make_fixnum",
"XINT" -> "XFIXNUM",
"XFASTINT" -> "XFIXNAT",
"TYPE_RANGED_INTEGERP" -> "TYPE_RANGED_FIXNUMP",
"RANGED_INTEGERP" -> "RANGED_FIXNUMP",
"CHECK_NATNUM" -> "CHECK_FIXNAT",
"CHECK_NUMBER" -> "CHECK_FIXNUM",
"INTEGERP" -> "FIXNUMP",
"NUMBERP" -> "FIXED_OR_FLOATP",
as done in the following changes:
2018-07-06 Rename integerp->fixnum, etc, in preparation
for bignums (42fe787b)
2018-08-07 More macro renamings for bignum (d1ec3a0a)

6 years ago; More instrumentation for shadowfile-tests.el and files.el
Michael Albinus [Thu, 9 Aug 2018 13:40:37 +0000 (15:40 +0200)]
; More instrumentation for shadowfile-tests.el and files.el

6 years agoFix Bug#32304
Michael Albinus [Thu, 9 Aug 2018 12:08:25 +0000 (14:08 +0200)]
Fix Bug#32304

* test/lisp/net/tramp-tests.el (tramp-test45-unload):
Handle tramp-archive autoloaded objects.  Remove tag :unstable.

6 years agoTrim JSONRPC events buffer when it's too large
João Távora [Thu, 9 Aug 2018 12:04:03 +0000 (13:04 +0100)]
Trim JSONRPC events buffer when it's too large

* lisp/jsonrpc.el (Version): Bump to 1.0.2
(jsonrpc--events-buffer-scrollback-size): New
jsonrpc-connection slot.
(jsonrpc--log-event): Use it to trim buffer.

6 years agoSynchronous JSONRPC requests can be cancelled on user input
João Távora [Thu, 9 Aug 2018 09:43:41 +0000 (10:43 +0100)]
Synchronous JSONRPC requests can be cancelled on user input

This allows building more responsive interfaces, such as a snappier
completion backend.

* lisp/jsonrpc.el (Version): Bump to 1.0.1
(jsonrpc-connection-receive): Don't warn when continuation isn't
found.
(jsonrpc-request): Add parameters CANCEL-ON-INPUT and
CANCEL-ON-INPUT-RETVAL.

6 years agoMinor pseudovector allocation cleanups
Paul Eggert [Thu, 9 Aug 2018 01:51:35 +0000 (18:51 -0700)]
Minor pseudovector allocation cleanups

* src/alloc.c (VECTOR_BLOCK_SIZE, VECTOR_BLOCK_BYTES)
(VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX):
Prefer enums to macros where either will do.
(allocate_vector_from_block): Arg is ptrdiff_t, not size_t.
Use eassume instead of eassert.
(PSEUDOVEC_STRUCT): New macro, which verifies the already-existing
assumption that the vector-like objects are small.
(cleanup_vector): Use it.  Use if-then-else systematically;
this lets GCC do a bit better job.

2018-08-08  Paul Eggert  <eggert@cs.ucla.edu>

* src/alloc.c (VBLOCK_BYTES_MAX): Use vroundup_ct, not
vroundup, so that can be used in static assertions.

6 years agoFix mod-test-sum-test for bignums
Tom Tromey [Wed, 8 Aug 2018 23:34:42 +0000 (17:34 -0600)]
Fix mod-test-sum-test for bignums

* test/src/emacs-module-tests.el (mod-test-sum-test): Update
for bignums.

6 years agoHandle leading "+" when converting string to bignum
Tom Tromey [Wed, 8 Aug 2018 23:33:24 +0000 (17:33 -0600)]
Handle leading "+" when converting string to bignum

* src/lread.c (string_to_number): Skip leading "+" when calling
make_bignum_str.

6 years agoUse mpz_import in mpz_set_uintmax_slow
Tom Tromey [Wed, 8 Aug 2018 23:01:55 +0000 (17:01 -0600)]
Use mpz_import in mpz_set_uintmax_slow

* src/alloc.c (mpz_set_uintmax_slow): Use mpz_import.

6 years agoMake purecopy work for bignums
Tom Tromey [Wed, 8 Aug 2018 23:01:14 +0000 (17:01 -0600)]
Make purecopy work for bignums

* src/alloc.c (make_pure_bignum): New function.
(purecopy): Use it.

6 years ago; Fix typos in commentary
Charles A. Roelli [Wed, 8 Aug 2018 19:26:33 +0000 (21:26 +0200)]
; Fix typos in commentary

* src/xdisp.c (windows_or_buffers_changed, update_mode_lines)
(get_phys_cursor_geometry, display_echo_area_1)
(resize_mini_window_1):
* src/dispextern.h (struct it): Fix typos in commentary.

6 years agoFix problems in tramp-tests
Michael Albinus [Wed, 8 Aug 2018 17:57:54 +0000 (19:57 +0200)]
Fix problems in tramp-tests

* test/lisp/net/tramp-tests.el (tramp-test45-unload): Filter out
tramp-archive objects.  (Bug#32304)

* test/lisp/net/tramp-tests.el (tramp-test43-auto-load):
Add skip condition.  (Bug#32304)
(tramp-test43-unload): Tag as :unstable.

6 years ago; More instrumentation for shadowfile-tests.el
Michael Albinus [Wed, 8 Aug 2018 14:22:23 +0000 (16:22 +0200)]
; More instrumentation for shadowfile-tests.el

6 years agoFilter out tramp-archive objects in tramp-test45-unload
Michael Albinus [Wed, 8 Aug 2018 13:38:10 +0000 (15:38 +0200)]
Filter out tramp-archive objects in tramp-test45-unload

* test/lisp/net/tramp-tests.el (tramp-test45-unload): Filter out
tramp-archive objects.  (Bug#32304)

6 years agoTag expensive tests in tramp-archive.el (Bug#30807)
Michael Albinus [Wed, 8 Aug 2018 12:59:56 +0000 (14:59 +0200)]
Tag expensive tests in tramp-archive.el  (Bug#30807)

* test/lisp/net/tramp-archive-tests.el (tramp-archive-test44-auto-load)
(tramp-archive-test44-delay-load): Rename.
(tramp-archive-test07-file-exists-p)
(tramp-archive-test08-file-local-copy)
(tramp-archive-test09-insert-file-contents)
(tramp-archive-test11-copy-file)
(tramp-archive-test15-copy-directory)
(tramp-archive-test16-directory-files)
(tramp-archive-test17-insert-directory)
(tramp-archive-test18-file-attributes)
(tramp-archive-test19-directory-files-and-attributes)
(tramp-archive-test20-file-modes)
(tramp-archive-test21-file-links)
(tramp-archive-test26-file-name-completion)
(tramp-archive-test44-auto-load)
(tramp-archive-test44-delay-load): Tag them as :expensive-test,
because they run longer than 10 seconds.  (Bug#30807)

6 years agoMore macro renamings for bignum
Tom Tromey [Wed, 8 Aug 2018 00:08:53 +0000 (18:08 -0600)]
More macro renamings for bignum

* src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c,
src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c,
src/category.c, src/ccl.c, src/character.c, src/character.h,
src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c,
src/composite.c, src/composite.h, src/data.c, src/dbusbind.c,
src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c,
src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c,
src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c,
src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c,
src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c,
src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c,
src/indent.c, src/insdel.c, src/intervals.c, src/json.c,
src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h,
src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c,
src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c,
src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c,
src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c,
src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c,
src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h,
src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c,
src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c,
src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c
Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.

6 years agoAvoid segfaults in jason-serialize on MS-Windows
Eli Zaretskii [Tue, 7 Aug 2018 14:28:35 +0000 (17:28 +0300)]
Avoid segfaults in jason-serialize on MS-Windows

* src/json.c (Fjson_serialize): Free the string with
'json_free', not 'free', since it was allocated with
'json_malloc'.  (Bug#32381)

6 years agoFix todo-mode bug involving active region (bug#32379)
Stephen Berman [Mon, 6 Aug 2018 21:52:47 +0000 (23:52 +0200)]
Fix todo-mode bug involving active region (bug#32379)

* lisp/calendar/todo-mode.el (todo-forward-category)
(todo-jump-to-category, todo-toggle-view-done-items)
(todo-toggle-view-done-only, todo-edit-quit, todo-search)
(todo-go-to-source-item, todo-diary-goto-entry): Deactivate the
mark when the region is active.

6 years agoCorrect and improve part of previous todo-mode.el fix
Stephen Berman [Mon, 6 Aug 2018 17:59:25 +0000 (19:59 +0200)]
Correct and improve part of previous todo-mode.el fix

* lisp/calendar/todo-mode.el (todo-jump-to-category): Improve code
by using bound-and-true-p.  This leaves a byte-compiler warning
unsilenced, but ideally, there shouldn't be a warning here (see
https://lists.gnu.org/archive/html/emacs-devel/2018-08/msg00131.html).
(todo--fifiles-history): New variable.
(todo-find-filtered-items-file): Use it to fix the filtered items
files history list for completing-read.

6 years agoFix the MS-Windows build as followup to Gnulib regex import
Eli Zaretskii [Mon, 6 Aug 2018 14:50:55 +0000 (17:50 +0300)]
Fix the MS-Windows build as followup to Gnulib regex import

* lib-src/ntlib.c (nl_langinfo): New function.  (Bug#32194)

6 years agoSpruce up some regex-emacs comments
Paul Eggert [Mon, 6 Aug 2018 01:41:21 +0000 (18:41 -0700)]
Spruce up some regex-emacs comments

* src/regex-emacs.c, src/regex-emacs.h: Update comments.

6 years agoRemove always-0 struct re_pattern_buffer members
Paul Eggert [Mon, 6 Aug 2018 01:41:21 +0000 (18:41 -0700)]
Remove always-0 struct re_pattern_buffer members

* src/regex-emacs.h (struct re_pattern_buffer):
Remove no_sub, not_bol, not_eol.  They are always zero.
All uses removed, and code simplified.

6 years agoSimplify regex-emacs by assuming Emacs syntax
Paul Eggert [Mon, 6 Aug 2018 01:41:20 +0000 (18:41 -0700)]
Simplify regex-emacs by assuming Emacs syntax

* src/regex-emacs.c (reg_syntax_t)
(RE_BACKSLASH_ESCAPE_IN_LISTS, RE_BK_PLUS_QM)
(RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS)
(RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS)
(RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE)
(RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT)
(RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS)
(RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES)
(RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING)
(RE_NO_GNU_OPS, RE_FRUGAL, RE_SHY_GROUPS)
(RE_NO_NEWLINE_ANCHOR, RE_SYNTAX_EMACS, RE_TRANSLATE_P):
Remove.  All uses removed and resulting code simplified.
(TRANSLATE): Treat nil as an absent translation table, not zero.
All uses changed.

6 years agoSimplify regex-emacs code by assuming Emacs
Paul Eggert [Mon, 6 Aug 2018 01:41:20 +0000 (18:41 -0700)]
Simplify regex-emacs code by assuming Emacs

* src/regex-emacs.c: Omit no-longer-needed AIX code.
Don’t ignore GCC warnings.
Include regex-emacs.h immediately after config.h,
to test that it’s independent.
Omit the "#ifndef emacs" and "#ifdef REGEX_MALLOC" and
"#if WIDE_CHAR_SUPPORT" or "#ifdef _REGEX_RE_COMP",
code, as we are no longer interested in compiling outside
Emacs (with or without debugging or native wide char support)
or in avoiding alloca.
(REGEX_EMACS_DEBUG, regex_emacs_debug): Rename from DEBUG and debug,
to avoid collision with other DEBUGS.  All uses changed.
In debugging output, change %ld and %zd to %zu when appropriate.
No need to include stddef.h, stdlib.h, sys/types.h, wchar.h,
wctype.h, locale/localeinfo.h, locale/elem-hash.h, langinfo.h,
libintl.h, unistd.h, stdbool.h, string.h, stdio.h, assert.h.
All uses of assert changed to eassert.
(RE_DUP_MAX, reg_syntax_t, RE_BACKSLASH_ESCAPE_IN_LISTS)
(RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS)
(RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS, RE_DOT_NEWLINE)
(RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE, RE_INTERVALS)
(RE_LIMITED_OPS, RE_NEWLINE_ALT, RE_NO_BK_BRACES)
(RE_NO_BK_PARENS, RE_NO_BK_REFS, RE_NO_BK_VBAR)
(RE_NO_EMPTY_RANGES, RE_UNMATCHED_RIGHT_PAREN_ORD)
(RE_NO_POSIX_BACKTRACKING, RE_NO_GNU_OPS, RE_FRUGAL)
(RE_SHY_GROUPS, RE_NO_NEWLINE_ANCHOR, RE_SYNTAX_EMACS)
(REG_NOERROR, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE)
(REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN)
(REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT)
(REG_EEND, REG_ESIZE, REG_ERPAREN, REG_ERANGEX, REG_ESIZEBR)
(reg_errcode_t, REGS_UNALLOCATED, REGS_REALLOCATE, REGS_FIXED)
(RE_NREGS, RE_TRANSLATE, RE_TRANSLATE_P):
Move here from regex-emacs.h.
(RE_NREGS): Define unconditionally.
(boolean): Remove.  All uses replaced by bool.
(WIDE_CHAR_SUPPORT, regfree, regexec, regcomp, regerror):
(re_set_syntax, re_syntax_options, WEAK_ALIAS, gettext, gettext_noop):
Remove.  All uses removed.
(malloc, realloc, free): Do not redefine.  Adjust all callers
to use xmalloc, xrealloc, xfree instead.
(re_error_msgid): Use C99 to avoid need to keep in same order
as reg_error_t.
(REGEX_USE_SAFE_ALLOCA): Simplify by using USE_SAFE_ALLOCA.
(REGEX_ALLOCATE, REGEX_REALLOCATE, REGEX_FREE, REGEX_ALLOCATE_STACK)
(REGEX_REALLOCATE_STACK, REGEX_FREE_STACK): Remove.
All callers changed to use the non-REGEX_MALLOC version.
(REGEX_TALLOC): Remove.  All callers changed to use SAFE_ALLOCA.
(re_set_syntax): Remove; unused.
(MATCH_MAY_ALLOCATE): Remove; now always true.  All uses simplified.
(INIT_FAILURE_ALLOC): Define unconditionally.
(re_compile_fastmap): Now static.
(re_compile_pattern): Avoid unnecessary cast.
* src/regex-emacs.h (EMACS_REGEX_H): Renamed from _REGEX_H to
avoid possible collision with glibc.
Don’t include sys/types.h.  All uses of ssize_t changed to ptrdiff_t.
Don’t worry about C++ or VMS.
Assume emacs is defined and that _REGEX_RE_COMP and WIDE_CHAR_SUPPORT
are not.
Define struct re_registers before including lisp.h.
(REG_ENOSYS, RE_TRANSLATE_TYPE): Remove; all uses replaced by
Lisp_Object.
(regoff_t): Remove.  All uses replaced with ptrdiff_t.
(re_match, regcomp, regexec, regerror, regfree):
Remove decl of nonexistent functions.
(RE_DEBUG, RE_SYNTAX_AWK, RE_SYNTAX_GNU_AWK)
(RE_SYNTAX_POSIX_AWK, RE_SYNTAX_GREP, RE_SYNTAX_EGREP)
(RE_SYNTAX_POSIX_EGREP, RE_SYNTAX_ED, RE_SYNTAX_SED)
(_RE_SYNTAX_POSIX_COMMON, RE_SYNTAX_POSIX_BASIC)
(RE_SYNTAX_POSIX_MINIMAL_BASIC, RE_SYNTAX_POSIX_EXTENDED)
(RE_SYNTAX_POSIX_MINIMAL_EXTENDED, REG_EXTENDED, REG_ICASE)
(REG_NEWLINE, REG_NOSUB, REG_NOTBOL, REG_NOTEOL, regmatch_t):
Remove; unused.
* src/search.c (Fset_match_data): Simplify range test now that
we know it’s ptrdiff_t.

6 years agoUse Gnulib regex for lib-src
Paul Eggert [Mon, 6 Aug 2018 01:41:20 +0000 (18:41 -0700)]
Use Gnulib regex for lib-src

Emacs regular expressions forked from everyone else long ago.
This makes it official and should allow simplification later.
etags.c now uses the glibc regex API, falling back on a
Gnulib-supplied substitute lib/regex.c if necessary.
Emacs proper now uses its own regular expression module.
Although this patch may look dauntingly large, most of it
was generated automatically by admin/merge-gnulib
and contains an exact copy of the glibc regex source,
and the by-hand changes do not grow the Emacs source code.
* admin/merge-gnulib (GNULIB_MODULES): Add regex.
(AVOIDED_MODULES): Add btowc, langinfo, lock, mbrtowc, mbsinit,
nl_langinfo, wchar, wcrtomb, wctype-h.
* lib-src/Makefile.in (regex-emacs.o): Remove; Gnulib does it now.
(etags_deps, etags_libs): Remove regex-emacs.o.
* lib-src/etags.c: Go back to including regex.h.
(add_regex): Use unsigned char translation array,
since glibc regex requires that.
* lib/Makefile.in (not_emacs_OBJECTS, for_emacs_OBJECTS): New macros.
(libegnu_a_OBJECTS): Use them, to avoid building e-regex.o.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/regcomp.c, lib/regex.c, lib/regex.h, lib/regex_internal.c:
* lib/regex_internal.h, lib/regexec.c, m4/builtin-expect.m4:
* m4/eealloc.m4, m4/glibc21.m4, m4/mbstate_t.m4, m4/regex.m4:
New files, copied from Gnulib.
* src/regex-emacs.h, src/conf_post.h:
(RE_TRANSLATE_TYPE, RE_TRANSLATE, RE_TRANSLATE_P):
Move from src/conf_post.h to src/regex-emacs.h,
so that they don’t interfere with compiling lib/regex.c.

6 years agoRename src/regex.c to src/regex-emacs.c.
Paul Eggert [Mon, 6 Aug 2018 01:41:20 +0000 (18:41 -0700)]
Rename src/regex.c to src/regex-emacs.c.

This is in preparation for using Gnulib regex for etags,
to avoid collisions in include directives.
* src/regex-emacs.c: Rename from src/regex.c.
* src/regex-emacs.h: Rename from src/regex.h.  All uses changed.
* test/src/regex-emacs-tests.el: Rename from test/src/regex-tests.el.

6 years agoUpdate from gnulib
Paul Eggert [Mon, 6 Aug 2018 00:40:22 +0000 (17:40 -0700)]
Update from gnulib

This incorporates:
2018-08-05 Fix link error regarding 'rpl_environ'
* build-aux/config.guess, lib/unistd.in.h, lib/warn-on-use.h:
* m4/extern-inline.m4: Copy from Gnulib.

6 years agoFix test and comment in CCL change
Andy Moreton [Sun, 5 Aug 2018 18:56:33 +0000 (12:56 -0600)]
Fix test and comment in CCL change

* lisp/international/ccl.el (ccl-fixnum): Update comment.
* test/lisp/international/ccl-tests.el (prog-midi-dump): Add
trailing space to expected result.

6 years ago; * src/xdisp.c: Fix typo.
Charles A. Roelli [Sun, 5 Aug 2018 15:39:38 +0000 (17:39 +0200)]
; * src/xdisp.c: Fix typo.

6 years agoFix mh-redistribute to work with nmh 1.5 and identities (SF#268)
Mike Kupfer [Sun, 5 Aug 2018 01:06:37 +0000 (18:06 -0700)]
Fix mh-redistribute to work with nmh 1.5 and identities (SF#268)

Co-authored-by: Jeffrey C Honig <jch@honig.net>
* lisp/mh-e/mh-comp.el (mh-redistribute): Add a non-optional
identity parameter.  Use mh-bare-components to generate a draft,
then apply identity-specific settings.  Add more details to the
"Resent" annotation line.
(mh-dist-formfile): New.
(mh-bare-components): Add a formfile argument.
(mh-edit-again, mh-send-sub): Track the change to
mh-bare-components.
* lisp/mh-e/mh-identity.el (mh-select-identity)
(mh-identity-field): New.

6 years agoFix hash functions for bignums
Tom Tromey [Sat, 4 Aug 2018 17:08:31 +0000 (11:08 -0600)]
Fix hash functions for bignums

* src/fns.c (cmpfn_eql, hashfn_eql): Handle bignums.
(sxhash_bignum): New function.
(sxhash): Use it.
* test/src/fns-tests.el (test-bignum-hash): New test.

6 years agoFix bignum comparisons with NaN
Tom Tromey [Sat, 4 Aug 2018 16:50:35 +0000 (10:50 -0600)]
Fix bignum comparisons with NaN

* src/data.c (isnan): Move earlier.
(bignumcompare): Explicitly handle NaN.
* test/src/data-tests.el (data-tests-min): Add NaN tests
for bignum.
(data-check-sign): Fix for previous patch.
* test/src/fns-tests.el (test-bignum-eql): Add NaN test.

6 years agoMake bignums work better when EMACS_INT is larger than long
Andy Moreton [Sat, 4 Aug 2018 16:28:13 +0000 (10:28 -0600)]
Make bignums work better when EMACS_INT is larger than long

* lisp/international/ccl.el (ccl-fixnum): New function.
(ccl-embed-data, ccl-embed-current-address, ccl-dump): Use it.
* src/alloc.c (make_number): Handle case where EMACS_INT is
larger than long.
* src/data.c (bignumcompare): Handle case where EMACS_INT is
larger than long.
(arith_driver): Likewise.  Coerce markers.
(float_arith_driver): Coerce markers.
(Flogcount): Use mpz_sgn.
(ash_lsh_impl): Fix bugs.
(Fsub1): Fix underflow check.
* src/lisp.h (NUMBERP): Don't check BIGNUMP.
(CHECK_FIXNUM_OR_FLOAT_COERCE_MARKER): Fix indentation.
* test/lisp/international/ccl-tests.el: New file.

6 years agoFix assorted todo-mode bugs (bug#32366)
Stephen Berman [Sat, 4 Aug 2018 16:06:18 +0000 (18:06 +0200)]
Fix assorted todo-mode bugs (bug#32366)

* lisp/calendar/todo-mode.el (todo-forward-category): Fix
calculation for skipping backward over archived categories.
(todo-jump-to-category): When hl-line-mode is enabled, force
highlighting to compensate for apparent failure of
post-command-hook to run.
(todo-insert-item--basic): Prevent inserting a new todo item in an
archive category.
(todo-delete-item): Ensure done items separator disappears when
the last done item is deleted.
(todo-edit-item--header): Fix calculation for choosing a month
prior to the current one.
(todo-find-filtered-items-file): Fix use of completing-read,
correcting typo in default value passed to it and confining
history to filtered items files.
(todo-go-to-source-item): Make a noop when point is not on an item.
(todo-save-filtered-items-buffer): Make buffer read-only after
saving and improve buffer name.
(todo-key-bindings-t+a+f): Remove three mistakenly included bindings.
(todo-key-bindings-t+a): Add two mistakenly omitted bindings.

6 years ago; (read-answer-short): Fix :version setting for backport
Noam Postavsky [Sat, 4 Aug 2018 16:00:43 +0000 (12:00 -0400)]
; (read-answer-short): Fix :version setting for backport

6 years ago; etc/NEWS: Remove read-answer, it was backported to v26
Noam Postavsky [Tue, 31 Jul 2018 01:02:07 +0000 (21:02 -0400)]
; etc/NEWS: Remove read-answer, it was backported to v26

6 years agoRespect non-saved value of `read-short-answer' (Bug#31782)
Noam Postavsky [Thu, 5 Jul 2018 02:51:45 +0000 (22:51 -0400)]
Respect non-saved value of `read-short-answer' (Bug#31782)

* lisp/emacs-lisp/map-ynp.el (read-answer-short): Add an `auto'
setting.
(read-answer): Check the function cell of `yes-or-no-p' when
`read-answer-short' is `auto' rather than calling
`custom-reevaluate-setting' which would reset the option to its saved
value.

6 years ago; Merge from emacs-26
Noam Postavsky [Sat, 4 Aug 2018 15:55:04 +0000 (11:55 -0400)]
; Merge from emacs-26

The following commit was skipped:

cc233365a9 New function read-answer (Bug#31782)

6 years agoMerge from emacs-26
Noam Postavsky [Sat, 4 Aug 2018 15:55:04 +0000 (11:55 -0400)]
Merge from emacs-26

f0b8e64fb7 Avoid assertion violations in maybe_produce_line_number
7669bf7880 Avoid assertion violations in set_text_properties_1

6 years ago; Merge from emacs-26
Noam Postavsky [Sat, 4 Aug 2018 15:55:03 +0000 (11:55 -0400)]
; Merge from emacs-26

The following commit was skipped:

15458a8301 ; Auto-commit of loaddefs files.

6 years agoMerge from emacs-26
Noam Postavsky [Sat, 4 Aug 2018 15:55:03 +0000 (11:55 -0400)]
Merge from emacs-26

951c5a127f Fix wdired test failure when byte compiled (bug#32318)
0252f7311f * test/lisp/wdired-tests.el (wdired-test-symlink-name): Ne...
dd51434714 Fix url's thing-at-point beginning-op (Bug#32028)

6 years agoNew function read-answer (Bug#31782)
Juri Linkov [Sun, 21 Jan 2018 21:45:43 +0000 (23:45 +0200)]
New function read-answer (Bug#31782)

* lisp/emacs-lisp/map-ynp.el (read-answer-short): New defcustom.
(read-answer): New function.
* lisp/subr.el (assoc-delete-all): New function.
* etc/NEWS: Announce them.

* lisp/dired.el (dired-delete-file): Use read-answer.
(dired--yes-no-all-quit-help): Remove function.
(dired-delete-help): Remove defconst.

(backported from master, "New function read-answer (bug#30073)" and
"Respect non-saved value of `read-short-answer' (Bug#31782)")

6 years ago* lisp/international/mule-cmds.el (universal-coding-system-argument):
Michael Albinus [Sat, 4 Aug 2018 15:26:55 +0000 (17:26 +0200)]
* lisp/international/mule-cmds.el (universal-coding-system-argument):

Use `current-input-mode' for determining quit char.

6 years agoRename Tramp method "owncloud" to "nextcloud"
Michael Albinus [Sat, 4 Aug 2018 10:05:28 +0000 (12:05 +0200)]
Rename Tramp method "owncloud" to "nextcloud"

In the spirit of freedom, "nextcloud" is preferred over "owncloud".

* doc/misc/tramp.texi (Quick Start Guide, GVFS based methods):
* etc/NEWS: Rename "owncloud" method to "nextcloud".

* lisp/net/tramp-gvfs.el (tramp-gvfs-methods, tramp-goa-methods)
(tramp-gvfs-url-file-name, tramp-gvfs-handler-mounted-unmounted)
(tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec)
(tramp-get-goa-accounts): Use "nextcloud" instead of "owncloud".
(tramp-gvfs-nextcloud-default-prefix)
(tramp-gvfs-nextcloud-default-prefix-regexp): Rename them.  Adapt
all callees.

* test/lisp/net/tramp-tests.el (tramp--test-nextcloud-p):
Rename from `tramp--test-owncloud-p'.
(tramp-test11-copy-file, tramp-test12-rename-file): Use it.

6 years agoFix a filenotify test failure on Cygwin
Ken Brown [Fri, 3 Aug 2018 14:37:04 +0000 (10:37 -0400)]
Fix a filenotify test failure on Cygwin

* test/lisp/filenotify-tests.el
(file-notify-test04-autorevert): Increase a sleep-for time
from 2 to 3 on Cygwin.  This avoids sporadic failures of the
test.  (Bug#32363)

6 years agoMerge branch 'scratch/backtrace-mode'
Gemini Lasswell [Fri, 3 Aug 2018 17:28:28 +0000 (10:28 -0700)]
Merge branch 'scratch/backtrace-mode'

6 years agoFix some documentation formatting nits
Gemini Lasswell [Wed, 1 Aug 2018 14:47:12 +0000 (07:47 -0700)]
Fix some documentation formatting nits

* doc/misc/ert.texi (Running Tests Interactively): Correct
Elisp manual titile in xref.
* doc/lispref/edebug.texi (Edebug Misc): Use single argument
form of xref.
* doc/lispref/debugging.texi (Backtraces): Add comma and
period after xref braces.
(Backtraces): Correct Emacs manual title.
(Internals of Debugger): Add a space before period.

6 years agoFix typo in edebug-backtrace-hide-instrumentation's docstring.
Gemini Lasswell [Fri, 27 Jul 2018 19:37:10 +0000 (12:37 -0700)]
Fix typo in edebug-backtrace-hide-instrumentation's docstring.

* lisp/emacs-lisp/edebug.el (edebug-backtrace-hide-instrumentation):
Fix docstring copypasta.

6 years agoGive two backtrace-mode commands better names
Gemini Lasswell [Sat, 21 Jul 2018 19:27:32 +0000 (12:27 -0700)]
Give two backtrace-mode commands better names

* lisp/emacs-lisp/backtrace.el (backtrace-mode-map): Update
bindings and menu items with new function names.
(backtrace-collapse, backtrace-pretty-print)
(backtrace--collapse, backtrace--pretty-print): Remove functions.
(backtrace-single-line, backtrace-multi-line)
(backtrace--single-line, backtrace--multi-line): New functions.
(backtrace--reformat-sexp): Remove 'error-message' argument.
* test/lisp/emacs-lisp/backtrace-tests.el
(backtrace-tests--pretty-print-and-collapse): Remove.
(backtrace-tests--single-and-multi-line): New test.
(backtrace-tests--verify-pp-and-collapse): Remove.
(backtrace-tests--verify-single-and-multi-line): New function.

6 years agoMove 'backtrace' from subr.el to backtrace.el
Gemini Lasswell [Wed, 18 Jul 2018 15:30:45 +0000 (08:30 -0700)]
Move 'backtrace' from subr.el to backtrace.el

* lisp/subr.el (backtrace, backtrace--print-frame): Remove functions.
* lisp/emacs-lisp/backtrace.el (backtrace-backtrace): Remove function.
(backtrace): New function.
(backtrace-to-string): Make argument optional.
* doc/lispref/debugging.texi (Internals of Debugger): Update
description of 'backtrace' function.

6 years agoAdd new commands to Edebug backtraces
Gemini Lasswell [Tue, 17 Jul 2018 18:47:43 +0000 (11:47 -0700)]
Add new commands to Edebug backtraces

Add commands to go to source if available, and to show and hide
Edebug's instrumentation.  Make Edebug pop to backtraces instead of
displaying them, which makes Edebug consistant with the behavior of
ERT and the Lisp Debugger.
* doc/lispref/edebug.texi (Edebug Misc): Document when and how you can
jump to source code from an Edebug backtrace.  Document
'edebug-backtrace-show-instrumentation' and
'edebug-backtrace-hide-instrumentation'.
* lisp/emacs-lisp/backtrace.el (backtrace-frame): Add comments to
describe the fields.
(backtrace-goto-source-functions): New
abnormal hook.
(backtrace-mode-map): Add keybinding and menu item for
backtrace-goto-source.
(backtrace--flags-width): New constant.
(backtrace-update-flags): Use it.
(backtrace-goto-source): New command.
(backtrace--print-flags): Print the :source-available flag.
* lisp/emacs-lisp/edebug.el (edebug-backtrace-frames)
(edebug-instrumented-backtrace-frames): New variables.
(edebug-backtrace, edebug--backtrace-frames): Remove functions.
(edebug-pop-to-backtrace, edebug--backtrace-goto-source)
(edebug--add-source-info): New functions.
(edebug-mode-map, edebug-mode-menus): Replace 'edebug-backtrace' with
'edebug-pop-to-backtrace'.
(edebug--strip-instrumentation): New function.
(edebug--unwrap-and-add-info): Remove.
(edebug-unwrap-frame, edebug-add-source-info): New functions.
(edebug-backtrace-show-instrumentation)
(edebug-backtrace-hide-instrumentation): New commands.
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-check-keymap):
Verify keybindings in backtrace-mode-map used by new test.
Update with binding for 'edebug-pop-to-backtrace'.
(edebug-tests-backtrace-goto-source): New test.
* test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
(edebug-test-code-range): Add a new stop point.

6 years agoAdd a menu for backtrace-mode
Gemini Lasswell [Sun, 15 Jul 2018 22:45:43 +0000 (15:45 -0700)]
Add a menu for backtrace-mode

* lisp/emacs-lisp/backtrace.el (backtrace-mode-map): Add a menu.
* lisp/emacs-lisp/debug.el (debugger-mode-map): Change menu text for
'backtrace-help-follow-symbol' to better describe what it does.

6 years ago* lisp/emacs-lisp/debug.el (debugger-mode-map): Use easy-menu-define.
Gemini Lasswell [Sun, 15 Jul 2018 22:41:56 +0000 (15:41 -0700)]
* lisp/emacs-lisp/debug.el (debugger-mode-map): Use easy-menu-define.

6 years agoAdd new command to expand all "..."s in a backtrace frame
Gemini Lasswell [Sat, 14 Jul 2018 15:05:51 +0000 (08:05 -0700)]
Add new command to expand all "..."s in a backtrace frame

* doc/lispref/debugging.texi (Backtraces): Document new keybinding.
* lisp/emacs-lisp/backtrace.el (backtrace-line-length): Add the
option of unlimited line length.
(backtrace--match-ellipsis-in-string): Add a comment to explain
why this function is necessary.
(backtrace-mode-map): Add keybinding for 'backtrace-expand-ellipses'.
(backtrace-expand-ellipsis): Use 'cl-print-to-string-with-limit'.
(backtrace-expand-ellipses): New command.
(backtrace-print-to-string): Use 'cl-print-to-string-with-limit'.
Tag the printed forms with a gensym instead of the values of
print-length and print-level.
(backtrace--print): Add 'stream' argument.
* test/lisp/emacs-lisp/backtrace-tests.el
(backtrace-tests--expand-ellipsis): Make the test less dependent
on the implementation.
(backtrace-tests--expand-ellipses): New test.

Move the fitting of a printed representation into a limited number of
characters using appropriate values of print-level and print-length
from 'backtrace-print-to-string' to cl-print.el for future use by
other parts of Emacs.
* lisp/emacs-lisp/cl-print.el (cl-print-to-string-with-limit): New
function.
* test/lisp/emacs-lisp/cl-print-tests.el
(cl-print-tests-print-to-string-with-limit): New test.

6 years agoChange keybinding for backtrace-collapse from '=' to '-'
Gemini Lasswell [Sat, 14 Jul 2018 14:23:15 +0000 (07:23 -0700)]
Change keybinding for backtrace-collapse from '=' to '-'

'+' and '-' make a more intuitive pair of keybindings for
backtrace-pretty-print and backtrace-collapse than '+' and '='.
* lisp/emacs-lisp/backtrace.el (backtrace-mode-map):
* doc/lispref/debugging.texi (Backtraces): Change
keybinding for backtrace-collapse.

6 years agoAdd more tests for backtrace-mode
Gemini Lasswell [Sat, 30 Jun 2018 15:45:53 +0000 (08:45 -0700)]
Add more tests for backtrace-mode

* test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--variables)
(backtrace-tests--backward-frame, backtrace-tests--forward-frame)
(backtrace-tests--pretty-print-and-collapse)
(backtrace-tests--verify-pp-and-collapse)
(backtrace-tests--print-circle, backtrace-tests--make-regexp)
(backtrace-tests--expand-ellipsis): New tests.
(backtrace-tests--to-string): Use backtrace-tests--make-backtrace.
(backtrace-tests--get-substring): New function.

Change the method of generating sample backtraces in backtrace tests
to work whether or not the tests are byte-compiled.
* test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--func1)
(backtrace-tests--func2, backtrace-tests--func3)
(backtrace-tests--create-backtrace-frames): Remove.
(backtrace-tests--uncompiled-functions): New constant.
(backtrace-tests--make-backtrace, backtrace-tests--setup-buffer):
New functions.
(backtrace-tests--backtrace-lines)
(backtrace-tests--backtrace-lines-with-locals): New functions.
(backtrace-tests--line-count): New constant.
(backtrace-tests--result, backtrace-tests--result-with-locals):
New functions.
(backtrace-tests--header): New constant.
(backtrace-tests--insert-header): Use backtrace-tests--header.
(backtrace-tests--with-buffer): Remove.

6 years agoAdd link in backtraces to position in buffer being evaluated (bug#14081)
Gemini Lasswell [Sat, 7 Jul 2018 19:48:18 +0000 (12:48 -0700)]
Add link in backtraces to position in buffer being evaluated (bug#14081)

* lisp/emacs-lisp/backtrace.el (backtrace-frame): Add buffer field.
(backtrace-get-frames): Set buffer field of frame.
(backtrace-buffer-pos): New button type.
(backtrace--pop-to-buffer-pos): New function.
(backtrace--print-func-and-args): Create a button for the buffer
position if it is set.

6 years agoAdd links in backtraces to functions written in C (bug#25393)
Gemini Lasswell [Mon, 25 Jun 2018 20:23:03 +0000 (13:23 -0700)]
Add links in backtraces to functions written in C (bug#25393)

* lisp/emacs-lisp/backtrace.el (backtrace--print-func-and-args):
Look up file names for built-in functions with evaluated arguments.

6 years agoAdd prefix argument to backtrace-toggle-print-circle
Gemini Lasswell [Sat, 23 Jun 2018 17:25:29 +0000 (10:25 -0700)]
Add prefix argument to backtrace-toggle-print-circle

With prefix argument, toggle print-circle for the whole buffer.
* lisp/emacs-lisp/backtrace.el (backtrace-toggle-print-circle): Add
universal prefix argument.
(backtrace--toggle-feature): Add new argument 'all' to toggle all
frames.
(backtrace--set-feature): New function.
(backtrace-mode): Use indent functions from Lisp modes.

6 years agoLazily print backtrace frame local variables
Gemini Lasswell [Fri, 22 Jun 2018 19:53:37 +0000 (12:53 -0700)]
Lazily print backtrace frame local variables

Instead of printing the local variables for all frames when the
backtrace buffer is created, print them when they are first made
visible.  Add a prefix argument to backtrace-toggle-locals to toggle
local variables display for the entire buffer.
* lisp/emacs-lisp/backtrace.el (backtrace-view): Mention
:show-locals in docstring.
(backtrace-get-section-end): Remove function.
(backtrace-toggle-locals): Add prefix argument.
(backtrace--with-output-variables): Move before first use.
(backtrace--set-frame-locals-visible): New function.
(backtrace--set-locals-visible-overlay): New function.
(backtrace--set-locals-visible): Remove function.
(backtrace-toggle-feature): Remove TODO comment.
(backtrace--print-locals): Skip printing the locals if they are not
visible.

6 years agoAlways make buttons from function names in backtraces
Gemini Lasswell [Sun, 24 Jun 2018 14:17:47 +0000 (07:17 -0700)]
Always make buttons from function names in backtraces

* lisp/emacs-lisp/backtrace.el (backtrace-view)
(backtrace--print-func-and-args, backtrace-mode): Always
make buttons.  Remove all uses of ':do-xrefs'.
* lisp/emacs-lisp/debug.el (debugger-setup-buffer): Modify
backtrace-view instead of setting it.
* lisp/emacs-lisp/edebug.el (edebug-backtrace):
* lisp/emacs-lisp/ert.el
(ert-results-pop-to-backtrace-for-test-at-point):
Remove initialization of backtrace-view.

6 years agoAdd backtrace-mode and use it in the debugger, ERT and Edebug
Gemini Lasswell [Tue, 19 Jun 2018 14:27:41 +0000 (07:27 -0700)]
Add backtrace-mode and use it in the debugger, ERT and Edebug

* doc/lispref/debugging.texi (Using Debugger): Remove explanation of
backtrace buffer.  Refer to new node.
(Backtraces): New node.
(Debugger Commands): Refer to new node.  Remove 'v'.
* doc/lispref/edebug.texi (Edebug Misc): Refer to new node.
* doc/misc/ert.texi (Running Tests Interactively): Refer to new node.

* lisp/emacs-lisp-backtrace.el: New file.
* test/lisp/emacs-lisp/backtrace-tests.el: New file.

* lisp/emacs-lisp/debug.el: (debugger-buffer-state): New cl-defstruct.
(debugger--restore-buffer-state): New function.
(debug): Use a debugger-buffer-state object to save and restore buffer
state.  Fix bug#15749 by leaving an unused buffer in debugger-mode,
empty, instead of in fundamental-mode, and then when reusing a buffer,
not calling debugger-mode if the buffer is already in debugger-mode.
(debugger-insert-backtrace): Remove.
(debugger-setup-buffer): Use backtrace-mode.
(debugger--insert-header): New function.
(debugger-continue, debugger-return-value): Change check for flags to
use backtrace-frames.
(debugger-frame-number): Determine backtrace frame number from
backtrace-frames.
(debugger--locals-visible-p, debugger--insert-locals)
(debugger--show-locals, debugger--hide-locals)
(debugger-toggle-locals): Remove.
(debugger-mode-map): Make a child of backtrace-mode-map.  Move
navigation commands to backtrace-mode-map.  Bind 'q' to debugger-quit
instead of top-level.  Make Help Follow menu item call
backtrace-help-follow-symbol.
(debugger-mode): Derive from backtrace-mode.
(debug-help-follow): Remove.  Move body of this function to
'backtrace-help-follow-symbol' in backtrace.el.
(debugger-quit): New function.

* lisp/emacs-lisp/edebug.el (edebug-unwrap-results): Remove warning
in docstring about circular results.
(edebug-unwrap): Use pcase.
(edebug-unwrap1): New function to unwrap circular objects.
(edebug-unwrap*): Use it.
(edebug--frame): New cl-defstruct.
(edebug-backtrace): Call the buffer *Edebug Backtrace* and use
backtrace-mode.  Get the frames from edebug--backtrace-frames.
(edebug--backtrace-frames, edebug--unwrap-and-add-info)
(edebug--symbol-not-prefixed-p): New functions.

* lisp/emacs-lisp/lisp-mode.el
(lisp-el-font-lock-keywords-for-backtraces)
(lisp-el-font-lock-keywords-for-backtraces-1)
(lisp-el-font-lock-keywords-for-backtraces-2): New constants.

* lisp/emacs-lisp/ert.el (ert--print-backtrace): Remove.
(ert--run-test-debugger): Use backtrace-get-frames.
(ert-run-tests-batch): Use backtrace-to-string.
(ert-results-pop-to-backtrace-for-test-at-point): Use backtrace-mode.
(ert--insert-backtrace-header): New function.

* tests/lisp/emacs-lisp/ert-tests.el (ert-test--which-file):
Use backtrace-frame slot accessor.

6 years agoAdd methods for strings to cl-print
Gemini Lasswell [Fri, 15 Jun 2018 17:26:13 +0000 (10:26 -0700)]
Add methods for strings to cl-print

* lisp/emacs-lisp/cl-print.el (cl-print-object) <string>: New method.
(cl-print-object-contents) <string>: New method.
(cl-print--find-sharing): Look in string property lists.

* test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-3): Test
printing of long strings.
(cl-print-tests-4): Test printing of strings nested in other objects.
(cl-print-tests-strings, cl-print-tests-ellipsis-string): New
tests.

6 years agoSupport ellipsis expansion in cl-print
Gemini Lasswell [Fri, 15 Jun 2018 17:23:58 +0000 (10:23 -0700)]
Support ellipsis expansion in cl-print

* lisp/emacs-lisp/cl-print.el (cl-print-object-contents): New
generic method.
(cl-print-object-contents) <cons, vector,cl-structure-object>: New
methods.
(cl-print-object) <cons>: Use cl-print-insert-ellipsis.
(cl-print-object) <vector, cl-structure-object>: Elide whole object if
print-level exceeded.  Use cl-print-insert-ellipsis.
(cl-print-insert-ellipsis, cl-print-propertize-ellipsis)
(cl-print-expand-ellipsis): New functions.

* test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-4): Test
printing of objects nested in other objects.
(cl-print-tests-strings, cl-print-tests-ellipsis-cons)
(cl-print-tests-ellipsis-vector, cl-print-tests-ellipsis-struct)
(cl-print-tests-ellipsis-circular): New tests.
(cl-print-tests-check-ellipsis-expansion)
(cl-print-tests-check-ellipsis-expansion-rx): New functions.

6 years agoAvoid assertion violations in maybe_produce_line_number
Eli Zaretskii [Thu, 2 Aug 2018 13:58:44 +0000 (16:58 +0300)]
Avoid assertion violations in maybe_produce_line_number

* src/xdisp.c (redisplay_window): Make sure desired_matrix is
cleared before calling try_window.  This is important when
display-line-numbers is non-nil, because line-number display code
assumes each glyph row is completely cleared when it is called to
produce a line number.  (Bug#32358)

6 years agoAvoid assertion violations in set_text_properties_1
Eli Zaretskii [Thu, 2 Aug 2018 13:29:54 +0000 (16:29 +0300)]
Avoid assertion violations in set_text_properties_1

* src/textprop.c (set_text_properties): If the call to
modify_text_properties modifies the interval tree as side effect,
recalculate the correct interval for START and END.  (Bug#32265)

6 years agoNew commands to create an empty file
Tino Calancha [Thu, 2 Aug 2018 04:20:46 +0000 (13:20 +0900)]
New commands to create an empty file

Similarly as `create-directory', `dired-create-directory',
the new commands create the parent dirs as needed (Bug#24150).
* lisp/files.el (make-empty-file): New command.

* lisp/dired-aux.el (dired-create-empty-file): New command.
(dired--find-topmost-parent-dir): New function extracted
from `dired-create-directory'.
(dired-create-directory, dired-create-empty-file): Use it.

* lisp/dired.el (dired-mode-map):
Add menu entry for `dired-create-empty-file'.

* doc/emacs/dired.texi (Misc Dired Features)
* doc/lispref/files.texi (Create/Delete Dirs): Update manual.
; * etc/NEWS: Announce the changes.

6 years agoSubstitute a <ieee754.h> on hosts lacking it
Paul Eggert [Thu, 2 Aug 2018 01:53:31 +0000 (18:53 -0700)]
Substitute a <ieee754.h> on hosts lacking it

* .gitignore: Add lib/ieee754.h.
* admin/merge-gnulib (GNULIB_MODULES): Add ieee754-h.
* configure.ac: Remove ieee754.h check, as Gnulib now does that.
* etc/NEWS: Mention this.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/ieee754.in.h, m4/ieee754-h.m4: New files, from Gnulib.
* src/lisp.h (IEEE_FLOATING_POINT): Now a macro so that it
can be used in #if.
* src/lread.c, src/print.c: Include <ieee754.h> if
IEEE_FLOATING_POINT, not if HAVE_IEEE754_H.
* src/lread.c (string_to_number):
* src/print.c (float_to_string):
Process NaNs only on IEEE hosts, and assume <ieee754.h>
in that case.

6 years agoFix Bug#32325
Michael Albinus [Wed, 1 Aug 2018 21:09:31 +0000 (23:09 +0200)]
Fix Bug#32325

* lisp/net/tramp-sh.el (tramp-sh-handle-make-directory): In case
of PARENTS flush also upper directories caches.  (Bug#32325)

6 years agoFix Edebug spec for cl-macrolet (bug#29919)
Gemini Lasswell [Sat, 21 Jul 2018 04:54:00 +0000 (21:54 -0700)]
Fix Edebug spec for cl-macrolet (bug#29919)

Add an Edebug matching function for cl-macrolet which keeps track of
its bindings and treats them as macros without Edebug specs when found
in the body of the expression.
* lisp/emacs-lisp/edebug.el (edebug--cl-macrolet-defs): New variable.
(edebug-list-form-args): Use it.
(edebug--current-cl-macrolet-defs): New variable.
(edebug-match-cl-macrolet-expr, edebug-match-cl-macrolet-name)
(edebug-match-cl-macrolet-body): New functions.
* lisp/emacs-lisp/cl-macs.el (cl-macrolet): Use cl-macrolet-expr
for Edebug spec.
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-cl-macrolet):
New test.
* test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
(edebug-test-code-use-cl-macrolet): New function.

6 years agoFix todo-mode commands called on done items separator
Stephen Berman [Wed, 1 Aug 2018 12:42:57 +0000 (14:42 +0200)]
Fix todo-mode commands called on done items separator

The done items separator is not reachable by todo-mode navigation
commands, but it is e.g. by C-n and C-p.  Ensure that invoking
todo-mode commands with point on the separator does not result in
unexpected results, errors or file corruption (bug#32343).

* lisp/calendar/todo-mode.el (todo-insert-item--basic): Make
copying item and inserting item "here" noops when invoked on done
items separator.  Consolidate error handling of these cases.  Also
restrict "here" insertion to valid positions in the current
category, since this is simpler than the previous behavior of
inserting as the first item, which was moreover undocumented,
counterintuitive and superfluous.
(todo-set-item-priority, todo-move-item, todo-item-done)
(todo-item-start, todo-item-end): Make noops when invoked on done
items separator.

* test/lisp/calendar/todo-mode-tests.el: Require ert-x.
(todo-test--insert-item): Add formal parameters of
todo-insert-item--basic.
(todo-test--done-items-separator): New function.
(todo-test-done-items-separator01-bol)
(todo-test-done-items-separator01-eol)
(todo-test-done-items-separator02-bol)
(todo-test-done-items-separator02-eol)
(todo-test-done-items-separator03-bol)
(todo-test-done-items-separator03-eol)
(todo-test-done-items-separator04-bol)
(todo-test-done-items-separator04-eol)
(todo-test-done-items-separator05-bol)
(todo-test-done-items-separator05-eol)
(todo-test-done-items-separator06-bol)
(todo-test-done-items-separator06-eol)
(todo-test-done-items-separator07): New tests.

6 years ago; Auto-commit of loaddefs files.
Glenn Morris [Wed, 1 Aug 2018 11:33:38 +0000 (07:33 -0400)]
; Auto-commit of loaddefs files.

6 years ago; Auto-commit of loaddefs files.
Glenn Morris [Wed, 1 Aug 2018 10:28:34 +0000 (06:28 -0400)]
; Auto-commit of loaddefs files.

6 years agoRead and print NaN significand if <ieee754.h>
Paul Eggert [Wed, 1 Aug 2018 07:49:39 +0000 (00:49 -0700)]
Read and print NaN significand if <ieee754.h>

* configure.ac: Check for ieee754.h.
* doc/lispref/numbers.texi (Float Basics): Document
that NaN string representation digits are machine-dependent.
* etc/NEWS: Mention the change.
* src/lread.c, src/print.c [HAVE_IEEE754_H]: Include ieee754.h.
* src/lread.c (string_to_number) [HAVE_IEEE754_H]:
* src/print.c (float_to_string) [HAVE_IEEE754_H]:
Read and print NaN significand.

6 years agoSimplify by assuming C99 math.h isnan etc.
Paul Eggert [Wed, 1 Aug 2018 06:46:57 +0000 (23:46 -0700)]
Simplify by assuming C99 math.h isnan etc.

These should be portable nowadays.
* src/data.c (isnan): Remove.
* src/floatfns.c (isfinite, isnan): Remove.
* src/print.c: Include math.h, for isinf and isnan.
(float_to_string): Simplify by using them.

6 years agoMerge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Stephen Gildea [Wed, 1 Aug 2018 05:34:35 +0000 (22:34 -0700)]
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

6 years agoReset mh-blacklist and mh-whitelist on folder undo
Stephen Gildea [Wed, 1 Aug 2018 05:29:47 +0000 (22:29 -0700)]
Reset mh-blacklist and mh-whitelist on folder undo

* mh-funcs.el (mh-undo-folder): Set mh-blacklist and mh-whitelist
to nil, as is done with the other lists of pending operations.

6 years agoFix Bug#32304
Michael Albinus [Tue, 31 Jul 2018 04:50:30 +0000 (06:50 +0200)]
Fix Bug#32304

* lisp/net/tramp.el (tramp-handle-substitute-in-file-name):
Handle special cas on Cygwin and MS-Windows.  (Bug#32304)

6 years agoFix wdired test failure when byte compiled (bug#32318)
Stephen Berman [Mon, 30 Jul 2018 22:42:52 +0000 (00:42 +0200)]
Fix wdired test failure when byte compiled (bug#32318)

* test/lisp/wdired-tests.el: Require wdired.  Defvar dired-query
to silence byte-compiler.

6 years ago* test/lisp/wdired-tests.el (wdired-test-symlink-name): New test.
Stephen Berman [Mon, 30 Jul 2018 12:12:50 +0000 (14:12 +0200)]
* test/lisp/wdired-tests.el (wdired-test-symlink-name): New test.

6 years ago; Instrumentation for shadowfile.el
Michael Albinus [Mon, 30 Jul 2018 09:11:32 +0000 (11:11 +0200)]
; Instrumentation for shadowfile.el

6 years ago* lisp/term.el (term-read-noecho): Mark obsolete.
Noam Postavsky [Mon, 30 Jul 2018 01:10:31 +0000 (21:10 -0400)]
* lisp/term.el (term-read-noecho): Mark obsolete.

6 years ago; * src/json.c: Fix typo in license statement
Philipp Stephani [Sun, 29 Jul 2018 22:18:27 +0000 (00:18 +0200)]
; * src/json.c: Fix typo in license statement

6 years ago; Instrumentation for shadowfile.el
Michael Albinus [Sun, 29 Jul 2018 21:10:21 +0000 (23:10 +0200)]
; Instrumentation for shadowfile.el

6 years agoAvoid gettimeofday deprecation warnings with MinGW
Eli Zaretskii [Sun, 29 Jul 2018 17:07:09 +0000 (20:07 +0300)]
Avoid gettimeofday deprecation warnings with MinGW

* nt/inc/ms-w32.h (__POSIX_2008_DEPRECATED)
[__MINGW32_VERSION >= 5001000L]: Define to nothing, to avoid
deprecation warnings about gettimeofday with mingw.org's MinGW
runtime 5.1 and later.

6 years agoMerge from origin/emacs-26
Paul Eggert [Sun, 29 Jul 2018 16:47:10 +0000 (09:47 -0700)]
Merge from origin/emacs-26

39d3e8b Fix last change in 'char_width'
67679f0 Add initial tests for wdired.el

6 years ago; Merge from origin/emacs-26
Paul Eggert [Sun, 29 Jul 2018 16:47:10 +0000 (09:47 -0700)]
; Merge from origin/emacs-26

The following commit was skipped:

831a3cb Fix use of non-nil wdired-use-interactive-rename

6 years ago; Instrumentation for shadowfile.el
Michael Albinus [Sun, 29 Jul 2018 16:35:43 +0000 (18:35 +0200)]
; Instrumentation for shadowfile.el

6 years agoFix url's thing-at-point beginning-op (Bug#32028)
Raimon Grau [Sun, 1 Jul 2018 20:31:08 +0000 (21:31 +0100)]
Fix url's thing-at-point beginning-op (Bug#32028)

* lisp/thingatpt.el (url): Fix beginning-op making.

6 years agoFix last change in 'char_width'
Eli Zaretskii [Sun, 29 Jul 2018 14:42:11 +0000 (17:42 +0300)]
Fix last change in 'char_width'

* src/character.c (char_width): Make sure variable C is always
initialized.  (Bug#32276)

6 years agoPrefer ?* to hide passwords
Tino Calancha [Sun, 29 Jul 2018 12:21:40 +0000 (21:21 +0900)]
Prefer ?* to hide passwords

It might be argued that a hidden string is more legible when using
?* as the hidden character instead of ?.
For example, the following strings have the same length:
"......"

"******"

It's slighly easier to visually count the number of characters in the second
string (Bug#32220).

* lisp/subr.el (read-passwd): Prefer ?* as default char instead of ?.
* doc/lispref/minibuf.texi (Reading a Password): Update manual.
; * etc/NEWS (Changes in Emacs 27.1): Announce the change.

6 years agoHandle symlinks in wdired.el when restoring filename property
Stephen Berman [Sun, 29 Jul 2018 11:16:48 +0000 (13:16 +0200)]
Handle symlinks in wdired.el when restoring filename property

* lisp/wdired.el (wdired--restore-dired-filename-prop): If the
file name is a symbolic link, only propertize the link name.  This
prevents wdired-create-parentdirs from turning the link into a
directory.

6 years agoFix bugs in wdired.el involving dired-filename property
Stephen Berman [Sat, 28 Jul 2018 23:14:41 +0000 (01:14 +0200)]
Fix bugs in wdired.el involving dired-filename property

After every change in wdired-mode, put the dired-filename text
property on the file name.  This ensures that changing some but not
all characters in the name succeeds with non-nil
wdired-use-interactive-rename (bug#32173) and it also ensures that
changed names can be found (e.g. by dired-isearch-filenames) while
still in wdired-mode.

* lisp/wdired.el (wdired--restore-dired-filename-prop): New function.
(wdired-change-to-wdired-mode): Add it to after-change-functions.
(wdired-change-to-dired-mode): Remove it from after-change-functions.
(wdired-finish-edit): Move invocation of
wdired-change-to-dired-mode below invocation of wdired-do-renames,
so that the latter runs wdired--restore-dired-filename-prop, but
above the invocation of revert-buffer to avoid using
wdired-revert, which changes back to wdired-mode.
(wdired-search-and-rename): Wrap renaming in unwind-protect and if
user types C-g when prompted to change the file name, make sure we
return to dired-mode.

6 years agoAdd initial tests for wdired.el
Stephen Berman [Sat, 28 Jul 2018 22:22:02 +0000 (00:22 +0200)]
Add initial tests for wdired.el

* test/lisp/wdired-tests.el: New file.

6 years agoFix use of non-nil wdired-use-interactive-rename
Stephen Berman [Sat, 28 Jul 2018 21:58:15 +0000 (23:58 +0200)]
Fix use of non-nil wdired-use-interactive-rename

This is a fairly minimal fix for the release branch; a more
comprehensive fix is on master, so do not merge this to master.

* lisp/wdired.el (wdired-search-and-rename): Remove dired-filename
text property in order to find new filename when it only partially
replaces old filename (bug#32173).  If user quits before renaming
succeeds, restore the dired-filename text property.

6 years ago; Instrumentation for shadowfile.el
Michael Albinus [Sat, 28 Jul 2018 18:06:24 +0000 (20:06 +0200)]
; Instrumentation for shadowfile.el