unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Make highlight-symbol.el perfect?
@ 2013-04-11 14:25 Steven Degutis
  2013-04-11 15:45 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Degutis @ 2013-04-11 14:25 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

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

It's a great package, but it does something silly: it changes the actual
face on matched regions of the buffer. It should just add overlays. The
code should get simpler, including removing the overlays when you
un-highlight matches, because that's just `(mapcat #'delete-overlay
existing-overlays)`.

Does anyone want to take the challenge and make this package perfect? I'm
willing to volunteer my time to do it, except I have absolutely no idea
what I'm doing, I don't know elisp, I'm a terrible programmer, and I'm
almost guaranteed to just make things worse instead of better.

-Steven

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

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

* Re: Make highlight-symbol.el perfect?
  2013-04-11 14:25 Make highlight-symbol.el perfect? Steven Degutis
@ 2013-04-11 15:45 ` Stefan Monnier
  2013-04-11 18:01   ` Steven Degutis
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2013-04-11 15:45 UTC (permalink / raw)
  To: help-gnu-emacs

> face on matched regions of the buffer. It should just add overlays. The
> code should get simpler, including removing the overlays when you
> un-highlight matches, because that's just `(mapcat #'delete-overlay
> existing-overlays)`.

Better would be to add "text-property planes".  So font-lock could
add&remove its `face' property and highlight-symbol could add&remove its
own `face' property without conflict.

I think this would make a nice GSoC project.


        Stefan




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

* Re: Make highlight-symbol.el perfect?
  2013-04-11 15:45 ` Stefan Monnier
@ 2013-04-11 18:01   ` Steven Degutis
  2013-04-12  0:54     ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Degutis @ 2013-04-11 18:01 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs@gnu.org

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

Isn't that what overlays would do? How is text-property planes better?

-Steven


On Thu, Apr 11, 2013 at 10:45 AM, Stefan Monnier
<monnier@iro.umontreal.ca>wrote:

> > face on matched regions of the buffer. It should just add overlays. The
> > code should get simpler, including removing the overlays when you
> > un-highlight matches, because that's just `(mapcat #'delete-overlay
> > existing-overlays)`.
>
> Better would be to add "text-property planes".  So font-lock could
> add&remove its `face' property and highlight-symbol could add&remove its
> own `face' property without conflict.
>
> I think this would make a nice GSoC project.
>
>
>         Stefan
>
>
>

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

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

* Re: Make highlight-symbol.el perfect?
  2013-04-11 18:01   ` Steven Degutis
@ 2013-04-12  0:54     ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2013-04-12  0:54 UTC (permalink / raw)
  To: help-gnu-emacs

> Isn't that what overlays would do? How is text-property planes better?

You can partly do that with overlays, yes.

But the current implementation of overlays comes with some performance
problems when you have many overlays (we also know how to fix it, which
would also be a nice GSoC project).

Furthermore, the main issue with resolving conflicts between multiple
packages wanting to use the same property is how to *merge* those
conflicting property values.

My proposal for text-property planes resolves those conflicts by merging
the values via Elisp functions invoked when the text-properties are
applied.  This could also work for overlays, of course, but it's
currently missing not only from text-properties but also from overlays.


        Stefan




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

end of thread, other threads:[~2013-04-12  0:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-11 14:25 Make highlight-symbol.el perfect? Steven Degutis
2013-04-11 15:45 ` Stefan Monnier
2013-04-11 18:01   ` Steven Degutis
2013-04-12  0:54     ` Stefan Monnier

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).