# HG changeset patch # User Glenn Morris # Date 1054060831 0 # Node ID 575ad90ca2548ff2f9a262c55f5bb9dce08324e0 # Parent ca3933891346240d914bd098f5246ba85832fba2 (sh-here-document-word): Document new treatment of leading "-". (sh-maybe-here-document): Strip a leading "-" from closing heredoc delimiter, if present. diff -r ca3933891346 -r 575ad90ca254 lisp/progmodes/sh-script.el --- 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