From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Subject: Re: [PATCH] fix a bug in org-open-at-point Date: Sat, 19 Feb 2011 10:03:38 +0100 Message-ID: <8739nk1jmd.fsf@gmail.com> References: <87bp281k5b.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from [140.186.70.92] (port=55754 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pqij8-0002eV-PM for emacs-orgmode@gnu.org; Sat, 19 Feb 2011 04:03:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pqij7-000493-T1 for emacs-orgmode@gnu.org; Sat, 19 Feb 2011 04:03:42 -0500 Received: from mail-bw0-f41.google.com ([209.85.214.41]:55078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pqij7-00048w-HN for emacs-orgmode@gnu.org; Sat, 19 Feb 2011 04:03:41 -0500 Received: by bwz17 with SMTP id 17so55241bwz.0 for ; Sat, 19 Feb 2011 01:03:40 -0800 (PST) In-Reply-To: <87bp281k5b.fsf@gmail.com> (Nicolas's message of "Sat, 19 Feb 2011 09:52:16 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain My bad, wrong manipulation. Here is the patch. To reproduce the error, you can type the following in a fresh Org #+begin_src org target some text <<>> another text target #+end_src Using C-c C-o on any of the two links will return an error. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Fix-bug-with-link-to-radio-target-at-beginning-or-en.patch Content-Description: patch for org-open-at-point >From f7738f3e9239fc4fddccc7850dad7a0936087a58 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 19 Feb 2011 09:37:48 +0100 Subject: [PATCH] Fix bug with link to radio target at beginning or end of buffer * lisp/org.el (org-open-at-point): if a link to a radio target is the first, (resp. the last), element of a buffer, function cannot find the property change required to get its boundaries, and `buffer-substring' is called with an invalid nil argument. --- lisp/org.el | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index b92186a..bfe9296 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9214,8 +9214,10 @@ application the system uses for this file type." pos (if (get-text-property (1+ (point)) 'org-linked-text) (1+ (point)) (point)) path (buffer-substring - (previous-single-property-change pos 'org-linked-text) - (next-single-property-change pos 'org-linked-text))) + (or (previous-single-property-change pos 'org-linked-text) + (point-min)) + (or (next-single-property-change pos 'org-linked-text) + (point-max)))) (throw 'match t)) (save-excursion -- 1.7.4.1 --=-=-= Content-Type: text/plain Regards, -- Nicolas --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--