>From a86e847607b281643603865c7231e52fb467da9c Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 24 Jul 2020 13:54:49 -0700 Subject: [PATCH v2 2/3] Add project-display-buffer and project-display-buffer-other-frame * lisp/progmodes/project.el (project-display-buffer, project-display-buffer-other-frame): Add commands. --- lisp/progmodes/project.el | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 9534eb2ef6..f674749497 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -906,6 +906,30 @@ project-switch-to-buffer (interactive (list (project--read-project-buffer))) (switch-to-buffer buffer)) +;;;###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." + (interactive (list (project--read-project-buffer))) + (display-buffer buffer)) + +;;;###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\\*") "Conditions for buffers `project-kill-buffers' should not kill. -- 2.27.0