瀏覽代碼

Allow relative links to doc-view files.

Patch by Jan Bker.
Carsten Dominik 15 年之前
父節點
當前提交
1af7fdfdcd
共有 2 個文件被更改,包括 6 次插入3 次删除
  1. 2 0
      lisp/ChangeLog
  2. 4 3
      lisp/org.el

+ 2 - 0
lisp/ChangeLog

@@ -2,6 +2,8 @@
 
 	* org.el (org-clean-visibility-after-subtree-move): Only fix
 	entries that are not entirely invisible already.
+	(org-insert-link): Respect org-link-file-path-type for
+	"docview:" links in addition to "file:" links.
 
 2009-12-03  Carsten Dominik  <carsten.dominik@gmail.com>
 

+ 4 - 3
lisp/org.el

@@ -7978,8 +7978,9 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
 	      (setq link search)))))
 
     ;; Check if we can/should use a relative path.  If yes, simplify the link
-    (when (string-match "^file:\\(.*\\)" link)
-      (let* ((path (match-string 1 link))
+    (when (string-match "^\\(file:\\|docview:\\)\\(.*\\)" link)
+      (let* ((type (match-string 1 link))
+	     (path (match-string 2 link))
 	     (origpath path)
 	     (case-fold-search nil))
 	(cond
@@ -8000,7 +8001,7 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
 		(setq path (substring (expand-file-name path)
 				      (match-end 0)))
 	      (setq path (abbreviate-file-name (expand-file-name path)))))))
-	(setq link (concat "file:" path))
+	(setq link (concat type path))
 	(if (equal desc origpath)
 	    (setq desc path))))