Skip to main content


Dumb #org-mode question:

Is there a way to tell #emacs to generate an agenda view for the current buffer only? Bonus points if the said buffer is not in org-agenda-files.

Edit: Got it.


Pressing < in the agenda dispatcher should do this

Laurent Gatto reshared this.

in reply to Jonathan Lamothe

Not tried, but does this work? stackoverflow.com/a/29509749
in reply to Jonathan Lamothe

A soltion with a little lisp code : stackoverflow.com/questions/63…
in reply to Jonathan Lamothe

Per the help doc for org-agenda

"If the current buffer is in Org mode and visiting a file, you can also
first press ‘<’ once to indicate that the agenda should be temporarily
(until the next use of ‘SPC o a’) restricted to the current file.
Pressing ‘<’ twice means to restrict to the current subtree or region
(if active).
"

In other words, execute org-agenda then press "<" before the command you want to run against the agenda.

This entry was edited (2 days ago)
in reply to a world without cars

Question for you - how did you highlight "org-agenda-files" like that in your post?
in reply to a world without cars

@a world without cars I have a markdown plugin on my Friendica server. I just put it between backticks like this: `org-agenda-files`.

This wouldn't work on Mastodon though.

in reply to Jonathan Lamothe

oh interesting. It rendered properly for me on Mastodon but not when I write it that way.
in reply to Jonathan Lamothe

you could do something like this

```
(defun my/file-agenda ()
(interactive)
(when-let ((org-agenda-files (list (buffer-file-name (current-buffer)))))
(org-agenda)))
```

This website uses cookies. If you continue browsing this website, you agree to the usage of cookies.