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
Gemini Lasswell
e09120d686 Add backtrace-mode and use it in the debugger, ERT and Edebug
* doc/lispref/debugging.texi (Using Debugger): Remove explanation of
backtrace buffer.  Refer to new node.
(Backtraces): New node.
(Debugger Commands): Refer to new node.  Remove 'v'.
* doc/lispref/edebug.texi (Edebug Misc): Refer to new node.
* doc/misc/ert.texi (Running Tests Interactively): Refer to new node.

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

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

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

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

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

* tests/lisp/emacs-lisp/ert-tests.el (ert-test--which-file):
Use backtrace-frame slot accessor.
2018-08-03 08:53:02 -07:00
Gemini Lasswell
8a7620955b Add methods for strings to cl-print
* lisp/emacs-lisp/cl-print.el (cl-print-object) <string>: New method.
(cl-print-object-contents) <string>: New method.
(cl-print--find-sharing): Look in string property lists.

* test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-3): Test
printing of long strings.
(cl-print-tests-4): Test printing of strings nested in other objects.
(cl-print-tests-strings, cl-print-tests-ellipsis-string): New
tests.
2018-08-03 08:53:02 -07:00
Gemini Lasswell
eba16e5e58 Support ellipsis expansion in cl-print
* lisp/emacs-lisp/cl-print.el (cl-print-object-contents): New
generic method.
(cl-print-object-contents) <cons, vector,cl-structure-object>: New
methods.
(cl-print-object) <cons>: Use cl-print-insert-ellipsis.
(cl-print-object) <vector, cl-structure-object>: Elide whole object if
print-level exceeded.  Use cl-print-insert-ellipsis.
(cl-print-insert-ellipsis, cl-print-propertize-ellipsis)
(cl-print-expand-ellipsis): New functions.

* test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-4): Test
printing of objects nested in other objects.
(cl-print-tests-strings, cl-print-tests-ellipsis-cons)
(cl-print-tests-ellipsis-vector, cl-print-tests-ellipsis-struct)
(cl-print-tests-ellipsis-circular): New tests.
(cl-print-tests-check-ellipsis-expansion)
(cl-print-tests-check-ellipsis-expansion-rx): New functions.
2018-08-03 08:53:01 -07:00
Gemini Lasswell
df7371b84e Fix Edebug spec for cl-macrolet (bug#29919)
Add an Edebug matching function for cl-macrolet which keeps track of
its bindings and treats them as macros without Edebug specs when found
in the body of the expression.
* lisp/emacs-lisp/edebug.el (edebug--cl-macrolet-defs): New variable.
(edebug-list-form-args): Use it.
(edebug--current-cl-macrolet-defs): New variable.
(edebug-match-cl-macrolet-expr, edebug-match-cl-macrolet-name)
(edebug-match-cl-macrolet-body): New functions.
* lisp/emacs-lisp/cl-macs.el (cl-macrolet): Use cl-macrolet-expr
for Edebug spec.
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-cl-macrolet):
New test.
* test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
(edebug-test-code-use-cl-macrolet): New function.
2018-08-01 13:59:49 -07:00
Stephen Berman
22d463ed5c Fix todo-mode commands called on done items separator
The done items separator is not reachable by todo-mode navigation
commands, but it is e.g. by C-n and C-p.  Ensure that invoking
todo-mode commands with point on the separator does not result in
unexpected results, errors or file corruption (bug#32343).

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

* test/lisp/calendar/todo-mode-tests.el: Require ert-x.
(todo-test--insert-item): Add formal parameters of
todo-insert-item--basic.
(todo-test--done-items-separator): New function.
(todo-test-done-items-separator01-bol)
(todo-test-done-items-separator01-eol)
(todo-test-done-items-separator02-bol)
(todo-test-done-items-separator02-eol)
(todo-test-done-items-separator03-bol)
(todo-test-done-items-separator03-eol)
(todo-test-done-items-separator04-bol)
(todo-test-done-items-separator04-eol)
(todo-test-done-items-separator05-bol)
(todo-test-done-items-separator05-eol)
(todo-test-done-items-separator06-bol)
(todo-test-done-items-separator06-eol)
(todo-test-done-items-separator07): New tests.
2018-08-01 14:42:57 +02:00
Stephen Berman
951c5a127f Fix wdired test failure when byte compiled (bug#32318)
* test/lisp/wdired-tests.el: Require wdired.  Defvar dired-query
to silence byte-compiler.
2018-07-31 00:42:52 +02:00
Stephen Berman
0252f7311f * test/lisp/wdired-tests.el (wdired-test-symlink-name): New test. 2018-07-30 14:12:50 +02:00
Paul Eggert
d7052cf393 Merge from origin/emacs-26
39d3e8b Fix last change in 'char_width'
67679f0 Add initial tests for wdired.el
2018-07-29 09:47:10 -07:00
Stephen Berman
67679f0c08 Add initial tests for wdired.el
* test/lisp/wdired-tests.el: New file.
2018-07-29 00:22:02 +02:00
Glenn Morris
4713f5d742 Merge from origin/emacs-26
bd52f37 (origin/emacs-26) ; Fix last change: only MinGW runtime 5.0.2...
024d20f Fix compilation with mingw.org's MinGW 5.x headers
38b6748 Update the list of special forms in the ELisp manual
8579105 Don't fail to indent-sexp before a full sexp (Bug#31984)
d24c5f2 Fix calls to modifications hooks in replace-buffer-contents
71a9151 * src/character.c (char_width): Support glyphs with faces.  (...
0feb673 Display raw bytes as belonging to 'eight-bit' charset
2e2f00f ; * doc/emacs/mule.texi (International Chars): Fix last change.
00561b5 Fix inaccurate text in the user manual
5cfb7a3 Copyedits in tramp.texi, improved example with bash's readline
6f8f358 Minor Tramp doc update
2585fcb File Shadowing is not available on MS Windows
39da592 ; Minor markup change in indent.texi
2f00ffe ; bookmark-jump: Add comment about last change.
2018-07-28 07:50:36 -07:00
Noam Postavsky
8579105393 Don't fail to indent-sexp before a full sexp (Bug#31984)
* lisp/emacs-lisp/lisp-mode.el (indent-sexp): Only signal error if the
initial forward-sexp fails.  Suppress scan-error forn any of the
forward-sexp calls after that.
* test/lisp/emacs-lisp/lisp-mode-tests.el (indent-sexp-cant-go): New
test.
2018-07-27 19:41:39 -04:00
Michael Albinus
22f549e305 ; More instrumentation for shadowfile-tests.el 2018-07-27 15:49:31 +02:00
Michael Albinus
a8f2d97b12 ; More instrumentation for shadowfile-tests.el 2018-07-26 16:12:15 +02:00
Paul Eggert
4a56ca5bbf %o and %x can now format signed integers
Optionally treat integers as signed numbers with %o
and %x format specifiers, instead of treating them as
a machine-dependent two’s complement representation.
This option is more machine-independent, allows formats
like "#x%x" to be useful for reading later, and is
better-insulated for future changes involving bignums.
Setting the new variable ‘binary-as-unsigned’ to nil
enables the new behavior (Bug#32252).
This is a simplified version of the change proposed in:
https://lists.gnu.org/r/emacs-devel/2018-07/msg00763.html
I simplified that proposal by omitting bitwidth modifiers, as
I could not find an any example uses in the Emacs source code
that needed them and doing them correctly would have been
quite a bit more work for apparently little benefit.
* doc/lispref/strings.texi (Formatting Strings):
Document that %x and %o format negative integers in a
platform-dependent way.  Also, document how to format
numbers so that the same values can be read back in.
* etc/NEWS: Document the change.
* src/editfns.c (styled_format): Treat integers as signed
numbers even with %o and %x, if binary-as-unsigned is nil.
Support the + and space flags with %o and %x, since they’re
about signs.
(syms_of_editfns): New variable binary-as-unsigned.
* test/src/editfns-tests.el (read-large-integer):
Test that maximal integers can be read after printing
with all integer formats, if binary-as-unsigned is nil.
2018-07-26 00:39:17 -07:00
Michael Albinus
244b682725 ; More instrumentation for shadowfile-tests.el 2018-07-25 22:04:34 +02:00
Michael Albinus
7d96ed541c ; More instrumentation for shadowfile-tests.el 2018-07-25 20:48:10 +02:00
Michael Albinus
2585fcb1d7 File Shadowing is not available on MS Windows
* doc/emacs/files.texi (File Shadowing): File Shadowing is not
available on MS Windows.

* test/lisp/shadowfile-tests.el (shadow-test00-clusters)
(shadow-test01-sites, shadow-test02-files)
(shadow-test03-expand-cluster-in-file-name)
(shadow-test04-contract-file-name, shadow-test05-file-match)
(shadow-test06-literal-groups, shadow-test07-regexp-groups)
(shadow-test08-shadow-todo, shadow-test09-shadow-copy-files):
Skip under MS Windows.
2018-07-25 17:34:55 +02:00
Michael Albinus
c67407e752 Instrument shadowfile{-tests} for error hunting on hydra.
* lisp/shadowfile.el (shadow-make-fullname): Use changed
`tramp-make-tramp-file-name' from Tramp 2.4.

* test/lisp/shadowfile-tests.el (shadow-test08-shadow-todo):
Instrument test.  Suppress errors in cleanup.
(shadow-test09-shadow-copy-files): Suppress errors in cleanup.
2018-07-25 13:18:46 +02:00
Glenn Morris
64f94785c7 Merge from origin/emacs-26
f64c277 (origin/emacs-26) Let bookmark-jump override window-point (Bu...
1208aaa Omit keymap from subword-mode docstring (Bug#32212)
2b70b54 Prevent line-mode term from showing user passwords
5de4441 Check for special filenames in eshell (Bug#30724)
1b4b965 Fix indent-sexp of #s(...) (Bug#31984)
59e8533 Add save-match-data to abbreviate-file-name (Bug#32201)
47f75b1 Fix last change in editfns.c
671dc5a Fix calls to buffer modification hooks from replace-buffer-co...
cc4ceed ; etc/NEWS: Remove unnecessary reference to a bug number.
e0f33ea Fix Bug#32226
7308fa0 Improve doc strings of several variables in keyboard.c
2018-07-24 06:40:58 -07:00
Michael Albinus
e23727978d thread-join returns the result of finished thread
* doc/lispref/threads.texi (Basic Thread Functions):
* etc/NEWS: Document return value of `thread-join'.

* src/thread.c (invoke_thread_function, Fmake_thread)
(init_main_thread): Set result.
(Fthread_join): Propagate signals, and return result.
(Vmain_thread): New defvar.

* src/thread.h (struct thread_state): Add `result' field.

* test/src/thread-tests.el (threads-join): Test also return value.
(threads-join-error): New test.
(threads-mutex-signal): Check for propagation of `quit' signal.
2018-07-22 11:53:24 +02:00
Noam Postavsky
1b4b96597c Fix indent-sexp of #s(...) (Bug#31984)
* lisp/emacs-lisp/lisp-mode.el (indent-sexp): Look for a sexp that
ends after the current line.
* test/lisp/emacs-lisp/lisp-mode-tests.el (indent-sexp-go): New test.
2018-07-21 21:07:07 -04:00
Michael Albinus
e0f33ea394 Fix Bug#32226
* lisp/shadowfile.el (shadow-site-name, shadow-name-site):
Use "[-.[:word:]]+" as hostname regexp.  (Bug#32226)

* test/lisp/shadowfile-tests.el (shadow-test06-literal-groups)
(shadow-test07-regexp-groups, shadow-test08-shadow-todo)
(shadow-test09-shadow-copy-files): Skip if needed.
2018-07-21 12:29:06 +02:00
Glenn Morris
6ee0032461 Merge from origin/emacs-26
3e72298 Improve documentation of 'pcase-defmacro rx'
ba9b9bb Fix TTY colors breakage by 'clear-face-cache'
f56ad42 * admin/MAINTAINERS: Add files maintained by me (Michael Albi...
7a258fa Adapt shadowfile.el for Tramp  (Bug#4526, Bug#4846)
cb50077 Fix auth-source-delete (Bug#26184)
a4767a6 Avoid assertion violations in gnutls.c
90110f8 Don't use a literal "C-u" in ispell.el  help message text
f4e7f6d Improve documentation of 'seqp'
ed13639 Clarify usage and dependencies between several Flyspell features

Conflicts:
	etc/NEWS
	test/lisp/auth-source-tests.el
2018-07-20 10:00:32 -07:00
Michael Albinus
61de292c72 Fix (Bug#32218). Do not merge with master
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.3.4.26.2".
(customize-package-emacs-version-alist): Add Tramp version
integrated in Emacs 26.2.

* 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.  (Bug#32218)

* test/lisp/net/tramp-tests.el (tramp-test21-file-links):
Remove `tramp--test-emacs27-p' check.
2018-07-20 10:56:41 +02:00
Michael Albinus
7a258fa0bb Adapt shadowfile.el for Tramp (Bug#4526, Bug#4846)
* etc/NEWS: Mention changes in shadowfile.el.

* lisp/shadowfile.el (top): Require 'tramp instead of 'ange-ftp.
(shadow-cluster): New defstruct.
(shadow-make-cluster, shadow-cluster-name, shadow-cluster-primary)
(shadow-cluster-regexp, shadow-get-user)
(shadow-parse-fullname): Remove.
(shadow-info-file, shadow-todo-file, shadow-system-name)
(shadow-homedir, shadow-regexp-superquote, shadow-suffix)
(shadow-set-cluster, shadow-get-cluster, shadow-site-name)
(shadow-name-site, shadow-site-primary, shadow-site-cluster)
(shadow-read-site, shadow-parse-name, shadow-make-fullname)
(shadow-replace-name-component, shadow-local-file)
(shadow-expand-cluster-in-file-name, shadow-contract-file-name)
(shadow-same-site, shadow-file-match, shadow-define-cluster)
(shadow-define-literal-group, shadow-define-regexp-group)
(shadow-make-group, shadow-shadows-of-1, shadow-read-files)
(shadow-write-info-file, shadow-write-todo-file)
(shadow-initialize): Adapt variables and functions.

* test/lisp/shadowfile-tests.el: New file.
2018-07-18 16:51:56 +02:00
Paul Eggert
c70d22f70b Fix bug with eql etc. on NaNs
Fix a bug where eql, sxhash-eql, memql, and make-hash-table
were not consistent on NaNs.  Likewise for equal,
sxhash-equal, member, and make-hash-table.  Some of these
functions ignored NaN significands, whereas others treated
them as significant.  It's more logical to treat significands
as significant, and this typically makes eql a bit more
efficient on floats, with just one integer comparison instead
of one to three floating-point comparisons.
* doc/lispref/numbers.texi (Float Basics): Document that
NaNs are never numerically equal, but might be eql.
* src/fns.c (WORDS_PER_DOUBLE): Move to top level of this file.
(union double_and_words): Now named, and at the top level of this file.
(same_float): New function.
(Fmemql, Feql, internal_equal, cmpfn_eql): Use it, so that
the corresponding functions treat NaNs consistently.
(sxhash_float): Simplify based on above-mentioned changes.

* test/src/fns-tests.el (fns-tests-equality-nan): New test.
2018-07-18 03:18:53 -07:00
Noam Postavsky
cb50077b1e Fix auth-source-delete (Bug#26184)
* lisp/auth-source.el (auth-source-delete): Fix `auth-source-search'
call.
* test/lisp/auth-source-tests.el (auth-source-delete): New test.
2018-07-17 21:28:26 -04:00
Michael Albinus
798cbac170 Add variable main-thread, fix Bug#32169
* doc/lispref/threads.texi (Basic Thread Functions): Add example,
how to propagate signals to the main thread.  Describe variable
`main-thread'.  Document optional argument CLEANUP of
`thread-last-error'.

* src/thread.c (Fthread_last_error): Add optional argument
CLEANUP.  (Bug#32169)
(main-thread): New defvar.

* test/src/thread-tests.el (thread-last-error): Adapt declaration.
(main-thread): Declare.
(threads-main-thread): New test.
(threads-errors): Extend test.
2018-07-17 12:03:43 +02:00
Noam Postavsky
46d7c78632 ; Remove tracing for epg-tests (Bug#23561) 2018-07-16 07:12:07 -04:00
Noam Postavsky
6de91809a3 ; Trace epg-tests (Bug#23561) 2018-07-15 19:09:36 -04:00
Noam Postavsky
7acb87ab97 Don't test symmetric operations on gpg 2.0 (Bug#23561)
On the Hydra test machines, which have gpg 2.0, the symmetric tests
fail.
* test/lisp/epg-tests.el (with-epg-tests): Pass REQUIRE-PUBLIC-KEY to
`epg-tests-find-usable-gpg-configuration' and call it before
`epg-make-context' so that the latter uses the resulting cached
config.
(epg-tests-find-usable-gpg-configuration): Only allow gpg 2.0 for
symmetric operations.  Clear `epg--configurations' and don't pass
NO-CACHE to `epg-find-configuration'.
(epg-tests--config-program-alist): Use copy-tree to avoid modifying
the epg-config--program-alist cons values.
* test/lisp/emacs-lisp/package-tests.el (package-test-signed): Allow
running with gpg 2.0.
2018-07-15 16:26:22 -04:00
Michael Albinus
02db06fc8e Fix Bug#32147
* test/lisp/net/secrets-tests.el (secrets-test02-collections)
(secrets-test03-items): Test for both "Login" or "login"
collection.  (Bug#32147)
2018-07-15 09:47:08 +02:00
Noam Postavsky
b1ebc12339 Update package.el test for message format changes
* test/lisp/emacs-lisp/package-tests.el (package-test-signed): Update
the expected message.  The message was changed in 2018-06-25 "Reformat
package.el message strings for future l10n".
(with-package-test, with-fake-help-buffer): Add debug declarations.
2018-07-15 00:15:52 -04:00
Noam Postavsky
10a7e91956 Fix gpg detection for tests (Bug#23561)
* test/lisp/emacs-lisp/package-tests.el (package-test-signed): Stop
using epg-check-configuration and ignore-errors, they're redundant
because epg-find-configuration already does all that.
* test/lisp/epg-tests.el (epg-tests-find-usable-gpg-configuration):
Remove tracing.
(with-epg-tests): Skip test if no gpg config is found.
(epg-decrypt-1 epg-roundtrip-1, epg-sign-verify-1, epg-sign-verify-2)
(epg-import-1): Don't check gpg configuration at top-level, rely on
`with-epg-tests' instead.  Checking the gpg configuration requires a
valid HOME (or GNUPGHOME), which is provided by `with-epg-tests'.
2018-07-14 23:45:27 -04:00
Noam Postavsky
5936f6cdac ; Trace epg-tests gpg config finding (Bug#23561) 2018-07-14 09:01:39 -04:00
Glenn Morris
cda7e1850f Merge from origin/emacs-26
17ebb6e (origin/emacs-26) Use consistent function names in thread-tes...
1c86229 Fix format error in Faccept_process_output
b38b91a Lessen stack consumption in recursive read1
3eb4603 Match w32 paths in grep sans --null hits (Bug#32051)
5cc7c4b Fix previous make-network-process change
d6a1b69 Another documentation improvement in flyspell.el
9b49a8e Improve documentation of Flyspell
3744fda Provide feature 'threads
ef9025f Save the server alias on reconnect (Bug#29657)
db3874b Refer to "proper lists" instead of "true lists"
35e0305 Avoid turning on the global-minor-mode recursively
51bf4e4 Fix Bug#32085
2018-07-13 09:28:15 -07:00
Basil L. Contovounesios
1013e0392b Tweak subr-x.el substring functions
* lisp/emacs-lisp/subr-x.el (string-join): #'-quote function symbol.
(string-trim-left, string-trim-right):
Make better use of substring for minor speedup.
* test/lisp/emacs-lisp/subr-x-tests.el
(subr-x-test-string-trim-left, subr-x-test-string-trim-right)
(subr-x-test-string-remove-prefix)
(subr-x-test-string-remove-suffix): New tests.
2018-07-13 11:28:16 -04:00
Basil L. Contovounesios
70d702d3b1 Fix custom-available-themes file expansion
For discussion, see thread starting at
https://lists.gnu.org/archive/html/emacs-devel/2018-05/msg00222.html.
* lisp/custom.el: (custom-available-themes): Use directory-files
instead of performing arbitrary wildcard expansion in file names.
(custom-theme--load-path): Document return value.
* test/lisp/custom-tests.el: New file.
(custom-theme--load-path): New test.
2018-07-13 11:28:16 -04:00
Michael Albinus
17ebb6e5ae Use consistent function names in thread-tests.el
* test/src/thread-tests.el (threads-call-error, threads-custom)
(threads-errors, threads-sticky-point, threads-signal-early):
Rename, using naming convention to prefix with "threads-".
2018-07-13 14:28:12 +02:00
Tom Tromey
27980e3604 Make ash and lsh handle bignums
* src/data.c (ash_lsh_impl): Handle bignums.
* test/src/data-tests.el (data-tests-ash-lsh): New test.
2018-07-12 22:12:28 -06:00
Tom Tromey
cca0e79ea8 Make logb handle bignums
* src/floatfns.c (Flogb): Handle bignums.
* test/src/floatfns-tests.el (bignum-logb): New test.
2018-07-12 22:12:28 -06:00
Tom Tromey
3dea8f8f53 Make % and mod handle bignums
* src/data.c (Frem, Fmod): Handle bignums.
* src/lisp.h (CHECK_INTEGER_COERCE_MARKER): New macro.
* test/src/data-tests.el (data-tests-check-sign)
(data-tests-%-mod): New tests.
2018-07-12 22:12:28 -06:00
Tom Tromey
8fb995b9e3 Make min and max handle bignums
* src/data.c (minmax_driver): Handle bignums.
* test/src/data-tests.el (data-tests-minmax): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
a770fb4428 Make logcount handle bignums
* src/data.c (Flogcount): Handle bignums.
* test/src/data-tests.el (data-tests-logcount): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
0d868917ef Make 1+ and 1- handle bignums
* src/data.c (Fadd1, Fsub1): Handle bignums.
* test/src/data-tests.el (data-tests-1+, data-tests-1-): New tests.
2018-07-12 22:12:27 -06:00
Tom Tromey
025adce2cf Make abs handle bignums
* src/floatfns.c (Fabs): Handle bignums.
* test/src/floatfns-tests.el (bignum-abs): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
872faabbd8 Allow conversion of bignums to floats
* src/floatfns.c (extract_float, Ffloat): Handle bignums.
* src/lisp.h (XFLOATINT): Handle bignums.
* test/src/floatfns-tests.el (bignum-to-float): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
d14808cd27 Make format handle bignums
* src/editfns.c (styled_format): Handle bignums.
* test/src/editfns-tests.el (read-large-integer): Update.
(format-bignum): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
23eab9a6a6 Make number-to-string work for bignums
* src/data.c (Fnumber_to_string): Handle bignum.
* test/src/data-tests.el (data-tests-number-to-string): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
6d4bf2ceda Add some bignum tests
* test/src/data-tests.el (data-tests-bignum, data-tests-+)
(data-tests-/, data-tests-number-predicates): New tests.
* test/src/fns-tests (test-bignum-eql): New test.
* test/src/lread-tests (lread-long-hex-integer): Expect bignum.
* test/src/print-tests (print-bignum): New test.
2018-07-12 22:12:27 -06:00
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