mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 12:21:25 -08:00
project-switch-to-buffer: Don't disambiguate too much
* lisp/progmodes/project.el (project--read-project-buffer): Use the new function from 'uniquify' to generate buffer names that are just unique to the current project, not globally (bug#77312).
This commit is contained in:
parent
79cd1cc30e
commit
1c465fc087
1 changed files with 22 additions and 7 deletions
|
|
@ -1574,13 +1574,28 @@ general form of conditions."
|
|||
(and (memq (cdr buffer) buffers)
|
||||
(not
|
||||
(project--buffer-check
|
||||
(cdr buffer) project-ignore-buffer-conditions)))))
|
||||
(buffer (read-buffer
|
||||
"Switch to buffer: "
|
||||
(when (funcall predicate (cons other-name other-buffer))
|
||||
other-name)
|
||||
nil
|
||||
predicate)))
|
||||
buffer project-ignore-buffer-conditions)))))
|
||||
(buffer
|
||||
(if (and (fboundp 'uniquify-get-unique-names)
|
||||
uniquify-buffer-name-style)
|
||||
;; Forgo the use of `buffer-read-function' (often nil) in
|
||||
;; favor of uniquifying the buffers better.
|
||||
(let* ((unique-names (uniquify-get-unique-names buffers))
|
||||
(other-name (when (funcall predicate (cons other-name other-buffer))
|
||||
(car (rassoc other-buffer unique-names))))
|
||||
(result (completing-read
|
||||
"Switch to buffer: "
|
||||
unique-names
|
||||
predicate
|
||||
nil nil nil
|
||||
other-name)))
|
||||
(assoc-default result unique-names #'equal result))
|
||||
(read-buffer
|
||||
"Switch to buffer: "
|
||||
(when (funcall predicate (cons other-name other-buffer))
|
||||
other-name)
|
||||
nil
|
||||
predicate))))
|
||||
;; XXX: This check hardcodes the default buffer-belonging relation
|
||||
;; which `project-buffers' is allowed to override. Straighten
|
||||
;; this up sometime later. Or not. Since we can add a method
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue