[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#32362: Interactive highlighting of sub-regexp
From: |
Grégory Mounié |
Subject: |
bug#32362: Interactive highlighting of sub-regexp |
Date: |
Fri, 3 Aug 2018 16:24:39 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
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
Description: Text Data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#32362: Interactive highlighting of sub-regexp,
Grégory Mounié <=