Browse Source

Fix error when not in any project.

Go to default inbox when in no project
master
Maxime Wack 3 years ago
parent
commit
2c9c6d9bfe
1 changed files with 9 additions and 6 deletions
  1. +9
    -6
      projectorg.el

+ 9
- 6
projectorg.el View File

@@ -47,17 +47,20 @@ Contains the general notes files, the projects list files and each project notes
"Return the full project name.

It is the result of substracting the projectorg-projects-root string from the beginning of the path of the project, as returned by projectile-project-p."
(let ((project-path (projectile-project-p)))
(and
(string= (substring project-path 0 (length projectorg-projects-root))
projectorg-projects-root)
(substring project-path (length projectorg-projects-root) -1))))
(when (projectile-project-p)
(let ((project-path (projectile-project-p)))
(and
(string= (substring project-path 0 (length projectorg-projects-root))
projectorg-projects-root)
(substring project-path (length projectorg-projects-root) -1)))))

(defun projectorg/notes-file ()
"Returns the notes-file location.

It is an org file, with the same name as the project (including subdirectories), located in the *org* directory in projectorg-projects-root."
(concat projectorg-projects-root "org/" (projectorg/project-name) ".org"))
(let ((project-name (projectorg/project-name)))
(when project-name
(concat projectorg-projects-root "org/" project-name ".org"))))

(defun projectorg/go-to-inbox ()
"Go to org-default-notes-file."


Loading…
Cancel
Save