[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[emacs-wiki-discuss] planner-browse-position-url quick fix
From: |
Romain Francoise |
Subject: |
[emacs-wiki-discuss] planner-browse-position-url quick fix |
Date: |
Tue, 21 Jun 2005 17:06:00 +0200 |
Hi,
The new planner-browse-position-url function is nice but unfortunately
in my setup one of the functions in find-file-hook clobbers the match
data, so after the call to find-file match-string returns nil. This
makes string-to-number signal an error.
I suggest the following to make this function more robust:
--- orig/planner.el
+++ mod/planner.el
@@ -1659,8 +1659,10 @@
(defun planner-browse-position-url (url)
"If this is a position URL, jump to it."
(when (string-match "^pos://\\(.+\\)#\\([0-9]+\\)$" url)
- (find-file (match-string 1 url))
- (goto-char (string-to-number (match-string 2 url)))
+ (let ((file (match-string 1 url))
+ (pos (string-to-number (match-string 2 url))))
+ (find-file file)
+ (goto-char pos))
t))
;;;###autoload
Cheers,
--
Romain Francoise <address@hidden> | Last night the whole of hell
it's a miracle -- http://orebokech.com/ | came down to bathe and dine
| with us.
- [emacs-wiki-discuss] planner-browse-position-url quick fix,
Romain Francoise <=
- [emacs-wiki-discuss] Re: planner-browse-position-url quick fix, Sacha Chua, 2005/06/21
- [emacs-wiki-discuss] Re: planner-browse-position-url quick fix, Romain Francoise, 2005/06/21
- [emacs-wiki-discuss] Re: planner-browse-position-url quick fix, Sacha Chua, 2005/06/22
- [emacs-wiki-discuss] Re: planner-browse-position-url quick fix, Romain Francoise, 2005/06/22
- Re: [emacs-wiki-discuss] Re: planner-browse-position-url quick fix, Jim Ottaway, 2005/06/22
- [emacs-wiki-discuss] Duplicate appointments with planner-appt (was: planner-browse-position-url quick fix), Romain Francoise, 2005/06/23
- Re: [emacs-wiki-discuss] Duplicate appointments with planner-appt, Jim Ottaway, 2005/06/23
- [emacs-wiki-discuss] Re: Duplicate appointments with planner-appt, Romain Francoise, 2005/06/23
- Re: [emacs-wiki-discuss] Re: Duplicate appointments with planner-appt, Jim Ottaway, 2005/06/23
- Re: [emacs-wiki-discuss] Re: Duplicate appointments with planner-appt, Jim Ottaway, 2005/06/23