branch: externals/ess commit de7dbecf4bd09a4957513b7ef76a620aeb6ccf0b Author: Lionel Henry <lionel....@gmail.com> Commit: Lionel Henry <lionel....@gmail.com>
Make `ess-can-eval-in-background` a function --- lisp/ess-inf.el | 7 +++++-- lisp/ess-julia.el | 2 +- lisp/ess-r-completion.el | 12 ++++++------ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lisp/ess-inf.el b/lisp/ess-inf.el index 4309024821..c7deaf512a 100644 --- a/lisp/ess-inf.el +++ b/lisp/ess-inf.el @@ -2181,6 +2181,9 @@ If in the output field, goes to the beginning of previous input." (inferior-ess--get-old-input:regexp) (inferior-ess--get-old-input:field))) +(defun ess-can-eval-in-background (&optional _proc) + ess-can-eval-in-background) + ;;;*;;; Hot key commands @@ -3000,7 +3003,7 @@ NO-ERROR prevents errors when this has not been implemented for (defun ess-synchronize-dirs () "Set Emacs' current directory to be the same as the subprocess directory. To be used in `ess-idle-timer-functions'." - (when (and ess-can-eval-in-background + (when (and (ess-can-eval-in-background) ess-getwd-command (inferior-ess-available-p)) (ess-when-new-input last-sync-dirs @@ -3040,7 +3043,7 @@ path, and can be a remote path" (defun ess-cache-search-list () "To be used in `ess-idle-timer-functions', to set search path related variables." - (when (and ess-can-eval-in-background + (when (and (ess-can-eval-in-background) inferior-ess-search-list-command) (ess-when-new-input last-cache-search-list (let ((path (ess-search-list 'force)) diff --git a/lisp/ess-julia.el b/lisp/ess-julia.el index a6d31a6ab8..92a55f3291 100644 --- a/lisp/ess-julia.el +++ b/lisp/ess-julia.el @@ -262,7 +262,7 @@ objects from that MODULE." "Return the doc string, or nil. If an ESS process is not associated with the buffer, do not try to look up any doc strings. Honors `eldoc-echo-area-use-multiline-p'." - (when (and ess-can-eval-in-background + (when (and (ess-can-eval-in-background) (ess-process-live-p) (not (ess-process-get 'busy))) (let ((funname (or (and ess-eldoc-show-on-symbol ;; aggressive completion diff --git a/lisp/ess-r-completion.el b/lisp/ess-r-completion.el index 6ba5133e82..b06e1b613f 100644 --- a/lisp/ess-r-completion.el +++ b/lisp/ess-r-completion.el @@ -53,7 +53,7 @@ "Return the doc string, or nil. If an ESS process is not associated with the buffer, do not try to look up any doc strings." - (when (and eldoc-mode ess-can-eval-in-background) + (when (and eldoc-mode (ess-can-eval-in-background)) (let* ((proc (ess-get-next-available-process)) (funname (and proc (or (and ess-eldoc-show-on-symbol ;; Aggressive completion (thing-at-point 'symbol)) @@ -364,7 +364,7 @@ To be used instead of ESS' completion engine for R versions >= 2.7.0." (let ((start (ess-symbol-start))) (when start (buffer-substring-no-properties start (point)))))) - (candidates (when ess-can-eval-in-background + (candidates (when (ess-can-eval-in-background) (let ((proc (ess-get-next-available-process))) (when proc (with-current-buffer (process-buffer proc) @@ -383,7 +383,7 @@ To be used instead of ESS' completion engine for R versions >= 2.7.0." (cons prefix (>= (length prefix) ess-company-arg-prefix-length)) prefix)))))) - (candidates (when ess-can-eval-in-background + (candidates (when (ess-can-eval-in-background) (let* ((proc (ess-get-next-available-process)) (args (delete "..." (nth 2 (ess-function-arguments (car ess--fn-name-start-cache) proc)))) @@ -392,7 +392,7 @@ To be used instead of ESS' completion engine for R versions >= 2.7.0." (all-completions arg args)))) ;; Displaying help for the argument in the echo area is disabled ;; by default for performance reasons. It causes delays or hangs (#1062). - (meta (when (and ess-can-eval-in-background + (meta (when (and (ess-can-eval-in-background) (bound-and-true-p ess-r--company-meta)) (let ((proc (ess-get-next-available-process))) (when (and proc @@ -414,7 +414,7 @@ To be used instead of ESS' completion engine for R versions >= 2.7.0." '("library" "require")) (let ((start (ess-symbol-start))) (and start (buffer-substring start (point)))))) - (candidates (when ess-can-eval-in-background + (candidates (when (ess-can-eval-in-background) (all-completions arg (ess-installed-packages)))) (annotation "<pkg>") (duplicates nil) @@ -425,7 +425,7 @@ To be used instead of ESS' completion engine for R versions >= 2.7.0." (defun ess-r-package-completion () "Return installed packages if in a call to library or require. Return format suitable for `completion-at-point-functions'." - (when (and ess-can-eval-in-background + (when (and (ess-can-eval-in-background) (member (car (ess--fn-name-start)) '("library" "require"))) (list (ess-symbol-start)