diff options
| author | Karl Heuer | 1995-08-19 00:30:56 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-08-19 00:30:56 +0000 |
| commit | cd76025c784faeec1206c2210ae34347cc6bca9e (patch) | |
| tree | 63a2fa344ca196e8a192979f8560541f3dda5576 | |
| parent | 4bfd70e96b978324e46e138b9a13d1b4fd329088 (diff) | |
| download | emacs-cd76025c784faeec1206c2210ae34347cc6bca9e.tar.gz emacs-cd76025c784faeec1206c2210ae34347cc6bca9e.zip | |
(sh-newline-and-indent): Don't interpret prefix arg
since `newline-and-indent' doesn't either. Don't turn a trailing
quoted tab into a space.
(sh-mode): Use new `skeleton-newline-indent-rigidly'.
(sh-set-shell): Make maximum font-locking also hightlight keywords
after ``' and `!'. (The latter is for ksh '93 but should't hurt other
shells.)
| -rw-r--r-- | lisp/progmodes/sh-script.el | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index e9aae75c49f..f1ad6922180 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -633,6 +633,7 @@ with your script for an edit-interpret-debug cycle." | |||
| 633 | (make-local-variable 'comint-prompt-regexp) | 633 | (make-local-variable 'comint-prompt-regexp) |
| 634 | (make-local-variable 'font-lock-keywords-case-fold-search) | 634 | (make-local-variable 'font-lock-keywords-case-fold-search) |
| 635 | (make-local-variable 'skeleton-filter) | 635 | (make-local-variable 'skeleton-filter) |
| 636 | (make-local-variable 'skeleton-newline-indent-rigidly) | ||
| 636 | (make-local-variable 'process-environment) | 637 | (make-local-variable 'process-environment) |
| 637 | (setq major-mode 'sh-mode | 638 | (setq major-mode 'sh-mode |
| 638 | mode-name "Shell-script" | 639 | mode-name "Shell-script" |
| @@ -651,7 +652,8 @@ with your script for an edit-interpret-debug cycle." | |||
| 651 | skeleton-pair-filter 'sh-quoted-p | 652 | skeleton-pair-filter 'sh-quoted-p |
| 652 | skeleton-further-elements '((< '(- (min sh-indentation | 653 | skeleton-further-elements '((< '(- (min sh-indentation |
| 653 | (current-column))))) | 654 | (current-column))))) |
| 654 | skeleton-filter 'sh-feature) | 655 | skeleton-filter 'sh-feature |
| 656 | skeleton-newline-indent-rigidly t) | ||
| 655 | ;; parse or insert magic number for exec() and set all variables depending | 657 | ;; parse or insert magic number for exec() and set all variables depending |
| 656 | ;; on the shell thus determined | 658 | ;; on the shell thus determined |
| 657 | (goto-char (point-min)) | 659 | (goto-char (point-min)) |
| @@ -688,7 +690,7 @@ Calls the value of `sh-set-shell-hook' if set." | |||
| 688 | (,(sh-feature sh-assignment-regexp) | 690 | (,(sh-feature sh-assignment-regexp) |
| 689 | 1 font-lock-variable-name-face) | 691 | 1 font-lock-variable-name-face) |
| 690 | ,@(if font-lock-maximum-decoration | 692 | ,@(if font-lock-maximum-decoration |
| 691 | `((,(concat "\\(^\\|[|&;()]\\)[ \t]*\\(\\(\\(" | 693 | `((,(concat "\\(^\\|[|&;()`!]\\)[ \t]*\\(\\(\\(" |
| 692 | (mapconcat 'identity | 694 | (mapconcat 'identity |
| 693 | (sh-feature sh-leading-keywords) | 695 | (sh-feature sh-leading-keywords) |
| 694 | "\\|") | 696 | "\\|") |
| @@ -1291,20 +1293,17 @@ The document is bounded by `sh-here-document-word'." | |||
| 1291 | 1293 | ||
| 1292 | 1294 | ||
| 1293 | 1295 | ||
| 1294 | (defun sh-newline-and-indent (&optional arg) | 1296 | (defun sh-newline-and-indent () |
| 1295 | "Strip unquoted whitespace, insert newline, and indent like current line. | 1297 | "Strip unquoted whitespace, insert newline, and indent like current line." |
| 1296 | Unquoted whitespace is stripped from the current line's end, unless a | 1298 | (interactive "*") |
| 1297 | prefix ARG is given." | 1299 | (indent-to (prog1 (current-indentation) |
| 1298 | (interactive "*P") | 1300 | (delete-region (point) |
| 1299 | (let ((previous (current-indentation))) | 1301 | (progn |
| 1300 | (if arg () | 1302 | (or (zerop (skip-chars-backward " \t")) |
| 1301 | (just-one-space) | 1303 | (if (sh-quoted-p) |
| 1302 | (backward-char) | 1304 | (forward-char))) |
| 1303 | (if (sh-quoted-p) | 1305 | (point))) |
| 1304 | (forward-char) | 1306 | (newline)))) |
| 1305 | (delete-char 1))) | ||
| 1306 | (newline) | ||
| 1307 | (indent-to previous))) | ||
| 1308 | 1307 | ||
| 1309 | 1308 | ||
| 1310 | 1309 | ||