[Top][All Lists]

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

Re: Regarding Emacs, js.el, template-strings and syntax-tables

From: Stefan Monnier
Subject: Re: Regarding Emacs, js.el, template-strings and syntax-tables
Date: Tue, 29 Aug 2017 09:36:47 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

>> Which version of bat-mode did you test?
> The one that comes with Emacs 25.1. For example (with a custom theme to
> make strings stand out):

> echo this should be a string, right?
> foo %alpha
> foo %alpha_beta
> foo "%alpha"set alpha=gammaset alpha_beta=gamma
> foo foo.in

Have you reported these as bugs?  They should be easy to fix.
I know nothing about the "bat" language, so I don't even know how the
above *should* be parsed.

>> Same question for some of the comments in the above web-page.  E.g. you
>> say "Strings containing “<<” are treated as heredoc comments", but AFAIK
>> this should only happen in fairly old versions of Emacs.
> I see this in Emacs 25.1, for example:
> echo "<<test"
> test
> I reported this over a year ago, for Emacs 25.0.93, see bug#23526.

Sorry, didn't see this one (I'm not subscribed to the bugs list any more,
so I only see the bugs that are Cc'd to me).

I believe the patch below should fix it (should appear in trunk


diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 54c47b719f..9cfbb39d53 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -975,7 +975,7 @@ sh-font-lock-open-heredoc
 be indented (i.e. a <<- was used rather than just <<).
 Point is at the beginning of the next line."
   (unless (or (memq (char-before start) '(?< ?>))
-             (sh-in-comment-or-string start)
+             (sh-in-comment-or-string (1+ start))
               (sh--inside-noncommand-expression start))
     ;; We're looking at <<STRING, so we add "^STRING$" to the syntactic
     ;; font-lock keywords to detect the end of this here document.

reply via email to

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