aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/eshell (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ; Simplify (with-current-buffer (get-buffer ...) ...)Tim Landscheidt2024-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no need to call 'get-buffer', since 'with-current-buffer' does that internally. * lisp/calendar/todo-mode.el (todo-merge-category): * lisp/comint.el (comint-dynamic-list-completions): * lisp/emacs-lisp/checkdoc.el (checkdoc-error): * lisp/emacs-lisp/debug.el (debug, debugger-record-expression): * lisp/emacs-lisp/eieio-opt.el (eieio-browse): * lisp/emacs-lisp/re-builder.el (reb-restart-font-lock): * lisp/erc/erc-dcc.el (erc-dcc-do-LIST-command): * lisp/eshell/em-unix.el (eshell-poor-mans-grep): * lisp/gnus/gnus-group.el (gnus-add-mark): * lisp/net/eww.el (eww-next-bookmark, eww-previous-bookmark): * lisp/net/sieve.el (sieve-upload): * lisp/net/tramp-cmds.el (tramp-cleanup-some-buffers): * lisp/obsolete/quickurl.el (quickurl-list-populate-buffer): * lisp/org/ob-calc.el: (org-babel-execute:calc): * lisp/org/org-agenda.el (org-agenda-use-sticky-p): * lisp/pcomplete.el (pcomplete-show-completions): * lisp/progmodes/bug-reference.el (bug-reference--try-setup-gnus-article): * lisp/progmodes/idlw-help.el (idlwave-highlight-linked-completions): * lisp/progmodes/verilog-mode.el (verilog-preprocess): * lisp/replace.el (occur-1): * lisp/term.el (term-dynamic-list-completions): * lisp/time.el (world-clock-update): * lisp/url/url-cache.el (url-store-in-cache): * lisp/vc/vc-cvs.el (vc-cvs-merge, vc-cvs-merge-news): * lisp/vc/vc-rcs.el (vc-rcs-system-release): * lisp/vc/vc-svn.el (vc-svn-merge, vc-svn-merge-news): * test/lisp/calendar/icalendar-tests.el (icalendar-tests--get-error-string-for-export): * test/lisp/erc/erc-dcc-tests.el (pcomplete/erc-mode/DCC--get-1flag) (pcomplete/erc-mode/DCC--get-2flags) (pcomplete/erc-mode/DCC--get-2flags-reverse): * test/lisp/erc/erc-networks-tests.el (erc-networks--rename-server-buffer--existing--noreuse): * test/lisp/erc/erc-scenarios-services-misc.el (erc-scenarios-services-misc--reconnect-retry-nick): * test/lisp/erc/erc-tests.el (erc--refresh-prompt): Replace (with-current-buffer (get-buffer ...) ...) with (with-current-buffer ...).
* Support expanding Eshell globs for remote file namesJim Porter2024-03-072-36/+51
| | | | | | | | | | | | | | | | | * 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).
* When deleting output in Eshell, optionally add it to the kill ring.Tomas Volf2024-02-151-5/+13
| | | | | | | | * lisp/eshell/esh-mode.el (eshell-kill-output): Rename to... (eshell-delete-output): ... this, for consistency with 'comint-mode', and accept KILL argument. Update callers. Copyright-paperwork-exempt: yes
* ; Compute the list of symbols for 'eshell-eval-using-options' onceJim Porter2024-02-131-28/+34
| | | | | | | | | | * 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.
* Document arguments to Eshell's built-in commandsJim Porter2024-02-043-8/+8
| | | | | | | | | | | | * lisp/eshell/em-unix.el (eshell/ln): LINK_NAME is required. * lisp/eshell/esh-ext.el (eshell/addpath): * lisp/eshell/esh-var.el (eshell/env): Improve help strings slightly. * doc/misc/eshell.texi (Scripts): Explain $0, $1, etc. (Dollars Expansion): Use "@dots{}" instead of "...". (Built-ins, Tramp extensions, Extra built-in commands): Document command-line arguments.
* ; Fix typosStefan Kangas2024-02-041-1/+1
|
* ; * lisp/eshell/em-unix.el (eshell/cp, eshell/ln): Delete extra space.Eli Zaretskii2024-02-031-2/+2
| | | | Bug#68862.
* Fix typo in Eshell's "du" commandJim Porter2024-01-291-1/+1
| | | | | | | This option is supposed to be "--si", for "International System of Units", not "--is". * lisp/eshell/em-unix.el (eshell/du): Change "is" to "si".
* In Eshell, don't expand quoted tildes into a user's home directoryJim Porter2024-01-281-0/+1
| | | | | | | | | * 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-2/+3
| | | | | | | | | | | | | | | | | | 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.
* ; Be more strict with command arguments for a few Eshell commandsJim Porter2024-01-273-3/+3
| | | | | | * lisp/eshell/em-dirs.el (eshell/pwd): * lisp/eshell/em-unix.el (eshell/whoami): * lisp/eshell/esh-proc.el (eshell/jobs): Don't accept arguments.
* Support setting umask symbolically in EshellJim Porter2024-01-271-10/+14
| | | | | | | | | | | | | | | | * 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-12/+10
| | | | | | | | | | | | | | | | 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'.
* Fix detection of directly-invokable commands in EshellJim Porter2024-01-264-36/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-19/+31
| | | | | | | | | | | | | * (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-26/+31
| | | | | | | | | | | | | | | | 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.
* ; For compatibility, eshell/make should print to Eshell unless backgroundedJim Porter2024-01-251-1/+1
| | | | | * lisp/eshell/em-unix.el (eshell/make): Pass 'plain' to eshell-compile when in the foreground (bug#68724).
* Merge from savannah/emacs-29Po Lu2024-01-0230-30/+30
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0230-30/+30
| |
| * Pass only the local parts of Eshell's $PATH to 'tramp-remote-path'Xiaoyue Chen2023-11-121-1/+1
| | | | | | | | | | | | | | | | | | * lisp/eshell/esh-proc.el (eshell-gather-process-output): Get the local part of the $PATH (bug#67126). Do not merge to master. Copyright-paperwork-exempt: yes
* | ; Fix a few more typosStefan Kangas2023-12-101-1/+1
| |
* | ; Fix typosStefan Kangas2023-12-101-1/+1
| |
* | Add option eshell-history-appendLiu Hui2023-12-071-3/+13
| | | | | | | | | | | | | | | | | | | | * lisp/eshell/em-hist.el (eshell-history-append): New option. (eshell--save-history): New function. (eshell-hist-initialize): (eshell-save-some-history): Replace eshell-write-history with eshell--save-history, which respects the new option. * doc/misc/eshell.texi (History): Document the change. * etc/NEWS: Announce the change. (Bug#66700)
* | Pass only the local parts of Eshell's $PATH to 'tramp-remote-path'Xiaoyue Chen2023-11-121-1/+1
| | | | | | | | | | | | | | * lisp/eshell/esh-proc.el (eshell-gather-process-output): Get the local part of the $PATH (bug#67126). Copyright-paperwork-exempt: yes
* | Improve read/append behavior of eshell history commandLiu Hui2023-11-101-16/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/eshell/em-hist.el (eshell-hist--new-items): New variable. (eshell-hist-initialize): Initialize 'eshell-hist--new-items' to 0. (eshell/history): Change the behavior of 'history -a' to "append new history in current buffer to history file". Clarify the help text of 'history -r'. (eshell-add-input-to-history): Increase counter of new history items. (eshell-read-history): Respect 'eshell-hist-ignoredups' option. (eshell-write-history): If the optional argument APPEND is non-nil, appending new history items rather than the whole history. * test/lisp/eshell/em-hist-tests.el (em-hist-test/history-append) (em-hist-test/history-read): New tests (bug#66768).
* | Speed up Eshell smart display moduleMorgan Smith2023-10-281-52/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | em-smart was forcibly re-displaying the screen upwards of 500 times per screen of output. This caused the Eshell to feel quite slow when the module was in use. By using fewer hooks and never explicitly calling 'redisplay' (which was unnecessary) the performance issues go away (bug#57367). lisp/eshell/em-smart.el: (em-smart-unload-hook, eshell-smart-unload-hook): Remove 'eshell-smart-scroll' instead of the now deleted 'eshell-refresh-windows'. (eshell-smart-displayed, eshell-currently-handling-window) (eshell-refresh-windows): Delete. (eshell-smart-scroll-window): Rename to 'eshell-smart-scroll-windows' and add a bunch of logic originally from 'eshell-refresh-windows'. (eshell-smart-initialize): Don't add a hook onto 'window-scroll-functions'. Replace 'eshell-refresh-windows' with 'eshell-smart-scroll-windows'. (eshell-smart-display-setup): Don't refresh windows. (eshell-smart-redisplay): Rename to 'eshell-smart-scroll'. Delete 'eobp' case.
* | Add a new Eshell special reference type for markersJim Porter2023-10-241-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/eshell/esh-arg.el (eshell-get-marker, eshell-insert-marker) (eshell-complete-marker-ref): New functions... (eshell-special-ref-alist): ... Add them to the new "marker" entry. * test/lisp/eshell/esh-arg-tests.el (esh-arg-test/special-reference/marker) (esh-arg-test/special-reference/nested) (esh-arg-test/special-reference/lisp-form): * test/lisp/eshell/em-cmpl-tests.el (em-cmpl-test/special-ref-completion/type) (em-cmpl-test/special-ref-completion/marker): New tests. * doc/misc/eshell.texi (Arguments): Document the new special ref type. * etc/NEWS: Announce this change (bug#66458).
* | Add 'eshell-special-ref-alist' to allow extending Eshell special refsJim Porter2023-10-245-89/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/eshell/esh-cmd.el (eshell--region-p, eshell-with-temp-command): Move to... * lisp/eshell/esh-util.el (eshell--region-p) (eshell-with-temp-command): ... here. * lisp/eshell/em-cmpl.el (eshell-complete-parse-arguments): Fix edge case when 'end' is at beginning of (possibly-narrowed) buffer. * lisp/eshell/esh-arg.el (eshell-special-ref-alist) New variable... (eshell-special-ref-default): ... New option... (eshell--special-ref-function): ... New function... (eshell-parse-special-reference): ... use them. (eshell-insert-special-reference): New function. (eshell-complete-special-reference): Reimplement to use a nested call to Pcomplete. (eshell-complete-buffer-ref): New function. * lisp/eshell/esh-proc.el (eshell-proc-initialize): Add "process" special ref type here. (eshell-complete-process-ref): New function. * doc/misc/eshell.texi (Bugs and ideas): Remove now-implemented idea.
* | Support arbitrary Eshell arguments inside special referencesJim Porter2023-10-244-140/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/eshell/esh-arg.el (eshell-current-argument-plain): New variable. (eshell-parse-special-reference): Use 'eshell-parse-arguments'. (eshell-get-buffer): New function. (eshell-insert-buffer-name): Properly quote the buffer name. * lisp/eshell/esh-proc.el (eshell-read-process-name): Move to "Special references" section. (eshell-insert-process): Properly quote the process name. * lisp/eshell/em-extpipe.el (eshell-parse-external-pipeline): * lisp/eshell/esh-io.el (eshell-parse-redirection): Don't do anything when 'eshell-argument-plain' is non-nil. * test/lisp/eshell/esh-arg-tests.el (esh-arg-test/special-reference/quoted) (esh-arg-test/special-reference/var-expansion): New tests. (esh-arg-test/special-reference/special): Rename to... (esh-arg-test/special-reference/special-characters): ... this. * test/lisp/eshell/em-extpipe-tests.el (em-extpipe-tests--deftest): Properly quote the buffer name. (em-extpipe-test-4, em-extpipe-test-7): Use 'eshell-get-buffer'.
* | ; * lisp/eshell/esh-proc.el (eshell-process-wait-time): Add :version.Jim Porter2023-10-171-0/+1
| |
* | ; 'eshell-kill-process-wait-time' can be a floating-point numberJim Porter2023-10-161-1/+1
| | | | | | | | * lisp/eshell/esh-proc.el (eshell-kill-process-wait-time): Update type.
* | ; Use the "new" calling convention for 'sit-for' in EshellJim Porter2023-10-161-2/+9
| | | | | | | | | | | | | | | | | | * lisp/eshell/esh-proc.el (eshell-process-wait-seconds) (eshell-process-wait-milliseconds): Make obsolete in favor of... (eshell-process-wait-time): ... this, and... (eshell-wait-for-process): ... use it. * etc/NEWS: Announce this change (bug#66574).
* | Reset the Eshell prompt when signaling with no foreground processJim Porter2023-10-121-15/+20
| | | | | | | | | | | | | | | | | | | | This fixes a small regression from commit eef32d13da5. * lisp/eshell/esh-proc.el (eshell-reset): Declare here. (eshell-reset-after-proc): Move implementation to... (eshell--reset-after-signal): ... here... (eshell-interrupt-process, eshell-kill-process eshell-quit-process) (eshell-stop-process, eshell-continue-process): ... and call it.
* | Fix behavior of Eshell prompt when yanking output into itJim Porter2023-10-112-0/+11
| | | | | | | | | | | | | | | | | | | | * lisp/eshell/esh-util.el (eshell--unmark-string-as-output): New function... * lisp/eshell/esh-mode.el (eshell-mode): ... use it. * test/lisp/eshell/eshell-tests.el (eshell-test/yank-output): New test (bug#66469).
* | Support Eshell iterative evaluation in the backgroundJim Porter2023-10-025-66/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This really just generalizes Eshell's previous support for iterative evaluation of a single current command to a list of multiple commands, of which at most one can be in the foreground (bug#66066). * lisp/eshell/esh-cmd.el (eshell-last-async-procs) (eshell-current-command): Make obsolete in favor of... (eshell-foreground-command): ... this (eshell-background-commands): New variable. (eshell-interactive-process-p): Make obsolete. (eshell-head-process, eshell-tail-process): Use 'eshell-foreground-command'. (eshell-cmd-initialize): Initialize new variables. (eshell-add-command, eshell-remove-command) (eshell-commands-for-process): New functions. (eshell-parse-command): Make 'eshell-do-subjob' the outermost call. (eshell-do-subjob): Call 'eshell-resume-eval' to split this command off from its parent forms. (eshell-eval-command): Use 'eshell-add-command'. (eshell-resume-command): Use 'eshell-commands-for-process'. (eshell-resume-eval): Take a COMMAND argument. Return ':eshell-background' form for deferred background commands. (eshell-do-eval): Remove check for 'eshell-current-subjob-p'. This is handled differently now. * lisp/eshell/eshell.el (eshell-command): Wait for all processes to exit when running synchronously. * lisp/eshell/esh-mode.el (eshell-intercept-commands) (eshell-watch-for-password-prompt): * lisp/eshell/em-cmpl.el (eshell-complete-parse-arguments): * lisp/eshell/em-smart.el (eshell-smart-display-move): Use 'eshell-foreground-command'. * test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/background/simple-command) (esh-cmd-test/background/subcommand): New tests. (esh-cmd-test/throw): Use 'eshell-foreground-command'. * test/lisp/eshell/eshell-tests.el (eshell-test/queue-input): Use 'eshell-foreground-command'. * test/lisp/eshell/em-script-tests.el (em-script-test/source-script/background): Make the test script more complex. * test/lisp/eshell/eshell-tests.el (eshell-test/eshell-command/pipeline-wait): New test. * doc/misc/eshell.texi (Bugs and ideas): Remove implemented feature.
* | Don't print subjob messages when running an Eshell script in the backgroundJim Porter2023-10-023-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/eshell/esh-proc.el (eshell-subjob-messages): New variable... (eshell-record-process-object) (eshell-remove-process-entry): ... check it. * lisp/eshell/em-script.el (eshell-source-file): Set 'eshell-subjob-messages' to nil. * lisp/eshell/esh-cmd.el (eshell-do-subjob): Set 'eshell-subjob-messages' to t. * test/lisp/eshell/em-script-tests.el (em-script-test/source-script/background): New test.
* | ; Adjust Eshell regression tests to avoid SIGPIPEJim Porter2023-10-011-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | In batch mode, SIGPIPEs can cause Emacs to abort (bug#66186). * lisp/eshell/esh-io.el (eshell-output-object-to-target): Update comment. * test/lisp/eshell/esh-proc-tests.el (esh-proc-test/pipeline-connection-type/middle) (esh-proc-test/pipeline-connection-type/last): Use '(ignore)', since that causes no output when called with no arguments, thus avoiding a risky 'process-send-string'.
* | Use 'unwind-protect' in more places in EshellJim Porter2023-09-262-52/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lets us simplify the logic for how we reset 'eshell-current-command' and 'eshell-last-async-procs', as well as improving correctness of Eshell command forms in a few esoteric scenarios. Additionally, this helps set the stage for better support of background commands in Eshell (bug#66164). * lisp/eshell/esh-cmd.el (eshell-cmd-initialize): Remove addition to 'eshell-post-command-hook'; this is handled in 'eshell-resume-command' and 'eshell-resume-eval' now. (eshell-resume-command): Handle resetting the prompt as needed. (eshell-resume-eval): Use 'unwind-protect' to ensure that we set 'eshell-last-async-procs' and 'eshell-current-comment' at the right times. (eshell-parse-command, eshell-trap-errors, eshell-manipulate): Use 'unwind-protect'. (eshell-do-eval): Allow 'eshell-defer' to pass through 'unwind-protect' forms without actually calling the unwinding forms (yet). * lisp/eshell/esh-proc.el (eshell-kill-process-function) (eshell-reset-after-proc): Make obsolete. The behavior is now handled in 'eshell-resume-command'. (eshell-gather-process-output, eshell-sentinel) (eshell-interrupt-process, eshell-kill-process, eshell-quit-process) (eshell-stop-process, eshell-continue-process): Run 'eshell-kill-hook' directly. * test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/throw): New test.
* | ; Add debug instrumention for queueing commands in EshellJim Porter2023-09-181-9/+13
| | | | | | | | | | * lisp/eshell/esh-cmd.el (eshell-eval-command): Log the new command form.
* | Fix another race condition when waiting for Eshell processesJim Porter2023-09-182-6/+12
| | | | | | | | | | | | | | | | | | | | | | When checking if the other processes in our pipeline are "alive", we also need to check whether their sentinels are finished. Otherwise, we might proceed with command evaluation while one of the other processes is still cleaning up. * lisp/eshell/esh-proc.el (eshell-process-active-p): New function... (eshell-wait-for-process) * lisp/eshell/esh-cmd.el (eshell-resume-command): ... use it.
* | Use 'eshell-with-temp-command' (indirectly) to parse Eshell script filesJim Porter2023-09-172-45/+46
| | | | | | | | | | | | | | | | | | * lisp/eshell/esh-cmd.el (eshell--region-p): New function. (eshell-with-temp-command, eshell-parse-command): Support '(:file . FILENAME)' to use the contents of FILENAME. * lisp/eshell/em-script.el (eshell-source-file): Call 'eshell-parse-command' and use backticks.
* | Fix running background commands via 'eshell-command'Jim Porter2023-09-171-15/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This regressed (I believe) due to 2ec41c174f9. * lisp/eshell/esh-cmd.el (eshell-resume-eval): Check for non-nil 'retval' instead of for a process list (nil is also a technically a process list!). * test/lisp/eshell/eshell-tests.el (eshell-test/eshell-command/background-pipeline): Remove unnecessary 'copy-tree'. (eshell-test/eshell-command/output-buffer/sync) (eshell-test/eshell-command/output-buffer/async): New tests.
* | ; Fix a recent change in EshellJim Porter2023-09-171-8/+6
| | | | | | | | | | * lisp/eshell/esh-cmd.el (eshell-manipulate): Fix 'eshell-stringify' calls. (eshell-do-eval): Simplify 'if' condition.
* | Fix documented Eshell behavior of ignoring leading nils in commandsJim Porter2023-09-152-43/+38
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/eshell/esh-var.el (eshell-handle-local-variables): Simplify, and move leading-nil handling to... * lisp/eshell/esh-cmd.el (eshell-named-command): ... here. * test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/skip-leading-nils): * test/lisp/eshell/esh-var-tests.el (esh-var-test/local-variables/skip-nil): New tests. * doc/misc/eshell.texi (Expansion): Document this behavior.
* | Collapse 'if' forms in Eshell iterative evaluationJim Porter2023-09-141-10/+17
| | | | | | | | | | * lisp/eshell/esh-cmd.el (eshell-do-eval): After evaluating 'if' conditional, replace the form with the THEN or ELSE body.
* | ; Simplify how to use 'eshell-debug-command'Jim Porter2023-09-144-40/+43
| | | | | | | | | | | | | | | | Now, 'eshell-debug-command' works more like 'format-message', which is how we usually use it. * lisp/eshell/esh-util.el (eshell-always-debug-command): New function. (eshell-debug-command): Simplify. Update callers.
* | Improve process instrumentation in EshellJim Porter2023-09-131-14/+23
| | | | | | | | | | | | * lisp/eshell/esh-proc.el (eshell-insertion-filter): Add more logging, and try to bulletproof the implementation. (eshell-sentinel): Add more logging.
* | When waiting for processes in Eshell, wait until all the I/O is completeJim Porter2023-09-131-1/+8
| | | | | | | | | | | | | | | | This should fix bug#59103, bug#65590, and bug#65601. * lisp/eshell/esh-proc.el (eshell-sentinel): Set ':eshell-handles' to nil when finished with I/O. (eshell-wait-for-process): Wait until ':eshell-handles' is nil.
* | ; Fix an Eshell error when calling a lambda with form logging enabledJim Porter2023-09-131-1/+1
| | | | | | | | | | * lisp/eshell/esh-cmd.el (eshell-do-eval): Don't call 'symbol-name'; the function might be a closure.
* | ; * lisp/eshell/esh-cmd.el (eshell-do-eval): Fix 'eshell-manipulate' call.Jim Porter2023-09-131-1/+1
| |