help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem Undoing Text Properties In Gnu Emacs 24, Is this a bug?


From: gtr289
Subject: Re: Problem Undoing Text Properties In Gnu Emacs 24, Is this a bug?
Date: Mon, 15 Dec 2014 13:43:05 -0800 (PST)
User-agent: G2/1.0

On Sunday, December 14, 2014 12:07:20 AM UTC-5, Michael Heerdegen wrote:
> Hello,
> 
> > (add-hook 'post-command-hook
> >      (function 
> >        (lambda ()
> >      (do-syntax))))
> 
> With this code, after you undo, `do-syntax' is called immediately and
> may add the text properties anew where the undo may have had removed
> them, so it is no surprise if you encounter a "loop" sometimes, I guess.
> 
> BTW, what is the purpose of your code, and why is font-lock-mode not
> sufficient for your needs?
> 
> 
> Michael.


Hello Michael,

Thank you for the response. Yes, that definitely was the problem. My routine is 
called after an undo and thus would reverse and re-apply the text properties. 
Gnu Emacs 21 did not behave like this. It was easy to fix by examining the 
value of last-input-event..

The reason I use it is because I've noticed performance issues with 
font-lock-mode on large C/C++ files (which I have some huge ones). Also, I only 
prefer the comments to be highlighted. I don't need the different constructs, 
strings, keywords..  Over the years I've had good performance commenting the 
entire file on the find-file-hook then supporting real-time commenting as I 
type.

Perhaps I will re-visit font-lock-mode again when I have some time. If it can 
be configured to highlight only comments with good performance, I would want to 
head in that directions..

Thanks again for your help..

Joe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]