From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#21391: 24.5; `thing-at-point' returns error when called with arguments 'number t) Date: Fri, 4 Nov 2016 09:31:38 -0700 (PDT) Message-ID: <0a68c2ae-0940-4e2c-8b3c-1faceb45c43c@default> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1478277342 26742 195.159.176.226 (4 Nov 2016 16:35:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 4 Nov 2016 16:35:42 +0000 (UTC) To: Tino Calancha , 21391@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 04 17:35:38 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2hSZ-0004YX-TT for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Nov 2016 17:35:20 +0100 Original-Received: from localhost ([::1]:39861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2hSc-0004qS-O7 for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Nov 2016 12:35:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2hPS-0002rZ-Kt for bug-gnu-emacs@gnu.org; Fri, 04 Nov 2016 12:32:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2hPO-00084B-MY for bug-gnu-emacs@gnu.org; Fri, 04 Nov 2016 12:32:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57640) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c2hPO-000840-JX for bug-gnu-emacs@gnu.org; Fri, 04 Nov 2016 12:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c2hPO-0000WF-Ds for bug-gnu-emacs@gnu.org; Fri, 04 Nov 2016 12:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Nov 2016 16:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21391 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21391-submit@debbugs.gnu.org id=B21391.14782771091976 (code B ref 21391); Fri, 04 Nov 2016 16:32:02 +0000 Original-Received: (at 21391) by debbugs.gnu.org; 4 Nov 2016 16:31:49 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 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)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:125345 Archived-At: 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).]