[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Confusing doc string of list-or-string at point
From: |
Juri Linkov |
Subject: |
Re: Confusing doc string of list-or-string at point |
Date: |
Fri, 24 Sep 2021 09:32:18 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) |
>> 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)
--
- Confusing doc string of list-or-string at point, Eli Zaretskii, 2021/09/23
- Re: Confusing doc string of list-or-string at point, Juri Linkov, 2021/09/23
- Re: Confusing doc string of list-or-string at point, Eli Zaretskii, 2021/09/23
- Re: Confusing doc string of list-or-string at point, Eli Zaretskii, 2021/09/23
- Re: Confusing doc string of list-or-string at point, Juri Linkov, 2021/09/23
- Re: Confusing doc string of list-or-string at point, Eli Zaretskii, 2021/09/23
- Re: Confusing doc string of list-or-string at point, Eli Zaretskii, 2021/09/23
- Re: Confusing doc string of list-or-string at point, Juri Linkov, 2021/09/23
- Re: Confusing doc string of list-or-string at point,
Juri Linkov <=
- Re: Confusing doc string of list-or-string at point, Eli Zaretskii, 2021/09/24
- RE: [External] : Re: Confusing doc string of list-or-string at point, Drew Adams, 2021/09/24
- RE: [External] : Re: Confusing doc string of list-or-string at point, Stefan Kangas, 2021/09/24
- Re: Confusing doc string of list-or-string at point, Stefan Monnier, 2021/09/24
- Re: Confusing doc string of list-or-string at point, Juri Linkov, 2021/09/25
- Re: Confusing doc string of list-or-string at point, Stefan Monnier, 2021/09/27
- Re: Confusing doc string of list-or-string at point, Juri Linkov, 2021/09/23