emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: org-agenda-buffer-name wrongly persists [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/28.0.50/lisp/org/)]
@ 2021-05-15 11:40 Ingo Lohmar
  2021-06-19 15:22 ` [PATCH] " Ingo Lohmar
  0 siblings, 1 reply; 2+ messages in thread
From: Ingo Lohmar @ 2021-05-15 11:40 UTC (permalink / raw)
  To: emacs-orgmode

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See


Your bug report will be posted to the Org mailing list.

The global variable org-agenda-buffer-name, once set, wrongly (IMO)
affects all future agenda buffer names for composite commands.

Minimal complete example (in emacs -q):


(setq org-agenda-custom-commands
      '(("z" "Std Agenda"
         ((tags "select"
		((org-agenda-overriding-header "*select*ed")))
          (agenda "" ((org-agenda-span 2)))))))
(("z" "Std Agenda" ((tags "select" ...) (agenda "" ...))))

(org-agenda nil "z")

and get a custom agenda with the default buffer name "*Org Agenda*"

Create a buffer "test.org" and switch it to `org-mode', insert a
timestamp (C-c .).  Now follow the timestamp link (C-c C-o), and get an
agenda with buffer name "*Org Agenda(a:2021-05-15)" (OK).

Now re-do

(org-agenda nil "z")

which has the same buffer name including the date (BUG).

I do not pretend to understand how the global variable
org-agenda-buffer-name is supposed to work (not even mentioning the
-sticky- functionality here).  What I understand is the following:

The org-agenda dispatcher let-binds o-a-buffer-name to the global value.
"Simple" agenda commands (like a todo list) called from the dispatcher
set this let-bound o-a-buffer-name, so they use the correct default
"Composite" custom commands called via the dispatcher do not set the
let-bound value, so they use the original let-bound value (the global
value at the start of org-agenda).
`org-follow-timestamp-link' calls the `org-agenda-list' command directly
(not via the dispatcher), hence sets the global (not a local let-bound)
value of o-a-buffer-name.

I have little constructive advice to offer regarding a solution.  It
seems to me that the global variable o-a-buffer-name is only harmful and
I would try to get rid of it, but I guess it is necessary for sticky
agendas (not using them).

Emacs  : GNU Emacs 28.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2021-05-01
Package: Org mode version 9.4.4 (release_9.4.4 @ /usr/local/share/emacs/28.0.50/lisp/org/)

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

end of thread, other threads:[~2021-06-19 15:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-15 11:40 Bug: org-agenda-buffer-name wrongly persists [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/28.0.50/lisp/org/)] Ingo Lohmar
2021-06-19 15:22 ` [PATCH] " Ingo Lohmar

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


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