Subject: Re: [SWIPL] Help with PCE emacs.

From: Jan Wielemaker <[email-masked]>
Date: Fri, 16 Mar 2001 12:15:39 +0100

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