MobileOrg: Use outline path if we cannot make an ID
* lisp/org-mobile.el (org-mobile-force-id-on-agenda-items): Fix docstring. (org-mobile-write-agenda-for-mobile): Use outline path if we do not have an ID and are not allowed to make one. (org-mobile-get-outline-path-link): New function.
This commit is contained in:
parent
f1960677de
commit
0c90cdc779
|
@ -150,7 +150,7 @@ list a list of selection key(s) as string."
|
||||||
(string :tag "Selection Keys"))))
|
(string :tag "Selection Keys"))))
|
||||||
|
|
||||||
(defcustom org-mobile-force-id-on-agenda-items t
|
(defcustom org-mobile-force-id-on-agenda-items t
|
||||||
"Non-nil means make all agenda items carry and ID."
|
"Non-nil means make all agenda items carry an ID."
|
||||||
:group 'org-mobile
|
:group 'org-mobile
|
||||||
:type 'boolean)
|
:type 'boolean)
|
||||||
|
|
||||||
|
@ -626,7 +626,8 @@ The table of checksums is written to the file mobile-checksums."
|
||||||
(if (org-bound-and-true-p
|
(if (org-bound-and-true-p
|
||||||
org-mobile-force-id-on-agenda-items)
|
org-mobile-force-id-on-agenda-items)
|
||||||
(org-id-get m 'create)
|
(org-id-get m 'create)
|
||||||
(org-entry-get m "ID")))
|
(or (org-entry-get m "ID")
|
||||||
|
(org-mobile-get-outline-path-link m))))
|
||||||
(insert " :PROPERTIES:\n :ORIGINAL_ID: " id
|
(insert " :PROPERTIES:\n :ORIGINAL_ID: " id
|
||||||
"\n :END:\n")))))
|
"\n :END:\n")))))
|
||||||
(beginning-of-line 2))
|
(beginning-of-line 2))
|
||||||
|
@ -634,6 +635,21 @@ The table of checksums is written to the file mobile-checksums."
|
||||||
org-mobile-checksum-files))
|
org-mobile-checksum-files))
|
||||||
(message "Agenda written to Org file %s" file)))
|
(message "Agenda written to Org file %s" file)))
|
||||||
|
|
||||||
|
(defun org-mobile-get-outline-path-link (pom)
|
||||||
|
(org-with-point-at pom
|
||||||
|
(concat "olp:"
|
||||||
|
(org-mobile-escape-olp (file-name-nondirectory buffer-file-name))
|
||||||
|
"/"
|
||||||
|
(mapconcat 'org-mobile-escape-olp
|
||||||
|
(org-get-outline-path)
|
||||||
|
"/")
|
||||||
|
"/"
|
||||||
|
(org-mobile-escape-olp (nth 4 (org-heading-components))))))
|
||||||
|
|
||||||
|
(defun org-mobile-escape-olp (s)
|
||||||
|
(let ((table '((?: . "%3a") (?\[ . "%5b") (?\] . "%5d") (?/ . "%2f"))))
|
||||||
|
(org-link-escape s table)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun org-mobile-create-sumo-agenda ()
|
(defun org-mobile-create-sumo-agenda ()
|
||||||
"Create a file that contains all custom agenda views."
|
"Create a file that contains all custom agenda views."
|
||||||
|
|
Loading…
Reference in New Issue