emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master e3614fc 2/4: Add project-display-buffer and project-display-buffe


From: Dmitry Gutov
Subject: master e3614fc 2/4: Add project-display-buffer and project-display-buffer-other-frame
Date: Sun, 26 Jul 2020 19:57:27 -0400 (EDT)

branch: master
commit e3614fcc622df1cf5fbae8db9e7013f96196443c
Author: Sean Whitton <spwhitton@spwhitton.name>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    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 | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 2bccd3f..da3ab4d 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\\*")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]