nschum / highlight-symbol.el

Emacs: automatic and manual symbol highlighting
http://nschum.de/src/emacs/highlight-symbol/
274 stars 41 forks source link

Symbols starting or ending with colon not highlighted (ruby-mode) #39

Closed patrickmclaren closed 8 years ago

patrickmclaren commented 8 years ago

Highlighting foo in the following example in a ruby-mode buffer only highlights the first and last occurrence of foo.

foo = :bar
bar = :foo

puts foo

One could argue this is working as intended, since foo is not :foo. However I was expecting similar behavior to other modes, i.e. highlight foo for var foo = { foo: "bar" }; in javascript-mode.

Using latest version from marmalade (20160102.1209) with Emacs 24.5.1.

nschum commented 8 years ago

ruby-mode gives the colon "symbol" syntax, other modes define it as "punctuation". (See documentation for modify-syntax-entry.) So as far as Emacs is concerned, foo is indeed not :foo.

Unfortunately, I don't see a reasonable around this.

dgutov commented 8 years ago

ruby-mode gives the colon "symbol" syntax

This will change in Emacs 25 (EDIT: now done).