From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Bug in highlight-lines-matching-regexp? Date: Mon, 20 Apr 2009 17:53:28 +0200 Message-ID: <49EC9A78.6040709@gmx.at> References: <7b501d5c0904200725r5f2590d6p4ca430c44abd007c@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1240243011 7442 80.91.229.12 (20 Apr 2009 15:56:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Apr 2009 15:56:51 +0000 (UTC) Cc: emacs-devel@gnu.org To: Deniz Dogan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 20 17:58:11 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lvvsg-0005SY-9n for ged-emacs-devel@m.gmane.org; Mon, 20 Apr 2009 17:58:02 +0200 Original-Received: from localhost ([127.0.0.1]:43280 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LvvrH-0003Fw-DK for ged-emacs-devel@m.gmane.org; Mon, 20 Apr 2009 11:56:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LvvpZ-0002hW-K9 for emacs-devel@gnu.org; Mon, 20 Apr 2009 11:54:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LvvpU-0002gu-S9 for emacs-devel@gnu.org; Mon, 20 Apr 2009 11:54:49 -0400 Original-Received: from [199.232.76.173] (port=39902 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LvvpU-0002gq-LK for emacs-devel@gnu.org; Mon, 20 Apr 2009 11:54:44 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]:54603) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1LvvpU-0006Ma-2d for emacs-devel@gnu.org; Mon, 20 Apr 2009 11:54:44 -0400 Original-Received: (qmail invoked by alias); 20 Apr 2009 15:54:39 -0000 Original-Received: from 62-47-58-149.adsl.highway.telekom.at (EHLO [62.47.58.149]) [62.47.58.149] by mail.gmx.net (mp014) with SMTP; 20 Apr 2009 17:54:39 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX180cOd56tQ0vEhqaQkSHT5SJ5ZE+4HKXZqQzttAaD 4Ho0BlHA530HRT User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) In-Reply-To: <7b501d5c0904200725r5f2590d6p4ca430c44abd007c@mail.gmail.com> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.6899999999999999 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:110368 Archived-At: > 1. Open a text file with any relevant contents. > 2. M-x highlight-lines-matching-regexp and highlight something in the file. > 3. M-x revert-buffer RET yes RET > 4. Now the highlighting is gone, which I can accept, however... > 5. M-x highlight-lines-matching-regexp RET RET > 6. Nothing is highlighted this second time! > > Is this a bug or expected behavior? It's unexpected behavior. You can, after reverting, turn _off_ `hi-lock-mode' and enter your pattern then, but that's clumsy. Either `hi-lock-mode' should add a function to `before-revert-hook' which resets `hi-lock-interactive-patterns' or add a function to `after-revert-hook' which either resets `hi-lock-interactive-patterns' or adds the interactive patterns to `font-lock-keywords' so that all patterns are preserved. I'm not sure which behavior is preferable. For non-font-locked buffers all hi-lock overlays should probably be removed (and possibly regenerated) too. martin