all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: 40576@debbugs.gnu.org, giorgian@gmail.com
Subject: bug#40576: call-process-region does not accept nil as first argument
Date: Sun, 12 Apr 2020 20:07:01 +0300	[thread overview]
Message-ID: <83y2r0k4zu.fsf@gnu.org> (raw)
In-Reply-To: <CAArVCkTRqUzD4H+8d6bKzypoXC3-3WSL-infWxTeKVU_N8vZJg@mail.gmail.com> (message from Philipp Stephani on Sun, 12 Apr 2020 18:44:58 +0200)

> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sun, 12 Apr 2020 18:44:58 +0200
> Cc: Pietro Giorgianni <giorgian@gmail.com>, 40576@debbugs.gnu.org
> 
> > Right.  But there's more here than meets the eye, because the change
> > after which we started advertising the special meaning of nil for
> > START exposed a problem: write_region, called from create_temp_file,
> > has special meaning for START = nil: it widens the buffer and writes
> > the entire buffer contents to the temp file.  Which isn't right when
> > write_region is called from call-process-region, as it allows access
> > to inaccessible portion of the buffer, something we shouldn't do.
> 
> I think that's pretty much intentional. The documentation says
> 
> "If START is nil, that means to use the entire buffer contents"

That sentence is an addition made in 2016, AFAICT.

> It specifically doesn't say to only use the accessible portion of the
> buffer. Given that this behavior probably has been in place since
> commit 561cb8e159e7eff7a6487a45a1cfab47ba456030 from 1994, it would be
> rather unwise to introduce such a breaking change.

But then START = nil would work, whereas START = 2 will signal an
error if the buffer is narrowed.  Does that make sense?





  reply	other threads:[~2020-04-12 17:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-12 14:25 bug#40576: call-process-region does not accept nil as first argument Pietro Giorgianni
2020-04-12 16:01 ` Philipp Stephani
2020-04-12 16:21   ` Eli Zaretskii
2020-04-12 16:44     ` Philipp Stephani
2020-04-12 17:07       ` Eli Zaretskii [this message]
2020-04-12 17:09         ` Philipp Stephani
2020-04-12 17:07       ` Philipp Stephani
2020-04-12 17:24         ` Eli Zaretskii
2020-04-12 17:37           ` Philipp Stephani
2020-04-12 18:29             ` Eli Zaretskii
2020-04-12 17:07   ` Philipp Stephani

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=83y2r0k4zu.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=40576@debbugs.gnu.org \
    --cc=giorgian@gmail.com \
    --cc=p.stephani2@gmail.com \
    /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.