]> git.eshelyaron.com Git - emacs.git/commitdiff
Add project-display-buffer and project-display-buffer-other-frame
authorSean Whitton <spwhitton@spwhitton.name>
Fri, 24 Jul 2020 20:54:49 +0000 (13:54 -0700)
committerDmitry Gutov <dgutov@yandex.ru>
Sun, 26 Jul 2020 23:52:10 +0000 (02:52 +0300)
* lisp/progmodes/project.el (project-display-buffer,
project-display-buffer-other-frame): Add commands.

lisp/progmodes/project.el

index 2bccd3f0fe512ee155a9f10fcedc354b3c82803b..da3ab4d1fb58585d4ae53e318f5a5a9f216d94c8 100644 (file)
@@ -904,7 +904,34 @@ current project.  Two buffers belong to the same project if their
 project instances, as reported by `project-current' in each
 buffer, are identical."
   (interactive (list (project--read-project-buffer)))
-  (switch-to-buffer buffer))
+  (switch-to-buffer buffer-or-name))
+
+;;;###autoload
+(defun project-display-buffer (buffer-or-name)
+  "Display BUFFER-OR-NAME in some window, without selecting it.
+When called interactively, prompts for a buffer belonging to the
+current project.  Two buffers belong to the same project if their
+project instances, as reported by `project-current' in each
+buffer, are identical.
+
+This function uses `display-buffer' as a subroutine, which see
+for how it is determined where the buffer will be displayed."
+  (interactive (list (project--read-project-buffer)))
+  (display-buffer buffer-or-name))
+
+;;;###autoload
+(defun project-display-buffer-other-frame (buffer-or-name)
+  "Display BUFFER-OR-NAME preferably in another frame.
+When called interactively, prompts for a buffer belonging to the
+current project.  Two buffers belong to the same project if their
+project instances, as reported by `project-current' in each
+buffer, are identical.
+
+This function uses `display-buffer-other-frame' as a subroutine,
+which see for how it is determined where the buffer will be
+displayed."
+  (interactive (list (project--read-project-buffer)))
+  (display-buffer-other-frame buffer))
 
 (defcustom project-kill-buffers-ignores
   '("\\*Help\\*")