Advertisement
bahman

compile-project-rename-buffer

Sep 7th, 2023 (edited)
1,943
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.55 KB | None | 0 0
  1. (defun bahman-compile-project-rename-buffer (command)
  2.   "Compiles the project using COMMAND in its own buffer."
  3.   (interactive
  4.    (list
  5.     (read-string "Compile command: " "make" 'compile-history)))
  6.    (let* ((compilation-buffer-name-function-original compilation-buffer-name-function))
  7.      (setq-local compilation-buffer-name-function
  8.                  (lambda (mode)
  9.                    (concat "*" (downcase mode) " - " command "*")))
  10.      (compile command)
  11.      (setq-local compilation-buffer-name-function compilation-buffer-name-function-original)))
  12.  
Tags: emacs lisp elips
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement