emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] org-agenda passes current-prefix-arg to commands instead of arg [9.5.3 (9.5.3-g69c588 @ /Users/stas/.emacs.d/straight/build/org/)]
@ 2022-07-03 12:56 stasvlasov
  2022-07-07 10:05 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: stasvlasov @ 2022-07-03 12:56 UTC (permalink / raw)
  To: emacs-orgmode


`org-agenda' function passes `current-prefix-arg' to its commands (e.g., `org-agenda-tags') instead of `arg'

This might create unexpected behaviour if one uses `org-agenda' function inside another interactive function that accepts on universal prefix. For example if I define `my/agenda-done-todos' it wont show any DONE todos if I call it with prefix to restrict it to current buffer because `org-agenda-tags' will be limited only to active todos by `current-prefix-arg' and this will always produce empty set:

(add-to-list 'org-agenda-custom-commands
             '("d" "DONE todos"
               tags "TODO=\"DONE\""))

(defun my/agenda-done-todos (arg)
  "Show agenda for keyword 'd' (DONE todos). With ARG prefix restrict to current buffer."
  (interactive "P")
  (if arg
      (org-agenda nil "d" 'buffer)
    (org-agenda nil "d")))

Emacs  : GNU Emacs 28.1 (build 1, x86_64-apple-darwin19.6.0, NS appkit-1894.60 Version 10.15.7 (Build 19H1519))
 of 2022-05-07
Package: Org mode version 9.5.3 (9.5.3-g69c588 @ /Users/stas/.emacs.d/straight/build/org/)


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

end of thread, other threads:[~2022-07-07 10:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-03 12:56 [BUG] org-agenda passes current-prefix-arg to commands instead of arg [9.5.3 (9.5.3-g69c588 @ /Users/stas/.emacs.d/straight/build/org/)] stasvlasov
2022-07-07 10:05 ` Ihor Radchenko

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