From f42a3aea506b5258dcf3e2b55d211d89f68a6c8a Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 23 Mar 2023 15:11:58 +0100 Subject: make list-follow-tags idiot proof --- lisp/mastodon-tl.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lisp/mastodon-tl.el') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 644a3d4..f557282 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -2037,8 +2037,10 @@ If TAG is provided, unfollow it." (interactive) (let* ((followed-tags-json (mastodon-tl--followed-tags)) (tags (mastodon-tl--map-alist 'name followed-tags-json)) - (tag (completing-read "Tag: " tags))) - (mastodon-tl--get-tag-timeline tag))) + (tag (completing-read "Tag: " tags nil))) + (if (null tag) + (message "You have to follow some tags first.") + (mastodon-tl--get-tag-timeline tag)))) ;;; UPDATING, etc. -- cgit v1.2.3 From 300d86f617f80e22a2926313f62ddbd06b992630 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 23 Mar 2023 23:25:14 +0100 Subject: replace hypen horiz-bars with unicode masto-tl--horiz-bar if poss --- lisp/mastodon-profile.el | 10 +++++----- lisp/mastodon-search.el | 16 ++++++++-------- lisp/mastodon-tl.el | 21 +++++++++++++-------- lisp/mastodon-views.el | 8 ++++---- 4 files changed, 30 insertions(+), 25 deletions(-) (limited to 'lisp/mastodon-tl.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 74f9b62..7fb36ad 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -642,7 +642,7 @@ HEADERS means also fetch link headers for pagination." (if (equal locked t) (concat " " (mastodon-tl--symbol 'locked)) "") - "\n ------------\n" + "\n " mastodon-tl--horiz-bar "\n" ;; profile note: ;; account here to enable tab-stops in profile note (mastodon-tl--render-text note account) @@ -662,11 +662,11 @@ HEADERS means also fetch link headers for pagination." 'profile-json account) ;; insert counts (mastodon-tl--set-face - (concat " ------------\n" + (concat " " mastodon-tl--horiz-bar "\n" " TOOTS: " toots-count " | " "FOLLOWERS: " followers-count " | " "FOLLOWING: " following-count "\n" - " ------------\n\n") + " " mastodon-tl--horiz-bar "\n\n") 'success) ;; insert relationship (follows) (if followsp @@ -682,9 +682,9 @@ HEADERS means also fetch link headers for pagination." "") ; if no followsp we still need str-or-char-p for insert ;; insert endpoint (mastodon-tl--set-face - (concat " ------------\n" + (concat " " mastodon-tl--horiz-bar "\n" endpoint-name "\n" - " ------------\n") + " " mastodon-tl--horiz-bar "\n") 'success)) (setq mastodon-tl--update-point (point)) (mastodon-media--inline-images (point-min) (point)) diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index b5900c7..3555238 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -97,9 +97,9 @@ QUERY is the string to search." nil) ;; hashtag results: (insert (mastodon-tl--set-face - (concat "\n ------------\n" + (concat "\n " mastodon-tl--horiz-bar "\n" " TRENDING HASHTAGS\n" - " ------------\n\n") + " " mastodon-tl--horiz-bar "\n\n") 'success)) (mastodon-search--print-tags-list tags))))) @@ -135,23 +135,23 @@ QUERY is the string to search." nil) ;; user results: (insert (mastodon-tl--set-face - (concat "\n ------------\n" + (concat "\n " mastodon-tl--horiz-bar "\n" " USERS\n" - " ------------\n\n") + " " mastodon-tl--horiz-bar "\n\n") 'success)) (mastodon-search--insert-users-propertized accts :note) ;; hashtag results: (insert (mastodon-tl--set-face - (concat "\n ------------\n" + (concat "\n " mastodon-tl--horiz-bar "\n" " HASHTAGS\n" - " ------------\n\n") + " " mastodon-tl--horiz-bar "\n\n") 'success)) (mastodon-search--print-tags-list tags-list) ;; status results: (insert (mastodon-tl--set-face - (concat "\n ------------\n" + (concat "\n " mastodon-tl--horiz-bar "\n" " STATUSES\n" - " ------------\n") + " " mastodon-tl--horiz-bar "\n") 'success)) (mapc #'mastodon-tl--toot toots-list-json) (goto-char (point-min)))))) diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index f557282..fbee377 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -189,6 +189,10 @@ If nil `(point-min)' is used instead.") (defvar-local mastodon-tl--timestamp-update-timer nil "The timer that, when set will scan the buffer to update the timestamps.") +(defvar mastodon-tl--horiz-bar + (if (char-displayable-p ?―) + (make-string 12 ?―) + (make-string 12 ?-))) ;;; KEYMAPS @@ -625,7 +629,8 @@ this just means displaying toot client." (mastodon-tl--relative-time-description edited-parsed) edited-parsed))) "") - (propertize "\n ------------" 'face 'default) + (propertize (concat "\n " mastodon-tl--horiz-bar) + 'face 'default) (if mastodon-tl--show-stats (mastodon-tl--toot-stats toot) "") @@ -962,13 +967,13 @@ message is a link which unhides/hides the main body." (mastodon-tl--clean-tabs-and-nl (mastodon-tl--render-text spoiler toot)) 'default)) - (message (concat ;"\n" - " ---------------\n" - " " (mastodon-tl--make-link - (concat "CW: " string) - 'content-warning) - "\n" - " ---------------\n")) + (message (concat + " " mastodon-tl--horiz-bar "\n " + (mastodon-tl--make-link + (concat "CW: " string) + 'content-warning) + "\n " + mastodon-tl--horiz-bar "\n")) (cw (mastodon-tl--set-face message 'mastodon-cw-face))) (concat cw diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el index 22eac7e..97ef082 100644 --- a/lisp/mastodon-views.el +++ b/lisp/mastodon-views.el @@ -163,10 +163,10 @@ This function is used as the update-function to provides the JSON data." (erase-buffer) (insert (mastodon-tl--set-face - (concat "\n ------------\n " + (concat "\n " mastodon-tl--horiz-bar "\n " (upcase view-name) - "\n" - " ------------\n\n") + "\n " + mastodon-tl--horiz-bar "\n\n") 'success) (if bindings-string (mastodon-tl--set-face @@ -215,7 +215,7 @@ provides the JSON data." (mastodon-tl--map-alist 'title lists))) (mapc (lambda (x) (mastodon-views--print-list-accounts x) - (insert (propertize " ------------\n\n" + (insert (propertize (concat " " mastodon-tl--horiz-bar "\n\n") 'face 'success))) lists-names))) -- cgit v1.2.3