aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.org50
-rw-r--r--sx-auth.el18
-rw-r--r--sx-cache.el8
-rw-r--r--sx-encoding.el4
-rw-r--r--sx-interaction.el3
-rw-r--r--sx-question-list.el14
-rw-r--r--sx-question-mode.el10
-rw-r--r--sx-question.el3
-rw-r--r--sx-request.el4
-rw-r--r--sx-site.el2
-rw-r--r--sx-tab.el4
-rw-r--r--sx-time.el6
-rw-r--r--sx.el23
-rw-r--r--sx.org2
14 files changed, 90 insertions, 61 deletions
diff --git a/README.org b/README.org
index ea115dd..df8d907 100644
--- a/README.org
+++ b/README.org
@@ -1,21 +1,25 @@
-#+Title: Stack-Mode
+#+Title: SX -- Stack Exchange for Emacs
-[[https://travis-ci.org/vermiculus/stack-mode][https://travis-ci.org/vermiculus/stack-mode.svg?branch=master]]
-[[https://gitter.im/vermiculus/stack-mode?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge][https://badges.gitter.im/Join Chat.svg]]
-[[https://www.waffle.io/vermiculus/stack-mode][https://badge.waffle.io/vermiculus/stack-mode.svg]]
+[[https://travis-ci.org/vermiculus/sx.el][https://travis-ci.org/vermiculus/sx.el.svg?branch=master]]
+[[https://gitter.im/vermiculus/sx.el?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge][https://badges.gitter.im/Join Chat.svg]]
+[[https://www.waffle.io/vermiculus/sx.el][https://badge.waffle.io/vermiculus/sx.el.svg]]
-StackMode will be a full featured Stack Exchange mode for GNU Emacs 24
-and up. Using the official API, we aim to create a more versatile
-experience for the Stack Exchange network within Emacs itself.
+SX will be a full featured Stack Exchange mode for GNU Emacs 24+.
+Using the official API, we aim to create a more versatile experience
+for the Stack Exchange network within Emacs itself.
* Features
-- ~list-questions~ ::
+- ~sx-tab-frontpage~ ::
List questions on a StackExchange site.
- Viewing Posts ::
- Use =jknp= to open questions from within ~list-questions~; use
=RET= to move focus.
- - Use =v= to open the site in your browser.
+ - Use =v= to open the object at point in your browser.
- Use =TAB= to fold questions and answers.
+ - Use =RET= to open a link at point.
+ - Use =:= to switch sites.
+ - Vote up and down with =u= and =d=.
+
** Planned
- Archiving questions for offline access
- Browsing and favoriting networks
@@ -30,37 +34,37 @@ Have a feature in mind that isn't on the list? Submit a pull request
to add it to the list! If you want to discuss it first, pop in our
Gitter chatroom (badge above) -- someone will be around shortly to
talk about it.
+
* Installation
To install the development version, follow the usual steps:
- Clone this repository
- Add this directory to your ~load-path~
-- Issue ~(require 'sx-question-list)~
+- Issue ~(require 'sx)~
This should give you access to the only entry point function at the
-moment, ~list-questions~.
+moment, ~sx-tab-frontpage~.
+
+Eventually, this package will be available on MELPA.
-Eventually, this package will at least be available on MELPA.
-Depending on community involvement, it may even be submitted to the
-official GNU ELPA.
* Contributing
Please help contribute! Doing any of the following will help us immensely:
- - [[https://github.com/vermiculus/stack-mode/issues/new][Open an issue]]
- - [[https://github.com/vermiculus/stack-mode/pulls][Submit a pull request]]
- - [[https://gitter.im/vermiculus/stack-mode][Suggest a package or library in our Chat on Gitter]]
+ - [[https://github.com/vermiculus/sx.el/issues/new][Open an issue]]
+ - [[https://github.com/vermiculus/sx.el/pulls][Submit a pull request]]
+ - [[https://gitter.im/vermiculus/sx.el][Suggest a package or library in our Chat on Gitter]] (or just hang out =:)=)
- Spread the word!
For a better view of all of the open issues, take a look at our lovely
-[[http://www.waffle.io/vermiculus/stack-mode][Waffle board]]. Feel free to take the torch on anything in =backlog= or
+[[http://www.waffle.io/vermiculus/sx.el][Waffle board]]. Feel free to take the torch on anything in =backlog= or
=ready=. If you have thoughts on any other issues, don't hesitate to
chime in!
+
* Resources
- [[http://www.gnu.org/software/emacs/][GNU Emacs]]
- [[https://api.stackexchange.com/docs][Stack Exchange API v2.2]]
-- [[http://stackapps.com/apps/oauth/register][StackApps Registration Page]]
-- [[http://www.emacswiki.org/emacs/ModeTutorial][Creating Major Modes for Emacs]]
+
** Icons
-Stack Exchange Mode for Emacs has no explicit use for an icon,
-although standard SVG files have been gathered in =resources/= if
-anyone would fancy a crack at it.
+SX has no explicit /need/ for an icon, although standard SVG files
+have been gathered in =resources/= if anyone would fancy a crack at
+it.
- [[file:resources/emacs.svg][Emacs icon]]
- [[file:resources/stackexchange.svg][Stack Exchange icon]]
diff --git a/sx-auth.el b/sx-auth.el
index 2217b8b..b6c0411 100644
--- a/sx-auth.el
+++ b/sx-auth.el
@@ -28,7 +28,7 @@
(defconst sx-auth-root
"https://stackexchange.com/oauth/dialog")
(defconst sx-auth-redirect-uri
- "http://vermiculus.github.io/stack-mode/auth/auth.htm")
+ "http://vermiculus.github.io/sx.el/auth/auth.htm")
(defconst sx-auth-client-id
"3291")
(defvar sx-auth-access-token
@@ -154,14 +154,14 @@ If it has `auth-required' properties, return a filter that has
removed those properties."
(let* ((incl-filter (if (listp filter) (car filter)))
(rest-filter (if incl-filter (cdr filter)))
- (auth-filters (cl-remove-if #'nil
- ;; Only retrieve the elements that
- ;; are issues.
- (mapcar (lambda (prop)
- (car
- (member prop
- sx-auth-filter-auth)))
- (or incl-filter filter))))
+ (auth-filters (remove nil
+ ;; Only retrieve the elements that
+ ;; are issues.
+ (mapcar (lambda (prop)
+ (car
+ (member prop
+ sx-auth-filter-auth)))
+ (or incl-filter filter))))
clean-filter out-filter)
(lwarn "sx-auth filter" :debug "Filter: %S" filter)
;; Auth-filters is the filters that are issues
diff --git a/sx-cache.el b/sx-cache.el
index 07352d0..51c2267 100644
--- a/sx-cache.el
+++ b/sx-cache.el
@@ -1,4 +1,4 @@
-;;; sx-cache.el --- caching for stack-mode
+;;; sx-cache.el --- caching
;; Copyright (C) 2014 Sean Allred
@@ -29,10 +29,10 @@
;;; Code:
(defcustom sx-cache-directory
- (expand-file-name ".stackmode" user-emacs-directory)
+ (expand-file-name ".sx" user-emacs-directory)
"Directory containing cached data."
:type 'directory
- :group 'sx-cache)
+ :group 'sx)
(defun sx-cache--ensure-sx-cache-directory-exists ()
"Ensure `sx-cache-directory' exists."
@@ -99,7 +99,7 @@ as delete the list of hidden questions."
(when save-auth
(setq caches (cl-remove-if (lambda (x)
(string= x "auth.el")) caches)))
- (lwarn 'stack-mode :debug "Invalidating: %S" caches)
+ (lwarn 'sx :debug "Invalidating: %S" caches)
(mapc #'delete-file caches)
(sx-initialize 'force)))
diff --git a/sx-encoding.el b/sx-encoding.el
index f683615..0e66677 100644
--- a/sx-encoding.el
+++ b/sx-encoding.el
@@ -1,4 +1,4 @@
-;;; sx-encoding.el --- encoding for stack-mode
+;;; sx-encoding.el --- encoding
;; Copyright (C) 2014 Sean Allred
@@ -145,7 +145,7 @@ See URL `http://www.gzip.org/zlib/rfc-gzip.html'."
"Check if BUFFER is gzip-compressed.
See `sx-encoding-gzipped-p'."
(with-current-buffer buffer
- (sx-encoding-gzip-check-magic
+ (sx-encoding-gzipped-p
(buffer-string))))
(defun sx-encoding-gzipped-file-p (file)
diff --git a/sx-interaction.el b/sx-interaction.el
index e4234b0..5f3ece6 100644
--- a/sx-interaction.el
+++ b/sx-interaction.el
@@ -180,8 +180,7 @@ ID is an integer."
(defun sx--add-comment-to-object (comment object)
"Add COMMENT to OBJECT's `comments' property.
OBJECT can be a question or an answer."
- (let ((com-cell (assoc 'comments object))
- (count-cell (assoc 'comment_count object)))
+ (let ((com-cell (assoc 'comments object)))
(if com-cell
(progn
(setcdr
diff --git a/sx-question-list.el b/sx-question-list.el
index fbed4ea..9709b99 100644
--- a/sx-question-list.el
+++ b/sx-question-list.el
@@ -30,10 +30,22 @@
(require 'sx-question-mode)
(require 'sx-favorites)
+(defgroup sx-question-list nil
+ "Customization group for sx-question-list."
+ :prefix "sx-question-list-"
+ :tag "SX Question List"
+ :group 'sx)
+
+(defgroup sx-question-list-faces nil
+ "Customization group for the faces of `sx-question-list'."
+ :prefix "sx-question-list-"
+ :tag "SX Question List Faces"
+ :group 'sx-question-list)
+
;;; Customization
(defcustom sx-question-list-height 12
- "Height, in lines, of stack-mode's *question-list* buffer."
+ "Height, in lines, of SX's *question-list* buffer."
:type 'integer
:group 'sx-question-list)
diff --git a/sx-question-mode.el b/sx-question-mode.el
index f3ef8e5..6dc8395 100644
--- a/sx-question-mode.el
+++ b/sx-question-mode.el
@@ -1,4 +1,4 @@
-;;; sx-question-mode.el --- Creating the buffer that displays questions -*- lexical-binding: t; -*-
+;;; sx-question-mode.el --- Creating the buffer that displays questions
;; Copyright (C) 2014 Artur Malabarba
@@ -31,11 +31,13 @@
(defgroup sx-question-mode nil
"Customization group for sx-question-mode."
:prefix "sx-question-mode-"
+ :tag "SX Question Mode"
:group 'sx)
(defgroup sx-question-mode-faces nil
"Customization group for the faces of `sx-question-mode'."
:prefix "sx-question-mode-"
+ :tag "SX Question Mode Faces"
:group 'sx-question-mode)
@@ -73,7 +75,7 @@ If WINDOW is given, use that to display the buffer."
;; Create the buffer if necessary.
(unless (buffer-live-p sx-question-mode--buffer)
(setq sx-question-mode--buffer
- (generate-new-buffer "*stack-question*")))
+ (generate-new-buffer "*sx-question*")))
(cond
;; Window was given, use it.
((window-live-p window)
@@ -637,3 +639,7 @@ query the api."
(provide 'sx-question-mode)
;;; sx-question-mode.el ends here
+
+;; Local Variables:
+;; lexical-binding: t
+;; End:
diff --git a/sx-question.el b/sx-question.el
index a7aadb2..01ba030 100644
--- a/sx-question.el
+++ b/sx-question.el
@@ -1,4 +1,4 @@
-;;; sx-question.el --- question logic for stack-mode -*- lexical-binding: t; -*-
+;;; sx-question.el --- question logic
;; Copyright (C) 2014 Sean Allred
@@ -167,4 +167,5 @@ 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 6b09988..a98af5a 100644
--- a/sx-request.el
+++ b/sx-request.el
@@ -71,7 +71,7 @@
"gunzip"
"Program used to unzip the response if it is compressed.
This program must accept compressed data on standard input."
- :group 'sx-request
+ :group 'sx
:type 'string)
(defvar sx-request-remaining-api-requests
@@ -85,7 +85,7 @@ Set by `sx-request-make'.")
After `sx-request-remaining-api-requests' drops below this
number, `sx-request-make' will begin printing out the
number of requests left every time it finishes a call."
- :group 'sx-request
+ :group 'sx
:type 'integer)
diff --git a/sx-site.el b/sx-site.el
index 04b5240..8bd4fc0 100644
--- a/sx-site.el
+++ b/sx-site.el
@@ -57,7 +57,7 @@
"List of favorite sites.
Each entry is a string corresponding to a single site's
api_site_parameter."
- :group 'sx-site)
+ :group 'sx)
(defun sx-site-get-api-tokens ()
"Return a list of all known site tokens."
diff --git a/sx-tab.el b/sx-tab.el
index 8a51236..154a90f 100644
--- a/sx-tab.el
+++ b/sx-tab.el
@@ -30,11 +30,11 @@
(defcustom sx-tab-default-site "emacs"
"Name of the site to use by default when listing questions."
:type 'string
- :group 'stack-exchange)
+ :group 'sx)
(defmacro sx-tab--define (tab pager &optional printer refresher
&rest body)
- "Define a stack-exchange tab called TAB.
+ "Define a StackExchange tab called TAB.
TAB is a capitalized string.
This defines a command `sx-tab-TAB' for displaying the tab,
diff --git a/sx-time.el b/sx-time.el
index 057a397..e65bb50 100644
--- a/sx-time.el
+++ b/sx-time.el
@@ -1,4 +1,4 @@
-;;; sx-time.el --- time for stack-mode
+;;; sx-time.el --- time
;; Copyright (C) 2014 Sean Allred
@@ -57,13 +57,13 @@
"Format used for dates on a past year.
See also `sx-time-date-format'."
:type 'string
- :group 'sx-time)
+ :group 'sx)
(defcustom sx-time-date-format "%H:%M - %d %b"
"Format used for dates on this year.
See also `sx-time-date-format-year'."
:type 'string
- :group 'sx-time)
+ :group 'sx)
(defun sx-time-seconds-to-date (seconds)
"Return the integer SECONDS as a date string."
diff --git a/sx.el b/sx.el
index e47e6e3..0fe98c7 100644
--- a/sx.el
+++ b/sx.el
@@ -1,9 +1,9 @@
-;;; sx.el --- Core functions of the sx package. -*- lexical-binding: t; -*-
+;;; sx.el --- core functions of the sx package.
;; Copyright (C) 2014 Sean Allred
;; Author: Sean Allred <code@seanallred.com>
-;; URL: https://github.com/vermiculus/stack-mode/
+;; URL: https://github.com/vermiculus/sx.el/
;; Version: 0.1
;; Keywords: help, hypermedia, tools
;; Package-Requires: ((emacs "24.1") (cl-lib "0.5") (json "1.3") (markdown-mode "2.0"))
@@ -23,14 +23,20 @@
;;; Commentary:
-;; This file defines basic commands used by all other parts of
-;; StackMode.
+;; This file defines basic commands used by all other parts of SX.
;;; Code:
(require 'tabulated-list)
(defconst sx-version "0.1" "Version of the `sx' package.")
+(defgroup sx nil
+ "Customization group for sx-question-mode."
+ :prefix "sx-"
+ :tag "SX"
+ :group 'applications)
+
+
;;; User commands
(defun sx-version ()
@@ -43,7 +49,7 @@
(defun sx-bug-report ()
"File a bug report about the `sx' package."
(interactive)
- (browse-url "https://github.com/vermiculus/stack-mode/issues/new"))
+ (browse-url "https://github.com/vermiculus/sx.el/issues/new"))
;;; Browsing filter
@@ -100,7 +106,7 @@ is intentionally skipped."
(defun sx-message (format-string &rest args)
"Display FORMAT-STRING as a message with ARGS.
See `format'."
- (message "[stack] %s" (apply #'format format-string args)))
+ (message "[sx] %s" (apply #'format format-string args)))
(defun sx-message-help-echo ()
"If there's a 'help-echo property under point, message it."
@@ -265,13 +271,13 @@ is equivalent to
,@body)))
(defcustom sx-init-hook nil
- "Hook run when stack-mode initializes.
+ "Hook run when SX initializes.
Run after `sx-init--internal-hook'."
:group 'sx
:type 'hook)
(defvar sx-init--internal-hook nil
- "Hook run when stack-mode initializes.
+ "Hook run when SX initializes.
This is used internally to set initial values for variables such
as filters.")
@@ -313,4 +319,5 @@ If FORCE is non-nil, run them even if they've already been run."
;; Local Variables:
;; indent-tabs-mode: nil
+;; lexical-binding: t
;; End:
diff --git a/sx.org b/sx.org
index cb1c109..f866aa5 100644
--- a/sx.org
+++ b/sx.org
@@ -4,7 +4,7 @@
#+TITLE: SX: A StackExchange Client (v{{{version}}})
#+DATE: 16 November 2014
-#+AUTHOR: @@texinfo:@url{@@www.github.com/vermiculus/stack-mode@@texinfo:}@@
+#+AUTHOR: @@texinfo:@url{@@www.github.com/vermiculus/sx.el@@texinfo:}@@
#+LANGUAGE: en
#+OPTIONS: ':t toc:t