aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore12
-rw-r--r--Makefile4
-rw-r--r--sx-auth.el23
-rw-r--r--sx-babel.el5
-rw-r--r--sx-button.el6
-rw-r--r--sx-cache.el16
-rw-r--r--sx-compose.el6
-rw-r--r--sx-encoding.el16
-rw-r--r--sx-favorites.el5
-rw-r--r--sx-filter.el6
-rw-r--r--sx-inbox.el2
-rw-r--r--sx-interaction.el6
-rw-r--r--sx-load.el2
-rw-r--r--sx-method.el6
-rw-r--r--sx-networks.el5
-rw-r--r--sx-notify.el2
-rw-r--r--sx-question-list.el8
-rw-r--r--sx-question-mode.el9
-rw-r--r--sx-question-print.el6
-rw-r--r--sx-question.el5
-rw-r--r--sx-request.el6
-rw-r--r--sx-search.el6
-rw-r--r--sx-site.el3
-rw-r--r--sx-switchto.el2
-rw-r--r--sx-tab.el23
-rw-r--r--sx-tag.el6
-rw-r--r--sx-time.el9
-rw-r--r--sx.el2
28 files changed, 162 insertions, 45 deletions
diff --git a/.gitignore b/.gitignore
index cfaa152..59d35bb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,12 +1,18 @@
-# Emacs backup files
+# Personal Development
+.dir-locals.el
+
+# Backup Files
*~
\#*\#
# Compiled Elisp
*.elc
+
+# Package Artifacts
/.cask/
-.dir-locals.el
-/.stackmode/
/url/
+/.sx/
+
+# Generated Files
/sx.info
/sx.texi
diff --git a/Makefile b/Makefile
index 53451ad..e04c1b0 100644
--- a/Makefile
+++ b/Makefile
@@ -36,7 +36,3 @@ install_cask:
install_evm:
curl -fsSkL https://raw.github.com/rejeep/evm/master/go | bash
-
-# Local Variables:
-# indent-tabs-mode: t
-# End:
diff --git a/sx-auth.el b/sx-auth.el
index fca5392..686aa0c 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 -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Sean Allred
@@ -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)
@@ -36,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)
@@ -65,11 +74,11 @@ what you are doing!")
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
@@ -77,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 ()
diff --git a/sx-babel.el b/sx-babel.el
index b30a044..4386172 100644
--- a/sx-babel.el
+++ b/sx-babel.el
@@ -1,4 +1,4 @@
-;;; sx-babel.el --- Font-locking pre blocks according to language. -*- lexical-binding: t; -*-
+;;; sx-babel.el --- font-locking pre blocks according to language -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Artur Malabarba
@@ -122,3 +122,6 @@ Returns the amount of indentation removed."
(provide 'sx-babel)
;;; sx-babel.el ends here
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
diff --git a/sx-button.el b/sx-button.el
index f166164..4c0666b 100644
--- a/sx-button.el
+++ b/sx-button.el
@@ -1,4 +1,4 @@
-;;; sx-button.el --- Defining buttons used throughout SX. -*- lexical-binding: t; -*-
+;;; sx-button.el --- defining buttons -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Artur Malabarba
@@ -163,3 +163,7 @@ usually part of a code-block."
(provide 'sx-button)
;;; sx-button.el ends here
+
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
diff --git a/sx-cache.el b/sx-cache.el
index e68397d..3a5bd3b 100644
--- a/sx-cache.el
+++ b/sx-cache.el
@@ -1,4 +1,4 @@
-;;; sx-cache.el --- caching -*- lexical-binding: t; -*-
+;;; sx-cache.el --- caching -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Sean Allred
@@ -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-compose.el b/sx-compose.el
index 8a8637b..f4fcd0a 100644
--- a/sx-compose.el
+++ b/sx-compose.el
@@ -1,4 +1,4 @@
-;;; sx-compose.el --- Major-mode for coposing questions and answers. -*- lexical-binding: t; -*-
+;;; sx-compose.el --- major-mode for composing questions and answers -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Artur Malabarba
@@ -302,3 +302,7 @@ the id property."
(provide 'sx-compose)
;;; sx-compose.el ends here
+
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
diff --git a/sx-encoding.el b/sx-encoding.el
index 795f175..d8ad2ba 100644
--- a/sx-encoding.el
+++ b/sx-encoding.el
@@ -1,4 +1,4 @@
-;;; sx-encoding.el --- encoding -*- lexical-binding: t; -*-
+;;; sx-encoding.el --- encoding -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Sean Allred
@@ -19,10 +19,18 @@
;;; 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)
+
+;;;; HTML Encoding
+
(defcustom sx-encoding-html-entities-plist
'(Aacute "Á" aacute "á" Acirc "Â" acirc "â" acute "´" AElig "Æ" aelig "æ"
Agrave "À" agrave "à" alefsym "ℵ" Alpha "Α" alpha "α" amp "&" and "∧"
@@ -86,6 +94,9 @@ Return the decoded string."
(substring ss 1))))))))
(replace-regexp-in-string "&[^; ]*;" get-function string)))
+
+;;;; Convenience Functions
+
(defun sx-encoding-normalize-line-endings (string)
"Normalize the line endings for STRING.
The API returns strings that use Windows-style line endings.
@@ -131,6 +142,9 @@ some cases."
(cl-map #'vector #'sx-encoding-clean-content-deep data))
(t data))))
+
+;;;; GZIP
+
(defun sx-encoding-gzipped-p (data)
"Check for magic bytes in DATA.
Check if the first two bytes of a string in DATA match the magic
diff --git a/sx-favorites.el b/sx-favorites.el
index e86e521..7fdc772 100644
--- a/sx-favorites.el
+++ b/sx-favorites.el
@@ -1,4 +1,4 @@
-;;; sx-favorites.el --- Starred questions -*- lexical-binding: t; -*-
+;;; sx-favorites.el --- starred questions -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Sean Allred
@@ -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..4695446 100644
--- a/sx-filter.el
+++ b/sx-filter.el
@@ -1,4 +1,4 @@
-;;; sx-filter.el --- Handles retrieval of filters. -*- lexical-binding: t; -*-
+;;; sx-filter.el --- handles retrieval of filters -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Sean Allred
@@ -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-inbox.el b/sx-inbox.el
index d0be379..01000a6 100644
--- a/sx-inbox.el
+++ b/sx-inbox.el
@@ -1,4 +1,4 @@
-;;; sx-inbox.el --- Base inbox logic. -*- lexical-binding: t; -*-
+;;; sx-inbox.el --- base inbox logic -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Artur Malabarba
diff --git a/sx-interaction.el b/sx-interaction.el
index dc4398e..4d71c17 100644
--- a/sx-interaction.el
+++ b/sx-interaction.el
@@ -1,4 +1,4 @@
-;;; sx-interaction.el --- Voting, commenting, and otherwise interacting with questions. -*- lexical-binding: t; -*-
+;;; sx-interaction.el --- voting, commenting, and other interaction -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Artur Malabarba
@@ -443,3 +443,7 @@ context at point. "
(provide 'sx-interaction)
;;; sx-interaction.el ends here
+
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
diff --git a/sx-load.el b/sx-load.el
index f1ec7c3..003f965 100644
--- a/sx-load.el
+++ b/sx-load.el
@@ -1,4 +1,4 @@
-;;; sx-load.el --- Load all files of the sx package. -*- lexical-binding: t; -*-
+;;; sx-load.el --- load all files of the SX package -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Artur Malabarba
diff --git a/sx-method.el b/sx-method.el
index bff6d30..9d61e60 100644
--- a/sx-method.el
+++ b/sx-method.el
@@ -1,4 +1,4 @@
-;;; sx-method.el --- Main interface for API method calls. -*- lexical-binding: t; -*-
+;;; sx-method.el --- method calls -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Sean Allred
@@ -144,3 +144,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 58ebff5..2695689 100644
--- a/sx-networks.el
+++ b/sx-networks.el
@@ -1,4 +1,4 @@
-;;; sx-networks.el --- user network information -*- lexical-binding: t; -*-
+;;; sx-networks.el --- user network information -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Sean Allred
@@ -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-notify.el b/sx-notify.el
index c335427..6dc90b9 100644
--- a/sx-notify.el
+++ b/sx-notify.el
@@ -1,4 +1,4 @@
-;;; sx-notify.el --- Mode-line notifications. -*- lexical-binding: t; -*-
+;;; sx-notify.el --- mode-line notifications -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Artur Malabarba
diff --git a/sx-question-list.el b/sx-question-list.el
index 3354052..b9f34a0 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. -*- lexical-binding: t; -*-
+;;; sx-question-list.el --- major-mode for navigating questions list -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Artur Malabarba
@@ -19,6 +19,8 @@
;;; Commentary:
+;; Provides question list logic (as used in e.g. `sx-tab-frontpage').
+
;;; Code:
(require 'tabulated-list)
(require 'cl-lib)
@@ -606,3 +608,7 @@ Sets `sx-question-list--site' and then call
(provide 'sx-question-list)
;;; sx-question-list.el ends here
+
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
diff --git a/sx-question-mode.el b/sx-question-mode.el
index b13caf3..f702822 100644
--- a/sx-question-mode.el
+++ b/sx-question-mode.el
@@ -1,4 +1,4 @@
-;;; sx-question-mode.el --- Major-mode for displaying a question. -*- lexical-binding: t; -*-
+;;; sx-question-mode.el --- major-mode for displaying questions -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Artur Malabarba
@@ -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
@@ -271,3 +274,7 @@ query the api."
(provide 'sx-question-mode)
;;; sx-question-mode.el ends here
+
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
diff --git a/sx-question-print.el b/sx-question-print.el
index 07378e8..e148d5f 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. -*- lexical-binding: t; -*-
+;;; sx-question-print.el --- populating the question-mode buffer with content -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Artur Malabarba
@@ -468,3 +468,7 @@ font-locking."
(provide 'sx-question-print)
;;; sx-question-print.el ends here
+
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
diff --git a/sx-question.el b/sx-question.el
index 0e830a6..b9fc78a 100644
--- a/sx-question.el
+++ b/sx-question.el
@@ -1,4 +1,4 @@
-;;; sx-question.el --- Base question logic. -*- lexical-binding: t; -*-
+;;; sx-question.el --- question logic -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Sean Allred
@@ -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-request.el b/sx-request.el
index bab53ec..ebc16d2 100644
--- a/sx-request.el
+++ b/sx-request.el
@@ -1,4 +1,4 @@
-;;; sx-request.el --- Requests and url manipulation. -*- lexical-binding: t; -*-
+;;; sx-request.el --- requests and url manipulation -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Sean Allred
@@ -256,3 +256,7 @@ false, use the symbol `false'. Each element is processed with
(provide 'sx-request)
;;; sx-request.el ends here
+
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
diff --git a/sx-search.el b/sx-search.el
index 2633da9..d47905e 100644
--- a/sx-search.el
+++ b/sx-search.el
@@ -1,4 +1,4 @@
-;;; sx-search.el --- Searching for questions. -*- lexical-binding: t; -*-
+;;; sx-search.el --- searching for questions -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Artur Malabarba
@@ -110,3 +110,7 @@ prefix argument, the user is asked for everything."
(provide 'sx-search)
;;; sx-search.el ends here
+
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
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-switchto.el b/sx-switchto.el
index 76804e4..458586a 100644
--- a/sx-switchto.el
+++ b/sx-switchto.el
@@ -1,4 +1,4 @@
-;;; sx-switchto.el --- Keymap for navigating between pages. -*- lexical-binding: t; -*-
+;;; sx-switchto.el --- keymap for navigating between pages -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Artur Malabarba
diff --git a/sx-tab.el b/sx-tab.el
index f97119a..f4e0c3d 100644
--- a/sx-tab.el
+++ b/sx-tab.el
@@ -1,4 +1,4 @@
-;;; sx-tab.el --- Functions for viewing different tabs. -*- lexical-binding: t; -*-
+;;; sx-tab.el --- functions for viewing different tabs -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Artur Malabarba
@@ -19,9 +19,22 @@
;;; Commentary:
-;;
+;; This file provides a single macro to define 'tabs' to view lists of
+;; questions.
+
+;;; Tabs:
+
+;; - FrontPage :: The standard front page
+;; - Newest :: Newest questions
+;; - TopVoted :: Top-voted questions
+;; - Hot :: Hot questions recently
+;; - Week :: Hot questions for the week
+;; - Month :: Hot questions for the month
+;; - Unanswered :: Unanswered questions
+;; - Unanswered My-tags :: Unanswered questions (subscribed tags)
+;; - Featured :: Featured questions
+;; - Starred :: Favorite questions
-
;;; Code:
(require 'sx)
@@ -266,3 +279,7 @@ belongs to."
(provide 'sx-tab)
;;; sx-tab.el ends here
+
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
diff --git a/sx-tag.el b/sx-tag.el
index 8c468a6..7ac80c6 100644
--- a/sx-tag.el
+++ b/sx-tag.el
@@ -1,4 +1,4 @@
-;;; sx-tag.el --- Retrieving list of tags and handling tags. -*- lexical-binding: t; -*-
+;;; sx-tag.el --- retrieving list of tags and handling tags -*- lexical-binding: t; -*-
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -84,3 +84,7 @@ Return the list of invalid tags in TAGS."
(provide 'sx-tag)
;;; sx-tag.el ends here
+
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
diff --git a/sx-time.el b/sx-time.el
index e05d95a..1d1267b 100644
--- a/sx-time.el
+++ b/sx-time.el
@@ -1,4 +1,4 @@
-;;; sx-time.el --- time -*- lexical-binding: t; -*-
+;;; sx-time.el --- time -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Sean Allred
@@ -19,7 +19,8 @@
;;; Commentary:
-;;
+;; This file provides functions for manipulating and displaying
+;; timestamps.
;;; Code:
@@ -77,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 f77b313..8cfb5dc 100644
--- a/sx.el
+++ b/sx.el
@@ -1,4 +1,4 @@
-;;; sx.el --- StackExchange client. Ask and answer questions on Stack Overflow, Super User, and the likes. -*- lexical-binding: t; -*-
+;;; sx.el --- StackExchange client. Ask and answer questions on Stack Overflow, Super User, and the likes -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Sean Allred