From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: gtr289@gmail.com Newsgroups: gmane.emacs.help Subject: Re: Problem Undoing Text Properties In Gnu Emacs 24, Is this a bug? Date: Mon, 15 Dec 2014 13:43:05 -0800 (PST) Message-ID: <524e52f9-4022-4bb0-bc1e-bf672dd1e9ff@googlegroups.com> References: <681ec09d-d836-48c9-af1f-fb19bd8bae03@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1418679928 29587 80.91.229.3 (15 Dec 2014 21:45:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Dec 2014 21:45:28 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 15 22:45:21 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y0dSD-0003QG-9V for geh-help-gnu-emacs@m.gmane.org; Mon, 15 Dec 2014 22:45:21 +0100 Original-Received: from localhost ([::1]:42030 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0dSA-0002KL-Sm for geh-help-gnu-emacs@m.gmane.org; Mon, 15 Dec 2014 16:45:18 -0500 X-Received: by 10.224.111.196 with SMTP id t4mr21211240qap.8.1418679785228; Mon, 15 Dec 2014 13:43:05 -0800 (PST) X-Received: by 10.140.18.173 with SMTP id 42mr66941qgf.9.1418679785212; Mon, 15 Dec 2014 13:43:05 -0800 (PST) Original-Path: usenet.stanford.edu!w8no8209817qac.0!news-out.google.com!r1ni52qat.1!nntp.google.com!s7no7718722qap.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.116.182.254; posting-account=tSYqGQoAAAAeSQ15qXX5aoJ3dafSnHkn Original-NNTP-Posting-Host: 76.116.182.254 User-Agent: G2/1.0 Injection-Date: Mon, 15 Dec 2014 21:43:05 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:209314 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:101594 Archived-At: On Sunday, December 14, 2014 12:07:20 AM UTC-5, Michael Heerdegen wrote: > Hello, >=20 > > (add-hook 'post-command-hook > > (function=20 > > (lambda () > > (do-syntax)))) >=20 > 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. >=20 > BTW, what is the purpose of your code, and why is font-lock-mode not > sufficient for your needs? >=20 >=20 > Michael. Hello Michael, Thank you for the response. Yes, that definitely was the problem. My routin= e is called after an undo and thus would reverse and re-apply the text prop= erties. Gnu Emacs 21 did not behave like this. It was easy to fix by examin= ing the value of last-input-event.. The reason I use it is because I've noticed performance issues with font-lo= ck-mode on large C/C++ files (which I have some huge ones). Also, I only pr= efer the comments to be highlighted. I don't need the different constructs,= strings, keywords.. Over the years I've had good performance commenting t= he entire file on the find-file-hook then supporting real-time commenting a= s I type. Perhaps I will re-visit font-lock-mode again when I have some time. If it c= an be configured to highlight only comments with good performance, I would = want to head in that directions.. Thanks again for your help.. Joe