From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Raffaele Ricciardi Newsgroups: gmane.emacs.help Subject: How should a clone of the `grep` program highlight matches for Emacs? Date: Sun, 21 Jun 2015 16:32:57 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1434897318 20399 80.91.229.3 (21 Jun 2015 14:35:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Jun 2015 14:35:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 21 16:35:17 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 1Z6gL7-0005Zl-EB for geh-help-gnu-emacs@m.gmane.org; Sun, 21 Jun 2015 16:35:17 +0200 Original-Received: from localhost ([::1]:36440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6gL6-0006qt-MV for geh-help-gnu-emacs@m.gmane.org; Sun, 21 Jun 2015 10:35:16 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 17 Original-X-Trace: individual.net /0SXkXKyXaCzKMHxoGxC6QjMHf7RGbp3WAl017lClZGsQQEkr7 Cancel-Lock: sha1:yNHw3ECo9tXS0EUpNOO66xnTp/U= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 Original-Xref: usenet.stanford.edu gnu.emacs.help:212775 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:105059 Archived-At: 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. After having read the Emacs Lisp file that defines the `rgrep` command -- which I am using for my tests -- I guess that the script should surround matches with Select Graphic Rendition sequences; and it is doing so, like this: (princ "\x1b[31m") ; 31 means "red", as hard-coded in `grep.el` (princ (match-string-no-properties 0)) (princ "\x1b[0m")) These sequences do cause a terminal to highlight the matches, but not Emacs (of course, Emacs does highlight matches from `grep`). What should the script do instead? Thank you.