emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master d08f7c4: Signal an error on `M-x shell-mode'


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master d08f7c4: Signal an error on `M-x shell-mode'
Date: Thu, 22 Aug 2019 20:59:23 -0400 (EDT)

branch: master
commit d08f7c41241e78b88bc2aaaa2dd323ce7512ae94
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Signal an error on `M-x shell-mode'
    
    * lisp/shell.el (shell-mode): This mode can't usefully be called
    interactively (and is somewhat destructive, as it disables
    `undo'), and it's usually confused with `shell-script-mode'
    (bug#19812).  So signal an error if it's used interactively.
---
 lisp/shell.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/shell.el b/lisp/shell.el
index 2914d1d..ba7515e 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -553,6 +553,8 @@ Variables `comint-output-filter-functions', a hook, and
 `comint-scroll-to-bottom-on-input' and `comint-scroll-to-bottom-on-output'
 control whether input and output cause the window to scroll to the end of the
 buffer."
+  (when (called-interactively-p 'any)
+    (error "Can't be called interactively; did you mean `shell-script-mode' 
instead?"))
   (setq comint-prompt-regexp shell-prompt-pattern)
   (shell-completion-vars)
   (setq-local paragraph-separate "\\'")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]