summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-07-24 13:54:49 -0700
committerDmitry Gutov <dgutov@yandex.ru>2020-07-27 02:52:10 +0300
commite3614fcc622df1cf5fbae8db9e7013f96196443c (patch)
tree53048d6dc31689285f5d6a4f5df1526b3ea06f97
parent7479c11b4e73fcb9aa9d42788012b850ee3245c5 (diff)
downloademacs-e3614fcc622df1cf5fbae8db9e7013f96196443c.tar.gz
Add project-display-buffer and project-display-buffer-other-frame
* lisp/progmodes/project.el (project-display-buffer, project-display-buffer-other-frame): Add commands.
-rw-r--r--lisp/progmodes/project.el29
1 files changed, 28 insertions, 1 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 2bccd3f0fe5..da3ab4d1fb5 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -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\\*")