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

3095 Commits

Author SHA1 Message Date
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
Ken Brown
0528a7c872 Ensure that expand-file-name returns an absolute file name
* src/fileio.c (Fexpand_file_name): Don't directly use the current
buffer's default-directory if it is relative.  Instead replace it
by its expansion relative to invocation-directory.  (Bug#36502)
* test/src/fileio-tests.el
(fileio-tests--relative-default-directory): New test.
2019-07-08 18:37:33 -04:00
Glenn Morris
bb856d12dc Merge from origin/emacs-26
e97c043 Fix python.el docstring (Bug#36458)
e660801 ; Add thing-at-point-looking-at test (Bug#35708)
f5b4846 ; Fix typo, insure -> ensure in ChangeLogs
cb8fb59 * lisp/hi-lock.el (hi-lock-line-face-buffer): Doc fix.  (Bug3...
2019-07-06 12:51:30 -07:00
Glenn Morris
16a8a7695f Merge from origin/emacs-26
316f5a3 Fix typo in doc string of file-exists-p (bug#36408)
bfc7c6e * test/lisp/url/url-file-tests.el (url-file): Fix for POSIX f...
13b95e1 Fix typo in windows.texi
8b775c3 Clarify & update (elisp) Writing Emacs Primitives
7648c12 Clarify a subtle issue in the Internals chapter of lispref
2019-07-06 12:51:30 -07:00
Stefan Kangas
cfcaf06fe5 Add tests for text-property-search to check prop-match-value
* test/lisp/emacs-lisp/text-property-search-tests.el
(with-match-test): New macro.
(text-property-search-forward-prop-match-match-face-nil-nil)
(text-property-search-forward-prop-match-match-face-bold-t)
(text-property-search-forward-prop-match-match-face-bold-nil)
(text-property-search-backward-prop-match-match-face-nil-nil)
(text-property-search-backward-prop-match-match-face-italic-t)
(text-property-search-backward-prop-match-match-face-italic-nil):
Add test cases to also verify the value of prop-match-value
(bug#36486).
2019-07-06 16:27:05 +02:00
Konstantin Kharlamov
dfc322d77f Replace manually crafted hex regexes with [:xdigit:]
* admin/charsets/mapconv:
* build-aux/gitlog-to-changelog (parse_amend_file, git_dir_option):
* lisp/progmodes/verilog-mode.el (verilog-delay-re):
(verilog-type-font-keywords, verilog-read-always-signals-recurse):
(verilog-is-number):
* lisp/progmodes/vera-mode.el (vera-font-lock-keywords):
* test/src/emacs-module-tests.el (mod-test-sum-test):
* lisp/xml.el: (xml--entity-replacement-text):
* lisp/version.el (emacs-repository-version-git):
* lisp/textmodes/sgml-mode.el (sgml-quote):
* lisp/textmodes/css-mode.el (css-escapes-re)
(css--colors-regexp):
* lisp/progmodes/prolog.el (prolog-syntax-propertize-function):
* lisp/progmodes/hideif.el (hif-token-regexp, hif-tokenize):
* lisp/progmodes/ebnf-dtd.el: (ebnf-dtd-attlistdecl)
(ebnf-dtd-entitydecl, ebnf-dtd-lex):
* lisp/progmodes/ebnf-ebx.el (ebnf-ebx-hex-character):
* lisp/progmodes/ebnf-abn.el (ebnf-abn-character):
* lisp/progmodes/cperl-mode.el (cperl-highlight-charclass)
(cperl-find-pods-heres):
* lisp/progmodes/cc-mode.el (c-maybe-quoted-number-head)
(c-maybe-quoted-number, c-parse-quotes-before-change)
(c-parse-quotes-after-change, c-quoted-number-head-before-point)
(c-quoted-number-straddling-point):
* lisp/progmodes/ada-mode.el (featurep, ada-in-numeric-literal-p)
(ada-font-lock-keywords):
* lisp/org/org-mobile.el (org-mobile-copy-agenda-files)
* lisp/org/org-table.el (org-table-number-regexp):
(org-mobile-update-checksum-for-capture-file):
* lisp/nxml/xsd-regexp.el (xsdre-gen-categories):
* lisp/nxml/xmltok.el (let*):
* lisp/nxml/rng-xsd.el (rng-xsd-convert-hex-binary)
(rng-xsd-convert-any-uri):
* lisp/nxml/rng-uri.el (rng-uri-file-name-1)
(rng-uri-unescape-multibyte, rng-uri-unescape-unibyte)
(rng-uri-unescape-unibyte-match)
(rng-uri-unescape-unibyte-replace):
* lisp/nxml/rng-cmpct.el (rng-c-process-escapes):
* lisp/nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* lisp/net/shr-color.el (shr-color->hexadecimal):
* lisp/mail/rfc2231.el (rfc2231-decode-encoded-string):
* lisp/international/mule-cmds.el (read-char-by-name):
* lisp/htmlfontify.el (hfy-hex-regex):
* lisp/gnus/nneething.el (nneething-decode-file-name):
* lisp/gnus/mml-sec.el (mml-secure-find-usable-keys):
* lisp/gnus/gnus-art.el (gnus-button-mid-or-mail-heuristic-alist):
* lisp/faces.el (read-color):
* lisp/epg.el (epg--status-ERRSIG, epg--status-VALIDSIG)
(epg--status-SIG_CREATED, epg--decode-percent-escape)
(epg--decode-hexstring, epg--decode-quotedstring)
(epg-dn-from-string):
* lisp/emulation/cua-rect.el (cua-incr-rectangle):
* lisp/dnd.el (dnd-unescape-uri):
* lisp/cedet/semantic/lex.el (semantic-lex-number-expression):
* lisp/cedet/semantic/java.el (semantic-java-number-regexp):
* lisp/calc/calc-lang.el (pascal):
* lisp/calc/calc-ext.el (math-read-number-fancy):
* lisp/calc/calc-aent.el (math-read-token):
Replace various combinations of [0-9a-fA-F] with [[:xdigit:]].
(Bug#36167)
2019-07-06 10:54:25 +03:00
Noam Postavsky
e6608010d7 ; Add thing-at-point-looking-at test (Bug#35708)
* test/lisp/thingatpt-tests.el (thing-at-point-looking-at): New test.
2019-07-05 21:50:37 -04:00
Juri Linkov
19b1cefa3b * lisp/char-fold.el (char-fold-to-regexp): Implement arg LAX (bug#36398).
* test/lisp/char-fold-tests.el (char-fold--test-multi-lax): New test.
2019-07-04 23:49:33 +03:00
Mattias Engdegård
3fd7491512 Optimise more inputs to `regexp-opt' (bug#36444)
Use a more precise test to determine whether the input to `regexp-opt'
is safe to optimise when KEEP-ORDER is non-nil, permitting more inputs
to be optimised than before.  For example, ("good" "goal" "go") is now
accepted.

* lisp/emacs-lisp/regexp-opt.el (regexp-opt):
More precise test for whether the list is safe w.r.t. KEEP-ORDER.
(regexp-opt--contains-prefix): Remove.

* test/lisp/emacs-lisp/regexp-opt-tests.el: Use lexical-binding.
(regexp-opt-test--permutation, regexp-opt-test--factorial)
(regexp-opt-test--permutations, regexp-opt-test--match-all)
(regexp-opt-test--check-perm, regexp-opt-test--explain-perm)
(regexp-opt-keep-order): Test KEEP-ORDER.
2019-07-04 17:18:15 +02:00
Stefan Kangas
22760ab357 Add tests for bookmark.el (Bug#36452)
* test/lisp/bookmark-resources/example.txt:
* test/lisp/bookmark-resources/test.bmk:
* test/lisp/bookmark-tests.el: New files.
* lisp/bookmark.el: Minor cleanups.
(bookmark-insert-annotation): Signal error on invalid bookmark.
(bookmark-write-file): Add newline at end of file.
2019-07-03 14:49:38 +03:00
Michael Albinus
14563dc10a Change expected result of a flymake test on emba
* test/lisp/progmodes/flymake-tests.el (different-diagnostic-types):
Test is now passing on emba.gnu.org, too.
2019-07-03 09:00:26 +02:00
Glenn Morris
20c1406cd0 Change expected result of a flymake test on hydra
* test/lisp/progmodes/flymake-tests.el (different-diagnostic-types):
Test is now passing on hydra.nixos.org, since today.
2019-07-02 16:46:25 -07:00
Stefan Monnier
fe3676fe18 (Finsert_file_contents): Keep buffer consistent in non-local exit
* src/fileio.c (decide_coding_unwind): Delete function.
(Finsert_file_contents): Don't let invalid multibyte byte sequences
escape when we exit non-locally.

* test/src/fileio-tests.el (fileio-tests--insert-file-interrupt): New test.
2019-07-02 18:02:51 -04:00
Stefan Monnier
a2c56a90f9 * test/src/editfns-tests.el (test-group-name): Accept nil group-name. 2019-07-02 15:11:16 -04:00
João Távora
5e88b50d54 Correctly reindent previous line in electric-indent-mode
Fixes: bug#35254

Do this even when electric-indent-inhibit is t, except when the
newline insertion is being performed by electric-layout-mode.

* lisp/electric.el (electric-indent-post-self-insert-function):
Reindent previous line unless operating under
electric-layout-mode.
(electric-layout-post-self-insert-function-1): Bind
electric-indent-inhibit to 'electric-layout-mode.

* test/lisp/electric-tests.el
(electric-layout-control-reindentation): New test.
2019-07-02 16:10:45 +01:00
Michael Albinus
10af8c5863 Release Tramp 2.4.2
* lisp/net/tramp.el: Bump version.

* test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case):
Add `add-name-to-file' error message.
(tramp--test-ignore-add-name-to-file-error): Make error handler
more explicit about the error.
2019-06-30 11:23:06 +02:00
Eli Zaretskii
74a5a332fe Support native image transforms on MS-Windows
This changeset also rearranges native image transform code
for other platforms to make it cleaner, and also removes
the support for native cropping.  For the discussions, see
https://lists.gnu.org/archive/html/emacs-devel/2019-06/msg00242.html

* src/w32term.c (w32_image_rotations_p, transform): New functions.
(w32_draw_image_foreground): If image rotation is requested
and supported, call PlgBlt to transform the image.
(w32_initialize): Populate the PlgBlt function pointer if it
is supported.
* src/w32term.h (w32_image_rotations_p): Add prototype.
* src/dispextern.h (struct image) [HAVE_NTGUI]: New member xform.
* src/image.c (compute_image_rotation): Renamed from
image_set_rotation.  Only compute and returns the rotation
angle; leave the matrix calculation for later.  Log an error
message if the :rotation parameter is not a number.
(image_set_crop): Function deleted.  We no longer support
native cropping, as one can display an image slice instead.
(image_set_transform): Compute the transform matrix in its
entirety here, in two variants: one for XRender and Cairo, the
other for NS and MS-Windows.  call compute_image_size and
compute_image_rotation internally.
(lookup_image) [HAVE_NATIVE_TRANSFORMS]: Call only
image_set_transform.  No need to pass the transform matrix to
image_set_transform.
(Fimage_transforms_p): Return a list of transform capabilities
rather than a simple boolean.  Support TTY frames as well.
* src/nsimage.m (setTransform:): Don't invert the matrix, as
it is already inverted in image.c.

* test/manual/image-transforms-tests.el (test-cropping): State
in the text that only ImageMagick supports cropping.

* doc/lispref/display.texi (Image Descriptors): Update the
documentation of native image transforms.
(ImageMagick Images): Move the description of ':crop' here.

* etc/NEWS: Minor copyedits of the feature announcement.
2019-06-29 14:51:41 +03:00
Mattias Engdegård
f1d414b98f Allow empty argument to `regexp-opt-charset'
* test/lisp/emacs-lisp/regexp-opt-tests.el (regexp-opt-charset):
Handle nil argument, and use regexp-quote for singletons.
* lisp/emacs-lisp/regexp-opt.el (regexp-opt-charset): Expand tests.
2019-06-29 11:12:27 +02:00
Andreas Schwab
c113d6f3c1 * test/src/json-tests.el (json-serialize/object): Fix spacing. 2019-06-29 07:41:52 +02:00
Pip Cet
bc87ee925d Fix json-serialize/object test failure
* test/src/json-tests.el (json-serialize/object):
Accept failure with different code.
2019-06-28 22:02:02 -07:00
Mattias Engdegård
a1f76adfb0 Correct regexp matching of raw bytes
Make regexp matching of raw bytes work in all combination of unibyte
and multibyte patterns and targets, as exact strings and in character
alternatives (bug#3687).

* src/regex-emacs.c (analyze_first):
Include raw byte in fastmap when pattern is a multibyte exact string.
Include leading byte in fastmap for raw bytes in character alternatives.
(re_match_2_internal):
Decrement the byte count by the number of bytes in the pattern character,
not 1.
* test/src/regex-emacs-tests.el (regexp-unibyte-unibyte)
(regexp-multibyte-unibyte, regexp-unibyte-mutibyte)
(regexp-multibyte-multibyte): New tests.
2019-06-28 17:30:18 +02:00
Michael Albinus
aae5bf4438 Tramp requires Emacs 24.4
* doc/misc/tramp.texi (Frequently Asked Questions):
Use `with-eval-after-load'. in example.

* doc/misc/trampver.texi: Set variable emacsver.

* lisp/net/tramp.el (tramp-send-string, tramp-call-process)
(tramp-call-process-region, tramp-process-lines):
* lisp/net/tramp-adb.el (tramp-adb-handle-file-truename)
(tramp-adb-sh-fix-ls-output, tramp-adb-maybe-open-connection):
* lisp/net/tramp-gvfs.el (tramp-gvfs-get-directory-attributes)
(tramp-gvfs-handle-file-notify-add-watch)
* lisp/net/tramp-sh.el (tramp-sh-handle-file-truename)
(tramp-do-copy-or-rename-file-out-of-band)
(tramp-sh-handle-file-notify-add-watch, tramp-find-executable)
(tramp-set-remote-path)
(tramp-open-connection-setup-interactive-shell)
(tramp-maybe-open-connection, tramp-send-command):
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory)
(tramp-smb-handle-file-acl, tramp-smb-handle-process-file)
(tramp-smb-handle-set-file-acl)
(tramp-smb-handle-start-file-process)
(tramp-smb-maybe-open-connection):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-set-file-acl):
(tramp-sudoedit-send-command): Use `string-join' and `string-empty-p'.

* lisp/net/tramp-adb.el:
* lisp/net/tramp-archive.el:
* lisp/net/tramp-integration.el:
* lisp/net/tramp-ftp.el: Use `with-eval-after-load'.

* lisp/net/tramp-cmds.el (tramp-cleanup-connection)
(tramp-cleanup-all-connections): Cancel timer.

* lisp/net/tramp-compat.el (subr-x): Require.
(default-toplevel-value): Don't make it a defalias.

* lisp/net/tramp-gvfs.el: Use `dbus-event-error-functions'.  Do
not special handle `split-string'.

* lisp/net/tramp.el: Require Emacs 24.4.
(tramp-password-prompt-regexp): Use `password-word-equivalents'.
(tramp-user-error): Use `user-error'.
(tramp-replace-environment-variables): Use `substitute-env-vars'.
(tramp-wait-for-regexp): Rearrange `with-current-buffer' call.
(tramp-get-local-gid): Use `group-gid'.

* lisp/net/trampver.el: Check for Emacs 24.4.

* test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect)
(tramp-test02-file-name-dissect-simplified)
(tramp-test02-file-name-dissect-separate)
(tramp-test03-file-name-host-rules)
(tramp-test03-file-name-method-rules): Don't check for `user-error'.
2019-06-28 16:32:12 +02:00
Juanma Barranquero
bfc7c6e0d3 * test/lisp/url/url-file-tests.el (url-file): Fix for POSIX filenames. 2019-06-28 15:22:00 +02:00
Stefan Monnier
0b4e003766 Revert "* lisp/calc/calc-ext.el (math-scalarp): Fix typo"
This reverts commit 698ff554ac.
2019-06-26 10:24:59 -04:00
Stefan Monnier
4e302630ae * test/lisp/calc/calc-tests.el (test-math-bignum, test-calc-23889): Disable
Not applicable any more with native bignums.
2019-06-26 10:04:52 -04:00
Stefan Monnier
698ff554ac * lisp/calc/calc-ext.el (math-scalarp): Fix typo 2019-06-26 10:03:48 -04:00
Noam Postavsky
9233865b70 Fix (rx-to-string (and (literal STR) (regexp STR)) regression
* lisp/emacs-lisp/rx.el (rx-regexp, rx-literal): Check the cadr of the
form for stringness, not the form itself.
* test/lisp/emacs-lisp/rx-tests.el (rx-to-string-lisp-forms): New test.
2019-06-26 08:50:27 -04:00
Noam Postavsky
9552ee4df7 Merge from emacs-26
e62ad04963 Fix sgml-mode handling of quotes within parens (Bug#36347)
06b35b2f92 ; * lisp/frame.el: Enhance add-variable-watcher commentary.
572e34bb6f Rename 'make-symbolic-link' argument NEWNAME to LINKNAME
04477adedc Check that length of data returned by sysctl is non-zero
81535eeadb * test/lisp/progmodes/python-tests.el (python-virt-bin): D...
9d48979ca8 Fix Python tests depending on system-type
fcf6cc3177 Fix problem with wdired test when symlinks cannot be created.
4701e0663e Improve wording of documentation of click events

# Conflicts:
#	lisp/textmodes/sgml-mode.el
#	test/lisp/textmodes/sgml-mode-tests.el
2019-06-25 22:04:13 -04:00
Noam Postavsky
648fdbbcec Don't bind search-spaces-regexp around possible autoload (Bug#35802)
* lisp/isearch.el (isearch-search-fun-default): Move possible autoload
trigger outside let-binding of search-spaces-regexp.
* lisp/char-fold.el (char-fold-make-table): Remove no longer needed
workaround.

* lisp/info.el (Info-search-whitespace-regexp):
* lisp/isearch.el (search-whitespace-regexp):
* src/search.c (syms_of_search) <search-spaces-regexp>: Add warning
about adding capturing groups to the value.

* test/lisp/char-fold-tests.el: Remove, binding search-spaces-regexp
to a different should be considered a bug.
2019-06-25 22:00:03 -04:00
Noam Postavsky
b59ffd2290 Support (rx (and (regexp EXPR) (literal EXPR))) (Bug#36237)
* lisp/emacs-lisp/rx.el (rx-regexp): Allow non-string forms.
(rx-constituents): Add literal constituent, which is like a plain
STRING form, but allows arbitrary lisp expressions.
(rx-literal): New function.
(rx-compile-to-lisp): New variable.
(rx--subforms): New helper function for handling subforms, including
non-constant case.
(rx-group-if, rx-and, rx-or, rx-=, rx->=, rx-repeat, rx-submatch)
(rx-submatch-n, rx-kleene, rx-atomic-p): Use it to handle non-constant
subforms.
(rx): Document new form, wrap non-constant forms with concat call.
* test/lisp/emacs-lisp/rx-tests.el (rx-tests--match): New macro.
(rx-nonstring-expr, rx-nonstring-expr-non-greedy): New tests.
* etc/NEWS: Announce changes.
2019-06-25 22:00:03 -04:00
Noam Postavsky
e62ad04963 Fix sgml-mode handling of quotes within parens (Bug#36347)
* lisp/textmodes/sgml-mode.el (sgml-syntax-propertize): Use
syntax-ppss-table if set.  This is only needed on the release branch,
on master the caller (syntax-propertize) already does this.
(sgml-mode): Set syntax-ppss-table to sgml-tag-syntax-table.  This
correctly classifies parens as punctuation, so they won't confuse the
parser.
* test/lisp/textmodes/sgml-mode-tests.el (sgml-tests--quotes-syntax):
New test copied from master, with two cases added for this bug.
2019-06-25 18:58:23 -04:00
Glenn Morris
bc780a4691 * test/lisp/progmodes/flymake-tests.el (ruby-backend): Skip on hydra.
Another unstable test.
2019-06-25 13:23:15 -07:00
Stefan Monnier
0ef3163959 * lisp/textmodes/tex-mode.el (latex-noindent-commands): New custom var
(latex-find-indent): Obey it.
(latex-noindent-environments): Make it into a defcustom as well.
2019-06-24 19:21:07 -04:00
Michael Albinus
18a7e5414c Improve error handling in Tramp
* lisp/net/tramp-compat.el (ls-lisp): Require.

* lisp/net/tramp.el (ls-lisp-use-insert-directory-program):
Don't declare.
(tramp-current-connection): Adapt docstring.
(tramp-debug-message): Adapt function names.
(tramp-error, tramp-run-real-handler): Let-bind `signal-hook-function'.
(tramp-signal-hook-function): New defun.
(tramp-debug-on-error, tramp-condition-case-unless-debug): Remove.
(tramp-file-name-handler): Handle `tramp-current-connection'.
Let-bind `signal-hook-function'.  Use `unwind-protect' instead of
`tramp-condition-case-unless-debug'.
(tramp-handle-insert-directory): Don't require ls-lisp.
(tramp-process-actions): Check, that
`tramp-password-save-function' is non-nil.
(tramp-equal-remote): Handle the case both files are local.

* test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case):
Do not bind `tramp-debug-on-error'.
(tramp--test-ignore-make-symbolic-link-error): Make error handler
more explicit about the error.
2019-06-24 17:36:00 +02:00
Damien Cassou
7022e3fde6
Refactoring of auth-source-pass
* lisp/auth-source-pass.el (auth-source-pass--find-match): Refactor by
moving some code to auth-source-pass--disambiguate.
(auth-source-pass--disambiguate)
(auth-source-pass--entries-matching-suffix): New function.
(auth-source-pass--find-match-unambiguous)
(auth-source-pass--select-from-entries)
(auth-source-pass--entry-reducer): Refactor to simplify and improve
logging.
(auth-source-pass--matching-entries)
(auth-source-pass--accumulate-matches): Remove.
* test/lisp/auth-source-pass-tests.el: Complete rewrite to facilitate
maintenance.
(auth-source-pass--have-message-containing): Remove.
(auth-source-pass--have-message-matching)
(auth-source-pass--explain--have-message-matching)
(auth-source-pass--explain-match-entry-p)
(auth-source-pass--includes-sorted-entries)
(auth-source-pass--explain-includes-sorted-entries)
(auth-source-pass--explain-match-any-entry-p)
(auth-source-pass--matching-entries)
(auth-source-pass-match-entry-p)
(auth-source-pass-match-any-entry-p): New function.
2019-06-24 09:15:41 +02:00
Keith Amidon
0a580c187d
Minimize entry parsing in auth-source-pass
Prior to this commit, while searching for the most applicable entry
password-store entries were decrypted and parsed to ensure they were
valid.  The entries were parsed in the order they were found on the
filesystem and all applicable entries would be decrypted and parsed,
which varied based on the contents of the password-store and the entry
to be found.

This is fine when the GPG key is cached and each entry can be
decrypted without user interaction.  However, for security some people
have their GPG on a hardware token like a Yubikey setup so that they
have to touch a sensor on the toke for every cryptographic operation,
in which case it becomes inconvenient as each attempt to find an entry
requires a variable number of touches of the hardware token.

The implementation already assumes that names which contain more of
the information in the search key should be preferred so there is an
ordering of preference of applicable entries.  If the decrypt and
parsing is removed from the initial identification of applicable
entries in the store then in most cases a single decrypt and parse of
the most preferred entry will suffice, improving the experience for
hardware token users that require interaction with the token.

This commit implements that strategy.  It is in spirit a refactor of
the existing code.

* lisp/auth-source-pass.el (auth-source-pass--matching-entries): New
function, generate an ordered list of regular expression matchers for
all possible names that could be in the password-store for the entry
to be found and then makes a pass over the password-store entry names
accumulating the matching entries in a list after the regexp that
matched.  This implementation ensures the password-store entry list
still only has to be scanned once.
(auth-source-pass--find-match-unambiguous): Use it to obtain candidate
entries and then parse them one by one until an entry containing the
desired information is located.  When complete, return the parsed data
of the entry instead of the entry name so that the information can be
used directly to construct the auth-source response.
(auth-source-pass--build-result): Update accordingly.
(auth-source-pass--find-match): Update docstring accordingly.
(auth-source-pass--select-one-entry)
(auth-source-pass--entry-valid-p)
(auth-source-pass--find-all-by-entry-name)
(auth-source-pass--find-one-by-entry-name): Remove.
(auth-source-pass--select-from-entries)
(auth-source-pass--accumulate-matches)
(auth-source-pass--entry-reducer)
(auth-source-pass--generate-entry-suffixes)
(auth-source-pass--domains)
(auth-source-pass--name-port-user-suffixes): New functions.

* test/lisp/auth-source-pass-tests.el: One test case was added to the
test suite to verify that only the minimal number of entries are
parsed in common cases.  The
auth-source-pass-only-return-entries-that-can-be-open test case had to
be re-implemented because the function it was used eliminated as the
functionality is provided elsewhere.  All the other fairly substantial
changes to the test suite are the result of mechanical changes that
were required to adapt to auth-source-pass--find-match returning the
data from a parsed password-store entry instead of the entry name.
2019-06-24 09:15:40 +02:00
Keith Amidon
94c9eb81b8
Fix auth-source-pass to search for hostname:port/username
auth-source-pass supports entries with username either prefixed to the
hostname with an @ as separator or in a subdirectory under the
hostname.  This was true when there was no port or service included in
the name, but got broken with the introduction of
auth-source-pass-port-separator.

* lisp/auth-source-pass.el (auth-source-pass--find-match-unambiguous): Fix
to match hostname:port/username.
* test/lisp/auth-source-pass-tests.el: Add corresponding tests.
2019-06-24 09:15:40 +02:00
Iku Iwasa
2a0a05789d
Add auth-source-pass-port-separator option
* lisp/auth-source-pass.el (auth-source-pass-port-separator): New
option to specify separator between host and port, default to
colon (":").
(auth-source-pass--find-match-unambiguous): Adapt to make use of the
new variable.
* test/lisp/auth-source-pass-tests.el: Add corresponding tests.
2019-06-24 09:15:40 +02:00
Magnus Henoch
527efaf798
Fix auth-source-pass to return nil if no entry found
* lisp/auth-source-pass.el (auth-source-pass-search): If there is no
matching entry, auth-source-pass-search should return nil, not (nil).
This lets auth-source fall back to other backends in the auth-sources
list.
* test/lisp/auth-source-pass-tests.el: Add corresponding test.

Copyright-paperwork-exempt: yes
2019-06-24 09:15:39 +02:00
Mattias Engdegård
866f527ddf Optional space and unit in `file-size-human-readable' (bug#35756)
To improve readability of strings produced by
`file-size-human-readable', add two optional arguments:

- SPACE, to provide a string (typically a space or non-breaking space)
to put between the number and unit.  For compatibility, the default is
an empty string.

- UNIT, a string to use as unit.  For compatibility, the default is
"B" in `iec' mode and the empty string otherwise.

Also fix a glitch with small numbers in `iec' mode which caused a
stray "i" in the result.

* lisp/files.el (file-size-human-readable):
Add optional SPACE and UNIT arguments and handle small numbers correctly.
(files--ask-user-about-large-file, warn-maybe-out-of-memory):
Call with `iec' and space.
* test/lisp/files-tests.el (files-test-file-size-human-readable): New test.
* lisp/url/url-http.el (url-http-simple-after-change-function)
(url-http-content-length-after-change-function): Call with `iec' and space.
* etc/NEWS (Lisp Changes): Mention the change.
2019-06-23 20:30:50 +02:00
Simen Heggestøyl
abf7d0d802 Split up and add tests for two page.el functions
* lisp/textmodes/page.el (page--count-lines-page): New function
extracted from `count-lines-page'.
(count-lines-page): Extract main logic into `page--count-lines-page'.
(page--what-page); New function extracted from `what-page'.
(what-page): Extract main logic into `page--what-page'.

* test/lisp/textmodes/page-tests.el (page-tests-count-lines-page)
(page-tests-what-page): New tests for `page--count-lines-page' and
`page--what-page'.  (Bug#36009)
2019-06-23 07:27:19 +02:00
Allen Li
2db75262c7 Fix defining inverse abbrevs on previous words (Bug#36243)
* lisp/abbrev.el (inverse-add-abbrev): Skip trailing nonword
characters when defining abbrev.

* test/lisp/abbrev-tests.el (abbrev-edit-save-to-file-test): Add
regression tests.
2019-06-22 19:25:44 -04:00
Noam Postavsky
0f01a58c39 Fix python docstring auto-fill (Bug#36056)
* lisp/progmodes/python.el (python-mode): Set
fill-indent-according-to-mode locally to t.  This lets auto-fill do
the right thing when auto-filling inside a docstring.  The default was
to nil on 2001-11-25 "(fill-indent-according-to-mode): Default to nil"
with the comment that it "screws up CC-mode's filling tricks".  But
presumably it shouldn't be a problem for python-mode.
* test/lisp/progmodes/python-tests.el (python-auto-fill-docstring):
New test.
2019-06-22 19:25:44 -04:00
Noam Postavsky
f46b16b9fb Make rcirc parsing more RFC2812 compliant (Bug#36233)
Do continue to allow multiple spaces between arguments, even though
that is technically not allowed by the RFC.
* lisp/net/rcirc.el (rcirc-process-server-response-1): Fix parsing of
arguments which contain colons.
* test/lisp/net/rcirc-tests.el: New test.
2019-06-22 19:25:44 -04:00
Stefan Kangas
5a96936520 Add tests for mail/flow-fill.el
* test/lisp/mail/flow-fill-tests.el: New file.
* lisp/mail/flow-fill.el (fill-flowed-encode-tests)
(fill-flowed-test): Make obsolete.  (Bug#36174)
2019-06-22 12:15:40 +03:00
Lars Ingebrigtsen
31b1e4cbdc Throughout cedet, don't use semantic-overlay-* compat aliases 2019-06-20 12:51:39 +02:00
Mattias Engdegård
d3a7f3e6cd Compile any subsequence of `cond' clauses to switch (bug#36139)
A single `cond' form can how be compiled to any number of switch ops,
optionally interspersed with non-switch conditions.
Previously, switch ops would only be used for whole `cond' forms
containing no other tests.

* lisp/emacs-lisp/bytecomp.el (byte-compile--cond-vars):
Rename from `byte-compile-cond-vars'.
(byte-compile--default-val): Remove.
(byte-compile--cond-switch-prefix):
Replace `byte-compile-cond-jump-table-info'; now also returns
trailing non-switch clauses.
(byte-compile-cond-jump-table): New arguments; no longer compiles
the default case.
(byte-compile-cond): Look for and compile switches at any place in the
list of clauses.
* test/lisp/emacs-lisp/bytecomp-tests.el (byte-opt-testsuite-arith-data):
Add test expression.
2019-06-19 11:22:21 +02:00
Mattias Engdegård
14a81524c2 Compile cond with heterogeneous tests into switch (bug#36139)
Allow any mixture of `eq', `eql' and `equal', `memq', `memql' and
`member' in a switch-like `cond' to be compiled into a single switch.

* lisp/emacs-lisp/bytecomp.el (byte-compile--common-test): New.
(byte-compile-cond-jump-table-info): Use most specific common test.
* test/lisp/emacs-lisp/bytecomp-tests.el (byte-opt-testsuite-arith-data):
Add test cases for multi-value clause cond forms.
2019-06-19 11:20:59 +02:00
Mattias Engdegård
b8c74742c0 Tighter pcase or-pattern member function selection (bug#36139)
* lisp/emacs-lisp/pcase.el (pcase--u1):
Use the most specific of `memq', `memql' and `member' in or-patterns
with constant cases.  This improves performance and may help the byte-code
compiler generate a switch.
* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-member):
Add mixed-type or-pattern test cases.
2019-06-19 11:20:58 +02:00
Juanma Barranquero
81535eeadb * test/lisp/progmodes/python-tests.el (python-virt-bin): Doc fix. 2019-06-17 03:12:45 +02:00
Juanma Barranquero
9d48979ca8 Fix Python tests depending on system-type
* test/lisp/progmodes/python-tests.el (python-virt-bin): New function.
(python-shell-calculate-exec-path-2)
(python-shell-calculate-exec-path-3)
(python-shell-calculate-exec-path-4)
(python-shell-with-environment-1, python-shell-with-environment-2):
Use it.
2019-06-17 02:48:21 +02:00
Glenn Morris
78a609d454 Disable filling of warnings in a bytecomp test
* test/lisp/emacs-lisp/bytecomp-tests.el (test-suppression):
Disable filling rather than working around it.
2019-06-16 17:37:21 -07:00
Juanma Barranquero
fcf6cc3177 Fix problem with wdired test when symlinks cannot be created.
* test/lisp/wdired-tests.el (wdired-test-symlink-name):
Skip test if 'make-symbolic-link' fails for whatever reason;
that's not what's being tested.
2019-06-16 21:57:44 +02:00
Alan Third
beb572a7dd Revert "Simplify image transforms"
This reverts commit cf3081d208.

; Pushed in error.
2019-06-16 20:46:42 +01:00
Alan Third
cf3081d208 Simplify image transforms
* src/image.c: (image_set_rotation, image_set_size,
image_set_transform): Combine into image_set_transform.
(image_set_crop): Remove function.
(lookup_image): Remove calls to removed functions and remove
transform_matrix.
* test/manual/image-transforms-tests.el (test-cropping): Remove
function.
(test-transforms): Remove reference to test-cropping.
2019-06-16 20:24:53 +01:00
Alan Third
11b0e33462 Document image transforms
* doc/lispref/display.texi (Image Descriptors): Document :crop and
update :rotation.
* src/image.c: Describe the image transform matrix layout.
* test/manual/image-transforms-tests.el: New file.
2019-06-16 20:24:53 +01:00
Michael Albinus
f87a9e359e Fix accidential change in tramp-tests; do not merge with master
* lisp/net/trampver.el: Change version to "2.3.5.26.3".
(customize-package-emacs-version-alist): Add Tramp version
integrated in Emacs 26.3.

* test/lisp/net/tramp-tests.el (tramp-test42-auto-load):
Add skip for w32.
2019-06-15 21:38:11 +02:00
Glenn Morris
30e3e58c1b Merge from origin/emacs-26
7a8f22b * test/lisp/url/url-file-tests.el (url-file): Use file:///, n...
0c5f6c6 Fix doc of srecompile-compile-split-code (Bug#36200)
2019-06-15 09:50:33 -07:00
Lars Ingebrigtsen
fcb3821ad5 Also test unpacking 2019-06-15 16:10:28 +02:00
Lars Ingebrigtsen
f03343747e Refactor for reuse 2019-06-15 16:06:38 +02:00
Lars Ingebrigtsen
60a6992ae3 New file to test bindat functions 2019-06-15 15:57:01 +02:00
Michael Albinus
38a86a4c49 Some changes in process output read of Tramp
* lisp/net/tramp.el (tramp-handle-file-notify-rm-watch):
Read pending output.

* test/lisp/net/tramp-tests.el (tramp-test31-interrupt-process):
Use a timeout when reading process output.
2019-06-15 11:33:16 +02:00
Michael Albinus
7d71d0b13d Tag remote autorevert tests as unstable
* test/lisp/autorevert-tests.el (auto-revert--timeout):
Derive value from `auto-revert-interval'.
(auto-revert--deftest-remote): Tag it as `:unstable'.
(auto-revert-test05-global-notify, auto-revert-test06-write-file):
Suppress final newline.  Use `auto-revert--timeout'.
2019-06-15 11:08:05 +02:00
Juanma Barranquero
200f63cfa5 tramp-test42-auto-load: Add expected-result.
* test/lisp/net/tramp-tests.el (tramp-test42-auto-load):
Expect a failed result if remote file access is not enabled,
as it happens while doing the test on Windows.
2019-06-15 07:23:25 +02:00
Juanma Barranquero
7a8f22b004 * test/lisp/url/url-file-tests.el (url-file): Use file:///, not file://. 2019-06-15 05:29:03 +02:00
Michael Albinus
0518e3ca98 Fix problem in remote file notification
* lisp/net/tramp-sh.el (tramp-sh-gio-monitor-process-filter)
(tramp-sh-gvfs-monitor-dir-process-filter)
(tramp-sh-inotifywait-process-filter): Do not kill the process.
Let `file-notify-rm-watch' do the job.

* test/lisp/filenotify-tests.el (file-notify-test03-events)
(file-notify-test05-file-validity)
(file-notify-test09-watched-file-in-watched-dir): Do not
special-case remote files.
2019-06-14 19:45:00 +02:00
Eli Zaretskii
746d42f52b Remove failing test erroneously added in backport
* test/src/thread-tests.el (threads-test-bug33073): Remove
test which cannot work on the emacs-26 branch.  Do not merge
to master.  Reported by Juanma Barranquero <lekktu@gmail.com>.
2019-06-14 09:40:40 +03:00
Glenn Morris
5e09ace074 Stop a tramp test leaving a file behind
* test/lisp/net/tramp-tests.el
(tramp-test10-write-region-file-precious-flag):
Avoid leaving a backup file after we are done.
2019-06-13 20:24:41 -04:00
Glenn Morris
4c3e78a9f4 Allow for line breaks in a bytecomp test
* test/lisp/emacs-lisp/bytecomp-tests.el (test-suppression):
Warnings from the byte compiler may be filled.
2019-06-12 19:31:00 -07:00
Lars Ingebrigtsen
c25e3754ed Add more ps-mode octal tests
* test/lisp/progmodes/ps-mode-tests.el
(ps-mode-test-octal-region-multibyte): New test.
2019-06-13 03:03:26 +02:00
Lars Ingebrigtsen
5b7ec43c61 Add ps-mode-tests.el and remove a compilation warning
* lisp/progmodes/ps-mode.el (ps-mode-octal-region): Remove a
string-make-unibyte that apparently had no effect here.
* test/lisp/progmodes/ps-mode-tests.el: New file.
2019-06-13 02:48:41 +02:00