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

6437 Commits

Author SHA1 Message Date
Dmitry Gutov
fd403a5c5a Fix ruby-add-log-current-method after nested class definition
* lisp/progmodes/ruby-mode.el (ruby--add-log-current-indent):
New function.
(ruby-add-log-current-method): Use it.
Check for "class" and "module" indentation to filter out the
definitions which don't include the given position.  Also try to
match "def" only once (for performance), because if the closest
one doesn't include the given position, none will.

* test/lisp/progmodes/ruby-mode-tests.el
(ruby-add-log-current-method-after-inner-class-outside-methods)
(ruby-add-log-current-method-after-inner-class-outside-methods-with-text):
New tests.
2022-12-15 03:21:44 +02:00
F. Jason Park
102a3e3b44 Don't send erc-sasl-user as USER command argument
* lisp/erc/erc-sasl.el (erc-sasl--send-cap-ls): Add internal switch
for sending an opening "CAP LS".  The rationale for not enabling this
by default is twofold: one, it more strongly implies that ERC supports
IRCv3 client capability negotiation, which is somewhat disingenuous;
and, two, We'd still be "faking it" by firing and forgetting, and more
balls in the air makes things less predictable.
(erc--register-connection): Possibly send a "CAP LS" before anything
depending on the value of `erc-sasl--send-cap-ls'.  Also, don't
attempt to send `erc-session-username' when it holds an SASL username
because the latter may contain protocol-defying characters.
* test/lisp/erc/resources/base/local-modules/fourth.eld: change user
parameter of "USER" command to reflect nick when `erc-sasl-user' is
set to `:user'.  (Bug#59976.)
2022-12-14 06:40:55 -08:00
F. Jason Park
f0c9088878 Set erc-network to a "given" ID instead of failing
* lisp/erc/erc-networks.el (erc-networks--determine): Return the
so-called "given" ID from a non-nil `:id' keyword arg passed to `erc'
or `erc-tls'.
(erc-networks--allow-unknown-network): Add internal variable to
allow IRC session to continue despite the network being unknown.
(erc-networks--set-name): Tell the user about falling back to a given
ID when the network can't be determined.  When that's so, end the
session by destroying the connection unless
`erc-networks--allow-unknown-network' is enabled.  (Bug#59976.)
(erc-networks--ensure-announced): Include the fallback announced
server name in the error message.
* test/lisp/erc/erc-networks-tests.el (erc-networks--set-name): Add
dummy server process and don't expect an error to be signaled.
* test/lisp/erc/erc-scenarios-misc.el
(erc-scenarios-networks-announced-missing): Don't expect an error to
be signaled.
* test/lisp/erc/resources/networks/announced-missing/foonet.eld:
Remove "mode" match pattern.
2022-12-14 06:40:55 -08:00
F. Jason Park
09c0c6b2ba Limit casemapping to appropriate ranges in ERC
* lisp/erc/erc-common.el (erc-downcase): Use case table for
`erc-downcase' so that case conversions are limited to the ASCII
interval.
* lisp/erc/erc.el (erc-casemapping--rfc1459-strict,
erc--casemapping-rfc1459): Make these case tables instead of
translation tables.  The functions in case-table.el modify the
standard syntax table, but that doesn't seem to make sense here,
right?
* test/lisp/erc/erc-tests.el (erc-downcase): Add cases showing
mappings outside of the ASCII range.  (Bug#59976.)
2022-12-14 06:40:55 -08:00
F. Jason Park
44b04c0ac1 Actually accept non-symbols as IDs in erc-open
* lisp/erc/erc.el (erc-generate-new-buffer-name): Despite what it says
in the documentation, only symbols were being accepted as valid `:id'
entry-point arguments.  This uses the interned `princ' representation
of the argument instead.
* test/lisp/erc/erc-scenarios-base-netid-samenet.el
(erc-scenarios-common--base-network-id-same-network): Randomly specify
a string for the ID param instead of a non-nil symbol when opening a
new connection.
* test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common-assert-initial-buf-name): Adjust helper to allow
for non-symbol IDs.  (Bug#59976.)
2022-12-14 06:40:55 -08:00
F. Jason Park
0155fc67be Respect a nil erc-session-password when reconnecting
* lisp/erc/erc.el (erc-open): Simplify `old-vars' expression.
(erc--compute-server-password): Only compute a server password when
first connecting.  For compatibility, this respects third-party code
that expects session passwords in target buffers when initially
non-nil.
* test/lisp/erc/erc-scenarios-services-misc.el
(erc-scenarios-services-auth-source-reconnect): Add new test.
* test/lisp/erc/resources/services/auth-source/recon.eld: Add new test
data file.  (Bug#59858.)
2022-12-14 06:40:55 -08:00
Michael Albinus
be165f7533 Fix Tramp tests in eglot-tests, prefix tests uniquely
* test/lisp/progmodes/eglot-tests.el (eglot--call-with-fixture):
Use `make-nearby-temp-file'.
(eglot--call-with-tramp-test): Set `tramp-verbose' and
`default-directory'.  The latter is needed for `make-nearby-temp-file'.
(eglot-test-tramp-test, eglot-test-tramp-test-2): Tag them as
:expensive-test.
(all): Prefix all tests with `eglot-test-' uniquely.
2022-12-14 10:52:04 +01:00
Stefan Kangas
3efe4df1d2 Delete temp files after icalendar tests
* test/lisp/calendar/icalendar-tests.el
(icalendar-tests--get-error-string-for-export): Make sure we clean up
temporary files after test.
2022-12-14 08:21:34 +01:00
Michael Albinus
ba4bdd6a25 Adapt Tramp specific tests in eglot-tests.el
* test/lisp/progmodes/eglot-tests.el (tramp): Move up.
(tramp-sh): Don't require.
(eglot--cleanup-after-test): Delete Tramp buffers if needed.
(eglot-tests-lsp-abiding-column): Rename from `eglot-lsp-abiding-column'.
(tramp-histfile-override): Declare.
(eglot--call-with-tramp-test):
Use `ert-remote-temporary-file-directory'.  Skip if needed.
(eglot--tramp-test, eglot--tramp-test-2): Don't skip.
2022-12-13 20:06:48 +01:00
Stefan Kangas
def51dd645 ; Fix typos 2022-12-13 18:44:41 +01:00
Yuan Fu
03ad1a92a2
Add improved tree-sitter navigation
This new set of functions (and tests) should eliminate
defun-navigation bugs and limitations we currently have.  This commit
doesn't change any existing bahavior: treesit-beginning/end-of-defun
and friends are unchanged.  The plan is to later switch gear and
replace the current functions with the new ones introduced in this
change.

This is a relatively big change, but I've setup a comprehensive test,
and it should fix current bugs, so I think it's ok to put it on the
release branch.

The gist of the new navigation is to use treesit--defuns-around to
find the previous sibling defun, next sibling defun, and the parent
defun, then use this information to move to previous/next
beginning/end of defun in treesit--navigate-defun.

I also added comprehensive testing that tests all four possible
operations (prev-beg, next-beg, prev-end, next-end) starting at all
possible positions (between two sibling defuns, inside a sibling
defun, etc).

* lisp/treesit.el (treesit-defun-type-regexp): Expand definition to
allow (REGEXP . FILTER).  Old functions don't support this, but it
should be fine since we are soon replacing them.

(treesit-defun-tactic)
(treesit-defun-skipper): New variables.

(treesit-default-defun-skipper)
(treesit--defuns-around)
(treesit--top-level-defun)
(treesit--navigate-defun): New functions.

* test/src/treesit-tests.el (treesit--ert-insert-and-parse-marker)
(treesit--ert-collect-positions)
(treesit--ert-test-defun-navigation): New helper functions.

(treesit--ert-defun-navigation-python-program)
(treesit--ert-defun-navigation-js-program)
(treesit--ert-defun-navigation-bash-program)
(treesit--ert-defun-navigation-nested-master): New variables.

(treesit-defun-navigation-nested-1)
(treesit-defun-navigation-nested-2)
(treesit-defun-navigation-nested-3)
(treesit-defun-navigation-top-level): New tests.
2022-12-12 21:17:40 -08:00
Yuan Fu
a5272e2a7c
; * test/src/treesit-tests.el: Add outline headers. 2022-12-12 21:12:21 -08:00
Stefan Kangas
5b178efd85 ; Adjust eglot test to recent autopep8/pycodestyle
* test/lisp/progmodes/eglot-tests.el (python-autopep-formatting):
Support more recent autopep8/pycodestyle.
2022-12-12 22:44:55 +01:00
Stefan Kangas
42d740fb2c ; Skip two eglot tests when typescript is missing
* test/lisp/progmodes/eglot-tests.el
(javascript-basic, project-wide-diagnostics-typescript): Skip tests
when the npm package "typescript" is not installed.
2022-12-12 17:54:18 +01:00
João Távora
081bf58300 Skip Eglot rust-analyzer tests if 'cargo' isn't available
* test/lisp/progmodes/eglot-tests.el
(project-wide-diagnostics-rust-analyzer)
(diagnostic-tags-unnecessary-code): Skip unless "cargo" is found.
2022-12-12 09:53:10 +00:00
João Távora
9c0d7bb73b Add automated tests for Eglot
Most of the tests require a specific LSP server to do their thing, and
skip themselves if this server isn't found.

This file is a modified/overhauled version of the original Eglot
automated tests that were developed in the old GitHub upstream.

* test/lisp/progmodes/eglot-tests.el: New file.
2022-12-11 23:21:40 +00:00
Mattias Engdegård
87475f4af2 Fix pcase rx patterns using rx-let bindings (bug#59814)
Reported by Daniel Pittman.

* lisp/emacs-lisp/rx.el (rx): Move binding of rx--local-definitions...
(rx--to-expr): ...here.
* test/lisp/emacs-lisp/rx-tests.el (rx-let-pcase): New test.
2022-12-11 16:49:06 +01:00
Jim Porter
1b7ece2095 ; Fix a failure when running server-tests via the command line
* test/lisp/server-tests.el
(server-tests/server-force-stop/keeps-frames): Delete every new frame
created during the test.  On some systems, 'delete-terminal' will
delete the frames for us, so this ensures that if there are no new
frames, nothing happens.

(cherry picked from commit 3785fe52e4)
2022-12-10 11:06:47 +01:00
Stefan Kangas
44c5f36149 ; Fix two byte-compiler warnings
* lisp/gnus/gnus-icalendar.el (gnus-icalendar--show-org-event):
* test/lisp/progmodes/project-tests.el (project/quoted-directory):
Fix warnings.
2022-12-10 10:48:28 +01:00
Yuan Fu
ebef8905b0
Make indirect buffers use tree-sitter parsers of their base buffer
Fix the problem described in bug#59693.

* src/treesit.c (treesit_record_change): Always use the base buffer.
(Ftreesit_parser_create): Always use the base buffer.  Also change the
for loop into FOR_EACH_TAIL (stylistic change).
(Ftreesit_parser_list): Always use the base buffer.

* doc/lispref/parsing.texi (Using Parser): Update manual.
* test/src/treesit-tests.el (treesit-indirect-buffer): New test.
2022-12-09 17:24:08 -08:00
Dmitry Gutov
d268ab1c5d Bring back the project--value-in-dir logic
Essentialy revert commit 2389158a31, restoring the changes
and fixing the conflicts.  Motivated by the problem brought up in
bug#59722 (behavior of project-find-files/regexp when switching
projects).  We should find other ways to improve performance.

* lisp/progmodes/project.el
(project--value-in-dir, project--vc-merge-submodules-p): Restore.
(project-try-vc, project-files, project--vc-list-files)
(project-ignores, project-buffers): Use.

* test/lisp/progmodes/project-tests.el
(project-vc-supports-project-in-different-dir): New test.

* test/lisp/progmodes/project-resources/.dir-locals.el:
* test/lisp/progmodes/project-resources/foo:
* test/lisp/progmodes/project-resources/etc: New files.
2022-12-09 18:19:36 +02:00
Andrea Corallo
fa36b5ddf5 Backport: Enable native speed 2 EMBA build and tests and disable speed 0
* test/infra/gitlab-ci.yml (build-native-comp-speed2): Uncomment.
	(build-native-comp-speed0): Comment.
	(test-native-comp-speed0): Remove.
	(test-native-comp-speed2): Add.

(cherry picked from commit 06bf218f69)
2022-12-09 16:10:08 +01:00
Michael Albinus
6a9e38f22c * test/infra/test-jobs.yml: Regenerate for the new use-package subdirectory. 2022-12-09 15:53:49 +01:00
F. Jason Park
dcf69a1da4 Respect some spaces in auth-source-pass--match-regexp
* lisp/auth-source-pass.el (auth-source-pass--match-regexp): Allow an
entry's host and user fields to contain spaces, just like other
backends do.
* lisp/erc/erc-compat.el
(erc-compat--29-auth-source-pass--retrieve-parsed): Change regexp to
allow spaces in host and user components of file names.
* test/lisp/auth-source-pass-tests.el (auth-source-pass-any-host):
Silence warning message re wildcards emitted by
`auth-source-pass-search'.
(auth-source-pass-extra-query-keywords--suffixed-user): Add spaces
to users and hosts of some example entries.  (Bug#58985.)
2022-12-09 06:35:36 -08:00
Stefan Kangas
2626704054 ; Normalize GPLv3 license statements in new files 2022-12-09 00:13:00 +01:00
Stefan Kangas
e950f5a663 Merge branch 'feature/use-package' into emacs-29 2022-12-08 18:01:30 +01:00
Stefan Kangas
4be96c9dcb Drop key-chord.el support from use-package
* lisp/use-package/bind-chord.el:
* lisp/use-package/use-package-chords.el:
* test/lisp/use-package/use-package-chords-tests.el: Delete files.
* doc/misc/use-package.texi (use-package-chords): Delete section.
Ref: https://lists.gnu.org/r/emacs-devel/2022-12/msg00052.html
2022-12-08 17:00:29 +01:00
Stefan Kangas
8fb2afe051 ; Fix typos 2022-12-08 07:17:47 +01:00
Jim Porter
a37df90276 Treat escaped newlines in Eshell as the empty string
This fixes a regression introduced during Emacs 29's development.

* lisp/eshell/esh-arg.el (eshell-parse-argument): Handle
'eshell-empty-token' as the result of an argument-parsing hook.
(eshell-parse-argument-hook): Document 'eshell-empty-token'.
(eshell-parse-backslash): Return 'eshell-empty-token' when
encountering an escaped newline.

* test/lisp/eshell/eshell-tests.el (eshell-test/escape-nonspecial)
(eshell-test/escape-nonspecial-unicode)
(eshell-test/escape-nonspecial-quoted)
(eshell-test/escape-special-quoted): Move from here...

* test/lisp/eshell/esh-arg-tests.el (esh-arg-test/escape/nonspecial)
(esh-arg-test/escape/nonspecial-unicode)
(esh-arg-test/escape-quoted/nonspecial)
(esh-arg-test/escape-quoted/special): ... to here.
(esh-arg-test/escape/special, esh-arg-test/escape/newline)
(esh-arg-test/escape-quoted/newline): New tests.

* doc/misc/eshell.texi (Arguments): Explain escaping logic in more
detail (bug#59622).
2022-12-07 21:39:07 -08:00
Yuan Fu
d31a253983
Improve parameter checking in tree-sitter functions
* src/treesit.c (treesit_check_position): Extract out new function.
(Ftreesit_node_first_child_for_pos)
(Ftreesit_node_descendant_for_range): Replace code with the new
function.
(Ftreesit_query_capture): Add missing check for node and parser.  Add
check for range for BEG and END.  Move treesit_initialize to the
beginning of the function.

* test/src/treesit-tests.el (treesit-node-api)
(treesit-query-api): Add tests for out-of-range error.
2022-12-07 12:01:37 -08:00
Eli Zaretskii
a669d5fae5 ; * test/lisp/comint-tests.el (w32-application-type): Fix typo. 2022-12-07 21:52:00 +02:00
Eli Zaretskii
f7262b8f81 Fix comint-tests on MS-Windows
* test/lisp/comint-tests.el (comint-tests/test-password-function):
On MS-Windows, call 'w32-native-executable-find' instead of
'executable-find', to find the native version of the 'cat'
program.
(w32-native-executable-p, w32-native-executable-find): New
functions.
2022-12-07 21:23:42 +02:00
Mattias Engdegård
d2411615e8 * test/src/sqlite-tests.el (sqlite-version): Declare. 2022-12-07 09:21:23 +01:00
Eli Zaretskii
70a2eb4a0b Fix 'add-display-text-property' when OBJECT is non-nil
* lisp/emacs-lisp/subr-x.el (add-display-text-property): Fix the
case where OBJECT is not nil.  (Bug#59857)

* test/lisp/emacs-lisp/subr-x-tests.el
(subr-x-test-add-display-text-property): Add test for this case.
2022-12-06 14:41:36 +02:00
Michael Albinus
d58d1dd48a Do not run slow tests on EMBA
* test/infra/gitlab-ci.yml (.filenotify-gio-template): Do not run
scheduled.
(build-native-comp-speed1, build-native-comp-speed2): Comment out.

* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-part1): Skip also on EMBA.
2022-12-06 12:36:15 +01:00
Mattias Engdegård
c5ba47c889 Speed up Unicode normalisation tests by a factor of 5
After this change, ucs-normalize-tests are still very slow but
somewhat less disastrously so (from 100 to 20 min on this machine).

* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--normalization-equal-p)
(ucs-normalize-tests--normalization-chareq-p)
(ucs-normalize-tests--rule1-holds-p)
(ucs-normalize-tests--rule2-holds-p)
(ucs-normalize-tests--part1-rule2):
Run only over the Unicode code space.
Hoist `with-current-buffer` to reduce overhead.
2022-12-03 20:47:41 +01:00
Juanma Barranquero
bd58dcedfb Fix and expand tests broken by commit 2772ebe366 of 2022-11-28
* test/lisp/emacs-lisp/comp-tests.el
(with-test-native-compile-prune-cache)
(test-native-compile-prune-cache)
(test-native-compile-prune-cache/delete-only-eln)
(test-native-compile-prune-cache/dont-delete-in-parent-of-cache):
Check that the last directory in `native-comp-eln-load-path' is
not affected by `native-compile-prune-cache'.
2022-12-03 12:23:02 +01:00
Stefan Kangas
01bfbd186a Fix use-package tests
* test/lisp/use-package/use-package-chords-tests.el:
* test/lisp/use-package/use-package-tests.el: Remove local
variables section.  Require 'ert' and fix copyright header.
2022-12-03 00:55:56 +01:00
Mattias Engdegård
1e36ad9458 ; server-tests: remove CI debugging 2022-12-02 18:26:50 +01:00
Mattias Engdegård
8413e95138 ; server-test CI debugging 2022-12-02 18:06:00 +01:00
Mattias Engdegård
4b3eb928fe Fix server-tests run noninteractively (bug#59742)
This may or may not fix the test run from CI.

* test/lisp/server-tests.el (server-tests/can-create-frames-p):
Don't attempt to create frames if TERM=dumb, which what we have
if run from M-x compile (for instance).
(server-tests/server-force-stop/keeps-frames): Delete created frame so
that it doesn't cause trouble for other tests.
2022-12-02 17:32:22 +01:00
Stefan Kangas
70ecdebc92 ; Fix typos (don't abbreviate "with" or "without") 2022-12-01 16:36:09 +01:00
Dmitry Gutov
61311d6862 ; Fix test failure on CI 2022-12-01 16:40:59 +02:00
kobarity
5d1a1019c6 Add highlighting Python operators (bug#59629)
* lisp/progmodes/python.el (python-rx): Remove "is" and
"not" from operator.
(python-font-lock-keywords-maximum-decoration): Add
highlighting operators.
* test/lisp/progmodes/python-tests.el
(python-font-lock-assignment-statement-1)
(python-font-lock-assignment-statement-2)
(python-font-lock-assignment-statement-3)
(python-font-lock-assignment-statement-4)
(python-font-lock-assignment-statement-5)
(python-font-lock-assignment-statement-6)
(python-font-lock-assignment-statement-7)
(python-font-lock-assignment-statement-8)
(python-font-lock-assignment-statement-9)
(python-font-lock-assignment-statement-10)
(python-font-lock-assignment-statement-11)
(python-font-lock-assignment-statement-12)
(python-font-lock-assignment-statement-13)
(python-font-lock-assignment-statement-14)
(python-font-lock-assignment-statement-15)
(python-font-lock-assignment-statement-16)
(python-font-lock-assignment-statement-17)
(python-font-lock-assignment-statement-18)
(python-font-lock-assignment-statement-multiline-1)
(python-font-lock-assignment-statement-multiline-2)
(python-font-lock-assignment-statement-multiline-3)
(python-font-lock-assignment-statement-multiline-4)
(python-font-lock-assignment-statement-multiline-5)
(python-font-lock-assignment-statement-multiline-6)
(python-font-lock-escape-sequence-multiline-string): Modify
expectations to include faces for operators.
(python-font-lock-operator-1, python-font-lock-operator-2): New tests.
2022-12-01 14:45:10 +02:00
Dmitry Gutov
785fa80159 New user option: project-vc-extra-root-markers
* lisp/progmodes/project.el: Commentary update.
(project-vc, project-vc-include-untracked, project-vc-name):
Update docstrings.  Rename 'VC project' to 'VC-aware project'.
(project-vc-extra-root-markers): New option (bug#41572).
(project-try-vc): Use it.  Construct a single regexp from all and
validate it using the MATCH argument of 'directory-files'.  Call
'locate-dominating-file' directly.
(project-ignores): Support VC-aware project instances with nil
value of VC backend.

* test/lisp/progmodes/project-tests.el (project-vc-recognizes-git)
(project-vc-extra-root-markers-supports-wildcards)
New tests.
(project-tests--this-file): New variable.
2022-12-01 04:09:14 +02:00
Mattias Engdegård
33a244097c Skip one python test case on macOS
* test/lisp/progmodes/python-tests.el (python-ffap-module-path-1):
This test fails with a standard macOS Python installation;
see bug#59477 and bug#25753.

(cherry picked from commit db042b7591)
2022-11-30 13:22:09 +01:00
Stefan Kangas
4a1e9d61b5 ; Merge from https://github.com/jwiegley/use-package 2022-11-30 02:38:56 +01:00
F. Jason Park
00de296d1b Simplify erc-sasl's auth-source API
* doc/misc/erc.texi: Revise descriptions in SASL chapter to reflect
simplified auth-source options.

* lisp/erc/erc-sasl.el (erc-sasl-password,
erc-sasl-auth-source-function): Revise doc strings.
(erc-sasl-auth-source-password-as-host): New function to serve as
more useful choice for option `erc-sasl-auth-source-function'.
(erc-sasl--read-password): Promote auth-source to pole position, above
an explicit string and `:password'.

* test/lisp/erc/erc-sasl-tests.el (erc-sasl--read-password--basic):
Massage tests to conform to simplified `erc-sasl-password'
API.  (Bug#29108.)
2022-11-29 00:01:13 -05:00
F. Jason Park
35e2b8a26b Add erc-sasl-auth-source-function to cached options
* lisp/erc/erc-sasl.el (erc-sasl--read-password): Consult cached
options instead of `erc-sasl-auth-source-function'.
(erc-sasl--init): Add `erc-sasl-auth-source-function' to
`erc-sasl--options'.

* test/lisp/erc/erc-sasl-tests.el (erc-sasl--read-password--basic,
erc-sasl--read-password--auth-source): Look for original value of
`erc-sasl-auth-source-function' in `erc-sasl--options' under the
`authfn' key.
2022-11-28 23:56:04 -05:00
Eli Zaretskii
89a10ffcc4 Fix the new ctags test
* test/manual/etags/Makefile (ctags_update): Sort CTAGS* files
before comparing.  Patch by lu4nx <lx@shellcodes.org>.  (Bug#59544)

* .gitignore: Ignore CTAGS*.sorted files.
2022-11-27 20:01:50 +02:00
Michael Albinus
1cbf2655db Extend memory-info for remote systems
* doc/lispref/files.texi (Magic File Names): Add memory-info.

* doc/lispref/internals.texi (Garbage Collection): memory-info can
also retrieve values from remote systems.

* etc/NEWS: Document changes in memory-info.  Fix typos.

* lisp/files.el (warn-maybe-out-of-memory): Ensure local memory info.

* lisp/net/tramp.el (tramp-handle-memory-info): New defun.
(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 'memory-info'.

* lisp/net/tramp-sshfs.el (tramp-sshfs-handle-exec-path):
Let-bind `process-file-side-effects'.

* src/alloc.c (Fmemory_info): Support remote systems.
(Qmemory_info): Declare.

* test/lisp/net/tramp-tests.el (tramp-test31-memory-info): New test.
2022-11-27 16:57:03 +01:00
Eli Zaretskii
6f0906be51 ; Fix last change in etags.c
* lib-src/etags.c (cleanup_tags_file): Renamed from
clean_matched_file_tag.

* test/manual/etags/CTAGS.good_update:
* test/manual/etags/CTAGS.good_crlf: Update to match the test.
2022-11-27 15:43:39 +02:00
lu4nx
d48bb4874b Fixed ctags local command execute vulnerability
* lib-src/etags.c:

(clean_matched_file_tag): New function
(do_move_file): New function
(readline_internal):
Add `leave_cr` parameter, if true, include the \r character

* test/manual/etags/CTAGS.good_crlf: New file
* test/manual/etags/CTAGS.good_update: New file
* test/manual/etags/crlf: New file
* test/manual/etags/Makefile: Add `ctags -u` test cases
2022-11-27 15:20:49 +02:00
Stefan Kangas
8296164eab Remove tests lacking a copyright assignment for now
* use-package-tests.el (use-package-test/pre-post-hooks-with-:config)
(use-package-test/pre-post-hooks-without-:config): Remove tests.
2022-11-27 10:03:56 +01:00
Jim Porter
14d54212ea Improve robustness of server.el tests
* lisp/emacs-lisp/ert.el (ert--insert-infos): Allow 'message' to be a
function that is called when inserting the info.
(ert-info): Update docstring to describe using a function for
MESSAGE-FORM.

* lisp/server.el (server-start): Log when the server is starting.

* test/lisp/server-tests.el (server-tests/can-create-frames-p): New
constant.  Use it to skip tests that need to create frames.
(server-tests/start-emacsclient): Rename to...
(server-tests/start-client): ... this, and set the process's buffer.
(server-tests/with-server): Put the server file in a temporary
directory so we don't conflict with real Emacs servers.
(server-tests/with-client): New macro...
(server-tests/server-start/stop-prompt-with-client)
(server-tests/emacsclient/server-edit)
(server-tests/emacsclient/create-frame)
(server-tests/emacsclient/create-frame): ... use it.
(server-tests/server-start/stop-prompt-with-client): Simplify.
2022-11-26 13:40:33 -08:00
Stefan Kangas
65f355a0ad ; Fix typos 2022-11-26 14:30:02 +01:00
Jim Porter
154daf8367 ; * test/lisp/eshell/esh-var-tests.el: Fix incorrect paren placement. 2022-11-25 17:45:06 -08:00
F. Jason Park
3d02c8aabf Disable auth-source-pass-extra-query-keywords by default
* doc/misc/auth.texi: Mention subdomain matching in
`auth-source-pass-extra-query-keywords' section.
* etc/NEWS: Mention the loss of traditional auth-source-pass features
when `auth-source-pass-extra-query-keywords' is enabled.
* lisp/auth-source-pass (auth-source-pass-extra-query-keywords): Set
default to nil.  Mention domain matching in doc string.
(auth-source-pass--match-regexp): Allow username to contain "@".
* lisp/erc/erc-compat.el:
(erc-compat--29-auth-source-pass--retrieve-parsed): Adjust regexp.
* test/lisp/auth-source-pass-tests.el
(auth-source-pass-extra-query-keywords--suffixed-user): make plain
username more email-like.
(Bug#58985.)
2022-11-25 05:37:01 -08:00
Mattias Engdegård
f35dc7058b Add sqlite library version string retrieval function (bug#58766)
* src/sqlite.c (sqlite3_libversion, load_dll_functions):
Make sqlite3_libversion available.
(Fsqlite_version): New.
(syms_of_sqlite): Define sqlite-version.
* doc/lispref/text.texi (Database): Document.
* test/src/sqlite-tests.el (sqlite-returning): `RETURNING` was added
in sqlite 3.35; skip the test for older versions.
2022-11-25 11:03:10 +01:00
Jim Porter
28c444f72a Don't explicitly delete client frames when killing Emacs anyway
This eliminates a useless error prompt when killing Emacs from a
client frame when there are no other frames (bug#58877).

* lisp/server.el (server-running-external): New error.
(server--file-name): New function...
(server-eval-at): ... use it.
(server-start): Factor out server stopping code into...
(server-stop): ... here.
(server-force-stop): Use 'server-stop', and tell it not to delete
frames.

* test/lisp/server-tests.el
(server-tests/server-force-stop/keeps-frames): New test.
2022-11-24 17:33:53 -08:00
Jim Porter
339893f2e3 ; Add more tests for the Emacs server
* test/lisp/server-tests.el (server-tests/emacs-client)
(server-tests/max-wait-time): New constants.
(server-tests/start-emacsclient): New function.
(server-tests/with-server, server-tests/wait-until): New macros.
(server-tests/variable): New variable.
(server-test/server-start-sets-minor-mode): Rename to...
(server-tests/server-start/sets-minor-mode): ... this.
(server-tests/server-start/stop-prompt-with-client)
(server-tests/server-start/no-stop-prompt-without-client)
(server-tests/emacsclient/server-edit)
(server-tests/emacsclient/create-frame, server-test/emacsclient/eval):
New tests.

* test/lib-src/emacsclient-tests.el: Mention the above file.
2022-11-24 17:27:11 -08:00
Ulf Jasper
b604bef915 icalendar: Adjust tests after fixing parsing of sexp entries (bug#56241)
* test/lisp/calendar/icalendar-tests.el
(icalendar-export-bug-56241-nested-sexps): New.
* test/lisp/calendar/icalendar-tests.el (icalendar-real-world):
Disable testcase for exporting sexp entries that has now become invalid.
2022-11-24 18:59:58 +01:00
Thomas Fitzsimmons
4231481af8 EUDC: Improve LDAP and BBDB tests
* test/lisp/net/eudc-tests.el (eudcb-ldap): Make slapd detection
reliable.
* test/lisp/net/eudc-resources/bbdb: Add another test contact.
2022-11-24 02:21:38 -05:00
F. Jason Park
f8b410f4a1
Add test scenarios for local ERC modules
* test/lisp/erc/erc-scenarios-base-local-modules.el: New file.
* test/lisp/erc/resources/base/local-modules/first.eld: New file.
* test/lisp/erc/resources/base/local-modules/fourth.eld: New file
* test/lisp/erc/resources/base/local-modules/second.eld: New file.
* test/lisp/erc/resources/base/local-modules/third.eld: New file.
(Bug#57955.)
2022-11-23 21:23:05 -05:00
F. Jason Park
5258f36168
Accept functions in place of passwords in ERC
* lisp/erc/erc-backend.el (erc-session-password): Add comment
explaining type is now string, nil, or function.
* lisp/erc/erc-compat.el (erc-compat--29-auth-source-pass-search):
Use obfuscation from auth-source function when available.
* lisp/erc/erc-sasl.el (erc-sasl--read-password,
erc-server-AUTHENTICATE): Use `erc--unfun'.
* lisp/erc/erc-services.el (erc-nickserv-get-password,
erc-nickserv-send-identify): Use `erc--unfun'.
* lisp/erc/erc.el (erc--unfun): New function for unwrapping a
password couched in a getter.
(erc--debug-irc-protocol-mask-secrets): Add variable to indicate
whether to mask passwords in debug logs.
(erc--mask-secrets): New function to swap masked secret with question
marks in debug logs.
(erc-log-irc-protocol): Conditionally mask secrets when
`erc--debug-irc-protocol-mask-secrets' is non-nil.
(erc--auth-source-search): Don't unwrap secret from function before
returning.
(erc-server-join-channel, erc-login): Use `erc--unfun'.

* test/lisp/erc/erc-services-tests.el
(erc-services-tests--wrap-search): Add helper for `erc--unfun'.
(erc-services-tests--auth-source-standard,
erc-services-tests--auth-source-announced,
erc-services-tests--auth-source-overrides, erc-nickserv-get-password):
Use `erc--unfun'.
* test/lisp/erc/erc-tests.el (erc--debug-irc-protocol-mask-secrets):
Add test for masking secrets with `erc--unfun' and friends.
2022-11-23 21:23:05 -05:00
F. Jason Park
ed8862c404
Add non-IRCv3 SASL module to ERC
* doc/misc/erc.texi: Add SASL section in Advanced Usage chapter to
document the new SASL module.

* etc/ERC-NEWS: Mention addition of erc-sasl module for SASL support.

* lisp/erc/erc-compat.el
(erc-compat--29-sasl-scram-construct-gs2-header,
erc-compat--29-sasl-scram-client-first-message,
erc-compat--29-sasl-scram--client-final-message): Fix encoding bug and
add minimal authorization support with copies of SASL functions
introduced in Emacs 29.

* lisp/erc/erc.el (erc-modules): Add `sasl'.
* lisp/erc/erc-sasl.el: New file (bug#29108).
* test/lisp/erc/erc-sasl-tests.el: New file.
* test/lisp/erc/erc-scenarios-sasl.el: New file.
* test/lisp/erc/resources/sasl/plain-failed.eld: New file.
* test/lisp/erc/resources/sasl/plain.eld: New file.
* test/lisp/erc/resources/sasl/scram-sha-1.eld: New file.
* test/lisp/erc/resources/sasl/scram-sha-256.eld: New file.
* test/lisp/erc/resources/sasl/external.eld: New file.
2022-11-23 21:14:25 -05:00
F. Jason Park
4c4936fab2
Support local ERC modules in erc-mode buffers
* doc/misc/erc.texi: Mention local modules in Modules chapter.

* etc/ERC-NEWS: Mention changes to `erc-update-modules'.

* lisp/erc/erc.el (erc-migrate-modules): Add some missing mappings.
(erc-modules): When a user removes a module, disable it and kill its
local variable in all ERC buffers.
(erc-update-modules): Move body of `erc-update-modules' to new
internal function.
(erc--update-modules): Add new function, a renamed and slightly
modified version of `erc-update-modules'.  Specifically, change return
value from nil to a list of minor-mode commands for local modules.
Use `custom-variable-p' to detect flavor.
(erc--merge-local-modes): Add helper for finding local modules
already active as minor modes in an ERC buffer.
(erc-open): Replace `erc-update-modules' with `erc--update-modules'.
Defer enabling of local modules via `erc--update-modules' until after
buffer is initialized with other local vars.  Also defer major-mode
hooks so they can detect things like whether the buffer is a server or
target buffer.  Also ensure local module setup code can detect when
`erc-open' was called with a non-nil `erc--server-reconnecting'.

* lisp/erc/erc-common.el (erc--module-name-migrations,
erc--features-to-modules, erc--modules-to-features): Add alists of
old-to-new module names to support module-name migrations.
(erc--assemble-toggle): Add new helper for constructing mode toggles,
like `erc-sasl-enable'.
(define-erc-modules): Defer to `erc--assemble-toggle' to create toggle
commands.
(erc--normalize-module-symbol): Add helper for `erc-migrate-modules'.

* lisp/erc/erc-goodies.el: Require cl-lib.

* test/lisp/erc/erc-tests.el (erc-migrate-modules,
erc--update-modules): Add rudimentary unit tests asserting correct
module-name mappings.
(erc--merge-local-modes): Add test for helper.
(define-erc-module--global, define-erc-module--local): Add tests
asserting module-creation macro.  (Bug#57955.)
2022-11-23 19:56:31 -05:00
F. Jason Park
da30a4908e
Don't set erc-networks--id until network is known
* lisp/erc/erc-networks.el (erc-networks--id-given): Accept a null
argument.
(erc-networks--id-on-connect): Remove unused function.
(erc-networks--id-equal-p): Add method for comparing initialized and
unset IDs.
(erc-networks--update-server-identity): Ensure `erc-networks--id' is
set before continuing search.
(erc-networks--init-identity): Don't assume `erc-networks--id' is
non-nil.  Add branch condition to reload ID on non-nil case.
(erc-networks-on-MOTD-end): Let init-ID function handle renaming of
server buffer.

* lisp/erc/erc.el (erc-open): For continued sessions, try copying over
the last network ID.
(erc--auth-source-determine-params-default): Don't expect a network ID
to have been initialized.
(erc-set-current-nick): When connected, reload network ID.  Leave
comment warning that it may be unneeded.

* lisp/erc/erc-backend.el (erc-server-NICK, erc-server-433): Unless
already connected, schedule ID reload when server rejects or mandates
a nick change.

* test/lisp/erc/erc-scenarios-base-association-nick.el
(erc-scenarios-base-association-nick-bumped,
erc-scenarios-base-association-nick-bumped-mandated-renick): Update to
reflect more liberal association behavior when renamed by IRCd.
2022-11-23 19:54:40 -05:00
Ulf Jasper
b42cd524b4 icalendar.el: Add test(s) for bug#56241
* test/lisp/calendar/icalendar-tests.el
(icalendar-tests--get-error-string-for-export): new.
* icalendar-tests.el (icalendar-export-bug-56241-dotted-pair): new
2022-11-23 20:31:42 +01:00
Michael Albinus
1524fe427d Restore tramp-achive's Emacs 26 compatibility
* lisp/net/tramp-archive.el (tramp-archive-autoload-file-name-regexp):
Special handling of Emacs 26.  Simplify the other part.

* test/lisp/net/tramp-tests.el (tramp-test48-unload): Special case
of `tramp-register-archive-file-name-handler'.
2022-11-23 12:00:35 +01:00
Stefan Kangas
5e8c62ffca ; Fix typos 2022-11-23 05:49:22 +01:00
Mattias Engdegård
eb02528b70 ; Fix warnings in builds without tree-sitter 2022-11-22 11:06:41 +01:00
F. Jason Park
7cfa87ed5b ; Fix ERC test failure following recent typo fix
* test/lisp/erc/erc-scenarios-base-compat-rename-bouncer.el: Replace
expected buffer content in test assertion.
* test/lisp/erc/resources/erc-scenarios-common.el: Replace expected
buffer content in test assertion. See also
40539c7587 "; Fix typos".
2022-11-21 20:53:25 -08:00
Stefan Kangas
40539c7587 ; Fix typos 2022-11-22 02:24:20 +01:00
Yuan Fu
3f37f6b435
; * test/src/treesit-tests.el (treesit-misc): Remove test.
This test is for treesit--setting-for-mode, which is removed when we
switched from using treesit-settings to using separate major modes.
2022-11-21 13:34:38 -08:00
Yuan Fu
aaeaa310f0
Merge remote-tracking branch 'savannah/master' into feature/tree-sitter 2022-11-21 12:54:35 -08:00
Mattias Engdegård
2450973165 ; * test/src/treesit-tests.el (treesit-misc): Don't fail without ts 2022-11-21 16:53:15 +01:00
Michael Albinus
61e96789dd Activate direct asynchronous processes for Tramp container methods
* doc/misc/tramp.texi (Remote processes): Mention also
tramp-container.el.

* lisp/emacs-lisp/ert-x.el (ert-remote-temporary-file-directory):
Add `tramp-direct-async' to "mock" method.

* lisp/net/tramp-container.el
(tramp-methods) <docker, podman, kubernetes>: Add `tramp-direct-async'.

* lisp/net/tramp.el (tramp-methods): Adapt docstring.
(tramp-handle-make-process): Handle `tramp-direct-async'.

* test/lisp/net/tramp-tests.el (tramp-methods) <mock>:
Add `tramp-direct-async'.
2022-11-21 14:49:54 +01:00
Stefan Kangas
16318bfb51 ; Fix typos 2022-11-20 12:59:39 +01:00
Thomas Fitzsimmons
2ec39734ca EUDC: Add BBDB test
* test/lisp/net/eudc-tests.el (eudcb-ldap): Call skip-unless with
slapd check.
(eudcb-bbdb): New test.
2022-11-19 11:43:30 -05:00
Thomas Fitzsimmons
a6ae13af42 EUDC: Add LDAP tests
* test/lisp/net/eudc-resources/slapd.conf: New file.
* test/lisp/net/eudc-resources/dc=gnu,dc=org.ldif: Likewise.
* test/lisp/net/eudc-resources/dc=gnu,dc=org: New files.
* test/lisp/net/eudc-tests.el (eudcb-ldap): New test.
2022-11-19 02:05:36 -05:00
Mattias Engdegård
87fce324c6 ; gnus-icalendar-tests: revert erroneous 'typo fix' 2022-11-18 19:50:33 +01:00
Stefan Kangas
ba485eb949 ; Fix typos 2022-11-18 16:02:19 +01:00
Stefan Kangas
f7ee6609ae ; Fix typos (prefer US spelling) 2022-11-18 13:06:55 +01:00
Mattias Engdegård
eeab7b5cad Fix simple-tests when run noninteractively
* test/lisp/simple-tests.el
(simple-execute-extended-command--describe-binding-msg):
Bind text-quoting-style explicitly to ensure consistent behaviour
whether or not the test is run interactively.
2022-11-18 12:12:09 +01:00
Philip Kaludercic
345bfd376e Add missing elpa-package.eld to package test resources 2022-11-17 20:55:04 +01:00
Stefan Kangas
2967356891 Avoid raw control characters in two files
* lisp/net/rcirc.el (rcirc-format, rcirc-unformat)
(rcirc-format-bold, rcirc-format-italic, rcirc-format-underline)
(rcirc-format-strike-trough, rcirc-format-fixed-width):
* test/lisp/subr-tests.el (test-keymap-parse-macros): Don't use
raw control characters.
2022-11-17 20:10:05 +01:00
F. Jason Park
ed5022b4ee Improve new connections in erc-handle-irc-url
* doc/misc/erc.texi: Add new Integrations section to the info manual
under Advanced Usage.
* etc/ERC-NEWS: Add new section mentioning improved UX when clicking
on irc:// links.

* lisp/erc/erc.el (erc-handle-irc-url): Add optional "scheme"
parameter.  Fix `erc-open' invocation so that the server buffer is
named correctly by deferring to a new customizable opener.  Arrange
for JOINing a channel in a manner similar to ERC's autojoin module.
(erc-url-connect-function): Add new option for creating a new ERC
connection based on info parsed from a URL.
(erc--url-default-connect-function): New function to serve as an
interactive-only fallback when a user hasn't specified a URL connect
function.
* lisp/erc/erc-compat.el (erc-compat--29-browse-url--irc): Add new
compatibility function for `browse-url-irc' and include it in
`browse-url-default-handlers' on Emacs versions below 29.

* test/lisp/erc/erc-tests.el (erc-tests--make-server-buf,
erc-tests--make-client-buf): Add helpers for creating dummy ERC
buffers.
(erc-handle-irc-url): Add test.
* test/lisp/erc/erc-scenarios-misc.el (erc-scenarios-handle-irc-url):
Add new test.
* test/lisp/erc/resources/join/legacy/foonet.eld: Relax
timeout.  (Bug#56514.)
2022-11-16 21:34:36 -08:00
F. Jason Park
535cc4c81a Add optional server param to erc-networks--determine
* lisp/erc/erc-networks.el (erc-networks--determine): Accept optional
`server' argument.
* test/lisp/erc/erc-networks-tests.el (erc-networks--determine): Add
test.  (Bug#56514.)
2022-11-16 21:34:36 -08:00
F. Jason Park
77d6351d60 Default to TLS port when calling erc-tls from lisp
* lisp/erc/erc.el (erc-normalize-port): Add standard IANA port-name
mappings for 6667 and 6697.
(erc-open): Add note to doc string explaining that params `connect'
and `channel' are mutually exclusive.
(erc-tls): Call `erc-compute-port' with override.
(erc-compute-port): Call `erc-normalize-port' with result'.
* test/lisp/erc/erc-tests.el (erc-tls): Add simplistic test focusing
on default parameters.  (Bug#56514.)
2022-11-16 21:34:36 -08:00
F. Jason Park
46c765ed09 Refactor erc-select-read-args
* lisp/erc/erc-backend.el (erc--server-connect-dumb-ipv6-regexp): Add
liberal pattern for matching bracketed IPv6 addresses.
(erc-server-connect): Remove brackets from IPv6 hosts before
connecting.
* lisp/erc/erc.el (erc--ensure-url): Add compat adapter to massage
partial URLs given as input that may be missing the scheme:// portion.
(erc-select-read-args): Keep bracketed IPv6 hosts
intact.  Make this function fully URL-aware (was only partially so).
Accept optional `input' argument.
* lisp/erc/erc-tests.el (erc-tests--ipv6-examples,
erc--server-connect-dumb-ipv6-regexp, erc-select-read-args): Add test
reading user input during interactive invocations of entry points.
(Bug#56514.)
2022-11-16 21:34:36 -08:00
F. Jason Park
5699e43f27 Accommodate ircs:// URLs in url-irc and browse-url
* lisp/url/url-irc.el (url-irc-function): Change signature of function
interface to expect a final "scheme" argument, such as "ircs".
(url-irc): Call `url-irc-function' with new positional argument, the
scheme extracted via `url-type' from the input URL.
(url-irc-erc, url-irc-rcirc, url-irc-zenirc): Accept a URL scheme as a
sixth positional arg.
(url-ircs-default-port, url-ircs): Add new autoloaded constant and
alias for `url-scheme-get-property' to recognize.  Do this to avoid
having to add another file.
* lisp/net/browse-url.el (browse-url-irc-function): Add new option.
(browse-url--irc): Add new function to call `browse-url-irc-function'.
(browse-url-default-handlers): Add "irc://" entry.
(browse-url-irc): Add new function to serve as general handler for
"irc://" URLS.  Accept trailing variadic args to accommodate
non-browse-url interfaces as well.
* test/lisp/net/browse-url-tests.el
(browse-url-tests-select-handler-irc): Add test for "irc://" URL
pattern.
* etc/NEWS: Mention select browse-url and url-irc
changes.  (Bug#56514.)
2022-11-16 21:34:36 -08:00
F. Jason Park
e7f2f6cd92 Improve auto-reconnect visibility in ERC
* lisp/erc/erc-backend.el (erc--server-reconnect-timer): New variable.
(erc-server-reconnect-function): New user option.
(erc-process-sentinel-2): Display time remaining until next
reconnection attempt.  Also remove condition case and move bulk of
else condition logic to `erc-schedule-reconnect'.  More importantly,
no longer set `erc--server-reconnecting here').
(erc-server-connect): Initialize `erc--server-reconnect-timer' to nil.
(erc-server-reconnect): Set `erc-server--reconnecting' here.
(erc--mode-line-process-reconnecting): New constant to store value for
"reconnect" state of `mode-line-process'.
(erc--cancel-auto-reconnect-timer): New function to cancel
auto-reconnect timer and print message.
(erc-schedule-reconnect): New function for scheduling another
reconnect attempt.

* lisp/erc/erc.el (erc-open): Only update mode line for target
buffers. For server buffers, let `erc-login' and/or process sentinels
take care of it.
(erc--cmd-reconnect, erc-cmd-RECONNECT): Rename latter to former, a
new function, but repurpose existing to recognize newly allowed
additional arguments and act accordingly.  In new internal function,
cancel an existing auto-reconnect timer, if any, before proceeding.
Defer to `erc-server-reconnect' to set `erc--server-reconnecting'.
Fix `with-suppressed-warnings' form.
(erc-update-mode-line-buffer): Show "reconnecting in Ns" for
`mode-line-process' when awaiting an automatic reconnect attempt.
(erc-message-english-reconnecting,
erc-message-english-reconnect-canceled): Add new message functions to
English catalog.

* lisp/erc/erc-pcomplete.el (pcomplete/erc-mode/RECONNECT): Perform
completion for newly subcommand-aware `erc-cmd-RECONNECT'.

* lisp/erc/erc-scenarios-base-reconnect
(erc-scenarios-base-cancel-reconnect): Add new test case for canceling
reconnect timers.  (Bug#58840.)
2022-11-16 21:34:36 -08:00
F. Jason Park
4351fb7161 ; Make some ERC test fixtures a bit more courteous
* test/lisp/erc/erc-dcc-tests.el (erc-dcc-tests--pcomplete-common):
Only emit messages when interactive.
* test/lisp/erc/resources/erc-d/erc-d-tests.el
(erc-d-tests-with-server): Shadow `erc-after-connect' so
`erc-autojoin-channels' doesn't affect other tests.
test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common--make-bindings): Shadow `erc-after-connect' here
as well.  Also require erc instead of erc-backend to silence some new
compiler warnings the cropped up after the creation of erc-common.el.
2022-11-16 21:34:36 -08:00
F. Jason Park
c5d91358b5 Support auth-source-pass in ERC
* doc/misc/erc.texi: Mention that the auth-source-pass backend is
supported.
* lisp/erc/erc-compat.el (erc-compat--29-auth-source-pass-search,
erc-compat--29-auth-source-pass--build-result-many,
erc-compat--29-auth-source-pass--retrieve-parsed,
erc-compat--29-auth-source-pass-backend-parse,
erc-compat--auth-source-backend-parser-functions): Adapt some yet
unreleased functions from auth-source-pass that mimic the netrc
backend, and add forward declarations to support them.

* lisp/erc/erc.el (erc--auth-source-search): Use own auth-source-pass
erc-compat backend.
* test/lisp/erc/erc-services-tests.el
(erc-join-tests--auth-source-pass-entries): Remove useless items.
(erc--auth-source-search--pass-standard,
erc--auth-source-search--pass-announced,
erc--auth-source-search--pass-overrides): Remove `ert-skip' guard.
(Bug#58985.)
2022-11-16 21:34:36 -08:00
F. Jason Park
2cf9e699ef Make auth-source-pass behave more like other backends
* lisp/auth-source-pass.el (auth-source-pass-extra-query-keywords): Add
new option to bring search behavior more in line with other backends.
(auth-source-pass-search): Add new keyword params `max' and `require'
and consider new option `auth-source-pass-extra-query-keywords' for
dispatch.
(auth-source-pass--match-regexp, auth-source-pass--retrieve-parsed,
auth-source-pass--match-parts): Add supporting variable and helpers.
(auth-source-pass--build-result-many,
auth-source-pass--find-match-many): Add "-many" variants for existing
workhorse functions.
* test/lisp/auth-source-pass-tests.el: Require `ert-x'.
(auth-source-pass-can-start-from-auth-source-search): Ensure
`auth-source-pass-extra-query-keywords' is enabled around test body.
(auth-source-pass-extra-query-keywords--wild-port-miss-netrc,
auth-source-pass-extra-query-keywords--wild-port-miss,
auth-source-pass-extra-query-keywords--wild-port-hit-netrc,
auth-source-pass-extra-query-keywords--wild-port-hit,
auth-source-pass-extra-query-keywords--wild-port-req-miss-netrc,
auth-source-pass-extra-query-keywords--wild-port-req-miss,
auth-source-pass-extra-query-keywords--netrc-akib,
auth-source-pass-extra-query-keywords--akib,
auth-source-pass-extra-query-keywords--netrc-host,
auth-source-pass-extra-query-keywords--host,
auth-source-pass-extra-query-keywords--baseline,
auth-source-pass-extra-query-keywords--port-type,
auth-source-pass-extra-query-keywords--hosts-first,
auth-source-pass-extra-query-keywords--ambiguous-user-host,
auth-source-pass-extra-query-keywords--suffixed-user,
auth-source-pass-extra-query-keywords--user-priorities): Add
juxtaposed netrc and extra-query-keywords pairs to demo optional
extra-compliant behavior.
* doc/misc/auth.texi: Add option
`auth-source-pass-extra-query-keywords' to auth-source-pass section.
* etc/NEWS: Mention `auth-source-pass-extra-query-keywords' in Emacs
29.1 package changes section.  (Bug#58985.)

Special thanks to Akib Azmain Turja <akib@disroot.org> for helping
improve this patch.
2022-11-16 21:34:36 -08:00
Jim Porter
0147e1ed83 Enable/disable 'server-mode' when starting/stopping the server
* lisp/server.el (server-mode-map): New keymap...
(server-mode): ... use it.
(server-start): Update the 'server-mode' variable (and sync to
'global-minor-modes') when starting/stopping the server.

* test/lisp/server-tests.el: New file (bug#58909).
2022-11-16 21:15:19 -08:00
Yuan Fu
639821d49a
Allow checking for outdated nodes in tree-sitter
Now you can run (treesit-node-check node 'outdated).

* doc/lispref/parsing.texi (Accessing Node Information): Update
manual.
* src/treesit.c (Ftreesit_node_check): Add new property 'outdated'.
* test/src/treesit-tests.el (treesit-node-check): Add tests.
2022-11-16 14:40:41 -08:00
John Wiegley
e42c8479ec Merge pull request from skangas/dir-locals
GitHub-reference: https://github.com/jwiegley/use-package/issues/1023
2022-11-16 11:29:27 -08:00
Stefan Kangas
30fa366737 Add .dir-locals.el 2022-11-16 18:02:20 +01:00
Eli Zaretskii
0a26b26217 Reduce buffer-tests noisiness even more
* test/src/buffer-tests.el (test-kill-buffer-auto-save-default)
(test-kill-buffer-auto-save-delete-yes)
(test-kill-buffer-auto-save-delete-no)
(test-buffer-modifications, test-restore-buffer-modified-p): Shut
up auto-save messages.  (Bug#59028)
2022-11-16 16:37:23 +02:00
Matt Armstrong
aee4d67b09 Reduce buffer-tests noisiness when run in batch mode.
* test/src/buffer-tests.el (overlay-modification-hooks): Remove noisy
`message' calls and use `ert-info' to log context of test
failures.  (bug#59028)
(overlay-tests-start-recording-modification-hooks): ditto.
2022-11-16 16:34:31 +02:00
Stefan Kangas
2399d0d5ce Normalize GPLv3 license statements 2022-11-16 08:43:55 +01:00
John Wiegley
3e81af80a2 Revert "Allow multiple keymaps in :map argument" 2022-11-15 15:24:12 -08:00
John Wiegley
49fffe7cf4 Merge remote-tracking branch 'origin/master' into pr-830 2022-11-15 09:21:07 -08:00
Yuan Fu
0d195584f2
; Remove some tree-sitter tests
* test/src/treesit-tests.el (treesit-parser-supplemental): Remove
treesit-set-ranges, and treesit-get-ranges, as these functions are
removed.
2022-11-14 01:23:45 -08:00
Yuan Fu
7e9c2e2952
; * test/src/treesit-tests.el (treesit-node-check): New test. 2022-11-14 00:54:54 -08:00
Stefan Kangas
ff30d22909 Various checkdoc fixes 2022-11-14 02:18:43 +01:00
Stefan Kangas
a5bf6fb526 Fix suggest-key-bindings displaying key as command
* lisp/simple.el (execute-extended-command--describe-binding-msg):
New function factored out from...
(execute-extended-command): ...here.  Fix bug where a key binding was
displayed as a command with 'suggest-key-bindings'.  (Bug#59247)
* test/lisp/simple-tests.el
(simple-execute-extended-command--describe-binding-msg): New test.
2022-11-13 19:46:02 +01:00
Stefan Kangas
90a7dee79d New test for execute-extended-command helper defun
* test/lisp/simple-tests.el
(simple-execute-extended-command--shorter): New test.
2022-11-13 15:34:02 +01:00
Yuan Fu
5cd3db73be
Improve treesit-node-at
* doc/lispref/parsing.texi (Retrieving Node): Update manual.
* lisp/treesit.el (treesit-node-at): Change semantic.  It tries to
return the node that a user would expect in various circumstances.
* test/src/treesit-tests.el (treesit-node-at): New test.
2022-11-11 20:04:38 -08:00
Stefan Kangas
6f48b46b03 ; Fix typos 2022-11-11 15:52:37 +01:00
Gerd Möllmann
6d9065b748 Fix &key parameters called without arguments (bug#58714)
* lisp/emacs-lisp/cl-macs.el (cl--do-arglist): Check for missing
argument.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-&key-arguments): New test.
2022-11-11 14:13:46 +01:00
kobarity
f8df45f853 Fix indentation for multi-line block start in Python mode
* lisp/progmodes/python.el
(python-info-dedenter-opening-block-positions): Fix for multi-line
block start.
* test/lisp/progmodes/python-tests.el
(python-info-dedenter-opening-block-positions-6): New test. (Bug#59009)
2022-11-10 12:23:52 +02:00
Eli Zaretskii
7e9afea775 ; * test/lisp/dired-tests.el (dired-test-bug59047): Rename. 2022-11-10 12:08:47 +02:00
Gabriel do Nascimento Ribeiro
7879eca247 Make 'dired-hide-details-mode' work after 'dired-hide-subdir'
* lisp/dired.el (dired--unhide): Restore text properties.
(Bug#59047)

* test/lisp/dired-tests.el (dired-test-bugXXXX): New test.
2022-11-10 12:05:59 +02:00
Matt Armstrong
b4db61f580 Rewrite the `kill-buffer-delete-auto-save' tests (bug#59028)
These tests had been annoying to me when run in interactive mode.
They failed to bind `kill-buffer-delete-auto-save' as needed, so they
depended on the user's settings, and they failed to mock out the
"Buffer modified, save?" prompt.

* test/src/buffer-tests.el (test-kill-buffer-auto-save): New helper
function that mocks the two different kinds of prompts that occur when
killing modified buffers that visit a file.  Tests fail if expected
prompts are not issued.
(test-kill-buffer-auto-save-default): Use it, and explicitly bind
`kill-buffer-delete-auto-save' to nil.
(test-kill-buffer-auto-save-delete): Delete it.
(test-kill-buffer-auto-save-delete-yes): New test for the "yes" half
of the old `test-kill-buffer-auto-save-delete'.
(test-kill-buffer-auto-save-delete-yes): Ditto for the "no" half.
2022-11-10 11:53:46 +02:00
F. Jason Park
4bd5ac04a3 Teach thing-at-point to recognize bracketed IPv6 URLs
* lisp/thingatpt.el (thing-at-point-bounds-of-url-at-point): Allow
IPv6 addresses as hosts.  Overshoots in the case of bracketed markup
but is rescued by `thing-at-point--bounds-of-well-formed-url'.
* test/lisp/thingatpt-tests.el (thing-at-point-test-data): Add cases
for IPv6 URLs.  Bug#56514.
2022-11-09 05:15:11 -08:00
Alexander Adolf
0e25a39e69 EUDC: Add ecomplete and mailabbrev backends
* doc/misc/eudc.texi (Overview): Add ecomplete and mailabbrev
nodes.
(ecomplete, mailabbrev): New nodes.
(Installation): Add ecomplete and mailabbrev nodes.
(LDAP Configuration): Use code formatting instead of quotes.
(macOS Contacts Configuration): Likewise.
(ecomplete Configuration): New node.
(mailabbrev Configuration): Likewise.
* etc/NEWS (EUDC): Mention ecomplete and mailabbrev backends,
mention eudc-server-hotlist default change.
* lisp/net/eudc-vars.el (eudc-known-protocols): Add ecomplete and
mailabbrev.
(eudc-server-hotlist): Add entries for ecomplete and mailabbrev.
* lisp/net/eudcb-ecomplete.el: New EUDC backend file.
* lisp/net/eudcb-mailabbrev.el: Likewise.
* test/lisp/net/eudc-resources/ecompleterc,
test/lisp/net/eudc-resources/mailrc: New eudc-tests resource
files.
* test/lisp/net/eudc-tests.el (eudc-test-rfc5322-quote-phrase)
(eudc-test-make-address, eudcb-ecomplete, eudcb-mailabbrev): New
test cases.
2022-11-08 18:19:15 -05:00
Stefan Kangas
2ea9f69f07 Fix failing eshell alias tests
* test/lisp/eshell/esh-var-tests.el (esh-var-test/alias/function)
(esh-var-test/alias/symbol-pair): Fix tests.  (Bug#59062)
2022-11-06 15:38:10 +01:00
Matt Armstrong
23dd27a979 itree.c and buffer-tests.el: Incorporate code review feedback
* src/itree.c: Improve wording in `itree_insert_gap` comment.
* test/src/buffer-tests.el (test-overlay-insert-before-markers-at-start):
Don't rely on (point-min) being 1.
(test-overlay-insert-before-markers-at-end): ditto.
(test-overlay-insert-before-markers-empty): ditto.
2022-11-06 00:05:55 -04:00
Stefan Monnier
6e5ec08551 buffer.c: evaporate overlays in all indirect buffers
This fixes bug#58928.  The patch works by moving the
`evaporate_overlays` check closer to `itree_delete_gap`.

* src/buffer.c (adjust_overlays_for_delete_in_buffer): New function,
integrating the functionality of `evaporate_overlays`.
(adjust_overlays_for_delete): Use it.
(evaporate_overlays): Delete function.

* src/buffer.h (evaporate_overlays): Delete declaration.

* src/insdel.c (adjust_markers_for_replace): Minor optimization.
(adjust_after_replace, replace_range, replace_range_2, del_range_2):
Don't call `evaporate_overlays`.

* test/src/buffer-tests.el (buffer-tests--overlays-indirect-evaporate):
Remove the `:expected-result :failed` attribute.
2022-11-05 17:22:37 -04:00
Matt Armstrong
5c9895fffe Add a test for overlay evaporation across indirect buffers
* test/src/buffer-tests.el (buffer-tests--overlays-indirect-evaporate):
Test evaporation of overlays triggered by deleting text in base
and in indirect buffers.  Test doesn't pass at the moment.
2022-11-05 16:48:55 -04:00
Matt Armstrong
2fc6e715a2 Tweak the overlay related `insert-before-markers' tests
* test/src/buffer-tests.el (test-overlay-insert-before-markers-empty):
Move code down to the other tests related to insertion.  Test all
front/rear insert combinations.  To make the test more clear, at least
to me, hard code all character positions.
(test-overlay-insert-before-markers-at-start): For both front-advance
modes verify that `insert-before-markers' at and overlay's start
advances it.
(test-overlay-insert-before-markers-at-end): For both rear-advance
modes test that `insert-before-markers' at an overlay's end advances
it.
(test-overlay-insert-before-markers-non-empty): Delete, replaced by
the two tests above.
2022-11-05 16:44:06 -04:00
Brian Cully
062d16c3eb Add the "doas" alias to eshell.
* lisp/eshell/em-tramp.el (eshell/doas): new function.
  (eshell--method-wrap-directory): new function.
  (eshell/sudo): accept '-s'/'--shell' for interactive use.
  * test/lisp/eshell/em-tramp-tests.el
  (em-tramp-test/sudo-shell) (em-tramp-test/sudo-user-shell)
  (em-tramp-test/doas-basic) (em-tramp-test/doas-user)
  (em-tramp-test/doas-shell) (em-tramp-test/doas-user-shell): new
  tests.
  * etc/NEWS: mention new 'doas' eshell command.
  * doc/misc/eshell.texi: add 'doas' command documentation.
2022-11-05 12:05:05 -07:00
dickmao
c2d657e7c4 Move ERC's core dependencies to separate file
Asking people to order require's is about as effective
as asking kids to keep off the grass.

* lisp/erc/erc-backend.el (erc--target, erc-auto-query,
erc-channel-list, erc-channel-users, erc-default-nicks,
erc-default-recipients, erc-format-nick-function,
erc-format-query-as-channel-p, erc-hide-prompt, erc-input-marker,
erc-insert-marker, erc-invitation, erc-join-buffer,
erc-kill-buffer-on-part, erc-kill-server-buffer-on-quit, erc-log-p,
erc-minibuffer-ignored, erc-networks--id, erc-nick,
erc-nick-change-attempt-count, erc-prompt-for-channel-key,
erc-prompt-hidden, erc-reuse-buffers, erc-verbose-server-ping,
erc-whowas-on-nosuchnick): Forward-declare variables.
(erc--open-target, erc--target-from-string, erc-active-buffer,
erc-add-default-channel, erc-banlist-update, erc-buffer-filter,
erc-buffer-list-with-nick, erc-channel-begin-receiving-names,
erc-channel-end-receiving-names, erc-channel-p,
erc-channel-receive-names, erc-cmd-JOIN, erc-connection-established,
erc-current-nick, erc-current-nick-p, erc-current-time,
erc-default-target, erc-delete-default-channel,
erc-display-error-notice, erc-display-server-message,
erc-emacs-time-to-erc-time, erc-format-message,
erc-format-privmessage, erc-get-buffer, erc-handle-login,
erc-handle-user-status-change, erc-ignored-reply-p,
erc-ignored-user-p, erc-is-message-ctcp-and-not-action-p,
erc-is-message-ctcp-p, erc-log-irc-protocol, erc-login,
erc-make-notice, erc-network, erc-networks--id-given,
erc-networks--id-reload, erc-nickname-in-use, erc-parse-user,
erc-process-away, erc-process-ctcp-query, erc-query-buffer-p,
erc-remove-channel-member, erc-remove-channel-users, erc-remove-user,
erc-sec-to-time, erc-server-buffer, erc-set-active-buffer,
erc-set-current-nick, erc-set-modes, erc-time-diff, erc-trim-string,
erc-update-mode-line, erc-update-mode-line-buffer,
erc-wash-quit-reason, erc-display-message, erc-get-buffer-create,
erc-process-ctcp-reply, erc-update-channel-topic, erc-update-modes,
erc-update-user-nick, erc-open, erc-update-channel-member):
Forward-declare functions.
(erc-response): Move to lisp/erc/erc-common.el.
(erc-compat--with-memoization): Use "erc-compat-" prefixed macro.

* lisp/erc/erc-common.el: New file.  Change indentation for
`erc-with-all-buffers-of-server' from 1 to 2.

* lisp/erc/erc-compat.el (erc-compat--with-memoization): Migrate macro
from `erc-backend' and rename.

* lisp/erc/erc-goodies.el: Require `erc-common' instead of `erc'.
(erc-controls-highlight-regexp, erc-controls-remove-regexp,
erc-input-marker, erc-insert-marker, erc-server-process, erc-modules,
erc-log-p): Forward declare variables.
(erc-buffer-list, erc-error, erc-extract-command-from-line):
Forward-declare functions.

* lisp/erc/erc-networks.el (erc--target, erc-insert-marker,
erc-kill-buffer-hook, erc-kill-server-hook, erc-modules,
erc-rename-buffers, erc-reuse-buffers, erc-server-announced-name,
erc-server-connected, erc-server-parameters, erc-server-process,
erc-session-server): Forward declare variables.
(erc--default-target, erc--get-isupport-entry, erc-buffer-filter,
erc-current-nick, erc-display-error-notice, erc-error, erc-get-buffer,
erc-server-buffer, erc-server-process-alive): Forward-declare
functions.
(erc-obsolete-var): Also suppress free-variable warnings.

* lisp/erc/erc.el: Require `erc-networks', `erc-goodies', and
`erc-backend' at top of file.  Don't require `erc-compat'.
(erc--server-last-reconnect-count, erc--server-reconnecting,
erc-channel-members-changed-hook, erc-network, erc-networks--id,
erc-server-367-functions, erc-server-announced-name,
erc-server-connect-function, erc-server-connected,
erc-server-current-nick, erc-server-lag, erc-server-last-sent-time,
erc-server-process, erc-server-quitting, erc-server-reconnect-count,
erc-server-reconnecting, erc-session-client-certificate,
erc-session-connector, erc-session-port, erc-session-server,
erc-session-user-full-name) Remove superfluous forward declarations.
(erc-message-parsed, tabbar--local-hlf, motif-version-string):
Relocate forward declares to central location.
(erc-session-password): Move to `erc-backend'.
(erc-downcase, erc-with-server-buffer, erc-server-user,
erc-channel-user, erc-get-channel-user, erc-get-server-user): Move to
lisp/erc/erc-common.el.
(erc-add-server-user, erc-remove-server-user,
erc-channel-user-owner-p, erc-channel-user-admin-p,
erc-channel-user-op-p, erc-channel-user-halfop-p,
erc-channel-user-voice-p): Convert from inline functions to normal
functions.
(define-erc-module, erc--target, erc--target-channel,
erc--target-channel-local, erc-log, erc-log-aux, erc-with-buffer,
erc-with-all-buffers-of-server): Move to lisp/erc/erc-common.el.
(erc-channel-members-changed-hook): Relocate option to avoid compiler
warning.
(erc-input, erc--input-split): Move to lisp/erc/erc-common.el.
(erc-controls-strip): Remove forward declaration temporarily until
this file stops requiring `erc-goodies'.

* test/lisp/erc/erc-networks-tests.el: Require `erc' instead of
`erc-networks'.
* test/lisp/erc/erc.el (erc--meta--backend-dependencies): Remove
obsolete test.  Don't require `erc-networks'. Bug#56340.
2022-11-04 19:32:23 -07:00
F. Jason Park
ae0642f859 Offer completions for GET subcommand flags in erc-dcc
* lisp/erc/erc-dcc.el (pcomplete/erc-mode/DCC): Add /DCC GET switches.
This is unfinished business from bug#54458.
* test/lisp/erc/erc-dcc-tests.el (erc-dcc-tests--pcomplete-common,
pcomplete/erc-mode/DCC--get-basic, pcomplete/erc-mode/DCC--get-1flag,
pcomplete/erc-mode/DCC--get-2flags,
pcomplete/erc-mode/DCC--get-2flags-reverse): Add helper and tests for
completing /DCC GET switches.
2022-11-04 19:32:23 -07:00
F. Jason Park
913aa90013 ; * test/lisp/erc/erc-services-tests.el: Remove cruft. 2022-11-04 19:32:23 -07:00
Yuan Fu
d9d66764e2
Revise tree-sitter facility for multi-language buffers
* doc/lispref/parsing.texi (Multiple Languages): Extend and update
manual.
* lisp/treesit.el (treesit-range-functions): Remove variable.
(treesit-range-settings): New variable.
(treesit-range-rules): New function.
(treesit--merge-ranges): New function.
(treesit-update-ranges): Use treesit-range-settings instead of
treesit-range-functions.
(treesit-font-lock-rules): Fix docstring.
(treesit-indent)
(treesit-indent-region): Only update ranges in a region.
* test/src/treesit-tests.el (treesit-range): New test.
2022-11-04 09:39:57 -07:00
Michael Albinus
5d6e919a90 Fix calling file name handler for `load'.
* lisp/net/ange-ftp.el (ange-ftp-load): Add MUST-SUFFIX argument.

* lisp/net/tramp.el (tramp-handle-load): Adapt MUST_SUFFIX test.

* src/lread.c (Fload): Call handler with must_suffix.

* test/lisp/net/tramp-tests.el (tramp-test27-load): Extend test.
2022-11-04 15:39:58 +01:00
Basil L. Contovounesios
fd3f51b7c3 Fix manual noverlay tests
* test/manual/noverlay/Makefile.in: Add copyright notice.
(LIBS): Rename...
(PACKAGES): ...to this, to avoid confusion with Autoconf's LIBS.
All uses changed.
(CFLAGS): Break out -I flag...
(CPPFLAGS): ...into this new variable.
(LDFLAGS): Rename...
(LDLIBS): ...to this, which is expected to hold -l flags.
(top_builddir): New variable.
(EMACS): Define in terms of it.
(.PHONY): Add clean, distclean, and perf targets.
(have-libcheck): Remove redundant target.  All uses updated.
(itree-tests.o): Remove redundant dependency on its source file.
(itree-tests): Remove redundant (and uncompilable) rule.

* test/manual/noverlay/check-sanitize.sh: Use /usr/bin/env.  Add
copyright notice.  Enable pipefail option, to propagate itree-tests
exit status to caller.  Fix typo in usage message.  Strip less
information from Check's error messages.

* test/manual/noverlay/emacs-compat.h: Add copyright notice.
Include stdlib.h.
(emacs_abort, eassert): Consistently use EXIT_FAILURE.
(eassume): Define when necessary.

* test/manual/noverlay/itree-tests.c: Add copyright notice.  Include
standard headers before third-party ones.  Use most narrowly
applicable ck_assert* macro for the types being checked,
e.g. ck_assert_ptr_* macros for pointer values.  Replace removed
names and APIs with current ones, e.g. the itree_node field 'color'
is now called 'red'.  Ensure preconditions of itree API are
satisfied before use, e.g. itree_node otick being set appropriately
before insertion, or global iterator being initialized
before (implicit) use (bug#58976).  Make all functions static.
(DEF_TEST_SETUP): Remove all instances, replacing with...
(test_insert1_setup, test_insert2_setup, test_remove1_setup)
(test_remove2_setup): ...these new test fixtures.
(A, B, C, D, E, N_05, N_10, N_15, N_20, N_30, N_40, N_50, N_70)
(N_80, N_90, N_85, N_95): Define as static variables rather than
macros.
(test_get_tree4): Remove, inlining salient parts.
(shuffle): Move closer to users.
(test_create_tree): Accept itree_nodes as argument instead of
dynamically allocating them.  All callers changed.
(FOREACH): Remove unused macro.
(N_BEG, N_END): Define in terms of itree_node_begin and
itree_node_end, respectively.
(test_gap_insert_1, test_gap_insert_2, test_gap_insert_3)
(test_gap_insert_5, test_gap_insert_7, test_gap_insert_11): Use
test_setup_gap_node_noadvance.
(basic_suite): Group unit tests into test cases and fixtures.  Run
previously forgotten test_insert_14.
(main): Run suite as CK_ENV to allow specifying desired verbosity in
the environment.
2022-11-04 13:38:02 +02:00
Stefan Monnier
ff679e16f8 itree: Reproduce markers's behavior more faithfully (bug#58928)
The most obvious problem was the lack of support for
`insert-before-markers`, but the behavior was also different in a few
other cases.

* src/itree.h (itree_insert_gap):
* src/itree.c (itree_insert_gap): Add `before_markers` arg.
* src/lisp.h (adjust_overlays_for_insert):
* src/buffer.c (adjust_overlays_for_insert): Add `before_markers` arg.

* src/insdel.c (adjust_markers_for_replace, adjust_markers_for_insert)
(adjust_markers_for_delete): Adjust overlays directly from here.
(insert_1_both, insert_from_string_1, insert_from_gap)
(insert_from_buffer_1, adjust_after_replace, replace_range)
(replace_range_2, del_range_2): Don't adjust overlays explicitly here
any more.

* test/src/buffer-tests.el (test-overlay-insert-before-markers-empty)
(test-overlay-insert-before-markers-non-empty): New tests.
2022-11-03 22:44:55 -04:00
Jim Porter
d2a9dae400 Only strip newlines when stringifying a value for Eshell
* lisp/eshell/esh-util.el (eshell-stringify): Use 'string-trim-right'
instead of stripping the last character of the result of
'pp-to-string' (bug#58810).

* test/lisp/eshell/esh-util-tests.el: New file.
2022-11-03 11:44:41 -07:00
Stefan Monnier
8a5678906f src/buffer.c: Fix interaction between overlays & indirect buffers (bug#58928)
* src/buffer.c (adjust_overlays_for_insert)
(adjust_overlays_for_delete): Repeat for all buffers sharing the same text.

* src/itree.c (itree_insert_gap, itree_delete_gap): Allow an empty tree.

* test/src/buffer-tests.el (buffer-tests--overlays-indirect-bug58928):
New test.
2022-11-01 21:39:12 -04:00
Stefan Kangas
2fa8f1b77a elide-head: Make trailing "/" in URL optional
* lisp/elide-head.el (elide-head-headers-to-hide): Make trailing
"/" in the gnu.org URL optional for the GPL.
* test/lisp/elide-head-tests.el
(elide-head--test-headers-to-hide/gpl3-5): New test.
2022-10-30 14:32:24 +01:00
Andrey Listopadov
76a5ce5d86 Allow passing the SPEC-TYPE argument via :custom-face
GitHub-reference: https://github.com/jwiegley/use-package/issues/1008
Copyright-paperwork-exempt: yes
2022-10-29 13:26:31 +03:00
Yuan Fu
4552b01d8c
Remove test of treesit-language-at
Because now it just calls a user-supplied function rather than doing
any work by itself.

* test/src/treesit-tests.el (treesit-parser-supplemental): Remove the
test.
2022-10-28 20:17:43 -07:00
Stefan Monnier
71589b101c Merge remote-tracking branch 'origin/feature/noverlay' 2022-10-28 17:44:44 -04:00
Stefan Monnier
d79cdcd4ff cconv.el: Fix regression in cconv-tests-interactive-closure-bug51695
The new code to make interpreted closures safe-for-space introduced
a regression in `cconv-tests-interactive-closure-bug51695`, only seen
when using TEST_LOAD_EL.
A few other issues were found and fixed along the way.

* lisp/emacs-lisp/cconv.el (cconv-fv): Change calling convention and
focus on finding the free variables.
(cconv-make-interpreted-closure): New function.

* lisp/loadup.el: Use `compiled-function-p` rather than
`byte-code-function-p` so we also use safe-for-space interpreted
closures when we build with native compilation.
(internal-make-interpreted-closure-function):
Use `cconv-make-interpreted-closure`.

* src/eval.c (syms_of_eval): Rename `internal-filter-closure-env-function`
to `internal-make-interpreted-closure-function`.
(Ffunction): Let that new var build the actual closure.

* test/lisp/emacs-lisp/cconv-tests.el
(cconv-tests-interactive-closure-bug51695): Test specifically the
interpreted case.
2022-10-28 11:33:24 -04:00
Wamm K. D
e893fd1073 Fix failing test for package Hierarchy
This fixes a typo in one of the tests of Hierarchy which was causing
the test to fail.
* test/lisp/emacs-lisp/hierarchy-tests.el (hierarchy-delayed-add-trees):
Fix typo.
2022-10-28 10:33:18 +03:00
Stefan Kangas
41d3d71a1e ; Fix typos in symbol names 2022-10-27 23:04:37 +02:00
Wamm K. D
c6ec08e49a Allow Hierarchy to delay computation of children
This adds an option to allow callers to specify that computing
the children of the hierarchy should be delayed to when the
user calls for them, by utilizing the tree-widget :expander
property.
* lisp/emacs-lisp/hierarchy.el (hierarchy-add-tree)
(hierarchy-add-trees): Add parameter 'delay-children-p'.
* lisp/emacs-lisp/hierarchy.el
(hierarchy--create-delayed-tree-widget): Add function.
* lisp/emacs-lisp/hierarchy.el (hierarchy-convert-to-tree-widget):
Utilize ':expander' if delaying children.  (Bug#55900)

* test/lisp/emacs-lisp/hierarchy-tests.el: Add tests for
delayed-children functionality.
2022-10-27 20:12:24 +03:00
kobarity
7ac3d91eb2 Disable completion/ElDoc/FFAP when Python program is running
* lisp/progmodes/python.el (python-completion-at-point)
(python-ffap-module-path, python-eldoc--get-doc-at-point): Add check
using `python-util-comint-end-of-output-p'.
(python-util-comint-end-of-output-p): New function.
* test/lisp/progmodes/python-tests.el (python-tests-shell-wait-for-prompt):
Use `python-util-comint-end-of-output-p'.
(python-completion-at-point-while-running-1)
(python-ffap-module-path-1)
(python-ffap-module-path-while-running-1)
(python-eldoc--get-doc-at-point-1)
(python-eldoc--get-doc-at-point-while-running-1): New tests.
(Bug#58713)
2022-10-27 19:04:14 +03:00
Stefan Kangas
092776c7eb ; Update copyright years
* doc/lispref/parsing.texi:
* src/treesit.h:
* test/src/treesit-tests.el: Update copyright years.
2022-10-27 12:15:32 +02:00
Stefan Kangas
db2ed9f333 ; Fix several symbol name typos 2022-10-26 23:04:23 +02:00
Stefan Kangas
d73b86a90a Fix typo in textsec-restriction-level
* lisp/international/textsec.el (textsec-restriction-level):
* test/lisp/international/textsec-tests.el (test-restriction-level):
Fix typo in symbol name `moderately-restrictive'.
2022-10-26 23:02:30 +02:00
Yuan Fu
7c5d434833
New tree-sitter toggle scheme
This version: central variable, everything controlled by
treesit-settings.  Major mode sets up tree-sitter/non-tree-sitter
in a conditional branch, based on the setting.

* lisp/treesit.el (treesit-settings): New option.
(treesit-defun-type-regexp): Change docstring.
(treesit-mode-supported)
(treesit-required-languages)
(treesit--local-variable-backup): Remove variables.
(treesit--backup-local-variable)
(treesit-mode)
(global-treesit-mode--turn-on)
(global-treesit-mode): Remove functions.
(treesit--setting-for-mode): New function.
(treesit-ready-p): New argument MODE, changed REPORT to QUIET, and
LANGUAGEs to LANGUAGE (now it can be a single symbol or a list of
them).
(treesit-major-mode-setup): New function.  Mostly comes from
treesit-mode.

* test/src/treesit-tests.el (treesit-misc): New test.

* lisp/progmodes/python.el (python-mode): Move some setup code into
the conditional branch at the end.

* lisp/progmodes/js.el (js-json-mode)
(js-mode): Move some setup code into the conditional branch at the
end.

* lisp/progmodes/ts-mode.el: Move tree-sitter setup into the
conditional branch.
2022-10-25 14:07:47 -07:00
Mattias Engdegård
36f5a1a7e7 Fix regexp matching with atomic strings and optimised backtracking
This bug occurs when an atomic pattern is matched at the end of
a string and the on-failure-keep-string-jump optimisation is
in effect, as in:

  (string-match "\\'\\(?:ab\\)*\\'" "a")

which succeeded but clearly should not (bug#58726).

Reported by Michael Heerdegen.

* src/regex-emacs.c (PREFETCH): Add reset parameter.
(re_match_2_internal): Use it for proper atomic pattern treatment.
* test/src/regex-emacs-tests.el (regexp-atomic-failure): New test.
2022-10-24 11:50:13 +02:00
Matt Armstrong
555bc1f8b3 Add `get-pos-property' tests covering bug#58706
* test/src/buffer-tests.el (get-pos-property-overlay-beg): New test.
(get-pos-property-overlay-empty-rear-advance): ditto.
(get-pos-property-overlay-past-rear-advance): ditto.
(get-pos-property-overlay-at-narrowed-end): ditto.
2022-10-22 20:58:09 -07:00
Basil L. Contovounesios
9db7b11cf7 Improve error reporting of EUDC plist functions
* lisp/net/eudc.el (eudc--plist-member): Signal a more
informative wrong-type-argument instead of a generic error
(bug#58531#19, bug#58720).
* test/lisp/net/eudc-tests.el (eudc--plist-member)
(eudc-plist-member, eudc-plist-get, eudc-lax-plist-get):
Update tests accordingly.
2022-10-23 00:44:52 +03:00
Basil L. Contovounesios
9da2efb670 Audit some plist uses with new predicate argument
* doc/lispref/lists.texi (Plist Access): Improve description of
default predicate.
* lisp/emacs-lisp/cl-extra.el (cl-getf, cl--set-getf): Assume
plist-member always returns a cons.
* lisp/emacs-lisp/gv.el (plist-get): Support new optional predicate
argument (bug#47425#91).
* lisp/emacs-lisp/map.el: Bump minor version.
(map--dispatch): Remove now that bug#58563 is fixed.  Break two
remaining uses out into corresponding cl-defmethods.
(map--plist-p): Add docstring.
(map--plist-has-predicate, map--plist-member-1, map--plist-member)
(map--plist-put-1, map--plist-put): New definitions for supporting
predicate argument backward compatibly.
(map-elt): Fix generalized variable getter under a
predicate (bug#58531).  Use predicate when given a plist.
(map-put): Avoid gratuitous warnings when called without the hidden
predicate argument.  Improve obsoletion message.
(map-put!): Use predicate when given a plist.
(map-contains-key): Ditto.  Declare forgotten
advertised-calling-convention (bug#58531#19).
(map--put): Group definition in file together with that of map-put!.
* lisp/files-x.el (connection-local-normalize-criteria): Simplify
using mapcan + plist-get.
* lisp/net/eudc.el (eudc--plist-member): New convenience function.
(eudc-plist-member, eudc-plist-get, eudc-lax-plist-get): Use it
instead of open-coding plist-member.
* src/fns.c (Fplist_get, plist_get, Fplist_put, plist_put): Pass the
plist element as the first argument to the predicate, for
consistency with assoc + alist-get.
(Fplist_member, plist_member): Move from widget to plist section.
Open-code the EQ case in plist_member, and call it from
Fplist_member in that case, rather than the other way around.

* test/lisp/apropos-tests.el (apropos-tests-format-plist): Avoid
polluting obarray.
* test/lisp/emacs-lisp/cl-extra-tests.el (cl-getf): Extend test with
generalized variables, degenerate plists, and improper lists.
* test/lisp/emacs-lisp/gv-tests.el: Byte-compile file; in the
meantime bug#24402 seems to have been fixed or worked around.
(gv-setter-edebug): Inhibit printing messages.
(gv-plist-get): Avoid modifying constant literals.  Also test with a
predicate argument.
* test/lisp/emacs-lisp/map-tests.el (with-maps-do): Simplify
docstring.
(test-map-elt-testfn): Rename...
(test-map-elt-testfn-alist): ...to this.  Also test with a predicate
argument.
(test-map-elt-testfn-plist, test-map-elt-gv, test-map-elt-signature)
(test-map-put!-plist, test-map-put!-signature)
(test-map-contains-key-signature, test-map-plist-member)
(test-map-plist-put): New tests.
(test-map-contains-key-testfn): Also test with a predicate argument.
(test-map-setf-alist-overwrite-key, test-map-setf-plist-insert-key)
(test-map-setf-plist-overwrite-key): Avoid modifying constant
literals.
(test-hash-table-setf-insert-key)
(test-hash-table-setf-overwrite-key): Fix indentation.
(test-setf-map-with-function): Make test more precise.
* test/lisp/net/eudc-tests.el: New file.
* test/lisp/subr-tests.el (test-plistp): Extend test with circular
list.
* test/src/fns-tests.el (test-cycle-equal, test-cycle-nconc): Move
from plist section to circular list section.
(plist-put/odd-number-of-elements): Avoid modifying constant
literals.
(plist-member/improper-list): Simplify.
(test-plist): Move to plist section.  Also test with a predicate
argument.
2022-10-22 19:33:12 +03:00
Matt Armstrong
f2a51774a9 Fix a narrow-to-region vs. overlays-at bug
See bug#58703.

* src/buffer.c (overlays_in): Add a new TRAILING arg expressing the
behavior wanted by `overlays-at', namely to include all overlays
beginning at the POS passed to `overlays-at', even if POS is the end
of the narrowed region.  Pass true and the search range is extended to
ZV+1 if END is greater than ZV, just as is done for EMPTY.
(overlays_at): Pass 'true' for the new trailing arg.  At present this
is the only caller passing 'true'.
(mouse_face_overlay_overlaps): Pass 'false' for the new trailing arg.
(disable_line_numbers_overlay_at_eob): ditto.
(Foverlays_in): ditto.
* src/editfns.c (overlays_around): ditto.
* test/src/buffer-tests.el (sorted-overlays): Add a spot test for
this.
2022-10-21 19:58:34 -07:00
Matt Armstrong
a2fde77b5c Fix handling of overlays that begin at END in 'overlays_in'
When passed EMPTY, 'overlays_in' should return empty overlays at END.
It was doing so, but it was also returning any other overlay that
happened to begin at END.

bug#58672

* src/buffer.c (overlays_in): Don't return overlays at END unless they
are empty overlays.
(disable_line_numbers_overlay_at_eob): Pass 'false' instead of 'NULL'
for the bool 'empty' arg.
* test/src/buffer-tests.el (sorted-overlays-in): New helper function.
(test-overlays-in-empty-range): New test exhaustively covering these
edge conditions.
(test-overlays-in-empty-range-bug58672): Simple test for one case.
2022-10-21 16:19:56 -07:00
Nacho Barrientos
40a361fbd6 Bindat (src, strz): Operate on vectors too
Copyright-paperwork-exempt: yes

* lisp/emacs-lisp/bindat.el (bindat--unpack-str, bindat--unpack-strz):
Fix the non-string case.
* test/lisp/emacs-lisp/bindat-tests.el (bindat-test--strz-array-unpack)
(bindat-test--str-simple-array-unpack,bindat-test--str-combined-array-unpack):
New tests.
2022-10-21 11:26:36 -04:00
Mauro Aranda
7ee5b0f85f Improve HERE document detection in perl-mode
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function):
Detect indented HERE documents when using a bare identifier.
(perl--syntax-exp-intro-keywords): Recognize HERE documents that come
after die, warn and eval.
(perl--syntax-exp-intro-regexp): Identify HERE documents when printing
to a filehandle with printf? and when they appear after a fat comma.

* test/lisp/progmodes/cperl-mode-resources/here-docs.pl: Add more tests.
2022-10-20 07:34:38 -03:00
Stefan Kangas
a57a3746d8 ; * test/lisp/image/wallpaper-tests.el: Simplify last change. 2022-10-19 20:53:36 +02:00
Stefan Kangas
b96f441139 ; Delete file after wallpaper test
* test/lisp/image/wallpaper-tests.el
(wallpaper-set/calls-init-action): Don't leave temp file behind.
2022-10-19 16:20:02 +02:00
Jim Porter
cee1cbfd54 Improve handling of $PATH in Eshell for remote directories
* lisp/eshell/esh-util.el (eshell-path-env, eshell-parse-colon-path):
Make obsolete.
(eshell-path-env-list): New variable.
(eshell-connection-default-profile): New connection-local profile.
(eshell-get-path): Reimplement using 'eshell-path-env-list'; add
LITERAL-P argument.
(eshell-set-path): New function.

* lisp/eshell/esh-var.el (eshell-variable-aliases-list): Add entry for
$PATH.
(eshell-var-initialize): Add 'eshell-path-env-list' to
'eshell-subcommand-bindings'.

* lisp/eshell/esh-ext.el (eshell-search-path): Use 'file-name-concat'
instead of 'concat'.
(eshell/addpath): Use 'eshell-get-path' and 'eshell-set-path'.

* lisp/net/tramp-integration.el: Only apply Eshell hooks when
'eshell-path-env-list' is unbound.

* test/lisp/eshell/esh-var-tests.el
(esh-var-test/path-var/local-directory)
(esh-var-test/path-var/remote-directory, esh-var-test/path-var/set)
(esh-var-test/path-var/set-locally)
(esh-var-test/path-var-preserve-across-hosts): New tests.

* test/lisp/eshell/esh-ext-tests.el: New file.

* test/lisp/eshell/eshell-tests-helpers.el
(with-temp-eshell): Set 'eshell-last-dir-ring-file-name' to nil.
(eshell-tests-remote-accessible-p, eshell-last-input)
(eshell-last-output): New functions.
(eshell-match-output, eshell-match-output--explainer): Use
'eshell-last-input' and 'eshell-last-output'.

* doc/misc/eshell.texi (Variables): Document $PATH.

* etc/NEWS: Announce this change (bug#57556).
2022-10-17 18:48:52 -07:00
Jim Porter
7c41016fca Allow setting the values of variable aliases in Eshell
This makes commands like "COLUMNS=40 some-command" work as expected.

* lisp/eshell/esh-cmd.el (eshell-subcommand-bindings): Remove
'process-environment' from here...

* lisp/eshell/esh-var.el (eshell-var-initialize): ... and add to here,
along with 'eshell-variable-aliases-list'.
(eshell-inside-emacs): Convert to a 'defvar-local' to make it settable
in a particular Eshell buffer.
(eshell-variable-aliases-list): Make $?, $$, and $* read-only and
update docstring.
(eshell-set-variable): New function...
(eshell-handle-local-variables, eshell/export, eshell/unset): ... use
it.
(eshell/set, pcomplete/eshell-mode/set): New functions.
(eshell-get-variable): Get the variable alias's getter function when
appropriate and use a safer method for checking function arity.

* test/lisp/eshell/esh-var-tests.el (esh-var-test/set/env-var)
(esh-var-test/set/symbol, esh-var-test/unset/env-var)
(esh-var-test/unset/symbol, esh-var-test/setq, esh-var-test/export)
(esh-var-test/local-variables, esh-var-test/alias/function)
(esh-var-test/alias/function-pair, esh-var-test/alias/string)
(esh-var-test/alias/string/prefer-lisp, esh-var-test/alias/symbol)
(esh-var-test/alias/symbol-pair, esh-var-test/alias/export)
(esh-var-test/alias/local-variables): New tests.

* doc/misc/eshell.texi (Built-ins): Add 'set' and update 'unset'
documentation.
(Variables): Expand documentation of how to get/set variables.
2022-10-17 18:48:52 -07:00
Jim Porter
2c82530f47 ; Allow ignoring errors when calling 'eshell-match-command-output'
* test/lisp/eshell/eshell-tests-helpers.el
(eshell-match-command-output): New argument IGNORE-ERRORS.

* test/lisp/eshell/esh-var-tests.el
(esh-var-test/last-status-var-lisp-command)
(esh-var-test/last-status-var-lisp-form)
(esh-var-test/last-status-var-lisp-form-2): Ignore errors when calling
'eshell-match-command-output'.
2022-10-17 18:48:52 -07:00
Jim Porter
3cc356abfe Add helpers to dynamically assign connection-local values
* lisp/files-x.el (connection-local-criteria)
(connection-local-profile-name-for-setq): New variables.
(with-connection-local-variables-1): ... let-bind them here.
(connection-local-update-profile-variables)
(connection-local-profile-name-for-criteria): New functions.
(with-connection-local-application-variables, setq-connection-local):
New macros.

* test/lisp/files-x-tests.el: Require 'tramp-integration'
(files-x-test--variable5, remote-lazy-var): New variables.
(files-x-test-hack-connection-local-variables-apply): Expand checks.
(files-x-test-with-connection-local-variables): Remove
'hack-connection-local-variables-apply' check (it belongs in the above
test), and expand some other checks.
(files-x-test--get-lazy-var, files-x-test--set-lazy-var): New
functions.
(files-x-test-connection-local-update-profile-variables)
(files-x-test-setq-connection-local): New tests.

* doc/lispref/variables.texi (Connection Local Variables): Split into
two subsections and document the new features.

* etc/NEWS: Announce 'setq-connection-local'.
2022-10-17 18:48:52 -07:00
Jim Porter
1beb389e47 ; Remove over-quoting of :application values in connection-local variables
* test/lisp/files-x-tests.el (files-x-test--application)
(files-x-test--another-application):
* doc/lispref/variables.texi (Connection Local Variables): Remove
extra quotes.
2022-10-17 18:48:52 -07:00
Yuan Fu
0be9a639fc
Skip tree-sitter tests unless language definition is available
* test/src/treesit-tests.el (treesit-basic-parsing)
(treesit-node-api)
(treesit-query-api)
(treesit-narrow)
(treesit-cross-boundary)
(treesit-multi-lang)
(treesit-node-supplemental): Add skip-unless form.
2022-10-17 14:00:12 -07:00
Basil L. Contovounesios
dd7f1bb3a1 Silence recent comp-tests.el lexvar warnings
* test/lisp/emacs-lisp/comp-tests.el: Mark used native-compile
variables as special to pacify unknown lexvar warnings in the
default build.
(with-test-native-compile-prune-cache): Instrument macro arguments
for debugging and indent conventionally.  Reindent all callers.
(test-native-compile-prune-cache/dont-delete-in-parent-of-cache):
Simplify file name expansion.
2022-10-17 21:02:26 +03:00
Stefan Kangas
40b734c500 Don't prune *.eln files in parent of eln-load-path
* lisp/emacs-lisp/comp.el (native-compile-prune-cache): Don't
prune *.eln files in parent directory of `native-comp-eln-load-path'.
* test/lisp/emacs-lisp/comp-tests.el
(test-native-compile-prune-cache/dont-delete-in-parent-of-cache):
New test.
2022-10-17 15:26:34 +02:00
Stefan Kangas
24b85b10e3 Add tests for native-compile-prune-cache
* test/lisp/comp-tests.el: New file.
2022-10-17 15:26:34 +02:00
Andrey Listopadov
6b344a9197 Use face-spec-set instead of custom-set-faces
GitHub-reference: https://github.com/jwiegley/use-package/issues/934
Copyright-paperwork-exempt: yes
2022-10-17 09:18:51 +03:00
Stefan Monnier
13d6e8fa54 cl-generic: Fix advertised-calling-convention declarations
* lisp/emacs-lisp/cl-generic.el (cl-generic-define-method):
Preserve the `advertised-calling-convention`, if any (bug#58563).

* lisp/subr.el (declare): Warn when we hit this.

* lisp/emacs-lisp/byte-run.el (get-advertised-calling-convention): New fun.
* lisp/progmodes/elisp-mode.el (elisp-get-fnsym-args-string):
* lisp/help-fns.el (help-fns--signature):
* lisp/emacs-lisp/bytecomp.el (byte-compile-fdefinition): Use it.

* test/lisp/emacs-lisp/cl-generic-tests.el (cl-generic-tests--acc): New fun.
(cl-generic-tests--advertised-calling-convention-bug58563): New test.
2022-10-16 12:01:47 -04:00
kobarity
0e5fc2345d Move and rename Python completion ERTs
* test/lisp/progmodes/python-tests.el
(python-shell-completion-at-point-1)
(python-shell-completion-at-point-native-1)
(python-completion-at-point-1)
(python-completion-at-point-2, python-completion-at-point-pdb-1)
(python-completion-at-point-native-1)
(python-completion-at-point-native-2)
(python-completion-at-point-native-with-ffap-1)
(python-completion-at-point-native-with-eldoc-1): Renamed tests
(bug#58565).
2022-10-16 15:26:49 +02:00
kobarity
cb975c6183 Fix invalid search bound error in python-shell-completion-at-point
* lisp/progmodes/python.el (python-shell-completion-at-point): Add
check if point is before line-start.
* test/lisp/progmodes/python-tests.el (python-shell-completion-shell-buffer-1)
(python-shell-completion-shell-buffer-native-1): New tests
(bug#58548).
2022-10-16 11:26:29 +02:00
kobarity
45aabe6eda Disable completion when PDB is active in Python Shell buffer
* lisp/progmodes/python.el (python-shell-completion-at-point): Disable
completion in Python buffer when PDB is active in Python Shell buffer.
* test/lisp/progmodes/python-tests.el (python-shell-completion-pdb-1):
New test (bug#58562).
2022-10-16 11:15:30 +02:00
Stefan Kangas
c4c4a60f71 Expand 'random' testsuite
* test/src/fns-tests.el (ert): Require.
(fns-tests-random): Expand test.
2022-10-16 08:23:55 +02:00
Stefan Kangas
3187225416 ; Prefer HTTPS to HTTP in many URLs 2022-10-15 13:06:45 +02:00
Stephen Gildea
0bf3873b1c ; improve test coverage of time-stamp-pattern parsing
* test/lisp/time-stamp-tests.el (time-stamp-test-pattern-multiply,
time-stamp-test-pattern-sequential): broaden range of test data
2022-10-14 20:47:27 -07:00
Basil L. Contovounesios
f5c6e628ed Update image-circular-tests.el
* test/manual/image-circular-tests.el
(image-test-duplicate-keywords): Skip unless images are supported.
(image-test-circular-plist, image-test-:type-property-value): Ditto.
Wrap only failing forms in should[-error] rather than entire test
bodies.  Use simpler printed notation in place of function calls.
(image-test-circular-specs): Ditto.  Wrap overly wide docstring.
Mark as failing since shortly after its introduction (bug#36403#63).
2022-10-15 01:10:31 +03:00
Stefan Monnier
b865053874 src/textprop.c (get_char_property_and_overlay): Fix bug#58479
Correct `get-char-property` which failed to ignore empty overlays.

* src/textprop.c (get_char_property_and_overlay): Make sure the
overlay covers the character.
* test/src/buffer-tests.el (buffer-tests--overlay-bug58479): New test.
* src/buffer.h (buffer_has_overlays): Avoid `interval_tree_size`.
2022-10-14 16:28:33 -04:00
John Wiegley
c0338e06cd Merge pull request from conao3/add-commands-keyword
GitHub-reference: https://github.com/jwiegley/use-package/issues/917
2022-10-12 13:43:57 -04:00
kobarity
aa559c1553 Fix Python completion when point in shell buffer is before prompt
* lisp/progmodes/python.el (python-shell-completion-at-point): Limit
prompt boundaries check to shell buffer.
* test/lisp/progmodes/python-tests.el (python-shell-completion-2):
(python-shell-completion-native-2): New tests (bug#58441).
2022-10-12 13:14:33 +02:00
kobarity
b0585441a3 Fix Python completion failure under certain conditions
* lisp/progmodes/python.el (python-shell-send-string-no-output):
Save and restore `comint-last-prompt-overlay' or `comint-last-prompt'.
* test/lisp/progmodes/python-tests.el (python-tests-shell-wait-for-prompt):
New helper function.
(python-tests-with-temp-buffer-with-shell): New helper macro.
(python-shell-completion-1, python-shell-completion-native-1)
(python-shell-completion-native-with-ffap-1)
(python-shell-completion-native-with-eldoc-1): New tests (bug#58389).
2022-10-11 02:29:42 +02:00
Lars Ingebrigtsen
8851a75ca7 Add a test for sqlite "insert ... returning"
* test/src/sqlite-tests.el (sqlite-returning): Add a test for
"insert ... returning".
2022-10-10 14:10:04 +02:00
Matt Armstrong
246acbddbe ; * test/src/buffer-tests.el: Remove unecessary `message' calls. 2022-10-09 19:24:53 -07:00
Matt Armstrong
92a0bf6ce2 ; * test/src/buffer-tests.el (test-overlay-randomly): new test. 2022-10-08 20:37:28 -07:00
Mattias Engdegård
81eb7c1809 ; * test/src/fns-tests.el (fns-tests--string-lessp-cases): Extend. 2022-10-08 18:48:30 +02:00
Stefan Monnier
8de7995ae6 package.el: Understand a few more variations in tarball formats
* lisp/emacs-lisp/package.el (package-untar-buffer): Fix thinko.
(package-tar-file-info): Handle the case where the first file is in
a subdirectory.

* test/lisp/emacs-lisp/package-tests.el (package-test-bug58367): New test.
* test/lisp/emacs-lisp/package-resources/ustar-withsub-0.1.tar:
* test/lisp/emacs-lisp/package-resources/v7-withsub-0.1.tar: New files.
2022-10-08 12:19:40 -04:00
Stefan Kangas
5e83c0117e Fix setting the wallpaper with "swaybg" and "wbg"
* lisp/image/wallpaper.el (wallpaper-setter): Add 'init-action'
and 'detach' fields to structure.
(wallpaper--init-action-kill): New helper function.
(wallpaper--default-setters): Use above new fields for "swaybg" and
"wbg", to start/restart the corresponding processes as needed.
(wallpaper-default-set-function): Call 'init-action' function if
there is one.  If 'detach', use 'call-process' instead of
'start-process'.  (Bug#57781)

* test/lisp/image/wallpaper-tests.el (wallpaper--find-setter)
(wallpaper--find-setter/call-predicate)
(wallpaper--find-setter/set-current-setter)
(wallpaper-set/runs-command, wallpaper-set/runs-command/detach)
(wallpaper-set/calls-init-action)
(wallpaper-set/calls-wallpaper-set-function): New tests.
2022-10-07 22:07:09 +02:00
Yuan Fu
cea1e95d38
Merge branch 'master' into feature/tree-sitter 2022-10-06 11:06:07 -07:00
Justus Winter
9a529537e3 Replace aging OpenPGP artifacts in gnus' mml-sec tests.
This replaces the old OpenPGPv4 keys that are used in the test suite
with more modern OpenPGPv4 keys.

Having old cryptographic artifacts in the test suite presents a
problem once the old algorithms are rejected by contemporary
implementations (bug#58301).
2022-10-06 14:54:57 +02:00
Justus Winter
8352cf53bd Replace aging OpenPGP artifacts in the package-resources tests.
This replaces the old OpenPGPv4 key that is used in the test suite
with a more modern OpenPGPv4 key.  The key is the Alice key from
https://datatracker.ietf.org/doc/draft-bre-openpgp-samples/.  All
cryptographic artifacts in the test suite are updated accordingly.

Having old cryptographic artifacts in the test suite presents a
problem once the old algorithms are rejected by contemporary
implementations.
2022-10-06 14:53:41 +02:00
Justus Winter
40e957c622 Replace aging OpenPGP artifacts in the epg tests.
This replaces the old OpenPGPv4 key that is used in the test suite
with a more modern OpenPGPv4 key.  The key is the Alice key from
https://datatracker.ietf.org/doc/draft-bre-openpgp-samples/.  All
cryptographic artifacts in the test suite are updated accordingly.

Having old cryptographic artifacts in the test suite presents a
problem once the old algorithms are rejected by contemporary
implementations.
2022-10-06 14:53:39 +02:00
Yuan Fu
7ebbd4efc3
Merge branch 'master' into feature/tree-sitter 2022-10-05 14:22:03 -07:00
Lars Ingebrigtsen
92df7cd923 Add 'seq-keep'
* doc/lispref/sequences.texi (Sequence Functions): Document it.
* lisp/emacs-lisp/seq.el (seq-keep): New function (bug#58278).
2022-10-04 21:44:52 +02:00
Eli Zaretskii
db6072f530 Revert "Improve manual display tests of undisplayable chars (bug#58168)"
This reverts commit 849b7756fd.
Please don't rush installing changes that are still being
discussed.
2022-10-04 19:15:17 +03:00
Mattias Engdegård
849b7756fd Improve manual display tests of undisplayable chars (bug#58168)
Test display of multibyte raw bytes, as well as undisplayable
multibyte chars (C1 controls and other values).

The test still assumes that raw bytes should be displayed identically
to undisplayable characters (such as C1 controls) because that is how
the display code currently works.

* test/manual/redisplay-testsuite.el (test-redisplay-5-toggle)
(test-redisplay-5): Fix likely typo (#x3fffc) of raw byte value.
(test-redisplay-6): New.
2022-10-04 16:44:34 +02:00
Stefan Kangas
8a2bc86039 ; Fix two wallpaper tests
* test/lisp/image/wallpaper-tests.el
(wallpaper--find-command/return-string)
(wallpaper--find-command-args/return-list): Fix tests.
2022-10-01 22:38:58 +02:00
Matthias Meulien
abc955d017 Rename osc.el to ansi-osc.el (bug#58200)
* lisp/osc.el: Move from here...
* lisp/ansi-osc.el: ...to here.
* test/lisp/osc-tests.el: Move from here...
* test/lisp/ansi-osc-tests.el: ...to here.
2022-10-01 11:58:27 +02:00
Mattias Engdegård
ec5af48a18 Strengthen string-lessp tests
* test/src/fns-tests.el (fns-tests--string-lessp-cases)
(fns-tests-string-lessp): Check more cases, and in a more robust way.
2022-09-30 16:28:46 +02:00
Stefan Kangas
5281946fbf Make format-spec accept function substitutions
* lisp/format-spec.el (format-spec): Accept a function producing the
substitution for a character.
* doc/lispref/strings.texi (Custom Format Strings): Document the
above change.
* test/lisp/format-spec-tests.el (format-spec/function): New test.
Ref. https://lists.gnu.org/r/emacs-devel/2022-09/msg01875.html
2022-09-29 15:39:27 +02:00
Stefan Kangas
423bdd5f7f ; Fix typos (prefer American spelling) 2022-09-29 15:20:07 +02:00
Jacob First
ec96b47664 bind-keys supports passing a list of keymaps as :map argument 2022-09-29 04:01:42 -04:00
Stefan Kangas
7280f3f073 ; Fix typos 2022-09-28 17:34:59 +02:00
Stefan Kangas
26ef0f1221 ; image-dired: Fix last change
* test/lisp/image/image-dired-util-tests.el
(image-dired-thumb-name/per-directory):
* lisp/image/image-dired-util.el (image-dired-thumb-name): Fix
last change.
2022-09-28 14:29:11 +02:00
Stefan Kangas
6cffaa3b6d image-dired: End thumbnail file names with ".jpg"
* lisp/image/image-dired-util.el (image-dired-thumb-name): Always
end thumbnail name in ".jpg" and simplify naming to just use the
SHA-1 hash.  (Bug#57961)
* test/lisp/image/image-dired-util-tests.el
(image-dired-thumb-name/image-dired): Adjust test for the above
change.
* etc/NEWS: Announce the above change.
2022-09-28 12:36:42 +02:00
Paul Eggert
f6fb2b9e1f Port better to C23 bool+true+false keywords
C23 is adding the C++ keywords bool, true, and false;
prefer them to <stdbool.h> if they are available.
* admin/merge-gnulib (GNULIB_MODULES):
Add stdbool, which emulates C23 on pre-C23 platforms.
(AVOIDED_MODULES): Remove stdbool; Gnulib has renamed
this module to stdbool-c99 and nobody uses it so it does
not need to be avoided.
* m4/c-bool.m4: New file, from Gnulib stdbool module.
* lib-src/seccomp-filter.c, src/conf_post.h, src/dynlib.h:
* src/emacs-module.c, src/nsterm.m, src/systhread.h:
* test/src/emacs-module-resources/mod-test.c:
Use the C23 style and use bool without including <stdbool.h>.
The Gnulib stdbool module causes config.h to include stdbool.h
on pre-C23 platforms.
* src/emacs-module.h.in:
Don’t include <stdbool.h> if C23 or later, or if
it has already been included.
2022-09-28 01:09:01 -07:00
Richard Hansen
fd653f5208 ; whitespace: Add test case for read-only buffers (bug#58082) 2022-09-27 13:44:04 +02:00
Stefan Kangas
b0289e7f6d Fix setting the wallpaper in XFCE
* lisp/image/wallpaper.el  (wallpaper-command-args)
(wallpaper-default-set-function): Support new format specifiers
%S for screen, %W for workspace, and %M for monitor.
(wallpaper--default-setters): Use above new specifiers for XFCE.
(wallpaper--format-arg): New defun broken out from...
(wallpaper-default-set-function): ...here.
(wallpaper--get-height-or-width): Support noninteractive use.
* test/lisp/image/wallpaper-tests.el (wallpaper--format-arg/filename)
(wallpaper--format-arg/filename-hex)
(wallpaper--format-arg/width, wallpaper--format-arg/screen)
(wallpaper--format-arg/monitor, wallpaper--format-arg/workspace):
New tests.
2022-09-26 17:41:37 +02:00
Stefan Kangas
35d5ad713e Rewrite wallpaper.el to use a cl-defstruct
* lisp/image/wallpaper.el
(wallpaper--default-commands): Delete variable.
(wallpaper-setter): New cl-defstruct.
(wallpaper--default-methods-create): New macro.
(wallpaper--default-setters):
(wallpaper--current-setter): New variables.
(wallpaper--find-setter): New defun to pick a wallpaper-setter.
(wallpaper--find-command, wallpaper--find-command-args):
Use 'wallpaper--find-setter'.
(wallpaper-command): Doc fix.

* test/lisp/image/wallpaper-tests.el
(wallpaper--find-command/return-string)
(wallpaper--find-command-args/return-list)
(wallpaper--image-file-regexp/return-string): New tests.
2022-09-26 17:41:09 +02:00
Stefan Monnier
650c20f1ca Merge 'master' into noverlay 2022-09-25 16:15:16 -04:00
Mattias Engdegård
fb5a049770 Don't crash in copy-alist with non-list argument
* src/fns.c (Fcopy_alist): Check argument type.
* test/src/fns-tests.el (fns--copy-alist): New test.
2022-09-25 17:04:49 +02:00
Stefan Kangas
ad88e3e0b5 Add reasonable default to wallpaper-set
* lisp/image/wallpaper.el
(wallpaper-default-file-name-regexp): New variable.
(wallpaper--get-default-file): New function.
(wallpaper-set): Use above new function to set a default.
* test/lisp/image/wallpaper-tests.el: New file.
2022-09-25 16:16:51 +02:00
Stefan Kangas
a256f49f08 Make image-dired-thumb-name more portable
* lisp/image/image-dired-util.el
(image-dired-thumb-name): Create file names in a portable manner.
* test/lisp/image/image-dired-util-tests.el
(image-dired-thumb-name/standard)
(image-dired-thumb-name/image-dired)
(image-dired-thumb-name/per-directory): Expand tests.
2022-09-25 14:27:51 +02:00
Yuan Fu
eba6582436
Add the treesit-search functions that supplant the removed ones
The signatures also changed.

treesit-traverse-depth-first   -> treesit-search-subtree
treesit-traverse-breadth-first ->
treesit-traverse-forward       -> treesit-search-forward
treesit-search-forward         -> treesit-search-forward-goto
treesit-search-beginning/end   -> treesit-search-forward-goto
                               -> treesit-induce-sparse-tree

* doc/lispref/parsing.texi (Retrieving Node): Add relevant manual
sections.
* lisp/treesit.el (treesit-search-forward-goto): New function.
* src/treesit.c (ts_traverse_sibling_helper)
(ts_traverse_match_predicate)
(ts_search_dfs)
(ts_search_forward)
(treesit-search-subtree)
(treesit-search-forward)
(ts_build_sparse_tree)
(Ftreesit_induce_sparse_tree): Add functions.
* test/src/treesit-tests.el (treesit-node-supplemental): Add comments.
2022-09-24 21:11:30 -07:00
Yuan Fu
c957832cbf
Remove treesit-traverse functions
Remove before adding the replacements.

* doc/lispref/parsing.texi (Retrieving Node): Remove relevant sections.
* lisp/treesit.el (treesit-traverse-depth-first)
(treesit--traverse-breadth-first-1)
(treesit-traverse-breadth-first)
(treesit-next-sibling-or-up)
(treesit-traverse-forward)
(treesit-search-forward)
(treesit-search-beginning):
(treesit-search-end): Remove functions.
(treesit-defun-query): Remove variable.
(treesit-beginning-of-defun)
(treesit-end-of-defun): Remove functions.
* test/src/treesit-tests.el: Remove comments.
2022-09-24 21:11:30 -07:00
Yuan Fu
013c7d6aae
Rename treesit-expand-query/pattern
* src/treesit.c (treesit-expand-pattern): Rename to
treesit-patter-expand.
(treesit-expand-query): Rename to treesit-query-expand.
(make_ts_query): Use new name.
* test/src/treesit-tests.el (treesit-query-api): Fix name.
2022-09-24 21:11:29 -07:00
kobarity
2084f4ada3 hideshow.el: Improve hs-toggle-hiding behavior
* lisp/progmodes/hideshow.el
(hs-find-block-beginning-match): New function to be used in
`hs-already-hidden-p'.
(hs-already-hidden-p): Add check if beginning of line is inside a
block.
(hs-toggle-hiding): Don't change to selected-window's buffer when
event arg is absent.

* test/lisp/progmodes/hideshow-tests.el
(hideshow-tests-with-temp-buffer-selected): New helper macro.
(hideshow-tests-make-event-at): New helper function.
(hideshow-already-hidden-p-1): New test.
(hideshow-toggle-hiding-1): New test.
(hideshow-mouse-toggle-hiding-1): New test (bug#52092).
2022-09-24 11:08:29 -04:00
Stefan Kangas
4b537dd99f Move thumbs.el to lisp/obsolete
* lisp/thumbs.el:
* test/lisp/thumbs-tests.el: Move from here...
* lisp/obsolete/thumbs.el:
* test/lisp/obsolete/thumbs-tests.el: ...to here.  (Bug#57779)
2022-09-24 14:07:57 +02:00
Stefan Monnier
c244d4af57 cconv.el: Fix interactive closure bug#51695
Make cconv.el detect when a closure's interactive form needs to
capture variables from the context and tweak the code accordingly
if so.

* lisp/emacs-lisp/cconv.el (cconv--interactive-form-funs): New var.
(cconv-convert): Handle the case where the interactive form captures
vars from the surrounding context.  Remove left over handling of
`declare` which was already removed from the cconv-analyze` phase.
(cconv-analyze-form): Adjust analysis of interactive forms accordingly.

* lisp/emacs-lisp/oclosure.el (cconv--interactive-helper): New type and
function.
* lisp/simple.el (function-documentation, oclosure-interactive-form):
Add methods for it.

* test/lisp/emacs-lisp/cconv-tests.el
(cconv-tests-interactive-closure-bug51695): New test.
2022-09-23 16:36:16 -04:00
kobarity
419b873f39 Fix syntax check in python-info-looking-at-beginning-of-defun
* lisp/progmodes/python.el
(python-info-looking-at-beginning-of-defun): Check syntax after moving
to the beginning of line.
* test/lisp/progmodes/python-tests.el (python-nav-beginning-of-defun-6)
(python-end-of-defun-1, python-info-looking-at-beginning-of-defun-3):
New tests (bug#58023).
2022-09-23 17:39:53 +02:00
Mattias Engdegård
47b986d488 Remove max-specpdl-size overrun test
* test/src/eval-tests.el (eval-tests--exceed-specbind-limit)
(eval-exceed-specbind-with-signal-hook): Remove test that is
no longer useful, since there is no longer any specpdl limit
to overrun.  (The test still passed but vacuously so, by
hitting the max-lisp-eval-depth limit instead.)
This silences an obsoletion warning.
2022-09-23 16:10:06 +02:00
Stefan Kangas
8557ecca53 ; Fix warnings in --without-x build
* lisp/image/image-crop.el (image-scaling-factor)
(image-property, image-size, imagep):
* test/src/image-tests.el (image-size, image-mask-p)
(image-metadata): Declare.
2022-09-23 15:19:00 +02:00
Mattias Engdegård
e4964de952 Don't rewrite set to setq of lexical variables
Only perform the rewrite

   (set 'VAR X) -> (setq VAR X)

for dynamic variables, as `set` isn't supposed to affect
lexical vars (and never does so when interpreted).

* lisp/emacs-lisp/byte-opt.el (byte-optimize-set):
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--xx): New.
(bytecomp-tests--test-cases): Add test cases.
* test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el:
Remove obsolete test.
2022-09-22 14:54:15 +02:00
Stefan Kangas
fdfd7ef6f3 Fix failing image-dired test
* test/lisp/image/image-dired-util-tests.el (ert-x, xdg): Require.
(image-dired-thumb-name/): Delete test.
(image-dired-thumb-name/standard)
(image-dired-thumb-name/image-dired)
(image-dired-thumb-name/per-directory): New tests.
2022-09-22 14:20:15 +02:00
Stefan Kangas
661be73b5e * test/lisp/image/image-dired-util-tests.el: New file. 2022-09-21 15:15:42 +02:00
Stefan Kangas
9b14e312f4 Merge from origin/emacs-28
478b786d5a ; * doc/lispref/windows.texi (Window Hooks): Fix a typo (b...
5085351645 * lisp/text-modes/tex-mode.el (tex-mode): Fix AUCTeX regre...
ee6f8598ca Add vc-annotate-switches to manual
616dcf27e5 ; Fix typos in Lisp symbols
5405852541 Remove mention of non-existent `annotate-switches'
191505b8a3 Mention that src/macuvs.h sometimes needs committing
10373c4b68 ; More comment fixes in font.h (bug#57935)
c2595b8dcc ; * src/font.h (struct font_driver): Comment fix.
97b928ce09 MacOS ld warning from native compilation (bug#57849)
2022-09-21 10:25:06 +02:00
Robert Pluim
cee9a2cbe0 Fix substitute-command-keys for global binding lookup
The previous change forgot to account for the (rare) case of doing a
lookup for a global binding when a specific keymap is in force.

* lisp/help.el (substitute-command-keys): Redo lookup in global map if
lookup in specific map fails.
*
test/lisp/help-tests.el (help-tests-substitute-command-keys/keymap-change):
Add testcase for specific map overriding advertised-binding.
2022-09-21 09:15:47 +02:00
Mauro Aranda
1231a601eb Recognize the backslash operator in perl-mode
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function):
Add new rule to detect a backslash operator.  (Bug#11996)

* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-11996): New
test.

* test/lisp/progmodes/cperl-mode-resources/cperl-bug-11996.pl: New
file.
2022-09-20 21:11:40 +02:00
Stefan Kangas
616dcf27e5 ; Fix typos in Lisp symbols 2022-09-20 12:21:40 +02:00
F. Jason Park
132d5cb0a3 Bury new ERC buffers by default
* lisp/erc/erc.el (erc-join-buffer): Change default value to `bury'.
(erc-setup-buffer): Make `window-noselect' behave more like its
description and abstain from ever replacing the current buffer.
* test/lisp/erc/erc-scenarios-base-reconnect.el
(erc-scenarios-common-base-reconnect-options): Update helper to handle
new default value for option `erc-join-buffer'.
(erc-scenarios-base-reconnect-options--buffer): Update and rename
function `erc-scenarios-base-reconnect-options--default'.
(erc-scenarios-base-reconnect-options--default): Update and rename
function `erc-scenarios-base-reconnect-options--bury'.
* etc/ERC-NEWS: Update existing display-buffers section for 5.5.
(Bug#51753)
2022-09-19 17:54:46 -07:00
F. Jason Park
01de334c78 Offer to regexp-quote new items in erc-match commands
* lisp/erc/erc-match.el (erc-match-quote-when-adding) Add new option
to quote new items added to match lists.
(erc-add-entry-to-list): Add optional `alt' parameter indicating
whether to flip the behavior indicated by
`erc-match-quote-when-adding'.
(erc-add-pal, erc-add-fool, erc-add-keyword, erc-add-dangerous-host):
Pass universal arg to `erc-add-entry-to-list' as `alt' argument.
(erc-match-pal-p, erc-match-fool-p, erc-match-keyword-p,
erc-match-dangerous-host-p): Don't bother matching when list is nil.

* lisp/erc/erc.el (erc-list-match (lst str): Join input list as regexp
union instead of looping over items.

* etc/ERC-NEWS: Update misc-UX section for 5.5.

* test/lisp/erc/erc-match-tests.el: New file. (Bug#56450)
2022-09-19 17:54:46 -07:00
F. Jason Park
e98465e541 Stabilize channels variant of erc-reuse-buffers test
* lisp/erc/erc-networks.el (erc-networks--id-sort-buffers): Use
`buffer-local-value' instead of `with-current-buffer'.

* test/lisp/erc/erc-scenarios-base-reuse-buffers.el
(erc-scenarios-common--base-reuse-buffers-channel-buffers): Wait for
buffers to be created by server-initiated JOINs.
(erc-scenarios-base-reuse-buffers-channel-buffers--disabled): Remove
`:unstable' tag.

* test/lisp/erc-tests.el (erc-ring-previous-command): Remove
unnecessary `goto-char'.
2022-09-19 17:54:46 -07:00
F. Jason Park
33fdb1daa3 ; Tag some ERC test-server tests as being :unstable
* test/lisp/erc/resources/base/assoc/samenet/chester.eld: Relax timeout.
* test/lisp/erc/resources/base/assoc/samenet/tester.eld: Relax timeout.
* test/lisp/erc/resources/base/assoc/samenet/tester2.eld: Relax timeout.
* test/lisp/erc/resources/base/netid/samenet/chester.eld: Relax timeout.
* test/lisp/erc/resources/base/netid/samenet/tester.eld: Relax timeout.
* test/lisp/erc/resources/erc-d/erc-d-tests.el (erc-d-run-linger,
erc-d-run-linger-fail, erc-d-run-linger-direct): Mark some tests as
being unstable.
2022-09-19 17:54:46 -07:00
Michael Albinus
c6d3d97bf5 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2022-09-19 21:15:06 +02:00
Mauro Aranda
0275b3a631 perl-mode: / is a regexp match if there's nothing before it
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function):
A "/" that starts the first statement is a regexp match.  (Bug#997)
* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-997): New
test.
2022-09-19 20:36:53 +02:00
Philipp Stephani
a71de4b52d Improve check for misleading 'cl-case' cases (Bug#57915).
* lisp/emacs-lisp/cl-macs.el (cl-case): Check that the case is of the
form (quote FOO), not just (quote).
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-case-no-warning): New unit test.
2022-09-19 13:34:51 +02:00
Michael Albinus
0e5eb6ec8c Revert change in Tramp inotifywait
* lisp/net/tramp-sh.el (tramp-sh-handle-file-notify-add-watch):
Revert use of "-P", it doesn't exist in older inotifywait versions.

* test/lisp/filenotify-tests.el: Deactivate instrumentation.
2022-09-19 11:39:29 +02:00
Matthias Meulien
7354f4e3e6 Extract support of OSC escape sequences from comint
* lisp/comint.el (osc): Now requires osc.el.
(comint-osc-directory-tracker): Alias to osc-directory-tracker.
(comint-osc-hyperlink-handler): Alias to osc-hyperlink-handler.
(comint-osc-hyperlink-map): Alias to osc-hyperlink-map.
(comint-osc-handlers): Alias to osc-handlers.
(comint-osc-hyperlink): Alias to osc-hyperlink.
(comint-osc-process-output): Rewritten to call osc-apply-on-region.
* lisp/osc.el (osc-handlers): Clone comint-osc-handlers.
(osc--marker): Clone comint-osc--marker.
(osc-apply-on-region): Implementation taken from comint-osc-process-output.
(osc-directory-tracker): Clone from comint-osc-directory-tracker.
(osc-hyperlink-map): Clone from comint-osc-hyperlink-map.
(osc-hyperlink): Clone from comint-osc-hyperlink.
(osc-hyperlink--state): Clone from comint-osc-hyperlink--state.
(osc-hyperlink-handler): Clone from comint-osc-hyperlink-handler.
* test/lisp/osc-tests.el (osc): Test osc-apply-region (bug#57821).
2022-09-18 14:49:27 +02:00
Michael Albinus
d7c4532f7c ; Instrument filenotify-tests
Author:
2022-09-18 10:52:34 +02:00
Michael Albinus
67620c2a13 ; Instrument filenotify-tests 2022-09-18 10:51:33 +02:00
Michael Albinus
e2c3ce2402 Sync with Tramp 2.5.3.2. Don't merge with master
* doc/misc/tramp.texi (Android shell setup): Rework.
(Frequently Asked Questions): Improve recommendations for speeding up.

* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.5.4-pre".

* lisp/net/tramp-adb.el (tramp-methods): Use "%d".
(tramp-adb-handle-directory-files-and-attributes): Fix "." and
".." in listing.
(tramp-adb-handle-file-attributes)
(tramp-adb-handle-directory-files-and-attributes)
(tramp-adb-handle-file-name-all-completions): Pipe "ls" output
through "cat", in order to avoid quoting special characters.
(tramp-adb-maybe-open-connection): Compute args from `tramp-login-args'.

* lisp/net/tramp-compat.el (tramp-compat-replace-regexp-in-region):
New defalias.

* lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file):
Adapt check for proper remote command.

* lisp/net/tramp.el (tramp-methods): Adapt docstring.
(tramp-handle-make-process): Check for adb device if indicated.
(tramp-get-remote-tmpdir): Cache result in temporary connection
property.

* test/lisp/net/tramp-tests.el  (tramp-test17-insert-directory)
(tramp-test22-file-times, tramp--test-utf8): Adapt tests.
(tramp--test-shell-file-name): Do not depend on `tramp--test-adb-p'.
(tramp-test46-unload): Ignore autoload functions in
`tramp-file-name' structure tests, since `tramp-file-name-handler'
is also autoloaded in Emacs 29.
2022-09-17 17:50:38 +02:00
Michael Albinus
5bf8f9cc0d Fix recent filenotify-tests changes
* lisp/net/tramp-sh.el (tramp-sh-handle-file-notify-add-watch):
Use "-P".

* test/lisp/filenotify-tests.el (file-notify-test11-symlinks):
Adapt test.
2022-09-17 15:11:00 +02:00
समीर सिंह Sameer Singh
8ec7f8f169 Update Unicode support to Unicode version 15.0.0 (bug#57846)
* admin/unidata/BidiBrackets.txt
* admin/unidata/BidiMirroring.txt
* admin/unidata/Blocks.txt
* admin/unidata/IVD_Sequences.txt
* admin/unidata/IdnaMappingTable.txt
* admin/unidata/NormalizationTest.txt
* admin/unidata/PropertyValueAliases.txt
* admin/unidata/ScriptExtensions.txt
* admin/unidata/Scripts.txt
* admin/unidata/SpecialCasing.txt
* admin/unidata/UnicodeData.txt
* admin/unidata/confusables.txt
* admin/unidata/copyright.html
* admin/unidata/emoji-data.txt
* admin/unidata/emoji-sequences.txt
* admin/unidata/emoji-test.txt
* admin/unidata/emoji-zwj-sequences.txt
* test/manual/BidiCharacterTest.txt: Updated files from Unicode
15.0.

* admin/unidata/unidata-gen.el (unidata-file-alist): Add new ranges.

* lisp/international/fontset.el (script-representative-chars): Add
new scripts.
(otf-script-alist): Update from latest version.
(setup-default-fontset): Add new scripts.
* lisp/international/characters.el: Update syntax and category
tables for new characters and scripts.
(char-width-table): Update for changes in Unicode 15.0.

* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--failing-lines-part1)
(ucs-normalize-tests--failing-lines-part2): Update per the test
results.

* doc/lispref/nonascii.texi (Character Properties): Update Unicode
version number.

* etc/NEWS: Announce support for Unicode 15.0.
2022-09-17 09:51:22 +03:00
Stefan Kangas
6938a2ddd2 Accept more wide function signatures in docstrings
* test/lisp/emacs-lisp/bytecomp-tests.el
("warn-wide-docstring-ignore-function-signature.el"): New test.
* lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p):
Make regexp more allowing to silence warning.
* test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-function-signature.el:
New file.
2022-09-16 22:28:46 +02:00
Michael Albinus
2053e350f3 Enable `dont-follow' for inotify file notifications
* doc/lispref/os.texi (File Notifications): Symlinks aren't followed.

* lisp/filenotify.el (file-notify--add-watch-inotify):
Add `dont-follow' flag.

* lisp/net/tramp.el (tramp-handle-file-notify-rm-watch):
Suppress errors when reading process output.

* test/lisp/filenotify-tests.el (file-notify-test11-symlinks)
(file-notify-test11-symlinks-remote): New tests.
2022-09-16 17:23:59 +02:00
Mattias Engdegård
4da0fbdc82 Faster and more robust list-of-strings-p
* lisp/subr.el (list-of-strings-p): Speed up by a factor 4 (approx.)
and don't crash on dotted lists.
* test/lisp/subr-tests.el (test-list-of-strings-p): Extend test.
2022-09-16 15:33:12 +02:00
Lars Ingebrigtsen
711f908f5d Fix cperl list indentation problem
* lisp/progmodes/cperl-mode.el (cperl-calculate-indent): Indent
foo:bar() in lists correctly (bug#57829).
2022-09-16 13:06:23 +02:00
Lars Ingebrigtsen
7d39453fd6 Add new predicate list-of-strings-p
* lisp/subr.el (list-of-strings-p): New function.
2022-09-16 12:29:54 +02:00
Jim Porter
b8e9239b47 Allow using a symbol as an index into an alist in Eshell
* lisp/eshell/esh-var.el (eshell-index-value): If INDEX is a symbol,
use 'assoc' for indexing.

* test/lisp/eshell/esh-var-tests.el (esh-var-test/interp-var-assoc)
(esh-var-test/quoted-interp-var-assoc): Add checks for indexing via
symbol (bug#57787).
2022-09-14 17:27:21 -07:00
Augusto Stoffel
a994126968 pcomplete: Generate completions from --help messages
* lisp/pcomplete.el (pcomplete-from-help): New function (and hash
table) to get pcomplete candidates from help messages.
(pcomplete-here-using-help): Helper function to define pcomplete for
simple commands
(pcomplete-completions-at-point): Provide annotation-function and
company-docsig properties.
* lisp/pcmpl-git.el: New file, provides pcomplete for Git.
* lisp/pcmpl-gnu.el: Add pcomplete for awk, gpg and gdb, emacs and
emacsclient.
* lisp/pcmpl-linux.el: Add pcomplete for systemctl and journalctl.
* lisp/pcmpl-rpm.el: Add pcomplete for dnf.
* lisp/pcmpl-unix.el: Add pcomplete for sudo and most commands found
in GNU Coreutils.
* lisp/pcmpl-x.el: Add pcomplete for tex, pdftex, latex, pdflatex,
rigrep and rclone.
* test/lisp/pcomplete-tests.el (pcomplete-test-parse-gpg-help,
pcomplete-test-parse-git-help): Tests for the new functions.
2022-09-14 21:58:04 +02:00
Basil L. Contovounesios
6a5043e9f6 Fix more misleading cl-case quoting in tests
* test/lisp/dnd-tests.el (x-begin-drag):
* test/lisp/so-long-tests/so-long-tests-helpers.el
(so-long-tests-assert-active, so-long-tests-assert-reverted): Remove
misleading quoting in cl-case clauses (bug#51368).
2022-09-14 14:20:52 +03:00
Stefan Kangas
fd70791218 Add new function xdg-current-desktop to xdg.el
* lisp/xdg.el (xdg-current-desktop): New function.
* test/lisp/xdg-tests.el (xdg-current-desktop): New test.
2022-09-14 10:23:45 +02:00
Lars Ingebrigtsen
10e9ec6da4 Fix recently-added cl-macs tests
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-case-error)
(cl-case-warning): Fix warning matches.
2022-09-14 02:30:54 +02:00