summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2010-04-08 15:57:17 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2010-04-08 15:57:17 +0200
commit39c91ba24a3bc34f84d66de5de20f5b10e854b84 (patch)
treef8edc38cba413c9bbaf03093fcbde8b24829be15
parenta589c7a22e2e47328faf9cf7bf50ccc727379faa (diff)
downloadorg-mode-39c91ba24a3bc34f84d66de5de20f5b10e854b84.tar.gz
Improve file opening when matching links
This patch tries to remove some of the adverse effects of Jan Bökers patch
-rwxr-xr-xlisp/ChangeLog1
-rw-r--r--lisp/org.el18
2 files changed, 13 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0a82487..bec794d 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -4,6 +4,7 @@
frames.
(org-export-latex-default-packages-alist): hyperref must be loaded
late.
+ (org-open-file): More care with the new matching for file links.
2010-04-07 Carsten Dominik <carsten.dominik@gmail.com>
diff --git a/lisp/org.el b/lisp/org.el
index 2fea170..9084f59 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9172,13 +9172,19 @@ If the file does not exist, an error is thrown."
(and dirp (cdr (assoc 'directory apps)))
;; if we find a match in org-file-apps, store the match
;; data for later
- (let ((match (assoc-default dlink (org-apps-regexp-alist
- apps a-m-a-p)
- 'string-match)))
- (if match
+ (let* ((re-list1 (org-apps-regexp-alist apps nil))
+ (re-list2
+ (if a-m-a-p
+ (org-apps-regexp-alist apps a-m-a-p)
+ re-list1))
+ (private-match
+ (assoc-default dlink re-list1 'string-match))
+ (general-match
+ (assoc-default dfile re-list2 'string-match)))
+ (if private-match
(progn (setq link-match-data (match-data))
- match)
- nil))
+ private-match)
+ general-match))
(cdr (assoc ext apps))
(cdr (assoc t apps))))))
(when (eq cmd 'system)