;;; prolog.el --- major mode for editing and running Prolog under Emacs
-;; Copyright (C) 1986, 1987, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 1986, 1987, 2001, 2002, 2003, 2004, 2005
+;; Free Software Foundation, Inc.
;; Author: Masanobu UMEDA <umerin@mse.kyutech.ac.jp>
;; Keywords: languages
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Commentary:
;;; Code:
+(defvar comint-prompt-regexp)
+
+
(defgroup prolog nil
- "Major mode for editing and running Prolog under Emacs"
+ "Major mode for editing and running Prolog under Emacs."
:group 'languages)
:group 'prolog)
(defcustom prolog-eof-string "end_of_file.\n"
- "*String that represents end of file for prolog.
-nil means send actual operating system end of file."
+ "*String that represents end of file for Prolog.
+When nil, send actual operating system end of file."
:type 'string
:group 'prolog)
(make-local-variable 'paragraph-ignore-fill-prefix)
(setq paragraph-ignore-fill-prefix t)
(make-local-variable 'imenu-generic-expression)
- (setq imenu-generic-expression "^[a-z][a-zA-Z0-9_]+")
+ (setq imenu-generic-expression '((nil "^\\sw+" 0)))
(make-local-variable 'indent-line-function)
(setq indent-line-function 'prolog-indent-line)
(make-local-variable 'comment-start)
))
(defun prolog-indent-level ()
- "Compute prolog indentation level."
+ "Compute Prolog indentation level."
(save-excursion
(beginning-of-line)
(skip-chars-forward " \t")
if that value is non-nil. Likewise with the value of `comint-mode-hook'.
`prolog-mode-hook' is called after `comint-mode-hook'.
-You can send text to the inferior Prolog from other buffers
-using the commands `send-region', `send-string' and \\[prolog-consult-region].
+You can send text to the inferior Prolog from other buffers using the commands
+`process-send-region', `process-send-string' and \\[prolog-consult-region].
Commands:
Tab indents for Prolog; with argument, shifts rest
(interactive "P\nr")
(save-excursion
(if compile
- (send-string "prolog" prolog-compile-string)
- (send-string "prolog" prolog-consult-string))
- (send-region "prolog" beg end)
- (send-string "prolog" "\n") ;May be unnecessary
+ (process-send-string "prolog" prolog-compile-string)
+ (process-send-string "prolog" prolog-consult-string))
+ (process-send-region "prolog" beg end)
+ (process-send-string "prolog" "\n") ;May be unnecessary
(if prolog-eof-string
- (send-string "prolog" prolog-eof-string)
+ (process-send-string "prolog" prolog-eof-string)
(process-send-eof "prolog")))) ;Send eof to prolog process.
(defun prolog-consult-region-and-go (compile beg end)