unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Anders Lindgren <andlind@gmail.com>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: Regarding Emacs, js.el, template-strings and syntax-tables
Date: Tue, 5 Sep 2017 11:25:26 +0300	[thread overview]
Message-ID: <6ca801de-9076-8a7f-6a7e-3b73ce207671@yandex.ru> (raw)
In-Reply-To: <CABr8ebb76fJJLk0=OBOUGgfByOkGwp8+-v_-=QakDYCh=Rp-Gg@mail.gmail.com>

On 9/5/17 10:00 AM, Anders Lindgren wrote:
> In other languages where the constructs only can be 
> simple variables, I would prefer to retain the string face (for the sake 
> of things like the background color) and color the variable name by 
> prepending the variable name face.

Sure, why not.

> In my experience, I can read code easier if the delimiters aren't 
> highlighted the same way the content is. (In other words, the current 
> Ruby implementation isn't ideal for me.)

Yes, so in the case of ruby-mode, the delimiters will have some special 
face (keyword? IDK), and the content will have the default face.

> While we're on the subject. I've been thinking about highlighting 
> parameters in functions and blocks in Ruby.

Let's maybe make it an optional mode, so ruby-mode doesn't stand out too 
much (or discuss whether all modes should do that if possible, on 
emacs-devel). But I've been looking at this too, albeit from a different 
standpoint (completion of local variable names).

> It wouldn't be too 
> difficult, and it would make code easier to read. Unfortunately, it 
> doesn't include all variables as local variables can be created on the 
> fly using a plain assignment in Ruby.

Finding assignments is easy (just a regexp). Tracking variable scopes 
(defined by their belonging to methods, or blocks, or even class/module 
bodies) looks harder to me. We can do that by parsing expressions with 
SMIE, but that's not fast if we have to parse the whole class body 
(there are some big classes out there).

Limiting ourselves to only methods might be fine, though.

> As a parallel, my lisp-extra-font-lock package 
> (https://github.com/Lindydancer/lisp-extra-font-lock) do this in Lisp 
> modes for function and lambda parameters and local variables introduces 
> using `let`, `dolist` et.c. Now that I've been using it for a couple of 
> years, I would not dream of going back to the near black-and-white world 
> of the default lisp modes.

I like the idea, but seeing the red on the screenshot is a bit 
off-putting. red is for errors.



  reply	other threads:[~2017-09-05  8:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24  6:56 Regarding Emacs, js.el, template-strings and syntax-tables Jostein Kjønigsen
2017-08-24 10:53 ` Stefan Monnier
2017-08-24 12:13   ` Jostein Kjønigsen
2017-08-24 12:17     ` Jostein Kjønigsen
2017-08-24 13:47       ` Stefan Monnier
2017-08-24 14:04     ` Stefan Monnier
2017-08-24 12:31   ` Anders Lindgren
2017-08-24 14:20     ` Stefan Monnier
2017-08-27 16:37       ` Dmitry Gutov
2017-08-24 14:22     ` Stefan Monnier
2017-08-24 15:19       ` Anders Lindgren
2017-08-29 13:36         ` Stefan Monnier
2017-08-29 13:49           ` Anders Lindgren
2017-08-30  2:22             ` Richard Stallman
2017-09-01 12:14               ` Anders Lindgren
2017-09-04 23:40     ` Dmitry Gutov
2017-09-05  7:00       ` Anders Lindgren
2017-09-05  8:25         ` Dmitry Gutov [this message]
2017-09-05  9:30           ` Anders Lindgren
2017-09-05  9:53             ` 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

  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=6ca801de-9076-8a7f-6a7e-3b73ce207671@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=andlind@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).