From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Confusing doc string of list-or-string at point
Date: Fri, 24 Sep 2021 09:32:18 +0300 [thread overview]
Message-ID: <875yuqpjpp.fsf@mail.linkov.net> (raw)
In-Reply-To: <87czoz3wm2.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 23 Sep 2021 22:44:37 +0300")
>> But the same can happen with a list/string enclosed within a defun, or
>> a word enclosed withing a string or a list. Do we also need
>> defun-or-string or list-or-string-or-word or any other combinations?
>
> An alternative would be to add a new thing-at-point target 'string'
> instead of 'list-or-string'. But since there is no such function as
> 'up-string' that would work like 'up-list' but only to go out of the
> enclosing string and not out of a list, so what remains to do is
> to use 'up-list' with the non-nil arg NO-SYNTAX-CROSSING, therefore
> the new target 'list-or-string'.
So now I reverted 'list-or-string', and added 'string' instead.
BTW, it seems there is a bug in thing-at-point--end-of-sexp,
but I'm not sure if this is a correct fix:
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index efe33982c3..3d2ea9dedf 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -241,7 +261,7 @@ in-string-p
(defun thing-at-point--end-of-sexp ()
"Move point to the end of the current sexp."
- (let ((char-syntax (syntax-after (point))))
+ (let ((char-syntax (char-syntax (char-after))))
(if (or (eq char-syntax ?\))
(and (eq char-syntax ?\") (nth 3 (syntax-ppss))))
(forward-char 1)
--
next prev parent reply other threads:[~2021-09-24 6:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-23 17:06 Confusing doc string of list-or-string at point Eli Zaretskii
2021-09-23 17:11 ` Juri Linkov
2021-09-23 17:33 ` Eli Zaretskii
2021-09-23 17:55 ` Juri Linkov
2021-09-23 17:56 ` Eli Zaretskii
2021-09-23 17:59 ` Juri Linkov
2021-09-23 18:43 ` Eli Zaretskii
2021-09-23 18:58 ` Eli Zaretskii
2021-09-23 19:44 ` Juri Linkov
2021-09-24 6:32 ` Juri Linkov [this message]
2021-09-24 7:14 ` Eli Zaretskii
2021-09-24 17:14 ` [External] : " Drew Adams
2021-09-24 17:59 ` Stefan Kangas
2021-09-24 17:41 ` Stefan Monnier
2021-09-25 19:03 ` Juri Linkov
2021-09-27 16:56 ` Stefan Monnier
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=875yuqpjpp.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.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).