From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Leo Liu Newsgroups: gmane.emacs.bugs Subject: bug#31772: 26.1; (thing-at-point 'list) regression Date: Tue, 11 Sep 2018 18:26:36 +0800 Message-ID: References: <838t7msmy1.fsf@gnu.org> <87k1r6acqo.fsf@gmail.com> <83y3c8mo40.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1536661526 18091 195.159.176.226 (11 Sep 2018 10:25:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 11 Sep 2018 10:25:26 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (macOS 10.12.6) Cc: 31772@debbugs.gnu.org, tino.calancha@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 11 12:25:22 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 1fzfrE-0004YL-42 for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Sep 2018 12:25:20 +0200 Original-Received: from localhost ([::1]:56621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzftK-0007xG-Lb for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Sep 2018 06:27:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzfsy-00075j-Av for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 06:27:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzfst-0001YH-ED for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 06:27:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60186) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fzfst-0001XX-9A for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 06:27:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fzfst-00033x-3X for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2018 06:27:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Liu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Sep 2018 10:27:03 +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.153666161011746 (code B ref 31772); Tue, 11 Sep 2018 10:27:03 +0000 Original-Received: (at 31772) by debbugs.gnu.org; 11 Sep 2018 10:26:50 +0000 Original-Received: from localhost ([127.0.0.1]:36210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzfsg-00033O-8V for submit@debbugs.gnu.org; Tue, 11 Sep 2018 06:26:50 -0400 Original-Received: from mail-pf1-f182.google.com ([209.85.210.182]:34346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzfse-000336-Bj for 31772@debbugs.gnu.org; Tue, 11 Sep 2018 06:26:49 -0400 Original-Received: by mail-pf1-f182.google.com with SMTP id k19-v6so12029108pfi.1 for <31772@debbugs.gnu.org>; Tue, 11 Sep 2018 03:26:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:face:date:in-reply-to:message-id :user-agent:mime-version; bh=b6wGKDwyJVdQULTcjP7WdK/rorTOBGh06OCzPaUnR48=; b=KFu3cYZkEWkHCEVZ2RiAd80lAMhHLK6xrordvvNpnGWt/1zHpfj4Js7Kkl3UxmiGK2 uzTAhKiH345HwvxqRw+vaE/Rw/YIiromwZaAwKvWMO/Kw0Q8utwd9ufDVYTn0kH/TSd3 9U+rkPTXTlv43GHd3Pct/Ww+Mjz2/N6gxKszwCFXYWq6F4HtuJ4LkYcVpa6HxK7xDccq 8DVMROw7lD/ZS5hem+sfhXu7HwIqmrYBU9HKCRufotNXh44Xz5XxBU0wXN9yZKyld5NW mkRYR//4pqhHlP3vQaueaRrKZ7Sdp0enXWL9qbosk62RJFsXROyf4oYsqNAPjQp6ylmy Wkug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:face:date :in-reply-to:message-id:user-agent:mime-version; bh=b6wGKDwyJVdQULTcjP7WdK/rorTOBGh06OCzPaUnR48=; b=CQYKOhdqicwRZzjnCS+uDCAK92DJ3ymW0bTlB8G492H/FeRjTrPOt6yIbILg+qfDWa 3+BFyytfveH0PWWwSgTyhFHWGkDOII8ZlZVRKkIUTYnsEloAIxCzC91ymAgSq7ISPULj 7iRaoAnZ+FyshsHdpVGTKYkhU8mNJwhm4R6/UQfroHuQpKZNjB8SxFl9JYCs66IPD+XE s7NdexIDMbouEdlEGh+I2QDw9bTR/wEEcVyXdhmBDpb1hhzxYpmsTDH3lMVaThWXxQ/2 Lfd1XAGhYYHE6twdPkfG3s24dNCJMIo62NewXg8rYtqOIlcNT2CRgZRG+aiB7vwXyo64 K5og== X-Gm-Message-State: APzg51CTAaHsPokhPbIVKehcqCTV5nUg6lUtAWPN87CQBlrhOkEVdnYC dtLenliuj9M4eAOhE3XMdFY= X-Google-Smtp-Source: ANB0VdYCd4nU+IjoKMqZUVanJ98+ZgQULWeIX2brwwNwtUbc9ac+gzEMPYZ9hq+HEKzVH6qZZ3wUHQ== X-Received: by 2002:a62:6c85:: with SMTP id h127-v6mr28816488pfc.65.1536661600175; Tue, 11 Sep 2018 03:26:40 -0700 (PDT) Original-Received: from Zeuss-MacBook-Air.local ([112.208.219.22]) by smtp.gmail.com with ESMTPSA id p73-v6sm27724038pfk.186.2018.09.11.03.26.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Sep 2018 03:26:39 -0700 (PDT) Face: iVBORw0KGgoAAAANSUhEUgAAACkAAAApAQAAAACAGz1bAAABKElEQVQYlWNg3NIt5FDPUPt7 4+X79Qyucz5/ugik+L2PBgKpyphaIK921q23QDnG0NBQoMr/vaWl9f8ZLL78uPv5PwN7RETfzXoG jhmFz27XM0RXmpuY/WfY+fv0Mc56BvFybfXA/wwL5t/wF61n2PU59axXPcOVzbmSW/8zrNt1benC /ww70hqUU/4zKCtrT9jwn8FhwynbufUMendE2aLqGRpdX9al1zM8eh17lKeeQcTMrdD5P8P3j/YT Q/8zXHSb7p1Qz/C4OM2JuZ7hgtI7K6AjqsMnf8j4z8C6xG1tw3+GqpqvsVn/GTzmpD9j/8/wP/oZ S/l/Bka+QO/g/wy15ueeFQL9N1O8mPU/g+umV3t1gdT0/1bTgHLqYVeXAlWKpMWt+w8Az82C9nHf X0cAAAAASUVORK5CYII= In-Reply-To: <83y3c8mo40.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 11 Sep 2018 11:31:43 +0300") 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:150215 Archived-At: On 2018-09-11 11:31 +0300, Eli Zaretskii wrote: [snipped 13 lines] > Thanks. Can you summarize how the behavior with your patch will be > different from what we had in Emacs 25 and before? 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. [snipped 6 lines] > 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)))) > > Thanks. Thanks. -Leo