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 kO98JsZIv2CwdAAAgWs5BA (envelope-from ) for ; Tue, 08 Jun 2021 12:39:02 +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 qLq3IcZIv2AbSAAAB5/wlQ (envelope-from ) for ; Tue, 08 Jun 2021 10:39:02 +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 F14F4156B5 for ; Tue, 8 Jun 2021 12:39:01 +0200 (CEST) Received: from localhost ([::1]:46112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqZ8N-00031A-Uz for larch@yhetil.org; Tue, 08 Jun 2021 06:38:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqZ7n-00030z-Tw for emacs-orgmode@gnu.org; Tue, 08 Jun 2021 06:38:23 -0400 Received: from esa08.ucs.mun.ca ([134.153.136.28]:3354) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqZ7l-0004yY-Lm for emacs-orgmode@gnu.org; Tue, 08 Jun 2021 06:38:23 -0400 IronPort-SDR: Z1WwsSBV+a5G3IAhHcy0whlFOmQIdwr0niV9jXSt9YXejX9N1Etu4acgBWBXuuPNtMONCdeOsg LXg4ZD4R5JMp+gdBWM2R0XMFPm/hSoLXiGFsokhDPnZehXTePVK83wMRjuC1EUvA14xUZ7qfVe BxJvY/RDr2hhkbTJDe/fcBRpKxyD8plDq6gsm1+16LE9jajIGgmeJZsi63jRYP1/WMsFhyXIpu YV/hm1upubttyEFrvnQdsA1dKndM4Olcj924S05RiFxiPxoZ9gyYBhzDPjB4NDielYQXzDZbd/ XT0= IronPort-HdrOrdr: =?us-ascii?q?A9a23=3A74AJS6xfP0xPkTtARpswKrPwKL1zdoMgy1?= =?us-ascii?q?knxilNoH1uA66lfq+V/cjzuSWYtB8wXzU6lcmEKO2cRxrnm6KdgrNhXotKPj?= =?us-ascii?q?OHhILAFugL0WKh+Vbd8kbFmdK1u50NT4FDEtHqSVB1gcHmiTPTL+od?= X-IronPort-AV: E=Sophos;i="5.83,257,1616466600"; d="scan'208";a="52175338" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from cpe00fc8db7a323-cm00fc8db7a320.cpe.net.cable.rogers.com (HELO pyrope.local) ([174.117.202.255]) by smtp08.ucs.mun.ca with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2021 08:08:05 -0330 References: <4a32c014-cc70-f71d-aadf-f830bf5b8af8@nicksavage.ca> User-agent: mu4e 1.5.6; emacs 27.2 From: Roger Mason To: emacs-orgmode@gnu.org Subject: Re: Hiding results using :post In-reply-to: Date: Tue, 08 Jun 2021 08:08:03 -0230 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=134.153.136.28; envelope-from=rmason@mun.ca; helo=esa08.ucs.mun.ca X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , 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=1623148742; h=from:from:sender:sender: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; bh=bPxajWFgcImuoe2we0bq0PcmX0FpX2LQCKtjBlETvhg=; b=PHSgsZc5RGPq62ghrUA2At+YfscWAesjcSP433qoOzyr2ZjD+QC0n1999DBIuBlbZZF/Xo i/DpRQ/Jp1BhUw7PdHIJamBKlaP2GeHXcNgG2RzXJxwbEGqu2JfwEdKb72nmq8qY9XuO9S eD+7Jr/rM/LQlVnv2dOCm5UFEfdbc961q7Ks9MRSZCjVxM6DUQ5GBPaqNUtbp53KBlYDiE 05vCtBKWevPCIA+es5Z9fIa7KdzLTWC6ZbZsUwfH3KG2B3fKhrvRTJ3aC1cuMJZ2FBwONw iobmud8a4mqVzfSIDdJ+wHp2tv/JRLh+BPDCOVq2dlNZQyrvf89nznK+xVfY2A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623148742; a=rsa-sha256; cv=none; b=WcIdypbsXJrU6FSdpAjM0t3k9Kb3pFYgccCcAE4Ibu2HlkeoatepbQE7+Byb4IA8LZvPkV iRacvEScxrSjwhCA7y0IPuyi/Zrq+KEN9eDk1N4CBTgyzzD+/imu4wBzwPDxJDnGk+ebef G1XW2GlIEK9NN7nQWrgJJreN+qZ7gkRzBjQMiHy0jyYcTSdb7X88vRqFR214mrt1lonHYF 6Zok8FZzbW+nuaEfFZh6heSchZ1GJ5W30sIpgeTkXjRqmUe435Rdp7LQD3wPF66pcQ8Ogq TNlI5YPMHCMg5EkYytrd7ncGueNMJLH0BFpRP+Y99uaIVFt08x8M+zMOE8zafA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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: -2.42 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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: F14F4156B5 X-Spam-Score: -2.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: 0zpC2hficlTT Hello, John Kitchin writes: > 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 That works very well. Many thanks. Roger