From 534644d2bd6a0a14b89d7bdacc41d305fcf265b6 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 5 Jul 2024 17:11:21 +0200 Subject: toot: default to emoji.el, emojify customize mastodon-use-emojify customize --- lisp/mastodon-toot.el | 16 +++++++--------- lisp/mastodon.el | 8 +++++++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index e934352..ecee301 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -31,6 +31,8 @@ ;;; Code: (eval-when-compile (require 'subr-x)) + +(defvar mastodon-use-emojify) (require 'emojify nil :noerror) (declare-function emojify-insert-emoji "emojify") (declare-function emojify-set-emoji-data "emojify") @@ -158,11 +160,6 @@ If the original toot visibility is different we use the more restricted one." "Whether to enable your instance's custom emoji by default." :type 'boolean) -(defcustom mastodon-toot--emojify-in-compose-buffer t - "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 "Nonnil to enable using proportional fonts in the compose buffer. By default fixed width fonts are used." @@ -285,8 +282,7 @@ Includes boosts, and notifications that display toots." (define-key map (kbd "C-c C-w") #'mastodon-toot--toggle-warning) (define-key map (kbd "C-c C-n") #'mastodon-toot--toggle-nsfw) (define-key map (kbd "C-c C-v") #'mastodon-toot--change-visibility) - (when (require 'emojify nil :noerror) - (define-key map (kbd "C-c C-e") #'mastodon-toot--insert-emoji)) + (define-key map (kbd "C-c C-e") #'mastodon-toot--insert-emoji) (define-key map (kbd "C-c C-a") #'mastodon-toot--attach-media) (define-key map (kbd "C-c !") #'mastodon-toot--clear-all-attachments) (define-key map (kbd "C-c C-p") #'mastodon-toot--create-poll) @@ -764,7 +760,9 @@ TEXT-ONLY means don't check for attachments or polls." ;;; EMOJIS (defalias 'mastodon-toot--insert-emoji - #'emojify-insert-emoji + (if mastodon-use-emojify + #'emojify-insert-emoji + #'emoji-search) "Prompt to insert an emoji.") (defun mastodon-toot--emoji-dir () @@ -2022,7 +2020,7 @@ 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 (and mastodon-toot--emojify-in-compose-buffer + (when (and mastodon-use-emojify ;; emojify loaded but poss not enabled in our buffer: (boundp 'emojify-mode)) (emojify-mode)) diff --git a/lisp/mastodon.el b/lisp/mastodon.el index d0dddee..73a8665 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -144,6 +144,11 @@ The default value \"%F %T\" prints ISO8601-style YYYY-mm-dd HH:MM:SS. Use. e.g. \"%c\" for your locale's date and time format." :type 'string) +(defcustom mastodon-use-emojify nil + "Whether to use emojify.el to display emojis. +From version 28, Emacs can display emojis natively. But +currently, it doesn't seem to have a way to handle custom emoji, +while emojify,el has this feature and mastodon.el implements it.") (defun mastodon-kill-window () "Quit window and delete helper." @@ -464,7 +469,8 @@ Calls `mastodon-tl--get-buffer-type', which see." (defun mastodon-mode-hook-fun () "Function to add to `mastodon-mode-hook'." - (when (require 'emojify nil :noerror) + (when (and mastodon-use-emojify + (require 'emojify nil :noerror)) (emojify-mode t) (when mastodon-toot--enable-custom-instance-emoji (mastodon-toot--enable-custom-emoji))) -- cgit v1.2.3 From 82931c0869387c3567e4b5e2f6383c980f73748c Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 5 Jul 2024 17:38:57 +0200 Subject: readme, emoji --- README.org | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/README.org b/README.org index 53cb508..48ee979 100644 --- a/README.org +++ b/README.org @@ -65,8 +65,7 @@ it shouldn't be very hard to get it working. *** Emoji -=mastodon-mode= will enable [[https://github.com/iqbalansari/emacs-emojify][Emojify]] if it is loaded in your Emacs environment, so -there's no need to write your own hook anymore. =emojify-mode= is not required. +Since Emacs 28, it has builtin emoji support with =emoji.el=. If you prefer to use [[https://github.com/iqbalansari/emacs-emojify][Emojify]], =require= it and set =mastodon-use-emojify= to non-nil to display emoji in timelines and to use it when composing toots. =Emoji.el= is the better option, but for now only =emojify= supports downloading and using custom emoji from your instance. *** Discover @@ -242,21 +241,21 @@ value of that hook is as follows: **** Keybindings -|----------+----------------------------------| -| Key | Action | -|----------+----------------------------------| -| =C-c C-c= | Send toot | -| =C-c C-k= | Cancel toot | -| =C-c C-w= | Add content warning | -| =C-c C-v= | Change toot visibility | -| =C-c C-n= | Add sensitive media/nsfw flag | -| =C-c C-a= | Upload attachment(s) | -| =C-c != | Remove all attachments | -| =C-c C-e= | Add emoji (if =emojify= installed) | -| =C-c C-p= | Create a poll | -| =C-c C-l= | Set toot language | -| =-C-c C-s= | Schedule toot | -|----------+----------------------------------| +|----------+-------------------------------| +| Key | Action | +|----------+-------------------------------| +| =C-c C-c= | Send toot | +| =C-c C-k= | Cancel toot | +| =C-c C-w= | Add content warning | +| =C-c C-v= | Change toot visibility | +| =C-c C-n= | Add sensitive media/nsfw flag | +| =C-c C-a= | Upload attachment(s) | +| =C-c != | Remove all attachments | +| =C-c C-e= | Insert emoji | +| =C-c C-p= | Create a poll | +| =C-c C-l= | Set toot language | +| =-C-c C-s= | Schedule toot | +|----------+-------------------------------| **** Autocompletion of mentions, tags and emoji @@ -265,7 +264,7 @@ Autocompletion of mentions, tags, and emojis is provided by =mastodon-toot--enable-completion= is enabled by default. To trigger completion, type a prefix followed by a few letters, =@= for -mentions, =#= for tags, and =:= for emoji. +mentions, =#= for tags, and =:= for emoji (for now this only works when using =emojify.el=). If you want to enable =company-mode= in the toot compose buffer, set =mastodon-toot--use-company-for-completion= to =t=. (=mastodon.el= used to run its @@ -424,7 +423,7 @@ Hard dependencies (should all install with =mastodon.el=): - =persist= for storing some settings across sessions Optional dependencies (install yourself, =mastodon.el= can use them): -- =emojify= for inserting and viewing emojis +- =emojify= to use custom emoji (else we use builtin =emoji.el=) - =mpv= and =mpv.el= for viewing videos and gifs - =lingva.el= for translating toots -- cgit v1.2.3 From 8df12b88088bb2b7072ea364fd2b0bdf74acd14a Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 6 Jul 2024 17:16:35 +0200 Subject: update info --- mastodon.info | 113 +++++++++++++++++++++++++++++++++++----------------------- mastodon.texi | 28 ++++++++++----- 2 files changed, 87 insertions(+), 54 deletions(-) diff --git a/mastodon.info b/mastodon.info index e300abe..1689c1d 100644 --- a/mastodon.info +++ b/mastodon.info @@ -24,6 +24,7 @@ README * Contributing:: * Supporting ‘mastodon.el’: Supporting mastodonel. * Contributors:: +* screenshots:: Installation @@ -76,6 +77,7 @@ have it installed you should be able to browse this readme inside emacs. * Contributing:: * Supporting ‘mastodon.el’: Supporting mastodonel. * Contributors:: +* screenshots::  File: mastodon.info, Node: Installation, Next: Usage, Up: README @@ -150,10 +152,12 @@ File: mastodon.info, Node: Emoji, Next: Discover, Prev: Repo, Up: Installati 1.1.4 Emoji ----------- -‘mastodon-mode’ will enable Emojify -(https://github.com/iqbalansari/emacs-emojify) if it is loaded in your -Emacs environment, so there’s no need to write your own hook anymore. -‘emojify-mode’ is not required. +Since Emacs 28, it has builtin emoji support with ‘emoji.el’. If you +prefer to use Emojify (https://github.com/iqbalansari/emacs-emojify), +‘require’ it and set ‘mastodon-use-emojify’ to non-nil to display emoji +in timelines and to use it when composing toots. ‘Emoji.el’ is the +better option, but for now only ‘emojify’ supports downloading and using +custom emoji from your instance.  File: mastodon.info, Node: Discover, Prev: Emoji, Up: Installation @@ -361,7 +365,7 @@ is as follows: 1. Keybindings Key Action - -------------------------------------------------- + --------------------------------------------- ‘C-c C-c’ Send toot ‘C-c C-k’ Cancel toot ‘C-c C-w’ Add content warning @@ -369,7 +373,7 @@ is as follows: ‘C-c C-n’ Add sensitive media/nsfw flag ‘C-c C-a’ Upload attachment(s) ‘C-c !’ Remove all attachments - ‘C-c C-e’ Add emoji (if ‘emojify’ installed) + ‘C-c C-e’ Insert emoji ‘C-c C-p’ Create a poll ‘C-c C-l’ Set toot language ‘-C-c C-s’ Schedule toot @@ -381,7 +385,8 @@ is as follows: ‘mastodon-toot--enable-completion’ is enabled by default. To trigger completion, type a prefix followed by a few letters, ‘@’ - for mentions, ‘#’ for tags, and ‘:’ for emoji. + for mentions, ‘#’ for tags, and ‘:’ for emoji (for now this only + works when using ‘emojify.el’). If you want to enable ‘company-mode’ in the toot compose buffer, set ‘mastodon-toot--use-company-for-completion’ to ‘t’. @@ -574,11 +579,12 @@ File: mastodon.info, Node: Bookmarks and mastodonel, Prev: Translating toots, 1.2.10 Bookmarks and ‘mastodon.el’ ---------------------------------- -‘mastodon.el’ doesn’t currently implement its own bookmark record and -handler, which means that emacs bookmarks will not work as is. Until we -implement them, you can get bookmarks going immediately by using -bookmark+.el -(https://github.com/emacsmirror/emacswiki.org/blob/master/bookmark%2b.el). +‘mastodon.el’ implements a basic bookmark record and handler. +Currently, this means that you can bookmark a post item and later load +it in thread view. This could be expanded to any item with an id, but +probably not to things like timeline views. If you want to be able to +bookmark something, open an issue and ask, it’s trivial to expand the +bookmarking code.  File: mastodon.info, Node: Dependencies, Next: Network compatibility, Prev: Usage, Up: README @@ -592,7 +598,7 @@ Hard dependencies (should all install with ‘mastodon.el’): • ‘persist’ for storing some settings across sessions Optional dependencies (install yourself, ‘mastodon.el’ can use them): - • ‘emojify’ for inserting and viewing emojis + • ‘emojify’ to use custom emoji (else we use builtin ‘emoji.el’) • ‘mpv’ and ‘mpv.el’ for viewing videos and gifs • ‘lingva.el’ for translating toots @@ -701,7 +707,7 @@ I can provide IBAN or other bank account details. out.  -File: mastodon.info, Node: Contributors, Prev: Supporting mastodonel, Up: README +File: mastodon.info, Node: Contributors, Next: screenshots, Prev: Supporting mastodonel, Up: README 1.7 Contributors ================ @@ -716,41 +722,58 @@ File: mastodon.info, Node: Contributors, Prev: Supporting mastodonel, Up: REA • + +File: mastodon.info, Node: screenshots, Prev: Contributors, Up: README + +1.8 screenshots +=============== + +Here’s a (federated) timeline: + +[image src="screenshot-tl.png"] + + + Here’s a notifcations view plus a compose buffer: + +[image src="screenshot-notifs+compose.png"] + +  Tag Table: Node: Top210 -Node: README962 -Node: Installation1596 -Node: ELPA1885 -Node: MELPA2113 -Node: Repo2493 -Node: Emoji2986 -Node: Discover3317 -Node: Usage3869 -Node: Logging in to your instance4312 -Node: Timelines5309 -Ref: Keybindings5784 -Ref: Toot byline legend10558 -Node: Composing toots10867 -Ref: Keybindings (1)12419 -Ref: Autocompletion of mentions tags and emoji12985 -Ref: Draft toots13851 -Node: Other commands and account settings14322 -Node: Customization17489 -Node: Commands and variables index18367 -Node: Alternative timeline layout18883 -Node: Live-updating timelines mastodon-async-mode19288 -Node: Translating toots20140 -Node: Bookmarks and mastodonel21322 -Node: Dependencies21794 -Node: Network compatibility22404 -Node: Contributing23286 -Node: Bug reports23782 -Node: Fixes and features24693 -Node: Coding style25194 -Node: Supporting mastodonel25818 -Node: Contributors26385 +Node: README978 +Node: Installation1628 +Node: ELPA1917 +Node: MELPA2145 +Node: Repo2525 +Node: Emoji3018 +Node: Discover3536 +Node: Usage4088 +Node: Logging in to your instance4531 +Node: Timelines5528 +Ref: Keybindings6003 +Ref: Toot byline legend10777 +Node: Composing toots11086 +Ref: Keybindings (1)12638 +Ref: Autocompletion of mentions tags and emoji13173 +Ref: Draft toots14098 +Node: Other commands and account settings14569 +Node: Customization17736 +Node: Commands and variables index18614 +Node: Alternative timeline layout19130 +Node: Live-updating timelines mastodon-async-mode19535 +Node: Translating toots20387 +Node: Bookmarks and mastodonel21569 +Node: Dependencies22108 +Node: Network compatibility22742 +Node: Contributing23624 +Node: Bug reports24120 +Node: Fixes and features25031 +Node: Coding style25532 +Node: Supporting mastodonel26156 +Node: Contributors26723 +Node: screenshots27158  End Tag Table diff --git a/mastodon.texi b/mastodon.texi index 571a2d7..059435e 100644 --- a/mastodon.texi +++ b/mastodon.texi @@ -38,6 +38,7 @@ README * Contributing:: * Supporting @samp{mastodon.el}: Supporting @samp{mastodonel}. * Contributors:: +* screenshots:: Installation @@ -85,6 +86,7 @@ NB: @samp{mastodon.el} now ships this readme as an .info file, so if you have it * Contributing:: * Supporting @samp{mastodon.el}: Supporting @samp{mastodonel}. * Contributors:: +* screenshots:: @end menu @node Installation @@ -150,8 +152,7 @@ it shouldn't be very hard to get it working. @node Emoji @subsection Emoji -@samp{mastodon-mode} will enable @uref{https://github.com/iqbalansari/emacs-emojify, Emojify} if it is loaded in your Emacs environment, so -there's no need to write your own hook anymore. @samp{emojify-mode} is not required. +Since Emacs 28, it has builtin emoji support with @samp{emoji.el}. If you prefer to use @uref{https://github.com/iqbalansari/emacs-emojify, Emojify}, @samp{require} it and set @samp{mastodon-use-emojify} to non-nil to display emoji in timelines and to use it when composing toots. @samp{Emoji.el} is the better option, but for now only @samp{emojify} supports downloading and using custom emoji from your instance. @node Discover @subsection Discover @@ -418,7 +419,7 @@ value of that hook is as follows: @anchor{Keybindings (1)}Keybindings -@multitable {aaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} +@multitable {aaaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaa} @headitem Key @tab Action @item @samp{C-c C-c} @@ -436,7 +437,7 @@ value of that hook is as follows: @item @samp{C-c !} @tab Remove all attachments @item @samp{C-c C-e} -@tab Add emoji (if @samp{emojify} installed) +@tab Insert emoji @item @samp{C-c C-p} @tab Create a poll @item @samp{C-c C-l} @@ -454,7 +455,7 @@ Autocompletion of mentions, tags, and emojis is provided by @samp{mastodon-toot--enable-completion} is enabled by default. To trigger completion, type a prefix followed by a few letters, @samp{@@} for -mentions, @samp{#} for tags, and @samp{:} for emoji. +mentions, @samp{#} for tags, and @samp{:} for emoji (for now this only works when using @samp{emojify.el}). If you want to enable @samp{company-mode} in the toot compose buffer, set @samp{mastodon-toot--use-company-for-completion} to @samp{t}. (@samp{mastodon.el} used to run its @@ -690,9 +691,7 @@ to your translator function as its text argument. Here's what @node Bookmarks and @samp{mastodonel} @subsection Bookmarks and @samp{mastodon.el} -@samp{mastodon.el} doesn’t currently implement its own bookmark record and handler, -which means that emacs bookmarks will not work as is. Until we implement them, -you can get bookmarks going immediately by using @uref{https://github.com/emacsmirror/emacswiki.org/blob/master/bookmark%2b.el, bookmark+.el}. +@samp{mastodon.el} implements a basic bookmark record and handler. Currently, this means that you can bookmark a post item and later load it in thread view. This could be expanded to any item with an id, but probably not to things like timeline views. If you want to be able to bookmark something, open an issue and ask, it's trivial to expand the bookmarking code. @node Dependencies @section Dependencies @@ -708,7 +707,7 @@ Hard dependencies (should all install with @samp{mastodon.el}): Optional dependencies (install yourself, @samp{mastodon.el} can use them): @itemize @item -@samp{emojify} for inserting and viewing emojis +@samp{emojify} to use custom emoji (else we use builtin @samp{emoji.el}) @item @samp{mpv} and @samp{mpv.el} for viewing videos and gifs @item @@ -826,4 +825,15 @@ Some significant contributors are: @uref{https://codeberg.org/Red_Starfish} @end itemize +@node screenshots +@section screenshots + +Here's a (federated) timeline: + +@image{screenshot-tl,,,,png} + +Here's a notifcations view plus a compose buffer: + +@image{screenshot-notifs+compose,,,,png} + @bye \ No newline at end of file -- cgit v1.2.3 From 4d335d45f4c9f3ea90b0b54822225fb0d3c80e9b Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 6 Jul 2024 17:18:17 +0200 Subject: index --- mastodon-index.org | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mastodon-index.org b/mastodon-index.org index 4637403..949cd6d 100644 --- a/mastodon-index.org +++ b/mastodon-index.org @@ -110,7 +110,7 @@ | | mastodon-tl--do-link-action-at-point | Do the action of the link at POSITION. | | | mastodon-tl--enable-notify-user-posts | Query for USER-HANDLE and enable notifications when they post. | | | mastodon-tl--filter-user-user-posts-by-language | Query for USER-HANDLE and filter display of their posts by language. | -| | mastodon-tl--follow-tag | Prompt for a tag and follow it. | +| | mastodon-tl--follow-tag | Prompt for a tag (from post at point) and follow it. | | W | mastodon-tl--follow-user | Query for USER-HANDLE from current status and follow that user. | | | mastodon-tl--follow-user-disable-boosts | Prompt for a USER-HANDLE, and disable display of boosts in home timeline. | | | mastodon-tl--follow-user-enable-boosts | Prompt for a USER-HANDLE, and enable display of boosts in home timeline. | @@ -121,9 +121,7 @@ | \ | mastodon-tl--get-remote-local-timeline | Prompt for an instance domain and try to display its local timeline. | | # | mastodon-tl--get-tag-timeline | Prompt for tag and opens its timeline. | | n | mastodon-tl--goto-next-item | Jump to next item. | -| C- | mastodon-tl--goto-next-toot | | | p | mastodon-tl--goto-prev-item | Jump to previous item. | -| C- | mastodon-tl--goto-prev-toot | | | " | mastodon-tl--list-followed-tags | List followed tags. View timeline of tag user choses. | | C- | mastodon-tl--mpv-play-video-at-point | Play the video or gif at point with an mpv process. | | | mastodon-tl--mpv-play-video-from-byline | Run `mastodon-tl--mpv-play-video-at-point' on first moving image in post. | -- cgit v1.2.3 From aa6b7b25bef714fe88493d4c04327a61fba0bd53 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 8 Jul 2024 15:10:33 +0200 Subject: readme re tofu --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.org b/README.org index 48ee979..8a5fa08 100644 --- a/README.org +++ b/README.org @@ -65,7 +65,7 @@ it shouldn't be very hard to get it working. *** Emoji -Since Emacs 28, it has builtin emoji support with =emoji.el=. If you prefer to use [[https://github.com/iqbalansari/emacs-emojify][Emojify]], =require= it and set =mastodon-use-emojify= to non-nil to display emoji in timelines and to use it when composing toots. =Emoji.el= is the better option, but for now only =emojify= supports downloading and using custom emoji from your instance. +Since Emacs 28, it has builtin emoji support with =emoji.el=. If you prefer to use [[https://github.com/iqbalansari/emacs-emojify][Emojify]], =require= it and set =mastodon-use-emojify= to non-nil to display emoji in timelines and to use it when composing toots. =Emoji.el= is the better option, but for now only =emojify= supports downloading and using custom emoji from your instance. From personal experience, =emojify= also tends to result in less TOFU. *** Discover -- cgit v1.2.3