From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AIgNASGVvmBGmwAAgWs5BA (envelope-from ) for ; Mon, 07 Jun 2021 23:52:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id YPPnNyCVvmACLQAAB5/wlQ (envelope-from ) for ; Mon, 07 Jun 2021 21:52:32 +0000 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 05AC02A6A2 for ; Mon, 7 Jun 2021 23:52:32 +0200 (CEST) Received: from localhost ([::1]:51868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqNAb-0002Xb-Dn for larch@yhetil.org; Mon, 07 Jun 2021 17:52:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqNA8-0002XR-2l for emacs-orgmode@gnu.org; Mon, 07 Jun 2021 17:52:00 -0400 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]:39546) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lqNA5-0005y4-0h for emacs-orgmode@gnu.org; Mon, 07 Jun 2021 17:51:59 -0400 Received: by mail-oi1-x22c.google.com with SMTP id m137so15682271oig.6 for ; Mon, 07 Jun 2021 14:51:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to; bh=1/VAVMWJIvLPey7k4eeB2ZBMVpE/dzQEfdYRx234MCc=; b=X+pGGVJCAys2NRDA1huOilrbCSMu9LJaNmnac6UkIg1Manzc++2Wu9yxCxy7n3qKGo 9W2I+jwUu6wTePLHkCMRHBdt1KbbjDmHt9OxZRLRENAD+KndF8oOD2UP0r9todRJ5qA+ k9EdrJgV2dAOTny9+4Uun3tToHtHEqbhmRBFzBIJTJvaJoy5pE3uY4zmjWrb/EN/vB9o DLsJ4PuLlsWG7MQfqYPakVJ3d39FWx6XIY1RsUz1MkWabpWrakrCLzXymUwVA9iA2Mpz czB+JlyryNV5oVG3EH/+3VTfqKzsGJTwUH4Anr/CaT97IzxRlQRI08Lx4biY0cJPDHHY FBNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to; bh=1/VAVMWJIvLPey7k4eeB2ZBMVpE/dzQEfdYRx234MCc=; b=KCjOSJob+EgO5nlKlciBmPIbMDqERMiTUAOgZ6KU4CaJRjnSOqyDry44+GBUlfj6XH /4nWFcFhgekwsOPPvmJ4lKAXY1brODlSSh76mxoW0ltUwkbXpyj5XZxcPE00ycFggToi XTtAYSYgwvPGcxpP/HdFhPlMM7TfT+285PonR4aCYHS6yKlVPh4giDHiJz1R/zS3sPOj nfI5UPjeW059Gjz0GnhL0LlnajbLkX8v01yp+dv+srlo3dfxlYZAZZBWytozZsR7bBsn Mp47R3JBYt4nlH06Y/XZIO2JS8cO262LSiozGHAiNk1zO5wso9jVdIpR1BTXH/RypzZh t6LA== X-Gm-Message-State: AOAM532HLr2kmHB37vNp6Akgxl5kUvTaOX0vhshevngfThxOXcxtB1M5 EXaB5YEwGztdVKXXOC1rI8ZUFPSH5YUMQrr0YFqgucD8Yb0= X-Google-Smtp-Source: ABdhPJy4R9xeuQ720Uuuesw9HX0tMVTgeLnupHCwcP21+nv7rrRsLgHqnI0P+eRXF8ZjZmHPms0Rc0jxFphyhQhMI5k= X-Received: by 2002:a05:6808:486:: with SMTP id z6mr727913oid.153.1623102715520; Mon, 07 Jun 2021 14:51:55 -0700 (PDT) MIME-Version: 1.0 References: <4a32c014-cc70-f71d-aadf-f830bf5b8af8@nicksavage.ca> In-Reply-To: From: George Mauer Date: Mon, 7 Jun 2021 16:51:44 -0500 Message-ID: Subject: Re: Hiding results using :post To: org-mode-email Content-Type: multipart/alternative; boundary="000000000000caecb905c4340c83" Received-SPF: pass client-ip=2607:f8b0:4864:20::22c; envelope-from=gmauer@gmail.com; helo=mail-oi1-x22c.google.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_SBL_A=0.1 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: gmauer@gmail.com Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1623102752; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=1/VAVMWJIvLPey7k4eeB2ZBMVpE/dzQEfdYRx234MCc=; b=KTZakW3ZUIz+jDyJIcjPogOJjVmF6xBR6OlUQlex+E0WxnosroQ4QWJmxSPPrsaC91WrzQ VnKxZ7Q/Esxd47F0g5VWOK5/Cc9UtmlTNQH0B1z9PMxw0EgsyCLS2pPN9oKWmtZJDobmOb JVCxjayIWRocXSVPtCby/YXyb3DQWga5yU1j4Y17RkvARsCQvWftBpTVWUGiQuOgw/V3uL ypRKKlVbjcHVAUE9TlFqTPPsUqMuJ3/2+dL+oDhdnS24I28QGFGtqvKdtJ5lBVdag3pyOv QvVemFlLX98i4mfKCniwb5Ojxi0huPl5G7ISTIzBRnyczJEzlkHAyEmGz8K8jQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623102752; a=rsa-sha256; cv=none; b=DTtNHmQH6OCcGwCWuBLU4ttdf8w1vUR+ML2cNxANDVPdNeUeh2k8k8urRjAfSAhYI3KleJ M6CsterkQAUdhO81d4MX0jXqsRlIuZWcV9yjyjvZKmW+dcc29LR47ErDzSwaShfaFLtNOy p/oiWBG65a1cRg5kYu0rdgVG60nEsok/+QyCTi7QV51I0v2Y1De/qJhyzZr4TU1YMpuSSA uZto8KOLQnCnyyMy0k0zSdsrxr0IXuyeddLliyL35Qd/lgZvsaqddAIsq+x5weGG0aETN7 9O3heJmfHvqIgRW8RZfYhdlRLO/B68Ulia44XgzL2PdjVBlCEXWiRxRJ1zLX7A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=X+pGGVJC; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=X+pGGVJC; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 05AC02A6A2 X-Spam-Score: -3.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: MfPkz8wmbfkp --000000000000caecb905c4340c83 Content-Type: text/plain; charset="UTF-8" Cool, thanks! On Mon, Jun 7, 2021 at 4:31 PM John Kitchin wrote: > it is the name of blocks that use emacs-jupyter ( > https://github.com/nnicandro/emacs-jupyter) (instead of ob-ipython). > Basically it is a connection between org-src blocks and a jupyter kernel > (it does not have to be python, it can be julia, R, etc.) I am trying it > out this summer. > > I think that code should work on most src-blocks though. > > John > > ----------------------------------- > Professor John Kitchin (he/him/his) > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > @johnkitchin > http://kitchingroup.cheme.cmu.edu > > > > On Mon, Jun 7, 2021 at 5:21 PM George Mauer wrote: > >> Woah woah. What is the jupyter-python language, John? >> >> On Mon, Jun 7, 2021, 15:44 John Kitchin wrote: >> >>> This is doable with a hook and advice I think. The hook will hide the >>> results if you use :results hide in the header. >>> >>> I had to use the advice to remove the results before hand, so that you >>> toggle the visibility off. This is pretty lightly tested. you could >>> eliminate >>> >>> (defun hide-results (&optional &rest args) >>> (let ((results (cdr (assoc :results (third >>> (org-babel-get-src-block-info 'light)))))) >>> (when (string-match "hide" results) >>> (org-babel-hide-result-toggle t)))) >>> >>> (add-hook 'org-babel-after-execute-hook 'hide-results) >>> >>> (advice-add 'org-babel-execute-src-block :before (lambda (&rest args) >>> (org-babel-remove-result))) >>> >>> I guess there are other ways that might work too. >>> >>> #+BEGIN_SRC jupyter-python :results hide >>> print(5) >>> #+END_SRC >>> >>> #+RESULTS: >>> : 5 >>> >>> >>> John >>> >>> ----------------------------------- >>> Professor John Kitchin (he/him/his) >>> Doherty Hall A207F >>> Department of Chemical Engineering >>> Carnegie Mellon University >>> Pittsburgh, PA 15213 >>> 412-268-7803 >>> @johnkitchin >>> http://kitchingroup.cheme.cmu.edu >>> >>> >>> >>> On Mon, Jun 7, 2021 at 10:03 AM Nick Savage wrote: >>> >>>> My initial thoughts are that this is very possible. This might be an >>>> area where we could add a new defcustom on always hiding the results to >>>> allow the user to choose it. Without looking at the code, I think it >>>> would be pretty straight forward to make an excursion to the results >>>> line, toggle showing it, then going back to where the point was. >>>> >>>> I can take a crack at a patch in the next day or so if no one else >>>> wants >>>> to or gets there first. >>>> >>>> On 6/7/21 8:51 AM, Roger Mason wrote: >>>> > Hello, >>>> > >>>> > I'd like to be able to hide results, for example when I expect the >>>> > them to span many lines. I know I can hit =tab= on the #+RESULTS: >>>> line, >>>> > but I'd like to be able to set this automatically. >>>> > >>>> > My most recent effort: >>>> > >>>> > #+name: hideresults >>>> > #+begin_src emacs-lisp :results none :exports none >>>> > (add-to-invisibility-spec '(org-babel-hide-result . t)) >>>> > #+end_src >>>> > >>>> > run like this >>>> > >>>> > #+header: :engine postgresql :dbhost "localhost" :dbuser "rmason" >>>> :database "test" :colnames yes >>>> > #+header: :post hideresults >>>> > #+name: pgquery >>>> > #+begin_src sql >>>> > select timestamp,nempty0 from settings where timestamp like >>>> '%20210528%' >>>> > #+end_src >>>> > >>>> > produces >>>> > >>>> > #+RESULTS: pgquery >>>> > : nil >>>> > >>>> > I'm sure there is a way to do this, but I need some pointers as to >>>> how. >>>> > >>>> > Thanks for any help. >>>> > >>>> > Roger >>>> > >>>> > Org mode version 9.2.3 (release_9.2.3-390-gfb5091 @ >>>> > /home/rmason/.emacs.d/org-git/lisp/) >>>> > >>>> > GNU Emacs 27.2 (build 1, amd64-portbld-freebsd11.4, X toolkit, cairo >>>> version 1.16.0, Xaw3d scroll bars) >>>> > >>>> >>>> --000000000000caecb905c4340c83 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Cool, thanks!=C2=A0

On Mon, Jun 7, 2021 at 4:31 PM John= Kitchin <jkitchin@andrew.cmu= .edu> wrote:
it is the name of blocks that use emacs-jupyter (https:/= /github.com/nnicandro/emacs-jupyter)=C2=A0 (instead of ob-ipython). Bas= ically it is a connection between org-src blocks and a jupyter kernel (it d= oes not have to be python, it can be julia, R, etc.) I am trying it out thi= s summer.

I think that code should work on most src-bloc= ks though.

John

-----------------------------------
P= rofessor John Kitchin (he/him/his)
Doherty Hall A207F
Department of C= hemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213412-268-7803


On Mon, Jun 7, 20= 21 at 5:21 PM George Mauer <gmauer@gmail.com> wrote:
Woah woah. What is the=C2=A0j= upyter-python language, John?

On Mon, Jun 7, 2021, 15:44 John Kitchin <<= a href=3D"mailto:jkitchin@andrew.cmu.edu" target=3D"_blank">jkitchin@andrew= .cmu.edu> wrote:
This is doable with a hook and advice I think. The= hook will hide the results if you use :results hide in the header.
I had to use the advice to remove the results before hand, so t= hat you toggle the visibility off. This is pretty lightly tested. you could= eliminate=C2=A0

(defun hide-results (&optional = &rest args)
=C2=A0 (let ((results (cdr (assoc :results (third (org-b= abel-get-src-block-info 'light))))))
=C2=A0 =C2=A0 (when (string-mat= ch "hide" results)
=C2=A0 =C2=A0 =C2=A0 (org-babel-hide-result= -toggle t))))

(add-hook 'org-babel-after-execute-hook 'hide-= results)

(advice-add 'org-babel-execute-src-block :before (lambd= a (&rest args) (org-babel-remove-result)))

I guess there are other ways that might work too.

#+BEGIN_SR= C jupyter-python :results hide
print(5)
#+END_SRC

#+RESULTS:: 5


John

----------------------------= -------
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Dep= artment of Chemical Engineering
Carnegie Mellon University
Pittsburgh= , PA 15213
412-268-7803

On Mon, Jun 7, 2021 at 10:03 AM Nick Savage <nick@nicksa= vage.ca> wrote:
My initial thoughts are that this is very possible. This might be an=
area where we could add a new defcustom on always hiding the results to allow the user to choose it. Without looking at the code, I think it
would be pretty straight forward to make an excursion to the results
line, toggle showing it, then going back to where the point was.

I can take a crack at a patch in the next day or so if no one else wants to or gets there first.

On 6/7/21 8:51 AM, Roger Mason wrote:
> Hello,
>
> I'd like to be able to hide results, for example when I expect the=
> them to span many lines.=C2=A0 I know I can hit =3Dtab=3D on the #+RES= ULTS: line,
> but I'd like to be able to set this automatically.
>
> My most recent effort:
>
> #+name: hideresults
> #+begin_src emacs-lisp :results none :exports none
> (add-to-invisibility-spec '(org-babel-hide-result . t))
> #+end_src
>
> run like this
>
> #+header: :engine postgresql :dbhost "localhost"=C2=A0 :dbus= er "rmason" :database "test" :colnames yes
> #+header: :post hideresults
> #+name: pgquery
> #+begin_src sql
> select timestamp,nempty0 from settings where timestamp like '%2021= 0528%'
> #+end_src
>
> produces
>
> #+RESULTS: pgquery
> : nil
>
> I'm sure there is a way to do this, but I need some pointers as to= how.
>
> Thanks for any help.
>
> Roger
>
> Org mode version 9.2.3 (release_9.2.3-390-gfb5091 @
> /home/rmason/.emacs.d/org-git/lisp/)
>
> GNU Emacs 27.2 (build 1, amd64-portbld-freebsd11.4, X toolkit, cairo v= ersion 1.16.0, Xaw3d scroll bars)
>

--000000000000caecb905c4340c83--