From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andreas =?UTF-8?Q?R=C3=B6hler?= Newsgroups: gmane.emacs.bugs Subject: bug#31772: 26.1; (thing-at-point 'list) regression Date: Tue, 11 Sep 2018 13:52:42 +0200 Message-ID: <40ce4d6f-406b-2a9b-6105-804a11ce133b@easy-emacs.de> References: <838t7msmy1.fsf@gnu.org> <87k1r6acqo.fsf@gmail.com> <83y3c8mo40.fsf@gnu.org> <83tvmwmgi7.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1536666433 32677 195.159.176.226 (11 Sep 2018 11:47:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 11 Sep 2018 11:47:13 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 To: 31772@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 11 13:47:08 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 1fzh8O-0008O2-8I for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Sep 2018 13:47:08 +0200 Original-Received: from localhost ([::1]:57087 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzhAU-0004s8-R3 for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Sep 2018 07:49:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzhAI-0004rn-44 for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 07:49:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzhAE-0002V7-NS for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 07:49:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60228) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fzhAE-0002Uq-H8 for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 07:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fzhAE-00077I-D0 for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 07:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Sep 2018 11:49: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: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.153666652227329 (code B ref -1); Tue, 11 Sep 2018 11:49:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Sep 2018 11:48:42 +0000 Original-Received: from localhost ([127.0.0.1]:36253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzh9t-00076j-Nr for submit@debbugs.gnu.org; Tue, 11 Sep 2018 07:48:41 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzh9s-00076X-7v for submit@debbugs.gnu.org; Tue, 11 Sep 2018 07:48:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzh9m-0002FV-5h for submit@debbugs.gnu.org; Tue, 11 Sep 2018 07:48:35 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:53895) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fzh9l-0002Ez-Vj for submit@debbugs.gnu.org; Tue, 11 Sep 2018 07:48:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzh9l-0004YP-2b for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 07:48:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzh9h-0002BM-MP for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 07:48:32 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.131]:35183) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fzh9h-0002AZ-Bm for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 07:48:29 -0400 Original-Received: from [192.168.178.35] ([88.74.26.136]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MT3QL-1gOkxj2TbB-00Rms3 for ; Tue, 11 Sep 2018 13:48:26 +0200 In-Reply-To: <83tvmwmgi7.fsf@gnu.org> Content-Language: en-US X-Provags-ID: V03:K1:sA+rbeLR5PrBmydJlo5ousjKwDsa8M9vMvVyZn4Y7oSMdWsqkYG tu+GslWrTARFQqoB5GPtHtZIsqY+0Weyc6mSdsqHJ1vIIO+xk0W/K+OH+s8ciYYluylDn92 O9xwqmFUSB2L6q7JCAmRiCI6EyeSfI3OtIyxBtunRjyOsAFHw5pzb9y3HwEeCrQUHzn1F6P lgFDhQpaRkiTmzGgqVc0Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:OY2+d0m87i8=:cJINH5PD2kfR2+S9deK6PH A0PPpwSAoU9LEgk6+dvdRPOFi5E35s1Dv6lRkmXcWzueAsmDcDjf1p2IXpPTvyT/7A9h35iQn E5QL2XjEVkwFAf4PoHIowcRzw8uOyEwEFIDzARl+Qgms8HWKcYa5DKhm/XcLv/Xat2QcX04Xk TBF0aMO1KRpRqEDzM5QP9RF/H2CVPDJThJdFSH7hKZ6LKNYmIUB8MgTBV+JOIpC72JaAOA4fg 3fLt/j5B3xpuin1+pkrRAldEZAhPDy3rkK3keS+GrsSWIERgE+ebIUnvjU5eC96HGpKBLJT1C dtJp4c+D9VMxT3N02g7K89xw//t4pmJGSO3UzFITui/3U+ttSzyeeQPLNTld/Gu7YzSH3CeVg SO5FrvxO8SLHvsAUECROiBaYPP2LK+z5liJnNr0ob3Tu5tpsHHeLFry4YROh/H6QooyXg1LYP BceGvivFwz5sRlAVnEDbmoejB35BAhh6wNFTA6R+Ij8K14aTJjp5xkg16jAxR+PKHj2hIYqxL 35yOpx7+QPuQ1SJBFDM94sZBI12jRFnkg90g4ihSiY6CyGlJYH32hjXq/uoyn/cD54oaw60oy azW9XSzqgAGzRczAQOtv1d2Y7m4u4l9Q5PjV4pBVFs9iiO26GE9UiNcIVHEWw4033oNBCH65z 2Lt12tK9VLxgDNG7R8InlN3j3Mbxq9GlqzF2GqBl8bcnQDTDm1Wr0SiTWSBLU6AnHfS9qopkW stAUsmzGWsZmAzrC X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:150217 Archived-At: On 11.09.2018 13:16, Eli Zaretskii wrote: >> 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: >>optional ignore-comment-or-string) >> "Return the Lisp list at >> (defun list-at-point (& 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. > > > The basic decision to make is to put some section as comment or not. If code is commented out, it looses its lisp-syntax. It's plain text. Therefor no lisp-list can exist and no need for a var ignore-comment-or-string.