aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2009-12-05 22:01:00 +0000
committerChong Yidong2009-12-05 22:01:00 +0000
commit9a594ee6eadd63fbf9daa69b701401c86aeddf01 (patch)
treef8f4ee76e4aa4232def6190e45fa7d475882cedc
parent212c5aef95f68f8fb8af05df2af19374f0ab7867 (diff)
downloademacs-9a594ee6eadd63fbf9daa69b701401c86aeddf01.tar.gz
emacs-9a594ee6eadd63fbf9daa69b701401c86aeddf01.zip
* bindings.el (complete-symbol): Call semantic-ia-complete-symbol if
possible. * cedet/semantic/ia.el (semantic-ia-complete-symbol): Make argument optional.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/bindings.el29
-rw-r--r--lisp/cedet/semantic/ia.el12
-rw-r--r--lisp/progmodes/etags.el1
4 files changed, 30 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d03ca939088..9ff951b09a3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,11 @@
12009-12-05 Chong Yidong <cyd@stupidchicken.com> 12009-12-05 Chong Yidong <cyd@stupidchicken.com>
2 2
3 * bindings.el (complete-symbol): Call semantic-ia-complete-symbol
4 if possible.
5
6 * cedet/semantic/ia.el (semantic-ia-complete-symbol): Make
7 argument optional.
8
3 * shell.el (shell): Require ansi-color (Bug#5113). 9 * shell.el (shell): Require ansi-color (Bug#5113).
4 10
5 * ansi-color.el (ansi-color-for-comint-mode): Default to t. 11 * ansi-color.el (ansi-color-for-comint-mode): Default to t.
diff --git a/lisp/bindings.el b/lisp/bindings.el
index c02980f04b2..64c57d112c7 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -671,23 +671,28 @@ is okay. See `mode-line-format'.")
671 671
672(define-key esc-map "\t" 'complete-symbol) 672(define-key esc-map "\t" 'complete-symbol)
673 673
674(defun complete-symbol (arg) "\ 674(defun complete-symbol (arg)
675Perform tags completion on the text around point. 675 "Perform tags completion on the text around point.
676Completes to the set of names listed in the current tags table. 676If a tags table is loaded, call `complete-tag'.
677The string to complete is chosen in the same way as the default 677Otherwise, if Semantic is active, call `semantic-ia-complete-symbol'.
678for \\[find-tag] (which see).
679 678
680With a prefix argument, this command does completion within 679With a prefix argument, this command does completion within
681the collection of symbols listed in the index of the manual for the 680the collection of symbols listed in the index of the manual for the
682language you are using." 681language you are using."
683 (interactive "P") 682 (interactive "P")
684 (if arg 683 (cond (arg
685 (info-complete-symbol) 684 (info-complete-symbol))
686 (if (fboundp 'complete-tag) 685 ((or tags-table-list tags-file-name)
687 (complete-tag) 686 (complete-tag))
688 ;; Don't autoload etags if we have no tags table. 687 ((and (fboundp 'semantic-ia-complete-symbol)
689 (error "%s" (substitute-command-keys 688 (fboundp 'semantic-active-p)
690 "No tags table loaded; use \\[visit-tags-table] to load one"))))) 689 (semantic-active-p))
690 (semantic-ia-complete-symbol))
691 (t
692 (error "%s"
693 (substitute-command-keys
694 "No completions available; use \\[visit-tags-table] \
695or \\[semantic-mode]")))))
691 696
692;; Reduce total amount of space we must allocate during this function 697;; Reduce total amount of space we must allocate during this function
693;; that we will not need to keep permanently. 698;; that we will not need to keep permanently.
diff --git a/lisp/cedet/semantic/ia.el b/lisp/cedet/semantic/ia.el
index 573f9fa867f..b0ae6301185 100644
--- a/lisp/cedet/semantic/ia.el
+++ b/lisp/cedet/semantic/ia.el
@@ -105,19 +105,21 @@ Supports caching."
105 symbols)) 105 symbols))
106 106
107;;;###autoload 107;;;###autoload
108(defun semantic-ia-complete-symbol (point) 108(defun semantic-ia-complete-symbol (&optional pos)
109 "Complete the current symbol at POINT. 109 "Complete the current symbol at POS.
110If POS is nil, default to point.
110Completion options are calculated with `semantic-analyze-possible-completions'." 111Completion options are calculated with `semantic-analyze-possible-completions'."
111 (interactive "d") 112 (interactive "d")
113 (or pos (setq pos (point)))
112 ;; Calculating completions is a two step process. 114 ;; Calculating completions is a two step process.
113 ;; 115 ;;
114 ;; The first analyzer the current context, which finds tags 116 ;; The first analyzer the current context, which finds tags
115 ;; for all the stuff that may be references by the code around 117 ;; for all the stuff that may be references by the code around
116 ;; POINT. 118 ;; POS.
117 ;; 119 ;;
118 ;; The second step derives completions from that context. 120 ;; The second step derives completions from that context.
119 (let* ((a (semantic-analyze-current-context point)) 121 (let* ((a (semantic-analyze-current-context pos))
120 (syms (semantic-ia-get-completions a point)) 122 (syms (semantic-ia-get-completions a pos))
121 (pre (car (reverse (oref a prefix)))) 123 (pre (car (reverse (oref a prefix))))
122 ) 124 )
123 ;; If PRE was actually an already completed symbol, it doesn't 125 ;; If PRE was actually an already completed symbol, it doesn't
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 2893fdfb766..82606362826 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -2027,7 +2027,6 @@ see the doc of that variable if you want to add names to the list."
2027 (interactive) 2027 (interactive)
2028 (quit-window t (selected-window))) 2028 (quit-window t (selected-window)))
2029 2029
2030;; Note, there is another definition of this function in bindings.el.
2031;;;###autoload 2030;;;###autoload
2032(defun complete-tag () 2031(defun complete-tag ()
2033 "Perform tags completion on the text around point. 2032 "Perform tags completion on the text around point.