From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andreas =?UTF-8?Q?R=C3=B6hler?= Newsgroups: gmane.emacs.bugs Subject: bug#21391: 24.5; `thing-at-point' should return a string Date: Tue, 15 Nov 2016 08:18:47 +0100 Message-ID: <8376278c-c1af-240e-25b1-d832baff7331@easy-emacs.de> References: <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> <838tsmhy54.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1479193902 24739 195.159.176.226 (15 Nov 2016 07:11:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 15 Nov 2016 07:11:42 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 Cc: 21391@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 15 08:11:33 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 1c6Xtj-0003W6-U9 for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Nov 2016 08:11:16 +0100 Original-Received: from localhost ([::1]:44611 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6Xtm-0008PN-UU for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Nov 2016 02:11:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6Xta-0008OR-0n for bug-gnu-emacs@gnu.org; Tue, 15 Nov 2016 02:11:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6XtW-0000K8-S1 for bug-gnu-emacs@gnu.org; Tue, 15 Nov 2016 02:11:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42277) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c6XtW-0000K4-OJ for bug-gnu-emacs@gnu.org; Tue, 15 Nov 2016 02:11:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c6XtW-0002tb-Ge for bug-gnu-emacs@gnu.org; Tue, 15 Nov 2016 02:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Nov 2016 07:11: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.147919382111066 (code B ref 21391); Tue, 15 Nov 2016 07:11:02 +0000 Original-Received: (at 21391) by debbugs.gnu.org; 15 Nov 2016 07:10:21 +0000 Original-Received: from localhost ([127.0.0.1]:57675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6Xsr-0002sQ-Di for submit@debbugs.gnu.org; Tue, 15 Nov 2016 02:10:21 -0500 Original-Received: from mout.kundenserver.de ([212.227.126.131]:60526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6Xsp-0002sD-Eb for 21391@debbugs.gnu.org; Tue, 15 Nov 2016 02:10:19 -0500 Original-Received: from [192.168.178.35] ([77.3.35.125]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.167]) with ESMTPSA (Nemesis) id 0M0dvG-1cvd4E1RMM-00utwp; Tue, 15 Nov 2016 08:10:12 +0100 In-Reply-To: <838tsmhy54.fsf@gnu.org> X-Provags-ID: V03:K0:JLsoaVrNaKQqS4DVPZ3M8ewqSRMD29ii1VHYY0USW70fmMh20go Akx+BzN6u6pDjAnpnXawdbevi6QCX2MPymOUCN569Sq9RlRQK0wqcgdfDRYjvooaRU5x4zp Ujc60OxxLH29KoRZmv27LQPMtV4qSJt7iPAWwsR1KMZ5IKrLDnbpSz2sRjSPi4hR6WCesxf E+rQftfrq36CN1sEL7fOg== X-UI-Out-Filterresults: notjunk:1;V01:K0:BUPbGeqmC60=:h0LzEGSt9ahfh091dbEfLs Z7Sep+3K5RYceAUtXsjbL2084MORTYKOT5Pr4UDghA2QYyT2qW109ahLr3qH7MDN04KoZ57Rz 6D74yM8Y/QLEj3qrA7kWO9BDGBoSTDs7t+UBtkCheOLqPEGcLjowSv8soh2G9DF9BWNsD6i3i es4N9PXUJn3S3Qgl9sZNt/t+L+HVpHLVvmTLUkhIO1yeTA6J0oobRHhrYS4x4MFVcU4u3WmUW 1b9JczbcHmYfWyBaMAa6Z8ZWgZSUM/+x7PR6urmxhRXWGmCjvXpQczVJl8BCXvv+g340vCXgQ BCt11QIMFK1ku/Usb6uhUytK1VhKATvipbEB/oiXA4lQLRuoLM6TNOPVdqz7fivDXGrt0xLpw 5sARoTpaCkHkCw6C5vqAyIKk5dT3DOQ71A1wK4Tomb3zumO6B2/5hzw0gwY/rghVL1fjHh8fz u0kAu7BsLt+H5d0Q92TRGB1x+yGhOjeJi9Em132s+xKjjlzv0JGOtR22cLIGMWfQ5EcF8+blE jbLo39IuCRFueJYdKPJYlspysM2OyUTKqW0eNtmAyTH7sdTNhPbDOeCnNeSasqintTE71Fi8i XyTTlKBnR3oHMJJIff8sTSxjA8La0+vNala4HS4lGrTdj855AN/X/nr4A4jF13mR31RopRU3G PNFxkLgzRJChSWXFRJZa/EI0zP8OvHgv+xxhvjdTnvk+bQe1ES9I2Ydz5G63UMXBrgwpK8UlE bWtvWDoAvRk4gOzT 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:125711 Archived-At: On 14.11.2016 16:36, Eli Zaretskii wrote: >> From: Andreas Röhler >> Date: Mon, 14 Nov 2016 11:26:54 +0100 >> >> IMHO the current design is really confusing and shouldn't be kept. > IMNSHO it would be madness to make incompatible changes 20 years after > the code was admitted into Emacs. > >> if (get thing 'thing-at-point) >> (funcall (get thing 'thing-at-point)) >> >> AFAIU an arbitrary function might be stored here, no real relation to >> thing-at-point at all. > Correct. We have gobs of functions that can return several different > kinds of objects. > >> Next clause deals with buffer-substring - which is thing-at-point about >> in my understanding. > IMO, your understanding is wrong at least since 1997. So lets have closer a look at thing-at-point, which under the hood is called also by list-at-point, form-at-point: ((text (if (get thing 'thing-at-point) (funcall (get thing 'thing-at-point)) (let ((bounds (bounds-of-thing-at-point thing))) (when bounds (buffer-substring (car bounds) (cdr bounds))))))) The second clause returns a string. All further deals with this string-var text AFAICS. That's why I'm calling the string the native return type here. The first clause was discussed above. Seeing just one use-case for now: (put 'email 'thing-at-point (lambda () (let ((boundary-pair (bounds-of-thing-at-point 'email))) (if boundary-pair (buffer-substring-no-properties (car boundary-pair) (cdr boundary-pair)))))) However, also returning a string. And definitely dressed up from behind.