From 4898b1669b54a8afca3303e70f01a9825cbe01d1 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sun, 7 Dec 2014 01:18:04 +0000 Subject: Patch sx and sx-question-print to use sx-babel. --- sx.el | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'sx.el') diff --git a/sx.el b/sx.el index 8e3e5d3..d5d9b75 100644 --- a/sx.el +++ b/sx.el @@ -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 -- cgit v1.2.3