From: gtr289@gmail.com
To: help-gnu-emacs@gnu.org
Subject: Re: Problem Undoing Text Properties In Gnu Emacs 24, Is this a bug?
Date: Mon, 15 Dec 2014 13:43:05 -0800 (PST) [thread overview]
Message-ID: <524e52f9-4022-4bb0-bc1e-bf672dd1e9ff@googlegroups.com> (raw)
In-Reply-To: <mailman.16016.1418533637.1147.help-gnu-emacs@gnu.org>
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
next prev parent reply other threads:[~2014-12-15 21:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-12 22:02 Problem Undoing Text Properties In Gnu Emacs 24, Is this a bug? gtr289
2014-12-14 5:06 ` Michael Heerdegen
[not found] ` <mailman.16016.1418533637.1147.help-gnu-emacs@gnu.org>
2014-12-15 21:43 ` gtr289 [this message]
2014-12-16 12:51 ` Michael Heerdegen
2014-12-17 1:53 ` Robert Thorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=524e52f9-4022-4bb0-bc1e-bf672dd1e9ff@googlegroups.com \
--to=gtr289@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).