From b211b850ca4b29d44a53df41e165a09dd586a859 Mon Sep 17 00:00:00 2001 From: Jason Blevins Date: Mon, 20 Nov 2017 20:20:48 -0500 Subject: [PATCH] Optionally skip matching in markdown-cur-list-item-bounds Pass a non-nil argument to skip matching against markdown-regex-list if already done. --- markdown-mode.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/markdown-mode.el b/markdown-mode.el index a76d7b3..1a5733d 100644 --- a/markdown-mode.el +++ b/markdown-mode.el @@ -3485,8 +3485,8 @@ original point. If the point is not in a list item, do nothing." (skip-syntax-backward "-"))) (point))) -(defun markdown-cur-list-item-bounds () - "Return bounds and indentation of the current list item. +(defun markdown-cur-list-item-bounds (&optional matched) + "Return bounds of list item at point (possibly already MATCHED). Return a list of the following form: (begin end indent nonlist-indent marker checkbox) @@ -3517,7 +3517,7 @@ Leave match data intact for `markdown-regex-list'." (save-excursion (let ((cur (point))) (end-of-line) - (when (re-search-backward markdown-regex-list nil t) + (when (or matched (re-search-backward markdown-regex-list nil t)) (let* ((begin (match-beginning 0)) (indent (length (match-string-no-properties 1))) (nonlist-indent (length (match-string 0))) -- 2.11.4.GIT