From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#9454: 24.0.50; thingatpt.el should be updated to respect field boundaries Date: Tue, 20 Aug 2019 08:26:34 -0700 (PDT) Message-ID: References: <44787C2CD18A4D45913B6FD72C387219@us.oracle.com> <87pnl0zh7f.fsf@mouse.gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="__156631479581221973abhmp0005.oracle.com" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="104551"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 9454@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 20 17:27:15 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i062T-000R46-UC for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Aug 2019 17:27:14 +0200 Original-Received: from localhost ([::1]:38628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i062S-0002HU-EJ for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Aug 2019 11:27:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34870) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i062L-0002Fv-61 for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2019 11:27:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i062K-0006m6-6Y for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2019 11:27:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53004) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i062K-0006lk-08 for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2019 11:27:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i062J-000063-IH for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2019 11:27:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Aug 2019 15:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9454 X-GNU-PR-Package: emacs Original-Received: via spool by 9454-submit@debbugs.gnu.org id=B9454.1566314806339 (code B ref 9454); Tue, 20 Aug 2019 15:27:02 +0000 Original-Received: (at 9454) by debbugs.gnu.org; 20 Aug 2019 15:26:46 +0000 Original-Received: from localhost ([127.0.0.1]:33592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0622-00005O-EH for submit@debbugs.gnu.org; Tue, 20 Aug 2019 11:26:46 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:37222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0620-000056-3i for 9454@debbugs.gnu.org; Tue, 20 Aug 2019 11:26:44 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x7KF8x7F032234; Tue, 20 Aug 2019 15:26:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type; s=corp-2019-08-05; bh=zGx25g4pelSTxPJUWds1ukE2qOgndnHd5KMus3LrTe8=; b=ekgsnzX5BLi4w0bDxf+U63IWEae/fK+yeNEFI041XlJhPcCeN3nMMNYH9aBcuLffTaOy Qoy0RaIGWwO34iujTdRM5nHt03VW2jmKvUGTIHTQfOaQylXfLcpjutOqLWYBvlUnan5O rBW1ggeUQZaFURr66Ykvr/o1iwadwvv8JrGaQE4Jzxb+d5TWOdTyqFiTAI6+MFWxIsVB nMjd4FwiM8EjKCWAbPl2Ub0R+woIFSvO7qAK8SmWbNM2jaEbn7ddo7SmH7x1FhwEKwno fAcUDePKakKyAjF+0nc4oxiExIyj1VYQiaD5F3kxa/06eLmS02LmFBI4KSqFojNcKXrM bg== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2ue90tf8m1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Aug 2019 15:26:37 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x7KF8H4b084601; Tue, 20 Aug 2019 15:26:37 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 2ug268u7b3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Aug 2019 15:26:36 +0000 Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x7KFQaoD029389; Tue, 20 Aug 2019 15:26:36 GMT In-Reply-To: <87pnl0zh7f.fsf@mouse.gnus.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4873.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9355 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=810 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908200147 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9355 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=874 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908200147 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: 209.51.188.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:165419 Archived-At: --__156631479581221973abhmp0005.oracle.com Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable > Do you have a test case to reproduce this bug? No. See the original report. It points you to my code that fixes the problem by sprinkling `constrain-to-field' everywhere. To give an idea, attached are two functions, my version and the vanilla version. Ediff them. See the additions of this: (constrain-to-field nil orig) I believe that the vanilla function needs similar protection. For you to decide. That's just one thingatpt.el function. I also added `constraint-to-field to other such functions. See thingatpt+.el if you want to see the occurrences, to maybe save some time when checking where thingatpt.el might need the same treatment. I think you get the idea. Thing-at-point should respect fields. Do it or don't do it; your choice. --__156631479581221973abhmp0005.oracle.com Content-Type: application/octet-stream; name="throw-my-thg.el" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="throw-my-thg.el" KGRlZnVuIHRhcC1ib3VuZHMtb2YtdGhpbmctYXQtcG9pbnQtMSAodGhpbmcpCiAgIkhlbHBlciBm b3IgYHRhcC1ib3VuZHMtb2YtdGhpbmctYXQtcG9pbnQnLgpEbyBldmVyeXRoaW5nIGV4Y2VwdCBo YW5kbGUgdGhlIG9wdGlvbmFsIFNZTlRBWC1UQUJMRSBhcmcuIgogIChsZXQgKChib3VuZHMtZm4g IChvciAoZ2V0IHRoaW5nICd0YXAtYm91bmRzLW9mLXRoaW5nLWF0LXBvaW50KQogICAgICAgICAg ICAgICAgICAgICAgICAoZ2V0IHRoaW5nICdib3VuZHMtb2YtdGhpbmctYXQtcG9pbnQpKSkpCiAg ICAoaWYgYm91bmRzLWZuCiAgICAgICAgKGZ1bmNhbGwgYm91bmRzLWZuKQogICAgICAobGV0ICgo b3JpZyAgKHBvaW50KSkpCiAgICAgICAgKGNvbmRpdGlvbi1jYXNlIG5pbAogICAgICAgICAgICAo c2F2ZS1leGN1cnNpb24KICAgICAgICAgICAgICA7OyBUcnkgbW92aW5nIGZvcndhcmQsIHRoZW4g YmFjay4KICAgICAgICAgICAgICAoZnVuY2FsbCAob3IgKGdldCB0aGluZyAnZW5kLW9wKSA7IE1v dmUgdG8gZW5kLgogICAgICAgICAgICAgICAgICAgICAgICAgICAobGFtYmRhICgpIChmb3J3YXJk LXRoaW5nIHRoaW5nIDEpKSkpCiAgICAgICAgICAgICAgKGNvbnN0cmFpbi10by1maWVsZCBuaWwg b3JpZykKICAgICAgICAgICAgICAoZnVuY2FsbCAob3IgKGdldCB0aGluZyAnYmVnaW5uaW5nLW9w KSA7IE1vdmUgdG8gYmVnLgogICAgICAgICAgICAgICAgICAgICAgICAgICAobGFtYmRhICgpIChm b3J3YXJkLXRoaW5nIHRoaW5nIC0xKSkpKQogICAgICAgICAgICAgIChjb25zdHJhaW4tdG8tZmll bGQgbmlsIG9yaWcpCiAgICAgICAgICAgICAgKGxldCAoKGJlZyAgKHBvaW50KSkpCiAgICAgICAg ICAgICAgICAoaWYgKDw9IGJlZyBvcmlnKQogICAgICAgICAgICAgICAgICAgIDs7IElmIHRoYXQg YnJpbmdzIHVzIGFsbCB0aGUgd2F5IGJhY2sgdG8gT1JJRywKICAgICAgICAgICAgICAgICAgICA7 OyBpdCB3b3JrZWQuICBCdXQgRU5EIG1heSBub3QgYmUgdGhlIHJlYWwgZW5kLgogICAgICAgICAg ICAgICAgICAgIDs7IFNvIGZpbmQgdGhlIHJlYWwgZW5kIHRoYXQgY29ycmVzcG9uZHMgdG8gQkVH LgogICAgICAgICAgICAgICAgICAgIDs7IEZJWE1FOiBpbiB3aGljaCBjYXNlcyBjYW4gYHJlYWwt ZW5kJyBkaWZmZXIgZnJvbSBgZW5kJz8KICAgICAgICAgICAgICAgICAgICAobGV0ICgocmVhbC1l bmQgIChwcm9nbiAoZnVuY2FsbAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAob3IgKGdldCB0aGluZyAnZW5kLW9wKQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoKSAoZm9yd2FyZC10aGluZyB0aGluZyAx KSkpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjb25zdHJh aW4tdG8tZmllbGQgbmlsIG9yaWcpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKHBvaW50KSkpKQogICAgICAgICAgICAgICAgICAgICAgKGFuZCAoPCBvcmlnIHJl YWwtZW5kKSAgKDwgYmVnIHJlYWwtZW5kKQogICAgICAgICAgICAgICAgICAgICAgICAgICAoY29u cyBiZWcgcmVhbC1lbmQpKSkKICAgICAgICAgICAgICAgICAgKGdvdG8tY2hhciBvcmlnKQogICAg ICAgICAgICAgICAgICA7OyBUcnkgYSBzZWNvbmQgdGltZSwgbW92aW5nIGZpcnN0IGJhY2t3YXJk IGFuZCB0aGVuIGZvcndhcmQsCiAgICAgICAgICAgICAgICAgIDs7IHNvIHRoYXQgd2UgY2FuIGZp bmQgYSB0aGluZyB0aGF0IGVuZHMgYXQgT1JJRy4KICAgICAgICAgICAgICAgICAgKGZ1bmNhbGwg KG9yIChnZXQgdGhpbmcgJ2JlZ2lubmluZy1vcCkgOyBNb3ZlIHRvIGJlZy4KICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIChsYW1iZGEgKCkgKGZvcndhcmQtdGhpbmcgdGhpbmcgLTEpKSkp CiAgICAgICAgICAgICAgICAgIChjb25zdHJhaW4tdG8tZmllbGQgbmlsIG9yaWcpCiAgICAgICAg ICAgICAgICAgIChmdW5jYWxsIChvciAoZ2V0IHRoaW5nICdlbmQtb3ApIDsgTW92ZSB0byBlbmQu CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobGFtYmRhICgpIChmb3J3YXJkLXRoaW5n IHRoaW5nIDEpKSkpCiAgICAgICAgICAgICAgICAgIChjb25zdHJhaW4tdG8tZmllbGQgbmlsIG9y aWcpCiAgICAgICAgICAgICAgICAgIChsZXQgKChlbmQgICAgICAgKHBvaW50KSkKICAgICAgICAg ICAgICAgICAgICAgICAgKHJlYWwtYmVnICAocHJvZ24gKGZ1bmNhbGwKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIChvciAoZ2V0IHRoaW5nICdiZWdpbm5pbmctb3Ap CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAo KSAoZm9yd2FyZC10aGluZyB0aGluZyAtMSkpKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKGNvbnN0cmFpbi10by1maWVsZCBuaWwgb3JpZykKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBvaW50KSkpKQogICAgICAgICAgICAgICAg ICAgIChhbmQgKDw9IHJlYWwtYmVnIG9yaWcpICAoPCBvcmlnIGVuZCkgICg8IHJlYWwtYmVnIGVu ZCkKICAgICAgICAgICAgICAgICAgICAgICAgIChjb25zIHJlYWwtYmVnIGVuZCkpKSkpKQogICAg ICAgICAgKGVycm9yIG5pbCkpKSkpKQ== --__156631479581221973abhmp0005.oracle.com Content-Type: application/octet-stream; name="throw-vanilla-thg.el" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="throw-vanilla-thg.el" KGRlZnVuIGJvdW5kcy1vZi10aGluZy1hdC1wb2ludCAodGhpbmcpCiAgIkRldGVybWluZSB0aGUg c3RhcnQgYW5kIGVuZCBidWZmZXIgbG9jYXRpb25zIGZvciB0aGUgVEhJTkcgYXQgcG9pbnQuClRI SU5HIHNob3VsZCBiZSBhIHN5bWJvbCBzcGVjaWZ5aW5nIGEgdHlwZSBvZiBzeW50YWN0aWMgZW50 aXR5LgpQb3NzaWJpbGl0aWVzIGluY2x1ZGUgYHN5bWJvbCcsIGBsaXN0JywgYHNleHAnLCBgZGVm dW4nLApgZmlsZW5hbWUnLCBgdXJsJywgYGVtYWlsJywgYHdvcmQnLCBgc2VudGVuY2UnLCBgd2hp dGVzcGFjZScsCmBsaW5lJywgYW5kIGBwYWdlJy4KClNlZSB0aGUgZmlsZSBgdGhpbmdhdHB0LmVs JyBmb3IgZG9jdW1lbnRhdGlvbiBvbiBob3cgdG8gZGVmaW5lIGEKdmFsaWQgVEhJTkcuCgpSZXR1 cm4gYSBjb25zIGNlbGwgKFNUQVJUIC4gRU5EKSBnaXZpbmcgdGhlIHN0YXJ0IGFuZCBlbmQKcG9z aXRpb25zIG9mIHRoZSB0aGluZyBmb3VuZC4iCiAgKGlmIChnZXQgdGhpbmcgJ2JvdW5kcy1vZi10 aGluZy1hdC1wb2ludCkKICAgICAgKGZ1bmNhbGwgKGdldCB0aGluZyAnYm91bmRzLW9mLXRoaW5n LWF0LXBvaW50KSkKICAgIChsZXQgKChvcmlnIChwb2ludCkpKQogICAgICAoaWdub3JlLWVycm9y cwoJKHNhdmUtZXhjdXJzaW9uCgkgIDs7IFRyeSBtb3ZpbmcgZm9yd2FyZCwgdGhlbiBiYWNrLgoJ ICAoZnVuY2FsbCA7OyBGaXJzdCBtb3ZlIHRvIGVuZC4KCSAgI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