diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-12 21:11:58 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-12 21:11:58 -0200 |
commit | 2f0c2c3d29e24873dbe9f66718e8478ed1472ca6 (patch) | |
tree | 90ba6f290e04a75a734fb615a58ab5a2c07d3a08 /sx.el | |
parent | 9356a6a039f0d8cf8d9f31e42e8007617c58577d (diff) | |
parent | 3855607ae779165e33f5f1834bedad42d1583971 (diff) |
Merge branch 'images' into print-question-without-temp-buffer
Diffstat (limited to 'sx.el')
-rw-r--r-- | sx.el | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -4,7 +4,7 @@ ;; Author: Sean Allred <code@seanallred.com> ;; URL: https://github.com/vermiculus/sx.el/ -;; Version: 0.1 +;; Version: 0.2 ;; Keywords: help, hypermedia, tools ;; Package-Requires: ((emacs "24.1") (cl-lib "0.5") (json "1.3") (markdown-mode "2.0") (let-alist "1.0.3")) @@ -28,7 +28,7 @@ ;;; Code: (require 'tabulated-list) -(defconst sx-version "0.1" "Version of the `sx' package.") +(defconst sx-version "0.2" "Version of the `sx' package.") (defgroup sx nil "Customization group for the `sx' package." @@ -148,12 +148,7 @@ with a `link' property)." ;; From URL (string-match (rx "/questions/" ;; Question ID - (group-n 1 (+ digit)) "/" - ;; Optional question title - (optional (+ (not (any "/"))) "/") - ;; Garbage at the end - (optional (and (any "?#") (* any))) - string-end) + (group-n 1 (+ digit)) "/") link)) (push '(type . question) result))) (push (cons 'id (string-to-number (match-string-no-properties 1 link))) @@ -336,6 +331,10 @@ GET-FUNC and performs the actual comparison." (funcall ,get-func a) (funcall ,get-func b)))) +(defun sx--squash-whitespace (string) + "Return STRING with consecutive whitespace squashed together." + (replace-regexp-in-string "[ \r\n]+" " " string)) + ;;; Printing request data (defvar sx--overlays nil |