From 2e611da66e0192a8a63437dbc8f116314cadb71d Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Sat, 12 Apr 2014 12:07:53 +0800 Subject: [PATCH] Don't break emacs <= 24.3 just yet * progmodes/octave.el (completion-table-with-cache): Define if not available. (octave-goto-function-definition) (octave-sync-function-file-names) (octave-find-definition-default-filename): Backquote upattern for compatibility. --- lisp/ChangeLog | 9 ++++++++ lisp/progmodes/octave.el | 50 +++++++++++++++++++++++++--------------- 2 files changed, 40 insertions(+), 19 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2c5b40ef86..6ccf81c9c3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2014-04-12 Leo Liu + + * progmodes/octave.el (completion-table-with-cache): Define if not + available. + (octave-goto-function-definition) + (octave-sync-function-file-names) + (octave-find-definition-default-filename): Backquote upattern for + compatibility. + 2014-04-11 Michael Albinus * net/tramp-sh.el (tramp-sh-handle-file-truename): Quote the file diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 123aac03ea..3fdcec219d 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -40,7 +40,19 @@ (unless (fboundp 'user-error) (defalias 'user-error 'error)) (unless (fboundp 'delete-consecutive-dups) - (defalias 'delete-consecutive-dups 'delete-dups))) + (defalias 'delete-consecutive-dups 'delete-dups)) + (unless (fboundp 'completion-table-with-cache) + (defun completion-table-with-cache (fun &optional ignore-case) + ;; See eg bug#11906. + (let* (last-arg last-result + (new-fun + (lambda (arg) + (if (and last-arg (string-prefix-p last-arg arg ignore-case)) + last-result + (prog1 + (setq last-result (funcall fun arg)) + (setq last-arg arg)))))) + (completion-table-dynamic new-fun))))) (eval-when-compile (unless (fboundp 'setq-local) (defmacro setq-local (var val) @@ -1048,8 +1060,8 @@ directory and makes this the current buffer's default directory." (unless found (goto-char orig)) found)))) (pcase (and buffer-file-name (file-name-extension buffer-file-name)) - ("cc" (funcall search - "\\_