| 1 |
From: Xiyue Deng <[email protected]> |
| 2 |
Date: Wed, 12 Nov 2025 14:12:55 -0800 |
| 3 |
Subject: Give one more space for the annotation for minibuffer right align |
| 4 |
|
| 5 |
Currently the annotation is perfectly right aligned, but this gives |
| 6 |
unpleasant display under console, which will force a line-wrap and |
| 7 |
push the ending `*' to the next line. For example: |
| 8 |
|
| 9 |
,---- |
| 10 |
| some-activitiy-1 1 bufs, 0 files, 2 days* |
| 11 |
| some-activitiy-2 2 bufs, 0 files, 3 days* |
| 12 |
`---- |
| 13 |
|
| 14 |
Will become |
| 15 |
|
| 16 |
,---- |
| 17 |
| some-activitiy-1 1 bufs, 0 files, 2 days\ |
| 18 |
| * |
| 19 |
| some-activitiy-2 2 bufs, 0 files, 3 days\ |
| 20 |
| * |
| 21 |
`---- |
| 22 |
|
| 23 |
This commit adds one more space when running under console to make the |
| 24 |
display better, and keep GUI mode untouched. |
| 25 |
|
| 26 |
Forwarded: https://github.com/alphapapa/activities.el/pull/154 |
| 27 |
--- |
| 28 |
activities.el | 3 ++- |
| 29 |
1 file changed, 2 insertions(+), 1 deletion(-) |
| 30 |
|
| 31 |
diff --git a/activities.el b/activities.el |
| 32 |
index 6e7ce9a..d873880 100644 |
| 33 |
--- a/activities.el |
| 34 |
+++ b/activities.el |
| 35 |
@@ -984,7 +984,8 @@ which see, with DEFAULT." |
| 36 |
'face `(:foreground ,age-color :weight bold))) |
| 37 |
(dirty-annotation (if dirtyp (propertize "*" 'face 'bold) " "))) |
| 38 |
(concat (propertize " " 'display |
| 39 |
- `(space :align-to (- right ,(+ 1 (length annotation) |
| 40 |
+ `(space :align-to (- right ,(+ (if (display-graphic-p) 1 2) |
| 41 |
+ (length annotation) |
| 42 |
(length age-annotation))))) |
| 43 |
annotation age-annotation dirty-annotation))))) |
| 44 |
(activity-table (str pred action) |