remove log window after compilation (typst-mode)

This commit is contained in:
Wayne H. Shephard 2026-01-07 23:36:33 +03:00
parent df350dd796
commit 6da244f167

View File

@ -8,6 +8,7 @@
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")) (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/"))
(package-initialize) (package-initialize)
(require 'auto-complete-config) (require 'auto-complete-config)
@ -65,7 +66,6 @@
(global-set-key (kbd "<M-up>") 'm-line-up) (global-set-key (kbd "<M-up>") 'm-line-up)
(global-set-key (kbd "<M-down>") 'm-line-down) (global-set-key (kbd "<M-down>") 'm-line-down)
;; Variables ;; Variables
(custom-set-variables (custom-set-variables
;; custom-set-variables was added by Custom. ;; custom-set-variables was added by Custom.
@ -162,3 +162,18 @@
(TeX-run-compile name command file) (TeX-run-compile name command file)
(TeX-process-set-variable file 'TeX-command-next TeX-command-default)) (TeX-process-set-variable file 'TeX-command-next TeX-command-default))
nil t :help "Create nomenclature file"))) nil t :help "Create nomenclature file")))
;; Helper for compilation. Close the compilation window if
;; there was no error at all.
(defun compilation-exit-autoclose (status code msg)
;; If M-x compile exists with a 0
(when (and (eq status 'exit) (zerop code))
;; then bury the *compilation* buffer, so that C-x b doesn't go there
(bury-buffer)
;; and delete the *compilation* window
(delete-window (get-buffer-window (get-buffer "*compilation*"))))
;; Always return the anticipated result of compilation-exit-message-function
(cons msg code))
;; Specify my function (maybe I should have done a lambda function)
(setq compilation-exit-message-function 'compilation-exit-autoclose)