emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/ement cdd35a0ee3 1/3: Fix: avoid spurious indent in roo


From: ELPA Syncer
Subject: [elpa] externals/ement cdd35a0ee3 1/3: Fix: avoid spurious indent in room membership changes
Date: Wed, 24 May 2023 14:58:34 -0400 (EDT)

branch: externals/ement
commit cdd35a0ee373990fa6a40eb44837a701cd6dd498
Author: Steven Allen <steven@stebalien.com>
Commit: Steven Allen <steven@stebalien.com>

    Fix: avoid spurious indent in room membership changes
    
    Propertize the spaces in the widget's format string to hide them. We
    could, alternatively, use a zero-width space... but that won't work on a
    TTY.
    
    This is a bit of a hack but it looks much nicer.
---
 ement-room.el | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/ement-room.el b/ement-room.el
index aba3b95619..cf8bdd0061 100644
--- a/ement-room.el
+++ b/ement-room.el
@@ -3698,12 +3698,10 @@ a copy of the local keymap, and sets 
`header-line-format'."
 (define-widget 'ement-room-membership 'item
   "Widget for membership events."
   ;; FIXME: This makes it hard to add a timestamp according to the buffer's 
message format spec.
-
-  ;; FIXME: The widget value inserts an extra space before the wrap prefix.  
There seems
-  ;; to be no way to fix this while still using a widget for this, so maybe we 
shouldn't
-  ;; use a widget after all.  But it might be good to keep digging for a 
solution so that
-  ;; widgets could be used for other things later...
-  :format "%{ %v %}"
+  ;; NOTE: The widget needs something before and after "%v" to correctly apply 
the
+  ;; `ement-room-membership' face. We could use a zero-width space, but that 
won't work on
+  ;; a TTY. So we use a regular space but replace it with nothing with a 
display spec.
+  :format (let ((zws (propertize " " 'display ""))) (concat "%{" zws "%v" zws 
"%}"))
   :sample-face 'ement-room-membership
   :value-create (lambda (widget)
                   (pcase-let* ((event (widget-value widget)))



reply via email to

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