aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-01-07 16:36:35 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-01-07 16:36:35 -0200
commit09423c2e8f40638a8438cd76783a21d0eb7ed492 (patch)
tree5f4dacc047925085724202d897d5d57f90973355
parent74790a11bc19fbdeae054816962b2160461767f4 (diff)
Add %@ support to sx-user--format
-rw-r--r--sx-user.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/sx-user.el b/sx-user.el
index fe05057..c533744 100644
--- a/sx-user.el
+++ b/sx-user.el
@@ -125,6 +125,7 @@ The value is a copy of FORMAT-STRING, but with certain constructs
replaced by text that describes the specified USER:
%d is the display name.
+%@ is the display name in a format suitable for @mentions.
%l is the link to the profile.
%r is the reputation.
%a is the accept rate.
@@ -138,7 +139,10 @@ the `sx-button-user' category."
(?n . ,\.display_name)
(?l . ,\.link)
(?r . ,\.reputation)
- (?a . ,\.accept_rate))
+ (?a . ,\.accept_rate)
+ (?@ . ,(when (string-match "%@" format-string)
+ (sx-user--@name .display_name)))
+ )
sx-user--format-property-alist)))
(if (> 0 (string-width .link))
(insert-text-button text