diff --git a/fpga-utils.el b/fpga-utils.el index 68e339b..ae15f0a 100644 --- a/fpga-utils.el +++ b/fpga-utils.el @@ -150,7 +150,7 @@ BUF-NAME determines the name of the compilation buffer." `(define-compilation-mode ,name ,desc ,docstring (setq-local compilation-error-regexp-alist (mapcar #'car ,compile-re)) (setq-local compilation-error-regexp-alist-alist ,compile-re) - (rename-buffer ,buf-name) + (when ,buf-name (rename-buffer ,buf-name)) (setq truncate-lines t) (goto-char (point-max)))) @@ -166,7 +166,7 @@ COMP-MODE is the name of the compilation derived mode created by macro (declare (indent 1) (debug 1)) `(defun ,name (command) ,docstring - (when (get-buffer ,buf) + (when (and ,buf (get-buffer ,buf)) (if (y-or-n-p (format "Buffer %s is in use, kill its process and start new compilation?" ,buf)) (kill-buffer ,buf) (user-error "Aborted"))) @@ -231,7 +231,7 @@ FONT-LOCK-KWDS determine syntax highlighting for the shell mode." :global nil (setq-local compilation-error-regexp-alist (mapcar #'car ,compile-re)) (setq-local compilation-error-regexp-alist-alist ,compile-re) - (rename-buffer ,buf) + (when ,buf (rename-buffer ,buf)) (setq truncate-lines t) (goto-char (point-max)) (setq-local comint-dynamic-complete-functions '(,capf-fn)))