1

Let's say I have just one file in org-agenda-files called short.org. If I put items with active timestamps in short.org, they'll appear in the Week view just fine:

enter image description here

But if I have any other agenda files with longer names (i.e. a-little-longer.org), they'll break the agenda view's alignment:

enter image description here

This is undesirable behaviour. Is there any org-* variable that controls the width of the filename field/column in the Agenda Week view?

Thanks in advance.

EDIT:

I'm currently trying out org-agenda-columns, and also tweaking the value of org-columns-default-format-for-agenda. Although it may be easier to get better alignment in Column View, I'd still prefer if there was a way to do it in the default view, without using org-agenda-columns.

EDIT #2:

Using column view, this is the closest I could get to displaying the same information as what's in the default view:

(setq org-columns-default-format-for-agenda "%FILE %TIMESTAMP %TODO %ITEM %TAGS")

enter image description here

Several issues:

  • Couldn't get column view to show just the filename; it shows the entire path instead
  • Timestamp is also displayed in full date/time, rather than just showing the time (e.g. just 11:00-12:00)
  • No space left to display the item itself

For these reasons, finding a way to change just one aspect of the default view (the filename field width) would be the most preferable.

3
  • The relevant variable is org-agenda-prefix-format. You should read its doc string (C-h v org-agenda-prefix-format) carefully. You probably will need to modify the agenda part of its value and you will need to modify the width of the category field. If you have problems, please add its current value to your question.
    – NickD
    Sep 11, 2022 at 2:11
  • @NickD This is exactly what I was looking for, thanks! I set the width of the category field to 20 with (agenda . " %i %-20:c%?-12t% s"). Would you like me to post this as an answer below, with the value I set for org-agenda-prefix-format, or would you prefer to post this as an answer yourself for me to accept? (still getting the hang of SE ettiquette :-P)
    – j-gopal
    Sep 12, 2022 at 2:46
  • Thanks for asking! I wrote it up as a comment, because I don't have time to write a proper anaswr ATM. So please go ahead and provide an answer. if there are any problems with it, it can always be edited to fix them. And I (or somebody else) can add additional answers if necessary.
    – NickD
    Sep 12, 2022 at 3:44

1 Answer 1

0

As per @NickD's suggestion, tweaking the agenda part of org-agenda-prefix-format did the job.

(setq org-agenda-prefix-format
 '((agenda . " %i %-20:c%?-12t% s") ;; '%-20' sets 20 char field width
   (todo   . " %i %-12:c")
   (tags   . " %i %-12:c")
   (search . " %i %-12:c")))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.