Mercurial > emacs
comparison lisp/cedet/semantic/complete.el @ 104439:da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
cedet/data-debug.el: Require `ring' for use of ring-length.
cedet/semantic.el (semantic-repeat-parse-whole-stream): Check
semantic-working-type before updating progress reporter.
cedet/semantic/adebug.el: Fix file header.
cedet/semantic/analyze.el: eval-when-compile semantic/find, for
semantic-find-tags-by-name. Declare semanticdb-strip-find-results and
semanticdb-find-tags-by-name.
cedet/semantic/chart.el: Require semantic/find, semantic/db-mode,
semantic/db-typecache, and semantic/scope.
cedet/semantic/complete.el: Declare
semantic-displayor-focus-abstract-child-p function (needed as the
semantic-displayor-focus-abstract class is defined only after used).
Move semantic-complete-inline-custom-type and
semantic-complete-inline-analyzer-displayor-class variable definitions
up, before they are used, to avoid compiler warning.
Require semantic/decorate, semantic/tag-file, eieio-opt, and
semantic/analyze/complete.
cedet/semantic/ctxt.el: Require semantic/find. Don't
eval-when-compile semantic/db
(semantic-get-local-variables): Use Emacs' built-in progress reporter
instead of working-status-forms.
cedet/semantic/db-debug.el: Require data-debug, semantic/db-mode, and
semantic/format.
cedet/semantic/db-ebrowse.el: Require semantic/db-mode, semantic/find,
semantic/sort, data-debug
(semanticdb-create-database): Require semantic/dep for
semantic-add-system-include.
(semanticdb-table-ebrowse, semanticdb-project-database-ebrowse): Move
class definitions near top of file, before they are used, to avoid
compiler warnings.
(semanticdb-ebrowse-add-tree-to-table): Use split-string.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sun, 30 Aug 2009 21:16:39 +0000 |
parents | b1ac14799f78 |
children | b22b44e953cb |
comparison
equal
deleted
inserted
replaced
104438:33171bfc7147 | 104439:da5b2513c225 |
---|---|
1 ;;; complete.el --- Routines for performing tag completion | 1 ;;; semantic/complete.el --- Routines for performing tag completion |
2 | 2 |
3 ;;; Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009 | 3 ;;; Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009 |
4 ;;; Free Software Foundation, Inc. | 4 ;;; Free Software Foundation, Inc. |
5 | 5 |
6 ;; Author: Eric M. Ludlam <zappo@gnu.org> | 6 ;; Author: Eric M. Ludlam <zappo@gnu.org> |
106 ;; `semantic-complete-read-tag-engine' will use the minibuffer. | 106 ;; `semantic-complete-read-tag-engine' will use the minibuffer. |
107 ;; `semantic-complete-inline-tag-engine' will complete text in | 107 ;; `semantic-complete-inline-tag-engine' will complete text in |
108 ;; a buffer. | 108 ;; a buffer. |
109 | 109 |
110 (require 'eieio) | 110 (require 'eieio) |
111 (require 'semantic/tag) | 111 (require 'eieio-opt) |
112 (require 'semantic/tag-file) | |
112 (require 'semantic/find) | 113 (require 'semantic/find) |
113 (require 'semantic/analyze) | 114 (require 'semantic/analyze) |
114 (require 'semantic/format) | 115 (require 'semantic/format) |
115 (require 'semantic/ctxt) | 116 (require 'semantic/ctxt) |
116 ;; Keep semanticdb optional. | 117 ;; Keep semanticdb optional. |
117 (eval-when-compile | 118 ;; (eval-when-compile |
118 (require 'semantic/db) | 119 ;; (require 'semantic/db) |
119 (require 'semantic/db-find)) | 120 ;; (require 'semantic/db-find)) |
121 (require 'semantic/decorate) | |
122 (require 'semantic/analyze/complete) | |
123 | |
120 | 124 |
121 (eval-when-compile | 125 (eval-when-compile |
122 (condition-case nil | 126 (condition-case nil |
123 ;; Tooltip not available in older emacsen. | 127 ;; Tooltip not available in older emacsen. |
124 (require 'tooltip) | 128 (require 'tooltip) |
322 ;; We need to convert this into a valid tag. We can exit the minibuffer | 326 ;; We need to convert this into a valid tag. We can exit the minibuffer |
323 ;; for different reasons. If we purposely exit, we must make sure | 327 ;; for different reasons. If we purposely exit, we must make sure |
324 ;; the focused tag is calculated... preferably once. | 328 ;; the focused tag is calculated... preferably once. |
325 (defvar semantic-complete-current-matched-tag nil | 329 (defvar semantic-complete-current-matched-tag nil |
326 "Variable used to pass the tags being matched to the prompt.") | 330 "Variable used to pass the tags being matched to the prompt.") |
331 | |
332 ;; semantic-displayor-focus-abstract-child-p is part of the | |
333 ;; semantic-displayor-focus-abstract class, defined later in this | |
334 ;; file. | |
335 (declare-function semantic-displayor-focus-abstract-child-p "semantic/complete") | |
327 | 336 |
328 (defun semantic-complete-current-match () | 337 (defun semantic-complete-current-match () |
329 "Calculate a match from the current completion environment. | 338 "Calculate a match from the current completion environment. |
330 Save this in our completion variable. Make sure that variable | 339 Save this in our completion variable. Make sure that variable |
331 is cleared if any other keypress is made. | 340 is cleared if any other keypress is made. |
1757 | 1766 |
1758 | 1767 |
1759 ;;; ------------------------------------------------------------ | 1768 ;;; ------------------------------------------------------------ |
1760 ;;; Specific queries | 1769 ;;; Specific queries |
1761 ;; | 1770 ;; |
1771 (defvar semantic-complete-inline-custom-type | |
1772 (append '(radio) | |
1773 (mapcar | |
1774 (lambda (class) | |
1775 (let* ((C (intern (car class))) | |
1776 (doc (documentation-property C 'variable-documentation)) | |
1777 (doc1 (car (split-string doc "\n"))) | |
1778 ) | |
1779 (list 'const | |
1780 :tag doc1 | |
1781 C))) | |
1782 (eieio-build-class-alist semantic-displayor-abstract t)) | |
1783 ) | |
1784 "Possible options for inlince completion displayors. | |
1785 Use this to enable custom editing.") | |
1786 | |
1787 (defcustom semantic-complete-inline-analyzer-displayor-class | |
1788 'semantic-displayor-traditional | |
1789 "*Class for displayor to use with inline completion." | |
1790 :group 'semantic | |
1791 :type semantic-complete-inline-custom-type | |
1792 ) | |
1793 | |
1762 (defun semantic-complete-read-tag-buffer-deep (prompt &optional | 1794 (defun semantic-complete-read-tag-buffer-deep (prompt &optional |
1763 default-tag | 1795 default-tag |
1764 initial-input | 1796 initial-input |
1765 history) | 1797 history) |
1766 "Ask for a tag by name from the current buffer. | 1798 "Ask for a tag by name from the current buffer. |
1883 )) | 1915 )) |
1884 nil | 1916 nil |
1885 inp | 1917 inp |
1886 history))) | 1918 history))) |
1887 | 1919 |
1888 (defvar semantic-complete-inline-custom-type | |
1889 (append '(radio) | |
1890 (mapcar | |
1891 (lambda (class) | |
1892 (let* ((C (intern (car class))) | |
1893 (doc (documentation-property C 'variable-documentation)) | |
1894 (doc1 (car (split-string doc "\n"))) | |
1895 ) | |
1896 (list 'const | |
1897 :tag doc1 | |
1898 C))) | |
1899 (eieio-build-class-alist semantic-displayor-abstract t)) | |
1900 ) | |
1901 "Possible options for inlince completion displayors. | |
1902 Use this to enable custom editing.") | |
1903 | |
1904 (defcustom semantic-complete-inline-analyzer-displayor-class | |
1905 'semantic-displayor-traditional | |
1906 "*Class for displayor to use with inline completion." | |
1907 :group 'semantic | |
1908 :type semantic-complete-inline-custom-type | |
1909 ) | |
1910 | |
1911 | |
1912 (defun semantic-complete-inline-analyzer (context) | 1920 (defun semantic-complete-inline-analyzer (context) |
1913 "Complete a symbol name by name based on the current context. | 1921 "Complete a symbol name by name based on the current context. |
1914 This is similar to `semantic-complete-read-tag-analyze', except | 1922 This is similar to `semantic-complete-read-tag-analyze', except |
1915 that the completion interaction is in the buffer where the context | 1923 that the completion interaction is in the buffer where the context |
1916 was calculated from. | 1924 was calculated from. |
2123 ; ) | 2131 ; ) |
2124 | 2132 |
2125 ;; End | 2133 ;; End |
2126 (provide 'semantic/complete) | 2134 (provide 'semantic/complete) |
2127 | 2135 |
2128 ;;; semantic-complete.el ends here | 2136 ;;; semantic/complete.el ends here |