Skip to content

Commit

Permalink
Uniquify xref buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewbauer committed Jul 13, 2024
1 parent 8b5aabe commit 9100c33
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,17 @@ as ARGS."
(replace-match "\"" t t)))))
#+END_SRC

#+BEGIN_SRC
(with-eval-after-load 'project
(defun project-find-regexp-with-unique-buffer (orig-fun &rest args)
"An advice function that gives project-find-regexp a unique buffer name"
(require 'xref)
(let ((xref-buffer-name (format "%s %s" xref-buffer-name (car args))))
(apply orig-fun args)))

(advice-add 'project-find-regexp :around #'project-find-regexp-with-unique-buffer))
#+END_SRC

Now we will call =bind-keys=. We give it keys to bind & what function to run
when those keys are pressed. Note on syntax of bind-keys: if you are unfamiliar
with how Emacs key binding works, you should read through [[https://www.masteringemacs.org/article/mastering-key-bindings-emacs][this article]]. Some
Expand Down

0 comments on commit 9100c33

Please sign in to comment.