emacs-orgmode
[Top][All Lists]
Advanced

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

[PATCH] Add buffer-local setting to request specific ESS process/session


From: Ihor Radchenko
Subject: [PATCH] Add buffer-local setting to request specific ESS process/session name (was: [PATCH] Set Python shell in Org edit buffer)
Date: Sun, 21 Jan 2024 11:48:32 +0000

Ihor Radchenko <yantar92@posteo.net> writes:

> We recently discovered `ess-gen-proc-buffer-name-function', but it does
> not work as we expected, unfortunately. (which is either because we
> misunderstand something or because there is a bug).

I am attaching tentative patch that will make `ess-request-a-process'
obey `ess-gen-proc-buffer-name-function'.

>From 68984a5a0a1df5a5a2619b579f23f70128e979cd Mon Sep 17 00:00:00 2001
Message-ID: 
<68984a5a0a1df5a5a2619b579f23f70128e979cd.1705837631.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Sun, 21 Jan 2024 12:44:32 +0100
Subject: [PATCH] ess-request-a-process: Honor
 ess-gen-proc-buffer-name-function

* lisp/ess-inf.el (ess-request-a-process): Do not make processes not
matching `ess-gen-proc-buffer-name-function' current.
---
 lisp/ess-inf.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/ess-inf.el b/lisp/ess-inf.el
index 9ca3f455..aaff314c 100644
--- a/lisp/ess-inf.el
+++ b/lisp/ess-inf.el
@@ -820,7 +820,7 @@ (defun ess-request-a-process (message &optional noswitch 
ask-if-1)
                            (delete-dups (list "R" "S+" (or (bound-and-true-p 
S+-dialect-name) "S+")
                                               "stata" (or (bound-and-true-p 
STA-dialect-name) "stata")
                                               "julia" "SAS")))))
-         (pname-list (delq nil ;; keep only those matching dialect
+         (pname-list (delq nil ;; keep only those matching dialect and 
`ess-gen-proc-buffer-name-function'
                            (append
                             (mapcar (lambda (lproc)
                                       (and (equal ess-dialect
@@ -828,6 +828,8 @@ (defun ess-request-a-process (message &optional noswitch 
ask-if-1)
                                                    'ess-dialect
                                                    (process-buffer 
(get-process (car lproc)))))
                                            (not (equal ess-local-process-name 
(car lproc)))
+                                           (equal (buffer-name (process-buffer 
(get-process (car lproc))))
+                                                  (funcall 
ess-gen-proc-buffer-name-function (car lproc)))
                                            (car lproc)))
                                     ess-process-name-list)
                             ;; append local only if running
-- 
2.43.0

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

reply via email to

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