diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2009-12-03 02:58:16 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2009-12-03 02:58:16 +0000 |
commit | 69a94a37cdf891955fd062d4c12dc2962ae1daab (patch) | |
tree | f8d2df70c25d118d09219b27957a064808aba6b9 /lisp/progmodes/octave-mod.el | |
parent | 8d2221483a384a61971b7742a73edfff4c230063 (diff) | |
download | emacs-69a94a37cdf891955fd062d4c12dc2962ae1daab.tar.gz |
(octave-complete-symbol): Use completion-in-region.
Diffstat (limited to 'lisp/progmodes/octave-mod.el')
-rw-r--r-- | lisp/progmodes/octave-mod.el | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el index 0671dbe807a..ab3c7781868 100644 --- a/lisp/progmodes/octave-mod.el +++ b/lisp/progmodes/octave-mod.el @@ -1237,45 +1237,10 @@ otherwise." "Perform completion on Octave symbol preceding point. Compare that symbol against Octave's reserved words and builtin variables." - ;; This code taken from lisp-complete-symbol (interactive) (let* ((end (point)) - (beg (save-excursion (backward-sexp 1) (point))) - (string (buffer-substring-no-properties beg end)) - (completion (try-completion string octave-completion-alist))) - (cond ((eq completion t)) ; ??? - ((null completion) - (message "Can't find completion for \"%s\"" string) - (ding)) - ((not (string= string completion)) - (delete-region beg end) - (insert completion)) - (t - (let ((list (all-completions string octave-completion-alist)) - (conf (current-window-configuration))) - ;; Taken from comint.el - (message "Making completion list...") - (with-output-to-temp-buffer "*Completions*" - (display-completion-list list string)) - (message "Hit space to flush") - (let (key first) - (if (with-current-buffer (get-buffer "*Completions*") - (setq key (read-key-sequence nil) - first (aref key 0)) - (and (consp first) (consp (event-start first)) - (eq (window-buffer (posn-window (event-start - first))) - (get-buffer "*Completions*")) - (eq (key-binding key) 'mouse-choose-completion))) - (progn - (if (fboundp 'mouse-choose-completion) - (mouse-choose-completion first) - (choose-completion first)) ; Emacs >= 23.2 - (set-window-configuration conf)) - (if (eq first ?\ ) - (set-window-configuration conf) - (setq unread-command-events - (listify-key-sequence key)))))))))) + (beg (save-excursion (backward-sexp 1) (point)))) + (completion-in-region beg end octave-completion-alist))) ;;; Electric characters && friends |