From: Drew Adams <drew.adams@oracle.com>
To: 33167@debbugs.gnu.org
Subject: bug#33167: 26; Doc string of `region-extract-function'
Date: Fri, 26 Oct 2018 08:32:04 -0700 (PDT) [thread overview]
Message-ID: <2e187b74-9999-4090-96b4-bb13d1f27544@default> (raw)
I don't understand these parts of the description:
- nil: return the content as a string.
What does that mean, for a noncontiguous region? Are the buffer
substrings for all of the region segments (zones) concatenated together?
If so, say that.
- anything else: delete the region and return its content
as a string, after filtering it with `filter-buffer-substring', which
is called with METHOD as its 3rd argument.
So first the region is deleted, and the deleted content (see previous)
is filtered via `(filter-buffer-substring BEG END METHOD)' and then
returned.
Some of what I don't understand:
1. What are the BEG and END args passed to `filter-buffer-substring'?
Is BEG the smallest car of any of the zones in the noncontiguous
region, and END the largest cdr of any of the zones?
2. `filter-buffer-substring' calls the value of
`filter-buffer-substring-function' with the same 3 args. But what
can that function do with BEG and END (which are what?)? It's
presumably a function that expects to use a single stretch of buffer
text from BEG to END. But here we're talking about a noncontiguous
3. The 3rd arg to `filter-buffer-substring' just deletes the region from
BEG to END if it is non-nil, so it seems like passing that non-nil
3rd arg is useless, as the region gets deleted anyway, by
`region-extract-function'.
4. The use of `filter-buffer-substring' is also unclear. It is passed
BEG and END (and METHOD, but see #3, above). And it filters the
buffer text between BEG and END. But see #1 above - are BEG and END
buffer positions that make sense for the whole region text? Just
what happens here?
This is quite unclear to me. And following the rabbit hole from
`region-extract-function' down to `filter-buffer-substring' and then to
`filter-buffer-substring-function' does not make things more clear.
Or is what happens perhaps that EACH element of the noncontiguous
region, that is, each zone (BEG<N> . END<N>) of the list ((BEG1 . END1)
...) gets filtered by `filter-buffer-substring', passing its BEG END and
EMTHOD - so that a mapcar is applied? In that case, how are the
resulting buffer substrings assembled - are they concatenated to get the
return value?
In GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
of 2018-05-30
Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea
Windowing system distributor `Microsoft Corp.', version 10.0.16299
Configured using:
`configure --without-dbus --host=x86_64-w64-mingw32
--without-compress-install 'CFLAGS=-O2 -static -g3''
next reply other threads:[~2018-10-26 15:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-26 15:32 Drew Adams [this message]
2018-10-27 11:20 ` bug#33167: 26; Doc string of `region-extract-function' Eli Zaretskii
[not found] <<2e187b74-9999-4090-96b4-bb13d1f27544@default>
[not found] ` <<831s8bocu3.fsf@gnu.org>
2018-10-27 15:27 ` Drew Adams
2018-10-27 16:32 ` Eli Zaretskii
2018-10-27 19:02 ` Drew Adams
2018-10-27 19:23 ` Eli Zaretskii
[not found] <<<2e187b74-9999-4090-96b4-bb13d1f27544@default>
[not found] ` <<<831s8bocu3.fsf@gnu.org>
[not found] ` <<db9097a6-7687-484c-9e32-1262e5825d92@default>
[not found] ` <<83o9bfmjte.fsf@gnu.org>
[not found] ` <<0a008152-d861-4b96-ad2a-b837bd412d98@default>
[not found] ` <<83h8h7mbxf.fsf@gnu.org>
2018-10-27 19:30 ` Drew Adams
2018-10-27 19:37 ` Eli Zaretskii
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2e187b74-9999-4090-96b4-bb13d1f27544@default \
--to=drew.adams@oracle.com \
--cc=33167@debbugs.gnu.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).