X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/502166d288cfe6982a6386fda20ce1ed862f860a..02b73b974f58f937c09ac318fd40d32c9a157c8b:/lisp/progmodes/octave-inf.el diff --git a/lisp/progmodes/octave-inf.el b/lisp/progmodes/octave-inf.el index 0dd6bf99eb..265cf6c049 100644 --- a/lisp/progmodes/octave-inf.el +++ b/lisp/progmodes/octave-inf.el @@ -24,6 +24,8 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. +;;; Commentary: + ;;; Code: (require 'octave-mod) @@ -39,7 +41,7 @@ :group 'octave-inferior) (defcustom inferior-octave-prompt - "\\(^octave\\(\\|.bin\\)\\(:[0-9]+\\)?\\|^debug\\|^\\)>+ " + "\\(^octave\\(\\|.bin\\)\\(-[.0-9]+\\)?\\(:[0-9]+\\)?\\|^debug\\|^\\)>+ " "*Regexp to match prompts for the inferior Octave process." :type 'regexp :group 'octave-inferior) @@ -93,6 +95,17 @@ mode, set this to (\"-q\" \"--traditional\")." ;; Could certainly do more font locking in inferior Octave ... "Additional expressions to highlight in Inferior Octave mode.") + +;;; Compatibility functions +(if (not (fboundp 'comint-line-beginning-position)) + ;; comint-line-beginning-position is defined in Emacs 21 + (defun comint-line-beginning-position () + "Returns the buffer position of the beginning of the line, after any prompt. +The prompt is assumed to be any text at the beginning of the line matching +the regular expression `comint-prompt-regexp', a buffer local variable." + (save-excursion (comint-bol nil) (point)))) + + (defvar inferior-octave-output-list nil) (defvar inferior-octave-output-string nil) (defvar inferior-octave-receive-in-progress nil) @@ -103,7 +116,7 @@ mode, set this to (\"-q\" \"--traditional\")." "Non-nil means that `inferior-octave-complete' is impossible.") (defvar inferior-octave-dynamic-complete-functions - '(inferior-octave-complete comint-dynamic-complete-filename) + '(inferior-octave-complete comint-dynamic-complete-filename) "List of functions called to perform completion for inferior Octave. This variable is used to initialize `comint-dynamic-complete-functions' in the Inferior Octave buffer.") @@ -125,12 +138,12 @@ Entry to this mode successively runs the hooks `comint-mode-hook' and (use-local-map inferior-octave-mode-map) (set-syntax-table inferior-octave-mode-syntax-table) - (make-local-variable 'comment-start) + (make-local-variable 'comment-start) (setq comment-start octave-comment-start) (make-local-variable 'comment-end) (setq comment-end "") (make-local-variable 'comment-column) - (setq comment-column 32) + (setq comment-column 32) (make-local-variable 'comment-start-skip) (setq comment-start-skip octave-comment-start-skip) @@ -214,7 +227,7 @@ startup file, `~/.emacs-octave'." (setq commands (list "page_screen_output = 0;\n" (if (not (string-equal - inferior-octave-output-string ">> ")) + inferior-octave-output-string ">> ")) "PS1=\"\\\\s> \";\n") (if (file-exists-p file) (format "source (\"%s\");\n" file)))) @@ -369,4 +382,5 @@ directory and makes this the current buffer's default directory." (provide 'octave-inf) +;;; arch-tag: bdce0395-24d1-4bb4-bfba-6fb1eeb1a660 ;;; octave-inf.el ends here