all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Juri Linkov <juri@linkov.net>, Randy Taylor <dev@rjt.dev>
Cc: casouri@gmail.com, 60105@debbugs.gnu.org
Subject: bug#60105: [PATCH] Add yaml-ts-mode
Date: Thu, 5 Jan 2023 01:30:41 +0200	[thread overview]
Message-ID: <9da7be0a-5ce8-f1da-6bb5-10f0c47d20ef@yandex.ru> (raw)
In-Reply-To: <86k023v5qa.fsf@mail.linkov.net>

On 03/01/2023 20:21, Juri Linkov wrote:
> The reason why I proposed a new customizable option is because
> ruby-ts-mode provides an option ruby-ts-highlight-predefined-constants
> that enables some rules in ruby-ts--font-lock-settings.  But maybe
> there is no way to avoid this fine-grained setting in ruby-ts-mode.

But there is. What do you think about this change?

diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el
index 5c173ad24c7..93039c27511 100644
--- a/lisp/progmodes/ruby-ts-mode.el
+++ b/lisp/progmodes/ruby-ts-mode.el
@@ -87,11 +87,6 @@ ruby-ts
    :prefix "ruby-ts-"
    :group 'languages)

-(defcustom ruby-ts-highlight-predefined-constants t
-  "When non-nil, the pre-defined constants are highlighted.
-They will be highlighted the same way as the pre-defined variables."
-  :type 'boolean)
-
  (defvar ruby-ts--operators
    '("+" "-" "*" "/" "%" "**"
      "==" "!=" ">" "<" ">=" "<=" "<=>" "==="
@@ -202,9 +197,11 @@ ruby-ts--font-lock-settings

     :language language
     :feature 'builtin
-   `(((global_variable) @var (:match ,ruby-ts--predefined-variables 
@var)) @font-lock-builtin-face
-     ,@(when ruby-ts-highlight-predefined-constants
-         `(((constant) @var (:match ,ruby-ts--predefined-constants 
@var)) @font-lock-builtin-face)))
+   `(((global_variable) @var (:match ,ruby-ts--predefined-variables 
@var)) @font-lock-builtin-face)
+
+   :language language
+   :feature 'builtin-constant
+   `(((constant) @var (:match ,ruby-ts--predefined-constants @var)) 
@font-lock-builtin-face)

     :language language
     :feature 'keyword
@@ -932,7 +929,7 @@ ruby-ts-mode
    (setq-local treesit-font-lock-feature-list
                '(( comment method-definition )
                  ( keyword regexp string type)
-                ( builtin constant
+                ( builtin builtin-constant constant
                    delimiter escape-sequence global
                    instance
                    interpolation literal symbol variable)






  reply	other threads:[~2023-01-04 23:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15 22:19 bug#60105: [PATCH] Add yaml-ts-mode Randy Taylor
2022-12-16  0:20 ` Stefan Kangas
2022-12-16  2:01   ` Randy Taylor
2022-12-16 22:55 ` Yuan Fu
2023-01-02 18:52 ` Juri Linkov
2023-01-02 21:58   ` Randy Taylor
2023-01-03 18:21     ` Juri Linkov
2023-01-04 23:30       ` Dmitry Gutov [this message]
2023-01-05 18:09         ` Juri Linkov
2023-01-06  1:55           ` Dmitry Gutov

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

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

  git send-email \
    --in-reply-to=9da7be0a-5ce8-f1da-6bb5-10f0c47d20ef@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=60105@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=dev@rjt.dev \
    --cc=juri@linkov.net \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.