unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: "積丹尼 Dan Jacobson" <jidanni@jidanni.org>
Cc: 23461@debbugs.gnu.org
Subject: bug#23461: perl mode uses same color for comments and here documents
Date: Wed, 09 Oct 2019 07:52:27 +0200	[thread overview]
Message-ID: <87zhiaqxd0.fsf@gnus.org> (raw)
In-Reply-To: <87a8k4tdxp.fsf@jidanni.org> ("積丹尼 Dan Jacobson"'s message of "Fri, 06 May 2016 05:03:46 +0800")

積丹尼 Dan Jacobson <jidanni@jidanni.org> writes:

> perl mode uses same color for comments and here documents.
> Isn't there some other color that can be chosen?
>
> print <<'EOF';
>  <meta name="viewport" content="width=device-width">
> EOF
> # use XML::TreePP;

Yes, that doesn't seem optimal...

But as usual when trying to investigate what's going on with these
syntax things, I have no idea what's going on.  perl-mode detects these
correctly, but I don't know where the mapping from whatever this does to
faces happens, and I can't edebug through syntax-propertize-rules, and
putting a `debug' into the thing is just ignored.

Does anybody know where I should be poking around to find out what's
going on here?

      ;; Here documents.
      ((concat
        "\\(?:"
        ;; << "EOF", << 'EOF', or << \EOF
        "<<\\(~\\)?[ \t]*\\('[^'\n]*'\\|\"[^\"\n]*\"\\|\\\\[[:alpha:]][[:alnum:]]*\\)"
        ;; The <<EOF case which needs perl--syntax-exp-intro-regexp, to
        ;; disambiguate with the left-bitshift operator.
        "\\|" perl--syntax-exp-intro-regexp "<<\\(?2:\\sw+\\)\\)"
        ".*\\(\n\\)")
       (4 (let* ((st (get-text-property (match-beginning 4) 'syntax-table))
                 (name (match-string 2))
                 (indented (match-beginning 1)))
            (goto-char (match-end 2))
            (if (save-excursion (nth 8 (syntax-ppss (match-beginning 0))))
                ;; Leave the property of the newline unchanged.
                st

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2019-10-09  5:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-05 21:03 bug#23461: perl mode uses same color for comments and here documents 積丹尼 Dan Jacobson
2019-10-09  5:52 ` Lars Ingebrigtsen [this message]
2020-12-23  2:19 ` bug#23461: perl-mode: Displaying HERE-docs as strings instead of comments [PATCH] Harald Jörg
2020-12-23  4:00   ` Stefan Monnier
2020-12-23 14:37     ` Harald Jörg
2020-12-23 16:34       ` Stefan Monnier
2020-12-23 18:46         ` Harald Jörg
2020-12-23 19:04           ` Stefan Monnier
2020-12-23 19:06             ` Stefan Monnier
2020-12-24 15:29             ` Harald Jörg
2020-12-24 17:32               ` Stefan Monnier
2021-01-04 23:43                 ` Harald Jörg
2021-01-05  9:14                   ` Lars Ingebrigtsen
2021-01-05 12:30                     ` Harald Jörg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zhiaqxd0.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=23461@debbugs.gnu.org \
    --cc=jidanni@jidanni.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).