소스 검색

New option org-open-directory-means-index-dot-org.

Carsten Dominik 16 년 전
부모
커밋
45e6f57af9
3개의 변경된 파일21개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      ORGWEBPAGE/Changes.org
  2. 6 0
      lisp/ChangeLog
  3. 10 0
      lisp/org.el

+ 5 - 0
ORGWEBPAGE/Changes.org

@@ -117,6 +117,11 @@
     This option can be used to switch the style of the index
     produced by org-publish.
 
+*** New option `org-open-directory-means-index'
+    When set, a link pointing to a directory will actually open
+    the index.org file in that directory.  This is a good setting
+    inside a publishing project.
+
 * Version 6.05
 
 If I were to name my releases, this one would be called "Adam".

+ 6 - 0
lisp/ChangeLog

@@ -1,3 +1,9 @@
+2008-07-18  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org.el (org-open-file): Use
+	`org-open-directory-means-index-dot-org'.
+	(org-open-directory-means-index-dot-org): New option.
+
 2008-07-17  Carsten Dominik  <dominik@science.uva.nl>
 
 	* org.el (org-make-link-string): Remove link attributes from

+ 10 - 0
lisp/org.el

@@ -1062,6 +1062,13 @@ When nil, an error will be generated."
   :group 'org-link-follow
   :type 'boolean)
 
+(defcustom org-open-directory-means-index-dot-org nil
+  "Non-nil means, a link to a directory really means to index.org.
+When nil, following a directory link will run dired or open a finder/explorer
+window on that directory."
+  :group 'org-link-follow
+  :type 'boolean)
+
 (defcustom org-link-mailto-program '(browse-url "mailto:%a?subject=%s")
   "Function and arguments to call for following mailto links.
 This is a list with the first element being a lisp function, and the
@@ -7571,6 +7578,9 @@ If the file does not exist, an error is thrown."
 	 (apps (append org-file-apps (org-default-apps)))
 	 (remp (and (assq 'remote apps) (org-file-remote-p file)))
 	 (dirp (if remp nil (file-directory-p file)))
+	 (file (if (and dirp org-open-directory-means-index-dot-org)
+		   (concat (file-name-as-directory file) "index.org")
+		 file))
 	 (dfile (downcase file))
 	 (old-buffer (current-buffer))
 	 (old-pos (point))