From bcf458194d29a63be25cda129da3d49325382a97 Mon Sep 17 00:00:00 2001 From: Jason Blevins Date: Sun, 7 Aug 2011 17:15:19 -0400 Subject: [PATCH] Add markdown-cur-line-indent, use in markdown-prev-line-indent --- markdown-mode.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/markdown-mode.el b/markdown-mode.el index 701a872..6b1f249 100644 --- a/markdown-mode.el +++ b/markdown-mode.el @@ -1033,13 +1033,18 @@ Arguments BEG and END specify the beginning and end of the region." (goto-char (point-at-bol)) (if (re-search-forward "^\\s " (point-at-eol) t) t))) +(defun markdown-cur-line-indent () + "Return the number of leading whitespace characters in the current line." + (save-excursion + (goto-char (point-at-bol)) + (re-search-forward "^\\s +" (point-at-eol) t) + (current-column))) + (defun markdown-prev-line-indent () "Return the number of leading whitespace characters in the previous line." (save-excursion (forward-line -1) - (goto-char (point-at-bol)) - (when (re-search-forward "^\\s +" (point-at-eol) t) - (current-column)))) + (markdown-cur-line-indent))) (defun markdown-prev-list-indent () "Return position of the first non-list-marker on the previous line." -- 2.11.4.GIT