From 32520c194d95589a4fec36a68ff13502ad651049 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 23 Feb 2024 18:04:59 +0100 Subject: readme typo --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.org b/README.org index 5c663e6..650c227 100644 --- a/README.org +++ b/README.org @@ -252,7 +252,7 @@ value of that hook is as follows: **** Autocompletion of mentions, tags, and emoji -Autocompletion of mentions, tags, and emoji is triggered =@=, =#=, and =:= +Autocompletion of mentions, tags, and emoji is triggered by =@=, =#=, and =:= respectively, plus a few letters. It is provided by =completion-at-point-functions= (capf) backends. =mastodon-toot--enable-completion= is enabled by default. If you want to enable -- cgit v1.2.3 From 77678bbc387cf492a3862f62670f5cb0a0e9d805 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 23 Feb 2024 18:16:38 +0100 Subject: readme: add nb re .info docs --- README.org | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.org b/README.org index 650c227..ea9c629 100644 --- a/README.org +++ b/README.org @@ -13,6 +13,8 @@ =mastodon.el= is an Emacs client for the AcitivityPub social networks that implement the Mastodon API. For info see [[https://joinmastodon.org/][joinmastodon.org]]. +NB: =mastodon.el= now ships this readme as an .info file, so if you have it installed you should be able to browse this readme inside emacs. =C-h i= for info, then =m masto RET= should load it for you. + ** Installation You can install =mastodon.el= from ELPA, MELPA, or directly from this repo. It is also available as a GUIX package. -- cgit v1.2.3 From 3cc43ddbc9d603f430dd6efc6d217cb6364c241e Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 23 Feb 2024 18:19:41 +0100 Subject: add eww--url-at-point to thing-at-point-provider-alist --- lisp/mastodon.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 7a04c87..4928bf1 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -463,7 +463,12 @@ Calls `mastodon-tl--get-buffer-type', which see." (mastodon-toot--enable-custom-emoji))) (mastodon-profile--fetch-server-account-settings) (when mastodon-tl--highlight-current-toot - (cursor-face-highlight-mode))) ; 29.1 + (cursor-face-highlight-mode)) ; 29.1 + ;; make `thing-at-point' functions work: + (setq-local thing-at-point-provider-alist + (append thing-at-point-provider-alist + '((url . eww--url-at-point))))) + ;;;###autoload (add-hook 'mastodon-mode-hook #'mastodon-mode-hook-fun) -- cgit v1.2.3 From 7b1d7584ff52fb2bbd45d3866bc03f912c741406 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 27 Feb 2024 11:17:56 +0100 Subject: readme, note about M-X --- README.org | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.org b/README.org index ea9c629..498625f 100644 --- a/README.org +++ b/README.org @@ -356,6 +356,8 @@ See =M-x customize-group RET mastodon= to view all customize options. An index of all user-facing commands and custom variables is available here: [[file:mastodon-index.org][mastodon-index.org]]. +You can also hit =?= in any =mastodon.el= buffer to see the available bindings, or run =M-X= (upper-case =X=) to view all commands in the buffer with completion, and call one. + *** Alternative timeline layout The incomparable Nicholas Rougier has written an alternative timeline layout -- cgit v1.2.3 From 54be3ac2457ca21fbc827c6304009e2461ffacec Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 27 Feb 2024 16:39:19 +0100 Subject: compose: only try to enable emojify-mode if its bound --- lisp/mastodon-toot.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 366a000..1d91578 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -155,7 +155,8 @@ If the original toot visibility is different we use the more restricted one." :type 'boolean) (defcustom mastodon-toot--emojify-in-compose-buffer t - "Whether to enable `emojify' in the compose buffer." + "Whether to enable `emojify-mode' in the compose buffer. +We only attempt to enable it if its bound." :type 'boolean) (defcustom mastodon-toot--proportional-fonts-compose nil @@ -1902,7 +1903,9 @@ EDIT means we are editing an existing toot, not composing a new one." (setq mastodon-toot-previous-window-config previous-window-config) (when mastodon-toot--proportional-fonts-compose (facemenu-set-face 'variable-pitch)) - (when mastodon-toot--emojify-in-compose-buffer + (when (and mastodon-toot--emojify-in-compose-buffer + ;; emojify loaded but poss not enabled in our buffer: + (boundp 'emojify-mode)) (emojify-mode)) (when (and initial-text (not reply-json)) -- cgit v1.2.3 From d61381e9395af63f0fa56e1f89a213aba3e43100 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 27 Feb 2024 17:11:25 +0100 Subject: only complete on : if emojify-mode enabled. it's too hard for now to enable completion without emojify --- lisp/mastodon-toot.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 1d91578..82ad03b 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -1036,8 +1036,10 @@ Federated user: `username@host.co`." (defun mastodon-toot--fetch-emojify-candidates () "Get the candidates to be used for emojis completion. The candidates are calculated according to currently active -`emojify-emoji-styles'. Hacked off `emojify--get-completing-read-candidates'." - (let ((styles (mapcar #'symbol-name emojify-emoji-styles))) +`emojify-emoji-styles'. Hacked off +`emojify--get-completing-read-candidates'." + (let ((styles ;'("ascii" "unicode" "github") + (mapcar #'symbol-name emojify-emoji-styles))) (let ((emojis '())) (emojify-emojis-each (lambda (key value) (when (seq-position styles (ht-get value "style")) @@ -1062,7 +1064,8 @@ TYPE is the candidate type, it may be :tags, :handles, or :emoji." collect (cons (concat "#" (car tag)) (cdr tag))))) ((eq type :emoji) - (mastodon-toot--fetch-emojify-candidates)) + (when (bound-and-true-p emojify-mode) + (mastodon-toot--fetch-emojify-candidates))) (t (mastodon-search--search-accounts-query (buffer-substring-no-properties start end)))))) -- cgit v1.2.3 From b60de81d7b8113fe622e9a5af149f165fab1dc96 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 27 Feb 2024 22:18:55 +0100 Subject: comment plain text in boost/fave notifs. FIX #432. --- lisp/mastodon-notifications.el | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 2c61cd4..f7276d6 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -171,6 +171,18 @@ Status notifications are given when "Format for an `edit' NOTE." (mastodon-notifications--format-note note 'edit)) +(defun mastodon-notifications--comment-note-text (str) + "Add comment face to all text in STR with `shr-text' face only." + (with-temp-buffer + (switch-to-buffer (current-buffer)) + (insert str) + (goto-char (point-min)) + (while (setq prop (text-property-search-forward 'face 'shr-text t)) + (add-text-properties (prop-match-beginning prop) + (prop-match-end prop) + '(face (font-lock-comment-face shr-text)))) + (buffer-string))) + (defun mastodon-notifications--format-note (note type) "Format for a NOTE of TYPE." (let ((id (alist-get 'id note)) @@ -191,17 +203,22 @@ Status notifications are given when (t status)) ;; body - (if (or (equal type 'follow) - (equal type 'follow-request)) - (propertize (if (equal type 'follow) - "Congratulations, you have a new follower!" - (format "You have a follow request from... %s" - follower)) - 'face 'default) - (mastodon-tl--clean-tabs-and-nl - (if (mastodon-tl--has-spoiler status) - (mastodon-tl--spoiler status) - (mastodon-tl--content status)))) + (let ((body (mastodon-tl--clean-tabs-and-nl + (if (mastodon-tl--has-spoiler status) + (mastodon-tl--spoiler status) + (mastodon-tl--content status))))) + (cond ((or (eq type 'follow) + (eq type 'follow-request)) + (propertize (if (equal type 'follow) + "Congratulations, you have a new follower!" + (format "You have a follow request from... %s" + follower)) + 'face 'default)) + ((or (eq type 'favourite) + (eq type 'boost)) + (mastodon-notifications--comment-note-text + body)) + (t body))) ;; author-byline (if (or (equal type 'follow) (equal type 'follow-request) -- cgit v1.2.3