diff options
author | Sean Allred <code@seanallred.com> | 2014-12-11 19:36:54 -0500 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-12-11 19:36:54 -0500 |
commit | e80ed6b6e717fc071ba28519caf4bbb6ac30d8a7 (patch) | |
tree | ab365622e69b97ca6a47e1f40e40f575665cdf15 /sx.el | |
parent | 8e73f901f46cbba4cb8650481464503844ebe81e (diff) | |
parent | 194a28541d8d2193872a4d83cef50567488a6338 (diff) |
Merge pull request #141 from vermiculus/babel
Font-lock code blocks according to mode.
Diffstat (limited to 'sx.el')
-rw-r--r-- | sx.el | 28 |
1 files changed, 0 insertions, 28 deletions
@@ -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 |