From: Bozhidar Batsov <bozhidar.batsov@gmail.com>
To: "Stephen J. Turnbull" <stephen@xemacs.org>,
Drew Adams <drew.adams@oracle.com>
Cc: emacs-devel@gnu.org
Subject: Re: Proposed enhancement for `split-string'
Date: Fri, 18 Jul 2014 15:24:00 +0300 [thread overview]
Message-ID: <etPan.53c911e0.721da317.daeb@Bozhidars-MacBook-Pro.local> (raw)
In-Reply-To: <87zjgbcwtt.fsf@uwakimon.sk.tsukuba.ac.jp>
[-- Attachment #1: Type: text/plain, Size: 1519 bytes --]
Drew’s suggestion can be implemented a different function in subr-x I guess.
—
Cheers,
Bozhidar
On July 15, 2014 at 3:04:48 AM, Stephen J. Turnbull (stephen@xemacs.org) wrote:
Drew Adams writes:
> The second arg, HOW, can be a regexp, giving the same behavior as now.
> Alternatively, HOW can be (1) a character predicate or (2) a doubleton
> plist (PROPERTY VALUE), where PROPERTY is a text property and VALUE is
> one of its possible values.
Why not just allow it to be any function returning an interval (with
implicit argument = (point)), and provide appropriate functions to
accomplish the tasks you propose?
> By providing non-nil TEST you can test, for example:
>
> * Whether the actual value of text property `invisible' belongs to the
> current `buffer-invisibility-spec'.
>
> * Whether a particular face is among the faces that are the value of
> property `face'.
A general predicate for HOW could do this, too.
> Non-nil optional arg FLIP simply swaps the separators and the kept
> substrings - regardless of HOW the separating is defined.
This can be done for the "standard" functions by providing an optional
FLIP argument, and using (lambda () (how-func 'flip-me)) as the HOW.
Alternatively you could provide flipped standard HOW functions.
I have no objection to a new function `split-string-à-la-drew' with
any signature you like, but `split-string' should keep as simple a
signature as possible.
[-- Attachment #2: Type: text/html, Size: 2454 bytes --]
prev parent reply other threads:[~2014-07-18 12:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-14 22:51 Proposed enhancement for `split-string' Drew Adams
2014-07-15 0:03 ` Stephen J. Turnbull
2014-07-18 12:24 ` Bozhidar Batsov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=etPan.53c911e0.721da317.daeb@Bozhidars-MacBook-Pro.local \
--to=bozhidar.batsov@gmail.com \
--cc=drew.adams@oracle.com \
--cc=emacs-devel@gnu.org \
--cc=stephen@xemacs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.