From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#8667: 24.0.50; `bounds-of-thing-at-point' returns (N . N) for `comment' Date: Thu, 12 May 2011 17:46:33 -0700 Message-ID: <1273A111E1924DE9BAB49AFE6257D462@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1305247634 5720 80.91.229.12 (13 May 2011 00:47:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 13 May 2011 00:47:14 +0000 (UTC) To: 8667@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 13 02:47:08 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QKgX6-00008i-9k for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 May 2011 02:47:08 +0200 Original-Received: from localhost ([::1]:33799 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKgX5-0002Pt-KY for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 May 2011 20:47:07 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:51423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKgX3-0002Pn-4N for bug-gnu-emacs@gnu.org; Thu, 12 May 2011 20:47:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QKgX0-0006Ny-GL for bug-gnu-emacs@gnu.org; Thu, 12 May 2011 20:47:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKgX0-0006Np-Er for bug-gnu-emacs@gnu.org; Thu, 12 May 2011 20:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QKgX0-0002tq-93; Thu, 12 May 2011 20:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 May 2011 00:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8667 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: Original-Received: via spool by submit@debbugs.gnu.org id=B.130524761311125 (code B ref -1); Fri, 13 May 2011 00:47:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 May 2011 00:46:53 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKgWq-0002tO-Bm for submit@debbugs.gnu.org; Thu, 12 May 2011 20:46:52 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKgWn-0002t8-Ld for submit@debbugs.gnu.org; Thu, 12 May 2011 20:46:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QKgWh-0006MA-LT for submit@debbugs.gnu.org; Thu, 12 May 2011 20:46:44 -0400 Original-Received: from lists.gnu.org ([140.186.70.17]:57272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKgWh-0006M6-K9 for submit@debbugs.gnu.org; Thu, 12 May 2011 20:46:43 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:51339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKgWg-0002Pg-L3 for bug-gnu-emacs@gnu.org; Thu, 12 May 2011 20:46:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QKgWf-0006Le-Fg for bug-gnu-emacs@gnu.org; Thu, 12 May 2011 20:46:42 -0400 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:24750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKgWf-0006LV-94 for bug-gnu-emacs@gnu.org; Thu, 12 May 2011 20:46:41 -0400 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p4D0kcbS010228 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 13 May 2011 00:46:40 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p4D0kbtD028183 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 13 May 2011 00:46:37 GMT Original-Received: from abhmt003.oracle.com (abhmt003.oracle.com [141.146.116.12]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p4D0kWd7027845 for ; Thu, 12 May 2011 19:46:32 -0500 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 12 May 2011 17:46:31 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcwRBzTGFN+OJvRwQ7e0FsXqpu3eKw== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6090 X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090201.4DCC7F70.0054:SCFMA922111,ss=1,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 12 May 2011 20:47:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.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:46435 Archived-At: emacs -Q Put point at position 3061 in file thingatpt.el (i.e., just before the `a' of `condition-case'). M-: (bounds-of-thing-at-point 'comment) returns (3061 . 3061), which represents an empty thing, "". This happens at most positions, probably all positions outside a comment. The code should handle this kind of case correctly (in other respects it seems to work OK for comments). The problem is that there is no `beginning-op' or `end-op' and all of the calls to `forward-thing' (with 1 and -1) do not move point at all, and return nil. So the code falls through to the end: (let ((end (point)) (real-beg (progn (funcall (or (get thing 'beginning-op) (lambda () (forward-thing thing -1)))) (point)))) ;; real-beg = end = (point). Result is (cons 3061 . 3061). (if (and real-beg end (<= real-beg orig) (<= orig end)) (cons real-beg end))) `bounds-of-thing-at-point' should foresee such a case (that `forward-THING' does nothing). IOW, it should of course be fixed for this problem. But it sounds like `forward-comment' should also be fixed so that it acts like other `forward-THING' functions, and not just be a no-op when outside a comment. In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600) of 2011-05-10 on 3249CTO Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (4.5) --no-opt --cflags -Ic:/build/include'