Exit keyboard input mode in the graphical debugger on Windows?

I’m using: SWI-Prolog version 8.0.2 on Windows 8.1

When I use Ctrl-F to search for a keyword in the source currently visible in the graphical debugger, the search works as expected. However, I am then “stuck” in document editing mode. Instead of the usual keystrokes activating debugging functions (e.g. ‘l’ for leap, SPACE for step, etc.), whatever I type ends up in the source in the graphical debugger; thus modifying the source code currently being debugged/trace…

Two questions:

  • How can I “break out” of document editing mode so I can resume debugging operations? I tried every key combination I could think of and nothing seems to work.
  • Is there a way to set the source currently loaded into the graphical debugger to “read-only” mode so I don’t have the problem in the first place?

You can use the pencil icon at the right of the button bar to get back to trace mode. This also happens if you save the file. Normally edit mode is enabled if you hit ‘e’. This should not be the case for ^f, which I assume you are using in Windows where CUA mode is the default. In native Emacs mode there is no such problem.

There is no way to disable edit mode completely, but as long as it is only activated on ‘e’ or the pencil that should IMO not be a problem. Activation on CUA find seems a bug.

1 Like

That was not correct. Turned out the problem also appears in Emacs native search. Pushed a fix that keeps forwarding events to the editor if the editor is in a sub-mode such as searching.

My normal flow if I want to look around or do serious browsing or editing is to use ^X2 (Control-X, followed by 2), which is the Emacs command for split window and interpreted in PceEmacs as create a new editor window on the same buffer. The two editors are fully shared, but the new window is in normal edit mode at its own location in the file while the debugger stays where it is.

Would it help to add a button to the button bar for creating the second editor? Or add this to the View menu? It is probably useful functionality and except for Emacs diehards it is not easy to find. Where would people look for it?


Hi Jan,

That’s always a good choice, especially if the button has a “hover-text” box like the other toolbar buttons do. My default behavior for when I’m looking for something is to hover over every screen element and see what it does. My opinion, of course.

IRONY UPDATE: I’m going to be a man about this and not delete this post due to the ironic blunder I made because I do like the toolbar idea and I want to keep that here. I realize now that I could have found Jan’s suggestion to restore read-only mode by hovering over the pencil icon, which displays the text “Toggle read-only/edit mode”, with the “hover” technique being the very technique I claimed I use to find undiscovered functions. I’m going to sit in the corner now and stare at the wall. :slight_smile: