[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#13617: 24.2.92; [PATCH] Add strip-string
From: |
Andreas Röhler |
Subject: |
bug#13617: 24.2.92; [PATCH] Add strip-string |
Date: |
Mon, 25 Mar 2013 08:48:22 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 |
Am 03.02.2013 10:40, schrieb Leo Liu:
On 2013-02-03 16:56 +0800, Andreas Schwab wrote:
You could use the same rules as skip-chars-forward.
+1
I looked at skip-chars-forward before opening this bug but found it
complicate things by introducing new rules.
Which one?
IMO you may use skip-chars... internally, which is fast and reliable.
In strip-string the idea is to have a default covering 90% of the use
cases:
(strip-string s) ; strip both
(strip-string s nil "") ; strip leading
(strip-string s "") ; strip trailing
Suggest keeping either boolean for not, resp. default,
or a string containing chars overriding the default.
while this is obsolet meanwhile:
http://lists.gnu.org/archive/html/gnu-emacs-sources/2007-01/msg00004.html
Andreas
Refer users to regexp as in (info "(elisp)Regexp Special") for the
remaining 10% use cases.
Regards,
Leo