all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#39578: 27.0.50; [rainbow-mode] #define is colored in c++-mode
@ 2020-02-12 15:06 tastytea
  2020-10-27 18:35 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: tastytea @ 2020-02-12 15:06 UTC (permalink / raw)
  To: 39578


[-- Attachment #1.1: Type: text/plain, Size: 298 bytes --]

Hi,
I found a little bug in rainbow-mode 1.0.3. In c-mode and c++-mode it
colors the “#def” in #define.

Minimal init.el (assuming that rainbow-mode is installed):
(package-initialize)
(require 'rainbow-mode)

Minimal C++ example:
#define XYZ
int main() {}

Kind regards, tastytea

[-- Attachment #1.2: screenshot_rainbow_define.png --]
[-- Type: image/png, Size: 3094 bytes --]

[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* bug#39578: 27.0.50; [rainbow-mode] #define is colored in c++-mode
  2020-02-12 15:06 bug#39578: 27.0.50; [rainbow-mode] #define is colored in c++-mode tastytea
@ 2020-10-27 18:35 ` Lars Ingebrigtsen
  2020-10-29 11:45   ` Julien Danjou
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-27 18:35 UTC (permalink / raw)
  To: tastytea; +Cc: Julien Danjou, 39578

tastytea <tastytea@tastytea.de> writes:

> I found a little bug in rainbow-mode 1.0.3. In c-mode and c++-mode it
> colors the “#def” in #define.
>
> Minimal init.el (assuming that rainbow-mode is installed):
> (package-initialize)
> (require 'rainbow-mode)
>
> Minimal C++ example:
> #define XYZ
> int main() {}

I can confirm that the bug is still present in the current ELPA
package.  Perhaps Julien has some insight here?  (Cc'd.)

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





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

* bug#39578: 27.0.50; [rainbow-mode] #define is colored in c++-mode
  2020-10-27 18:35 ` Lars Ingebrigtsen
@ 2020-10-29 11:45   ` Julien Danjou
  2020-10-30 12:00     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Julien Danjou @ 2020-10-29 11:45 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: tastytea, 39578

On Tue, Oct 27 2020, Lars Ingebrigtsen wrote:

Hi there,

> I can confirm that the bug is still present in the current ELPA
> package.  Perhaps Julien has some insight here?  (Cc'd.)

It's not a bug per say since it matches the regexp.
We just need to add even more code to avoid matching languages'
keywords.

-- 
Julien Danjou
;; Free Software hacker
;; https://julien.danjou.info





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

* bug#39578: 27.0.50; [rainbow-mode] #define is colored in c++-mode
  2020-10-29 11:45   ` Julien Danjou
@ 2020-10-30 12:00     ` Lars Ingebrigtsen
  2020-10-30 15:53       ` Julien Danjou
  2022-05-01  9:24       ` Lars Ingebrigtsen
  0 siblings, 2 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-30 12:00 UTC (permalink / raw)
  To: Julien Danjou; +Cc: tastytea, 39578

Julien Danjou <julien@danjou.info> writes:

> It's not a bug per say since it matches the regexp.
> We just need to add even more code to avoid matching languages'
> keywords.

It seems like a more general problem to me.  That is, "#def" should be
colourized, but "#defi" should not?

So would checking for a word boundary after the regexp be sufficient?
Or are there places where #000000foobar makes sense and we really want
to colourize that #000000 bit?

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





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

* bug#39578: 27.0.50; [rainbow-mode] #define is colored in c++-mode
  2020-10-30 12:00     ` Lars Ingebrigtsen
@ 2020-10-30 15:53       ` Julien Danjou
  2020-11-01 12:22         ` Lars Ingebrigtsen
  2022-05-01  9:24       ` Lars Ingebrigtsen
  1 sibling, 1 reply; 7+ messages in thread
From: Julien Danjou @ 2020-10-30 15:53 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: tastytea, 39578

On Fri, Oct 30 2020, Lars Ingebrigtsen wrote:

> It seems like a more general problem to me.  That is, "#def" should be
> colourized, but "#defi" should not?
>
> So would checking for a word boundary after the regexp be sufficient?
> Or are there places where #000000foobar makes sense and we really want
> to colourize that #000000 bit?

It might be. It's hard to say since I don't have a good memory and there
is no unit test. :(

-- 
Julien Danjou
/* Free Software hacker
   https://julien.danjou.info */





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

* bug#39578: 27.0.50; [rainbow-mode] #define is colored in c++-mode
  2020-10-30 15:53       ` Julien Danjou
@ 2020-11-01 12:22         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2020-11-01 12:22 UTC (permalink / raw)
  To: Julien Danjou; +Cc: tastytea, 39578

Julien Danjou <julien@danjou.info> writes:

>> So would checking for a word boundary after the regexp be sufficient?
>> Or are there places where #000000foobar makes sense and we really want
>> to colourize that #000000 bit?
>
> It might be. It's hard to say since I don't have a good memory and there
> is no unit test. :(

Right.  I guess this one will just have to wait until somebody that uses
it tries such a change and sees what the results are...

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





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

* bug#39578: 27.0.50; [rainbow-mode] #define is colored in c++-mode
  2020-10-30 12:00     ` Lars Ingebrigtsen
  2020-10-30 15:53       ` Julien Danjou
@ 2022-05-01  9:24       ` Lars Ingebrigtsen
  1 sibling, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-01  9:24 UTC (permalink / raw)
  To: Julien Danjou; +Cc: tastytea, 39578

Lars Ingebrigtsen <larsi@gnus.org> writes:

> So would checking for a word boundary after the regexp be sufficient?
> Or are there places where #000000foobar makes sense and we really want
> to colourize that #000000 bit?

I've now made this change in rainbow-mode for the ^#... matches, which
should probably be correct for most things.

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





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

end of thread, other threads:[~2022-05-01  9:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-12 15:06 bug#39578: 27.0.50; [rainbow-mode] #define is colored in c++-mode tastytea
2020-10-27 18:35 ` Lars Ingebrigtsen
2020-10-29 11:45   ` Julien Danjou
2020-10-30 12:00     ` Lars Ingebrigtsen
2020-10-30 15:53       ` Julien Danjou
2020-11-01 12:22         ` Lars Ingebrigtsen
2022-05-01  9:24       ` Lars Ingebrigtsen

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.