Skip to content

Commit

Permalink
tweak(valgrind): make the buffer name customizable
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Nov 29, 2024
1 parent a73cc7d commit 73b19ef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion elisp/valgrind.el
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ You might also use mode hooks to specify it in certain modes, like this:
:type 'string
:group 'valgrind)

(defcustom valgrind-buffer-name-function (lambda (_mode-name) "Takes the MODE-NAME, returns a string." "*valgrind*")
"A function that takes one argument (mode name) and returns name of the buffer."
:type 'function
:group 'valgrind)

;; History of compile commands.
(defvar valgrind-history nil)

Expand All @@ -54,7 +59,7 @@ move to the source code that caused it."
(let ((default-directory (or (let ((proj (project-current))) (project-root proj)) default-directory)))
(unless (equal command (eval valgrind-command))
(setq valgrind-command command))
(compilation-start command nil (lambda (_) "*valgrind*"))))
(compilation-start command nil valgrind-buffer-name-function)))


(provide 'valgrind)
Expand Down

0 comments on commit 73b19ef

Please sign in to comment.