GNU bug report logs - #32362
Interactive highlighting of sub-regexp

Previous Next

Package: emacs;

Reported by: Grégory Mounié <Gregory.Mounie <at> imag.fr>

Date: Fri, 3 Aug 2018 14:26:02 UTC

Severity: wishlist

Tags: fixed, patch

Merged with 32365

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Grégory Mounié <Gregory.Mounie <at> imag.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: Interactive highlighting of sub-regexp
Date: Fri, 3 Aug 2018 16:24:39 +0200
[Message part 1 (text/plain, inline)]
 Dear maintainers,

 I propose to add to Interactive Highlighting (hi-lock.el) few lines in 
order to highlight only the first sub-regexps if it exists.

 The use case that interested me was to highlight the column of a CSV file.

 EG.:

 M-x highlight-regexp  then ^\(?:[^,]*,\)\{5\}\([^,]*\),.*$ for 
highlighting the 6th column of a clean CSV file

 I try to keep it as simple as possible as the function is in the 
documentation.

 The modified function has two paths: font-lock if enabled or directly 
overlay

 The sub-regexp detection is a bit rough for font-lock-mode case. I do 
not know how to do it perfectly without implementing a regexp engine or
using a much more complex detection regexp.
 For overlay-case, the code seems quite straightforward.

 Have a nice day,
 Grégory Mounié



[0001-Interactive-Hightlighting-only-the-first-subexp-if-i.patch (text/x-patch, attachment)]

This bug report was last modified 6 years and 283 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.