From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#21391: 24.5; `thing-at-point' should return a string Date: Mon, 14 Nov 2016 10:54:30 -0800 (PST) Message-ID: References: <<<>>> <<<<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>>>> <<<>>> <<<<83y40sfyij.fsf@gnu.org>>>> <<<<76505436-e66c-0ed3-6d7a-ce654f38ef30@yandex.ru>>>> <<<<83bmxnfhbi.fsf@gnu.org>>>> <<<<73600483-1df5-597c-6066-232189bbdd4a@yandex.ru>>>> <<<<834m3ffeb9.fsf@gnu.org>>>> <<<>>> <<<<83twbfdvav.fsf@gnu.org>>>> <<<<73be4b9d-2df8-cc83-b873-398cb7dd043b@yandex.ru>>>> <<<<83pom3ds3e.fsf@gnu.org>>>> <<<>>> <<<>>> <<<<83bmxme12w.fsf@gnu.org>>>> <<<>>> <<<<834m3edqyr.fsf@gnu.org>>>> <<<<6dbea00c-3bde-6ec3-b109-7aa205bedb5f@yandex.ru>>>> <<<<8337iydq8z.fsf@gnu.org>>>> <<<>>> <<<<83y40qc9jv.fsf@gnu.org>>>> <<<>>> <<<>>> <<<<83a8d2hy8f.fsf@gnu.org>>>> <<<5a6ddd21-ebf9-42bf-9fb6-7fc9e037b3ed@default>>> <<<83zil2ggf7.fsf@gnu.org>>> <> <<83wpg6gc8h.fsf@gnu.org>> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1479149723 13390 195.159.176.226 (14 Nov 2016 18:55:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 14 Nov 2016 18:55:23 +0000 (UTC) Cc: tino.calancha@gmail.com, dgutov@yandex.ru, 21391@debbugs.gnu.org To: Eli Zaretskii , Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 14 19:55:19 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 1c6MPT-0002To-H9 for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Nov 2016 19:55:15 +0100 Original-Received: from localhost ([::1]:42060 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6MPW-0001ze-Je for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Nov 2016 13:55:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6MPL-0001ub-L5 for bug-gnu-emacs@gnu.org; Mon, 14 Nov 2016 13:55:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6MPG-0007dc-QR for bug-gnu-emacs@gnu.org; Mon, 14 Nov 2016 13:55:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41966) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c6MPG-0007dR-Ne for bug-gnu-emacs@gnu.org; Mon, 14 Nov 2016 13:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c6MPG-00019a-Er for bug-gnu-emacs@gnu.org; Mon, 14 Nov 2016 13:55: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, 14 Nov 2016 18:55:02 +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.14791496814393 (code B ref 21391); Mon, 14 Nov 2016 18:55:02 +0000 Original-Received: (at 21391) by debbugs.gnu.org; 14 Nov 2016 18:54:41 +0000 Original-Received: from localhost ([127.0.0.1]:57364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6MOv-00018m-Dv for submit@debbugs.gnu.org; Mon, 14 Nov 2016 13:54:41 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:45132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6MOt-00018V-J2 for 21391@debbugs.gnu.org; Mon, 14 Nov 2016 13:54:40 -0500 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uAEIsXw3016671 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Nov 2016 18:54:33 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id uAEIsWMt009050 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Nov 2016 18:54:32 GMT Original-Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uAEIsVq2011788; Mon, 14 Nov 2016 18:54:31 GMT In-Reply-To: <<83wpg6gc8h.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] 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:125699 Archived-At: > > All this just means that what you call the "caller", function > > `thing-at-point', >=20 > No, the caller is whoever calls thing-at-point the function. Only > that caller knows whether the text properties on any text the > function returns are wanted or not, which is why the caller can use the > NO-PROPERTIES argument to express the intent. I misspoke there. That is what I meant - the calling sequence, not the defun of `thing-at-point'. The point of the other approach is that if another function (on the THING-symbol property) determines the `thing-at-point' function behavior then that applies to a string value that it might return, as well. That enables a THING-specific behavior that can return a propertized string - yes, overriding callers that provide non-nil NO-PROPERTIES. IOW, with the other approach "the behavior is controlled by the symbol property, in addition to the `thing-at-point' defun." And that includes the part of the defun that tries to respect argument NO-PROPERTIES. It's a design choice. There is no golden rule about this. Emacs lets things that are outside a defun AND things that are outside a calling sequence change the behavior of a called function. There are umpteen ways that this is allowed, from binding variables around code that eventually calls "the caller" (reaching deep inside) to advising, to hooks, to, yes, fiddling with symbol properties. As I said, I'm fine with either approach. One gives some more control to the symbol property (which, remember, can be used by "calling" code and users). The other gives more control to a given call. And note, again, that if we got rid of the ill-designed NO-PROPERTIES arg then the behavior you prefer would be used: Calling code would remove properties separately, after the string is returned.