From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: How should a clone of the `grep` program highlight matches for Emacs? Date: Sat, 27 Jun 2015 17:22:52 +0200 Message-ID: <87381d2n1v.fsf@web.de> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1435418600 17189 80.91.229.3 (27 Jun 2015 15:23:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 27 Jun 2015 15:23:20 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Raffaele Ricciardi Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 27 17:23:11 2015 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 1Z8rwl-0004Us-Gz for geh-help-gnu-emacs@m.gmane.org; Sat, 27 Jun 2015 17:23:11 +0200 Original-Received: from localhost ([::1]:35903 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8rwk-000538-Ak for geh-help-gnu-emacs@m.gmane.org; Sat, 27 Jun 2015 11:23:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8rwa-00052v-IT for help-gnu-emacs@gnu.org; Sat, 27 Jun 2015 11:23:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8rwX-0002Su-7X for help-gnu-emacs@gnu.org; Sat, 27 Jun 2015 11:23:00 -0400 Original-Received: from mout.web.de ([212.227.17.11]:52925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8rwW-0002S5-Um for help-gnu-emacs@gnu.org; Sat, 27 Jun 2015 11:22:57 -0400 Original-Received: from drachen.dragon ([90.187.130.156]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0MDP6H-1ZIyhO17TZ-00GoBr; Sat, 27 Jun 2015 17:22:55 +0200 In-Reply-To: (Raffaele Ricciardi's message of "Sun, 21 Jun 2015 16:32:57 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:Ku0nOHMuwbLUbzo4LlPtEmN/NonanacFKVqKQeYeuAvnFH/SJSr QaqonBLLPKEnzplmR1x/afK74y0/jk/vXCQwcUfv7PLbJeOi8YsZaClUz+8A7AAUdvKUiyD oNDVHaPu6zyQvukOxkAy/Mfy0B2+tpQA6GZwILRMSitvfy4lbIcvWppaepTZXu+/uqy3Skc Qv5IXVThz9qrweoI8GZ6Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:rWY+6KYQvGw=:idxfyfaSFM9sPcG8AkOChX o+j0LdnUcvjmZM36yLpLxqdNdhsvD8QY0t1469mXHgoDrWeRxF1XEHi73V4FfdldT5uHnlShS Hh4dxCJ9OSpdhQp7b4hWos2Jc5SUqTNhCUVPpdc+wtXgM9G1HZBM5SQm15LYJmQ+umCNQaVdE 15dpqoT8eV1hHHK1EMTb7ogTn9XqZtXVMIoeLHkXeh8JXtlmswUX9ElFjBIrYwEie3hDb3Lkg 2Z6DRH0Vgxw+I76NAQo0dPcWyffc1FPyDSYBfw+beM58pJiN7FI7B2lrxDpfOfRg6I5VbyEAF OrGQBdhfLmTCoC0Pl14VCbfmd2S7NdI+ITgc2B9TiVcR4gYgq9O2kJvc9LMEzbs3xzIPwcAmT G6eq6THTgR3llypQ+3EPc0RLV2OluFfToovlLCSz7gNfgMshp9d1UiLCga5avPCaJ1YaAk7zM I2rrQeWzCvnbbhAt5iUDjZ0Fv6RQ/88lu3fBL6a08g/EPRPyzZdghzgX1vwj+UB4xB2/F/p6M p9KEjLH/JXxxHJW2KiQN1kE+0c8ZKWYjNRA4zPpvi/UtIDTMgVcRll/cl8WAlVaSlKmoYOK+B /g2MSj43vRkIsJf3UsduYbYcB9U/NF41b2LFd9Uau259gAWy15ewKQe48ptiMMUe8MNGrJY35 lvONri8uppVh+O9l0WWT2HfXDX2OLC3KRi4MiWKSs7XTtiv98KcYZR7/KGNGtQt/PH8A= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.17.11 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:105225 Archived-At: Raffaele Ricciardi writes: > I am writing an Emacs script as a replacement for the `grep` program > while executing the `rgrep` command. Now, I can't make my Emacs > script highlight the matches in a way that Emacs understands. Do you want to use this script from M-x grep? I assume "yes". AFAICT grep.el highlights matches via a grep-mode defined as kind of a compilation-mode. The way of highlighting is defined in `grep-regexp-alist'. Other things are highlighted via font-lock keywords. Of course be sure to bind grep-highlight-matches non-nil. But in general, grep-mode should be able to highlight as you want it. My first guess is that might be help to set grep-highlight-matches to always -- note that this option has a :set custom specification! If that doesn't help, please show us some code! Regards, Michael.