From 50465fe9cb68978088da2be1a88549892c6b3146 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Thu, 8 Jan 2015 16:03:54 -0200 Subject: Don't use .total the total property doubles the time taken for the request, according to https://api.stackexchange.com/docs/paging --- sx-filter.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sx-filter.el') diff --git a/sx-filter.el b/sx-filter.el index a3f6861..72ab6b2 100644 --- a/sx-filter.el +++ b/sx-filter.el @@ -64,7 +64,7 @@ All wrapper fields are included by default." .page_size .quota_max .quota_remaining - .total) + ) nil none))) ;;; @TODO allow BASE to be a precompiled filter name -- cgit v1.2.3 From 7818811a7ca2666a007007caa8b32be7787e932d Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Thu, 8 Jan 2015 16:09:54 -0200 Subject: Docs --- sx-filter.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sx-filter.el') diff --git a/sx-filter.el b/sx-filter.el index 72ab6b2..a35b51d 100644 --- a/sx-filter.el +++ b/sx-filter.el @@ -47,7 +47,7 @@ Structure: ;;; Creation (defmacro sx-filter-from-nil (included) - "Creates a filter data structure with INCLUDED fields. + "Create a filter data structure with INCLUDED fields. All wrapper fields are included by default." `(quote ((,@(sx--tree-expand @@ -70,7 +70,7 @@ All wrapper fields are included by default." ;;; @TODO allow BASE to be a precompiled filter name (defun sx-filter-compile (&optional include exclude base) "Compile INCLUDE and EXCLUDE into a filter derived from BASE. -INCLUDE and EXCLUDE must both be lists; BASE should be a string. +INCLUDE and EXCLUDE must both be lists; BASE should be a symbol. Returns the compiled filter as a string." (let ((keyword-arguments @@ -93,7 +93,7 @@ Returns the compiled filter as a string." (defun sx-filter-get (&optional include exclude base) "Return the string representation of the given filter. -If the filter data exist in `sx--filter-alist', that value will +If the filter data exists in `sx--filter-alist', that value will be returned. Otherwise, compile INCLUDE, EXCLUDE, and BASE into a filter with `sx-filter-compile' and push the association onto `sx--filter-alist'. Re-cache the alist with `sx-cache-set' and -- cgit v1.2.3 From 55682ee682c983f66c0a05b63ecb0ab4e5832cba Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Thu, 8 Jan 2015 16:10:05 -0200 Subject: Style --- sx-filter.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sx-filter.el') diff --git a/sx-filter.el b/sx-filter.el index a35b51d..bdbdab9 100644 --- a/sx-filter.el +++ b/sx-filter.el @@ -77,10 +77,8 @@ Returns the compiled filter as a string." `((include . ,(if include (sx--thing-as-string include))) (exclude . ,(if exclude (sx--thing-as-string exclude))) (base . ,(if base base))))) - (let ((response (elt (sx-request-make - "filter/create" - keyword-arguments) 0))) - (sx-assoc-let response + (let ((result (elt (sx-request-make "filter/create" keyword-arguments) 0))) + (sx-assoc-let result .filter)))) -- cgit v1.2.3 From 117f78c3e16fa32f82e75f43a7aac24afd9a37d5 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Thu, 8 Jan 2015 16:11:54 -0200 Subject: Build filters from default. --- sx-filter.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sx-filter.el') diff --git a/sx-filter.el b/sx-filter.el index bdbdab9..0df9b5e 100644 --- a/sx-filter.el +++ b/sx-filter.el @@ -65,7 +65,7 @@ All wrapper fields are included by default." .quota_max .quota_remaining ) - nil none))) + nil nil))) ;;; @TODO allow BASE to be a precompiled filter name (defun sx-filter-compile (&optional include exclude base) -- cgit v1.2.3