GNU bug report logs - #16500
24.3.50; Wrong font-lock backquote highlighting in plan9 rc variant of sh-mode

Previous Next

Package: emacs;

Reported by: Mikhail Gusarov <dottedmag <at> dottedmag.net>

Date: Sun, 19 Jan 2014 18:49:02 UTC

Severity: minor

Found in version 24.3.50

Full log


Message #14 received at 16500 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Vasilij Schneidermann <mail <at> vasilij.de>
Cc: Mikhail Gusarov <dottedmag <at> dottedmag.net>, 16500 <at> debbugs.gnu.org
Subject: Re: bug#16500: 24.3.50; Wrong font-lock backquote highlighting in
 plan9 rc
Date: Sat, 03 Sep 2022 12:02:15 +0200
Vasilij Schneidermann <mail <at> vasilij.de> writes:

> I've run into this bug while switching all my sh/bash scripts to rc and
> used the following workaround:
>
>     (defun my-sh-set-shell-hook ()
>       (when (member sh-shell '(rc es))
>         (modify-syntax-entry ?` ".")))
>
>     (add-hook 'sh-set-shell-hook 'my-sh-set-shell-hook)
>
> I doubt this warrants inclusion into sh-script.el as is, but should
> demonstrate a possible approach how to fix it.

But we want the {...} to be fontified as a quoted-exec, so I think the
correct fix here is to make { } be a pair after ` in the rc version?

That is, tweak this:

(defun sh-font-lock-syntactic-face-function (state)
  (let ((q (nth 3 state)))
    (if q
        (if (characterp q)
            (if (eq q ?\`) 'sh-quoted-exec font-lock-string-face)
          'sh-heredoc)
      font-lock-comment-face)))

Possibly...




This bug report was last modified 1 year and 155 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.