GNU bug report logs - #17779
24.4.50; (elisp) `Using Interactive'

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: Drew Adams <drew.adams@HIDDEN>; dated Sat, 14 Jun 2014 15:52:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 Jun 2014 15:51:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 14 11:51:20 2014
Received: from localhost ([127.0.0.1]:47878 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1WvqEi-00044M-6j
	for submit <at> debbugs.gnu.org; Sat, 14 Jun 2014 11:51:20 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43754)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <drew.adams@HIDDEN>) id 1WvqEe-000446-M0
 for submit <at> debbugs.gnu.org; Sat, 14 Jun 2014 11:51:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1WvqEP-0007i7-1t
 for submit <at> debbugs.gnu.org; Sat, 14 Jun 2014 11:51:11 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:47745)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1WvqEO-0007i3-Uu
 for submit <at> debbugs.gnu.org; Sat, 14 Jun 2014 11:51:00 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45444)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1WvqEG-0001B0-73
 for bug-gnu-emacs@HIDDEN; Sat, 14 Jun 2014 11:51:00 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1WvqE3-0007eT-CG
 for bug-gnu-emacs@HIDDEN; Sat, 14 Jun 2014 11:50:52 -0400
Received: from aserp1040.oracle.com ([141.146.126.69]:29696)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1WvqE3-0007eP-5a
 for bug-gnu-emacs@HIDDEN; Sat, 14 Jun 2014 11:50:39 -0400
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
 by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id
 s5EFobe6001089
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
 for <bug-gnu-emacs@HIDDEN>; Sat, 14 Jun 2014 15:50:37 GMT
Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230])
 by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s5EFoaPJ027036
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
 for <bug-gnu-emacs@HIDDEN>; Sat, 14 Jun 2014 15:50:36 GMT
Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12])
 by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s5EFoa8W027033
 for <bug-gnu-emacs@HIDDEN>; Sat, 14 Jun 2014 15:50:36 GMT
MIME-Version: 1.0
Message-ID: <79a25ee9-e53e-494f-b7e3-ebd2e2eebafa@default>
Date: Sat, 14 Jun 2014 08:50:37 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 24.4.50; (elisp) `Using Interactive'
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8  (707110) [OL
 12.0.6691.5000 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic]
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

I wonder about the bullet "It may be a Lisp expression that is not a
string...".

1. The text for this does two things, which should perhaps be separated:
(a) it describes the general nature and use of such an expression, and
(b) it goes down a rabbit hole to talk about one particular gotcha.

Combining these in the same bullet, which is supposed to present the non-st=
ring Lisp sexp case, just confuses things - that's my guess.

2. Wrt that gotcha: Really?  I'm probably missing something here, since
this text has been in the manual for a long time.  But here's my take on
this gotcha. What am I missing?

> Providing point or the mark as an argument value is also common,
> but if you do this and read input (whether using the minibuffer
> or not), be sure to get the integer values of point or the mark
> after reading.

Why?  Why is after reading always (or typically) the appropriate time?

> The current buffer may be receiving subprocess output; if
> subprocess output arrives while the command is waiting for input,
> it could relocate point and the mark.

And?  Why is the location after reading more appropriate than before?
What does the input reading have to do, necessarily, with the timing of
the external process and its possible effect on the buffer text?

> Here's an example of what not to do:
>   (interactive
>    (list (region-beginning) (region-end)
>          (read-string "Foo: " nil 'my-history)))
>=20
> Here's how to avoid the problem, by examining point and the mark
> after reading the keyboard input:
>   (interactive
>    (let ((string (read-string "Foo: " nil 'my-history)))
>      (list (region-beginning) (region-end) string)))

That does not make sense to me as a general guideline.  The appropriate
time for the interactive spec to record the region limits depends on
just what behavior one wants for the particular command.  I see no
reason to assume that one always (or typically) wants the limits to be
recorded after reading input instead of before.

If text modifications because of some external process are a concern,
then it is likely that the exact interaction between that process and
user input action needs to be taken into account for the particular
command definition.

IOW, I don't see why such a generalization is appropriate here.  What am
I missing?

[I would think it would be more typical (if any generalization is
appropriate here) for the command to make sure that such a process
finishes before checking the region limits, if the process can
change them.]


In GNU Emacs 24.4.50.1 (i686-pc-mingw32)
 of 2014-06-08 on ODIEONE
Bzr revision: 117291 rgm@HIDDEN
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=3D/c/Devel/emacs/snapshot/trunk
 --enable-checking=3Dyes,glyphs 'CFLAGS=3D-O0 -g3'
 LDFLAGS=3D-Lc:/Devel/emacs/lib 'CPPFLAGS=3D-DGC_MCHECK=3D1
 -Ic:/Devel/emacs/include''




Acknowledgement sent to Drew Adams <drew.adams@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#17779; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.