[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/mastodon 1fa432d27c 11/27: toot.el: use all emoji for : ca
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/mastodon 1fa432d27c 11/27: toot.el: use all emoji for : capf, and get text annotation |
Date: |
Fri, 23 Feb 2024 13:00:54 -0500 (EST) |
branch: elpa/mastodon
commit 1fa432d27cad87f873de656bd4d6b257198314d9
Author: marty hiatt <martianhiatus@riseup.net>
Commit: marty hiatt <martianhiatus@riseup.net>
toot.el: use all emoji for : capf, and get text annotation
---
lisp/mastodon-toot.el | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 462f92566a..9c6c1ef6b6 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -1027,6 +1027,21 @@ Federated user: `username@host.co`."
(cons (match-beginning 2)
(match-end 2))))))
+(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)))
+ (let ((emojis '()))
+ (emojify-emojis-each (lambda (key value)
+ (when (seq-position styles (ht-get value "style"))
+ (push (cons key
+ (format "%s (%s)"
+ (ht-get value "name")
+ (ht-get value "style")))
+ emojis))))
+ emojis)))
+
(defun mastodon-toot--fetch-completion-candidates (start end &optional type)
"Search for a completion prefix from buffer positions START to END.
Return a list of candidates.
@@ -1041,8 +1056,7 @@ TYPE is the candidate type, it may be :tags, :handles, or
:emoji."
collect (cons (concat "#" (car tag))
(cdr tag)))))
((eq type :emoji)
- (cl-loop for e in emojify-user-emojis
- collect (car e)))
+ (mastodon-toot--fetch-emojify-candidates))
(t
(mastodon-search--search-accounts-query
(buffer-substring-no-properties start end))))))
@@ -1100,10 +1114,10 @@ arg, a candidate."
;; or make it an alist and use cdr
(cadr (assoc candidate mastodon-toot-completions)))
-(defun mastodon-toot--emoji-annotation-fun (_candidate)
+(defun mastodon-toot--emoji-annotation-fun (candidate)
"."
;; TODO: emoji image as annot
- )
+ (cdr (assoc candidate mastodon-toot-completions)))
;;; REPLY
- [nongnu] elpa/mastodon a01eec0d57 07/27: message appropriately for foll req, (continued)
- [nongnu] elpa/mastodon a01eec0d57 07/27: message appropriately for foll req, ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon 4a8a102b3b 01/27: Count characters directly from string, ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon aa4e01e5cd 16/27: toot: defcustom emojify in compose, ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon 3d558edff6 04/27: Tweak display actions to better preserve defaults, ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon 5977495b8a 20/27: move condition case from http get-response to credential-account, ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon 379e1edc27 12/27: read me, var index, ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon 11be568c1e 09/27: my-profile: load by id, rather than server search, ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon 8e48dc0d5f 26/27: readme typo, ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon 63120440fa 18/27: string-trim-left on remove-docs, ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon af029656fa 14/27: comment re return-creds-acc, ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon 1fa432d27c 11/27: toot.el: use all emoji for : capf, and get text annotation,
ELPA Syncer <=
- [nongnu] elpa/mastodon 5e31b1b484 15/27: http: some hack error handling in get-response, ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon 9caa0b58ea 10/27: docstrings, ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon 445d176b2a 02/27: Replace 'switch-to-buffer' with 'display-buffer' or 'pop-to-buffer', ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon 58ec54b666 17/27: update: skip scheduled-statuses view, ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon d66e27be92 23/27: Merge branch 'develop', ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon 2e6bcd41a9 05/27: Use pop-to-buffer so that new window is selected, ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon 6a5152b6cb 03/27: Use 'read-buffer' to choose a buffer, ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon 51132d0868 08/27: Merge pull request 'Use display-buffer to allow customization' (#522) from rahguzar/mastodon.el:display-buffer into develop, ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon 25bae1042f 25/27: Merge branch 'develop', ELPA Syncer, 2024/02/23
- [nongnu] elpa/mastodon c84630f0f1 27/27: readme: add nb re .info docs, ELPA Syncer, 2024/02/23