~ubuntu-branches/debian/stretch/ecb/stretch

« back to all changes in this revision

Viewing changes to ecb-semantic-wrapper.el

  • Committer: Package Import Robot
  • Author(s): Balint Reczey
  • Date: 2014-10-25 16:13:05 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20141025161305-6cg7rnaao1xa4ngb
Tags: 2.40+git20140216-1
* Adopting the package
  Thanks to Mike O'Connor for maintaing the package (Closes: #766440)
* New upstream snapshot (Closes: #729865)
* Drop obsoleted patches
* Bump dh compat level to 9
* Move packaging repository to git.debian.org
* Depend on default emacs (Closes: #754002)
* Bump standards version, no changes needed
* Move homepage URL to source package description

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
;; GNU Emacs; see the file COPYING.  If not, write to the Free Software
23
23
;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
24
 
25
 
;; $Id: ecb-semantic-wrapper.el,v 1.27 2009/04/15 14:22:35 berndl Exp $
 
25
;; $Id$
26
26
 
27
27
;;; Commentary:
28
28
 
38
38
 
39
39
 
40
40
(require 'semantic)
41
 
(require 'semantic/ctxt)
42
 
(require 'semantic/analyze)
 
41
(if (locate-library "semantic-ctxt")
 
42
    (progn
 
43
      (require 'semantic-ctxt)
 
44
      (require 'semantic-analyze))
 
45
  (progn
 
46
    (require 'semantic/ctxt)
 
47
    (require 'semantic/analyze)))
43
48
 
44
49
(defconst ecb-semantic-2-loaded (string-match "^2" semantic-version))
45
50
(defconst ecb-semantic-2-beta-nr (if (and ecb-semantic-2-loaded
60
65
(silentcomp-defvar semanticdb-search-system-databases)
61
66
(silentcomp-defvar semantic-format-use-images-flag)
62
67
(silentcomp-defvar ezimage-use-images)
63
 
;; semantic 2.0 does not have this
64
 
(silentcomp-defvar semantic-toplevel-bovine-cache)
65
68
 
66
69
;; -- getter functions for all variables of semantic currently used by ECB ---
67
70
 
205
208
      (apply 'semantic-tag name class ignore)
206
209
    (list name class nil nil nil nil)))
207
210
 
208
 
(defsubst ecb--semantic-tag-new-variable (name type default-value &rest attributes)
 
211
(with-no-warnings(defsubst ecb--semantic-tag-new-variable (name type default-value &rest attributes)
209
212
  "Create a semantic tag of class variable"
210
213
  (if (fboundp 'semantic-tag-new-variable)
211
214
      (apply 'semantic-tag-new-variable name type default-value attributes)
212
 
    (list name 'variable nil nil nil nil)))
 
215
    (list name 'variable nil nil nil nil))))
213
216
 
214
217
(defsubst ecb--semantic--tag-set-overlay (tag overlay)
215
218
  "Set the overlay part of TAG with OVERLAY. OVERLAY can be an overlay or an
221
224
  "Attempt to calculate the parent-tag of TAG."
222
225
  (if (fboundp 'semantic-tag-calculate-parent)
223
226
      (apply 'semantic-tag-calculate-parent (list tag))
224
 
    (save-excursion
225
 
      (set-buffer (ecb--semantic-tag-buffer tag))
 
227
    (with-current-buffer (ecb--semantic-tag-buffer tag)
226
228
      (goto-char (ecb--semantic-tag-start tag))
227
229
      (ecb--semantic-current-tag-parent))))
228
230
 
285
287
(if (fboundp 'semantic-fetch-available-tags)
286
288
    (defalias 'ecb--semantic-fetch-available-tags 'semantic-fetch-available-tags)
287
289
  (defsubst ecb--semantic-fetch-available-tags ()
288
 
    semantic-toplevel-bovine-cache))
 
290
    (if (boundp 'semantic--buffer-cache)
 
291
        semantic--buffer-cache
 
292
      semantic-toplevel-bovine-cache)))
289
293
 
290
294
(if (fboundp 'semantic-tag-components)
291
295
    (defalias 'ecb--semantic-tag-components