bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9333: 23.3; shell script mode: "<<" starts here doc even on comment


From: Stefan Monnier
Subject: bug#9333: 23.3; shell script mode: "<<" starts here doc even on comment line
Date: Mon, 22 Aug 2011 18:11:30 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> 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@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)
                     ""))






reply via email to

[Prev in Thread] Current Thread [Next in Thread]