From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: font-lock on variables Date: Sun, 26 Jul 2009 07:51:15 -0700 Message-ID: References: <87ljmdsu67.fsf@uchicago.edu> <87r5w45qtd.fsf@uchicago.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1248619914 13381 80.91.229.12 (26 Jul 2009 14:51:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Jul 2009 14:51:54 +0000 (UTC) To: "'Santiago Mejia'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 26 16:51:47 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MV54k-0006My-BO for geh-help-gnu-emacs@m.gmane.org; Sun, 26 Jul 2009 16:51:46 +0200 Original-Received: from localhost ([127.0.0.1]:39263 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MV54j-00023e-In for geh-help-gnu-emacs@m.gmane.org; Sun, 26 Jul 2009 10:51:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MV54M-000230-3B for help-gnu-emacs@gnu.org; Sun, 26 Jul 2009 10:51:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MV54G-0001ya-T4 for help-gnu-emacs@gnu.org; Sun, 26 Jul 2009 10:51:20 -0400 Original-Received: from [199.232.76.173] (port=57315 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MV54G-0001yX-JG for help-gnu-emacs@gnu.org; Sun, 26 Jul 2009 10:51:16 -0400 Original-Received: from rcsinet11.oracle.com ([148.87.113.123]:18951 helo=rgminet11.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MV54G-0006WU-2V for help-gnu-emacs@gnu.org; Sun, 26 Jul 2009 10:51:16 -0400 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n6QEqvoS000883 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 26 Jul 2009 14:52:58 GMT Original-Received: from abhmt005.oracle.com (abhmt005.oracle.com [141.146.116.14]) by acsinet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n6QEpJlG017298; Sun, 26 Jul 2009 14:51:19 GMT Original-Received: from dradamslap1 (/141.144.232.119) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 26 Jul 2009 07:51:08 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87r5w45qtd.fsf@uchicago.edu> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Thread-Index: AcoNeSliu30bQwg+RYmubbugX5s/GQAg/KrA X-Source-IP: abhmt005.oracle.com [141.146.116.14] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A010202.4A6C6D5D.0007:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:66391 Archived-At: > > Hi-lock is only one library that offers such highlighting. > > See the generic wiki page for this topic: > > http://www.emacswiki.org/emacs/HighlightTemporarily. > > That page compares the various highlighting libraries, > > including hi-lock, listing what each is good for. > > As I just said in an earlier post, hi-lock is not yet working > for me. I have managed, however, to highlight text with > other packages in the page you mentioned > (such as highlight.el). So, if anything else works, at > least I have now a solution. > > However, it seems that using this procedure is not ideal. > highlight.el does not work in connection with font-lock-mode. > It seems to me that it would be desirable that, when one > turned font-lock-mode off, all the fontified text was > unfontified. However, using packets such as highlight.el > entails using two modes to fontify, and therefore the > fontification would not be unified. Decoupling such highlighting from font-lock is a feature (deliberate), not a bug (missing feature). The problem you ran into with hi-lock is one of the main reasons: coupling the two means mixing them up - you must take other font-locking into account at the same time, and each mode defines its own font-locking. See http://www.emacswiki.org/emacs/HighLight#PreservingHighlighting. You can "turn off" highlighting by highlight.el in several ways, depending on what is meant. Command `hlt-unhighlight-region' turns off all such highlighting in the buffer, but you can also turn it off selectively: for given faces, a region, only overlays, or only text-properties. If you really need to couple turning off highlighting and font-lock for some reason, just write a function that does both: turn off `font-lock mode' and call `hlt-unhighlight-region'. Or advise `font-lock-mode' so that it also turns off highlighting when you turn it off. Finally, highlight.el and hi-lock.el are complementary - you can use them together.