Mercurial > emacs
annotate lisp/cedet/semantic/fw.el @ 104513:a6a812dd2d88
* cedet/semantic/lex.el (semantic-lex-reset-hooks): Doc fix.
* cedet/semantic/idle.el
(semantic-before-idle-scheduler-reparse-hook)
(semantic-after-idle-scheduler-reparse-hook): Rename from *-hooks.
Make old name an obsolete alias.
* cedet/semantic/edit.el (semantic-after-partial-cache-change-hook)
(semantic-change-hooks, semantic-edits-new-change-hooks)
(semantic-edits-delete-change-hooks)
(semantic-edits-move-change-hook)
(semantic-edits-reparse-change-hooks)
(semantic-edits-incremental-reparse-failed-hooks): Doc fixes.
* cedet/semantic/debug.el (semantic-debug-mode): Rename hook
symbols.
* cedet/semantic/db-mode.el (semanticdb-mode-hook): Rename from
semanticdb-mode-hooks.
(global-semanticdb-minor-mode): Use the new name.
(semanticdb-hooks): Use semantic-init-db-hook instead of obsolete
alias semantic-init-db-hooks.
* cedet/semantic/db-global.el (semanticdb-enable-gnu-global-databases):
Use semantic-init-hook instead of obsolete alias
semantic-init-hooks.
* cedet/semantic/db-file.el (semanticdb-save-database-hook):
Rename from semanticdb-save-database-hooks. Make old name an
obsolete alias.
* cedet/semantic/decorate/mode.el
(semantic-decorate-pending-decoration-hook): Rename from
semantic-decorate-pending-decoration-hooks. Make old name an
obsolete alias.
* cedet/srecode/map.el (srecode-map-validate-file-for-mode): Use
semantic-init-hook instead of obsolete alias semantic-init-hooks.
* cedet/semantic/fw.el (semantic-find-file-noselect): Use
semantic-init-hook instead of obsolete alias semantic-init-hooks.
* cedet/ede/project-am.el (project-am-with-makefile-current): Use
semantic-init-hook instead of obsolete alias semantic-init-hooks.
* cedet/semantic/util.el (semantic-describe-buffer): Use
semantic-init-hook and semantic-init-db-hook instead of obsolete
aliases.
* cedet/semantic/util-modes.el (semantic-mode-line-update)
(semantic-toggle-minor-mode-globally): Use semantic-init-hook
instead of obsolete alias semantic-init-hooks.
Synch to Eric Ludlam's upstream CEDET repository:
* cedet/semantic/bovine/c.el (semantic-c-parse-token-hack-depth):
New var.
(semantic-c-parse-lexical-token): Save match data when setting up
the secondary parse buffer. Allow recursion. Protect against
initializing the major mode from throwing errors, ie user hooks.
* cedet/semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Protect installing a major mode from throwing errors.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sat, 26 Sep 2009 17:47:11 +0000 |
parents | a4e1a12c8b97 |
children | bbd7017a25d9 |
rev | line source |
---|---|
104412
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1 ;;; semantic-fw.el --- Framework for Semantic |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
2 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
3 ;;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
4 ;;; 2007, 2008, 2009 Free Software Foundation, Inc. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
5 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
6 ;; Author: Eric M. Ludlam <zappo@gnu.org> |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
7 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
8 ;; This file is part of GNU Emacs. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
9 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
10 ;; GNU Emacs is free software: you can redistribute it and/or modify |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
11 ;; it under the terms of the GNU General Public License as published by |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
12 ;; the Free Software Foundation, either version 3 of the License, or |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
13 ;; (at your option) any later version. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
14 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
15 ;; GNU Emacs is distributed in the hope that it will be useful, |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
18 ;; GNU General Public License for more details. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
19 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
20 ;; You should have received a copy of the GNU General Public License |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
22 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
23 ;;; Commentary: |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
24 ;; |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
25 ;; Semantic has several core features shared across it's lex/parse/util |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
26 ;; stages. This used to clutter semantic.el some. These routines are all |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
27 ;; simple things that are not parser specific, but aid in making |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
28 ;; semantic flexible and compatible amongst different Emacs platforms. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
29 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
30 ;;; Code: |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
31 ;; |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
32 (require 'mode-local) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
33 (require 'eieio) |
104444
2bf481006ba4
lisp/Makefile.in: Ignore CEDET subdirectories when making subdirs.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
104412
diff
changeset
|
34 (require 'semantic/loaddefs) |
104412
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
35 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
36 ;;; Compatibility |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
37 ;; |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
38 (if (featurep 'xemacs) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
39 (progn |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
40 (defalias 'semantic-buffer-local-value 'symbol-value-in-buffer) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
41 (defalias 'semantic-overlay-live-p |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
42 (lambda (o) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
43 (and (extent-live-p o) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
44 (not (extent-detached-p o)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
45 (bufferp (extent-buffer o))))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
46 (defalias 'semantic-make-overlay |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
47 (lambda (beg end &optional buffer &rest rest) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
48 "Xemacs `make-extent', supporting the front/rear advance options." |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
49 (let ((ol (make-extent beg end buffer))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
50 (when rest |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
51 (set-extent-property ol 'start-open (car rest)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
52 (setq rest (cdr rest))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
53 (when rest |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
54 (set-extent-property ol 'end-open (car rest))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
55 ol))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
56 (defalias 'semantic-overlay-put 'set-extent-property) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
57 (defalias 'semantic-overlay-get 'extent-property) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
58 (defalias 'semantic-overlay-properties 'extent-properties) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
59 (defalias 'semantic-overlay-move 'set-extent-endpoints) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
60 (defalias 'semantic-overlay-delete 'delete-extent) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
61 (defalias 'semantic-overlays-at |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
62 (lambda (pos) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
63 (condition-case nil |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
64 (extent-list nil pos pos) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
65 (error nil)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
66 )) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
67 (defalias 'semantic-overlays-in |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
68 (lambda (beg end) (extent-list nil beg end))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
69 (defalias 'semantic-overlay-buffer 'extent-buffer) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
70 (defalias 'semantic-overlay-start 'extent-start-position) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
71 (defalias 'semantic-overlay-end 'extent-end-position) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
72 (defalias 'semantic-overlay-size 'extent-length) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
73 (defalias 'semantic-overlay-next-change 'next-extent-change) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
74 (defalias 'semantic-overlay-previous-change 'previous-extent-change) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
75 (defalias 'semantic-overlay-lists |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
76 (lambda () (list (extent-list)))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
77 (defalias 'semantic-overlay-p 'extentp) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
78 (defalias 'semantic-event-window 'event-window) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
79 (defun semantic-read-event () |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
80 (let ((event (next-command-event))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
81 (if (key-press-event-p event) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
82 (let ((c (event-to-character event))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
83 (if (char-equal c (quit-char)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
84 (keyboard-quit) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
85 c))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
86 event)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
87 (defun semantic-popup-menu (menu) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
88 "Blockinig version of `popup-menu'" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
89 (popup-menu menu) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
90 ;; Wait... |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
91 (while (popup-up-p) (dispatch-event (next-event)))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
92 ) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
93 ;; Emacs Bindings |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
94 (defalias 'semantic-buffer-local-value 'buffer-local-value) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
95 (defalias 'semantic-overlay-live-p 'overlay-buffer) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
96 (defalias 'semantic-make-overlay 'make-overlay) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
97 (defalias 'semantic-overlay-put 'overlay-put) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
98 (defalias 'semantic-overlay-get 'overlay-get) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
99 (defalias 'semantic-overlay-properties 'overlay-properties) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
100 (defalias 'semantic-overlay-move 'move-overlay) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
101 (defalias 'semantic-overlay-delete 'delete-overlay) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
102 (defalias 'semantic-overlays-at 'overlays-at) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
103 (defalias 'semantic-overlays-in 'overlays-in) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
104 (defalias 'semantic-overlay-buffer 'overlay-buffer) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
105 (defalias 'semantic-overlay-start 'overlay-start) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
106 (defalias 'semantic-overlay-end 'overlay-end) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
107 (defalias 'semantic-overlay-size 'overlay-size) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
108 (defalias 'semantic-overlay-next-change 'next-overlay-change) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
109 (defalias 'semantic-overlay-previous-change 'previous-overlay-change) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
110 (defalias 'semantic-overlay-lists 'overlay-lists) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
111 (defalias 'semantic-overlay-p 'overlayp) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
112 (defalias 'semantic-read-event 'read-event) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
113 (defalias 'semantic-popup-menu 'popup-menu) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
114 (defun semantic-event-window (event) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
115 "Extract the window from EVENT." |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
116 (car (car (cdr event)))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
117 ) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
118 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
119 (if (and (not (featurep 'xemacs)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
120 (>= emacs-major-version 21)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
121 (defalias 'semantic-make-local-hook 'identity) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
122 (defalias 'semantic-make-local-hook 'make-local-hook) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
123 ) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
124 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
125 (if (featurep 'xemacs) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
126 (defalias 'semantic-mode-line-update 'redraw-modeline) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
127 (defalias 'semantic-mode-line-update 'force-mode-line-update)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
128 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
129 ;; Since Emacs 22 major mode functions should use `run-mode-hooks' to |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
130 ;; run major mode hooks. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
131 (defalias 'semantic-run-mode-hooks |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
132 (if (fboundp 'run-mode-hooks) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
133 'run-mode-hooks |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
134 'run-hooks)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
135 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
136 ;; Fancy compat useage now handled in cedet-compat |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
137 (defalias 'semantic-subst-char-in-string 'subst-char-in-string) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
138 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
139 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
140 (defun semantic-delete-overlay-maybe (overlay) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
141 "Delete OVERLAY if it is a semantic token overlay." |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
142 (if (semantic-overlay-get overlay 'semantic) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
143 (semantic-overlay-delete overlay))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
144 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
145 (defalias 'semantic-compile-warn |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
146 (eval-when-compile |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
147 (if (fboundp 'byte-compile-warn) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
148 'byte-compile-warn |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
149 'message))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
150 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
151 (if (not (fboundp 'string-to-number)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
152 (defalias 'string-to-number 'string-to-int)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
153 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
154 ;;; Menu Item compatibility |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
155 ;; |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
156 (defun semantic-menu-item (item) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
157 "Build an XEmacs compatible menu item from vector ITEM. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
158 That is remove the unsupported :help stuff." |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
159 (if (featurep 'xemacs) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
160 (let ((n (length item)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
161 (i 0) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
162 slot l) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
163 (while (< i n) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
164 (setq slot (aref item i)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
165 (if (and (keywordp slot) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
166 (eq slot :help)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
167 (setq i (1+ i)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
168 (setq l (cons slot l))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
169 (setq i (1+ i))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
170 (apply #'vector (nreverse l))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
171 item)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
172 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
173 ;;; Positional Data Cache |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
174 ;; |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
175 (defvar semantic-cache-data-overlays nil |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
176 "List of all overlays waiting to be flushed.") |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
177 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
178 (defun semantic-cache-data-to-buffer (buffer start end value name &optional lifespan) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
179 "In BUFFER over the region START END, remember VALUE. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
180 NAME specifies a special name that can be searched for later to |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
181 recover the cached data with `semantic-get-cache-data'. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
182 LIFESPAN indicates how long the data cache will be remembered. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
183 The default LIFESPAN is 'end-of-command. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
184 Possible Lifespans are: |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
185 'end-of-command - Remove the cache at the end of the currently |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
186 executing command. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
187 'exit-cache-zone - Remove when point leaves the overlay at the |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
188 end of the currently executing command." |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
189 ;; Check if LIFESPAN is valid before to create any overlay |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
190 (or lifespan (setq lifespan 'end-of-command)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
191 (or (memq lifespan '(end-of-command exit-cache-zone)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
192 (error "semantic-cache-data-to-buffer: Unknown LIFESPAN: %s" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
193 lifespan)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
194 (let ((o (semantic-make-overlay start end buffer))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
195 (semantic-overlay-put o 'cache-name name) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
196 (semantic-overlay-put o 'cached-value value) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
197 (semantic-overlay-put o 'lifespan lifespan) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
198 (setq semantic-cache-data-overlays |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
199 (cons o semantic-cache-data-overlays)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
200 ;;(message "Adding to cache: %s" o) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
201 (add-hook 'post-command-hook 'semantic-cache-data-post-command-hook) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
202 )) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
203 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
204 (defun semantic-cache-data-post-command-hook () |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
205 "Flush `semantic-cache-data-overlays' based 'lifespan property. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
206 Remove self from `post-command-hook' if it is empty." |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
207 (let ((newcache nil) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
208 (oldcache semantic-cache-data-overlays)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
209 (while oldcache |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
210 (let* ((o (car oldcache)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
211 (life (semantic-overlay-get o 'lifespan)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
212 ) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
213 (if (or (eq life 'end-of-command) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
214 (and (eq life 'exit-cache-zone) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
215 (not (member o (semantic-overlays-at (point)))))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
216 (progn |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
217 ;;(message "Removing from cache: %s" o) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
218 (semantic-overlay-delete o) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
219 ) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
220 (setq newcache (cons o newcache)))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
221 (setq oldcache (cdr oldcache))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
222 (setq semantic-cache-data-overlays (nreverse newcache))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
223 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
224 ;; Remove ourselves if we have removed all overlays. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
225 (unless semantic-cache-data-overlays |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
226 (remove-hook 'post-command-hook |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
227 'semantic-cache-data-post-command-hook))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
228 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
229 (defun semantic-get-cache-data (name &optional point) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
230 "Get cached data with NAME from optional POINT." |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
231 (save-excursion |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
232 (if point (goto-char point)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
233 (let ((o (semantic-overlays-at (point))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
234 (ans nil)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
235 (while (and (not ans) o) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
236 (if (equal (semantic-overlay-get (car o) 'cache-name) name) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
237 (setq ans (car o)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
238 (setq o (cdr o)))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
239 (when ans |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
240 (semantic-overlay-get ans 'cached-value))))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
241 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
242 ;;; Obsoleting various functions & variables |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
243 ;; |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
244 (defun semantic-overload-symbol-from-function (name) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
245 "Return the symbol for overload used by NAME, the defined symbol." |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
246 (let ((sym-name (symbol-name name))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
247 (if (string-match "^semantic-" sym-name) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
248 (intern (substring sym-name (match-end 0))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
249 name))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
250 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
251 (defun semantic-alias-obsolete (oldfnalias newfn) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
252 "Make OLDFNALIAS an alias for NEWFN. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
253 Mark OLDFNALIAS as obsolete, such that the byte compiler |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
254 will throw a warning when it encounters this symbol." |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
255 (defalias oldfnalias newfn) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
256 (make-obsolete oldfnalias newfn) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
257 (when (and (function-overload-p newfn) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
258 (not (overload-obsoleted-by newfn)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
259 ;; Only throw this warning when byte compiling things. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
260 (boundp 'byte-compile-current-file) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
261 byte-compile-current-file |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
262 (not (string-match "cedet" byte-compile-current-file)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
263 ) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
264 (make-obsolete-overload oldfnalias newfn) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
265 (semantic-compile-warn |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
266 "%s: `%s' obsoletes overload `%s'" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
267 byte-compile-current-file |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
268 newfn |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
269 (semantic-overload-symbol-from-function oldfnalias)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
270 )) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
271 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
272 (defun semantic-varalias-obsolete (oldvaralias newvar) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
273 "Make OLDVARALIAS an alias for variable NEWVAR. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
274 Mark OLDVARALIAS as obsolete, such that the byte compiler |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
275 will throw a warning when it encounters this symbol." |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
276 (make-obsolete-variable oldvaralias newvar) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
277 (condition-case nil |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
278 (defvaralias oldvaralias newvar) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
279 (error |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
280 ;; Only throw this warning when byte compiling things. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
281 (when (and (boundp 'byte-compile-current-file) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
282 byte-compile-current-file) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
283 (semantic-compile-warn |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
284 "variable `%s' obsoletes, but isn't alias of `%s'" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
285 newvar oldvaralias) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
286 )))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
287 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
288 ;;; Help debugging |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
289 ;; |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
290 (defmacro semantic-safe (format &rest body) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
291 "Turn into a FORMAT message any error caught during eval of BODY. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
292 Return the value of last BODY form or nil if an error occurred. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
293 FORMAT can have a %s escape which will be replaced with the actual |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
294 error message. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
295 If `debug-on-error' is set, errors are not caught, so that you can |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
296 debug them. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
297 Avoid using a large BODY since it is duplicated." |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
298 ;;(declare (debug t) (indent 1)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
299 `(if debug-on-error |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
300 ;;(let ((inhibit-quit nil)) ,@body) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
301 ;; Note to self: Doing the above screws up the wisent parser. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
302 (progn ,@body) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
303 (condition-case err |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
304 (progn ,@body) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
305 (error |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
306 (message ,format (format "%S - %s" (current-buffer) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
307 (error-message-string err))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
308 nil)))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
309 (put 'semantic-safe 'lisp-indent-function 1) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
310 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
311 ;;; Misc utilities |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
312 ;; |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
313 (defsubst semantic-map-buffers (function) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
314 "Run FUNCTION for each Semantic enabled buffer found. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
315 FUNCTION does not have arguments. When FUNCTION is entered |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
316 `current-buffer' is a selected Semantic enabled buffer." |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
317 (mode-local-map-file-buffers function #'semantic-active-p)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
318 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
319 (defalias 'semantic-map-mode-buffers |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
320 'mode-local-map-mode-buffers) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
321 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
322 (semantic-alias-obsolete 'semantic-fetch-overload |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
323 'fetch-overload) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
324 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
325 (semantic-alias-obsolete 'define-mode-overload-implementation |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
326 'define-mode-local-override) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
327 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
328 (semantic-alias-obsolete 'semantic-with-mode-bindings |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
329 'with-mode-local) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
330 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
331 (semantic-alias-obsolete 'define-semantic-child-mode |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
332 'define-child-mode) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
333 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
334 (defun semantic-install-function-overrides (overrides &optional transient mode) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
335 "Install the function OVERRIDES in the specified environment. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
336 OVERRIDES must be an alist ((OVERLOAD . FUNCTION) ...) where OVERLOAD |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
337 is a symbol identifying an overloadable entry, and FUNCTION is the |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
338 function to override it with. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
339 If optional argument TRANSIENT is non-nil, installed overrides can in |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
340 turn be overridden by next installation. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
341 If optional argument MODE is non-nil, it must be a major mode symbol. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
342 OVERRIDES will be installed globally for this major mode. If MODE is |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
343 nil, OVERRIDES will be installed locally in the current buffer. This |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
344 later installation should be done in MODE hook." |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
345 (mode-local-bind |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
346 ;; Add the semantic- prefix to OVERLOAD short names. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
347 (mapcar |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
348 #'(lambda (e) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
349 (let ((name (symbol-name (car e)))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
350 (if (string-match "^semantic-" name) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
351 e |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
352 (cons (intern (format "semantic-%s" name)) (cdr e))))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
353 overrides) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
354 (list 'constant-flag (not transient) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
355 'override-flag t) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
356 mode)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
357 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
358 ;;; User Interrupt handling |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
359 ;; |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
360 (defvar semantic-current-input-throw-symbol nil |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
361 "The current throw symbol for `semantic-exit-on-input'.") |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
362 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
363 (defmacro semantic-exit-on-input (symbol &rest forms) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
364 "Using SYMBOL as an argument to `throw', execute FORMS. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
365 If FORMS includes a call to `semantic-thow-on-input', then |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
366 if a user presses any key during execution, this form macro |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
367 will exit with the value passed to `semantic-throw-on-input'. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
368 If FORMS completes, then the return value is the same as `progn'." |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
369 `(let ((semantic-current-input-throw-symbol ,symbol)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
370 (catch ,symbol |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
371 ,@forms))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
372 (put 'semantic-exit-on-input 'lisp-indent-function 1) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
373 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
374 (defmacro semantic-throw-on-input (from) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
375 "Exit with `throw' when in `semantic-exit-on-input' on user input. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
376 FROM is an indication of where this function is called from as a value |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
377 to pass to `throw'. It is recommended to use the name of the function |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
378 calling this one." |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
379 `(when (and semantic-current-input-throw-symbol |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
380 (or (input-pending-p) (accept-process-output))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
381 (throw semantic-current-input-throw-symbol ,from))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
382 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
383 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
384 ;;; Special versions of Find File |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
385 ;; |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
386 (defun semantic-find-file-noselect (file &optional nowarn rawfile wildcards) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
387 "Call `find-file-noselect' with various features turned off. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
388 Use this when referencing a file that will be soon deleted. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
389 FILE, NOWARN, RAWFILE, and WILDCARDS are passed into `find-file-noselect'" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
390 (let* ((recentf-exclude '( (lambda (f) t) )) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
391 ;; This is a brave statement. Don't waste time loading in |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
392 ;; lots of modes. Especially decoration mode can waste a lot |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
393 ;; of time for a buffer we intend to kill. |
104513
a6a812dd2d88
* cedet/semantic/lex.el (semantic-lex-reset-hooks): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
394 (semantic-init-hook nil) |
104412
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
395 ;; This disables the part of EDE that asks questions |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
396 (ede-auto-add-method 'never) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
397 ;; Ask font-lock to not colorize these buffers, nor to |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
398 ;; whine about it either. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
399 (font-lock-maximum-size 0) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
400 (font-lock-verbose nil) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
401 ;; Disable revision control |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
402 (vc-handled-backends nil) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
403 ;; Don't prompt to insert a template if we visit an empty file |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
404 (auto-insert nil) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
405 ;; We don't want emacs to query about unsafe local variables |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
406 (enable-local-variables |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
407 (if (featurep 'xemacs) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
408 ;; XEmacs only has nil as an option? |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
409 nil |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
410 ;; Emacs 23 has the spiffy :safe option, nil otherwise. |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
411 (if (>= emacs-major-version 22) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
412 nil |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
413 :safe))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
414 ;; ... or eval variables |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
415 (enable-local-eval nil) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
416 ) |
104492
8db96f200ac8
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104444
diff
changeset
|
417 (save-match-data |
8db96f200ac8
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104444
diff
changeset
|
418 (if (featurep 'xemacs) |
8db96f200ac8
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104444
diff
changeset
|
419 (find-file-noselect file nowarn rawfile) |
8db96f200ac8
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104444
diff
changeset
|
420 (find-file-noselect file nowarn rawfile wildcards))) |
104412
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
421 )) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
422 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
423 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
424 ;;; Editor goodies ;-) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
425 ;; |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
426 (defconst semantic-fw-font-lock-keywords |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
427 (eval-when-compile |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
428 (let* ( |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
429 ;; Variable declarations |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
430 (vl nil) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
431 (kv (if vl (regexp-opt vl t) "")) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
432 ;; Function declarations |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
433 (vf '( |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
434 "define-lex" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
435 "define-lex-analyzer" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
436 "define-lex-block-analyzer" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
437 "define-lex-regex-analyzer" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
438 "define-lex-spp-macro-declaration-analyzer" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
439 "define-lex-spp-macro-undeclaration-analyzer" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
440 "define-lex-spp-include-analyzer" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
441 "define-lex-simple-regex-analyzer" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
442 "define-lex-keyword-type-analyzer" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
443 "define-lex-sexp-type-analyzer" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
444 "define-lex-regex-type-analyzer" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
445 "define-lex-string-type-analyzer" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
446 "define-lex-block-type-analyzer" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
447 ;;"define-mode-overload-implementation" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
448 ;;"define-semantic-child-mode" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
449 "define-semantic-idle-service" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
450 "define-semantic-decoration-style" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
451 "define-wisent-lexer" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
452 "semantic-alias-obsolete" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
453 "semantic-varalias-obsolete" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
454 "semantic-make-obsolete-overload" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
455 "defcustom-mode-local-semantic-dependency-system-include-path" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
456 )) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
457 (kf (if vf (regexp-opt vf t) "")) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
458 ;; Regexp depths |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
459 (kv-depth (if kv (regexp-opt-depth kv) nil)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
460 (kf-depth (if kf (regexp-opt-depth kf) nil)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
461 ) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
462 `((,(concat |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
463 ;; Declarative things |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
464 "(\\(" kv "\\|" kf "\\)" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
465 ;; Whitespaces & names |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
466 "\\>[ \t]*\\(\\sw+\\)?[ \t]*\\(\\sw+\\)?" |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
467 ) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
468 (1 font-lock-keyword-face) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
469 (,(+ 1 kv-depth kf-depth 1) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
470 (cond ((match-beginning 2) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
471 font-lock-type-face) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
472 ((match-beginning ,(+ 1 kv-depth 1)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
473 font-lock-function-name-face) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
474 ) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
475 nil t) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
476 (,(+ 1 kv-depth kf-depth 1 1) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
477 (cond ((match-beginning 2) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
478 font-lock-variable-name-face) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
479 ) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
480 nil t))) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
481 )) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
482 "Highlighted Semantic keywords.") |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
483 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
484 ;; (when (fboundp 'font-lock-add-keywords) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
485 ;; (font-lock-add-keywords 'emacs-lisp-mode |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
486 ;; semantic-fw-font-lock-keywords)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
487 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
488 ;;; Interfacing with edebug |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
489 ;; |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
490 (defun semantic-fw-add-edebug-spec () |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
491 (def-edebug-spec semantic-exit-on-input 'def-body)) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
492 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
493 (add-hook 'edebug-setup-hook 'semantic-fw-add-edebug-spec) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
494 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
495 (provide 'semantic/fw) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
496 |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
497 ;;; semantic-fw.el ends here |