GNU bug report logs - #13973
thingatpt.el and end-of-sexp in python-mode

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: Andreas Röhler <andreas.roehler@HIDDEN>; dated Sat, 16 Mar 2013 07:53:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Changed bug title to 'thingatpt.el and end-of-sexp in python-mode' from 'Subject: 24.3; thingatpt.el, end-of-sexp' Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 13973) by debbugs.gnu.org; 28 Aug 2021 15:05:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 28 11:05:57 2021
Received: from localhost ([127.0.0.1]:54814 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mJzu9-0003Qa-9v
	for submit <at> debbugs.gnu.org; Sat, 28 Aug 2021 11:05:57 -0400
Received: from quimby.gnus.org ([95.216.78.240]:43624)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mJzu6-0003QK-Tr
 for 13973 <at> debbugs.gnu.org; Sat, 28 Aug 2021 11:05:55 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=zMUvDDy2LBRdXS+S5g5Qu7V4fzvfyFY6dmLDbZziIHk=; b=aRK4uHGEBJhL2TutQaVgUqVRDg
 LsOFvySOqjkH06eIU/l40jsHWG0Fgd1CzMSdqwsS5hSGomlr91rfcGPs9DbZr6+Q+bF0GX7oxcCHu
 f5Ui8bMkosCVgzy7fWZlHhfq86ZpGeWg2StVn+u8YvtQwUq3HsW2xqZkMFbuO+bLzDjw=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mJztw-0004cS-SM; Sat, 28 Aug 2021 17:05:49 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Andreas =?utf-8?Q?R=C3=B6hler?= <andreas.roehler@HIDDEN>
Subject: Re: bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp
References: <51442486.4070100@HIDDEN> <87a6l9ufug.fsf@HIDDEN>
 <524429ba-026c-e5a6-579e-1789bd2cee1a@HIDDEN>
 <87k0k9n70g.fsf@HIDDEN>
 <8614ba8d-342d-312d-ca11-1c5b7e0885ff@HIDDEN>
 <87pmu01etv.fsf@HIDDEN>
 <50eab79c-0ea8-87e8-9574-670a03669f4a@HIDDEN>
Date: Sat, 28 Aug 2021 17:05:42 +0200
In-Reply-To: <50eab79c-0ea8-87e8-9574-670a03669f4a@HIDDEN> ("Andreas
 =?utf-8?Q?R=C3=B6hler=22's?= message of "Fri, 27 Aug 2021 20:44:33 +0200")
Message-ID: <87mtp1k3sp.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 
 Content preview:  Andreas Röhler <andreas.roehler@HIDDEN> writes: >
   BTW end-of-sexp is declared obsolete meanwhile. Below an adapted test. Thanks.
    The odd movements happen in these cases: 
 
 Content analysis details:   (-2.9 points, 5.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
                             [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 13973
Cc: 13973 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: -3.3 (---)

Andreas R=C3=B6hler <andreas.roehler@HIDDEN> writes:

> BTW end-of-sexp is declared obsolete meanwhile. Below an adapted test.

Thanks.  The odd movements happen in these cases:

"|""Some hint"""

"""Some hint|"""

where | is point.

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13973; Package emacs. Full text available.

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


Received: (at 13973) by debbugs.gnu.org; 27 Aug 2021 18:44:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 27 14:44:44 2021
Received: from localhost ([127.0.0.1]:53007 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mJgqK-0004JY-1j
	for submit <at> debbugs.gnu.org; Fri, 27 Aug 2021 14:44:44 -0400
Received: from mout.kundenserver.de ([212.227.126.134]:41667)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <andreas.roehler@HIDDEN>) id 1mJgqG-0004JI-WA
 for 13973 <at> debbugs.gnu.org; Fri, 27 Aug 2021 14:44:42 -0400
Received: from [192.168.178.63] ([94.134.177.238]) by mrelayeu.kundenserver.de
 (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id
 1Moewz-1mm6mJ2JQn-00p8X5; Fri, 27 Aug 2021 20:44:34 +0200
Subject: Re: bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp
To: Lars Ingebrigtsen <larsi@HIDDEN>
References: <51442486.4070100@HIDDEN> <87a6l9ufug.fsf@HIDDEN>
 <524429ba-026c-e5a6-579e-1789bd2cee1a@HIDDEN>
 <87k0k9n70g.fsf@HIDDEN>
 <8614ba8d-342d-312d-ca11-1c5b7e0885ff@HIDDEN>
 <87pmu01etv.fsf@HIDDEN>
From: =?UTF-8?Q?Andreas_R=c3=b6hler?= <andreas.roehler@HIDDEN>
Message-ID: <50eab79c-0ea8-87e8-9574-670a03669f4a@HIDDEN>
Date: Fri, 27 Aug 2021 20:44:33 +0200
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:78.0) Gecko/20100101
 Thunderbird/78.13.0
MIME-Version: 1.0
In-Reply-To: <87pmu01etv.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Content-Language: en-US
X-Provags-ID: V03:K1:MPxC/AuLAy8/zb4zSq39fvfnLdLl0+DdCHCGZU2lg7CUaRuY1Cr
 uyuksFIIrTFEdJRU2wAF/z+vWw4dsI9fMw301G70iDc+UsP8BAg6knytaq3sWHqSTAJaWyt
 j/PEVCPJXIkYitDFw7pKnyOXh/g4bxHEqbc6b1rcgMUnqnXGU6N0h0pOlMR18PimRuWWO+E
 PGikrc9HX5KKRDgzhszNg==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:/bBZLOcrtaI=:G6ANkBfTMyn6TCb4k9gbtG
 qHBYTdIswdA8F8tjQDEkNzbkWOiaMsuH5evJflWTW4f1kAeVTqRqEff5ep2TiX8nH1tWINbZd
 eohAQXRGBXdlSMJRKR1al+peAHIQIsJftxTfC/iq+aKIiUVb4yjq5WfReRbieqfC9T1yoSsMd
 DUWJeCAZ9fJ+6RvLS8KfjZGr23HlDu+Ohi2/C+l6WcyF52rlyIRAppM4YEZxPLn2yXtVMR8rr
 0UQDIaWS74lUdZmglOyDLmdmd+xu3o8AU973rF1XACJb1r0xbbq6XxO+zwD5bxYCUEoyNidJg
 lKDXaWuwnTIRGBJbvE5YcwjbWcNGiSyhYTnRXGOnGSxihSUY/RV2BJaZbnRedoM4n8jmMrtT7
 qquaKA01pDAtqAnM7E9cLNssh2PaekIZfZ/oxmPu83P2GoWcqrph7FVjJzJApMgeEZ8ABeK/J
 yYW3kH5Wk0GZXOyyacuTdnrgXeo90wVoS3Uxltj7B1Vj0V9ozgFkT9/t1MUYylKxNt0ZWad/u
 xlHet4OGJl5TTNBmv21KYKXEUeKo32vdxtArM/b8eUd+keJ+KdhF9SjhRnPkwovBvEwi02GCc
 aK/ck8d0uhlrHL0asa1BK6ZLRF6Z92W9ix7entRDXqwe0pGxa5xH0Gk/IVAQjkvx2JGFIumCE
 4i/ZhZh6JDRaBiQBxUOSTLNjb4Fvb98hiuTGk/tszr0lLckqfSsBAz+CJ1XkSruqpWiZ7Y3Re
 QQXo+y6y1mis99nOWJ/yVanr51blnUpVHB/9AR2nuwgdpOxf0XXEkFmTAqg=
X-Spam-Score: -0.1 (/)
X-Debbugs-Envelope-To: 13973
Cc: 13973 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: -1.1 (-)


On 26.08.21 16:05, Lars Ingebrigtsen wrote:
> Andreas Röhler <andreas.roehler@HIDDEN> writes:
>
>>>> Maybe put the Python code below at the top of some buffer and run the
>>>> test delivered below:
>>>>
>>>> # Python
>>>>
>>>> def main():
>>>>       """Some hint"""
>>>>       if len(sys.argv) == 1:
>>>>           usage()
>>>>
>>>> ;; Elisp
>>>> (defun forward-sexp-text ()
>>>>     (interactive)
>>>>     (goto-char 30 )
>>>>     (forward-sexp))
>>> By that goto-char, do you mean the "S" character?
>> No, sorry, the 5th double-quote of the triple-quoted-string.
> That gives me
>
> forward-sexp: Scan error: "Unbalanced parentheses", 40, 86
>
> which I think is the right thing?

If inside a string, forward-sexp --or end-of-- should reach the end of 
this string.

BTW end-of-sexp is declared obsolete meanwhile. Below an adapted test.


(defun my-thing-at-point--end-of-sexp-test ()
   (interactive)
   (goto-char (point-max))
   (search-backward "\"" nil t 6)
   ;; the only one ending correctly behind the string
   (thing-at-point--end-of-sexp)
   (goto-char (point-max))
   (search-backward "\"" nil t 6)
   (forward-char 4)
   (thing-at-point--end-of-sexp)
   (goto-char (point-max))
   (search-backward "\"" nil t 3)
   (thing-at-point--end-of-sexp)
   (goto-char (point-max))
   (search-backward "\"" nil t 2)
   (thing-at-point--end-of-sexp))

and here the Python code to test again:


def main():
      """Some hint"""
      if len(sys.argv) == 1:
          usage()



>
> This bug report started with thingatpt.  What is the real thingatpt use
> case that doesn't work in triple-quoted strings?
>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13973; Package emacs. Full text available.

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


Received: (at 13973) by debbugs.gnu.org; 26 Aug 2021 14:05:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 26 10:05:53 2021
Received: from localhost ([127.0.0.1]:49961 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mJG0r-0001gq-Ev
	for submit <at> debbugs.gnu.org; Thu, 26 Aug 2021 10:05:53 -0400
Received: from quimby.gnus.org ([95.216.78.240]:47704)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mJG0l-0001gY-N7
 for 13973 <at> debbugs.gnu.org; Thu, 26 Aug 2021 10:05:48 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=BYAG1Gn4PlChEGkGryi9ztvMgV0h8y5xAZFmITFAVa4=; b=B+vrw/CU8wC75g49MdGonZBm6t
 Ou0AHgz0oS9CuHrcGjfxNvVnVk//XlgaDLuXRke+a8yScih/tC4LgVzBFBy7zSvWEYZroO1GPfcmD
 AxaUHyc4w3kEadCXyeQpG58UXGv1FOklha8Nh69A3L6ZV8KMV4xlqu/B6ce5iXWL8gVk=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mJG0b-0001YO-7K; Thu, 26 Aug 2021 16:05:37 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Andreas =?utf-8?Q?R=C3=B6hler?= <andreas.roehler@HIDDEN>
Subject: Re: bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp
References: <51442486.4070100@HIDDEN> <87a6l9ufug.fsf@HIDDEN>
 <524429ba-026c-e5a6-579e-1789bd2cee1a@HIDDEN>
 <87k0k9n70g.fsf@HIDDEN>
 <8614ba8d-342d-312d-ca11-1c5b7e0885ff@HIDDEN>
Date: Thu, 26 Aug 2021 16:05:32 +0200
In-Reply-To: <8614ba8d-342d-312d-ca11-1c5b7e0885ff@HIDDEN> ("Andreas
 =?utf-8?Q?R=C3=B6hler=22's?= message of "Thu, 26 Aug 2021 08:21:36 +0200")
Message-ID: <87pmu01etv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 
 Content preview:  Andreas Röhler <andreas.roehler@HIDDEN> writes: >>>
    Maybe put the Python code below at the top of some buffer and run the >>>
    test delivered below: >>> >>> # Python >>> >>> def main(): >>>     """Some
    hint""" >>>     if len(sys.argv) == 1: >> [...] 
 
 Content analysis details:   (-2.9 points, 5.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
                             [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 13973
Cc: 13973 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: -3.3 (---)

Andreas R=C3=B6hler <andreas.roehler@HIDDEN> writes:

>>> Maybe put the Python code below at the top of some buffer and run the
>>> test delivered below:
>>>
>>> # Python
>>>
>>> def main():
>>>  =C2=A0=C2=A0=C2=A0 """Some hint"""
>>>  =C2=A0=C2=A0=C2=A0 if len(sys.argv) =3D=3D 1:
>>>  =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 usage()
>>>
>>> ;; Elisp
>>> (defun forward-sexp-text ()
>>>  =C2=A0 (interactive)
>>>  =C2=A0 (goto-char 30 )
>>>  =C2=A0 (forward-sexp))
>> By that goto-char, do you mean the "S" character?
>
> No, sorry, the 5th double-quote of the triple-quoted-string.

That gives me

forward-sexp: Scan error: "Unbalanced parentheses", 40, 86

which I think is the right thing?

This bug report started with thingatpt.  What is the real thingatpt use
case that doesn't work in triple-quoted strings?

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13973; Package emacs. Full text available.

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


Received: (at 13973) by debbugs.gnu.org; 26 Aug 2021 06:21:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 26 02:21:47 2021
Received: from localhost ([127.0.0.1]:48196 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mJ8lm-0008Or-QR
	for submit <at> debbugs.gnu.org; Thu, 26 Aug 2021 02:21:46 -0400
Received: from mout.kundenserver.de ([212.227.126.135]:45571)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <andreas.roehler@HIDDEN>) id 1mJ8lj-0008Ob-UD
 for 13973 <at> debbugs.gnu.org; Thu, 26 Aug 2021 02:21:45 -0400
Received: from [192.168.178.63] ([94.134.177.209]) by mrelayeu.kundenserver.de
 (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id
 1MFbFW-1mFFXj1qQg-00HAgx; Thu, 26 Aug 2021 08:21:37 +0200
Subject: Re: bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp
To: Lars Ingebrigtsen <larsi@HIDDEN>
References: <51442486.4070100@HIDDEN> <87a6l9ufug.fsf@HIDDEN>
 <524429ba-026c-e5a6-579e-1789bd2cee1a@HIDDEN>
 <87k0k9n70g.fsf@HIDDEN>
From: =?UTF-8?Q?Andreas_R=c3=b6hler?= <andreas.roehler@HIDDEN>
Message-ID: <8614ba8d-342d-312d-ca11-1c5b7e0885ff@HIDDEN>
Date: Thu, 26 Aug 2021 08:21:36 +0200
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:78.0) Gecko/20100101
 Thunderbird/78.13.0
MIME-Version: 1.0
In-Reply-To: <87k0k9n70g.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Content-Language: en-US
X-Provags-ID: V03:K1:uXxi0g3pZdZxUCUIjWizTzUGJPt4KTn8WZ9F7vqKzu+Gb6CEFfs
 If31ZhvpDXdG5Yoh/PmcnQ26PcgmejF4c5BalNahNuijq6DSDGitZdGMhPlxAWxXZmEOy64
 i/15NJqEZ9Ov+RS0RfG82aLeV3y1jkP2a2sTq88KhrwLpYOTqHVdyPKykoR/vCI539w1poZ
 aEjtybZQFLeNUV1pszjzA==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:QsA33Oefejs=:OYF8sckh3y1Eg2KNHYsqnV
 4mZCIjqTBjJTFrjvEglWD/jAaXf7TeX1R5BEtW+pTiZxdVD/N8myXfleP+io5QSgEd+40Pgj6
 YFXjwNd+2VDZMBepldJPwZOme9Qzy8qXtIsVCe6iY0hMttsXCRcLn7UefzdYwQH1wiGw0w5IU
 HUGF2Cp0IrCjqSBdCGKC8lykIERXMDRX2TQTimRn5SUOMmzc1fSxReonV98ouIU3Jl3rKKzeM
 /d4feWaGcuTaRaNWOC2Ju6CMsFRAVdOiDtenTK/CQ4gWSUWfBMSg8J/LfilIhpsMvJ6I/ksPP
 WqiYe+hk3VRs//P5WF7C01nMk69GbPRKS/NxXXYe/dv1vTL1U+GGSnFPfiIQRnHAGtwg93+4g
 IdDLmt2nr99clAiD8gk1mbwMLaBmhl2bsRNn2QjqGcpAK3n5jhdlOiTlbQrqt+r+wwatKcHEu
 nMw/B+Onjfa5Zv2jEfgmY9B2gK3RngxGGxtaFq5hEmRy3l169sbIJ6U9Bp8LcX3ZLpz1CUT1/
 wdHu/00qg9g2180cRaqsu+S1m4m4cd70MQ9mNnWO79Remd8TdL484+l2KNvj5xR9GgFLE5DV2
 yxbsxVBK/2iBTStXNsR0cF0nGt0xbfo3ejLV7H5L4nqtHsXS09sJ14pqtl4Uh87r+JGHQJK0N
 ZQPNGbjCjpV3Q5fymy3MistB8yB6b552HKp/JzP3Oof5a4quASh68bqCO9uQUdJxCL4fQPTfx
 jQkbQOP+zvFveHl93U/fjrJQRRltpIjXqdKyuJOgykLwOWsKtOs4rf0FOzM=
X-Spam-Score: -0.1 (/)
X-Debbugs-Envelope-To: 13973
Cc: 13973 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: -1.1 (-)


On 25.08.21 12:38, Lars Ingebrigtsen wrote:
> Andreas Röhler <andreas.roehler@HIDDEN> writes:
>
>> Maybe put the Python code below at the top of some buffer and run the
>> test delivered below:
>>
>> # Python
>>
>> def main():
>>      """Some hint"""
>>      if len(sys.argv) == 1:
>>          usage()
>>
>> ;; Elisp
>> (defun forward-sexp-text ()
>>    (interactive)
>>    (goto-char 30 )
>>    (forward-sexp))
> By that goto-char, do you mean the "S" character?


No, sorry, the 5th double-quote of the triple-quoted-string.

> (It's where point
> lands in the buffer included below.)  If so, `forward-sex'
> (in Emacs 28) does the correct thing -- it moves to the end of "Some".
>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13973; Package emacs. Full text available.

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


Received: (at 13973) by debbugs.gnu.org; 25 Aug 2021 10:39:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 25 06:39:09 2021
Received: from localhost ([127.0.0.1]:45855 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mIqJJ-0003Kw-4V
	for submit <at> debbugs.gnu.org; Wed, 25 Aug 2021 06:39:09 -0400
Received: from quimby.gnus.org ([95.216.78.240]:34914)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mIqJG-0003KS-VG
 for 13973 <at> debbugs.gnu.org; Wed, 25 Aug 2021 06:39:07 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=cbbLFSRBkJLHdk7ybelJMCQG1LJ048bejtoeHPL1If0=; b=iep3kZ+HIRHzJPyc+g049Bw7/s
 WojfXNjI42Fpur7pKBhPkMJrGMkPwwWNxRD98h/IcHfkRsZHlt4GbWW1sma7Jjf3/O9XPDvBl8ayW
 ZQFcIHtr/acbo/7kkPQUk1y1jqqh6w1rsfQm6rkniRp8KG9U5q1J1RvQ87LhaTls/Hcg=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mIqJ6-0002z0-91; Wed, 25 Aug 2021 12:39:00 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Andreas =?utf-8?Q?R=C3=B6hler?= <andreas.roehler@HIDDEN>
Subject: Re: bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp
References: <51442486.4070100@HIDDEN> <87a6l9ufug.fsf@HIDDEN>
 <524429ba-026c-e5a6-579e-1789bd2cee1a@HIDDEN>
Date: Wed, 25 Aug 2021 12:38:55 +0200
In-Reply-To: <524429ba-026c-e5a6-579e-1789bd2cee1a@HIDDEN> ("Andreas
 =?utf-8?Q?R=C3=B6hler=22's?= message of "Mon, 23 Aug 2021 19:11:45 +0200")
Message-ID: <87k0k9n70g.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 
 Content preview:  Andreas Röhler <andreas.roehler@HIDDEN> writes: >
   Maybe put the Python code below at the top of some buffer and run the > test
    delivered below: > > # Python > > def main(): >     """Some hint""" >
       if len(sys.argv) == 1: >         u [...] 
 
 Content analysis details:   (-2.9 points, 5.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
                             [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 13973
Cc: 13973 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: -3.3 (---)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Andreas R=C3=B6hler <andreas.roehler@HIDDEN> writes:

> Maybe put the Python code below at the top of some buffer and run the
> test delivered below:
>
> # Python
>
> def main():
> =C2=A0=C2=A0=C2=A0 """Some hint"""
> =C2=A0=C2=A0=C2=A0 if len(sys.argv) =3D=3D 1:
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 usage()
>
> ;; Elisp
> (defun forward-sexp-text ()
> =C2=A0 (interactive)
> =C2=A0 (goto-char 30 )
> =C2=A0 (forward-sexp))

By that goto-char, do you mean the "S" character?  (It's where point
lands in the buffer included below.)  If so, `forward-sex'
(in Emacs 28) does the correct thing -- it moves to the end of "Some".

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

--=-=-=
Content-Type: text/x-python
Content-Disposition: inline; filename=sexp.py

# Python

def main():
    """Some hint"""
    if len(sys.argv) == 1:
        usage()

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13973; Package emacs. Full text available.

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


Received: (at 13973) by debbugs.gnu.org; 23 Aug 2021 17:11:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 23 13:11:57 2021
Received: from localhost ([127.0.0.1]:42559 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mIDUK-0003ji-Ql
	for submit <at> debbugs.gnu.org; Mon, 23 Aug 2021 13:11:57 -0400
Received: from mout.kundenserver.de ([212.227.126.134]:54627)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <andreas.roehler@HIDDEN>) id 1mIDUH-0003jU-70
 for 13973 <at> debbugs.gnu.org; Mon, 23 Aug 2021 13:11:56 -0400
Received: from [192.168.178.63] ([82.207.239.129]) by mrelayeu.kundenserver.de
 (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id
 1MnJUy-1mjbh10w7A-00jLTf; Mon, 23 Aug 2021 19:11:47 +0200
Subject: Re: bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp
To: Lars Ingebrigtsen <larsi@HIDDEN>
References: <51442486.4070100@HIDDEN> <87a6l9ufug.fsf@HIDDEN>
From: =?UTF-8?Q?Andreas_R=c3=b6hler?= <andreas.roehler@HIDDEN>
Message-ID: <524429ba-026c-e5a6-579e-1789bd2cee1a@HIDDEN>
Date: Mon, 23 Aug 2021 19:11:45 +0200
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:78.0) Gecko/20100101
 Thunderbird/78.13.0
MIME-Version: 1.0
In-Reply-To: <87a6l9ufug.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Content-Language: en-US
X-Provags-ID: V03:K1:J7Z+fQeSP6k/imM3d3daRDagA9Hk6xyACT2Gze5EBh++93RC6Fn
 z6GqAF2Wv07NZmYcG2Nfffn14C/vXGTXorikflap9PH18/X3R4kAE88DXZrYN94kyppCF1k
 PORlbasWrKZsv0ht7XnleO4r5ZKYXJK/8CQ8svaE+qa5GHALZ14c7W1U71tMp8jz2VL85gZ
 Yw+4iBFly6reyQsgRiGWA==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:gafrIMGLYJ4=:OSnyqaaPgtbAXSFnUGdWXv
 z2VZOQHrK8dlD1mp9HntOxfm1sPYnmSPpjQcBvjC5UCEUeUuJK9nBoJr60q/PBjOoQKvihtUG
 Hlx8+Oy1RYnvtoDObiMb3GCxxXMP3qXqksfEzF/wJ38NN9W4TAqIJGN2u/9uoMDi0vOm8b8rE
 ofx4SMqZWARGhbJFHXpTyVq6Xxk5iarnUSQtxCnz21vBd+hKoAaoXCUZc1/phvNHtvWroT4j+
 PdDXu3MZ6bNWceO54apWCN1Iuk143KZJy2bomDeHRt5GMqDOKlQxL6FkNEobVA9+4yyO4T9jD
 M0bXKk30/V/mUeAwFcTyc7QgC68uIEkQT7SgDknDvs07IaKZE68Ng+Nl40ktrvZvayBvshGQu
 R8h2NmeAj5DSEDHN7gSAcGSqKdFgikkALEmjpQ1oahiShC9IEhXaqHwV3+37t0nN0aZ+tqv5U
 8+sGH5CZ3m50MY018JD1yAW6my8dx+LUfiK26hVJGKUFAGJjQ/D5WebTy36XuScPkTuVawVU4
 kmS61gWEhSrG4q/+yNpPBXYMDbqnfxB4IzR8thLFBOWvoc8RwFCeJbDwc0HIyDL9TRdJbBLYh
 aTiCEAmrAfLDT+1W3802ZH0dzCBNMoNNkdhS1DgSpNsKbijSL8hRHSCaPN1FXVRFxE1/Jg+xt
 baHjkCM6ou/zzNJknXwr0PzlVFVXheKbV6s1DjPh/bywaQ7OHlEbaUj8RX/pPDwMiC1IGAU+G
 WGzCZ2Ihxt0cyigQsQ7qGk72+ifenLOwJHOsrD43m3bLosrw2ut7EMn+8t6Uu13wMMoOXnizo
 HIJ2eHoG3Cd3D7D/fDZgU+AQXLgIE5xcGn7f212Cu/IwLYh+NCd+DouqjDjwxqSp4O3LiJDIi
 Yc5TLNBqn4h0SNBZz3XA==
X-Spam-Score: -0.1 (/)
X-Debbugs-Envelope-To: 13973
Cc: 13973 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: -1.1 (-)


On 23.08.21 03:09, Lars Ingebrigtsen wrote:
> Andreas Röhler <andreas.roehler@HIDDEN> writes:
>
>> (defun end-of-sexp ()
>>    "Move point to the end of the current sexp.
>> \[This is an internal function.]"
>>    (let ((char-syntax (char-syntax (char-after))))
>>      (if (or (eq char-syntax ?\))
>> 	    (and (eq char-syntax ?\") (in-string-p)))
>> 	(forward-char 1)
>>        (forward-sexp 1))))
>>
>> "or" asks if inside a string and calls (forward-char 1).
>>
>> This must fail with some probability with
>> triple-quoted-strings as used in Python.
>>
>> Solution:
>>
>> When inside a string, jump to (nth 8 (syntax-ppss)) and
>> call (forward-sexp 1) from there.
> (I'm going through old bug reports that unfortunately weren't resolved
> at the time.)
>
> It's not quite clear to me what the actual problem here is.

It's only abstract reasoning when looking at the code.

Maybe put the Python code below at the top of some buffer and run the 
test delivered below:

# Python

def main():
     """Some hint"""
     if len(sys.argv) == 1:
         usage()

;; Elisp
(defun forward-sexp-text ()
   (interactive)
   (goto-char 30 )
   (forward-sexp))


>   Do you have
> a test case where thingatpt does the wrong thing in Python mode?
>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13973; Package emacs. Full text available.
Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 13973) by debbugs.gnu.org; 23 Aug 2021 01:09:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 22 21:09:40 2021
Received: from localhost ([127.0.0.1]:40057 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mHyT5-00043x-Om
	for submit <at> debbugs.gnu.org; Sun, 22 Aug 2021 21:09:39 -0400
Received: from quimby.gnus.org ([95.216.78.240]:38782)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mHyT4-00043g-Cm
 for 13973 <at> debbugs.gnu.org; Sun, 22 Aug 2021 21:09:39 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=neCqOlMWrKp766KRu/+KAP5Nj9BHB21OdJ5WED7HDuU=; b=dhIpOEJKvPTHHdtKJB7pkWKma1
 CAKp7BUbzjMsZ0DUD4ihKOb2XWK7vrEMbvKlDSpJGrfFQynOKzDtBxEHgBUmShCWZF5gx64BjkTiX
 gJJp0zYF1eh80R4Pu73BAVA+VPN1cfN3haP7+tzvRsnHT5yxRHn5ZKgM/xX60alE1GVA=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mHySu-0005L2-DJ; Mon, 23 Aug 2021 03:09:32 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Andreas =?utf-8?Q?R=C3=B6hler?= <andreas.roehler@HIDDEN>
Subject: Re: bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp
References: <51442486.4070100@HIDDEN>
Date: Mon, 23 Aug 2021 03:09:27 +0200
In-Reply-To: <51442486.4070100@HIDDEN> ("Andreas =?utf-8?Q?R=C3=B6h?=
 =?utf-8?Q?ler=22's?= message of "Sat, 16 Mar 2013 08:51:34 +0100")
Message-ID: <87a6l9ufug.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 
 Content preview:  Andreas Röhler <andreas.roehler@HIDDEN> writes: >
   (defun end-of-sexp () > "Move point to the end of the current sexp. > \[This
    is an internal function.]" > (let ((char-syntax (char-syntax (char-after))))
    > (if (or (eq char-syntax ?\)) > (and (eq ch [...] 
 
 Content analysis details:   (-2.9 points, 5.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
                             [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 13973
Cc: 13973 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: -3.3 (---)

Andreas R=C3=B6hler <andreas.roehler@HIDDEN> writes:

> (defun end-of-sexp ()
>   "Move point to the end of the current sexp.
> \[This is an internal function.]"
>   (let ((char-syntax (char-syntax (char-after))))
>     (if (or (eq char-syntax ?\))
> 	    (and (eq char-syntax ?\") (in-string-p)))
> 	(forward-char 1)
>       (forward-sexp 1))))
>
> "or" asks if inside a string and calls (forward-char 1).
>
> This must fail with some probability with
> triple-quoted-strings as used in Python.
>
> Solution:
>
> When inside a string, jump to (nth 8 (syntax-ppss)) and
> call (forward-sexp 1) from there.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

It's not quite clear to me what the actual problem here is.  Do you have
a test case where thingatpt does the wrong thing in Python mode?

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13973; Package emacs. Full text available.

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


Received: (at 13973) by debbugs.gnu.org; 16 Mar 2013 13:51:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 16 09:51:34 2013
Received: from localhost ([127.0.0.1]:57455 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UGrWI-0007OT-NP
	for submit <at> debbugs.gnu.org; Sat, 16 Mar 2013 09:51:34 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.182]:1945)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <monnier@HIDDEN>) id 1UGrWG-0007OG-QJ
	for 13973 <at> debbugs.gnu.org; Sat, 16 Mar 2013 09:51:33 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av8EABK/CFFFxIIq/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDgkdEhQYDRYOiB4GwS2RCgOkeoFegxM
X-IPAS-Result: Av8EABK/CFFFxIIq/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDgkdEhQYDRYOiB4GwS2RCgOkeoFegxM
X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; 
   d="scan'208";a="5053355"
Received: from 69-196-130-42.dsl.teksavvy.com (HELO pastel.home)
	([69.196.130.42])
	by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA;
	16 Mar 2013 09:50:02 -0400
Received: by pastel.home (Postfix, from userid 20848)
	id 5ED2067B17; Sat, 16 Mar 2013 09:50:04 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Leo Liu <sdl.web@HIDDEN>
Subject: Re: bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp
Message-ID: <jwvli9ncv4k.fsf-monnier+emacs@HIDDEN>
References: <51442486.4070100@HIDDEN> <m138vvzlb4.fsf@HIDDEN>
Date: Sat, 16 Mar 2013 09:50:04 -0400
In-Reply-To: <m138vvzlb4.fsf@HIDDEN> (Leo Liu's message of "Sat, 16 Mar
	2013 18:33:03 +0800")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 13973
Cc: 13973 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
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>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

>> When inside a string, jump to (nth 8 (syntax-ppss)) and
>> call (forward-sexp 1) from there.

Sounds right, yes.

> In my experience (a while ago, I use little python these days) this
> cannot reliably goes to the end of the triple-quoted string.

That would be a bug in python-mode, then.


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13973; Package emacs. Full text available.

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


Received: (at submit) by debbugs.gnu.org; 16 Mar 2013 12:10:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 16 08:10:37 2013
Received: from localhost ([127.0.0.1]:57403 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UGpwa-00054M-L0
	for submit <at> debbugs.gnu.org; Sat, 16 Mar 2013 08:10:37 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33090)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <andreas.roehler@HIDDEN>) id 1UGpwY-00054A-36
	for submit <at> debbugs.gnu.org; Sat, 16 Mar 2013 08:10:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <andreas.roehler@HIDDEN>) id 1UGpv7-000686-Lv
	for submit <at> debbugs.gnu.org; Sat, 16 Mar 2013 08:09:06 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE,
	USER_IN_WHITELIST autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:59133)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <andreas.roehler@HIDDEN>) id 1UGpv7-000682-IF
	for submit <at> debbugs.gnu.org; Sat, 16 Mar 2013 08:09:05 -0400
Received: from eggs.gnu.org ([208.118.235.92]:44451)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <andreas.roehler@HIDDEN>) id 1UGpv6-0002ZD-JN
	for bug-gnu-emacs@HIDDEN; Sat, 16 Mar 2013 08:09:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <andreas.roehler@HIDDEN>) id 1UGpv5-00067d-Lh
	for bug-gnu-emacs@HIDDEN; Sat, 16 Mar 2013 08:09:04 -0400
Received: from moutng.kundenserver.de ([212.227.17.9]:61481)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <andreas.roehler@HIDDEN>) id 1UGpv5-00067I-CO
	for bug-gnu-emacs@HIDDEN; Sat, 16 Mar 2013 08:09:03 -0400
Received: from [192.168.178.21] (brln-4d0c0260.pool.mediaWays.net [77.12.2.96])
	by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis)
	id 0Lj8u3-1Us70c3k3r-00dK0c; Sat, 16 Mar 2013 13:09:02 +0100
Message-ID: <51446112.2040800@HIDDEN>
Date: Sat, 16 Mar 2013 13:09:54 +0100
From: =?ISO-8859-1?Q?Andreas_R=F6hler?= <andreas.roehler@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:17.0) Gecko/20130307 Thunderbird/17.0.4
MIME-Version: 1.0
To: bug-gnu-emacs@HIDDEN
Subject: Re: bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp
References: <51442486.4070100@HIDDEN> <m138vvzlb4.fsf@HIDDEN>
In-Reply-To: <m138vvzlb4.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Provags-ID: V02:K0:K+jtLOCONAJKaq/7vETJ6xv9/H/fZdGK7otXOpMQilD
	37HcoDexYEckw/k8Gis0B0Kx5B9KzQIhEBAT5gFPl8c3ZIcv0h
	neMkKiE8oMqzq+zykvM4OFiHjfNlttcRcenkIsL9mO1khiI7Ct
	glTfUxhJa2eYrAQQH6w0Vtu0gt16GFetslXNW5+1ja2HYR3NXK
	EZTQpZ520OvFa09gDjvSlCoba2i1E3JEcfYwuI736wpd6HnqGl
	vlWbO8fAep2VjwH8eRTtev+BTENkYf18Nb0qb8gjVC+NtZc93S
	Y/tHtina0oXzpUmVgVKhAJ68TLvG11f98GwvfwD9clGORVKVb5
	gNU3myVCG9/N92w0pFzv2y8ZHzHqL5pV8UTUKnSS1
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: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -4.2 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
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>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.9 (------)

Am 16.03.2013 11:33, schrieb Leo Liu:
> On 2013-03-16 15:51 +0800, Andreas Röhler wrote:
>> When inside a string, jump to (nth 8 (syntax-ppss)) and
>> call (forward-sexp 1) from there.
>
> In my experience (a while ago, I use little python these days) this
> cannot reliably goes to the end of the triple-quoted string.
>
> Leo
>
>
>
>
>

Indeed seems a bug in python-mode.el at this place just now.
Anyway - forward-sexp must go to the end of string from it's beginning,
a string is a balanced expression.


Best,

Andreas









Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13973; Package emacs. Full text available.

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


Received: (at submit) by debbugs.gnu.org; 16 Mar 2013 10:35:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 16 06:35:15 2013
Received: from localhost ([127.0.0.1]:57252 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UGoSJ-0001uJ-2b
	for submit <at> debbugs.gnu.org; Sat, 16 Mar 2013 06:35:15 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41879)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1UGoSG-0001u6-7J
	for submit <at> debbugs.gnu.org; Sat, 16 Mar 2013 06:35:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1UGoQq-0001cW-8F
	for submit <at> debbugs.gnu.org; Sat, 16 Mar 2013 06:33:44 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-100.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	FSL_HELO_BARE_IP_2, RCVD_IN_DNSWL_NONE, RCVD_NUMERIC_HELO,
	RP_MATCHES_RCVD, USER_IN_WHITELIST autolearn=no version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:50685)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1UGoQq-0001cS-4o
	for submit <at> debbugs.gnu.org; Sat, 16 Mar 2013 06:33:44 -0400
Received: from eggs.gnu.org ([208.118.235.92]:53241)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1UGoQp-0004bM-5o
	for bug-gnu-emacs@HIDDEN; Sat, 16 Mar 2013 06:33:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1UGoQm-0001c9-Pf
	for bug-gnu-emacs@HIDDEN; Sat, 16 Mar 2013 06:33:43 -0400
Received: from plane.gmane.org ([80.91.229.3]:58850)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1UGoQm-0001bs-In
	for bug-gnu-emacs@HIDDEN; Sat, 16 Mar 2013 06:33:40 -0400
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <geb-bug-gnu-emacs@HIDDEN>) id 1UGoR5-0003Rx-Sm
	for bug-gnu-emacs@HIDDEN; Sat, 16 Mar 2013 11:33:59 +0100
Received: from 182.48.109.29 ([182.48.109.29])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-gnu-emacs@HIDDEN>; Sat, 16 Mar 2013 11:33:59 +0100
Received: from sdl.web by 182.48.109.29 with local (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-gnu-emacs@HIDDEN>; Sat, 16 Mar 2013 11:33:59 +0100
X-Injected-Via-Gmane: http://gmane.org/
To: bug-gnu-emacs@HIDDEN
From: Leo Liu <sdl.web@HIDDEN>
Subject: Re: bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp
Date: Sat, 16 Mar 2013 18:33:03 +0800
Lines: 8
Message-ID: <m138vvzlb4.fsf@HIDDEN>
References: <51442486.4070100@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Complaints-To: usenet@HIDDEN
X-Gmane-NNTP-Posting-Host: 182.48.109.29
Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAMFBMVEUaFRZLMy1dTENxVzKQ
	WiCrXQ97cmO/dSqSh3akjGTApXy5sJ7Sxo/Sz8Xo6eP9//xJbkruAAAAAWJLR0QAiAUdSAAAAAlw
	SFlzAAACxQAAAsUBidZ/7wAAAAd0SU1FB9cBBwMJOwHXewoAAAIBSURBVCjPVdNBiNNAFADQ6J4F
	x3hThHZBBC+WCFI8SS0iezRDcMHLHkLAg6gJH/fgYQ9xYlj2sLK4KHgqCgXFhda2Idmr4kkQPZQ0
	nkQMbTypbMmMM2m7ZgYSmMef/5OZPwo7HFnx3uKPcmj0Dht1LWZJ+Hvr7dIFZXRUwl9VRTuuKDJ+
	U44gjscknK4hhJaCkYRsWjmBtLqXlJAG2wipNe18OZJu1BBq1E8xafl4s6Jq2mUZGftU1y7CCxnp
	FVUDWJXx4C66BKBnErbuoaYNtoRTu6EZBsCbMn7W+5qOAR6WvxNOby9jHWC9hAf3n304CdiAByXs
	3Nh9roLDkyb/sWV712vYwaLSAn8CPMHIAAzOPDKP2COAFm4Y4ODVWc6xG7KXsN7UeUJjjimx2uwd
	gCgNhr0i8C/xyCD5CiCKAMY3Bf5oDzx//w/fimscdcAZU2jv9sedx6+nYPPFIoWI/GK6QZ+EFGOR
	ErAjCnV3vPZ7XqlTIMbOLY7fLcvvmT7rXNWaGDexIY44N12TG2PDp7vqyl57dnCeuWwyNpnEURxk
	fTbDYeBnKRn4oejPYI4sH6WviBumEZ/GxX4X/x6EcURFZ7E071bjQGAxpcOAEOJuTiroDEea5Szv
	rVWLYfl7ZiQwSUToxrkux7OLixAWGz22+HIyWTRYcVfomOwvzusfjtVIGgLHf3MAAAAASUVORK5C
	YII=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (OS X 10.8.3)
Cancel-Lock: sha1:hTqXNR5EZ4Q9Vc/igT4XGgrKnhQ=
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -1.0 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
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>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.9 (--)

On 2013-03-16 15:51 +0800, Andreas Röhler wrote:
> When inside a string, jump to (nth 8 (syntax-ppss)) and
> call (forward-sexp 1) from there.

In my experience (a while ago, I use little python these days) this
cannot reliably goes to the end of the triple-quoted string.

Leo





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13973; Package emacs. Full text available.

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


Received: (at submit) by debbugs.gnu.org; 16 Mar 2013 07:52:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 16 03:52:18 2013
Received: from localhost ([127.0.0.1]:57140 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UGlub-0006UL-Sv
	for submit <at> debbugs.gnu.org; Sat, 16 Mar 2013 03:52:18 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43794)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <andreas.roehler@HIDDEN>) id 1UGluZ-0006U4-EX
	for submit <at> debbugs.gnu.org; Sat, 16 Mar 2013 03:52:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <andreas.roehler@HIDDEN>) id 1UGlt9-0000RC-Hk
	for submit <at> debbugs.gnu.org; Sat, 16 Mar 2013 03:50:49 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE,
	USER_IN_WHITELIST autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:45685)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <andreas.roehler@HIDDEN>) id 1UGlt9-0000R7-Eh
	for submit <at> debbugs.gnu.org; Sat, 16 Mar 2013 03:50:47 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55154)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <andreas.roehler@HIDDEN>) id 1UGlt8-0003of-FG
	for bug-gnu-emacs@HIDDEN; Sat, 16 Mar 2013 03:50:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <andreas.roehler@HIDDEN>) id 1UGlt6-0000Qd-VB
	for bug-gnu-emacs@HIDDEN; Sat, 16 Mar 2013 03:50:46 -0400
Received: from moutng.kundenserver.de ([212.227.126.171]:49691)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <andreas.roehler@HIDDEN>) id 1UGlt6-0000QF-K3
	for bug-gnu-emacs@HIDDEN; Sat, 16 Mar 2013 03:50:44 -0400
Received: from [192.168.178.21] (brln-4d0c0260.pool.mediaWays.net [77.12.2.96])
	by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis)
	id 0MLA5x-1UH30F0gHx-000IdF; Sat, 16 Mar 2013 08:50:42 +0100
Message-ID: <51442486.4070100@HIDDEN>
Date: Sat, 16 Mar 2013 08:51:34 +0100
From: =?ISO-8859-15?Q?Andreas_R=F6hler?= <andreas.roehler@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:17.0) Gecko/20130307 Thunderbird/17.0.4
MIME-Version: 1.0
To: bug-gnu-emacs@HIDDEN
Subject: Subject: 24.3; thingatpt.el, end-of-sexp
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V02:K0:ha05DoTDUoTFyhIgczvA+GYVRgIK2vovqRcXHIeQPUv
	VoNnXIocaOyAS1S94xw0XLWsZZJiYocL7sF6QCdeID2Ibo3TXs
	mlO5aKdB1bCELwu028sy237tzQEc4npwPXZUKYfsUvYN9Nv7+V
	YKgPygMcHgwVSJn/imBLAuohkPH8UkpeJWpPpnwNL7mEXNMcK+
	Xr8vdPEqHiQWGvHC2YVmTtR/91mG4xTx2du1aeGiILMaZ3AWNX
	AlLyfPc7VWR/WOTRHJz1wbuVXujbUmlBi/2RQhd4EGGpkAZEtd
	n8d+pvX4vmNTsRXrIMRVvhpJ6znYFrVl2K0LBr6YCr0l2aYptG
	5bV2NU0AJhYtWHAAdSw+dDuGcH5CWRLmHOefme5af
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: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
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>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.9 (------)

(defun end-of-sexp ()
   "Move point to the end of the current sexp.
\[This is an internal function.]"
   (let ((char-syntax (char-syntax (char-after))))
     (if (or (eq char-syntax ?\))
	    (and (eq char-syntax ?\") (in-string-p)))
	(forward-char 1)
       (forward-sexp 1))))

"or" asks if inside a string and calls (forward-char 1).

This must fail with some probability with
triple-quoted-strings as used in Python.

Solution:

When inside a string, jump to (nth 8 (syntax-ppss)) and
call (forward-sexp 1) from there.




Acknowledgement sent to Andreas Röhler <andreas.roehler@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#13973; 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: Thu, 5 May 2022 12:30:02 UTC

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