mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 09:14:18 +00:00
Revert "Use 'project-name-cached' in 'python-shell-get-process-name'"
This reverts commit482748592f. Commit583a112169removed 'project-name-cached' and also resolved bug#80045.
This commit is contained in:
parent
48525f500e
commit
06395ba77d
1 changed files with 5 additions and 12 deletions
|
|
@ -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)))))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue