emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: John Wiegley <johnw@gnu.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Suggestion for org-agenda-list: pre-open org-agenda-files
Date: Fri, 08 Dec 2023 22:02:52 +0000	[thread overview]
Message-ID: <87v898bbeb.fsf@localhost> (raw)
In-Reply-To: <m2zfypc0pf.fsf@newartisans.com>

"John Wiegley" <johnw@gnu.org> writes:

> 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)
>       …)))

This should actually be redundant because all the agenda commands should
(if not, it is a bug) open the necessary buffers when calling
`org-agenda-prepare'->`org-agenda-prepare-buffers'. By default,
`org-agenda-prepare-buffers' applies initial folding, according to the
default nil value of `org-agenda-inhibit-startup'.

> 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)

... and `org-agenda-list' does call `org-agenda-prepare'...

So, may you dig a bit further and check why `org-agenda-prepare' is not
opening the agenda files?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


  reply	other threads:[~2023-12-08 22:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04 17:54 Suggestion for org-agenda-list: pre-open org-agenda-files John Wiegley
2023-12-08 22:02 ` Ihor Radchenko [this message]
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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v898bbeb.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=johnw@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 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).