summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-06-28 04:31:59 +0300
committerThanos Apollo <[email protected]>2024-06-28 04:31:59 +0300
commit2042ef66bebc8b80b24b49ba667f85ddda2ce861 (patch)
treebc74528f0cf87323fdb624ffab0bea5d5dafd7ad
parent6b637b10a68e2979fef6ef4a6e92ef9a5aca93c2 (diff)
gnosis-display-question: Center string & apply syntax highlighting
-rw-r--r--gnosis.el11
1 files changed, 11 insertions, 0 deletions
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.