Add the Emacspeak Telega integration module#558
Conversation
| (cl-declaim (optimize (safety 0) (speed 3))) | ||
| (require 'subr-x) | ||
| (require 'emacspeak-preamble) | ||
| (require 'telega-notifications) |
There was a problem hiding this comment.
Use (require 'telega), making every telega function available to the package
| (dtk-speak (emacspeak-telega--message-preview msg))))))) | ||
|
|
||
| ;;;###autoload | ||
| (defun emacspeak-telega-toggle-autospeak (&optional prefix) |
There was a problem hiding this comment.
It is better to utilize define-minor-mode to define local/global minor modes. See how it is done in the telega-squash-message-mode and global-telega-squash-message-mode.
| (if prefix "" "locally"))) | ||
|
|
||
| (add-hook 'telega-chat-post-message-hook | ||
| #'emacspeak-telega--autospeak-message) |
There was a problem hiding this comment.
Since you use with-telega-chatbuf in the emacspeak-telega--autospeak-message it is better to use telega-chatbuf-post-msg-insert-hook local hook, which is triggered after message is inserted in the existing chatbuf.
add-hook has local argument to install hook locally for the current buffer.
| (emacspeak-telega-setup-keys) | ||
|
|
||
| (with-eval-after-load 'telega-chat | ||
| (emacspeak-telega-setup-keys)) |
There was a problem hiding this comment.
This is not needed, since all top-level forms will be evaluated on the emacspeak-telega load. And telega-chat-mode-map will be available because you did (require 'telega) at the top.
Also, it is arguable that explicit binding to enable mode is needed. Better to leave this to user setup
This module aims to make Emacspeak --- the complete audio desktop seamlessly integrated with Telega.el. Currently the module allows to automatically read incoming messages (controlled per chat with
{C-c }or globally to all Telega chat buffers{C-u C-c }).