1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-15 17:00:26 +00:00
Commit Graph

5868 Commits

Author SHA1 Message Date
Paul Eggert
5abcc2fc67 Fix comp-tests.el problem after reconfiguring
* test/src/comp-tests.el: Do not byte-compile, as the .elc
file would be machine-dependent (bug#51104).
2022-09-12 15:32:09 -05:00
Stefan Kangas
8253090293 Skip manual GIF metadata test on MS-Windows
* test/manual/image-tests.el
(image-skip-unless): Add new arg CONDITION.
(image-tests-image-metadata/gif): Skip test on MS-Windows when
using native image API.  (Bug#57691)
2022-09-12 15:15:16 +02:00
Arash Esbati
191c4fe249 Consider key=val labels when renumbering
* lisp/textmodes/reftex-global.el (reftex-translate): Recognize
key=val labels given in the optional or mandatory argument of
environments (AUCTeX bug#57720).

* test/lisp/textmodes/reftex-tests.el
(reftex-renumber-simple-labels): New Test.
2022-09-12 09:34:23 +02:00
Kévin Le Gouguec
d8f392bccd Restrict replace-*-in-region to the bounds defined by caller
* lisp/subr.el (replace-string-in-region, replace-regexp-in-region):
Narrow to region before iterating over matches, instead of giving a
bound to the search functions.
* test/lisp/subr-tests.el (test-replace-string-in-region): Add
regression tests (bug#57733).
2022-09-11 19:55:36 +02:00
Richard Hansen
f47a5324f4 whitespace: Redo BoB/EoB empty line highlighting
* lisp/whitespace.el (whitespace--empty-at-bob-matcher,
whitespace--empty-at-eob-matcher, whitespace--update-bob-eob,
whitespace-color-off, whitespace-color-on,
whitespace-empty-at-bob-regexp, whitespace-empty-at-eob-regexp,
whitespace-looking-back, whitespace-post-command-hook): Redo the
`empty' line highlighting logic to ensure that a buffer change causes
all affected `empty' lines to become (un)highlighted (bug#37467).
Also, for improved UX, don't highlight BoB empty lines at or below
point (not just when point is at 1), or EoB empty lines at or above
point (not just when point is `eobp').
(whitespace-bob-marker, whitespace-eob-marker): Clarify documentation.
* test/lisp/whitespace-tests.el (whitespace--with-test-buffer,
whitespace--fu, whitespace-tests--empty-bob,
whitespace-tests--empty-eob): Add tests.
2022-09-11 13:46:30 +02:00
Richard Hansen
10573e0db7 ert-x: New `ert-with-test-buffer-selected' convenience macro
* lisp/emacs-lisp/ert-x.el (ert-with-test-buffer-selected): New
convenience macro that extends `ert-with-test-buffer' by displaying
the test buffer in a temporary selected window.  This makes it easier
to simulate user input in the body via `execute-kbd-macro'.
* test/lisp/emacs-lisp/ert-x-tests.el
(ert-test-test-buffer-selected/*): Add tests.
2022-09-11 13:46:30 +02:00
Stefan Kangas
6cd9e586cc New function substitute-quotes
* lisp/help.el (substitute-quotes): New function.  (Bug#51040)
* doc/lispref/help.texi (Keys in Documentation): Document
substitute-quotes.
* test/lisp/help-tests.el (help-tests-substitute-quotes): New test.

* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-theme.el (describe-theme-1):
* lisp/emacs-lisp/cl-extra.el (cl--describe-class):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/package.el (describe-package-1):
* lisp/help-fns.el (help-fns--parent-mode, help-fns--var-risky)
(help-fns--var-file-local, help-fns--var-bufferlocal)
(describe-face):
* lisp/help.el (substitute-command-keys):
* lisp/progmodes/octave.el (octave-help): Use the new function
instead of 'substitute-command-keys'.
2022-09-10 07:37:36 +02:00
Lars Ingebrigtsen
06e4d9cb96 Fix "warn-lambda-malformed-interactive-spec.el" even more
* test/lisp/emacs-lisp/bytecomp-tests.el
("warn-lambda-malformed-interactive-spec.el"): Adjust test further.
2022-09-09 19:43:28 +02:00
Lars Ingebrigtsen
04a6fd378f Don't bind `s' in the normal backtrace map
* lisp/emacs-lisp/backtrace.el (backtrace-mode-map): Don't bind
the "s" command, because it's meaningless outside modes that have
set the backtrace-goto-source-functions variable (and only edebug
does that) (bug#57674).
* lisp/emacs-lisp/edebug.el (edebug-pop-to-backtrace): Use it.
(edebug-backtrace-mode-map, edebug-backtrace-mode): New mode.
2022-09-09 19:29:21 +02:00
Lars Ingebrigtsen
4cc78bcfd1 Update a bytecomp test
* test/lisp/emacs-lisp/bytecomp-tests.el
("warn-lambda-malformed-interactive-spec.el"): Update test to code
change.
2022-09-09 19:18:02 +02:00
Michael Albinus
08cc6c4d9e Make use of rx in Tramp backward compatoble
* lisp/net/tramp-compat.el (tramp-compat-rx--runtime-params): New defvar.
(tramp-compat-rx--transform-items)
(tramp-compat-rx--transform-item, tramp-compat-rx--transform):
New defuns.  Suggested by Mattias Engdegård <mattiase@acm.org>.
(tramp-compat-rx): New defalias or defmacro.
(tramp-compat-string-replace, tramp-compat-string-search):
Use regexp-quote.

* lisp/net/tramp.el:
* lisp/net/tramp-adb.el:
* lisp/net/tramp-archive.el:
* lisp/net/tramp-cmds.el:
* lisp/net/tramp-crypt.el:
* lisp/net/tramp-fuse.el:
* lisp/net/tramp-gvfs.el:
* lisp/net/tramp-sh.el:
* lisp/net/tramp-smb.el:
* lisp/net/tramp-sudoedit.el: Use `tramp-compat-rx' where indicated.

* test/lisp/net/tramp-archive-tests.el:
* test/lisp/net/tramp-tests.el: Use `tramp-compat-rx' where indicated.
2022-09-09 17:10:28 +02:00
Stefan Kangas
72c64dd73c Fix SVG loading test for old librsvg 2.40.1
* test/manual/image-tests.el (image-tests-load-image/svg-invalid): Fix
test for old librsvg 2.40.1.  (Bug#57691)
2022-09-09 14:24:51 +02:00
Stefan Kangas
0ad028c91f ; Clean up recently added SVG test
* test/manual/image-tests.el (image-tests-load-image/svg-invalid):
Clean up.
2022-09-09 14:20:29 +02:00
Stefan Kangas
816106b7e6 Display librsvg error when loading bad SVG
* src/image.c (svg_load_image): Display the error message from librsvg
when parsing a bad SVG image file.
* test/manual/image-tests.el
(image-tests-load-image/svg-invalid): New test.
2022-09-09 03:07:44 +02:00
Jim Porter
ef17ba8370 ; Fix a race condition in an Eshell test
* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/sigpipe-exits-process): Use "|&" when creating the
pipeline to prevent an extra pipe process from being started.
2022-09-08 15:13:17 -07:00
Stefan Monnier
112cb75141 test: Remove redundant "" arg to mapconcat
* test/src/process-tests.el (process-test-stderr-filter):
* test/src/print-tests.el (print-tests-continuous-numbering):
* test/src/fns-tests.el (fns-tests-mapconcat):
* test/src/data-tests.el (test-bool-vector-to-hex-string):
* test/src/casefiddle-tests.el (casefiddle-tests-char-properties)
(casefiddle-tests-case-table, casefiddle-tests-casing-character):
* test/lisp/tabify-tests.el (tabify-tests--test-changes):
* test/lisp/subr-tests.el (subr-tests-bug22027):
* test/lisp/sort-tests.el (sort-tests-random-word):
* test/lisp/net/hmac-md5-tests.el (hmac-md5-test-encode-string):
* test/lisp/md4-tests.el (md4-tests-digest->hex):
* test/lisp/emacs-lisp/cl-extra-tests.el (cl-extra-test-map):
* test/lisp/dired-tests.el (dired-test-directory-files):
* test/lisp/char-fold-tests.el (char-fold--random-word):
* test/lisp/ansi-color-tests.el (ansi-color-incomplete-sequences-test):
Remove redundant "" arg to `mapconcat`.
2022-09-08 16:08:42 -04:00
Michael Albinus
684950eb94 Make call of remote `id' more performant in Tramp
* lisp/net/tramp-adb.el (tramp-adb-handle-file-exists-p): New defun.
(tramp-adb-file-name-handler-alist): Use it.
(tramp-adb-handle-file-executable-p)
(tramp-adb-handle-file-readable-p)
(tramp-adb-handle-file-writable-p)
(tramp-adb-handle-get-remote-uid)
(tramp-adb-handle-get-remote-gid)
(tramp-adb-handle-get-remote-groups): Use caches consequently.

* lisp/net/tramp-sh.el (tramp-perl-id, tramp-python-id): New defconsts.
(tramp-sh-handle-get-remote-uid, tramp-sh-handle-get-remote-gid)
(tramp-sh-handle-get-remote-groups): Use caches consequently.
(tramp-sh-handle-file-writable-p): Use `file-writable-p'.
(tramp-expand-script): Handle also "python" expansion.
(tramp-get-remote-id): Do not set connection property anymore,
this is done differently now.
(tramp-get-remote-uid-with-id, tramp-get-remote-uid-with-perl)
(tramp-get-remote-uid-with-python, tramp-get-remote-gid-with-id)
(tramp-get-remote-gid-with-perl)
(tramp-get-remote-gid-with-python): Remove.

* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-file-executable-p)
(tramp-sudoedit-handle-file-exists-p)
(tramp-sudoedit-handle-file-readable-p)
(tramp-sudoedit-handle-file-writable-p):
(tramp-sudoedit-handle-get-remote-uid)
(tramp-sudoedit-handle-get-remote-gid)
(tramp-sudoedit-handle-get-remote-groups): Use caches consequently.

* lisp/net/tramp.el (tramp-check-cached-permissions):
Call `tramp-get-remote-groups' only if needed.
(tramp-get-remote-groups): Do not return default value.
(tramp-read-id-output): New defun.

* test/lisp/net/tramp-tests.el (tramp--test-deftest-with-perl):
Suppress also remote `id'.
2022-09-08 10:36:08 +02:00
Stefan Kangas
5b87429d99 Move some tests to test/manual/image-tests.el
* test/src/image-tests.el: Move several tests from here...
* test/manual/image-tests.el: ...to here.
Suggested by Eli Zaretskii <eliz@gnu.org>.
2022-09-08 02:35:37 +02:00
Stefan Kangas
5308a4e11e Improve image-tests.el Commentary
* test/src/image-tests.el: Doc fix; explain how to run from
command line.
2022-09-07 03:22:48 +02:00
Stefan Kangas
015fb4ac1c Add tests for opening different image formats
* test/src/image-tests.el
(image-tests-make-load-image-test): New macro.
(image-tests-load-image/gif)
(image-tests-load-image/jpeg)
(image-tests-load-image/pbm)
(image-tests-load-image/png)
(image-tests-load-image/svg)
(image-tests-load-image/tiff)
(image-tests-load-image/webp)
(image-tests-load-image/xbm)
(image-tests-load-image/xpm): New tests.
2022-09-06 13:13:15 +02:00
Stefan Kangas
2d29ee5dde Fix interactive image.c tests
* test/src/image-tests.el (image-tests-image-metadata/gif)
(image-tests-image-metadata/webp): Fix tests.
2022-09-06 12:57:25 +02:00
Laurence Warne
969983ea1f Apply syntax highlighting for all python f-strings
* lisp/progmodes/python.el (python--f-string-p)
(python--font-lock-f-strings): Edit functions to use a regular
expression matching all f-strings (bug#56757).
2022-09-06 12:54:42 +02:00
Michael Albinus
106456d01b Use secondary groups when checking permissions in Tramp (Bug#57044)
* lisp/net/tramp.el (tramp-check-cached-permissions): Check also for
secondary groups.  (Bug#57044)
(tramp-get-remote-groups):
* lisp/net/tramp-adb.el (tramp-adb-handle-get-remote-groups):
* lisp/net/tramp-sh.el (tramp-sh-handle-get-remote-groups):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-get-remote-groups):
New defuns.

* lisp/net/tramp.el (tramp-file-name-for-operation):
* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist):
* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
* lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist):
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
* lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
Add `tramp-get-remote-groups'.

* lisp/net/tramp.el:
* lisp/net/tramp-adb.el:
* lisp/net/tramp-cache.el:
* lisp/net/tramp-crypt.el:
* lisp/net/tramp-fuse.el:
* lisp/net/tramp-gvfs.el:
* lisp/net/tramp-integration.el:
* lisp/net/tramp-rclone.el:
* lisp/net/tramp-sh.el:
* lisp/net/tramp-smb.el:
* lisp/net/tramp-sudoedit.el: Use `blank' in `rx' forms.

* test/lisp/net/tramp-archive-tests.el:
* test/lisp/net/tramp-tests.el: Use `blank' in `rx' forms.
2022-09-06 12:33:19 +02:00
Stefan Monnier
2a78f06ef4 cl-symbol-macrolet: Fix recent regression
The recent fix for bug#57397 introduced a regression, breaking
the `cl-lib-symbol-macrolet-hide` test.  It turned out that the
origin of the problem was that `gv.el` uses `macroexpand-1` which
does not (can't) use `macroexpand` but `cl-symbol-macrolet` failed
to advise `macroexpand-1` the way it advised `macroexpand`.

To fix this, we change `cl-symbol-macrolet` so it advises both, and we
do that with a new `macroexpand` advice which delegates the bulk of
the work to `macroexpand-1`.

Along the way, I bumped into another bug in the interaction between
`cl-letf` and `cl-symbol-macrolet`, which I tried to fix in `cl-letf`.

I hear the war on `cl-symbol-macrolet` was a failure.
Maybe ... just say no?

* lisp/emacs-lisp/cl-macs.el (cl--sm-macroexpand-1): New function,
extracted from `cl--sm-macroexpand`.
(cl--sm-macroexpand): Rewrite completely.
(cl-symbol-macrolet): Advise both `macroexpand` and `macroexpand-1`.
(cl--letf): Don't use the "simple variable" code for symbol macros.

* test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-symbol-macrolet-hide):
Revert last change because the test was right.

* test/lisp/emacs-lisp/cl-macs-tests.el
(cl-macs-test--symbol-macrolet): Add a test case.
2022-09-06 00:08:35 -04:00
Lars Ingebrigtsen
361d3dbc4e Disable failing cl-lib-symbol-macrolet-hide test for now
* test/lisp/emacs-lisp/cl-lib-tests.el
(cl-lib-symbol-macrolet-hide): Disable until code is fixed.
2022-09-06 00:06:34 +02:00
Jim Porter
f07505d1ec Let external Eshell processes send stdout and stderr to different places
* lisp/eshell/esh-proc.el (eshell-put-process-properties): Pass INDEX.
(eshell-gather-process-output): Create a pipe process for stderr when
stderr goes somewhere different than stdout.
(eshell-insertion-filter, eshell-sentinel): Consult
':eshell-handle-index' property.

* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/output/stdout-to-buffer)
(esh-proc-test/output/stderr-to-buffer)
(esh-proc-test/exit-status/with-stderr-pipe): New tests (bug#21605).
2022-09-04 15:15:01 -07:00
Jim Porter
a87c7aff55 Put Eshell's bookkeeping data for external processes on the process object
This allows tracking this information for process objects not recorded
in 'eshell-process-list', which will be useful for pipe processes for
stderr output.

* lisp/eshell/esh-proc.el (eshell-process-list): Add docstring.
(eshell-record-process-object): Only record the process object and
whether it's a subjob.
(eshell-remove-process-entry): Adapt to changes in
'eshell-record-process-object'.
(eshell-record-process-properties): New function...
(eshell-gather-process-output): ... call it.
(eshell-insertion-filter, eshell-sentinel): Use new process
properties, don't require process to be in 'eshell-process-list'.

* test/lisp/eshell/esh-proc-tests.el (esh-proc-test--output-cmd): New
variable.
(esh-proc-test--detect-pty-cmd): Add docstring.
(esh-proc-test/output/to-screen)
(esh-proc-test/output/stdout-and-stderr-to-buffer)
(esh-proc-test/exit-status/success, esh-proc-test/exit-status/failure)
(esh-proc-test/kill-process/foreground-only): New tests.
(esh-proc-test/kill-background-process): Rename to...
(esh-proc-test/kill-process/background-prompt): ... this, and use
'eshell-wait-for-subprocess' instead of 'sit-for'.
2022-09-04 15:15:01 -07:00
Jim Porter
ab7e94fb1d Add support for more kinds of redirect operators in Eshell
* lisp/eshell/esh-arg.el: Require cl-lib.
(eshell-finish-arg): Allow passing multiple ARGUMENTS.
(eshell-quote-argument): Handle the case when 'eshell-finish-arg' was
passed multiple arguments.

* lisp/eshell/esh-cmd.el (eshell-do-pipelines)
(eshell-do-pipelines-synchronously): Only set stdout output handle.

* lisp/eshell/esh-io.el (eshell-redirection-operators-alist): New
constant.
(eshell-io-initialize): Prefer sharp quotes for functions.
(eshell-parse-redirection, eshell-strip-redirections): Add support for
more redirection forms.
(eshell-copy-output-handle, eshell-set-all-output-handles): New
functions.

* test/lisp/eshell/esh-io-tests.el
(esh-io-test/redirect-all/overwrite, esh-io-test/redirect-all/append)
(esh-io-test/redirect-all/insert, esh-io-test/redirect-copy)
(esh-io-test/redirect-copy-first, esh-io-test/redirect-pipe): New
tests.

* doc/misc/eshell.texi (Redirection): Document new redirection syntax.
(Pipelines): Document '|&' syntax.
(Bugs and ideas): Update item about redirection syntax.

* etc/NEWS: Announce this change.
2022-09-04 15:15:01 -07:00
Jim Porter
1be925faa1 Simplify Eshell handle functions and add tests/documentation
* lisp/eshell/esh-arg.el (eshell-parse-argument-hook): Explain how to
use 'eshell-finish-arg'.

* lisp/eshell/esh-io.el (eshell-create-handles): Only call
'eshell-get-target' for stderr if necessary.
(eshell-protect-handles): Use 'dotimes'.
(eshell-set-output-handle): Pass HANDLES and fix an edge case with
setting a duplicate TARGET.

* test/lisp/eshell/eshell-tests-helpers.el (eshell-with-temp-buffer):
New macro.

* test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/quoted-lisp-form)
(esh-cmd-test/backquoted-lisp-form)
(esh-cmd-test/backquoted-lisp-form/splice): New tests.

* test/lisp/eshell/eshell-tests.el (eshell-test/redirect-buffer)
(eshell-test/redirect-buffer-escaped): Move to...
* test/lisp/eshell/esh-io-tests.el: ... here, and add other I/O tests.

* doc/misc/eshell.texi (Arguments): Add documentation for special
argument types.
(Input/Output): Expand documentation for redirection and pipelines.
2022-09-04 15:15:01 -07:00
Matt Armstrong
5af5ed6c62 Add basic test coverage for overlay modification hooks
* test/src/buffer-tests.el: (overlay-modification-hooks) new
ert-deftest.
(overlay-tests-start-recording-modification-hooks): New function.
(overlay-tests-get-recorded-modification-hooks): New function
(bug#57150).
2022-09-04 23:58:55 +02:00
Lars Ingebrigtsen
1dad2cba15 Mark some filenotify tests unstable on EMBA
* test/lisp/filenotify-tests.el (file-notify-test03-events)
(file-notify-test09-watched-file-in-watched-dir): Mark as unstable
on EMBA, because they seem to fail regularly.
2022-09-04 20:44:30 +02:00
Michael Albinus
f1635c8efb Fix rx forms in Tramp
* lisp/net/tramp.el (tramp-restricted-shell-hosts-alist)
(tramp-local-host-regexp, tramp-echoed-echo-mark-regexp)
(tramp-login-prompt-regexp, tramp-terminal-prompt-regexp)
(tramp-antispoof-regexp)
(tramp-build-completion-file-name-regexp)
(tramp-debug-outline-regexp)
(tramp-use-absolute-autoload-file-names)
(tramp-lock-file-info-regexp, tramp-shell-quote-argument):
* lisp/net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls)
* lisp/net/tramp-cache.el (tramp-flush-file-function):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name):
* lisp/net/tramp-integration.el (tramp-rfn-eshadow-update-overlay-regexp)
(info-lookup-maybe-add-help):
* lisp/net/tramp-sh.el (tramp-default-user-alist, tramp-sunos-unames)
(tramp-scp-direct-remote-copying, tramp-get-remote-locale):
* lisp/net/tramp-smb.el (tramp-smb-prompt, tramp-smb-wrong-passwd-regexp)
(tramp-smb-errors, tramp-smb-get-localname)
(tramp-smb-read-file-entry): Simplify rx forms.

* lisp/net/tramp.el (tramp-handle-find-backup-file-name)
(tramp-handle-lock-file, tramp-handle-make-auto-save-file-name):
* lisp/net/tramp-adb.el (tramp-adb-handle-set-file-times)
(tramp-adb-maybe-open-connection):
* lisp/net/tramp-gvfs.el
(tramp-gvfs-file-attributes-with-gvfs-ls-regexp):
* lisp/net/tramp-sh.el (tramp-open-shell, tramp-find-shell): Do not use
`eval-when-compile'.

* lisp/net/tramp-cmds.el (tramp-rename-files, tramp-rename-these-files):
Use rx.

* lisp/net/tramp-gvfs.el (tramp-gvfs-password-tcrypt): New defonst.
(tramp-gvfs-handle-file-attributes): Use `number-to-string'.

* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test17-insert-directory):
* test/lisp/net/tramp-tests.el (tramp-test17-insert-directory)
(tramp--test-share-p): Simplify rx forms.
2022-09-04 13:44:30 +02:00
Damien Cassou
4751b51d5e Add new function `seq-positions'
* doc/lispref/sequences.texi (Sequence Functions): Document it.

* lisp/emacs-lisp/seq.el (seq-positions): New function.

* lisp/emacs-lisp/shortdoc.el (sequence): Mention it.

* test/lisp/emacs-lisp/seq-tests.el (test-seq-positions): Test it
(bug#57548).
2022-09-04 13:21:59 +02:00
Damien Cassou
2db8b0e12f Add new function `seq-remove-at-position'
* doc/lispref/sequences.texi (Sequence Functions): Document it.

* lisp/emacs-lisp/seq.el (seq-remove-at-position): New function.

* lisp/emacs-lisp/shortdoc.el (sequence): Mention it.

* test/lisp/emacs-lisp/seq-tests.el (test-seq-remove-at-position):
Test it.
2022-09-04 13:07:18 +02:00
Stefan Monnier
2dd1c2ab19 gv.el and cl-macs.el: Fix bug#57397
* lisp/emacs-lisp/gv.el (gv-get): Obey symbol macros.
* lisp/emacs-lisp/cl-macs.el (cl--letf): Remove workaround placed to
try and handle symbol macros.

* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-test--symbol-macrolet):
Add new testcase.
2022-09-03 22:38:28 -04:00
Stefan Kangas
0504f39259 Split image-dired.el into several files (part 1/2)
Use a git trick to split a file while preserving line history (for
"git blame", "git log --follow", etc.):

1) Make exact copies of the original file, in the same commit as
   moving it.  [this commit]

2) Next, trim down the extra copies to contain only the relevant
   parts.

* lisp/image-dired.el: Move from here...
* lisp/image/image-dired-dired.el:
* lisp/image/image-dired-external.el:
* lisp/image/image-dired-tags.el:
* lisp/image/image-dired-util.el:
* lisp/image/image-dired.el: ...to here.

* test/lisp/image-dired-tests.el: Move from here...
* test/lisp/image/image-dired-tests.el: ...to here.
2022-09-03 10:23:37 +02:00
Felix Dietrich
81f8bb7ae5 Add tests for ‘mailcap-add-mailcap-entry’
* test/lisp/net/mailcap-tests.el:
Add tests for ‘mailcap-add-mailcap-entry’
2022-09-02 12:09:59 +02:00
Jim Porter
612ff133b7 Don't fail Eshell ERT tests when an internal signal gets raised
* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/pipeline-connection-type/middle)
(esh-proc-test/pipeline-connection-type/last): Set 'debug-on-error' to
nil.

Ref: https://lists.gnu.org/archive/html/emacs-devel/2022-08/msg01452.html
2022-08-31 13:47:58 -07:00
Mattias Engdegård
e1e60e51bf Accept bignum arguments in take and ntake
* src/fns.c (Ftake, Fntake): Accept any integer as first argument, for
completeness.
* test/src/fns-tests.el (fns--take-ntake): Add test cases.
2022-08-30 16:48:25 +02:00
Jim Porter
f9250c5ebc Handle 'eshell-pipe-broken' when evaluating Lisp forms in Eshell
* lisp/eshell/esh-cmd.el (eshell-exec-lisp): Handle
'eshell-pipe-broken'.

* lisp/eshell/esh-io.el (eshell-output-object-to-target): Only signal
'eshell-pipe-broken' if the process being written to has finished.

* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/pipeline-connection-type/middle)
(esh-proc-test/pipeline-connection-type/last): Remove ':unstable'.

Ref: https://lists.gnu.org/archive/html/emacs-devel/2022-08/msg00524.html
2022-08-29 20:16:31 -07:00
Ken Brown
3edee9a6a3 Fix data for files-tests-bug-21454 on Cygwin
* test/lisp/files-tests.el (files-tests-bug-21454): Fix test data
to reflect the fact that Cygwin supports UNC paths.
2022-08-28 11:43:50 -04:00
Michael Albinus
be2e6228f8 Use `rx' in Tramp where possible
* lisp/net/tramp.el:
* lisp/net/tramp-adb.el:
* lisp/net/tramp-archive.el:
* lisp/net/tramp-cache.el:
* lisp/net/tramp-cmds.el:
* lisp/net/tramp-compat.el:
* lisp/net/tramp-crypt.el:
* lisp/net/tramp-ftp.el:
* lisp/net/tramp-fuse.el:
* lisp/net/tramp-gvfs.el:
* lisp/net/tramp-integration.el:
* lisp/net/tramp-rclone.el:
* lisp/net/tramp-sh.el:
* lisp/net/tramp-smb.el:
* lisp/net/tramp-sudoedit.el: Use `rx' where possible.

* lisp/net/tramp-adb.el (tramp-adb-handle-set-file-times):
Use `eval-when-compile'.
(tramp-adb-maybe-open-connection): Use file-property for "/".  Use
`eval-when-compile'.

* lisp/net/tramp-cmds.el (mm-7bit-chars): Declare.
(tramp-reporter-dump-variable): Simplify point movement.

* lisp/net/tramp-gvfs.el (tramp-dbus-function): Fix typo.
(tramp-zeroconf-parse-device-names): Use `tramp-prefix-port-format'.

* lisp/net/tramp-sh.el (tramp-open-shell, tramp-find-shell):
Use `eval-when-compile'.  Improve sanity check.

* lisp/net/tramp.el (tramp-prefix-format, tramp-prefix-regexp)
(tramp-method-regexp, tramp-postfix-method-format)
(tramp-postfix-method-regexp, tramp-prefix-ipv6-format)
(tramp-prefix-ipv6-regexp, tramp-postfix-ipv6-format)
(tramp-postfix-ipv6-regexp, tramp-postfix-host-format)
(tramp-postfix-host-regexp, tramp-remote-file-name-spec-regexp)
(tramp-file-name-structure, tramp-file-name-regexp)
(tramp-completion-method-regexp)
(tramp-completion-file-name-regexp): Declare.
(tramp-set-syntax): Set also `tramp-completion-method-regexp'.
(tramp-volume-letter-regexp, tramp-completion-method-regexp-alist):
New defconsts.
(tramp-build-completion-method-regexp): New defun.
(tramp-completion-method-regexp): New defvar.
(tramp-completion-file-name-regexp-default)
(tramp-completion-file-name-regexp-simplified)
(tramp-completion-file-name-regexp-separate)
(tramp-completion-file-name-regexp-alist): Remove.
(tramp-build-completion-file-name-regexp): Rwrite.
(tramp-make-tramp-file-name): Use `tramp-archive-method'.
(tramp-handle-file-directory-p): Ignore errors.
(tramp-handle-find-backup-file-name, tramp-handle-lock-file)
(tramp-handle-make-auto-save-file-name): Use `eval-when-compile'.

* test/lisp/net/tramp-archive-tests.el:
* test/lisp/net/tramp-tests.el: Use `rx' where possible.
(tramp-test01-file-name-syntax): Adapt test.
2022-08-26 16:19:47 +02:00
Basil L. Contovounesios
0f561d0e5c Pacify obsolete gv warnings in xt-mouse-tests.el
* test/lisp/xt-mouse-tests.el (with-xterm-mouse-mode): Replace
deprecated generalized variables frame-width and frame-height with
direct calls to set-frame-width and set-frame-height, respectively.
2022-08-26 12:53:49 +03:00
Daniel Martín
dbec115948 Fix instrumented eval-defun not printing "Edebug:" to the echo area
* lisp/progmodes/elisp-mode.el (elisp--eval-defun): Determine if we're
instrumenting a function and call eval-region with PRINTFLAG set to
nil if so (Bug#50245).

* test/lisp/progmodes/elisp-mode-tests.el
(eval-defun-prints-edebug-when-instrumented): Add a new test.
2022-08-25 14:37:36 +02:00
Lars Ingebrigtsen
b947f80a62 Add hideshow-test.el file (bug#56635) 2022-08-25 14:29:43 +02:00
kobarity
7c7fc8fa5b Add Python blocks support for hideshow
* lisp/progmodes/python.el (python-nav-beginning-of-block-regexp):
New variable.
(python-hideshow-forward-sexp-function): Change to call
`python-nav-end-of-block'.
(python-hideshow-find-next-block): New function to be used as
FIND-NEXT-BLOCK-FUNC in `hs-special-modes-alist'.
(python-info-looking-at-beginning-of-block): New function to be
used as LOOKING-AT-BLOCK-START-P-FUNC in `hs-special-modes-alist'.
(python-mode): Change settings of `hs-special-modes-alist'.

* test/lisp/progmodes/python-tests.el
(python-hideshow-hide-levels-1): Fix to keep empty lines.
(python-info-looking-at-beginning-of-block-1)
(python-hideshow-hide-levels-3, python-hideshow-hide-levels-4)
(python-hideshow-hide-all-1, python-hideshow-hide-all-2)
(python-hideshow-hide-all-3, python-hideshow-hide-block-1): New
tests (bug#56635).
2022-08-25 14:29:10 +02:00
Michael Albinus
c5c3f57bd4 Minor fixes in tramp-tests.el
* test/lisp/net/tramp-tests.el (tramp--test-deftest-with-stat)
(tramp--test-deftest-with-perl)
(tramp--test-deftest-with-ls): Skip if underlying test didn't run
or lasted too long.
(tramp--test-shell-file-name): Do not depend on `tramp--test-adb-p'.
2022-08-25 11:08:48 +02:00
Eli Zaretskii
95b1eacd47 Fix handling of UNCs in 'parse-colon-path
* lisp/files.el (parse-colon-path): Don't remove the second
leading slash on systems that support UNCs.  (Bug#57353)

* test/lisp/files-tests.el (files-tests-bug-21454): Update
expected results.
(files-colon-path): Add a new test pattern.
2022-08-24 19:19:33 +03:00
Lars Ingebrigtsen
b448fbec4b Disable a lisp-mode test that now fails
* test/lisp/emacs-lisp/lisp-mode-tests.el
(test-lisp-current-defun-name): Comment-out now-failing tests.
2022-08-23 12:49:13 +02:00
Lars Ingebrigtsen
efd95300c7 Adjust autorevert tests to recent change
* test/lisp/autorevert-tests.el (auto-revert--wait-for-revert):
Adjust test to code change.
2022-08-21 22:18:49 +02:00