1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-16 09:50:25 +00:00
Commit Graph

3522 Commits

Author SHA1 Message Date
Michael Albinus
45fd45a283 ; Fix docstring in Tramp
* test/lisp/net/tramp-tests.el
(tramp-test32-shell-command-dont-erase-buffer): Fix docstring.
2020-02-02 11:26:09 +01:00
Mattias Engdegård
32763dac46 Replace add-to-list to lexical variable with push (bug#39373)
Since 'add-to-list', being a plain function, cannot access lexical
variables, such use must be rewritten for correctness.
(Some instances actually do work thanks to a compiler macro,
but it's not something code should rely on.)

* lisp/autoinsert.el (auto-insert-alist):
* lisp/cedet/mode-local.el (mode-local-print-bindings):
* lisp/net/tramp-cache.el (tramp-flush-connection-properties)
(tramp-list-connections):
* lisp/net/zeroconf.el (zeroconf-list-service-names)
(zeroconf-list-service-types, zeroconf-list-services):
* lisp/org/org.el (org-reload):
* lisp/whitespace.el (whitespace-report-region):
* test/lisp/emacs-lisp/map-tests.el (test-map-do):
Replace add-to-list with push.
2020-02-01 22:27:23 +01:00
Michael Albinus
bb1d42b955 Implement `shell-command-dont-erase-buffer' in Tramp. (Bug#39067)
* lisp/net/tramp.el (tramp-handle-shell-command):
Handle `shell-command-dont-erase-buffer'.  (Bug#39067)

* test/lisp/net/tramp-tests.el (shell-command-dont-erase-buffer):
Declare.
(tramp-test10-write-region, tramp-test21-file-links): Use function
symbols.
(tramp--test-async-shell-command): Don't assume that
`async-shell-command' returns the process object.
(tramp-test32-shell-command): Rework `async-shell-command-width' test.
(tramp-test32-shell-command-dont-erase-buffer): New test.
2020-02-01 14:29:45 +01:00
Lars Ingebrigtsen
1ed7cd41db Give fuller support for obsolete ---12 dates in iso8601
* lisp/calendar/iso8601.el
(iso8601--outdated-reduced-precision-date-match): New constant.
(iso8601--date-match): Use it.
2020-01-30 03:02:48 +01:00
Lars Ingebrigtsen
7c7b91b9fe Make iso8601.el understand two obsolete forms
* lisp/calendar/iso8601.el (iso8601-parse-date): Understand some
obsolete formats to provide compatibility with the vCard RFC
(bug#39347).
2020-01-30 02:11:15 +01:00
Michael Albinus
e1c93a02dd Fix problems in Tramp's async-shell-command
* lisp/net/tramp-adb.el (tramp-adb-handle-make-process):
* lisp/net/tramp-cache.el (top):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process):
Use `insert-file-contents-literally'.

* lisp/net/tramp.el (tramp-parse-file):
Use `insert-file-contents-literally'.
(tramp-handle-shell-command): Reorganize error-buffer handling.
(tramp-handle-start-file-process): Use `consp' instead of `listp'.

* test/lisp/net/tramp-tests.el (tramp-test31-interrupt-process):
Bind `delete-exited-processes'.
(tramp--test-async-shell-command): Bind `delete-exited-processes'.
Add additional `accept-process-output'.  Move cleanup of output
buffer ...
(tramp-test32-shell-command): ... here.  Test error buffer also
for `async-shell-command'.
2020-01-27 10:11:32 +01:00
Stefan Kangas
e97da6b08b Add more tests for bookmark-bmenu-list
* test/lisp/bookmark-tests.el (cl-lib): Require.
(bookmark-test-bmenu-toggle-filenames)
(bookmark-test-bmenu-toggle-filenames/show)
(bookmark-test-bmenu-show-filenames)
(bookmark-test-bmenu-hide-filenames)
(bookmark-test-bmenu-bookmark, bookmark-test-bmenu-mark)
(bookmark-test-bmenu-any-marks, bookmark-test-bmenu-unmark)
(bookmark-test-bmenu-delete, bookmark-test-bmenu-locate): New
tests.

(bookmark-test-bmenu-edit-annotation/show-annotation): Rename from
'bookmark-bmenu-edit-annotation/show-annotation'.
(bookmark-test-bmenu-send-edited-annotation): Rename from
'bookmark-bmenu-send-edited-annotation'.
(bookmark-test-bmenu-send-edited-annotation/restore-focus): Rename
from 'bookmark-bmenu-send-edited-annotation/restore-focus'.
2020-01-26 04:11:38 +01:00
Mattias Engdegård
0c6c8aa002 Remove (or double) redundant backslashes in string literals
See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00749.html .

* lisp/obsolete/iswitchb.el (iswitchb-summaries-to-end):
* test/src/regex-emacs-tests.el (regex-tests-BOOST-frob-escapes):
* test/lisp/help-fns-tests.el (help-fns-test-lisp-macro)
(help-fns-test-lisp-defun, help-fns-test-lisp-defsubst)
(help-fns-test-alias-to-defun, help-fns-test-bug23887):
Double backslashes for desired effect.
* lisp/org/ol.el (org-link-escape):
* lisp/net/nsm.el (nsm-protocol-check--rsa-kx)
(nsm-protocol-check--anon-kx, nsm-protocol-check--sha1-sig):
* lisp/obsolete/old-whitespace.el (whitespace-buffer):
* lisp/obsolete/rcompile.el (remote-compile-run-before):
* lisp/obsolete/vi.el (vi-end-of-blank-delimited-word):
* lisp/obsolete/vip.el (vip-current-major-mode)
(vip-paren-match, vip-switch-to-buffer)
(vip-switch-to-buffer-other-window, vip-kill-buffer)
(vip-get-ex-token, ex-edit):
* lisp/org/org-element.el (org-element--cache-sync-requests):
* lisp/org/org.el (org-sparse-tree):
* lisp/textmodes/reftex.el (reftex-report-bug):
* test/lisp/ibuffer-tests.el (ibuffer-save-filters):
* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--insert-failing-lines):
* test/lisp/simple-tests.el (undo-test-kill-c-a-then-undo):
* test/lisp/textmodes/conf-mode-tests.el (conf-test-toml-mode):
* test/src/regex-emacs-tests.el (regex-tests-compare):
Remove redundant backslashes.
2020-01-24 23:04:34 +01:00
Paul Eggert
a391ffa2f0 Fix iso8601-parse so unknown DST is -1, not nil
The convention in a decoded time’s dst flag is that t means DST,
nil means standard time, and -1 means unknown.  This differs from
the convention for other components of a decoded time, where nil
means unknown.  Fix some places where iso8601-parse mistakenly
treated nil as meaning that the dst flag was unknown.
* doc/lispref/os.texi (Time Parsing):
Adjust to match parse-time-string’s doc string.
* lisp/calendar/iso8601.el (iso8601-parse):
Set dst flag to nil if a numeric time zone or "Z" is given.
(iso8601--decoded-time): Default dst flag to -1 if no dst
flag or zone is given.
* lisp/calendar/time-date.el (decoded-time-set-defaults):
When we don’t have a time zone, set the dst flag consistently
with DEFAULT-ZONE.
* test/lisp/calendar/iso8601-tests.el (test-iso8601-date-years)
(test-iso8601-date-dates, test-iso8601-date-obsolete)
(test-iso8601-date-weeks, test-iso8601-date-ordinals)
(test-iso8601-time, test-iso8601-combined)
(test-iso8601-duration, test-iso8601-intervals)
(standard-test-dates, standard-test-time-of-day-local-time)
(standard-test-time-of-day-fractions)
(nonstandard-test-time-of-day-decimals)
(standard-test-time-of-day-beginning-of-day)
(standard-test-date-and-time-of-day, standard-test-interval):
Adjust tests to match fixed behavior.
2020-01-24 13:41:56 -08:00
Stefan Kangas
fcad41c14d Add tests for version comparison predicates
* test/lisp/subr-tests.el (subr-test-version-list-<)
(subr-test-version-list-=, subr-test-version-list-<=): New tests.
2020-01-24 18:28:53 +01:00
Michael Albinus
ff630b5693 Adapt tramp-test32-shell-command
* test/lisp/net/tramp-tests.el (tramp-test32-shell-command):
Test error buffer for synchronous `shell-command' only.
2020-01-24 14:42:12 +01:00
Paul Eggert
6f580542c1 Fix crash when sending Gnus message (Bug#39207)
* src/alloc.c (resize_string_data): The string must be multibyte.
When not bothering to reallocate, do bother to change the byte count.
* test/src/alloc-tests.el (aset-nbytes-change) New test.
2020-01-22 23:44:34 -08:00
Michael Albinus
63f69e935e Minor cleanup in {autorevert,filenotify,shadowfile}-tests.el
* test/lisp/autorevert-tests.el (tramp-message-show-message):
* test/lisp/shadowfile-tests.el (tramp-message-show-message):
* test/lisp/filenotify-tests.el (tramp-message-show-message)
Do Not set.
(file-notify-test04-autorevert): Inhibit messages.
2020-01-22 11:45:26 +01:00
Damien Cassou
abb2515b0c * test/lisp/auth-source-pass-tests.el: Test for multiple ports. 2020-01-22 07:37:01 +01:00
Glenn Morris
215ceadcc8 Merge from origin/emacs-27
154cd116be (origin/emacs-27) * admin/release-process: Adapt bug numbe...
fd19282134 Fix shell-tests failures
891f7de8ed * test/lisp/simple-tests.el: Full path to Emacs binary (bu...
92f30d62c0 * lisp/tab-line.el (tab-line-auto-hscroll): Fix for long t...
dde313151d * lisp/menu-bar.el (menu-bar-options-menu): Add desktop-sa...
3543b9fad9 ; Fix a test (Bug#39067)
83f9fe44fa ; * etc/NEWS: Fix typo.
2eb0b7835d Fix shell-command-dont-erase-buffer feature
c134978a76 Remove reference to Emacs 19 from FAQ
fabf0065c5 Doc fixes in package.el

# Conflicts:
#	etc/NEWS
2020-01-20 07:50:30 -08:00
Glenn Morris
519de2f88e Merge from origin/emacs-27
f3d30b5303 Remove some doc references to old Emacs versions
4217bc229b Fix infloop in shell.el
74b151195d Fix erc-notifications-notify for non-PRIVMSGs, broken in l...
db4436eaf9 Fix the notification action for PRIVMSG in erc-notificatio...
36a4068105 ERC: New maintainer.
2391d3f45d ; spelling fixes
e898442be3 Honor tags-case-fold-search during xref identifer completion

# Conflicts:
#	etc/NEWS
2020-01-20 07:50:26 -08:00
Mattias Engdegård
fd19282134 Fix shell-tests failures
* test/lisp/shell-tests.el (shell-tests-completion-before-semi):
Go back to actually testing completion before semicolon.
(shell-tests-completion-after-semi): Test completion after semicolon,
correctly (bug#39075).
2020-01-20 15:52:27 +01:00
Mattias Engdegård
891f7de8ed * test/lisp/simple-tests.el: Full path to Emacs binary (bug#39067). 2020-01-20 14:27:38 +01:00
Tino Calancha
3543b9fad9 ; Fix a test (Bug#39067)
* test/lisp/simple-tests.el (with-shell-command-dont-erase-buffer):
Use flag -Q to prevent from loading site-lisp files.
2020-01-19 22:01:17 +01:00
Michael Albinus
0ad895df50 Sync with Tramp 2.5.0-pre
* doc/misc/tramp.texi:  Protext Tramp x.y and Emacs x.y by @w{}.
(GVFS-based methods): Move "GNOME Online Accounts" index.
(Customizing Methods, Android shell setup, File name completion)
(Frequently Asked Questions): Fix typos.

* doc/misc/trampver.texi: Change version to "2.5.0-pre".

* lisp/net/trampver.el: Change version to "2.5.0-pre".
(inhibit-message): Don't declare.

* lisp/net/tramp.el: Bump version to 2.5.0-pre.  Require Emacs 25.1.
(tramp-debug-message): Simplify.
(tramp-message): Don't use `tramp-message-show-message'.
(tramp-with-demoted-errors, with-parsed-tramp-file-name)
(with-tramp-file-property, with-tramp-connection-property):
Adapt `declare' form.
(with-tramp-progress-reporter): Suppress progress reporter when
noninteractive.
(tramp-completion-mode, tramp-completion-mode-p): Remove.

* lisp/net/tramp-compat.el (tramp-compat-process-running-p)
(format-message): Remove compatibility code.
(tramp-compat-directory-name-p)
(tramp-compat-tramp-file-name-slots): Remove.

* lisp/net/tramp.el (tramp-debug-message, tramp-message)
(tramp-backtrace, tramp-error, tramp-error-with-buffer)
(tramp-user-error, tramp-with-demoted-errors)
(tramp-signal-hook-function):
* lisp/net/tramp-compat.el (tramp-compat-funcall)
* lisp/net/tramp-gvfs.el (tramp-dbus-function):
Add `tramp-suppress-trace' property.

* lisp/net/tramp.el (tramp-get-method-parameter)
(tramp-dissect-file-name, tramp-error, tramp-error-with-buffer)
(tramp-user-error, with-parsed-tramp-file-name)
(with-tramp-progress-reporter, tramp-file-name-handler)
(tramp-completion-file-name-handler, tramp-autoload-file-name-handler)
(tramp-register-file-name-handlers, tramp-connectable-p)
(tramp-handle-file-modes, tramp-handle-file-regular-p)
(tramp-handle-file-truename, tramp-handle-insert-directory)
(tramp-handle-load, tramp-set-file-uid-gid):
* lisp/net/tramp-adb.el (tramp-adb-file-name-handler)
(tramp-adb-handle-file-truename, tramp-adb-handle-copy-file)
(tramp-adb-handle-rename-file):
* lisp/net/tramp-archive.el (with-parsed-tramp-archive-file-name):
* lisp/net/tramp-cache.el (tramp-get-file-property, tramp-cache-print):
* lisp/net/tramp-compat.el (tramp-compat-process-running-p)
(tramp-compat-exec-path):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler)
(tramp-gvfs-dbus-byte-array-to-string)
(tramp-gvfs-do-copy-or-rename-file):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler)
(tramp-rclone-do-copy-or-rename-file):
* lisp/net/tramp-sh.el (tramp-sh-handle-file-truename)
(tramp-sh-handle-copy-directory, tramp-do-copy-or-rename-file)
(tramp-sh-handle-insert-directory, tramp-sh-file-name-handler)
(tramp-maybe-open-connection):
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler)
(tramp-smb-handle-copy-file, tramp-smb-handle-copy-directory)
(tramp-smb-handle-copy-file, tramp-smb-handle-insert-directory)
(tramp-smb-handle-rename-file, tramp-smb-maybe-open-connection):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler)
(tramp-sudoedit-do-copy-or-rename-file)
(tramp-sudoedit-handle-file-truename):
Use `if-let', `when-let', `directory-name-p', `inhibit-message',
`non-essential and `cl-struct-slot-info'.  Don't use `seconds-to-time'.

* test/lisp/net/tramp-archive-tests.el (tramp-message-show-message):
Don't set.

* test/lisp/net/tramp-tests.el (inhibit-message): Don't declare.
(tramp-message-show-message): Don't set.
(tramp-test06-directory-file-name): Use `non-essential'.
(tramp-test10-write-region): Use `inhibit-message'.
(tramp-test36-vc-registered): No special handling for old Emacsen.
(tramp--test-emacs25-p): Remove.
(tramp-test45-unload): Special case of `tramp-completion-mode'.
2020-01-19 14:11:07 +01:00
Tino Calancha
2eb0b7835d Fix shell-command-dont-erase-buffer feature
* lisp/simple.el (shell-command-dont-erase-buffer):
The default, nil, is backward compatible, i.e. it erases the buffer
only if the output buffer is not the current one; the new value 'erase
always erases the output buffer.
Update docstring.

(shell-command-save-pos-or-erase):
Add optional arg output-to-current-buffer.
Rename it so that it's not internal.  All callers updated.

(shell-command-set-point-after-cmd): Rename it so that it's not internal.
All callers updated.
Adjust it to cover a side case.

(shell-command): Adjust logic to match the specification (Bug#39067).
Enable the feature when the output buffer is the current one.

(shell-command-on-region): Little tweak to follow
`shell-command-dont-erase-buffer' specification.

* test/lisp/simple-tests.el (with-shell-command-dont-erase-buffer):
Add helper macro.
(simple-tests-shell-command-39067)
(simple-tests-shell-command-dont-erase-buffer): Add tests.

* doc/emacs/misc.texi (Single Shell): Update manual.

* etc/NEWS (Single shell commands): Announce the change.
2020-01-19 11:13:02 +01:00
Pieter van Oostrum
4217bc229b Fix infloop in shell.el
* test/lisp/shell-tests.el (shell-tests-completion-before-semi):
Amend the shell.el tests to catch errors such as bug#39057.

* lisp/shell.el (shell--parse-pcomplete-arguments): Skip the
semi-colon as well.  This avoids inflooping when a semi-colon is
typed by the user.  (Bug#39057)

Copyright-paperwork-exempt: yes
2020-01-18 11:54:03 +02:00
Glenn Morris
215d9fcb79 Merge from origin/emacs-27
52080b5778 (origin/emacs-27) * lisp/minibuffer.el (read-file-name-def...
e4cec1fd10 ; * etc/NEWS: Fix some file name quotations.
13995f31a2 Make emacs prefer an existing ~/.emacs.d to an existing XD...
91cac24952 ; etc/NEWS minor edits
5505babc07 Describe --with-cairo non-support for bitmapped fonts.
caf00066ee Mention GTK font chooser changes in NEWS
23b87db628 ; Unmaintain fortran elisp
3b0d1a50aa f90: handle F2008 module function
55803cc189 Move shell-related menu items to "Shell Commands" submenu ...
2be48605c0 * admin/notes/font-backend: Remove outdated file. (Bug#34663)
f07a470124 Declare the ftx font backend driver obsolete
6c08a430fb ; Fix wording of a comment.

# Conflicts:
#	admin/notes/font-backend
#	etc/NEWS
2020-01-16 07:50:22 -08:00
Simon Josefsson
f7ff3ddc16
Add SASL SCRAM-SHA-256 support.
* lisp/net/sasl.el (sasl-mechanisms): Add SCRAM-SHA-256.
(sasl-mechanism-alist): Ditto.
* lisp/net/sasl-scram-sha256.el: New file.
* tests/lisp/net/sasl-scram-rfc-tests.el (sasl-scram-sha-256-test):
New function.
2020-01-16 08:54:04 +01:00
Glenn Morris
3b0d1a50aa f90: handle F2008 module function
* lisp/progmodes/f90.el (f90-font-lock-keywords-1)
(f90-looking-at-program-block-start):
Handle F2008 "module function" and subroutine.  (Bug#38415)
* test/lisp/progmodes/f90-tests.el (f90-test-bug38415): New test.
2020-01-15 18:47:51 -08:00
Michael Albinus
06caa3b7e5 Refactor Tramp async process code
* lisp/net/tramp-adb.el (tramp-adb-handle-make-process):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process):
Update stderr buffer when process has finished.  Do not call
`auto-revert'.

* test/lisp/net/tramp-tests.el (tramp-test31-interrupt-process):
Tag it :unstable.  Change `accept-process-output' arguments.
(tramp--test-async-shell-command): New defun.
(tramp--test-shell-command-to-string-asynchronously): Use it.
(tramp-test32-shell-command): Refactor code.
2020-01-14 11:46:42 +01:00
Paul Eggert
724af76715 Fix sxhash-equal on bytecodes, markers, etc.
Problem reported by Pip Cet (Bug#38912#14).
* doc/lispref/objects.texi (Equality Predicates):
Document better when ‘equal’ looks inside objects.
* doc/lispref/windows.texi (Window Configurations):
Don’t say that ‘equal’ looks inside window configurations.
* etc/NEWS: Mention the change.
* src/fns.c (internal_equal):
Do not look inside window configurations.
(sxhash_obj): Hash markers, byte-code function objects,
char-tables, and font objects consistently with Fequal.
* src/window.c (compare_window_configurations):
Now static.  Remove last argument.  Caller changed.
* test/lisp/ffap-tests.el (ffap-other-window--bug-25352):
Use compare-window-configurations, not ‘equal’.
* test/src/fns-tests.el (test-sxhash-equal): New test.
2020-01-07 11:29:42 -08:00
Michael Albinus
dd85664d23 Implement stderr in tramp-adb-handle-make-process
* lisp/net/tramp-adb.el (tramp-adb-handle-make-process):
Implement `stderr'.

* lisp/net/tramp-sh.el (tramp-sh-handle-make-process):
Flush connection properties in time.

* test/lisp/net/tramp-tests.el (tramp-test30-make-process)
(tramp-test32-shell-command): Test asynchronous stderr for tramp-adb.
2020-01-07 13:13:03 +01:00
Michael Albinus
4f2b41503b ; Adapt tramp-tests.el
* test/lisp/net/tramp-tests.el (tramp-test30-make-process):
(tramp-test32-shell-command): Extend for asynchronous stderr.
2020-01-06 12:24:16 +01:00
Philipp Stephani
fc92c2d894 Also print function data when printing module functions.
This is especially useful in cases where modules only use a single
entry point and use the data to dispatch to the actual function.  Such
a design is common for languages such as Go and C++.

* src/emacs-module.c (module_function_data): New function.

* src/print.c (print_vectorlike): Use it to print module function data
if not NULL.
(print_object): Adapt size of buffer.

* test/data/emacs-module/mod-test.c (emacs_module_init): Pass some
non-NULL data to ‘mod-test-sum’.
(Fmod_test_sum): Check that correct data is passed through.

* test/src/emacs-module-tests.el (mod-test-sum-test)
(module-function-object): Adapt unit tests.
2020-01-05 16:07:28 +01:00
Philipp Stephani
fb38d367f4 Make module function finalizer test less brittle.
* test/src/emacs-module-tests.el (module/function-finalizer): Create
100 leaked functions to increase the probability that at least one
gets garbage-collected.
2020-01-04 12:34:10 +01:00
Philipp Stephani
48ffef5ef4 Implement finalizers for module functions (Bug#30373)
* src/module-env-28.h: Add new module environment functions to
module environment for Emacs 28.

* src/emacs-module.h.in: Document that 'emacs_finalizer' also works
for function finalizers.

* src/emacs-module.c (CHECK_MODULE_FUNCTION): New function.
(struct Lisp_Module_Function): Add finalizer data member.
(module_make_function): Initialize finalizer.
(module_get_function_finalizer)
(module_set_function_finalizer): New module environment functions.
(module_finalize_function): New function.
(initialize_environment): Initialize new environment functions.

* src/alloc.c (cleanup_vector): Call potential module function
finalizer during garbage collection.

* test/data/emacs-module/mod-test.c (signal_error): New helper
function.
(memory_full): Use it.
(finalizer): New example function finalizer.
(Fmod_test_make_function_with_finalizer)
(Fmod_test_function_finalizer_calls): New test module functions.
(emacs_module_init): Define them.

* test/src/emacs-module-tests.el (module/function-finalizer): New unit
test.

* doc/lispref/internals.texi (Module Functions): Document new
functionality.
(Module Misc): Move description of 'emacs_finalizer' type to 'Module
Functions' node, and add a reference to it.

* etc/NEWS: Mention new functionality.
2020-01-03 19:24:10 +01:00
Paul Eggert
c6fb86b40b Merge from origin/emacs-27
186152ba40 Pacify gcc -Wunused-function on Ubuntu 18.04.3
4cd143aded Fix copyright years by hand
365e01cc9f Update copyright year to 2020
cd2c156163 ; * etc/NEWS: Make the description of XDG fallback more ac...

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
2020-01-01 01:08:16 +00:00
Paul Eggert
4cd143aded Fix copyright years by hand
These are dates that admin/update-copyright did not update.
2020-01-01 01:01:53 +00:00
Paul Eggert
365e01cc9f Update copyright year to 2020
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2020-01-01 00:59:52 +00:00
Glenn Morris
331f3f9104 Merge from origin/emacs-27
9b6872b4e4 ; * test/lisp/calc/calc-tests.el: Fix warnings
957cdca6f0 Make minibuffer-tests work in out-of-tree builds (bug#38816)
2065316749 Make comint-tests more robust (bug#38813)
2019-12-31 07:50:15 -08:00
Mattias Engdegård
9b6872b4e4 ; * test/lisp/calc/calc-tests.el: Fix warnings 2019-12-30 21:02:10 +01:00
Mattias Engdegård
957cdca6f0 Make minibuffer-tests work in out-of-tree builds (bug#38816)
* test/lisp/minibuffer-tests.el (completion-table-test-quoting):
Set default-directory.
2019-12-30 21:01:14 +01:00
Mattias Engdegård
2065316749 Make comint-tests more robust (bug#38813)
* test/lisp/comint-tests.el (comint-test-no-password-function)
(comint-test-password-function-with-value)
(comint-test-password-function-with-nil):
Call accept-process-output as many times as needed, with a slightly
more generous timeout (100 ms), after sending the Password: prompt to
the process, since there must be time for some back-and-forth
communication.  Also clear the process-query-on-exit flag, since it
doesn't go well with noninteractive tests.
2019-12-30 21:00:27 +01:00
Michael Albinus
248c5e103d Sync with Tramp 2.4.3
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.4.3".

* lisp/net/tramp.el: Bump version.
(tramp-handle-shell-command): The temp file for error-buffer is remote.

* test/lisp/net/tramp-tests.el (tramp-test30-make-process):
Simplify buffer generation.
(tramp-test32-shell-command): Extend test.

(cherry picked from commit d6922db49d)
2019-12-30 18:55:39 +01:00
Glenn Morris
99cd8ba7c0 Merge from origin/emacs-27
70fe552c61 ; xref-references-in-directory: Autoload as well
181f571651 Fix up requires
43f66c3368 Extract xref-matches-in-files from project--find-regexp-in...
65af18d86e Rename xref-collect-references and xref-collect-matches
98788bf976 ; Improve the docstring some more
c190e91a1e Improve docstrings
012c12a05e Fix when expose draws partially visible first glyph (bug#3...
d915b8c3f1 Don't require semantic/fw
50a0126402 Do some renames for clarity
74261ff301 Rearrange NEWS, add missing documentation
6c9571379e Fix interactive spec in netrc-parse
32222fb34c Fix documentation of define-obsolete-* functions

# Conflicts:
#	etc/NEWS
2019-12-30 09:04:05 -08:00
Michael Albinus
d6922db49d Sync with Tramp 2.4.3
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.4.3".

* lisp/net/tramp.el: Bump version.
(tramp-handle-shell-command): The temp file for error-buffer is remote.

* test/lisp/net/tramp-tests.el (tramp-test30-make-process):
Simplify buffer generation.
(tramp-test32-shell-command): Extend test.
2019-12-29 13:53:06 +01:00
Dmitry Gutov
65af18d86e Rename xref-collect-references and xref-collect-matches
* lisp/progmodes/xref.el (xref-references-in-directory): Rename
from xref-collect-references.  Update the sole caller.
(xref-matches-in-directory): Rename from xref-collect-matches.
Update all callers (all of them are in the /tests/ dir).

* test/lisp/progmodes/xref-tests.el (xref-tests-data-dir):
Don't use the EMACS_TEST_DIRECTORY env var. It doesn't work when
running interactively.
2019-12-29 15:46:44 +03:00
Glenn Morris
822c98a442 Merge from origin/emacs-27
8aad80d661 Fix installer build
47a73e3e14 Update Windows build documentation
cd55984153 Calc: add missing dynamic variable declarations
e8aa6f19e9 * doc/emacs/buffers.texi (Kill Buffer): Improve indexing.
ccd7cd2c51 Speed up dired-do-find-regexp
7edb1f0773 ; Remove outdated declarations
6ab40c1a51 ; Clarify the assumption
be38e39fcc project--find-regexp-in-files: Support remote files
21c3020fce Document some restrictions for module functions.
e1ce9f3423 Don't recommend using 'module-load' for loading modules.
03f962a486 Port x_get_monitor_attributes_fallback to !HAVE_GTK3
0b32f59764 Fix compilation warning in gnus-start.el
2019-12-27 07:50:16 -08:00
Mattias Engdegård
cd55984153 Calc: add missing dynamic variable declarations
* lisp/calc/calc-alg.el (math-simplify-only, calc-simplify-mode)
(math-expand-formulas, calc-poly-div-remainder)
(math-living-dangerously, math-simplifying, calc-angle-mode)
(calc-prefer-frac, math-poly-base-variable):
Declare dynamic variables.
* test/lisp/calc/calc-tests.el (calc-poly-div):
Add test for at least one bug caused by missing declarations.
2019-12-26 19:37:10 +01:00
Philipp Stephani
28268e47d8 Support .dylib suffix for modules on macOS (Bug#36226).
On macOS, shared libraries typically have the suffix .dylib.  This
commit switches the module suffix to .dylib on Darwin to account for
that.  To also support the .so suffix, introduce the concept of a
secondary module suffix.

* configure.ac: Switch MODULES_SUFFIX to .dylib for Darwin, introduce
MODULES_SECONDARY_SUFFIX.

* src/lread.c (Fload, syms_of_lread): Also use
MODULES_SECONDARY_SUFFIX if defined.

* test/src/emacs-module-tests.el (module-darwin-secondary-suffix): New
unit test.
2019-12-25 15:42:20 +01:00
Stephen Gildea
17c19817f7 Further expand coverage of unit tests for time-stamp
* test/lisp/time-stamp-tests.el (time-stamp-custom-format-tabs-expand,
time-stamp-custom-end, time-stamp-helper-string-defaults): New tests.
(time-stamp-custom-count): Test 0 case.
(time-stamp-format-non-date-conversions): Test different system values.

Development of these new tests was guided by the "testcover" library.
2019-12-23 11:52:42 -08:00
Michael R. Mauger
3df7d06d41 Added `comint-password-function' hook
* etc/NEWS:
* lisp/comint.el (comint-password-function): New variable.
  (comint-send-invisible): Use it.
* test/lisp/comint-tests.el (comint-test-no-password-function,
  comint-test-password-function-with-value,
  comint-test-password-function-with-nil): Test new variable.
2019-12-22 23:56:05 -05:00
Michael Albinus
753389448d Extend tramp-tests.el for other host name syntax and file name syntax
* test/lisp/net/tramp-tests.el (inhibit-message)
(connection-local-criteria-alist)
(connection-local-profile-alist, async-shell-command-width): Declare.
(tramp-test01-file-name-syntax)
(tramp-test02-file-name-dissect): Set syntax to `default'.
(tramp-test03-file-name-defaults)
(tramp-test03-file-name-host-rules)
(tramp-test03-file-name-method-rules)
(tramp-test04-substitute-in-file-name)
(tramp-test05-expand-file-name)
(tramp-test06-directory-file-name, tramp-test44-auto-load):
Skip unless syntax is `default'.
(tramp-test06-directory-file-name, tramp-test10-write-region)
(tramp-test17-dired-with-wildcards)
(tramp-test26-file-name-completion): Handle IPv6 host names.
(tramp-test21-file-links): Support all syntaxes.
(tramp-test30-make-process, tramp-test45-unload):
Suppress compiler warnings.
(tramp-test37-make-auto-save-file-name): Skip for `separate' syntax.
2019-12-22 13:48:36 +01:00
Stefan Monnier
0f7e3430bb * lisp/international/mule-cmds.el: Fix bug#38642
(universal-coding-system-argument): Adjust the code to the way
`universal-argument` works nowadays.  Handle `prefix-arg` a bit more
like `command_loop` does.

* test/lisp/international/mule-tests.el
(mule-cmds--test-universal-coding-system-argument): New test.
2019-12-20 17:34:38 -05:00
Mattias Engdegård
82b4e48c59 Allow characters and single-char strings in rx charsets
The `not' and `intersection' forms, and `or' inside these forms,
now accept characters and single-character strings as arguments.
Previously, they had to be wrapped in `any' forms.
This does not add expressive power but is a convenience and is easily
understood.

* doc/lispref/searching.texi (Rx Constructs): Amend the documentation.
* etc/NEWS: Announce the change.
* lisp/emacs-lisp/rx.el (rx--charset-p, rx--translate-not)
(rx--charset-intervals, rx): Accept characters and 1-char strings in
more places.
* test/lisp/emacs-lisp/rx-tests.el (rx-not, rx-charset-or)
(rx-def-in-charset-or, rx-intersection): Test the change.
2019-12-13 13:30:14 +01:00
Mattias Engdegård
f16766a0eb Use or' instead of union' for charset union in rx
Design change suggested by Stefan Monnier.

* doc/lispref/searching.texi (Rx Constructs):
* etc/NEWS: Document.
* lisp/emacs-lisp/rx.el (rx--translate-or): Detect charset arguments.
(rx--charset-p): New.
(rx--translate-not, rx--charset-intervals, rx--translate-union):
Change from `union' to `or'.
(rx--translate-form, rx--builtin-forms, rx): Remove `union'.
* test/lisp/emacs-lisp/rx-tests.el (rx-union, rx-def-in-union)
(rx-intersection): Rename tests and change `union' to `or' and `|'.
2019-12-12 23:47:25 +01:00
Paul Eggert
b0f20651e3 ; Spelling fixes 2019-12-10 20:05:49 -08:00
Mattias Engdegård
ea93326cc0 Add union' and intersection' to rx (bug#37849)
These character set operations, together with `not' for set
complement, improve the compositionality of rx, and reduce duplication
in complicated cases.  Named character classes are not permitted in
set operations.

* lisp/emacs-lisp/rx.el (rx--translate-any): Split into multiple
functions.
(rx--foldl, rx--parse-any, rx--generate-alt, rx--intervals-to-alt)
(rx--complement-intervals, rx--intersect-intervals)
(rx--union-intervals, rx--charset-intervals, rx--charset-union)
(rx--charset-all, rx--charset-intersection, rx--translate-union)
(rx--translate-intersection): New.
(rx--translate-not, rx--translate-form, rx--builtin-forms, rx):
Add `union' and `intersection'.
* test/lisp/emacs-lisp/rx-tests.el (rx-union ,rx-def-in-union)
(rx-intersection, rx-def-in-intersection): New tests.
* doc/lispref/searching.texi (Rx Constructs):
* etc/NEWS:
Document `union' and `intersection'.
2019-12-10 22:37:47 +01:00
Alan Third
33a37360de Fix dabbrev-completion (bug#17899)
* lisp/dabbrev.el (dabbrev--check-all-buffers): Add new variable.
(dabbrev-completion): Lexical scoping means we can't use let to
override global variables, so use setq.
(dabbrev--reset-global-variables): Reset new variable.
(dabbrev--make-friend-buffer-list): Use new variable.
* test/lisp/dabbrev-tests.el (dabbrev-completion-test):
(dabbrev-completion-test-with-argument): New tests.
2019-12-10 20:38:21 +00:00
Paul Eggert
d1a791f8ed Spelling fixes 2019-12-09 18:45:18 -08:00
Dmitry Gutov
ac1b6e97b6 Rename faces used in faces-tests.el
* test/data/themes/faces-test-light-theme.el:
* test/data/themes/faces-test-dark-theme.el: Update accordingly.

* test/lisp/faces-tests.el (faces--test-extend-with-themes):
Don't use the diff-mode faces.  Rename the definitions.
2019-12-10 02:16:44 +02:00
Dmitry Gutov
58fb4c3e68 Make ':extend' inherited from default spec unless overridden
* lisp/faces.el (face-spec-recalc): Handle the :extend attribute
specially and always inherit it from the default spec unless
overwritten in a theme (bug#37774).

* test/lisp/faces-tests.el (faces--test-data-dir): New variable.
(faces--test-extend-with-themes): Use test themes instead of ones
from etc/themes.  Update expected values.

* test/data/themes/faces-test-dark-theme.el: New file.

* test/data/themes/faces-test-light-theme.el: New file.

* doc/lispref/display.texi (Face Attributes):
Update the description of ':extend'.

* etc/NEWS: Update the entry for ':extend'.

* etc/themes/adwaita-theme.el:
* etc/themes/deeper-blue-theme.el:
* etc/themes/dichromacy-theme.el:
* etc/themes/leuven-theme.el:
* etc/themes/light-blue-theme.el:
* etc/themes/manoj-dark-theme.el:
* etc/themes/misterioso-theme.el:
* etc/themes/tango-dark-theme.el:
* etc/themes/tango-theme.el:
* etc/themes/tsdh-dark-theme.el:
* etc/themes/tsdh-light-theme.el:
* etc/themes/wheatgrass-theme.el:
* etc/themes/wombat-theme.el: Remove the now-redundant ':extend'
attribute in all the themes.
2019-12-10 02:16:44 +02:00
Eli Zaretskii
aed9584a0e Add more tests for face :extend attribute
* test/lisp/faces-tests.el (faces--test-extend-with-themes):
New set of tests for verifying the :extend attribute across
theme loading and unloading, and also via face inheritance.
(Bug#37774)
2019-12-09 14:46:43 +02:00
Jackson Ray Hamilton
8e1c553260
Ignore comments and strings when matching JSX
* lisp/progmodes/js.el (js-jsx--matching-close-tag-pos): Ignore
comments and strings.
* test/manual/indent/jsx-comment-string.jsx: New test.
2019-12-07 13:18:00 -08:00
Paul Eggert
48f6888588 Test format-time-string padding
Adapted from tests written by Stephen Gildea.
* test/src/timefns-tests.el:
(format-time-string-padding-minimal-deletes-unneeded-zeros)
(format-time-string-padding-minimal-retains-needed-zeros)
(format-time-string-padding-spaces)
(format-time-string-padding-zeros-adds-on-insignificant-side):
New tests.
2019-12-06 15:37:32 -08:00
Andreas Politz
bcf4201d4c * test/src/buffer-tests.el: Add loads of overlay tests
Taken from the `feature/noverlay` branch.
Suggested by Vladimir Kazanov <vekazanov@gmail.com>.
2019-12-05 23:10:32 -05:00
Eli Zaretskii
85f8aa1089 Fix recent modifications in emacs-module-tests
* test/data/emacs-module/mod-test.c (extract_big_integer): Fix
calculation of size of 'magnitude' when 'emacs_limb_t' is wider
than 'unsigned long'.

* test/src/emacs-module-tests.el
(module--test-assertions--load-non-live-object)
(module--test-assertions--call-emacs-from-gc): On MS-Windows,
check also mod-test-emacs with ".exe" appended, before
skipping the tests.
2019-12-05 16:38:17 +02:00
Philipp Stephani
096be9c454 Change module interface to no longer use GMP objects directly.
As described in the new comment added to emacs-module.c, using GMP
directly in the module interface has significant downsides: it couples
the module interface directly to the implementation and requires
module authors to link their module against the same GMP library as
Emacs itself, which is often difficult and an unnecessary burden.  By
picking a representation for the magnitude that often matches the one
used by GMP, we can avoid overhead when converting from and to GMP in
most cases.

Loading the test module in test/data/emacs-module and evaluating

(dotimes (_ 10000)
  (mod-test-double (* 2 most-negative-fixnum)))

under Callgrind shows that on my (GNU/Linux) machine Emacs only spends
10% of the CPU time of mod-test-double in mpz_import and mpz_export
combined, even though that function does little else.  (By contrast,
30% is spent in allocate_pseudovector.)

* src/emacs-module.h.in: Don't check EMACS_MODULE_GMP.  Don't include
gmp.h.  Remove emacs_mpz structure.  Instead, define type alias
emacs_limb_t and macro EMACS_LIMB_MAX.

* src/module-env-27.h: Change interface of extract_big_integer and
make_big_integer to take a sign-magnitude representation instead of
mpz_t.

* src/emacs-module.c: Don't check EMACS_MODULE_GMP or
EMACS_MODULE_HAVE_MPZ_T.  Add a comment about the chosen
implementation.
(module_extract_big_integer, module_make_big_integer): Reimplement
without using mpz_t in the interface.

* doc/lispref/internals.texi (Module Values): Adapt function
documentation and example.  Stop mentioning GMP and EMACS_MODULE_GMP.

* test/data/emacs-module/mod-test.c: Don't define EMACS_MODULE_GMP or
EMACS_MODULE_HAVE_MPZ_T.
(memory_full, extract_big_integer, make_big_integer): New helper
functions, identical to example in the Info documentation.
(Fmod_test_nanoseconds, Fmod_test_double): Adapt to new interface.
2019-12-04 21:17:10 +01:00
Mattias Engdegård
a6b598518c Avoid duplicated character classes in rx
For example, (any digit digit) should produce "[[:digit:]]",
not "[[:digit:][:digit:]]".

* lisp/emacs-lisp/rx.el (rx--translate-any): Deduplicate character classes.
* test/lisp/emacs-lisp/rx-tests.el (rx-any): Add test case.
2019-12-03 15:17:37 +01:00
Michael Albinus
ec65b9adbe Suppress superfluous messages in tramp-tests
* test/lisp/net/tramp-tests.el (tramp-test10-write-region)
(tramp-test10-write-region-file-precious-flag)
(tramp-test34-connection-local-variables)
(tramp-test36-vc-registered): Let-bind `inhibit-message'.
2019-12-01 12:25:15 +01:00
Robert Pluim
6d8e758e85 Add nsm-should-check IPv6 local subnet tests
* test/lisp/net/nsm-tests.el (nsm-check-local-subnet-ipv6): Now
that IPv6 addresses are returned from network-interface-list, test
nsm-should check and nsm-network-same-subnet for IPv6 as well.
2019-11-29 16:41:04 +01:00
Noam Postavsky
b2790db049 Improve errors & warnings due to fancy quoted vars (Bug#32939)
Add some hints to the message for byte compiler free & unused variable
warnings, and 'void-variable' errors where the variable has confusable
quote characters in it.
* lisp/help.el (uni-confusables), uni-confusables-regexp): New
constants.
(help-command-error-confusable-suggestions): New function, added to
`command-error-function'.
(help-uni-confusable-suggestions): New function.
* lisp/emacs-lisp/bytecomp.el (byte-compile-variable-ref):
* lisp/emacs-lisp/cconv.el (cconv--analyze-use): Use it.

* lisp/emacs-lisp/lisp-mode.el
(lisp--match-confusable-symbol-character): New function.
(lisp-fdefs): Use it to fontify confusable characters with
font-lock-warning-face when they occur in symbol names.
* doc/lispref/modes.texi (Faces for Font Lock):
* doc/lispref/objects.texi (Basic Char Syntax): Recommend backslash
escaping of confusable characters, and mention new fontification.
* etc/NEWS: Announce the new fontification behavior.
* test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-fontify-confusables):
New test.
2019-11-28 18:10:07 -05:00
Noam Postavsky
85f586f3ce Stop signaling an error when reading "smart quotes" in symbols
Revert commits from 2018-01-28 "Fix round tripping of read->print for
symbols with strange quotes", and 2017-07-22 "Signal error for symbol
names with strange quotes (Bug#2967)".
* etc/NEWS: Remove corresponding entries.
* src/character.c (confusable_symbol_character_p):
* test/src/lread-tests.el (lread-tests--old-style-backquotes): Remove.
* src/lread.c (read1): Don't signal error on confusable character.
* src/print.c (print_object): Don't escape confusable characters.
2019-11-28 18:03:42 -05:00
Robert Pluim
95e218af14 Use 127.0.0.1 in nsm-tests
Winsock doesn't like "127.1"

* test/lisp/net/nsm-tests.el (nsm-check-local-subnet-ipv4): Spell
numeric localhost as "127.0.0.1" instead of "127.1".
2019-11-26 19:27:06 +01:00
Stefan Monnier
384d1c47ce * test/lisp/minibuffer-tests.el (completion-table-test-quoting): New test
* test/data/minibuffer-test-cttq$tion: New file-name test data.
2019-11-26 13:18:18 -05:00
Juanma Barranquero
6f3ff47c52 Make help-split-fundoc more flexible about what returns
* lisp/help.el (help-split-fundoc): New arg SECTION to return
only the usage or doc parts of the docstring, or both even if
there is no usage.

* test/lisp/help-tests.el: New file.
2019-11-23 23:29:53 +01:00
dickmao
045cfbef09 Refix conditional step clauses in cl-loop
* lisp/emacs-lisp/cl-macs.el
(cl--loop-bindings, cl--loop-symbol-macs, cl-loop):
Add cl--loop-conditions, remove cl--loop-guard-cond.
(cl--push-clause-loop-body): Apply clause to both cl--loop-conditions
and cl--loop-body
(cl--parse-loop-clause): Use cl--push-clause-loop-body.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-loop-and-assignment):
Use docstring.
(cl-macs-loop-for-as-arith): Removed expected failure.
(cl-macs-loop-conditional-step-clauses): Add some tests (bug#29799).
2019-11-22 15:53:58 +01:00
Stephen Gildea
123c775aa7 Expand coverage of unit tests for time-stamp
* test/lisp/time-stamp-tests.el: Remove redundant word "test"
from the names of all the tests.
(time-stamp-custom-time-zone, time-stamp-custom-pattern,
time-stamp-custom-inserts-lines, time-stamp-custom-count,
time-stamp-helper-safe-locals): New tests
2019-11-19 21:27:13 -08:00
Phil Sainty
33676820bd lisp/so-long.el: Refactor menu action commands
* lisp/so-long.el (so-long-menu): Call `so-long' with an ACTION
argument instead of using `so-long-menu-item-replace-action'.
(so-long-menu-item-replace-action): Remove the deprecated function.

* test/lisp/so-long-tests/so-long-tests.el
(so-long-tests-so-long-menu-item-replace-action): Update the test.
2019-11-18 21:25:36 +13:00
Stefan Monnier
6b361d9530 lisp/so-long.el: Use (interactive "@") for menu commands
* lisp/so-long.el (so-long-menu, so-long-menu-item-replace-action)
(so-long-revert): Use interactive code "@", replacing all uses of
`so-long-menu-click-window'.  This approach leaves the window selected
afterwards, whereas the old code did not; but that is not a problem.
(so-long-menu-click-window, so-long-menu-item-revert): Remove the
deprecated functions.

* test/lisp/so-long-tests/so-long-tests.el
(so-long-tests-so-long-menu-item-replace-action): Update the test.

Co-authored-by: Phil Sainty <psainty@orcon.net.nz>
2019-11-18 21:25:36 +13:00
Stefan Monnier
87347a5bbc * lisp/progmodes/perl-mode.el (perl-calculate-indent): Indent qw(...)
Fix initialization of `state`.
Special-case `qw(...)` because we do want to indent its contents.
2019-11-15 13:19:37 -05:00
Paul Eggert
8b848def9b Handle weird cases like (ceil 0 0.0)
* src/floatfns.c (double_integer_scale): Distinguish Inf from NaN.
(rounding_driver): Handle (ceil 0 0.0) and (ceil 0 1.0e+INF).
* test/src/floatfns-tests.el (special-round): Add tests for
weird cases like this.

Avoid crash with (floor 0 0.0)
* src/floatfns.c (rounding_driver): Signal an arithmetic
error if divisor is 0.0 or -0.0, instead of crashing.
2019-11-14 18:52:48 -08:00
Paul Eggert
c2cd8e6265 Fix byte-counting error in ‘format’
Problem reported by Paul Pogonyshev (Bug#38191).
* src/editfns.c (styled_format): When checking for adjacent
%-sequences, use byte position rather than character position.
* test/src/editfns-tests.el (format-properties): Test for fix.
2019-11-14 14:44:42 -08:00
Phil Sainty
e9dca2b5aa Defer triggering `so-long' until the buffer is displayed
* lisp/so-long.el (so-long-invisible-buffer-function): New user option.
(so-long--set-auto-mode): Use so-long-invisible-buffer-function.
(so-long-deferred): New function/value for so-long-invisible-buffer-function.
(so-long, so-long--disable): Support for so-long-deferred.

* test/lisp/so-long-tests/autoload-longlines-mode-tests.el
* test/lisp/so-long-tests/autoload-major-mode-tests.el
* test/lisp/so-long-tests/autoload-minor-mode-tests.el
* test/lisp/so-long-tests/so-long-tests.el:
Support for so-long-deferred.

Pre-existing tests have been updated to ensure the buffer is already
displayed in cases where a call to `normal-mode' is the (potential)
trigger for `so-long'.
2019-11-15 00:39:13 +13:00
Phil Sainty
90290745d7 ; Documentation and spelling
* lisp/so-long.el: Documentation fixes.  For the purposes of
consistency, this reverts some of the changes made in commit
41ba8231ef, including one which
had introduced inconsistent spelling.

ispell configuration and LocalWords have been added such that
`ispell-buffer' should find no misspellings for this library.

* test/lisp/so-long-tests/spelling-tests.el (so-long-spelling):
New test to check the spelling using `ispell-buffer'.
2019-11-15 00:39:12 +13:00
Stephen Gildea
1d189843bb time-stamp: update support for time zone numeric offset
* time-stamp.el (time-stamp-string-preprocess): Change new format for
numeric time zone from %:z to %5z to match format-time-string better.
(time-stamp-format): Document support for numeric time zone.
See discussion in bug#32931.

* NEWS: Mention time-stamp-format %5z.
2019-11-13 21:11:28 -08:00
Paul Eggert
bede598424 Fix double-rounding bug in ceiling etc.
This is doable now that we have bignums.
* src/floatfns.c (integer_value): Remove; no longer used.
(rescale_for_division): New function.
(rounding_driver): Use it to divide properly (by using bignums)
even when arguments are float, fixing a double-rounding FIXME.
* src/lisp.h (LOG2_FLT_RADIX): Move here ...
* src/timefns.c (frac_to_double): ... from here.
* test/src/floatfns-tests.el (big-round):
Add a test to catch the double-rounding bug.
2019-11-13 13:10:09 -08:00
Michael Albinus
d3438460ef Adapt Tramp docstrings according to checkdoc
* lisp/net/tramp.el (tramp-backup-directory-alist)
(tramp-echoed-echo-mark-regexp, tramp-syntax-values)
(tramp-lookup-syntax, tramp-build-prefix-format)
(tramp-build-prefix-regexp, tramp-build-method-regexp)
(tramp-build-postfix-method-format)
(tramp-build-postfix-method-regexp)
(tramp-build-prefix-ipv6-format, tramp-build-prefix-ipv6-regexp)
(tramp-build-postfix-ipv6-format)
(tramp-build-postfix-ipv6-regexp)
(tramp-build-postfix-host-format)
(tramp-build-postfix-host-regexp, tramp-unknown-id-string)
(tramp-unknown-id-integer, tramp-build-file-name-regexp)
(tramp-build-completion-file-name-regexp, tramp-chunksize)
(tramp-find-method, tramp-find-user, tramp-find-host)
(tramp-dissect-file-name, tramp-get-buffer)
(tramp-get-connection-buffer, tramp-debug-message, tramp-error)
(with-tramp-connection-property, tramp-run-real-handler)
(tramp-file-name-for-operation, tramp-file-name-handler)
(tramp-completion-file-name-handler)
(tramp-completion-handle-file-name-completion)
(tramp-completion-dissect-file-name)
(tramp-completion-dissect-file-name1)
(tramp-handle-file-name-as-directory)
(tramp-handle-file-name-directory)
(tramp-handle-file-name-nondirectory, tramp-mode-string-to-int)
(tramp-file-mode-from-int):
* lisp/net/tramp-adb.el (tramp-adb-file-name-p):
* lisp/net/tramp-archive.el (tramp-archive-run-real-handler)
(tramp-archive-file-name-handler)
(tramp-archive-dissect-file-name)
(with-parsed-tramp-archive-file-name)
(tramp-archive-gvfs-file-name, tramp-archive-handle-access-file):
* lisp/net/tramp-cmds.el (tramp-list-remote-buffers):
* lisp/net/tramp-compat.el (tramp-unload-file-name-handlers)
(tramp-compat-funcall, tramp-compat-tramp-file-name-slots):
* lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler)
(tramp-ftp-file-name-p):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-p)
(tramp-gvfs-file-name-handler)
(tramp-gvfs-stringify-dbus-message)
(tramp-gvfs-monitor-process-filter)
(tramp-gvfs-handler-mounted-unmounted):
* lisp/net/tramp-integration.el
(tramp-rfn-eshadow-update-overlay-regexp):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-p)
(tramp-rclone-file-name-handler, tramp-rclone-send-command):
* lisp/net/tramp-sh.el (tramp-sh--quoting-style-options)
(tramp-sh-gio-monitor-process-filter)
(tramp-sh-gvfs-monitor-dir-process-filter)
(tramp-sh-inotifywait-process-filter, tramp-find-executable)
(tramp-set-remote-path, tramp-open-shell, tramp-find-shell)
(tramp-send-command-and-check, tramp-shell-case-fold)
(tramp-get-remote-path):
* lisp/net/tramp-smb.el (tramp-smb-file-name-p)
(tramp-smb-file-name-handler)
(tramp-smb-do-file-attributes-with-stat)
(tramp-smb-handle-substitute-in-file-name)
(tramp-smb-get-stat-capability, tramp-smb-shell-quote-argument):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-p)
(tramp-sudoedit-file-name-handler)
(tramp-sudoedit-send-command-string):
* test/lisp/net/tramp-archive-tests.el (tramp-archive-test-all):
* test/lisp/net/tramp-tests.el (tramp--test-gvfs-p)
(tramp--test-with-proper-process-name-and-buffer)
(tramp-test-all): Adapt docstrings according to `checkdoc'.
2019-11-13 13:10:58 +01:00
Paul Eggert
6b4a97c1c7 Fix some quoting glitches in doc strings 2019-11-11 10:32:53 -08:00
Glenn Morris
2f36a08214 Disable a portion of one doc-test
* test/src/doc-tests.el (doc-test-substitute-command-keys):
Disable component that fails twice in the past 5 weeks
due to changes in the minibuffer map.
2019-11-09 19:38:05 -08:00
Eli Zaretskii
f2019fc676 Fix case-insensitive completion of buffer names
* test/src/minibuf-tests.el (test-try-completion-ignore-case):
New test, suggested by Stefan Monnier <monnier@iro.umontreal.ca>.

* src/minibuf.c (Ftry_completion): Don't treat strings that
are identical but for the case as if they were identical for
the purposes of not counting the same string twice.  This
fixes case-insensitive completion when all the candidates are
identical but for the letter-case.  (Bug#11339)
2019-11-09 21:56:30 +02:00
Robert Pluim
063277c5ec Ensure building and running on non-IPv6 capable hosts works
* src/process.c (Fmake_network_process) [AF_INET6]: Only build ::1
localhost when IPv6 is supported.
(Fnetwork_lookup_address_info) [AF_INET6]: Move check for Qipv6 inside
ifdef, since its definition depends on AF_INET6.  Don't return IPv6
addresses when they're not supported.

* test/src/process-tests.el (lookup-family-specification,
lookup-google): Only do IPv6 lookup if IPv6 is supported.
2019-11-08 10:04:13 +01:00
Michael Albinus
4ab7800126 Make ange-ftp fit for tramp-tests
* lisp/net/ange-ftp.el (ange-ftp-repaint-minibuffer): Use empty message.
(ange-ftp-quote-string): Unquote the string.
(ange-ftp-substitute-in-file-name, ange-ftp-access-file)
(ange-ftp-copy-directory, ange-ftp-make-symbolic-link)
(ange-ftp-add-name-to-file): New defuns.  Set 'ange-ftp property.
(ange-ftp-real-substitute-in-file-name)
(ange-ftp-real-copy-directory): New defuns.
(ange-ftp-file-name-as-directory): Care about `non-essential'.
(ange-ftp-file-attributes): Handle ID-STRING.
(ange-ftp-copy-file-internal, ange-ftp-rename-file)
(ange-ftp-make-directory): Improve error handling.
(ange-ftp-insert-directory): Initialize SWITCHES if they are nil.

* test/lisp/net/tramp-tests.el (ange-ftp-make-backup-files): Declare.
(tramp-test39-make-nearby-temp-file, tramp--test-ange-ftp-p): New defun.
(tramp-test05-expand-file-name-relative)
(tramp-test06-directory-file-name, tramp-test10-write-region)
(tramp-test11-copy-file, tramp-test12-rename-file)
(tramp-test17-insert-directory)
(tramp-test26-file-name-completion)
(tramp-test37-make-auto-save-file-name)
(tramp-test38-find-backup-file-name)
(tramp--test-special-characters): Use it.
2019-11-07 12:03:19 +01:00
Stefan Kangas
1428dfe630 Test that comint-password-prompt-regexp matches "git push"
* test/lisp/comint-tests.el (comint-testsuite-password-strings): Test
that 'comint-password-prompt-regexp' matches 'git push'
output.  (Bug#20910)
2019-11-07 01:48:13 +01:00
Stephen Gildea
9ce67baa9a time-stamp: add support for time zone numeric offset
* time-stamp.el: Implement %:z as expanding to the numeric time zone
offset, to address the feature request of bug#32931.  Do not document it
yet, to discourage compatibility problems in mixed Emacs 26 and Emacs 27
environments.  Documentation will be added in a subsequent release at
least two years later.  (We cannot yet use %z for numeric time zone
because in Emacs 26 it was documented to do something else.)

* time-stamp-tests.el (time-stamp-test-format-time-zone): expand this
test and break it into two tests, time-stamp-test-format-time-zone-name
and time-stamp-test-format-time-zone-offset.
2019-11-06 08:33:51 -08:00
Michael Albinus
da2df1c1b5 More error checks in Tramp's make-directory
* lisp/net/tramp-adb.el (tramp-adb-handle-make-directory):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-make-directory):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-directory):
* lisp/net/tramp-smb.el (tramp-smb-handle-make-directory):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-make-directory):
Signal `file-already-exists' if DIR exists.

* test/lisp/net/tramp-tests.el (tramp-test04-substitute-in-file-name):
Fix thinko.
(tramp-test13-make-directory, tramp-test14-delete-directory)
(tramp-test15-copy-directory): Extend tests.
2019-11-06 16:49:35 +01:00
Paul Eggert
5ab29400a4 Don’t signal overflow for (expt 1 bignum)
Similarly for (expt 0 bignum) and (expt -1 bignum).
The result is always a -1, 0 or 1, so do not signal overflow.
* src/data.c (expt_integer): Do not signal an overflow if
-1 <= X <= 1.  Be clearer about when overflow is signaled.
* test/src/floatfns-tests.el (bignum-expt): Test this.
2019-11-04 23:39:54 -08:00
Michael Albinus
dd19cc3aa1 Improve Tramp error handling
* lisp/net/tramp.el (tramp-set-syntax): Add missing argument.
(tramp-signal-hook-function): Make it more robust.
(tramp-handle-directory-files):
* lisp/net/tramp-adb.el
(tramp-adb-handle-directory-files-and-attributes)
(tramp-adb-handle-copy-file, tramp-adb-handle-rename-file):
* lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file):
* lisp/net/tramp-rclone.el (tramp-rclone-do-copy-or-rename-file)
(tramp-rclone-handle-directory-files):
* lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes)
(tramp-sh-handle-copy-directory, tramp-do-copy-or-rename-file):
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory)
(tramp-smb-handle-copy-file, tramp-smb-handle-directory-files)
(tramp-smb-handle-rename-file):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file):
Improve error handling.

* test/lisp/net/tramp-tests.el (tramp-test11-copy-file)
(tramp-test12-rename-file, tramp-test14-delete-directory)
(tramp-test15-copy-directory, tramp-test16-directory-files)
(tramp-test19-directory-files-and-attributes): Extend tests.
2019-11-04 17:34:31 +01:00
Eli Zaretskii
2ad06e28e3 Fix file-tests.el on MS-Windows
* test/lisp/files-tests.el
(files-tests-file-name-non-special-start-file-process): On
MS-Windows, wait till the process dies before returning from
the files-tests--with-temp-non-special macro, to ensure the
temporary directory is successfully deleted.
2019-11-03 18:13:38 +02:00
Filipp Gunbin
0bffb3e69d Make ant regexp in compilation-error-regexp-alist-alist more lax
* lisp/progmodes/compile.el: Make ant regexp accept filenames that may
occur on Cygwin (like c:/test) and optional additional severity level
after task name.
* etc/compilation.txt: Add sample.
2019-11-01 15:20:42 +03:00
Eric Ludlam
cf59afb7e1 * test/lisp/cedet/semantic-utest-ia.el: Update from upstream
Merge content from CEDET on SF to bring in additional test points
and support more types of languages.
(semantic-utest-ia-struct.cpp, semantic-utest-ia-templates.cpp)
(semantic-utest-ia-using.cpp, semantic-utest-ia-nsp.cpp)
(semantic-utest-ia-localvars.cpp, semantic-utest-ia-varnamse.java)
(semantic-utest-ia-wisent.wy, semantic-utest-ia-texi)
(semantic-utest-ia-make, semantic-utest-ia-srecoder): New test points
(semantic-ia-utest-buffer): Use comment-start-skip when looking
for test point tokens.
Capture errors ignoring debugger to enable test for empty results.
Improve output from test diagnostics.
(semantic-ia-utest-buffer-refs): Use comment-start-skip to find
test point tokens.
Author: Eric Ludlam <zappo@gnu.org>
2019-10-31 19:05:35 -04:00
Eric Ludlam
f69e2aa104 * test/manual/cedet/tests/test*: More updates from upstream
* test/manual/cedet/tests/testjavacomp.java,
test/manual/cedet/tests/testnsp.cpp,
test/manual/cedet/tests/testsppcomplete.c,
test/manual/cedet/tests/testtypedefs.cpp,
test/manual/cedet/tests/testvarnames.c:
Merge content from CEDET on SF with extended test points for use with
test/lisp/cedet/semantic-utest-ia.el
Author: Eric Ludlam <zappo@gnu.org>
2019-10-31 19:04:12 -04:00
Eric Ludlam
31ed03020c * test/manual/cedet/tests/testdoublens.cpp: Update from upstream
* test/manual/cedet/tests/testdoublens.hpp:
Merge content from CEDET on SF with extended test points for use with
test/lisp/cedet/semantic-utest-ia.el
Author: Eric Ludlam <zappo@gnu.org>
2019-10-31 19:03:47 -04:00
Eric Ludlam
0f7163ab89 * test/manual/cedet/tests/: New files for semantic-utest-ia.el
* test/manual/cedet/tests/test.mk,
test/manual/cedet/tests/test.srt, test/manual/cedet/tests/test.texi,
test/manual/cedet/tests/testlocalvars.cpp,
test/manual/cedet/tests/teststruct.cpp,
test/manual/cedet/tests/testtemplates.cpp,
test/manual/cedet/tests/testusing.cpp,
test/manual/cedet/tests/testusing.hh,
test/manual/cedet/tests/testvarnames.java.
test/manual/cedet/tests/testwisent.wy:
New files to be used by test/lisp/cedet/semantic-utest-ia.el.
Author: Eric Ludlam <zappo@gnu.org>
2019-10-31 19:01:08 -04:00
Michael Albinus
bdb33af39d Fix some minor Tramp problems
* lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
Check, that `tramp-password-save-function' is a function.

* lisp/net/tramp-smb.el (tramp-smb-handle-file-system-info):
Check, that there is a share.

* lisp/net/tramp.el (outline-regexp): Declare.
(tramp-get-debug-buffer): Let-bind `signal-hook-function'.

* test/lisp/net/tramp-tests.el (tramp-test04-substitute-in-file-name):
Skip some tests for Emacs 24 and 25; they let Emacs crash.
2019-10-31 11:13:13 +01:00
Paul Eggert
f2a72bb8ed Fix print.c infloop on circular lists
Fix infinite loops in print.c when a circular list is passed
to command-error-default-function or to error-message-string.
* src/print.c (print_error_message):
Use FOR_EACH_TAIL to avoid infloop on circular lists.
(print_object): Use FOR_EACH_TAIL_SAFE, as it uses
Brent’s teleporting tortoise-hare algorithm which is
asymptotically better than the classic tortoise-hare
algorithm that the code wsas using.
* test/src/print-tests.el (print-circle-2): When print-circle
is nil, do not insist on a particular cycle-detection heuristic.
(error-message-string-circular): New test.
2019-10-30 14:43:14 -07:00
Paul Eggert
40ae02ff50 Fix fileio.c infloops on circular lists
Fix infinite loops in fileio.c when a circular list is the
value of after_insert_file_functions,
buffer-auto-save-file-format, buffer-file-format, or
write-region-annotate-functions.
* src/fileio.c (Finsert_file_contents, build_annotations):
Use FOR_EACH_TAIL to avoid infloop on circular lists.
(build_annotations): Use an EMACS_INT, not an int, to count
nesting level.
* test/src/fileio-tests.el:
(fileio-tests--circular-after-insert-file-functions): New test.
2019-10-30 14:43:14 -07:00
Filipp Gunbin
6d2c73e8c7 Add gradle-kotlin to compilation-error-regexp-alist-alist
* lisp/progmodes/compile.el: Add gradle-kotlin to
compilation-error-regexp-alist-alist.
* etc/compilation.txt: Add samples for it.
2019-10-29 23:06:20 +03:00
Eric Ludlam
38ec422a35 * test/lisp/cedet/semantic-utest: silence compiler warnings
* test/lisp/cedet/semantic-utest-c.el
(semantic-test-c-preprocessor-simulation): Use with-current-buffer.

* test/lisp/cedet/semantic-utest.el (semantic-utest-makebuffer):
Use read-only-mode.
(semantic-utest-verify-names-jave, semantic-utest-verify-names-2):
Remove functions, unused.
2019-10-27 17:02:59 -04:00
Stephen Gildea
113ff954db time-stamp-time-zone: update customization
* time-stamp.el (time-stamp-time-zone): Support customization with
an integer offset (a new possible value of the ZONE argument to
format-time-string in Emacs 27).
Update the safe-local-variable predicate from string-or-null-p
(describing time-stamp-time-zone's domain before 2015) to new
predicate time-stamp-zone-type-p (describing the current domain).

* time-stamp-tests.el (time-stamp-test-helper-zone-type-p): New test.
2019-10-27 08:21:16 -07:00
Mattias Engdegård
cbd439e785 Expand rx definitions inside (not ...)
* lisp/emacs-lisp/rx.el (rx--translate-not):
* test/lisp/emacs-lisp/rx-tests.el (rx-not, rx-def-in-not):
* doc/lispref/searching.texi (Rx Constructs, Extending Rx):

Allow user-defined rx constructs to be expanded inside (not ...)
forms, for better composability (bug#37849).
2019-10-27 09:54:54 +01:00
Michael Albinus
6e66d9a95c Some Tramp trace improvements
* lisp/net/tramp.el (tramp-call-process): `result' can also be nil.

* test/lisp/net/tramp-tests.el (tramp--test-timeout-handler):
Improve trace format.
2019-10-27 09:36:56 +01:00
Juri Linkov
c6667cc6a9 dired-dwim-target uses most recently visited window instead of next window.
* doc/emacs/dired.texi (Operating on Files): Document behavior change.

* lisp/dired-aux.el (dired-dwim-target-directories): New function.
(dired-dwim-target-directory, dired-dwim-target-defaults): Use it
to get the most recently used window instead of the next window (bug#35385).

* lisp/dired.el (dired-dwim-target): Doc fix.

* test/lisp/dired-tests.el: Remove unnecessary require and pacify
byte-compiler.
2019-10-27 02:20:15 +03:00
Stephen Gildea
f247599e16 time-stamp-tests: add name prefix to tests of formatting
* time-stamp-tests.el: rename all the time-stamp-string formatting tests
to have the word "format" in their name, to make room in the namespace
for other, future tests.
2019-10-26 14:31:39 -07:00
Stephen Gildea
4e271a6c36 time-stamp-tests: consistently name the time vars
* time-stamp-tests.el (with-time-stamp-test-env): rename local variable
'ref-time' to 'ref-time1', for parallelism with ref-time2 and ref-time3.
2019-10-25 08:45:27 -07:00
Glenn Morris
5f67809a8f Set expected result for a cedet test
* test/lisp/cedet/srecode-utest-template.el (srecode-utest-project):
Test fails on hydra.nixos.org, for some reason.
2019-10-22 16:25:21 -07:00
Stefan Kangas
0e6f4628d8 Don't try to add nil packages on refresh
* lisp/emacs-lisp/package.el (package-read-archive-contents): Don't
try to add nil entries.  Warn instead.  (Bug#28502)
* test/lisp/emacs-lisp/package-tests.el
(package-test-update-archives/ignore-nil-entry): New test.
* test/lisp/emacs-lisp/package-resources/with-nil-entry/archive-contents:
New file.
2019-10-21 00:00:36 +02:00
Michael Albinus
36c75c2a41 * test/lisp/net/tramp-tests.el (remote-file-name-inhibit-cache): Set to nil. 2019-10-18 19:45:07 +02:00
Mattias Engdegård
6331d23de3 Use [^z-a] for matching any character (anychar/anything) in rx
* lisp/emacs-lisp/rx.el (rx--translate-symbol):
* test/lisp/emacs-lisp/rx-tests.el (rx-any, rx-atoms):
Use [^z-a] instead of ".\\|\n" for anychar.

The new expression is faster (about 2×) and does not allocate regexp
stack space.  For example, (0+ anychar) now matches strings of any
size (bug#37659).
2019-10-18 14:46:12 +02:00
Mattias Engdegård
ae5407b857 Add `unmatchable' as alias for (or) in rx (bug#37659)
* lisp/emacs-lisp/rx.el (rx--translate-symbol, rx--builtin-symbols, rx):
* test/lisp/emacs-lisp/rx-tests.el (rx-atoms):
* doc/lispref/searching.texi (Rx Constructs):
* etc/NEWS:
Add `unmatchable', more descriptive than (or), and corresponding to
the variable `regexp-unmatchable'.
2019-10-18 14:46:06 +02:00
Mattias Engdegård
e5a446b0a7 Add anychar' as alias to anything' in rx (bug#37659)
* lisp/emacs-lisp/rx.el (rx--translate-symbol, rx--builtin-symbols, rx):
* test/lisp/emacs-lisp/rx-tests.el (rx-atoms):
* doc/lispref/searching.texi (Rx Constructs):
* etc/NEWS:
Add `anychar', an alias for `anything'.  Since `anychar' is more
descriptive (and slightly shorter), treat it as the preferred name.
2019-10-18 14:45:47 +02:00
Eric Ludlam
06114b79a5 Fix test data broken by removing trailing whitespace. 2019-10-15 11:08:18 -04:00
Eric Ludlam
26f5edf0c8 Adapt the CEDET SRecoder getset tests to use ERT
These tests were copied from CEDET from SourceForge.
Author: Eric Ludlam <zappo@gnu.org>
2019-10-15 11:08:18 -04:00
Eric Ludlam
57a786db5a Adapt the CEDET SRecoder template test to use ERT
These tests were copied from CEDET from SourceForge.
Author: Eric Ludlam <zappo@gnu.org>
2019-10-15 11:08:18 -04:00
Eric Ludlam
3f8915a019 Copy CEDET/Semantic's tag formatter test suite to be an
automated test.
These tests were copied from CEDET on Sourceforge and adapted to use ERT.
Author: Eric Ludlam <zappo@gnu.org>
2019-10-15 11:08:18 -04:00
Eric Ludlam
128f803197 Update CEDET manual tests so that they run.
To run visit test/manual/cedet/cedet-utests.el
M-x eval-buffer
M-x cedet-utest
Author: Eric Ludlam <zappo@gnu.org>
2019-10-15 11:08:18 -04:00
Eric Ludlam
a99812ee0f Convert manual CEDET tests from test/manual/cedet to be
automated tests in test/lisp/cedet.
Author: Eric Ludlam <zappo@gnu.org>
2019-10-15 11:08:18 -04:00
Mattias Engdegård
67ed6ee733 Correctly explain test failures with mixed uni/multibyte strings
* lisp/emacs-lisp/ert.el (ert--explain-equal-rec):
* test/lisp/emacs-lisp/ert-tests.el (ert-test-explain-equal):
When explaining a difference between a unibyte and a multibyte string,
first convert both to multibyte.  Otherwise, we might end up comparing
unibyte char C to multibyte char C, 127<C<256, and not detect the
difference (bug#30219).
2019-10-13 20:29:27 +02:00
Stephen Gildea
d9a01dcd9f Minor tweaks to time-stamp documentation strings
* time-stamp.el (time-stamp): Reformat the explanation of the
variables that affect time-stamp, for easier reading.  In particular,
wrap the documentation to 75 characters, so that it displays neatly as
a before-save-hook customization option.

* time-stamp-tests.el (with-time-stamp-test-env): Use imperative voice,
per checkdoc.
2019-10-13 07:59:59 -07:00
Michael Albinus
15ed1598b5 Adapt some Tramp tests
* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test17-insert-directory): Adapt regexp of summary line.

* test/lisp/net/tramp-tests.el (tramp-test21-file-links):
Extend test for symlinked directories.
2019-10-12 12:20:55 +02:00
Andrea Corallo
421db07d06 * lisp/emacs-lisp/map.el (map-into) <hash-table>: Allow keyword args
(map--into-hash): New function, extracted from `map-into <hash-table>`.
Speed it up a bit by using gethash instead of map-elt when we know
we're accessing a hash table.

* test/lisp/emacs-lisp/map-tests.el (test-map-into): Add corresponding test.
2019-10-11 12:18:21 -04:00
Lars Ingebrigtsen
b5d2c6ee01 Remove two checkdoc tests checked in by mistake
* test/lisp/emacs-lisp/checkdoc-tests.el: Remove &aux and &context
checks mistakenly checked in (as these aren't implemented) (bug#37697).
2019-10-11 07:46:41 +02:00
Paul Eggert
288e00d69a Port time-stamp-test-time-zone to macOS
Problem reported by Stefan Kangas in:
https://lists.gnu.org/r/emacs-devel/2019-10/msg00360.html
* test/lisp/time-stamp-tests.el (time-stamp-test-time-zone):
Don’t assume (format-time-string "%Z" 0 t) returns "GMT".
2019-10-10 00:16:21 -07:00
Damien Cassou
46d11bcfa3 checkdoc CL tests
* test/lisp/emacs-lisp/checkdoc-tests.el: Add cl-lib-related tests
(bug#37063).
2019-10-10 02:19:10 +02:00
Lars Ingebrigtsen
9ab3f16c46 Fix formatting of (file-size-human-readable 2047)
* lisp/files.el (file-size-human-readable): Don't format
slightly-less numbers as X.0k, but just Xk instead (bug#36329).
2019-10-10 01:57:54 +02:00
Stephen Gildea
600bcde608 time-stamp: revert recent change to "%04y"
* time-stamp.el (time-stamp-string-preprocess): Revert change to "%04y"
format made 2 weeks ago by commit 0e56883878 (the previous commit to
this file).  Although undocumented, "%04y" was discovered to be in use
in the wild (2016) and had not issued a warning that it would change.
Add a warning that it will change.

* time-stamp-tests.el (time-stamp-test-year-2digit): add test of "%04y"
2019-10-09 09:19:10 -07:00
Stephen Gildea
697a7a1497 Expand testing of time-stamp format "%y"
* time-stamp-tests.el (time-stamp-test-year): break into two tests,
time-stamp-test-year-2digit and time-stamp-test-year-4digit.  Expand
time-stamp-test-year-2digit to look more like tests for other 2-digit
conversions.
2019-10-09 09:08:19 -07:00
Federico Tedin
f96b8fd27c Filter packages by name in list-packages. (Bug#36981)
* lisp/emacs-lisp/package.el (package-menu-filter-by-name): New
function to filter packages by name.
(package-menu-clear-filter): New function to clear applied filters.
(package-menu-filter-by-keyword): Rename function from
package-menu-filter.
(package-menu--generate): Don't change 'q' binding anymore.
(package-menu-mode-map): Bind '/ n' to package-menu-filter-by-name, '/
k' to package-menu-filter-by-keyword and '/ /' to
package-menu-clear-filter.
(package-menu-mode-menu): Update menu entries for the three functions.
* test/lisp/emacs-lisp/package-tests.el (package-test-list-filter-by-name)
(package-test-list-clear-filter): New tests.
* doc/emacs/package.texi: Document usage of
package-menu-filter-by-name, package-menu-clear-filter and update
reference to package-menu-filter-by-keyword.
* etc/NEWS: Announce changes.
2019-10-08 19:24:12 +02:00
Stefan Monnier
b12edc6171 * lisp/emacs-lisp/package.el (package--get-deps): Fix thinko
* test/lisp/emacs-lisp/package-tests.el (package-test-get-deps):
Adjust test to new calling convention.
2019-10-08 09:36:01 -04:00
Stefan Kangas
9839466b23 Add "python3 -m twine" example to comint-password-prompt tests
* test/lisp/comint-tests.el (comint-testsuite-password-strings): Add
new example for "python3 -m twine" to test suite.  (Bug#37636)
2019-10-07 20:51:53 +02:00
Paul Eggert
9d829b8be5 Fix off-by-one bug in ISO 8601 BC years
* lisp/calendar/iso8601.el (iso8601--year-match)
(iso8601--full-date-match, iso8601--without-day-match)
(iso8601--week-date-match, iso8601--ordinal-date-match)
(iso8601-parse-date):
Don’t bother to separate the year’s sign from the year,
as that distinction is not needed: ISO 8601 uses
astronomical year numbering with a year zero, which
is what the Emacs time functions use, so there’s no
need to treat nonpositive years specially.
(iso8601--adjust-year): Remove; no longer needed
since callers can just use string-to-number.
* test/lisp/calendar/iso8601-tests.el (test-iso8601-date-years):
Adjust test case to match fixed behavior.
2019-10-05 21:24:09 -07:00
Paul Smith
e72e4990f9 Support GNU make error messages in compile mode.
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Match GNU make error messages.
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data):
Test GNU make error message matching.
(compile-test-error-regexps): Update count of infos found.
2019-10-05 12:33:23 -07:00
Lars Ingebrigtsen
4f2de56830 Remove some XEmacs compat code from the CEDET tests 2019-10-05 17:01:33 +02:00
Stefan Kangas
ef8fadf8c1 Add tests for secure-hash and improve doc string (Bug#37420)
* src/fns.c (Fsecure_hash_algorithms): Fix typo.
(Fsecure_hash): Add algorithm list to doc string.
* test/src/fns-tests.el (test-secure-hash): New test.
2019-10-04 17:30:57 +02:00
Mattias Engdegård
32558cfe53 Fix error in gnu compilation-mode regexp (bug#37582)
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Fix a mistake introduced when the regexp was translated to rx.
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data)
(compile-test-error-regexps): Add test case.
* etc/compilation.txt: Add example.
2019-10-04 15:43:15 +02:00
Mattias Engdegård
d09cbcee9c Make compile-tests re-runnable
* test/lisp/progmodes/compile-tests.el (compile-test-error-regexps):
Don't rely on compilation-num-errors (etc) all being zero, which they
aren't if the test has been run before.
(compile-tests--test-regexps-data): Change defvar to defconst.
2019-10-04 15:43:15 +02:00
Stefan Kangas
93dd959711 More doc fixes in package.el (Bug#37544)
* lisp/emacs-lisp/package.el (package-menu-hide-low-priority)
(package-pinned-packages, package-load-descriptor)
package-archive-version, package-archive-contents)
package--read-archive-file, package-read-archive-contents)
(package-unsigned-archives, package-read-all-archive-contents)
(package--download-and-read-archives, package-install):
* lisp/subr.el (package--description-file):
* test/lisp/emacs-lisp/package-tests.el: Doc fixes.
2019-10-04 01:14:15 +02:00
Basil L. Contovounesios
0fc8177414 Further improve button.el support for help-echo
The last change to forward-button added support for help-echo values
that are functions.  This patch fixes the arguments passed to such
functions and further adds support for help-echo values that are
forms (bug#37515).
* doc/lispref/display.texi (Button Properties): Fix description of
help-echo button property.
* lisp/button.el (button--help-echo): New function.
(forward-button): Use it.
(backward-button): Clarify help-echo reference in docstring.
* test/lisp/button-tests.el (button--help-echo-string)
(button--help-echo-form, button--help-echo-function): New tests.
2019-10-03 23:05:14 +01:00
Michael Albinus
5b09393f2c Fix typo in last commit 2019-10-03 10:47:12 +02:00
Michael Albinus
b27c7f3e60 Further adaptions for shadowfile-tests.el
* test/lisp/shadowfile-tests.el: Change some traces.
(shadow-test-remote-temporary-file-directory): Adapt also remote
home directory.
(shadow--tests-cleanup): Cleanup Tramp.
2019-10-03 10:44:02 +02:00
Glenn Morris
b0043f688a Update a substitute-command-keys test
* test/src/doc-tests.el (doc-test-substitute-command-keys):
Update for recent minibuffer map change.
2019-10-01 17:35:26 -07:00
Stephen Gildea
0e56883878 Move undocumented time-stamp formats closer to format-time-string
* time-stamp.el (time-stamp-string-preprocess): Update some undocumented
formatting characters of time-stamp format for closer (still incomplete)
alignment with format-time-string.  They have displayed a warning since
Emacs 20 (released in 1997), so it is unlikely anyone is using them.

* time-stamp-tests.el: Update tests to match new expectations.
2019-09-30 20:22:51 -07:00
Stephen Gildea
8ba1ca54f3 time-stamp doc: recommend formats closer to format-time-string
* time-stamp.el (time-stamp-format, time-stamp-pattern): Update
recommended (documented) formats.  No code changes, just documentation.
All recommended formats are compatible at least as far back as Emacs
22.1 (released in 2007) and are now closer to compatibility with
format-time-string.

* time-stamp-tests.el: Update test comments to match.
2019-09-30 20:08:12 -07:00
Lars Ingebrigtsen
c34801f883 Update iso8601-tests for new interface 2019-09-29 21:57:59 +02:00
Lars Ingebrigtsen
0df01e3aa5 Add support for sub-second ISO8601 strings
* lisp/calendar/iso8601.el (iso8601--decimalize): New function.
(iso8601-parse-time): Support sub-second ISO8601 times.
2019-09-29 21:22:36 +02:00
Mattias Engdegård
2fa33eb6ee Add `rx-submatch-n' for compatibility (bug#37517)
It was an internal symbol in the old `rx' implementation, used in old
versions of the `flycheck' package.

* lisp/emacs-lisp/rx.el (rx-submatch-n): Alias of `rx-to-string'.
* test/lisp/emacs-lisp/rx-tests.el (rx-compat): Test it.
2019-09-29 17:08:43 +02:00
Mattias Engdegård
19405291aa Fix linear equation system solving in Calc (bug#35374)
* lisp/calc/calcalg2.el (math-try-solve-for):
To solve Ax^n=0 where A is a nonzero constant and x the variable to
solve for, solve x^n=0 instead of solving A=0 (which obviously fails)
or something equally stupid.
* test/lisp/calc/calc-tests.el (calc-test-solve-linear-system): New.
2019-09-29 13:41:21 +02:00
Lars Ingebrigtsen
9767bd2b78 Add some commented-out tests for iso8601 2019-09-29 13:04:01 +02:00
Stephen Gildea
c359782ae6 Reorganize time-stamp tests
* time-stamp-tests.el: Group tests by when the format was or will be
documented.  Add tests for a few more undocumented, volatile formats.
Change AM hours test time to be a different hour from PM test time.
(Making these changes to the tests now will minimize test changes
needed later with anticipated code changes.)
2019-09-28 15:48:45 -07:00
Mauro Aranda
283fd5f2f6 Don't discard customizations in progress when adding comments (Bug#5358)
* lisp/cus-edit.el (custom-comment-show): Add docstring.  Save the
widget value in the :shown-value property, before redrawing.
(custom-variable-modified-p): New function, to complement the return
values of custom-variable-state.
(custom-variable-state-set): Use it.
(custom-face-value-create): Add children to the custom-face widget
before setting the state, to be able to check for user edits.
(custom-face-state-set): Check for user edits before calling
custom-face-state (bug#5358).

* test/lisp/custom-tests.el
(custom-test-show-comment-preserves-changes): New test.
2019-09-27 18:06:36 +02:00
Michael Albinus
ce89cb760f ; Add traces to shadowfile-tests.el 2019-09-26 20:55:49 +02:00
Stefan Kangas
3cf8f9b1ec Remove support for destructive splicing in elisp
* src/lread.c (read1): Don't handle destructive splicing in
backquote expressions (e.g. ",.<identifier>").  (Bug#19790)
(syms_of_lread): Remove Qcomma_dot.
* src/print.c (print_object): Don't check for Qcomma_dot.
* test/src/eval-tests.el
(eval-tests-19790-backquote-comma-dot-substitution): New test.
* etc/NEWS: Announce it.
2019-09-26 18:37:23 +02:00
Mauro Aranda
45524b9702 Don't indent unrelated widgets following widget of type 'other
* lisp/wid-edit.el (widget 'other): Use \n instead of the %n escape in the
:format property of this widget.  If %n is used at the end of the
format string, unrelated widgets get indented.  (Bug#12533)

* test/wid-edit-tests.el (widget-test-indentation-after-%n)
(widget-test-indentation-after-newline)
(widget-test-newline-and-indent-same-widget): New tests.
2019-09-26 17:16:28 +02:00
Michael Albinus
1667bc2fa7 Avoid errors in tramp-tests with a remote ksh shell
* test/lisp/net/tramp-tests.el (tramp--test-ksh-p): New defun.
(tramp-test41-utf8, tramp-test41-utf8-with-stat)
(tramp-test41-utf8-with-perl, tramp-test41-utf8-with-ls):
Skip, when remote shell is ksh.
2019-09-26 09:33:47 +02:00
Mattias Engdegård
07367e5b95 Add rx extension mechanism
Add a built-in set of extension macros: `rx-define', `rx-let' and
`rx-let-eval'.

* lisp/emacs-lisp/rx.el (rx-constituents, rx-to-string): Doc updates.
(rx--builtin-symbols, rx--builtin-names, rx--local-definitions)
(rx--lookup-def, rx--substitute, rx--expand-template)
(rx--make-binding, rx--make-named-binding, rx--extend-local-defs)
(rx-let-eval, rx-let, rx-define): New.
(rx--translate-symbol, rx--translate-form): Use extensions if any.
(rx): Use local definitions.
* test/lisp/emacs-lisp/rx-tests.el (rx-let, rx-define)
(rx-to-string-define, rx-let-define, rx-let-eval): New.
* etc/NEWS (Changes in Specialized Modes and Packages):
* doc/lispref/searching.texi (Rx Notation, Rx Functions, Extending Rx):
Add node about rx extensions.
2019-09-25 14:29:50 -07:00
Mattias Engdegård
2ed71227c6 New rx implementation
* lisp/emacs-lisp/rx.el:
* test/lisp/emacs-lisp/rx-tests.el:
* doc/lispref/searching.texi (Rx Constructs):
Rewrite rx for correctness, clarity, and performance.  The new
implementation retains full compatibility and has more comprehensive
tests.

* lisp/emacs-lisp/re-builder.el (reb-rx-font-lock-keywords):
Adapt to changes in internal variables in rx.el.
2019-09-25 14:29:50 -07:00
Lars Ingebrigtsen
ea5c79f657 Allow controlling when to send cookies when retrieving images in shr
* lisp/net/shr.el (shr--use-cookies-p): New function.
(shr-tag-img): Use it.
(shr-cookie-policy): New variable.
(shr-save-contents): Use cookies.

* doc/misc/eww.texi (Advanced): Document it.
2019-09-24 17:48:41 +02:00
Lars Ingebrigtsen
0faf3496ab Adjust exif-tests.el to new interface 2019-09-23 22:02:58 +02:00
Michael Albinus
a877e2217a ; Enable traces for shadowfile-tests on hydra 2019-09-23 13:08:02 +02:00
Paul Eggert
946a56a10f Update some URLs
This mostly changes http: to https: in URLs.  It also updates
some URLs that have moved, removes some URLs that no longer
work, recommends against using procmail (procmail.org no
longer works), and removes some mentions of the
no-longer-existing Gmane, LPF and VTW.
It doesn't update all URLs, just the ones I had time for.
* GNUmakefile (help):
* admin/admin.el (manual-doctype-string):
* admin/charsets/Makefile.in (${charsetdir}/ALTERNATIVNYJ.map):
* admin/charsets/mapconv:
* lisp/net/soap-client.el (soap-create-envelope):
* lisp/org/org.el (org-doi-server-url):
* lisp/textmodes/bibtex.el (bibtex-generate-url-list):
Prefer https: to http: un URLs.
2019-09-23 00:12:52 -07:00
Stephen Gildea
a33cda168e Expand time-stamp unit tests to cover all formatting options
* time-stamp-tests.el: Expand unit tests to cover all formatting options.
These tests validate time-stamp-pattern formatting that has existed
since at least Emacs 22 (released in 2007).  The tests cover both
documented behavior and behavior implemented to support future migrations.

* time-stamp.el (time-stamp-string): Add a second argument (TIME) to
open a testing seam.  Have the unit tests call this public function.

* time-stamp.el (time-stamp-string, time-stamp-string-preprocess):
Remove the second pass through time-string--format.  (Previously both
functions called it.)  It was used only to handle "%", but this is now
handled by having time-stamp-string-preprocess not double it.
Not doubling the "%" in time-stamp-string-preprocess fixes the padding
of "%2%", which was discovered by the new unit tests to be wrong.
2019-09-22 20:31:59 -07:00
Jackson Ray Hamilton
9aacc443d9
Ignore comments and strings when recognizing JSX
* lisp/progmodes/js.el (js-syntax-propertize): Ignore comments and
strings.
* test/manual/indent/jsx-comment-string.jsx: New test.
2019-09-22 12:55:44 -07:00
Paul Eggert
2f600e97e7 Avoid crashes when casifying noncontiguous regions
This is a followon fix for Bug#37477.
* lisp/simple.el (region-extract-function):
Use setq here, since the var is now defined in C code.
* src/casefiddle.c (casify_pnc_region): New function.
(Fupcase_region, Fdowncase_region, Fcapitalize_region)
(Fupcase_initials_region): Use it.
(Fupcase_initials_region): Add region-noncontiguous-p flag
for consistency with the others.  All uses changed.
(syms_of_casefiddle): Define Qbounds, Vregion_extract_function.
* src/insdel.c (prepare_to_modify_buffer_1):
* src/keyboard.c (command_loop_1):
Use Vregion_extraction_function.
* src/insdel.c (syms_of_insdel): No need to define
Qregion_extract_function.
* test/src/casefiddle-tests.el (casefiddle-oldfunc): New var.
(casefiddle-loopfunc, casefiddle-badfunc): New functions.
(casefiddle-invalid-region-extract-function): New test.
2019-09-22 10:45:14 -07:00
Lars Ingebrigtsen
535b65875e Add an Exif parsing library
* lisp/image/exif.el: New file (bug#23070).

* test/lisp/image/exif-tests.el: Add some basic tests.
2019-09-21 18:13:11 +02:00
Michael Albinus
ffcec7cd4b Simplify tramp-tests.el check for owncloud/nextcloud
* test/lisp/net/tramp-tests.el (tramp-test11-copy-file):
Simplify check for owncloud/nextcloud connections.
2019-09-18 14:12:54 +02:00
Tino Calancha
57ac6523af Add backquote tests
* test/lisp/emacs-lisp/backquote-tests.el: New file (bug#37432).
2019-09-16 22:57:35 +02:00
Michael Albinus
6684db8cea ; Disable traces in shadowfile-tests 2019-09-16 15:00:37 +02:00
Glenn Morris
a625ca5c26 Merge from origin/emacs-26
30c4f35 (origin/emacs-26) query-replace-regexp undo: Update next-repl...
c596be0 Amend the menu caption for page "Display Property" in the Eli...
13b9510 Add description of chinese-sisheng
2019-09-15 16:38:23 -07:00
Michael Albinus
6d3cb263f9 Use also truname of temporary-file-directory in shadowfile-tests.el
* test/lisp/shadowfile-tests.el (top): Use truename of
`temporary-file-directory' and
`shadow-test-remote-temporary-file-directory'.  (Bug#37202)
(shadow-test08-shadow-todo, shadow-test09-shadow-copy-files):
Do not bind `shadow-test-remote-temporary-file-directory'.
2019-09-15 16:52:22 +02:00
Gemini Lasswell
3bd6ef40b5 Create common tests for print.c and cl-print.el
* test/lisp/emacs-lisp/cl-print-tests.el
(cl-print--test, cl-print-tests-1, cl-print-tests-2)
(cl-print-tests-3, cl-print-tests-4, cl-print-tests-5)
(cl-print-tests-strings, cl-print-circle, cl-print-circle-2):
Remove.
* test/src/print-tests.el (print-tests--prin1-to-string): New
alias.
(print-tests--deftest): New macro.
(print-hex-backslash, print-read-roundtrip, print-bignum): Define with
print-tests--deftest and use print-tests--prin1-to-string.
(print-tests--prints-with-charset-p): Use
print-tests--prin1-to-string.
(print-tests--print-charset-text-property-nil)
(print-tests--print-charset-text-property-t)
(print-tests--print-charset-text-property-default): Define with
print-tests--deftest.
(print-tests-print-gensym)
(print-tests-continuous-numbering, print-tests-1, print-tests-2)
(print-tests-3, print-tests-4, print-tests-5)
(print-tests-strings, print-circle, print-circle-2): New tests.
(print--test, print-tests-struct): New cl-defstructs.
2019-09-13 13:43:07 -07:00
Gemini Lasswell
2093395dbf Improve print output options commands in backtrace-mode (bug#36566)
* lisp/emacs-lisp/backtrace.el (backtrace-view): Mention
:print-gensym in docstring.
(backtrace-mode-map): Add keyboard binding for
backtrace-toggle-print-gensym.  Add menu entries for
backtrace-toggle-print-circle and backtrace-toggle-print-gensym.
(backtrace--with-output-variables): Bind print-gensym with value
of :print-gensym found in view plist.
(backtrace-toggle-print-circle): Remove description of
implementation details from docstring.
(backtrace-toggle-print-gensym): New command.
(backtrace--toggle-feature): Add echo area message describing result
of command.

* test/lisp/emacs-lisp/backtrace-tests.el
(backtrace-tests--print-circle): New test.

* doc/lispref/debugging.texi (Backtraces): Document keyboard
binding for backtrace-toggle-print-gensym.
2019-09-13 13:43:07 -07:00
Michael Albinus
8806c196ab Fix problems in tramp-test33-environment-variables
* test/lisp/net/tramp-tests.el (tramp-test33-environment-variables):
Use ${parameter:-word} construct.  Remove PS1 entry from
"printenv" output.
(tramp--test-check-files): Use "printenv".
2019-09-13 12:08:34 +02:00
Noam Postavsky
cbb8a8ad97 Fix fill-paragraph in python docstrings (Bug#36056)
* lisp/progmodes/python.el (python-do-auto-fill): New function.
(python-mode): Set it as normal-auto-fill-function, and don't set
fill-indent-according-to-mode.  Having the latter set during
fill-paragraph gives wrongs result, because python-indent-line doesn't
remove indentation added by filling.
* test/lisp/progmodes/python-tests.el (python-fill-docstring): New
test.
2019-09-12 20:25:30 -04:00
Ulf Jasper
74e9799bd8 Handle missing start-time when importing ical event (Bug#33277)
* lisp/calendar/icalendar.el (icalendar--convert-ical-to-diary): Set
start time only if it is explicitly given in ical.  Do not use
start-time as default for end-time (Bug#33277).

* test/lisp/calendar/icalendar-tests.el (icalendar-import-bug-33277):
New.  Test fix for Bug#33277.
2019-09-09 18:35:02 +02:00
Tino Calancha
30c4f35a6f query-replace-regexp undo: Update next-replacement after undo
* lisp/replace.el (perform-replace):
Rename the local binding to not shadow next-replacement.
Update next-replacement after undo (Bug#37287).

* test/lisp/replace-tests.el (query-replace-undo-bug37287): Add test.
(query-replace-undo-bug37073): Tweak this test.
2019-09-09 08:21:18 +02:00
Michael Albinus
f8143323c7 Fix Bug#37202
* test/lisp/shadowfile-tests.el (shadow-test08-shadow-todo)
(shadow-test09-shadow-copy-files): Use truename of
`shadow-test-remote-temporary-file-directory'.  (Bug#37202)
2019-09-08 10:13:13 +02:00
Michael Albinus
01a04880ca Add traces in shadowfile
* lisp/shadowfile.el (shadow-add-to-todo)
(shadow-remove-from-todo, shadow-save-todo-file):
* test/lisp/shadowfile-tests.el (shadow-test08-shadow-todo):
Add traces.
2019-09-07 12:31:31 +02:00
Michael Albinus
ed80d6d88c Further work on Bug#37202
* test/lisp/shadowfile-tests.el (shadow-debug): Set to t.
(shadow--tests-cleanup): Simplify.
(shadow-test*): Call `shadow-initialize'.
(shadow-test08-shadow-todo, shadow-test09-shadow-copy-files):
In cleanup, kill buffers used for test.
(top): Do not initialize.
2019-09-04 14:13:13 +02:00
Michael Albinus
ea5d591f29 Fix Bug#37202
* lisp/shadowfile.el (shadow-debug): New defvar.
(shadow-read-files): Suppress error if there's no TODO file.

* test/lisp/shadowfile-tests.el (shadow-debug): Set to nil.
(shadow--tests-cleanup): New defun.  Apply to all tests.  (Bug#37202)
(shadow-test06-literal-groups): Cleanup temp buffer.
(shadow-test08-shadow-todo): Add debug messages.
(top): Cleanup initially.
2019-09-03 13:55:42 +02:00
Noam Postavsky
7e527af72c Fix non-deterministic process test
* test/src/process-tests.el (set-process-filter-t): Don't assume
subprocess output will come in a single chunk, keep waiting for more
data until next "prompt" is read from subprocess.

(cherry picked from commit aa49aa8840)
2019-09-01 14:40:00 -04:00
Glenn Morris
2de46be662 * test/lisp/net/tramp-tests.el (tramp-test21-file-links): More cleanup. 2019-08-31 10:30:14 -07:00
Michael Albinus
d09a1d66c6 Extend tramp--test-check-files (Bug#37228)
* test/lisp/net/tramp-tests.el (tramp--test-check-files): Test also
`directory-files-and-attributes'.  (Bug#37228)
2019-08-30 13:54:42 +02:00
Michael Albinus
7803e65ffc Clarify meaning of <filename> in test/README 2019-08-28 20:39:33 +02:00
Michael Albinus
ba1f7797fb Deactivate part of tramp--test-check-files on macOS (Bug#36940)
* test/lisp/net/tramp-tests.el (tramp--test-check-files): Do not
search for environment variables on macOS.  (Bug#36940)
2019-08-27 18:53:26 +02:00
Michael Albinus
693e9be587 * test/Makefile.in (test_template): Declare target FOO.log. 2019-08-27 12:58:38 +02:00
Michael Albinus
f87ace2aed ; Continued attempt to fix Bug#36940
* test/lisp/net/tramp-tests.el (tramp--test-file-attributes-equal-p):
Handle link number.
(tramp--test-check-files): Encode search string on macOS.  (Bug#36940)
2019-08-26 16:14:16 +02:00
Paul Eggert
575179f74d Make (mod 1.0 0) consistent with (/ 1.0 0)
* src/data.c (Fmod): Do not signal an error for (mod 1.0 0), for
the same reason (/ 1.0 0) does not signal an error.
* test/src/data-tests.el (data-tests-mod-0): New test.
2019-08-24 15:55:08 -07:00
Noam Postavsky
aa49aa8840 Fix non-deterministic process test
* test/src/process-tests.el (set-process-filter-t): Don't assume
subprocess output will come in a single chunk, keep waiting for more
data until next "prompt" is read from subprocess.
2019-08-24 12:16:26 -04:00
Robert Pluim
649fb17443 Fix DNS tests
* test/src/process-tests.el: (lookup-family-specification,
lookup-unicode-domains, unibyte-domain-name, lookup-google,
non-existent-lookup-failure): Skip on Hydra, which doesn't have DNS.
Fix buggy test condition.  (Bug#37165)
2019-08-24 14:57:58 +02:00
Michael Albinus
42f8fa8070 Fix some problems of Bug#36940
* test/lisp/net/tramp-tests.el (tramp-test22-file-times): Do not
compare time value lists by `equal'.  (Bug#36940).
(tramp-test30-make-process): Adapt "kill" message to match on macOS.
2019-08-24 10:10:05 +02:00
Lars Ingebrigtsen
53cb3d3e0d Merge remote-tracking branch 'origin/netsec' 2019-08-23 04:49:52 +02:00
Paul Eggert
951ea375d5 Don’t hard-loop on cycles in ‘read’ etc.
Problem for ‘read’ reported by Pip Cet in:
https://lists.gnu.org/r/emacs-devel/2019-08/msg00316.html
* src/fns.c (Frequire): Protect against circular current-load-list.
* src/lread.c (Fget_load_suffixes):
Protect against circular load-suffixes or load-file-rep-suffixes.
(Fload): Protect against circular loads-in-progress.
(openp): Protect against circular PATH and SUFFIXES.
(build_load_history): Protect against circular load-history or
current-load-list.
(readevalloop_eager_expand_eval): Protect against circular SUBFORMS.
(read1): Protect against circular data.
* test/src/lread-tests.el (lread-circular-hash): New test.
2019-08-21 17:21:06 -07:00
Michael Albinus
0f801d4a5e ; Fix typo introduced by last autorevert-tests patch 2019-08-21 11:03:34 +02:00
Michael Albinus
c2abe6abba ; Add traces to auto-revert-test02-auto-revert-deleted-file 2019-08-21 09:19:28 +02:00
Paul Eggert
396ed88a50 Avoid some excess precision in time arithmetic
* doc/misc/emacs-mime.texi (time-date):
Adjust example to match new behavior.
* etc/NEWS: Mention this.
* lisp/calendar/time-date.el (decoded-time-add)
(decoded-time--alter-second):
Don’t lose underestimate precision of seconds component.
* src/bignum.c (mpz): Grow by 1.
* src/timefns.c (trillion_factor): New function.
(timeform_sub_ps_p): Remove.
(time_arith): Avoid unnecessarily-large hz, by reducing the hz
to a value no worse than the worse hz of the two arguments.
The result is always exact unless an error is signaled.
* test/src/timefns-tests.el (timefns-tests--decode-time):
New function.
(format-time-string-with-zone): Test (decode-time LOOK ZONE t)
resolution as well as its numeric value.
2019-08-20 17:36:46 -07:00
Paul Eggert
5a95521282 Support larger TIMEs in (time-convert TIME t)
Also, improve the doc to match current behavior.
* doc/lispref/os.texi (Time Conversion): Document that
time-convert signals an error for infinite or NaN args,
and that (time-convert TIME t) is exact otherwise.
Mention float-time as an alternative to time-convert.
(Time Calculations): Document that time-add and time-subtract
are exact and do not decrease HZ below the minimum of their args.
* src/timefns.c (decode_float_time): Don’t signal an error for
floating-point arguments whose base-FLT_RADIX exponent is not less
than DBL_MANT_DIG.  Instead, convert them to (TICKS . 1) values.
Use two (instead of three) integer exponent comparisons in the
typical case.
* test/src/timefns-tests.el (time-arith-tests):
Add more floating-point tests, including some tests
that the old code fails.
2019-08-20 15:45:59 -07:00
Michael Albinus
fde614f4cc Another attempt to fix bug#32645
* test/lisp/autorevert-tests.el ()
(auto-revert-test02-auto-revert-deleted-file):
* test/lisp/filenotify-tests.el (file-notify-test04-autorevert):
Check `file-notify-valid-p', not that the descriptor is nil.
2019-08-20 21:32:34 +02:00
Glenn Morris
af103ef3c9 Merge from origin/emacs-26
615cff4 (origin/emacs-26) Fix process filter documentation (Bug#13400)
beb1d22 Fix query-replace-regexp undo feature

# Conflicts:
#	test/lisp/replace-tests.el
2019-08-20 09:04:53 -07:00
Glenn Morris
8f68449c94 Merge from origin/emacs-26
0b810eb Fix a typo in char-width-table
3f00db7 Minor update in admin/notes/unicode
bcd0115 Fix lisp indent infloop on unfinished strings (Bug#37045)
5f992d1 Improve commentary in composite.el
3a04be2 ; Improve commentary in xdisp.c
15de1d1 Fix markup in dired-x.texi
bda7fc7 ; Fix typo in a doc string of speedbar.el
6f57ef9 * src/callproc.c (Fcall_process): Doc fix.

# Conflicts:
#	doc/misc/dired-x.texi
#	lisp/international/characters.el
#	src/callproc.c
2019-08-20 09:01:55 -07:00
Paul Eggert
2197ea89bf Fix time-add/time-sub validity checking
* src/timefns.c (time_arith): Check the first arg for
validity even if the second arg is not finite.
* test/src/timefns-tests.el (time-arith-tests): Test this.
2019-08-19 18:05:15 -07:00
Tino Calancha
beb1d22260 Fix query-replace-regexp undo feature
Ensure that non-regexp strings used with `looking-at' are quoted.
* lisp/replace.el (perform-replace): Quote regexp (Bug#37073).
* test/lisp/replace-tests.el (replace-tests-perform-replace-regexp-flag):
New variable.
(replace-tests-with-undo): Use it.
(query-replace-undo-bug37073): Add tests.
2019-08-19 17:32:09 +02:00
Noam Postavsky
f9464020d4 Handle more subprocess chunking in M-x man (Bug#36927)
* lisp/man.el (Man-bgproc-filter): Make sure not to chop man sections
by narrowing.
(Man-highlight-references0): Revert previous fix, as it's no longer
needed.
* test/lisp/man-tests.el (man-tests-filter-strings): New function.
(man-bgproc-filter-buttonize-includes): New test.
2019-08-18 18:19:21 -04:00
Eli Zaretskii
190565b239 Support the new Japanese era name
* admin/unidata/NormalizationTest.txt:
* admin/unidata/UnicodeData.txt: Add U+32FF SQUARE ERA NAME REIWA.
Do not merge to master.

* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--failing-lines-part1)
(ucs-normalize-tests--failing-lines-part2): Update.  Do not
merge to master.

* etc/NEWS: Mention the change.
2019-08-18 19:36:31 +03:00
Paul Eggert
643df79279 Port test harness to Solaris 10
* test/Makefile.in (ELFILES): Port to Solaris 10, where
‘find’ does not support ‘-path’.
2019-08-17 09:16:59 -07:00
Noam Postavsky
bcd0115e4d Fix lisp indent infloop on unfinished strings (Bug#37045)
* lisp/emacs-lisp/lisp-mode.el (lisp-indent-calc-next): Stop trying to
skip over strings if we've hit the end of buffer.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-indent-unfinished-string): New test.
2019-08-17 09:42:34 -04:00
Paul Eggert
37257d6aca More-compatible subsecond calendrical timestamps
Instead of appending a subseconds member to the result of
‘decode-time’, this keeps the format unchanged unless you give
a new optional argument to ‘decode-time’.  Also, the augmented
format now puts the subsecond info in the SECONDS element, so
the total number of elements is unchanged; this is more
compatible with code that expects the traditional 9 elements,
such as ‘(pcase decoded-time (`(,SEC ,MIN ,HOUR ,DAY ,MON
,YEAR ,DOW ,DST ,ZONE) ...) ...)’.
* doc/lispref/os.texi, doc/misc/emacs-mime.texi, etc/NEWS:
* lisp/net/soap-client.el (soap-decode-date-time):
* lisp/simple.el (decoded-time):
Document the new behavior.
* lisp/calendar/icalendar.el (icalendar--decode-isodatetime):
* lisp/calendar/iso8601.el (iso8601-parse)
(iso8601-parse-time, iso8601-parse-duration)
(iso8601--decoded-time):
* lisp/calendar/parse-time.el (parse-time-string):
* lisp/calendar/time-date.el (decoded-time-add)
(decoded-time--alter-second):
* lisp/org/org.el (org-parse-time-string):
* lisp/simple.el (decoded-time):
* src/timefns.c (Fdecode_time, Fencode_time):
* test/lisp/calendar/icalendar-tests.el:
(icalendar--decode-isodatetime):
* test/lisp/calendar/iso8601-tests.el (test-iso8601-date-years)
(test-iso8601-date-dates, test-iso8601-date-obsolete)
(test-iso8601-date-weeks, test-iso8601-date-ordinals)
(test-iso8601-time, test-iso8601-combined)
(test-iso8601-duration, test-iso8601-intervals)
(standard-test-dates, standard-test-time-of-day-fractions)
(standard-test-time-of-day-beginning-of-day)
(standard-test-time-of-day-utc)
(standard-test-time-of-day-zone)
(standard-test-date-and-time-of-day, standard-test-interval):
* test/lisp/calendar/parse-time-tests.el (parse-time-tests):
* test/src/timefns-tests.el (format-time-string-with-zone)
(encode-time-dst-numeric-zone):
Revert recent changes that added a SUBSECS member to
calendrical timestamps, since that component is no longer
present (the info, if any, is now in the SECONDS member).
* lisp/calendar/time-date.el (decoded-time-add)
(decoded-time--alter-second):
Support fractional seconds in the new form.  Simplify.
* src/timefns.c (Fdecode_time): Support new arg FORM.
(Fencode_time): Support subsecond resolution.
* test/src/timefns-tests.el (format-time-string-with-zone)
(decode-then-encode-time): Test subsecond calendrical timestamps.
2019-08-16 23:25:07 -07:00
Paul Eggert
f6dd46cba8 Subtracting “now” from “now” should yield zero
* src/timefns.c (time_arith): Arrange for (time-subtract nil
nil) to yield 0, to be consistent with (time-equal-p nil nil).
* test/lisp/calendar/time-date-tests.el (test-time-since): New test.
2019-08-16 18:12:24 -07:00
Paul Eggert
f9fd12a30b Fix time-add rounding bug
Without this fix, time arithmetic yielded results that were not
mathematically accurate, even though the exact results were
representable; for example, (time-add 0 1e-13) yielded a timestamp
equal to 0 instead of to 1e-13.
* lisp/timezone.el (timezone-time-from-absolute):
Let time-add do its thing rather than using floating point
internally, which has rounding errors.  We now have bignums and so
don’t need floating point to avoid overflow issues.
* src/timefns.c (timeform_sub_ps_p): New function.
(time_arith): If either argument is a float, represent the
result exactly instead of discarding sub-ps info.
* test/lisp/timezone-tests.el (timezone-tests-time-from-absolute):
Don’t assume (HI LO US PS) timestamp format.
* test/src/emacs-module-tests.el (mod-test-add-nanosecond/valid):
Don’t assume that time-add discards sub-ns info.
* test/src/timefns-tests.el (time-rounding-tests):
Add regression test to detect time-add rounding bug.
2019-08-16 16:27:27 -07:00
Lars Ingebrigtsen
ab8a96977f Reimplement the `fill-flowed' function to respect space stuffing
* lisp/mail/flow-fill.el (fill-flowed): Reimplement the function
to respect space-stuffing (bug#17190).

* test/lisp/mail/flow-fill-tests.el
(fill-flow-tests-fill-flowed-stuffed): New test.
(fill-flow-tests-fill-flowed-decode): Rename the test so that it
actually runs.
2019-08-15 18:00:16 -07:00
Paul Eggert
af82a6248c Fix rounding errors with float timestamps
When converting from float to (TICKS . HZ) form, do the
conversion exactly.  When converting from (TICKS . HZ) form to
float, round to even precisely.  This way, successfully
converting a float to (TICKS . HZ) and back yields a value
numerically equal to the original.
* src/timefns.c (flt_radix_power_size): New constant.
(flt_radix_power): New static var.
(decode_float_time): Convert the exact numeric value rather
than guessing TIMESPEC_HZ resolution.
(s_ns_to_double): Remove; no longer needed.
(frac_to_double): New function.
(decode_ticks_hz): It is now the caller’s responsibility to
pass a valid TICKS and HZ.  All callers changed.
Use frac_to_double to round (TICKS . HZ) precisely.
(decode_time_components): When decoding nil, use
decode_ticks_hz since it rounds precisely.
(syms_of_timefns): Initialize flt_radix_power.
* test/src/timefns-tests.el (float-time-precision): New test.
2019-08-15 10:41:40 -07:00
Michael Albinus
f6ae51c71d Give auto-revert-test02-auto-revert-deleted-file a chance on hydra
* test/lisp/autorevert-tests.el
(auto-revert-test02-auto-revert-deleted-file): Don't skip on hydra.
2019-08-15 16:40:53 +02:00
Paul Eggert
311fcab8f8 Port mod-test-nanoseconds to 32-bit Emacs
* test/src/emacs-module-tests.el (mod-test-nanoseconds):
Don’t assume -1000000000 is a fixnum.
2019-08-15 02:06:34 -07:00
Óscar Fuentes
dbae38efc2 * lisp/password-cache.el: adapt test to change in password-in-cache-p 2019-08-12 16:22:34 +02:00
Michael Albinus
95552e08db Retrieve start time from remote machine, use compat attrib functions
* lisp/net/tramp-compat.el (tramp-compat-file-attribute-access-time)
(tramp-compat-file-attribute-status-change-time): New defaliases.

* test/lisp/net/tramp-tests.el (tramp--test-start-time): New defvar.
(tramp--test-file-attributes-equal-p)
(tramp-test19-directory-files-and-attributes): Use it.
(tramp-test18-file-attributes)
(tramp--test-file-attributes-equal-p, tramp-test20-file-modes)
(tramp-test22-file-times, tramp--test-check-files):
Use `tramp-compat-file-attribute-*' functions.
2019-08-11 12:06:57 +02:00
Michael Albinus
2c5dd68018 Use a time offset when comparing times of local and remote machines
* test/lisp/net/tramp-tests.el (tramp--test-file-attributes-equal-p):
Use a time offset in order to compensate different times on local
and remote machines.
2019-08-10 11:34:13 +02:00
Michael Albinus
78ddf6ba96 Improve time arithmetic in tramp--test-file-attributes-equal-p
* test/lisp/net/tramp-tests.el (tramp--test-file-attributes-equal-p):
Improve time arithmetic.
2019-08-08 15:42:45 +02:00
Stefan Kangas
2c0f6c3540 Suppress interactive-only warnings in undo-tests.el (Bug#36565)
* test/src/undo-tests.el (undo-test-region-deletion)
(undo-test-region-example, undo-test-marker-adjustment-nominal)
(undo-test-region-t-marker, undo-test-marker-adjustment-moved)
(undo-test-region-mark-adjustment): Suppress interactive-only warnings
by using funcall-interactively.
2019-08-08 08:26:31 -04:00
Glenn Morris
d5622eb6ff Tests need to be moved when source files are
* test/lisp/obsolete/cl-tests.el: Move from test/lisp/emacs-lisp.
2019-08-07 09:24:15 -07:00
Michael Albinus
2a82b55426 ; Still working on tramp--test-file-attributes-equal-p 2019-08-07 16:36:00 +02:00
Michael Albinus
2b6932b440 ; Instrument tramp--test-file-attributes-equal-p 2019-08-07 14:59:19 +02:00
Michael Albinus
25baa7d20c Continue to work on Bug#36940
* test/lisp/net/tramp-tests.el (tramp--test-file-attributes-equal-p):
Make the check more precise.  (Bug#36940)
2019-08-07 14:12:14 +02:00
Robert Pluim
bc1cf28da5 Change nsm-should-check to look at local subnets
* lisp/net/nsm.el (nsm-network-same-subnet): New function.  Checks
if an ip address is in the same subnet as another one.
(nsm-should-check): Use nsm-network-same-subnet to see if we're
connecting to a local subnet machine.  Remove checks for RFC1918 addresses.

* test/lisp/net/nsm-tests.el: New file.  Test nsm-should-check functionality.
2019-08-07 14:07:07 +02:00
Michael Albinus
998f3612f7 Fix Bug#36940
* test/lisp/net/tramp-tests.el (tramp--test-file-attributes-equal-p):
Make the check more precise.  (Bug#36940)
(tramp-test19-directory-files-and-attributes): Move some checks to
`tramp--test-file-attributes-equal-p'.
2019-08-06 21:47:57 +02:00
Mattias Engdegård
4ce9c6d0b5 Fix various Calc date conversions (bug#36822)
* lisp/calc/calc-forms.el (math-absolute-from-gregorian-dt):
Rewrite in a way that I understand, and that actually seems to work.
(math-absolute-from-julian-dt): Use Julian, not Gregorian, leap year
rules for counting days within a year.
(math-julian-date-beginning, math-julian-date-beginning-int):
Change constants to be consistent with their doc strings and the code:
use Rata Die epoch at Dec 31, 1 BC Gregorian proleptic, not Julian.
* doc/misc/calc.texi (Date Forms): Correct difference between Julian
Day and Rata Die.
* test/lisp/calc/calc-tests.el (calc-test-calendar): New test.
2019-08-06 13:59:28 +02:00
Mattias Engdegård
c676444a43 Add conditional operator xor to subr.el
Suggested by Oleh Krehel and implemented by Basil Contovounesios in
the following thread:
https://lists.gnu.org/archive/html/emacs-devel/2019-07/msg00547.html

* lisp/array.el (xor): Move unused function from here...
* lisp/subr.el: ...to here, and improve.
* lisp/gnus/spam.el (spam-xor):
* lisp/play/5x5.el (5x5-xor):
* lisp/proced.el (proced-xor):
* lisp/progmodes/idlwave.el (idlwave-xor):
* lisp/vc/diff-mode.el (diff-xor): Define as obsolete aliases of,
and replace all uses with, xor.
* lisp/jsonrpc.el: Remove unused dependency on array.el.
* lisp/org/org.el (org-xor): Move from here...
* lisp/org/org-compat.el (org-xor): ...to here, as a compatibility
shim for xor.
* lisp/progmodes/idlw-shell.el (idlwave-shell-enable-all-bp):
* lisp/simple.el (exchange-point-and-mark):
* lisp/windmove.el (windmove-display-in-direction): Use xor.
* lisp/strokes.el (strokes-xor): Remove commented-out xor
implementation.

* doc/lispref/control.texi (Control Structures): Extend menu entry
for new combining condition.
(Combining Conditions):
* etc/NEWS (Lisp Changes): Document xor.

* test/lisp/subr-tests.el (subr-test-xor): New test.
2019-08-06 13:38:47 +02:00
Paul Eggert
b06917a491 decode-time now returns subsec too
The list that decode-time returns now contains an extra
trailing component that counts the subseconds part of the
original timestamp (Bug#36549).
This builds on a suggestion by Lars Ingebrigtsen in:
https://lists.gnu.org/r/emacs-devel/2019-07/msg00734.html
* doc/lispref/os.texi (Time Conversion):
* doc/misc/emacs-mime.texi (time-date):
* etc/NEWS: Document this.
* lisp/calendar/icalendar.el (icalendar--decode-isodatetime):
* lisp/calendar/iso8601.el (iso8601-parse)
(iso8601-parse-time, iso8601-parse-duration)
(iso8601--decoded-time):
* lisp/calendar/parse-time.el (parse-time-string):
* lisp/calendar/time-date.el (make-decoded-time)
(decoded-time-set-defaults):
* lisp/org/org.el (org-fix-decoded-time)
(org-parse-time-string):
* src/timefns.c (Fdecode_time):
Generate subsec member for decoded time.
* lisp/calendar/time-date.el (decoded-time-add)
Add the decoded subsec too.
* lisp/simple.el (decoded-time): New subsec member.
* src/data.c (Frem): Simplify zero-check to match that of new Fmod.
(integer_mod): New function, with most of the guts of the old Fmod.
Remove redundant zero-check.
(Fmod): Use it.
* src/timefns.c (Fencode_time): Handle new subsec member
or (with the obsolescent calling convention) subsec arg.
It defaults to 0.
* test/lisp/calendar/icalendar-tests.el:
(icalendar--decode-isodatetime):
* test/lisp/calendar/iso8601-tests.el (test-iso8601-date-years)
(test-iso8601-date-dates, test-iso8601-date-obsolete)
(test-iso8601-date-weeks, test-iso8601-date-ordinals)
(test-iso8601-time, test-iso8601-combined)
(test-iso8601-duration, test-iso8601-intervals)
(standard-test-dates, standard-test-time-of-day-fractions)
(standard-test-time-of-day-beginning-of-day)
(standard-test-time-of-day-utc)
(standard-test-time-of-day-zone)
(standard-test-date-and-time-of-day, standard-test-interval):
* test/lisp/calendar/parse-time-tests.el (parse-time-tests):
* test/src/timefns-tests.el (format-time-string-with-zone)
(encode-time-dst-numeric-zone):
Adjust to match new behavior.
2019-08-05 18:37:29 -07:00
Paul Eggert
89c63b3522 New function time-convert
This replaces the awkward reuse of encode-time to both convert
calendrical timestamps to Lisp timestamps, and to convert Lisp
timestamps to other forms.  Now, encode-time does just the
former and the new function does just the latter.
The new function builds on a suggestion by Lars Ingebrigtsen in:
https://lists.gnu.org/r/emacs-devel/2019-07/msg00801.html
and refined by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2019-07/msg00803.html
* doc/lispref/os.texi (Time of Day, Time Conversion):
* doc/misc/emacs-mime.texi (time-date):
* etc/NEWS: Update documentation.
* lisp/calendar/cal-dst.el (calendar-next-time-zone-transition):
* lisp/calendar/time-date.el (seconds-to-time, days-to-time):
* lisp/calendar/timeclock.el (timeclock-seconds-to-time):
* lisp/cedet/ede/detect.el (ede-detect-qtest):
* lisp/completion.el (cmpl-hours-since-origin):
* lisp/ecomplete.el (ecomplete-add-item):
* lisp/emacs-lisp/cl-extra.el (cl--random-time):
* lisp/emacs-lisp/timer.el (timer--time-setter)
(timer-next-integral-multiple-of-time):
* lisp/find-lisp.el (find-lisp-format-time):
* lisp/gnus/gnus-diary.el (gnus-user-format-function-d):
* lisp/gnus/gnus-group.el (gnus-group-set-timestamp):
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-show-org-agenda):
* lisp/gnus/nnrss.el (nnrss-normalize-date):
* lisp/gnus/nnspool.el (nnspool-request-newgroups):
* lisp/net/ntlm.el (ntlm-compute-timestamp):
* lisp/net/pop3.el (pop3-uidl-dele):
* lisp/obsolete/vc-arch.el (vc-arch-add-tagline):
* lisp/org/org-clock.el (org-clock-get-clocked-time)
(org-clock-resolve, org-resolve-clocks, org-clock-in)
(org-clock-out, org-clock-sum):
* lisp/org/org-id.el (org-id-uuid, org-id-time-to-b36):
* lisp/org/ox-publish.el (org-publish-cache-ctime-of-src):
* lisp/proced.el (proced-format-time):
* lisp/progmodes/cc-cmds.el (c-progress-init)
(c-progress-update):
* lisp/progmodes/cperl-mode.el (cperl-time-fontification):
* lisp/progmodes/flymake.el (flymake--schedule-timer-maybe):
* lisp/progmodes/vhdl-mode.el (vhdl-update-progress-info)
(vhdl-fix-case-region-1):
* lisp/tar-mode.el (tar-octal-time):
* lisp/time.el (emacs-uptime):
* lisp/url/url-auth.el (url-digest-auth-make-cnonce):
* lisp/url/url-util.el (url-lazy-message):
* lisp/vc/vc-cvs.el (vc-cvs-parse-entry):
* lisp/vc/vc-hg.el (vc-hg-state-fast):
* lisp/xt-mouse.el (xterm-mouse-event):
* test/lisp/emacs-lisp/timer-tests.el:
(timer-next-integral-multiple-of-time-2):
Use time-convert, not encode-time.
* lisp/calendar/icalendar.el (icalendar--decode-isodatetime):
Don’t use now-removed FORM argument for encode-time.
It wasn’t crucial anyway.
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Add time-convert.
* lisp/emacs-lisp/elint.el (elint-unknown-builtin-args):
Update encode-time signature to match current arg set.
* lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time):
Use timer-convert with t rather than doing it by hand.
* src/timefns.c (time_hz_ticks, time_form_stamp, lisp_time_form_stamp):
Remove; no longer needed.
(decode_lisp_time): Rturn the form instead of having a *PFORM arg.
All uses changed.
(time_arith): Just return TICKS if HZ is 1.
(Fencode_time): Remove argument FORM.  All callers changed.
Do not attempt to encode time values; just encode
decoded (calendrical) times.
Unless CURRENT_TIME_LIST, just return VALUE since HZ is 1.
(Ftime_convert): New function, which does the time value
conversion that bleeding-edge encode-time formerly did.
Return TIME if it is easy to see that it is already
of the correct form.
(Fcurrent_time): Mention in doc that the form is planned to change.
* test/src/timefns-tests.el (decode-then-encode-time):
Don’t use (encode-time nil).
2019-08-05 18:37:29 -07:00
Michael Albinus
6c1d0d53b3 Improve Tramp's caching
* lisp/net/tramp.el (tramp-handle-add-name-to-file)
(tramp-handle-write-region):
* lisp/net/tramp-adb.el (tramp-adb-handle-make-directory)
(tramp-adb-handle-delete-directory)
(tramp-adb-handle-delete-file, tramp-adb-handle-write-region)
(tramp-adb-handle-set-file-modes)
(tramp-adb-handle-set-file-times, tramp-adb-handle-copy-file)
(tramp-adb-handle-rename-file):
* lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file)
(tramp-gvfs-handle-delete-directory)
(tramp-gvfs-handle-delete-file)
(tramp-gvfs-handle-make-directory)
(tramp-gvfs-handle-set-file-modes)
(tramp-gvfs-handle-set-file-times, tramp-gvfs-set-file-uid-gid):
* lisp/net/tramp-rclone.el (tramp-rclone-do-copy-or-rename-file)
(tramp-rclone-handle-delete-directory)
(tramp-rclone-handle-delete-file):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link)
(tramp-sh-handle-set-file-modes, tramp-sh-handle-set-file-times)
(tramp-sh-handle-add-name-to-file)
(tramp-sh-handle-copy-directory, tramp-do-copy-or-rename-file)
(tramp-sh-handle-delete-directory, tramp-sh-handle-delete-file)
(tramp-sh-handle-write-region):
* lisp/net/tramp-smb.el (tramp-smb-handle-add-name-to-file)
(tramp-smb-handle-copy-directory, tramp-smb-handle-copy-file)
(tramp-smb-handle-delete-directory)
(tramp-smb-handle-delete-file)
(tramp-smb-handle-make-directory-internal)
(tramp-smb-handle-make-symbolic-link)
(tramp-smb-handle-rename-file, tramp-smb-handle-write-region):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-add-name-to-file)
(tramp-sudoedit-do-copy-or-rename-file)
(tramp-sudoedit-handle-delete-directory)
(tramp-sudoedit-handle-delete-file)
(tramp-sudoedit-handle-set-file-modes)
(tramp-sudoedit-handle-set-file-times)
(tramp-sudoedit-handle-make-symbolic-link): Do not flush all file
properties of upper directory.

* lisp/net/tramp-cache.el (tramp-flush-file-upper-properties):
New defun.
(tramp-flush-file-properties, tramp-flush-directory-properties):
Use it.

* test/lisp/net/tramp-tests.el (tramp-time-diff): Declare.
(tramp--test-file-attributes-equal-p): Handle also modification
and status change time.
2019-08-05 13:09:26 +02:00
Michael Albinus
2abcca2391 Implement set-file-* functions for tramp-gvfs.el
* lisp/net/tramp-gvfs.el (tramp-gvfs-gio-mapping):
Add "gvfs-set-attribute".
(tramp-gvfs-file-name-handler-alist):
Add `tramp-gvfs-handle-set-file-modes',
`tramp-gvfs-handle-set-file-times' and
`tramp-gvfs-handle-set-file-uid-gid'.
(tramp-gvfs-handle-set-file-modes)
(tramp-gvfs-handle-set-file-times)
(tramp-sh-handle-set-file-uid-gid): New defuns.

* lisp/net/tramp.el (tramp-handle-write-region): Set file modes.

* test/lisp/net/tramp-tests.el (tramp-test20-file-modes)
(tramp-test22-file-times): Do not skip for tramp-gvfs.el.
2019-08-04 12:47:43 +02:00
Noam Postavsky
01661f33c1 Improved ChangeLog generation for vc log (Bug#16301)
* lisp/vc/diff-mode.el (diff-find-source-location): Fix docstring.

* lisp/vc/add-log.el (change-log-unindented-file-names-re)
(change-log-read-entries, change-log-read-defuns)
(change-log-insert-entries):
* lisp/vc/diff-mode.el (diff-add-log-current-defuns):
* lisp/vc/log-edit.el (log-edit--insert-filled-defuns)
(log-edit-fill-entry): New functions.
(log-edit-mode): Set `log-edit-fill-entry' as
`fill-paragraph-function'.
(log-edit-generate-changelog-from-diff): New command.
(log-edit-mode-map): Bind it to C-c C-w.
* doc/emacs/maintaining.texi (Types of Log File, Log Buffer):
* CONTRIBUTE: Document it.
* etc/NEWS: Announce it.
* test/lisp/vc/log-edit-tests.el (log-edit-fill-entry)
(log-edit-fill-entry-joining): New tests.
2019-08-03 20:14:52 -04:00
Michael Albinus
a6a0e857d4 ; Fix typo in filenotify-tests.el 2019-08-02 20:13:44 +02:00
Basil L. Contovounesios
eddf4664d7 Make gravatar.el more configurable
For discussion, see the following thread:
https://lists.gnu.org/archive/html/emacs-devel/2019-07/msg00528.html

* etc/NEWS: Announce changes in gravatar.el user options.

* lisp/image/gravatar.el (gravatar-cache-ttl): Change :type to
number of seconds without changing the default value and while still
accepting other timestamp formats.
(gravatar-rating): Restrict :type to ratings recognized by Gravatar.
(gravatar-size): Allow nil as a value, in which case Gravatar's
default size is used.
(gravatar-default-image, gravatar-force-default): New user options
controlling the Gravatar query parameters 'default' and
'forcedefault', respectively.
(gravatar-base-url): Use HTTPS.
(gravatar--query-string): New helper function to facilitate testing.
(gravatar-build-url): Use it.

* test/lisp/image/gravatar-tests.el (gravatar-size)
(gravatar-default-image, gravatar-force-default)
(gravatar-build-url): New tests.
2019-08-02 16:33:30 +03:00
Basil L. Contovounesios
b4b1eda7fb Fix some minor gravatar.el issues
For discussion, see the following thread:
https://lists.gnu.org/archive/html/emacs-devel/2019-07/msg00528.html
* lisp/image/gravatar.el (gravatar-hash): Trim leading and trailing
whitespace in given address, as per the Gravatar docs.
(gravatar-retrieve-synchronously): Silence call to
url-retrieve-synchronously for consistency with gravatar-retrieve.
(gravatar-retrieved): Only cache buffer on successful retrieval.
* test/lisp/image/gravatar-tests.el: New file.
2019-08-02 16:33:30 +03:00
Mattias Engdegård
408e75e819 Clean up file-size-function
It is now called `byte-count-to-string-function', and used instead of
calling `file-size-human-readable' directly where appropriate.

* lisp/files.el (file-size-human-readable-iec): New.
(file-size-function): Rename to byte-count-to-string-function.  Better
default value.  Eliminate lambda.  Better default for custom choice.
Put in group `files'.  More descriptive doc string.  Move.
(out-of-memory-warning-percentage, warn-maybe-out-of-memory)
(get-free-disk-space):
* lisp/dired.el (dired-number-of-marked-files):
* lisp/url/url-http.el (url-http-simple-after-change-function)
(url-http-content-length-after-change-function):
Use byte-count-to-string-function.
* test/lisp/files-test.el (files-test-file-size-human-readable):
Test file-size-human-readable-iec.
2019-08-02 12:38:44 +02:00
Paul Eggert
24b60b75ea Port standard-test-interval to Los Angeles
* test/lisp/calendar/iso8601-tests.el (standard-test-interval):
Use UTC to avoid DST glitches in the test.
2019-08-01 15:47:15 -07:00
Basil L. Contovounesios
2267110b6f Fix usage of remove-text-properties
* lisp/allout-widgets.el (allout-decorate-item-icon):
* lisp/emacs-lisp/chart.el (chart-goto-xy):
* lisp/forms.el (forms--make-format)
(forms--make-format-elt-using-text-properties):
* lisp/htmlfontify.el (hfy-unmark-trailing-whitespace):
* lisp/net/newst-plainview.el (newsticker-hide-entry)
(newsticker-show-entry):
* lisp/nxml/nxml-mode.el (nxml-cleanup):
* lisp/obsolete/longlines.el (longlines-unshow-hard-newlines)
(longlines-encode-region):
* lisp/org/ob-exp.el (org-babel-exp-process-buffer):
* lisp/org/org-agenda.el (org-agenda-show-new-time):
* lisp/progmodes/cc-defs.el
(c-clear-char-property-with-value-function)
(c-clear-char-property-with-value-on-char-function):
* lisp/progmodes/ebrowse.el (ebrowse--hide):
* lisp/progmodes/gdb-mi.el (gdb-send):
* lisp/progmodes/idlw-shell.el
(idlwave-retrieve-expression-from-level):
* lisp/progmodes/make-mode.el (makefile-fill-paragraph):
* lisp/progmodes/prog-mode.el (prettify-symbols--post-command-hook):
* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize):
* lisp/tmm.el (tmm-remove-inactive-mouse-face):
Always pass an explicit plist to remove-text-properties.

* lisp/dired.el (dired--unhide):
* lisp/facemenu.el (facemenu-add-face):
* lisp/htmlfontify.el (hfy-fontify-buffer):
* lisp/iimage.el (iimage-mode-buffer):
* lisp/image-file.el (image-file-yank-handler):
* lisp/progmodes/prog-mode.el (prettify-symbols--compose-symbol):
* lisp/textmodes/tex-mode.el (latex-env-before-change):
* test/src/undo-tests.el (undo-test0):
Use remove-list-of-text-properties in place of
remove-text-properties where appropriate.
2019-08-01 17:04:53 +03:00
Paul Eggert
f8f1c8c33a format-time-string subsumes time-zone-format
* lisp/calendar/time-date.el (time-zone-format):
* test/lisp/calendar/time-date-tests.el (test-time-zone-format):
Remove.
* lisp/gnus/nnrss.el (nnrss-normalize-date):
Use format-time-string instead of time-zone-format.
2019-07-31 19:24:13 -07:00
Lars Ingebrigtsen
a79e96f0f9 Add more icalendar tests (for the isodatetime parser)
* test/lisp/calendar/icalendar-tests.el
(icalendar-tests--decode-isodatetime): Test
`icalendar--decode-isodatetime'.
2019-07-31 21:47:29 +02:00
Lars Ingebrigtsen
6a87416d61 Use iso8601-parse in nnrss
* lisp/gnus/nnrss.el (nnrss-normalize-date): Use iso8601-parse
instead of hand-rolled parser.

* test/lisp/gnus/nnrss-tests.el: New file.
2019-07-31 21:47:29 +02:00
Lars Ingebrigtsen
46df7bbe12 Add new function time-zone-format
* lisp/calendar/time-date.el (time-zone-format): New function.
2019-07-31 21:47:29 +02:00
Michael Albinus
794f8f25b5 Call file notification actions properly in filenotify-tests.el
* test/lisp/filenotify-tests.el (file-notify--test-wait-for-events):
Rename from `file-notify--wait-for-events'.  Adapt all callees.
(file-notify--test-cleanup): Reset also `file-notify--test-event'
and `file-notify--test-file nil'.
(file-notify--test-event-desc, file-notify--test-event-action):
New accessor functions.
(file-notify-test02-rm-watch, file-notify--test-event-test)
(file-notify--test-with-actions-check)
(file-notify--test-with-actions-explainer): Use them.
(file-notify--test-with-actions-check)
(file-notify--test-with-actions-explainer)
(file-notify--test-with-actions): Rename them from *-events-*.
Rename also internal variables accordingly.  Adapt all callees.
2019-07-31 21:22:48 +02:00
Glenn Morris
1ac0cfa264 Merge from origin/emacs-26
8fbe462 (origin/emacs-26) ; * doc/lispref/positions.texi (List Motion...
1d9efc0 Add index for "\( in strings" (Bug#25195)
304e96f Fix doc-string of 'fit-window-to-buffer' (Bug#36848)
d4c4987 Update view-mode docstring
d6ca1fc ; * lisp/term.el: Add missing / to esc seq commentary.
b3e2073 Fix subproc listening when setting filter to non-t (Bug#36591)
f671950 * etc/NEWS.25: Belatedly announce rcirc-reconnect-delay.
7f42277 Mention term.el's \032 dir tracking in commentary (Bug#19524)
16a529e Remove upload functionality of package-x from the elisp manual
78e6c2a * etc/AUTHORS: Update.
086a56e Clarify Gravatar docs
0592467 * doc/lispref/display.texi (Defining Faces): Say a face can't...

# Conflicts:
#	doc/emacs/programs.texi
#	etc/AUTHORS
#	lisp/term.el
2019-07-30 21:42:34 -07:00
Dmitry Gutov
4fe88791df ; Re-enable all Flymake tests on Hydra
To see if the recent improvements fixed something
2019-07-30 16:59:59 +03:00
Dmitry Gutov
56db1e84a0 Guard against flymake-no-changes-timeout being nil
* test/lisp/progmodes/flymake-tests.el
(flymake-tests--wait-for-backends): Guard against
flymake-no-changes-timeout being nil (in personal configurations)
to help when running tests interactively.
2019-07-30 16:59:59 +03:00