aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-01-07 16:36:07 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-01-07 16:36:07 -0200
commit74790a11bc19fbdeae054816962b2160461767f4 (patch)
tree9dac41532ab11102fa0e392b6557e2d255d1c691
parent49ee9fc6aa1702cfaf3f67b193eb7c888d23f8d2 (diff)
Make sx-user--@name take a string.
-rw-r--r--sx-user.el17
1 files changed, 7 insertions, 10 deletions
diff --git a/sx-user.el b/sx-user.el
index 7a07d03..fe05057 100644
--- a/sx-user.el
+++ b/sx-user.el
@@ -174,20 +174,17 @@ the `sx-button-user' category."
"List of replacements to use for non-ascii characters.
Used to convert user names into @mentions.")
-(defun sx-user--@name (user)
- "Get the `display_name' of USER prepended with @.
+(defun sx-user--@name (display-name)
+ "Convert DISPLAY-NAME into an @mention.
In order to correctly @mention the user, all whitespace is
-removed from the display name and a series of unicode conversions
-are performed before it is returned
+removed from DISPLAY-NAME and a series of unicode conversions are
+performed before it is returned.
See `sx-user--ascii-replacement-list'.
If all you need is the @name, this is very slightly faster than
-using `sx-user--format'."
- (sx-assoc-let user
- (if (stringp .display_name)
- (concat "@" (sx--recursive-replace
- sx-user--ascii-replacement-list .display_name))
- "")))
+using `sx-user--format', but it doesn't do any sanity checking."
+ (concat "@" (sx--recursive-replace
+ sx-user--ascii-replacement-list display-name)))
(provide 'sx-user)
;;; sx-user.el ends here