Subject: Re: [SWIPL] Editing

From: Jan Wielemaker <[email-masked]>
Date: Thu, 15 Feb 2001 13:28:13 +0100

On Thu, 15 Feb 2001, [email-masked] wrote:
>This might seem stupid but I'm having problems getting a 
>simple editor to work. I have used SWI-Prolog version 1.9.5 
>for some time (actually, if it's 1.9.5 it must be a very 
>long time) and found that typing:
>
>	?- setenv(editor, notepad).
>
>as  the first line in a session works fine: when I use 
>edit/1 the system either loads the required file if already 
>created or asks if I want to create such a file if not.
>
>	Having up-graded to version 4.0.0 (running under 
>both Windows 98 and NT) I find that this no longer works. 
>>From the on-line documentation it looks like I don't need 
>to use setenv/2 since edit/1 should default to Notepad. 
>However, all I get is:
>
>   ?- edit('foo.pl').
>   WARNING: Cannot find anything to edit from "'foo.pl'"
>   No
>
>Using setenv/2 doesn't help. What am I doing wrong?

Nothing.  The current editor interface however is only
capable of dealing with *existing* things.  So you can't
create a new file this way.  Of course you can do

?- shell(notepad).

If you are using SWI-Prolog 4.0.0 together with notepad,
I think you should consider using the built-in PceEmacs
based editor.  There is no editor as primitive as notepad :-)

You can notify the system you wish to do so using

	:- ensure_loaded(library('emacs/swi_prolog')).

or you can start it onces explicitly using

	?- emacs.
or	?- emacs('foo.pl').

After starting it once is a session, it remains the default
editor for the remainder of the session.

	Regards --- Jan