Close emacs when view/mode is closed

This commit is contained in:
2025-09-09 07:32:07 +02:00
parent 7cc80e8cf4
commit 8567e48c4c
5 changed files with 66 additions and 2 deletions

View File

@@ -3,4 +3,13 @@
EMACS_NO_DESKTOP=1 emacs -nw --eval "(progn
(when (fboundp 'portfolio-tracker)
;; Quit Emacs when portfolio tracker buffer is killed
(add-hook 'tabulated-list-mode-hook
(lambda ()
(when (string-match-p \"\\*Portfolio Tracker\\*\" (buffer-name))
(add-hook 'kill-buffer-hook
(lambda ()
(when (string-match-p \"\\*Portfolio Tracker\\*\" (buffer-name))
(kill-emacs)))
nil t))))
(portfolio-tracker)))"