aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu2013-05-02 00:42:18 +0800
committerLeo Liu2013-05-02 00:42:18 +0800
commitd8ef28b19d21b0fd021ceb6fe5e6ce392be63169 (patch)
tree0b97a078962b7842bacf81f15ade88ce23a29c60
parent9d02d82f21f52669769a416a9ca93acf539cb416 (diff)
downloademacs-d8ef28b19d21b0fd021ceb6fe5e6ce392be63169.tar.gz
emacs-d8ef28b19d21b0fd021ceb6fe5e6ce392be63169.zip
* 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.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/progmodes/octave.el29
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 @@
12013-05-01 Leo Liu <sdl.web@gmail.com>
2
3 * progmodes/octave.el (inferior-octave-has-built-in-variables):
4 Remove. Buil-in variables were removed from Octave in 2007.
5 (inferior-octave-startup): Fix uses.
6 (comint-line-beginning-position): Remove compatibility code for
7 emacs 21.
8
12013-05-01 Juri Linkov <juri@jurta.org> 92013-05-01 Juri Linkov <juri@jurta.org>
2 10
3 * isearch.el (isearch-forward, isearch-mode): Doc fix. (Bug#13923) 11 * 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\")."
589 ;; Could certainly do more font locking in inferior Octave ... 589 ;; Could certainly do more font locking in inferior Octave ...
590 "Additional expressions to highlight in Inferior Octave mode.") 590 "Additional expressions to highlight in Inferior Octave mode.")
591 591
592
593;;; Compatibility functions
594(if (not (fboundp 'comint-line-beginning-position))
595 ;; comint-line-beginning-position is defined in Emacs 21
596 (defun comint-line-beginning-position ()
597 "Returns the buffer position of the beginning of the line, after any prompt.
598The prompt is assumed to be any text at the beginning of the line matching
599the regular expression `comint-prompt-regexp', a buffer local variable."
600 (save-excursion (comint-bol nil) (point))))
601
602
603(defvar inferior-octave-output-list nil) 592(defvar inferior-octave-output-list nil)
604(defvar inferior-octave-output-string nil) 593(defvar inferior-octave-output-string nil)
605(defvar inferior-octave-receive-in-progress nil) 594(defvar inferior-octave-receive-in-progress nil)
@@ -607,9 +596,6 @@ the regular expression `comint-prompt-regexp', a buffer local variable."
607(define-obsolete-variable-alias 'inferior-octave-startup-hook 596(define-obsolete-variable-alias 'inferior-octave-startup-hook
608 'inferior-octave-mode-hook "24.4") 597 'inferior-octave-mode-hook "24.4")
609 598
610(defvar inferior-octave-has-built-in-variables nil
611 "Non-nil means that Octave has built-in variables.")
612
613(defvar inferior-octave-dynamic-complete-functions 599(defvar inferior-octave-dynamic-complete-functions
614 '(inferior-octave-completion-at-point comint-filename-completion) 600 '(inferior-octave-completion-at-point comint-filename-completion)
615 "List of functions called to perform completion for inferior Octave. 601 "List of functions called to perform completion for inferior Octave.
@@ -701,20 +687,11 @@ startup file, `~/.emacs-octave'."
701 'identity inferior-octave-output-list "\n") 687 'identity inferior-octave-output-list "\n")
702 "\n")))) 688 "\n"))))
703 689
704 ;; Find out whether Octave has built-in variables.
705 (inferior-octave-send-list-and-digest
706 (list "exist \"LOADPATH\"\n"))
707 (setq inferior-octave-has-built-in-variables
708 (string-match "101$" (car inferior-octave-output-list)))
709
710 ;; An empty secondary prompt, as e.g. obtained by '--braindead', 690 ;; An empty secondary prompt, as e.g. obtained by '--braindead',
711 ;; means trouble. 691 ;; means trouble.
712 (inferior-octave-send-list-and-digest (list "PS2\n")) 692 (inferior-octave-send-list-and-digest (list "PS2\n"))
713 (if (string-match "\\(PS2\\|ans\\) = *$" (car inferior-octave-output-list)) 693 (if (string-match "\\(PS2\\|ans\\) = *$" (car inferior-octave-output-list))
714 (inferior-octave-send-list-and-digest 694 (inferior-octave-send-list-and-digest (list "PS2 (\"> \");\n")))
715 (list (if inferior-octave-has-built-in-variables
716 "PS2 = \"> \"\n"
717 "PS2 (\"> \");\n"))))
718 695
719 ;; O.k., now we are ready for the Inferior Octave startup commands. 696 ;; O.k., now we are ready for the Inferior Octave startup commands.
720 (let* (commands 697 (let* (commands
@@ -725,9 +702,7 @@ startup file, `~/.emacs-octave'."
725 (list "more off;\n" 702 (list "more off;\n"
726 (if (not (string-equal 703 (if (not (string-equal
727 inferior-octave-output-string ">> ")) 704 inferior-octave-output-string ">> "))
728 (if inferior-octave-has-built-in-variables 705 "PS1 (\"\\\\s> \");\n")
729 "PS1=\"\\\\s> \";\n"
730 "PS1 (\"\\\\s> \");\n"))
731 (if (file-exists-p file) 706 (if (file-exists-p file)
732 (format "source (\"%s\");\n" file)))) 707 (format "source (\"%s\");\n" file))))
733 (inferior-octave-send-list-and-digest commands)) 708 (inferior-octave-send-list-and-digest commands))