aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/eshell (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ; * lisp/eshell/esh-io.el (eshell-close-handles): Fix version annotation.Jim Porter2024-07-201-1/+1
|
* Don't set exit info in Eshell if the command is being piped elsewhereJim Porter2024-07-192-14/+22
| | | | | | | | | | | | | | | | 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.
* Split out exit code parts of 'eshell-close-handles' into a new functionJim Porter2024-07-194-41/+50
| | | | | | | | | | | * lisp/eshell/esh-cmd.el (eshell-last-command-status) (eshell-last-command-result): Move here from esh-io.el. (eshell-set-exit-info): New function, extracted from 'eshell-close-handles'. * lisp/eshell/esh-io.el (eshell-close-handles): Make old calling convention obsolete. Update callers to use 'eshell-set-exit-info' as needed.
* Allow specifying stdout/stderr separately in some Eshell commandsJim Porter2024-07-182-17/+37
| | | | | | | | | | | * lisp/eshell/eshell.el (eshell-command): Add ERROR-TARGET. * lisp/eshell/em-script.el (eshell-execute-file): Make interactive, and add ERROR-TARGET. * doc/misc/eshell.texi (One-Off Commands, Scripts): Update documentation. * etc/NEWS: Announce this change.
* Improve implementation of built-in Eshell "kill" commandJim Porter2024-07-181-27/+21
| | | | | | | | | | * 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).
* Handle broken pipes in a better way in EshellJim Porter2024-07-181-16/+21
| | | | | | * lisp/eshell/esh-proc.el (eshell-insertion-filter): Send SIGPIPE delaying for Tramp and falling back to SIGTERM for MS-Windows (bug#72117).
* Improve handling of deferrable Eshell commandsJim Porter2024-07-181-40/+27
| | | | | | | | | | | | | | | | | | | | | | | | 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-162-22/+18
|\ | | | | | | | | | | | | | | 68b7806c319 Support passing signals like 'SIGCODE' to 'tramp-signal-p... 510ca5e84b5 Merge branch 'emacs-30' of git.sv.gnu.org:/srv/git/emacs ... fe28ba5d55b ; Replace quotes with @code{...} in texinfo files ecc8516d9ca ; Replace (non-)nil with (non-)@code{nil} in texinfo files 3407e274999 Don't save to history from 'eshell-command' when aborting
| * Don't save to history from 'eshell-command' when abortingJim Porter2024-07-152-22/+18
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/eshell/eshell.el (eshell-add-input-to-history) (eshell--save-history): Declare. (eshell-command-mode-exit): New function... (eshell-command-mode): ... use it. * lisp/eshell/em-hist.el (eshell-hist-initialize): Don't handle minibuffer logic here. Always read history file (this ensures that 'eshell-command' can see the history, too). (eshell-add-command-to-history): Remove.
* | Merge from savannah/emacs-30Po Lu2024-07-121-2/+9
|\ \ | |/ | | | | | | | | 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-2/+9
| | | | | | | | | | | | | | | | | | | | * 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.
* | Improve Eshell's behavior when waiting for processesJim Porter2024-07-093-23/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has a few benefits. First, it fixes a race condition when killing old processes in 'eshell-command'. Second, the "wait" built-in command is now more useful. Finally, killing processes when exiting Eshell (via 'eshell-round-robin-kill') should be much faster. * lisp/eshell/esh-proc.el (esh-opt): Require. (eshell-wait-for-process): Make obsolete in favor of... (eshell-wait-for-processes): ... this. Accept a timeout and support PIDs. Update callers. (eshell/wait): New implementation accepting -t/--timeout. (eshell-round-robin-kill): Use 'eshell-wait-for-processes'. * lisp/eshell/eshell.el (eshell-command): Use 'eshell-round-robin-kill'. * doc/misc/eshell.texi (List of Built-ins): Document the new "wait" behavior. * etc/NEWS: Announce this change.
* | Don't use the Lisp implementation of "kill" in remote Eshell directoriesJim Porter2024-07-091-0/+5
| | | | | | | | | | * lisp/eshell/esh-proc.el (eshell/kill): When in a remote directory, fall back to the external "kill" program (bug#72013).
* | Merge from savannah/emacs-30Po Lu2024-07-096-8/+7
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dce31372a60 editorconfig-core-handle.el: Fix regressions in fnmatch h... ed2986494c7 Checkdoc fixes in `url/*.el` 846c0e10ffa Checkdoc fixes in `term/*.el` 3977aa07568 Checkdoc fixes in `mh-e/*.el` 521f740d013 Checkdoc fixes in `calc/*.el` 336aa6ab17a Checkdoc fixes in `textmodes/*.el` e19fd6a22de Checkdoc fixes in `gnus/*.el` 7350457c793 Checkdoc fixes in `eshell/*.el` 23c1ba81ddd Checkdoc fixes in `emulation/*.el` c85f67a66df Checkdoc fixes in `erc/*.el` e392382e2e2 Checkdoc fixes in `vc/*.el` ef7364b070e Checkdoc fixes in `emacs-lisp/*.el` 5fe1ae0e843 Checkdoc fixes in `mail/*.el` e43e9d09986 Checkdoc fixes in `net/*.el` 4c6e9f5b004 Improve `use-package-vc-valid-keywords` docstring format 928180f32be ; * etc/TODO: New item on installing Magit. c193a702dc2 ; Improve a recent change to the documentation 6ebc5d5c278 ; Delete fixed item from etc/TODO: "proced on macOS" 7b2778e3a3d ; Delete fixed NS bug from etc/TODO 84552ff395c Revert "Fix link to major mode variable in docstring" 198063ba643 * etc/TODO: Add item to convert documentation to 'setopt'. 92de67829ca Prefer 'setopt' in browse-url docs 76683853905 ; Improve 'native-comp-debug' documentation
| * Checkdoc fixes in `eshell/*.el`Stefan Kangas2024-07-086-8/+7
| | | | | | | | | | | | | | | | | | | | * lisp/eshell/em-elecslash.el: * lisp/eshell/em-extpipe.el: * lisp/eshell/em-pred.el (eshell-get-delimited-modifier-argument): * lisp/eshell/esh-cmd.el (eshell--unmark-deferrable) (eshell-named-command-hook): * lisp/eshell/esh-module.el (eshell-module--feature-name): * lisp/eshell/esh-util.el (eshell-find-delimiter): Checkdoc fixes.
* | Merge from savannah/emacs-30Po Lu2024-07-081-1/+11
|\ \ | |/ | | | | | | | | 67f291ddae3 Correct conditions for iconification on Android 130c3efa108 Fix execution of MS-Windows app execution aliases in Eshell fffab032b05 Improve 'tab-line-tabs-fixed-window-buffers' sorting perf...
| * Fix execution of MS-Windows app execution aliases in EshellJim Porter2024-07-071-1/+11
| | | | | | | | | | * lisp/eshell/esh-ext.el (eshell-script-interpreter): Check for 0-size files (bug#71655).
| * Always perform Eshell process cleanup runs in the Eshell bufferJim Porter2024-06-251-22/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-052-35/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-22/+24
|/ | | | | | | | | | | 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.
* ; Fix typosStefan Kangas2024-06-231-1/+1
|
* Ensure navigating by paragraphs in Eshell stops at prompts and paragraphsJim Porter2024-06-201-5/+27
| | | | | | | | | | | | | | | 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.
* Limit the amount of text we examine when looking for password promptsJim Porter2024-06-201-13/+19
| | | | | | | | | | | | | | | Both Comint and Eshell do this, and it can significantly slow down commands that write a lot of output (bug#71576). * lisp/comint.el (comint-password-prompt-max-length): New variable... (comint-watch-for-password-prompt): ... use it. Additionally, use the matched result for the Emacs-based password prompt. * lisp/eshell/esh-mode.el (eshell-password-prompt-max-length): New variable... (eshell-watch-for-password-prompt): ... use it. * etc/NEWS: Announce this change.
* ; * lisp/eshell/em-script.el (eshell-execute-file): Improve docstring.Jim Porter2024-06-131-0/+4
|
* Improve correctness of 'eshell-quote-argument'Jim Porter2024-06-092-10/+12
| | | | | | | | | | | | | | | | | | * 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-...').
* ; Use the current system's style of shell-quoting in Eshell debug logsJim Porter2024-06-091-2/+1
| | | | | * lisp/eshell/esh-proc.el (eshell-gather-process-output): Don't force POSIX syntax. This is less confusing when running on MS-Windows.
* Remove empty Eshell commands when parsingJim Porter2024-06-092-31/+36
| | | | | | | | | | | | | | | | | 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.
* ; Add another test for 'eshell-batch-script'Jim Porter2024-06-091-0/+4
| | | | | | | | * 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.
* Fix Eshell tests on MS-WindowsEli Zaretskii2024-06-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * 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-38/+30
| | | | | | | | | * 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-086-65/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Spelling fixesPaul Eggert2024-06-042-2/+2
|
* Check for a real process when trying to find password prompts in EshellJim Porter2024-06-031-1/+1
| | | | | * lisp/eshell/esh-mode.el (eshell-watch-for-password-prompt): Use 'eshell-head-process'.
* ; Remove superfluous 'quit' handler in 'eshell-send-input'Jim Porter2024-06-021-5/+1
| | | | | | This is now handled by the command form itself, thanks to eef32d13da5. * lisp/eshell/esh-mode.el (eshell-send-input): Remove 'quit' handler.
* Merge from origin/emacs-29Eli Zaretskii2024-06-011-3/+3
|\ | | | | | | | | bf50aa38f9d Improve documentation of case-conversion commands 225b426f256 ; Fix typos
| * ; Fix typosStefan Kangas2024-05-271-3/+3
| |
* | Make Eshell's "which" command extensibleJim Porter2024-05-293-66/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | ; Improve recent change to deferred evaluation in EshellJim Porter2024-05-291-3/+2
| | | | | | | | * lisp/eshell/esh-cmd.el (eshell-do-eval): Move active check later.
* | Fix calling Eshell scripts outside of EshellJim Porter2024-05-292-26/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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).
* | Rework how 'eshell-ensure-newline-p' adds newlinesJim Porter2024-05-293-20/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows for other output targets (see the following commit) to be "line-oriented". * lisp/eshell/esh-io.el (eshell-ensure-newline-p): Move from esh-cmd.el. (eshell-target-line-oriented-p, eshell--output-maybe-n) (eshell-print-maybe-n, eshell-error-maybe-n) (eshell-maybe-output-newline): New functions. * lisp/eshell/esh-cmd.el (eshell-lisp-command): Don't print a newline in this function directly; instead, use 'eshell-print-maybe-n' and 'eshell-error-maybe-n'. (eshell-ensure-newline-p): Move to esh-io.el. * lisp/eshell/em-unix.el (eshell/cat): Remove now-unnecessary override of 'eshell-ensure-newline-p'.
* | Add ability for Eshell virtual targets to handle closing the targetJim Porter2024-05-291-27/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Use 'esh-module-autoload' for Eshell modules' defgroupsJim Porter2024-05-2920-110/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will let modules define their own, regular autoloads, independent of the core Eshell machinery for defining modules. * lisp/eshell/em-alias.el (em-alias): * lisp/eshell/em-banner.el (em-banner): * lisp/eshell/em-basic.el (em-basic): * lisp/eshell/em-cmpl.el (em-cmpl): * lisp/eshell/em-dirs.el (em-dirs): * lisp/eshell/em-elecslash.el (em-elecslash): * lisp/eshell/em-extpipe.el: * lisp/eshell/em-glob.el (em-glob): * lisp/eshell/em-hist.el (em-hist): * lisp/eshell/em-ls.el (em-ls): * lisp/eshell/em-pred.el (em-pred): * lisp/eshell/em-prompt.el (em-prompt): * lisp/eshell/em-rebind.el (em-rebind): * lisp/eshell/em-script.el (em-script): * lisp/eshell/em-smart.el (em-smart): * lisp/eshell/em-term.el (em-term): * lisp/eshell/em-tramp.el (em-tramp): * lisp/eshell/em-unix.el (em-unix): * lisp/eshell/em-xtra.el (em-xtra): Use 'esh-module-autoload'. * lisp/eshell/esh-module.el ("esh-module-loaddefs"): Load this instead of "esh-groups". * .gitignore: Change esh-groups.el to esh-module-loaddefs.el
* | Consolidate Eshell module loading/unloading codeJim Porter2024-05-292-37/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 adding to history via 'eshell-command'Jim Porter2024-05-282-10/+8
| | | | | | | | | | | | | | | | | | * lisp/eshell/eshell.el (eshell-read-command): Don't handle history here. * lisp/eshell/em-hist.el (eshell-hist-initialize): Properly set up history for minibuffer. (eshell-add-command-to-history): Immediately save history.
* | esh-mode.el: Refrain from hiding buffer modifications (bug#70966)Stefan Monnier2024-05-281-37/+35
| | | | | | | | | | | | | | | | | | | | | | We have not been able to discover why these functions let-bound `inhibit-modification-hooks`, but these let-bindings are undesired effects on other modes such as `diff-mode` which need to keep track of buffer modifications. Let's remove those let-bindings and hope for the best. * lisp/eshell/esh-mode.el (eshell-send-input) (eshell-interactive-filter): Don't bind `inhibit-modification-hooks`.
* | Fix a race condition when evaluating Eshell commandsJim Porter2024-05-251-2/+4
| | | | | | | | | | | | | | | | * 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-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | ; * lisp/eshell/em-unix.el (eshell-grep): Fix "plain grep" behavior.Jim Porter2024-05-201-2/+2
| |
* | Add new Eshell built-in command 'funcall'Jim Porter2024-05-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | ; * lisp/eshell/esh-ext.el (eshell-remote-command): Improve last change.Jim Porter2024-05-151-1/+1
| |