diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-13 00:53:12 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-13 00:53:12 +0000 |
commit | 678510081ece49dc8c12140e8bf4f5b543ea2cfc (patch) | |
tree | 156a64c887effbdd96d83049bcec14609885898f /sx.el | |
parent | 0b766bb6f949ac583c7cbff90fc172c36795b231 (diff) | |
parent | 302b5a0cf2222973b901c7856da3920705ebe24e (diff) |
Merge branch 'master' into use-let-alist
Conflicts:
Cask
Diffstat (limited to 'sx.el')
-rw-r--r-- | sx.el | 30 |
1 files changed, 1 insertions, 29 deletions
@@ -1,4 +1,4 @@ -;;; sx.el --- core functions of the sx package. +;;; sx.el --- StackExchange client ;; Copyright (C) 2014 Sean Allred @@ -201,34 +201,6 @@ Anything before the (sub)domain is removed." (rx string-start (or (and (0+ word) (optional ":") "//"))) "" url))) -(defun sx--unindent-text (text) - "Remove indentation from TEXT. -Primarily designed to extract the content of markdown code -blocks." - (with-temp-buffer - (insert text) - (goto-char (point-min)) - (let (result) - ;; Get indentation of each non-blank line - (while (null (eobp)) - (skip-chars-forward "[:blank:]") - (unless (looking-at "$") - (push (current-column) result)) - (forward-line 1)) - (when result - ;; Build a regexp with the smallest indentation - (let ((rx (format "^ \\{0,%s\\}" - (apply #'min result)))) - (goto-char (point-min)) - ;; Use this regexp to remove that much indentation - ;; throughout the buffer. - (while (and (null (eobp)) - (search-forward-regexp rx nil 'noerror)) - (replace-match "") - (forward-line 1))))) - ;; Return the buffer - (buffer-string))) - ;;; Printing request data (defvar sx--overlays nil |