aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sx-interaction.el2
-rw-r--r--sx.el7
2 files changed, 6 insertions, 3 deletions
diff --git a/sx-interaction.el b/sx-interaction.el
index 1e6164f..e4234b0 100644
--- a/sx-interaction.el
+++ b/sx-interaction.el
@@ -132,7 +132,7 @@ TEXT is a string. Interactively, it is read from the minibufer."
(setq text (read-string
"Comment text: "
(when .comment_id
- (sx--user-@name .owner))))
+ (concat (sx--user-@name .owner) " "))))
(while (< (string-width text) 15)
(setq text (read-string "Comment text (at least 15 characters): " text))))
;; If non-interactive, `text' could be anything.
diff --git a/sx.el b/sx.el
index d4c3ac2..e47e6e3 100644
--- a/sx.el
+++ b/sx.el
@@ -199,10 +199,13 @@ Return the result of BODY."
result))
(defun sx--user-@name (user)
- "Get the `display_name' of USER prepended with @."
+ "Get the `display_name' of USER prepended with @.
+In order to correctly @mention the user, all whitespace is
+removed from the display name before it is returned."
(sx-assoc-let user
(when (stringp .display_name)
- (concat "@" .display_name))))
+ (concat "@" (replace-regexp-in-string
+ "[[:space:]]" "" .display_name)))))
;;; Assoc-let