all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Leo Liu <sdl.web@gmail.com>
Cc: 31772@debbugs.gnu.org, tino.calancha@gmail.com
Subject: bug#31772: 26.1; (thing-at-point 'list) regression
Date: Tue, 11 Sep 2018 14:16:00 +0300	[thread overview]
Message-ID: <83tvmwmgi7.fsf@gnu.org> (raw)
In-Reply-To: <m1zhwowcrn.fsf@gmail.com> (message from Leo Liu on Tue, 11 Sep 2018 18:26:36 +0800)

> From:  Leo Liu <sdl.web@gmail.com>
> Cc: 31772@debbugs.gnu.org,  tino.calancha@gmail.com
> Date: Tue, 11 Sep 2018 18:26:36 +0800
> 
> The difference is on what to return when (up-list -1) fails. They both
> try to return the sexp at point but the patched behaviour try returning
> the whole sexp while the one in <= 25.1 cut off the sexp from point.
> 
> Looking at the code in 25.1 it looks to me the original author had a
> thinko i.e. he/she meant to write:
> 
> (if (>= opoint (point))
>     (cons (point) end))
> 
> but instead write
> 
> (if (>= opoint (point))
>     (cons opoint end))
> 
> which resulted in some weird cases that you mentioned in previous email.

Right.

> > Would it be possible to modify list-at-point so that it keeps the
> > current behavior, perhaps as an option?  I'd like to find a solution
> > that doesn't just revert to the old behavior, but allows those who
> > need the new behavior to have it in some reasonable way.
> 
> Yes, this can be done. For example:
> 
> (defun list-at-point (&optional ignore-comment-or-string)
>   "Return the Lisp list at point, or nil if none is found.
> If IGNORE-COMMENT-OR-STRING is non-nil comments and strings are
> treated as white space."
>   (let ((ppss (and ignore-comment-or-string (syntax-ppss))))
>     (save-excursion
>       (goto-char (or (nth 8 ppss) (point)))
>       (form-at-point 'list 'listp))))

Would you mind submitting a patch that includes the above, and also
fixes/augments the tests accordingly?  I think these changes then
could go into the emacs-26 branch, unless someone raises objections.

Thanks.





  reply	other threads:[~2018-09-11 11:16 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-10  3:58 bug#31772: 26.1; (thing-at-point 'list) regression Leo Liu
2018-06-10 15:03 ` Eli Zaretskii
2018-06-10 15:21   ` Tino Calancha
2018-06-11  3:17     ` Leo Liu
2018-06-11 15:06       ` Tino Calancha
2018-06-11 16:08         ` Leo Liu
2018-06-11 16:25           ` Tino Calancha
2018-09-06 10:37             ` Leo Liu
2018-09-06 19:01               ` Andreas Röhler
2018-09-07  4:42                 ` Leo Liu
2018-09-07  8:17                   ` Andreas Röhler
2018-09-08  0:09                     ` Leo Liu
2018-09-11  8:31               ` Eli Zaretskii
2018-09-11 10:26                 ` Leo Liu
2018-09-11 11:16                   ` Eli Zaretskii [this message]
2018-09-11 11:52                     ` Andreas Röhler
2018-09-11 12:10                       ` Eli Zaretskii
2018-09-11 12:36                     ` Leo Liu
2018-09-11 12:39                       ` Eli Zaretskii
2018-09-14 14:55                         ` Leo Liu
2018-09-15  9:06                           ` Eli Zaretskii
2018-09-15 12:58                             ` Leo Liu
2018-09-15 13:28                               ` Eli Zaretskii
2018-06-11 16:34           ` Eli Zaretskii
2018-06-11 15:10       ` Eli Zaretskii
2018-06-11 16:36         ` Leo Liu
2018-06-11  2:32   ` Leo Liu
2018-06-11 14:58     ` Eli Zaretskii
2018-06-11 17:04       ` Leo Liu

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83tvmwmgi7.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=31772@debbugs.gnu.org \
    --cc=sdl.web@gmail.com \
    --cc=tino.calancha@gmail.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.