]> git.eshelyaron.com Git - emacs.git/commitdiff
Signal an error on `M-x shell-mode'
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 23 Aug 2019 00:57:07 +0000 (17:57 -0700)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 23 Aug 2019 00:57:07 +0000 (17:57 -0700)
* 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

index 2914d1d2c81c8a1dc14f2b7530dae71309f53401..ba7515e7bad9a306252d1fac3475be2e784aab6d 100644 (file)
@@ -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 "\\'")