From ad6e15019541a38323733ee1576b8c8b39cc5f36 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 23 Aug 2022 10:35:54 +0200 Subject: implement tags company completion --- lisp/mastodon-search.el | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'lisp/mastodon-search.el') diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index cbb1fba..5756ae4 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -59,12 +59,22 @@ Returns a nested list containing user handle, display name, and URL." (interactive "sSearch mastodon for: ") (let* ((url (mastodon-http--api "accounts/search")) - ;; (buffer (format "*mastodon-search-%s*" query)) (response (if (equal mastodon-toot--enable-completion-for-mentions "following") (mastodon-http--get-search-json url query "following=true") (mastodon-http--get-search-json url query)))) - (mapcar #'mastodon-search--get-user-info-@ - response))) + (mapcar #'mastodon-search--get-user-info-@ response))) + +;; functions for tags completion: + +(defun mastodon-search--search-tags-query (query) + "Return an alist containing tag strings plus their URLs. +QUERY is the string to search." + (interactive "sSearch for hashtag: ") + (let* ((url (format "%s/api/v2/search" mastodon-instance-url)) + (type-param (concat "type=hashtags")) + (response (mastodon-http--get-search-json url query type-param)) + (tags (alist-get 'hashtags response))) + (mapcar #'mastodon-search--get-hashtag-info tags))) ;; functions for mastodon search -- cgit v1.2.3 From e620ef7cd4ff10a78334cd5e4293756e33f58f71 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 26 Aug 2022 18:01:48 +0200 Subject: completion customizes edit for handling tags completion --- lisp/mastodon-search.el | 2 +- lisp/mastodon-toot.el | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'lisp/mastodon-search.el') diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 5756ae4..89df311 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -59,7 +59,7 @@ Returns a nested list containing user handle, display name, and URL." (interactive "sSearch mastodon for: ") (let* ((url (mastodon-http--api "accounts/search")) - (response (if (equal mastodon-toot--enable-completion-for-mentions "following") + (response (if (equal mastodon-toot--completion-style-for-mentions "following") (mastodon-http--get-search-json url query "following=true") (mastodon-http--get-search-json url query)))) (mapcar #'mastodon-search--get-user-info-@ response))) diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index b3de461..b33350d 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -103,13 +103,19 @@ followers-only), or \"direct\"." :group 'mastodon-toot :type 'integer) -(defcustom mastodon-toot--enable-completion-for-mentions - (if (require 'company nil :noerror) "following" "off") - "Whether to enable company completion for mentions. +(defcustom mastodon-toot--enable-completion + (if (require 'company nil :noerror) t nil) + "Whether to enable completion of mentions and hashtags. Used for completion in toot compose buffer. This is only used if company mode is installed." + :group 'mastodon-toot + :type 'boolean) + +(defcustom mastodon-toot--completion-style-for-mentions + (if (require 'company nil :noerror) "following" "off") + "The company completion style to use for mentions." :group 'mastodon-toot :type '(choice (const :tag "off" nil) -- cgit v1.2.3 From 3715823cce66553bc2d51f1431202d014439572b Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 27 Aug 2022 08:44:55 +0200 Subject: autoloads, flycheck --- lisp/mastodon-notifications.el | 5 ++++- lisp/mastodon-profile.el | 4 ++-- lisp/mastodon-search.el | 2 +- lisp/mastodon.el | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) (limited to 'lisp/mastodon-search.el') diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 5de7354..89532c7 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -48,6 +48,7 @@ (autoload 'mastodon-tl--spoiler "mastodon-tl.el") (autoload 'mastodon-tl--toot-id "mastodon-tl.el") (autoload 'mastodon-http--get-params-async-json "mastodon-http.el") +(autoload 'mastodon-profile--view-follow-requests "mastodon-profile.el") (defvar mastodon-tl--buffer-spec) (defvar mastodon-tl--display-media-p) (defvar mastodon-tl--buffer-spec) @@ -219,7 +220,9 @@ Status notifications are given when (equal type 'boost)) status)))) -(defun mastodon-notifications--insert-status (toot body author-byline action-byline id &optional parent-toot) +(defun mastodon-notifications--insert-status (toot body + author-byline action-byline id + &optional parent-toot) "Display the content and byline of timeline element TOOT. BODY will form the section of the toot above the byline. diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index ae244d8..8ae5ace 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -65,7 +65,7 @@ (autoload 'mastodon-tl--goto-first-item "mastodon-tl") (autoload 'mastodon-toot "mastodon") (autoload 'mastodon-search--insert-users-propertized "mastodon-search") - +(autoload 'mastodon-tl--get-endpoint "mastodon-tl.el") (defvar mastodon-instance-url) (defvar mastodon-tl--buffer-spec) (defvar mastodon-tl--update-point) @@ -78,7 +78,7 @@ (let ((map (make-sparse-keymap))) (define-key map (kbd "s") #'mastodon-profile--open-followers) (define-key map (kbd "g") #'mastodon-profile--open-following) - (define-key map (kbd "C-c C-c") #'mastodon-profile--account-view-cycle) + (define-key map (kbd "C-c C-c") #'mastodon-profile-account-view-cycle) map) "Keymap for `mastodon-profile-mode'.") diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 89df311..b9dcb18 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -40,7 +40,7 @@ (autoload 'mastodon-auth--access-token "mastodon-auth") (autoload 'mastodon-http--get-search-json "mastodon-http") (autoload 'mastodon-http--api "mastodon-http") - +(defvar mastodon-toot--completion-style-for-mentions) (defvar mastodon-instance-url) (defvar mastodon-tl--link-keymap) (defvar mastodon-http--timeout) diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 49abe26..632f5c5 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -88,7 +88,8 @@ (autoload 'mastodon-profile--view-bookmarks "mastodon-profile") (autoload 'mastoton-tl--view-filters "mastodon-tl") ;; (autoload 'mastodon-toot--bookmark-toot-toggle "mastodon-toot") - +(autoload 'mastodon-tl--view-filters "mastodon-tl") +(autoload 'mastodon-tl--get-follow-suggestions "mastodon-tl") (when (require 'lingva nil :no-error) (autoload 'mastodon-toot--translate-toot-text "mastodon-toot")) -- cgit v1.2.3 From c2a48ac4bd0b75adbb525600dca93ad6636177c3 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sun, 31 Jul 2022 22:54:30 +0200 Subject: bump version in boilerplate --- lisp/mastodon-async.el | 2 +- lisp/mastodon-auth.el | 2 +- lisp/mastodon-client.el | 2 +- lisp/mastodon-discover.el | 2 +- lisp/mastodon-http.el | 2 +- lisp/mastodon-inspect.el | 2 +- lisp/mastodon-media.el | 2 +- lisp/mastodon-notifications.el | 2 +- lisp/mastodon-profile.el | 4 ++-- lisp/mastodon-search.el | 2 +- lisp/mastodon-tl.el | 2 +- lisp/mastodon-toot.el | 2 +- lisp/mastodon.el | 6 +++--- 13 files changed, 16 insertions(+), 16 deletions(-) (limited to 'lisp/mastodon-search.el') diff --git a/lisp/mastodon-async.el b/lisp/mastodon-async.el index 86547a1..8a08416 100644 --- a/lisp/mastodon-async.el +++ b/lisp/mastodon-async.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017 Alex J. Griffith ;; Author: Alex J. Griffith ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index 2f333b7..02799bf 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -4,7 +4,7 @@ ;; Copyright (C) 2021 Abhiseck Paira ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-client.el b/lisp/mastodon-client.el index 4fc8db7..f1dcd4f 100644 --- a/lisp/mastodon-client.el +++ b/lisp/mastodon-client.el @@ -4,7 +4,7 @@ ;; Copyright (C) 2021 Abhiseck Paira ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-discover.el b/lisp/mastodon-discover.el index a63d500..20ed092 100644 --- a/lisp/mastodon-discover.el +++ b/lisp/mastodon-discover.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2019 Johnson Denen ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index ec3b5e6..49b2375 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1") (request "0.3.0")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-inspect.el b/lisp/mastodon-inspect.el index 15ee7ce..cbf6a8e 100644 --- a/lisp/mastodon-inspect.el +++ b/lisp/mastodon-inspect.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index e5a1111..ace15b2 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 89532c7..0d11fb4 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index c589f53..4b541fd 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -3,8 +3,8 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 -;; Package-Requires: ((emacs "27.1") +;; Version: 1.0.0 +;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index b9dcb18..8d450e3 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2017-2019 Marty Hiatt ;; Author: Marty Hiatt ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 4e2a8ba..45e7282 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -4,7 +4,7 @@ ;; Author: Johnson Denen ;; Marty Hiatt ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 9abbb62..be3aaad 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -4,7 +4,7 @@ ;; Author: Johnson Denen ;; Marty Hiatt ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 4373ef2..9400014 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -4,7 +4,7 @@ ;; Copyright (C) 2021 Abhiseck Paira ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 0.10.0 +;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1") (request "0.3.0")) ;; Homepage: https://codeberg.org/martianh/mastodon.el @@ -28,8 +28,8 @@ ;;; Commentary: ;; mastodon.el is an Emacs client for Mastodon , -;; the federated microblogging social network. It is very much a work-in-progress, but -;; it is a labor of love. +;; the federated microblogging social network. It also works with Pleroma instances. +;; see the readme file at https://codeberg.org/martianh/mastodon.el for set up and usage details. ;;; Code: (require 'cl-lib) ; for `cl-some' call in mastodon -- cgit v1.2.3