1

Emacs воспринимает файлы с расширением .pl, как Perl. Как можно переключить его на Prolog? Пробовал записывать в файл prolog.el следующее:

(autoload 'run-prolog "prolog" "Start a Prolog sub-process." t)
(autoload 'prolog-mode "prolog" "Major mode for editing Prolog programs." t)
(autoload 'mercury-mode "prolog" "Major mode for editing Mercury programs." t)
(setq prolog-system 'swi)
(setq auto-mode-alist (append '(("\\.pl$" . prolog-mode)
                                ("\\.m$" . mercury-mode))
                               auto-mode-alist)

Не помогло.

1 ответ 1

1

Emacs воспринимает файлы с расширением .pl, как Perl. Как можно переключить его на Prolog?

фрагмент документации c сайта SWI-Prolog:

Using the PceEmacs built-in editor ...

3.4.2.1 Edit modes ...

Using the proper extension

If the file ends in .pl or the selected alternative (e.g. .pro) extension, Prolog mode is selected.

Using #!/path/to/.../swipl

If the file is a Prolog Script file, starting with the line #!/path/to/swipl options, Prolog mode is selected regardless of the extension.

Using -*- Prolog -*-

If the above sequence appears in the first line of the file (inside a Prolog comment) Prolog mode is selected.

Explicit selection

Finally, using File/Mode/Prolog you can switch to Prolog mode explicitly.

Источник: http://www.swi-prolog.org/pldoc/man?section=pceemacs

Ваш ответ

Нажимая на кнопку «Отправить ответ», вы соглашаетесь с нашими условиями использования и подтверждаете, что прочитали и поняли наши политику конфиденциальности и нормы поведения.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.