# HG changeset patch # User Richard Westhaver # Date 1725840695 14400 # Node ID 48bcbca019e6e0dbfbd104fc6d78f85d0aa0ba47 # Parent 642b3b82b20d9f6622c8eb07af5cccdd3fcde75e org-project-info dblock update diff -r 642b3b82b20d -r 48bcbca019e6 emacs/lib/inbox.el --- a/emacs/lib/inbox.el Sun Sep 08 17:35:03 2024 -0400 +++ b/emacs/lib/inbox.el Sun Sep 08 20:11:35 2024 -0400 @@ -269,12 +269,20 @@ (message "building project vc log..."))) ('files (when files (message "building project file table...") - (insert "#+CALL: files() :dir " project-root "\n"))))) + (insert "#+CALL: project-files() :dir " project-root "\n"))))) (org-babel-execute-region point (point))))) (defun org-project-info () "Insert or update a project-info dblock." - (interactive)) + (interactive) + (if (re-search-forward (rx bol "#+BEGIN:" (+ space) "project-info") nil t) + (progn + (if (fboundp 'org-fold-show-entry) + (org-fold-show-entry) + (with-no-warnings (org-show-entry))) + (beginning-of-line)) + (org-create-dblock (list :name "project-info"))) + (org-update-dblock)) (defun org-inbox-configure-dblock () "Configure the current org-inbox-dblock at point." diff -r 642b3b82b20d -r 48bcbca019e6 emacs/lib/ulang.el --- a/emacs/lib/ulang.el Sun Sep 08 17:35:03 2024 -0400 +++ b/emacs/lib/ulang.el Sun Sep 08 20:11:35 2024 -0400 @@ -157,17 +157,28 @@ For example, a PROPERTY value of 'LOCATION' would check all property values in addition to the keyword '#+LOCATION:'." (interactive (list nil nil)) - (let ((property (or property (org-read-property-name)))) - ;; most of the work passed through to the property handler - (org-entry-get-with-inheritance property literal-nil epom))) + (let* ((property (or property (org-read-property-name))) + (kw (when-let ((val (org-collect-keywords '("LOCATION") nil))) + (cadar val))) + ;; most of the work passed through to the property handler + (props (org-entry-get-with-inheritance property literal-nil epom))) + (if kw + (append (list kw) (if (listp props) props (list props))) + props))) (defun org-get-location (point) "Get the value of property LOCATION at POINT." (interactive "d") - (org-with-point-at point - (message "%s" (or (when-let ((prop (org-entry-get-with-inheritance "LOCATION"))) - (apply 'join-paths (string-split prop " "))) - (caadar (org-collect-keywords '("LOCATION") nil '("LOCATION"))))))) + (let ((path (org-get-with-inheritance "LOCATION" nil point))) + ;; when the second path component is an absolute path, skip the first + (when (and (< 1 (length path)) (file-name-absolute-p (print (cadr path)))) + (setq path (cdr path))) + (message "%s" + (apply 'join-paths + (flatten + (mapcar + (lambda (x) (split-string x " ")) + path)))))) (defun org-set-location (value) "Set the value of property LOCATION. If point is before first heading