GNU bug report logs -
#9333
23.3; shell script mode: "<<" starts here doc even on comment line
Previous Next
Reported by: Ryo Furue <furue <at> hawaii.edu>
Date: Sat, 20 Aug 2011 02:56:02 UTC
Severity: minor
Found in version 23.3
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #10 received at 9333-done <at> debbugs.gnu.org (full text, mbox):
> In the shell-script mode, typing "<<" on a comment line starts
> a here document. I use "<< . . ." in comments as a personal
> style in many computer languages including shell.
I've installed the patch below which should fix this issue.
Stefan
=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog 2011-08-22 21:16:46 +0000
+++ lisp/ChangeLog 2011-08-22 22:09:55 +0000
@@ -1,5 +1,8 @@
2011-08-22 Stefan Monnier <monnier <at> iro.umontreal.ca>
+ * progmodes/sh-script.el (sh-maybe-here-document): Disable magic in
+ strings and comments (bug#9333).
+
* emacs-lisp/debug.el (debug-arglist): New function.
(debug-convert-byte-code): Use it. Handle lexical byte-codes.
(debug-on-entry-1): Handle interpreted closures (bug#9120).
=== modified file 'lisp/progmodes/sh-script.el'
--- lisp/progmodes/sh-script.el 2011-08-04 00:58:07 +0000
+++ lisp/progmodes/sh-script.el 2011-08-22 22:08:26 +0000
@@ -460,6 +460,7 @@
(define-key map "\C-c+" 'sh-add)
(define-key map "\C-\M-x" 'sh-execute-region)
(define-key map "\C-c\C-x" 'executable-interpret)
+ ;; FIXME: Use post-self-insert-hook.
(define-key map "<" 'sh-maybe-here-document)
(define-key map "(" 'skeleton-pair-insert-maybe)
(define-key map "{" 'skeleton-pair-insert-maybe)
@@ -3659,6 +3660,7 @@
(save-excursion
(backward-char 2)
(sh-quoted-p))
+ (nth 8 (syntax-ppss))
(let ((tabs (if (string-match "\\`-" sh-here-document-word)
(make-string (/ (current-indentation) tab-width) ?\t)
""))
This bug report was last modified 13 years and 275 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.