summaryrefslogtreecommitdiff
path: root/lisp/progmodes/sh-script.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/sh-script.el')
-rw-r--r--lisp/progmodes/sh-script.el23
1 files changed, 16 insertions, 7 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 91db4ae21cb..c6b6f83471d 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -628,7 +628,8 @@ removed when closing the here document."
(wksh sh-append ksh88)
(zsh sh-append ksh88
- "autoload" "bindkey" "builtin" "chdir" "compctl" "declare" "dirs"
+ "autoload" "always"
+ "bindkey" "builtin" "chdir" "compctl" "declare" "dirs"
"disable" "disown" "echotc" "enable" "functions" "getln" "hash"
"history" "integer" "limit" "local" "log" "popd" "pushd" "r"
"readonly" "rehash" "sched" "setopt" "source" "suspend" "true"
@@ -1396,8 +1397,15 @@ If FORCE is non-nil and no process found, create one."
(or found
(and force
(get-buffer-process
- (let ((explicit-shell-file-name sh-shell-file))
- (shell)))))))))
+ (let ((explicit-shell-file-name sh-shell-file)
+ (display-buffer-overriding-action
+ '(nil . ((inhibit-same-window . t)))))
+ ;; We must prevent this `(shell)' call from
+ ;; switching buffers, so that the variable
+ ;; `sh-shell-process' is set locally in the
+ ;; correct buffer.
+ (save-current-buffer
+ (shell))))))))))
(defun sh-show-shell ()
"Pop the shell interaction buffer."
@@ -1532,6 +1540,7 @@ with your script for an edit-interpret-debug cycle."
(setq-local add-log-current-defun-function #'sh-current-defun-name)
(add-hook 'completion-at-point-functions
#'sh-completion-at-point-function nil t)
+ (setq-local outline-regexp "###")
;; Parse or insert magic number for exec, and set all variables depending
;; on the shell thus determined.
(sh-set-shell
@@ -1774,7 +1783,7 @@ Does not preserve point."
(goto-char p)
nil))))
(while
- (progn (skip-syntax-backward "w_'")
+ (progn (skip-syntax-backward ".w_'")
(or (not (zerop (skip-syntax-backward "\\")))
(when (eq ?\\ (char-before (1- (point))))
(let ((p (point)))
@@ -2192,7 +2201,7 @@ Point should be before the newline."
When used interactively, insert the proper starting #!-line,
and make the visited file executable via `executable-set-magic',
perhaps querying depending on the value of `executable-query'.
-(If given a prefix (i.e., `C-u') don't insert any starting #!
+(If given a prefix (i.e., `\\[universal-argument]') don't insert any starting #!
line.)
When this function is called noninteractively, INSERT-FLAG (the third
@@ -2514,7 +2523,7 @@ overwritten if
sh-styles-alist nil t)))
(let ((sl (assoc name sh-styles-alist)))
(if (null sl)
- (error "sh-load-style - style %s not known" name)
+ (error "sh-load-style: Style %s not known" name)
(dolist (var (cdr sl))
(set (car var) (cdr var))))))
@@ -2672,7 +2681,7 @@ t means to return a list of all possible completions of STRING.
(or sh-shell-variables-initialized
(sh-shell-initialize-variables))
(nconc (mapcar (lambda (var)
- (substring var 0 (string-match "=" var)))
+ (substring var 0 (string-search "=" var)))
process-environment)
sh-shell-variables))))
(complete-with-action code vars string predicate)))