diff options
| author | Leo Liu | 2013-05-09 08:52:49 +0800 |
|---|---|---|
| committer | Leo Liu | 2013-05-09 08:52:49 +0800 |
| commit | 455851dd0cba67f2b1ec28296e34e34ff1668251 (patch) | |
| tree | 25f4db0d5d260fcc19050ab12d0391ee5348a1cd | |
| parent | ad75d77ea30f940da9bcc3a96ee265896248e7ee (diff) | |
| download | emacs-455851dd0cba67f2b1ec28296e34e34ff1668251.tar.gz emacs-455851dd0cba67f2b1ec28296e34e34ff1668251.zip | |
* progmodes/octave.el (inferior-octave-completion-at-point):
Restore the broken file completion.
(inferior-octave-startup): Fix incorrect highlighting for the
first prompt.
Fixes: debbugs:14300
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/progmodes/octave.el | 23 |
2 files changed, 22 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 12e2007c126..e681469fedc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2013-05-09 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * progmodes/octave.el (inferior-octave-completion-at-point): | ||
| 4 | Restore the broken file completion. (Bug#14300) | ||
| 5 | (inferior-octave-startup): Fix incorrect highlighting for the | ||
| 6 | first prompt. | ||
| 7 | |||
| 1 | 2013-05-08 Stefan Monnier <monnier@iro.umontreal.ca> | 8 | 2013-05-08 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 9 | ||
| 3 | * progmodes/ruby-mode.el: First cut at SMIE support. | 10 | * progmodes/ruby-mode.el: First cut at SMIE support. |
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 138c1948131..6e6e6feb772 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el | |||
| @@ -716,7 +716,6 @@ startup file, `~/.emacs-octave'." | |||
| 716 | (when (and inferior-octave-startup-file | 716 | (when (and inferior-octave-startup-file |
| 717 | (file-exists-p inferior-octave-startup-file)) | 717 | (file-exists-p inferior-octave-startup-file)) |
| 718 | (format "source (\"%s\");\n" inferior-octave-startup-file)))) | 718 | (format "source (\"%s\");\n" inferior-octave-startup-file)))) |
| 719 | ;; XXX: the first prompt is incorrectly highlighted | ||
| 720 | (insert-before-markers | 719 | (insert-before-markers |
| 721 | (concat | 720 | (concat |
| 722 | (if inferior-octave-output-list | 721 | (if inferior-octave-output-list |
| @@ -729,7 +728,9 @@ startup file, `~/.emacs-octave'." | |||
| 729 | (set-process-filter proc 'comint-output-filter) | 728 | (set-process-filter proc 'comint-output-filter) |
| 730 | ;; Just in case, to be sure a cd in the startup file | 729 | ;; Just in case, to be sure a cd in the startup file |
| 731 | ;; won't have detrimental effects. | 730 | ;; won't have detrimental effects. |
| 732 | (inferior-octave-resync-dirs))) | 731 | (inferior-octave-resync-dirs) |
| 732 | ;; A trick to get the prompt highlighted. | ||
| 733 | (comint-send-string proc "\n"))) | ||
| 733 | 734 | ||
| 734 | (defun inferior-octave-completion-table () | 735 | (defun inferior-octave-completion-table () |
| 735 | (completion-table-dynamic | 736 | (completion-table-dynamic |
| @@ -741,13 +742,19 @@ startup file, `~/.emacs-octave'." | |||
| 741 | 742 | ||
| 742 | (defun inferior-octave-completion-at-point () | 743 | (defun inferior-octave-completion-at-point () |
| 743 | "Return the data to complete the Octave symbol at point." | 744 | "Return the data to complete the Octave symbol at point." |
| 744 | (let* ((end (point)) | 745 | ;; http://debbugs.gnu.org/14300 |
| 746 | (let* ((filecomp (string-match-p | ||
| 747 | "/" (or (comint--match-partial-filename) ""))) | ||
| 748 | (end (point)) | ||
| 745 | (start | 749 | (start |
| 746 | (save-excursion | 750 | (unless filecomp |
| 747 | (skip-syntax-backward "w_" (comint-line-beginning-position)) | 751 | (save-excursion |
| 748 | (point)))) | 752 | (skip-syntax-backward "w_" (comint-line-beginning-position)) |
| 749 | (when (> end start) | 753 | (point))))) |
| 750 | (list start end (inferior-octave-completion-table))))) | 754 | (when (and start (> end start)) |
| 755 | (list start end (completion-table-in-turn | ||
| 756 | (inferior-octave-completion-table) | ||
| 757 | 'comint-completion-file-name-table))))) | ||
| 751 | 758 | ||
| 752 | (define-obsolete-function-alias 'inferior-octave-complete | 759 | (define-obsolete-function-alias 'inferior-octave-complete |
| 753 | 'completion-at-point "24.1") | 760 | 'completion-at-point "24.1") |