emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Proposal: do not align tags in Agenda
@ 2020-09-24 16:16 Michaël Cadilhac
  2020-09-30  3:36 ` Kyle Meyer
  0 siblings, 1 reply; 5+ messages in thread
From: Michaël Cadilhac @ 2020-09-24 16:16 UTC (permalink / raw)
  To: Org-Mode mailing list

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

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.  The attached patch is what I've been using for the
past month, and it seems to work alright.

Thoughts for/against?

Stay safe,
M.

[-- Attachment #2: do-not-align.diff --]
[-- Type: text/x-patch, Size: 1380 bytes --]

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index e4a334dbd..792348e4c 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1912,6 +1912,7 @@ character screen."
   :group 'org-agenda-line-format
   :type '(choice
 	  (const :tag "Automatically align to right edge of window" auto)
+	  (const :tag "Do not align" nil)
 	  (integer :tag "Specific column" -80))
   :package-version '(Org . "9.1")
   :version "26.1")
@@ -9073,13 +9074,20 @@ current line."
 				 (if (memq 'org-tag prop)
 				     prop
 				   (cons 'org-tag prop))))))
-	(setq l (string-width (match-string 1))
-	      c (if (< org-agenda-tags-column 0)
-		    (- (abs org-agenda-tags-column) l)
-		  org-agenda-tags-column))
+	(when org-agenda-tags-column
+	    (setq l (string-width (match-string 1))
+		  c (if (< org-agenda-tags-column 0)
+			(- (abs org-agenda-tags-column) l)
+		      org-agenda-tags-column)))
 	(goto-char (match-beginning 1))
 	(delete-region (save-excursion (skip-chars-backward " \t") (point))
 		       (point))
+	(unless org-agenda-tags-column
+	  (setq c (if (get-text-property (point) 'org-habit-p)
+		      (+ 1 org-habit-graph-column
+			 org-habit-preceding-days
+			 org-habit-following-days)
+		    (current-column))))
 	(insert (org-add-props
 		    (make-string (max 1 (- c (current-column))) ?\s)
 		    (plist-put (copy-sequence (text-properties-at (point)))

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: Proposal: do not align tags in Agenda
@ 2020-10-05 16:59 No Wayman
  0 siblings, 0 replies; 5+ messages in thread
From: No Wayman @ 2020-10-05 16:59 UTC (permalink / raw)
  To: michael; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 398 bytes --]

I recently proposed a patch that would allow a workaround for this:

https://orgmode.org/list/87ft8gelpn.fsf@gmail.com/

It allows custom placement of the habit consistency graph within the agenda.
There is an accompanying example that places the graph on its own line
under the agenda item.
I've attached an org file with my current workaround which advises
`org-habit-insert-consistency-graphs'.

[-- Attachment #1.2: Type: text/html, Size: 592 bytes --]

[-- Attachment #2: org-habit-single-line-suggestion.org --]
[-- Type: application/vnd.lotus-organizer, Size: 1849 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-29  2:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2020-10-29  2:21     ` Kyle Meyer
2020-10-05 16:59 No Wayman

Code repositories for project(s) associated with this 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).