emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Michaël Cadilhac" <michael@cadilhac.name>
To: Kyle Meyer <kyle@kyleam.com>
Cc: Org-Mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: Proposal: do not align tags in Agenda
Date: Sun, 4 Oct 2020 11:03:29 -0500	[thread overview]
Message-ID: <CADt3fpPppPKSoj1AjdacUK6X1dgegmw+mAOm=Fq7Yo=2OZwx9A@mail.gmail.com> (raw)
In-Reply-To: <87lfgsq6l5.fsf@kyleam.com>

[-- Attachment #1: Type: text/plain, Size: 1987 bytes --]

Hello Kyle,

Thanks very much for your feedback.  As these are changes I made
months ago, I forgot the … finer details—I basically got my narrative
completely wrong, my apologies.

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.

Cheers,
M.


On Tue, Sep 29, 2020 at 10:36 PM Kyle Meyer <kyle@kyleam.com> wrote:
>
> Michaël Cadilhac writes:
>
> > Hello all,
> >
> > I have a wide screen, which makes right edge alignment of tags in the
> > agenda inconvenient (they're hard to match with the main entry).
> > Setting org-agenda-tags-column to a specific column overwrites part of
> > the entry, which is not optimal.  I'd simply want the tag to be put
> > _after_ the entry.
>
> Hmm, I don't think it's supposed to overwrite part of the entry.  I
> haven't been able to trigger that on my end.  Here's the setup I tried
> with an otherwise vanilla configuration:
>
>     (setq org-agenda-files (list "/tmp/scratch.org"))
>     (setq org-agenda-tags-column 25)
>
> where /tmp/scratch.org looks like this
>
>     * TODO foo bar baz                                                      :one:
>     * TODO b                                                                :two:
>
> When I run org-todo-list, the longer top entry isn't overwritten:
>
>     Global list of TODO items of type: ALL
>     Press ‘N r’ (e.g. ‘0 r’) to search again: (0)[ALL] (1)TODO (2)DONE
>       scratch:    TODO foo bar baz :one:
>       scratch:    TODO b     :two:
>
> What am I missing?

[-- Attachment #2: agenda-tags-habit.patch --]
[-- Type: text/x-patch, Size: 608 bytes --]

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))))
 	(insert (org-add-props
 		    (make-string (max 1 (- c (current-column))) ?\s)
 		    (plist-put (copy-sequence (text-properties-at (point)))

  reply	other threads:[~2020-10-04 16:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-24 16:16 Proposal: do not align tags in Agenda Michaël Cadilhac
2020-09-30  3:36 ` Kyle Meyer
2020-10-04 16:03   ` Michaël Cadilhac [this message]
2020-10-29  2:21     ` Kyle Meyer
  -- strict thread matches above, loose matches on Subject: below --
2020-10-05 16:59 No Wayman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADt3fpPppPKSoj1AjdacUK6X1dgegmw+mAOm=Fq7Yo=2OZwx9A@mail.gmail.com' \
    --to=michael@cadilhac.name \
    --cc=emacs-orgmode@gnu.org \
    --cc=kyle@kyleam.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).