From mboxrd@z Thu Jan 1 00:00:00 1970 From: 'Ihor Radchenko' Subject: Bug: org-babel-execute:emacs-lisp does not allow changing window configuration from within code block [9.3 (release_9.3 @ /home/yantar92/.emacs.d/straight/build/org/)] Date: Fri, 20 Dec 2019 22:59:38 +0800 Message-ID: <87tv5vt545.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:34124) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iiJmg-0002Dv-4V for emacs-orgmode@gnu.org; Fri, 20 Dec 2019 10:01:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iiJme-0003vv-LP for emacs-orgmode@gnu.org; Fri, 20 Dec 2019 10:01:41 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:35380) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iiJme-0003sv-CO for emacs-orgmode@gnu.org; Fri, 20 Dec 2019 10:01:40 -0500 Received: by mail-ed1-x533.google.com with SMTP id f8so8526712edv.2 for ; Fri, 20 Dec 2019 07:01:40 -0800 (PST) Received: from localhost ([5.226.137.4]) by smtp.gmail.com with ESMTPSA id f10sm969510eds.31.2019.12.20.07.01.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2019 07:01:37 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See https://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org mailing list. ------------------------------------------------------------------------ Recipe: 1. emacs -Q 2. Create the following org file #+begin_src emacs-lisp (split-window-below) #+end_src 3. Execute the source block Observed behaviour: The block returns, but the window is not splitted Expected behaviour: The window is splitted The reason of the observed behaviour is that org-babel-execute:emacs-lisp wraps the code block evaluation into save-window-excursion. Thus window manipulation is impossible from within babel blocks. The real case scenario when one would need to change window layout from within babel block is a window setup for a project development. If certain project requires working with specific window configuration, this can be defined by adding all the setup into a babel block somewhere in the project. Then, the layout could be applied just by hitting C-c C-c on the code block once one need to work on the project. However, it is not possible with the current org-babel-execute:emacs-lisp implementation. Best regards, Ihor Emacs : GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0) of 2019-12-17 Package: Org mode version 9.3 (release_9.3 @ /home/yantar92/.emacs.d/straight/build/org/) -- Ihor Radchenko, PhD, Center for Advancing Materials Performance from the Nanoscale (CAMP-nano) State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong University, Xi'an, China Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg