From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#31772: 26.1; (thing-at-point 'list) regression Date: Tue, 11 Sep 2018 14:16:00 +0300 Message-ID: <83tvmwmgi7.fsf@gnu.org> References: <838t7msmy1.fsf@gnu.org> <87k1r6acqo.fsf@gmail.com> <83y3c8mo40.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1536664516 30578 195.159.176.226 (11 Sep 2018 11:15:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 11 Sep 2018 11:15:16 +0000 (UTC) Cc: 31772@debbugs.gnu.org, tino.calancha@gmail.com To: Leo Liu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 11 13:15:12 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzgdU-0007rO-FV for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Sep 2018 13:15:12 +0200 Original-Received: from localhost ([::1]:56983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzgfb-0000oS-0M for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Sep 2018 07:17:23 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzgfN-0000oJ-Cr for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 07:17:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzgfI-00011O-BG for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 07:17:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60209) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fzgfI-00011B-6e for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 07:17:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fzgfG-0004Mr-BS for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 07:17:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Sep 2018 11:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31772 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31772-submit@debbugs.gnu.org id=B31772.153666456516712 (code B ref 31772); Tue, 11 Sep 2018 11:17:02 +0000 Original-Received: (at 31772) by debbugs.gnu.org; 11 Sep 2018 11:16:05 +0000 Original-Received: from localhost ([127.0.0.1]:36233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzgeL-0004LU-Dj for submit@debbugs.gnu.org; Tue, 11 Sep 2018 07:16:05 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35943) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzgeI-0004Kk-GQ for 31772@debbugs.gnu.org; Tue, 11 Sep 2018 07:16:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzgeC-0008JU-H6 for 31772@debbugs.gnu.org; Tue, 11 Sep 2018 07:15:57 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzge6-0008E3-Ro; Tue, 11 Sep 2018 07:15:50 -0400 Original-Received: from [176.228.60.248] (port=3372 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fzge6-0004Fg-FX; Tue, 11 Sep 2018 07:15:50 -0400 In-reply-to: (message from Leo Liu on Tue, 11 Sep 2018 18:26:36 +0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:150216 Archived-At: > From: Leo Liu > 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.