1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-19 10:22:27 +00:00
Commit Graph

2393 Commits

Author SHA1 Message Date
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