From jan@swi.psy.uva.nl Thu Feb 15 13:41:23 2001
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f1FCfNZ00255;
	Thu, 15 Feb 2001 13:41:23 +0100 (MET)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id NAA02506;
	Thu, 15 Feb 2001 13:41:19 +0100
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: clive.matthews@uea.ac.uk, prolog@swi.psy.uva.nl
Subject: Re: [SWIPL] Editing
Date: Thu, 15 Feb 2001 13:28:13 +0100
X-Mailer: KMail [version 1.0.28]
Content-Type: text/plain
References: <3A8BCEC8.30E8@uea.ac.uk>
In-Reply-To: <3A8BCEC8.30E8@uea.ac.uk>
MIME-Version: 1.0
Message-Id: <01021513411901.01604@gollem>
Content-Transfer-Encoding: 8bit

On Thu, 15 Feb 2001, clive.matthews@uea.ac.uk 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

