From b257d983083b3b2f31a0bd3a7a3b3a00144c73ac Mon Sep 17 00:00:00 2001 From: Cayetano Santos Date: Fri, 20 Dec 2024 13:21:22 +0100 Subject: [PATCH 1/5] optional renamimg of compilation buffer --- fpga-utils.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fpga-utils.el b/fpga-utils.el index 68e339b..eb872c6 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 (rename-buffer ,buf-name)) (setq truncate-lines t) (goto-char (point-max)))) @@ -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-name)) (setq truncate-lines t) (goto-char (point-max)) (setq-local comint-dynamic-complete-functions '(,capf-fn))) From afd58a0b7a1cb8c7bcdd8c75c84b721dab708c8c Mon Sep 17 00:00:00 2001 From: Cayetano Santos Date: Fri, 20 Dec 2024 13:35:11 +0100 Subject: [PATCH 2/5] typo --- fpga-utils.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fpga-utils.el b/fpga-utils.el index eb872c6..9f57ab3 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) - (when ,buf (rename-buffer ,buf-name)) + (when ,buf-name (rename-buffer ,buf-name)) (setq truncate-lines t) (goto-char (point-max)))) @@ -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) - (when ,buf (rename-buffer ,buf-name)) + (when ,buf (rename-buffer ,buf)) (setq truncate-lines t) (goto-char (point-max)) (setq-local comint-dynamic-complete-functions '(,capf-fn))) From 74649959c8e497153dc5ca28d1dd141ac14eb3ad Mon Sep 17 00:00:00 2001 From: Cayetano Santos Date: Sat, 21 Dec 2024 20:03:26 +0100 Subject: [PATCH 3/5] deal with nil fpga-xilinx-vivado-buf in fpga-utils-define-compile-fn --- fpga-utils.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpga-utils.el b/fpga-utils.el index 9f57ab3..a178a39 100644 --- a/fpga-utils.el +++ b/fpga-utils.el @@ -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 (get-buffer (or ,buf "*vivado*")) (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"))) From c963fae96c6e12e7142a8195703e19ac3e2a1abe Mon Sep 17 00:00:00 2001 From: Gonzalo Larumbe Date: Tue, 24 Dec 2024 19:01:17 +0100 Subject: [PATCH 4/5] Revert "deal with nil fpga-xilinx-vivado-buf in fpga-utils-define-compile-fn" This reverts commit 74649959c8e497153dc5ca28d1dd141ac14eb3ad. --- fpga-utils.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpga-utils.el b/fpga-utils.el index a178a39..9f57ab3 100644 --- a/fpga-utils.el +++ b/fpga-utils.el @@ -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 (or ,buf "*vivado*")) + (when (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"))) From 672604036ee83f4d2d05f5bd1ca839951990b047 Mon Sep 17 00:00:00 2001 From: Gonzalo Larumbe Date: Tue, 24 Dec 2024 19:02:05 +0100 Subject: [PATCH 5/5] Fix error for nil custom compilation buffer names --- fpga-utils.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpga-utils.el b/fpga-utils.el index 9f57ab3..ae15f0a 100644 --- a/fpga-utils.el +++ b/fpga-utils.el @@ -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")))