4.4BSD/usr/src/contrib/emacs-18.57/lisp/prolog.elc


(defvar prolog-mode-syntax-table nil)

(defvar prolog-mode-abbrev-table nil)

(defvar prolog-mode-map nil)

(defvar prolog-consult-string "reconsult(user).
" "*(Re)Consult mode (for C-Prolog and Quintus Prolog). ")

(defvar prolog-compile-string "compile(user).
" "*Compile mode (for Quintus Prolog).")

(defvar prolog-eof-string "end_of_file.
" "*String that represents end of file for prolog.
nil means send actual operaing system end of file.")

(defvar prolog-indent-width 4)

(if prolog-mode-syntax-table nil (let ((table (make-syntax-table))) (modify-syntax-entry 95 "w" table) (modify-syntax-entry 92 "\\" table) (modify-syntax-entry 47 "." table) (modify-syntax-entry 42 "." table) (modify-syntax-entry 43 "." table) (modify-syntax-entry 45 "." table) (modify-syntax-entry 61 "." table) (modify-syntax-entry 37 "<" table) (modify-syntax-entry 60 "." table) (modify-syntax-entry 62 "." table) (modify-syntax-entry 39 "\"" table) (setq prolog-mode-syntax-table table)))

(define-abbrev-table (quote prolog-mode-abbrev-table) nil)

(defun prolog-mode-variables nil (byte-code "Í!ˆ
‰ˆÎÃ!ˆÏP‰ˆÎÅ!ˆ‰ˆÎÆ!ˆÇ‰ˆÎÈ!ˆÐ‰ˆÎÉ!ˆÑ‰	ˆÎÊ!ˆÒ‰
ˆÎË!ˆÓ‰ˆÎÌ!ˆÔ‰‡" [prolog-mode-syntax-table local-abbrev-table prolog-mode-abbrev-table paragraph-start page-delimiter paragraph-separate paragraph-ignore-fill-prefix t indent-line-function comment-start comment-start-skip comment-column comment-indent-hook set-syntax-table make-local-variable "^%%\\|^$\\|" prolog-indent-line "%" "%+ *" 48 prolog-comment-indent] 11))

(defun prolog-mode-commands (map) (byte-code "ÁÂÃ#ˆÁÄÅ#‡" [map define-key "	" prolog-indent-line "" prolog-consult-region] 5))

(if prolog-mode-map nil (setq prolog-mode-map (make-sparse-keymap)) (prolog-mode-commands prolog-mode-map))

(defun prolog-mode nil "\
Major mode for editing Prolog code for Prologs.
Blank lines and `%%...' separate paragraphs.  `%'s start comments.
Commands:
\\{prolog-mode-map}
Entry to this mode calls the value of prolog-mode-hook
if that value is non-nil." (interactive) (byte-code "ÃˆÄ ˆÅ!ˆÆ‰ˆÇ‰ˆÈ ˆÉÊ!‡" [prolog-mode-map major-mode mode-name nil kill-all-local-variables use-local-map prolog-mode "Prolog" prolog-mode-variables run-hooks prolog-mode-hook] 5))

(defun prolog-indent-line (&optional whole-exp) "\
Indent current line as Prolog code.
With argument, indent any additional lines of the same clause
rigidly along with this one (not yet)." (interactive "p") (byte-code "ÃˆÄ d`ZÃÅ ˆ`‰ˆÆÇ!ˆÈiZ!ƒ\"Â)É
`\"ˆjˆd	Z`V…6d	Zb+‡" [indent pos beg nil prolog-indent-level beginning-of-line skip-chars-forward " 	" zerop delete-region] 7))

(defun prolog-indent-level nil "\
Compute prolog indentation level." (byte-code "ŠÉ ˆÊË!ˆÌÍ!ƒ΂ÛÌÏ!ƒ‚Ûoƒ$΂ÛÁÆÆÆÌÐ!ƒ8Á‰‚;Ɖˆ
…iÑÒ!ˆÉ ˆoƒQƉ‚eÊË!ˆÌÏ!†^ÌÓ!?…eƉˆ‚<ˆoƒtΉ‚wi‰ˆÌÔ!ƒ‚‚ÚÌÕ!ƒŽÁ‰‚‘ƉˆÖ ˆo†œ×Ò!ˆÌØ!ƒ»…ªÌÙ!ƒ´\\‚¸]‚ÚÌÚ!ƒÆ‚Ú
†ÍÌÛ!ƒÙZÎ]‚ÚÎ,)‡" [comment-column t empty ind more less nil prolog-indent-width tab-width beginning-of-line skip-chars-forward " 	" looking-at "%%%" 0 "%[^%]" ")" forward-line -1 "
" "%%[^%]" "(" end-of-prolog-clause forward-char "[,(;>]" "[^,]" "-" "[^.]"] 20))

(defun end-of-prolog-clause nil "\
Go to end of clause in this line." (byte-code "ÂÃ!ˆŠÄ ˆ`)Å	Æ#…ÇÈ!bˆÉÊ!)‡" [eolpos comment-start-skip beginning-of-line 1 end-of-line re-search-forward move match-beginning 0 skip-chars-backward " 	"] 6))

(defun prolog-comment-indent nil "\
Compute prolog comment indentation." (byte-code "ÂÃ!ƒ
Ä‚ÂÅ!ƒÆ ‚ŠÇÈ!ˆiT	])‡" [t comment-column looking-at "%%%" 0 "%%" prolog-indent-level skip-chars-backward " 	"] 6))

(defvar inferior-prolog-mode-map nil)

(defun inferior-prolog-mode nil "\
Major mode for interacting with an inferior Prolog process.

The following commands are available:
\\{inferior-prolog-mode-map}

Entry to this mode calls the value of prolog-mode-hook with no arguments,
if that value is non-nil.  Likewise with the value of shell-mode-hook.
prolog-mode-hook is called after shell-mode-hook.

You can send text to the inferior Prolog from other buffers
using the commands send-region, send-string and \\[prolog-consult-region].

Commands:
Tab indents for Prolog; with argument, shifts rest
 of expression rigidly with the current line.
Paragraphs are separated only by blank lines and '%%'. '%'s start comments.

Return at end of buffer sends line as input.
Return not at end copies rest of line to end and sends it.
\\[shell-send-eof] sends end-of-file as input.
\\[kill-shell-input] and \\[backward-kill-word] are kill commands, imitating normal Unix input editing.
\\[interrupt-shell-subjob] interrupts the shell or its current subjob if any.
\\[stop-shell-subjob] stops, likewise. \\[quit-shell-subjob] sends quit signal, likewise." (interactive) (byte-code "ÄˆÉ ˆÊ‰ˆË‰ˆÌ‰ˆÍ ˆÎÏ!ˆƒ Ä‚)Ð
!‰ˆÑ!ˆÒ!ˆÓÆ!ˆÔ ‰ˆÓÇ!ˆÔ ‰ˆÕÈ!ˆÖ‰ˆ×ØÙ\"‡" [major-mode mode-name mode-line-process inferior-prolog-mode-map nil shell-mode-map last-input-start last-input-end shell-prompt-pattern kill-all-local-variables inferior-prolog-mode "Inferior Prolog" (": %s") prolog-mode-variables require shell copy-alist prolog-mode-commands use-local-map make-local-variable make-marker make-variable-buffer-local "^| [ ?][- ] *" run-hooks shell-mode-hook prolog-mode-hook] 14))

(defun run-prolog nil "\
Run an inferior Prolog process, input and output via buffer *prolog*." (interactive) (byte-code "ÀˆÁÂ!ˆÃÄÅÅ\"!ˆÆ ‡" [nil require shell switch-to-buffer make-shell "prolog" inferior-prolog-mode] 5))

(defun prolog-consult-region (compile beg end) "\
Send the region to the Prolog process made by M-x run-prolog.
 If COMPILE (prefix arg) is not nil,
 use compile mode rather than consult mode." (interactive "P
r") (byte-code "ƈŠƒÇÈ	\"‚ÇÈ
\"ˆÉÈ#ˆÇÈÊ\"ˆ
ƒ)ÇÈ
\"‚,ËÈ!)‡" [compile prolog-compile-string prolog-consult-string beg end prolog-eof-string nil send-string "prolog" send-region "
" process-send-eof] 7))

(defun prolog-consult-region-and-go (compile beg end) "\
Send the region to the inferior Prolog, and switch to *prolog* buffer.
 If COMPILE (prefix arg) is not nil,
 use compile mode rather than consult mode." (interactive "P
r") (byte-code "ÈÄ	
#ˆÅÆ!‡" [compile beg end nil prolog-consult-region switch-to-buffer "*prolog*"] 4))