all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Add ruby-mode.el configuration for font-face customization
@ 2017-04-24  1:55 Justin Smestad
  2017-04-28  9:12 ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Justin Smestad @ 2017-04-24  1:55 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 541 bytes --]

I've been in the process of switching over to emacs and noticed the syntax
highlighter for `ruby-mode.el` is much less customizable than say
`python.el`. In an effort to make it more customizable, I created this
patch - https://gist.github.com/jsmestad/d4ab36c94c5d22bb68a72d8d403b4c
b7#file-ruby-mode-revised-patch

A few things:

   - Is this the right mailing list to discuss ruby-mode.el changes?
   - Are there better ways to do this?
   - What do you all think of the idea of font-face customizations for the
   mode?

Regards,
Justin

[-- Attachment #2: Type: text/html, Size: 1145 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Add ruby-mode.el configuration for font-face customization
  2017-04-24  1:55 Add ruby-mode.el configuration for font-face customization Justin Smestad
@ 2017-04-28  9:12 ` Dmitry Gutov
  2017-04-28  9:48   ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2017-04-28  9:12 UTC (permalink / raw)
  To: Justin Smestad, emacs-devel

Hello Justin,

On 24.04.2017 4:55, Justin Smestad wrote:
> I've been in the process of switching over to emacs and noticed the 
> syntax highlighter for `ruby-mode.el` is much less customizable than say 
> `python.el`.

Is that right? I don't see any python-...-face variables in 
lisp/progmodes/python.el.

> In an effort to make it more customizable, I created this 
> patch - 
> https://gist.github.com/jsmestad/d4ab36c94c5d22bb68a72d8d403b4cb7#file-ruby-mode-revised-patch 
> <https://gist.github.com/jsmestad/d4ab36c94c5d22bb68a72d8d403b4cb7#file-ruby-mode-revised-patch>
> 
> A few things:
> 
>   * Is this the right mailing list to discuss ruby-mode.el changes?

It is. Though a bug report probably would have worked better. The 
emacs-devel threads that are not replied to immediately tend to get lost 
in time.

>   * Are there better ways to do this?

I'm not sure what you are trying to do. How does this make highlighting 
"more vim-like"?

>   * What do you all think of the idea of font-face customizations for
>     the mode?

Not a huge fan, to be honest.

Ideally, we'd have a rich common set of font-lock faces that are 
consistently applied across all programming modes. And thus consistently 
signal syntactic elements in a language-agnostic way (where possible).

The users can then customize the font-lock faces, if they so wish.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Add ruby-mode.el configuration for font-face customization
  2017-04-28  9:12 ` Dmitry Gutov
@ 2017-04-28  9:48   ` Eli Zaretskii
  2017-04-28  9:57     ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2017-04-28  9:48 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: justin.smestad, emacs-devel

> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Fri, 28 Apr 2017 12:12:33 +0300
> 
> Ideally, we'd have a rich common set of font-lock faces that are 
> consistently applied across all programming modes. And thus consistently 
> signal syntactic elements in a language-agnostic way (where possible).

I agree, but I thought we already had that.  Those are the
font-lock-variable-name-face, font-lock-constant-face,
font-lock-function-name-face, font-lock-comment-face,
font-lock-string-face, etc.  If that's not what you meant, then please
elaborate.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Add ruby-mode.el configuration for font-face customization
  2017-04-28  9:48   ` Eli Zaretskii
@ 2017-04-28  9:57     ` Dmitry Gutov
  2017-04-28 13:21       ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2017-04-28  9:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: justin.smestad, emacs-devel

On 28.04.2017 12:48, Eli Zaretskii wrote:
>> From: Dmitry Gutov <dgutov@yandex.ru>
>> Date: Fri, 28 Apr 2017 12:12:33 +0300
>>
>> Ideally, we'd have a rich common set of font-lock faces that are
>> consistently applied across all programming modes. And thus consistently
>> signal syntactic elements in a language-agnostic way (where possible).
> 
> I agree, but I thought we already had that.  Those are the
> font-lock-variable-name-face, font-lock-constant-face,
> font-lock-function-name-face, font-lock-comment-face,
> font-lock-string-face, etc.

Ah, indeed. But I've never used any of those. It's the OP who asked for 
customizable variables.

> If that's not what you meant, then please
> elaborate.

More standard faces, e.g. for regexps... maybe numbers as well. If we 
look at "modern" editors, I'm sure there are others we could add.

And then we might need to rethink which faces apply to which tokens. 
E.g. in ruby-mode we apply font-lock-type-face to both class names and 
constants (because the former is a subset of the latter), and 
font-lock-constant-face to :symbols.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Add ruby-mode.el configuration for font-face customization
  2017-04-28  9:57     ` Dmitry Gutov
@ 2017-04-28 13:21       ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2017-04-28 13:21 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: justin.smestad, emacs-devel

> Cc: justin.smestad@gmail.com, emacs-devel@gnu.org
> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Fri, 28 Apr 2017 12:57:25 +0300
> 
> > font-lock-variable-name-face, font-lock-constant-face,
> > font-lock-function-name-face, font-lock-comment-face,
> > font-lock-string-face, etc.
> 
> Ah, indeed. But I've never used any of those. It's the OP who asked for 
> customizable variables.

Well, I guess the OP now has them ;-)

> More standard faces, e.g. for regexps... maybe numbers as well. If we 
> look at "modern" editors, I'm sure there are others we could add.

Sure, expanding the set of standard faces is welcome.  We will, of
course, have to go through the existing major modes and add support
for any new faces.

> And then we might need to rethink which faces apply to which tokens. 
> E.g. in ruby-mode we apply font-lock-type-face to both class names and 
> constants (because the former is a subset of the latter), and 
> font-lock-constant-face to :symbols.

Right, this can be done whenever the users of the mode think they have
a better proposal than what we currently use.

Thanks.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-28 13:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-24  1:55 Add ruby-mode.el configuration for font-face customization Justin Smestad
2017-04-28  9:12 ` Dmitry Gutov
2017-04-28  9:48   ` Eli Zaretskii
2017-04-28  9:57     ` Dmitry Gutov
2017-04-28 13:21       ` Eli Zaretskii

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.