buffer kill hook: check process live before kill

This commit is contained in:
TEC 2022-05-01 22:31:47 +08:00
parent 83e78f8b1b
commit f9b3de4d9c
Signed by: tec
GPG Key ID: 779591AFDB81F06C
1 changed files with 4 additions and 1 deletions

View File

@ -387,7 +387,10 @@ This mode locally removes any `spell-fu-mode' or `flyspell-mode' entries in
Consider resolving any edge cases with an addition to `lexic-mode-hook'."
(setq buffer-read-only t)
(add-hook 'kill-buffer-hook
(lambda () (kill-process (get-process lexic-process-name)))
(lambda ()
(let ((proc (get-process lexic-process-name)))
(when (process-live-p proc)
(kill-process proc))))
nil t)
(setq-local outline-regexp "\u200B+")
(setq-local outline-heading-end-regexp "\u2008")