From 06395ba77d6e5a90df4dee1c9c3fdb0522d5b21f Mon Sep 17 00:00:00 2001 From: kobarity Date: Wed, 11 Feb 2026 13:29:12 +0900 Subject: [PATCH] Revert "Use 'project-name-cached' in 'python-shell-get-process-name'" This reverts commit 482748592f61abed6f675e7b62b2d56e4e18a146. Commit 583a112169f0c964552b94f84ea0c942377a14e6 removed 'project-name-cached' and also resolved bug#80045. --- lisp/progmodes/python.el | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 2a3035c95c5..942b072e23a 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3366,16 +3366,6 @@ from `python-shell-prompt-regexp', python-shell--prompt-calculated-output-regexp (funcall build-regexp output-prompts))))) -(defun python-shell-get-project-name () - "Return the project name for the current buffer. -Use `project-name-cached' if available." - (when (featurep 'project) - (if (fboundp 'project-name-cached) - (project-name-cached default-directory) - (when-let* ((proj (project-current))) - (file-name-nondirectory - (directory-file-name (project-root proj))))))) - (defun python-shell-get-process-name (dedicated) "Calculate the appropriate process name for inferior Python process. If DEDICATED is nil, this is simply `python-shell-buffer-name'. @@ -3384,8 +3374,11 @@ name respectively the current project name." (pcase dedicated ('nil python-shell-buffer-name) ('project - (if-let* ((proj-name (python-shell-get-project-name))) - (format "%s[%s]" python-shell-buffer-name proj-name) + (if-let* ((proj (and (featurep 'project) + (project-current)))) + (format "%s[%s]" python-shell-buffer-name (file-name-nondirectory + (directory-file-name + (project-root proj)))) python-shell-buffer-name)) (_ (format "%s[%s]" python-shell-buffer-name (buffer-name)))))