unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47975: 28.0.50; Project prefixed buffer name
@ 2021-04-23 16:32 Juri Linkov
  2021-04-23 22:58 ` Dmitry Gutov
  0 siblings, 1 reply; 3+ messages in thread
From: Juri Linkov @ 2021-04-23 16:32 UTC (permalink / raw)
  To: 47975

[-- Attachment #1: Type: text/plain, Size: 56 bytes --]

It seems the commit 08fab316a1 calls for more changes:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: project-prefixed-buffer-name.patch --]
[-- Type: text/x-diff, Size: 1661 bytes --]

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 5996a76488..914d7ce9e4 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -918,10 +918,7 @@ project-shell
 if one already exists."
   (interactive)
   (let* ((default-directory (project-root (project-current t)))
-         (default-project-shell-name
-           (concat "*" (file-name-nondirectory
-                        (directory-file-name default-directory))
-                   "-shell*"))
+         (default-project-shell-name (project-prefixed-buffer-name "shell"))
          (shell-buffer (get-buffer default-project-shell-name)))
     (if (and shell-buffer (not current-prefix-arg))
         (pop-to-buffer-same-window shell-buffer)
@@ -937,10 +934,7 @@ project-eshell
   (interactive)
   (defvar eshell-buffer-name)
   (let* ((default-directory (project-root (project-current t)))
-         (eshell-buffer-name
-          (concat "*" (file-name-nondirectory
-                       (directory-file-name default-directory))
-                  "-eshell*"))
+         (eshell-buffer-name (project-prefixed-buffer-name "eshell"))
          (eshell-buffer (get-buffer eshell-buffer-name)))
     (if (and eshell-buffer (not current-prefix-arg))
         (pop-to-buffer-same-window eshell-buffer)
@@ -1004,6 +998,7 @@ project-compilation-buffer-name-function
   "Function to compute the name of a project compilation buffer.
 If non-nil, it overrides `compilation-buffer-name-function' for
 `project-compile'."
+  :version "28.1"
   :group 'project
   :type '(choice (const :tag "Default" nil)
                  (const :tag "Prefixed with root directory name"

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#47975: 28.0.50; Project prefixed buffer name
  2021-04-23 16:32 bug#47975: 28.0.50; Project prefixed buffer name Juri Linkov
@ 2021-04-23 22:58 ` Dmitry Gutov
  2021-04-24 21:54   ` Juri Linkov
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Gutov @ 2021-04-23 22:58 UTC (permalink / raw)
  To: Juri Linkov, 47975

Hi Juri,

On 23.04.2021 19:32, Juri Linkov wrote:
> It seems the commit 08fab316a1 calls for more changes:

I stopped short of doing this keeping in mind the possibility for fixing 
and reusing uniquify not too far off in the future.

But please feel free to install, it shouldn't hurt either way.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#47975: 28.0.50; Project prefixed buffer name
  2021-04-23 22:58 ` Dmitry Gutov
@ 2021-04-24 21:54   ` Juri Linkov
  0 siblings, 0 replies; 3+ messages in thread
From: Juri Linkov @ 2021-04-24 21:54 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 47975

tags 47975 fixed
close 47975 28.0.50
thanks

>> It seems the commit 08fab316a1 calls for more changes:
>
> I stopped short of doing this keeping in mind the possibility for fixing
> and reusing uniquify not too far off in the future.

Reusing uniquify is welcome, it could eliminate the need of redefining
the built-in commands to be able to generate unique compilation buffer names:

(defun my-project-compile ()
  (interactive)
  ;; Like ‘project-compile’ but generate unique buffer names:
  (let ((default-directory (project-root (project-current t)))
        (compilation-buffer-name-function
         (lambda (mode)
           (generate-new-buffer-name
            (project-prefixed-buffer-name mode)))))
    (compile (compilation-read-command (car compile-history)) nil)))

> But please feel free to install, it shouldn't hurt either way.

Now installed in master.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-24 21:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 16:32 bug#47975: 28.0.50; Project prefixed buffer name Juri Linkov
2021-04-23 22:58 ` Dmitry Gutov
2021-04-24 21:54   ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).