Recently I switched all of my Org files from “properties at the bottom” to
“properties at the top”, in order to avoid maintaining my own fork with this
capability. Although that fork had been working well, Ihor had a good argument
that I’m potentially opting myself out of 3rd party tools by veering from what
has become the standard format.

Right away I discovered one of the reasons I had preferred properties at the
bottom: When I startup my Emacs and run org-agenda-list, and then hit RET on
an entry, no folding has been applied to the Org file and thus I see the full
property block at the beginning of entries (and in my case, they can often be
quite large). I have to scan down to find the actual text.

Reading through the code, I found that org-agenda-list calls
org-agenda-get-day-entries on each file in org-agenda-files, which
intentionally disables code folding before opening the file if it isn’t open
already:

  (defun org-agenda-get-day-entries (file date &rest args)
    (let* ((org-startup-folded nil)
      …)))

My workaround for this is to visit every entry in org-agenda-files before
calling org-agenda-list:

  (require 'org-agenda)
  (mapc #’find-file-noselect org-agenda-files)
  (call-interactively 'org-agenda-list)

I’m wondering whether we might want to provide a customization option to do
this automatically at the top of org-agenda-list, for any org-agenda-files
that aren’t already in buffers, since proper folding can make a big difference
when visiting Org entries from the Agenda.

--
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2

Reply via email to