From 753ee36a9b1dc17804198d461ca660a65eeff0e9 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Thu, 27 Nov 2014 18:41:09 -0500 Subject: File header normalization --- sx-auth.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sx-auth.el') diff --git a/sx-auth.el b/sx-auth.el index b6c0411..bfa805a 100644 --- a/sx-auth.el +++ b/sx-auth.el @@ -1,4 +1,4 @@ -;;; sx-auth.el --- user authentication -*- lexical-binding: t; -*- +;;; sx-auth.el --- user authentication ;; Copyright (C) 2014 Sean Allred @@ -183,4 +183,5 @@ removed those properties." ;; Local Variables: ;; indent-tabs-mode: nil +;; lexical-binding: t ;; End: -- cgit v1.2.3 From 0228524a31cf2e040525302da8cf12e2f749fbbb Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 28 Nov 2014 13:30:11 -0500 Subject: Provide commentaries for each file --- sx-auth.el | 7 +++++++ sx-cache.el | 14 ++++++++++---- sx-encoding.el | 5 +++++ sx-favorites.el | 3 +++ sx-filter.el | 4 ++++ sx-interaction.el | 4 ++++ sx-networks.el | 3 +++ sx-question-list.el | 2 ++ sx-question-mode.el | 3 +++ sx-question.el | 3 +++ sx-site.el | 3 +++ sx-tab.el | 7 ++++++- sx-time.el | 3 ++- 13 files changed, 55 insertions(+), 6 deletions(-) (limited to 'sx-auth.el') diff --git a/sx-auth.el b/sx-auth.el index bfa805a..427900d 100644 --- a/sx-auth.el +++ b/sx-auth.el @@ -19,6 +19,13 @@ ;;; Commentary: +;; This file handles logic related to authentication. This includes +;; determining if a certain filter requires authentication (via the +;; variable `sx-auth-filter-auth' and function `sx-auth--filter-p'), +;; determining if a method requires authentication (via the variable +;; `sx-auth-method-auth' and function `sx-auth--method-p'), and +;; actually authenticating the user (with `sx-auth-authenticate'). + ;;; Code: (require 'sx) diff --git a/sx-cache.el b/sx-cache.el index 51c2267..cf48ef5 100644 --- a/sx-cache.el +++ b/sx-cache.el @@ -19,12 +19,18 @@ ;;; Commentary: -;; All caches are retrieved and set using symbols. The symbol should -;; be the sub-subpackage that is using the cache. For example, -;; `sx-pkg' would use `(sx-cache-get 'pkg)'. +;; This file handles the cache system. All caches are retrieved and +;; set using symbols. The symbol should be the sub-package that is +;; using the cache. For example, `sx-pkg' would use +;; +;; `(sx-cache-get 'pkg)' ;; ;; This symbol is then converted into a filename within -;; `sx-cache-directory'. +;; `sx-cache-directory' using `sx-cache-get-file-name'. +;; +;; Currently, the cache is written at every `sx-cache-set', but this +;; write will eventually be done by some write-all function which will +;; be set on an idle timer. ;;; Code: diff --git a/sx-encoding.el b/sx-encoding.el index 0e66677..36cf03f 100644 --- a/sx-encoding.el +++ b/sx-encoding.el @@ -19,6 +19,11 @@ ;;; Commentary: +;; This file handles decoding the responses we get from the API. They +;; are received either as plain-text or as a `gzip' compressed archive. +;; For this, `sx-encoding-gzipped-p' is used to determine if content +;; has been compressed under `gzip'. + ;;; Code: (require 'cl-lib) diff --git a/sx-favorites.el b/sx-favorites.el index d5c5a4f..44ee19f 100644 --- a/sx-favorites.el +++ b/sx-favorites.el @@ -19,6 +19,9 @@ ;;; Commentary: +;; This file provides logic for retrieving and managing a user's +;; starred questions. + ;;; Code: (require 'sx-method) diff --git a/sx-filter.el b/sx-filter.el index d973f2a..327a8eb 100644 --- a/sx-filter.el +++ b/sx-filter.el @@ -19,6 +19,10 @@ ;;; Commentary: +;; This file manages filters and provides an API to compile filters +;; and retrieve them from the cache. See `sx-filter-compile' and +;; `sx-filter-get-var', respectively. + ;;; Code: diff --git a/sx-interaction.el b/sx-interaction.el index a50e718..0e4aae9 100644 --- a/sx-interaction.el +++ b/sx-interaction.el @@ -19,6 +19,10 @@ ;;; Commentary: +;; This file provides voting, commenting, and other interactive +;; facilities. Most functions are scoped relative to `sx--data-here' +;; when called interactively. + ;;; Code: diff --git a/sx-networks.el b/sx-networks.el index dda6dd5..5f5f1c3 100644 --- a/sx-networks.el +++ b/sx-networks.el @@ -19,6 +19,9 @@ ;;; Commentary: +;; This file provides logic for retrieving information about the user +;; across the entire network, e.g. their registered sites. + ;;; Code: (require 'sx-method) diff --git a/sx-question-list.el b/sx-question-list.el index 7caa03d..0967d6a 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -19,6 +19,8 @@ ;;; Commentary: +;; Provides question list logic (as used in e.g. `sx-tab-frontpage'). + ;;; Code: (require 'tabulated-list) (require 'cl-lib) diff --git a/sx-question-mode.el b/sx-question-mode.el index c3e7eac..ff13ede 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -19,6 +19,9 @@ ;;; Commentary: +;; This file provides a means to print questions with their answers +;; and all comments. See the customizable group `sx-question-mode'. + ;;; Code: (require 'markdown-mode) diff --git a/sx-question.el b/sx-question.el index 01ba030..680eaaf 100644 --- a/sx-question.el +++ b/sx-question.el @@ -19,6 +19,9 @@ ;;; Commentary: +;; Thie file provides an API for retrieving questions and defines +;; additional logic for marking questions as read or hidden. + ;;; Code: diff --git a/sx-site.el b/sx-site.el index df02f7e..1ed469a 100644 --- a/sx-site.el +++ b/sx-site.el @@ -19,6 +19,9 @@ ;;; Commentary: +;; This file provides various pieces of site logic, such as retrieving +;; the list of sites and the list of a user's favorited questions. + ;;; Code: (require 'sx-method) diff --git a/sx-tab.el b/sx-tab.el index bbbdb79..16b1737 100644 --- a/sx-tab.el +++ b/sx-tab.el @@ -19,7 +19,12 @@ ;;; Commentary: -;; +;; This file provides a single macro to define 'tabs' to view lists of +;; questions. + +;;; Tabs: + +;; - frontpage :: the frontpage of a single site ;;; Code: diff --git a/sx-time.el b/sx-time.el index e65bb50..8f90747 100644 --- a/sx-time.el +++ b/sx-time.el @@ -19,7 +19,8 @@ ;;; Commentary: -;; +;; This file provides functions for manipulating and displaying +;; timestamps. ;;; Code: -- cgit v1.2.3 From 209546f6af36e6c2bacb9cee92a51e1c782aff1f Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 28 Nov 2014 13:30:44 -0500 Subject: Correct documentation --- sx-auth.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sx-auth.el') diff --git a/sx-auth.el b/sx-auth.el index 427900d..cfbae0a 100644 --- a/sx-auth.el +++ b/sx-auth.el @@ -72,7 +72,7 @@ what you are doing!") upvote (unanswered my-tags))) "List of methods that require auth. -Methods are of form (METHOD SUBMETHODS) where SUBMETHODS +Methods are of form (METHOD . SUBMETHODS) where SUBMETHODS is (METHOD METHOD METHOD ...). If all SUBMETHODS require auth or there are no submethods, form -- cgit v1.2.3 From 4c8a4e83e09b2f9c0bbb5cc75896bcdd543c33cd Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 28 Nov 2014 13:31:08 -0500 Subject: Relate variable with setting function --- sx-auth.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sx-auth.el') diff --git a/sx-auth.el b/sx-auth.el index cfbae0a..8a52041 100644 --- a/sx-auth.el +++ b/sx-auth.el @@ -43,7 +43,9 @@ "Your access token. This is needed to use your account to write questions, make comments, and read your inbox. Do not alter this unless you know -what you are doing!") +what you are doing! + +This variable is set with `sx-auth-authenticate'.") (defvar sx-auth-method-auth '((me . t) (inbox . t) -- cgit v1.2.3 From 3a5afcc8225e52baaaba92c27d1d594eeb1cf729 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Mon, 1 Dec 2014 08:45:50 -0500 Subject: Standardize local variables - Move lexical-binding to top of file; fixes #123 - Use indent-tabs-mode: nil for all files --- sx-auth.el | 3 +-- sx-cache.el | 2 +- sx-encoding.el | 2 +- sx-favorites.el | 3 +-- sx-filter.el | 3 +-- sx-interaction.el | 4 ++-- sx-method.el | 6 +++++- sx-networks.el | 3 +-- sx-question-list.el | 4 ++-- sx-question-mode.el | 4 ++-- sx-question-print.el | 4 ++-- sx-question.el | 3 +-- sx-request.el | 4 ++-- sx-site.el | 3 +-- sx-tab.el | 4 ++-- sx-time.el | 6 +++++- sx.el | 3 +-- 17 files changed, 31 insertions(+), 30 deletions(-) (limited to 'sx-auth.el') diff --git a/sx-auth.el b/sx-auth.el index 8a52041..bbd84e2 100644 --- a/sx-auth.el +++ b/sx-auth.el @@ -1,4 +1,4 @@ -;;; sx-auth.el --- user authentication +;;; sx-auth.el --- user authentication -*- lexical-binding: t -*- ;; Copyright (C) 2014 Sean Allred @@ -192,5 +192,4 @@ removed those properties." ;; Local Variables: ;; indent-tabs-mode: nil -;; lexical-binding: t ;; End: diff --git a/sx-cache.el b/sx-cache.el index cf48ef5..598a5df 100644 --- a/sx-cache.el +++ b/sx-cache.el @@ -1,4 +1,4 @@ -;;; sx-cache.el --- caching +;;; sx-cache.el --- caching -*- lexical-binding: t -*- ;; Copyright (C) 2014 Sean Allred diff --git a/sx-encoding.el b/sx-encoding.el index ee099bc..c8a7862 100644 --- a/sx-encoding.el +++ b/sx-encoding.el @@ -1,4 +1,4 @@ -;;; sx-encoding.el --- encoding +;;; sx-encoding.el --- encoding -*- lexical-binding: t -*- ;; Copyright (C) 2014 Sean Allred diff --git a/sx-favorites.el b/sx-favorites.el index 44ee19f..9408dd5 100644 --- a/sx-favorites.el +++ b/sx-favorites.el @@ -1,4 +1,4 @@ -;;; sx-favorites.el --- starred questions +;;; sx-favorites.el --- starred questions -*- lexical-binding: t -*- ;; Copyright (C) 2014 Sean Allred @@ -82,5 +82,4 @@ Writes list to cache QUESTION-FAVORITES." ;; Local Variables: ;; indent-tabs-mode: nil -;; lexical-binding: t ;; End: diff --git a/sx-filter.el b/sx-filter.el index 327a8eb..cd919f7 100644 --- a/sx-filter.el +++ b/sx-filter.el @@ -1,4 +1,4 @@ -;;; sx-filter.el --- filters +;;; sx-filter.el --- filters -*- lexical-binding: t -*- ;; Copyright (C) 2014 Sean Allred @@ -90,5 +90,4 @@ return the compiled filter." ;; Local Variables: ;; indent-tabs-mode: nil -;; lexical-binding: t ;; End: diff --git a/sx-interaction.el b/sx-interaction.el index 0e4aae9..aeb6781 100644 --- a/sx-interaction.el +++ b/sx-interaction.el @@ -1,4 +1,4 @@ -;;; sx-interaction.el --- voting, commenting, and other interaction +;;; sx-interaction.el --- voting, commenting, and other interaction -*- lexical-binding: t -*- ;; Copyright (C) 2014 Artur Malabarba @@ -202,5 +202,5 @@ OBJECT can be a question or an answer." ;;; sx-interaction.el ends here ;; Local Variables: -;; lexical-binding: t +;; indent-tabs-mode: nil ;; End: diff --git a/sx-method.el b/sx-method.el index 83455b8..88525a3 100644 --- a/sx-method.el +++ b/sx-method.el @@ -1,4 +1,4 @@ -;;; sx-method.el --- method calls +;;; sx-method.el --- method calls -*- lexical-binding: t -*- ;; Copyright (C) 2014 Sean Allred @@ -114,3 +114,7 @@ Return the entire response as a complex alist." (provide 'sx-method) ;;; sx-method.el ends here + +;; Local Variables: +;; indent-tabs-mode: nil +;; End: diff --git a/sx-networks.el b/sx-networks.el index 5f5f1c3..e9bc1c7 100644 --- a/sx-networks.el +++ b/sx-networks.el @@ -1,4 +1,4 @@ -;;; sx-networks.el --- user network information +;;; sx-networks.el --- user network information -*- lexical-binding: t -*- ;; Copyright (C) 2014 Sean Allred @@ -107,5 +107,4 @@ list of sites the user is active on." ;; Local Variables: ;; indent-tabs-mode: nil -;; lexical-binding: t ;; End: diff --git a/sx-question-list.el b/sx-question-list.el index 0967d6a..58c233b 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -1,4 +1,4 @@ -;;; sx-question-list.el --- major-mode for navigating questions list +;;; sx-question-list.el --- major-mode for navigating questions list -*- lexical-binding: t -*- ;; Copyright (C) 2014 Artur Malabarba @@ -544,5 +544,5 @@ Sets `sx-question-list--site' and then call ;;; sx-question-list.el ends here ;; Local Variables: -;; lexical-binding: t +;; indent-tabs-mode: nil ;; End: diff --git a/sx-question-mode.el b/sx-question-mode.el index 6efa10b..6293ad2 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -1,4 +1,4 @@ -;;; sx-question-mode.el --- major-mode for displaying questions +;;; sx-question-mode.el --- major-mode for displaying questions -*- lexical-binding: t -*- ;; Copyright (C) 2014 Artur Malabarba @@ -228,5 +228,5 @@ query the api." ;;; sx-question-mode.el ends here ;; Local Variables: -;; lexical-binding: t +;; indent-tabs-mode: nil ;; End: diff --git a/sx-question-print.el b/sx-question-print.el index 0959f36..6b1c96e 100644 --- a/sx-question-print.el +++ b/sx-question-print.el @@ -1,4 +1,4 @@ -;;; sx-question-print.el --- Populating the question-mode buffer with content. +;;; sx-question-print.el --- Populating the question-mode buffer with content. -*- lexical-binding: t -*- ;; Copyright (C) 2014 Artur Malabarba @@ -436,5 +436,5 @@ If ID is nil, use FALLBACK-ID instead." ;;; sx-question-print.el ends here ;; Local Variables: -;; lexical-binding: t +;; indent-tabs-mode: nil ;; End: diff --git a/sx-question.el b/sx-question.el index 7b53e2e..a9ff2b1 100644 --- a/sx-question.el +++ b/sx-question.el @@ -1,4 +1,4 @@ -;;; sx-question.el --- question logic +;;; sx-question.el --- question logic -*- lexical-binding: t -*- ;; Copyright (C) 2014 Sean Allred @@ -171,5 +171,4 @@ If no cache exists for it, initialize one with SITE." ;; Local Variables: ;; indent-tabs-mode: nil -;; lexical-binding: t ;; End: diff --git a/sx-request.el b/sx-request.el index 3a8b7a8..653e17c 100644 --- a/sx-request.el +++ b/sx-request.el @@ -1,4 +1,4 @@ -;;; sx-request.el --- requests and url manipulation +;;; sx-request.el --- requests and url manipulation -*- lexical-binding: t -*- ;; Copyright (C) 2014 Sean Allred @@ -200,5 +200,5 @@ false, use the symbol `false'. Each element is processed with ;;; sx-request.el ends here ;; Local Variables: -;; lexical-binding: t +;; indent-tabs-mode: nil ;; End: diff --git a/sx-site.el b/sx-site.el index 1ed469a..250df35 100644 --- a/sx-site.el +++ b/sx-site.el @@ -1,4 +1,4 @@ -;;; sx-site.el --- browsing sites +;;; sx-site.el --- browsing sites -*- lexical-binding: t -*- ;; Copyright (C) 2014 Sean Allred @@ -73,5 +73,4 @@ api_site_parameter." ;; Local Variables: ;; indent-tabs-mode: nil -;; lexical-binding: t ;; End: diff --git a/sx-tab.el b/sx-tab.el index 7394da6..3706780 100644 --- a/sx-tab.el +++ b/sx-tab.el @@ -1,4 +1,4 @@ -;;; sx-tab.el --- functions for viewing different tabs +;;; sx-tab.el --- functions for viewing different tabs -*- lexical-binding: t -*- ;; Copyright (C) 2014 Artur Malabarba @@ -114,5 +114,5 @@ If SITE is nil, use `sx-tab-default-site'." ;;; sx-tab.el ends here ;; Local Variables: -;; lexical-binding: t +;; indent-tabs-mode: nil ;; End: diff --git a/sx-time.el b/sx-time.el index 8f90747..3cf26b9 100644 --- a/sx-time.el +++ b/sx-time.el @@ -1,4 +1,4 @@ -;;; sx-time.el --- time +;;; sx-time.el --- time -*- lexical-binding: t -*- ;; Copyright (C) 2014 Sean Allred @@ -78,3 +78,7 @@ See also `sx-time-date-format-year'." (provide 'sx-time) ;;; sx-time.el ends here + +;; Local Variables: +;; indent-tabs-mode: nil +;; End: diff --git a/sx.el b/sx.el index b468762..899e9ff 100644 --- a/sx.el +++ b/sx.el @@ -1,4 +1,4 @@ -;;; sx.el --- core functions +;;; sx.el --- core functions -*- lexical-binding: t -*- ;; Copyright (C) 2014 Sean Allred @@ -319,5 +319,4 @@ If FORCE is non-nil, run them even if they've already been run." ;; Local Variables: ;; indent-tabs-mode: nil -;; lexical-binding: t ;; End: -- cgit v1.2.3 From 14eadafd6388281085eb3330b9d7ee29a85ab8b2 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 28 Nov 2014 13:30:11 -0500 Subject: Provide commentaries for each file --- sx-auth.el | 7 +++++++ sx-cache.el | 14 ++++++++++---- sx-encoding.el | 5 +++++ sx-favorites.el | 3 +++ sx-filter.el | 4 ++++ sx-networks.el | 3 +++ sx-question-list.el | 2 ++ sx-question-mode.el | 3 +++ sx-question.el | 3 +++ sx-site.el | 3 +++ sx-tab.el | 7 ++++++- sx-time.el | 3 ++- 12 files changed, 51 insertions(+), 6 deletions(-) (limited to 'sx-auth.el') diff --git a/sx-auth.el b/sx-auth.el index fca5392..8c317fb 100644 --- a/sx-auth.el +++ b/sx-auth.el @@ -19,6 +19,13 @@ ;;; Commentary: +;; This file handles logic related to authentication. This includes +;; determining if a certain filter requires authentication (via the +;; variable `sx-auth-filter-auth' and function `sx-auth--filter-p'), +;; determining if a method requires authentication (via the variable +;; `sx-auth-method-auth' and function `sx-auth--method-p'), and +;; actually authenticating the user (with `sx-auth-authenticate'). + ;;; Code: (require 'sx) diff --git a/sx-cache.el b/sx-cache.el index e68397d..5f37d84 100644 --- a/sx-cache.el +++ b/sx-cache.el @@ -19,12 +19,18 @@ ;;; Commentary: -;; All caches are retrieved and set using symbols. The symbol should -;; be the sub-subpackage that is using the cache. For example, -;; `sx-pkg' would use `(sx-cache-get 'pkg)'. +;; This file handles the cache system. All caches are retrieved and +;; set using symbols. The symbol should be the sub-package that is +;; using the cache. For example, `sx-pkg' would use +;; +;; `(sx-cache-get 'pkg)' ;; ;; This symbol is then converted into a filename within -;; `sx-cache-directory'. +;; `sx-cache-directory' using `sx-cache-get-file-name'. +;; +;; Currently, the cache is written at every `sx-cache-set', but this +;; write will eventually be done by some write-all function which will +;; be set on an idle timer. ;;; Code: diff --git a/sx-encoding.el b/sx-encoding.el index 795f175..cf7d0f8 100644 --- a/sx-encoding.el +++ b/sx-encoding.el @@ -19,6 +19,11 @@ ;;; Commentary: +;; This file handles decoding the responses we get from the API. They +;; are received either as plain-text or as a `gzip' compressed archive. +;; For this, `sx-encoding-gzipped-p' is used to determine if content +;; has been compressed under `gzip'. + ;;; Code: (require 'cl-lib) diff --git a/sx-favorites.el b/sx-favorites.el index e86e521..17021fc 100644 --- a/sx-favorites.el +++ b/sx-favorites.el @@ -19,6 +19,9 @@ ;;; Commentary: +;; This file provides logic for retrieving and managing a user's +;; starred questions. + ;;; Code: (require 'sx-method) diff --git a/sx-filter.el b/sx-filter.el index 15bd8a1..f64d34b 100644 --- a/sx-filter.el +++ b/sx-filter.el @@ -19,6 +19,10 @@ ;;; Commentary: +;; This file manages filters and provides an API to compile filters +;; and retrieve them from the cache. See `sx-filter-compile' and +;; `sx-filter-get-var', respectively. + ;;; Code: diff --git a/sx-networks.el b/sx-networks.el index 58ebff5..f2b0a22 100644 --- a/sx-networks.el +++ b/sx-networks.el @@ -19,6 +19,9 @@ ;;; Commentary: +;; This file provides logic for retrieving information about the user +;; across the entire network, e.g. their registered sites. + ;;; Code: (require 'sx-method) diff --git a/sx-question-list.el b/sx-question-list.el index 3354052..0cb1167 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -19,6 +19,8 @@ ;;; Commentary: +;; Provides question list logic (as used in e.g. `sx-tab-frontpage'). + ;;; Code: (require 'tabulated-list) (require 'cl-lib) diff --git a/sx-question-mode.el b/sx-question-mode.el index b13caf3..b3f9eb7 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -19,6 +19,9 @@ ;;; Commentary: +;; This file provides a means to print questions with their answers +;; and all comments. See the customizable group `sx-question-mode'. + ;;; Code: (eval-when-compile diff --git a/sx-question.el b/sx-question.el index 0e830a6..f3f99bb 100644 --- a/sx-question.el +++ b/sx-question.el @@ -19,6 +19,9 @@ ;;; Commentary: +;; Thie file provides an API for retrieving questions and defines +;; additional logic for marking questions as read or hidden. + ;;; Code: diff --git a/sx-site.el b/sx-site.el index 2f0a31d..02f618e 100644 --- a/sx-site.el +++ b/sx-site.el @@ -19,6 +19,9 @@ ;;; Commentary: +;; This file provides various pieces of site logic, such as retrieving +;; the list of sites and the list of a user's favorited questions. + ;;; Code: (require 'sx-method) diff --git a/sx-tab.el b/sx-tab.el index f97119a..eb2e2de 100644 --- a/sx-tab.el +++ b/sx-tab.el @@ -19,7 +19,12 @@ ;;; Commentary: -;; +;; This file provides a single macro to define 'tabs' to view lists of +;; questions. + +;;; Tabs: + +;; - frontpage :: the frontpage of a single site ;;; Code: diff --git a/sx-time.el b/sx-time.el index e05d95a..c1be881 100644 --- a/sx-time.el +++ b/sx-time.el @@ -19,7 +19,8 @@ ;;; Commentary: -;; +;; This file provides functions for manipulating and displaying +;; timestamps. ;;; Code: -- cgit v1.2.3 From 45376bd7cad5175aa77e2343137856c9ee041e26 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 28 Nov 2014 13:30:44 -0500 Subject: Correct documentation --- sx-auth.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sx-auth.el') diff --git a/sx-auth.el b/sx-auth.el index 8c317fb..c142e3d 100644 --- a/sx-auth.el +++ b/sx-auth.el @@ -72,7 +72,7 @@ what you are doing!") upvote (unanswered my-tags))) "List of methods that require auth. -Methods are of form (METHOD SUBMETHODS) where SUBMETHODS +Methods are of form (METHOD . SUBMETHODS) where SUBMETHODS is (METHOD METHOD METHOD ...). If all SUBMETHODS require auth or there are no submethods, form -- cgit v1.2.3 From d94292227beddbceee8b0bb0c8f6a761764487fe Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 28 Nov 2014 13:31:08 -0500 Subject: Relate variable with setting function --- sx-auth.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sx-auth.el') diff --git a/sx-auth.el b/sx-auth.el index c142e3d..f35cca1 100644 --- a/sx-auth.el +++ b/sx-auth.el @@ -43,7 +43,9 @@ "Your access token. This is needed to use your account to write questions, make comments, and read your inbox. Do not alter this unless you know -what you are doing!") +what you are doing! + +This variable is set with `sx-auth-authenticate'.") (defvar sx-auth-method-auth '((me . t) (inbox . t) -- cgit v1.2.3 From 97130cb7154fc494745d6b2a2a347c765403c5f3 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Sun, 4 Jan 2015 18:06:16 -0500 Subject: Fix docstrings --- sx-auth.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sx-auth.el') diff --git a/sx-auth.el b/sx-auth.el index 3cb7217..686aa0c 100644 --- a/sx-auth.el +++ b/sx-auth.el @@ -74,11 +74,11 @@ This variable is set with `sx-auth-authenticate'.") upvote (unanswered my-tags))) "List of methods that require auth. -Methods are of form (METHOD . SUBMETHODS) where SUBMETHODS - is (METHOD METHOD METHOD ...). +Methods are of the form \(METHOD . SUBMETHODS) where SUBMETHODS + is \(METHOD METHOD METHOD ...). If all SUBMETHODS require auth or there are no submethods, form -will be (METHOD . t)") +will be \(METHOD . t)") (defvar sx-auth-filter-auth '(question.upvoted question.downvoted @@ -86,8 +86,8 @@ will be (METHOD . t)") answer.downvoted comment.upvoted) "List of filter types that require auth. -Keywords are of form (OBJECT TYPES) where TYPES is (FILTER FILTER -FILTER).") +Keywords are of the form \(OBJECT TYPES) where TYPES is \(FILTER +FILTER FILTER).") ;;;###autoload (defun sx-authenticate () -- cgit v1.2.3 From a812b209b24401827a7020051ac3726358795231 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sun, 4 Jan 2015 21:22:42 -0200 Subject: Use defconst instead of defvar where appropriate. Fix #200 --- sx-auth.el | 64 +++++++++++++++++++++++++++-------------------------- sx-favorites.el | 2 +- sx-filter.el | 2 +- sx-inbox.el | 6 ++--- sx-networks.el | 2 +- sx-notify.el | 2 +- sx-question-list.el | 2 +- sx-question-mode.el | 2 +- sx-site.el | 2 +- sx-tag.el | 2 +- sx-time.el | 2 +- sx.el | 2 +- 12 files changed, 46 insertions(+), 44 deletions(-) (limited to 'sx-auth.el') diff --git a/sx-auth.el b/sx-auth.el index 686aa0c..cba310d 100644 --- a/sx-auth.el +++ b/sx-auth.el @@ -47,32 +47,33 @@ what you are doing! This variable is set with `sx-auth-authenticate'.") -(defvar sx-auth-method-auth '((me . t) - (inbox . t) - (notifications . t) - (events . t) - (posts (comments add)) - (comments delete - edit - flags - upvote) - (answers accept - delete - downvote - edit - flags - upvote) - (questions answers - add - close - delete - downvote - edit - favorite - flags - render - upvote - (unanswered my-tags))) +(defconst sx-auth-method-auth + '((me . t) + (inbox . t) + (notifications . t) + (events . t) + (posts (comments add)) + (comments delete + edit + flags + upvote) + (answers accept + delete + downvote + edit + flags + upvote) + (questions answers + add + close + delete + downvote + edit + favorite + flags + render + upvote + (unanswered my-tags))) "List of methods that require auth. Methods are of the form \(METHOD . SUBMETHODS) where SUBMETHODS is \(METHOD METHOD METHOD ...). @@ -80,11 +81,12 @@ Methods are of the form \(METHOD . SUBMETHODS) where SUBMETHODS If all SUBMETHODS require auth or there are no submethods, form will be \(METHOD . t)") -(defvar sx-auth-filter-auth '(question.upvoted - question.downvoted - answer.upvoted - answer.downvoted - comment.upvoted) +(defconst sx-auth-filter-auth + '(question.upvoted + question.downvoted + answer.upvoted + answer.downvoted + comment.upvoted) "List of filter types that require auth. Keywords are of the form \(OBJECT TYPES) where TYPES is \(FILTER FILTER FILTER).") diff --git a/sx-favorites.el b/sx-favorites.el index 7fdc772..d98b4c2 100644 --- a/sx-favorites.el +++ b/sx-favorites.el @@ -30,7 +30,7 @@ (require 'sx-networks) (require 'sx-filter) -(defvar sx-favorite-list-filter +(defconst sx-favorite-list-filter (sx-filter-from-nil (question.question_id))) diff --git a/sx-filter.el b/sx-filter.el index 4695446..57c491d 100644 --- a/sx-filter.el +++ b/sx-filter.el @@ -107,7 +107,7 @@ return the compiled filter." ;;; Browsing filter -(defvar sx-browse-filter +(defconst sx-browse-filter (sx-filter-from-nil ((question body_markdown bounty_amount diff --git a/sx-inbox.el b/sx-inbox.el index 01000a6..1efceb1 100644 --- a/sx-inbox.el +++ b/sx-inbox.el @@ -28,7 +28,7 @@ ;;; API -(defvar sx-inbox-filter +(defconst sx-inbox-filter '((inbox_item.answer_id inbox_item.body inbox_item.comment_id @@ -91,7 +91,7 @@ These are identified by their links.") "List of notification items which are read. These are identified by their links.") -(defvar sx-inbox--header-line +(defconst sx-inbox--header-line '(" " (:propertize "n p j k" face mode-line-buffer-id) ": Navigate" @@ -106,7 +106,7 @@ These are identified by their links.") ": Quit") "Header-line used on the inbox list.") -(defvar sx-inbox--mode-line +(defconst sx-inbox--mode-line '(" " (:propertize (sx-inbox--notification-p diff --git a/sx-networks.el b/sx-networks.el index 2695689..45eaf05 100644 --- a/sx-networks.el +++ b/sx-networks.el @@ -29,7 +29,7 @@ (require 'sx-site) (require 'sx-filter) -(defvar sx-network--user-filter +(defconst sx-network--user-filter (sx-filter-from-nil ((badge_count bronze silver diff --git a/sx-notify.el b/sx-notify.el index 6dc90b9..0c9a5b8 100644 --- a/sx-notify.el +++ b/sx-notify.el @@ -27,7 +27,7 @@ ;;; mode-line notification -(defvar sx-notify--mode-line +(defconst sx-notify--mode-line '((sx-inbox--unread-inbox (sx-inbox--unread-notifications " [")) (sx-inbox--unread-inbox (:propertize diff --git a/sx-question-list.el b/sx-question-list.el index b9f34a0..c72dc0d 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -228,7 +228,7 @@ and thus not displayed in the list of questions. This is ignored if `sx-question-list--refresh-function' is set.") (make-variable-buffer-local 'sx-question-list--dataset) -(defvar sx-question-list--header-line +(defconst sx-question-list--header-line '(" " (:propertize "n p j k" face mode-line-buffer-id) ": Navigate" diff --git a/sx-question-mode.el b/sx-question-mode.el index f702822..5303ebb 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -178,7 +178,7 @@ property." ;;; Major-mode -(defvar sx-question-mode--header-line +(defconst sx-question-mode--header-line '(" " (:propertize "n p TAB" face mode-line-buffer-id) ": Navigate" diff --git a/sx-site.el b/sx-site.el index 02f618e..9b2ea34 100644 --- a/sx-site.el +++ b/sx-site.el @@ -28,7 +28,7 @@ (require 'sx-cache) (require 'sx-filter) -(defvar sx-site-browse-filter +(defconst sx-site-browse-filter (sx-filter-from-nil ((site site_type name diff --git a/sx-tag.el b/sx-tag.el index 7ac80c6..5e75890 100644 --- a/sx-tag.el +++ b/sx-tag.el @@ -26,7 +26,7 @@ ;;; Getting the list from a site -(defvar sx-tag-filter +(defconst sx-tag-filter (sx-filter-from-nil (tag.name tag.synonyms)) diff --git a/sx-time.el b/sx-time.el index 1d1267b..9fa0037 100644 --- a/sx-time.el +++ b/sx-time.el @@ -26,7 +26,7 @@ (require 'time-date) -(defvar sx-time-seconds-to-string +(defconst sx-time-seconds-to-string ;; (LIMIT NAME VALUE) ;; We use an entry if the number of seconds in question is less than ;; LIMIT, but more than the previous entry's LIMIT. diff --git a/sx.el b/sx.el index 8cfb5dc..3271755 100644 --- a/sx.el +++ b/sx.el @@ -300,7 +300,7 @@ Return the result of BODY." (push ov sx--overlays)) result)) -(defvar sx--ascii-replacement-list +(defconst sx--ascii-replacement-list '(("[:space:]" . "") ("àåáâäãåą" . "a") ("èéêëę" . "e") -- cgit v1.2.3