diff options
author | H Durer <h.duerer@gmail.com> | 2018-03-30 04:59:34 +0100 |
---|---|---|
committer | Johnson Denen <johnson.denen@gmail.com> | 2018-08-10 22:20:04 -0400 |
commit | 4eaab0252c154ba4651125b7984d36a7474179ff (patch) | |
tree | f8a06b0e9fd946858f39b47042d7b111dace9082 /lisp/mastodon-tl.el | |
parent | 87cb71a718a5877492f958d1966d13150673e8fa (diff) |
More profile work (#193)
* Add an alternative approach to user profile opening.
This way asks the user in the minibuffer for the handle and offering completion for all user handles in the current status but allowing the user to also enter any other handle to browse whichever account they wish.
This also cleans up some compiler warnings about profile code.
* Create a new minor mode for mastodon profile pages. There we override the 'f' and 'F' keys to show following and followers respectively.
Those pages now look very similar to the regular profile page (with a header).
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r-- | lisp/mastodon-tl.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 5411d42..61a0f1e 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -39,6 +39,9 @@ (autoload 'mastodon-media--get-media-link-rendering "mastodon-media") (autoload 'mastodon-media--inline-images "mastodon-media") (autoload 'mastodon-mode "mastodon") +(autoload 'mastodon-profile--account-from-id "mastodon.el-profile.el") +(autoload 'mastodon-profile--make-author-buffer "mastodon-profile.el") +(autoload 'mastodon-profile--search-account-by-handle "mastodon.el-profile.el") (defvar mastodon-instance-url) (defvar mastodon-toot-timestamp-format) (defvar shr-use-fonts) ;; need to declare it since Emacs24 didn't have this @@ -72,11 +75,11 @@ width fonts when rendering HTML text")) (image-type-available-p 'imagemagick) "A boolean value stating whether to show avatars in timelines.") -(defvar mastodon-tl-update-point nil +(defvar mastodon-tl--update-point nil "When updating a mastodon buffer this is where new toots will be inserted. If nil `(point-min)' is used instead.") -(make-variable-buffer-local 'mastodon-tl-update-point) +(make-variable-buffer-local 'mastodon-tl--update-point) (defvar mastodon-tl--display-media-p t "A boolean value stating whether to show media in timelines.") @@ -251,7 +254,7 @@ Optionally start from POS." 'mouse-face 'highlight ;; TODO: Replace url browsing with native profile viewing 'mastodon-tab-stop 'user-handle - 'account (cdr (assoc 'account toot)) + 'account account 'shr-url profile-url 'keymap mastodon-tl--link-keymap 'mastodon-handle (concat "@" handle) @@ -941,7 +944,7 @@ from the start if it is nil." (json (mastodon-tl--updated-json endpoint id))) (when json (let ((inhibit-read-only t)) - (goto-char (or mastodon-tl-update-point (point-min))) + (goto-char (or mastodon-tl--update-point (point-min))) (funcall update-function json))))) (defun mastodon-tl--init (buffer-name endpoint update-function) |