emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to stop results being hidden when using ":results drawer"?
@ 2022-05-11 16:52 Richard Stanton
  2022-05-11 17:51 ` Richard Stanton
  2022-05-12 10:14 ` Ihor Radchenko
  0 siblings, 2 replies; 13+ messages in thread
From: Richard Stanton @ 2022-05-11 16:52 UTC (permalink / raw)
  To: orgmode

I’m creating documents where I run Python code blocks that create LaTeX mathematical output that I want to be able to export to either LaTeX/PDF or HTML. 

Using :wrap in the header works fine, except that LaTeX complains about the unknown environment “results” (it still compiles the file to PDF fine).

Using :wrap export latex works fine for LaTeX export, but I can’t get HTML that way.

The recommended method seems to be to use :results drawer. This works fine from an export perspective to both LaTeX/PDF and to HTML. However, it has one significant drawback when I’m actually creating the document: the results drawer starts out hidden and to see what’s there I have to click on it. This makes debugging the code in the first place a lot less convenient.

Is there a way to use :results drawer and have the results NOT hidden by default?

Thanks for any suggestions!

Richard Stanton




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to stop results being hidden when using ":results drawer"?
  2022-05-11 16:52 How to stop results being hidden when using ":results drawer"? Richard Stanton
@ 2022-05-11 17:51 ` Richard Stanton
  2022-05-11 20:14   ` Richard Stanton
  2022-05-12 10:14 ` Ihor Radchenko
  1 sibling, 1 reply; 13+ messages in thread
From: Richard Stanton @ 2022-05-11 17:51 UTC (permalink / raw)
  To: orgmode

I see that the same question was asked by John Kitchin in 2016. The accepted answer back then was either to put

#+STARTUP: showeverything

at the top of the org file or to use (setq org-startup-folded "showeverything”).

I don’t know if something has changed in org since then, but neither of these seems to work for me at the moment. All of my :results: drawers start out and remain hidden until I click on them and press TAB.


> On May 11, 2022, at 9:52 AM, Richard Stanton <rhstanton@berkeley.edu> wrote:
> 
> I’m creating documents where I run Python code blocks that create LaTeX mathematical output that I want to be able to export to either LaTeX/PDF or HTML. 
> 
> Using :wrap in the header works fine, except that LaTeX complains about the unknown environment “results” (it still compiles the file to PDF fine).
> 
> Using :wrap export latex works fine for LaTeX export, but I can’t get HTML that way.
> 
> The recommended method seems to be to use :results drawer. This works fine from an export perspective to both LaTeX/PDF and to HTML. However, it has one significant drawback when I’m actually creating the document: the results drawer starts out hidden and to see what’s there I have to click on it. This makes debugging the code in the first place a lot less convenient.
> 
> Is there a way to use :results drawer and have the results NOT hidden by default?
> 
> Thanks for any suggestions!
> 
> Richard Stanton
> 
> 



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to stop results being hidden when using ":results drawer"?
  2022-05-11 17:51 ` Richard Stanton
@ 2022-05-11 20:14   ` Richard Stanton
  2022-05-11 20:18     ` John Kitchin
  0 siblings, 1 reply; 13+ messages in thread
From: Richard Stanton @ 2022-05-11 20:14 UTC (permalink / raw)
  To: orgmode

It works fine when I use emacs -Q, so I did some hunting around and discovered that it’s a bad interaction with the xenops package. A shame, as this package does a great job of almost-real-time previewing of LaTeX equations, figure and tables.


> On May 11, 2022, at 10:51 AM, Richard Stanton <rhstanton@berkeley.edu> wrote:
> 
> I see that the same question was asked by John Kitchin in 2016. The accepted answer back then was either to put
> 
> #+STARTUP: showeverything
> 
> at the top of the org file or to use (setq org-startup-folded "showeverything”).
> 
> I don’t know if something has changed in org since then, but neither of these seems to work for me at the moment. All of my :results: drawers start out and remain hidden until I click on them and press TAB.
> 
> 
>> On May 11, 2022, at 9:52 AM, Richard Stanton <rhstanton@berkeley.edu> wrote:
>> 
>> I’m creating documents where I run Python code blocks that create LaTeX mathematical output that I want to be able to export to either LaTeX/PDF or HTML. 
>> 
>> Using :wrap in the header works fine, except that LaTeX complains about the unknown environment “results” (it still compiles the file to PDF fine).
>> 
>> Using :wrap export latex works fine for LaTeX export, but I can’t get HTML that way.
>> 
>> The recommended method seems to be to use :results drawer. This works fine from an export perspective to both LaTeX/PDF and to HTML. However, it has one significant drawback when I’m actually creating the document: the results drawer starts out hidden and to see what’s there I have to click on it. This makes debugging the code in the first place a lot less convenient.
>> 
>> Is there a way to use :results drawer and have the results NOT hidden by default?
>> 
>> Thanks for any suggestions!
>> 
>> Richard Stanton
>> 
>> 
> 



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to stop results being hidden when using ":results drawer"?
  2022-05-11 20:14   ` Richard Stanton
@ 2022-05-11 20:18     ` John Kitchin
  0 siblings, 0 replies; 13+ messages in thread
From: John Kitchin @ 2022-05-11 20:18 UTC (permalink / raw)
  To: Richard Stanton; +Cc: orgmode

[-- Attachment #1: Type: text/plain, Size: 2420 bytes --]

hm. what is xenops doing? That isn't a package I use, but my results
drawers are also closed when opening a file.

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 Wed, May 11, 2022 at 4:16 PM Richard Stanton <rhstanton@berkeley.edu>
wrote:

> It works fine when I use emacs -Q, so I did some hunting around and
> discovered that it’s a bad interaction with the xenops package. A shame, as
> this package does a great job of almost-real-time previewing of LaTeX
> equations, figure and tables.
>
>
> > On May 11, 2022, at 10:51 AM, Richard Stanton <rhstanton@berkeley.edu>
> wrote:
> >
> > I see that the same question was asked by John Kitchin in 2016. The
> accepted answer back then was either to put
> >
> > #+STARTUP: showeverything
> >
> > at the top of the org file or to use (setq org-startup-folded
> "showeverything”).
> >
> > I don’t know if something has changed in org since then, but neither of
> these seems to work for me at the moment. All of my :results: drawers start
> out and remain hidden until I click on them and press TAB.
> >
> >
> >> On May 11, 2022, at 9:52 AM, Richard Stanton <rhstanton@berkeley.edu>
> wrote:
> >>
> >> I’m creating documents where I run Python code blocks that create LaTeX
> mathematical output that I want to be able to export to either LaTeX/PDF or
> HTML.
> >>
> >> Using :wrap in the header works fine, except that LaTeX complains about
> the unknown environment “results” (it still compiles the file to PDF fine).
> >>
> >> Using :wrap export latex works fine for LaTeX export, but I can’t get
> HTML that way.
> >>
> >> The recommended method seems to be to use :results drawer. This works
> fine from an export perspective to both LaTeX/PDF and to HTML. However, it
> has one significant drawback when I’m actually creating the document: the
> results drawer starts out hidden and to see what’s there I have to click on
> it. This makes debugging the code in the first place a lot less convenient.
> >>
> >> Is there a way to use :results drawer and have the results NOT hidden
> by default?
> >>
> >> Thanks for any suggestions!
> >>
> >> Richard Stanton
> >>
> >>
> >
>
>
>

[-- Attachment #2: Type: text/html, Size: 3281 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to stop results being hidden when using ":results drawer"?
  2022-05-11 16:52 How to stop results being hidden when using ":results drawer"? Richard Stanton
  2022-05-11 17:51 ` Richard Stanton
@ 2022-05-12 10:14 ` Ihor Radchenko
  2022-05-12 13:07   ` John Kitchin
  2022-05-12 17:04   ` Richard H. Stanton
  1 sibling, 2 replies; 13+ messages in thread
From: Ihor Radchenko @ 2022-05-12 10:14 UTC (permalink / raw)
  To: Richard Stanton; +Cc: orgmode

Richard Stanton <rhstanton@berkeley.edu> writes:

> I’m creating documents where I run Python code blocks that create LaTeX mathematical output that I want to be able to export to either LaTeX/PDF or HTML. 
>
> Using :wrap in the header works fine, except that LaTeX complains about the unknown environment “results” (it still compiles the file to PDF fine).
>
> Using :wrap export latex works fine for LaTeX export, but I can’t get HTML that way.
>
> The recommended method seems to be to use :results drawer. This works fine from an export perspective to both LaTeX/PDF and to HTML. However, it has one significant drawback when I’m actually creating the document: the results drawer starts out hidden and to see what’s there I have to click on it. This makes debugging the code in the first place a lot less convenient.
>
> Is there a way to use :results drawer and have the results NOT hidden by default?

I think that you are experiencing the same issue with
https://list.orgmode.org/80k0ar1lml.fsf@felesatra.moe/T/#u

Does it help when you run
M-: (setq org-fold-core-first-unfold-functionsp nil) <RET>
before running the code block?

Best,
Ihor


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to stop results being hidden when using ":results drawer"?
  2022-05-12 10:14 ` Ihor Radchenko
@ 2022-05-12 13:07   ` John Kitchin
  2022-05-13 12:11     ` Ihor Radchenko
  2022-05-12 17:04   ` Richard H. Stanton
  1 sibling, 1 reply; 13+ messages in thread
From: John Kitchin @ 2022-05-12 13:07 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Richard Stanton, emacs-orgmode

This does not change anything for me.

The function that causes folding for me is `org-entry-show'. Presumably
because of this line: (org-cycle-hide-drawers 'children)

My solution was an override advice that makes this function not run when
point is in a src-block
(https://github.com/jkitchin/scimax/blob/master/scimax-jupyter.el#L281).


Ihor Radchenko <yantar92@gmail.com> writes:

> Richard Stanton <rhstanton@berkeley.edu> writes:
>
>> I’m creating documents where I run Python code blocks that create LaTeX mathematical output that I want to be able to export to either LaTeX/PDF or HTML. 
>>
>> Using :wrap in the header works fine, except that LaTeX complains about the unknown environment “results” (it still compiles the file to PDF fine).
>>
>> Using :wrap export latex works fine for LaTeX export, but I can’t get HTML that way.
>>
>> The recommended method seems to be to use :results drawer. This works fine
>> from an export perspective to both LaTeX/PDF and to HTML. However, it has one
>> significant drawback when I’m actually creating the document: the results
>> drawer starts out hidden and to see what’s there I have to click on it. This
>> makes debugging the code in the first place a lot less convenient.
>>
>> Is there a way to use :results drawer and have the results NOT hidden by default?
>
> I think that you are experiencing the same issue with
> https://list.orgmode.org/80k0ar1lml.fsf@felesatra.moe/T/#u
>
> Does it help when you run
> M-: (setq org-fold-core-first-unfold-functionsp nil) <RET>
> before running the code block?
>
> Best,
> Ihor


-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu
Pronouns: he/him/his


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to stop results being hidden when using ":results drawer"?
  2022-05-12 10:14 ` Ihor Radchenko
  2022-05-12 13:07   ` John Kitchin
@ 2022-05-12 17:04   ` Richard H. Stanton
  1 sibling, 0 replies; 13+ messages in thread
From: Richard H. Stanton @ 2022-05-12 17:04 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: orgmode


>> I’m creating documents where I run Python code blocks that create LaTeX mathematical output that I want to be able to export to either LaTeX/PDF or HTML. 
>> 
>> Using :wrap in the header works fine, except that LaTeX complains about the unknown environment “results” (it still compiles the file to PDF fine).
>> 
>> Using :wrap export latex works fine for LaTeX export, but I can’t get HTML that way.
>> 
>> The recommended method seems to be to use :results drawer. This works fine from an export perspective to both LaTeX/PDF and to HTML. However, it has one significant drawback when I’m actually creating the document: the results drawer starts out hidden and to see what’s there I have to click on it. This makes debugging the code in the first place a lot less convenient.
>> 
>> Is there a way to use :results drawer and have the results NOT hidden by default?
> 
> I think that you are experiencing the same issue with
> https://list.orgmode.org/80k0ar1lml.fsf@felesatra.moe/T/#u
> 
> Does it help when you run
> M-: (setq org-fold-core-first-unfold-functionsp nil) <RET>
> before running the code block?
> 
> Best,
> Ihor

Thanks for the suggestion, Ihor, but like John, this doesn’t solve my problem. For now, I'm using :wrap flushleft, which allows exporting to both LaTeX and HTML without errors, allows xenops to preview my LaTeX output, and doesn’t have any hiding issues. I’ve also reported the issue to the author of xenops.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to stop results being hidden when using ":results drawer"?
  2022-05-12 13:07   ` John Kitchin
@ 2022-05-13 12:11     ` Ihor Radchenko
  2022-05-13 12:46       ` John Kitchin
  0 siblings, 1 reply; 13+ messages in thread
From: Ihor Radchenko @ 2022-05-13 12:11 UTC (permalink / raw)
  To: John Kitchin; +Cc: Richard Stanton, emacs-orgmode

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> This does not change anything for me.
>
> The function that causes folding for me is `org-entry-show'. Presumably
> because of this line: (org-cycle-hide-drawers 'children)
>
> My solution was an override advice that makes this function not run when
> point is in a src-block
> (https://github.com/jkitchin/scimax/blob/master/scimax-jupyter.el#L281).

Could you elaborate? I am not sure how `org-entry-show' has anything to
do with hiding results.

I tried the following Org file with latest Org main (after (require 'ob-python)):

* test heading

#+begin_src python :results drawer output
  print(1+2)
#+end_src

#+RESULTS:
:results:
3
:end:

The drawer does not get hidden.

Best,
Ihor


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to stop results being hidden when using ":results drawer"?
  2022-05-13 12:11     ` Ihor Radchenko
@ 2022-05-13 12:46       ` John Kitchin
  2022-05-13 13:35         ` [PATCH] " Ihor Radchenko
  0 siblings, 1 reply; 13+ messages in thread
From: John Kitchin @ 2022-05-13 12:46 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Richard Stanton, emacs-orgmode

If you add this and click on it:


[[elisp:(org-show-entry)]]

The drawer will collapse.

This issue is specific to using a scimax function
`scimax-ob-execute-and-next-block` that executes the current block then
moves to the next or creates a new block if needed. This is a UI feature
from jupyter notebooks that I like to use.

That function uses `(org-babel-next-src-block)`, which uses
org-next-block, which calls org-show-context, which uses
org-show-set-visibility, which calls org-show-entry, which hides the
drawers.

It isn't an org-core issue perhaps, other than it is not obvious why
org-show-entry has a hard-coded line to hide drawers in it.


Ihor Radchenko <yantar92@gmail.com> writes:

> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>
>> This does not change anything for me.
>>
>> The function that causes folding for me is `org-entry-show'. Presumably
>> because of this line: (org-cycle-hide-drawers 'children)
>>
>> My solution was an override advice that makes this function not run when
>> point is in a src-block
>> (https://github.com/jkitchin/scimax/blob/master/scimax-jupyter.el#L281).
>
> Could you elaborate? I am not sure how `org-entry-show' has anything to
> do with hiding results.
>
> I tried the following Org file with latest Org main (after (require 'ob-python)):
>
> * test heading
>
> #+begin_src python :results drawer output
>   print(1+2)
> #+end_src
>
> #+RESULTS:
> :results:
> 3
> :end:
>
> The drawer does not get hidden.
>
> Best,
> Ihor


-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu
Pronouns: he/him/his


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] Re: How to stop results being hidden when using ":results drawer"?
  2022-05-13 12:46       ` John Kitchin
@ 2022-05-13 13:35         ` Ihor Radchenko
  2022-05-13 15:39           ` Eric S Fraga
  2022-07-31  2:21           ` Ihor Radchenko
  0 siblings, 2 replies; 13+ messages in thread
From: Ihor Radchenko @ 2022-05-13 13:35 UTC (permalink / raw)
  To: John Kitchin; +Cc: Richard Stanton, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1071 bytes --]

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> This issue is specific to using a scimax function
> `scimax-ob-execute-and-next-block` that executes the current block then
> moves to the next or creates a new block if needed. This is a UI feature
> from jupyter notebooks that I like to use.
>
> That function uses `(org-babel-next-src-block)`, which uses
> org-next-block, which calls org-show-context, which uses
> org-show-set-visibility, which calls org-show-entry, which hides the
> drawers.
>
> It isn't an org-core issue perhaps, other than it is not obvious why
> org-show-entry has a hard-coded line to hide drawers in it.

I'd say that it is org-core issue. The current behaviour does not really
follow what org-fold-show-entry docstring promises:

>> Show the body directly following its heading.

>> Show the heading too, if it is currently invisible.

In fact, forcefully folding the drawers is relatively recent addition by
Nicolas in 1027e0256903bc2.

I am attaching the patch making drawer folding controllable via optional
argument. WDYT?

Best,
Ihor


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-fold-show-entry-Do-not-fold-drawers-unless-reque.patch --]
[-- Type: text/x-patch, Size: 6581 bytes --]

From bd3c7ac6162d64a19eff370b7b22ba233f8480ad Mon Sep 17 00:00:00 2001
Message-Id: <bd3c7ac6162d64a19eff370b7b22ba233f8480ad.1652448909.git.yantar92@gmail.com>
From: Ihor Radchenko <yantar92@gmail.com>
Date: Fri, 13 May 2022 21:30:46 +0800
Subject: [PATCH] org-fold-show-entry: Do not fold drawers unless requested

* lisp/org-fold.el (org-fold-show-entry): Do not fold drawers in the
unfolded entry unless the new optional argument is non-nil.  Folding
the drawers was introduced in 1027e0256903bc2, but does not follow the
function docstring.  Moreover, folding drawers creates unexpected
behaviour in some cases.  See
https://orgmode.org/list/m2a6bl4mmr.fsf@andrew.cmu.edu

* etc/ORG-NEWS (~org-fold-show-entry~ does not fold drawers by default
anymore): Document the change.

* lisp/org-agenda.el (org-agenda-show):
(org-agenda-show-and-scroll-up):
(org-agenda-show-1):
* lisp/org-clock.el (org-clock-goto):
* lisp/org-compat.el (outline-toggle-children):
* lisp/org-timer.el (org-timer--get-timer-title):
* lisp/org.el (org-move-subtree-down):
(org-return): Explicitly request folding drawers inside the revealed
entry in the places where it appears to make sense.
---
 etc/ORG-NEWS       | 7 +++++++
 lisp/org-agenda.el | 6 +++---
 lisp/org-clock.el  | 2 +-
 lisp/org-compat.el | 2 +-
 lisp/org-fold.el   | 4 ++--
 lisp/org-timer.el  | 2 +-
 lisp/org.el        | 4 ++--
 7 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 582816534..15986c935 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -190,6 +190,13 @@ installed. It uses Emacs' font-lock information, and so tends to
 produce results superior to Minted or Listings.
 
 ** New functions and changes in function arguments
+*** ~org-fold-show-entry~ does not fold drawers by default anymore
+
+~org-fold-show-entry~ now accepts an optional argument HIDE-DRAWERS.
+When the argument is non-nil, the function folds all the drawers
+inside entry.  This was the default previously.
+
+Now, ~org-fold-show-entry~ does not fold drawers by default.
 
 *** New function ~org-element-cache-map~ for quick mapping across Org elements
 
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 0479a0e1f..6fd0e4498 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -9701,7 +9701,7 @@ (defun org-agenda-show (&optional full-entry)
   (interactive "P")
   (let ((win (selected-window)))
     (org-agenda-goto t)
-    (when full-entry (org-fold-show-entry))
+    (when full-entry (org-fold-show-entry 'hide-drawers))
     (select-window win)))
 
 (defvar org-agenda-show-window nil)
@@ -9720,7 +9720,7 @@ (defun org-agenda-show-and-scroll-up (&optional arg)
 	  (select-window org-agenda-show-window)
 	  (ignore-errors (scroll-up)))
       (org-agenda-goto t)
-      (org-fold-show-entry)
+      (org-fold-show-entry 'hide-drawers)
       (if arg (org-cycle-hide-drawers 'children)
 	(org-with-wide-buffer
 	 (narrow-to-region (org-entry-beginning-position)
@@ -9764,7 +9764,7 @@ (defun org-agenda-show-1 (&optional more)
      ((and (called-interactively-p 'any) (= more 1))
       (message "Remote: show with default settings"))
      ((= more 2)
-      (org-fold-show-entry)
+      (org-fold-show-entry 'hide-drawers)
       (org-fold-show-children)
       (save-excursion
 	(org-back-to-heading)
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index ec87aaf8a..c04a8fdcf 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1849,7 +1849,7 @@ (defun org-clock-goto (&optional select)
     (pop-to-buffer-same-window (marker-buffer m))
     (if (or (< m (point-min)) (> m (point-max))) (widen))
     (goto-char m)
-    (org-fold-show-entry)
+    (org-fold-show-entry 'hide-drawers)
     (org-back-to-heading t)
     (recenter org-clock-goto-before-context)
     (org-fold-reveal)
diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 704197645..8553500d6 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -1400,7 +1400,7 @@ (defadvice outline-toggle-children (around outline-toggle-children@fix-for-org-f
               (if (not (org-fold-folded-p (line-end-position)))
                   (org-fold-hide-subtree)
                 (org-fold-show-children)
-                (org-fold-show-entry))))
+                (org-fold-show-entry 'hide-drawers))))
     ad-do-it))
 
 ;; TODO: outline-headers-as-kill
diff --git a/lisp/org-fold.el b/lisp/org-fold.el
index acf7c0761..482b5772b 100644
--- a/lisp/org-fold.el
+++ b/lisp/org-fold.el
@@ -514,7 +514,7 @@ (defun org-fold-hide-sublevels (levels)
       (if (and (bolp) (not (bobp)) (outline-invisible-p (1- (point))))
           (org-fold-region (max (point-min) (1- (point))) (point) nil)))))
 
-(defun org-fold-show-entry ()
+(defun org-fold-show-entry (&optional hide-drawers)
   "Show the body directly following its heading.
 Show the heading too, if it is currently invisible."
   (interactive)
@@ -529,7 +529,7 @@ (defun org-fold-show-entry ()
  	 (point-max)))
      nil
      'outline)
-    (org-cycle-hide-drawers 'children)))
+    (when hide-drawers (org-cycle-hide-drawers 'children))))
 
 (defalias 'org-fold-show-hidden-entry #'org-fold-show-entry
   "Show an entry where even the heading is hidden.")
diff --git a/lisp/org-timer.el b/lisp/org-timer.el
index 0c9350e76..f8e753edf 100644
--- a/lisp/org-timer.el
+++ b/lisp/org-timer.el
@@ -478,7 +478,7 @@ (defun org-timer--get-timer-title ()
 	(with-current-buffer (marker-buffer marker)
 	  (org-with-wide-buffer
 	   (goto-char hdmarker)
-	   (org-fold-show-entry)
+	   (org-fold-show-entry 'hide-drawers)
 	   (or (ignore-errors (org-get-heading))
 	       (buffer-name (buffer-base-buffer))))))))
    ((derived-mode-p 'org-mode)
diff --git a/lisp/org.el b/lisp/org.el
index 47a16e94b..0f761e475 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6765,7 +6765,7 @@ (defun org-move-subtree-down (&optional arg)
      (move-marker ins-point nil)
      (if folded
 	 (org-fold-subtree t)
-       (org-fold-show-entry)
+       (org-fold-show-entry 'hide-drawers)
        (org-fold-show-children))
      (org-clean-visibility-after-subtree-move)
      ;; move back to the initial column we were at
@@ -17261,7 +17261,7 @@ (defun org-return (&optional indent arg interactive)
 	 (org-auto-align-tags (org-align-tags))
 	 (t (org--align-tags-here tags-column))) ;preserve tags column
 	(end-of-line)
-	(org-fold-show-entry)
+	(org-fold-show-entry 'hide-drawers)
 	(org--newline indent arg interactive)
 	(when string (save-excursion (insert (org-trim string))))))
      ;; In a list, make sure indenting keeps trailing text within.
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] Re: How to stop results being hidden when using ":results drawer"?
  2022-05-13 13:35         ` [PATCH] " Ihor Radchenko
@ 2022-05-13 15:39           ` Eric S Fraga
  2022-05-13 16:19             ` Ihor Radchenko
  2022-07-31  2:21           ` Ihor Radchenko
  1 sibling, 1 reply; 13+ messages in thread
From: Eric S Fraga @ 2022-05-13 15:39 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: John Kitchin, Richard Stanton, emacs-orgmode

On Friday, 13 May 2022 at 21:35, Ihor Radchenko wrote:
> In fact, forcefully folding the drawers is relatively recent addition by
> Nicolas in 1027e0256903bc2.

I wonder if this is related to my issue with ediff-ing org buffers and
having drawers hidden?  I've not had time yet to investigate but
interesting coincidence maybe?

-- 
: Eric S Fraga, with org release_9.5.3-481-gaea24b in Emacs 29.0.50


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Re: How to stop results being hidden when using ":results drawer"?
  2022-05-13 15:39           ` Eric S Fraga
@ 2022-05-13 16:19             ` Ihor Radchenko
  0 siblings, 0 replies; 13+ messages in thread
From: Ihor Radchenko @ 2022-05-13 16:19 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: John Kitchin, Richard Stanton, emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> On Friday, 13 May 2022 at 21:35, Ihor Radchenko wrote:
>> In fact, forcefully folding the drawers is relatively recent addition by
>> Nicolas in 1027e0256903bc2.
>
> I wonder if this is related to my issue with ediff-ing org buffers and
> having drawers hidden?  I've not had time yet to investigate but
> interesting coincidence maybe?

If I recall correctly, you had some drawers folded and some not in
ediff. That is a different issue and it should be fixed on the latest
main.

Best,
Ihor


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Re: How to stop results being hidden when using ":results drawer"?
  2022-05-13 13:35         ` [PATCH] " Ihor Radchenko
  2022-05-13 15:39           ` Eric S Fraga
@ 2022-07-31  2:21           ` Ihor Radchenko
  1 sibling, 0 replies; 13+ messages in thread
From: Ihor Radchenko @ 2022-07-31  2:21 UTC (permalink / raw)
  To: John Kitchin; +Cc: Richard Stanton, emacs-orgmode

Ihor Radchenko <yantar92@gmail.com> writes:

> In fact, forcefully folding the drawers is relatively recent addition by
> Nicolas in 1027e0256903bc2.
>
> I am attaching the patch making drawer folding controllable via optional
> argument. WDYT?

No objections have been given.
Applied onto main via 785f003de with slight modifications to address https://orgmode.org/list/m2a68zthgq.fsf@ntnu.no.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=785f003de527487d1557cb724dd4b8867b5ea657

Best,
Ihor


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-07-31  2:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-11 16:52 How to stop results being hidden when using ":results drawer"? Richard Stanton
2022-05-11 17:51 ` Richard Stanton
2022-05-11 20:14   ` Richard Stanton
2022-05-11 20:18     ` John Kitchin
2022-05-12 10:14 ` Ihor Radchenko
2022-05-12 13:07   ` John Kitchin
2022-05-13 12:11     ` Ihor Radchenko
2022-05-13 12:46       ` John Kitchin
2022-05-13 13:35         ` [PATCH] " Ihor Radchenko
2022-05-13 15:39           ` Eric S Fraga
2022-05-13 16:19             ` Ihor Radchenko
2022-07-31  2:21           ` Ihor Radchenko
2022-05-12 17:04   ` Richard H. Stanton

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).