From 74790a11bc19fbdeae054816962b2160461767f4 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Wed, 7 Jan 2015 16:36:07 -0200 Subject: Make sx-user--@name take a string. --- sx-user.el | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'sx-user.el') 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 -- cgit v1.2.3