summaryrefslogtreecommitdiff
path: root/test/lisp
Commit message (Collapse)AuthorAgeFilesLines
* Avoid raw control characters in two filesStefan Kangas2022-11-171-1/+1
| | | | | | | | * 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.
* Improve new connections in erc-handle-irc-urlF. Jason Park2022-11-163-1/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.)
* Add optional server param to erc-networks--determineF. Jason Park2022-11-161-0/+17
| | | | | | | * 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.)
* Default to TLS port when calling erc-tls from lispF. Jason Park2022-11-161-0/+42
| | | | | | | | | | | * 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.)
* Refactor erc-select-read-argsF. Jason Park2022-11-161-0/+89
| | | | | | | | | | | | | | | | * 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.)
* Accommodate ircs:// URLs in url-irc and browse-urlF. Jason Park2022-11-161-0/+9
| | | | | | | | | | | | | | | | | | | | | | | * 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.)
* Improve auto-reconnect visibility in ERCF. Jason Park2022-11-161-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.)
* ; Make some ERC test fixtures a bit more courteousF. Jason Park2022-11-163-2/+5
| | | | | | | | | | | | * 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.
* Support auth-source-pass in ERCF. Jason Park2022-11-161-3/+0
| | | | | | | | | | | | | | | | | | | | | * 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.)
* Make auth-source-pass behave more like other backendsF. Jason Park2022-11-161-2/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Enable/disable 'server-mode' when starting/stopping the serverJim Porter2022-11-161-0/+41
| | | | | | | | | * 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).
* Fix suggest-key-bindings displaying key as commandStefan Kangas2022-11-131-0/+11
| | | | | | | | | * 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.
* New test for execute-extended-command helper defunStefan Kangas2022-11-131-0/+12
| | | | | * test/lisp/simple-tests.el (simple-execute-extended-command--shorter): New test.
* Fix &key parameters called without arguments (bug#58714)Gerd Möllmann2022-11-111-0/+6
| | | | | | * 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.
* Fix indentation for multi-line block start in Python modekobarity2022-11-101-0/+17
| | | | | | | | * 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)
* ; * test/lisp/dired-tests.el (dired-test-bug59047): Rename.Eli Zaretskii2022-11-101-10/+11
|
* Make 'dired-hide-details-mode' work after 'dired-hide-subdir'Gabriel do Nascimento Ribeiro2022-11-101-0/+10
| | | | | | | * lisp/dired.el (dired--unhide): Restore text properties. (Bug#59047) * test/lisp/dired-tests.el (dired-test-bugXXXX): New test.
* Teach thing-at-point to recognize bracketed IPv6 URLsF. Jason Park2022-11-091-0/+3
| | | | | | | | * 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.
* EUDC: Add ecomplete and mailabbrev backendsAlexander Adolf2022-11-083-0/+126
| | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Fix failing eshell alias testsStefan Kangas2022-11-061-9/+11
| | | | | * test/lisp/eshell/esh-var-tests.el (esh-var-test/alias/function) (esh-var-test/alias/symbol-pair): Fix tests. (Bug#59062)
* Add the "doas" alias to eshell.Brian Cully2022-11-051-0/+75
| | | | | | | | | | | | | * 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.
* Move ERC's core dependencies to separate filedickmao2022-11-042-23/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Offer completions for GET subcommand flags in erc-dccF. Jason Park2022-11-041-1/+118
| | | | | | | | | | * 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.
* ; * test/lisp/erc/erc-services-tests.el: Remove cruft.F. Jason Park2022-11-041-16/+8
|
* Fix calling file name handler for `load'.Michael Albinus2022-11-041-4/+7
| | | | | | | | | | * 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.
* Only strip newlines when stringifying a value for EshellJim Porter2022-11-031-0/+57
| | | | | | | | * 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.
* elide-head: Make trailing "/" in URL optionalStefan Kangas2022-10-301-5/+16
| | | | | | | * 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.
* cconv.el: Fix regression in cconv-tests-interactive-closure-bug51695Stefan Monnier2022-10-281-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix failing test for package HierarchyWamm K. D2022-10-281-1/+1
| | | | | | | 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.
* ; Fix typos in symbol namesStefan Kangas2022-10-271-1/+1
|
* Allow Hierarchy to delay computation of childrenWamm K. D2022-10-271-0/+143
| | | | | | | | | | | | | | | | 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.
* Disable completion/ElDoc/FFAP when Python program is runningkobarity2022-10-271-4/+67
| | | | | | | | | | | | | | | * 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)
* Fix typo in textsec-restriction-levelStefan Kangas2022-10-261-1/+1
| | | | | | * lisp/international/textsec.el (textsec-restriction-level): * test/lisp/international/textsec-tests.el (test-restriction-level): Fix typo in symbol name `moderately-restrictive'.
* Improve error reporting of EUDC plist functionsBasil L. Contovounesios2022-10-231-12/+12
| | | | | | | | | * 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.
* Audit some plist uses with new predicate argumentBasil L. Contovounesios2022-10-226-67/+413
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Bindat (src, strz): Operate on vectors tooNacho Barrientos2022-10-211-1/+18
| | | | | | | | | | 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.
* Improve HERE document detection in perl-modeMauro Aranda2022-10-201-0/+66
| | | | | | | | | | | * 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.
* ; * test/lisp/image/wallpaper-tests.el: Simplify last change.Stefan Kangas2022-10-191-6/+2
|
* ; Delete file after wallpaper testStefan Kangas2022-10-191-2/+9
| | | | | * test/lisp/image/wallpaper-tests.el (wallpaper-set/calls-init-action): Don't leave temp file behind.
* Improve handling of $PATH in Eshell for remote directoriesJim Porter2022-10-173-7/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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).
* Allow setting the values of variable aliases in EshellJim Porter2022-10-171-0/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* ; Allow ignoring errors when calling 'eshell-match-command-output'Jim Porter2022-10-172-12/+16
| | | | | | | | | | | * 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'.
* Add helpers to dynamically assign connection-local valuesJim Porter2022-10-171-41/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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'.
* ; Remove over-quoting of :application values in connection-local variablesJim Porter2022-10-171-2/+2
| | | | | | | * 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.
* Silence recent comp-tests.el lexvar warningsBasil L. Contovounesios2022-10-171-19/+23
| | | | | | | | | | * 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.
* Don't prune *.eln files in parent of eln-load-pathStefan Kangas2022-10-171-0/+11
| | | | | | | | * 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.
* Add tests for native-compile-prune-cacheStefan Kangas2022-10-171-0/+62
| | | | * test/lisp/comp-tests.el: New file.
* cl-generic: Fix `advertised-calling-convention` declarationsStefan Monnier2022-10-161-0/+22
| | | | | | | | | | | | | | | * 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.
* Move and rename Python completion ERTskobarity2022-10-161-41/+41
| | | | | | | | | | | | | * 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).
* Fix invalid search bound error in python-shell-completion-at-pointkobarity2022-10-161-0/+27
| | | | | | | | * 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).