comparison lisp/progmodes/sh-script.el @ 104298:75f3a35d516e

* progmodes/sh-script.el (sh-maybe-here-document): Avoid inserting another heredoc if the user adds another < (Bug#3226).
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 16 Aug 2009 14:04:25 +0000
parents 69c0814ddb4e
children afa0e028ba97
comparison
equal deleted inserted replaced
104297:f3695109ab95 104298:75f3a35d516e
3747 "Insert self. Without prefix, following unquoted `<' inserts here document. 3747 "Insert self. Without prefix, following unquoted `<' inserts here document.
3748 The document is bounded by `sh-here-document-word'." 3748 The document is bounded by `sh-here-document-word'."
3749 (interactive "*P") 3749 (interactive "*P")
3750 (self-insert-command (prefix-numeric-value arg)) 3750 (self-insert-command (prefix-numeric-value arg))
3751 (or arg 3751 (or arg
3752 (not (eq (char-after (- (point) 2)) last-command-event)) 3752 (not (looking-back "[^<]<<"))
3753 (save-excursion 3753 (save-excursion
3754 (backward-char 2) 3754 (backward-char 2)
3755 (sh-quoted-p)) 3755 (sh-quoted-p))
3756 (let ((tabs (if (string-match "\\`-" sh-here-document-word) 3756 (let ((tabs (if (string-match "\\`-" sh-here-document-word)
3757 (make-string (/ (current-indentation) tab-width) ?\t) 3757 (make-string (/ (current-indentation) tab-width) ?\t)