aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/eshell (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Don't set exit info in Eshell if the command is being piped elsewhereJim Porter2024-07-191-1/+4
| | | | | | | | | | | | | | | | Previously, the exit info in Eshell was that of the last command that finished, rather than the last command in a pipeline. * lisp/eshell/esh-cmd.el (eshell-exec-lisp) (eshell-lisp-command): Check whether the command is being piped. * lisp/eshell/esh-proc.el (eshell-gather-process-output): Record whether the command is being piped... (eshell-sentinel): ... and do the right thing with that info. * test/lisp/eshell/esh-proc-tests.el (esh-proc-test/sigpipe-exits-process): Check the exit status to ensure we don't report the first process's SIGPIPE exit.
* Improve implementation of built-in Eshell "kill" commandJim Porter2024-07-181-0/+24
| | | | | | | | | | * lisp/eshell/esh-proc.el (eshell/kill): Fix handling of commands like "kill 123". Use REMOTE when signalling PIDs in remote directories. Signal using process objects when possible. Report errors when failing to signal. * test/lisp/eshell/esh-proc-tests.el (esh-proc-test/kill/process-id) (esh-proc-test/kill/process-object): New tests (bug#72013).
* Improve handling of deferrable Eshell commandsJim Porter2024-07-183-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | Now, we use the 'eshell-deferrable' wrapper to wrap a form that returns a process (or list thereof). This improves upon the old method, which failed to handle 'eshell-replace-command' correctly. In that case, Eshell would fail to unmark commands as deferrable when necessary (e.g. for commands in pipelines). * lisp/eshell/esh-cmd.el (eshell-deferrable-commands): Make into a defvar. (eshell-deferrable): New function... (eshell-structure-basic-command): ... use it. (eshell-trap-errors): Rename to... (eshell-do-command): ... this, and use 'eshell-deferrable'. Update callers. (eshell--unmark-deferrable): Remove. Update callers. (eshell-execute-pipeline): Remove 'eshell-process-identity'. (eshell-process-identity, eshell-named-command*, eshell-lisp-command*): Make obsolete. * test/lisp/eshell/esh-cmd-tests.el (eshell-test-replace-command): New function. (esh-cmd-test/pipeline/replace-command): New test.
* Merge from savannah/emacs-30Po Lu2024-07-121-1/+13
|\ | | | | | | | | | | a5ef9e25680 Document means of executing Emacs from unrelated Android ... 0de0056fd6b Don't emit a prompt in Eshell when a background command i... ec1e300a215 Fix reference from buffer-stale-function docstring
| * Don't emit a prompt in Eshell when a background command is killedJim Porter2024-07-111-1/+13
| | | | | | | | | | | | | | | | | | | | * lisp/eshell/esh-cmd.el (eshell-resume-command): Check for background-ness before resetting the prompt. * test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/background/simple-command): Make the regexp a bit stricter. (esh-cmd-test/background/kill): New test.
| * Always perform Eshell process cleanup runs in the Eshell bufferJim Porter2024-06-251-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, some code executed in a timer, which could execute in the wrong buffer, leading to a hang. * lisp/eshell/esh-proc.el (eshell-sentinel): Use 'with-current-buffer' in the timer function. * test/lisp/eshell/esh-proc-tests.el (eshell-test-value): New variable. (esh-proc-test/sentinel/change-buffer): New test. (cherry picked from commit da4bc5c9274a6705501e24fb8f2984f5bf5fe099)
* | Allow using multiple buffers in 'eshell-command'Thierry Volpiatto2024-07-051-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide the same functionality as 'async-shell-command-buffer' but for 'eshell-command'. Co-Authored-By: Jim Porter <jporterbugs@gmail.com> * lisp/eshell/eshell.el (eshell-command-async-buffer): New option... (eshell-command): ... use it. * lisp/eshell/esh-proc.el (eshell-sentinel): Check for buffer liveness in 'finish-io'. * test/lisp/eshell/eshell-tests.el (eshell-test/eshell-command/output-buffer/async-kill): New test. * etc/NEWS: Announce this change (bug#71554).
* | Always perform Eshell process cleanup runs in the Eshell bufferJim Porter2024-06-251-0/+16
|/ | | | | | | | | | | Previously, some code executed in a timer, which could execute in the wrong buffer, leading to a hang. * lisp/eshell/esh-proc.el (eshell-sentinel): Use 'with-current-buffer' in the timer function. * test/lisp/eshell/esh-proc-tests.el (eshell-test-value): New variable. (esh-proc-test/sentinel/change-buffer): New test.
* Ensure navigating by paragraphs in Eshell stops at prompts and paragraphsJim Porter2024-06-201-1/+48
| | | | | | | | | | | | | | | The previous implementation in 6ae2b74ed20 only stopped at prompts, which isn't the right behavior (bug#61545). * lisp/eshell/em-prompt.el (eshell-forward-paragraph) (eshell-backward-paragraph): Reimplement to handle prompts and paragraphs (the latter by calling the original 'forward-paragraph'). * test/lisp/eshell/em-prompt-tests.el (em-prompt-test/next-previous-prompt/multiline): Rename. (em-prompt-test/forward-backward-paragraph-1): New function. (em-prompt-test/forward-backward-paragraph) (em-prompt-test/forward-backward-paragraph/multiline): New tests.
* Fix Eshell "which" test on MS-WindowsJim Porter2024-06-152-8/+11
| | | | | | | | | * test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/which/plain/external-program): Compare the file name case-insensitively on case-insensitive file systems. * test/lisp/eshell/eshell-tests-helpers.el (eshell-command-result--equal): Revert to the previous implementation.
* Fix em-extpipe-tests on MS-WindowsEli Zaretskii2024-06-151-1/+5
| | | | | * test/lisp/eshell/em-extpipe-tests.el (em-extpipe-test-14): Fix test on MS-Windows (bug#71446).
* ; Improve last changeJim Porter2024-06-151-3/+10
| | | | | * test/lisp/eshell/esh-proc-tests.el (esh-proc-test/kill-pipeline): Fix check of exit message and ensure we have only one prompt.
* ; Add command logging to some more Eshell testsJim Porter2024-06-151-20/+22
| | | | | * test/lisp/eshell/esh-proc-tests.el (esh-proc-test/kill-pipeline) (esh-proc-test/kill-pipeline-head): Write debug logs on failure.
* ; Minor editorial fixes to some Eshell testsJim Porter2024-06-131-10/+10
| | | | | | | * test/lisp/eshell/esh-proc-tests.el (esh-proc-test/kill-process/redirect-message): Move next to its sibling tests. (esh-proc-test/remote/remote-path): Rename from 'esh-var-test/...'.
* Fix recently added eshell testStefan Kangas2024-06-101-7/+8
| | | | | * test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/empty-background-command): Fix failing test.
* Improve correctness of 'eshell-quote-argument'Jim Porter2024-06-093-25/+21
| | | | | | | | | | | | | | | | | | * lisp/eshell/esh-arg.el (eshell-quote-argument): Mention that this function is for use within Eshell buffers. (eshell-quote-backslash): Properly quote newlines. * lisp/eshell/em-unix.el (eshell/cat, eshell/du): Throw 'eshell-external' instead; that's what it's here for. * test/lisp/eshell/esh-proc-tests.el (esh-proc-test-quote-argument): Remove. (esh-proc-test/emacs-command): * test/lisp/eshell/esh-var-tests.el (esh-var-test/path-var/set) (esh-var-test/path-var/set-locally): Use 'eshell-quote-argument'. * test/lisp/eshell/em-unix-tests.el (em-unix-test/compile/interactive): Use 'shell-quote-argument' (Note: *not* 'eshell-...').
* Remove empty Eshell commands when parsingJim Porter2024-06-091-0/+10
| | | | | | | | | | | | | | | | | This improves the logic for copying/stealing handles when constructing the command form: now, we should always steal the handles for the last real command, even if there were some trailing semicolons. * lisp/eshell/esh-arg.el (eshell-parse-delimiter): Be stricter about parsing so that things like "& &" aren't parsed as a single "&&" token. * lisp/eshell/esh-cmd.el (eshell-parse-command): Get the commands in reverse, and remove any nil commands. (eshell-split-commands): Always return the trailing terms (except when there were no terms to begin with). * test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/empty-background-command): New test.
* ; Allow batch-file Eshell test on MS-WindowsEli Zaretskii2024-06-091-1/+0
| | | | | * test/lisp/eshell/em-script-tests.el (em-script-test/batch-file): Don't skip on MS-Windows, as the test was fixed.
* ; Add another test for 'eshell-batch-script'Jim Porter2024-06-091-0/+12
| | | | | | | | * lisp/eshell/em-script.el (eshell-close-target): New function. * test/lisp/eshell/em-script-tests.el (em-script-test/batch-file): New test; rename old one to... (em-script-test/batch-file/shebang): ... this.
* A better fix for esh-proc-tests on MS-WindowsEli Zaretskii2024-06-091-14/+10
| | | | | | | | * test/lisp/eshell/esh-proc-tests.el (esh-proc-test-quote-argument): New function. (esh-proc-test/emacs-command): Use it instead of 'shell-quote-argument', which allows to go back to system-independent code.
* Fix Eshell tests on MS-WindowsEli Zaretskii2024-06-096-14/+35
| | | | | | | | | | | | | | | | | | | | | | | | | * lisp/eshell/esh-util.el (eshell-get-path): Don't add "." if it is already there. * test/lisp/eshell/esh-var-tests.el (esh-var-test/path-var/preserve-across-hosts): Skip on MS-Windows. (esh-var-test/path-var/set, esh-var-test/path-var/set-locally): Quote the PATH value, for MS-Windows. * test/lisp/eshell/esh-util-tests.el (esh-util-test/path/get): No need to add ".": it is already done by 'eshell-get-path'. * test/lisp/eshell/esh-proc-tests.el (esh-proc-test/kill-pipeline): Accept empty string as valid output. (esh-proc-test/sigpipe-exits-process): Skip on MS-Windows: no SIGPIPE. (esh-proc-test/emacs-command): Quote correctly for MS-Windows. * test/lisp/eshell/em-unix-tests.el (em-unix-test/compile/interactive): Fix test on MS-Windows. * test/lisp/eshell/em-script-tests.el (em-script-test/batch-file): Skip on MS-Windows. * test/lisp/eshell/eshell-tests-helpers.el (eshell-command-result--equal): Compare strings (file names) case-insensitively on MS-Windows.
* Improve implementations of some Eshell output filter functionsJim Porter2024-06-081-0/+62
| | | | | | | | | * lisp/eshell/esh-mode.el (eshell-postoutput-scroll-to-bottom): Use 'get-buffer-window-list' for simplicity. (eshell-handle-control-codes): Use 're-search-forward'; this way is much faster. * test/lisp/eshell/esh-mode-tests.el: New file.
* Be more efficient when buffering output in EshellJim Porter2024-06-081-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the built-in 'eshell/cat' 5-10x faster on large files in my (somewhat limited) tests. In addition, this change periodically redisplays when using the Eshell buffered output so that users can see some progress. * lisp/eshell/esh-io.el (eshell-print-queue-size, eshell-print-queue, eshell-print-queue-count): Make obsolete in favor of... (eshell-buffered-print-size, eshell--buffered-print-queue) (eshell--buffered-print-current-size): ... these. (eshell-buffered-print-redisplay-throttle): New user option. (eshell--buffered-print-next-redisplay): New variable. (eshell-init-print-buffer): Make obsolete. (eshell-flush): Add new REDISPLAY-NOW argument in favor of CLEAR (which only 'eshell-init-print-buffer' should have used). (eshell-buffered-print): Compare queued output length to 'eshell--buffered-print-current-size'. (eshell-with-buffered-print): New macro. * lisp/eshell/esh-var.el (eshell/env): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-hist.el (eshell/history): * lisp/eshell/em-unix.el (eshell/cat): * lisp/eshell/em-ls.el (eshell/ls): Use 'eshell-with-buffered-print'. (flush-func): Remove. (eshell-ls--insert-directory, eshell-do-ls): Remove 'flush-func'. * test/lisp/eshell/em-unix-tests.el (em-unix-test/compile/interactive) (em-unix-test/compile/pipeline, em-unix-test/compile/subcommand): Fix indentation. (em-unix-test/cat/file-output): New test. * etc/NEWS: Announce these improvements.
* Make Eshell's "which" command extensibleJim Porter2024-05-292-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 'eshell-named-command-hook' already makes execution of commands extensible, "which" should be too. This makes sure that "which" returns the right result for quoted commands like "/:cat". * lisp/eshell/em-alias.el (eshell-aliases-file): Allow it to be nil. (eshell-read-aliases-list, eshell-write-aliases-list): Check if 'eshell-aliases-file' is nil. (eshell-maybe-replace-by-alias--which): New function... (eshell-maybe-replace-by-alias): ... use it. * lisp/eshell/esh-cmd.el (eshell-named-command-hook): Update docstring. (eshell/which): Make extensible. (eshell--find-plain-lisp-command, eshell-plain-command--which): New functions. (eshell-plain-command): Use 'eshell--find-plain-lisp-command'. * lisp/eshell/esh-ext.el (eshell-explicit-command--which): New function... (eshell-explicit-command): ... unise it. (eshell-quoted-file-command--which): New function... (eshell-quoted-file-command): ... use it. (eshell-external-command--which): New function. * test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/which/plain/eshell-builtin) (esh-cmd-test/which/plain/external-program) (esh-cmd-test/which/plain/not-found, esh-cmd-test/which/alias) (esh-cmd-test/which/explicit, esh-cmd-test/which/explicit/not-found) (esh-cmd-test/which/quoted-file) (esh-cmd-test/which/quoted-file/not-found): New tests. * test/lisp/eshell/eshell-tests-helpers.el (with-temp-eshell-settings): Don't load or save aliases. (eshell-command-result--match,eshell-command-result--match-explainer) (eshell-command-result-match): New functions.
* Fix calling Eshell scripts outside of EshellJim Porter2024-05-292-15/+52
| | | | | | | | | | | | | | | | | | | | | | | | | * lisp/eshell/em-script.el (eshell-source-file): Make obsolete. (eshell--source-file): Adapt from 'eshell-source-file'... (eshell-script-initialize, eshell/source, eshell/.): ... use it. (eshell-princ-target): New struct. (eshell-output-object-to-target, eshell-target-line-oriented-p): New implementations for 'eshell-princ-target'. (eshell-execute-file, eshell-batch-file): New functions. * lisp/eshell/esh-mode.el (eshell-mode): Just warn if we can't create the Eshell directory. * test/lisp/eshell/em-script-tests.el (em-script-test/execute-file): (em-script-test/execute-file/args), em-script-test/batch-file): New tests. * test/lisp/eshell/eshell-tests-helpers.el (with-temp-eshell-settings): New function... (with-temp-eshell): ... use it. * doc/misc/eshell.texi (Control Flow): Update documentation. * etc/NEWS: Announce this change (bug#70847).
* Add ability for Eshell virtual targets to handle closing the targetJim Porter2024-05-291-0/+15
| | | | | | | | | | | | | | | | | | This was documented to work by calling the output function with 'nil', but that was never actually implemented. Instead, for compatibility, we now support a new (optional) close function. * lisp/eshell/esh-io.el (eshell-virtual-targets): Update docstring. (eshell-generic-target): New struct... (eshell-function-target): ... inherit from it, and rename from 'eshell-virtual-target'. (eshell-get-target): Handle already-created 'eshell-generic-target'. (eshell-close-target): Call the target's close function if present. * test/lisp/eshell/esh-io-tests.el (esh-io-test/virtual/device-close): New test. * doc/misc/eshell.texi (Redirection): Document the new behavior.
* Consolidate Eshell module loading/unloading codeJim Porter2024-05-292-4/+8
| | | | | | | | | | | | | | | | | | | | | This also adds the ability to suppress module loading/unloading messages, which will be necessary to support running Eshell scripts as batch scripts. * lisp/eshell/esh-mode.el (eshell-mode): Move module loading/initialization to... * lisp/eshell/esh-module.el (eshell-load-modules) (eshell-initialize-modules): ... here. (eshell-module-loading-messages): New option. (eshell-module--feature-name): Improve docstring. (eshell-unload-modules): Display a real warning if unable to unload a module. * test/lisp/eshell/eshell-tests-helpers.el (with-temp-eshell) (eshell-command-result-equal): * test/lisp/eshell/eshell-tests-unload.el (load-eshell): Silence Eshell loading messages.
* Fix a race condition when evaluating Eshell commandsJim Porter2024-05-251-0/+12
| | | | | | | | * lisp/eshell/esh-cmd.el (eshell-do-eval): Don't defer when all the processes are done. * test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/pipeline-wait/nested-pipes): New test.
* Erase existing duplicates in eshell-history-ringRobin Joy2024-05-241-0/+17
| | | | | | | | | | | | | | Erase all existing duplicates instead of just the last duplicate entry when 'eshell-hist-ignoredups' is set to 'erase'. Multiple duplicates can exist in case 'eshell-hist-ignoredups' was set to something else than 'erase' in the past or if the history file contains duplicates (bug#71107). * lisp/eshell/em-hist.el (eshell-add-input-to-history): Remove all duplicates from history ring. * test/lisp/eshell/em-hist-tests.el (em-hist-test/add-to-history/erase-existing-dups): New test.
* Add new Eshell built-in command 'funcall'Jim Porter2024-05-162-29/+32
| | | | | | | | | | | | | | | | | | | | * lisp/eshell/esh-cmd.el (eshell/funcall): New function... * test/lisp/eshell/em-glob-tests.el (em-glob-test/expand/splice-results) (em-glob-test/expand/no-splice-results) (em-glob-test/expand/explicitly-splice-results) (em-glob-test/expand/explicitly-listify-results): * test/lisp/eshell/esh-var-tests.el (esh-var-test/quoted-interp-lisp-indices) (esh-var-test/quoted-interp-cmd-indices) (esh-var-test/interp-convert-quoted-var-number) (esh-var-test/quoted-interp-convert-var-number) (esh-var-test/quoted-interp-convert-quoted-var-number) (esh-var-test/last-status-var-lisp-command) (esh-var-test/last-result-var-split-indices) (esh-var-test/last-arg-var-split-indices): ... use it in tests. * doc/misc/eshell.texi (List of Built-ins): Describe this command.
* Use "/local:" prefix in Eshell to run local commands when cwd is remoteJim Porter2024-05-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | * lisp/eshell/esh-ext.el (eshell-explicit-remote-commands) (eshell-explicit-command): Update docstrings. (eshell--local-prefix): New constant. (eshell-handle-remote-command): Remove. (eshell-quoted-file-command): New function... (eshell-ext-initialize): ... add it as a hook. (eshell-remote-command): Support running commands on localhost. (eshell-connection-local-command): Rename from 'eshell-external-command'. (eshell-external-command): New implementation calling 'eshell-remote-command' or 'eshell-connection-local-command' as appropriate. * test/lisp/eshell/esh-ext-tests.el (esh-ext-test/explicitly-local-command): Update test. * doc/misc/eshell.texi (Remote Access): Update documentation. * etc/NEWS: Update announcement.
* ; Fix an edge case with Eshell globs when the directory part is quotedJim Porter2024-05-091-0/+6
| | | | | | | | * lisp/eshell/esh-util.el (eshell-split-filename): Escaping shouldn't matter for splitting the name (no other shells handle it like this). * test/lisp/eshell/em-glob-tests.el (em-glob-test/convert/quoted-start-directory): New test.
* Fix Eshell handling of remote files like "/ssh:remote:~/file.txt"Jim Porter2024-05-051-3/+16
| | | | | | | | | | | * lisp/eshell/em-glob.el (eshell-glob-convert): Use 'concat' instead of 'file-name-concat' to avoid extraneous slashes. (eshell-extended-glob): Bail out if we didn't find a glob after all. * test/lisp/eshell/em-glob-tests.el (tramp): Require. (em-glob-test/convert/remote-start-directory): Use the mock remote connection. (em-glob-test/remote-user-directory): New test.
* Support expanding Eshell globs for remote file namesJim Porter2024-03-071-0/+30
| | | | | | | | | | | | | | | | | * lisp/eshell/em-glob.el (eshell-glob-chars-regexp): New function... (eshell-glob-regexp): ... use it. (eshell-glob-p): New function... (eshell-glob-convert): ... use it, and return the deepest start directory possible. * lisp/eshell/esh-util.el (eshell-split-path): Rename to... (eshell-split-path): ... this, and account for remote file names. * test/lisp/eshell/em-glob-tests.el (em-glob-test/convert/current-start-directory) (em-glob-test/convert/relative-start-directory) (em-glob-test/convert/absolute-start-directory) (em-glob-test/convert/remote-start-directory): New tests (bug#69592).
* Replace use of obsolete eshell-kill-output in testMattias EngdegÄrd2024-02-231-1/+1
| | | | | * test/lisp/eshell/eshell-tests.el (eshell-test/flush-output): Use eshell-delete-output instead of eshell-kill-output.
* ; Compute the list of symbols for 'eshell-eval-using-options' onceJim Porter2024-02-131-8/+16
| | | | | | | | | | * lisp/eshell/esh-opt.el (eshell--get-option-symbols): New function... (eshell-eval-using-options): ... use it. (eshell--do-opts, eshell--process-args): Take OPTION-SYMS. * test/lisp/eshell/esh-opt-tests.el (esh-opt-test/process-args): (esh-opt-test/process-args-parse-leading-options-only): (esh-opt-test/process-args-external): Pass OPTION-SYMS in.
* In Eshell, don't expand quoted tildes into a user's home directoryJim Porter2024-01-281-0/+22
| | | | | | | | | * lisp/eshell/em-dirs.el (eshell-parse-user-reference): Don't expand quoted tildes. * test/lisp/eshell/em-dirs-tests.el (em-dirs-test/expand-user-reference/local) (em-dirs-test/expand-user-reference/quoted): New tests.
* In Eshell, allow an escaped newline at the end of a commandJim Porter2024-01-281-6/+8
| | | | | | | | | | | | | | | | | | Normally, "echo<RET>" runs the command "echo". Likewise, "echo\<RET><RET>" should too: we escape the first newline, and then the second one is unescaped and should send the command input to Eshell. Previously, you had to press RET a third time, but now it works as expected. * lisp/eshell/esh-arg.el (eshell-looking-at-backslash-return): Make obsolete. (eshell-parse-backslash): A backslash sequence is only incomplete if there's nothing at all after it. * test/lisp/eshell/esh-arg-tests.el (esh-arg-test/escape/newline) (esh-arg-test/escape-quoted/newline): Remove inaccurate comment; escaped newlines are always special. (esh-arg-test/escape/trailing-newline): New test.
* Support setting umask symbolically in EshellJim Porter2024-01-271-4/+30
| | | | | | | | | | | | | | | | * lisp/eshell/em-basic.el (eshell/umask): Handle setting umask symbolically, and make setting umask take precedence over "-S". * test/lisp/eshell/em-basic-tests.el (em-basic-test/umask-print-numeric, em-basic-test/umask-read-symbolic, em-basic-test/umask-set): Rename to... (em-basic-test/umask/print-numeric) (em-basic-test/umask/print-symbolic, em-basic-test/umask/set-numeric): ... these. (em-basic-test/umask/set-symbolic, em-basic-test/umask/set-with-S): New tests. * etc/NEWS: Announce this change.
* Fix command replacement with the Eshell builtin versions of "sudo" and "doas"Jim Porter2024-01-271-49/+40
| | | | | | | | | | | | | | | | This is particularly important when the inner command to execute is an alias. Aliases throw 'eshell-replace-command' too, so we want to do this in two phases: first, replace the "sudo"/"doas" with a let-binding of 'default-directory', and then later, let the alias code do its own replacement (bug#68074). * lisp/eshell/em-tramp.el (eshell/sudo, eshell/doas): Use 'eshell-replace-command' to wrap the inner command. * test/lisp/eshell/em-tramp-tests.el (mock-eshell-named-command): Remove. (em-tramp-test/sudo-basic, em-tramp-test/sudo-user) (em-tramp-test/doas-basic, em-tramp-test/doas-user): Catch 'eshell-replace-command'.
* ; Add docstring to testJim Porter2024-01-261-1/+2
| | | | | | | Note to self: coffee first, *then* push upstream. * test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test--deftest-invoke-directly): Add missing docstring.
* ; * test/lisp/eshell/esh-cmd-tests.el: Fix last change.Jim Porter2024-01-261-2/+3
|
* Fix detection of directly-invokable commands in EshellJim Porter2024-01-261-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | I think this regressed partly due to eef32d13da58, so let's add some regression tests to make sure that doesn't happen again. * lisp/eshell/em-unix.el (eshell-unix-initialize): Add "compile". * lisp/eshell/esh-cmd.el (eshell--find-subcommands): Yield the second element of the subcommand. (eshell--invoke-command-directly-p): Rename and account for 'eshell-with-copied-handles'. (eshell-invoke-directly): Rename to... (eshell-invoke-directly-p): ... this, and use 'pcase' to make the logic clearer. * lisp/eshell/esh-mode.el (eshell-send-input): Always queue input if the process is running; rename some locals to be clearer. * lisp/eshell/esh-var.el (eshell-var-initialize): Add "env" as a complex command. * test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test--deftest-invoke-directly): New macro. (no-args, with-args, multiple-cmds, subcmd, complex, complex-subcmd): New test cases.
* Add support for running commands via Eshell's "env" commandJim Porter2024-01-251-0/+7
| | | | | | | | | | | | | * (eshell-handle-local-variables): Move most of the code to... (eshell-parse-local-variables): ... here. (eshell/env): Call 'eshell-parse-local-variables'. * test/lisp/eshell/esh-var-tests.el (esh-var-test/local-variables/env): New test. * doc/misc/eshell.texi (Built-ins): Describe the new behavior. * etc/NEWS: Announce this change.
* Improve handling of local variable settings in EshellJim Porter2024-01-251-0/+8
| | | | | | | | | | | | | | | | This ensures that these commands work the same as normal commands, aside from making environment variable settings local to that command. Among other things, this means that "VAR=value cd dir/" now changes the directory correctly. * lisp/eshell/esh-var.el (eshell-in-local-scope-p) (eshell-local-variable-bindings): New variables. (eshell-var-initialize, eshell-set-variable): Use 'eshell-local-variable-bindings'. (eshell-handle-local-variables): Don't use 'eshell-as-subcommand'. * test/lisp/eshell/esh-var-tests.el (esh-var-test/local-variables/cd): New test.
* ; Fix test failures from the fix for bug#67661Jim Porter2024-01-171-6/+6
| | | | | * test/lisp/eshell/em-cmpl-tests.el (em-cmpl-test/file-completion/non-unique): Make test more robust.
* ; Add 2024 to copyright yearsPo Lu2024-01-024-4/+4
|
* Merge from savannah/emacs-29Po Lu2024-01-0220-20/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dc4e6b13296 ; Update copyright years in more files 64b37776318 ; Run set-copyright from admin.el 8e1c56ae467 ; Add 2024 to copyright years # Conflicts: # doc/misc/modus-themes.org # doc/misc/texinfo.tex # etc/NEWS # etc/refcards/ru-refcard.tex # etc/themes/modus-operandi-theme.el # etc/themes/modus-themes.el # etc/themes/modus-vivendi-theme.el # lib/alloca.in.h # lib/binary-io.h # lib/c-ctype.h # lib/c-strcasecmp.c # lib/c-strncasecmp.c # lib/careadlinkat.c # lib/cloexec.c # lib/close-stream.c # lib/diffseq.h # lib/dup2.c # lib/filemode.h # lib/fpending.c # lib/fpending.h # lib/fsusage.c # lib/getgroups.c # lib/getloadavg.c # lib/gettext.h # lib/gettime.c # lib/gettimeofday.c # lib/group-member.c # lib/malloc.c # lib/md5-stream.c # lib/md5.c # lib/md5.h # lib/memmem.c # lib/memrchr.c # lib/nanosleep.c # lib/save-cwd.h # lib/sha1.c # lib/sig2str.c # lib/stdlib.in.h # lib/strtoimax.c # lib/strtol.c # lib/strtoll.c # lib/time_r.c # lib/xalloc-oversized.h # lisp/auth-source-pass.el # lisp/emacs-lisp/lisp-mnt.el # lisp/emacs-lisp/timer.el # lisp/info-look.el # lisp/jit-lock.el # lisp/loadhist.el # lisp/mail/rmail.el # lisp/net/ntlm.el # lisp/net/webjump.el # lisp/progmodes/asm-mode.el # lisp/progmodes/project.el # lisp/progmodes/sh-script.el # lisp/textmodes/flyspell.el # lisp/textmodes/reftex-toc.el # lisp/textmodes/reftex.el # lisp/textmodes/tex-mode.el # lisp/url/url-gw.el # m4/alloca.m4 # m4/clock_time.m4 # m4/d-type.m4 # m4/dirent_h.m4 # m4/dup2.m4 # m4/euidaccess.m4 # m4/fchmodat.m4 # m4/filemode.m4 # m4/fsusage.m4 # m4/getgroups.m4 # m4/getloadavg.m4 # m4/getrandom.m4 # m4/gettime.m4 # m4/gettimeofday.m4 # m4/gnulib-common.m4 # m4/group-member.m4 # m4/inttypes.m4 # m4/malloc.m4 # m4/manywarnings.m4 # m4/mempcpy.m4 # m4/memrchr.m4 # m4/mkostemp.m4 # m4/mktime.m4 # m4/nproc.m4 # m4/nstrftime.m4 # m4/pathmax.m4 # m4/pipe2.m4 # m4/pselect.m4 # m4/pthread_sigmask.m4 # m4/readlink.m4 # m4/realloc.m4 # m4/sig2str.m4 # m4/ssize_t.m4 # m4/stat-time.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/stdio_h.m4 # m4/stdlib_h.m4 # m4/stpcpy.m4 # m4/strnlen.m4 # m4/strtoimax.m4 # m4/strtoll.m4 # m4/time_h.m4 # m4/timegm.m4 # m4/timer_time.m4 # m4/timespec.m4 # m4/unistd_h.m4 # m4/warnings.m4 # nt/configure.bat # nt/preprep.c # test/lisp/register-tests.el
| * ; Add 2024 to copyright yearsPo Lu2024-01-0220-20/+20
| |
* | ; Fix typosStefan Kangas2023-12-102-2/+2
| |