diff options
| author | Dmitry Gutov | 2024-06-01 18:03:42 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2024-06-01 18:03:42 +0300 |
| commit | a154f0aa73bceeaaeefcd243e7db9d09e3f450d7 (patch) | |
| tree | 4708f1f9e80eaff35cddb7bdc09d18948d014166 /lisp/shell.el | |
| parent | d91ad9be5a72974784e0552069020c3ae0bc830e (diff) | |
| download | emacs-a154f0aa73bceeaaeefcd243e7db9d09e3f450d7.tar.gz emacs-a154f0aa73bceeaaeefcd243e7db9d09e3f450d7.zip | |
shell-command-mode: New major mode for async-shell-command
* etc/NEWS: Mention the additions.
* lisp/shell.el (shell-command-mode): New major mode (bug#71049).
* lisp/simple.el (async-shell-command-mode):
New variable, with default value pointing to that mode.
(shell-command): Refer to it here.
(async-shell-command): Update docstring.
* lisp/net/tramp.el (tramp-handle-shell-command):
Use the new variable when available.
Diffstat (limited to 'lisp/shell.el')
| -rw-r--r-- | lisp/shell.el | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/shell.el b/lisp/shell.el index b3201726762..4352811912a 100644 --- a/lisp/shell.el +++ b/lisp/shell.el | |||
| @@ -838,6 +838,13 @@ Sentinels will always get the two parameters PROCESS and EVENT." | |||
| 838 | (with-current-buffer buf | 838 | (with-current-buffer buf |
| 839 | (insert (format "\nProcess %s %s\n" process event)))))) | 839 | (insert (format "\nProcess %s %s\n" process event)))))) |
| 840 | 840 | ||
| 841 | (define-derived-mode shell-command-mode comint-mode "Shell" | ||
| 842 | "Major mode for the output of asynchronous `shell-command'." | ||
| 843 | (setq-local font-lock-defaults '(shell-font-lock-keywords t)) | ||
| 844 | ;; See comments in `shell-mode'. | ||
| 845 | (setq-local ansi-color-apply-face-function #'shell-apply-ansi-color) | ||
| 846 | (setq list-buffers-directory (expand-file-name default-directory))) | ||
| 847 | |||
| 841 | ;;;###autoload | 848 | ;;;###autoload |
| 842 | (defun shell (&optional buffer file-name) | 849 | (defun shell (&optional buffer file-name) |
| 843 | "Run an inferior shell, with I/O through BUFFER (which defaults to `*shell*'). | 850 | "Run an inferior shell, with I/O through BUFFER (which defaults to `*shell*'). |