diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-18 17:49:18 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-18 17:49:18 -0200 |
commit | b3008bf4e11bb4a5bc67a82f7bebd3f38520d0af (patch) | |
tree | 6e3572c1b3dd371c092016632bb7cf2d3c5712eb | |
parent | df276818b6275f795f4504b5df36505a7f79c8ee (diff) |
Don't fill headlines
-rw-r--r-- | sx-question-print.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sx-question-print.el b/sx-question-print.el index 46e18ca..6c98c36 100644 --- a/sx-question-print.el +++ b/sx-question-print.el @@ -375,6 +375,7 @@ E.g.: (skip-chars-forward "\r\n[:blank:]") (let ((first-non-blank (point))) (dolist (it '(sx-question-mode--skip-and-fontify-pre + sx-question-mode--skip-headline sx-question-mode--skip-comments)) ;; If something worked, keep point where it is and return t. (if (funcall it) (throw 'sx-question-mode-done t) @@ -443,5 +444,12 @@ font-locking." ;; "Handling means to store any relevant metadata it might be holding." (markdown-match-comments (line-end-position))) +(defun sx-question-mode--skip-headline () + "If there's a headline ahead, skip it and return non-nil." + (when (or (looking-at-p "^#+ ") + (progn (forward-line 1) (looking-at-p "===\\|---"))) + ;; Returns non-nil. + (forward-line 1))) + (provide 'sx-question-print) ;;; sx-question-print.el ends here |