From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 13973@debbugs.gnu.org
Subject: bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp
Date: Fri, 27 Aug 2021 20:44:33 +0200 [thread overview]
Message-ID: <50eab79c-0ea8-87e8-9574-670a03669f4a@easy-emacs.de> (raw)
In-Reply-To: <87pmu01etv.fsf@gnus.org>
On 26.08.21 16:05, Lars Ingebrigtsen wrote:
> Andreas Röhler <andreas.roehler@easy-emacs.de> 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?
>
next prev parent reply other threads:[~2021-08-27 18:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-16 7:51 bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp Andreas Röhler
2013-03-16 10:33 ` Leo Liu
2013-03-16 12:09 ` Andreas Röhler
2013-03-16 13:50 ` Stefan Monnier
2021-08-23 1:09 ` Lars Ingebrigtsen
2021-08-23 17:11 ` Andreas Röhler
2021-08-25 10:38 ` Lars Ingebrigtsen
2021-08-26 6:21 ` Andreas Röhler
2021-08-26 14:05 ` Lars Ingebrigtsen
2021-08-27 18:44 ` Andreas Röhler [this message]
2021-08-28 15:05 ` Lars Ingebrigtsen
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=50eab79c-0ea8-87e8-9574-670a03669f4a@easy-emacs.de \
--to=andreas.roehler@easy-emacs.de \
--cc=13973@debbugs.gnu.org \
--cc=larsi@gnus.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).