Trevoke / org-gtd.el

A package for using GTD with org-mode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduce new variable `org-gtd-agenda-truncate-ellipsis`

Sabicool opened this issue · comments

Issue

I use Iosevka as my font and so an ellipsis does not take 1 character width. This results in headings not being in line:
image

I keep the following code in my config

(defun org-gtd--truncate-project-to-width (st)
  "Truncates the string to the width indicated by org-gtd-engage-prefix-width."
  (truncate-string-to-width
   (string-trim st)
   org-gtd-engage-prefix-width nil ?\s  "⣀"))

Which changes it to this:
image

Proprosed solution

To change the appearance of the agenda so they are in line. Would be preferable for this to be a customizable variable e.g:

(defcustom org-gtd-agenda-truncate-ellipsis "..."
  "Ellipsis to be shown for categories and contexts that are truncated"
  :group 'org-gtd-engage
  :package-version '(org-gtd . "3.1")
  :type 'string)

(defun org-gtd--truncate-project-to-width (st)
  "Truncates the string to the width indicated by org-gtd-engage-prefix-width."
  (truncate-string-to-width
   (string-trim st)
   org-gtd-engage-prefix-width nil ?\s  org-gtd-agenda-truncate-ellipsis))

Alternatively it could be made to inherit the value of org-ellipsis but this may not be ideal since some people like to use down arrows and other symbols for it since it goes in folded headers. This does not match the context in which the proposed org-gtd-agenda-truncate-ellipsis is to be used