emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] org-habit: custom consistency graph placement [9.3.7 (releas


From: No Wayman
Subject: Re: [PATCH] org-habit: custom consistency graph placement [9.3.7 (release_9.3.7-716-g6d5cab @ /home/n/.emacs.d/straight/build/org/)]
Date: Thu, 20 Aug 2020 23:12:20 -0400
User-agent: mu4e 1.5.5; emacs 28.0.50


Ihor Radchenko <yantar92@gmail.com> writes:

As I remember, last time I played with multi-line agenda entries, there
were issues with org-agenda-next/previous-item. You may consider
checking if your patch breaks those.

Thanks for the heads up, Ihor. The patch itself shouldn't break
anything and is completely optional behavior, though the example I gave in the docstring does.
I ended up faking the newline with the display text-property:


(defun +org-habit-graph-on-own-line (graph)
 "Place org habit consitency graph below the habit."
 (add-text-properties
  (line-beginning-position)
  (line-end-position)
`(display ,(concat (when-let ((icon (car (org-agenda-get-category-icon
                                            (org-agenda-get-category)))))

                       (format " %s " icon))
                     (string-trim-left (thing-at-point 'line))
(make-string (or org-habit-graph-column 0) ? ) (propertize graph 'display '(height (+ 1)))))))

This works well for me so far.

I've revised the docstring attachment in the attached patch.

Attachment: 0001-habit-add-custom-option-for-placing-consistency-grap.patch
Description: org-habit-insert-graph-function.0.0.3


reply via email to

[Prev in Thread] Current Thread [Next in Thread]