1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-15 09:47:20 +00:00
Commit Graph

2888 Commits

Author SHA1 Message Date
Michael Albinus
9199643ab2 * test/lisp/autorevert-tests.el (auto-revert--deftest-remote):
Do not handle errors.
2019-05-19 11:34:01 +00:00
Paul Eggert
db9af10394 For SVG, 8192 is the new 256
Prefer librsvg for display of splash.svg
When both librsvg and Imagemagick are available, Emacs should
prefer librsvg to render SVG images.  However, Emacs was using
Imagemagick to render its own splash.svg file because
image-type-from-file-header returned nil for that file.
* lisp/image.el (image-type-from-buffer)
(image-type-from-file-header): Look at the first 8192 bytes of
the image, not just the first 256.  For Emacs’s own splash.svg
file, image-type-header-regexps needs to look at 939 bytes.
8192 bytes is a reasonable number nowadays given typical file
system design.
* test/lisp/image-tests.el (image-tests--emacs-images-directory):
New contant.
(image-type-from-file-header-test): New test.
2019-05-18 10:01:10 -07:00
Michael Albinus
b0a0705a4e Suppress compiler warnings for older Emacsen in tramp-tests.el
* test/lisp/net/tramp-tests.el (tramp-test17-insert-directory):
Add error name to test.
(tramp-test30-make-process, tramp-test45-unload):
Suppress compiler warnings from older Emacsen.
2019-05-18 16:04:58 +02:00
Stefan Monnier
9ed0b55848 * cl-macs-tests.el (cl-macs-test--symbol-macrolet): New test 2019-05-16 17:16:36 -04:00
Stefan Monnier
9a74e5666b * lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-rules): Fix typo
* test/lisp/textmodes/sgml-mode-tests.el (sgml-tests--quotes-syntax):
New corresponding test.
2019-05-15 22:21:36 -04:00
Glenn Morris
5fe9375a51 Merge from origin/emacs-26
02bee78 Let dir locals for more specific modes override those from less
b1235f9 Improve documentation of Hexl mode
32d1813 Fix description of (move-to-column <n> t) when column <n> is ...
0397b7c ; Fix smtpmail-stream-type docstring
7dab3ee Recognize single quote attribute values in nxml and sgml (Bug...
e4cde42 Disable extra display of &#10; in nxml-mode (Bug#32897)
ca14dd1 Fix nxml-get-inside (Bug#32003)
e7ab351 Fix positioning client buffer as instructed by emacsclient

# Conflicts:
#	lisp/files.el
#	lisp/textmodes/sgml-mode.el
2019-05-14 17:18:18 -07:00
Kévin Le Gouguec
59ad303e8f Stop splicing anonymous faces in font-lock-append-text-property
This is the same fix as 2019-04-29 "Refrain from splicing anonymous
faces in text properties", which was only applied to
font-lock-prepend-text-property.

* lisp/font-lock.el (font-lock-append-text-property): Distinguish list
of faces from property list.
* test/lisp/font-lock-tests.el: New test suite.

(Bug#35476)
2019-05-13 20:41:02 -04:00
Michael Albinus
4255f0fcae * test/lisp/net/tramp-tests.el (cl-lib): Require instead of cl-seq. 2019-05-09 14:23:07 +02:00
Noam Postavsky
7dab3ee7ab Recognize single quote attribute values in nxml and sgml (Bug#35381)
* lisp/textmodes/sgml-mode.el (sgml-specials): Add single quote.
(sgml-syntax-propertize-rules): Handle single quote.
* test/lisp/nxml/nxml-mode-tests.el (nxml-mode-font-lock-quotes): New
test.
* test/lisp/textmodes/sgml-mode-tests.el
(sgml-delete-tag-bug-8203-should-not-delete-apostrophe): Now passes.
2019-05-09 06:42:40 -04:00
Noam Postavsky
ca14dd1d46 Fix nxml-get-inside (Bug#32003)
The change from 2016-01-16 "lisp/nxml: Use syntax-tables for comments"
made nxml-get-inside return non-nil for any string or comment,
including attribute strings.  This caused incorrect and therefore
indentation.
* lisp/nxml/nxml-rap.el: Update commentary to reflect changes to
nxml-mode parsing.
(nxml-get-inside): Only return non-nil when inside comments and
generic strings, not normal quote-delimited strings.
* test/lisp/nxml/nxml-mode-tests.el: New tests.
2019-05-09 06:42:40 -04:00
Glenn Morris
8b789755b4 Merge from origin/emacs-26
1c6484e (origin/emacs-26) Fix incorrect cloning of eieio-instance-inh...
37436fe Fix cloning of eieio-named objects (Bug#22840)
fb65a36 Fix ibuffer-unmark-backward synopsis (bug#35572)
f77bd2b ; * src/lisp.h (DEFSYM): Fix inaccurate comment.
3b86e0b Clarify handling of long options (Bug#24949)
04340a8 Improve documentation of the daemon and emacsclient
3e29de2 * etc/NEWS.24: Belatedly announce delete-consecutive-dups.
2019-05-08 07:51:48 -07:00
Vitalie Spinu
1c6484e975 Fix incorrect cloning of eieio-instance-inheritor objects (Bug#34840)
* lisp/emacs-lisp/eieio-base.el (clone): Unbound slots of
  eieio-instance-inheritor objects as documented in the docs string
  and implemented in the original eieio implementation.
2019-05-08 11:12:29 +02:00
Michael Albinus
0728b40cc7 ; Instrument auto-revert--deftest-remote 2019-05-08 10:49:31 +02:00
Michael Albinus
173fd94c11 Skip tramp-test10-write-region-file-precious-flag for Emacs < 27
* test/lisp/net/tramp-tests.el
(tramp-test10-write-region-file-precious-flag): Skip for Emacs < 27.
2019-05-08 09:44:22 +02:00
Jonathan Tomer
21888a9464 Don't rewrite buffer contents after saving by rename (Bug#35497)
* lisp/files.el (basic-save-buffer-2): Don't rewrite file contents
after saving-by-renaming.  (Bug#35497)

* test/lisp/files-tests.el (files-tests-dont-rewrite-precious-files):
* test/lisp/net/tramp-tests.el
(tramp-test10-write-region-file-precious-flag): Regression tests
for this change.
2019-05-08 09:13:58 +02:00
John Shahid
e44b56d16a Fix setting and resetting of scroll-with-delete
The start and end lines of the scroll region must to be in the range
[0,term-height).  There are few placees that incorrectly set the end
line of the scroll region to term-height which is outside the valid
range.  Combined with another off-by-one error in
term-set-scroll-region's clamping logic, this would cause
term-scroll-with-delete to be unnecessarily turned on.

* lisp/term.el (term-scroll-start,term-scroll-end): Use defvar-local
to define the variables and document the valid range of values that
the variables can take.
(term--last-line): New function to calculate the 0-based index of the
last line.
(term--reset-scroll-region): New function to reset the scroll region
to the full height of the terminal.
(term-mode,term-reset-size,term-reset-terminal): Call
term--reset-scroll-region to reset the scroll region.
(term-set-scroll-region): Fix the off-by-one error in the clamping
logic which allowed term-scroll-end to have values outside the valid
range [0,term-height).
2019-05-07 14:51:42 -04:00
Vitalie Spinu
37436fe6d3 Fix cloning of eieio-named objects (Bug#22840)
* lisp/emacs-lisp/eieio-base.el (clone): Correctly set the name of the
  cloned objects from eieio-named instances.
2019-05-07 13:45:00 +02:00
Juri Linkov
df9b56ecff Rename shell-command-width to async-shell-command-width (bug#35055)
* lisp/simple.el (async-shell-command-width):
* lisp/net/tramp.el (tramp-handle-shell-command):
* test/lisp/net/tramp-tests.el (tramp-test32-shell-command):
* doc/misc/tramp.texi (Remote processes): Rename this variable.

* doc/emacs/misc.texi (Single Shell): Add async-shell-command-width.
2019-05-05 22:27:33 +03:00
Paul Eggert
81487bf891 Port mod-test to --enable-gcc-warnings
* test/data/emacs-module/mod-test.c (NDEBUG): Undef, to prevent
GCC from complaining “error: unused variable ‘dummy’” and failing
to build the test, if --enable-gcc-warnings.
2019-05-05 09:08:24 -07:00
Eli Zaretskii
6709240b7a Fix compilation of mod-test.c on MinGW
* test/data/emacs-module/mod-test.c (Fmod_test_nanoseconds)
[__MINGW32__]: Use _Static_assert, not static_assert, as the
latter is not available in mingw.org's MinGW's assert.h.
2019-05-05 18:07:26 +03:00
Michael Albinus
10aa44a1dd ; SOme changes in filenotify-tests.el for EMBA
* test/lisp/filenotify-tests.el (file-notify-test03-events)
(file-notify-test05-file-validity)
(file-notify-test09-watched-file-in-watched-dir): Adapt for EMBA.
2019-05-05 13:34:26 +02:00
Michael Albinus
f82e0e5b76 Adapt tests for recent file-notification changes in Tramp
* lisp/net/tramp.el (tramp-file-notify-process-sentinel):
Pacify byte compiler.

* test/lisp/autorevert-tests.el
(auto-revert-test02-auto-revert-deleted-file):
* test/lisp/filenotify-tests.el (file-notify-test03-events)
(file-notify-test05-file-validity)
(file-notify-test09-watched-file-in-watched-dir): Adapt for remote
files.
2019-05-05 12:20:44 +02:00
Philipp Stephani
a976602066 Fix compilation of test module.
Because all other objects are compiled without -fPIC, we can’t use
them when linking the test module.  Instead, use the source files
directly.

* test/Makefile.in (HYBRID_MALLOC, LIBEGNU_ARCHIVE): Remove.
($(test_module)): Use source files instead of objects and archives.
2019-05-05 01:35:11 +02:00
Philipp Stephani
e95ecbe146 Use extract_time in test module.
* test/data/emacs-module/mod-test.c (Fmod_test_sleep_until): Use
extract_time for time argument.
(signal_wrong_type_argument): Remove unused function.

* test/src/emacs-module-tests.el (mod-test-sleep-until): Remove
unnecessary ‘float-time’.
2019-05-05 01:34:07 +02:00
Philipp Stephani
27a9377d42 * test/Makefile.in (src/emacs-module-tests.elc): Require test module 2019-05-05 00:27:19 +02:00
Michael Albinus
d0fe28cb1d Add tests for remote files in auto-revert-tests
* lisp/autorevert.el (auto-revert-debug): New defvar.
(auto-revert-notify-handler): Write traces.

* lisp/filenotify.el (file-notify-debug): New defvar.
(file-notify-handle-event, file-notify-callback): Write traces.

* lisp/net/tramp-sh.el (tramp-sh-handle-vc-registered):
Handle nil `vc-handled-backends'.

* test/lisp/autorevert-tests.el
(auto-revert-test-remote-temporary-file-directory): New defconst.
Handle also $REMOTE_FILE_NOTIFY_LIBRARY.
(auto-revert--test-enabled-remote-checked): New defvar.
(auto-revert--test-enabled-remote): New defun.
(auto-revert--wait-for-revert): Rewrite without timeout.
(auto-revert--deftest-remote): New defmacro.
(auto-revert-test01-auto-revert-several-files):
(auto-revert-test02-auto-revert-deleted-file): Adapt for remote files.
(auto-revert-test02-auto-revert-deleted-file):
Use `auto-revert-debug' for debug messages.
(auto-revert-test00-auto-revert-mode-remote)
(auto-revert-test01-auto-revert-several-files-mode-remote)
(auto-revert-test02-auto-revert-deleted-file-mode-remote)
(auto-revert-test03-auto-revert-tail-mode-mode-remote)
(auto-revert-test04-auto-revert-mode-dired-mode-remote): New tests.

* test/lisp/filenotify-tests.el (file-notify--test-event-handler):
Use `file-notify-debug' for debug messages.
2019-05-03 17:18:13 +02:00
Stefan Monnier
3fa9c9f774 * lisp/mail/footnote.el: Tweak markers convention
Instead of using markers that are sometimes before and sometimes after
the [...] and using `insert-before-markers` to make sure those that are
are before stay before, always place them before, and make them
"move after"so they stay with their [...] without the need for
insert-before-markers.

(footnote--current-regexp): Add arg to match previous style.
Include the start/end "tags" in the regexp.  Adjust all callers.
(footnote--markers-alist): Change position of POINTERS.
(footnote--refresh-footnotes, footnote--renumber)
(footnote--make-hole, footnote-delete-footnote)
(footnote-back-to-message): Adjust accordingly, mostly by using
`looking-at` instead of `looking-back`.
(footnote--make-hole): Always return footnote nb to use.
(footnote-add-footnote): Simplify call accordingly.

* test/lisp/mail/footnote-tests.el: New file.
2019-05-02 10:27:42 -04:00
Paul Eggert
325f51c84d Fix decode-time/encode-time roundtrip on macOS
* src/timefns.c (Fencode_time): Ignore DST flag when the zone is
numeric or is a cons, as the doc string says it’s ignored in that
case, and not ignoring it causes encode-time to not invert
decode-time on some platforms (Bug#35502).
* test/src/timefns-tests.el (encode-time-dst-numeric-zone):
New test.
2019-04-30 10:47:17 -07:00
Glenn Morris
6662938619 Merge from origin/emacs-26
0e8d452 ; * doc/lispref/nonascii.texi (Coding System Basics): Fix gra...
25a2ff7 ; Add missing space in custom.texi
9ec18fb * admin/admin.el (set-version): Check for increase in version...
93912ba Be more careful about indent-sexp going over eol (Bug#35286)
2019-04-29 09:08:19 -07:00
Michael Albinus
295c797503 * test/lisp/net/tramp-tests.el (tramp--test-timeout-handler): Instrument. 2019-04-29 17:24:53 +02:00
Noam Postavsky
74712470fc Replace use of obsolete string-make-unibyte
* lisp/image-file.el (insert-image-file): Use encode-coding-region
instead of string-make-unibyte.
* test/lisp/image-file-tests.el: New test.
2019-04-28 16:45:13 -04:00
Noam Postavsky
caadbd9492 ; Add test for previous change
* test/lisp/progmodes/python-tests.el (python-indent-hanging-close-paren):
New test.
2019-04-28 16:45:13 -04:00
Philipp Stephani
4d97e1a9ea Export major version of latest Emacs supported by emacs-module.h.
This is useful if module authors want to support multiple versions of
emacs-module.h.

* configure.ac (emacs_major_version): Define substitution.

* src/emacs-module.h.in (EMACS_MAJOR_VERSION): Define macro.

* doc/lispref/internals.texi (Module Initialization): Document
EMACS_MAJOR_VERSION preprocessor macro.

* test/data/emacs-module/mod-test.c (emacs_module_init): Verify
behavior of EMACS_MAJOR_VERSION.
2019-04-28 20:08:25 +02:00
Philipp Stephani
24f717a5d7 Fix another compilation warning.
* test/src/emacs-module-tests.el (multiply-string): Remove unused
variable ‘i’.
2019-04-28 19:21:03 +02:00
Philipp Stephani
66a2c412be Fix a few minor compilation and Checkdoc warnings.
* test/src/emacs-module-tests.el: Add package name and standard
sections.
(multiply-string): Add a docstring.
2019-04-28 17:15:44 +02:00
Philipp Stephani
cf11fac1eb * test/src/emacs-module-tests.el: Switch to lexical binding. 2019-04-28 17:15:44 +02:00
Glenn Morris
a241e45b5a * test/lisp/progmodes/sql-tests.el (sql-tests-buffer-naming-harness):
Fix previous for TEST_LOAD_EL=no.
2019-04-25 22:06:34 -04:00
Glenn Morris
8082291773 * test/lisp/progmodes/sql-tests.el (sql-tests-buffer-naming-harness):
Skip if no sqlite program.
2019-04-25 19:53:02 -04:00
Stephen Berman
6d8e0fc5aa Make wdired-mode ignore ls file indicators
* lisp/wdired.el (wdired--restore-dired-filename-prop): When
dired-listing-switches includes "F" or "classify", don't treat
appended indicator characters as part of the file name (bug#34915).

* test/lisp/wdired-tests.el (wdired-test-bug34915): New test.
2019-04-25 19:17:23 +02:00
Michael R. Mauger
a1386fa6a7 * lisp/progmodes/sql.el
(sql-is-sqli-buffer-p): New function.
(sql-generate-unique-sqli-buffer-name): Refactor and use it.
(sql-product-interactive): Simplify name logic.
* test/lisp/progmodes/sql-tests.el
(sql-tests-placeholder-filter-harness): New macro.
(sql-tests-placeholder-filter-simple)
(sql-tests-placeholder-filter-ampersand)
(sql-tests-placeholder-filter-period): Refactored tests and use macro.
(sql-tests-buffer-naming-harness): New macro.
(sql-tests-buffer-naming-default)
(sql-tests-buffer-naming-multiple)
(sql-tests-buffer-naming-explicit)
(sql-tests-buffer-naming-universal-argument)
(sql-tests-buffer-naming-existing): New tests.
2019-04-24 20:59:25 -04:00
Philipp Stephani
4eb7f9ef59 Unbreak build when building without GMP support.
Add support for a new preprocessor macro EMACS_MODULE_HAVE_MPZ_T to
emacs-module.h.  If this macro is defined, assume that mpz_t is
already defined and don’t include gmp.h.

Don’t document the new macro for now, as it’s unclear whether we want
to support this in modules outside the Emacs tree.

* src/emacs-module.h.in: Allow user to prevent inclusion of gmp.h.

* src/emacs-module.c: Use mini-gmp if GMP is unavailable.  Don’t
include gmp.h.

* src/lisp.h: Don’t require gmp.h.  It’s not needed for lisp.h.

* test/Makefile.in (GMP_LIB, GMP_OBJ): New variables.
($(test_module)): Use them.

* test/data/emacs-module/mod-test.c: Use mini-gmp if GMP is unavailable.
2019-04-24 23:27:43 +02:00
Philipp Stephani
553220fca6 Add missing GMP library to test module.
* test/Makefile.in (GMP_LIB): Define variable.
($(test_module)): Use it.
2019-04-24 23:14:13 +02:00
Philipp Stephani
c4bacb1215 Clarify rounding mode when converting to struct timespec.
* doc/lispref/internals.texi (Module Values): Clarify that the
truncation is towards negative infinity.

* test/data/emacs-module/mod-test.c (Fmod_test_nanoseconds): Add test
function.
(emacs_module_init): Define it.

* test/src/emacs-module-tests.el (mod-test-nanoseconds): New unit test.
2019-04-24 13:41:05 +02:00
Philipp Stephani
534c33cf37 Fix return type of make_time.
make_time is documented to return a (TICKS . HZ) pair, so we can’t use
make_lisp_time.  Introduce a new conversion function instead.

* src/emacs-module.c (module_make_time): Use timespec_to_lisp to
correct return type.

* src/timefns.c (timespec_to_lisp): New function.
(make_lisp_time): Use it.

* test/src/emacs-module-tests.el (mod-test-add-nanosecond/valid):
Check return type.
2019-04-24 13:17:53 +02:00
Philipp Stephani
e290a7d173 Add module functions to convert from and to big integers.
* src/module-env-27.h: Add new module functions to convert big
integers.

* src/emacs-module.h.in (emacs_mpz): Define if GMP is available.

* src/emacs-module.c (module_extract_big_integer)
(module_make_big_integer): New functions.
(initialize_environment): Use them.

* test/data/emacs-module/mod-test.c (Fmod_test_double): New test
function.
(emacs_module_init): Define it.

* test/src/emacs-module-tests.el (mod-test-double): New unit test.

* doc/lispref/internals.texi (Module Values): Document new functions.
2019-04-24 12:53:54 +02:00
Philipp Stephani
bffceab633 Add conversions to and from struct timespec to module interface.
Time values are a fundamental data type, and such conversions are hard
to implement within modules because of the various forms of time
values in Emacs Lisp.  Adding dedicated conversion functions can
significantly simplify module code dealing with times.

This approach uses nanosecond precision.  While Emacs in theory has
support for higher-precision time values, in practice most languages
and standards, such as POSIX, C, Java, and Go, have settled on
nanosecond-precision integers to represent time.

* src/emacs-module.h.in: Add header for struct timespec.

* src/module-env-27.h: Add module functions for time conversion.

* src/emacs-module.c (module_extract_time, module_make_time): New
functions.
(initialize_environment): Use them.

* test/data/emacs-module/mod-test.c (Fmod_test_add_nanosecond): New
test function.
(emacs_module_init): Define it.

* test/src/emacs-module-tests.el (mod-test-add-nanosecond/valid)
(mod-test-add-nanosecond/nil, mod-test-add-nanosecond/invalid): New
unit tests.

* doc/lispref/internals.texi (Module Values): Document time
conversion functions.
2019-04-24 11:33:52 +02:00
Philipp Stephani
b59429a43e Small fix for a JSON unit test.
* test/src/json-tests.el (json-parse-string/null): Make JSON object
syntactically valid.  This test is supposed to check whether an
escaped null character causes an error, but without quoting the string
it would be syntactically invalid in any case.
2019-04-23 12:00:32 +02:00
Noam Postavsky
93912baefd Be more careful about indent-sexp going over eol (Bug#35286)
* lisp/emacs-lisp/lisp-mode.el (indent-sexp): Only go over multiple
sexps if the end of line is within a sexp.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(indent-sexp-stop-before-eol-comment)
(indent-sexp-stop-before-eol-non-lisp): New tests.
2019-04-22 12:49:36 -04:00
Michael Albinus
0289498211 Some changes in tramp-tests
* test/lisp/net/tramp-tests.el (tramp-test32-shell-command):
Check for backward compatibility.
(tramp-test33-environment-variables): Apply a better check for
unset variable.
2019-04-22 09:58:37 +02:00
Glenn Morris
50d00e7153 Merge from origin/emacs-26
037970f Document insert-image-file's return value (Bug#32978)
598b45a Autoload cua-toggle-rectangle-mark (Bug#34947)
95bd56d Tell xclip not to expect job-control under eshell (Bug#35257)
9997bbb ; * src/emacs.c: Fix typo in comment (Bug#35320).
a4ad7be Fix off-by-one-link error in image--set-property
2019-04-21 07:51:36 -07:00