From 8dbe42a9e66e2dd6650409d2a8025a11e581d2b5 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 14 Nov 2014 09:24:31 -0500 Subject: Fix require We don't seem to use sx-filter anywhere in here --- sx-question-mode.el | 1 - 1 file changed, 1 deletion(-) diff --git a/sx-question-mode.el b/sx-question-mode.el index 90a88ce..00ef447 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -26,7 +26,6 @@ (require 'markdown-mode) (require 'sx) -(require 'sx-filter) (require 'sx-question) (defgroup sx-question-mode nil -- cgit v1.2.3 From 76dde309a49b8959d482257b5622ef6dcf72072c Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 14 Nov 2014 09:24:53 -0500 Subject: Use correct method `sx-request-make' wouldn't behave correctly on this --- sx-question.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sx-question.el b/sx-question.el index 69a4d7f..40adbcb 100644 --- a/sx-question.el +++ b/sx-question.el @@ -54,7 +54,7 @@ (defun sx-question-get-question (site id) "Get the question ID from SITE." - (let ((res (sx-request-make + (let ((res (sx-method-call (format "questions/%s" id) `((site . ,site)) sx-question-browse-filter))) -- cgit v1.2.3 From 378fb090ab1826a7ee09e20c1ed439be283c72d4 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 14 Nov 2014 09:25:15 -0500 Subject: Ensure error string can print "%s" must take a string, but what we get might not be string-y. --- sx-question.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sx-question.el b/sx-question.el index 40adbcb..d15cc80 100644 --- a/sx-question.el +++ b/sx-question.el @@ -60,7 +60,7 @@ sx-question-browse-filter))) (if (vectorp res) (elt res 0) - (error "Couldn't find question %s in %s" id site)))) + (error "Couldn't find question %S in %S" id site)))) ;;; Question Properties -- cgit v1.2.3 From 96a45d820fb4499acadb2e8103ba786d06054e03 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Fri, 14 Nov 2014 14:28:42 +0000 Subject: Improve comment formating --- sx-question-mode.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sx-question-mode.el b/sx-question-mode.el index 4aa2688..72b139d 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -168,11 +168,18 @@ editor's name." :type 'string :group 'sx-question-mode) -(defcustom sx-question-mode-comments-title " Comments" +(defcustom sx-question-mode-comments-title " Comments" "Title used at the start of \"Comments\" sections." :type 'string :group 'sx-question-mode) +(defcustom sx-question-mode-comments-format "%s: %s\n" + "Format used to display comments. +First \"%s\" is replaced with user name. +Second \"%s\" is replaced with the comment." + :type 'string + :group 'sx-question-mode) + ;;; Printing a question's content ;;;; Functions @@ -274,13 +281,6 @@ DATA can represent a question or an answer." (propertize .display_name 'font-lock-face 'sx-question-mode-author))) -(defcustom sx-question-mode-comments-format " %s: %s\n" - "Format used to display comments. -First \"%s\" is replaced with user name. -Second \"%s\" is replaced with the comment." - :type 'string - :group 'sx-question-mode) - (defun sx-question-mode--print-comment (data) "Print the comment described by alist DATA." (sx-assoc-let data -- cgit v1.2.3