|
From: | Andreas Röhler |
Subject: | bug#13973: Subject: 24.3; thingatpt.el, end-of-sexp |
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 |
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?
[Prev in Thread] | Current Thread | [Next in Thread] |