From 09423c2e8f40638a8438cd76783a21d0eb7ed492 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Wed, 7 Jan 2015 16:36:35 -0200 Subject: Add %@ support to sx-user--format --- sx-user.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sx-user.el') 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 -- cgit v1.2.3