From beafd94faf6ec8c1aede9cbca66c5af26bf35d51 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sun, 4 Jan 2015 17:50:17 -0200 Subject: Some starting comments --- sx-question-list.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sx-question-list.el') diff --git a/sx-question-list.el b/sx-question-list.el index 0a8e72c..ee7d6b1 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -141,12 +141,14 @@ Also see `sx-question-list-refresh'." 'sx-question-list-answers-accepted 'sx-question-list-answers)) (concat + ;; First line (propertize .title 'face (if (sx-question--read-p question-data) 'sx-question-list-read-question 'sx-question-list-unread-question)) (propertize " " 'display "\n ") + ;; Second line (propertize favorite 'face 'sx-question-list-favorite) " " (propertize (concat (sx-time-since .last_activity_date) -- cgit v1.2.3 From e8a2b48d09e22cf5dca446e70d1428ae4561fd42 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sun, 4 Jan 2015 17:50:35 -0200 Subject: Display bounty --- sx-filter.el | 1 + sx-question-list.el | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'sx-question-list.el') diff --git a/sx-filter.el b/sx-filter.el index d484f43..1cf010f 100644 --- a/sx-filter.el +++ b/sx-filter.el @@ -106,6 +106,7 @@ return the compiled filter." (defvar sx-browse-filter (sx-filter-from-nil ((question body_markdown + bounty_amount comments answers last_editor diff --git a/sx-question-list.el b/sx-question-list.el index ee7d6b1..81e5ab0 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -104,6 +104,11 @@ "" :group 'sx-question-list-faces) +(defface sx-question-list-bounty + '((t :inherit font-lock-warning-face)) + "" + :group 'sx-question-list-faces) + ;;; Backend variables (defvar sx-question-list--print-function #'sx-question-list--print-info @@ -150,9 +155,11 @@ Also see `sx-question-list-refresh'." (propertize " " 'display "\n ") ;; Second line (propertize favorite 'face 'sx-question-list-favorite) - " " - (propertize (concat (sx-time-since .last_activity_date) - sx-question-list-ago-string) + (if (and (numberp .bounty_amount) (> .bounty_amount 0)) + (propertize (format "%4d" .bounty_amount) + 'face 'sx-question-list-bounty) + " ") + " " 'face 'sx-question-list-date) " " (propertize (mapconcat #'sx-question--tag-format .tags " ") -- cgit v1.2.3 From 63484071c93bb3b9d661ed98a77a29e587b456e7 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sun, 4 Jan 2015 17:51:11 -0200 Subject: Fix date width --- sx-question-list.el | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sx-question-list.el') diff --git a/sx-question-list.el b/sx-question-list.el index 81e5ab0..ee37fb2 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -160,6 +160,9 @@ Also see `sx-question-list-refresh'." 'face 'sx-question-list-bounty) " ") " " + (propertize (format "%3s%s" + (sx-time-since .last_activity_date) + sx-question-list-ago-string) 'face 'sx-question-list-date) " " (propertize (mapconcat #'sx-question--tag-format .tags " ") -- cgit v1.2.3 From 707cb9f97ea9ff6e6f7b135d24a0e2e7b0f99740 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sun, 4 Jan 2015 17:51:23 -0200 Subject: Set tag max-width to 40 --- sx-question-list.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sx-question-list.el') diff --git a/sx-question-list.el b/sx-question-list.el index ee37fb2..1342e76 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -165,7 +165,9 @@ Also see `sx-question-list-refresh'." sx-question-list-ago-string) 'face 'sx-question-list-date) " " - (propertize (mapconcat #'sx-question--tag-format .tags " ") + ;; @TODO: Make this width customizable. (Or maybe just make + ;; the whole thing customizable) + (propertize (format "%-40s" (mapconcat #'sx-question--tag-format .tags " ")) 'face 'sx-question-list-tags) (propertize " " 'display "\n"))))))) -- cgit v1.2.3 From df4a8bba9b720357008423b8f91657a8a311607a Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sun, 4 Jan 2015 18:09:26 -0200 Subject: Display user --- sx-filter.el | 5 ++++- sx-question-list.el | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'sx-question-list.el') diff --git a/sx-filter.el b/sx-filter.el index 1cf010f..15bd8a1 100644 --- a/sx-filter.el +++ b/sx-filter.el @@ -117,7 +117,10 @@ return the compiled filter." downvoted question_id share_link) - (user display_name) + (user display_name + reputation) + (shallow_user display_name + reputation) (comment owner body_markdown body diff --git a/sx-question-list.el b/sx-question-list.el index 1342e76..40b72b9 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -109,6 +109,16 @@ "" :group 'sx-question-list-faces) +(defface sx-question-list-reputation + '((t :inherit sx-question-list-date)) + "" + :group 'sx-question-list-faces) + +(defface sx-question-list-user + '((t :inherit font-lock-builtin-face)) + "" + :group 'sx-question-list-faces) + ;;; Backend variables (defvar sx-question-list--print-function #'sx-question-list--print-info @@ -169,6 +179,12 @@ Also see `sx-question-list-refresh'." ;; the whole thing customizable) (propertize (format "%-40s" (mapconcat #'sx-question--tag-format .tags " ")) 'face 'sx-question-list-tags) + " " + (let-alist .owner + (format "%15s %5s" + (propertize .display_name 'face 'sx-question-list-user) + (propertize (number-to-string .reputation) + 'face 'sx-question-list-reputation))) (propertize " " 'display "\n"))))))) (defvar sx-question-list--pages-so-far 0 -- cgit v1.2.3