aboutsummaryrefslogtreecommitdiff
path: root/sx-question-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'sx-question-mode.el')
-rw-r--r--sx-question-mode.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/sx-question-mode.el b/sx-question-mode.el
index 0ac2774..39d352e 100644
--- a/sx-question-mode.el
+++ b/sx-question-mode.el
@@ -345,11 +345,13 @@ HEADER is given `sx-question-mode-header' face, and value is given FACE.
(when sx-question-mode-bullet-appearance
(font-lock-add-keywords ;; Bullet items.
nil
- `(("^ *\\(\\*\\|\\+\\|-\\|\\) "
+ `(((rx line-start (0+ blank) (group-n 1 (any "*+-")) blank)
1 '(face nil display ,sx-question-mode-bullet-appearance) prepend))))
(font-lock-add-keywords ;; Highlight usernames.
nil
- `(("\\(?: \\|^\\)\\(@\\(?:\\sw\\|\\s_\\)+\\)\\_>"
+ `(((rx (or blank line-start)
+ (group-n 1 (and "@" (1+ (or (syntax word) (syntax symbol)))))
+ symbol-end)
1 font-lock-builtin-face)))
;; Everything.
(font-lock-fontify-region (point-min) (point-max))
@@ -426,10 +428,11 @@ If ID is nil, use ID2 instead."
(save-match-data
(goto-char (point-min))
(when (search-forward-regexp
- (format "^\\s-*\\[\\(%s\\)]:\\s-+\\(?2:[^ ]+\\)"
+ (format (rx line-start (0+ blank) "[%s]:" (1+ blank)
+ (group-n 1 (1+ (not blank))))
(or id id2))
nil t)
- (match-string-no-properties 2)))))
+ (match-string-no-properties 1)))))
(defun sx-question-mode--move-over-pre ()
"Non-nil if paragraph at point can be filled."