From 2042ef66bebc8b80b24b49ba667f85ddda2ce861 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 28 Jun 2024 04:31:59 +0300 Subject: gnosis-display-question: Center string & apply syntax highlighting --- gnosis.el | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gnosis.el') diff --git a/gnosis.el b/gnosis.el index 0d9cb7d..b71ec10 100644 --- a/gnosis.el +++ b/gnosis.el @@ -366,6 +366,17 @@ This will not be applied to sentences that start with double space." (delete-region end (match-end 0)) (delete-region (match-beginning 0) start)))))))) +(defun gnosis-display-question (id &optional fill-paragraph-p) + "Display main row for note ID. + +If FILL-PARAGRAPH-P, insert question using `fill-paragraph'." + (let ((question (gnosis-get 'main 'notes `(= id ,id)))) + (erase-buffer) + (if fill-paragraph-p + (fill-paragraph (insert "\n" (propertize question 'face 'gnosis-face-main)))) + (insert "\n" (gnosis-center-string (propertize question 'face 'gnosis-face-main))) + (gnosis-apply-syntax-overlay))) + (cl-defun gnosis-display-image (id &optional (image 'images)) "Display image for note ID. -- cgit v1.2.3