summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-13 16:06:38 -0500
committerCraig Jennings <c@cjennings.net>2026-05-13 16:06:38 -0500
commit8fc423d90eff78176fa538f2cf838cb671592e99 (patch)
tree072823a4400a76ece4d0204119be554c6535ef05
parentc3ec8508a8ff414d099d9e567eb5ffd43a9c93f2 (diff)
downloaddotemacs-8fc423d90eff78176fa538f2cf838cb671592e99.tar.gz
dotemacs-8fc423d90eff78176fa538f2cf838cb671592e99.zip
feat(telega): add telega.el module with docker-backed TDLib
New `modules/telega-config.el` configures telega.el as an in-Emacs Telegram client. `telega-use-docker' is on so TDLib runs in a container instead of needing a system-level build -- pairs with a follow-up `scripts/setup-telega.sh' for fresh-clone installs. First-run auth (phone + verification code) is interactive inside `M-x telega' and isn't scripted here. Launcher binding: `C-; G` (mnemonic: teleGram). `C-; t` and `C-; m t` were both taken (test-runner, music's "repeat track"), so the launcher landed on a free top-level letter. Two tests cover the wiring: module loads, launcher is bound.
-rw-r--r--init.el1
-rw-r--r--modules/telega-config.el41
-rw-r--r--tests/test-telega-config.el25
3 files changed, 67 insertions, 0 deletions
diff --git a/init.el b/init.el
index 33a7dc62..4c522362 100644
--- a/init.el
+++ b/init.el
@@ -71,6 +71,7 @@
(require 'diff-config) ;; diff and merge functionality w/in Emacs
(require 'erc-config) ;; seamless IRC client
(require 'slack-config) ;; slack client via emacs-slack
+(require 'telega-config) ;; telegram client via telega.el (TDLib in docker)
(require 'eshell-config) ;; emacs shell configuration
(require 'vterm-config) ;; vterm + F12 toggle + tmux history copy
(require 'ai-vterm) ;; in-Emacs Claude launcher (vertical-split vterm)
diff --git a/modules/telega-config.el b/modules/telega-config.el
new file mode 100644
index 00000000..aada717f
--- /dev/null
+++ b/modules/telega-config.el
@@ -0,0 +1,41 @@
+;;; telega-config.el --- Telega Telegram client config -*- lexical-binding: t; coding: utf-8; -*-
+;; author: Craig Jennings <c@cjennings.net>
+
+;;; Commentary:
+;;
+;; Configures telega.el (https://github.com/zevlg/telega.el) as an
+;; in-Emacs Telegram client.
+;;
+;; TDLib (Telegram Database Library) runs in a docker container via
+;; `telega-use-docker' so a fresh-clone install does not need a
+;; system-level TDLib build. =scripts/setup-telega.sh= prepares the
+;; container the first time; afterwards telega.el reattaches
+;; automatically.
+;;
+;; First-run auth (phone number + Telegram verification code) is
+;; interactive and happens inside `M-x telega'. This module does not
+;; script it.
+;;
+;; Launcher: =C-; G= (mnemonic: teleGram). Neither =C-; t= (test-runner
+;; menu) nor =C-; m t= (music "repeat track") were available, so the
+;; launcher lives at a free top-level letter rather than under a
+;; messaging sub-prefix.
+
+;;; Code:
+
+(require 'keybindings)
+
+(use-package telega
+ :defer t
+ :commands (telega)
+ :custom
+ (telega-use-docker t))
+
+(keymap-set cj/custom-keymap "G" #'telega)
+
+(with-eval-after-load 'which-key
+ (which-key-add-key-based-replacements
+ "C-; G" "telegram (telega)"))
+
+(provide 'telega-config)
+;;; telega-config.el ends here
diff --git a/tests/test-telega-config.el b/tests/test-telega-config.el
new file mode 100644
index 00000000..ace96555
--- /dev/null
+++ b/tests/test-telega-config.el
@@ -0,0 +1,25 @@
+;;; test-telega-config.el --- Tests for Telegram (telega) module wiring -*- lexical-binding: t; -*-
+
+;;; Commentary:
+;; Lightweight asserts that the module loads, exposes the launcher,
+;; sets the docker preference, and registers the C-; G keybinding.
+;; The bulk of telega.el's behaviour is owned upstream; the tests
+;; here only cover what this config wires.
+
+;;; Code:
+
+(require 'ert)
+
+(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory))
+(require 'telega-config)
+
+(ert-deftest test-telega-config-loads-cleanly ()
+ "Normal: module loads without errors and `provide's its feature."
+ (should (featurep 'telega-config)))
+
+(ert-deftest test-telega-config-launcher-binding-is-telega ()
+ "Normal: =C-; G= invokes `telega'."
+ (should (eq (keymap-lookup cj/custom-keymap "G") #'telega)))
+
+(provide 'test-telega-config)
+;;; test-telega-config.el ends here