aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu2016-06-25 08:57:51 +0800
committerLeo Liu2016-06-25 09:49:16 +0800
commitd590048bed8466e84c66d60f35df236d0ff8e81b (patch)
tree6761c641e552d54db2f7c51e4f7b16312e19bf3a
parentb120fbd6a40de657673bea7c3a630cf514b59310 (diff)
downloademacs-d590048bed8466e84c66d60f35df236d0ff8e81b.tar.gz
emacs-d590048bed8466e84c66d60f35df236d0ff8e81b.zip
Remove compatibility with Emacs 24.3 in octave-mode
* lisp/progmodes/octave.el: Clean up and remove compatibility with Emacs 24.3.
-rw-r--r--lisp/progmodes/octave.el43
1 files changed, 3 insertions, 40 deletions
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index f309565acff..4f223f2f3cc 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -34,31 +34,6 @@
34;;; Code: 34;;; Code:
35(require 'comint) 35(require 'comint)
36 36
37;;; For emacs < 24.3.
38(require 'newcomment)
39(eval-and-compile
40 (unless (fboundp 'user-error)
41 (defalias 'user-error 'error))
42 (unless (fboundp 'delete-consecutive-dups)
43 (defalias 'delete-consecutive-dups 'delete-dups))
44 (unless (fboundp 'completion-table-with-cache)
45 (defun completion-table-with-cache (fun &optional ignore-case)
46 ;; See eg bug#11906.
47 (let* (last-arg last-result
48 (new-fun
49 (lambda (arg)
50 (if (and last-arg (string-prefix-p last-arg arg ignore-case))
51 last-result
52 (prog1
53 (setq last-result (funcall fun arg))
54 (setq last-arg arg))))))
55 (completion-table-dynamic new-fun)))))
56(eval-when-compile
57 (unless (fboundp 'setq-local)
58 (defmacro setq-local (var val)
59 "Set variable VAR to value VAL in current buffer."
60 (list 'set (list 'make-local-variable (list 'quote var)) val))))
61
62(defgroup octave nil 37(defgroup octave nil
63 "Editing Octave code." 38 "Editing Octave code."
64 :link '(custom-manual "(octave-mode)Top") 39 :link '(custom-manual "(octave-mode)Top")
@@ -605,13 +580,8 @@ Key bindings:
605 580
606 (setq-local fill-nobreak-predicate 581 (setq-local fill-nobreak-predicate
607 (lambda () (eq (octave-in-string-p) ?'))) 582 (lambda () (eq (octave-in-string-p) ?')))
608 (with-no-warnings 583 (add-function :around (local 'comment-line-break-function)
609 (if (fboundp 'add-function) ; new in 24.4 584 #'octave--indent-new-comment-line)
610 (add-function :around (local 'comment-line-break-function)
611 #'octave--indent-new-comment-line)
612 (setq-local comment-line-break-function
613 (apply-partially #'octave--indent-new-comment-line
614 #'comment-indent-new-line))))
615 585
616 (setq font-lock-defaults '(octave-font-lock-keywords)) 586 (setq font-lock-defaults '(octave-font-lock-keywords))
617 587
@@ -908,9 +878,6 @@ startup file, `~/.emacs-octave'."
908 (inferior-octave-completion-table) 878 (inferior-octave-completion-table)
909 'comint-completion-file-name-table)))))) 879 'comint-completion-file-name-table))))))
910 880
911(define-obsolete-function-alias 'inferior-octave-complete
912 'completion-at-point "24.1")
913
914(defun inferior-octave-dynamic-list-input-ring () 881(defun inferior-octave-dynamic-list-input-ring ()
915 "List the buffer's input history in a help buffer." 882 "List the buffer's input history in a help buffer."
916 ;; We cannot use `comint-dynamic-list-input-ring', because it replaces 883 ;; We cannot use `comint-dynamic-list-input-ring', because it replaces
@@ -1060,8 +1027,7 @@ directory and makes this the current buffer's default directory."
1060 (skip-syntax-backward "-(") 1027 (skip-syntax-backward "-(")
1061 (thing-at-point 'symbol))))) 1028 (thing-at-point 'symbol)))))
1062 (completing-read 1029 (completing-read
1063 (format (if def "Function (default %s): " 1030 (format (if def "Function (default %s): " "Function: ") def)
1064 "Function: ") def)
1065 (inferior-octave-completion-table) 1031 (inferior-octave-completion-table)
1066 nil nil nil nil def))) 1032 nil nil nil nil def)))
1067 1033
@@ -1448,9 +1414,6 @@ The block marked is the one that contains point or follows point."
1448 (inferior-octave-completion-table)) 1414 (inferior-octave-completion-table))
1449 octave-reserved-words))))) 1415 octave-reserved-words)))))
1450 1416
1451(define-obsolete-function-alias 'octave-complete-symbol
1452 'completion-at-point "24.1")
1453
1454(defun octave-add-log-current-defun () 1417(defun octave-add-log-current-defun ()
1455 "A function for `add-log-current-defun-function' (which see)." 1418 "A function for `add-log-current-defun-function' (which see)."
1456 (save-excursion 1419 (save-excursion