]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/sh-script.el
(compilation-start): Resurrect the version for systems that don't support
[gnu-emacs] / lisp / progmodes / sh-script.el
index bff5814811679c4078418880082a14dba5c7cc71..72533d887349fee981809957b8b2b29acb19e658 100644 (file)
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -21,9 +21,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -477,7 +475,6 @@ This is buffer-local in every such buffer.")
     (define-key map "\"" 'skeleton-pair-insert-maybe)
 
     (define-key map [remap complete-tag] 'comint-dynamic-complete)
-    (define-key map [remap newline-and-indent] 'sh-newline-and-indent)
     (define-key map [remap delete-backward-char]
       'backward-delete-char-untabify)
     (define-key map "\C-c:" 'sh-set-shell)
@@ -498,8 +495,13 @@ This is buffer-local in every such buffer.")
                  :help "Set the indentation for the current line"))
 
     (define-key menu-map [sh-pair]
-      '(menu-item "Insert braces and quotes in pairs" (lambda () (interactive) (setq skeleton-pair (not skeleton-pair)))
-                 :button (:toggle . skeleton-pair)
+      '(menu-item "Insert braces and quotes in pairs"
+                 (lambda ()
+                   (interactive)
+                   (require 'skeleton)
+                   (setq skeleton-pair (not skeleton-pair)))
+                 :button (:toggle . (and (boundp 'skeleton-pair)
+                                         skeleton-pair))
                  :help "Inserting a brace or quote automatically inserts the matching pair"))
 
     (define-key menu-map [sh-s0] '("--"))
@@ -877,7 +879,7 @@ See `sh-feature'.")
   "Face to show a here-document"
   :group 'sh-indentation)
 
-;; These colours are probably icky.  It's just a placeholder though.
+;; These colors are probably icky.  It's just a placeholder though.
 (defface sh-quoted-exec
   '((((class color) (background dark))
      (:foreground "salmon"))
@@ -1006,7 +1008,7 @@ If non-nil INDENTED indicates that the EOF was indented."
 (defun sh-font-lock-open-heredoc (start string)
   "Determine the syntax of the \\n after a <<EOF.
 START is the position of <<.
-STRING is the actual word used as delimiter (f.ex. \"EOF\").
+STRING is the actual word used as delimiter (e.g. \"EOF\").
 INDENTED is non-nil if the here document's content (and the EOF mark) can
 be indented (i.e. a <<- was used rather than just <<).
 Point is at the beginning of the next line."
@@ -1512,7 +1514,7 @@ buffer indents as it currently is indented.
 
 
 \\[backward-delete-char-untabify]       Delete backward one position, even if it was a tab.
-\\[sh-newline-and-indent]       Delete unquoted space and indent new line same as this one.
+\\[newline-and-indent]  Delete unquoted space and indent new line same as this one.
 \\[sh-end-of-command]   Go to end of successive commands.
 \\[sh-beginning-of-command]     Go to beginning of successive commands.
 \\[sh-set-shell]        Set this buffer's shell, and maybe its magic number.
@@ -2594,7 +2596,7 @@ If AND-MOVE is non-nil then move to end of word."
        (goto-char where))
     (prog1
        (buffer-substring (point)
-                         (progn (skip-chars-forward "^ \t\n;&|()")(point)))
+                         (progn (skip-chars-forward "^ \t\n;&|")(point)))
       (unless and-move
        (goto-char start)))))
 
@@ -3782,18 +3784,6 @@ The document is bounded by `sh-here-document-word'."
 
 
 
-(defun sh-newline-and-indent ()
-  "Strip unquoted whitespace, insert newline, and indent like current line."
-  (interactive "*")
-  (indent-to (prog1 (current-indentation)
-              (delete-region (point)
-                             (progn
-                               (or (zerop (skip-chars-backward " \t"))
-                                   (if (sh-quoted-p)
-                                       (forward-char)))
-                               (point)))
-              (newline))))
-
 (defun sh-beginning-of-command ()
   "Move point to successive beginnings of commands."
   (interactive)