aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sx-cache.el21
-rw-r--r--sx-question-mode.el3
2 files changed, 15 insertions, 9 deletions
diff --git a/sx-cache.el b/sx-cache.el
index 9f152e2..7ff7f7f 100644
--- a/sx-cache.el
+++ b/sx-cache.el
@@ -78,21 +78,26 @@ CACHE is resolved to a file name by `sx-cache-get-file-name'."
VARS is a list of variables to unbind to ensure cache is cleared.
If INIT-METHOD is defined, call it after all invalidation to
re-initialize the cache."
- (sx-cache-set cache nil)
+ (let ((file (sx-cache-get-file-name cache)))
+ (delete-file file))
(mapc #'makunbound vars)
- (funcall init-method))
+ (when init-method
+ (funcall init-method)))
(defun sx-cache-invalidate-all (&optional save-auth)
"Invalidate all caches using `sx-cache--invalidate'.
-Afterwards reinitialize caches using `sx-initialize'. If
-SAVE-AUTH is non-nil, do not clear AUTH cache."
- (let ((caches (let ((default-directory sx-cache-directory))
- (file-expand-wildcards "*.el"))))
+Afterwards reinitialize caches using `sx-initialize'. If
+SAVE-AUTH is non-nil, do not clear AUTH cache.
+
+Note: This will also remove read/unread status of questions as well
+as delete the list of hidden questions."
+ (let* ((default-directory sx-cache-directory)
+ (caches (file-expand-wildcards "*.el")))
(when save-auth
(setq caches (cl-remove-if (lambda (x)
- (string= x "auth.el")) caches)))
+ (string= x "auth.el")) caches)))
(lwarn 'stack-mode :debug "Invalidating: %S" caches)
- (mapc #'sx-cache--invalidate caches)
+ (mapc #'delete-file caches)
(sx-initialize 'force)))
(provide 'sx-cache)
diff --git a/sx-question-mode.el b/sx-question-mode.el
index f8a0d1e..f1705a5 100644
--- a/sx-question-mode.el
+++ b/sx-question-mode.el
@@ -270,6 +270,7 @@ DATA can represent a question or an answer."
(insert "\n"
(sx-question-mode--fill-and-fontify
.body_markdown)
+ "\n"
(propertize sx-question-mode-separator
'face 'sx-question-mode-header))))
;; Comments
@@ -547,7 +548,7 @@ Optional argument _ is for `push-button'."
;;; Major-mode
-(define-derived-mode sx-question-mode markdown-mode "Question"
+(define-derived-mode sx-question-mode special-mode "Question"
"Major mode to display and navigate a question and its answers.
Letters do not insert themselves; instead, they are commands.