about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-08-26T10·47+0100
committertazjin <mail@tazj.in>2020-08-26T11·15+0000
commitdec32be0d749098047e0fbaacbffeda0b15a8ee4 (patch)
treedb6ba29b777f99a8f2d15976ce20f210db9064b2
parenta9650041bb73366d9be73bcbe34faf8694f9aa2c (diff)
fix(tazjin/emacs): Override vterm's internal title generator r/1712
This used to be part of the public interface, but was removed and
replaced with a (less useful) format string.

Change-Id: I387557c20c2eddde16974c3fcad1712569db5325
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1841
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
-rw-r--r--users/tazjin/emacs/config/init.el19
1 files changed, 11 insertions, 8 deletions
diff --git a/users/tazjin/emacs/config/init.el b/users/tazjin/emacs/config/init.el
index 24719c8e450a..9f9573a3a8c7 100644
--- a/users/tazjin/emacs/config/init.el
+++ b/users/tazjin/emacs/config/init.el
@@ -165,14 +165,17 @@
   :config (progn
             (setq vterm-shell "fish")
             (setq vterm-exit-functions
-                  (lambda (&rest _) (kill-buffer (current-buffer))))
-            (setq vterm-set-title-functions
-                  (lambda (title)
-                    (rename-buffer
-                     (generate-new-buffer-name
-                      (format "vterm<%s>"
-                              (s-trim-left
-                               (s-chop-prefix "fish" title)))))))))
+                  (lambda (&rest _) (kill-buffer (current-buffer))))))
+
+;; vterm removed the ability to set a custom title generator function
+;; via the public API, so this overrides its private title generation
+;; function instead
+(defun vterm--set-title (title)
+  (rename-buffer
+   (generate-new-buffer-name
+    (format "vterm<%s>"
+            (s-trim-left
+             (s-chop-prefix "fish" title))))))
 
 ;;
 ;; Packages providing language-specific functionality