diff options
| author | Chong Yidong | 2009-09-27 03:59:51 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-09-27 03:59:51 +0000 |
| commit | 78f9c78d2d49d6acfa1a018c9cba82dcb12975b0 (patch) | |
| tree | 6a6fc93e31b39838e1fcf6639fc57374275bc1bc | |
| parent | abe6fcf1414b423362a59f26fbcb13e359a13264 (diff) | |
| download | emacs-78f9c78d2d49d6acfa1a018c9cba82dcb12975b0.tar.gz emacs-78f9c78d2d49d6acfa1a018c9cba82dcb12975b0.zip | |
* cedet/semantic/symref/list.el: Require semantic/complete.
(semantic-symref-symbol): Use
semantic-complete-read-tag-buffer-deep.
* cedet/semantic/ia.el (semantic-ia-complete-symbol-menu): Remove.
(semantic-ia-complete-symbol): Use semantic-complete-symbol.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/cedet/semantic/ia.el | 43 | ||||
| -rw-r--r-- | lisp/cedet/semantic/symref/list.el | 5 |
3 files changed, 11 insertions, 44 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8e4f9136e92..fd0fd6afb12 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2009-09-27 Chong Yidong <cyd@stupidchicken.com> | 1 | 2009-09-27 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 2 | ||
| 3 | * cedet/semantic/symref/list.el: Require semantic/complete. | ||
| 4 | (semantic-symref-symbol): Use | ||
| 5 | semantic-complete-read-tag-buffer-deep. | ||
| 6 | |||
| 7 | * cedet/semantic/ia.el (semantic-ia-complete-symbol-menu): Remove. | ||
| 8 | (semantic-ia-complete-symbol): Use semantic-complete-symbol. | ||
| 9 | |||
| 3 | * cedet/semantic/idle.el (semantic-idle-scheduler-work-timer): | 10 | * cedet/semantic/idle.el (semantic-idle-scheduler-work-timer): |
| 4 | Change timeout to 1. Doc fix. | 11 | Change timeout to 1. Doc fix. |
| 5 | 12 | ||
diff --git a/lisp/cedet/semantic/ia.el b/lisp/cedet/semantic/ia.el index 4fc4e49348a..1036a9b5b98 100644 --- a/lisp/cedet/semantic/ia.el +++ b/lisp/cedet/semantic/ia.el | |||
| @@ -35,7 +35,6 @@ | |||
| 35 | ;; fast-jump. For a virtual method, offer some of the possible | 35 | ;; fast-jump. For a virtual method, offer some of the possible |
| 36 | ;; implementations in various sub-classes. | 36 | ;; implementations in various sub-classes. |
| 37 | 37 | ||
| 38 | ;; (require 'senator) | ||
| 39 | (require 'semantic/analyze) | 38 | (require 'semantic/analyze) |
| 40 | (require 'semantic/format) | 39 | (require 'semantic/format) |
| 41 | (require 'pulse) | 40 | (require 'pulse) |
| @@ -137,8 +136,7 @@ Completion options are calculated with `semantic-analyze-possible-completions'." | |||
| 137 | ;; | 136 | ;; |
| 138 | ;; This is a way of making this fcn more useful since the | 137 | ;; This is a way of making this fcn more useful since the |
| 139 | ;; smart completion engine sometimes failes. | 138 | ;; smart completion engine sometimes failes. |
| 140 | (senator-complete-symbol) | 139 | (semantic-complete-symbol))) |
| 141 | )) | ||
| 142 | ;; Use try completion to seek a common substring. | 140 | ;; Use try completion to seek a common substring. |
| 143 | (let ((tc (try-completion (or pre "") syms))) | 141 | (let ((tc (try-completion (or pre "") syms))) |
| 144 | (if (and (stringp tc) (not (string= tc (or pre "")))) | 142 | (if (and (stringp tc) (not (string= tc (or pre "")))) |
| @@ -167,45 +165,6 @@ Completion options are calculated with `semantic-analyze-possible-completions'." | |||
| 167 | :group 'semantic | 165 | :group 'semantic |
| 168 | :type semantic-format-tag-custom-list) | 166 | :type semantic-format-tag-custom-list) |
| 169 | 167 | ||
| 170 | ;;;###autoload | ||
| 171 | (defun semantic-ia-complete-symbol-menu (point) | ||
| 172 | "Complete the current symbol via a menu based at POINT. | ||
| 173 | Completion options are calculated with `semantic-analyze-possible-completions'." | ||
| 174 | (interactive "d") | ||
| 175 | (require 'imenu) | ||
| 176 | (let* ((a (semantic-analyze-current-context point)) | ||
| 177 | (syms (semantic-ia-get-completions a point)) | ||
| 178 | ) | ||
| 179 | ;; Complete this symbol. | ||
| 180 | (if (not syms) | ||
| 181 | (progn | ||
| 182 | (message "No smart completions found. Trying Senator.") | ||
| 183 | (when (semantic-analyze-context-p a) | ||
| 184 | ;; This is a quick way of getting a nice completion list | ||
| 185 | ;; in the menu if the regular context mechanism fails. | ||
| 186 | (senator-completion-menu-popup))) | ||
| 187 | |||
| 188 | (let* ((menu | ||
| 189 | (mapcar | ||
| 190 | (lambda (tag) | ||
| 191 | (cons | ||
| 192 | (funcall semantic-ia-completion-menu-format-tag-function tag) | ||
| 193 | (vector tag))) | ||
| 194 | syms)) | ||
| 195 | (ans | ||
| 196 | (imenu--mouse-menu | ||
| 197 | ;; XEmacs needs that the menu has at least 2 items. So, | ||
| 198 | ;; include a nil item that will be ignored by imenu. | ||
| 199 | (cons nil menu) | ||
| 200 | (senator-completion-menu-point-as-event) | ||
| 201 | "Completions"))) | ||
| 202 | (when ans | ||
| 203 | (if (not (semantic-tag-p ans)) | ||
| 204 | (setq ans (aref (cdr ans) 0))) | ||
| 205 | (delete-region (car (oref a bounds)) (cdr (oref a bounds))) | ||
| 206 | (semantic-ia-insert-tag ans)) | ||
| 207 | )))) | ||
| 208 | |||
| 209 | ;;; Completions Tip | 168 | ;;; Completions Tip |
| 210 | ;; | 169 | ;; |
| 211 | ;; This functions shows how to get the list of completions, | 170 | ;; This functions shows how to get the list of completions, |
diff --git a/lisp/cedet/semantic/symref/list.el b/lisp/cedet/semantic/symref/list.el index 20d911225ab..08d2478283b 100644 --- a/lisp/cedet/semantic/symref/list.el +++ b/lisp/cedet/semantic/symref/list.el | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | ;; NOTE: Need to add some refactoring tools. | 34 | ;; NOTE: Need to add some refactoring tools. |
| 35 | 35 | ||
| 36 | (require 'semantic/symref) | 36 | (require 'semantic/symref) |
| 37 | (require 'semantic/complete) | ||
| 37 | (require 'pulse) | 38 | (require 'pulse) |
| 38 | 39 | ||
| 39 | ;;; Code: | 40 | ;;; Code: |
| @@ -69,8 +70,8 @@ current project to find references to the input SYM. The | |||
| 69 | references are the organized by file and the name of the function | 70 | references are the organized by file and the name of the function |
| 70 | they are used in. | 71 | they are used in. |
| 71 | Display the references in`semantic-symref-results-mode'" | 72 | Display the references in`semantic-symref-results-mode'" |
| 72 | (interactive (list (car (senator-jump-interactive "Symrefs for: " nil nil t))) | 73 | (interactive (list (semantic-tag-name (semantic-complete-read-tag-buffer-deep |
| 73 | ) | 74 | "Symrefs for: ")))) |
| 74 | (semantic-fetch-tags) | 75 | (semantic-fetch-tags) |
| 75 | (let ((res nil) | 76 | (let ((res nil) |
| 76 | ) | 77 | ) |