Michaël Cadilhac writes: > My problem wasn't at all, as you point out, that the tag would erase the > entry. > > It has to do with habits: The habit graph overwrites anything else. I > like having org-agenda-tags-column to a low value (wide screen), but > tags are crucial to my workflow, so them being overwritten is > problematic. > > My previous patch is completely overkill for that purpose (it's even > misguided since it does stem from a misunderstanding of tags > alignment). Here's a simpler patch. It may be a matter of taste, > though.
I see (and sorry for the slow reply). I've never used habits, but that does sound good to avoid. Would you mind 1) wrapping the change below into a patch (see <https://orgmode.org/worg/org-contribute.html>) and 2) providing a minimal example like the one in my last reply so that reviewers have something to quickly test? No Wayman, I see that you replied [1] that your patch at <https://orgmode.org/list/87ft8gelpn....@gmail.com/> would allow working around this issue [2], but do you still think the change below is a good idea? Thanks. [1] Note that it's detached from this thread because the References and In-Reply-To headers weren't preserved. [2] Sorry that that patch hasn't gotten any attention yet. > diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el > index e4a334dbd..a80123853 100644 > --- a/lisp/org-agenda.el > +++ b/lisp/org-agenda.el > @@ -9080,6 +9080,10 @@ current line." > (goto-char (match-beginning 1)) > (delete-region (save-excursion (skip-chars-backward " \t") (point)) > (point)) > + (when (get-text-property (point) 'org-habit-p) > + (setq c (max c (+ 1 org-habit-graph-column > + org-habit-preceding-days > + org-habit-following-days)))) I haven't applied this to check, but I suspect you'll need some amount of guarding (e.g. with boundp) to silence the byte-compiler here. > (insert (org-add-props > (make-string (max 1 (- c (current-column))) ?\s) > (plist-put (copy-sequence (text-properties-at (point)))