vermiculus / sx.el

Stack Exchange for Emacs
http://stackapps.com/q/3950
709 stars 40 forks source link
emacs stack-exchange stackoverflow

+Title: SX -- Stack Exchange for Emacs

[[https://travis-ci.org/vermiculus/sx.el][https://travis-ci.org/vermiculus/sx.el.svg?branch=master]] [[http://melpa.org/#/sx][file:http://melpa.org/packages/sx-badge.svg]] [[http://stable.melpa.org/#/sx][file:http://stable.melpa.org/packages/sx-badge.svg]] [[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]]

SX is a full-featured Stack Exchange mode for GNU Emacs 24+. Using the official API, it provides a versatile experience for the Stack Exchange network within Emacs itself.

[[file:list-and-question.png]]

Inside SX buffers, you can switch to other tabs by typing =s= followed by the key listed with the tab above. You can also use ~sx-tab-switch~ (=s t=) to switch between tabs with completion. Each of these opens up a list of questions, and you can further customize the ordering of the list with =O=. Other keys include:

*** Questions and Answers

** Your Inbox

** Authenticating If you are going to be doing any asking/answering/commenting/upvoting/downvoting/ /etc./, you must use ~sx-authenticate~ to provide SX with an authentication token to act on your behalf.

After authentication, you will be redirected to the project page. This page will prominently display your authentication token. Keep this secret! It's as good as your password as far as StackExchange is concerned. Copy and paste the token into the prompt in Emacs.

+BEGIN_QUOTE

SX will store this authentication token in plain text in the =sx= folder of your =.emacs.d=. Please take any and all steps necessary to protect the security of your account. This token is as good as a password.

+END_QUOTE

** Sample Keybindings *** With =use-package=

+BEGIN_SRC elisp

(require 'use-package)

(use-package sx :config (bind-keys :prefix "C-c s" :prefix-map my-sx-map :prefix-docstring "Global keymap for SX." ("q" . sx-tab-all-questions) ("i" . sx-inbox) ("o" . sx-open-link) ("u" . sx-tab-unanswered-my-tags) ("a" . sx-ask) ("s" . sx-search)))

+END_SRC

*** Standard (With Prefix Key) Shamelessly stolen from [[http://endlessparentheses.com/sx-el-announcement-and-more-launcher-map.html][Endless Parentheses]].

+BEGIN_SRC elisp

(define-prefix-command 'launcher-map) (global-set-key (kbd "s-l") 'launcher-map) (define-key launcher-map "qq" #'sx-tab-all-questions) (define-key launcher-map "qi" #'sx-inbox) (define-key launcher-map "qo" #'sx-open-link) (define-key launcher-map "qu" #'sx-tab-unanswered-my-tags) (define-key launcher-map "qa" #'sx-ask) (define-key launcher-map "qs" #'sx-search)

+END_SRC

For a better view of all of the open issues, take a look at our lovely [[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!

See also =CONTRIBUTING.org=.

** Icons 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.