diff options
Diffstat (limited to 'jakob.org')
| -rw-r--r-- | jakob.org | 27 |
1 files changed, 17 insertions, 10 deletions
@@ -1205,9 +1205,11 @@ Code for interactively navigating the personal wiki. (concat notes-directory "/" category) notes-directory)) (contents (cl-remove-if #'notes-file-should-ignore - (directory-files path))) + (directory-files path))) (pages (cl-remove-if-not #'notes-file-is-page contents)) - (categories (cl-remove-if #'notes-file-is-page contents)) + (categories (cl-remove-if-not #'(lambda (subcategory) + (file-directory-p (concat path "/" subcategory))) + contents)) (categories (if category (map 'list #'(lambda (subcategory) (concat category "/" subcategory)) @@ -1221,15 +1223,20 @@ Code for interactively navigating the personal wiki. (defun notes-hierarchy () "Returns every page and category in `notes-directory'. - The result contains lists of the form (NAME PATH IS-PAGE-P), and - does not include files that satisfy the - `notes-file-should-ignore' predicate." + The result contains lists of the form (NAME PATH IS-PAGE-P), and + does not include files that satisfy the + `notes-file-should-ignore' predicate." (map 'list - #'(lambda (path) (list (if (notes-file-is-page path) - (cl-subseq path 0 -4) - path) - (concat notes-directory "/" path) - (notes-file-is-page path))) + #'(lambda (path) (list + (cond ((cl-search "Index.org" path) + (let ((name (cl-subseq path 0 -9))) + (if (string= name "") + "/" + name))) + ((notes-file-is-page path) (cl-subseq path 0 -4)) + (t path)) + (concat notes-directory "/" path) + (notes-file-is-page path))) (notes-hierarchy-paths))) (defun notes-page-goto () |