aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/eshell (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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
| |
* | Use "/local:" prefix in Eshell to run local commands when cwd is remoteJim Porter2024-05-151-28/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | ; Clean up some 'require' and 'declare-function' calls in EshellJim Porter2024-05-105-18/+8
| | | | | | | | | | | | | | | | | | | | * lisp/eshell/em-ls.el: * lisp/eshell/esh-cmd.el: * lisp/eshell/esh-mode.el: * lisp/eshell/esh-ext.el: Remove superfluous 'declare-function' calls. * lisp/eshell/esh-proc.el (pcomplete): Require this explicitly instead of transitively.
* | ; Remove unnecessary defvars defined in a file we already 'require'Jim Porter2024-05-091-3/+0
| | | | | | | | | | * lisp/eshell/esh-cmd.el (eshell-output-handle, eshell-error-handle): Remove superfluous declarations.
* | ; Fix an edge case with Eshell globs when the directory part is quotedJim Porter2024-05-091-2/+1
| | | | | | | | | | | | | | | | * 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-11/+19
| | | | | | | | | | | | | | | | | | | | | | * 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.
* | Only run 'eshell-first-time-mode-hook' once per Emacs sessionLin Sun2024-05-021-2/+4
| | | | | | | | | | * lisp/eshell/esh-mode.el (eshell-mode): Set 'eshell-first-time-p' to nil (bug#70610).
* | Suppress warnings for obsolete display-comint-buffer-action (bug#69983)Juri Linkov2024-04-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/cmuscheme.el (run-scheme, switch-to-scheme): * lisp/shell.el (shell): * lisp/eshell/eshell.el (eshell): * lisp/progmodes/inf-lisp.el (inferior-lisp): * lisp/progmodes/sh-script.el (sh-show-shell): * lisp/textmodes/tex-mode.el (tex-display-shell) (tex-recenter-output-buffer): Add 'with-suppressed-warnings' to suppress warnings for obsolete options 'display-comint-buffer-action' and 'display-tex-shell-buffer-action'.
* | ; 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.