Trevoke / org-gtd.el

A package for using GTD with org-mode
GNU General Public License v3.0
367 stars 45 forks source link

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

Open Sabicool opened 5 months ago

Sabicool commented 5 months ago

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