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-encoding.el | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sx-encoding.el') 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) -- cgit v1.2.3 From 891c7eeb070ccde615cd3371bf9136a3b2287b4f Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 28 Nov 2014 13:42:31 -0500 Subject: Add sections to `sx-encoding.el' --- sx-encoding.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sx-encoding.el') diff --git a/sx-encoding.el b/sx-encoding.el index 36cf03f..ee099bc 100644 --- a/sx-encoding.el +++ b/sx-encoding.el @@ -28,6 +28,9 @@ (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 "∧" @@ -91,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. @@ -136,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 -- 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-encoding.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