* [PATCH] fix a bug in org-open-at-point
@ 2011-02-19 8:52 Nicolas
2011-02-19 9:03 ` Nicolas
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas @ 2011-02-19 8:52 UTC (permalink / raw)
To: emacs-orgmode
Hello,
This is an improba
--
Nicolas
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix a bug in org-open-at-point
2011-02-19 8:52 [PATCH] fix a bug in org-open-at-point Nicolas
@ 2011-02-19 9:03 ` Nicolas
2011-02-26 17:14 ` [Accepted] " Bastien Guerry
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas @ 2011-02-19 9:03 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 252 bytes --]
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 <<<target>>> another text target
#+end_src
Using C-c C-o on any of the two links will return an error.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch for org-open-at-point --]
[-- Type: text/x-patch, Size: 1218 bytes --]
From f7738f3e9239fc4fddccc7850dad7a0936087a58 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@gmail.com>
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
[-- Attachment #3: Type: text/plain, Size: 23 bytes --]
Regards,
--
Nicolas
[-- Attachment #4: Type: text/plain, Size: 201 bytes --]
_______________________________________________
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Accepted] Re: [PATCH] fix a bug in org-open-at-point
2011-02-19 9:03 ` Nicolas
@ 2011-02-26 17:14 ` Bastien Guerry
0 siblings, 0 replies; 3+ messages in thread
From: Bastien Guerry @ 2011-02-26 17:14 UTC (permalink / raw)
To: emacs-orgmode
Patch 624 (http://patchwork.newartisans.com/patch/624/) is now "Accepted".
Maintainer comment: none
This relates to the following submission:
http://mid.gmane.org/%3C8739nk1jmd.fsf%40gmail.com%3E
Here is the original message containing the patch:
> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [Orgmode] Re: [PATCH] fix a bug in org-open-at-point
> Date: Sat, 19 Feb 2011 14:03:38 -0000
> From: Nicolas Goaziou <n.goaziou@gmail.com>
> X-Patchwork-Id: 624
> Message-Id: <8739nk1jmd.fsf@gmail.com>
> To: emacs-orgmode@gnu.org
>
> 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 <<<target>>> another text target
> #+end_src
>
> Using C-c C-o on any of the two links will return an error.
> Regards,
>
>
> >From f7738f3e9239fc4fddccc7850dad7a0936087a58 Mon Sep 17 00:00:00 2001
> From: Nicolas Goaziou <n.goaziou@gmail.com>
> 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
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-02-26 17:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-19 8:52 [PATCH] fix a bug in org-open-at-point Nicolas
2011-02-19 9:03 ` Nicolas
2011-02-26 17:14 ` [Accepted] " Bastien Guerry
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).