From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 31 21:56:34 2015 Received: (at submit) by debbugs.gnu.org; 1 Sep 2015 01:56:34 +0000 Received: from localhost ([127.0.0.1]:44507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZWaoL-00016z-In for submit@debbugs.gnu.org; Mon, 31 Aug 2015 21:56:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34027) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZWaoJ-00016r-Fs for submit@debbugs.gnu.org; Mon, 31 Aug 2015 21:56:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWaoH-0006eI-VR for submit@debbugs.gnu.org; Mon, 31 Aug 2015 21:56:30 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:50936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWaoH-0006eE-SM for submit@debbugs.gnu.org; Mon, 31 Aug 2015 21:56:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWaoG-0007m1-O2 for bug-gnu-emacs@gnu.org; Mon, 31 Aug 2015 21:56:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWaoD-0006d3-IJ for bug-gnu-emacs@gnu.org; Mon, 31 Aug 2015 21:56:28 -0400 Received: from calancha-ilc.kek.jp ([130.87.234.234]:33126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWaoC-0006c8-Vs for bug-gnu-emacs@gnu.org; Mon, 31 Aug 2015 21:56:25 -0400 Received: by calancha-ilc.kek.jp (Postfix, from userid 500) id 2D844B37A; Tue, 1 Sep 2015 10:59:30 +0900 (JST) Received: from localhost (localhost [127.0.0.1]) by calancha-ilc.kek.jp (Postfix) with ESMTP id 132A4B377; Tue, 1 Sep 2015 10:59:30 +0900 (JST) Date: Tue, 1 Sep 2015 10:59:30 +0900 (JST) From: Tino Calancha X-X-Sender: calancha@calancha-ilc.kek.jp To: bug-gnu-emacs@gnu.org Subject: 24.5; `thing-at-point' returns error when called with arguments 'number t Message-ID: User-Agent: Alpine 2.20 (LRH 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="1468197610-1549670963-1441072770=:5317" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: "C. Calancha" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --1468197610-1549670963-1441072770=:5317 Content-Type: text/plain; format=flowed; charset=US-ASCII (thing-at-point 'number t) fails (thing-at-point 'number nil) OK The former case call `length' with a non sequence argument. In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23) of 2015-08-30 on calancha-ilc.kek.jp System Description: Scientific Linux release 6.7 (Carbon) Configured using: `configure --with-gif=no' Important settings: value of $LANG: en_US.utf8 value of $XMODIFIERS: @im=none locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils xterm time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 75908 4118) (symbols 48 17587 0) (miscs 40 31 88) (strings 32 9018 4405) (string-bytes 1 248942) (vectors 16 7095) (vector-slots 8 341333 33198) (floats 8 65 260) (intervals 56 156 0) (buffers 960 11) (heap 1024 22077 2012)) --1468197610-1549670963-1441072770=:5317 Content-Type: text/plain; charset=US-ASCII; name=thingatpt.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=thingatpt.patch LS0tIHRoaW5nYXRwdC5lbAkyMDE1LTA5LTAxIDEwOjQ5OjAzLjE2OTc0NzQ4 OCArMDkwMA0KKysrIHRoaW5nYXRwdF9wYXRjaGVkLmVsCTIwMTUtMDktMDEg MTA6NTA6MTguODk2NzQ3NDgwICswOTAwDQpAQCAtMTQ1LDcgKzE0NSw3IEBA DQogICAgICAgICAgICAobGV0ICgoYm91bmRzIChib3VuZHMtb2YtdGhpbmct YXQtcG9pbnQgdGhpbmcpKSkNCiAgICAgICAgICAgICAgKHdoZW4gYm91bmRz DQogICAgICAgICAgICAgICAgKGJ1ZmZlci1zdWJzdHJpbmcgKGNhciBib3Vu ZHMpIChjZHIgYm91bmRzKSkpKSkpKQ0KLSAgICAod2hlbiAoYW5kIHRleHQg bm8tcHJvcGVydGllcykNCisgICAgKHdoZW4gKGFuZCB0ZXh0IChzZXF1ZW5j ZXAgdGV4dCkgbm8tcHJvcGVydGllcykNCiAgICAgICAoc2V0LXRleHQtcHJv cGVydGllcyAwIChsZW5ndGggdGV4dCkgbmlsIHRleHQpKQ0KICAgICB0ZXh0 KSkNCiANCg== --1468197610-1549670963-1441072770=:5317-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 05 04:23:34 2015 Received: (at 21391-done) by debbugs.gnu.org; 5 Sep 2015 08:23:34 +0000 Received: from localhost ([127.0.0.1]:49351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZY8l3-0005Uw-TD for submit@debbugs.gnu.org; Sat, 05 Sep 2015 04:23:34 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:38462) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZY8l0-0005Un-Kf for 21391-done@debbugs.gnu.org; Sat, 05 Sep 2015 04:23:32 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NU700J0038PJ400@a-mtaout22.012.net.il> for 21391-done@debbugs.gnu.org; Sat, 05 Sep 2015 11:23:29 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NU700JBG3B4HE20@a-mtaout22.012.net.il>; Sat, 05 Sep 2015 11:23:29 +0300 (IDT) Date: Sat, 05 Sep 2015 11:23:35 +0300 From: Eli Zaretskii Subject: Re: bug#21391: 24.5; `thing-at-point' returns error when called with arguments 'number t In-reply-to: X-012-Sender: halo1@inter.net.il To: Tino Calancha Message-id: <837fo58ebc.fsf@gnu.org> References: X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 21391-done Cc: 21391-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Tue, 1 Sep 2015 10:59:30 +0900 (JST) > From: Tino Calancha > Cc: "C. Calancha" > > (thing-at-point 'number t) fails > (thing-at-point 'number nil) OK > > The former case call `length' with a non sequence argument. Thanks, fixed. From unknown Sat Aug 16 18:46:14 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 03 Oct 2015 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 13 02:56:01 2016 Received: (at control) by debbugs.gnu.org; 13 Oct 2016 06:56:01 +0000 Received: from localhost ([127.0.0.1]:53675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buZvt-000802-CX for submit@debbugs.gnu.org; Thu, 13 Oct 2016 02:56:01 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:33368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buZvs-0007zq-3q for control@debbugs.gnu.org; Thu, 13 Oct 2016 02:56:00 -0400 Received: by mail-pf0-f179.google.com with SMTP id 128so31198706pfz.0 for ; Wed, 12 Oct 2016 23:56:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:message-id:user-agent:mime-version; bh=FAmfEbTobcCSbEm9zrIHBkysK5+rSrBok3MRtwuoqhw=; b=suuL05TjZ2rTYEx1RzwPpIifC2/L2x+9e4uFaOe8h8t+qlFrlZcmx/l6HypPcfYHge xN1NbMJSRaSkBr2hGDysbZ3OCi1L9STG7jMPUWq6xzJtpWVeGV8fUJmloyllaBXudrjO H3HMqxwSkecCdCfLyJcomAPaVdX13AhgswHKt9RV++dGqeOAVzqy12nb2eHhIa4K9+Ri 99ImTlMbrOWzrNaNBQrBfbejSjyMETzajhMx3cjNTdgbmTqZ282svcw7Am3oP9+HcabZ nd9cmt7c9FXJHvuA2hNmAzrRE7KL+DuDUUCkUc+rQlGAXZXJ/D2dMiOLJIo01osA/Z+c prfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:message-id:user-agent:mime-version; bh=FAmfEbTobcCSbEm9zrIHBkysK5+rSrBok3MRtwuoqhw=; b=YmlSwy6SSc0gd1UOgjt+W5xEIhhBqbaSYt5L5LmZKyzhqOioZFMKVl/ycZvIV6Zdk8 OkcEhPCH/rDoyX4AyjcNQScsiLuw3EGa+slczORiOvMztn35AfOCBKxPLSXU9nLACV63 dNjNICSG+V597Yg/CFq+U9OXB82AUImB6GwMGTYJMZy75VZ3tOsH9+N+i9nNyZOKuCUY fTfI19W2fWJoB5bBGumrBiTA8ndI9kg+1HvsdcYeIlbuZA+Mxm0EV82zpwG1mnrwlOO2 8XX/Pi7YH+eAarN4RWHTK+r1dMguEF2slEpREcrIqw6rUUQT7TdV7yygVxjA/+eW0Emt Z1YQ== X-Gm-Message-State: AA6/9Rkxl0PXGVyX5CHnqIVZ0Yf4AJ0nkRqCNzwjciMoVmaB14Dq5S0AHU1GBFX3yLxwuQ== X-Received: by 10.98.74.12 with SMTP id x12mr7779569pfa.140.1476341754165; Wed, 12 Oct 2016 23:55:54 -0700 (PDT) Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id sa1sm16603978pac.34.2016.10.12.23.55.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Oct 2016 23:55:53 -0700 (PDT) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Thu, 13 Oct 2016 15:55:51 +0900 (JST) X-X-Sender: calancha@calancha-pc To: control@debbugs.gnu.org Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: unarchive 21391 [...] Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tino.calancha[at]gmail.com) -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.179 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.192.179 listed in list.dnswl.org] 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [209.85.192.179 listed in dnsbl.sorbs.net] 0.0 TVD_SPACE_RATIO No description available. 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: unarchive 21391 [...] Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.179 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.192.179 listed in list.dnswl.org] 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [209.85.192.179 listed in dnsbl.sorbs.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tino.calancha[at]gmail.com) 0.0 TVD_SPACE_RATIO No description available. 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid unarchive 21391 From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 13 03:00:12 2016 Received: (at 21391) by debbugs.gnu.org; 13 Oct 2016 07:00:12 +0000 Received: from localhost ([127.0.0.1]:53680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buZzv-0008HX-S7 for submit@debbugs.gnu.org; Thu, 13 Oct 2016 03:00:12 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:36448) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buZzt-000895-Qn for 21391@debbugs.gnu.org; Thu, 13 Oct 2016 03:00:10 -0400 Received: by mail-pa0-f68.google.com with SMTP id os4so298497pac.3 for <21391@debbugs.gnu.org>; Thu, 13 Oct 2016 00:00:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:user-agent:mime-version; bh=u0Ky/eDk1+SdI+TAwiwT1ZFIeyHNECMivuhCyQbzhpM=; b=xNV5O6U+OjiBwm47xEyMK30XFKsnofxzqMexlkg7bLDdNOP35V7cdF9QTgbft9Ji5R JLm+RQdDmD8V3vDyN4pKRSRmBrMdp9du/emH80Y1CFA3L56uBccg1qPD/D5yLHdhI3kX LOoMMaucmcv0LC3rYYy/kdB8ZGhVx8obcMhiSYV2NU0GujgRRQLDrG2OpRW2mSxAEhNF FuELkGVHiMUPUVZngEHve5aHyB/S5WKFVxvsazYk5bTPYQMieDEp//43YtQMa2r2g8WD +gon8JRBmgcyMan+INJr2OaVDHXzD1N7xUcq/Yxok7CJKMSOUZZD7t757qc/jU7RWW+e KMbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:message-id:user-agent :mime-version; bh=u0Ky/eDk1+SdI+TAwiwT1ZFIeyHNECMivuhCyQbzhpM=; b=PRitFGzPZNCU1kWchKbV8H469VN+6v+OdIyde3wP/Sq+I9LcWqZUfrWUyPa72U9fyh PBhQ5z7w0Q2oWyY5o8ax4NwkfvuwN1IDfOBgT/YaART09yvuti90fVXJNUJ5wTqKJrEb INAwIi2wv63+Y6ZCUZ1phj6T7Al6auYDmmy7uw0AaV8+lkSkv01UfjKYQNwUH4kp8BLH v3+IaCcEjhi3qv8LBdtt1vrfoKT1ToPwreL3JmRV8fO3cliDEqKSMsDRKgt9FQQsFU80 AgVYk+LOlPfA6rTTeyyTtlEt4DRRuhqhZVmJzX3m4afaFXAcqTWIsUjw3UAoVlH2tOA/ K3cw== X-Gm-Message-State: AA6/9Rm9F6yC3YZtAK86dWijtfUvR4GXl+rishHnjQRkx5HfOr8uclM3tGKsYs2g4M/OOg== X-Received: by 10.66.152.200 with SMTP id va8mr6621310pab.12.1476342004278; Thu, 13 Oct 2016 00:00:04 -0700 (PDT) Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id l2sm16726275pav.7.2016.10.13.00.00.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Oct 2016 00:00:03 -0700 (PDT) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Thu, 13 Oct 2016 16:00:01 +0900 (JST) X-X-Sender: calancha@calancha-pc To: 21391@debbugs.gnu.org Subject: Re: bug#21391: 24.5; `thing-at-point' returns error when called with arguments 'number t) Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 21391 Cc: Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Using `sequencep' looks too general here: `set-text-properties' justs accepts as arg OBJECT an string or a buffer. The case of interest for this function seems when text satisfy `stringp'. We might want to do in the future (or some 3rd party code) something like: (put 'list 'thing-at-point 'list-at-point) In that case, 'text' would satisfy `listp', so it would satisfy `sequencep' as well: we would then call `set-text-properties' with arg OBJECT being a list, which signals an error. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >From 346ce0fcf3665ebfb24303763e2372551b33a1ae Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Thu, 13 Oct 2016 15:45:02 +0900 Subject: [PATCH] thing-at-point: Delete text properties only if text is a string * lisp/thingatpt.el (thing-at-point): Delete text properties only when text is an string (Bug#21391). --- lisp/thingatpt.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index 6d1014b..2fd51e6 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -145,7 +145,7 @@ thing-at-point (let ((bounds (bounds-of-thing-at-point thing))) (when bounds (buffer-substring (car bounds) (cdr bounds))))))) - (when (and text no-properties (sequencep text)) + (when (and text no-properties (stringp text)) (set-text-properties 0 (length text) nil text)) text)) -- 2.9.3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; In GNU Emacs 26.0.50.16 (x86_64-pc-linux-gnu, GTK+ Version 3.22.1) of 2016-10-13 built on calancha-pc Repository revision: 1dd54e3eef7543720eff161457677a35fae2435c From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 04 12:31:49 2016 Received: (at 21391) by debbugs.gnu.org; 4 Nov 2016 16:31:49 +0000 Received: from localhost ([127.0.0.1]:44806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2hPB-0000Vo-A6 for submit@debbugs.gnu.org; Fri, 04 Nov 2016 12:31:49 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:19455) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2hP9-0000Vb-Cf for 21391@debbugs.gnu.org; Fri, 04 Nov 2016 12:31:47 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uA4GVfH2023627 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 4 Nov 2016 16:31:41 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id uA4GVd40015316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 4 Nov 2016 16:31:41 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id uA4GVdRJ008516; Fri, 4 Nov 2016 16:31:39 GMT MIME-Version: 1.0 Message-ID: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> Date: Fri, 4 Nov 2016 09:31:38 -0700 (PDT) From: Drew Adams To: Tino Calancha , 21391@debbugs.gnu.org Subject: RE: bug#21391: 24.5; `thing-at-point' returns error when called with arguments 'number t) References: In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Spam-Score: -4.6 (----) X-Debbugs-Envelope-To: 21391 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.6 (----) Tino is right. The mistake behind the handling of optional arg NO-PROPERTIES (which was added in Emacs 24.4) is to assume that `thing-at-point' returns a string. This is a common misconception. It can return anything that Emacs Lisp can return. emacs -Q M-x load-library thingatpt M-: (put 'list 'thing-at-point (lambda () '(1 2 3 4))) In *scratch*: C-x h C-w M-: (insert "(foo)") M-x goto-char 2 M-: (thing-at-point 'list) ; =3D> (1 2 3 4) M-: (thing-at-point 'list t) ; =3D> error raised The proper test is not `sequencep', but either `stringp' or (or (stringp text) (buffer-live-p text)). This is obvious from just the signature of `set-text-properties'. And "text" should be renamed accordingly - it is a THING, not necessarily text. [And I disagree that the doc string should say that THING specifies a type of "syntactic" entity. It should say that THING specifies a type of thing that can be manipulated by Emacs Lisp. You could say a type of Lisp object, but it could be, say, a file (not just a file name).] From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 04 14:23:33 2016 Received: (at submit) by debbugs.gnu.org; 4 Nov 2016 18:23:33 +0000 Received: from localhost ([127.0.0.1]:44989 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2j9J-00039a-Kv for submit@debbugs.gnu.org; Fri, 04 Nov 2016 14:23:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60809) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2j9I-00039O-EJ for submit@debbugs.gnu.org; Fri, 04 Nov 2016 14:23:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2j9C-00035b-Je for submit@debbugs.gnu.org; Fri, 04 Nov 2016 14:23:27 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_50,RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49512) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c2j9C-00035P-GU for submit@debbugs.gnu.org; Fri, 04 Nov 2016 14:23:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2j9B-0005fq-JP for bug-gnu-emacs@gnu.org; Fri, 04 Nov 2016 14:23:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2j97-0002zl-H9 for bug-gnu-emacs@gnu.org; Fri, 04 Nov 2016 14:23:25 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:51058) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c2j97-0002yW-7P for bug-gnu-emacs@gnu.org; Fri, 04 Nov 2016 14:23:21 -0400 Received: from [192.168.178.35] ([77.12.33.84]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0MSao8-1cRznv1O4K-00RZJj for ; Fri, 04 Nov 2016 19:23:19 +0100 Subject: Re: bug#21391: 24.5; `thing-at-point' returns error when called with arguments 'number t) To: bug-gnu-emacs@gnu.org References: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Message-ID: <6d4d9469-5698-d522-ac3d-3f540b1c14b3@easy-emacs.de> Date: Fri, 4 Nov 2016 19:31:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:FBmqlc39u86NCgsTvzKH+OnwLic6AcRd8zXGDYxO/Slr+SI0ang 2kajwKG9PNqKb6gnX24w+FhZFhR0dicGHrdNxo5uuqGqWt3R5K+JW99h9mxIcUw0xAlwAb0 /PtWhuGo2iPWXRvMqYlg6jv8Wmw7O0RmIn5VMmBClstKUjs9x0VfI+amsKIAxH9Ew1lQEfx KEOaeLJewl9z96bPJ/NSg== X-UI-Out-Filterresults: notjunk:1;V01:K0:3MP8oWMu6vM=:JafBWvoIo6MCHF5ko0LvyO ZELG7zatRKEOg6CLJ1E64Y+dOcyOHevaypDXMfGFeMWXbxmiX/8KKtRlnqG7Nwk9EdbK1SWZK dzTujYjDmTpNmKUGwuz5m61jj85TLU2tlLvSGo5gAyFydCMkYdqBl6LR7fFLAbrfz94LuOE0b d0+dndZN/iBZ3PXFQxn/Tk8DcAtjuldhVLBx1pDGC8TgPLw14f08tJiu44X2vXhFFXqBvqUVj NbigKze+bU2Qjk1ef0L5cj2CY3KYoNhP8fjwHc+B8UFjk3H7e8kub37zzmxu0FUW6j4JnIcIE dVfBMbiglD9pcFb6aGSC9ofXWxWPN2C4N1DF3RfiDfNT7YL/RLYC2bEKBcEvvvXIKyuoMXgBA XyA24P9s7viJvURVTLX2bLUwCayhuY7VtEn/4nd36O/Ppz9CuLw67wlHTSzHicy1XFzV3uh3l qhhD7CQ22KdBYxDK6ntskKLXL6JXHKm5eDCw8upxBitqz55XWmYX38EYuasbCgSMdDsr9sdgy e1OHqGVIq0ZdgtQriyeN+rsib9t7qWS8Ij7tZwwm0tIdtW4qJzLQG4ssGYWp9aEnn9phpGDvh T9fFqzwZ+yphr+FRjc71/Qh3CpwInLyDm35zuadB54tK/+jyzXtU8jhQFRbd9D+oqOGe0zfmd dFHhTG0YBmfpmD4tPVg7Tw3t6VinbZKrVUbB89IlkOJKoXWRL6j25hZd040906sGmukaIHZCF f0SwlnTh2ieUWGlD X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.5 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.5 (----) On 04.11.2016 17:31, Drew Adams wrote: > Tino is right. The mistake behind the handling of optional arg > NO-PROPERTIES (which was added in Emacs 24.4) is to assume that > `thing-at-point' returns a string. This is a common misconception. > It can return anything that Emacs Lisp can return. Is there a need to pick symbols from a buffer as symbols? Don't know. My use-case is editing and strings are the suitable format. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 04 15:27:34 2016 Received: (at 21391) by debbugs.gnu.org; 4 Nov 2016 19:27:34 +0000 Received: from localhost ([127.0.0.1]:45061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2k9G-0004kx-7Q for submit@debbugs.gnu.org; Fri, 04 Nov 2016 15:27:34 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:44070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2k9E-0004kg-Im for 21391@debbugs.gnu.org; Fri, 04 Nov 2016 15:27:32 -0400 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 uA4JRPLs003028 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 4 Nov 2016 19:27:25 GMT 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 uA4JROGb005154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 4 Nov 2016 19:27:25 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uA4JRONG016293; Fri, 4 Nov 2016 19:27:24 GMT MIME-Version: 1.0 Message-ID: <295cccf3-bb80-4cde-bcdb-5137333cc1ed@default> Date: Fri, 4 Nov 2016 12:27:23 -0700 (PDT) From: Drew Adams To: =?utf-8?B?QW5kcmVhcyBSw7ZobGVy?= , 21391@debbugs.gnu.org Subject: RE: bug#21391: 24.5; `thing-at-point' returns error when called with arguments 'number t) References: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> <6d4d9469-5698-d522-ac3d-3f540b1c14b3@easy-emacs.de> In-Reply-To: <6d4d9469-5698-d522-ac3d-3f540b1c14b3@easy-emacs.de> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: 21391 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) > > Tino is right. The mistake behind the handling of optional arg > > NO-PROPERTIES (which was added in Emacs 24.4) is to assume that > > `thing-at-point' returns a string. This is a common > > misconception. It can return anything that Emacs Lisp can > > return. >=20 > Is there a need to pick symbols from a buffer as symbols? > Don't know. My use-case is editing and strings are the suitable > format. Of course there is. And not just symbols, but numbers, lists... People too often misunderstand thing-at-point as being only something to grab text at point to serve as a default value for reading input. There are any number of reasons to determine whether there is a thing of a given type at point, and to retrieve it if so. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 04 16:03:52 2016 Received: (at 21391) by debbugs.gnu.org; 4 Nov 2016 20:03:52 +0000 Received: from localhost ([127.0.0.1]:45090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2kiO-0005ds-G5 for submit@debbugs.gnu.org; Fri, 04 Nov 2016 16:03:52 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:34492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2kiN-0005de-6p for 21391@debbugs.gnu.org; Fri, 04 Nov 2016 16:03:51 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uA4K3iJU003138 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 4 Nov 2016 20:03:44 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id uA4K3h5Z010697 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 4 Nov 2016 20:03:44 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id uA4K3fcN004782; Fri, 4 Nov 2016 20:03:42 GMT MIME-Version: 1.0 Message-ID: <1773ab35-70b1-42f9-8a8b-fe07881487d1@default> Date: Fri, 4 Nov 2016 13:03:40 -0700 (PDT) From: Drew Adams To: Tino Calancha , 21391@debbugs.gnu.org Subject: RE: bug#21391: 24.5; `thing-at-point' returns error when called with arguments 'number t) References: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> In-Reply-To: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Spam-Score: -4.6 (----) X-Debbugs-Envelope-To: 21391 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.6 (----) Sorry, but I confused things further, I'm afraid. `thing-at-point' should always return a string. `list-at-point', `form-at-point', etc. are a different story - they can return anything. The problem with the code of `thing-at-point' is not where it has been identified so far. The problem is that if THING has property `thing-at-point', and if that function returns something that is not a string, then `set-text-properties' raises an error. A proper fix is to convert the result returned by (funcall (get thing 'thing-at-point)) to a string. For that, you can use (format "%s" thing). FWIW, this is the code that I use (prefix `tap-' is for the package). Note that the doc string's first line says that what is returned is a string. (defun tap-thing-at-point (thing &optional no-properties syntax-table) "Return the THING at point as a string. If no THING is present at point then return nil. THING is an Emacs Lisp symbol that specifies a type of syntactic entity. THING examples include `symbol', `list', `sexp', `defun', `filename', `url', `email', `word', `sentence', `whitespace', `line', `number', and `page'. See the commentary of library `thingatpt.el' for how to define a symbol as a valid THING. If THING has property `thing-at-point' then the property value should be a function. The function is called with no arguments. If the return value of that function is a string or nil then that value is returned by this function also. Otherwise, that value is converted to a string and returned. Optional arg NO-PROPERTIES means that if a string is to be returned then it is first stripped of any text properties. Optional arg SYNTAX-TABLE is a syntax table to use." (let* ((thing-fn (or (get thing 'tap-thing-at-point) =20 (get thing 'thing-at-point))) (text (if thing-fn (let* ((opoint (point)) (thg (prog1 (funcall thing-fn) (constrain-to-field nil opoint)))) (if (stringp thg) thg (and thg (format "%s" thg)))) (let ((bounds (tap-bounds-of-thing-at-point thing syntax-table))) (and bounds (buffer-substring (car bounds) (cdr bounds))))))) (when (and text no-properties) (set-text-properties 0 (length text) nil text)) text)) From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 04 16:22:05 2016 Received: (at 21391) by debbugs.gnu.org; 4 Nov 2016 20:22:05 +0000 Received: from localhost ([127.0.0.1]:45104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2l01-00064C-I3 for submit@debbugs.gnu.org; Fri, 04 Nov 2016 16:22:05 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:36403) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2l00-00063j-DA for 21391@debbugs.gnu.org; Fri, 04 Nov 2016 16:22:04 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uA4KLtWx002041 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 4 Nov 2016 20:21:57 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id uA4KLs7E032274 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 4 Nov 2016 20:21:55 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id uA4KLrO4012417; Fri, 4 Nov 2016 20:21:53 GMT MIME-Version: 1.0 Message-ID: Date: Fri, 4 Nov 2016 13:21:51 -0700 (PDT) From: Drew Adams To: =?utf-8?B?QW5kcmVhcyBSw7ZobGVy?= , 21391@debbugs.gnu.org Subject: RE: bug#21391: 24.5; `thing-at-point' returns error when called with arguments 'number t) References: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> <6d4d9469-5698-d522-ac3d-3f540b1c14b3@easy-emacs.de> <295cccf3-bb80-4cde-bcdb-5137333cc1ed@default> In-Reply-To: <295cccf3-bb80-4cde-bcdb-5137333cc1ed@default> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: 21391 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) > > Is there a need to pick symbols from a buffer as symbols? > > Don't know. My use-case is editing and strings are the suitable > > format. >=20 > Of course there is. And not just symbols, but numbers, lists... Sorry for the confusion. I was thinking of `list-at-point' etc., and not `thing-at-point', which always returns a string (or it should, at least - see my previous msg). From unknown Sat Aug 16 18:46:14 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: Did not alter fixed versions and reopened. Date: Mon, 07 Nov 2016 03:12:02 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # Did not alter fixed versions and reopened. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 06 22:17:30 2016 Received: (at 21391) by debbugs.gnu.org; 7 Nov 2016 03:17:30 +0000 Received: from localhost ([127.0.0.1]:47358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3aR7-0008Jv-UI for submit@debbugs.gnu.org; Sun, 06 Nov 2016 22:17:30 -0500 Received: from mail-pf0-f170.google.com ([209.85.192.170]:36025) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3aR5-0008Jj-K0 for 21391@debbugs.gnu.org; Sun, 06 Nov 2016 22:17:28 -0500 Received: by mail-pf0-f170.google.com with SMTP id 189so83706112pfz.3 for <21391@debbugs.gnu.org>; Sun, 06 Nov 2016 19:17:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:cc:date:in-reply-to:message-id :user-agent:mime-version; bh=pKpklgzbEySA/7eE6fDAb8THopO4TjzVJ4ZgnIL21KQ=; b=PDSbmmczzZPIX7JHbvSUeZkMPhm8YvLlAJ11F42EvI8B1pf//92UY2kG56VYzZ1RaX s37P86z3FC/V+nzo+XPZzqHn/jCGeKefabwGUN6pDq33a7kUYchEQg3UHB5MpkmgCYkx ICceIaGOYCUvyj9my3gUwnLnDqJOB3pp9WadwnwEzE5Sj6ftZR8HNZf/dvkUVqpVF4Wi TS+RaRdbfZ0RIdYZMOeEBrebQ+MAh/YZVEh1QS04Tw8NBkF4nZXMqVm5e3w8wVsoXGjC txB9CMJIcemLmpDAIbwLXvs+vHl5HS1ZkYUAsDKUACH4q5t3n0UqHx5fRmp6zmzeUckA W8LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:references:cc:date:in-reply-to :message-id:user-agent:mime-version; bh=pKpklgzbEySA/7eE6fDAb8THopO4TjzVJ4ZgnIL21KQ=; b=XsAfK/h8HZl7xDjnYkxBMiGyJmccB6kYI3rqS1uuu1khBzcolKj0x9nVrExLTojrBY 2FCT/dHcmKt/6Bde87sxU4hV/ggyGCM45vzqhfOYBY8xWBwhAtnU2jPKfwizteXL2L4G YhXLpoRRLamkjv0UWqLmtjqAKJ5Bu51DXwoiBtoKX6hfKqg/+zWoeTMkhVc8O5qW9v8L N9KPwoSxl1TrEOwPUjEUjfEdiuKKoNz0TrI44wW+j7FMvu2rqDIXczRLFI7JnNEQsV+H 2yF8JKMGG2bHvUHgENAt0hVPfE+gpo+4db2S8SHousTZ2qZ2tGsotmufwh7imUQ6I1wN BU0Q== X-Gm-Message-State: ABUngvcSV1QFJik/91oKZK/Bo7mqdpeKbTenwdf3WEbPKm75tUVC+B7SoKmMzOsjfuBRzA== X-Received: by 10.99.135.200 with SMTP id i191mr7595608pge.18.1478488641824; Sun, 06 Nov 2016 19:17:21 -0800 (PST) Received: from calancha-pc ([240f:6e:c00e:1:6875:2e94:598b:96cb]) by smtp.gmail.com with ESMTPSA id y2sm20351665pay.10.2016.11.06.19.17.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 06 Nov 2016 19:17:21 -0800 (PST) From: Tino Calancha To: 21391@debbugs.gnu.org Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string References: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> <1773ab35-70b1-42f9-8a8b-fe07881487d1@default> Date: Mon, 07 Nov 2016 12:17:17 +0900 In-Reply-To: <1773ab35-70b1-42f9-8a8b-fe07881487d1@default> (Drew Adams's message of "Fri, 4 Nov 2016 13:03:40 -0700 (PDT)") Message-ID: <874m3krnb6.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: 21391 Cc: Eli Zaretskii , Drew Adams , Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.6 (-) Drew Adams writes: > `thing-at-point' should always return a string. > `list-at-point', `form-at-point', etc. are a different > story - they can return anything. > > The problem with the code of `thing-at-point' is not where > it has been identified so far. The problem is that if > THING has property `thing-at-point', and if that function > returns something that is not a string, then > `set-text-properties' raises an error. > > A proper fix is to convert the result returned by > (funcall (get thing 'thing-at-point)) to a string. > For that, you can use (format "%s" thing). It's natural if `thing-at-point' returns the thing as a string. When the user don't want a string then s?he can use the specific functions, like `number-at-point' or `list-at-point'. Indeed, that is what is specified in the manual: * doc/lispref/text.texi (Examining Buffer Contents) Following patch pass all the Emacs tests: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >From ce1ced756c2762b4b0448a0480173e757804f784 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Mon, 7 Nov 2016 12:05:28 +0900 Subject: [PATCH] * lisp/thingatpt.el (thing-at-point): Return the thing as a string --- lisp/thingatpt.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index e423630..fd6b323 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -128,7 +128,7 @@ bounds-of-thing-at-point ;;;###autoload (defun thing-at-point (thing &optional no-properties) - "Return the THING at point. + "Return the THING at point as a string. THING should be a symbol specifying a type of syntactic entity. Possibilities include `symbol', `list', `sexp', `defun', `filename', `url', `email', `word', `sentence', `whitespace', @@ -145,7 +145,9 @@ thing-at-point (let ((bounds (bounds-of-thing-at-point thing))) (when bounds (buffer-substring (car bounds) (cdr bounds))))))) - (when (and text no-properties (sequencep text)) + (when (and text (not (stringp text))) + (setq text (format "%s" text))) + (when (and text no-properties) (set-text-properties 0 (length text) nil text)) text)) -- 2.10.1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; In GNU Emacs 26.0.50.6 (x86_64-pc-linux-gnu, GTK+ Version 3.22.2) of 2016-11-06 Repository revision: f1d19d1445a8e7d4ee0d13edb8ed99e222603086 From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 04:22:17 2016 Received: (at 21391) by debbugs.gnu.org; 7 Nov 2016 09:22:17 +0000 Received: from localhost ([127.0.0.1]:47506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3g89-0008WM-5E for submit@debbugs.gnu.org; Mon, 07 Nov 2016 04:22:17 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:56806) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3g87-0008W7-3Q for 21391@debbugs.gnu.org; Mon, 07 Nov 2016 04:22:15 -0500 Received: from [192.168.178.35] ([77.12.174.196]) by mrelayeu.kundenserver.de (mreue005) with ESMTPSA (Nemesis) id 0LbNoU-1cX0K11pak-00kzTZ; Mon, 07 Nov 2016 10:22:03 +0100 Subject: Re: bug#21391: 24.5; `thing-at-point' returns error when called with arguments 'number t) To: Drew Adams References: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> <6d4d9469-5698-d522-ac3d-3f540b1c14b3@easy-emacs.de> <295cccf3-bb80-4cde-bcdb-5137333cc1ed@default> From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Message-ID: Date: Mon, 7 Nov 2016 10:30:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:u/s42JXNb7Hu8YC+XkiokPDd5Vyqy8uVrHzWR35lxQc7LIDkWi/ fHvrRUr5BibtIf+lRJMAID24VJzLo8n34Ywd8aboFPRzVAopQQCoCufrrJnJsT0GwK0DKxE 9iZtWS5CX0UEh0+GsdgkoIjDgf8G/sjSC6nftzFiZheZNabATjd2vvtGVh4ZnAdIpFXlUAH e/oH4B2hjS/daGRklBn8A== X-UI-Out-Filterresults: notjunk:1;V01:K0:SGxr0F2L8dU=:lXS/gzVtBC0YE/ca+ZNevF rOHdJnWVb25VMWUoQF8mYLsPQkD8q7agiCXn0kVncnBGtRJTzFhFujMuc6bAvQmxvIcJqcqgx YbKt5yAvRcbmN1YdQiDysn49IgWWkxMG+VD1RLyleXOy0o18X2LYLYNty392Ifv/HtraeDiM8 1HbW1+C4X3xIW/JEFNFQ88QS60EPA3+n2uYh0itbdeh2VLgjplk7VntumxRBbC+JS9MRrujNP q7tW279p+WBBllTQzNsRQP3tGo63nanb5HBM6X/KmvFFLs9P8Ri5gsCmu6ia8qPCKgbPA35jB UxBh1SLQILDnvXcB6lCg1pIoGzYed7iD5Is1aumio78aKdk0vuE9VlDFEhCG1nCvm193FtP4C P82BKXM9EqsF/bPH+or4Q4HUWhHaYoaSp3DCxyDYySX8+7vjCAi21ql79FTFYW9ZtXIJ2zFi7 KGzwEZ+WpSmaVk1yQNl+eCNW6qVaz4pPM9YRGGD/ENcuX36yl4QukNKigCmrMOG/7l4A92iS+ D4YCq/rRD7hwFi2gnkevg2sJGGirlHcmGs/s0lr5d7SD2Q7sBpex8Z2HLwJyYHX4HWvXCujTi qlayVRwj/2vs26MLeKyzhE6qUJlRU2vj7HDTIjFoZl7fPYUv16Mbjha9ZCjvEl4WzJKIfVajZ 2FrTXInQ4dISnD7mTP8h4uJguRIdLs/ckYtc76IZAwt1o6YKS7s1lIXz5yR5Rw6xrKISozau+ AdzhRq5JC+clZbPK X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 21391 Cc: Tino Calancha , 21391@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.9 (/) On 04.11.2016 21:21, Drew Adams wrote: >>> Is there a need to pick symbols from a buffer as symbols? >>> Don't know. My use-case is editing and strings are the suitable >>> format. >> Of course there is. And not just symbols, but numbers, lists... > Sorry for the confusion. I was thinking of `list-at-point' etc., > and not `thing-at-point', which always returns a string (or it > should, at least - see my previous msg). AFAIU the symbol-at-point-as-symbol idea and thing-at-point are two different conceptions. BTW can't see a use-case of form-at-point for know - while having some in mind ;) Thanks, Andreas From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 10:00:48 2016 Received: (at 21391) by debbugs.gnu.org; 7 Nov 2016 15:00:48 +0000 Received: from localhost ([127.0.0.1]:48519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3lPk-0003XH-Mb for submit@debbugs.gnu.org; Mon, 07 Nov 2016 10:00:48 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:39772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3lPj-0003X4-F6 for 21391@debbugs.gnu.org; Mon, 07 Nov 2016 10:00:47 -0500 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uA7F0ddI012146 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 7 Nov 2016 15:00:39 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id uA7F0cGQ030530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 7 Nov 2016 15:00:39 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uA7F0cGU011805; Mon, 7 Nov 2016 15:00:38 GMT MIME-Version: 1.0 Message-ID: Date: Mon, 7 Nov 2016 07:00:37 -0800 (PST) From: Drew Adams To: =?utf-8?B?QW5kcmVhcyBSw7ZobGVy?= Subject: RE: bug#21391: 24.5; `thing-at-point' returns error when called with arguments 'number t) References: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> <6d4d9469-5698-d522-ac3d-3f540b1c14b3@easy-emacs.de> <295cccf3-bb80-4cde-bcdb-5137333cc1ed@default> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Spam-Score: -7.8 (-------) X-Debbugs-Envelope-To: 21391 Cc: Tino Calancha , 21391@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.8 (-------) > >>> Is there a need to pick symbols from a buffer as symbols? > >>> Don't know. My use-case is editing and strings are the suitable > >>> format. > >> Of course there is. And not just symbols, but numbers, lists... > > Sorry for the confusion. I was thinking of `list-at-point' etc., > > and not `thing-at-point', which always returns a string (or it > > should, at least - see my previous msg). >=20 > AFAIU the symbol-at-point-as-symbol idea and thing-at-point are two > different conceptions. >=20 > BTW can't see a use-case of form-at-point for know - while > having some in mind ;) A particular kind of thing at point is defined using function `form-at-point' or by using the `thing-at-point' symbol property. `form-at-point' is essentially a building block (helper). This is different from what `thing-at-point', which returns text (a string) that names or represents a thing at point of a particular kind. Examples of functions defined using `form-at-point' include `symbol-at-point', which returns a symbol, not a symbol name (string); `number-at-point', which returns a number, not a numeral (string); and `list-at-point', which returns a list (not a string representing a list). In my library `thingatpt+.el' I define functions such as `symbol-name-at-point', which returns a string naming the symbol at point, and `non-nil-symbol-name-at-point', which is the same but returns nil instead of the symbol name "nil", if there is no symbol (including no symbol `nil') at point. Using `-name-' as part of the function name helps make clear that such functions return strings, not symbols. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 10:01:17 2016 Received: (at 21391) by debbugs.gnu.org; 7 Nov 2016 15:01:17 +0000 Received: from localhost ([127.0.0.1]:48523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3lQC-0003YZ-UD for submit@debbugs.gnu.org; Mon, 07 Nov 2016 10:01:17 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:45910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3lQA-0003YD-TT for 21391@debbugs.gnu.org; Mon, 07 Nov 2016 10:01:15 -0500 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uA7F18xL003961 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 7 Nov 2016 15:01:08 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.13.8) with ESMTP id uA7F185G021911 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 7 Nov 2016 15:01:08 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uA7F17av012457; Mon, 7 Nov 2016 15:01:07 GMT MIME-Version: 1.0 Message-ID: Date: Mon, 7 Nov 2016 07:01:05 -0800 (PST) From: Drew Adams To: =?utf-8?B?QW5kcmVhcyBSw7ZobGVy?= Subject: RE: bug#21391: 24.5; `thing-at-point' returns error when called with arguments 'number t) References: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> <6d4d9469-5698-d522-ac3d-3f540b1c14b3@easy-emacs.de> <295cccf3-bb80-4cde-bcdb-5137333cc1ed@default> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Spam-Score: -7.8 (-------) X-Debbugs-Envelope-To: 21391 Cc: Tino Calancha , 21391@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.8 (-------) > >>> Is there a need to pick symbols from a buffer as symbols? > >>> Don't know. My use-case is editing and strings are the suitable > >>> format. > >> Of course there is. And not just symbols, but numbers, lists... > > Sorry for the confusion. I was thinking of `list-at-point' etc., > > and not `thing-at-point', which always returns a string (or it > > should, at least - see my previous msg). >=20 > AFAIU the symbol-at-point-as-symbol idea and thing-at-point are two > different conceptions. >=20 > BTW can't see a use-case of form-at-point for know - while > having some in mind ;) A particular kind of thing at point is defined using function `form-at-point' or by using the `thing-at-point' symbol property. `form-at-point' is essentially a building block (helper). This is different from what `thing-at-point', which returns text (a string) that names or represents a thing at point of a particular kind. Examples of functions defined using `form-at-point' include `symbol-at-point', which returns a symbol, not a symbol name (string); `number-at-point', which returns a number, not a numeral (string); and `list-at-point', which returns a list (not a string representing a list). In my library thingatpt+.el I define functions such as `symbol-name-at-point', which returns a string naming the symbol at point, and `non-nil-symbol-name-at-point', which is the same but returns nil instead of the symbol name "nil", if there is no symbol (including no symbol `nil') at point. Using `-name-' as part of the function name helps make clear that such functions return strings, not symbols. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 10:13:54 2016 Received: (at 21391) by debbugs.gnu.org; 7 Nov 2016 15:13:54 +0000 Received: from localhost ([127.0.0.1]:48531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3lcQ-0003pm-Bc for submit@debbugs.gnu.org; Mon, 07 Nov 2016 10:13:54 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42894) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3lcO-0003pX-K4 for 21391@debbugs.gnu.org; Mon, 07 Nov 2016 10:13:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3lcF-0000Ib-N0 for 21391@debbugs.gnu.org; Mon, 07 Nov 2016 10:13:47 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3lc9-0000Gr-As; Mon, 07 Nov 2016 10:13:37 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1973 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c3lc8-0007Z8-3H; Mon, 07 Nov 2016 10:13:36 -0500 Date: Mon, 07 Nov 2016 17:14:07 +0200 Message-Id: <83a8dbiaps.fsf@gnu.org> From: Eli Zaretskii To: Tino Calancha In-reply-to: <874m3krnb6.fsf_-_@gmail.com> (message from Tino Calancha on Mon, 07 Nov 2016 12:17:17 +0900) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string References: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> <1773ab35-70b1-42f9-8a8b-fe07881487d1@default> <874m3krnb6.fsf_-_@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 21391 Cc: drew.adams@oracle.com, 21391@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > From: Tino Calancha > CC: Drew Adams , Tino Calancha ,Eli Zaretskii > Date: Mon, 07 Nov 2016 12:17:17 +0900 > > Drew Adams writes: > > > A proper fix is to convert the result returned by > > (funcall (get thing 'thing-at-point)) to a string. > > For that, you can use (format "%s" thing). > > It's natural if `thing-at-point' returns the thing as a string. > When the user don't want a string then s?he can use the specific > functions, like `number-at-point' or `list-at-point'. Isn't that completely backward-incompatible? If so, I don't think we can do that. I don't really see what is "improper" with the other suggestions to fix this bug, which simply avoid signaling an error if the "thing at point" happens to be something other than a string? From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 11:10:51 2016 Received: (at 21391) by debbugs.gnu.org; 7 Nov 2016 16:10:51 +0000 Received: from localhost ([127.0.0.1]:48567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3mVX-0006ni-1k for submit@debbugs.gnu.org; Mon, 07 Nov 2016 11:10:51 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:26799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3mVV-0006nW-BL for 21391@debbugs.gnu.org; Mon, 07 Nov 2016 11:10:49 -0500 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uA7GAgol026962 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 7 Nov 2016 16:10:43 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id uA7GAgZ1009383 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 7 Nov 2016 16:10:42 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id uA7GAaD6005193; Mon, 7 Nov 2016 16:10:37 GMT MIME-Version: 1.0 Message-ID: <123efdfd-3a87-4b39-9567-a56ecc3ea82e@default> Date: Mon, 7 Nov 2016 08:10:34 -0800 (PST) From: Drew Adams To: Eli Zaretskii , Tino Calancha Subject: RE: bug#21391: 24.5; `thing-at-point' should return a string References: < <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> <1773ab35-70b1-42f9-8a8b-fe07881487d1@default>> <<874m3krnb6.fsf_-_@gmail.com>> <<83a8dbiaps.fsf@gnu.org>> In-Reply-To: <<83a8dbiaps.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)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Spam-Score: -7.8 (-------) X-Debbugs-Envelope-To: 21391 Cc: drew.adams@oracle.com, 21391@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.8 (-------) > > > A proper fix is to convert the result returned by > > > (funcall (get thing 'thing-at-point)) to a string. > > > For that, you can use (format "%s" thing). > > > > It's natural if `thing-at-point' returns the thing as a string. > > When the user don't want a string then s?he can use the specific > > functions, like `number-at-point' or `list-at-point'. >=20 > Isn't that completely backward-incompatible? If so, I don't think > we can do that. >=20 > I don't really see what is "improper" with the other suggestions to > fix this bug, which simply avoid signaling an error if the "thing at > point" happens to be something other than a string? `thing-at-point' has always allowed, and rightfully so, its default behavior to be replaced by putting a function on the THING symbol as property `thing-at-point'. That function is invoked, and what the return value was returned by `thing-at-point'. The two branches of the `if' in `thing-at-point' were thus not symmetrical (and intentionally so, so that it could return actual things, not just strings naming things). One branch could return anything - a THING at point; the other branch returned a string naming a thing at point. This meant that `thing-at-point' could return a list, symbol, etc. - things that are not strings. What is new (since Emacs 24.4) is that someone added this at the end of the definition of `thing-at-point', and made it pertain to _both_ branches of the `if'. In addition, they named the result of the `if' by the variable `text'. (when (and text no-properties) (set-text-properties 0 (length text) nil text)) They apparently paid no attention to the important `thing-at-point' behavior provided by the first `if' clause, and instead just assumed that the `if' always returned a string. IIUC, Emacs Dev (not I), has insisted that `thing-at-point' itself should always return a string, as opposed to what `form-at-point' (and functions defined using it) returns, which can be a THING (not just a string naming a thing). For one thing, this allows code calling `thing-at-point' to count on the result being a string (if a thing is found) or nil (if not). I see three possibly reasonable fixes for the bug introduced in Emacs 24.4: 1. Make `thing-at-point' always return a thing, as (IIUC) wished by Emacs Dev. Have it convert the result of the first `if' clause to a string. Anyone needing a real (non-string) thing can use `form-at-point' to get what they want. 2. Make `thing-at-point', as before, return just what the firat `if' clause returns, if that clause is taken. IOW, move the removal of text properties (from non-nil NO-PROPERTIES) into the second `if' clause. Among other things (sic), this allows the first `if' clause to return a propertized string. 3. Make `thing-at-point', as before, return just what the firat `if' clause returns, if that clause is taken, except that if either clause returns a string then strip that string of text properties (if NO-PROPERTIES is non-nil). My understanding is that Emacs Dev has preferred that `thing-at-point' return a string, and that users should use `form-at-point' if they want something else. (I've adapted my own code to that preference.) If so, then #1 is probably the option of choice: Convert anything returned by (funcall (get thing 'thing-at-point)) to a string. Personally, I do not see why Emacs added arg NO-PROPERTIES, as anyone could always remove properties on a string result from `thing-at-point'. Dunno who added this arg, or why, but I don't see that it provides any advantage. (Perhaps the one advantage it has inadvertently provided is to raise the question again of whether `thing-at-point' should always return a string.) From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 12:14:10 2016 Received: (at submit) by debbugs.gnu.org; 7 Nov 2016 17:14:10 +0000 Received: from localhost ([127.0.0.1]:48616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3nUo-0001TJ-8m for submit@debbugs.gnu.org; Mon, 07 Nov 2016 12:14:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3nUm-0001T6-Cu for submit@debbugs.gnu.org; Mon, 07 Nov 2016 12:14:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3nUg-0000oZ-GP for submit@debbugs.gnu.org; Mon, 07 Nov 2016 12:14:03 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33383) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c3nUg-0000oE-Cw for submit@debbugs.gnu.org; Mon, 07 Nov 2016 12:14:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3nUc-0007Ib-AX for bug-gnu-emacs@gnu.org; Mon, 07 Nov 2016 12:14:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3nUX-0000WU-Bn for bug-gnu-emacs@gnu.org; Mon, 07 Nov 2016 12:13:58 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:53133) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c3nUX-0000Su-1U; Mon, 07 Nov 2016 12:13:53 -0500 Received: from [192.168.178.35] ([77.12.174.196]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0LheU5-1cYgPJ2KYr-00mpxL; Mon, 07 Nov 2016 18:13:44 +0100 Subject: Re: bug#21391: 24.5; `thing-at-point' returns error when called with arguments 'number t) To: bug-gnu-emacs@gnu.org References: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> <1773ab35-70b1-42f9-8a8b-fe07881487d1@default> From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Message-ID: <302c1b51-e840-a2ca-5b8f-e3f64532eda8@easy-emacs.de> Date: Mon, 7 Nov 2016 18:22:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <1773ab35-70b1-42f9-8a8b-fe07881487d1@default> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:oT3qoxZFrjiRlZ3yNvElO02IDMHdB80siX3nQD2zCM8hOumuCXP OxvtHTbjpdAunY8Jrv2/why6XkZDXOZY3bla4XREMGWQP/Iv+hphzlzfsvb8qPEf3kRHO0M 49bmXZ2AxTOzFwLt3EXwt3hAzB9hwvUSf7ASykehanAnJpb9FAIjLhAYwvihgkt7C69l4h7 1Nb8aOjrb0khHetiEzGvg== X-UI-Out-Filterresults: notjunk:1;V01:K0:C0lgdTEjAdQ=:3aTE9SrL5a06SG6Ftvn1u1 t8oMD1XX2KlxcjACB9T6ZX3F5nNv/mKysaTTJ4JX+G1wRUtJ9VwTUh6tClP1iZlta0uJQayv9 ViNCUI/Yp0PPvYK920SCpzU0ly8uPNzwG9jJy6VszVH/uCUsPDHgfPXZHL/3dynuJIQCr/JVy rKH0XHt5Blh7UhTH4mDT6uQJr9J0F5su1Aot7Fvh3EI17zP0SYYAcsoCOkdChxn6doSSinMg4 my0Sk00DDNepdYM4BlOfn/NoNOI2FlkU1t4zRTw+0eQn93iLrw5RPNXOXVZ/0YRTNNKgaXEU9 7cZx9CGPkAwQlQm9QtaMSmMTLrOf57gLkodJJnwgwOV/uWFpXLdVRkXYG9jXdBP/tUmorQv74 SW9eQLB45IhTrqRMN9N6HWgnKrsppV172R5p8SWe1S9BIFce+Zi2I8qu8PChEEOFlIvkTRSq0 trdepTQW5O1QCV0xbXShvJpQpaEo5cIcnRK1dbLMcHjZ+skB3D1EYpFiKu1EpMC2SiH7O6c4L utz2ZfGhGMu11BAmTnBTTzB11y9473YuwiBzvfY9zN751TU/awuDG0Y3ohzSuft+25HIJ00q3 gRs88FjybMtVjGBXoDuI8S1S6nN++X/KE7/y4jUYlelnjhud0T/Rr0sVwAqyJ47Q2B4l48BMs VtT0ePDesNbgSZnK8b/wfklC8swVzvuD0W48oP/d0F9J2vz++evP7K2FSvcwkoV45lbYdI1on 6IQaXDCqAhWQxBEP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: Eli Zaretskii , Drew Adams , Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) On 04.11.2016 21:03, Drew Adams wrote: > Sorry, but I confused things further, I'm afraid. > > `thing-at-point' should always return a string. Indeed. Which would require some normalization WRT number-at-point etc. > `list-at-point', `form-at-point', etc. are a different > story - they can return anything. Interesting question. Maybe returns the symbol if found - nil otherwise? From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 12:37:59 2016 Received: (at submit) by debbugs.gnu.org; 7 Nov 2016 17:37:59 +0000 Received: from localhost ([127.0.0.1]:48621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3nrr-00020Z-8w for submit@debbugs.gnu.org; Mon, 07 Nov 2016 12:37:59 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3nrp-00020M-DC for submit@debbugs.gnu.org; Mon, 07 Nov 2016 12:37:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3nrf-0000u4-9x for submit@debbugs.gnu.org; Mon, 07 Nov 2016 12:37:52 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35618) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c3nrf-0000tx-7J for submit@debbugs.gnu.org; Mon, 07 Nov 2016 12:37:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3nre-0008Pt-5h for bug-gnu-emacs@gnu.org; Mon, 07 Nov 2016 12:37:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3nrd-0000tM-Cs for bug-gnu-emacs@gnu.org; Mon, 07 Nov 2016 12:37:46 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:41375) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c3nrY-0000pt-Ql; Mon, 07 Nov 2016 12:37:41 -0500 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uA7HbYh3001597 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 7 Nov 2016 17:37:34 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.13.8) with ESMTP id uA7HbXMq011976 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 7 Nov 2016 17:37:34 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uA7HbVNr024626; Mon, 7 Nov 2016 17:37:31 GMT MIME-Version: 1.0 Message-ID: <2857cfd4-94db-49ae-902e-a010c0571868@default> Date: Mon, 7 Nov 2016 09:37:30 -0800 (PST) From: Drew Adams To: =?utf-8?B?QW5kcmVhcyBSw7ZobGVy?= , bug-gnu-emacs@gnu.org Subject: RE: bug#21391: 24.5; `thing-at-point' returns error when called with arguments 'number t) References: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> <1773ab35-70b1-42f9-8a8b-fe07881487d1@default> <302c1b51-e840-a2ca-5b8f-e3f64532eda8@easy-emacs.de> In-Reply-To: <302c1b51-e840-a2ca-5b8f-e3f64532eda8@easy-emacs.de> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: Eli Zaretskii , Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) > > `thing-at-point' should always return a string. >=20 > Indeed. Which would require some normalization WRT number-at-point > etc. `number-at-point' uses `form-at-point'. It returns a number (or nil), not a numeral (string). It satisfies `numberp', not `stringp'. What normalization do you have in mind? (I have also `decimal-number-at-point' and `hex-number-at-point', FWIW.) > > `list-at-point', `form-at-point', etc. are a different > > story - they can return anything. >=20 > Interesting question. Maybe returns the symbol if found - nil > otherwise? That's what `symbol-at-point' does. However, since `nil' is a symbol, `symbol-at-point' does not distinguish between finding that symbol and not finding any symbol at point. The others return a thing of the given type (or nil, if none). `list-at-point', like `symbol-at-point', does not distinguish between an empty list at point (buffer text "nil" or "()" or "( )" etc.) and no list at point. The doc for `list-at-point' should in fact say that it returns the _non-nil_ list at point, or nil if none. It should also return the list (quote (1 2)) when on '(1 2) (it's broken, IMO). (I also have a function `unquoted-list-at-point'.) From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 13:04:03 2016 Received: (at 21391) by debbugs.gnu.org; 7 Nov 2016 18:04:03 +0000 Received: from localhost ([127.0.0.1]:48641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3oH4-0002cV-V4 for submit@debbugs.gnu.org; Mon, 07 Nov 2016 13:04:03 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38215) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3oH3-0002c2-BJ for 21391@debbugs.gnu.org; Mon, 07 Nov 2016 13:04:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3oGt-00031S-VF for 21391@debbugs.gnu.org; Mon, 07 Nov 2016 13:03:56 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3oGt-00031K-Sj; Mon, 07 Nov 2016 13:03:51 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2179 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c3oGs-000831-W1; Mon, 07 Nov 2016 13:03:51 -0500 Date: Mon, 07 Nov 2016 20:04:22 +0200 Message-Id: <831syni2u1.fsf@gnu.org> From: Eli Zaretskii To: Drew Adams In-reply-to: <123efdfd-3a87-4b39-9567-a56ecc3ea82e@default> (message from Drew Adams on Mon, 7 Nov 2016 08:10:34 -0800 (PST)) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string References: < <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> <1773ab35-70b1-42f9-8a8b-fe07881487d1@default>> <<874m3krnb6.fsf_-_@gmail.com>> <<83a8dbiaps.fsf@gnu.org>> <123efdfd-3a87-4b39-9567-a56ecc3ea82e@default> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > Date: Mon, 7 Nov 2016 08:10:34 -0800 (PST) > From: Drew Adams > Cc: 21391@debbugs.gnu.org, drew.adams@oracle.com > > What is new (since Emacs 24.4) is that someone added this at the end > of the definition of `thing-at-point', and made it pertain to _both_ > branches of the `if'. In addition, they named the result of the `if' > by the variable `text'. > > (when (and text no-properties) > (set-text-properties 0 (length text) nil text)) > > They apparently paid no attention to the important `thing-at-point' > behavior provided by the first `if' clause, and instead just assumed > that the `if' always returned a string. This is already fixed in the current sources. We now only remove the text properties if the object supports that. Why isn't that enough? From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 13:37:28 2016 Received: (at 21391) by debbugs.gnu.org; 7 Nov 2016 18:37:28 +0000 Received: from localhost ([127.0.0.1]:48661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3onQ-0003Op-C6 for submit@debbugs.gnu.org; Mon, 07 Nov 2016 13:37:28 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:27939) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3onO-0003Oa-7c for 21391@debbugs.gnu.org; Mon, 07 Nov 2016 13:37:26 -0500 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uA7IbJ89018413 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 7 Nov 2016 18:37:19 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id uA7IbJqi004497 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 7 Nov 2016 18:37:19 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id uA7IbGm4012600; Mon, 7 Nov 2016 18:37:17 GMT MIME-Version: 1.0 Message-ID: <0e01c7ea-13b2-47ca-92c9-5de40b29379f@default> Date: Mon, 7 Nov 2016 10:37:14 -0800 (PST) From: Drew Adams To: Eli Zaretskii Subject: RE: bug#21391: 24.5; `thing-at-point' should return a string References: << <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> <1773ab35-70b1-42f9-8a8b-fe07881487d1@default>>> <<<874m3krnb6.fsf_-_@gmail.com>>> <<<83a8dbiaps.fsf@gnu.org>>> <<123efdfd-3a87-4b39-9567-a56ecc3ea82e@default>> <<831syni2u1.fsf@gnu.org>> In-Reply-To: <<831syni2u1.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)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Spam-Score: -7.8 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.8 (-------) > This is already fixed in the current sources. We now only remove > the text properties if the object supports that. Why isn't that enough? My understanding was, as I said, that Emacs Dev wanted `t-a-p' to always return a string (or nil), and that `form-at-point' is to be used to return something else. The advantage of that, I suppose, was considered to be that callers could count on the return type, without regard to the THING arg. I don't have emacs-devel or bug-report messages to hand, to support my understanding, but I thought that was the point of view taken by those deciding, so far, wrt thingatpt.el. I know that I made an effort to adjust my code, to accommodate that approach. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 14:12:19 2016 Received: (at 21391) by debbugs.gnu.org; 7 Nov 2016 19:12:20 +0000 Received: from localhost ([127.0.0.1]:48678 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3pL9-0004Dp-Ms for submit@debbugs.gnu.org; Mon, 07 Nov 2016 14:12:19 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:37783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3pL8-0004Dc-1W for 21391@debbugs.gnu.org; Mon, 07 Nov 2016 14:12:18 -0500 Received: by mail-wm0-f52.google.com with SMTP id t79so196685458wmt.0 for <21391@debbugs.gnu.org>; Mon, 07 Nov 2016 11:12:18 -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=JCf8W3ZY+VYIfPZ/4qrBwcjQKk417iJaq7329zMpNko=; b=VBB69Bwwq6SWBzbxtFHJnPkR/sc/z+sy5FaWpMqutdGUXd/UuShLcnhK2Beh8ItXxU sGqR/R2wFra3g9bARtGaAhcOJ0Vr0NRHDGRZrhiT9STxS0kaw55PdyoHRpbXYqpXNeBY Tgg3tJeC5tLPYZXFIanJw77Dud2FIRsKuefOhEpQUcGnMROoTiDUsgnVPU4mtQ8Jvoa1 WvLZENfatocuKPbudeXhGqQIYgVA7KuNk8pdWJlXXA67HWXHoSEI81lzLQBNGo6Jv+D+ i4K/zTNUMgiSbz46KsuxtysXrKEmhWBA3TpaeDlGn58/ByJLpeZlo4sVY8WM0JQRuATB Ae+Q== 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=JCf8W3ZY+VYIfPZ/4qrBwcjQKk417iJaq7329zMpNko=; b=CEFoR5WwnX/MWHzLDkhe+h/pbOHrFGUgwfUkIfanPhzB4lMSMnkf8hMPwaRPluqRzv FoFnEwDqD1gKLtihHvWuYg/hRdH1MFYvczg2/tCNpYA+uxQkmjo3BsviMbZ91KH2jXrF LCUVckq2Ru516o0Kr6BDTa/nk5mygdBcIyy9Df3cCWLVxAHkAIY1qTujoqjF/4XvEZCq LtzZoQTPYU98WtTY2amqw8+qYH6OMze/+jEss+i3A6OxgUBUjgiVMtE+s4QQlYCRjYuz Ld5H9tgIGUJTZZ/BovhDQN42BInlssVWG78bixVLX+tYT3gkOT8NkzXRDacZVQNqr8fE gD6A== X-Gm-Message-State: ABUngvf0LkZnzAv5YlCC2vgr8J8LgUd+QRwQfwvvyb4eWgslMmk+roFn2Jfp0HIEqny5BA== X-Received: by 10.28.234.201 with SMTP id g70mr8051952wmi.104.1478545932232; Mon, 07 Nov 2016 11:12:12 -0800 (PST) Received: from [192.168.1.3] ([185.105.173.41]) by smtp.googlemail.com with ESMTPSA id wh3sm32603566wjb.49.2016.11.07.11.12.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 11:12:11 -0800 (PST) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: Eli Zaretskii , Tino Calancha References: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> <1773ab35-70b1-42f9-8a8b-fe07881487d1@default> <874m3krnb6.fsf_-_@gmail.com> <83a8dbiaps.fsf@gnu.org> From: Dmitry Gutov Message-ID: Date: Mon, 7 Nov 2016 21:12:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 In-Reply-To: <83a8dbiaps.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On 07.11.2016 17:14, Eli Zaretskii wrote: >> It's natural if `thing-at-point' returns the thing as a string. >> When the user don't want a string then s?he can use the specific >> functions, like `number-at-point' or `list-at-point'. > > Isn't that completely backward-incompatible? When thing is a number? Maybe. I don't imagine it's used very often. > If so, I don't think we > can do that. It's pretty clearly a bug: most other "things" behave otherwise (list, sexp, symbol). I'd very much rather we didn't retain conceptual problems like that just for the sake of compatibility. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 14:47:20 2016 Received: (at 21391) by debbugs.gnu.org; 7 Nov 2016 19:47:20 +0000 Received: from localhost ([127.0.0.1]:48694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3pt2-000579-5e for submit@debbugs.gnu.org; Mon, 07 Nov 2016 14:47:20 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3pt0-00056v-T0 for 21391@debbugs.gnu.org; Mon, 07 Nov 2016 14:47:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3psr-0003Ks-OH for 21391@debbugs.gnu.org; Mon, 07 Nov 2016 14:47:13 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3psr-0003Kn-LD; Mon, 07 Nov 2016 14:47:09 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2406 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c3psq-0005Pq-7l; Mon, 07 Nov 2016 14:47:09 -0500 Date: Mon, 07 Nov 2016 21:47:34 +0200 Message-Id: <83pom7gjhl.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-reply-to: (message from Dmitry Gutov on Mon, 7 Nov 2016 21:12:07 +0200) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string References: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> <1773ab35-70b1-42f9-8a8b-fe07881487d1@default> <874m3krnb6.fsf_-_@gmail.com> <83a8dbiaps.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > Cc: 21391@debbugs.gnu.org > From: Dmitry Gutov > Date: Mon, 7 Nov 2016 21:12:07 +0200 > > On 07.11.2016 17:14, Eli Zaretskii wrote: > > >> It's natural if `thing-at-point' returns the thing as a string. > >> When the user don't want a string then s?he can use the specific > >> functions, like `number-at-point' or `list-at-point'. > > > > Isn't that completely backward-incompatible? > > When thing is a number? Maybe. I don't imagine it's used very often. But previously it could be used. After this change, it would be impossible. > > If so, I don't think we > > can do that. > > It's pretty clearly a bug: most other "things" behave otherwise (list, > sexp, symbol). I'd very much rather we didn't retain conceptual problems > like that just for the sake of compatibility. Not sure which behavior you have in mind. The removal of properties? Or something else? From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 14:51:34 2016 Received: (at 21391) by debbugs.gnu.org; 7 Nov 2016 19:51:34 +0000 Received: from localhost ([127.0.0.1]:48703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3px8-0005Ew-0P for submit@debbugs.gnu.org; Mon, 07 Nov 2016 14:51:34 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:37832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3px6-0005Ej-SW for 21391@debbugs.gnu.org; Mon, 07 Nov 2016 14:51:33 -0500 Received: by mail-wm0-f42.google.com with SMTP id t79so198582934wmt.0 for <21391@debbugs.gnu.org>; Mon, 07 Nov 2016 11:51:32 -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=fAvvkoOZLVFfVzDgLTF4t/huojvHHvAPH76uSlukBjI=; b=jOkMi57AOH8sXoBq/naXH1gDPP/HsbOy73mspNGRx9ffudXZ2FJoNK+5obMUL6zyE+ eUlGrLJDGvyRJIhwqGeWz8zsKDOgyqLt3S1vHqbGc+KDGI3PxpzwvMS0u5I2cv1Kimhb ZdnaqpRjsoBV+oyP7JOvbpMGZ876Z72jQmtts0boOcGdLG3tN1WDOZfAYqE58AToYhKs B6oo6JuCPrWDeSc2W/HNDatD2YyranrHGknRh5V6f9ImXTkTm5ruBZuxsjzUjOwpEC4A 37a3CqVisNu30yHlYE5WjycRS3uKZvQm/Sax09sSIkTckQS6t2CKtJercB+wUBJdb6cr eKhQ== 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=fAvvkoOZLVFfVzDgLTF4t/huojvHHvAPH76uSlukBjI=; b=Cy86olkH+mjTChFtWwCxCEp+V14qTXPMM2aECAoVSsGxcCySbm69eqmF+TjW0xnmzy 87gpQZ1xSV+upHsnrIRdhtQeU4CXdz6a6xVb0Bn8jAElSwWJurq/dggHLj8KFm94dkVF irXo29Hn9a3Bd9JEse/QOk+D1TWNdV/kT+/mxSCqK2Y5QALsEOoTWJai4YmN35ZN18KK V+wnpHdTFQYGjZNHsxt4+PF6bWKgrrZT1j9tWOy2VC2o4jRmuyXBhRyFmar841NjJ9xA 7iOMi59ZqqlGSxtASXw3QUxAzckyBjxRljGxcjeFZXiaL2TMI5SwnCth7cO+V2bG5MQm GIMw== X-Gm-Message-State: ABUngvcYj5NL9MrOFDlXXCbZBBmFoG80v03xnV+PZivRkhWq/fH3lKg3AMz1scM8O5t7gw== X-Received: by 10.194.86.165 with SMTP id q5mr1360492wjz.178.1478548286883; Mon, 07 Nov 2016 11:51:26 -0800 (PST) Received: from [192.168.1.3] ([185.105.173.41]) by smtp.googlemail.com with ESMTPSA id cl10sm24386793wjb.4.2016.11.07.11.51.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 11:51:26 -0800 (PST) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: Eli Zaretskii 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> From: Dmitry Gutov Message-ID: <0a8d76e4-4d1b-a26d-2b76-a2d9384d9f72@yandex.ru> Date: Mon, 7 Nov 2016 21:51:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 In-Reply-To: <83pom7gjhl.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On 07.11.2016 21:47, Eli Zaretskii wrote: >> When thing is a number? Maybe. I don't imagine it's used very often. > > But previously it could be used. After this change, it would be > impossible. The callers will need to switch to `number-at-point', probably. The resulting code will work with both new and older versions of Emacs. >> It's pretty clearly a bug: most other "things" behave otherwise (list, >> sexp, symbol). I'd very much rather we didn't retain conceptual problems >> like that just for the sake of compatibility. > > Not sure which behavior you have in mind. The removal of properties? > Or something else? Returning something other than a string or nil from thing-at-point. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 15:01:48 2016 Received: (at 21391) by debbugs.gnu.org; 7 Nov 2016 20:01:48 +0000 Received: from localhost ([127.0.0.1]:48717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3q72-0005Yr-IS for submit@debbugs.gnu.org; Mon, 07 Nov 2016 15:01:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43657) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3q71-0005Yd-5l for 21391@debbugs.gnu.org; Mon, 07 Nov 2016 15:01:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3q6s-0002dy-R5 for 21391@debbugs.gnu.org; Mon, 07 Nov 2016 15:01:42 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3q6s-0002du-No; Mon, 07 Nov 2016 15:01:38 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2421 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c3q6r-0007DL-3I; Mon, 07 Nov 2016 15:01:38 -0500 Date: Mon, 07 Nov 2016 22:02:04 +0200 Message-Id: <83mvhbgitf.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-reply-to: <0a8d76e4-4d1b-a26d-2b76-a2d9384d9f72@yandex.ru> (message from Dmitry Gutov on Mon, 7 Nov 2016 21:51:23 +0200) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > Cc: tino.calancha@gmail.com, 21391@debbugs.gnu.org > From: Dmitry Gutov > Date: Mon, 7 Nov 2016 21:51:23 +0200 > > >> It's pretty clearly a bug: most other "things" behave otherwise (list, > >> sexp, symbol). I'd very much rather we didn't retain conceptual problems > >> like that just for the sake of compatibility. > > > > Not sure which behavior you have in mind. The removal of properties? > > Or something else? > > Returning something other than a string or nil from thing-at-point. Didn't the function behave that way for quite some time? If so, how come it's suddenly a problem? From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 07 15:04:11 2016 Received: (at 21391) by debbugs.gnu.org; 7 Nov 2016 20:04:11 +0000 Received: from localhost ([127.0.0.1]:48721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3q9L-0005cx-2V for submit@debbugs.gnu.org; Mon, 07 Nov 2016 15:04:11 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:37077) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c3q9I-0005ck-N4 for 21391@debbugs.gnu.org; Mon, 07 Nov 2016 15:04:08 -0500 Received: by mail-wm0-f45.google.com with SMTP id t79so199195226wmt.0 for <21391@debbugs.gnu.org>; Mon, 07 Nov 2016 12:04:08 -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=aAJeoa6DL63Ov6BoZPiFu/ZuSOaVfvt2615iqjATXCs=; b=ebw8BJYUiQHCrFUJO0FFdGJLAho/w+uLQcjyQsji0m34hckyj7ccvUouOKnM4Hl02Q gu//vwTHOucv/9Q/fmZ9XRCNYAUr+MruoplV4s59jwWh4ppiQ1qa9e9lJk3GsqfdrXta Rem4zbZ3etM6iVjz7VyzSH2C1PgS1JGvK3jFruNu1JHXcwDwvSxmPM9bizwrC+EtH+ef oQf1Y7jvo5L7gzP4INrkZEKsBQo9vpIqvgONZqMexRM4W9keVePpGQNw+vVg6LVu7xxk 8IPO6JUP71rW+zIlKn56yIKAm7tsemkb5Y3dNokVkw2ADJqQ7dtjGQvdgxDkWPo6qRy5 nvmw== 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=aAJeoa6DL63Ov6BoZPiFu/ZuSOaVfvt2615iqjATXCs=; b=Ywgm2JWeXgx4VN3UHpwV+6frFY+Ako6/yJh7osuIYl6eoaVygbAKREQu1XnZAKTBD7 rZJ0+OYXl8Ch7LEoF/edgINjbOXvQhrhHitjs+TNgCeOkrdNZlSjFzJfZPeC1+OnHeHD yhxbA4lE+FjSsfAPo/z77vQ95hDA9ZP3YP7s7Nlx94S2oIDocG8qnMKNDcTTdhQ/DrVd KmizpyaQLCIcaHa10EVzzCQJxCgxK3S7aD10Hp/o39CUHzToUQz39yjKzLANfq/x/SNd KjWWnayaHB6RFu9iKvyWca5kkEiCLk1CMeMP0Y36Tb8byWZpkQQIubSKb9cwExuNw35n vi1g== X-Gm-Message-State: ABUngveHMDX0DzRGlJgnDoBS5xVywCOfMOqTRQWPItAZS8s3O7FAIyqT6oC8frz8s0c3Jw== X-Received: by 10.28.74.133 with SMTP id n5mr11522557wmi.132.1478549041407; Mon, 07 Nov 2016 12:04:01 -0800 (PST) Received: from [192.168.1.3] ([185.105.173.41]) by smtp.googlemail.com with ESMTPSA id t186sm15373146wmt.22.2016.11.07.12.04.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 12:04:00 -0800 (PST) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: Eli Zaretskii 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> From: Dmitry Gutov Message-ID: <25bb22e8-1388-275a-d0da-7e698acdf6da@yandex.ru> Date: Mon, 7 Nov 2016 22:03:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 In-Reply-To: <83mvhbgitf.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On 07.11.2016 22:02, Eli Zaretskii wrote: > Didn't the function behave that way for quite some time? If so, how > come it's suddenly a problem? Someone tried to use it for the first time? From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 03:14:16 2016 Received: (at submit) by debbugs.gnu.org; 8 Nov 2016 08:14:16 +0000 Received: from localhost ([127.0.0.1]:49007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c41Xs-0007HO-3O for submit@debbugs.gnu.org; Tue, 08 Nov 2016 03:14:16 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48349) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c41Xr-0007Gx-E8 for submit@debbugs.gnu.org; Tue, 08 Nov 2016 03:14:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c41Xl-0001Pd-Jn for submit@debbugs.gnu.org; Tue, 08 Nov 2016 03:14:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36893) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c41Xl-0001PZ-Ga for submit@debbugs.gnu.org; Tue, 08 Nov 2016 03:14:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c41Xk-0007Xr-EN for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2016 03:14:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c41Xj-0001OU-IS for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2016 03:14:08 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:50476) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c41Xe-0001LS-RV; Tue, 08 Nov 2016 03:14:03 -0500 Received: from [192.168.178.35] ([77.12.86.218]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0LsyHC-1cojLf1IyY-012Wa4; Tue, 08 Nov 2016 09:14:01 +0100 Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: bug-gnu-emacs@gnu.org 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> From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Message-ID: <97f5732b-1c05-6b73-9200-8284ef341def@easy-emacs.de> Date: Tue, 8 Nov 2016 09:22:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <83mvhbgitf.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:6s2rrpP6dwsIwCotBBryrEeE0oKlKUXWQSO7B2qrpuVbR5cZA0V 76ev5oNjA6leONyoeaCuizElZFRxuFyHESbOCFeXD45z+J82H+GMOdpmXXNBZvq1eFkvZQ6 5VeWl/aFaaRCZiJR5fFLZOPd2tMM4qKTQ2Js/jOG/+7N6EzVFr0oWVtn6IzVskV0R8+mSXt +UWYCHNHEMRLci3ungtJQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:YVrLGANQQrY=:5acbtPPweWvyM0YCgLrPnP SYOHkysJsPqUir2hHlTDsmvRhYoRC+yLqnBlBO6hSO9aNKEAD7xXTsHWaYWnMr1P4RmO8/B6o g1sMtC+Fdcjr3t9DljG/6TpSUQaWff1wkUe1NlS8RVu+Gr73Bt85JYRKjmA2tkrVDZjn06yl4 S8UOlnwnjH/S2guP00HR5aKlLHOCIshm7niFU4/OlfSMYbDXivvPcQ14g1OyLeKcZ95XJ+tz4 T2HK2fSKqmU8ew+TREYg/SgLgkPcv5dnGcuDhGJVdxPnHo9u93XLU+pjxCpaQI2zI3nrw2JCo zXC6UqiPoCa3vGrfzCPwiSnxLHdbzUd3FB+0Vi8cR6n/7PHFTICzbqxkCm7iT71bdtp+bQs// ZAvYyXd189EFagjjoMPxE8J7Eeanx5oAiRvOu21YFIvbqgkaj564ihfY9grQPp1sUxcNoElYW TCzx4GMMwCi304vDTU9cwqxV8sPReY3lGcEkF4OV+okVfg9z1+qzXTjJ9TqOKE9y2h09DnFa2 RH8od1z7Sy+vBSbsLcLY6OcML6Q00x9o7F6NMeWVvbPfLopX2TjdEQ1kpolXVfiyngEzcwP/3 hkuex+/8m85rLuw08SlP+O+VtROVGbC9AmWSvLhwNqwrIFaazQhUTj8djCL0xh51cOaSgix5z 43KaaVVtixpEPXpMWX7becifEkkP06oiFDqJiPA8zWpnJ84Z9VLfAnV3q7P1wPxD0/oTuvAWG QA78AMu6N/C6X7S5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: Eli Zaretskii , Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) On 07.11.2016 21:02, Eli Zaretskii wrote: >> Cc: tino.calancha@gmail.com, 21391@debbugs.gnu.org >> From: Dmitry Gutov >> Date: Mon, 7 Nov 2016 21:51:23 +0200 >> >>>> It's pretty clearly a bug: most other "things" behave otherwise (list, >>>> sexp, symbol). I'd very much rather we didn't retain conceptual problems >>>> like that just for the sake of compatibility. >>> Not sure which behavior you have in mind. The removal of properties? >>> Or something else? >> Returning something other than a string or nil from thing-at-point. > Didn't the function behave that way for quite some time? If so, how > come it's suddenly a problem? > > > Assume a lot of bugs open like #21391. These library, which is excellent in base, needs a cleanup, resp. reconsideration. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 03:35:45 2016 Received: (at submit) by debbugs.gnu.org; 8 Nov 2016 08:35:45 +0000 Received: from localhost ([127.0.0.1]:49011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c41se-0007ma-Ud for submit@debbugs.gnu.org; Tue, 08 Nov 2016 03:35:45 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53522) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c41sd-0007mP-WA for submit@debbugs.gnu.org; Tue, 08 Nov 2016 03:35:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c41sX-0001nc-PO for submit@debbugs.gnu.org; Tue, 08 Nov 2016 03:35:38 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_50,RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:55260) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c41sX-0001nT-Lw for submit@debbugs.gnu.org; Tue, 08 Nov 2016 03:35:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c41sW-00014L-6B for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2016 03:35:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c41sS-0001mC-84 for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2016 03:35:36 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:50522) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c41sR-0001ln-UA; Tue, 08 Nov 2016 03:35:32 -0500 Received: from [192.168.178.35] ([77.12.86.218]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0MbLNo-1cMnBB0d2i-00IjcQ; Tue, 08 Nov 2016 09:35:25 +0100 Subject: Re: bug#21391: 24.5; `thing-at-point' returns error when called with arguments 'number t) To: Drew Adams , bug-gnu-emacs@gnu.org References: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> <1773ab35-70b1-42f9-8a8b-fe07881487d1@default> <302c1b51-e840-a2ca-5b8f-e3f64532eda8@easy-emacs.de> <2857cfd4-94db-49ae-902e-a010c0571868@default> From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Message-ID: <66b2bee0-a07f-6d51-8119-89decd6b2cae@easy-emacs.de> Date: Tue, 8 Nov 2016 09:43:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <2857cfd4-94db-49ae-902e-a010c0571868@default> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:BdqmbJu2pmS84VWz2Z+RWAvZOckTEOAVYIpMViaz65DiucoLeoz 5sm4z1qD+NDtEC+cS3IXTemvScp2e104h9cg5c23BZmvYqh9Hc8hPJyo0dqxsxzLMWU7BQK QACrt8LePBOMMZcFOj9TDKBfV2BQU5CmlbuKx3T9UhPxUxaZLoiMALs+d8LHBmiHsOxKjbD yLU/MKdNqJEhNAt3BceNg== X-UI-Out-Filterresults: notjunk:1;V01:K0:igqCbP5ZvXI=:ItDsQ7b6i2Jyp1QB7EXy97 hFNJcjJlbSPGGjHd8zjuCgVMI8bLoL2MQIT3EHNyrxFtKRReFpHytFYom7TbQ8NJf39RuJeEb dOiRTldlO9Gr3Ntx68VvltsvtpjX/UpgC8J4PGF1miW8KM3w1/lYPjwvg4wnPhLu/oyaztOJV ziBqPN6tQtaRwOTDxAxZLgk3d9O/7CBVLWHpbsMJf0yAkSkfkq4GApGC2529/tk+z8/YAxZ6U vZ282mo7s4GgqqOrP5dEEleHkJqpDeQPYMydBpNrU1pU+LjWDXt6yvaEdlAKGTjkVfl3R6m4/ WajVEln7nBvwv/IjGoB0f9QB3V6QZTN9XyZT69NA/TaC/c3v8LBvn5OcbL2Y7C4izjFSQ/RbS 4KVBXwTN7RykWKMMLeZW+GZ7UNKLsDM74cJDAkghsa1D2HFe2vBk6YUEzZlFjbqJDhTk/SA2Q 0b+ZN3H7K+2Lxs+9i6kCk4wPq2pfYhLnlN59laNnKPg+K4VipBUPhxQmcd7Jxx4hA3pgDX6pu c9Lx9GpnphzQq7pALEc3AZzSmvszNkN5D7/UgNt3cCN0lqWoP4WPmKXMEXnNdpz/seUXL8231 dSBdGR28zhYi3qrBNSYTp+QSSsSLBRk9Q0JOeG6DVG/PS6bf61ALbDzjiOauDIxfMr+YXRUnD EIGlxxoNotYfYYG5LgrSfZ4wav+U2tkFe1kUnTSlyTbCLHVX/pKPIx07S7kIq1ZG4DiCs1Moe xKRANIYmsdSJdA7J X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: submit Cc: Eli Zaretskii , Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) On 07.11.2016 18:37, Drew Adams wrote: >>> `thing-at-point' should always return a string. >> Indeed. Which would require some normalization WRT number-at-point >> etc. > `number-at-point' uses `form-at-point'. It returns a number (or nil), > not a numeral (string). It satisfies `numberp', not `stringp'. > > What normalization do you have in mind? Still think detecting buffer-substrings according to THING and returning them if found at point --nil otherwise-- is most straightforward. > (I have also `decimal-number-at-point' and `hex-number-at-point', FWIW.) > >>> `list-at-point', `form-at-point', etc. are a different >>> story - they can return anything. >> Interesting question. Maybe returns the symbol if found - nil >> otherwise? > That's what `symbol-at-point' does. Unfortunately it does more - it might change the symbol-table. Expect a passive, plain report instead. > However, since `nil' is a > symbol, `symbol-at-point' does not distinguish between finding > that symbol and not finding any symbol at point. > > The others return a thing of the given type (or nil, if none). > > `list-at-point', like `symbol-at-point', does not distinguish > between an empty list at point (buffer text "nil" or "()" or "( )" > etc.) and no list at point. The doc for `list-at-point' should in > fact say that it returns the _non-nil_ list at point, or nil if none. > > It should also return the list (quote (1 2)) when on '(1 2) (it's > broken, IMO). (I also have a function `unquoted-list-at-point'.) From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 08:15:39 2016 Received: (at 21391) by debbugs.gnu.org; 8 Nov 2016 13:15:39 +0000 Received: from localhost ([127.0.0.1]:49159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c46FX-0007fb-5Z for submit@debbugs.gnu.org; Tue, 08 Nov 2016 08:15:39 -0500 Received: from mail-pf0-f170.google.com ([209.85.192.170]:36186) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c46FV-0007fO-H2 for 21391@debbugs.gnu.org; Tue, 08 Nov 2016 08:15:37 -0500 Received: by mail-pf0-f170.google.com with SMTP id 189so108390115pfz.3 for <21391@debbugs.gnu.org>; Tue, 08 Nov 2016 05:15:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=wocUb2He0dN858plfMJeZKrcOcKnVyCnnmLmj6Jf6m8=; b=imYFvCGS5/IaOfH8+LDtA4a8Vo1DkZir25U8/IzyN3kq1hQzbak/zulc5CTbwsU30D ZJZ30UVPK3b/CoKRTl259v5a/sO9zcLsrHI/3VXzIU8+NFR6hN1WOF/+HzvltcpLqy2+ ZfX6+QdwY7TQ1YyJJFhops9o3ER4HtuZ1XRp34bjemu3B1VVwrEbguya9wXf/jOrGexs D/QzSg94AY1Ir591jG8PfN3IM3dAi7ZQJzuBoDqEUlmpWRHB+aco6SB9t6a5ZceaTYL/ 9fBMCrNe1M9EeLxzF90GTXB2uWyODiVZVazu9oUf592DMtpgevSZD3dPTp0FWT2gCgiE K+1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=wocUb2He0dN858plfMJeZKrcOcKnVyCnnmLmj6Jf6m8=; b=VeoFW/1FgKUFvQnCOi7I32JjC6aNpo/bQe98x3mSkcYm0hBBah4oC61FRhi0VyuE6n hYKNbbsTueAYYLY7Z5ASs35L8zPkfT1apjGtAs3LsnQ96Q+4DOKsi0egqua1wUlruZux XR1fkrZ32kU7zA0/RrKnbXiMaSxns76iL8CgXCtTnvACY1ze/6enDwck5uYu7fuaxXoD jq7yrv6z0LXz74C+ppZKy7zsCJuS5Dk87Plsp4mGboXGzOELOqggi9MPQE1IVKb8Sfsh GkTUvvWNQlrWyj3GjbLBi+2YBR55UdeDH1JpBC2OqxDQOFsVRuhITkdsz2fIhYxkXl9f lO6A== X-Gm-Message-State: ABUngvfs86sOnmz18GIvjse8H75+Tgj7xq/+pzgMxQ1MTKvbrk8P56BSZ+I72FpzOpC3+A== X-Received: by 10.99.98.2 with SMTP id w2mr18688099pgb.59.1478610931737; Tue, 08 Nov 2016 05:15:31 -0800 (PST) Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id g78sm48289480pfe.19.2016.11.08.05.15.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Nov 2016 05:15:31 -0800 (PST) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Tue, 8 Nov 2016 22:15:28 +0900 (JST) X-X-Sender: calancha@calancha-pc To: Dmitry Gutov Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string In-Reply-To: <25bb22e8-1388-275a-d0da-7e698acdf6da@yandex.ru> 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> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: 21391 Cc: Eli Zaretskii , 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On Mon, 7 Nov 2016, Dmitry Gutov wrote: > On 07.11.2016 22:02, Eli Zaretskii wrote: > >> Didn't the function behave that way for quite some time? If so, how >> come it's suddenly a problem? > > Someone tried to use it for the first time? I started to use it ~ 1 year ago. I want to recall that the manual says that this function returns _always_ a string: Return the @var{thing} around or next to point, as a string. (see at: doc/lispref/text.texi (Buffer Contents) But as you know, that is not true if (get thing 'thing-at-point) returns a non-nil value. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 10:04:47 2016 Received: (at 21391) by debbugs.gnu.org; 8 Nov 2016 15:04:47 +0000 Received: from localhost ([127.0.0.1]:49779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c47x8-0001tm-P4 for submit@debbugs.gnu.org; Tue, 08 Nov 2016 10:04:46 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c47x6-0001tW-JP for 21391@debbugs.gnu.org; Tue, 08 Nov 2016 10:04:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c47wy-0008Uu-6q for 21391@debbugs.gnu.org; Tue, 08 Nov 2016 10:04:39 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57577) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c47wy-0008Uq-3F; Tue, 08 Nov 2016 10:04:36 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2899 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c47wx-00053c-4T; Tue, 08 Nov 2016 10:04:35 -0500 Date: Tue, 08 Nov 2016 17:05:08 +0200 Message-Id: <83inrygggr.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-reply-to: <25bb22e8-1388-275a-d0da-7e698acdf6da@yandex.ru> (message from Dmitry Gutov on Mon, 7 Nov 2016 22:03:58 +0200) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > Cc: tino.calancha@gmail.com, 21391@debbugs.gnu.org > From: Dmitry Gutov > Date: Mon, 7 Nov 2016 22:03:58 +0200 > > Didn't the function behave that way for quite some time? If so, how > come it's suddenly a problem? > > Someone tried to use it for the first time? I'm not sure what issue we are discussing and what problem we are trying to solve. Let me take a step back and describe the situation as I see it. This bug report started because thing-at-point would signal an error for some of its calls. That bug is already fixed. Tino was unhappy with using sequencep and wanted to replace that with stringp -- fine with me, I don't object to such a change. >From my POV the issue should be closed once we agree on the predicate to use when deciding whether or not stripping the text properties is appropriate. 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 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? 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? 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. So why would we want to make such a change? What am I missing? From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 11:31:30 2016 Received: (at submit) by debbugs.gnu.org; 8 Nov 2016 16:31:30 +0000 Received: from localhost ([127.0.0.1]:49845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c49J4-0003zt-Fp for submit@debbugs.gnu.org; Tue, 08 Nov 2016 11:31:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c49J2-0003zd-BL for submit@debbugs.gnu.org; Tue, 08 Nov 2016 11:31:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c49Iw-0005g6-B6 for submit@debbugs.gnu.org; Tue, 08 Nov 2016 11:31:23 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:55138) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c49Iw-0005fy-8b for submit@debbugs.gnu.org; Tue, 08 Nov 2016 11:31:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c49Iv-0002dn-7x for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2016 11:31:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c49Iu-0005fW-Cj for bug-gnu-emacs@gnu.org; Tue, 08 Nov 2016 11:31:21 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:51705) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c49Io-0005cd-Ir; Tue, 08 Nov 2016 11:31:14 -0500 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uA8GV9vr031645 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Nov 2016 16:31:09 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.13.8) with ESMTP id uA8GV9Is026298 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Nov 2016 16:31:09 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uA8GV8LA010057; Tue, 8 Nov 2016 16:31:08 GMT MIME-Version: 1.0 Message-ID: <4b4e0908-827a-4c61-a0f5-b91e053f1f3d@default> Date: Tue, 8 Nov 2016 08:31:07 -0800 (PST) From: Drew Adams To: =?utf-8?B?QW5kcmVhcyBSw7ZobGVy?= , bug-gnu-emacs@gnu.org Subject: RE: bug#21391: 24.5; `thing-at-point' returns error when called with arguments 'number t) References: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> <1773ab35-70b1-42f9-8a8b-fe07881487d1@default> <302c1b51-e840-a2ca-5b8f-e3f64532eda8@easy-emacs.de> <2857cfd4-94db-49ae-902e-a010c0571868@default> <66b2bee0-a07f-6d51-8119-89decd6b2cae@easy-emacs.de> In-Reply-To: <66b2bee0-a07f-6d51-8119-89decd6b2cae@easy-emacs.de> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: Eli Zaretskii , Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) > >>> `thing-at-point' should always return a string. > >> > >> Indeed. Which would require some normalization WRT number-at- > >> point etc. > > > > `number-at-point' uses `form-at-point'. It returns a number (or > > nil), not a numeral (string). It satisfies `numberp', not `stringp'. > > > > What normalization do you have in mind? >=20 > Still think detecting buffer-substrings according to THING and > returning them if found at point --nil otherwise-- is most > straightforward. Sorry, but I don't follow you. Just what are you proposing? > >>> `list-at-point', `form-at-point', etc. are a different > >>> story - they can return anything. > >> > >> Interesting question. Maybe returns the symbol if found - nil > >> otherwise? > > > > That's what `symbol-at-point' does. >=20 > Unfortunately it does more - it might change the symbol-table. > Expect a passive, plain report instead. I don't understand. Please specify what you are proposing (maybe in a different bug report, if that is more appropriate). From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 11:31:12 2016 Received: (at 21391) by debbugs.gnu.org; 8 Nov 2016 16:31:12 +0000 Received: from localhost ([127.0.0.1]:49842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c49Im-0003zL-5Z for submit@debbugs.gnu.org; Tue, 08 Nov 2016 11:31:12 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:18577) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c49Ik-0003z6-TI for 21391@debbugs.gnu.org; Tue, 08 Nov 2016 11:31:11 -0500 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uA8GV4tk031544 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Nov 2016 16:31:04 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.13.8) with ESMTP id uA8GV38N025936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 8 Nov 2016 16:31:04 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id uA8GV1is014152; Tue, 8 Nov 2016 16:31:02 GMT MIME-Version: 1.0 Message-ID: Date: Tue, 8 Nov 2016 08:31:00 -0800 (PST) From: Drew Adams To: Eli Zaretskii , Dmitry Gutov Subject: RE: bug#21391: 24.5; `thing-at-point' should return a string 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>> In-Reply-To: <<83inrygggr.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)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Spam-Score: -7.8 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.8 (-------) > I'm not sure what issue we are discussing and what problem we are > trying to solve. Let me take a step back and describe the situation > as I see it. >=20 > This bug report started because thing-at-point would signal an error > for some of its calls. That bug is already fixed. Tino was unhappy > with using sequencep and wanted to replace that with stringp -- fine > with me, I don't object to such a change. >=20 > From my POV the issue should be closed once we agree on the > predicate > to use when deciding whether or not stripping the text properties is > appropriate. >=20 > 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 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? 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? >=20 > 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. >=20 > So why would we want to make such a change? What am I missing? FWIW, I agree with you here, in general. (I do not agree that thingatpt no longer has any known bugs, however. See bug #9300, which is a very important bug, to me.) On the other hand, I'm pretty sure that some Emacs Dev deciders have previously proclaimed that it is wrong for someone to exploit this "loophole" and thus have `t-a-p' return something other than a string. And, as Tino points out, the doc says clearly that it returns a string - no ifs, ands, or buts about that. So yes, enforcing returning a string would be an incompatible change. But it would (apparently) do what Emacs Dev has said the function should do, and it would do what the doc says it does ((elisp) `Buffer Contents'). Yes, deciding to enforce returning a string is outside the error that was reported in this bug report. On the other hand, the bug title is precisely, explicitly this question we are discussing now: Should `t-a-p' return a string? I can work with this either way. Long ago, I adapted my own code to fit the prescription that `t-a-p' must return a string. But I guess I could make an incompatible change to my code, to once again realign it with allowing a non-string return value. My preference, at least so far, would be for us to do the following: 1. Enforce a string return value, in the way suggested. 2. CLEARLY point out, in the high-level doc, that returning a THING at point can mean two different things: * For `thing-at-point' it means return text (a string) that names/represents a THING. * For `form-at-point' and its callers (e.g., `symbol-at-point', `list-at-point', `sexp-at-point', `number-at-point'), it means return a THING, not its name. That is, it returns an Emacs-Lisp entity - any kind of value that Lisp can return. If we do NOT go down this road, but we instead stick with what is there now (i.e., we do not enforce a string value for `t-a-p') then I think it is imperative that we point out, in the doc, that `t-a-p', like `form-at-point' and its callers, can return a Lisp THING of any kind OR a string naming such a THING, and that the former case is realized via property `thing-at-point' on the THING-argument symbol. Being clear and explicit about what it does and how will help avoid the kinds of ambiguity that have plagued this function for a long time now. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 08 19:04:30 2016 Received: (at 21391) by debbugs.gnu.org; 9 Nov 2016 00:04:30 +0000 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 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 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) 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) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: Eli Zaretskii 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> From: Dmitry Gutov Message-ID: Date: Wed, 9 Nov 2016 02:04:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 In-Reply-To: <83inrygggr.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) 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. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 09 01:35:27 2016 Received: (at submit) by debbugs.gnu.org; 9 Nov 2016 06:35:27 +0000 Received: from localhost ([127.0.0.1]:50313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4MTn-0002l0-Kk for submit@debbugs.gnu.org; Wed, 09 Nov 2016 01:35:27 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4MTm-0002ko-C9 for submit@debbugs.gnu.org; Wed, 09 Nov 2016 01:35:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4MTg-0004lC-EJ for submit@debbugs.gnu.org; Wed, 09 Nov 2016 01:35:21 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39861) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c4MTg-0004l8-B7 for submit@debbugs.gnu.org; Wed, 09 Nov 2016 01:35:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4MTf-0002sE-Az for bug-gnu-emacs@gnu.org; Wed, 09 Nov 2016 01:35:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4MTa-0004kV-DQ for bug-gnu-emacs@gnu.org; Wed, 09 Nov 2016 01:35:19 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:63222) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c4MTa-0004jB-3u for bug-gnu-emacs@gnu.org; Wed, 09 Nov 2016 01:35:14 -0500 Received: from [192.168.178.35] ([77.12.14.120]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0Lw10f-1cuBqW1LmH-017ncg; Wed, 09 Nov 2016 07:35:05 +0100 Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: bug-gnu-emacs@gnu.org 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> From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Message-ID: <492c00fc-d6ba-6842-312b-99514f55f6d1@easy-emacs.de> Date: Wed, 9 Nov 2016 07:43:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:VVNncMMhnuwvIqhr/yKRewDJpFgZX1jobPRTLT1tviPrN5+fgQs cTv+l1n5FzNv8SROPTJ9BydBaqY9JDtqIVARznSxmnWdgHw/Ks80A+WLTZy3F1KHFIGKQVx 7wZEraqvTHQ2EkxPPr9y8mmZk19LB1xXKH9bYuX9dUY2pkAUZwE6OjnAsPev5by1AaC41Jv utJq4eED4kChA5z8NNT/A== X-UI-Out-Filterresults: notjunk:1;V01:K0:lmoSaCgx1fI=:wmvsjo34TXTny1oeHq1YTP R9dh38qBKAu79V3QgYPBWDE1WXXtXkD5NW3iA4NoNmc7HOWqd38t6/ffh7A5GSyK/FIXA9P1D M1D4RiFtGdvkSAWxA/xb5EdhVEFiAuRyLTFGGI1ANdm7VuGPIBHdH08IOLWa9TmxKmW/hQRl8 JgNJWAiYY/YJEEpO/bv6+b3yftPJm2qcV1kvhjlJXQjbahi2N6lyFsnUkpa7xtj2pCCd+WDdt b8moX5I6aQh4HOhFmEGkqb7fJjFrXGtKsoY8MQf/RsK0i6SBgKuabskz5Wf/Jp2UTQF6OvX1b XjkXsXwFt0cldYuoFMLoSKzXpKrnToSKA6gb+/o149cuh89TDX3p40nRaMc0x0SThUdQrY029 m4EYhFmJ2LY7eHTR3xAY/c+Eu4O2aSc13TmTyhqipuxBNO03esPoJ+eVK7V46dwuHvFduUJl1 5XkUYeg9YoUvSZgWCqoRtVrC9WKCRTRjMTtOQrjYIvsVE2zW30DSbqjA41hdVOkkfy71Xa0Wx dVne3TVr6AcawWPFZrOqujj/BHpAV8hLrh4m728hFHEtYXaKfAfAEJQdQ6UmuGvib92cQ+B4D Y7nI4oHWzrc5XgP7O9h23FgJxYV/dssYtVIr+RCvnCljT7D2rB1fLgFC0cGRMEBvL1kg2YuOe iBDUTPD3QYsHA/l/E5w3+Nsdvo0y8tNN+vl10V6SUz+BHjItEVgNNpgrwIbCaKFKrN/2+4WGE 1fnqERf2IdLyTCIj X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: Tino Calancha , Drew Adams , Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) On 09.11.2016 01:04, Dmitry Gutov wrote: > 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. It might be worth noticing that result of thing-at-point natively is a string. In case these string is not returned for now, additional functions are called upon. For example "intern" in case of symbol-at-point, which makes me frown. ;) From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 09 10:45:19 2016 Received: (at 21391) by debbugs.gnu.org; 9 Nov 2016 15:45:19 +0000 Received: from localhost ([127.0.0.1]:51090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4V3v-0003hI-8W for submit@debbugs.gnu.org; Wed, 09 Nov 2016 10:45:19 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4V3t-0003h4-88 for 21391@debbugs.gnu.org; Wed, 09 Nov 2016 10:45:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4V3l-0004aV-2c for 21391@debbugs.gnu.org; Wed, 09 Nov 2016 10:45:12 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4V3k-0004aQ-V9; Wed, 09 Nov 2016 10:45:08 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3788 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c4V3k-0004FF-72; Wed, 09 Nov 2016 10:45:08 -0500 Date: Wed, 09 Nov 2016 17:45:08 +0200 Message-Id: <83y40sfyij.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-reply-to: (message from Dmitry Gutov on Wed, 9 Nov 2016 02:04:20 +0200) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > Cc: tino.calancha@gmail.com, 21391@debbugs.gnu.org > From: Dmitry Gutov > Date: Wed, 9 Nov 2016 02:04:20 +0200 > > 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 think I understand what you are suggesting. Can you show a proposed patch, so I could see the light? > > 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. It is consistent now. The only way to make it inconsistent is to have a 'thing-at-point' property that violates that, but we never do that in Emacs proper, so if someone else does that, it would be their bug. > > 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. I might agree when I see a concrete proposal. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 09 12:58:24 2016 Received: (at 21391) by debbugs.gnu.org; 9 Nov 2016 17:58:24 +0000 Received: from localhost ([127.0.0.1]:51187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4X8i-0006ts-In for submit@debbugs.gnu.org; Wed, 09 Nov 2016 12:58:24 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:19688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4X8g-0006tf-Qi for 21391@debbugs.gnu.org; Wed, 09 Nov 2016 12:58:23 -0500 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uA9HwGAr013100 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 9 Nov 2016 17:58:16 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id uA9HwDnC026320 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 9 Nov 2016 17:58:15 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uA9HwD8k005439; Wed, 9 Nov 2016 17:58:13 GMT MIME-Version: 1.0 Message-ID: Date: Wed, 9 Nov 2016 09:58:12 -0800 (PST) From: Drew Adams To: Dmitry Gutov , Eli Zaretskii Subject: RE: bug#21391: 24.5; `thing-at-point' should return a string 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> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Spam-Score: -8.1 (--------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.1 (--------) > 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. Oh, God, no. That would be among the most misguided proposals I've heard in a long time. That truly throws out the baby with the bathwater. It is not property `thing-at-point' that should return (a function that returns) a string; it is function `thing-at-point' that should return a string - if anything should. > And of all things enumerated in thing-at-point's docstring, That list is only an indication of some of what is possible. > IIUC only number has such problem.=20 It has no problem that I'm aware of. What's the problem? `number-at-point' returns a number, as it should. `list-at-point' returns a list, as it should, and so on. (get 'number 'thing-at-point) returns `number-at-point', which is 100% reasonable. > Which leaves third-party things, but, they will either need > to be fixed, I get the impression that your idea of what is broken and needs to be fixed is very different from mine. > or people will have to remain content not to use thing-at-point > with NO-PROPERTIES argument on them. What is "them"? What Eli has suggested is one reasonable approach: just prevent raising the stupid error. I proposed at least two other reasonable approaches. In none of those suggestions is there a problem with calling `thing-at-point' on ANY kind of THING while using non-nil NO-PROPERTIES. It is not clear what you are seeing as a problem, for which you think that requiring or prescribing that property `thing-at-point' return a (function that returns a) string is the solution. > 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. Not wanting someone to use (thing-at-point 'number) to return a number via (get 'number 'thing-at-point) is one thing. And it is already addressed by what I proposed. Not wanting to let (get 'number 'thing-at-point) to return a function that returns a number is quite another thing altogether. And it is totally uncalled for.=20 > 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). I really disagree with what seems to be your view of thingatpt.el functionality. I disagreed with it strongly in the context of bug #9300, where you were the lone voice proclaiming it. You apparently view the only use of this functionality as returning a string near (not at) point that can be used as an input default value. thingatpt.el is much more than that. It is very important that it be able to be used to test whether there (really) is a given THING _at_ point (not just somewhere near point). From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 09 18:30:30 2016 Received: (at 21391) by debbugs.gnu.org; 9 Nov 2016 23:30:30 +0000 Received: from localhost ([127.0.0.1]:51414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4cK5-0008Av-Ri for submit@debbugs.gnu.org; Wed, 09 Nov 2016 18:30:30 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:37441) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4cK4-0008Ai-9a for 21391@debbugs.gnu.org; Wed, 09 Nov 2016 18:30:28 -0500 Received: by mail-wm0-f44.google.com with SMTP id t79so330633595wmt.0 for <21391@debbugs.gnu.org>; Wed, 09 Nov 2016 15:30: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; bh=+tPGMnAF6UpejGsLILfBs04G0w1amhG8osICaoGdeJU=; b=nF4QBZwMuP7d2V8E6SxqpPLlxmnnQNYi9FMofIQoBYYpcoUMBga7ZrEEOVIIla6MCM GI3kLEd/g3UyYQBbxuXQMBVq5ctGFp7WzQ2Y7LZRVuBGK3ugOk8fIbpMjX+NtJffDWVd PgQplqpeqAN1CpEDgedd4uBH9bQ7xWo1yZF2gqnH8j400/O/sqaM+oRvcZPMs5uzrmCC 9Os4m6Q67Wm8ciGkGFvpf9QLTeq0zc8qnwUiyvNthKqJ7Ie+mV9l6sOAMEKhflQmZbOe 8JBC7XSt7myHh+wWYc2NKDXg78MUDg5ViAxQY1MVPf5Q0G2MMkJzIFe8yXGZQjOXXR54 CRVw== 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; bh=+tPGMnAF6UpejGsLILfBs04G0w1amhG8osICaoGdeJU=; b=HsyRO4l+kyEgG84rL5ovo/eVF93VR6Guf028EWzU+pgYyhodd5OGRYkS8jmri+wKXl 8C8kBcZq9msn0sYa/Bh+vGBoNa+ZTP7ouBHStq//snSUkZoAG/XnMvE0lMfzGYYdTqKk kOy6OuUrZ9HdkyMAl06rkvcL3/nazRSc35+OoPBfHp94nCcLsAZdoLqEioWP49TOo9eI kRCcSD9ffz2RAHrM2yMOtReSQwUNvFFxJaXxfGAuyVXXBNjb1gj9e0f/gQzH+6Mwfts/ Zrs8FL8YNZw7McfdupwKlcUJ/Arejb//a37CJgoW6jbDtkVilA5bWLYQYb4gYnpioknB MOEA== X-Gm-Message-State: ABUngveZ8GXR7ltrlt1T9nZOtLyOnT+3oTW+VE0mQPLL3FnPq4Cj3HO30B4kiYmrpM08jw== X-Received: by 10.194.176.40 with SMTP id cf8mr1814940wjc.68.1478734222621; Wed, 09 Nov 2016 15:30:22 -0800 (PST) Received: from [192.168.1.3] ([185.105.173.41]) by smtp.googlemail.com with ESMTPSA id w65sm2843459wmd.23.2016.11.09.15.30.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Nov 2016 15:30:21 -0800 (PST) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: Eli Zaretskii 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> <83y40sfyij.fsf@gnu.org> From: Dmitry Gutov Message-ID: <76505436-e66c-0ed3-6d7a-ce654f38ef30@yandex.ru> Date: Thu, 10 Nov 2016 01:30:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 In-Reply-To: <83y40sfyij.fsf@gnu.org> Content-Type: multipart/mixed; boundary="------------F9952C605D30E7F792E52751" Content-Language: en-US X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) This is a multi-part message in MIME format. --------------F9952C605D30E7F792E52751 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 09.11.2016 17:45, Eli Zaretskii wrote: > I don't think I understand what you are suggesting. Can you show a > proposed patch, so I could see the light? See the attached patch. Or to take a step further, we might want to deprecate the `thing-at-point' property, and recommend to only use the `bounds-of-thing-at-point' property. This way, we get the string-ness guarantee automatically, and the bounds-of-thing-at-point function will work for all things (it currently fails for `number'). >>> 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. > > It is consistent now. Put point on a number. Number is a sexp. Not all sexps are strings. (thing-at-point 'number) => 123 (thing-at-point 'sexp) => "123" That doesn't looks consistent to me. And there's no way to guess the return value type in advance without knowing which exact function is the thing's `thing-at-point' property. > The only way to make it inconsistent is to have > a 'thing-at-point' property that violates that, but we never do that > in Emacs proper, so if someone else does that, it would be their bug. number's `thing-at-point' property is not like the others. --------------F9952C605D30E7F792E52751 Content-Type: text/x-diff; name="thingatpt-number.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="thingatpt-number.diff" diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index 9920fa0..1c630f7 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -128,7 +128,7 @@ bounds-of-thing-at-point ;;;###autoload (defun thing-at-point (thing &optional no-properties) - "Return the THING at point. + "Return the THING at point as a string. THING should be a symbol specifying a type of syntactic entity. Possibilities include `symbol', `list', `sexp', `defun', `filename', `url', `email', `word', `sentence', `whitespace', @@ -145,7 +145,7 @@ thing-at-point (let ((bounds (bounds-of-thing-at-point thing))) (when bounds (buffer-substring (car bounds) (cdr bounds))))))) - (when (and text no-properties (sequencep text)) + (when (and text no-properties) (set-text-properties 0 (length text) nil text)) text)) @@ -557,6 +557,14 @@ thing-at-point-email-regexp (put 'buffer 'end-op (lambda () (goto-char (point-max)))) (put 'buffer 'beginning-op (lambda () (goto-char (point-min)))) +;; Number + +(put 'number 'thing-at-point + (lambda () + (let ((thing (thing-at-point 'sexp))) + (when (numberp (thing-at-point--read-from-whole-string thing)) + thing)))) + ;; Aliases (defun word-at-point () @@ -604,7 +612,6 @@ symbol-at-point (defun number-at-point () "Return the number at point, or nil if none is found." (form-at-point 'sexp 'numberp)) -(put 'number 'thing-at-point 'number-at-point) ;;;###autoload (defun list-at-point () "Return the Lisp list at point, or nil if none is found." --------------F9952C605D30E7F792E52751-- From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 09 18:35:33 2016 Received: (at 21391) by debbugs.gnu.org; 9 Nov 2016 23:35:33 +0000 Received: from localhost ([127.0.0.1]:51424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4cOz-0008IN-FR for submit@debbugs.gnu.org; Wed, 09 Nov 2016 18:35:33 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:35843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4cOx-0008I8-50 for 21391@debbugs.gnu.org; Wed, 09 Nov 2016 18:35:31 -0500 Received: by mail-wm0-f42.google.com with SMTP id g23so9902230wme.1 for <21391@debbugs.gnu.org>; Wed, 09 Nov 2016 15:35:31 -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=VGgD9ER9dmkvdTxk380rAkjSlI0yic2q6vyzNnIrxdA=; b=jyC9n4QfzjjKOmlc7HWgpSNsZauxoG76s8It5NAg4OXZjNYAXzYFzU7XU+3MfPnUiE YZNkgwPnq82PHxm8+6QIGbdYi8ovxXShbwn4TB84Q5jreE7Th6yes0TafuYnF7gkEBK2 rPERwYtYjW9GTJ7s8ciXKgzRnSfJMFeTEoWPmrTxgTj6c0SvboT1rbskyNCjZI4N5yIo PMjpd6qkpfhpwz6vS9SayD+TpLYSbERjxcE6d6WyWk9S7AwXp+zpheN9M44sh1Lk7Fdf pMlC8NWtSKdfYbfkSLuJgUIeO0RdsrVkfDZplh2RUXWPt0TfJKPMeHHvhZfEWUmENODQ Ke+A== 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=VGgD9ER9dmkvdTxk380rAkjSlI0yic2q6vyzNnIrxdA=; b=Uz+fcPJ9H4TD9ORjppwBV2zy/cMrffifmWrTH3kTlltXvTeazYv6WWKF+G5bGxBgON BLTmBiH4Q4Tim1ruGTrW89zqAUYy1FIgQoCGfJz7a9Gdeicn0sVNPuOBBq/BacFPzy90 mjAtHC5bwsfBB8eTp4qQ4FcrV3iVe7Sf14QqBnarvCg68yYgxzuY9F6TUEnE3RZ5eGSv EfIOq3LONaNScJCZglMPwdsFnEzuL3zi3A9LrVe4gdl4/p42zP+ZhRsQ+1VaLQHPw5YR s1OYCiz7ngjdR73qbrh+QNFcnV0YdeEooWJTu2EBzrvb7+Ez/i0GlWhdCk4Mr8Wp8xSd 8+dQ== X-Gm-Message-State: ABUngveu47pB61HpsFkzOy+xvFV1nlSWAdbYjVmk7eH6VmJvZNUmjc0hntG0b2Uwrqsnhw== X-Received: by 10.28.51.141 with SMTP id z135mr2676239wmz.109.1478734525449; Wed, 09 Nov 2016 15:35:25 -0800 (PST) Received: from [192.168.1.3] ([185.105.173.41]) by smtp.googlemail.com with ESMTPSA id k2sm2224839wjv.11.2016.11.09.15.35.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Nov 2016 15:35:24 -0800 (PST) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: Drew Adams , Eli Zaretskii 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> From: Dmitry Gutov Message-ID: <1c17de6b-2297-6e7e-9b06-e84b5b6df3eb@yandex.ru> Date: Thu, 10 Nov 2016 01:35:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On 09.11.2016 19:58, Drew Adams wrote: > It has no problem that I'm aware of. What's the problem? > `number-at-point' returns a number, as it should. > `list-at-point' returns a list, as it should, and so on. No problem there. > (get 'number 'thing-at-point) returns `number-at-point', which > is 100% reasonable. Not at all. As I've explained previously. >> or people will have to remain content not to use thing-at-point >> with NO-PROPERTIES argument on them. > > What is "them"? The third-party things. > Not wanting someone to use (thing-at-point 'number) to return > a number via (get 'number 'thing-at-point) is one thing. > And it is already addressed by what I proposed. I must have missed that proposal. > Not wanting to let (get 'number 'thing-at-point) to return a > function that returns a number is quite another thing altogether. > And it is totally uncalled for. Isn't that one and the same? > I disagreed with it strongly in the context of bug #9300, where you > were the lone voice proclaiming it. You apparently view the only > use of this functionality as returning a string near (not at) point > that can be used as an input default value. thingatpt.el is much > more than that. It is very important that it be able to be used > to test whether there (really) is a given THING _at_ point (not > just somewhere near point). That seems orthogonal to the current discussion. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 09 19:40:20 2016 Received: (at 21391) by debbugs.gnu.org; 10 Nov 2016 00:40:20 +0000 Received: from localhost ([127.0.0.1]:51481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4dPg-0001OF-JZ for submit@debbugs.gnu.org; Wed, 09 Nov 2016 19:40:20 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:21361) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4dPe-0001O2-Mz for 21391@debbugs.gnu.org; Wed, 09 Nov 2016 19:40:19 -0500 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uAA0eB51010969 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 10 Nov 2016 00:40:12 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id uAA0eBH2011162 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 10 Nov 2016 00:40:11 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uAA0eALf024896; Thu, 10 Nov 2016 00:40:10 GMT MIME-Version: 1.0 Message-ID: <8c2b4b8b-0e49-42af-a98d-d82006f90354@default> Date: Wed, 9 Nov 2016 16:40:09 -0800 (PST) From: Drew Adams To: Dmitry Gutov , Eli Zaretskii Subject: RE: bug#21391: 24.5; `thing-at-point' should return a string 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> <1c17de6b-2297-6e7e-9b06-e84b5b6df3eb@yandex.ru> In-Reply-To: <1c17de6b-2297-6e7e-9b06-e84b5b6df3eb@yandex.ru> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Spam-Score: -8.1 (--------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.1 (--------) > > (get 'number 'thing-at-point) returns `number-at-point', which > > is 100% reasonable. >=20 > Not at all. As I've explained previously. No, you have not. This is the whole point of symbol property `thing-at-point', and it always has been. What do YOU think is the point of putting property `thing-at-point' on a THING type? > > Not wanting someone to use (thing-at-point 'number) to return > > a number via (get 'number 'thing-at-point) is one thing. > > And it is already addressed by what I proposed. >=20 > I must have missed that proposal. I showed three possibilities, and I pointed out which one I prefer. The bug thread is there, in case you really missed it. > > Not wanting to let (get 'number 'thing-at-point) to return a > > function that returns a number is quite another thing altogether. > > And it is totally uncalled for. >=20 > Isn't that one and the same? Of course not. The use of (get 'number 'thing-at-point) in the definition of `thing-at-point' is only _one_ use of it. That's apparently what you've missed from the beginning: the point of symbol property `thing-at-point'. You will see things like this in thingatpt.el: (put 'url 'thing-at-point 'thing-at-point-url-at-point) (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)))))) (put 'number 'thing-at-point 'number-at-point) And that's only a few predefined uses of it. One of the main points of the library is to provide tools that you can use to define your functions that implement providing a THING at point. And by that I do not mean just a string at point that names a thing - I mean a Lisp THING (list, sexp, number, color name, file name,... whatever). It is irrelevant to the design of thingatpt.el, and its intended use cases, that the THINGs defined for `url' and `email' are string values. They are no more "normal" cases for the design than is `number'. What is important is that the design provides this functionality for _any_ kind of THING - any Lisp value. Examples of other THING-returning definitions: (put 'list 'thing-at-point 'my-list-at-point) (put 'unquoted-list 'thing-at-point 'my-unquoted-list-at-point) (put 'non-nil-symbol-name 'thing-at-point 'my-non-nil-symbol-name-at-point) (put 'symbol-name 'thing-at-point 'my-symbol-name-at-point) (put 'region-or-word 'thing-at-point 'my-region-or-word-at-point) (put 'color 'thing-at-point 'my-color-at-point) (put 'decimal-number 'thing-at-point 'my-number-at-point-decimal) (put 'hex-number 'thing-at-point 'my-number-at-point-hex) (put 'string 'thing-at-point 'my-string-at-point) Some of those THING types are strings; some are lists; some are symbols; some are numbers. The THING possibilities are limitless. Practically the entire design of thingatpt.el revolves around putting properties on THING-type symbols and function symbols. This includes property `thing-at-point'. > > I disagreed with it strongly in the context of bug #9300, where > > you were the lone voice proclaiming it. You apparently view the only > > use of this functionality as returning a string near (not at) > > point that can be used as an input default value. thingatpt.el is much > > more than that. It is very important that it be able to be used > > to test whether there (really) is a given THING _at_ point (not > > just somewhere near point). >=20 > That seems orthogonal to the current discussion. It points to the fact that you apparently have only a limited view of what thingatpt.el is for and what features it provides. You've missed two for two, so far - and important ones, at that. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 10 03:55:57 2016 Received: (at 21391) by debbugs.gnu.org; 10 Nov 2016 08:55:57 +0000 Received: from localhost ([127.0.0.1]:51636 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4l9J-0004ap-JE for submit@debbugs.gnu.org; Thu, 10 Nov 2016 03:55:57 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:34820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4l9I-0004ab-5U for 21391@debbugs.gnu.org; Thu, 10 Nov 2016 03:55:56 -0500 Received: by mail-wm0-f50.google.com with SMTP id a197so354179772wmd.0 for <21391@debbugs.gnu.org>; Thu, 10 Nov 2016 00:55:56 -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=md5oCIMVr4ItR8hSPriLG/N/XWZO8V94kE0XuxZ4M1I=; b=w1K39HNIn98Buk9vY/J+RAVnNwotAHDWhd611rjfbrmTiOp9Iq+zmUBs5O07rTuKNs WTt4IAkud1pQQ2JtW3xkAGoz9VliOQdLn2WihJJEGvMD/BMUDSRBu1XgobN0FtK9/UvQ I088qwB9vZjw+DWerpPns4LiDuStWdx4NeQ6v04rMb6ZQzA1Y4DI0cwCM/nahE44VhkE SHyUaRiGq87Fb5kA59Egi3MI1IBSw38ie26sPPpWMg/BVJQIfoF9CE0tZ9Qs5krSRA/N SZ9SLgIjcix5lDnHIYtRb9amtkrRAxeiA3zsXLDiKdWUhLpu4btRaSwJII1nf0XCyrUT SG1A== 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=md5oCIMVr4ItR8hSPriLG/N/XWZO8V94kE0XuxZ4M1I=; b=MEWtSacMQTEYGqOCERYHHhXe67M2If/uFIOR+I6YEZK5jQqvCDwDYkppeOiOWJpl/z Zd6ttbm/ee5hklIXURoPg7xYwPmF1bBG/xriBXMiLv6QyCAzYK4tavEQP7RcpSshZSWl 1hrwee9H6v4EY4220QUfLRUrPtwr+cMazrA2t3KYLetQ6qG105TS/yiyPmCgAeulRUH0 Uiz+lU6NJ2S1nJZUFgW3joorEH5cpjB6/y63Yc16BlEelahFqTlIX5+Ye5eK4HW8qAnG HehSZ7TsFChf/xPIIMJTBHmvWMLxDvpaf+khUrWN/QdMLjoqSRtQIJnlmiBaaozY+cJP cTzA== X-Gm-Message-State: ABUngvcI8LgwH73JNSQ5H+2L5FmKEu5JpZJcxQ/Hb0WsUvx0+GC2hlAbKDntp4E7dLEuPg== X-Received: by 10.194.37.198 with SMTP id a6mr4048675wjk.57.1478768150183; Thu, 10 Nov 2016 00:55:50 -0800 (PST) Received: from [192.168.1.3] ([185.105.173.41]) by smtp.googlemail.com with ESMTPSA id f76sm4918148wmd.15.2016.11.10.00.55.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Nov 2016 00:55:49 -0800 (PST) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: Drew Adams , Eli Zaretskii 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> <1c17de6b-2297-6e7e-9b06-e84b5b6df3eb@yandex.ru> <8c2b4b8b-0e49-42af-a98d-d82006f90354@default> From: Dmitry Gutov Message-ID: <52250983-13a2-98ab-05cd-04b41a048866@yandex.ru> Date: Thu, 10 Nov 2016 10:55:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 In-Reply-To: <8c2b4b8b-0e49-42af-a98d-d82006f90354@default> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On 10.11.2016 02:40, Drew Adams wrote: > What do YOU think is the point of putting property `thing-at-point' > on a THING type? Being lazy or unable to make up your mind. Or maybe some kind of micro-optimization. > You will see things like this in thingatpt.el: > > (put 'url 'thing-at-point 'thing-at-point-url-at-point) > > (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)))))) Try removing these two in your local Emacs, save and restart (maybe do a rebuild as well, to be sure). (thing-at-point 'url) and (thing-at-point 'email) will continue to work fine. > (put 'number 'thing-at-point 'number-at-point) > > And that's only a few predefined uses of it. One of the main > points of the library is to provide tools that you can use to > define your functions that implement providing a THING at point. Search my messages for the word "third-party". From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 10 11:09:00 2016 Received: (at 21391) by debbugs.gnu.org; 10 Nov 2016 16:09:00 +0000 Received: from localhost ([127.0.0.1]:52434 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4ruN-0008Ph-TG for submit@debbugs.gnu.org; Thu, 10 Nov 2016 11:09:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41869) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4ruM-0008PS-IE for 21391@debbugs.gnu.org; Thu, 10 Nov 2016 11:08:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4ruC-0004r2-Ee for 21391@debbugs.gnu.org; Thu, 10 Nov 2016 11:08:53 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4ruC-0004qu-BJ; Thu, 10 Nov 2016 11:08:48 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4738 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c4ruB-0006uh-Pk; Thu, 10 Nov 2016 11:08:48 -0500 Date: Thu, 10 Nov 2016 18:08:49 +0200 Message-Id: <83bmxnfhbi.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-reply-to: <76505436-e66c-0ed3-6d7a-ce654f38ef30@yandex.ru> (message from Dmitry Gutov on Thu, 10 Nov 2016 01:30:20 +0200) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string 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> <83y40sfyij.fsf@gnu.org> <76505436-e66c-0ed3-6d7a-ce654f38ef30@yandex.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > Cc: tino.calancha@gmail.com, 21391@debbugs.gnu.org > From: Dmitry Gutov > Date: Thu, 10 Nov 2016 01:30:20 +0200 > > See the attached patch. > > Or to take a step further, we might want to deprecate the > `thing-at-point' property, and recommend to only use the > `bounds-of-thing-at-point' property. This way, we get the string-ness > guarantee automatically, and the bounds-of-thing-at-point function will > work for all things (it currently fails for `number'). > > >>> 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. > > > > It is consistent now. > > Put point on a number. Number is a sexp. Not all sexps are strings. > > (thing-at-point 'number) => 123 > (thing-at-point 'sexp) => "123" > > That doesn't looks consistent to me. There's a tension here between consistency and backward compatibility. And since this function was "inconsistent" for a very long time, I'm not sure losing backward compatibility can be justified by consistency at this point. We'd also lose something else: some Lisp objects can be printed, but their printed representation cannot be read back. So for some objects, requiring thing-at-point to return a string would lose information. > > The only way to make it inconsistent is to have > > a 'thing-at-point' property that violates that, but we never do that > > in Emacs proper, so if someone else does that, it would be their bug. > > number's `thing-at-point' property is not like the others. Right, I succeeded to forget that since the beginning of this thread. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 10 11:19:11 2016 Received: (at 21391) by debbugs.gnu.org; 10 Nov 2016 16:19:11 +0000 Received: from localhost ([127.0.0.1]:52448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4s4F-0000Dh-6N for submit@debbugs.gnu.org; Thu, 10 Nov 2016 11:19:11 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4s4D-0000DR-0R for 21391@debbugs.gnu.org; Thu, 10 Nov 2016 11:19:09 -0500 Received: by mail-wm0-f54.google.com with SMTP id f82so41805952wmf.1 for <21391@debbugs.gnu.org>; Thu, 10 Nov 2016 08:19:08 -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=8sZyUg8FzF4+AMChqr7Tvoc6uUc2/iex+Gg+QzcG2Mg=; b=Sh7V6zR2bVs8USNaqfcE6mJlY65RdjhPTKe+53m7vEQhXcE4Nq7UX6Pw6CpuG+aMzH 4P75Q1U+gn0id9jpti+ZAtiQ3gh2P0SB6PKT6MRCabm9kofT51HU11eg4kdDemBc8Mwi PJDAe5biYbKBQkFYTOQFz45vL74CFQmTo0g9RQyMD1NKjvMaTVCcyYBCi60RFKk0zZDX f/m340HoFL04zkjcsfBo0zC2M3b9OvGNRWmfq1WDSYBY7ZzUehmjbitLyTj7HqP96D2Y WL0CUMkSIzLIerK0VUZjr+LXuXe2MABZ1RVQq+0vJ9eHk3Y+L+Thm7U3vFtHe3ocNp0h tkGA== 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=8sZyUg8FzF4+AMChqr7Tvoc6uUc2/iex+Gg+QzcG2Mg=; b=jn6v7w0TQ5oW+w9kYyulcvxZeg3vRc7br41S7EBHLMIkNhHOyHqFry9SRQwtxL9AKT JCCy8Va+YjnQwjMwe6IlizDKIzE0g+wUfWzTS0GWyUu4xAA+ibkJlCoX7hhdPHowxAA2 fC7wtNkEiuUFIbpF+is9fqPRW2IkBFnGSKWSk1O4DaaLaiBrYpnM8EXbKjrvkShRCP/J fKOvMhyeBw0CnBIqmWLU9atklY2RUM2CIhh1K/E3cFhQV5npb0xXNldCKgDCy00qdM+w RZxUomxn4RrTfR9jw1v1gNAIyX9ajz0LJ3/TKeyUCDsNPCdGsr81h1k8cGb6d7WE3Nzg X4WQ== X-Gm-Message-State: ABUngvd1hIoDs3DaH7y7ZQfizrrm7blEGZeIQKrX6IfXYQbnonAPZEosH0ysfePcgh3org== X-Received: by 10.28.69.217 with SMTP id l86mr9103292wmi.129.1478794743314; Thu, 10 Nov 2016 08:19:03 -0800 (PST) Received: from [192.168.0.133] ([212.50.99.193]) by smtp.googlemail.com with ESMTPSA id bj1sm6292369wjc.17.2016.11.10.08.19.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Nov 2016 08:19:02 -0800 (PST) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: Eli Zaretskii 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> <83y40sfyij.fsf@gnu.org> <76505436-e66c-0ed3-6d7a-ce654f38ef30@yandex.ru> <83bmxnfhbi.fsf@gnu.org> From: Dmitry Gutov Message-ID: <73600483-1df5-597c-6066-232189bbdd4a@yandex.ru> Date: Thu, 10 Nov 2016 18:19:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 In-Reply-To: <83bmxnfhbi.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On 10.11.2016 18:08, Eli Zaretskii wrote: > There's a tension here between consistency and backward compatibility. > And since this function was "inconsistent" for a very long time, I'm > not sure losing backward compatibility can be justified by consistency > at this point. I believe I've touched on this already. And another inconsistency: (bounds-of-thing-at-point 'number) always returns nil. > We'd also lose something else: some Lisp objects can be printed, but > their printed representation cannot be read back. So for some > objects, requiring thing-at-point to return a string would lose > information. We won't lose that if we go with either of my proposals: instead of printing objects inside the thing-at-point function, we would require that each returned thing is a string already. Any thing-at-point function that returns a non-string will be considered non-conformant. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 10 12:13:54 2016 Received: (at 21391) by debbugs.gnu.org; 10 Nov 2016 17:13:54 +0000 Received: from localhost ([127.0.0.1]:52537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4svB-0001YM-SB for submit@debbugs.gnu.org; Thu, 10 Nov 2016 12:13:54 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33214) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4svA-0001YA-B6 for 21391@debbugs.gnu.org; Thu, 10 Nov 2016 12:13:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4sv2-00048U-6d for 21391@debbugs.gnu.org; Thu, 10 Nov 2016 12:13:47 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4sv2-00048P-2F; Thu, 10 Nov 2016 12:13:44 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4847 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c4sv1-0005vx-BW; Thu, 10 Nov 2016 12:13:43 -0500 Date: Thu, 10 Nov 2016 19:13:46 +0200 Message-Id: <834m3ffeb9.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-reply-to: <73600483-1df5-597c-6066-232189bbdd4a@yandex.ru> (message from Dmitry Gutov on Thu, 10 Nov 2016 18:19:00 +0200) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string 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> <83y40sfyij.fsf@gnu.org> <76505436-e66c-0ed3-6d7a-ce654f38ef30@yandex.ru> <83bmxnfhbi.fsf@gnu.org> <73600483-1df5-597c-6066-232189bbdd4a@yandex.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > Cc: tino.calancha@gmail.com, 21391@debbugs.gnu.org > From: Dmitry Gutov > Date: Thu, 10 Nov 2016 18:19:00 +0200 > > > We'd also lose something else: some Lisp objects can be printed, but > > their printed representation cannot be read back. So for some > > objects, requiring thing-at-point to return a string would lose > > information. > > We won't lose that if we go with either of my proposals: instead of > printing objects inside the thing-at-point function, we would require > that each returned thing is a string already. But that's exactly my point: you cannot usefully return some objects as strings. Their text representation is much less useful than the object itself. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 10 12:28:29 2016 Received: (at 21391) by debbugs.gnu.org; 10 Nov 2016 17:28:29 +0000 Received: from localhost ([127.0.0.1]:52556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4t9I-0001uD-H5 for submit@debbugs.gnu.org; Thu, 10 Nov 2016 12:28:29 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:36561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4t9F-0001ty-S5 for 21391@debbugs.gnu.org; Thu, 10 Nov 2016 12:28:26 -0500 Received: by mail-wm0-f49.google.com with SMTP id g23so54630053wme.1 for <21391@debbugs.gnu.org>; Thu, 10 Nov 2016 09:28:25 -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=D4g6jCVkxzYw5ry/GVUgqZmmkKSjZhgy0MqMm9xvik4=; b=G/UMsHuPB8E6zmX8seJbdpmxMU3rxvgscfvoRrtLGTU5yZNUTDGb9sDLWiraomdMGN d6n5wZ57abjiNo4p6RRoKk7jDiQv0eGxqVi/X0u00J8knzMFH2vedldEiTElzhVc7nSP 0QSXUPgNDNbOW2eBBpNrivyK62QJCExQNpu9X1W3R+tnEW+cZ1nzyryvrDuO9BbOTCz9 71RmeTxCuv8pbPDjcU3g4teUBDJmsoNBY5483HNXkzFAoKrm5CTIcWCI9LB2kRJmBVGo nznrpOsjQTTAAuLb6WMc97WmajZwCmNV2kjkIfPM21H987eQIl+FCack1naYjymsuUDZ eBwg== 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=D4g6jCVkxzYw5ry/GVUgqZmmkKSjZhgy0MqMm9xvik4=; b=KvE/VB8Y3hxcgiOvrmsV4Khcsj37IYmjU9ARdUT0JmxUoZCkN/HaVIJR6dKt4YLyWT /T98gfUAtuMUWJE9dhB06sdfdJvykVOm5FTjw0Z6L+1ANR3m0NHhCllQ6RXIriXRtILg C9FRfVnBPPPgNM/woN85tId7hW3UiOGFtxutAzI+CuAxOX3dZIwfN8398LVYQbYDl4vJ wmLXLfAz3ZJJ9zCKPOQFhP2UR5MlqqWa8eFdYhM2g2Jeo+v8BTvWMGGWGoS3dH7p44tq BTU1ZUI+GmznPCISCJ3GOpT6RJnAKd5B6BS4J4APv3IUhbIwG8WyBVk2mVCAZ+gN9Gh6 uQow== X-Gm-Message-State: ABUngvdFxeYwkQgYrVFmsAppNuRMh50OQ+11PlA9YHvlHLKkZtiSWdjeuk0yYspD+cN0Rg== X-Received: by 10.194.146.228 with SMTP id tf4mr5348844wjb.183.1478798900182; Thu, 10 Nov 2016 09:28:20 -0800 (PST) Received: from [192.168.1.3] ([185.105.173.41]) by smtp.googlemail.com with ESMTPSA id v2sm6558575wja.41.2016.11.10.09.28.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Nov 2016 09:28:19 -0800 (PST) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: Eli Zaretskii 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> <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> From: Dmitry Gutov Message-ID: Date: Thu, 10 Nov 2016 19:28:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 In-Reply-To: <834m3ffeb9.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On 10.11.2016 19:13, Eli Zaretskii wrote: > But that's exactly my point: you cannot usefully return some objects > as strings. Their text representation is much less useful than the > object itself. If the consumer needs the text representation, they will call (thing-at-point 'foo) If they need the "real thing", they will call (foo-at-point) which we really expect to be defined. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 10 13:27:56 2016 Received: (at 21391) by debbugs.gnu.org; 10 Nov 2016 18:27:56 +0000 Received: from localhost ([127.0.0.1]:52625 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4u4q-0003Oe-CV for submit@debbugs.gnu.org; Thu, 10 Nov 2016 13:27:56 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:28252) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4u4o-0003OR-DE for 21391@debbugs.gnu.org; Thu, 10 Nov 2016 13:27:54 -0500 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uAAIRl02003431 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 10 Nov 2016 18:27:47 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id uAAIRkV1007958 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 10 Nov 2016 18:27:47 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id uAAIRj4Q031324; Thu, 10 Nov 2016 18:27:46 GMT MIME-Version: 1.0 Message-ID: Date: Thu, 10 Nov 2016 10:27:44 -0800 (PST) From: Drew Adams To: Dmitry Gutov , Eli Zaretskii Subject: RE: bug#21391: 24.5; `thing-at-point' should return a string 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> <83y40sfyij.fsf@gnu.org> <76505436-e66c-0ed3-6d7a-ce654f38ef30@yandex.ru> <83bmxnfhbi.fsf@gnu.org> <73600483-1df5-597c-6066-232189bbdd4a@yandex.ru> In-Reply-To: <73600483-1df5-597c-6066-232189bbdd4a@yandex.ru> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Spam-Score: -8.1 (--------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.1 (--------) > And another inconsistency: > (bounds-of-thing-at-point 'number) always returns nil. It's not an inconsistency. It's a bug. `thingatpt.el' HAS bugs. I've provided patches and filed bug reports, pointing to code that fixes things. All of that has been ignored. I've been using the fixed code for years, and so have others. In my code I do this, and things work fine: (put 'number 'tap-bounds-of-thing-at-point 'tap-bounds-of-number-at-point) (defun tap-bounds-of-number-at-point () "Return the bounds of the number represented by the numeral at point. Return nil if none is found." (and (number-at-point) (tap-bounds-of-thing-at-point 'sexp))) `bounds-of-thing-at-point' is broken. I've provided a fix for it, which you've rejected summarily, based on your own perceived "need" to force `thing-at-point' to not respect "at point" but try to return things that are only near point - things that are either here or there - no "at". > We won't lose that if we go with either of my proposals: instead of > printing objects inside the thing-at-point function, we would > require that each returned thing is a string already. Any thing-at-point > function that returns a non-string will be considered non-conformant. You want to throw out the baby with the bathwater. You have no use for what is truly useful in thingatpt. You ignore the design and insist on your own interpretation of what's "useless" or "inconsistent". From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 10 13:49:57 2016 Received: (at 21391) by debbugs.gnu.org; 10 Nov 2016 18:49:57 +0000 Received: from localhost ([127.0.0.1]:52633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4uQ9-0003uu-8W for submit@debbugs.gnu.org; Thu, 10 Nov 2016 13:49:57 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4uQ7-0003ug-6T for 21391@debbugs.gnu.org; Thu, 10 Nov 2016 13:49:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4uPy-00076f-0c for 21391@debbugs.gnu.org; Thu, 10 Nov 2016 13:49:49 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47141) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4uPx-00076U-T1; Thu, 10 Nov 2016 13:49:45 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4883 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c4uPw-0001rs-Mt; Thu, 10 Nov 2016 13:49:45 -0500 Date: Thu, 10 Nov 2016 20:49:44 +0200 Message-Id: <83twbfdvav.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-reply-to: (message from Dmitry Gutov on Thu, 10 Nov 2016 19:28:17 +0200) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string 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> <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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > Cc: tino.calancha@gmail.com, 21391@debbugs.gnu.org > From: Dmitry Gutov > Date: Thu, 10 Nov 2016 19:28:17 +0200 > > On 10.11.2016 19:13, Eli Zaretskii wrote: > > > But that's exactly my point: you cannot usefully return some objects > > as strings. Their text representation is much less useful than the > > object itself. > > If the consumer needs the text representation, they will call > > (thing-at-point 'foo) > > If they need the "real thing", they will call > > (foo-at-point) > > which we really expect to be defined. Which is again entirely backward incompatible, right? Sorry, this doesn't sound safe to me. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 10 13:55:55 2016 Received: (at 21391) by debbugs.gnu.org; 10 Nov 2016 18:55:55 +0000 Received: from localhost ([127.0.0.1]:52647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4uVv-00043w-GL for submit@debbugs.gnu.org; Thu, 10 Nov 2016 13:55:55 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:36225) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4uVu-00043j-N3 for 21391@debbugs.gnu.org; Thu, 10 Nov 2016 13:55:54 -0500 Received: by mail-wm0-f42.google.com with SMTP id g23so59041236wme.1 for <21391@debbugs.gnu.org>; Thu, 10 Nov 2016 10:55:54 -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=Dp10G+5LffYODLwTAVk3Vf9+mnMLoMEHhE1fBkJmP2I=; b=ERg4ubOlKq2WrBhkSxc/zT+Sg7xJmaVC/tCQbV7fIVSyGz0qw/XH+W5+zhvlxJrtS/ rLSCroW9ZNRUEfNj3oH6Vlk43LPat4ZivOlgcYF00GjLVpsOopo6XnWRVZBXL2Nxjxub DzqdmtRjNf/1bGe9mfHDIfbyA1OGrWqbzAG4Jr2hqiTh+XKOYRj9orzNAmtlKKcJXwUe utGMy6Jt/AekOuoVZLS/eCXPCXv3B8eQ9PQwr4eOQVJ+eJGLogDFo7baXr5om4V96hG4 jYdSFUTcbf/H3ajChG6Gs3cd9/eB8BZLGciQ8LQV82fwDaizQdnl5r1wkjCdEcJMKCHQ rD9w== 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=Dp10G+5LffYODLwTAVk3Vf9+mnMLoMEHhE1fBkJmP2I=; b=BeZNikG3JtwM0NWeLXb7RyP8yotxyeaVrsD/vgU6zgUcdr8RWkqhFHzAVUHtHEm7zz sJMgGZejV6/RfsrXhr60JyAOw4hJFt3OEPJc2LvriWdGM6a588dcEtoAk8DZ6nQPBrH5 DpvzvRUcpxinr3Hj+Dp34n8uBfTADs4rYOb8iLYHzye3uWleGK0dt8yZo4WfYNzHA7YR kQvmtSpRN1aAU7R8Uc4YJyl6Nzwct071A1MF+WmQY61galBSY28IxvEdmrhMqnIPDQPc thphD2hj81v35SZ1ZXwlzMgg4bbwBQR0rjXPoVOU170yMAQTd6ekCy6+PDqbule/cFhM RkDQ== X-Gm-Message-State: ABUngvd5+rL0TxqNMjXXJdqCAKl1ahQ9G53+qomhnPA/ui0xAPPj2wfQ7Kjib1gqlPhXSw== X-Received: by 10.28.4.199 with SMTP id 190mr30193291wme.11.1478804148906; Thu, 10 Nov 2016 10:55:48 -0800 (PST) Received: from [192.168.1.3] ([185.105.173.41]) by smtp.googlemail.com with ESMTPSA id pd2sm6954597wjb.31.2016.11.10.10.55.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Nov 2016 10:55:48 -0800 (PST) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: Eli Zaretskii 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> <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> From: Dmitry Gutov Message-ID: <73be4b9d-2df8-cc83-b873-398cb7dd043b@yandex.ru> Date: Thu, 10 Nov 2016 20:55:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 In-Reply-To: <83twbfdvav.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On 10.11.2016 20:49, Eli Zaretskii wrote: >> If the consumer needs the text representation, they will call >> >> (thing-at-point 'foo) >> >> If they need the "real thing", they will call >> >> (foo-at-point) >> >> which we really expect to be defined. > > Which is again entirely backward incompatible, right? Why do you think so? This is the normal usage of thingatpt. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 10 14:59:16 2016 Received: (at 21391) by debbugs.gnu.org; 10 Nov 2016 19:59:16 +0000 Received: from localhost ([127.0.0.1]:52688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4vVE-0005YU-FX for submit@debbugs.gnu.org; Thu, 10 Nov 2016 14:59:16 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4vVC-0005YI-OT for 21391@debbugs.gnu.org; Thu, 10 Nov 2016 14:59:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4vV3-0007t8-Fd for 21391@debbugs.gnu.org; Thu, 10 Nov 2016 14:59:09 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4vV3-0007t1-Ck; Thu, 10 Nov 2016 14:59:05 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4938 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c4vV1-0004Ae-ST; Thu, 10 Nov 2016 14:59:05 -0500 Date: Thu, 10 Nov 2016 21:59:01 +0200 Message-Id: <83pom3ds3e.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-reply-to: <73be4b9d-2df8-cc83-b873-398cb7dd043b@yandex.ru> (message from Dmitry Gutov on Thu, 10 Nov 2016 20:55:44 +0200) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string 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> <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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > Cc: tino.calancha@gmail.com, 21391@debbugs.gnu.org > From: Dmitry Gutov > Date: Thu, 10 Nov 2016 20:55:44 +0200 > > On 10.11.2016 20:49, Eli Zaretskii wrote: > > >> If the consumer needs the text representation, they will call > >> > >> (thing-at-point 'foo) > >> > >> If they need the "real thing", they will call > >> > >> (foo-at-point) > >> > >> which we really expect to be defined. > > > > Which is again entirely backward incompatible, right? > > Why do you think so? Because currently they can call thing-at-point without defining foo-at-point. AFAIU, you suggest to deny them this possibility, and force them to define foo-at-point for every foo. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 10 16:12:57 2016 Received: (at 21391) by debbugs.gnu.org; 10 Nov 2016 21:12:57 +0000 Received: from localhost ([127.0.0.1]:52733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4weW-0000WX-TV for submit@debbugs.gnu.org; Thu, 10 Nov 2016 16:12:57 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:36347) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4weV-0000WJ-Nz for 21391@debbugs.gnu.org; Thu, 10 Nov 2016 16:12:56 -0500 Received: by mail-wm0-f42.google.com with SMTP id g23so65204881wme.1 for <21391@debbugs.gnu.org>; Thu, 10 Nov 2016 13:12:55 -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=3r8OPCihtfK07dkCHNsxZdi/vP0B5QYY6EOasS+sJYw=; b=FE19HibYSxU8sGpto5v53lmWExuhiiIRAVbz41IQokLfWizzjU8ii8iAm4I9ptTq4j qqkhzqI7IvIwiSiOBVsXctAYIinIp4nCiWxQvhXD3H4OHfTB9CDmh/Ted1CCfy+32Y2p IN2dy26VoCrCw5NqUA07mEvYTdhlQj7yVesoh2pHdJwbFsoTcb0TFs0NHiMMOM9G/I2z xYGYeFSP+EXg+oPAgC5tUGJEaW+oqEqE0u7Ag2wNJxgfi5CguOn5tmUgQ5dh8RFNNAJT SOR3eJk5FotPif8HCH7jW/wyszoFXIxsthkAhYYrEwYeH7iTlaq1JwLfHeH/HqNFc1Ht VJ2Q== 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=3r8OPCihtfK07dkCHNsxZdi/vP0B5QYY6EOasS+sJYw=; b=LtIENGC+LxoMP0tQ2K4lSeDnlz0dNLaDi4oc3kw+A/p8hkzqA/5CFzTg7DPr4G4LyB RB1Va5mpAUhmN+nZ0wdw65FVySt2A9P1SRmC2pNXkn7NoXyfXCHcvH+pnUQbq6k4+Ivf WeY4DwRuQ+X4aQRIU6w7Dq6kaFNfqUhrG5VjParql59sz97u9A51MzUXxgkyKuRiihct DfAqIkTq9zAn9pmIjUOW65nneEpkRRUC8Lq7aPZHynXOgLVOjaEwAM7XYV5nqRTvdrYv /cKaUV9fWGPu+5YWQpGFOzu/mAXdNx2phVt0uMbrS8u0zjl8xY6+PVOzOPJcCGDnhn/c 9lng== X-Gm-Message-State: ABUngvewH7AcN4nB00l99N6wHmhCxqGh/lthTh2OmjflYuzk10U45Yef74U7oO39tiYMAA== X-Received: by 10.28.63.3 with SMTP id m3mr7723493wma.113.1478812369953; Thu, 10 Nov 2016 13:12:49 -0800 (PST) Received: from [192.168.1.3] ([185.105.173.41]) by smtp.googlemail.com with ESMTPSA id d184sm8343138wmd.8.2016.11.10.13.12.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Nov 2016 13:12:48 -0800 (PST) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: Eli Zaretskii 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> <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> From: Dmitry Gutov Message-ID: Date: Thu, 10 Nov 2016 23:12:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 In-Reply-To: <83pom3ds3e.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On 10.11.2016 21:59, Eli Zaretskii wrote: > Because currently they can call thing-at-point without defining > foo-at-point. AFAIU, you suggest to deny them this possibility, and > force them to define foo-at-point for every foo. They'll really have to do that only for string-unrepresentable foos. Like currently (thing-at-point 'symbol) returns a string, whereas (symbol-at-point) returns an interned symbol. That's nothing new. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 05:07:28 2016 Received: (at 21391) by debbugs.gnu.org; 11 Nov 2016 10:07:28 +0000 Received: from localhost ([127.0.0.1]:53009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c58k3-0006Tv-Rq for submit@debbugs.gnu.org; Fri, 11 Nov 2016 05:07:28 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35671) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c58k2-0006Ti-T8 for 21391@debbugs.gnu.org; Fri, 11 Nov 2016 05:07:27 -0500 Received: by mail-pf0-f194.google.com with SMTP id i88so2064887pfk.2 for <21391@debbugs.gnu.org>; Fri, 11 Nov 2016 02:07:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=Ju1cVJykpiTaZPeEea31wD9sP6maxuYJAn9fpbn4MDU=; b=gkh7BN9FQ1/xIDQ9gzhfbNJxmIH0d6KPsv9fkZY4SMWbTH10SFuFoIqQWWtr1bEHaf kVk1sfw7ZXZatS1xdEUhB2O28ziLnoe4SCPjP6OnR2QDesI2dCpnCBSj8M6Xa7fziGj+ Ye77Vk/bHshSSINFmJrqsf2ZKokzFGBhMK8VCw1y1VB75ulv6hJ7UcAZ4ksJjgjnEvvx 0DfOfT/8lcXNYbw9EwBbEbeG1o2LZOiJKztelDMKiF3qE4HvYKjOGnChQfZsqtkRLCTQ +y4iiohRLZrJcsbdqS88BMrbIZ51F325cPCr1IZqysgkDmqAX1Y5CVVKDyMWAtLGa6HL oB/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=Ju1cVJykpiTaZPeEea31wD9sP6maxuYJAn9fpbn4MDU=; b=N2oBjCBp32TPKpdKwFqq1LvxAVZszbIiU9K5brzz+zNhiPVeE+Vb8fgi9HcKlDMVhz RIv5qW+0d8xwjkpWtf6BXzjASH8j+Lv/MixgzjkNzQ/0rm6UJ/4L+aIla0F9OaJ9/4Yd FvdcRd1IEFAVGXOiLkP+98wRABZ2OsuZ08mOJZpl7mfRyLGpBaDSegoIBDpA1yR/jEMY CZWJW1T6TN1ksNV6+/Y0QGODlU8ugeFJ3IF/Er4jbKtUjDbAa86U7x/9+RckRt70hLAX B3pgIO/E3Ar7KwWoRwE3q4R6lApZ9rbl7nJ/XcVU/dtrk1a4YDoD5BnonGCe6ctKaibA wTHg== X-Gm-Message-State: ABUngvca6gdpsr2uY81rBhR3qes2XpNBMb+pMyfadowRpEN5OBK121NlJ8oF2/jpxcRIlw== X-Received: by 10.99.139.199 with SMTP id j190mr43673727pge.115.1478858841158; Fri, 11 Nov 2016 02:07:21 -0800 (PST) Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id t67sm13778665pfg.13.2016.11.11.02.07.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Nov 2016 02:07:20 -0800 (PST) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Fri, 11 Nov 2016 19:07:15 +0900 (JST) X-X-Sender: calancha@calancha-pc To: Dmitry Gutov Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string In-Reply-To: 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> <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> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 21391 Cc: Eli Zaretskii , 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) On Thu, 10 Nov 2016, Dmitry Gutov wrote: > On 10.11.2016 21:59, Eli Zaretskii wrote: > >> Because currently they can call thing-at-point without defining >> foo-at-point. AFAIU, you suggest to deny them this possibility, and >> force them to define foo-at-point for every foo. > > They'll really have to do that only for string-unrepresentable foos. > > Like currently (thing-at-point 'symbol) returns a string, whereas > (symbol-at-point) returns an interned symbol. That's nothing new. Indeed, this sounds the right usage for me, and for an user who has read the part of the manual refering to `thing-at-point'. If i want the list object i call `list-at-point', and if i just want the text representation i would call (thing-at-point 'list). The fact that we have that duality in the code, i.e. I) (thing-at-point 'foo) II) (foo-at-point) in some sense is asking for I) and II) returning two different things. I find it easier if I) always return a string. Note also that we don't need to define one version II) per each THING: just in the few cases where it has sense to return the THING with a different type than a string. We already have defined all II) functions in `thingatpt.el'. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 05:57:19 2016 Received: (at 21391) by debbugs.gnu.org; 11 Nov 2016 10:57:19 +0000 Received: from localhost ([127.0.0.1]:53026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c59WJ-0007ch-AN for submit@debbugs.gnu.org; Fri, 11 Nov 2016 05:57:19 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c59WH-0007cU-7l for 21391@debbugs.gnu.org; Fri, 11 Nov 2016 05:57:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c59W8-0004fn-Tl for 21391@debbugs.gnu.org; Fri, 11 Nov 2016 05:57:12 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33266) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c59W8-0004fi-Q8; Fri, 11 Nov 2016 05:57:08 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1441 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c59W7-0001zf-U2; Fri, 11 Nov 2016 05:57:08 -0500 Date: Fri, 11 Nov 2016 12:57:11 +0200 Message-Id: <83bmxme12w.fsf@gnu.org> From: Eli Zaretskii To: Tino Calancha In-reply-to: (message from Tino Calancha on Fri, 11 Nov 2016 19:07:15 +0900 (JST)) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string 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> <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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > From: Tino Calancha > Date: Fri, 11 Nov 2016 19:07:15 +0900 (JST) > cc: Eli Zaretskii , tino.calancha@gmail.com, > 21391@debbugs.gnu.org > > > On 10.11.2016 21:59, Eli Zaretskii wrote: > > > >> Because currently they can call thing-at-point without defining > >> foo-at-point. AFAIU, you suggest to deny them this possibility, and > >> force them to define foo-at-point for every foo. > > > > They'll really have to do that only for string-unrepresentable foos. > > > > Like currently (thing-at-point 'symbol) returns a string, whereas > > (symbol-at-point) returns an interned symbol. That's nothing new. > Indeed, this sounds the right usage for me, and for an user who has > read the part of the manual refering to `thing-at-point'. I disagree, sorry. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 09:14:06 2016 Received: (at 21391) by debbugs.gnu.org; 11 Nov 2016 14:14:06 +0000 Received: from localhost ([127.0.0.1]:53121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5Cak-0005Qv-Ic for submit@debbugs.gnu.org; Fri, 11 Nov 2016 09:14:06 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:33779) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5Caj-0005QI-Qz for 21391@debbugs.gnu.org; Fri, 11 Nov 2016 09:14:06 -0500 Received: by mail-pg0-f66.google.com with SMTP id 3so2015382pgd.0 for <21391@debbugs.gnu.org>; Fri, 11 Nov 2016 06:14:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=BCW8NT6PR7SidTqeX2xvRy0fPZKCqgxr0cQezQzLjnU=; b=bUoc2ydj6wy1YgDQjNsVyuXFaQ3V+PLxy3bVT1w9EqvduO+ESL0fmXZv8hHxKd9prG KdAmUCV4t2LibHdC5bVmL+4PnwUhm+Wk9N0hdP7rlFruwX1QWxRLTMnvj6y3YiRPvlhu UhE1u72RwfcwozHrfKXSchjY/izPsTdMQeZl97/R71DHJpiu5Qxr9qRbHpnOgJxSXlYt h40rcd+8UolqdjUTUJr2ZrfEHP78qQHaESYR6GDPB9w7iGQv7Q+HprRXyaPRu+967gtA KkCQdsKa+87PxEIPiEXTQIIoM9AC+IZlWraYMqybgWN/0E3Ar173frN/KbzH1fuxvT5J P9sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=BCW8NT6PR7SidTqeX2xvRy0fPZKCqgxr0cQezQzLjnU=; b=eMKyCCp03feo5BUO82yg0C9Jwo/GzcpWBNZyXq9UnvW4maKs+HXd9Uz/4IYtmfUxS7 Rx75i6xIn3nkAGbNlAiqYb3dvficqRhFL5W1XV4utUR+XkkpEonE2csyaxXQPG2reLRe VyXMpnpQkmczueRybTNr2w5UfGeKnTn8rvtc+9FyHxyj0Lup3deNVuPFdQcKEgTtzWu4 bWRSWoG1eoZsdjKpeqmalqwngR8Sc58BPqeQyT4lZrteKz/hy9EtStRX66f4dacplrgl Uj+Amnaq6Yng7ButV+4P+xEDWt+rbQidIpJgxa0yfRElGjbKPsR/rXZbQ4g43y5Jc1eg D9Rg== X-Gm-Message-State: ABUngvdq1kiA8uuUz8QtdZxQ552BVkcB2YpDcg5bwq25xSpXGnyfxC+GARp9OKL2NjyGSQ== X-Received: by 10.99.149.22 with SMTP id p22mr37388964pgd.21.1478873640069; Fri, 11 Nov 2016 06:14:00 -0800 (PST) Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id 3sm15652579pam.21.2016.11.11.06.13.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Nov 2016 06:13:59 -0800 (PST) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Fri, 11 Nov 2016 23:13:55 +0900 (JST) X-X-Sender: calancha@calancha-pc To: Eli Zaretskii Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string In-Reply-To: <83bmxme12w.fsf@gnu.org> 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> <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> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, dgutov@yandex.ru, Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Fri, 11 Nov 2016, Eli Zaretskii wrote: >> From: Tino Calancha >> Date: Fri, 11 Nov 2016 19:07:15 +0900 (JST) >> cc: Eli Zaretskii , tino.calancha@gmail.com, >> 21391@debbugs.gnu.org >> >>> On 10.11.2016 21:59, Eli Zaretskii wrote: >>> >>>> Because currently they can call thing-at-point without defining >>>> foo-at-point. AFAIU, you suggest to deny them this possibility, and >>>> force them to define foo-at-point for every foo. >>> >>> They'll really have to do that only for string-unrepresentable foos. >>> >>> Like currently (thing-at-point 'symbol) returns a string, whereas >>> (symbol-at-point) returns an interned symbol. That's nothing new. >> Indeed, this sounds the right usage for me, and for an user who has >> read the part of the manual refering to `thing-at-point'. > > I disagree, sorry. The current implementation makes the things harder to understand. Currently one user need to read the source code to know the actual type this function returns. Depending of what is foo in: (thing-at-point 'foo nil) you could get: 1) a non-string 2) a string with properties 3) a string without properties. That's true even after you pass nil to the second argument (see examples below). Then it's not clear to me the motivation of the second argument: if non-nil means strip the properties, i guess a nil value should means do not strip them. Let's say i want to get some things as strings keeping their properties (in this example warning face). ;; list: OK (with-temp-buffer (insert (propertize "(foo)" 'face 'warning)) (goto-char 2) (thing-at-point 'list)) => #("(foo)" 0 5 (face warning)) ;; sexp: OK (with-temp-buffer (insert (propertize "(foo)" 'face 'warning)) (goto-char 2) (thing-at-point 'sexp)) => #("foo" 0 3 (face warning)) ;; symbol: OK (with-temp-buffer (insert (propertize "(foo)" 'face 'warning)) (goto-char 2) (thing-at-point 'symbol)) => #("foo" 0 3 (face warning)) ;; filename: OK (with-temp-buffer (insert (propertize "thingatpt.el" 'face 'warning)) (goto-char 2) (thing-at-point 'filename)) => #("thingatpt.el" 0 12 (face warning)) ;; url: Opps! And the properties? (with-temp-buffer (insert (propertize "https://www.example.com" 'face 'warning)) (goto-char 2) (thing-at-point 'url)) => "https://www.example.com" ;; email: Again No properties (with-temp-buffer (insert (propertize "foo@bar.edu" 'face 'warning)) (goto-char 2) (thing-at-point 'email)) => "foo@bar.edu" ;; number: Cannot get even a string. (with-temp-buffer (insert (propertize "4" 'face 'warning)) (goto-char 1) (thing-at-point 'number)) => 4 From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 09:35:46 2016 Received: (at 21391) by debbugs.gnu.org; 11 Nov 2016 14:35:46 +0000 Received: from localhost ([127.0.0.1]:53129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5Cvi-0005wZ-FC for submit@debbugs.gnu.org; Fri, 11 Nov 2016 09:35:46 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33089) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5Cvh-0005wM-3K for 21391@debbugs.gnu.org; Fri, 11 Nov 2016 09:35:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c5CvY-0004KX-TP for 21391@debbugs.gnu.org; Fri, 11 Nov 2016 09:35:39 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5CvY-0004KT-Qc; Fri, 11 Nov 2016 09:35:36 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2594 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c5CvY-0008Qn-2d; Fri, 11 Nov 2016 09:35:36 -0500 Date: Fri, 11 Nov 2016 16:35:40 +0200 Message-Id: <834m3edqyr.fsf@gnu.org> From: Eli Zaretskii To: Tino Calancha In-reply-to: (message from Tino Calancha on Fri, 11 Nov 2016 23:13:55 +0900 (JST)) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string 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> <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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > From: Tino Calancha > Date: Fri, 11 Nov 2016 23:13:55 +0900 (JST) > cc: Tino Calancha , dgutov@yandex.ru, > 21391@debbugs.gnu.org > > The current implementation makes the things harder to understand. > Currently one user need to read the source code to know the actual > type this function returns. If that's a problem, let's improve the doc string (and the manual, if needed) to make this more clear. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 09:46:24 2016 Received: (at 21391) by debbugs.gnu.org; 11 Nov 2016 14:46:24 +0000 Received: from localhost ([127.0.0.1]:53135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5D60-0006By-Kq for submit@debbugs.gnu.org; Fri, 11 Nov 2016 09:46:24 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:33177) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5D5z-0006Bm-24 for 21391@debbugs.gnu.org; Fri, 11 Nov 2016 09:46:23 -0500 Received: by mail-wm0-f51.google.com with SMTP id c184so60780908wmd.0 for <21391@debbugs.gnu.org>; Fri, 11 Nov 2016 06:46:22 -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=/Ts6bm5U0ovAV19l6caVh9Ez7IrV1xIW83YTaedlhfs=; b=Go5g+GS7Dao3nodc5xOQw6P+ZpYLpWu4Cko7yVMjRH54IinGbmYCpHWdtnMCAv7rZG TFFgXY+ngnoNY4mtmJwfv/Yz4nwmQILz3kNVfrkCpFeLvEMxEkhjlvNSbh/WG6H/+Gcj XketLOBWbb4qWwFQf1Rf6UvJEyz/+AQeT4XPhBmRQ2qL68vziOG2cgXdXFqtANW314nS TjzpQJZk+Pvkhuxx7TcvLxf2GRAz1ZDNMG4K33CyJz8e0xMal+g7ZzuO9xXIxkVo4j0k SjWLofqnkKliGOcxkjo/Dq41btCCD6SU0LmbVZnO/3PP6jN6HV2MgOC04Bp6CRedIpJy Qccg== 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=/Ts6bm5U0ovAV19l6caVh9Ez7IrV1xIW83YTaedlhfs=; b=VdzPsclHhUaoXPYLVuFwezCG/Cu7L/6aBCf/u+1yxx2xyrjbcPlCE0sRuza6OCQJgJ X981zB8m5DubxpXc2nw4CzLqhpwyUYV+/K0cSUM9T8UV/85UZL2QqnSWwQyZBKjavDOF 5MSiB2TF5Y1UfaCY5mgfl46GpuszKHsH38TKoZNsiCTvnbbGBXXfZzFOslEpNKkCr8yh TWK/OfJES7d5kUs79NysdHla2MZtDx5trLc7K6ZKtiVqm3zpWxjsD4v83Dbg2OsyFAi+ YbCXPHGx8S8OvDsDr6ahYw8eDPXvJPblMZ2Jf1fWFpt2qjzXoCqjUjg25QUl/U18Yumv jDlA== X-Gm-Message-State: ABUngvdg2urQnbYTmXLSlNcodcdhNYKPhcJgXazELDZ2En/Tk7jrBSPSj3gjYRzXTyFe7w== X-Received: by 10.194.31.201 with SMTP id c9mr8559113wji.176.1478875577232; Fri, 11 Nov 2016 06:46:17 -0800 (PST) Received: from [192.168.0.133] ([212.50.99.193]) by smtp.googlemail.com with ESMTPSA id g10sm11820584wjw.18.2016.11.11.06.46.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Nov 2016 06:46:16 -0800 (PST) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: Eli Zaretskii , Tino Calancha References: <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> <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> From: Dmitry Gutov Message-ID: <6dbea00c-3bde-6ec3-b109-7aa205bedb5f@yandex.ru> Date: Fri, 11 Nov 2016 16:46:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 In-Reply-To: <834m3edqyr.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On 11.11.2016 16:35, Eli Zaretskii wrote: >> The current implementation makes the things harder to understand. >> Currently one user need to read the source code to know the actual >> type this function returns. > > If that's a problem, let's improve the doc string (and the manual, if > needed) to make this more clear. Improve how? By saying that the function behaves in a variety of ways, solely depending on which `thing' it is passed? That won't make it much clearer, or make it easier to follow code that uses `thing-at-point'. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 09:51:16 2016 Received: (at 21391) by debbugs.gnu.org; 11 Nov 2016 14:51:16 +0000 Received: from localhost ([127.0.0.1]:53144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5DAi-0006JJ-Ga for submit@debbugs.gnu.org; Fri, 11 Nov 2016 09:51:16 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5DAg-0006J6-Qd for 21391@debbugs.gnu.org; Fri, 11 Nov 2016 09:51:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c5DAX-00040x-24 for 21391@debbugs.gnu.org; Fri, 11 Nov 2016 09:51:09 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5DAW-00040o-Np; Fri, 11 Nov 2016 09:51:04 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2598 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c5DAV-00013w-Vx; Fri, 11 Nov 2016 09:51:04 -0500 Date: Fri, 11 Nov 2016 16:51:08 +0200 Message-Id: <8337iydq8z.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-reply-to: <6dbea00c-3bde-6ec3-b109-7aa205bedb5f@yandex.ru> (message from Dmitry Gutov on Fri, 11 Nov 2016 16:46:14 +0200) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string References: <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> <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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > Cc: 21391@debbugs.gnu.org > From: Dmitry Gutov > Date: Fri, 11 Nov 2016 16:46:14 +0200 > > On 11.11.2016 16:35, Eli Zaretskii wrote: > > >> The current implementation makes the things harder to understand. > >> Currently one user need to read the source code to know the actual > >> type this function returns. > > > > If that's a problem, let's improve the doc string (and the manual, if > > needed) to make this more clear. > > Improve how? By saying that the function behaves in a variety of ways, > solely depending on which `thing' it is passed? Improve it by describing whatever it is that is evident from the code that is not evident from the doc string. > That won't make it much clearer, or make it easier to follow code that > uses `thing-at-point'. I don't understand why. It's not like we don't have other functions that can return different kinds of objects. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 09:57:36 2016 Received: (at 21391) by debbugs.gnu.org; 11 Nov 2016 14:57:36 +0000 Received: from localhost ([127.0.0.1]:54060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5DGq-0006gN-8Q for submit@debbugs.gnu.org; Fri, 11 Nov 2016 09:57:36 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:38763) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5DGp-0006gB-JW for 21391@debbugs.gnu.org; Fri, 11 Nov 2016 09:57:35 -0500 Received: by mail-wm0-f53.google.com with SMTP id f82so96494355wmf.1 for <21391@debbugs.gnu.org>; Fri, 11 Nov 2016 06:57:35 -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=COaUZMa+8QLMySz/9eGQtrqVeNkE8rZGnHkFeumYjJ0=; b=JLyGx4ZmLnx1rKtI/0zhXfyfVpaw7MMX0wTw15e0WiTZtrGT8O8hhJwdOH0fjeC9bj NdGacwuHlBozaVZmTnDqX29cmgzu/KXnLMja6/6cm8ysy+MCW7FW4Zkla/7fdokCT3qy QEQ5cngWtmx7xGLzfvZWEDrZASVOWGvzoey/Wq7zLJOVxn+I8odlMY5/TRRGkivHqxla uew+sapH3nmHnZKqDCf1MSzZaQc5BQoWxBGDymhstEvlXH1eBl11pzGiAaFynobFaSUn 7ae0ykh2uyba8tEqNTb4AXPLaxxBj3bylDMOUQ6q09+gRhoLGQXbZRghX3awgTdW65qL ta9Q== 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=COaUZMa+8QLMySz/9eGQtrqVeNkE8rZGnHkFeumYjJ0=; b=XmeIQ+u7W5+2fEol1ZratmOD8VQd6vGEBefDYmmEQYJ6OlrXaJSRifXTi+Ra6lAOij 08+RI4Bf1TbV7PvpKTwK2SuIkW38oyVo4WHhvorME/I1/FBv4px+JjCULiJmje53Drz8 Jiq1JbfxNx7eF9zuuFoBy4NvRCCrAELxPxmFd6JiGnBNq68nnZmTJso2HBg5hnQyACnD MUs+Q4oszu5IO6UpzIYaMlZ6iVwMrx/as4qAGYcdFBk06hz8POF25K21D4QMlTo0LESf 5qN+BNdAar4HSe4tl284z4IOKXipJtJy41qXjstQfNEBBzCaREXSIogImMwmrWoGzHlv zh2Q== X-Gm-Message-State: ABUngvcFKB6etqF0D50Et4zTt4QdNWJ5u/kh7sfhQvZWYlWbJqZUvQqRy9oEIc/ra7FoQg== X-Received: by 10.28.234.85 with SMTP id i82mr4666907wmh.6.1478876249892; Fri, 11 Nov 2016 06:57:29 -0800 (PST) Received: from [192.168.0.133] ([212.50.99.193]) by smtp.googlemail.com with ESMTPSA id q7sm11917533wjh.9.2016.11.11.06.57.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Nov 2016 06:57:29 -0800 (PST) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: Eli Zaretskii References: <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> <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> From: Dmitry Gutov Message-ID: Date: Fri, 11 Nov 2016 16:57:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 In-Reply-To: <8337iydq8z.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On 11.11.2016 16:51, Eli Zaretskii wrote: > Improve it by describing whatever it is that is evident from the code > that is not evident from the doc string. So we will enumerate how every built-in "thing" behaves? That still won't account for the third-party ones. > I don't understand why. It's not like we don't have other functions > that can return different kinds of objects. Because there is no rhyme or reason in the current behavior, no matter how you want to look at it. E.g. symbols or sexps are not strings, and yet (thing-at-point 'symbol) and (thing-at-point 'sexp) return strings (or nil). From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 10:06:06 2016 Received: (at 21391) by debbugs.gnu.org; 11 Nov 2016 15:06:06 +0000 Received: from localhost ([127.0.0.1]:54069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5DP4-0006tx-AZ for submit@debbugs.gnu.org; Fri, 11 Nov 2016 10:06:06 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35133) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5DP3-0006tT-7V for 21391@debbugs.gnu.org; Fri, 11 Nov 2016 10:06:05 -0500 Received: by mail-pg0-f66.google.com with SMTP id p66so2103894pga.2 for <21391@debbugs.gnu.org>; Fri, 11 Nov 2016 07:06:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=dG7Ki3Y/0e9LYwsI3iHr1Qi3qouUs5LUYt4JYf4R5ro=; b=0+zToRlblptvLZy/t2FAlVxVLixmsx7O79Dzc/xnhF94otgH6SBYGs+s6sE/iGmvMt e7mBOm4Q7Sw31tk++u/YlvofeLKT6EqRC9nA4mdn4ui0ZlDrARsxQAbNzfa46MRlVZH0 6NrdrEY4rCd1+pdjKn1zKP4KWcv8JZN2REV9Eni+Nx5bf+gSCCawnx2yLoMdej9EfYj1 pbESY5VVF+WowqsD843K/bodVEs4DtY2bXA6vkEeJcYma6lFnyH9FFSuUgfU4P207jh9 /EWEmbtBja6ih45xp/VjTLsYZ69ktpE5zr00iIhs1B2jHsT7wN1OS1wdhJKuTH3qf4ts sYmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=dG7Ki3Y/0e9LYwsI3iHr1Qi3qouUs5LUYt4JYf4R5ro=; b=OdupTjhabRMStB68afgeu4Q6fItiO85B7Hj4HO7jt8ld/RTSeQ/5WqO5sKPxYfl8L3 OI/yF5n+XR6LDFTgrySeBsdps+mWYC0zYbId1u/GwKRM1ifrZO4p4q3iaPukALvZxsPe pWCw4uZ/jf1sQ1mhSX2Ze3m6MWAO491JoxEIHvPzm7Cd9w0jaUEAkz/Vjy5TamcbzkKk 47HOEpAcQcsE/XjMIuPMGiPvCQ8D5kH2URCYCFCx4h5YosS16+hW0Wc0MhdSf1HKNZli hpmhuO7vCsm2N4rg+g1FB8jCjgOFVGmqYgbCB1xdyuzDqUYC9BXBUS798Mgv9QZS6Tb8 xjMA== X-Gm-Message-State: ABUngvdtRFgjokaf/91g62ykE6A7VKTVi0QXcgWVnolRtbvSa49TrI2mOfF6UlE033jgGA== X-Received: by 10.99.67.7 with SMTP id q7mr8531733pga.45.1478876759668; Fri, 11 Nov 2016 07:05:59 -0800 (PST) Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id y200sm15921481pfb.16.2016.11.11.07.05.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Nov 2016 07:05:59 -0800 (PST) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Sat, 12 Nov 2016 00:05:56 +0900 (JST) X-X-Sender: calancha@calancha-pc To: Eli Zaretskii Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string In-Reply-To: <8337iydq8z.fsf@gnu.org> Message-ID: References: <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> <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> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Fri, 11 Nov 2016, Eli Zaretskii wrote: >> Cc: 21391@debbugs.gnu.org >> From: Dmitry Gutov >> Date: Fri, 11 Nov 2016 16:46:14 +0200 >> >> On 11.11.2016 16:35, Eli Zaretskii wrote: >> >>>> The current implementation makes the things harder to understand. >>>> Currently one user need to read the source code to know the actual >>>> type this function returns. >>> >>> If that's a problem, let's improve the doc string (and the manual, if >>> needed) to make this more clear. >> >> Improve how? By saying that the function behaves in a variety of ways, >> solely depending on which `thing' it is passed? > > Improve it by describing whatever it is that is evident from the code > that is not evident from the doc string. > >> That won't make it much clearer, or make it easier to follow code that >> uses `thing-at-point'. > > I don't understand why. It's not like we don't have other functions > that can return different kinds of objects. Yes, and it's a good thing when it results in a simpler code. I don't think in this case it makes a simpler code or a code easier to follow, kinda the opposite. I don't think we actually need a polymorphic function here with the bizarre behaviour pointed out in my previous email. Instead of document its counter-intuitive behaviour, i would go for fixing the function to do just one obvious thing. It would save the users time reading the manual. It's a change for better, a good thing. We will have a better function. Everyone will be happy with this. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 10:31:23 2016 Received: (at 21391) by debbugs.gnu.org; 11 Nov 2016 15:31:23 +0000 Received: from localhost ([127.0.0.1]:54074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5DnX-0007Up-EH for submit@debbugs.gnu.org; Fri, 11 Nov 2016 10:31:23 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47861) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5DnV-0007UU-S7 for 21391@debbugs.gnu.org; Fri, 11 Nov 2016 10:31:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c5DnG-0002lc-Fd for 21391@debbugs.gnu.org; Fri, 11 Nov 2016 10:31:09 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5DnG-0002lV-Ct; Fri, 11 Nov 2016 10:31:06 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2610 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c5DnF-0006rw-LG; Fri, 11 Nov 2016 10:31:06 -0500 Date: Fri, 11 Nov 2016 17:31:09 +0200 Message-Id: <831syidoea.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-reply-to: (message from Dmitry Gutov on Fri, 11 Nov 2016 16:57:20 +0200) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string References: <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> <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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > Cc: tino.calancha@gmail.com, 21391@debbugs.gnu.org > From: Dmitry Gutov > Date: Fri, 11 Nov 2016 16:57:20 +0200 > > On 11.11.2016 16:51, Eli Zaretskii wrote: > > > Improve it by describing whatever it is that is evident from the code > > that is not evident from the doc string. > > So we will enumerate how every built-in "thing" behaves? No, we won't, not unless you and Tino say that's what you think should be there. > > I don't understand why. It's not like we don't have other functions > > that can return different kinds of objects. > > Because there is no rhyme or reason in the current behavior, no matter > how you want to look at it. The reason is that it existed in this form for the last 19 years. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 10:37:16 2016 Received: (at 21391) by debbugs.gnu.org; 11 Nov 2016 15:37:16 +0000 Received: from localhost ([127.0.0.1]:54082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5DtE-0007dQ-BX for submit@debbugs.gnu.org; Fri, 11 Nov 2016 10:37:16 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5DtC-0007dD-4Q for 21391@debbugs.gnu.org; Fri, 11 Nov 2016 10:37:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c5Dt3-0004YT-Qv for 21391@debbugs.gnu.org; Fri, 11 Nov 2016 10:37:08 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5Dt3-0004YP-Nx; Fri, 11 Nov 2016 10:37:05 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2614 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c5Dt2-0004u0-SA; Fri, 11 Nov 2016 10:37:05 -0500 Date: Fri, 11 Nov 2016 17:37:08 +0200 Message-Id: <83y40qc9jv.fsf@gnu.org> From: Eli Zaretskii To: Tino Calancha In-reply-to: (message from Tino Calancha on Sat, 12 Nov 2016 00:05:56 +0900 (JST)) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string References: <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> <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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.9 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.9 (-------) > From: Tino Calancha > Date: Sat, 12 Nov 2016 00:05:56 +0900 (JST) > cc: Dmitry Gutov , tino.calancha@gmail.com, > 21391@debbugs.gnu.org > > > I don't understand why. It's not like we don't have other functions > > that can return different kinds of objects. > Yes, and it's a good thing when it results in a simpler code. > I don't think in this case it makes a simpler code or a code > easier to follow, kinda the opposite. I can envision it being used to simplify code as well, but I don't think this is the important point. > I don't think we actually need a polymorphic function here with the > bizarre behaviour pointed out in my previous email. Instead of document > its counter-intuitive behaviour, i would go for fixing the function to do > just one obvious thing. It would save the users time reading the manual. > It's a change for better, a good thing. We will have a better > function. Everyone will be happy with this. I understand, but backward compatibility is more important in my eyes. I can suggest adding a new function, with the features you mention. We could even deprecate thing-at-point and advise to use the new one instead. But I don't see here a reason good enough to change a long-standing behavior of thing-at-point in backward-incompatible ways, sorry. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 13 20:52:34 2016 Received: (at 21391) by debbugs.gnu.org; 14 Nov 2016 01:52:34 +0000 Received: from localhost ([127.0.0.1]:56221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c66Rm-0007Ob-2F for submit@debbugs.gnu.org; Sun, 13 Nov 2016 20:52:34 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:36065) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c66Rk-0007OP-89 for 21391@debbugs.gnu.org; Sun, 13 Nov 2016 20:52:32 -0500 Received: by mail-wm0-f44.google.com with SMTP id g23so72996441wme.1 for <21391@debbugs.gnu.org>; Sun, 13 Nov 2016 17:52:32 -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=Rssjcf6B5TQp4HVPvwUkNZjm0dDFLlPPKYFnpVUFdDc=; b=BidH9Em2B9DLcuo4Mo2R6loCCli1oEVLZ3nntnHLhfE2yd5pxz7UQkreuwYde+915C S+HtA7tLTc65FbDRcDcuwsG1nHKLznWwi/jySaL8DQq5S6q2OFaSLkaL+jx6bVsiOTAS 7c5BUR/HDXqXVrrrN4y9uwolLCapuI3xvrD+rQ+dGVssWeepVMh0z5chNlmMa99dfYy3 0R0O5tsO7GHiBNP4wfRnhmX1UyWGsgoAo48pbsbznvmNxHY+6Htqqt4rOsynYOqSVd1B POoxaMwHdgk2aY3DnyI5Eg8NqRBvl1GHMGmg2ldQ+esB8eXzq2FhbSrRBvvhbCJkfetY ji7w== 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=Rssjcf6B5TQp4HVPvwUkNZjm0dDFLlPPKYFnpVUFdDc=; b=dbynMBAW4MP5Yv//AUb/i7gaGAMAaNiyP1+aFpYVbpkFxBntMcmAJk9MV+tHqCeMBx IIigoJOuyxgsgRicYiG4euIH0QMC2Um1ErGmocKlxuoNsqnFMLRbMKjQICVsCvP/hGvF 0GwrP2jLDVJmW9fehjaE3I+YfRbzZH3ETRUzvGIXI/dSog6rGhdwESJEr18ruJyIyUnc 4UE59PTnRPflpCvCNwupnueF6NtVUR9V/Ff+l4fmwJyXW1wu+nVHWEOmrihu70b0ksxE qeakYVNXh6+DE4lg+intuhpP4qP5wS7XnDUj6uUsQjWMwco1k/jgbaBctHWTvmTQPZX3 GyNQ== X-Gm-Message-State: ABUngvfyiYdFfcbxyvgsVMuF77sqie2ff0kRtxMZlNJ7wqAuF6DwNWPj+KWLQ3dqZHjXtA== X-Received: by 10.28.128.198 with SMTP id b189mr7854384wmd.105.1479088346540; Sun, 13 Nov 2016 17:52:26 -0800 (PST) Received: from [192.168.1.3] ([185.105.173.41]) by smtp.googlemail.com with ESMTPSA id r138sm19031889wme.9.2016.11.13.17.52.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Nov 2016 17:52:25 -0800 (PST) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: Eli Zaretskii , Tino Calancha 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> From: Dmitry Gutov Message-ID: Date: Mon, 14 Nov 2016 03:52:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0 MIME-Version: 1.0 In-Reply-To: <83y40qc9jv.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On 11.11.2016 17:37, Eli Zaretskii wrote: > I can suggest adding a new function, with the features you mention. > We could even deprecate thing-at-point and advise to use the new one > instead. In this vein, I would propose deprecating `thing-at-point' in favor of `bounds-of-thing-at-point', which should provide all the necessary information for a `buffer-substring' call anyway (when it works). From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 13 21:44:04 2016 Received: (at 21391) by debbugs.gnu.org; 14 Nov 2016 02:44:04 +0000 Received: from localhost ([127.0.0.1]:56248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c67Fc-0000FM-9J for submit@debbugs.gnu.org; Sun, 13 Nov 2016 21:44:04 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:16645) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c67Fa-0000Ee-QJ for 21391@debbugs.gnu.org; Sun, 13 Nov 2016 21:44:03 -0500 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uAE2hu4T030431 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 14 Nov 2016 02:43:56 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id uAE2htXw014430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 14 Nov 2016 02:43:56 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uAE2hsbK024505; Mon, 14 Nov 2016 02:43:54 GMT MIME-Version: 1.0 Message-ID: Date: Sun, 13 Nov 2016 18:43:52 -0800 (PST) From: Drew Adams To: Dmitry Gutov , Eli Zaretskii , Tino Calancha Subject: RE: bug#21391: 24.5; `thing-at-point' should return a string 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> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) > > I can suggest adding a new function, with the features you > > mention. We could even deprecate thing-at-point and advise > > to use the new one instead. >=20 > In this vein, I would propose deprecating `thing-at-point' in favor > of `bounds-of-thing-at-point', which should provide all the necessary > information for a `buffer-substring' call anyway (when it works). This is really going from bad to worse. But I can't say I'm surprised. Eli suggested to keep the behavior backward-compatible, rather than ensuring that the return value is a string. That is a reasonable approach. It's OK by me. It is the 2nd of the 3 approaches I described as reasonable=20 (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D21391#52): d> 2. Make `thing-at-point', as before, return just what the firat `if' clause returns, if that clause is taken. IOW, move the removal of text properties (from non-nil NO-PROPERTIES) into the second `if' clause. Can we please just do that, and stop f__ing with thingatpt? I also suggested that we do this, in that case: d> Point out, in the doc, that `t-a-p', like `form-at-point' and its callers, can return a Lisp THING of any kind OR a string naming such a THING, and that the former case is realized via property `thing-at-point' on the THING-argument symbol. That's important. The use of symbol property `thing-at-point' is one of the most important features of library `thingatpt.el'. Pointing out `thing-at-point' in the doc without pointing out this feature is letting users down. Each of the 3 approaches I described is reasonable. What is not so reasonable are the kinds of changes you are suggesting now. If you are really entertaining removing existing functionality then I would suggest you remove (deprecate) the NO-PROPERTIES argument that was added fairly recently. It is unnecessary, and its addition was apparently completely gratuitous. Did that action correspond to a bug fix or a user request? I cannot imagine that it did. Are we going to start adding a NO-PROPERTIES arg to _every_ function that can return a string? If not, why does it make sense here? How hard is it to remove the properties of a string? From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 14 05:18:41 2016 Received: (at submit) by debbugs.gnu.org; 14 Nov 2016 10:18:41 +0000 Received: from localhost ([127.0.0.1]:56377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6ELZ-00036c-4p for submit@debbugs.gnu.org; Mon, 14 Nov 2016 05:18:41 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6ELY-00036Q-Bd for submit@debbugs.gnu.org; Mon, 14 Nov 2016 05:18:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6ELS-0000RN-Je for submit@debbugs.gnu.org; Mon, 14 Nov 2016 05:18:35 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_50,RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44272) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c6ELS-0000Qv-GF for submit@debbugs.gnu.org; Mon, 14 Nov 2016 05:18:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6ELR-0003Ho-CT for bug-gnu-emacs@gnu.org; Mon, 14 Nov 2016 05:18:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6ELN-0000Jz-Dj for bug-gnu-emacs@gnu.org; Mon, 14 Nov 2016 05:18:33 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:57044) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c6ELN-0000Ik-3h for bug-gnu-emacs@gnu.org; Mon, 14 Nov 2016 05:18:29 -0500 Received: from [192.168.178.35] ([77.12.36.75]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MR7Py-1cEZF41dvC-00UNrS; Mon, 14 Nov 2016 11:18:20 +0100 Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: bug-gnu-emacs@gnu.org References: <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> From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Message-ID: Date: Mon, 14 Nov 2016 11:26:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:tfX32hSIDulC23P2aCUsKyv95utTbGaZS6qtZZh18NIiKbVK9rG q0Tqr/iGMn8MfXpcfs69tkLzPwg6TEC0KcRUlC7XYljHRdJ/SKlumyu7eu3r90PCTd0UXJF D+V4wMOrI/RpjUn+wMcLULDKaKqW+MFOHQd15j9Z5FeJJEP1Wrq7HFBHsWGjXO8F/8UdQi7 S+aQdGYGGpLQXMxl+Nihg== X-UI-Out-Filterresults: notjunk:1;V01:K0:iw27Hlf6eq4=:h9PjenN90cjIQQGJ2ZajNa S7ygIi4YM+bUV82igyCquazs4yvVIiwZqHJZ9UdlLq99q2HBRfDgN8bs1dRuDiDvh232I4U1b 6KNk62FT/j7nGjqrwwKCFygoNrZK+D688jhITF1iVEwl5RAWTpfo5aruEfHwa1DuVQUdJG9Cm w7K6XMi/6cjjlGemnb0gHwBjUY1Cw7Nut8LY+nJv43iLZJAHBU2LPBIvexYsSPmV9XPwoEVOf sxH8egzHESqEZaxOeL4TkQzzDQhFVnI6DEJNgsmuJvBrMH55NflyOZQ/KgqZ8vxKD2tQjXI2S eQOlH6WtQqiceH/00gSFNtsY9sTR0FwYT6PRodkhlmMAo8EwHd8/ANsE14TXVYhGXC+TBCT4o 0tNekM6a2FOtbtRfUcP8wQ8RbvMAuFJzb3vAVOB6CnKawhOK83aiJny2Utbqiuwq0keXbAJL9 6ezqPvS/M9gjJC6QGTGHxwGCh5x1MHxRuW2FYTIHfsc/POgasDZF3sPI0Oe0TYRrz9CbMqYqz F/VPjthE7XpAKj7lWzYDcuqLp3516p1ZbIsireQ0mKo9dtdvrHCbQkSvU/tvkY6FLAtBqk/Le WLnEfZUTVV7G1gb2lrw4DDvIS9sb9APiEb2QIi6RBlM0HjbWNXeoTUg8p6uLiekjmS90bmKI6 CUwYOsDMNPwkjm0n+N5RUucU+4IBXyYMhjC6U67N5tAuNwg== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.5 (----) X-Debbugs-Envelope-To: submit Cc: Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.5 (----) On 14.11.2016 03:43, Drew Adams wrote: >>> I can suggest adding a new function, with the features you >>> mention. We could even deprecate thing-at-point and advise >>> to use the new one instead. >> In this vein, I would propose deprecating `thing-at-point' in favor >> of `bounds-of-thing-at-point', which should provide all the necessary >> information for a `buffer-substring' call anyway (when it works). > This is really going from bad to worse. But I can't say I'm > surprised. > > Eli suggested to keep the behavior backward-compatible, rather > than ensuring that the return value is a string. That is a > reasonable approach. It's OK by me. IMHO the current design is really confusing and shouldn't be kept. Look at the start of thing-at-point implementation: 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. Next clause deals with buffer-substring - which is thing-at-point about in my understanding. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 14 10:19:49 2016 Received: (at submit) by debbugs.gnu.org; 14 Nov 2016 15:19:49 +0000 Received: from localhost ([127.0.0.1]:57222 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6J2z-00045o-Cw for submit@debbugs.gnu.org; Mon, 14 Nov 2016 10:19:49 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6J2x-00045b-Qb for submit@debbugs.gnu.org; Mon, 14 Nov 2016 10:19:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6J2r-0005gY-JO for submit@debbugs.gnu.org; Mon, 14 Nov 2016 10:19:42 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42112) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c6J2r-0005g7-Fq for submit@debbugs.gnu.org; Mon, 14 Nov 2016 10:19:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6J2q-0002TF-Bm for bug-gnu-emacs@gnu.org; Mon, 14 Nov 2016 10:19:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6J2m-0005ba-4B for bug-gnu-emacs@gnu.org; Mon, 14 Nov 2016 10:19:40 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:24255) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c6J2l-0005al-SO for bug-gnu-emacs@gnu.org; Mon, 14 Nov 2016 10:19:36 -0500 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uAEFJV7w008869 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 14 Nov 2016 15:19:31 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id uAEFJVAa025889 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 14 Nov 2016 15:19:31 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uAEFJTEd020735; Mon, 14 Nov 2016 15:19:29 GMT MIME-Version: 1.0 Message-ID: Date: Mon, 14 Nov 2016 07:19:28 -0800 (PST) From: Drew Adams To: =?utf-8?B?QW5kcmVhcyBSw7ZobGVy?= , bug-gnu-emacs@gnu.org Subject: RE: bug#21391: 24.5; `thing-at-point' should return a string References: <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> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) > Look at the start of thing-at-point implementation: >=20 > if (get thing 'thing-at-point) > (funcall (get thing 'thing-at-point)) >=20 > AFAIU an arbitrary function might be stored here, no real > relation to thing-at-point at all. ANY time you use a function as a parameter (passed as an argument, obtained as the value of a variable, or picked up in some other way, such as here) there is little or no control over the nature of that function in the function that makes use of it. It is up to the code that provides the function to provide an appropriate function (DTRT). > Next clause deals with buffer-substring - which is > thing-at-point about in my understanding. Your understanding is partial, then. Thing-at-point has been, from the outset, about actual Lisp THINGS, not just strings that name such things. Yes, string-naming-a-thing is a common use case - the most common, currently. But it is only part of the story. And yes, buffer text is usually examined to come up with the returned THING. But the buffer text need not be examined. What is most significant is point - the buffer position. And even that could be ignored by the function that comes up with an appropriate THING to return. thingatpt.el is much more general, and offers many more possibilities, than just grabbing some text at or near point. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 14 10:34:09 2016 Received: (at 21391) by debbugs.gnu.org; 14 Nov 2016 15:34:09 +0000 Received: from localhost ([127.0.0.1]:57254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6JGr-0004VR-LQ for submit@debbugs.gnu.org; Mon, 14 Nov 2016 10:34:09 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6JGq-0004VC-It for 21391@debbugs.gnu.org; Mon, 14 Nov 2016 10:34:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6JGi-0005Du-5i for 21391@debbugs.gnu.org; Mon, 14 Nov 2016 10:34:03 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6JGi-0005Dk-35; Mon, 14 Nov 2016 10:34:00 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1883 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c6JGf-00046R-FS; Mon, 14 Nov 2016 10:33:57 -0500 Date: Mon, 14 Nov 2016 17:34:08 +0200 Message-Id: <83a8d2hy8f.fsf@gnu.org> From: Eli Zaretskii To: Drew Adams In-reply-to: (message from Drew Adams on Sun, 13 Nov 2016 18:43:52 -0800 (PST)) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.8 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.8 (-------) > Date: Sun, 13 Nov 2016 18:43:52 -0800 (PST) > From: Drew Adams > Cc: 21391@debbugs.gnu.org > > d> 2. Make `thing-at-point', as before, return just what the > firat `if' clause returns, if that clause is taken. > IOW, move the removal of text properties (from non-nil > NO-PROPERTIES) into the second `if' clause. Why would we want to do that? AFAIU, it would require the function that is the value of the thing-at-point property to second-guess what the caller of thing-at-point wants, something it has no means to do. If thing-at-point is called with NO-PROPERTIES non-nil, and the thing-at-point property returns a string, then any properties should be removed from that string, exactly as in the other case. I don't see why we should single out that one use case. I think the only change that makes sense at this point is to replace sequencep by stringp, as Tino originally proposed. Other than that, there are no problems here that we need to solve. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 14 10:36:05 2016 Received: (at 21391) by debbugs.gnu.org; 14 Nov 2016 15:36:05 +0000 Received: from localhost ([127.0.0.1]:57260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6JIj-0004Yt-1g for submit@debbugs.gnu.org; Mon, 14 Nov 2016 10:36:05 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42067) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6JIi-0004YO-3E for 21391@debbugs.gnu.org; Mon, 14 Nov 2016 10:36:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6JIZ-00064T-UF for 21391@debbugs.gnu.org; Mon, 14 Nov 2016 10:35:59 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38453) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6JIZ-00064O-R4; Mon, 14 Nov 2016 10:35:55 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1885 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c6JIZ-0004KG-7p; Mon, 14 Nov 2016 10:35:55 -0500 Date: Mon, 14 Nov 2016 17:36:07 +0200 Message-Id: <838tsmhy54.fsf@gnu.org> From: Eli Zaretskii To: Andreas =?utf-8?Q?R=C3=B6hler?= In-reply-to: (message from Andreas =?utf-8?Q?R=C3=B6hler?= on Mon, 14 Nov 2016 11:26:54 +0100) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string References: <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> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.8 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.8 (-------) > 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 14 11:24:44 2016 Received: (at 21391) by debbugs.gnu.org; 14 Nov 2016 16:24:44 +0000 Received: from localhost ([127.0.0.1]:57293 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6K3o-0005pU-CA for submit@debbugs.gnu.org; Mon, 14 Nov 2016 11:24:44 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:44977) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6K3m-0005pG-CY for 21391@debbugs.gnu.org; Mon, 14 Nov 2016 11:24:42 -0500 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uAEGOZfI018362 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Nov 2016 16:24:36 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id uAEGOYB4025437 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Nov 2016 16:24:35 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id uAEGOWQu026216; Mon, 14 Nov 2016 16:24:32 GMT MIME-Version: 1.0 Message-ID: <5a6ddd21-ebf9-42bf-9fb6-7fc9e037b3ed@default> Date: Mon, 14 Nov 2016 08:24:30 -0800 (PST) From: Drew Adams To: Eli Zaretskii , Drew Adams Subject: RE: bug#21391: 24.5; `thing-at-point' should return a string 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>> In-Reply-To: <<83a8d2hy8f.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)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) > > d> 2. Make `thing-at-point', as before, return just what the > > firat `if' clause returns, if that clause is taken. > > IOW, move the removal of text properties (from non-nil > > NO-PROPERTIES) into the second `if' clause. >=20 > Why would we want to do that? AFAIU, it would require the function > that is the value of the thing-at-point property to second-guess > what the caller of thing-at-point wants, something it has no means to do. Quite the contrary. It gives the function that is the value of the property the ability to determine the return value. Which is precisely the intended behavior of that property, from the start. That is the point of allowing such a function: to let you control the behavior from outside function `thing-at-point'. This is similar to passing a function-valued optional parameter and calling that to provide the behavior. That's the point of the original design of `thing-at-point': (1) provide a default, string-producing behavior and (2) also allow for another function to define the behavior for particular types of THING. > If thing-at-point is called with NO-PROPERTIES non-nil, and the > thing-at-point property returns a string, then any properties > should be removed from that string, exactly as in the other case. That overrides the intended behavior of the THING function. It removes its control, which is there by design. Sure, you can say that if a caller provides NO-PROPERTIES then s?he always wants a string value to have properties removed. I agree that this is not a problem (since the arg is optional, and new). However, I really see no reason for NO-PROPERTIES to have ever been added. What were we thinking, to do such a thing? I cannot imagine a good reason for that change, even if the arg is optional. We don't add optional args willy nilly just because they don't do any harm if they're not called. And we certainly don't add a NO-PROPERTIES arg to every function that can return a string. What is so special about this function, that it needs such a "feature"? I haven't seen an answer to this question yet. I seriously would propose that we deprecate that optional arg and return to what was there before it was introduced, along with this bug. That was a misguided change, IMO. It is perhaps no accident that whoever added it introduced this bug at the same time. I suspect that the change betrays a poor understanding of thingatpt.el. > I don't see why we should single out that one use case. > I think the only change that makes sense at this point is to replace > sequencep by stringp, as Tino originally proposed. Other than that, > there are no problems here that we need to solve. I'm OK with that, too. That was my #3 "reasonable solution": d> 3. Make `thing-at-point', as before, return just what the firat `if' clause returns, if that clause is taken, except that if either clause returns a string then strip that string of text properties (if NO-PROPERTIES is non-nil). Fine by me. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 14 11:44:12 2016 Received: (at 21391) by debbugs.gnu.org; 14 Nov 2016 16:44:12 +0000 Received: from localhost ([127.0.0.1]:57309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6KMd-0006L2-Te for submit@debbugs.gnu.org; Mon, 14 Nov 2016 11:44:12 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6KMc-0006Kq-41 for 21391@debbugs.gnu.org; Mon, 14 Nov 2016 11:44:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6KMT-0007qq-OH for 21391@debbugs.gnu.org; Mon, 14 Nov 2016 11:44:04 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6KMT-0007qm-L8; Mon, 14 Nov 2016 11:44:01 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1973 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c6KMS-0001yr-Q7; Mon, 14 Nov 2016 11:44:01 -0500 Date: Mon, 14 Nov 2016 18:44:12 +0200 Message-Id: <83zil2ggf7.fsf@gnu.org> From: Eli Zaretskii To: Drew Adams In-reply-to: <5a6ddd21-ebf9-42bf-9fb6-7fc9e037b3ed@default> (message from Drew Adams on Mon, 14 Nov 2016 08:24:30 -0800 (PST)) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.8 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.8 (-------) > Date: Mon, 14 Nov 2016 08:24:30 -0800 (PST) > From: Drew Adams > Cc: dgutov@yandex.ru, tino.calancha@gmail.com, 21391@debbugs.gnu.org > > > > d> 2. Make `thing-at-point', as before, return just what the > > > firat `if' clause returns, if that clause is taken. > > > IOW, move the removal of text properties (from non-nil > > > NO-PROPERTIES) into the second `if' clause. > > > > Why would we want to do that? AFAIU, it would require the function > > that is the value of the thing-at-point property to second-guess > > what the caller of thing-at-point wants, something it has no means to do. > > Quite the contrary. It gives the function that is the value of > the property the ability to determine the return value. Which > is precisely the intended behavior of that property, from the > start. So you are saying that the function should control the caller, instead of the other way around? That makes very little sense to me, because the function writer has no way of knowing the caller's intent. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 14 12:33:13 2016 Received: (at 21391) by debbugs.gnu.org; 14 Nov 2016 17:33:13 +0000 Received: from localhost ([127.0.0.1]:57317 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6L84-0007Y1-Qs for submit@debbugs.gnu.org; Mon, 14 Nov 2016 12:33:13 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:25724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6L82-0007Xm-PA for 21391@debbugs.gnu.org; Mon, 14 Nov 2016 12:33:11 -0500 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uAEHX4m0027509 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Nov 2016 17:33:04 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id uAEHX2WM002274 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Nov 2016 17:33:02 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uAEHX1pf031484; Mon, 14 Nov 2016 17:33:02 GMT MIME-Version: 1.0 Message-ID: Date: Mon, 14 Nov 2016 09:33:00 -0800 (PST) From: Drew Adams To: Eli Zaretskii Subject: RE: bug#21391: 24.5; `thing-at-point' should return a string 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>> In-Reply-To: <<83zil2ggf7.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)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0021.oracle.com [156.151.31.71] X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) > > > > d> 2. Make `thing-at-point', as before, return just what the > > > > firat `if' clause returns, if that clause is taken. > > > > IOW, move the removal of text properties (from non-nil > > > > NO-PROPERTIES) into the second `if' clause. > > > > > > Why would we want to do that? AFAIU, it would require the > > > function that is the value of the thing-at-point property to > > > second-guess what the caller of thing-at-point wants, something > > > it has no means to do. > > > > Quite the contrary. It gives the function that is the value of > > the property the ability to determine the return value. Which > > is precisely the intended behavior of that property, from the > > start. >=20 > So you are saying that the function should control the caller, > instead of the other way around? That makes very little sense to me, > because the function writer has no way of knowing the caller's intent. If the THING has property `thing-at-point' then the function that is the value of that property controls the behavior of function `thing-at-point' _for that type of THING_. Yes. That is the design. And of course you can override the behavior locally or temporarily by removing the symbol property (and then restoring it). You can, similarly, change the symbol property, to locally or temporarily get different behavior. I don't see that being done often. I've never seen it done, in practice - but it could be done. All this just means that what you call the "caller", function `thing-at-point', does not have its behavior decided/defined once and for all, ahead of time. Its behavior is controlled by the symbol property, in addition to the `thing-at-point' defun. Again, this is very similar (it is equivalent) to what happens when you pass a function-valued parameter to a higher-order function. In effect, `thing-at-point' is a higher-order function, because of symbol-property `thing-at-point'. Being able to put the property on specific THING symbols is a way of making the higher-order nature more specific (THING type-specific). And (except for the fact that the property value could be changed at runtime) this differs from passing a function-valued parameter that is computed at runtime: with this design, the THING-specific behavior is defined at coding time, not at runtime. A user or a 3rd-party library can easily define a specialized (including a personally preferred) behavior for a given THING type, simply by setting property `thing-at-point'. No advising needed. (You can think of it as a kind of hook, if you like.) From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 14 13:14:39 2016 Received: (at 21391) by debbugs.gnu.org; 14 Nov 2016 18:14:39 +0000 Received: from localhost ([127.0.0.1]:57334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6LmA-000070-IE for submit@debbugs.gnu.org; Mon, 14 Nov 2016 13:14:39 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34232) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6Lm9-00006l-8q for 21391@debbugs.gnu.org; Mon, 14 Nov 2016 13:14:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6Lm0-0002mc-38 for 21391@debbugs.gnu.org; Mon, 14 Nov 2016 13:14:32 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40674) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6Lm0-0002mY-00; Mon, 14 Nov 2016 13:14:28 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2042 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c6Llz-0005lm-Ae; Mon, 14 Nov 2016 13:14:27 -0500 Date: Mon, 14 Nov 2016 20:14:38 +0200 Message-Id: <83wpg6gc8h.fsf@gnu.org> From: Eli Zaretskii To: Drew Adams In-reply-to: (message from Drew Adams on Mon, 14 Nov 2016 09:33:00 -0800 (PST)) Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string 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>> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.8 (-------) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.8 (-------) > Date: Mon, 14 Nov 2016 09:33:00 -0800 (PST) > From: Drew Adams > Cc: dgutov@yandex.ru, tino.calancha@gmail.com, 21391@debbugs.gnu.org > > All this just means that what you call the "caller", function > `thing-at-point', 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 14 13:54:41 2016 Received: (at 21391) by debbugs.gnu.org; 14 Nov 2016 18:54:41 +0000 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 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 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 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 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 MIME-Version: 1.0 Message-ID: Date: Mon, 14 Nov 2016 10:54:30 -0800 (PST) From: Drew Adams To: Eli Zaretskii , Drew Adams Subject: RE: bug#21391: 24.5; `thing-at-point' should return a string 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>> 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)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) > > 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 15 02:10:21 2016 Received: (at 21391) by debbugs.gnu.org; 15 Nov 2016 07:10:21 +0000 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 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 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 Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: Eli Zaretskii 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> From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Message-ID: <8376278c-c1af-240e-25b1-d832baff7331@easy-emacs.de> Date: Tue, 15 Nov 2016 08:18:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <838tsmhy54.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) 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. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 16 08:41:27 2016 Received: (at submit) by debbugs.gnu.org; 16 Nov 2016 13:41:27 +0000 Received: from localhost ([127.0.0.1]:58893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c70Ss-0005p7-VD for submit@debbugs.gnu.org; Wed, 16 Nov 2016 08:41:27 -0500 Received: from eggs.gnu.org ([208.118.235.92]:46245) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c70Sr-0005ot-It for submit@debbugs.gnu.org; Wed, 16 Nov 2016 08:41:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c70Sl-0007HH-IL for submit@debbugs.gnu.org; Wed, 16 Nov 2016 08:41:20 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_50,RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:55127) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c70Sl-0007HB-F3 for submit@debbugs.gnu.org; Wed, 16 Nov 2016 08:41:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37186) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c70Sh-0006Je-7p for bug-gnu-emacs@gnu.org; Wed, 16 Nov 2016 08:41:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c70Se-0007En-4R for bug-gnu-emacs@gnu.org; Wed, 16 Nov 2016 08:41:15 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:61365) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c70Sd-0007EL-RL for bug-gnu-emacs@gnu.org; Wed, 16 Nov 2016 08:41:12 -0500 Received: from [192.168.178.35] ([77.3.53.102]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.167]) with ESMTPSA (Nemesis) id 0Lzkkl-1cuHPm3OB1-01544d; Wed, 16 Nov 2016 14:41:06 +0100 Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string To: Drew Adams , bug-gnu-emacs@gnu.org References: <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> From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Message-ID: Date: Wed, 16 Nov 2016 14:49:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:E+kdeeEjNNLG4A86I/a7wi8Q9cPFutiC6KbRups/bpdpJTw4Nqz VtM+pSk64Ui6h7Hwe9TD1Xw+ZnVVLUIIPGdM9XfVEqprBnVPl5o2iTuDKOZN5ozu6YpojMn tmDsUx6YiwAb9l81ITc5hT+RyQINL7nD8xnzvVZInLTPxHt4fG0r4L23kHQwuWuQhXjbKiC Wuf36aVQ92nXWRy5aH6uA== X-UI-Out-Filterresults: notjunk:1;V01:K0:wJZEV+1uelE=:V+0Jh/1iKUZkKnK8UNuSNK L86WCV5wu+Imhkw7K0y+dceL3YHCb1ufjCKWkaFUU0nYyz8p0Lsy87VT86cr31LrLlTGZ/f/J MQcRbmlXB2l92m7xGH2JzVjgprKrLbIVRh8ceuXhiUZuEGKN5lVb4Nae+9vjkdQh35ghFtfAI UkXw4KqhJh88X6duuhWPJGW7f879UbGsmd/YeSyekINzsZwxWygg1SpsDT0qguHnaqnCTJB56 UwIIRTyUCXfvyfIhwygDt24FT5XNle1E2+S8Wda2Aou82SwhUzCo0ry7yI7I/qRMYmiFv6kTE UaSPyDkNmQpmx7jWwk2SWVPn4BhK6imuyi2NLSBO6vw97auK3bKiMBYl6QMgKVv6iw7PbN3JF Hi5wAyFTd/SfBLhg7T7TyFpZ5iDeUjaTMVInM2CwLdVmKeoKV7sVkp21jDnxvOrvofDlVJWOm gUkicZuA0cdmOaXOTmLZQ5/0wPRMf98RzwjXE0eD61NoQimmDwOtdt/qnD5GMwV2HhlZYQofl WGqRadFSwcCxSuPEYA2bB6Oum2MXrHmrooVkMKD+s/5jVM6cSiWzhZgabx9H8Z+5GnKgMWHpr /Bhg+P4JermapYSFBa76rywU9rLspSMUQG99DaqKqBVBjcghfrPDjl+GQZJzGC65uTWwc4Djj qQQxPJ41twcyn0klbkunhl0RR6/X6gUHLYs4MtvybGFhYMvfOplBM4ZmXmk5vVHZHaxmXzaOM 1tjvi/zbqSB9BZrV X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.5 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.5 (----) On 14.11.2016 16:19, Drew Adams wrote: >> Look at the start of thing-at-point implementation: >> >> 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. > ANY time you use a function as a parameter (passed as an > argument, obtained as the value of a variable, or picked up > in some other way, such as here) there is little or no control > over the nature of that function in the function that makes > use of it. It is up to the code that provides the function > to provide an appropriate function (DTRT). > >> Next clause deals with buffer-substring - which is >> thing-at-point about in my understanding. > Your understanding is partial, then. Thing-at-point has > been, from the outset, about actual Lisp THINGS, not just > strings that name such things. Yes, string-naming-a-thing > is a common use case - the most common, currently. But it > is only part of the story. > > And yes, buffer text is usually examined to come up with > the returned THING. But the buffer text need not be > examined. What is most significant is point - the buffer > position. And even that could be ignored by the function > that comes up with an appropriate THING to return. > > thingatpt.el is much more general, and offers many more > possibilities, than just grabbing some text at or near > point. Agreed so far, understand that. My point is to suggest a restriction here, making the use easier. If a symbol might return an arbitrary thing doing arbitrary actions, why it should reside in this library? Beside this - upholding that in the core, a string is the result in any case first. Follows functions which operate on this string, derive from its representation a number, intern it or whatever. For clarification IMO it would be better to separate these use-cases from the core-thing. These use-cases are plain operations on strings, nothing special to thing-at-point. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 16 09:45:36 2016 Received: (at submit) by debbugs.gnu.org; 16 Nov 2016 14:45:37 +0000 Received: from localhost ([127.0.0.1]:58921 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c71Sy-0007Sd-KC for submit@debbugs.gnu.org; Wed, 16 Nov 2016 09:45:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34181) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c71Sv-0007SP-RL for submit@debbugs.gnu.org; Wed, 16 Nov 2016 09:45:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c71Sp-0005R9-NW for submit@debbugs.gnu.org; Wed, 16 Nov 2016 09:45:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59414) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c71Sp-0005R5-Jh for submit@debbugs.gnu.org; Wed, 16 Nov 2016 09:45:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c71So-000285-Dx for bug-gnu-emacs@gnu.org; Wed, 16 Nov 2016 09:45:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c71Si-0005PC-Qa for bug-gnu-emacs@gnu.org; Wed, 16 Nov 2016 09:45:26 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:24408) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c71Si-0005OO-Ik for bug-gnu-emacs@gnu.org; Wed, 16 Nov 2016 09:45:20 -0500 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uAGEjE9l006864 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 16 Nov 2016 14:45:14 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id uAGEjEoG017448 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 16 Nov 2016 14:45:14 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uAGEjC46025506; Wed, 16 Nov 2016 14:45:13 GMT MIME-Version: 1.0 Message-ID: Date: Wed, 16 Nov 2016 06:45:11 -0800 (PST) From: Drew Adams To: =?utf-8?B?QW5kcmVhcyBSw7ZobGVy?= , bug-gnu-emacs@gnu.org Subject: RE: bug#21391: 24.5; `thing-at-point' should return a string References: <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> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) > > Thing-at-point has been, from the outset, about actual Lisp > > THINGS, not just strings that name such things. Yes, > > string-naming-a-thing is a common use case - the most common, > > currently. But it is only part of the story. > > > > And yes, buffer text is usually examined to come up with > > the returned THING. But the buffer text need not be > > examined. What is most significant is point - the buffer > > position. And even that could be ignored by the function > > that comes up with an appropriate THING to return. > > > > thingatpt.el is much more general, and offers many more > > possibilities, than just grabbing some text at or near > > point. >=20 > Agreed so far, understand that. > My point is to suggest a restriction here, making the use easier. What difficulty in use to you see? What is the difficult-use problem you are trying to solve? > If a symbol might return an arbitrary thing doing arbitrary > actions, why it should reside in this library? Users of thingatpt.el, including code that uses its features, will use functions to do THING-related things. Any "arbitrary" functions used to come up with an appropriate thing are not, in practice (i.e., in the real world) not arbitrary. They are designed to return a Lisp THING usefully. And yes, this is all about obtaining a THING at point. > Beside this - upholding that in the core, a string is the result in > any case first. Follows functions which operate on this string, It's hard for me to parse what you're saying, but I think your point is only that buffer text at point is the origin of coming up with a THING. That does not at all imply that the THING result is a string. > derive from its representation a number, intern it or whatever. What's "its"? All that serves as input to the function is point and a buffer (and any global Emacs context - windows etc.). It is precisely up to the "arbitrary" function to decide just what part of that (humongous) "its" input it uses as relevant, and it is up to that function to decide how to use it and what THING to return. > For clarification IMO it would be better to separate these > use-cases from the core-thing. There is no "core-thing". The buffer text is only an input. It is not the THING that is returned. And even in the case where a string taken from the buffer text is returned, which string? which bit of buffer text? That's the point. There are an infinite number of THINGs that the function could return. And even picking some buffer text as the (string) THING to return, there are a myriad (but in this case not infinite) different string THINGS taken from buffer text that it could return. There is NO "core-thing". It is always up to the function (even in the case of a string return) to decide what to return and how to obtain it. > These use-cases are plain operations on strings, nothing > special to thing-at-point. There are no "core" or special use cases. There is nothing special or more "core" about returning a string value, whether or not that string is a subsequence of buffer text. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 24 14:32:33 2020 Received: (at 21391) by debbugs.gnu.org; 24 Aug 2020 18:32:33 +0000 Received: from localhost ([127.0.0.1]:59211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAHGj-0001gr-IQ for submit@debbugs.gnu.org; Mon, 24 Aug 2020 14:32:33 -0400 Received: from quimby.gnus.org ([95.216.78.240]:60490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAHGi-0001c4-F2 for 21391@debbugs.gnu.org; Mon, 24 Aug 2020 14:32:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=lnJuX4nBumwOIh83ohayaIUnwEfyzSydfUFL8UqENKA=; b=uVD0Y91ok3W2SerV8nAIXRk7mZ OWMuh1/JFLw17t/YCnXXyXZohp+MzE3bFfjBqU8aCi+wzIvEdRm47eQsyOicvXiQgH5+pWZsBljt6 NNkMHPytBVV06BQVg7OfX2slxxXZEdmQIgZJi9YNGPex0/T2e+S6BYNOUT4F8ijnncmA=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAHGZ-0002A4-3I; Mon, 24 Aug 2020 20:32:25 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#21391: 24.5; `thing-at-point' should return a string 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> X-Now-Playing: Split's _Telepathe, 77Klash_: "77Klash - Caroline" Date: Mon, 24 Aug 2020 20:32:21 +0200 In-Reply-To: <83inrygggr.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 08 Nov 2016 17:05:08 +0200") Message-ID: <87r1rv6gju.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: > 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' proper [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21391 Cc: 21391@debbugs.gnu.org, tino.calancha@gmail.com, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > 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. > > So why would we want to make such a change? What am I missing? I semi-skimmed this thread, and I think the conclusion here was that 1) the thingatpt library has functions with non-optimal semantics (I agree), and 2) changing the return value of thing-at-point in the manner proposed would likely break stuff. So it doesn't seem likely that there'll be any further progress in this bug report, and I'm closing it. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 24 14:32:40 2020 Received: (at control) by debbugs.gnu.org; 24 Aug 2020 18:32:40 +0000 Received: from localhost ([127.0.0.1]:59214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAHGp-0001lb-QY for submit@debbugs.gnu.org; Mon, 24 Aug 2020 14:32:40 -0400 Received: from quimby.gnus.org ([95.216.78.240]:60506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAHGo-0001gm-NZ for control@debbugs.gnu.org; Mon, 24 Aug 2020 14:32:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+zP8kivUgw8IZVTEKnD/huY1LTeT3vQBn7qucA7Rg48=; b=aTklCy35ThByDPHQ5DxwxcEIBd EYVSHyC3pdYAoNjKJ1erGRv87H0rMDR7IV+6DPzWpYyI+rBdASLyP8AxxgCTb+QINC4HIOiNxV/Hq BEVueHtqJ35t0RoX1ZPl2uh5vv4bOMbV/H1NOID1fLktOP6Uu061YdFwSBcdqLijjsJw=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAHGg-0002AF-Vo for control@debbugs.gnu.org; Mon, 24 Aug 2020 20:32:33 +0200 Date: Mon, 24 Aug 2020 20:32:29 +0200 Message-Id: <87pn7f6gjm.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #21391 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 21391 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 21391 quit From unknown Sat Aug 16 18:46:14 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 22 Sep 2020 11:24:12 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator