aboutsummaryrefslogtreecommitdiff
path: root/pearl.el
diff options
context:
space:
mode:
Diffstat (limited to 'pearl.el')
-rw-r--r--pearl.el25
1 files changed, 20 insertions, 5 deletions
diff --git a/pearl.el b/pearl.el
index bb91f35..e9f1e8b 100644
--- a/pearl.el
+++ b/pearl.el
@@ -287,6 +287,17 @@ Set to nil to omit the tag."
:type 'boolean
:group 'pearl)
+(defcustom pearl-assignee-tag-short nil
+ "When non-nil, shorten the assignee @-tag to the first name only.
+The default slugs Linear's full @-mention handle (e.g. `first.last' becomes
+=:@first_last:'). With this on, only the first segment is kept -- the part
+before the first `.' or space -- so the tag becomes =:@first:'. A single-token
+handle like `alice' is unchanged. Shorter and more scannable, but first names
+can collide across teammates, so it is off by default. Opt in when brevity
+matters more than disambiguation."
+ :type 'boolean
+ :group 'pearl)
+
(defconst pearl--title-case-minor-words
'("a" "an" "and" "as" "at" "but" "by" "for" "if" "in" "nor" "of" "on" "or"
"per" "the" "to" "vs" "via")
@@ -2507,12 +2518,16 @@ e.g. \"nerses\") and falls back to `:name' -- so a teammate whose `:name' is a
full email gets @nerses, not @nerses_deepsat_com. The slug reuses
`pearl--label-name-to-tag'; the `@' prefix keeps the assignee tag in its own
namespace, distinct from label tags, so the label-edit path can preserve it (see
-`pearl--set-heading-label-tags'). Title-sync-safe: Org strips tags before the
-heading title is hashed."
+`pearl--set-heading-label-tags'). With `pearl-assignee-tag-short' on, only the
+first segment of the handle is kept (see that variable). Title-sync-safe: Org
+strips tags before the heading title is hashed."
(when (and pearl-show-assignee assignee)
- (let ((slug (pearl--label-name-to-tag
- (or (plist-get assignee :display-name)
- (plist-get assignee :name)))))
+ (let* ((handle (or (plist-get assignee :display-name)
+ (plist-get assignee :name)))
+ (handle (if (and pearl-assignee-tag-short handle)
+ (car (split-string handle "[.[:space:]]+" t))
+ handle))
+ (slug (pearl--label-name-to-tag handle)))
(unless (string-empty-p slug) (concat "@" slug)))))
(defun pearl--derive-todo-line (states)