|
4 | 4 |
|
5 | 5 | ;; telegram client for emacs
|
6 | 6 | (use-package! telega
|
7 |
| - :commands (telega) |
8 | 7 | :defer t
|
9 |
| - :bind ("C-M-S-s-t" . #'telega) |
10 | 8 | :custom
|
11 | 9 | ;; (telega-proxies (list '(:server "127.0.0.1" :port 1086 :enable t
|
12 | 10 | ;; :type (:@type "proxyTypeSocks5"))))
|
13 |
| - (telega-chat-reply-prompt "<<< ") |
14 |
| - (telega-chat-edit-prompt "+++ ") |
| 11 | + (telega-open-file-function 'org-open-file) |
| 12 | + (telega-chat-input-prompt '((prompt . ">>> ") |
| 13 | + (reply . "<<< ") |
| 14 | + (edit . "+++ "))) |
| 15 | + (telega-chat-input-anonymous-prompt '((prompt . "Anonymous>>> ") |
| 16 | + (reply . "Anonymous<<< ") |
| 17 | + (edit . "Anonymous+++ "))) |
| 18 | + (telega-chat-input-comment-prompt '((prompt . "Comment>>> ") |
| 19 | + (reply . "Comment<<< ") |
| 20 | + (edit . "Comment+++ "))) |
15 | 21 | (telega-sticker-size '(8 . 48))
|
16 |
| - (telega-chat-use-markdown-version nil) |
17 | 22 | (telega-animation-play-inline t)
|
18 | 23 | (telega-emoji-use-images nil)
|
19 | 24 | (telega-sticker-set-download t)
|
20 |
| - ;; (telega-use-tracking-for '(or pin (label "⌘"))) |
21 | 25 | (telega-chat-show-deleted-messages-for '(all))
|
| 26 | + |
22 | 27 | :init
|
23 | 28 | (setq telega-use-images (or (display-graphic-p) (daemonp)))
|
24 |
| - |
| 29 | + (define-key global-map (kbd "C-c t") telega-prefix-map) |
| 30 | + (which-key-add-keymap-based-replacements global-map |
| 31 | + (kbd "C-c t") '("telega")) |
25 | 32 | (when (featurep! :completion ivy)
|
26 | 33 | (load! "+ivy-telega"))
|
27 | 34 |
|
28 | 35 | :hook
|
29 | 36 | (telega-chat-mode . yas-minor-mode-on)
|
30 |
| - (telega-chat-mode . visual-line-mode) |
| 37 | + ;; (telega-chat-mode . visual-line-mode) |
31 | 38 | (telega-chat-mode . (lambda ()
|
32 | 39 | (set-company-backend! 'telega-chat-mode
|
33 | 40 | (append '(telega-company-emoji
|
34 | 41 | telega-company-username
|
35 | 42 | telega-company-hashtag)
|
36 | 43 | (when (telega-chat-bot-p telega-chatbuf--chat)
|
37 | 44 | '(telega-company-botcmd))))))
|
38 |
| - (telega-chat-pre-message . telega-msg-ignore-blocked-sender) |
| 45 | + ;(telega-chat-pre-message . telega-msg-ignore-blocked-sender) |
| 46 | + (telega-load . telega-mode-line-mode) |
| 47 | + (telega-load . global-telega-url-shorten-mode) |
| 48 | + (telega-load . global-telega-mnz-mode) |
| 49 | + |
39 | 50 | :config
|
| 51 | + (setq telega-mode-line-string-format |
| 52 | + (cl-remove '(:eval (telega-mode-line-icon)) |
| 53 | + telega-mode-line-string-format |
| 54 | + :test #'equal)) |
| 55 | + (add-hook 'telega-msg-ignore-predicates 'telega-msg-from-blocked-sender-p) |
40 | 56 |
|
41 |
| - (when (featurep! +auto-method) |
42 |
| - (load! "+telega-auto-method")) |
| 57 | + (when (featurep! +auto-im) |
| 58 | + (load! "+telega-auto-im")) |
43 | 59 |
|
44 |
| - ; (set-evil-initial-state! '(telega-root-mode telega-chat-mode) 'emacs) |
| 60 | + ; (set-evil-initial-state! '(telega-root-mode telega-chat-mode) 'emacs) |
45 | 61 | (when (featurep! :editor evil)
|
46 | 62 | (map!
|
47 | 63 | (:map telega-msg-button-map
|
48 |
| - "J" #'telega-button-forward |
49 |
| - "k" nil |
50 |
| - "K" #'telega-button-backward |
51 |
| - "p" #'telega-msg-redisplay |
52 |
| - "l" nil)) |
| 64 | + "J" #'telega-button-forward |
| 65 | + "k" nil |
| 66 | + "K" #'telega-button-backward |
| 67 | + "p" #'telega-msg-redisplay |
| 68 | + "l" nil)) |
53 | 69 | (map!
|
54 | 70 | :map telega-chat-button-map
|
55 |
| - "h" nil)) |
| 71 | + "h" nil)) |
56 | 72 |
|
57 | 73 | ;; use RET to add newline and C-RET to send
|
58 | 74 | (when (featurep! :config default)
|
59 | 75 | (map! :map telega-chat-mode-map
|
60 |
| - "RET" #'+default/newline-below |
61 |
| - "<C-return>" #'telega-chatbuf-input-send)) |
62 |
| - |
63 |
| - (pushnew! telega-known-inline-bots |
64 |
| - "@vid" "@bing" "@wiki" "@imdb") |
| 76 | + "C-c C-t" #'telega-chatbuf-attach-sticker |
| 77 | + "RET" nil |
| 78 | + "<C-return>" #'telega-chatbuf-input-send)) |
65 | 79 |
|
66 | 80 | (set-popup-rule! (regexp-quote telega-root-buffer-name)
|
67 | 81 | :ignore t)
|
68 | 82 | ;; (set-popup-rule! "^◀[^◀\[]*[\[({<].+[\])}>]"
|
69 | 83 | ;; :side 'right :size 100 :select t :ttl 300 :quit nil :modeline t)
|
70 | 84 |
|
71 |
| - (telega-mode-line-mode 1) |
72 |
| - (telega-url-shorten-mode 1) |
73 | 85 | (when (and IS-LINUX (boundp 'dbus-runtime-version))
|
74 | 86 | (telega-notifications-mode 1))
|
75 | 87 |
|
|
84 | 96 | :heigt 1.0
|
85 | 97 | :v-adjust -0.2
|
86 | 98 | :face all-the-icons-blue)))
|
| 99 | + (use-package! telega-stories |
| 100 | + :config |
| 101 | + (telega-stories-mode 1) |
| 102 | + (map! :map telega-root-mode-map "v e" 'telega-view-emacs-stories)) |
| 103 | + |
87 | 104 | (load! "+telega-addition"))
|
88 |
| - ;; (advice-add 'telega-root--killed :around (lambda ()))) |
89 |
| - ;; (when (daemonp) |
90 |
| - ;; (telega nil))) |
|
0 commit comments