From 18368c4a7a11f442a28b2520654d727ec733af83 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 27 May 2003 18:40:55 +0000 Subject: [PATCH] (sh-here-document-word): Document new treatment of leading "-". (sh-maybe-here-document): Strip a leading "-" from closing heredoc delimiter, if present. --- lisp/ChangeLog | 23 +++++++++++++++++++++++ lisp/progmodes/sh-script.el | 13 +++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 409fdc5cc73..47616ddaded 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,26 @@ +2003-05-27 Glenn Morris + + * progmodes/sh-script.el (sh-here-document-word): Document + new treatment of leading "-". + (sh-maybe-here-document): Strip a leading "-" from closing + heredoc delimiter, if present. + + * align.el (align-rules-list): Doc fix. + + * calendar/timeclock.el: Update copyright. + (timeclock-ask-before-exiting): Put `timeclock-query-out' on + `kill-emacs-query-functions' rather than `kill-emacs-hook'. + (timeclock-mode-string): Doc fix. + (timeclock-modeline-display): Doc fix. Use `global-mode-string' + rather than `mode-line-format'. + (timeclock-query-out): Doc fix. + (timeclock-update-modeline): No need for `let*', so use `let'. + Add some help-echo text to `timeclock-mode-string'. + (timeclock-mode-string): Give it the risky-local-variable + property, so that help-echo text will display. + (timeclock-find-discrep): Set `accum' to 0 if + `timeclock-discrepancy' is nil. + 2003-05-27 Stefan Monnier * emacs-lisp/lisp-mode.el (lisp-font-lock-syntactic-face-function): diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index f43aca53536..d5193e17e2c 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -543,7 +543,13 @@ The actual command ends at the end of the first \\(grouping\\)." (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 @@ The document is bounded by `sh-here-document-word'." (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 -- 2.39.2