From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id kgNjL5h0PmRwPwEASxT56A (envelope-from ) for ; Tue, 18 Apr 2023 12:44:40 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id kKk0LZh0PmRqYgEAauVa8A (envelope-from ) for ; Tue, 18 Apr 2023 12:44:40 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4FD852F215 for ; Tue, 18 Apr 2023 12:44:40 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poioI-0003Wo-SA; Tue, 18 Apr 2023 06:43:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poioH-0003Wf-05 for emacs-orgmode@gnu.org; Tue, 18 Apr 2023 06:43:41 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poioE-0007WO-3n for emacs-orgmode@gnu.org; Tue, 18 Apr 2023 06:43:40 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 4F1DB240309 for ; Tue, 18 Apr 2023 12:43:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1681814615; bh=FEKjBmAsJMRkvLHuuM7mBu13YINHFEafC9RqdmHQBMk=; h=From:To:Cc:Subject:Date:From; b=aV/HMsYSga7FAMAJlDjWt9ykOLi7qTfA/Jg5HLDte/++ilQOkKVPO4b6Cm0YDtgd4 1uboEAj1rOttJ2TACS3QBvVlNy64x42U3vFD0KUlmtFmCxztmeljPt0E1OOE8oATRI Z7AJU6FC4U7b96TKIO/KZ6KXzaXL7lCK1KE2jJyrG9bw8yupfayVgnQTLg3p5sNb7x uTCb1yUoa9FD56hjV5cTxsHiK9KwGKAhSbUuZMI5xnbqaQ68TdpLQtM8OOjQXxeczq 0jN6EZb3AKGpUSd4r6EQrSm10/XXpKJkq+S8aRk2kCc8Wab/0PIoyj1d1hWZ4NVaU3 tePyglIS6b9Pw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Q10rk2ZLZz6txP; Tue, 18 Apr 2023 12:43:34 +0200 (CEST) From: Ihor Radchenko To: Lionel Henry Cc: emacs-orgmode@gnu.org, ESS-core@r-project.org Subject: Re: [BUG] ob-R tests fail on Emacs 27 since ESS commit 536b5b914a7 [9.7-pre (release_9.6.4-318-gcfe5e0.dirty @ /home/yantar92/.emacs.d/straight/build/org/)] In-Reply-To: References: <87ilduqrem.fsf@localhost> Date: Tue, 18 Apr 2023 10:46:06 +0000 Message-ID: <87mt35h3ip.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681814680; a=rsa-sha256; cv=none; b=gyH3D4EgTykJprOofMSurmSDMmxD6ARIoss5kVrqEcwqZU/q+edJgVGeaUqw55AfVo0m2a caBbtCaEOBCKD8ARjbzVE+0Gh3BWVsg5XBxy5zzegH3fBeIWq4PL5BJ+rwTkqz19GzGcQu tsrtDK7CRlKO7Hy3dxFLkw51+kN+v6mevwmhcjgNPlvRVQfDqgLShOlg8QZxyAYsVYm2Q7 amNaLsIaW2NPzavMkOItQlRkW6lXRnwKUERZvwLmKxKn6VA8dMV/5rhg7i9U9biyXDd1hR 8QkwnNj9GlBA78KL7voVcCV/3vaDK1Qr+mONijcA6ymr0Lb7S8LtwVjSNYic7A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="aV/HMsYS"; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681814680; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=RjiPueUscREaX3eXjYc/fcVISTWwS3hyGaqKC3umXSY=; b=rqJb6z2SpjjQL/gRukD3KvOhTH1n6OUqk3P7HKkcyG+olI6n/XEpQE/e56WCtRnqcOEm1J MPG1yf8FcNj2s3HDEvXJ9TxlnH81LJqkV5mtboxxXk+i9Piaht+R5m6+Qd+TJjWTPIn+Ox oOo0iKkQgt+AS044Huv9BTPowN/I/R52yzbfyTcFHdXJGVM8qoYoFih3ZAAOiv6drFVQgf SwD0h3TsM+TpqmB34+GmDWZ8z7J1lDH/OC6/3QP9FGGfyrtzcDHnXMwYdAU2cCOVetoGii K++Upy+WFlh1B1i+36kX2uO8NAKrw12anVGqLEPd9+qtQoTNCfYFRuXhkjINSg== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -4.71 X-Spam-Score: -4.71 X-Migadu-Queue-Id: 4FD852F215 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="aV/HMsYS"; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-TUID: HlOjVE2EaV/Y --=-=-= Content-Type: text/plain Lionel Henry writes: > Thanks for looking into this. I think you're right it's probably > caused by ESS now setting the width on startup. In that case you could > fix your tests by setting `options(width = )` to some hardcoded value. > You could do it via `ess-r-post-run-hook`. I tried using `ess-r-post-run-hook', but it fails for some reason. See the attached patch. With the patch, the tests fail with Test ob-session-async-R-value-drawer condition: (user-error "ESS process not ready. Finish your command before trying again") In contrast, directly editing `ess-r-initialize' like ;; (ess-execute-screen-options t) (ess-command (ess-calculate-width 9999)) does not fail and make all the tests pass. Is there anything I am missing about `ess-r-post-run-hook'? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ob-R-Fix-regression-after-ESS-commit-536b5b914a7.patch >From 07407519d2e8de0f2925a9d2971b855fd0be86b4 Mon Sep 17 00:00:00 2001 Message-Id: <07407519d2e8de0f2925a9d2971b855fd0be86b4.1681814636.git.yantar92@posteo.net> From: Ihor Radchenko Date: Tue, 18 Apr 2023 12:42:29 +0200 Subject: [PATCH] ob-R: Fix regression after ESS commit 536b5b914a7 * lisp/ob-R.el (org-babel-R--set-wide-screen-width): New function setting fill column to large value in ESS interactive shell. (org-babel-R-initiate-session): Override the default ESS truncation settings. Reported-by: Ihor Radchenko Link: https://orgmode.org/list/87ilduqrem.fsf@localhost --- lisp/ob-R.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lisp/ob-R.el b/lisp/ob-R.el index 7ea137197..9ad878370 100644 --- a/lisp/ob-R.el +++ b/lisp/ob-R.el @@ -39,6 +39,10 @@ (declare-function orgtbl-to-tsv "org-table" (table params)) (declare-function run-ess-r "ext:ess-r-mode" (&optional start-args)) (declare-function inferior-ess-send-input "ext:ess-inf" ()) (declare-function ess-make-buffer-current "ext:ess-inf" ()) +(declare-function + ess-command "ext:ess-inf" + (cmd &optional out-buffer sleep no-prompt-check wait proc proc force-redisplay timeout)) +(declare-function ess-calculate-width "ext:ess-inf" (opt)) (declare-function ess-eval-buffer "ext:ess-inf" (vis)) (declare-function ess-wait-for-process "ext:ess-inf" (&optional proc sec-prompt wait force-redisplay)) @@ -261,7 +265,13 @@ (defun org-babel-R-assign-elisp (name value colnames-p rownames-p) (t (format "%s <- %S" name (prin1-to-string value)))))) +(defun org-babel-R--set-wide-screen-width () + "Set large screen width in current R buffer." + (org-require-package 'ess-inf "ESS") + (ess-command (ess-calculate-width 9999))) + (defvar ess-ask-for-ess-directory) ; dynamically scoped +(defvar ess-r-post-run-hook) (defun org-babel-R-initiate-session (session params) "If there is not a current R process then create one." (unless (string= session "none") @@ -277,7 +287,10 @@ (defun org-babel-R-initiate-session (session params) ;; Session buffer exists, but with dead process (set-buffer session)) (org-require-package 'ess-r-mode "ESS") - (set-buffer (run-ess-r)) + (let ((ess-r-post-run-hook + (cons #'org-babel-R--set-wide-screen-width + ess-r-post-run-hook))) + (set-buffer (run-ess-r))) (let ((R-proc (get-process (or ess-local-process-name ess-current-process-name)))) (while (process-get R-proc 'callbacks) -- 2.40.0 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--