branch: externals/embark
commit 69cb685a0731d9682be2c69a26bd4dd07e4f087d
Author: Daniel Mendler <m...@daniel-mendler.de>
Commit: Daniel Mendler <m...@daniel-mendler.de>

    Add `embark--uniquify-orig-buffer`
    
    See emacs-mirror/emacs/commit/76877a6b08492c555744cfebda3224df91dec82a.
---
 embark.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/embark.el b/embark.el
index 380f6a4131..22984ea9ca 100644
--- a/embark.el
+++ b/embark.el
@@ -207,6 +207,7 @@ Each function should take no arguments and return one of:
     (project-file . embark--project-file-full-path)
     (package . embark--remove-package-version)
     (multi-category . embark--refine-multi-category)
+    (buffer . embark--uniquify-orig-buffer)
     (file . embark--simplify-path))
   "Alist associating type to functions for transforming targets.
 Each function should take a type and a target string and return a
@@ -2160,6 +2161,14 @@ minibuffer before executing the action."
       (setq prefix-arg nil)
       (if quit (embark--quit-and-run run-action) (funcall run-action)))))
 
+(defun embark--uniquify-orig-buffer (_type target)
+  "Return `uniquify-orig-buffer' property of TARGET.
+Used by `project--read-project-buffer' on Emacs 31."
+  (cons 'buffer
+        (if-let ((buf (get-text-property 0 'uniquify-orig-buffer target)))
+            (buffer-name buf)
+          target)))
+
 (defun embark--refine-multi-category (_type target)
   "Refine `multi-category' TARGET to its actual type."
   (or (let ((mc (get-text-property 0 'multi-category target)))

Reply via email to