From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#21391: 24.5; `thing-at-point' should return a string Date: Wed, 9 Nov 2016 02:04:20 +0200 Message-ID: References: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> <1773ab35-70b1-42f9-8a8b-fe07881487d1@default> <874m3krnb6.fsf_-_@gmail.com> <83a8dbiaps.fsf@gnu.org> <83pom7gjhl.fsf@gnu.org> <0a8d76e4-4d1b-a26d-2b76-a2d9384d9f72@yandex.ru> <83mvhbgitf.fsf@gnu.org> <25bb22e8-1388-275a-d0da-7e698acdf6da@yandex.ru> <83inrygggr.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1478649941 20638 195.159.176.226 (9 Nov 2016 00:05:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 9 Nov 2016 00:05:41 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 Cc: tino.calancha@gmail.com, 21391@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 09 01:05:32 2016 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 1c4GO8-0001rS-Ek for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 Nov 2016 01:05:12 +0100 Original-Received: from localhost ([::1]:36098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4GOB-0004Ya-F5 for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Nov 2016 19:05:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4GO1-0004X7-7v for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2016 19:05:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4GNy-0007E3-3P for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2016 19:05:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34765) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c4GNx-0007Dt-VW for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2016 19:05:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c4GNx-0008PA-Jd for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2016 19:05:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Nov 2016 00:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21391 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21391-submit@debbugs.gnu.org id=B21391.147864987032269 (code B ref 21391); Wed, 09 Nov 2016 00:05:01 +0000 Original-Received: (at 21391) by debbugs.gnu.org; 9 Nov 2016 00:04:30 +0000 Original-Received: from localhost ([127.0.0.1]:50164 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4GNS-0008OP-Gd for submit@debbugs.gnu.org; Tue, 08 Nov 2016 19:04:30 -0500 Original-Received: from mail-wm0-f45.google.com ([74.125.82.45]:37319) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4GNQ-0008OB-Fu for 21391@debbugs.gnu.org; Tue, 08 Nov 2016 19:04:28 -0500 Original-Received: by mail-wm0-f45.google.com with SMTP id t79so270434208wmt.0 for <21391@debbugs.gnu.org>; Tue, 08 Nov 2016 16:04:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=wNrQbOC4V97pv1BrWSVHGgCMB4eF0d1MA54bUm3aQ+0=; b=BiMyvkEs2qYlPEMhq442kR9SHqo6iuXB1OJbBj3grAIdkgumrrsaqNTb8Gu3A0IQLY +8vXnm4+A87+hPnHHGBa0YeT9jErfjWg7gyoFoOb14A1lchIASqlBRgG1Bo6dBEaQ+G5 siNotH1+p4alWEvUq5B2BLw81yc9WG6AH8yGAjV6ENhLiRptPM9a9/gdT7Y+mC84Oh6A gHuIUAyiCMclSGx4n2rUxmEjsSxK2YBkxHPYAq1j86Posjt44JPutfpulIyrg7sH+Qee Fwt5szKVncV2XBMG9R7nYDVL0BmLX4qwM3AdNqd2xrXlZ4mCaUBde0FoEVe5k9OGJHuF DdJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wNrQbOC4V97pv1BrWSVHGgCMB4eF0d1MA54bUm3aQ+0=; b=alGL7c00rMat3sDdyAYUiUYmbCYGmBVfF9o2PXWGm0qJmuEO2h3pYQFdPZtdT3L5Fs 6BUlJQKz7PB0lPxIVkxhLnfeRRMp5nTHSqKY232Nv+NNIbZIgNbWatDSomXF4sSpNuEE M3WSRXzVA0vG/GWx1kLsjdxvMJWjS5jUqRHG1j1feypXhif3Md4D/LgCtWVTgZ69bOmr hYSGWxfbO0r/aju/L/WbTHCm6LMoU0XRlS3SBfZ/TOVLGslH+CB1tHCBqb1TkslbGSB/ q1jiOQfRZ3Vow+Jg/ewOePR5EPqjSaicZ4/0iJk2cCN1g3nLWi//2U7ues9xR5ohtZmY 2ABQ== X-Gm-Message-State: ABUngvcGElrQD298C4R+ju2/qFaL+YZhxSPGBS0sskSS+N3zCxwS9tIEOudnOuTygF3Ltw== X-Received: by 10.28.216.65 with SMTP id p62mr16900364wmg.92.1478649862800; Tue, 08 Nov 2016 16:04:22 -0800 (PST) Original-Received: from [192.168.1.3] ([185.105.173.41]) by smtp.googlemail.com with ESMTPSA id y2sm39758096wjx.20.2016.11.08.16.04.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Nov 2016 16:04:22 -0800 (PST) In-Reply-To: <83inrygggr.fsf@gnu.org> Content-Language: en-US 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:125501 Archived-At: On 08.11.2016 17:05, Eli Zaretskii wrote: > But then somehow the discussion shifted to be about whether to _force_ > thing-at-point value to be a string, even if it isn't for some reason. I'd suggest trying to fix that from the other end, as one alternative. If we agree that the return value of thing-at-point should be a string, (get 'number 'thing-at-point) can't return `number-at-point', it should return a function that will return the said number as a string. And of all things enumerated in thing-at-point's docstring, IIUC only number has such problem. Which leaves third-party things, but, they will either need to be fixed, or people will have to remain content not to use thing-at-point with NO-PROPERTIES argument on them. > I don't understand the rationale for such a change. Yes, > thing-at-point was most probably always meant to return a string. > Yes, Lisp code that causes it to return some other object is probably > wrong. However, the change that allowed this was introduced 19 years > ago; who knows what code out there actually uses this loophole? I can't imagine that loophole to be too useful. The proposal above should leave all such uses of third-party things alone. But yes, anyone who uses (thing-at-point 'number) as a (longer, pointless) substitute for (number-at-point) will have to change their code. > If > there is such code, why would we want to break it? To what end? And > if no code uses this loophole, why do we care that it exists? To make thing-at-point behavior more consistent. This kind of thing is usually performed with future new uses in mind. But it also might help with code maintenance a bit, for existing users (not likely to make much of a difference, but still; the danger of breakage is not very significant either). > IOW, thing-at-point no longer has any known bugs, and we are talking > about forcibly breaking a use case that does no harm to us, and can > only happen if someone abuses the 'thing-at-point' property, which > would make it that someone's bug/misfeature, for them to fix. Yes. The fix is very easy, though, for projects that retain at least somewhat active maintainer.