1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-17 10:06:13 +00:00
Commit Graph

3065 Commits

Author SHA1 Message Date
Juri Linkov
be16c204d6 Move some uncontroversial char-folding pairs from test data to default values
* lisp/char-fold.el (char-fold--default-include)
(char-fold--default-exclude): Add some default values.

* test/lisp/char-fold-tests.el (char-fold--test-without-customization)
(char-fold--test-with-customization): Move some test data to
default values.  Add more data for tests to pass.   (Bug#35689)
2019-07-29 01:45:36 +03:00
Lars Ingebrigtsen
d7665ae8df Make let-alist work with vectors
* lisp/emacs-lisp/let-alist.el (let-alist--deep-dot-search):
Descend into vectors, too, looking for dotted variables (bug#23244).

Test case:

(let-alist '((a . 1) (b . 2))
  `[,(+ .a) ,(+ .a .b .b)])
2019-07-28 23:28:24 +02:00
Lars Ingebrigtsen
348a6de118 `unknown' test case now works 2019-07-28 11:40:30 +02:00
Eli Zaretskii
51443b9a83 Move tty-colors-tests.el to its proper directory. 2019-07-27 14:10:20 +03:00
Paul Eggert
e3575ee4b2 Fix recently-introduced file-name-absolute-p typo
Fix a bug introduced in 2019-07-24T21:28:13!eggert@cs.ucla.edu.
* src/fileio.c (file_name_absolute_p):
~/foo is also absolute (Bug#36809).
* test/src/fileio-tests.el (fileio-tests--file-name-absolute-p):
Rename from fileio-tests--no-such-user and add more tests.
2019-07-26 09:48:57 -07:00
Lars Ingebrigtsen
eb45cc9521 Add new macro `ignore-error'
* doc/lispref/control.texi (Handling Errors): Document
`ignore-error'.
* lisp/subr.el (ignore-error): New macro.

* lisp/progmodes/elisp-mode.el (elisp-completion-at-point):
Provide completion for `ignore-error'.
2019-07-26 09:58:53 +02:00
Nobuyoshi Nakada
0cbdbac2bb Strip trailing whitespaces at the end of converted do block
* lisp/progmodes/ruby-mode.el (ruby-brace-to-do-end):
Strip trailing whitespaces at the end of converted do block
(bug#36756).

https://bugs.ruby-lang.org/issues/16014
https://github.com/syl20bnr/spacemacs/issues/12548
2019-07-25 16:01:55 +03:00
Paul Eggert
a5063aa8b1 Do not treat ~nosuchuser as an absolute file name
Derived from Ken Brown’s patch (Bug#36502#97).
* doc/lispref/files.texi (Relative File Names):
* etc/NEWS: Document this.
* src/fileio.c (user_homedir): New function.
(Fexpand_file_name, file_name_absolute_p): Use it.
(search_embedded_absfilename): Simplify via file_name_absolute_p.
* test/src/fileio-tests.el (fileio-tests--no-such-user): New test.
2019-07-24 14:33:02 -07:00
Mattias Engdegård
3a76484865 Don't use internal filenotify function in test
* test/lisp/filenotify-tests.el
(file-notify--test-file, file-notify--test-add-watch): New.
(file-notify--test-event-test, file-notify--test-event-handler)
(file-notify-test02-rm-watch, file-notify-test03-events)
(file-notify-test05-file-validity, file-notify-test07-many-events)
(file-notify-test08-backup, file-notify-test09-watched-file-in-watched-dir):
Avoid using the internal `file-notify--event-watched-file' so that it
can be removed from filenotify.el.
Instead, pass the file name to the callback as an extra argument;
use `file-notify--test-add-watch' instead of `file-notify-add-watch'.
2019-07-24 11:52:44 +02:00
Mattias Engdegård
5cfd8c508e Local definitions of accessors only used in test
* test/lisp/filenotify-tests.el (file-notify--test-event-file)
(file-notify--test-event-file1, file-notify--test-event-test)
(file-notify--test-event-handler):
Define accessors locally, so that they can be removed from filenotify.el.
2019-07-24 11:52:33 +02:00
Juri Linkov
376f5df3cc Customizable char-fold with char-fold-symmetric, char-fold-include (bug#35689)
* doc/emacs/search.texi (Lax Search): Document
char-fold-symmetric, char-fold-include, char-fold-exclude.

* lisp/char-fold.el (char-fold--default-include)
(char-fold--default-exclude, char-fold--default-symmetric)
(char-fold--previous): New defconsts.
(char-fold-include, char-fold-exclude, char-fold-symmetric):
New defcustoms.
(char-fold-make-table): Use them.
(char-fold-update-table): New function called at top-level.

* test/lisp/char-fold-tests.el (char-fold--test-no-match-exactly)
(char-fold--permutation): New functions.
(char-fold--test-without-customization)
(char-fold--test-with-customization): New tests.
2019-07-23 23:27:28 +03:00
Paul Eggert
dfb0ba79b5 Support "%x" etc. formats on more floats
* doc/lispref/strings.texi (Formatting Strings): Document this.
* src/editfns.c (styled_format): Support %o, %x, and %X on
finite floats less than zero or greater than UINTMAX_MAX.
* test/src/editfns-tests.el (format-%x-large-float)
(read-large-integer, format-%o-negative-float):
Adjust tests to match extended behavior.
Rename the latter test from format-%o-invalid-float,
since the float is no longer invalid.

* test/src/editfns-tests.el (format-%x-large-float)
(read-large-integer): Test this.
2019-07-23 01:46:41 -07:00
Stefan Monnier
87ad8a1143 * lisp/progmodes/opascal.el: Allow inline var decl in for (bug#36348)
(opascal-enclosing-indent-of): Ignore decls "neutered" by delimiter.
2019-07-22 13:10:35 -04:00
Mattias Engdegård
d0eeb62c43 Make tramp test regexp more robust
* test/lisp/net/tramp-tests.el (tramp-test17-insert-directory):
Match a greater variety of human-readable size values.
2019-07-22 16:38:02 +02:00
Ken Brown
8b13ec1d70 Fix expand-file-name for names starting with '~'
* src/fileio.c: (file_name_absolute_no_tilde_p):
New static function.
(Fexpand_file_name): If the current buffer's default-directory
starts with "~user" where "user" is not a valid user name, don't
give the '~' a special meaning.  Just treat the value of
default-directory as a relative name.  (Bug#36502)
* test/src/fileio-tests.el
(fileio-tests--relative-default-directory): Add a test.
2019-07-21 10:40:54 -04:00
Paul Eggert
515afc9c15 Fix crash if user test munges hash table
* src/fns.c (restore_mutability)
(hash_table_user_defined_call): New functions.
(cmpfn_user_defined, hashfn_user_defined): Use them.
(make_hash_table, copy_hash_table):
Mark new hash table as mutable.
(check_mutable_hash_table): New function.
(Fclrhash, Fputhash, Fremhash): Use it instead of CHECK_IMPURE.
* src/lisp.h (struct hash_table_test): User-defined functions
now take pointers to struct Lisp_Hash_Table, not to struct
hash_table_test.  All uses changed.
(struct Lisp_Hash_Table): New member ‘mutable’.
* src/pdumper.c (dump_hash_table): Copy it.
* test/src/fns-tests.el (test-hash-function-that-mutates-hash-table):
New test, which tests for the bug.
2019-07-20 20:13:46 -07:00
Noam Postavsky
6490269bec Merge from emacs-26
150bdfe43a Handle completely undecoded input in term (Bug#29918)
021f32cca1 * doc/misc/forms.texi (Control File Format): Fix a doc error.
76538d09b7 Fix typo in package-alist docstring
b2fde4b5e8 * doc/lispref/text.texi (Mode-Specific Indent): Fix a typo...
7e62778548 ; Another minor change in 'bidi-display-reordering's doc s...
4455ddbe56 Improve doc string of 'bidi-display-reordering'
34ee26dd93 Add warning to bidi-display-reordering doc string

# Conflicts:
#	lisp/term.el
#	test/lisp/term-tests.el
2019-07-20 22:02:36 -04:00
Noam Postavsky
150bdfe43a Handle completely undecoded input in term (Bug#29918)
* lisp/term.el (term-emulate-terminal): Avoid errors if the whole
decoded string is eight-bit characters.  Don't attempt to save the
string for next iteration in that case.
* test/lisp/term-tests.el (term-decode-partial)
(term-undecodable-input): New tests.
2019-07-20 21:35:21 -04:00
Stefan Monnier
189296bfcc * test/manual/indent/octave.m (spmd): Add test for last change 2019-07-20 12:19:57 -04:00
Basil L. Contovounesios
b728620a75 Allow counter-clockwise rotations in image-rotate
* lisp/image.el (image-rotate): Extend with an optional argument
specifying the rotation in degrees (bug#35421).
* doc/lispref/display.texi (Showing Images):
* etc/NEWS: Document the change.
* test/lisp/image-tests.el (image-rotate): New test.
2019-07-20 16:00:31 +01:00
Benjamin Riefenstahl
e6bfc6753c Make REs in magic-(fallback-)mode-alist case-sensitive.
These variables are used for well-defined file formats where relaxed
case matching is not wanted usually.

* lisp/files.el (magic-mode-alist, magic-fallback-mode-alist): Update
the doc string.
(set-auto-mode): Make looking-at for elements of magic-mode-alist and
magic-fallback-mode-alist use case-fold-search == nil.
* lisp/files.el (files-test-magic-mode-alist-re-baseline)
(files-test-magic-mode-alist-re-no-match)
(files-test-magic-mode-alist-re-case-diff): Add.
2019-07-20 12:27:19 +03:00
Stefan Kangas
daf5c4309f Use lexical-binding in help-fns-tests.el (Bug#36585)
* test/lisp/help-fns-tests.el: Use lexical-binding.  Doc fix.
2019-07-18 20:06:27 -04:00
Simen Heggestøyl
b4eaa7eace Use lexical-binding in asm-mode.el and add tests
* lisp/progmodes/asm-mode.el: Use lexical-binding.
(asm-comment-char): Remove redundant :group arg.
(asm-mode): Use `setq-local'.
(asm-calculate-indentation): Remove moot `or'.

* test/lisp/progmodes/asm-mode-tests.el: New file with tests for
asm-mode.el.
2019-07-18 20:41:47 +02:00
Glenn Morris
decfdb091a Update a tramp test for get-free-disk-space change
* test/lisp/net/tramp-tests.el (tramp-test17-insert-directory):
Handle optional unit suffix in free space.
2019-07-18 08:03:36 -07:00
Nick Drozd
b8bf7255f3 * test/lisp/progmodes/cc-mode-tests.el: Add a test with /***/ in #define lines 2019-07-17 14:07:26 +00:00
Glenn Morris
7e70c78867 An electric test is now passing
* test/lisp/electric-tests.el
(electric-pair-whitespace-chomping-2-at-point-4-in-c++-mode-in-strings):
Seems to pass since today's cc-mode changes.
2019-07-16 16:04:54 -07:00
Basil L. Contovounesios
d2758820cd Fix failing secrets-test03-items
* test/lisp/net/secrets-tests.el: Use lexical-binding.
(secrets-test03-items): Do not assume :xdg:schema attribute is
silently added to the front of the collection (bug#36694).
(secrets-test04-search, secrets-test-all): Quote function symbols as
such.
2019-07-16 18:29:52 +01:00
Mattias Engdegård
a87840fffb Fix calc number formatting with digit grouping (bug#36689)
The functions math-format-hex and math-format-octal were not
implemented, yet called, leading to a crash when using hex or octal
radix with digit grouping.

* test/lisp/calc/calc-tests.el (calc-test-format-radix): New test.
* lisp/calc/calc-ext.el: Don't declare non-existing functions.
(math--format-integer-fancy): Don't call non-existing functions.
* lisp/calc/calc-bin.el (math-format-binary, math-binary-digits):
Simplify, fixing 0-padding bug.
2019-07-16 17:37:46 +02:00
Glenn Morris
c3da6fd707 Stop wdired tests leaving behind symlink /tmp/emacs1000
* test/lisp/wdired-tests.el (server-socket-dir): Make effective.
2019-07-14 15:18:22 -07:00
Glenn Morris
fe2141d157 Update a ffap test
* test/lisp/ffap-tests.el (ffap-other-window--bug-25352):
Update for incompatible ffap-other-window change.
2019-07-14 13:28:54 -07:00
Stefan Kangas
7c30ad184f Restore focus to Bookmark List after editing annotation
There are two entry points to bookmark-edit-annotation-mode: the first
when we add a bookmark and bookmark-use-annotations is non-nil; the
second when bookmark-bmenu-edit-annotation is run from the bookmark
list.  When editing is concluded, in the first case, we should just
quit window.  In the second case, we should instead return to the
bookmark list.

* lisp/bookmark.el (text-property-search): Require.
(bookmark-annotation-name): Make buffer-local and improve doc string.
(bookmark--annotation-from-bookmark-list): New buffer-local variable.
(bookmark-edit-annotation): New argument from-bookmark-list sets
bookmark--annotation-from-bookmark-list.
(bookmark-bmenu-edit-annotation): Call bookmark-edit-annotation with
argument from-bookmark-list set to t.
(bookmark-send-edited-annotation): When editing originated in the
bookmark list, restore focus to bookmark list and move point back to
edited bookmark. (Bug#20150)

(bookmark-edit-annotation-mode): Fix typo.
(bookmark-bmenu-buffer): New variable.
(bookmark-bmenu-surreptitiously-rebuild-list)
(bookmark-bmenu-list): Use it.

* test/lisp/bookmark-tests.el (with-bookmark-bmenu-test): New macro.
(bookmark-tests-set/bookmark-use-annotations-t)
(bookmark-bmenu-edit-annotation/show-annotation)
(bookmark-bmenu-send-edited-annotation)
(bookmark-bmenu-send-edited-annotation/restore-focus): New test cases.
2019-07-14 09:26:42 +03:00
Marco Wahl
352530ee0a New function for scroll-lock-mode to almost always scroll
* lisp/scroll-lock.el (scroll-lock-next-line-always-scroll): New
function.  Opposed to scroll-lock-next-line it does not switch to
forward-line at eob.  S-down is the default key binding for this
function.  (Bug#36494)
* test/lisp/scroll-lock-tests.el: A few tests for
scroll-lock-next-line-always-scroll.
* etc/NEWS: Announce the new command.
2019-07-14 09:23:20 +03:00
Michael Albinus
40743cbb73 ; Some precisements in test/README 2019-07-13 13:30:28 +02:00
Phil Sainty
c1b4368809 Add tests for so-long.el 2019-07-13 18:51:55 +12:00
Lars Ingebrigtsen
936d074d7c Document format-spec and expand the modifiers it supports
* doc/lispref/text.texi (Interpolated Strings): New section.
* lisp/format-spec.el (format-spec--parse-modifiers)
(format-spec--pad): New functions.
(format-spec): Support more format modifiers (bug#32931).
2019-07-13 03:50:50 +02:00
Juri Linkov
38e420af45 * test/lisp/replace-tests.el (replace-tests-with-undo): Override
replace-highlight to emulate clobbering match-data (bug#36328).
2019-07-12 22:00:56 +03:00
Juri Linkov
391e8e530a * lisp/progmodes/compile.el (compilation-filter): `compilation--ensure-parse'
is used instead of `font-lock-ensure' (bug#36564).

* test/lisp/progmodes/compile-tests.el (compile-test-error-regexps)
(compile-test-grep-regexps): Check the number of errors.
2019-07-12 21:57:18 +03:00
Lars Ingebrigtsen
4c4ff9d90a Fix breaking of rfc2047 headers with long words
* lisp/mail/rfc2047.el (rfc2047-fold-region): Don't break lines
right after the Header: field, but wait until the next
whitespace.  (This only makes a difference for words that are very
long (i.e., longer than, say, 60 characters, depending on the
header name length.)
2019-07-12 15:59:27 +02:00
Lars Ingebrigtsen
4438459eaa Refactor rfc2047-fold-region slightly and add a couple of tests
* lisp/mail/rfc2047.el (rfc2047--break-line): Refactor out to
avoid code repetition...
(rfc2047-fold-region): ... from this function.
2019-07-12 15:48:34 +02:00
Michael Albinus
955db22005 Check directory in Tramp's {copy,rename}-file
* lisp/net/tramp-adb.el (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):
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file):
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-file)
(tramp-smb-handle-rename-file):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file):
Check, that NEWNAME is not a directory given as file name.

* test/lisp/net/tramp-tests.el (tramp-test11-copy-file)
(tramp-test12-rename-file): Extend tests.
2019-07-12 15:10:57 +02:00
Michael Albinus
37cb129979 * test/lisp/format-spec-tests.el (test-format-unknown): Use `should-error'. 2019-07-11 20:01:57 +02:00
Lars Ingebrigtsen
b44f0c4579 Allow passing unknown specs to format-spec
* lisp/format-spec.el (format-spec): Allow passing through format
strings that have no specs (to be able to act as a filter).  Also
add an example.
* test/lisp/format-spec-tests.el (test-format-spec): Add tests for
the new functionality.
2019-07-11 18:44:30 +02:00
Lars Ingebrigtsen
b41ddb7a8b Add tests for format-spec 2019-07-11 18:37:55 +02:00
Lars Ingebrigtsen
50e7e8101a Add test to time-stamp.el 2019-07-11 18:27:12 +02:00
Mattias Engdegård
83ed722c8d Fix trig simplification crash (bug#33052)
* lisp/calc/calc-alg.el (calcFunc-sec, calcFunc-csc, calcFunc-cot):
Check that `math-known-sin' and `math-known-tan' succeeded before
using their value in arithmetic.
* test/lisp/calc/calc-tests.el (calc-test-trig): Add regression tests.
2019-07-10 19:28:35 +02:00
Stefan Kangas
c198ecda9f Fix warnings in todo-mode-tests.el (Bug#36569)
* test/lisp/calendar/todo-mode-tests.el (todo-test--insert-item):
Fix "Unused lexical argument" warnings.
2019-07-10 11:26:18 +01:00
Stefan Kangas
faedbe4665 Fix warning in electric-tests.el (Bug#36570)
* test/lisp/electric-tests.el (plainer-c-mode): Remove duplicate
definition.
2019-07-10 11:11:39 +01:00
Stefan Monnier
fec111c9ee * src/fileio.c: Fix bug#36431
(decide_coding_unwind): Re-introduce.  Move text back to the gap.
Return the new `inserted` via the unwind_data.
(Finsert_file_contents): Use it.
Make sure `inserted` is always 0 when we jump straight to `notfound`.
Don't insert the text in the buffer until we know it's properly decoded
for the byteness of the buffer.

* test/src/fileio-tests.el (fileio-tests--insert-file-interrupt):
Allow insert-file-contents to return an empty buffer in case of
non-local exit in set-auto-coding-function.
2019-07-09 17:04:24 -04:00
Paul Eggert
ce59b41a28 Port image-type-from-file-header-test to non-SVG Emacs
Problem reported privately by Michael Albinus.
* test/lisp/image-tests.el (image-type-from-file-header-test):
Don’t assume svg is a supported image type.
2019-07-09 13:03:07 -07:00
Glenn Morris
95dce77c5e Conditionalize result of a bytecomp test
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--switch-duplicates):
Apparently the result depends on byte-compile-cond-use-jump-table.
2019-07-09 03:27:26 -07:00