emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* ob-scheme haunted source code block?
@ 2020-01-17 11:59 Joost Kremers
  2020-01-21 14:46 ` Neil Jerram
  0 siblings, 1 reply; 3+ messages in thread
From: Joost Kremers @ 2020-01-17 11:59 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

Hi list,

I've been learning some Scheme recently and decided to use Org 
mode and babel so I could document my progress, keep notes, etc. 
together with the code I write. I also installed the geiser 
package to work with Scheme source files directly. 

This all worked perfectly, until I made the (apparent) mistake of 
typing =C-c C-c= on an expression while editing a source code 
block. That is, I had pressed =C-c '= in an Org buffer on a source 
block and in the editing buffer that popped up, I hit =C-c C-c= 
(bound to =geiser-eval-definition=) on a particular function (well 
procedure...) definition.

From that moment on, that particular procedure definition seems 
haunted. Whenever I evaluate a source block containing it from 
within an Org file, the associated REPL is doomed. It takes about 
30 seconds for the evaluation to complete, during which time Emacs 
seems to hang (no CPU activity, just waiting). Any further 
interaction with the REPL from that point on, either from other 
source blocks in the same file (all source blocks in it use the 
same session) or in the REPL buffer directly, causes the same 
hang.

I can `C-g` out of the hang, but this doesn't solve much because 
any further interaction causes the same hang. 

Putting the relevant procedure definition in a Scheme source file 
and evaluating that (within Emacs, through geiser) is 
unproblematic, so the code itself is not to blame.

The weirdest thing about this is that the problem is persistent. I 
restarted Emacs and in my desperation even rebooted the computer, 
but to no avail.

Does anyone have any idea what might be going on? I rgrepped 
through my =.emacs.d= directory to see if the relevant procedure 
name turns up anywhere but found nothing. I'm not really sure 
where to look beyond that.

Versions:

IELM> emacs-version
"26.3"
IELM> org-version
"9.3.1"

TIA

Joost

-- 
Joost Kremers
Life has its moments

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

* Re: ob-scheme haunted source code block?
  2020-01-17 11:59 ob-scheme haunted source code block? Joost Kremers
@ 2020-01-21 14:46 ` Neil Jerram
  2020-01-23 10:07   ` Joost Kremers
  0 siblings, 1 reply; 3+ messages in thread
From: Neil Jerram @ 2020-01-21 14:46 UTC (permalink / raw)
  To: Joost Kremers; +Cc: emacs-orgmode@gnu.org

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

On Fri, 17 Jan 2020 at 12:01, Joost Kremers <joostkremers@fastmail.fm>
wrote:

> Hi list,
>
> I've been learning some Scheme recently and decided to use Org
> mode and babel so I could document my progress, keep notes, etc.
> together with the code I write. I also installed the geiser
> package to work with Scheme source files directly.
>
> This all worked perfectly, until I made the (apparent) mistake of
> typing =C-c C-c= on an expression while editing a source code
> block. That is, I had pressed =C-c '= in an Org buffer on a source
> block and in the editing buffer that popped up, I hit =C-c C-c=
> (bound to =geiser-eval-definition=) on a particular function (well
> procedure...) definition.
>
> From that moment on, that particular procedure definition seems
> haunted. Whenever I evaluate a source block containing it from
> within an Org file, the associated REPL is doomed. It takes about
> 30 seconds for the evaluation to complete, during which time Emacs
> seems to hang (no CPU activity, just waiting). Any further
> interaction with the REPL from that point on, either from other
> source blocks in the same file (all source blocks in it use the
> same session) or in the REPL buffer directly, causes the same
> hang.
>
> I can `C-g` out of the hang, but this doesn't solve much because
> any further interaction causes the same hang.
>
> Putting the relevant procedure definition in a Scheme source file
> and evaluating that (within Emacs, through geiser) is
> unproblematic, so the code itself is not to blame.
>

OK, up to this point I am thinking: this is all quite curious, but
presumably not really a big problem, as you surely don't need to use this
rather strange workflow...


> The weirdest thing about this is that the problem is persistent. I
> restarted Emacs and in my desperation even rebooted the computer,
> but to no avail.
>

But this is indeed weird.  Are you saying that you can reboot your
computer, restart Emacs, open the relevant Org file, evaluate the source
block (without any C-c ') and you still see the problem?

If so, I wonder if it's a real but intermittent problem in your code that
was somehow made more likely by the original workflow, and now you're just
being unlucky?


>
> Does anyone have any idea what might be going on? I rgrepped
> through my =.emacs.d= directory to see if the relevant procedure
> name turns up anywhere but found nothing. I'm not really sure
> where to look beyond that.
>
> Versions:
>
> IELM> emacs-version
> "26.3"
> IELM> org-version
> "9.3.1"
>
> TIA
>
> Joost
>
> --
> Joost Kremers
> Life has its moments
>
>
Best wishes,
   Neil

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

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

* Re: ob-scheme haunted source code block?
  2020-01-21 14:46 ` Neil Jerram
@ 2020-01-23 10:07   ` Joost Kremers
  0 siblings, 0 replies; 3+ messages in thread
From: Joost Kremers @ 2020-01-23 10:07 UTC (permalink / raw)
  To: Neil Jerram; +Cc: emacs-orgmode


On Tue, Jan 21 2020, Neil Jerram wrote:
> OK, up to this point I am thinking: this is all quite curious, 
> but
> presumably not really a big problem, as you surely don't need to 
> use this
> rather strange workflow...

Mind you, that's not my normal workflow. I normally just do =C-'= 
to edit a source block, =C-'= to finish the edit and return to the 
Org file, and then =C-c C-c= to evaluate the source block. The 
rest was just to try and find out where the problem lies.

>> The weirdest thing about this is that the problem is 
>> persistent. I
>> restarted Emacs and in my desperation even rebooted the 
>> computer,
>> but to no avail.
>
> But this is indeed weird.  Are you saying that you can reboot 
> your
> computer, restart Emacs, open the relevant Org file, evaluate 
> the source
> block (without any C-c ') and you still see the problem?

Yes, that was what was happening. I suspected there might be some 
history being kept somewhere, that's why I grepped through my 
=~/.emacs.d/= directory.

> If so, I wonder if it's a real but intermittent problem in your 
> code that
> was somehow made more likely by the original workflow, and now 
> you're just
> being unlucky?

The code was fairly straightforward (and not even mine... It came 
directly from SICP), so I doubt that had much to do with it.

Anyway, I'm gonna have to put this down as a Heisenbug. The 
problem disappeared after a while and I can't reproduce it: Going 
through the steps that I thought triggered the bug doesn't 
recreate it. Weird.

Thanks for reading and apologies for wasting everyone's time...

Joost

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

end of thread, other threads:[~2020-01-23 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17 11:59 ob-scheme haunted source code block? Joost Kremers
2020-01-21 14:46 ` Neil Jerram
2020-01-23 10:07   ` Joost Kremers

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).