unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* backing out of debugger
@ 2021-09-14 12:50 Mortimer Cladwell
  2021-09-14 13:11 ` Luis Felipe
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Mortimer Cladwell @ 2021-09-14 12:50 UTC (permalink / raw)
  To: guile-user

Hi,
Let's say I made a lot of mistakes. I look at my repl and see:
scheme@(guile-user) [10]>

Any way to back out to scheme@(guile-user)> without typing ,q ten times?
Thanks
Mortimer


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

* Re: backing out of debugger
  2021-09-14 12:50 backing out of debugger Mortimer Cladwell
@ 2021-09-14 13:11 ` Luis Felipe
  2021-09-14 13:27   ` Mortimer Cladwell
  2021-09-14 13:55 ` tomas
  2021-09-15 12:49 ` Matt Wette
  2 siblings, 1 reply; 9+ messages in thread
From: Luis Felipe @ 2021-09-14 13:11 UTC (permalink / raw)
  To: Mortimer Cladwell; +Cc: guile-user

Hi, Mortimer,

On Tuesday, September 14th, 2021 at 12:50 PM, Mortimer Cladwell <mbcladwell@gmail.com> wrote:

> Hi,
>
> Let's say I made a lot of mistakes. I look at my repl and see:
>
> scheme@(guile-user) [10]>
>
> Any way to back out to scheme@(guile-user)> without typing ,q ten times?

I don't know if there is a command for that, but maybe pressing Ctrl+D several times is easier than typing ,q several times?



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

* Re: backing out of debugger
  2021-09-14 13:11 ` Luis Felipe
@ 2021-09-14 13:27   ` Mortimer Cladwell
  2021-09-14 14:08     ` Luis Felipe
  0 siblings, 1 reply; 9+ messages in thread
From: Mortimer Cladwell @ 2021-09-14 13:27 UTC (permalink / raw)
  To: Luis Felipe; +Cc: guile-user

Thanks Luis. What about in emacs/geiser where Ctrl-D won't work?

On Tue, Sep 14, 2021 at 9:11 AM Luis Felipe <luis.felipe.la@protonmail.com>
wrote:

> Hi, Mortimer,
>
> On Tuesday, September 14th, 2021 at 12:50 PM, Mortimer Cladwell <
> mbcladwell@gmail.com> wrote:
>
> > Hi,
> >
> > Let's say I made a lot of mistakes. I look at my repl and see:
> >
> > scheme@(guile-user) [10]>
> >
> > Any way to back out to scheme@(guile-user)> without typing ,q ten times?
>
> I don't know if there is a command for that, but maybe pressing Ctrl+D
> several times is easier than typing ,q several times?
>


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

* Re: backing out of debugger
  2021-09-14 12:50 backing out of debugger Mortimer Cladwell
  2021-09-14 13:11 ` Luis Felipe
@ 2021-09-14 13:55 ` tomas
  2021-09-15 12:49 ` Matt Wette
  2 siblings, 0 replies; 9+ messages in thread
From: tomas @ 2021-09-14 13:55 UTC (permalink / raw)
  To: guile-user

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

On Tue, Sep 14, 2021 at 08:50:03AM -0400, Mortimer Cladwell wrote:
> Hi,
> Let's say I made a lot of mistakes. I look at my repl and see:
> scheme@(guile-user) [10]>
> 
> Any way to back out to scheme@(guile-user)> without typing ,q ten times?

Guile tells you :)

  scheme@(guile-user)> foo
  ;;; <stdin>:7:0: warning: possibly unbound variable `foo'
  ice-9/boot-9.scm:1685:16: In procedure raise-exception:
  Unbound variable: foo
  
  Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.

This [1] thingy coming next is the new prompt. So typing ,q gets me out
of it:

  scheme@(guile-user) [1]> ,q
  scheme@(guile-user)>

I'm not deep into that, but as far as I understand, the job of this
prompt is to keep information around about what went wrong, so you
can inspect it (e.g. with ,bt).

Cheers
 - t

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: backing out of debugger
  2021-09-14 13:27   ` Mortimer Cladwell
@ 2021-09-14 14:08     ` Luis Felipe
  2021-09-14 14:35       ` Olivier Dion via General Guile related discussions
  0 siblings, 1 reply; 9+ messages in thread
From: Luis Felipe @ 2021-09-14 14:08 UTC (permalink / raw)
  To: Mortimer Cladwell; +Cc: guile-user

On Tuesday, September 14th, 2021 at 1:27 PM, Mortimer Cladwell <mbcladwell@gmail.com> wrote:

> Thanks Luis. What about in emacs/geiser where Ctrl-D won't work?

The equivalent in Geiser would be C-c C-q, I think. But I don't know if that's any better than typing ,q plus Enter :)



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

* Re: backing out of debugger
  2021-09-14 14:08     ` Luis Felipe
@ 2021-09-14 14:35       ` Olivier Dion via General Guile related discussions
  2021-09-15 15:40         ` Mortimer Cladwell
  0 siblings, 1 reply; 9+ messages in thread
From: Olivier Dion via General Guile related discussions @ 2021-09-14 14:35 UTC (permalink / raw)
  To: Luis Felipe, Mortimer Cladwell; +Cc: guile-user

On Tue, 14 Sep 2021, Luis Felipe <luis.felipe.la@protonmail.com> wrote:
> On Tuesday, September 14th, 2021 at 1:27 PM, Mortimer Cladwell <mbcladwell@gmail.com> wrote:
>
>> Thanks Luis. What about in emacs/geiser where Ctrl-D won't work?
>
> The equivalent in Geiser would be C-c C-q, I think. But I don't know
> if that's any better than typing ,q plus Enter :)

You could define a procedure that calls geiser-repl-exit N time with the
prefix argument.

Note that geiser-repl-exit already takes a prefix argument, but will
simply kill the process instead of exiting N repl.

-- 
Olivier Dion
Polymtl



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

* Re: backing out of debugger
  2021-09-14 12:50 backing out of debugger Mortimer Cladwell
  2021-09-14 13:11 ` Luis Felipe
  2021-09-14 13:55 ` tomas
@ 2021-09-15 12:49 ` Matt Wette
  2021-09-15 12:50   ` Matt Wette
  2 siblings, 1 reply; 9+ messages in thread
From: Matt Wette @ 2021-09-15 12:49 UTC (permalink / raw)
  To: guile-user


On 9/14/21 5:50 AM, Mortimer Cladwell wrote:
> Hi,
> Let's say I made a lot of mistakes. I look at my repl and see:
> scheme@(guile-user) [10]>
>
> Any way to back out to scheme@(guile-user)> without typing ,q ten times?
> Thanks
> Mortimer
Try binding a command to:

(while (pair? (cdr (fluid-ref *repl-stack*))) (throw 'quit))




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

* Re: backing out of debugger
  2021-09-15 12:49 ` Matt Wette
@ 2021-09-15 12:50   ` Matt Wette
  0 siblings, 0 replies; 9+ messages in thread
From: Matt Wette @ 2021-09-15 12:50 UTC (permalink / raw)
  To: guile-user



On 9/15/21 5:49 AM, Matt Wette wrote:
>
> On 9/14/21 5:50 AM, Mortimer Cladwell wrote:
>> Hi,
>> Let's say I made a lot of mistakes. I look at my repl and see:
>> scheme@(guile-user) [10]>
>>
>> Any way to back out to scheme@(guile-user)> without typing ,q ten times?
>> Thanks
>> Mortimer
> Try binding a command to:
>
> (while (pair? (cdr (fluid-ref *repl-stack*))) (throw 'quit))
>
>
This  probably won't work but it could be a start.




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

* Re: backing out of debugger
  2021-09-14 14:35       ` Olivier Dion via General Guile related discussions
@ 2021-09-15 15:40         ` Mortimer Cladwell
  0 siblings, 0 replies; 9+ messages in thread
From: Mortimer Cladwell @ 2021-09-15 15:40 UTC (permalink / raw)
  To: matt.wette; +Cc: guile-user

Thanks Matt.
I wrote a Guile utility function and attached to a button using e-lisp:

----Guile-----------------------------------------------------------
(define (back-out repl-stack )
  (if (null? (cdr repl-stack))
      (throw 'quit)
      (begin
(throw 'quit)
(back-out (cdr repl-stack)))))
----end guile-------------------------------------------------------

----Emacs Lisp---------------------------------------------------
(defun insert-back-out()
  (interactive)
  (insert "(back-out (fluid-ref *repl-stack*))"))

(global-set-key (kbd "<f4>") 'insert-back-out)
---end-elisp------------------------------------------------------

If I am at scheme@(guile-user) [3]> I must press the button three times.
So doesn't quite work as expected. Seems like only one (throw 'quit) can be
executed per prompt? Not sure what the problem is.
Mortimer

On Tue, Sep 14, 2021 at 10:35 AM Olivier Dion <olivier.dion@polymtl.ca>
wrote:

> On Tue, 14 Sep 2021, Luis Felipe <luis.felipe.la@protonmail.com> wrote:
> > On Tuesday, September 14th, 2021 at 1:27 PM, Mortimer Cladwell <
> mbcladwell@gmail.com> wrote:
> >
> >> Thanks Luis. What about in emacs/geiser where Ctrl-D won't work?
> >
> > The equivalent in Geiser would be C-c C-q, I think. But I don't know
> > if that's any better than typing ,q plus Enter :)
>
> You could define a procedure that calls geiser-repl-exit N time with the
> prefix argument.
>
> Note that geiser-repl-exit already takes a prefix argument, but will
> simply kill the process instead of exiting N repl.
>
> --
> Olivier Dion
> Polymtl
>


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

end of thread, other threads:[~2021-09-15 15:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-14 12:50 backing out of debugger Mortimer Cladwell
2021-09-14 13:11 ` Luis Felipe
2021-09-14 13:27   ` Mortimer Cladwell
2021-09-14 14:08     ` Luis Felipe
2021-09-14 14:35       ` Olivier Dion via General Guile related discussions
2021-09-15 15:40         ` Mortimer Cladwell
2021-09-14 13:55 ` tomas
2021-09-15 12:49 ` Matt Wette
2021-09-15 12:50   ` Matt Wette

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 NNTP newsgroup(s).