From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#9300: 24.0.50; `bounds-of-thing-at-point' does not return nil when just after THING Date: Fri, 26 Feb 2016 12:15:45 +0200 Message-ID: <503db28a-d430-8a5d-a26d-e95890da58b9@yandex.ru> References: < <56CBAF58.2000708@yandex.ru> <3a64315c-fc72-42bd-a6cf-0fa43414daa6@default> <56CC32CD.5050906@yandex.ru> <27990eb0-3d4e-62c7-257d-7ea7a8204e2d@yandex.ru> <6635cd58-2d42-46fe-85b4-287f1e0eb05d@default> <05f0b24b-1a52-4fa4-9f22-f34f5ed33556@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1456481782 7387 80.91.229.3 (26 Feb 2016 10:16:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Feb 2016 10:16:22 +0000 (UTC) To: Drew Adams , 9300@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 26 11:16:12 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aZFRS-0005s2-Q4 for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Feb 2016 11:16:11 +0100 Original-Received: from localhost ([::1]:48580 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZFRS-00044C-3K for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Feb 2016 05:16:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZFRN-000443-Be for bug-gnu-emacs@gnu.org; Fri, 26 Feb 2016 05:16:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZFRK-0000D1-4t for bug-gnu-emacs@gnu.org; Fri, 26 Feb 2016 05:16:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49805) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZFRK-0000Cv-1B for bug-gnu-emacs@gnu.org; Fri, 26 Feb 2016 05:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aZFRJ-0003tx-O8 for bug-gnu-emacs@gnu.org; Fri, 26 Feb 2016 05:16:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Feb 2016 10:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9300 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9300-submit@debbugs.gnu.org id=B9300.145648175414980 (code B ref 9300); Fri, 26 Feb 2016 10:16:01 +0000 Original-Received: (at 9300) by debbugs.gnu.org; 26 Feb 2016 10:15:54 +0000 Original-Received: from localhost ([127.0.0.1]:46932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZFRB-0003tY-SJ for submit@debbugs.gnu.org; Fri, 26 Feb 2016 05:15:54 -0500 Original-Received: from mail-wm0-f43.google.com ([74.125.82.43]:35037) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZFRB-0003tL-0r for 9300@debbugs.gnu.org; Fri, 26 Feb 2016 05:15:53 -0500 Original-Received: by mail-wm0-f43.google.com with SMTP id c200so65628994wme.0 for <9300@debbugs.gnu.org>; Fri, 26 Feb 2016 02:15:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=H3dNtUeHm+4mDvgZAgrVpEerzXBME6p4qdwzsyvuufY=; b=kEMJNSL6ppXth0qvlkZPmXFhX+OfPexJTB6F6e5P8vDqXuJ/FPAszO5xq2QCM6mTkk MAlApXddAFipeqzj9UB61QDcKvqXtlrOEvrPmtzSyx3CAXCJYTjVKpXHYHWQRMJHMuBe IrXvS0TtIrCgTARTgLCViOX15PMWD47ovq36v2Wln47VbTsDC4KxiGDWwKdcZSZTgsoX /+SshbOyd7aj9Yl+ShB8kL3ikbGiT1hWKUu9O2A3wUJzvhC34sq88fTN8W58m0faB2o4 ZElhKe0gtIcItDIrMGq7nYjI3OStHYduzSqUaXMyv+hoGaSgjpBdkJ0ObJDkTVJq66lP Ollg== 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:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=H3dNtUeHm+4mDvgZAgrVpEerzXBME6p4qdwzsyvuufY=; b=HR0rAru+L4upeIgzps0paLbV/NUa2p5wBnXNLBAR5IHGGmkOitXeIQX+yhB6EHOjjL EtXQ+vdTZx9Dz874ptWdFR4bAAI53mFN5gB+JylNwN34Ifo6rk67w+uSpiCaS1raDIV6 b2fZulEmf1eDo/r5nkCY5r6dneY0YbY+nMZjbFu466S0J2FQtnxGY00sPjYJrue5czZZ 8xkNgDGjSRJxdkjbMimgvk7bRgXRwUl9N7nsTrFusZuo1hoCqkrXH+231eYWi4ac4tTB LJnkn0CopGexZBxde1dsex2plFMwaQA20eYZjyld0WGBrOeBJOHfDgUXL00CQOp+s3Zu RJCw== X-Gm-Message-State: AD7BkJKjxmMnDQ0uGWKkJmIrexUVgTFQonuaPXpsDVeKJh33XZp1BUS85lgEkeHBHLy3/g== X-Received: by 10.28.227.134 with SMTP id a128mr2413326wmh.67.1456481747518; Fri, 26 Feb 2016 02:15:47 -0800 (PST) Original-Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id z127sm2207539wme.5.2016.02.26.02.15.46 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 26 Feb 2016 02:15:46 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 In-Reply-To: <05f0b24b-1a52-4fa4-9f22-f34f5ed33556@default> 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:113872 Archived-At: On 02/26/2016 03:44 AM, Drew Adams wrote: > But the proper fix for 3rd-party code, mentioned above, does not > have any such problem. It should look for a thing at (1- (point)) > if it wants to get a thing that might be just before point but not > at point. If the thing _begins_ at point, and the third-party code in question calls (save-excursion (forward-char -1) (thing-at-point 'foo)), they will get nil. >> Maybe there aren't too many. Will you do the research on this? > > Does anyone need to? I imagine so. > You're the one who > mentioned that your code depends on checking for a thing at the > wrong position in order to get a thing at point-minus-one. And > you mentioned an Eclipse function that acts similarly. That's two. I never mentioned anything Eclipse-related in this bug. >>> if they really want the bugged behavior. Better: tell them >>> to use the fixed `bounds-of-thing-at-point' after backing up >>> so point is actually on the THING instead of after it. >> >> Any such client would be forced to call bounds-of-thing-at-point- >> strict twice. Which is not particularly ideal. > > Not at all. Why do you say that? See above. >> Think of the semantics of `match-end', or the last argument of >> `substring'. > > Think of all the other uses of thing-at-point, and the other THINGs > it finds and where it finds them. > > Type (foo bar) at top level, and put point after the ). > M-: (thing-at-point 'list) > What do you get? id it give you "(foo bar)"? Or did it give > you nil? There is no list at point. Is this a bug? No; it's TRT. If the list is at the end of the buffer, it gives me an empty string, or a string of spaces. So yeah, this particular "thing" seems bugged. > Why don't you present a valid (in your sense) configuration >> that a bounds-of-thing-at-point implementation without the "else" >> branch will return nil in? > > OK, I give up. Because there is no such example. > It's clearly not about your being unconvinced that the fix is correct. > It's about your not wanting to give up your ingrained expectations > of the incorrect behavior. Not just mine. I believe I have demonstrated that the code has been written with exactly this expectation in mind. And stayed like that for decades.