aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-08-14 14:27:29 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-08-14 14:44:21 +0200
commitc58e69b4d6e327603d868b98745e032d2436bafa (patch)
treec0be8fafdb2b085c81ace723a0663b5f3aaf326f
parent5e2e14b1f9aee068d3b59c4d319fa923114b9f71 (diff)
fix insert-filter-kws
-rw-r--r--lisp/mastodon-views.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el
index 8c36f27..2a0d248 100644
--- a/lisp/mastodon-views.el
+++ b/lisp/mastodon-views.el
@@ -604,11 +604,15 @@ JSON is the filters data."
(defun mastodon-views--insert-filter-kws (kws)
"Insert filter keywords KWS."
+ ;; FIXME: make this a table (ideally upatable)
+ (insert "\n\nTerms: | whole words only:")
(mapc (lambda (kw)
- (let ((whole (alist-get 'whole_word kw)))
+ (let ((whole (if (eq :json-false (alist-get 'whole_word kw))
+ "nil"
+ "t")))
(insert
(propertize (concat
- (format "\n %s \"%s\" | whole word: %s"
+ (format "\n %s \"%s\" | %s"
(if (char-displayable-p ?―) "―" "-")
(alist-get 'keyword kw)
whole))
@@ -637,10 +641,9 @@ JSON is the filters data."
;; type (warn or hide):
(insert "\n\nType: " .filter_action)
;; terms list:
- (if (not .keywords)
+ (if (not .keywords) ;; poss to have a filter sans keywords
""
- (insert "\n\nTerms:")
- (mastodon-views--insert-filter-kws \.keywords))
+ (mastodon-views--insert-filter-kws .keywords))
(insert "\n")))
(defvar mastodon-views--filter-types