From d8ef28b19d21b0fd021ceb6fe5e6ce392be63169 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Thu, 2 May 2013 00:42:18 +0800 Subject: [PATCH] * progmodes/octave.el (inferior-octave-has-built-in-variables): Remove. Buil-in variables were removed from Octave in 2007. (inferior-octave-startup): Fix uses. (comint-line-beginning-position): Remove compatibility code for emacs 21. --- lisp/ChangeLog | 8 ++++++++ lisp/progmodes/octave.el | 29 ++--------------------------- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2e02f567058..aa2003a9aba 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2013-05-01 Leo Liu + + * progmodes/octave.el (inferior-octave-has-built-in-variables): + Remove. Buil-in variables were removed from Octave in 2007. + (inferior-octave-startup): Fix uses. + (comint-line-beginning-position): Remove compatibility code for + emacs 21. + 2013-05-01 Juri Linkov * isearch.el (isearch-forward, isearch-mode): Doc fix. (Bug#13923) diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 9e4de4c207f..f12365552f9 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -589,17 +589,6 @@ 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) @@ -607,9 +596,6 @@ the regular expression `comint-prompt-regexp', a buffer local variable." (define-obsolete-variable-alias 'inferior-octave-startup-hook 'inferior-octave-mode-hook "24.4") -(defvar inferior-octave-has-built-in-variables nil - "Non-nil means that Octave has built-in variables.") - (defvar inferior-octave-dynamic-complete-functions '(inferior-octave-completion-at-point comint-filename-completion) "List of functions called to perform completion for inferior Octave. @@ -701,20 +687,11 @@ startup file, `~/.emacs-octave'." 'identity inferior-octave-output-list "\n") "\n")))) - ;; Find out whether Octave has built-in variables. - (inferior-octave-send-list-and-digest - (list "exist \"LOADPATH\"\n")) - (setq inferior-octave-has-built-in-variables - (string-match "101$" (car inferior-octave-output-list))) - ;; An empty secondary prompt, as e.g. obtained by '--braindead', ;; means trouble. (inferior-octave-send-list-and-digest (list "PS2\n")) (if (string-match "\\(PS2\\|ans\\) = *$" (car inferior-octave-output-list)) - (inferior-octave-send-list-and-digest - (list (if inferior-octave-has-built-in-variables - "PS2 = \"> \"\n" - "PS2 (\"> \");\n")))) + (inferior-octave-send-list-and-digest (list "PS2 (\"> \");\n"))) ;; O.k., now we are ready for the Inferior Octave startup commands. (let* (commands @@ -725,9 +702,7 @@ startup file, `~/.emacs-octave'." (list "more off;\n" (if (not (string-equal inferior-octave-output-string ">> ")) - (if inferior-octave-has-built-in-variables - "PS1=\"\\\\s> \";\n" - "PS1 (\"\\\\s> \");\n")) + "PS1 (\"\\\\s> \");\n") (if (file-exists-p file) (format "source (\"%s\");\n" file)))) (inferior-octave-send-list-and-digest commands)) -- 2.39.2