From jan@swi.psy.uva.nl Fri Mar 16 12:24:31 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 f2GBOVZ13690;
	Fri, 16 Mar 2001 12:24:31 +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 MAA30446;
	Fri, 16 Mar 2001 12:24:31 +0100
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: "Sergio Roberto P. de Silva" <srsilva@din.uem.br>, prolog@swi.psy.uva.nl
Subject: Re: [SWIPL] Help with PCE emacs.
Date: Fri, 16 Mar 2001 12:15:39 +0100
X-Mailer: KMail [version 1.0.28]
Content-Type: text/plain
References: <830F3447B955D311946000A024B2F53006C9A5@uem-din-pdc.din.uem.br>
In-Reply-To: <830F3447B955D311946000A024B2F53006C9A5@uem-din-pdc.din.uem.br>
MIME-Version: 1.0
Message-Id: <01031612243102.28682@gollem>
Content-Transfer-Encoding: 8bit

On Thu, 15 Mar 2001, Sergio Roberto P. de Silva wrote:
>Hi all,
>
>I'm new to emacs and i'd like to know how can I configure the PCE emacs to
>start directly in the Prolog mode.
>Thank you in advance.

PceEmacs, like most emacs clones, determine the mode on the basis of
the file-extension.  If you name your Prolog files <name>.pl it will
gracefully use Prolog mode.

You can define other filename pattern using declare_emacs_mode/3:

:- declare_emacs_mode(prolog, library('emacs/prolog_mode'),
		      ['.*\\.pro']).

The last argument is a list of regular expressions.  If the plain
filename matches the pattern, this mode is used.

Which you can place anywhere you want as long as it is executed before
you load a .pro file into PceEmacs.  Obvious choices are the .plrc file
(see initialisation files) or the .pceemacsrc file, playing the same
role as .plrc, but loaded while PceEmacs is loaded.

P.s.  I see .pceemacsrc is still loaded by expanding ~/.pceemacsrc,
rather then using the user_profile approach for the Prolog
initialisation.  On Unix the location is obvious.  To find the location
of the file on your Windows system, do

?- get(file('~/.pceemacsrc'), absolute_path, Path).

	--- Jan

