Mikhail Skorzhinskii <mskorzhins...@eml.cc> writes: > Thank you for your comments once again. I've changed string= to eq and > it appears to be working OK. > > I've also renamed "title" variable to "title-prop" for better > readability. The -prop suffix should show the reader that it was > extracted from the file, and thus cost some CPU/IO. > > I've attached an updated version to this email. Would love to hear what > you think.
Thanks! And sorry for the late reply. Your patch fell through the cracks in my todo list. > * lisp/org-agenda.el (org-agenda-show-outline-path): add an option to > show document title in outline path (instead of file name) > * lisp/org.el (org-get-title-from-file): a function to collect the > document title from the org-mode file > * lisp/org.el (org-display-outline-path): add logic that will collect a > document title and put it into the outline path if > org-agenda-show-outline-path set to 'title It would make sense to document the new customization in ORG-NEWS. > +(defun org-get-title-from-file (file) > + "Collect tilte from the provided `org-mode' FILE." > + (let (title) ^ typo > + (when file > + (with-current-buffer > + (get-file-buffer file) > + (pcase (org-collect-keywords '("TITLE")) > + (`(("TITLE" . ,val)) > + (setq title (car val))))) > + title))) Note that this function behavior is underfined when FILE buffer does not exist. It would be better to accept buffer as argument. Best, Ihor