(require 'octave-mod)
(require 'comint)
-(defvar inferior-octave-program "octave"
- "*Program invoked by `inferior-octave'.")
-
-(defvar inferior-octave-prompt
- "\\(^octave\\(:[0-9]+\\)?\\|^debug\\|^\\)>+ "
- "*Regexp to match prompts for the inferior Octave process.")
-
-(defvar inferior-octave-startup-file nil
+(defgroup octave-inferior nil
+ "Running Octave as an inferior Emacs process."
+ :group 'octave)
+
+(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."
+ :type 'regexp
+ :group 'octave-inferior)
+
+(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")
+(defcustom inferior-octave-startup-args '("-i")
"*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.")
(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
(defun inferior-octave-directory-tracker (string)
"Tracks `cd' commands issued to the inferior Octave process.
Use \\[inferior-octave-resync-dirs] to resync if Emacs gets confused."
- (if (string-match "[ \t]*cd[ \t]*\\([^ \t\n;]*\\)[ \t\n;]"
+ (if (string-match "^[ \t]*cd[ \t]*\\([^ \t\n;]*\\)[ \t\n;]"
string)
(cd (substring string (match-beginning 1) (match-end 1)))))