From: "John Wiegley" <johnw@gnu.org>
To: emacs-orgmode@gnu.org
Subject: Suggestion for org-agenda-list: pre-open org-agenda-files
Date: Mon, 04 Dec 2023 09:54:52 -0800 [thread overview]
Message-ID: <m2zfypc0pf.fsf@newartisans.com> (raw)
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
next reply other threads:[~2023-12-04 17:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 17:54 John Wiegley [this message]
2023-12-08 22:02 ` Suggestion for org-agenda-list: pre-open org-agenda-files Ihor Radchenko
2024-01-16 15:48 ` Ihor Radchenko
2024-03-16 7:46 ` Ihor Radchenko
2024-03-16 12:32 ` John Wiegley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2zfypc0pf.fsf@newartisans.com \
--to=johnw@gnu.org \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.