changeset 51265:575ad90ca254

(sh-here-document-word): Document new treatment of leading "-". (sh-maybe-here-document): Strip a leading "-" from closing heredoc delimiter, if present.
author Glenn Morris <rgm@gnu.org>
date Tue, 27 May 2003 18:40:31 +0000
parents ca3933891346
children 260b864ff270
files lisp/progmodes/sh-script.el
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/sh-script.el	Tue May 27 18:38:40 2003 +0000
+++ b/lisp/progmodes/sh-script.el	Tue May 27 18:40:31 2003 +0000
@@ -543,7 +543,13 @@
 
 
 (defvar sh-here-document-word "EOF"
-  "Word to delimit here documents.")
+  "Word to delimit here documents.
+If the first character of this string is \"-\", this character will
+be removed from the string when it is used to close the here document.
+This convention is used by the Bash shell, for example, to indicate
+that leading tabs inside the here document should be ignored.
+Note that Emacs currently has no support for indenting inside here
+documents - you must insert literal tabs by hand.")
 
 (defvar sh-test
   '((sh "[  ]" . 3)
@@ -3498,7 +3504,10 @@
 	    (sh-quoted-p)
 	  (end-of-line 2))
 	(newline)
-	(save-excursion (insert ?\n sh-here-document-word)))))
+	(save-excursion
+          (insert ?\n (substring
+                       sh-here-document-word
+                       (if (string-match "^-" sh-here-document-word) 1 0)))))))
 
 
 ;; various other commands