emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Suggestion for org-agenda-list: pre-open org-agenda-files
@ 2023-12-04 17:54 John Wiegley
  2023-12-08 22:02 ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: John Wiegley @ 2023-12-04 17:54 UTC (permalink / raw)
  To: emacs-orgmode

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-16 12:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-04 17:54 Suggestion for org-agenda-list: pre-open org-agenda-files John Wiegley
2023-12-08 22:02 ` Ihor Radchenko
2024-01-16 15:48   ` Ihor Radchenko
2024-03-16  7:46     ` Ihor Radchenko
2024-03-16 12:32       ` John Wiegley

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).