diff --git a/ORGWEBPAGE/Changes.org b/ORGWEBPAGE/Changes.org index 370db4494..39c9a40da 100644 --- a/ORGWEBPAGE/Changes.org +++ b/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". diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 62de9a285..232b03739 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2008-07-18 Carsten Dominik + + * 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 * org.el (org-make-link-string): Remove link attributes from diff --git a/lisp/org.el b/lisp/org.el index edc8a7dc0..122c0d6d9 100644 --- a/lisp/org.el +++ b/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))