[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: w3m-filter-delete-regions feature enhancements (patch included)
In [emacs-w3m : No.12664]
On Tue, 30 May 2017 05:25:24 -0400, Boruch Baum wrote:
> On 2017-05-30 17:23, Katsumi Yamaoka wrote:
>> In [emacs-w3m : No.12655]
>> On Mon, 29 May 2017 21:57:19 -0400, Boruch Baum wrote:
>>> (defun my-w3m-filter-delete-regions (url start end &optional without-start without-end use-regex)
>>> "Delete regions surrounded with a START pattern and an END pattern.
>>> If argument WITHOUT-START is t, do not delete START strings.
>>> If argument WITHOUT-END is t, do not delete the END strings.
>>> If argument USE-REGEX is t, treat START and END as REGEXes"
>> Sorry, I'm negative to introduce such a function to emacs-w3m
>> because:
> Here are my counter-arguments:
Ok, I'm not so perversity not to implement it. ;)
Do you have a good idea to toggle those filters using
`w3m-toggle-filtering' (with prefix arg)?
I made it omit the filters that use `w3m-filter-delete-regions'
even if they are listed in `w3m-filter-configuration' because
I have no idea for a way for a user to identify such a filter.
Instead, I think it's better to remake every those filter so as
to have a function name, e.g.:
(nil
("Remove garbage in http://www.geocities.co.jp/*"
"http://www.geocities.co.jp/* でゴミを取り除きます")
"\\`http://www\\.geocities\\.co\\.jp/"
(w3m-filter-delete-regions
"<DIV ALIGN=CENTER>\n<!--*/GeoGuide/*-->" "<!--*/GeoGuide/*-->\n</DIV>"))
↓
(nil
("Remove garbage in http://www.geocities.co.jp/*"
"http://www.geocities.co.jp/* でゴミを取り除きます")
"\\`http://www\\.geocities\\.co\\.jp/"
w3m-filter-geocities)
In that case `w3m-filter-delete-regions' will get useless, or it
will not necessarily need to be more flexible.
In addition, could you show some filter examples by which the
revised `w3m-filter-delete-regions' is used conveniently?
Regards,