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

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

bug#16500: 24.3.50; Wrong font-lock backquote highlighting in plan9 rc


From: Lars Ingebrigtsen
Subject: bug#16500: 24.3.50; Wrong font-lock backquote highlighting in plan9 rc
Date: Sat, 03 Sep 2022 12:02:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Vasilij Schneidermann <mail@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...





reply via email to

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