From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74890: 31.0.50; (thing-at-point 'string) raises error Date: Mon, 16 Dec 2024 23:39:38 +0000 Message-ID: References: <874j352vwz.fsf@lco2.mail-host-address-is-not-set> <86cyhsre61.fsf@gnu.org> <86seqnpon5.fsf@gnu.org> Reply-To: Drew Adams Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21628"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "74890@debbugs.gnu.org" <74890@debbugs.gnu.org> To: Eli Zaretskii , Jean Louis Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 17 00:40:28 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tNKhP-0005T6-UT for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Dec 2024 00:40:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNKh3-0006Mf-C4; Mon, 16 Dec 2024 18:40:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNKh1-0006MP-Nl for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 18:40:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNKh0-0000md-J7 for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 18:40:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:In-Reply-To:References:Date:From:To:Subject; bh=7RbaickX+jBq5dTuDuc4V6WasUsm2Mp1d43NTmbOpaU=; b=T2/d0UO47CLeO6R9Qy+vQdPxKVoeKoXwWLllPx7w6ExpfhZTlhBbeTXyzhEHOCqR+U1qIbOxr228audS9lzXkPLz13Mddld/FGzxTbWS+bQWmZ8E0oL48fid8TrIUfO8xMu9fF7kaQER+n32c4JiQj/OQH/MNsi2fcJ/4EHVyPE3+WVqQPYJG7MzrH8c+zPezLJPmiQXomctmYJ8iChU19MaXTLFqiK4aHqmd77wH94eeBT9TKsOeTuWdV/DAY7McKNF9yegrTeLa6lRXgn50etY5OsSA0S56b6KKcP0qnE/Lk9BpSOlyJv3FtYvS0faMpJ7u4gbSj2XpoPlmZL01A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tNKh0-00010S-CW for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 18:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Dec 2024 23:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74890 X-GNU-PR-Package: emacs Original-Received: via spool by 74890-submit@debbugs.gnu.org id=B74890.17343923863838 (code B ref 74890); Mon, 16 Dec 2024 23:40:02 +0000 Original-Received: (at 74890) by debbugs.gnu.org; 16 Dec 2024 23:39:46 +0000 Original-Received: from localhost ([127.0.0.1]:56697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNKgk-0000zp-0O for submit@debbugs.gnu.org; Mon, 16 Dec 2024 18:39:46 -0500 Original-Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:24912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNKgh-0000ze-PV for 74890@debbugs.gnu.org; Mon, 16 Dec 2024 18:39:45 -0500 Original-Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BGMjWJW009798; Mon, 16 Dec 2024 23:39:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=7RbaickX+jBq5dTuDuc4V6WasUsm2Mp1d43NTmbOpaU=; b= DrT/YgGO7Juxa1YkxIBdjNH4oQ42go6698VRF1ButlnqEvQkOXvmsEVHuatq7Kq5 hjCD4PyZBkZuY4Y2BOMYKXODX935N1joTt1zMNW/CJHwlvTxpZrjimfvzKRSEX8f 9Qeogt6Kq1B+ZbTBMKYfrhPVCuwHcka2FP0bLvLv0cNaehUho811N1ywCuIr04Q9 b+ECipXqGvQRaRynNHV9Rh0aW4Q/2/Q4rh1OBd+g4Qt80C6y6wsrtQKmMwtSKDFV R2/L4RTFah4C4xS+kBMVkDZAjjqegQwJUQJHdu2b2054r9KrpSVEBK3sAAMpiYem f3bTdqZ0ByVDcQlU1k/vsA== Original-Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h22cmn6e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Dec 2024 23:39:41 +0000 (GMT) Original-Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BGLe0iI032638; Mon, 16 Dec 2024 23:39:41 GMT Original-Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2043.outbound.protection.outlook.com [104.47.66.43]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fdyvnb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Dec 2024 23:39:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EdCrtI4IRz9nZNVArOt+dTJLIv7u7y+qxVOUxe4dqBa0eT5A4GJjnk3zr6JLUBKA5Rpi58PoAtsB1kyoBbt8U3y+JUh0hJ2fBDcNgJMYOXkMZMakOkHaXTp3uToAzrXuywGloNT849WecTqO7gGtKcJzbrcu4aSBJL5FZa4bDmT/mwpmVYJ8nS4hB0F74rXG9UjL7eVjBoQatprkNS0uFenEBZf/1eoktwQ9iseznplvW1QtjnBoRjYPkcmoI3zE76jmQaWgUt4dNz6j5Seqfk0xrPPIuoc3B2WWhadZSuOl0STHL7orcFHVNsG5Tg4npaDkUR/TmE9+oe5yY6Gb8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7RbaickX+jBq5dTuDuc4V6WasUsm2Mp1d43NTmbOpaU=; b=LJcmnFKoLy30xIlBJ5eiDSTfW5u2PgjNLttKAYmMdvN20NfsfbLv4stWKSOjK+qJ+hOsFF9ZxxzrRLlXEdAnhMPKfwoJsdC1KOC6PtQyXsV1g+sMOR81dqy2xgcR3dQ8eYhe2mK++tEBGYxdt7FQOdu3cW3fJCtywE6q3BUYdq27Hn8xrra+ECbCM85/Wt3iR4PzWaYzSkb862i/Z4P6bTvgTLfBps9b5aEKwmuxlmmMNoHQwgwwLg5NcdGw1Q/TPI5bT3GFiXrvHhiArX7yk3om6gLsi8FMj/+1b33y4dIyMiytEyYGdbURcpppDJBwSsai37pAe3um6xFiv5Kncw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7RbaickX+jBq5dTuDuc4V6WasUsm2Mp1d43NTmbOpaU=; b=akSX7QCLsyrJPOdVzzm+F336RujVXzYpfY+R5GJVvlDMXSxQWVs9LniBcwsGGypByG5euOoPewsTKmqEe4jEg9BfoZJdwX+0D6HE0ugDDclVVArBfVeUXZ2Rkuv1zj8t1v3r1zhf6AlvZn8NkJ4RvBPEr9DTcMCPyafZ3L7ghBg= Original-Received: from DS7PR10MB5232.namprd10.prod.outlook.com (2603:10b6:5:3aa::24) by BY5PR10MB4370.namprd10.prod.outlook.com (2603:10b6:a03:20b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.20; Mon, 16 Dec 2024 23:39:39 +0000 Original-Received: from DS7PR10MB5232.namprd10.prod.outlook.com ([fe80::8303:658f:14f8:2324]) by DS7PR10MB5232.namprd10.prod.outlook.com ([fe80::8303:658f:14f8:2324%5]) with mapi id 15.20.8251.015; Mon, 16 Dec 2024 23:39:39 +0000 Thread-Topic: [External] : Re: bug#74890: 31.0.50; (thing-at-point 'string) raises error Thread-Index: AQHbT9lXxU40yWvZpE6LIgfxcec7KrLpd7ZQ In-Reply-To: <86seqnpon5.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DS7PR10MB5232:EE_|BY5PR10MB4370:EE_ x-ms-office365-filtering-correlation-id: 97925df5-a741-4c59-394d-08dd1e2ae834 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: 6mD5DJH5KN0NulTNQbAYFENCkaPD5vyoa8QGnjgRahk5VTjSOdwGX69n7V6JwNQ3Lzb9RITBWtQtgk1E9CO7hsFc4AKWmJuIC5fdupsDyHtx5VOnuMWASEPqqA0EcNwtV+NgaVPjEJvYKm9XYE2eI/izBG2gq3bJSR3vEfRI82WwEdoe/mhWFLTOWcUZ/zVipSO5b0QDDFNT2V9t3SdaGNyAKdu60N0mWUkhNWf2rFEINM5haPL0oRoh3sg9ueV+q0O9NEnZEFhHStvYrBD9emO0SKNkiXib2UL7wS6NSebvKw0XIiGO4PdYtHd+QHypwyv5h7AmW+6cQADvf387gfFwUMdcsTULls4TWCT5iS1qP7TuwqDY83e7FCDPT3pC30BLCgEygHrwQMoJovn4hK9FKOhrVWo2hcbUkQQDNBKuWtYtaU7055i9mvRXl/MDCyfNVH25bINYx0pnuyKCOJp6l+gImh67m2jYZeUKBlb21hJzKcK5vQ873gL1XlCgq0N8kYz29Vs//IkTxzQLPxXi69qjF6xtY2NB+v0wLfmp5BJLKybtAp3XfYCSzKnAriU23XxwyVigIe0A3NH9F04AVfBXlN2TC9e1l09ZMJdVd7P9s9JYLDAPY2wrNxWjWReGBHy8SqBsBdZQKdtTbE8D51S/cZn4Nrim4uat+weTQQZBL34lpLLr+UpSkR4aGxbDZ1ewbo86/C+8JiD3rTMdWnpOlWZgkaFJ26uvgYIcC9MHMubUW1jgQBF29 VegsQUBBrtOL0y3G/9LsGMKsb0qBBqWZR45KTWGIGBASQg6GpFxoRMdUUh63eotX+tvi9xezSTVd5GkrJjXl4yKOewN+JO9cNZ x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS7PR10MB5232.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: HPYbIXhTw4ej2+Fl7emiKuynDLWzXaBPDCTnZ3RWjVR/P/vr3tGDZJ9sIC9et7U2gNanK5IH8IJjSZnHWAWb7DBuC1R3L2tbhfnA41dLSaF+u+0J0UICNkkiKQ4MPoCAtCPbJP77XkbZirL04TnQ7HGOR9eMhwadFOymc15G8p3QM7jsCNG0DE6Fikbs8rtKXbFArT1J4Bvt/okgmsUH7KykyTivEWsGBMhrEiNJr8AAYrkDWKxDhDeZYc1KKBN7zQVtzNLIOVjb27zsrwO02Vv3yJvW0TqLLSBB/0lUv7Wq2MHjCbn/oZCJIzg2L4p39AgzEyeuxMbQA3uZsu+G0fDcd316V8D1+Oi9Q+v/jQpslZctF+nJMNWc1UvAVJ6S0BQMvrM+LPMGqOo5tdLGPSkT+8C8dyMJ0NP5tezBYT5l6hX+44il2QzT7JbJCgclNY5R9aZVtiz/de6sIVFRTlMny6rU7JjWDIlRyW+FIJGxPtO1bYgjQd3XtrEca5lYyZ0L/Svk0uZWKEb7wFQo0234pEIXkEFF3rLU01CN5GqgcA1bdZmNEpVkGLthcOg3OLy6ecjuu8sdB/DQmjIA0qMu9J4kQNyK4pKiw25i0KqwJNhTt4A30ni3sBLgLnd6hxQQg5oXYRBUYd6rGrvJH42yQSAnKYXd6AGc3W1uqIyvddG1O363wh+tIe1a9UpmwDp3OUbOsQSEty3WcTKdps8rBJld5YV/P7NTSbkATW4Z0ypPXaIVM9udk7 Zwr4G3jAdoXuU6Zz+6zlsILwIwipqShFslgCwYJ7nrCedsBBooSwHgoxPy5ogQEaI/Uhv8z48Hjy969eUn0dNmtrWVFZz/jwC9 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: bpU1s1+p9QNdINLAx8MNQrj2V6Tvy+oSgBGJWBG9viFKEUnY5juwFJxRQkU/Y9CIHrgSTt4XO4aqUE+nH1t4HV5ScZvF3R5Oxvc+QeBTyNm8QK09LT0HzBdBgo3oPiHHYhPfJGbaIqp7maor8uOdTRBK9Wgsw7Q93t7H78e8Q0H7ajT61a2Q2m9TSzbxx1X59N273WDvsNOik17E2vwKIICa6qw2Wexmzd/iPPzGkZJvrG3Oox7mL0KhjGcNBlrmCKzpTzcSXS6BHTXkObp5LMNSC/TRHc9a7mQLE8ty+jr36aK4fjTX3Nmr4u3p5XogCXFA3zNBFzU/mfruQOqA63o5pqRrJI9+H11o4XFLSH8S5P3WPjLZbSz+XP1oKeLDG9rKtW8kPILC5QQi9mPpXzYvc/cvGJKlyNnBJKPOVkKNyiqR1a+Wgv1/ntAKcMbYeECw7+J2/nkAWBXCvi6FxoDqk9JbHnv452KcHO8vc+8Jrsl6+b0gEqYh3WIyqB1GGlfzilVagC2g0dJLCPIv81ATtfhs/JYYy/UuesznRQk3xNZH4WqAs4ifzcR5gAmHKvqHjWRHf3g6rSq/tfzX2Cdf8k7GwOBFdnbG/xI+xng= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5232.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97925df5-a741-4c59-394d-08dd1e2ae834 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2024 23:39:38.9120 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: /qifUeevLKwEiQnPvbR3nwnSPRq4zvgQf2ZXpfYG0bxW/H+uWyHx4PQs5MhGNurbcWIrlqNbFuw4hBWG/LD74Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4370 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-16_10,2024-12-16_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412160193 X-Proofpoint-GUID: i084t3yE8RIO5XzkQBoglagGEnZezeSY X-Proofpoint-ORIG-GUID: i084t3yE8RIO5XzkQBoglagGEnZezeSY X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297239 Archived-At: > Until there's a recipe to reproduce this in "emacs -Q", I maintain > that this is not an Emacs bug, and should be closed. Which I will do > soon, unless a recipe is posted. Please feel free to close this bug. I thought that this return-nil-no-error behavior was new in Emacs 30. But I found that it was introduced in 28.1. All Emacs releases 20-27 return nil in the reported scenario (like Emacs 30+ will). I've changed my mind: I think that's the right behavior. I assume that the Emacs 28-29 behavior wasn't introduced intentionally but was an unintended regression - fixed in Emacs 30. [Note that the behavior is to return nil instead of returning the string that's just before point. That's the correct behavior, IMO, and it was the main point I was making earlier: Don't return a THING that's _before_ point and not _at_ point. At least for _string_ THINGs, vanilla Emacs is doing the right thing.] Jean: I've now adapted my code (thingatpt+.el) to use the Emacs 30 definition of `thing-at-point-bounds-of-string-at-point'. Please download the latest thingatpt+.el. and let me know if you see any problems with the fix. Thx. ___ However, since we're talking now about `thing-at-point-bounds-of-string-at-point': 1. I don't see why it should ever return a non-string sexp. E.g., the doc string includes this: "Prefer the enclosing string, with fallback on sexp at point." There's no vanilla code that even calls this function, so that return-a-non-string must have been something for which a use case was only imagined, and not for any existing use (?). (It's of course used by `bound-of-thing-at-point' when its arg is the symbol `string'. But grepping for its name and for "(thing-at-point 'string)" finds no hits.) I'm not even sure what kind of non-string sexp this is meant for. I tried lists, symbols, and numbers - just nil was returned, always. What's the use case for returning a non-string sexp? IOW, why do we cater to that case, when no string syntax is involved? It's the "else" clause of the `if' that I question: why include it? ;; At the beginning of the string (if (let ((ca (char-after))) (and ca (eq (char-syntax ca) ?\"))) (let ((bound (bounds-of-thing-at-point 'sexp))) (and bound (<=3D (car bound) (point)) (< (point) (cdr bound)) bound))) 2. (nit) I don't think it makes sense for the two functions `thing-at-point-bounds-of-string-at-point' and `thing-at-point-bounds-of-list-at-point' (and no other functions) to have this in their doc string: "[Internal function used by `bounds-of-thing-at-point'.]" Either all such `thing-at-point-bounds-of-*-at-point' functions should have it or none should. I think none should, because it's misleading. These _aren't_ internal functions. No more so than `yank' is an internal function of `delete-selection'. They're simply functions `put' on a THING name such as `string', for use by `bounds-of-thing-at-point'. And they can be used by any code that wants the bounds of a string, list, etc. directly, and doesn't necessarily want the text that's bounded.