geiser-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Geiser-users] geiser dbg in org-mode


From: Jose A. Ortega Ruiz
Subject: Re: [Geiser-users] geiser dbg in org-mode
Date: Wed, 23 Sep 2015 18:44:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Hi Lawrence,

I'm not very familiar with ob-scheme, and haven't had a chance to try it
these days, so take the following with a grain of salt :)

When you send anything to evaluate to geiser, it returns two things,
namely, a value for the expression, and any output it's producing.  In
this case, the result of evaluating `(letter ...)' is `#<unspecified>'
and, as a side effect, the contents you paste is produced.  When geiser
sees this result and output, by default, it writes it to the dbg buffer.

ob-scheme must do something to avoid that: either intercept the result
and output of the evaluation (by using lower-level geiser functions) or
arrange things so that the dbg buffer is buried after the evaluation.

My guess is that something is interferring when ob-scheme tries to do
that.  As something to try, does setting these variables help?

   (setq geiser-debug-jump-to-debug-p nil
         geiser-debug-show-debug-p nil)

If it does, ob-scheme should temporarily set those values and restore
them after doing its thing, probably by wrapping its thing in a
a (let ((geiser-debug-show-debug-p nil) ...) ...).

I'll try to give it a try if this doesn't help!

jao

On Wed, Sep 16 2015, Lawrence Bottorff wrote:

> I've got this code in an org-mode buffer (from HTDP)
>
> #+name: letter
> #+header:
> #+begin_src scheme :exports both :session ch1
> (define (letter fst lst signature-name)
>   (print (string-append
>    (opening fst)
>    "\n\n"
>    (body fst lst)
>    "\n\n"
>    (closing signature-name))))
>
> (define (opening fst)
>   (string-append "Dear " fst ","))
>
> (define (body fst lst)
>   (string-append
>    "We have discovered that all people with the last name " "\n"
>    lst " have won our lottery. So, " fst ", " "\n"
>    "hurry and pick up your prize."))
>
> (define (closing signature-name)
>   (string-append
>    "Sincerely,"
>    "\n\n"
>    signature-name
>    "\n"))
> #+end_src
>
> . . . nothing earth-shaking, and it is accepted and works in the "ch1" REPL 
> buffer. But if I try this with C-c C-c
>
> #+BEGIN_SRC scheme :session ch1
> (letter "Lawrence" "Bottorff" "The Grand Nagus")
> #+END_SRC
>
> I get
>
> #+RESULTS:
> : #<unspecified>
>
> and a new Geiser dbg buffer with this output:
>
> => #<unspecified>
>
> Dear Lawrence,
>
> We have discovered that all people with the last name 
> Bottorff have won our lottery. So, Lawrence, 
> hurry and pick up your prize.
>
> Sincerely,
>
> The Grand Nagus
>
> ;; -*- geiser-scheme-implementation: chicken -*-
> (letter "Lawrence" "Bottorff" "The Grand Nagus")
>
> This is the proper output -- but as a guile dbg buffer displacing the
> ch1 REPL? Please advise if this is a ob-scheme.el issue. (We've
> tracked down one major issue already.) ob-scheme is designed to work
> only with geiser, BTW.
>
> LB
>

-- 
All parts should go together without forcing. You must remember that
the parts you are reassembling were disassembled by you. Therefore, if
you can’t get them together again, there must be a reason. By all
means, do not use a hammer. —IBM Manual, 1925



reply via email to

[Prev in Thread] Current Thread [Next in Thread]