diff options
| author | kobarity | 2026-02-11 13:29:12 +0900 |
|---|---|---|
| committer | Juri Linkov | 2026-02-13 09:43:29 +0200 |
| commit | 06395ba77d6e5a90df4dee1c9c3fdb0522d5b21f (patch) | |
| tree | 9e5db7c48d7dc3cbacf3ae8e1efd68a271470a88 /lisp/progmodes/python.el | |
| parent | 48525f500e98d31a636978983d63ee7850621b06 (diff) | |
| download | emacs-06395ba77d6e5a90df4dee1c9c3fdb0522d5b21f.tar.gz emacs-06395ba77d6e5a90df4dee1c9c3fdb0522d5b21f.zip | |
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.
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 17 |
1 files 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', | |||
| 3366 | python-shell--prompt-calculated-output-regexp | 3366 | python-shell--prompt-calculated-output-regexp |
| 3367 | (funcall build-regexp output-prompts))))) | 3367 | (funcall build-regexp output-prompts))))) |
| 3368 | 3368 | ||
| 3369 | (defun python-shell-get-project-name () | ||
| 3370 | "Return the project name for the current buffer. | ||
| 3371 | Use `project-name-cached' if available." | ||
| 3372 | (when (featurep 'project) | ||
| 3373 | (if (fboundp 'project-name-cached) | ||
| 3374 | (project-name-cached default-directory) | ||
| 3375 | (when-let* ((proj (project-current))) | ||
| 3376 | (file-name-nondirectory | ||
| 3377 | (directory-file-name (project-root proj))))))) | ||
| 3378 | |||
| 3379 | (defun python-shell-get-process-name (dedicated) | 3369 | (defun python-shell-get-process-name (dedicated) |
| 3380 | "Calculate the appropriate process name for inferior Python process. | 3370 | "Calculate the appropriate process name for inferior Python process. |
| 3381 | If DEDICATED is nil, this is simply `python-shell-buffer-name'. | 3371 | If DEDICATED is nil, this is simply `python-shell-buffer-name'. |
| @@ -3384,8 +3374,11 @@ name respectively the current project name." | |||
| 3384 | (pcase dedicated | 3374 | (pcase dedicated |
| 3385 | ('nil python-shell-buffer-name) | 3375 | ('nil python-shell-buffer-name) |
| 3386 | ('project | 3376 | ('project |
| 3387 | (if-let* ((proj-name (python-shell-get-project-name))) | 3377 | (if-let* ((proj (and (featurep 'project) |
| 3388 | (format "%s[%s]" python-shell-buffer-name proj-name) | 3378 | (project-current)))) |
| 3379 | (format "%s[%s]" python-shell-buffer-name (file-name-nondirectory | ||
| 3380 | (directory-file-name | ||
| 3381 | (project-root proj)))) | ||
| 3389 | python-shell-buffer-name)) | 3382 | python-shell-buffer-name)) |
| 3390 | (_ (format "%s[%s]" python-shell-buffer-name (buffer-name))))) | 3383 | (_ (format "%s[%s]" python-shell-buffer-name (buffer-name))))) |
| 3391 | 3384 | ||