reddit / emacs

Line gets broken / wrapped in org-agenda view

pragmat1c1 · 2022-05-15 16:06
In org-agenda, when I apply tags to items, the item text (even if it’s just five words) gets a line break after two words or so. As you can see in the attached image, the item with the text "Org Party Einschulung" with the tag ":pauli:" gets wrapped, but only after I applied the tag. What do I need to change / investigate to fix this? https://preview.redd.it/dn83z036ynz81.png?width=750&format=png&auto=webp&s=4d50a88a1368bef752a654269f785c926a07f241 This is my **org-agenda-prefix-format**, in case it matters: (setq org-agenda-prefix-format '((agenda . "%-12:c%-12t% s") (todo . "%-12:c") (tags . "%-12:c") (search . "%-16:c"))) # Edit Started emacs with option "-Q" from command line: emacs -Q Then ran these lines: (setq org-directory "/Users/pragmat1c1/Dropbox/org") (setq org-agenda-files (directory-files-recursively org-directory "\\.org$")) (find-file (concat org-directory "/agenda/" "planner.org")) Next, I opened agenda: "M-x org-agenda RET a" I can see that indeed lines get wrapped when "visual-line-mode" is turned on. Otherwise no wrap and and arrow on the right of the tag (when I am resizing frame and make it smaller). # My findings Apparently in my setup 1. visual-line-mode is turned on 2. the items do not get enough width so that they get wrapped when a tag is added to an item Question: Where is the line width for the items defined? How can I increase that? ​ # FIXED Turns out that 1. I had "olivetti-mode" in org-agenda. That interferes with the window width. Turned it off. 2. "org-agenda-tags-column" was set to "auto"; setting it to "auto" has a bug and will break the item at arbitraty length. Setting this variable to "-100" will align the tags at column 100. 3. To prevent all line breaks in org agenda, I can use the code below. (But I did not. Point 1 and 2 were enough to fix my problem). ​ (add-hook 'org-agenda-mode-hook (lambda () (visual-line-mode -1) (setq truncate-lines 1))) Taken from: Disabling visual-line-mode only in org-agenda-mode [https://emacs.stackexchange.com/questions/68160/disabling-visual-line-mode-only-in-org-agenda-mode](https://emacs.stackexchange.com/questions/68160/disabling-visual-line-mode-only-in-org-agenda-mode) ​
organic-bookworm · 2022-05-15 17:36
`visual-line-mode`?
pragmat1c1 · 2022-05-15 18:20
Does not fix it, unfortunately. I am wondering what defines the width of the org-agenda buffer and the items. When a tag gets added to an item, the item does not have enough space anymore in my case.
yantar92 · 2022-05-16 13:00
This should be fixed on development version of Org. See the discussion in https://orgmode.org/list/87o80wz9le.fsf@localhost