1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-18 10:16:51 +00:00
Commit Graph

2642 Commits

Author SHA1 Message Date
Noam Postavsky
3eb4603b0d Match w32 paths in grep sans --null hits (Bug#32051)
* lisp/progmodes/grep.el (grep-regexp-alist): Add an optional part to
match paths starting with C: (other drive letters).
* test/lisp/progmodes/compile-tests.el
(compile-tests--grep-regexp-testcases)
(compile-tests--grep-regexp-tricky-testcases)
(compile-test-grep-regexps): New tests.
(compile--test-error-line): Return `compilation-message'.
2018-07-12 21:49:50 -04:00
Noam Postavsky
1222ff5275 Don't skip epg-tests even with gpg 2.0 (Bug#23561)
* test/lisp/epg-tests.el (epg-tests--config-program-alist): New
constant, which allows gpg2 version 2.0+.
(epg-tests-find-usable-gpg-configuration): Pass it to
epg-find-configuration.
2018-07-12 21:45:30 -04:00
Michael Albinus
3744fda5fa Provide feature 'threads
* src/thread.c (syms_of_threads): Provide feature "threads".

* test/src/thread-tests.el (top): Declare the functions.
(all): Use (featurep 'threads) check.
2018-07-12 10:49:06 +02:00
Basil L. Contovounesios
2fde6275b6 Add predicate proper-list-p
For discussion, see emacs-devel thread starting at
https://lists.gnu.org/archive/html/emacs-devel/2018-04/msg00460.html.

* lisp/subr.el (proper-list-p): New function.
Implementation suggested by Paul Eggert <eggert@cs.ucla.edu> in
https://lists.gnu.org/archive/html/emacs-devel/2018-06/msg00138.html.
* doc/lispref/lists.texi (List Elements):
* etc/NEWS: Document proper-list-p.
* lisp/org/ob-core.el (org-babel-insert-result):
* lisp/emacs-lisp/byte-opt.el (byte-optimize-if):
* lisp/emacs-lisp/cl-macs.el (cl--make-usage-args): Use proper-list-p.
* lisp/emacs-lisp/ert.el (ert--proper-list-p): Remove.
Replaced by proper-list-p in lisp/subr.el.
(ert--explain-equal-rec): Use proper-list-length.
* lisp/format.el (format-proper-list-p): Remove.
Replaced by proper-list-p in lisp/subr.el.
(format-annotate-single-property-change): Use proper-list-p.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-proper-list-p):
Move from here...
* test/lisp/subr-tests.el (subr-tests--proper-list-length):
...to here, mutatis mutandis.
2018-07-09 19:00:43 -07:00
Noam Postavsky
e4ad2d1a8f Respect field boundaries in indent-line-to (Bug#32014)
* lisp/indent.el (indent-line-to): Use the back-to-indentation point
as the end-point of whitespace removal, rather than
backward-to-indentation which doesn't respect field boundaries.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-indent-with-read-only-field): Don't expect to fail.
2018-07-09 20:08:13 -04:00
Noam Postavsky
6b8349a902 Merge from emacs-26
db3f779780 ; Test for Bug#32014
90d95b000c Explicitly reject :server and :nowait (Bug#31903)
917158f8c9 Fix Bug#32090

# Conflicts:
#	src/process.c
2018-07-09 20:06:27 -04:00
Noam Postavsky
7bcb697e19 Merge from emacs-26
65889a6d12 Fix bootstrap infloop in GNU/Linux alpha
48efd1c98b Minor fix of a recent documentation change
3302b7cd7f Mention the NSM in the gnutls variable doc strings
40c2ce743b Remove test code from last commit
e02d8e29c6 Fix Bug#32084
da5d6dbe39 Fix (length NON-SEQUENCE) documentation
2018-07-09 20:03:30 -04:00
Noam Postavsky
8f7d35cabd Stop using indent-line-to in lisp-indent-line (Bug#32014)
This is partial revert of "Remove ignored argument from
lisp-indent-line", because `indent-line-to' doesn't respect field
boundaries.
* lisp/emacs-lisp/lisp-mode.el (lisp-indent-line): Use delete-region
and indent-to instead of `indent-line-to'.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-indent-with-read-only-field): Expect to pass.

Don't merge to master, we will fix indent-line-to there instead.
2018-07-09 19:39:03 -04:00
Noam Postavsky
db3f779780 ; Test for Bug#32014
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-indent-with-read-only-field): New test.
2018-07-09 19:39:03 -04:00
Michael Albinus
917158f8c9 Fix Bug#32090
* lisp/files-x.el (connection-local-normalize-criteria): Do not
use PROPERTIES anymore.
(connection-local-get-profiles): Rewrite, in order to accept any
property as optional.  (Bug#32090)
(connection-local-set-profiles):
Adapt ´connection-local-normalize-criteria' call.

* test/lisp/files-x-tests.el
(files-x-test-connection-local-set-profiles)
(files-x-test-hack-connection-local-variables-apply): Extend tests.
2018-07-09 16:03:49 +02:00
Michael Albinus
40c2ce743b Remove test code from last commit 2018-07-08 13:08:05 +02:00
Michael Albinus
e02d8e29c6 Fix Bug#32084
* test/lisp/net/dbus-tests.el (dbus-test02-register-service-own-bus):
Unset $DISPLAY when calling dbus-launch, in order to avoid
possible X11 authentication errors.  (Bug#32084)
2018-07-08 13:02:19 +02:00
Tom Tromey
38ea8e147a Fix Tcl indentation in a namespace
Fixes bug#32035
* lisp/progmodes/tcl.el (tcl-proc-list): Add "namespace".
* test/lisp/progmodes/tcl-tests.el (tcl-mode-namespace-indent): New
test.
2018-07-03 22:13:27 -06:00
João Távora
4ee502ca9d Adjust previous jsonrpc change
(nth 2) is probably a better alternative to caddr, and in Emacs 26.1
we can pass 0 as :service to automatically find an available port.

* lisp/jsonrpc.el (jsonrpc--call-deferred): Use cl-caddr.

* test/lisp/jsonrpc-tests.el
(jsonrpc--call-with-emacsrpc-fixture): Pass 0 as :service to when
making the listen server.
2018-07-03 08:21:56 +01:00
João Távora
332f4656b0 Make lisp/jsonrpc.el work with Emacs 25.1
* jsonrpc.el (Package-Requires): Require Emacs 25.1
(jsonrpc-lambda): Use cl-gensym.
(jsonrpc--call-deferred): Caddr doesn't exist in
emacs 25.1.

* jsonrpc-tests.el
(jsonrpc--call-with-emacsrpc-fixture): New function.
(jsonrpc--with-emacsrpc-fixture): Use it.
(deferred-action-complex-tests): Adjust test for Emacs 25.1
2018-07-02 17:30:35 +01:00
Michael Albinus
8b6812fd90 Minor change in tramp-tests.el
* test/lisp/net/tramp-tests.el (tramp-test03-file-name-host-rules):
Cleanup before running the test.
2018-07-01 11:58:55 +02:00
João Távora
8af26410a9 Add lisp/jsonrpc.el
* doc/lispref/text.texi (Text): Add JSONRPC.
(JSONRPC): New node.

* etc/NEWS (New Modes and Packages in Emacs 27.1): Mention jsonrpc.el

* lisp/jsonrpc.el: New file.

* test/lisp/jsonrpc-tests.el: New file.
2018-06-30 19:46:06 +01:00
Michael Albinus
45390596e6 Sync with Tramp 2.4.0
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.4.0".

* lisp/net/tramp-gvfs.el (tramp-gvfs-handler-mounted-unmounted):
Ignore unknown GVFS methods.

* test/lisp/net/tramp-tests.el (tramp-test42-asynchronous-requests):
Tag as :unstable.
2018-06-29 10:17:46 +02:00
Michael Albinus
1f5037925b Sync with Tramp 2.3.4. Do not merge with master
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.3.4".

* lisp/net/tramp-smb.el (tramp-smb-handle-delete-directory):
Check, that the directory has been removed indeed.

* test/lisp/net/tramp-tests.el (tramp-test21-file-links): Adapt test.
(tramp--test-emacs25-p): New defun.
(tramp-test34-vc-registered): Use it.
2018-06-27 13:08:18 +02:00
Jean-Christophe Helary
61f73703c7 Reformat package.el message strings for future l10n
* lisp/emacs-lisp/package.el (package-buffer-info)
(package--download-one-archive, package-install-selected-packages)
(package-autoremove, describe-package-1, package-menu-toggle-hiding)
(package-menu-hide-package, package-menu--mark-upgrades-1)
(package-menu--list-to-prompt, package-menu--prompt-transaction-p)
(package-menu-execute, package-menu--find-and-notify-upgrades):
Reformat message strings to remove need for plural computation.  Try
to put full sentences in source string literals.
* test/lisp/emacs-lisp/package-tests.el
(package-test-describe-package): Update to match new message format.
2018-06-25 19:18:55 -04:00
Paul Eggert
d0e2a341dd (format "%d" F) now truncates floating F
Problem reported by Paul Pogonyshev (Bug#31938).
* src/editfns.c: Include math.h, for trunc.
(styled_format): For %d, truncate floating-point numbers and
convert -0 to 0, going back to how Emacs 26 did things.
* doc/lispref/strings.texi (Formatting Strings):
Document behavior of %o, %d, %x, %X on floating-point numbers.
* src/floatfns.c (trunc) [!HAVE_TRUNC]: Rename from emacs_trunc
and make it an extern function, so that editfns.c can use it.
All callers changed.
* test/src/editfns-tests.el (format-%d-float): New test.
2018-06-25 12:23:08 -07:00
Tom Tromey
cd5bb4bf3d Fix two tcl-mode defun-related bugs
Fixes bug#23565
* lisp/progmodes/tcl.el (tcl-mode): Set beginning-of-defun-function
and end-of-defun-function.
(tcl-beginning-of-defun-function, tcl-end-of-defun-function): New
defuns.
* test/lisp/progmodes/tcl-tests.el: New file.
2018-06-24 11:33:02 -06:00
Glenn Morris
b81e193ac0 Merge from origin/emacs-26
5cb3991 Fix a typo in emacs-lisp-intro.texi
d6aa55e Avoid segfaults in replace-buffer-contents with large buffers
d22b8d1 Adjust for scaling for mode-line popup menus (Bug#31880)
3d2e3dc Change name of `seqp' argument (Bug#26411)
40e1db8 Change index of ";" to better reflect it's usage (Bug#31623)
d289e7e Fix bug of 'mouse-drag-and-drop-region' to detect edges of re...
e292c09 Fix #'fun handling inside `labels' (Bug#31792)
2018-06-23 07:50:59 -07:00
Michael Albinus
e6476c914e Improve backward compatibility of Tramp
* lisp/net/tramp-adb.el (tramp-adb-handle-exec-path):
* lisp/net/tramp-sh.el (tramp-sh-handle-exec-path): Use ´file-remote-p'.
(tramp-get-ls-command-with): Handle busybox specially.

* test/lisp/net/tramp-tests.el (tramp-test34-exec-path): Check for
`fboundp'.  Use `file-remote-p'.  Hide compiler warning for older
Emacsen.
2018-06-22 16:17:17 +02:00
Michael Albinus
6f649e77b8 Implement command completion in remote shells. (Bug#31704)
* doc/lispref/files.texi (Locating Files): Describe optional
argument REMOTE of `executable-find'.
(Magic File Names): Add `exec-path'.

* doc/lispref/processes.texi (Subprocess Creation): Describe
function `exec-path'.

* doc/misc/tramp.texi (Remote programs): Explain refresh of search
paths by `tramp-cleanup-this-connection'.

* etc/NEWS: Mention 'exec-path' and 'executable-find'.

* lisp/files.el (exec-path): New defun.
(executable-find): Add optional argument REMOTE.

* lisp/shell.el (shell-completion-vars): Set `comint-file-name-prefix'.
(shell--command-completion-data): Use `(exec-path)'.  (Bug#31704)

* lisp/net/ange-ftp.el (exec-path):
* lisp/net/tramp.el (tramp-file-name-for-operation):
* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
* lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist):
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist)
<exec-path>: Add handler.

* lisp/net/tramp-adb.el (tramp-adb-handle-exec-path): New defun.
(tramp-adb-maybe-open-connection): Do not set "remote-path"
connection property.

* lisp/net/tramp-compat.el (tramp-compat-exec-path): New defun.

* lisp/net/tramp-sh.el (tramp-sh-handle-exec-path): New defun.

* lisp/net/tramp.el (tramp-eshell-directory-change): Use it.

* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test38-make-nearby-temp-file)
(tramp-archive-test41-file-system-info)
(tramp-archive-test43-auto-load)
(tramp-archive-test43-delay-load): Rename.

* test/lisp/net/tramp-tests.el (tramp-test34-exec-path): New test.
(tramp-test36-make-auto-save-file-name)
(tramp-test37-find-backup-file-name)
(tramp-test38-make-nearby-temp-file)
(tramp-test39-special-characters)
(tramp-test39-special-characters-with-stat)
(tramp-test39-special-characters-with-perl)
(tramp-test39-special-characters-with-ls, tramp-test40-utf8)
(tramp-test40-utf8-with-stat, tramp-test40-utf8-with-perl)
(tramp-test40-utf8-with-ls, tramp-test41-file-system-info)
(tramp-test42-asynchronous-requests, tramp-test43-auto-load)
(tramp-test43-delay-load, tramp-test43-recursive-load)
(tramp-test43-remote-load-path, tramp-test44-unload): Rename.
2018-06-20 12:13:56 +02:00
Noam Postavsky
e292c0973c Fix #'fun handling inside `labels' (Bug#31792)
* lisp/emacs-lisp/cl.el (labels): Apply the equivalent of the
cl-labels change from 2015-01-16 "* lisp/emacs-lisp/cl-macs.el: Fix
last change".
* test/lisp/emacs-lisp/cl-tests.el (labels-function-quoting): New
test.
* lisp/emacs-lisp/cl-macs.el (cl-flet, cl-labels): Improve docstring,
link to relevant manual page.
* doc/misc/cl.texi (Function Bindings): Don't imply that function
cells of symbols are modified by cl-flet.  Don't claim that cl-flet or
cl-labels affect references of the form (quote FUNC).
2018-06-19 20:02:16 -04:00
João Távora
1e2e48c13c Skip a json.c test unless functions being tested exist
* test/src/json-tests.el
(json-parse-with-custom-null-and-false-objects): Skip this test
unless functions being tested exist.
2018-06-19 03:02:09 +01:00
João Távora
d37d30cef5 Mark a specific electric-pair-mode test as an expected failure
See https://lists.gnu.org/archive/html/emacs-devel/2018-06/msg00535.html

* test/lisp/electric-tests.el
(electric-pair-whitespace-chomping-2-at-point-4-in-c++-mode-in-strings):
Mark as failing.
2018-06-19 02:53:10 +01:00
Glenn Morris
b455a1b2a8 Merge from origin/emacs-26
63ba73a Fix documentation of ':propertize' in mode-line-format
22aa665 Reject invalid 5-byte sequences when detecting UTF-8 encoding
0d3c358 Fix 'replace-buffer-contents' in multibyte buffers
c79a627 Update etc/NEWS for mail-source-movemail-program change
63f1dc4 Improve movemail default
0b1a2ae Delete description of deleted Customize functions
fcd66d0 Keep vc-print-log from putting point at buffer end (Bug#31764)

Conflicts:
	etc/NEWS
2018-06-18 12:14:25 -07:00
Glenn Morris
ef02c9fd1a Merge from origin/emacs-26
5bdc344 ; Reduce quoting for SELECTOR in 'make -C test' (Bug#31744)
b6b793b ; test/Makefile.in: Add TEST_INTERACTIVE option (Bug#31744).
1aa906f Make 'tags' targets respect --with-silent-rules (Bug#31744)

Conflicts:
	test/Makefile.in
	test/README
2018-06-18 12:14:24 -07:00
Glenn Morris
2d1b774dbc * test/lisp/simple-tests.el (simple-tests-async-shell-command-30280):
Use the correct emacs executable, not first in PATH.
2018-06-17 10:22:28 -07:00
Michael Albinus
39ccbacf9c Cleanup secrets-tests
* test/lisp/net/secrets-tests.el (secrets-test03-items)
(secrets-test04-search): Cleanup "session" collection initially.
2018-06-17 11:19:16 +02:00
Noam Postavsky
6021e1db92 Don't forget to analyze args of lambda lifted functions (Bug#30872)
* lisp/emacs-lisp/cconv.el (cconv--convert-funcbody): New function.
(cconv--convert-function): Extracted from here.
(cconv-convert): Also use it here, in the lambda lifted case, so that
mutated args are properly accounted for.
* test/lisp/emacs-lisp/cconv-tests.el: New test.
2018-06-16 18:34:19 -04:00
Noam Postavsky
05345babc9 Fix off by one error in python-mode assertion (Bug#30964)
* lisp/progmodes/python.el (python-nav-end-of-statement): Don't assert
that string-start is strictly greater than last-string-end, because
the string end is a position outside of the string and may therefore
be the same as the following string's start.
* test/lisp/progmodes/python-tests.el (python-nav-end-of-statement-2):
New test.
2018-06-16 18:34:19 -04:00
Paul Eggert
e1284341fd Fix byte compilation of (eq foo 'default)
Backport from master.
Do not use the symbol ‘default’ as a special marker.
Instead, use a value that cannot appear in the program,
improving on a patch proposed by Robert Cochran (Bug#31718#14).
* lisp/emacs-lisp/bytecomp.el (byte-compile--default-val):
New constant.
(byte-compile-cond-jump-table-info)
(byte-compile-cond-jump-table): Use it instead of 'default.
* test/lisp/emacs-lisp/bytecomp-tests.el:
(byte-opt-testsuite-arith-data): Add a test for the bug.
2018-06-16 09:44:05 -07:00
Paul Eggert
9af399fd80 Fix byte compilation of (eq foo 'default)
Do not use the symbol ‘default’ as a special marker.
Instead, use a value that cannot appear in the program,
improving on a patch proposed by Robert Cochran (Bug#31718#14).
* lisp/emacs-lisp/bytecomp.el (byte-compile--default-val):
New constant.
(byte-compile-cond-jump-table-info)
(byte-compile-cond-jump-table): Use it instead of 'default.
* test/lisp/emacs-lisp/bytecomp-tests.el:
(byte-opt-testsuite-arith-data): Add a test for the bug.
2018-06-16 07:48:51 -07:00
Eli Zaretskii
0d3c35807d Fix 'replace-buffer-contents' in multibyte buffers
* src/editfns.c (buffer_chars_equal): Pass a byte position to
BUF_FETCH_CHAR_AS_MULTIBYTE, not a character position.
(Bug#31837)

* test/src/editfns-tests.el (replace-buffer-contents-bug31837):
New test.
2018-06-15 11:27:56 +03:00
João Távora
51adab5de2 Also allow custom false and null when serializing to JSON
* doc/lispref/text.texi (Parsing JSON): Describe new arguments of
json-serialize and json-insert.

* src/json.c (enum json_object_type, struct json_configuration):
Move up in file before first usage.
(lisp_to_json_toplevel, lisp_to_json_toplevel_1, lisp_to_json):
Accept a struct json_configuration*.
(Fjson_serialize, Fjson_insert): Accept multiple args.
(json_parse_args): Accept new boolean configure_object_type.

* test/src/json-tests.el
(json-serialize, json-insert): Update forward decls.
(json-parse-with-custom-null-and-false-objects): Add assertions for
json-serialize.
2018-06-15 00:13:00 +01:00
João Távora
9348039ed4 Support custom null and false objects when parsing JSON
* doc/lispref/text.texi (Parsing JSON): Describe new :null-object
and :false-object kwargs to json-parse-string and
json-parse-buffer.

* src/json.c
(struct json_configuration): New type.
(json_to_lisp): Accept a struct json_configuration* param.
(json_parse_args): Rename from json_parse_object_type.
(Fjson_parse_string): Rework docstring.
(Fjson_parse_string, Fjson_parse_buffer): Update call to
json_to_lisp.
(syms_of_json): Two new syms, QCnull_object and QCfalse_object.

* test/src/json-tests.el
(json-parse-with-custom-null-and-false-objects): New test.
2018-06-15 00:11:56 +01:00
Damien Cassou
8cb9beb321
Fix pretty-printing empty objects as null
* lisp/json.el (json-pretty-print): Force distinction between empty
  objects and null.
(json-encode-list): Remove responsibility to print "null" as this
value is not a list.
(json-encode): Give higher precedence to lists so that an empty list
is printed as an empty object, not as "null".

* test/lisp/json-tests.el (test-json-encode): Add many tests to check
  the behavior of pretty-printing.
2018-06-14 11:01:49 +02:00
Noam Postavsky
c912db0836 Give warning if losing value to defvaralias (Bug#5950)
* src/eval.c (Fdefvaralias): Call `display-warning' if the alias
target has a non-eq value to the variable being aliased.
* test/src/eval-tests.el (defvaralias-overwrite-warning): New test.
2018-06-12 07:40:33 -04:00
Noam Postavsky
5bdc344780 ; Reduce quoting for SELECTOR in 'make -C test' (Bug#31744)
Before:

    make -C test SELECTOR='\"foo\"'
    make -C test SELECTOR='(quote (tag :some-tag))'

After:

    make -C test SELECTOR='"foo"'
    make -C test SELECTOR='(tag :some-tag)'

* test/Makefile.in: Use single quotes around the command line call to
ert, this means the user doesn't have to backslash escape double
quotes when writing lisp strings for the selector.  Also wrap the
SELECTOR value in (quote ...) so the user won't have to type it
in (and not get tempted to use the '... reader syntax form which would
now fail to work due to using single quotes around the whole shell
arg).
* test/README: Update instructions accordingly.
2018-06-12 07:26:06 -04:00
Noam Postavsky
b6b793bd77 ; test/Makefile.in: Add TEST_INTERACTIVE option (Bug#31744).
* test/README: Note the new option.
2018-06-12 07:26:06 -04:00
Noam Postavsky
962547791e Merge from emacs-26
8a1576cc03 Fix term.el cursor movement at bottom margin (Bug#31690)
2018-06-10 18:47:27 -04:00
Noam Postavsky
7adf1a361d Merge from emacs-26
3434edc731 Enlarge DUMPED_HEAP_SIZE for 64-bit Windows builds
36bbdfc017 Update Unicode data files to version 11.0.0 of Unicode
b7b7a5f4f3 * etc/NEWS: Belatedly call out vc-hg changes in v26.1.  (B...
5b6f8b54d1 Clarify the documentation of 'dired-recursive-deletes'
9db97b49cd ; * etc/DEBUG: Add information about debugging libXft prob...
0214ffbe60 Clarify doc string of 'update-glyphless-char-display'
ef35d405b1 Clarify subtle issues with 'eq' in byte-compiled code
c6ef3c8321 Make cl-print respect print-quoted (bug#31649)
26b52ac40e Fix unexpected jumps of window-point in 'set-window-config...
4af077ab4d * etc/emacs.appdata.xml: Update Emacs screenshot.
e5ab25deae Fix cursor movement by 'next-logical-line' after 'next-line'
d20beef5f1 Fix prompt in bookmark.el (Bug#24726)
c57e7eaae8 Improve documentation of 'empty' whitespace-style

# Conflicts:
#	etc/NEWS
2018-06-10 18:43:49 -04:00
Noam Postavsky
8a1576cc03 Fix term.el cursor movement at bottom margin (Bug#31690)
* lisp/term.el (term-handle-ansi-escape) <\E[B cud>: Allow moving the
cursor to the bottom margin line, rather than stopping one line
before.
2018-06-10 17:57:50 -04:00
Eli Zaretskii
36bbdfc017 Update Unicode data files to version 11.0.0 of Unicode
* admin/unidata/UnicodeData.txt:
* admin/unidata/SpecialCasing.txt:
* admin/unidata/NormalizationTest.txt:
* admin/unidata/copyright.html:
* admin/unidata/BidiMirroring.txt:
* admin/unidata/BidiBrackets.txt: Import from Unicode 11.0.
* admin/notes/unicode: Update the URL for OTF script tags.

* lisp/international/mule-cmds.el (ucs-names): Update unused ranges.
* lisp/international/fontset.el (script-representative-chars): Add
hanifi-rohingya, old-sogdian, sogdian, dogra, gunjala-gondi,
makasar, and medefaidrin.
(otf-script-alist): Add old-hungarian.
* lisp/international/characters.el (tbl): Add syntax entries for
Supplemental Mathematical Operators, Miscellaneous Symbols and
Arrows, and Supplemental Punctuation.
Update the list of wide characters.

* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--failing-lines-part2): Update to match
admin/unidata/NormalizationTest.txt.

* doc/lispref/nonascii.texi (Character Properties): Update the
reference to the Unicode Standard.
* doc/misc/efaq.texi (New in Emacs 26):
* etc/NEWS: Mention compatibility with Unicode 11.0.
2018-06-09 15:41:21 +03:00
Gemini Lasswell
c6ef3c8321 Make cl-print respect print-quoted (bug#31649)
* lisp/emacs-lisp/cl-print.el (cl-print-object) <cons>: Observe
print-quoted when printing quote and its relatives.  Add printing of
'function' as #'.
2018-06-07 08:27:43 -07:00
João Távora
3509aaaefe Accept plists when serializing and parsing JSON
* doc/lispref/text.texi (Parsing JSON): Mention plist support.

* src/json.c (lisp_to_json_toplevel_1): Serialize plists to json.
(Fjson_serialize): Mention plists in docstring.
(enum json_object_type): Add json_object_plist.
(json_to_lisp): Parse JSON into plists.
(json_parse_object_type): Consider plists.
(Fjson_parse_string): Mention plists in docstring.
(syms_of_json): New Qplist sym_of_json.
(lisp_to_json): Update comment.

* test/src/json-tests.el (json-serialize/object)
(json-parse-string/object): New plist tests.
2018-06-07 12:30:39 +01:00
Damien Cassou
47ccee220a
Test checking that auth-source-pass backend is correctly installed
* test/lisp/auth-source-pass-tests.el
(auth-source-pass-can-start-from-auth-source-search): Add test.
2018-06-05 15:53:33 +02:00
Jelle Licht
1d2551f8e7
Fix auth-source-pass.el to properly handle special inputs
* lisp/auth-source-pass.el (auth-source-pass-search): Warn when
passing multiple hosts in SPEC. Early return and warn when passing a
wildcard as host in SPEC. Early return when host is nil.
* test/lisp/auth-source-pass-tests.el (auth-source-pass-any-host,
auth-source-pass-undefined-host): Add corresponding tests.
2018-06-05 15:51:26 +02:00
Damien Cassou
b43ed61ef9
auth-source-pass: Take care of matching hosts when port is provided
* lisp/auth-source-pass.el (auth-source-pass--find-match): Add PORT
parameter and reorganize code by extracting `find-match-unambiguous'.
(auth-source-pass--find-match-unambiguous): New function.
(auth-source-pass--build-result): Fix the call to `find-match'.
(auth-source-pass--hostname, auth-source-pass--hostname-with-user,
auth-source-pass--user): Remove functions.
* test/lisp/auth-source-pass-tests.el: Fix the calls to `find-match'.
(auth-source-pass-find-host-without-port) Add corresponding test.
2018-06-05 15:51:14 +02:00
Damien Cassou
a52661b58b
Add missing test cases to auth-source-pass-tests.el
* test/lisp/auth-source-pass-tests.el
(auth-source-pass-build-result-passes-full-host-to-find-match): Add
missing test cases.
2018-06-05 15:51:09 +02:00
Damien Cassou
5b31e6de99
Add a test to auth-source-pass-tests.el
* test/lisp/auth-source-pass-tests.el
(auth-source-pass-build-result-passes-full-host-to-find-match): Add
test making sure find-match is called with full host.
2018-06-05 15:51:00 +02:00
Damien Cassou
53f044c22f
Fix indentation in auth-source-pass-tests.el
* test/lisp/auth-source-pass-tests.el
(auth-source-pass-only-return-entries-that-can-be-open): Fix indentation.
2018-06-05 15:50:54 +02:00
Edison Ibañez
59d44b528e
* test/lisp/auth-source-pass-tests.el: Add assertions for host:port 2018-06-05 15:50:46 +02:00
Michael Albinus
7c1fa17955 Fix selinux test in files-tests.el
* test/lisp/files-tests.el
(files-tests-file-name-non-special-set-file-selinux-context):
Adapt test.
2018-06-05 09:43:34 +02:00
Gemini Lasswell
5d448ca98c Make cl-print respect print-level and print-length (bug#31559)
* lisp/emacs-lisp/cl-print.el (cl-print--depth): New variable.
(cl-print-object) <cons>: Print ellipsis if printing depth greater
than 'print-level' or length of list greater than 'print-length'.
(cl-print-object) <vector>: Truncate printing with ellipsis if
vector is longer than 'print-length'.
(cl-print-object) <cl-structure-object>: Truncate printing with
ellipsis if structure has more slots than 'print-length'.
(cl-print-object) <:around>: Bind 'cl-print--depth'.
* test/lisp/emacs-lisp/cl-print-tests.el
(cl-print-tests-3, cl-print-tests-4): New tests.

(cherry picked from commit 0f48d18fd2)
2018-06-04 08:57:10 -07:00
Stefan Monnier
ed962f2b8a Fix bug#30846, along with misc cleanups found along the way
* test/src/data-tests.el (data-tests-kill-all-local-variables): New test.

* src/buffer.c (swap_out_buffer_local_variables): Remove.
Fuse the body of its loop into that of reset_buffer_local_variables.
(Fkill_buffer, Fkill_all_local_variables): Don't call it any more.
(reset_buffer_local_variables): Make sure the buffer's local binding
is swapped out before removing it from the alist (bug#30846).
Call watchers before actually killing the var.

* src/data.c (Fmake_local_variable): Simplify.
Use swap_in_global_binding to swap out any local binding, instead of
a mix of find_symbol_value followed by messing with where&found.
Don't call swap_in_symval_forwarding since the currently swapped
binding is never one we've modified.
(Fkill_local_variable): Use swap_in_global_binding rather than messing
with where&found to try and trick find_symbol_value into doing the same.

* src/alloc.c (mark_localized_symbol): 'where' can't be a frame any more.

(cherry picked from commit 3ddff08034)
2018-06-03 12:48:14 -04:00
Noam Postavsky
9552485c4d Fix cl-print for circular sublists (Bug#31146)
* lisp/emacs-lisp/cl-print.el (cl-print-object) <cons>: Push each
element of list being printed onto cl-print--currently-printing.
* test/lisp/emacs-lisp/cl-print-tests.el (cl-print-circle-2): New
test.

(cherry picked from commit b8aa7ecf54)
2018-06-03 12:48:13 -04:00
Noam Postavsky
daa602338f Fix another case of freed markers in the undo-list (Bug#30931)
* src/alloc.c (free_marker): Remove.
* src/editfns.c (save_restriction_restore):
* src/insdel.c (signal_before_change): Detach the markers from the
buffer when we're done with them instead of calling free_marker on
them.
* test/src/editfns-tests.el (delete-region-undo-markers-1)
(delete-region-undo-markers-2): New tests.

(cherry picked from commit 96b8747d5c)
2018-06-03 12:48:13 -04:00
Tino Calancha
5fa73a7d98 query-replace undo: Handle when user edits the replacement string
* lisp/replace.el (perform-replace): Update the replacement string
after the user edit it (Fix Bug#31538).

* test/lisp/replace-tests.el (query-replace-undo-bug31538): New test.

Backport: (cherry picked from commits
ea133e04f4
and
7dcfdf5b14)
2018-06-03 23:28:30 +09:00
Tino Calancha
031004e81b Backport: Fix corner case in query-replace-regexp undo
This commit fixes Bug#31492.
* lisp/replace.el (replace-match-maybe-edit): Preserve match data.

* test/lisp/replace-tests.el (query-replace-undo-bug31492): Add test.

(cherry picked from commit bab73230d1)
2018-06-03 23:28:24 +09:00
Tino Calancha
50c0624b2a Backport: Preserve case in query-replace undo
If the user query and replaces 'foo' with 'BAR', then
undo must comeback to 'foo', not to 'FOO' (Bug#31073).
* lisp/replace.el (perform-replace): Bind nocasify to non-nil
value during undo/undo-all actions.
* test/lisp/replace-tests.el (query-replace-undo-bug31073): Add test.

(cherry picked from commit 32dc0cb1b5)
2018-06-03 23:28:14 +09:00
Michael Albinus
e75c57f10e Extend file-name-non-special
* lisp/files.el (insert-file-contents-literally):
Bind `inhibit-file-name-handlers' the default way.
(file-name-non-special): Rework, mainly for operations with two
file name arguments.
(file-name-unquote-non-special): New defsubst.
(file-name-unquote): Use it.

* test/lisp/files-tests.el (files-test-bug-18141): Skip if needed.
(files-tests--with-temp-non-special): Add docstring.  Delete also
`non-special-name' if the file/directory exists.
(files-tests--special-file-name-extension)
(files-tests--special-file-name-regexp): New defconst.
(files-tests--special-file-name-handler, files-tests--new-name):
New defuns.
(files-tests--with-temp-non-special-and-file-name-handler): New macro.
(files-tests-file-name-non-special-access-file)
(files-tests-file-name-non-special-add-name-to-file)
(files-tests-file-name-non-special-byte-compiler-base-file-name)
(files-tests-file-name-non-special-copy-directory)
(files-tests-file-name-non-special-copy-file)
(files-tests-file-name-non-special-delete-directory)
(files-tests-file-name-non-special-delete-file)
(files-tests-file-name-non-special-diff-latest-backup-file)
(files-tests-file-name-non-special-directory-file-name)
(files-tests-file-name-non-special-directory-files)
(files-tests-file-name-non-special-directory-files-and-attributes)
(files-tests-file-name-non-special-dired-compress-handler)
(files-tests-file-name-non-special-dired-uncache)
(files-tests-file-name-non-special-expand-file-name)
(files-tests-file-name-non-special-file-accessible-directory-p)
(files-tests-file-name-non-special-file-acl)
(files-tests-file-name-non-special-file-attributes)
(files-tests-file-name-non-special-file-directory-p)
(files-tests-file-name-non-special-file-equal-p)
(files-tests-file-name-non-special-file-executable-p)
(files-tests-file-name-non-special-file-exists-p)
(files-tests-file-name-non-special-file-in-directory-p)
(files-tests-file-name-non-special-file-local-copy)
(files-tests-file-name-non-special-file-modes)
(files-tests-file-name-non-special-file-name-all-completions)
(files-tests-file-name-non-special-file-name-as-directory)
(files-tests-file-name-non-special-file-name-case-insensitive-p)
(files-tests-file-name-non-special-file-name-completion)
(files-tests-file-name-non-special-file-name-directory)
(files-tests-file-name-non-special-file-name-nondirectory)
(files-tests-file-name-non-special-file-name-sans-versions)
(files-tests-file-name-non-special-file-newer-than-file-p)
(files-tests-file-name-non-special-notify-handlers)
(files-tests-file-name-non-special-file-ownership-preserved-p)
(files-tests-file-name-non-special-file-readable-p)
(files-tests-file-name-non-special-file-regular-p)
(files-tests-file-name-non-special-file-remote-p)
(files-tests-file-name-non-special-file-selinux-context)
(files-tests-file-name-non-special-file-symlink-p)
(files-tests-file-name-non-special-file-truename)
(files-tests-file-name-non-special-file-writable-p)
(files-tests-file-name-non-special-find-backup-file-name)
(files-tests-file-name-non-special-get-file-buffer)
(files-tests-file-name-non-special-insert-directory)
(files-tests-file-name-non-special-insert-file-contents)
(files-tests-file-name-non-special-load)
(files-tests-file-name-non-special-make-auto-save-file-name)
(files-tests-file-name-non-special-make-directory)
(files-tests-file-name-non-special-make-directory-internal)
(files-tests-file-name-non-special-make-symbolic-link)
(files-tests-file-name-non-special-rename-file)
(files-tests-file-name-non-special-set-file-acl)
(files-tests-file-name-non-special-set-file-modes)
(files-tests-file-name-non-special-set-file-selinux-context)
(files-tests-file-name-non-special-set-file-times)
(files-tests-file-name-non-special-set-visited-file-modtime)
(files-tests-file-name-non-special-shell-command)
(files-tests-file-name-non-special-start-file-process)
(files-tests-file-name-non-special-substitute-in-file-name)
(files-tests-file-name-non-special-temporary-file-directory)
(files-tests-file-name-non-special-unhandled-file-name-directory)
(files-tests-file-name-non-special-vc-registered)
(files-tests-file-name-non-special-write-region): Extends tests to
quoted file names, which would require a file name handler if unquoted.
(files-test-no-file-write-contents): Make test more robust.

* test/lisp/net/tramp-tests.el (tramp-test21-file-links): Adapt test.
(tramp--test-emacs25-p): New defun.
(tramp-test34-vc-registered): Use it.
2018-06-03 14:30:41 +02:00
John Shahid
9ac76456eb Fix column double counting in term.el (Bug#31662)
* lisp/term.el (term-emulate-terminal): Invalidate
`term-current-column' after deleting overwritten text.
2018-06-01 23:06:34 -04:00
Simen Heggestøyl
58d0642e1c Add Imenu support to CSS mode and its derivatives
* lisp/textmodes/css-mode.el (css--join-nested-selectors)
(css--prev-index-position, css--extract-index-name): New helper
functions for supporting Imenu.
(css-mode): Set `imenu-space-replacement',
`imenu-prev-index-position-function', and
`imenu-extract-index-name-function'.
(css-current-defun-name): Reuse `css--prev-index-position' and
`css--extract-index-name' to support nested selectors.

* test/lisp/textmodes/css-mode-tests.el (css-test-current-defun-name):
Fix character index.
(css-test-join-nested-selectors): New tests for
`css--join-nested-selectors'.

* etc/NEWS: Add news entry.
2018-05-29 21:24:26 +02:00
Michael Albinus
e8912d5be9 Sync with Tramp 2.3.4-pre
* doc/misc/trampver.texi: Change version to "2.3.4-pre

* lisp/net/tramp.el (tramp-mode, tramp-verbose)
(tramp-backup-directory-alist, tramp-auto-save-directory)
(tramp-encoding-shell, tramp-encoding-command-switch)
(tramp-encoding-command-interactive, tramp-default-method)
(tramp-default-method-alist, tramp-default-user)
(tramp-default-user-alist, tramp-default-host)
(tramp-default-host-alist, tramp-default-proxies-alist)
(tramp-save-ad-hoc-proxies, tramp-restricted-shell-hosts-alist)
(tramp-local-end-of-line, tramp-rsh-end-of-line)
(tramp-login-prompt-regexp, tramp-shell-prompt-pattern)
(tramp-password-prompt-regexp, tramp-wrong-passwd-regexp)
(tramp-yesno-prompt-regexp, tramp-yn-prompt-regexp)
(tramp-terminal-prompt-regexp)
(tramp-operation-not-permitted-regexp, tramp-copy-failed-regexp)
(tramp-process-alive-regexp, tramp-chunksize)
(tramp-process-connection-type, tramp-connection-timeout)
(tramp-connection-min-time-diff)
(tramp-completion-reread-directory-timeout):
* lisp/net/tramp-adb.el (tramp-adb-program)
(tramp-adb-connect-if-not-connected, tramp-adb-prompt):
* lisp/net/tramp-cache.el (tramp-connection-properties)
(tramp-persistency-file-name):
* lisp/net/tramp-gvfs.el (tramp-gvfs-methods)
(tramp-gvfs-zeroconf-domain, tramp-bluez-discover-devices-timeout):
* lisp/net/tramp-sh.el (tramp-inline-compress-start-size)
(tramp-copy-size-limit, tramp-terminal-type)
(tramp-histfile-override, tramp-use-ssh-controlmaster-options)
(tramp-remote-path, tramp-remote-process-environment)
(tramp-sh-extra-args):
* lisp/net/tramp-smb.el (tramp-smb-program, tramp-smb-acl-program)
(tramp-smb-conf, tramp-smb-winexe-program)
(tramp-smb-winexe-shell-command)
(tramp-smb-winexe-shell-command-switch):
Dont't require 'tramp.  (Bug#31558)

* lisp/net/tramp.el (tramp-accept-process-output):
* lisp/net/tramp-adb.el (tramp-adb-handle-start-file-process):
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band)
(tramp-sh-handle-start-file-process):
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory)
(tramp-smb-handle-file-acl, tramp-smb-handle-process-file)
(tramp-smb-handle-set-file-acl)
(tramp-smb-handle-start-file-process): Suppress timers.

* lisp/net/tramp-adb.el (tramp-adb-handle-write-region):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region):
* lisp/net/tramp-sh.el (tramp-sh-handle-write-region):
* lisp/net/tramp-smb.el (tramp-smb-handle-write-region):
Write proper message.

* lisp/net/tramp-cmds.el (tramp-change-syntax):
Use `customize-set-variable'.

* lisp/net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):
Ensure proper EOL handling for Darwin.
(tramp-find-inline-compress): Improve command quoting for w32.
Reported by Chris Zheng <chriszheng99@gmail.com>.
(tramp-open-connection-setup-interactive-shell): Wrap both echo
calls in parentheses, in order to avoid double prompt.

* lisp/net/tramp-smb.el (tramp-smb-errors):
Add "NT_STATUS_RESOURCE_NAME_NOT_FOUND".

* lisp/net/tramp.el (tramp-default-user-alist)
(tramp-default-host-alist): Fix docstring.
(tramp-dissect-file-name): Adapt docstring.  (Bug#30904)
(tramp-make-tramp-file-name): Check, that method is
not empty.  (Bug#30038)
(tramp-message-show-message): Change default.

* lisp/net/trampver.el: Change version to "2.3.4-pre".

* test/lisp/net/tramp-tests.el (ert-x): Require it.
(tramp-test10-write-region): Extend test.
(tramp--test-emacs27-p, tramp--test-windows-nt): New defuns.
(tramp-test11-copy-file, tramp-test12-rename-file)
(tramp-test21-file-links, tramp-test24-file-acl)
(tramp-test25-file-selinux, tramp--test-check-files): Use them.
(tramp-test21-file-links): Do not call `make-symbolic-link' on w32.
Fix file name quoting test.
(tramp-test32-environment-variables-and-port-numbers):
Adapt check for systems which do not support "echo -n".  (Bug#29712)
(tramp-test36-find-backup-file-name): Call also
`convert-standard-filename' due to w32.
(tramp-test41-asynchronous-requests):
Use $REMOTE_PARALLEL_PROCESSES.  Flush cache prior file operations.
(tramp-test42-auto-load, tramp-test42-delay-load)
(tramp-test42-recursive-load, tramp-test42-remote-load-path):
Quote command due to w32.
2018-05-29 09:57:48 +02:00
Gemini Lasswell
0f48d18fd2 Make cl-print respect print-level and print-length (bug#31559)
* lisp/emacs-lisp/cl-print.el (cl-print--depth): New variable.
(cl-print-object) <cons>: Print ellipsis if printing depth greater
than 'print-level' or length of list greater than 'print-length'.
(cl-print-object) <vector>: Truncate printing with ellipsis if
vector is longer than 'print-length'.
(cl-print-object) <cl-structure-object>: Truncate printing with
ellipsis if structure has more slots than 'print-length'.
(cl-print-object) <:around>: Bind 'cl-print--depth'.
* test/lisp/emacs-lisp/cl-print-tests.el
(cl-print-tests-3, cl-print-tests-4): New tests.
2018-05-27 11:38:00 -07:00
Tino Calancha
7dcfdf5b14 replace-tests.el: Refactor undo tests
* test/lisp/replace-tests.el (replace-tests-bind-read-string): New variable.
(replace-tests-with-undo): Add helper macro to generate the boilerplate code.
(replace-tests--query-replace-undo, query-replace-undo-bug31073)
(query-replace-undo-bug31492, query-replace-undo-bug31538): Use it.
2018-05-27 00:58:48 +09:00
Tino Calancha
66c9ab90d5 replace-tests.el: Fix broken tests
After previous commit, all tests using helper function
`replace-tests-clauses' fail: during the expansion
of macro `replace-tests-with-undo', the function
`replace-tests-clauses' is unbound.

Delete those helpers and reimplement test
`query-replace-undo-bug31538'.
* test/lisp/replace-tests.el (query-replace-undo-bug31538):
Reimplement this test without using any helper function/macro.
2018-05-26 12:51:53 +09:00
Tino Calancha
ea133e04f4 query-replace undo: Handle when user edits the replacement string
* lisp/replace.el (perform-replace): Update the replacement string
after the user edit it (Fix Bug#31538).

* test/lisp/replace-tests.el (replace-tests-clauses): New function.
(replace-tests-bind-read-string): New variable.
(replace-tests-with-undo): Macro to create boilerplate code.
(query-replace-undo-bug31073): Use it.
(query-replace-undo-bug31538): New test.
2018-05-26 11:31:26 +09:00
Michael Albinus
9fe9f21515 Fix file name completion in Tramp
* lisp/net/tramp.el (tramp-handle-file-name-directory): Fix case
of localname starts w/o a slash.

* test/lisp/net/tramp-tests.el (tramp-test06-directory-file-name):
Extend test.
2018-05-24 16:55:16 +02:00
Noam Postavsky
6f037f427a Honor print-charset-text-property value of nil (Bug#31376)
* src/print.c (print_check_string_charset_prop): Move check
for nil Vprint_charset_text_property from here...
(print_prune_string_charset): ... to here.
(syms_of_print) <print-charset-text-property>: Clarify that any
non-boolean values are treated the same as `default'.
* doc/lispref/streams.texi (Output Variables): Add
print-prune-string-charset.
* test/src/print-tests.el (print-charset-text-property-nil)
(print-charset-text-property-default)
(print-charset-text-property-t): New tests.
(print-tests--prints-with-charset-p): New helper function.
2018-05-23 07:53:58 -04:00
Tino Calancha
bab73230d1 Fix corner case in query-replace-regexp undo
This commit fixes Bug#31492.
* lisp/replace.el (replace-match-maybe-edit): Preserve match data.

* test/lisp/replace-tests.el (query-replace-undo-bug31492): Add test.
2018-05-23 18:20:36 +09:00
João Távora
c73e6a3111 More helpful docstrings for tests of electric-tests.el
* test/lisp/electric-tests.el (electric-pair-define-test-form):
Improve automatically generated docstring.
2018-05-22 23:05:17 +01:00
Paul Eggert
02f303d75f Fix failed assertion when load-force-doc-strings
Problem reported by Philipp Stephani (Bug#31556).
* src/lread.c (read_vector): When load_force_doc_strings, check
for byte code vectors that are invalid because they are too short.
* test/src/lread-tests.el (lread-invalid-bytecodes): New test.
2018-05-22 12:42:16 -07:00
Michael Albinus
19e642fdb0 Extend secrets.el by searching for object paths.
* lisp/net/secrets.el (secrets-search-item-paths): New function.
(secrets-search-items): Use it.
(secrets-create-item): Adapt docstring.

* test/lisp/net/secrets-tests.el (secrets-test04-search): Extend test.
2018-05-22 11:32:33 +02:00
Paul Eggert
7b9fb7ace4 Don’t assume ordering in make-process/mix-stderr
* test/src/process-tests.el (process-tests--mixable): New function.
(make-process/mix-stderr): Don’t assume stdout is merged before
stderr.  POSIX does not require this, and the assumption failed to
hold on my Fedora 28 platform.  See Bug#31214.
2018-05-21 12:31:54 -07:00
João Távora
f21db9e120 Fix Flymake's ruby-mode tests when user has "rubocop" installed
The Flymake test suite fails if the "rubocop" program is installed,
because the ruby-flymake-rubocop backend is selected automatically by
ruby-flymake-auto.  The test was designed for ruby-flymake-simple,
tough, and fails.

* test/lisp/progmodes/flymake-tests.el (ruby-backend): Ensure
this test runs exclusively with the ruby-flymake-simple backend.
2018-05-21 19:23:42 +01:00
Michael Albinus
ab37ceb9ee Fix Bug#31489
* doc/misc/tramp.texi (Frequently Asked Questions):
Mention `tramp-ignored-file-name-regexp'.  Improve index.

; * etc/NEWS: Mention `tramp-ignored-file-name-regexp'.

* lisp/net/tramp.el (tramp-ignored-file-name-regexp): New defcustom.
(tramp-tramp-file-p): Use it.  Check also for `tramp-mode'.
(tramp-file-name-handler): Don't check for `tramp-mode'.  (Bug#31489)

* test/lisp/net/tramp-tests.el (tramp-test01-file-name-syntax):
Extend test.
2018-05-21 19:48:15 +02:00
Paul Eggert
ee2916c6d2 Use “Cc” for email copies, as per RFC 5322.
Also fix similar problems with Bcc, Fcc, In-Reply-To,
and similar email headers.  See thread starting at:
https://lists.gnu.org/r/emacs-devel/2018-05/msg00463.html
2018-05-20 11:02:50 -07:00
Filipp Gunbin
60ff810144 Fix bugs in `auth-source-netrc-parse-one'.
* lisp/auth-source.el (auth-source-netrc-parse-one): Ensure that match
  data is not overwritten in `auth-source-netrc-parse-next-interesting'.
  Ensure that blanks are skipped before and after going over comments
  and eols.
* test/lisp/auth-source-tests.el (auth-source-test-netrc-parse-one): New test.
2018-05-17 18:44:31 +03:00
Michael Albinus
01120ec3d2 Fix creation of Secret Service items in auth-source
* lisp/auth-source.el (auth-source-secrets-create): Use ´apply'.
(auth-source-secrets-saver): Handle `auth-source-save-behavior'
equal t.

* lisp/net/secrets.el (secrets-get-items): Do not call
`secrets-open-session' here ...
(top): ... but here.

* test/lisp/auth-source-tests.el
(auth-source-test-secrets-create-secret): Bind
`auth-source-save-behavior' to t.  Cleanup.

* test/lisp/net/secrets-tests.el (secrets-test00-availability):
After loading secets.el, a session is already opened.
(secrets-test02-collections, secrets-test03-items)
(secrets-test04-search): Open a new session.
2018-05-16 11:22:51 +02:00
Jay Kamat
a4c616e27a esh-opt.el: Add a :parse-leading-options-only argument (Bug#28323)
* lisp/eshell/esh-opt.el (eshell-eval-using-options): Add a new
:parse-leading-options-only argument which ignores dash/switch
arguments after the first positional argument.
(eshell--process-args): Abort processing of arguments if we see one
positional argument and :parse-leading-options-only is set.
* lisp/eshell/em-tramp.el (eshell/sudo): Use
:parse-leading-options-only, to avoid parsing subcommand switches as
switches of sudo itself.
* test/lisp/eshell/esh-opt-tests.el: Add tests for new and old behavior.
2018-05-15 19:32:49 -04:00
Michael Albinus
b3956d85c7 Fix Bug#29575
* lisp/net/secrets.el (secrets-create-item): The new item does not
need a unique label.
(secrets-item-path, secrets-get-secret, secrets-get-attributes)
(secrets-get-attribute, secrets-delete-item): ITEM can also be an
object path.  (Bug#29575)

* test/lisp/net/secrets-tests.el (secrets-test03-items):
Test also creation of two items with same label.  Test
`secrets-get-secret', `secrets-get-attribute' and
`secrets-get-attributes' with object path.
(secrets-test04-search): Harden test.
2018-05-15 14:48:11 +02:00
Tino Calancha
bb97552784 Run python test if the python executable is found
* test/lisp/progmodes/python-tests.el (python-tests--bug31398):
Skip test when executable python is no found.
2018-05-15 09:03:02 +09:00
Tino Calancha
b015fb0ce3 run-python: Make the buffer running python current
* lisp/progmodes/python.el (run-python, python-shell-make-comint):
Make the buffer running the inferior python process the current buffer
(Bug#31398).
* test/lisp/progmodes/python-tests.el (python-tests--bug31398):
Add test.
2018-05-15 01:30:11 +09:00
Basil L. Contovounesios
81fb3761ef Fix a broken test
* lisp/simple.el (shell-command): Use call-process-shell-command,
start-process-shell-command, and file-attribute-size. (bug#30280)
2018-05-15 01:22:04 +09:00
Michael Albinus
e3d115ae86 Tramp updates
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-attributes):
Parse multibyte symlinks correctly.

* test/lisp/net/tramp/tramp-tests.el (tramp--test-utf8):
Improve backward compatibility.
2018-05-11 18:38:46 +02:00
Glenn Morris
766b057e41 Merge from origin/emacs-26
1d732d6 (origin/emacs-26) Fix gud-statement for pdb
91a68b5 ; * msdos/INSTALL: Add info about GCC versions.
7ddcc9a Document 'custom-group'
58f9e15 A minor addition to etc/DEBUG
4590414 Avoid errors in ispell.el when Enchant returns empty extra chars
d0d75f9 Make 'ispell-initialize-spellchecker-hook' work again
b90ce66 Handle selected_window change in prepare_menu_bars (Bug#31312)
79ad0b3 ; * INSTALL: Fix Emacs version number.  (Bug#31358)
91de88b Fix report-emacs-bug via mailclient on MS-Windows
f4b5ff2 Port collation tests to glibc 2.27
2018-05-07 07:50:49 -07:00
Michael Albinus
6464a8d702 Fix Bug#31272
* lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls)
(tramp-do-directory-files-and-attributes-with-stat)
(tramp-sh-handle-insert-directory): Use "--show-control-chars".
(tramp-convert-file-attributes): Decode multibyte strings,
produced by "stat".  (Bug#31272)

* test/lisp/net/tramp-tests.el (tramp--test-utf8): Extend test.
2018-05-06 12:39:36 +02:00
Basil L. Contovounesios
f2c74543ed Fix off-by-one history pruning (bug#31211)
* lisp/subr.el (add-to-history): Clarify docstring.
Protect against negative history-length and unnecessary variable
modification, as per read_minibuf.

* lisp/ido.el (ido-record-command):
* lisp/international/mule-cmds.el (deactivate-input-method):
(set-language-environment-input-method):
* lisp/isearch.el (isearch-done):
* lisp/minibuffer.el (read-file-name-default):
* lisp/net/eww.el (eww-save-history):
* lisp/simple.el (edit-and-eval-command, repeat-complex-command):
(command-execute, kill-new, push-mark):
* src/callint.c (Fcall_interactively):
* src/minibuf.c (read_minibuf): Delegate to add-to-history.

* test/lisp/simple-tests.el (command-execute-prune-command-history):
* test/src/callint-tests.el
(call-interactively-prune-command-history): New tests.
2018-05-02 20:18:07 -04:00
Paul Eggert
f4b5ff20a6 Port collation tests to glibc 2.27
* test/src/fns-tests.el (fns-tests-collate-strings)
(fns-tests-collate-sort): Don’t make unportable assumptions
about how en_US.UTF-8 collation works.  These assumptions
are not true on Fedora 28, which ships with glibc 2.27.
2018-05-02 11:46:03 -07:00
Michael Albinus
8ae7c424c4 Fix some edge cases of tramp-smb
* lisp/net/tramp-smb.el (tramp-smb-errors):
Add "NT_STATUS_REVISION_MISMATCH".
(tramp-smb-handle-delete-directory): Check, that the directory
has been removed indeed.
(tramp-smb-get-localname): Add further checks on filename syntax.

* lisp/net/tramp.el (tramp-localname-regexp): Do not allow linefeeds.

* test/lisp/net/tramp-tests.el (tramp-smb-get-localname): Declare.
(auth-source-save-behavior): Set it to nil.
(tramp-test01-file-name-syntax): Extend, checking for linefeeds.
(tramp-test03-file-name-host-rules, tramp--test-utf8): Refine tests.
(tramp-test03-file-name-method-rules): New test.
(tramp--test-ignore-add-name-to-file-error): New defmacro.
(tramp-test21-file-links): Use it.
2018-05-02 12:31:51 +02:00
Lars Ingebrigtsen
e859acb11c Rewrite `url-domain' to avoid network traffic
* lisp/url/url-util.el (url-domain): Don't talk DNS to determine
the domain, because this is slow.

* test/lisp/url/url-util-tests.el (url-domain-tests): Add tests
for `url-domain'.
2018-05-01 14:26:38 +02:00
Glenn Morris
41f707d03c * test/src/process-tests.el (make-process/mix-stderr): Skip on hydra. 2018-04-30 12:51:17 -04:00
Juri Linkov
f4eeb0f5ae * lisp/subr.el (dotimes): Deprecate RESULT field. (Bug#16206)
* doc/lispref/control.texi (Iteration):
* doc/misc/cl.texi (Iteration): Document deprecation of its use.
* doc/lispintro/emacs-lisp-intro.texi (dotimes):
* test/src/emacs-module-tests.el (multiply-string):
* test/lisp/filenotify-tests.el (file-notify-test07-many-events):
Place RESULT field after the form.
2018-04-28 23:20:33 +03:00
Eli Zaretskii
a7a3918a16 Fix documentation and tests for 'string-distance'
* src/fns.c (Fstring_distance): Doc fix.

* doc/lispref/strings.texi (Text Comparison): Document
'string-distance'.

* etc/NEWS: Fix wording and mark as documented in the manuals.

* test/src/fns-tests.el (test-string-distance): Move from
subr-tests.el and rename.
2018-04-28 10:27:53 +03:00
Chen Bin
c6e6503900 New function 'string-distance'
* src/fns.c (Fstring_distance): New primitive.
(syms_of_fns): Defsubr it.

* test/lisp/subr-tests.el (subr-tests--string-distance): New test.

* etc/NEWS: Mention 'string-distance'.
2018-04-28 09:56:14 +03:00
Noam Postavsky
b8aa7ecf54 Fix cl-print for circular sublists (Bug#31146)
* lisp/emacs-lisp/cl-print.el (cl-print-object) <cons>: Push each
element of list being printed onto cl-print--currently-printing.
* test/lisp/emacs-lisp/cl-print-tests.el (cl-print-circle-2): New
test.
2018-04-26 07:37:48 -04:00
Michael Albinus
0ecc10a777 Let Tramp save passwords
* lisp/auth-source.el (auth-source-secrets-saver): New defun.
(auth-source-secrets-create): Use it.

* lisp/net/secrets.el (secrets-struct-secret-content-type):
(secrets-create-item): Do not hard-code :xdg:schema.

* lisp/net/tramp.el (tramp-password-save-function): New defvar.
(tramp-read-passwd): Set it properly.
(tramp-process-actions):
* lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
Save password.

* lisp/net/tramp-cmds.el (tramp-bug): Don't report
`tramp-password-save-function'.

* test/lisp/net/secrets-tests.el (secrets-test03-items):
Extend test with another :xdg:schema.
2018-04-23 10:16:06 +02:00
Lars Ingebrigtsen
214ca3b585 Add a test suite for text-property-search 2018-04-22 16:57:16 +02:00
Glenn Morris
2a8f8f7563 Merge from origin/emacs-26
5de608f (origin/emacs-26) Update the documentation of 'perform-replace'
06245b6 * etc/NEWS: Another fix for the last change (noted by Juri Li...
8f6293c Fix use of @key in Texinfo manuals
f4c9894 Improve documentation of actual arglist
ce0e253 ; * etc/NEWS: Improve last change as proposed by Phil Sainty
b89ff0e Don't assume term-current-row cache is valid (Bug#31193)
326a296 ; * etc/NEWS: Mention 'display-buffer-in-major-side-window' c...
3bdc9a1 Fix flyspell-auto-correct-previous-word broken by recent change
a539eb5 * test/src/lread-tests.el (lread-test-bug-31186): New test.
3fa472b Fix undefined behaviour while looking for lexical-binding fil...
4341aac Minor wording improvement in "Bookmarks"

Conflicts:
	test/src/lread-tests.el
2018-04-20 08:07:43 -07:00
Glenn Morris
0ac64af1d4 * test/src/process-tests.el (make-process/mix-stderr): Use bash.
Not all shells support ">&2".
2018-04-18 20:18:33 -04:00
Paul Eggert
5dff4905d7 Fix signal for large integers with valid syntax
* src/lread.c (read_integer): If a radixed integer has valid syntax
but is waayyy too large, signal overflow instead of invalid syntax.
* test/src/lread-tests.el (lread-long-hex-integer): New test.
2018-04-17 16:23:48 -07:00
Eli Zaretskii
a539eb51ac * test/src/lread-tests.el (lread-test-bug-31186): New test. 2018-04-17 18:40:41 +03:00
Philipp Stephani
9f2d21ca53 Avoid undefined behavior in 'defvar' (Bug#31072)
* src/eval.c (Fdefvar): Check that first argument is a symbol.
* test/src/eval-tests.el (defvar/bug31072): New unit test.
2018-04-15 23:50:06 -07:00
Michael Albinus
1f31c1348c Fix Bug#30246
* lisp/auth-source.el (auth-source-secrets-search): Do not
suppress creation.
(auth-source-secrets-create): Implement it.  (Bug#30246)

* lisp/net/secrets.el (secrets-debug): Set default to nil.

* test/lisp/auth-source-tests.el (secrets): Require it.
(auth-source-test-secrets-create-secret): New test.
2018-04-13 15:21:24 +02:00
Lars Ingebrigtsen
9978e88b31 Remove repetitions from recipient addresses in Message
* lisp/gnus/message.el (message--alter-repeat-address): New function.
(message-get-reply-headers): Use it to remove repetitions on the
form "foo@bar.com" <foo@bar.com>.
2018-04-12 14:59:41 +02:00
Shanavas M
10f5f4361b Add tests for buffer-base-buffer function (Bug#30905)
* test/src/buffer-tests.el (test-buffer-base-buffer-indirect)
(test-buffer-base-buffer-non-indirect): New tests for
`buffer-base-buffer'.
2018-04-11 21:16:49 -04:00
Tino Calancha
32dc0cb1b5 Preserve case in query-replace undo
If the user query and replaces 'foo' with 'BAR', then
undo must comeback to 'foo', not to 'FOO' (Bug#31073).
* lisp/replace.el (perform-replace): Bind nocasify to non-nil
value during undo/undo-all actions.
* test/lisp/replace-tests.el (query-replace-undo-bug31073): Add test.
2018-04-09 11:47:47 +09:00
Philipp Stephani
8df23a8204 Document that 'make-process' mixes the output streams
* doc/lispref/processes.texi (Asynchronous Processes):
* src/process.c (Fmake_process): Document that standard error is mixed
with standard output if STDERR is nil.

* test/src/process-tests.el (make-process/mix-stderr): New unit test.
2018-04-07 22:15:42 +02:00
Michal Nazarewicz
8d3bb7beb4 Handle quotation marks and apostrophes in ‘sgml-quote’
To be able to use text in an HTML argument, quotation marks need
to be replaced with an appropriate character reference.  Make
‘sgml-quote’ do that.

While at it, fix entiteis not being unquoted if they lack closing
semicolon (e.g. ‘&amp’) occuring at the very end of a region.
Even though unlikely, make ‘sgml-quote’ handle this scenario.

* lisp/textmodes/sgml-mode.el (sgml-quote): Handle quotation marks and
apostrophes.  Match entities lacking semicolon at the end of regions.
* test/lisp/textmodes/sgml-mode-tests.el (sgml-quote-works): New test
case for ‘sgml-quote’ function.
2018-04-07 11:16:12 +01:00
Michael Albinus
358da4565b Make dbus.el fitter for Emacs configured --without-dbus
* lisp/net/dbus.el (dbus-error, dbus-debug): Define if not exist.

* test/lisp/net/secrets-tests.el: Revert 51c8369fa2 and 79a3ad9592.
2018-04-06 11:49:21 +02:00
Tino Calancha
79a3ad9592 Require secrets.el iif Emacs has dbusbind support
* test/lisp/net/secrets-tests.el: Require secrets.el if
and only if, Emacs has been compiled with dbusbind support.
2018-04-06 10:08:32 +09:00
Tino Calancha
51c8369fa2 Run secrets suite test when Emacs has dbus support
* test/lisp/net/secrets-tests.el (secrets-test00-availability)
(secrets-test01-sessions, secrets-test02-collections)
(secrets-test03-items, secrets-test04-search): Skip test
unless Emacs is compiled with dbus support.
2018-04-06 09:01:21 +09:00
Michael Albinus
b6aea79b00 Add tests for secrets.el
* lisp/net/secrets.el (secrets-lock-collection): New defun.
(secrets-search-items, secrets-create-item): Fix structure of :dict-entry.

* test/lisp/net/secrets-tests.el: New package.
2018-04-05 17:40:57 +02:00
Glenn Morris
f9052b7350 * test/lisp/gnus/message-tests.el (message-all-epg-keys-available-p):
Add skip condition.
2018-04-05 08:58:20 -04:00
Tino Calancha
0b690a83f6 Honor dired-create-destination-dirs if copying/renaming >1 files
Check `dired-create-destination-dirs' when the user wants to
copy/rename several files.
* lisp/dired-aux.el (dired-do-create-files):
Call `dired-maybe-create-dirs' right before bind `into-dir' (Bug#30624).
* test/lisp/dired-aux-tests.el (dired-test-bug30624): Add test.
2018-04-05 12:15:54 +09:00
Damien Cassou
29006a6fd8
Detect if a message can be encrypted and add an MML tag
* lisp/gnus/message.el (message-all-recipients): Return a list of
pairs, one for each recipient in To, Cc, Bcc.
(message-all-epg-keys-available-p): Check that there is a public key
in epg for each recipient of the current message.
(message-sign-encrypt-if-all-keys-available): Add MML tag to sign and
encrypt current message if there is a public key for every recipient
in current message.

* test/lisp/gnus/message-tests.el (message-all-recipients): Test for
message-all-recipients.
2018-04-04 20:32:28 +02:00
Gemini Lasswell
e3525385a8 Fix Testcover bug in handling of vectors containing dotted lists
* lisp/emacs-lisp/testcover.el (testcover-analyze-coverage-compose):
Handle dotted lists. Fix bug#30909.
* test/lisp/emacs-lisp/testcover-resources/testcases.el:
(dotted-list-in-vector-bug-30909): New test case.
(quotes-within-backquotes-bug-25316, dotted-backquote)
(quoted-backquote, backquoted-vector-bug-25316)
(vector-in-macro-spec-bug, backquoted-dotted-alist): Change
docstrings to mention analyzing code instead of reinstrumenting
it.
2018-04-02 09:38:12 -07:00
Noam Postavsky
96b8747d5c Fix another case of freed markers in the undo-list (Bug#30931)
* src/alloc.c (free_marker): Remove.
* src/editfns.c (save_restriction_restore):
* src/insdel.c (signal_before_change): Detach the markers from the
buffer when we're done with them instead of calling free_marker on
them.
* test/src/editfns-tests.el (delete-region-undo-markers-1)
(delete-region-undo-markers-2): New tests.
2018-03-30 14:26:25 -07:00
Michael Albinus
ef0617888c Improve Tramp test performance
* lisp/net/tramp.el (tramp-backtrace): Improve performance.

* test/lisp/net/tramp-tests.el (tramp-test03-file-name-host-rules):
Skip for older Emacsen.
(tramp-test39-utf8): Remove instrumentation.
2018-03-30 12:36:07 +02:00
Paul Eggert
6b3d01dad4 Lisp reader now checks for integer overflow
* doc/lispref/numbers.texi (Integer Basics), etc/NEWS:
Document this.
* src/lisp.h (S2N_IGNORE_TRAILING, S2N_OVERFLOW_TO_FLOAT):
New constants.
* src/lread.c (string_to_number): Change trailing bool arg to
integer argument with flags, to support S2N_OVERFLOW_TO_FLOAT.
All uses changed.
* test/src/editfns-tests.el (read-large-integer): New test.
2018-03-29 11:03:07 -07:00
Michael Albinus
b9340aad79 Fix Bug#30946
* doc/misc/tramp.texi (Multi-hops): Mention host name checks.

* lisp/net/tramp.el (tramp-set-syntax, tramp-dissect-file-name)
(tramp-debug-message, tramp-handle-shell-command):
* lisp/net/tramp-adb.el (tramp-adb-handle-shell-command):
* lisp/net/tramp-archive.el (tramp-archive-file-name-handler)
(tramp-archive-dissect-file-name):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler): Adapt callees.

* lisp/net/tramp-compat.el (tramp-compat-user-error): Move defsubst ---

* lisp/net/tramp-sh.el (tramp-compute-multi-hops): Check for proper
host names in multi-hop.  (Bug#30946)

* lisp/net/tramp.el (tramp-user-error): ... here.  Make it a defun.

* test/lisp/net/tramp-tests.el (tramp-test03-file-name-host-rules):
New test.
2018-03-29 15:59:11 +02:00
Paul Eggert
9ea56457f5 Test notify handlers only if file notification
* test/lisp/files-tests.el:
(files-file-name-non-special-notify-handlers):
Skip if file notification is not available.
2018-03-28 16:33:05 -07:00
Michael Albinus
c77d9ea0e7 Remove unstable tags in Tramp
* test/lisp/net/tramp-tests.el (tramp-test39-utf8)
(tramp-test39-utf8-with-stat, tramp-test39-utf8-with-perl)
(tramp-test39-utf8-with-ls): Remove :unstable tag.
2018-03-28 19:06:42 +02:00
Michael Albinus
e6bb547353 Improve tramp--test-utf8
* test/lisp/net/tramp-tests.el (tramp--test-check-files):
Encode string when testing environment variables.
(tramp--test-utf8): Remove "TaiViet" test.
2018-03-28 18:05:58 +02:00
Stefan Monnier
7bc31c1cd4 (benchmark-run-compiled): Make it work like 'benchmark-run' again
* lisp/emacs-lisp/benchmark.el (benchmark-run): Add special case for
nil repetitions.
2018-03-27 16:19:40 -04:00
Glenn Morris
43f9692728 * test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test-featurep-warnings): New.
2018-03-26 21:56:33 -04:00
Michael Albinus
f5834c9ba0 Fix problem with trailing slash in Tramp
* lisp/net/tramp.el (tramp-handle-file-truename):
* lisp/net/tramp-adb.el (tramp-adb-handle-file-truename):
* lisp/net/tramp-sh.el (tramp-sh-handle-file-truename):
Fix problem with trailing slash.

* test/lisp/net/tramp-tests.el (tramp-test21-file-links):
Test also quoted directories.
2018-03-26 14:33:24 +02:00
Noam Postavsky
1d47d777ef Allow &rest' or &optional' without following variable (Bug#29165)
This is sometimes convenient when writing macros, so that the empty
variable case doesn't need to be handled specially.  Older versions of
Emacs accepted this in some cases (especially the interpreter in Emacs
25 and below was very accepting).

                            |   interpreted/compiled   |
| arglist                   | 25 & earlier | 26  | 27  |
|---------------------------+--------------+-----+-----|
| (&rest)                   | y/n          | n/n | y/y |
| (&rest &rest)             | y/n          | n/n | n/n |
| (&rest &rest x)           | y/n          | n/n | n/n |
| (&rest x &rest)           | y/n          | n/n | n/n |
| (&rest x &rest y)         | y/n          | n/n | n/n |
|---------------------------+--------------+-----+-----|
| (&optional)               | y/n          | n/n | y/y |
| (&optional &optional)     | y/n          | n/n | n/n |
| (&optional x &optional)   | y/n          | n/n | n/n |
| (&optional x &optional y) | y/y          | n/n | n/n |
|---------------------------+--------------+-----+-----|
| (&optional &rest)         | y/n          | n/n | y/y |
| (&optional x &rest)       | y/n          | n/n | y/y |
| (&optional &rest y)       | y/y          | n/n | y/y |
|---------------------------+--------------+-----+-----|
| (&rest &optional)         | y/n          | n/n | n/n |
| (&rest &optional y)       | y/n          | n/n | n/n |
| (&rest x &optional y)     | y/n          | n/n | n/n |

The values in the table above can be produced with the following code:

(with-current-buffer (get-buffer-create "*ck-args*")
  (erase-buffer)
  (dolist (arglist '((&rest)
                     (&rest &rest)
                     (&rest &rest x)
                     (&rest x &rest)
                     (&rest x &rest y)
                     (&optional)
                     (&optional &optional)
                     (&optional x &optional)
                     (&optional x &optional y)
                     (&optional &rest)
                     (&optional x &rest)
                     (&optional &rest y)
                     (&rest &optional)
                     (&rest &optional y)
                     (&rest x &optional y)))
    (insert
     (format "%c/%c\n"
             (condition-case err
                 (progn (funcall `(lambda ,arglist 'ok))
                        ?y)
               (error ?n))
             (condition-case err
                 (progn (byte-compile-check-lambda-list arglist)
                        ?y)
               (error ?n))))
    (display-buffer (current-buffer))))

* src/eval.c (funcall_lambda):
* lisp/emacs-lisp/bytecomp.el (byte-compile-check-lambda-list): Don't
check for missing variables after `&rest' and `&optional'.
* test/src/eval-tests.el (eval-tests--bugs-24912-and-24913)
(eval-tests-accept-empty-optional-rest): Update tests accordingly.
* etc/NEWS: Update announcement accordingly.
* doc/lispref/functions.texi (Argument List): Update manual to
indicate that variable names are optional.
2018-03-25 07:56:35 -04:00
Paul Eggert
42e7e267e5 Avoid Fortran-style floating-point optimization
When optimizing arithmetic operations, avoid optimizations that
are valid for mathematical numbers but invalid for floating-point.
For example, do not optimize (+ 1 v 0.5) to (+ v 1.5), as they may
not be the same due to rounding errors.  In general,
floating-point numbers cannot be constant-folded, since that would
make .elc files platform-dependent.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-associative-math):
Do not optimize floats.
(byte-optimize-nonassociative-math, byte-optimize-approx-equal)
(byte-optimize-delay-constants-math, byte-compile-butlast)
(byte-optimize-logmumble):
Remove; no longer used.
(byte-optimize-minus): Do not optimize (- 0 x) to (- x).
(byte-optimize-multiply): Do not optimize (* -1 x) to (- x).
(byte-optimize-divide): Do not optimize (/ x -1) to (- x).
(logand, logior, logxor): Optimize with byte-optimize-predicate
instead of with byte-optimize-logmumble.
* test/lisp/emacs-lisp/bytecomp-tests.el:
(byte-opt-testsuite-arith-data): Add a couple of test cases.
2018-03-23 12:59:18 -07:00
Michael Albinus
d088137473 Instrument tramp-test39-utf8
* test/lisp/net/tramp-tests.el (tramp--test-expensive-test):
Add the test name to the template.
(tramp-test39-utf8): Instrument test.
2018-03-23 17:39:29 +01:00
Stefan Monnier
3ddff08034 Fix bug#30846, along with misc cleanups found along the way
* test/src/data-tests.el (data-tests-kill-all-local-variables): New test.

* src/buffer.c (swap_out_buffer_local_variables): Remove.
Fuse the body of its loop into that of reset_buffer_local_variables.
(Fkill_buffer, Fkill_all_local_variables): Don't call it any more.
(reset_buffer_local_variables): Make sure the buffer's local binding
is swapped out before removing it from the alist (bug#30846).
Call watchers before actually killing the var.

* src/data.c (Fmake_local_variable): Simplify.
Use swap_in_global_binding to swap out any local binding, instead of
a mix of find_symbol_value followed by messing with where&found.
Don't call swap_in_symval_forwarding since the currently swapped
binding is never one we've modified.
(Fkill_local_variable): Use swap_in_global_binding rather than messing
with where&found to try and trick find_symbol_value into doing the same.

* src/alloc.c (mark_localized_symbol): 'where' can't be a frame any more.
2018-03-23 11:29:06 -04:00
Paul Eggert
011186279c Port emacs-module-tests to 32-bit Emacs
Fix a portability bug when emacs-module-tests.el is byte-compiled
with a 32-bit Emacs (where #x20000000 evaluates to a
floating-point number) and then is run on a 64-bit Emacs (where
the floating-point number causes a test failure).
* test/src/emacs-module-tests.el (mod-test-sum-test):
Don’t assume #x20000000 can be represented as an Emacs integer.
2018-03-22 09:33:33 -07:00
Glenn Morris
0afb436eeb Merge from origin/emacs-26
8ac621b (origin/emacs-26) Document DEFUN attributes
16d0cc7 * etc/NEWS: Add an entry for auth-source-pass.
cc1702f Fix the MSDOS build
daa9e85 Improve warning and error messages
7612dd1 Adjust eieio persistence tests for expected failure
f0cf4dc Let eieio-persistent-read read what object-write has written
40ad1ff Handle possible classtype values in eieio-persistent-read
4ec935d Add new tests for eieio persistence
47917d8 * lisp/gnus/gnus-cloud.el (gnus-cloud-synced-files): Fix doc ...
e32f352 * lisp/ibuf-ext.el (ibuffer-never-search-content-mode): Fix t...
5268f30 * doc/lispref/windows.texi (Selecting Windows): Fix a typo.
143b485 * doc/lispref/internals.texi (Writing Emacs Primitives): Fix ...
4ab4551 Firm up documentation of generalized variables
a5bf099 Improve documentation of Auto-Revert mode
ed05eaa Improvements in dired.texi

Conflicts:
	etc/NEWS
2018-03-22 07:50:37 -07:00
Michael Albinus
aeb107b630 Tag tramp-test39-utf8* as :unstable
* test/lisp/net/tramp-tests.el (tramp-test39-utf8)
(tramp-test39-utf8-with-stat, tramp-test39-utf8-with-perl)
(tramp-test39-utf8-with-ls): Tag the tests as :unstable.
2018-03-22 09:43:44 +01:00
Eric Abrahamsen
7612dd14b6 Adjust eieio persistence tests for expected failure
* test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el
 (eieio-test-persist-hash-and-vector,
  eieio-test-persist-interior-lists): Persistence does not currently
 handle deeply-nested objects. Expect current failures, and mark for
 future fixes.
2018-03-22 10:46:08 +08:00
Pierre Téchoueyres
4ec935dc5b Add new tests for eieio persistence
* test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el:
  (hash-equal): New comparison test for hash-tables.
  (persist-test-save-and-compare): Use test for hash-tables.
  (eieio-test-persist-hash-and-vector,
  eieio-test-persist-interior-lists): New tests.
2018-03-22 10:46:07 +08:00
Paul Eggert
cae9e0fa03 Port data-tests-popcnt to 32-bit Emacs
* test/src/data-tests.el (data-tests-popcnt):
Don’t assume Emacs integers can represent 32-bit quantities.
Change to a simple and straightforward approach, since runtime
performance is not important here.
2018-03-21 16:08:53 -07:00
Paul Eggert
e70d0c9e66 Add tests for Bug#30408
* test/src/editfns-tests.el (format-%d-large-float)
(format-%x-large-float, format-%o-invalid-float): New tests.
2018-03-21 12:11:52 -07:00
Glenn Morris
5648746756 Quieten eieio-test compilation
* test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el:
* test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el:
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el:
Remove obsolete name args where not being explicitly tested.
2018-03-21 14:13:53 -04:00
Paul Eggert
a5f190dd65 Merge from origin/emacs-26
23527013c7 ; Rewrap doc string
4328d5f744 Correct Info link markup
2fb52abd9e Improve documentation of 'with-help-window'
ec08c62f03 Minor improvements in building.texi
663aafe1ff * lisp/textmodes/bibtex.el (bibtex-mark-entry): activate mark
05781b2e88 ; Spelling fix
aa40014ba3 * doc/emacs/building.texi (Starting GUD): Mention 'guiler'.
23072e468f Yet more proofreading of the Emacs manual
ba5a372540 * doc/emacs/rmail.texi: Fix broken link.
6b2210cc29 ; Spelling fix
067c8c4f5b Fix recently-added POP doc glitch
fb3dc0e8aa More proofreading of the Emacs manual
a776ce7be6 Fix typo in the Emacs manual's VC chapter
7f27d42f0b Pass json-readtable-error data as a list (bug#30489)
10bd3b3af8 Improve word motion docs (Bug#30815)
2b8507fbdc Replace "carriage-return" by "carriage return" in manuals
2616cd94f1 Minor copyedits in mule.texi
36a1d52814 Fix problems caused by fontconfig-2.13.0
2018-03-20 08:59:39 -07:00
Michael Albinus
97608c60b8 Extend Tramp's UTF8 tests
* test/lisp/net/tramp-tests.el (tramp--test-utf8):
Apply more exhaustive tests.
2018-03-20 16:33:51 +01:00
Paul Eggert
b39ca55e29 ; Spelling fix 2018-03-19 18:55:14 -07:00
Glenn Morris
6b168a3b24 ; * test/lisp/info-xref-tests.el: Remove stray line from previous. 2018-03-19 17:08:46 -04:00
Glenn Morris
5c8c8f0a49 * test/lisp/info-xref-tests.el (info-xref-test-emacs-manuals): New. 2018-03-19 16:57:28 -04:00
Michael Albinus
1979bce57d Print top time consuming tests if advised
* lisp/emacs-lisp/ert.el (ert-summarize-tests-batch-and-exit):
New argument HIGH.  Print top-running tests.

* test/Makefile.in (check-doit): Use ${SUMMARIZE_TESTS}.

* test/README: Explain SUMMARIZE_TESTS.
2018-03-19 12:58:45 +01:00
Basil L. Contovounesios
7f27d42f0b Pass json-readtable-error data as a list (bug#30489)
* lisp/json.el (json-readtable-dispatch): Fix error data.
* test/lisp/json-tests.el (test-json-read): Check error data is a
list.
2018-03-18 23:13:29 -04:00
Nicolas Petton
9667ba25b4
Fix compilation warnings in subr-x-tests.el
* test/lisp/emacs-lisp/subr-x-tests.el (subr-x-test-if-let*-false)
(subr-x-test-when-let*-false): Make tests simpler and compiler warning
free.
2018-03-18 22:21:30 +01:00
Nicolas Petton
6d2b50a245
Add URL handler for file-name-directory (Bug#30444)
* lisp/url/url-handlers.el (url-handler-file-name-directory): New
function which handles special cases for `file-name-directory' and
URLs.
* test/lisp/url/url-handlers-test.el: New file.  Add tests for
`url-handler-file-name-directory'.
2018-03-18 20:47:35 +01:00
Michael Albinus
bcc146a668 Optimize tramp-tests.el
* test/lisp/net/tramp-tests.el (tramp--test-expensive-test):
Make it a defsubst.  Adapt all callees.
(tramp--test-print-duration): New defmacro.
(tramp-test11-copy-file, tramp-test12-rename-file)
(tramp-test21-file-links, tramp--test-special-characters):
Run some parts only if expensive tests are enabled.  (Bug#30807)
2018-03-17 15:10:46 +01:00
Michael Albinus
bcec2a8a39 Print test timings unconditionally
* lisp/emacs-lisp/ert.el (ert-batch-print-duration): Remove.
(ert-run-tests-batch): Adapt accordingly.

* test/Makefile.in:
* test/README: Remove TEST_PRINT_TEST_DURATION.
2018-03-17 10:25:22 +01:00
Michael Albinus
2d0853f62a Optimize "make check" and "make check-maybe"
* lisp/emacs-lisp/ert.el (ert-run-tests-batch): Print summary duration.

* test/Makefile.in (TEST_LOAD_EL): Set default to "no" for
targets all, check, and check-maybe.  (Bug#30807)

* test/README: Reflect recent changes in Makefile.

* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test99-libarchive-tests): Tag it :unstable.
2018-03-16 16:19:10 +01:00
Glenn Morris
711b94c8bb * test/lisp/ses-tests.el: Quieten compilation. 2018-03-15 12:32:50 -04:00
Eli Zaretskii
9e73c9d038 Support variable-unquoting syntax in bat-mode
* lisp/progmodes/bat-mode.el (bat-font-lock-keywords): Fontify
argument numbers in %~n.  Suggested by Jostein Kjønigsen
<jostein@secure.kjonigsen.net> in emacs-devel.

* test/lisp/progmodes/bat-mode-tests.el
(bat-test-fontification-iter-var-1): Update the test to check also
the %~n construct.
2018-03-15 15:23:01 +02:00
Michael Albinus
c8c486bd38 Fix an error in tramp-archive-test42-auto-load
* test/lisp/net/tramp-archive-tests.el (tramp-archive-test42-auto-load):
Do not use "/ssh::" as test directory, it could harm.  (Bug#30807)
2018-03-15 11:32:50 +01:00
Michael Albinus
d993d00394 ; * test/README: Fix typo 2018-03-14 16:45:45 +01:00
Michael Albinus
84a946a519 Extend ert to print duration of single tests
* lisp/emacs-lisp/ert.el (ert-test-result): New slot ´duration'.
(ert-run-or-rerun-test): Set it.
(ert-batch-print-duration): New defvar.
(ert-run-tests-batch): Print duration if needed.

* test/Makefile.in (TEST_PRINT_TEST_DURATION): New variable.

* test/README: Explain TEST_PRINT_TEST_DURATION.
2018-03-14 16:21:06 +01:00
Noam Postavsky
4c33ad4a24 Fix line-wrapping for term.el (Bug#30775)
* lisp/term.el (term-emulate-terminal): Leave line-wrapping state if
point was moved after we entered it.
* test/lisp/term-tests.el (term-line-wrapping-then-motion): New test.
2018-03-13 21:58:38 -04:00
Glenn Morris
ae80854e9a Try to stop tramp test hangs on hydra
* test/lisp/net/tramp-tests.el (tramp-test41-asynchronous-requests):
Use fewer processes on hydra.
2018-03-13 18:45:38 -04:00
Paul Eggert
a3f26048a9 Merge from origin/emacs-26
5c91ca8 Fix create_process bug breaking eudc-expand-inline
e244fed Clarify that nil doesn't match itself as a cl-case clause (Bu...
df0e7e2 Improve SVG documentation
a34ef52 Document the "URL" keyword in library headers
fbc7f9a * test/lisp/international/mule-tests.el: Avoid local variable...
16faff6 ; * lisp/org/org-table.el: Replace obsolete alias in comment.
2018-03-10 18:30:54 -08:00
Noam Postavsky
60c4cf6311 ; Revert "; Tracing for eieio-test random failure (Bug#24503)"
The tracing seems to prevent the bug from happening.
2018-03-10 21:02:10 -05:00
Glenn Morris
6edbc03f8f * test/Makefile.in (check-declare): New PHONY rule. 2018-03-09 16:39:51 -05:00
Glenn Morris
d3ceff630e Quieten --without-json compilation of json-tests.el
* test/src/json-tests.el (json-serialize, json-insert)
(json-parse-string, json-parse-buffer): Declare.
2018-03-09 16:38:02 -05:00
Glenn Morris
01675be387 * test/lisp/vc/vc-tests.el (w32-application-type): Fix declaration. 2018-03-09 16:36:50 -05:00
Glenn Morris
94a59a6d83 Quieten compilation of some test/lisp files
* test/lisp/dired-tests.el (dired-test-bug27243-02)
(dired-test-bug27243-03, dired-test-bug27899)
(dired-test-with-temp-dirs): Remove unused local variables.
* test/lisp/hi-lock-tests.el (hi-lock-bug26666)
(hi-lock-test-set-pattern): Mark unused arguments.
* test/lisp/ses-tests.el (ses-tests-renamed-cells-row-insertion):
Remove unused global "ses-tests-trigger".
* test/lisp/simple-tests.el (line-number-at-pos-when-passing-point):
Remove unused local "pos".
* test/lisp/emacs-lisp/benchmark-tests.el (benchmark-tests):
Pacify compiler.
* test/lisp/emacs-lisp/package-tests.el (package-test-signed):
Replace obsolete function epg-configuration.
* test/lisp/ls-lisp-tests.el:
* test/lisp/eshell/em-ls-tests.el: Require dired.
* test/lisp/progmodes/ruby-mode-tests.el
(ruby-forward-sexp-skips-method-calls-with-keyword-names):
* test/lisp/vc/diff-mode-tests.el
(diff-mode-test-ignore-trailing-dashes): Replace interactive funcs.
2018-03-09 15:04:59 -05:00
Glenn Morris
fbc7f9ae44 * test/lisp/international/mule-tests.el:
Avoid local variables confusion.
2018-03-09 14:05:36 -05:00
Michael Heerdegen
f6bd7e0686 Revert last commit
This reverts commit af4697faa1.  It's
too late for this to be in the release.
2018-03-06 18:32:04 +01:00
Michael Heerdegen
af4697faa1 Define if-let* and derivatives as aliases for if-let etc
This commit reverts declaring `if-let' and `when-let' obsolete in
favor of the new `if-let*' and `when-let*' versions because of the
compiler warning mess (Bug#30039).  Instead we make foo-let* aliases
for foo-let.  The old single-tuple variable spec case is still
supported for backward compatibility.
* lisp/emacs-lisp/subr-x.el (if-let, when-let): Don't declare
obsolete.  Tweak edebug specs.
(and-let): Renamed from `and-let*' for compatibility with the names
`if-let' and `when-let'.
(if-let*, when-let*, and-let*): Define as aliases for `if-let',
`when-let' and `and-let'.
* test/lisp/emacs-lisp/subr-x-tests.el (if-let-single-tuple-case-test)
(when-let-single-tuple-case-test): New tests for the single-binding
tuple case.
In the whole file, prefer the names without "*".
2018-03-06 15:47:05 +01:00
Stefan Monnier
9793a46168 * test/lisp/emacs-lisp/package-tests.el: Improve signature tests
(package-test-signed): Don't rely on return value of 'package-install'.
Make sure 'package-install' does indeed install the package.
2018-02-22 17:00:00 -05:00
Glenn Morris
3267763e6b Speed up parallel make check by testing slower files first
* test/Makefile.in (SLOW_TESTS): New variable.
(ELFILES): Move slow tests to the front.
2018-02-21 20:49:40 -05:00
Glenn Morris
4fa90ff8f5 Merge from origin/emacs-26
e5a2933 (origin/emacs-26) lisp/vc/: documentation fixes
f21f8e6 Document 'desktop-files-not-to-save'
d8917eb Improve documentation of Profiling features
b228839 Improve indexing of "performance" in ELisp manual
ab67b3e Minor change in Emacs manual's VC chapter
c352434 Avoid memory corruption with specpdl overflow + edebug (Bug#3...
593bbda Document comment-fill-column in the manual (Bug#11636)
bd4cc8d * doc/emacs/dired.texi (Marks vs Flags): Copyedits.
69107f3 ; Fix doc typos related to indefinite articles
aaad1e6 Merge branch 'emacs-26' of git.savannah.gnu.org:/srv/git/emac...
5906418 More fixes for the Emacs manual
9ab3df1 ; Fix doc typos related to indefinite articles
66a4e65 ; Fix doc typos related to indefinite articles
35e5c57 ; Fix doc typos related to indefinite articles
2018-02-17 07:50:28 -08:00
Allen Li
0f5cc9a085 Preserve special abbrev properties when writing
Fixes bug#29924

* lisp/abbrev.el (abbrev--write): Write abbrev properties when set.
2018-02-17 08:47:20 -05:00
Noam Postavsky
c352434ab8 Avoid memory corruption with specpdl overflow + edebug (Bug#30481)
If grow_specpdl fails due to outgrowing max_specpdl_size, it will
signal an error *before* growing the specpdl array.  Therefore, when
handling the signal, specpdl_ptr points past the end of the specpdl
array and any further use of of specpdl before unwinding (e.g., if
edebug binds signal-hook-function) will cause memory corruption.
* src/eval.c (signal_or_quit): Don't call `signal-hook-function' if
the specpdl_ptr is already past the end of the specpdl array.
* test/src/eval-tests.el (eval-tests--exceed-specbind-limit)
(eval-exceed-specbind-with-signal-hook): New test & helper function.
2018-02-16 22:13:34 -05:00
Noam Postavsky
82379efaaf ; Add test for iter-lambda variable shadowing (Bug#26073)
* test/lisp/emacs-lisp/generator-tests.el
(iter-lambda-variable-shadowing): New test.
2018-02-14 21:31:06 -05:00
Glenn Morris
875cb835f0 Merge from origin/emacs-26
0276743 (origin/emacs-26) Doc string fix in latin-alt.el
c9269af Minor improvements in package.texi
898a3e4 Minor improvement in Emacs user manual
8f7d718 * doc/lispref/anti.texi (Antinews): Replace 25.2 with 25.3.
989d0af Improve documentation of mini-window resizing
923e415 More changes in the Emacs manual
565adf2 Clarify that text-quoting-style doesn't affect *Info* (Bug#24...
2dd273b Mention that shell quoting of % on w32 may fail (Bug#19350)
19fa6d5 Fix --no-build-details for w32 and macOS
979944c * doc/lispref/anti.texi (Antinews): Add some more antinews.
c2727e3 Fix crashes when run with --no-build-details
dc08490 More changes for the manual
04c5bd5 Doc fixes for process functions (Bug#30349)
e209034 Fix shr and CSS 4 color maps
5fe8192 Yet another round of improvements in the manual

Conflicts:
	doc/emacs/files.texi
	test/lisp/subr-tests.el
2018-02-09 11:12:48 -08:00
Stefan Monnier
6b183f85e0 * lisp/emacs-lisp/cl-macs.el (cl--sm-macroexpand): Handle lambda!
(cl--old-macroexpand): Remove.
(cl--sm-macroexpand): Change its calling convention, so it can use
advice-add.  Extend re-binding treatment of vars so it applies to all
var-introducing forms rather than only to 'let'.
(cl-symbol-macrolet): Use advice-add rather than fset.
2018-02-08 21:41:21 -05:00
Noam Postavsky
2dd273b985 Mention that shell quoting of % on w32 may fail (Bug#19350)
* doc/lispref/os.texi (Security Considerations): Mention that quoting
of '%' assumes no '^' in variable names.
* test/lisp/subr-tests.el (shell-quote-argument-%-on-w32): New test,
demonstrating what doesn't work.
2018-02-08 19:10:11 -05:00
Basil L. Contovounesios
e209034536 Fix shr and CSS 4 color maps
* lisp/net/shr-color.el (shr-color-html-colors-alist): Fix typos.
Add RebeccaPurple.
* lisp/textmodes/css-mode.el (css--color-map): Add fuchsia-magenta
and aqua-cyan aliases.
* test/lisp/textmodes/css-mode-tests.el (css-test-property-values):
Bump color count.
2018-02-07 22:14:00 +01:00
Glenn Morris
a0c7157a16 Merge from origin/emacs-26
c787a49 (origin/emacs-26) * lisp/vc/vc-git.el (vc-git-print-log): Res...
b654791 * doc/emacs/misc.texi (Interactive Shell): Refer to node "Min...
f1102d2 Yet another round of fixing the Emacs manual
76b5a68 * etc/NEWS: Expunge the solecism "allow(s)" + infinitive
b4ff8cc Two minor fixes in Antinews
aafcd12 * etc/NEWS: Rename image-dired-thumb-job-limit
a893924 * lisp/simple.el (async-shell-command, shell-command): Fix gr...
699081f Fix deferred display of async shell-command buffers
d2d5e54 Mention remote file name completion in Emacs manual
f589f5a Yest another round of manual copyedits
1ed4089 Update xdisp.c commentary
e23de39 Fix Bug#30324
e1a9dc0 Recognize Org as builtin package (bug#30310)

Conflicts:
	etc/NEWS
2018-02-05 07:50:22 -08:00
Michael Albinus
c24c5dc4a4 Fix inconsistency expanding "//" in Tramp
* doc/misc/tramp.texi (File name completion): Adapt example
expanding "//".

* lisp/net/tramp.el (tramp-handle-substitute-in-file-name): "//" shall
expand the localname only, even when on top of the local part.

* test/lisp/net/tramp-tests.el (tramp-test04-substitute-in-file-name):
Adapt test.
2018-02-05 14:02:49 +01:00
Michael Albinus
d2630e4569 Make tramp-archive fit for older Emacsen
* lisp/net/tramp-archive.el (tramp-archive-enabled)
(tramp-archive-file-name-handler-alist)
(tramp-archive-file-name-handler): Adapt docstring.
(tramp-register-archive-file-name-handler): Remove it from
`after-init-hook' when unloading.
(tramp-archive-gvfs-host): New defsubst.
(tramp-archive-dissect-file-name): Use it.

* lisp/net/tramp-cmds.el (tramp-cleanup-all-connections):
Check that `tramp-archive-enabled' is bound.

* test/lisp/net/tramp-archive-tests.el (tramp-archive-test42-auto-load):
Check also that tramp-archive is not loaded when Tramp is loaded.
(tramp-archive-test42-delay-load): Adapt test messages.
2018-02-04 13:25:10 +01:00
Philipp Stephani
a34c7d7470 Add tests to verify error propagation in 'json-insert'.
* test/src/json-tests.el (json-tests--error): New error symbol.
(json-insert/signal, json-insert/throw): New tests.
2018-02-03 21:14:59 +01:00
Noam Postavsky
9da8da2c41 Don't require all file-attributes to be equal (Bug#30327)
* test/lisp/files-tests.el (files-tests-file-attributes-equal): New
function.
(files-tests-file-name-non-special-directory-files-and-attributes)
(files-tests-file-name-non-special-file-attributes): Use it instead of
`equal'.
2018-02-03 14:36:14 -05:00
Michael Albinus
a057771a5a * test/lisp/files-tests.el (files-tests--with-temp-non-special):
Expand `temporary-file-directory' by `file-truename', in case
it is located on a symlinked directory.  (Bug#30327)
2018-02-03 20:08:29 +01:00
Michael Albinus
a2cb52cd2e Prevent loading tramp-archive when it cannot be used
* lisp/files.el (locate-dominating-file): Check, that FILE is
a directory when traversing the tree.

* lisp/net/tramp-archive.el (tramp-archive-enabled): New defvar.
(tramp-archive-file-name-regexp): Protect against errors.
(tramp-archive-file-name-handler)
(tramp-register-archive-file-name-handler): Use it.
(all) Call `tramp-register-archive-file-name-handler'.

* lisp/net/tramp.el (tramp-register-file-name-handlers):
Use `tramp-archive-enabled'.

* test/lisp/net/tramp-archive-tests.el (all):
Use `tramp-archive-enabled' instead of `tramp-gvfs-enabled'.
(tramp-archive--test-emacs27-p): New defun.
(tramp-archive-test42-auto-load): Skip for older Emacsen.
(tramp-archive-test42-delay-load): Skip for older Emacsen.
Test also behavior when `tramp-archive-enabled' is nil.
2018-02-03 18:49:56 +01:00
Michael Albinus
84c9dba4ce Autoload tramp-archive
* doc/misc/tramp.texi (Archive file names): Do not require to
load Tramp explicitly, this is autoloaded now also for file archives.

* lisp/net/tramp-archive.el (tramp-archive-suffixes)
(tramp-archive-compression-suffixes): Autoload them.
(tramp-archive-autoload-file-name-regexp): New defmacro.
(tramp-archive-file-name-regexp): Use it.
(tramp-register-archive-file-name-handler): New defun.  Call
it in `after-init-hook'.

* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test40-file-system-info): Rename from
`tramp-archive-test40-archive-file-system-info.
(tramp-archive-test42-auto-load)
(tramp-archive-test42-delay-load): New tests.
2018-02-03 13:22:56 +01:00
Glenn Morris
e1a9dc0af6 Recognize Org as builtin package (bug#30310)
* lisp/org/org.el: Add Version header so detected as builtin package.
* test/lisp/org/org-tests.el: New file.
2018-02-02 21:09:09 -05:00
Noam Postavsky
2b288eb900 ; Merge from emacs-26
4c8157cfe0 ; Let files-tests.el pass multiple times in a session
99251ab62e ; Avoid process kill query during term tests
2018-02-02 18:12:37 -05:00
Noam Postavsky
4c8157cfe0 ; Let files-tests.el pass multiple times in a session
* test/lisp/files-tests.el (files-test-local-variables): Use `cl-letf'
instead of advice.  The advice was not being activated on the second
run.
2018-02-02 18:09:13 -05:00
Noam Postavsky
99251ab62e ; Avoid process kill query during term tests
* test/lisp/term-tests.el (term-test-screen-from-input): Just unset
the process query-on-exit flag to rather than trying to end the
process before the end of test (which is generally unreliable).
2018-02-02 18:08:50 -05:00
Philipp Stephani
0443411f5c Properly integrate modules into the loading process (Bug#30164).
* src/lread.c (Fload): Don't defer to module-load immediately when
encountering a module, but use the normal loading machinery to
properly set up load-history, check for recursive loads, print
messages, etc.

* test/src/emacs-module-tests.el (module/load-history): New test.
(module/describe-function-1): Adapt test.

* etc/NEWS: Mention fixed behavior.
2018-02-02 20:56:01 +01:00
Philipp Stephani
75c663f834 Use 'defalias' in test module instead of 'fset'.
This puts functions defined in the module into the 'load-history'.

* test/data/emacs-module/mod-test.c (bind_function): Use 'defalias'
instead of 'fset'.

* test/src/emacs-module-tests.el (module/describe-function-1): Adapt
unit test.
2018-02-02 20:40:10 +01:00
Philipp Stephani
f3d0db7f0f Add support for module functions to C-h f (Bug#30163).
* lisp/help-fns.el (help-fns-function-description-header): Handle
module functions.

* test/src/emacs-module-tests.el (module/describe-function-1): New
test.
2018-02-02 20:31:40 +01:00
Michael Albinus
344750aef4 Handle quoted remote file names for file notifications
* lisp/filenotify.el (file-notify-add-watch): Do not suppress
other file name handlers when FILE is quoted.

* test/lisp/filenotify-tests.el
(file-notify-test-remote-temporary-file-directory):
Beware quoted `temporary-file-directory'.

* test/lisp/files-tests.el
(files-tests-file-name-non-special-quote-unquote): Improve test.
2018-02-02 18:51:25 +01:00
Michael Albinus
e08de2bae2 Handle quoted file names in filenotify.el
* lisp/filenotify.el (file-notify-add-watch): Do not save
quoted file names in `file-notify-descriptors'.

* test/lisp/files-tests.el
(files-file-name-non-special-notify-handlers): Do not expect
to fail.
2018-02-01 20:15:12 -05:00
Michael Albinus
00c65bcf4e Use file-name-quote{,d-p} in files-tests.el
* test/lisp/files-tests.el
(files-tests-file-name-non-special-quote-unquote): New test.
(files-tests--file-name-non-special--subprocess): Simplify.
(files-tests--file-name-non-special--buffers)
(files-tests--with-temp-non-special)
(files-tests-file-name-non-special-directory-file-name)
(files-tests-file-name-non-special-file-in-directory-p)
(files-tests-file-name-non-special-file-name-all-completions)
(files-tests-file-name-non-special-file-name-as-directory)
(files-tests-file-name-non-special-file-name-completion)
(files-tests-file-name-non-special-file-name-directory)
(files-tests-file-name-non-special-find-backup-file-name)
(files-tests-file-name-non-special-make-nearby-temp-file):
Use `file-name-quote' and `file-name-quoted-p', respectively.
2018-02-01 20:15:11 -05:00