# HG changeset patch # User jwe # Date 938155237 0 # Node ID fe641c25df905ab97c00aef9eb12c42bb3feefb1 # Parent 7c55f59918890a625483b624b780f20b0726ecc2 [project @ 1999-09-24 06:40:36 by jwe] diff --git a/emacs/octave-inf.el b/emacs/octave-inf.el --- a/emacs/octave-inf.el +++ b/emacs/octave-inf.el @@ -1,6 +1,6 @@ -;; octave-inf.el --- running Octave as an inferior Emacs process +;;; octave-inf.el --- running Octave as an inferior Emacs process -;;; Copyright (C) 1997 Free Software Foundation, Inc. +;; Copyright (C) 1997 Free Software Foundation, Inc. ;; Author: Kurt Hornik ;; Author: John Eaton @@ -29,22 +29,35 @@ (require 'octave-mod) (require 'comint) -(defvar inferior-octave-program "octave" - "*Program invoked by `inferior-octave'.") +(defgroup octave-inferior nil + "Running Octave as an inferior Emacs process." + :group 'octave) -(defvar inferior-octave-prompt +(defcustom inferior-octave-program "octave" + "*Program invoked by `inferior-octave'." + :type 'string + :group 'octave-inferior) + +(defcustom inferior-octave-prompt "\\(^octave\\(\\|.bin\\)\\(:[0-9]+\\)?\\|^debug\\|^\\)>+ " - "*Regexp to match prompts for the inferior Octave process.") + "*Regexp to match prompts for the inferior Octave process." + :type 'regexp + :group 'octave-inferior) -(defvar inferior-octave-startup-file nil +(defcustom inferior-octave-startup-file nil "*Name of the inferior Octave startup file. The contents of this file are sent to the inferior Octave process on -startup.") +startup." + :type '(choice (const :tag "None" nil) + file) + :group 'octave-inferior) -(defvar inferior-octave-startup-args '("-i" "--no-line-editing") +(defcustom inferior-octave-startup-args nil "*List of command line arguments for the inferior Octave process. For example, for suppressing the startup message and using `traditional' -mode, set this to (\"-q\" \"--traditional\").") +mode, set this to (\"-q\" \"--traditional\")." + :type '(repeat string) + :group 'octave-inferior) (defvar inferior-octave-mode-map nil "Keymap used in Inferior Octave mode.") @@ -69,8 +82,10 @@ (modify-syntax-entry ?\n ">" table) (setq inferior-octave-mode-syntax-table table))) -(defvar inferior-octave-mode-hook nil - "*Hook to be run when Inferior Octave mode is started.") +(defcustom inferior-octave-mode-hook nil + "*Hook to be run when Inferior Octave mode is started." + :type 'hook + :group 'octave-inferior) (defvar inferior-octave-font-lock-keywords (list @@ -167,7 +182,8 @@ (substring inferior-octave-buffer 1 -1) inferior-octave-buffer inferior-octave-program - inferior-octave-startup-args))) + (append (list "-i" "--no-line-editing") + inferior-octave-startup-args)))) (set-process-filter proc 'inferior-octave-output-digest) (setq comint-ptyp process-connection-type inferior-octave-process proc @@ -355,3 +371,4 @@ (provide 'octave-inf) ;;; octave-inf.el ends here + diff --git a/emacs/octave-mod.el b/emacs/octave-mod.el --- a/emacs/octave-mod.el +++ b/emacs/octave-mod.el @@ -41,12 +41,16 @@ ;;; Code: +(defgroup octave nil + "Major mode for editing Octave source files." + :group 'languages) + (defvar inferior-octave-output-list nil) (defvar inferior-octave-output-string nil) (defvar inferior-octave-receive-in-progress nil) (defconst octave-maintainer-address - "Kurt Hornik , bug-gnu-emacs@prep.ai.mit.edu" + "Kurt Hornik , bug-gnu-emacs@gnu.org" "Current maintainer of the Emacs Octave package.") (defvar octave-abbrev-table nil @@ -171,7 +175,7 @@ 'font-lock-keyword-face) ;; Fontify all builtin operators. (cons "\\(&\\||\\|<=\\|>=\\|==\\|<\\|>\\|!=\\|!\\)" - 'font-lock-reference-face) + 'font-lock-builtin-face) ;; Fontify all builtin variables. (cons (concat "\\<\\(" (mapconcat 'identity octave-variables "\\|") @@ -183,8 +187,10 @@ '(3 font-lock-function-name-face nil t))) "Additional Octave expressions to highlight.") -(defvar inferior-octave-buffer "*Inferior Octave*" - "*Name of buffer for running an inferior Octave process.") +(defcustom inferior-octave-buffer "*Inferior Octave*" + "*Name of buffer for running an inferior Octave process." + :type 'string + :group 'octave-inferior) (defvar inferior-octave-process nil) @@ -299,18 +305,26 @@ (modify-syntax-entry ?\n ">" table) (setq octave-mode-syntax-table table))) -(defvar octave-auto-indent nil - "*Non-nil means indent line after a semicolon or space in Octave mode.") +(defcustom octave-auto-indent nil + "*Non-nil means indent line after a semicolon or space in Octave mode." + :type 'boolean + :group 'octave) -(defvar octave-auto-newline nil - "*Non-nil means insert newline after a semicolon in Octave mode.") +(defcustom octave-auto-newline nil + "*Non-nil means automatically newline after a semicolon in Octave mode." + :type 'boolean + :group 'octave) -(defvar octave-blink-matching-block t +(defcustom octave-blink-matching-block t "*Control the blinking of matching Octave block keywords. Non-nil means show matching begin of block when inserting a space, -newline or semicolon after an else or end keyword.") -(defvar octave-block-offset 2 - "*Extra indentation applied to statements in Octave block structures.") +newline or semicolon after an else or end keyword." + :type 'boolean + :group 'octave) +(defcustom octave-block-offset 2 + "*Extra indentation applied to statements in Octave block structures." + :type 'integer + :group 'octave) (defvar octave-block-begin-regexp (concat "\\<\\(" @@ -345,12 +359,16 @@ (concat (make-string 2 octave-comment-char) " ") "String to insert to start a new Octave comment on an empty line.") -(defvar octave-continuation-offset 4 - "*Extra indentation applied to Octave continuation lines.") +(defcustom octave-continuation-offset 4 + "*Extra indentation applied to Octave continuation lines." + :type 'integer + :group 'octave) (defvar octave-continuation-regexp "[^#%\n]*\\(\\\\\\|\\.\\.\\.\\)\\s-*\\(\\s<.*\\)?$") -(defvar octave-continuation-string "\\" - "*Character string used for Octave continuation lines. Normally \\.") +(defcustom octave-continuation-string "\\" + "*Character string used for Octave continuation lines. Normally \\." + :type 'string + :group 'octave) (defvar octave-completion-alist nil "Alist of Octave symbols for completion in Octave mode. @@ -364,19 +382,29 @@ (list nil octave-function-header-regexp 3)) "Imenu expression for Octave mode. See `imenu-generic-expression'.") -(defvar octave-mode-startup-message t - "*Nil means do not display the Octave mode startup message.") +(defcustom octave-mode-startup-message t + "*Nil means do not display the Octave mode startup message." + :type 'boolean + :group 'octave) -(defvar octave-mode-hook nil - "*Hook to be run when Octave mode is started.") +(defcustom octave-mode-hook nil + "*Hook to be run when Octave mode is started." + :type 'hook + :group 'octave) -(defvar octave-send-show-buffer t - "*Non-nil means display `inferior-octave-buffer' after sending to it.") -(defvar octave-send-line-auto-forward t +(defcustom octave-send-show-buffer t + "*Non-nil means display `inferior-octave-buffer' after sending to it." + :type 'boolean + :group 'octave) +(defcustom octave-send-line-auto-forward t "*Control auto-forward after sending to the inferior Octave process. -Non-nil means always go to the next Octave code line after sending.") -(defvar octave-send-echo-input t - "*Non-nil means echo input sent to the inferior Octave process.") +Non-nil means always go to the next Octave code line after sending." + :type 'boolean + :group 'octave) +(defcustom octave-send-echo-input t + "*Non-nil means echo input sent to the inferior Octave process." + :type 'boolean + :group 'octave) ;;;###autoload @@ -515,10 +543,8 @@ (setq font-lock-defaults '(octave-font-lock-keywords nil nil)) (make-local-variable 'imenu-generic-expression) - (setq imenu-generic-expression octave-mode-imenu-generic-expression) - - (make-local-variable 'comment-multi-line) - (setq comment-multi-line nil) + (setq imenu-generic-expression octave-mode-imenu-generic-expression + imenu-case-fold-search nil) (octave-add-octave-menu) (octave-initialize-completions)