From a4f823a5f7c10ca60d53bcdf3d5814cecd8a135c Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Thu, 18 Jan 2024 12:16:05 +0300 Subject: [PATCH] emacs: update telega.el --- .emacs.d/init.el | 17 +++++++++++++---- Emacs.org | 17 +++++++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 9f0b04d..73bd9f1 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -548,8 +548,10 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." :straight t :commands (visual-fill-column-mode) :config - (add-hook 'visual-fill-column-mode-hook - (lambda () (setq visual-fill-column-center-text t)))) + ;; How did it get here? + ;; (add-hook 'visual-fill-column-mode-hook + ;; (lambda () (setq visual-fill-column-center-text t))) + ) (use-package accent :straight t @@ -850,6 +852,10 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." :config (setq wakatime-ignore-exit-codes '(0 1 102 112)) (advice-add 'wakatime-init :after (lambda () (setq wakatime-cli-path (expand-file-name "~/bin/wakatime-cli")))) + (when (file-exists-p "~/.wakatime.cfg") + (setq wakatime-api-key + (string-trim + (shell-command-to-string "awk '/api-key/{print $NF}' ~/.wakatime.cfg")))) ;; (setq wakatime-cli-path (executable-find "wakatime")) (global-wakatime-mode)) @@ -7303,6 +7309,7 @@ base toot." :background (my/color-value 'fg))) :config (setq telega-emoji-use-images nil) + (setq telega-chat-fill-column 80) (general-define-key :keymaps '(telega-root-mode-map telega-chat-mode-map) :states '(normal) @@ -7342,13 +7349,15 @@ base toot." (defun my/telega-chat-setup () (set (make-local-variable 'company-backends) - (append (list telega-emoji-company-backend + (append (list 'telega-company-emoji 'telega-company-username 'telega-company-hashtag 'telega-company-markdown-precode) (when (telega-chat-bot-p telega-chatbuf--chat) '(telega-company-botcmd)))) - (company-mode 1)) + (company-mode 1) + (setopt visual-fill-column-width + (+ telega-chat-fill-column 4))) (add-hook 'telega-chat-mode-hook #'my/telega-chat-setup) (defun my/telega-online-status () diff --git a/Emacs.org b/Emacs.org index 54bf8b7..bdfa1a2 100644 --- a/Emacs.org +++ b/Emacs.org @@ -986,8 +986,10 @@ References: :straight t :commands (visual-fill-column-mode) :config - (add-hook 'visual-fill-column-mode-hook - (lambda () (setq visual-fill-column-center-text t)))) + ;; How did it get here? + ;; (add-hook 'visual-fill-column-mode-hook + ;; (lambda () (setq visual-fill-column-center-text t))) + ) #+end_src **** Accents Input accented characters. @@ -1410,6 +1412,10 @@ Before I figure out how to package this for Guix: :config (setq wakatime-ignore-exit-codes '(0 1 102 112)) (advice-add 'wakatime-init :after (lambda () (setq wakatime-cli-path (expand-file-name "~/bin/wakatime-cli")))) + (when (file-exists-p "~/.wakatime.cfg") + (setq wakatime-api-key + (string-trim + (shell-command-to-string "awk '/api-key/{print $NF}' ~/.wakatime.cfg")))) ;; (setq wakatime-cli-path (executable-find "wakatime")) (global-wakatime-mode)) #+end_src @@ -10054,6 +10060,7 @@ Or you can load up Element for a moment to see what the mention was, if that's e :background (my/color-value 'fg))) :config (setq telega-emoji-use-images nil) + (setq telega-chat-fill-column 80) (general-define-key :keymaps '(telega-root-mode-map telega-chat-mode-map) :states '(normal) @@ -10102,13 +10109,15 @@ Configuring company backends for the chat buffer, as recommended in the manual: #+begin_src emacs-lisp (defun my/telega-chat-setup () (set (make-local-variable 'company-backends) - (append (list telega-emoji-company-backend + (append (list 'telega-company-emoji 'telega-company-username 'telega-company-hashtag 'telega-company-markdown-precode) (when (telega-chat-bot-p telega-chatbuf--chat) '(telega-company-botcmd)))) - (company-mode 1)) + (company-mode 1) + (setopt visual-fill-column-width + (+ telega-chat-fill-column 4))) (add-hook 'telega-chat-mode-hook #'my/telega-chat-setup) #+end_src