aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/cedet
diff options
context:
space:
mode:
authorJoakim Verona2013-06-12 12:32:25 +0200
committerJoakim Verona2013-06-12 12:32:25 +0200
commite6fa6da6899bf1b4877b96c450eae3934085d560 (patch)
tree48e6fda463d24a792ec8428fb8044a250ee2ff82 /lisp/cedet
parent4f0994366d33f8f76db4662cc126720866df3461 (diff)
parent84d6f46535554f9f51aae3314313112e8d755c65 (diff)
downloademacs-e6fa6da6899bf1b4877b96c450eae3934085d560.tar.gz
emacs-e6fa6da6899bf1b4877b96c450eae3934085d560.zip
Merge branch 'trunk' into xwidget
Conflicts: src/Makefile.in src/keyboard.c src/termhooks.h
Diffstat (limited to 'lisp/cedet')
-rw-r--r--lisp/cedet/ChangeLog93
-rw-r--r--lisp/cedet/ede.el21
-rw-r--r--lisp/cedet/ede/base.el66
-rw-r--r--lisp/cedet/ede/cpp-root.el5
-rw-r--r--lisp/cedet/ede/proj.el2
-rw-r--r--lisp/cedet/semantic.el3
-rw-r--r--lisp/cedet/semantic/analyze/fcn.el2
-rw-r--r--lisp/cedet/semantic/bovine/c.el2
-rw-r--r--lisp/cedet/semantic/bovine/el.el9
-rw-r--r--lisp/cedet/semantic/complete.el2
-rw-r--r--lisp/cedet/semantic/ctxt.el83
-rw-r--r--lisp/cedet/semantic/db.el2
-rw-r--r--lisp/cedet/semantic/decorate/mode.el44
-rw-r--r--lisp/cedet/semantic/ede-grammar.el2
-rw-r--r--lisp/cedet/semantic/edit.el5
-rw-r--r--lisp/cedet/semantic/grammar.el5
-rw-r--r--lisp/cedet/semantic/idle.el54
-rw-r--r--lisp/cedet/semantic/lex.el2
-rw-r--r--lisp/cedet/semantic/wisent/python.el14
-rw-r--r--lisp/cedet/srecode/args.el1
-rw-r--r--lisp/cedet/srecode/compile.el28
-rw-r--r--lisp/cedet/srecode/java.el1
-rw-r--r--lisp/cedet/srecode/srt-wy.el6
23 files changed, 370 insertions, 82 deletions
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index 25f966362ce..98548a919d5 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,3 +1,96 @@
12013-06-02 Eric Ludlam <zappo@gnu.org>
2
3 * semantic/edit.el (semantic-change-function): Use
4 `save-match-data' around running hooks.
5
6 * semantic/decorate/mode.el
7 (semantic-decorate-style-predicate-default)
8 (semantic-decorate-style-highlighter-default): New.
9 (semantic-decoration-mode): Do not require
10 `semantic/decorate/include' anymore.
11 (semantic-toggle-decoration-style): Error if an unknown decoration
12 style is toggled.
13 (define-semantic-decoration-style): Add new :load option. When
14 :load is specified, add autoload tokens for the definition
15 functions so that code is loaded when the mode is used.
16 (semantic-decoration-on-includes): New autoload definition for
17 highlighting includes.
18
19 * semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc
20 characters to appear after the tested variable.
21
22 * semantic/ede-grammar.el (project-compile-target): Calculate full
23 src name via ede-expand-filename instead of the crutch of the
24 current buffer. Enables this target to compile in batch mode.
25
26 * semantic/idle.el
27 (semantic-idle-symbol-maybe-highlight): Wrap highlighting of
28 remote symbol with `save-excursion'.
29 (semantic-idle-scheduler-work-parse-neighboring-files): Instead of
30 using directory-files on each found mode pattern, collect all the
31 patterns for the current mode, and then for each file, see if it
32 matches any of them. If it does, parse the file. (Patch
33 inspiration from Tomasz Gajewski.)
34
35 * semantic/ctxt.el (semantic-ctxt-end-of-symbol): New.
36 (semantic-ctxt-current-symbol-default): New.
37
38 * semantic/bovine/el.el (semantic-default-elisp-setup): Add
39 autoload cookie. Explain existence.
40 (footer): Add local variable for loaddefs.
41
42 * semantic/db.el (semanticdb-file-table-object): Add new filter,
43 only checking for regular files too.
44
45 * semantic/wisent/python.el
46 (semantic-format-tag-abbreviate): New override. Cuts back on size
47 of code tags.
48
49 * srecode/compile.el (srecode-compile-templates): Fix warning
50 punctuation. Remove status messages to clean up testing output
51
52 * ede/base.el (ede-project-placeholder-cache-file): Update doc to
53 mention 'nil' value.
54 (ede-save-cache): Disable cache save if file is nil.
55
56 * ede.el (ede-initialize-state-current-buffer): Flush deleted
57 projects.
58 (global-ede-mode): Always append our find-file-hook to the end.
59 (ede-flush-deleted-projects): New command.
60
61 * ede/cpp-root.el (ede-preprocessor-map): Protect against init
62 problems.
63
64 * ede/proj.el (ede-proj-target): Added a new "custom" option for
65 custom symbols representing a compiler or linker instead of
66 restricting things to only the predefined compilers and linkers.
67
682013-06-02 David Engster <dengste@eml.cc>
69
70 * semantic.el (semantic-mode-map): To avoid showing showing
71 Development menu twice, only disable menu item if menu-bar is
72 actually enabled, otherwise the popup 'global menu' might display
73 a disabled Development menu.
74
75 * srecode/srt-wy.el: Regenerate.
76
772013-06-02 Pete Beardmore <elbeardmorez@msn.com>
78
79 * semantic/complete.el
80 (semantic-displayor-show-request): Fix which slot in obj is set to
81 the max tags.
82
832013-06-01 Glenn Morris <rgm@gnu.org>
84
85 * semantic/grammar.el (semantic-grammar-complete):
86 Replace the obsolete function lisp-complete-symbol.
87
88 * semantic/analyze/fcn.el (semantic-tag-similar-p): Autoload.
89
90 * srecode/args.el, srecode/java.el: Require ede.
91
92 * semantic/lex.el (semantic-lex-make-type-table): Fix transposed args.
93
12013-05-24 Glenn Morris <rgm@gnu.org> 942013-05-24 Glenn Morris <rgm@gnu.org>
2 95
3 * semantic/bovine/grammar.el (bovine-make-parsers): 96 * semantic/bovine/grammar.el (bovine-make-parsers):
diff --git a/lisp/cedet/ede.el b/lisp/cedet/ede.el
index 5fecd8b994f..3483d541122 100644
--- a/lisp/cedet/ede.el
+++ b/lisp/cedet/ede.el
@@ -494,6 +494,11 @@ provided `global-ede-mode' is enabled."
494(defun ede-initialize-state-current-buffer () 494(defun ede-initialize-state-current-buffer ()
495 "Initialize the current buffer's state for EDE. 495 "Initialize the current buffer's state for EDE.
496Sets buffer local variables for EDE." 496Sets buffer local variables for EDE."
497 ;; due to inode recycling, make sure we don't
498 ;; we flush projects deleted off the system.
499 (ede-flush-deleted-projects)
500
501 ;; Init the buffer.
497 (let* ((ROOT nil) 502 (let* ((ROOT nil)
498 (proj (ede-directory-get-open-project default-directory 503 (proj (ede-directory-get-open-project default-directory
499 'ROOT)) 504 'ROOT))
@@ -569,7 +574,9 @@ an EDE controlled project."
569 (add-hook 'semanticdb-project-predicate-functions 'ede-directory-project-p) 574 (add-hook 'semanticdb-project-predicate-functions 'ede-directory-project-p)
570 (add-hook 'semanticdb-project-root-functions 'ede-toplevel-project-or-nil) 575 (add-hook 'semanticdb-project-root-functions 'ede-toplevel-project-or-nil)
571 (add-hook 'ecb-source-path-functions 'ede-ecb-project-paths) 576 (add-hook 'ecb-source-path-functions 'ede-ecb-project-paths)
572 (add-hook 'find-file-hook 'ede-turn-on-hook) 577 ;; Append our hook to the end. This allows mode-local to finish
578 ;; it's stuff before we start doing misc file loads, etc.
579 (add-hook 'find-file-hook 'ede-turn-on-hook t)
573 (add-hook 'dired-mode-hook 'ede-turn-on-hook) 580 (add-hook 'dired-mode-hook 'ede-turn-on-hook)
574 (add-hook 'kill-emacs-hook 'ede-save-cache) 581 (add-hook 'kill-emacs-hook 'ede-save-cache)
575 (ede-load-cache) 582 (ede-load-cache)
@@ -1057,6 +1064,18 @@ On success, return the added project."
1057 (add-to-list 'ede-projects proj) 1064 (add-to-list 'ede-projects proj)
1058 proj) 1065 proj)
1059 1066
1067(defun ede-flush-deleted-projects ()
1068 "Scan the projects list for projects which no longer exist.
1069Flush the dead projects from the project cache."
1070 (interactive)
1071 (let ((dead nil))
1072 (dolist (P ede-projects)
1073 (when (not (file-exists-p (oref P :file)))
1074 (add-to-list 'dead P)))
1075 (dolist (D dead)
1076 (setq ede-projects (remove D ede-projects)))
1077 ))
1078
1060(defun ede-load-project-file (dir &optional rootreturn) 1079(defun ede-load-project-file (dir &optional rootreturn)
1061 "Project file independent way to read a project in from DIR. 1080 "Project file independent way to read a project in from DIR.
1062Optional ROOTRETURN will return the root project for DIR." 1081Optional ROOTRETURN will return the root project for DIR."
diff --git a/lisp/cedet/ede/base.el b/lisp/cedet/ede/base.el
index 5302ac3207a..a94ce8f1868 100644
--- a/lisp/cedet/ede/base.el
+++ b/lisp/cedet/ede/base.el
@@ -306,7 +306,8 @@ All specific project types must derive from this project."
306;; 306;;
307(defcustom ede-project-placeholder-cache-file 307(defcustom ede-project-placeholder-cache-file
308 (locate-user-emacs-file "ede-projects.el" ".projects.ede") 308 (locate-user-emacs-file "ede-projects.el" ".projects.ede")
309 "File containing the list of projects EDE has viewed." 309 "File containing the list of projects EDE has viewed.
310If set to nil, then the cache is not saved."
310 :group 'ede 311 :group 'ede
311 :type 'file) 312 :type 'file)
312 313
@@ -316,38 +317,39 @@ All specific project types must derive from this project."
316(defun ede-save-cache () 317(defun ede-save-cache ()
317 "Save a cache of EDE objects that Emacs has seen before." 318 "Save a cache of EDE objects that Emacs has seen before."
318 (interactive) 319 (interactive)
319 (let ((p ede-projects) 320 (when ede-project-placeholder-cache-file
320 (c ede-project-cache-files) 321 (let ((p ede-projects)
321 (recentf-exclude '( (lambda (f) t) )) 322 (c ede-project-cache-files)
322 ) 323 (recentf-exclude '( (lambda (f) t) ))
323 (condition-case nil
324 (progn
325 (set-buffer (find-file-noselect ede-project-placeholder-cache-file t))
326 (erase-buffer)
327 (insert ";; EDE project cache file.
328;; This contains a list of projects you have visited.\n(")
329 (while p
330 (when (and (car p) (ede-project-p p))
331 (let ((f (oref (car p) file)))
332 (when (file-exists-p f)
333 (insert "\n \"" f "\""))))
334 (setq p (cdr p)))
335 (while c
336 (insert "\n \"" (car c) "\"")
337 (setq c (cdr c)))
338 (insert "\n)\n")
339 (condition-case nil
340 (save-buffer 0)
341 (error
342 (message "File %s could not be saved."
343 ede-project-placeholder-cache-file)))
344 (kill-buffer (current-buffer))
345 ) 324 )
346 (error 325 (condition-case nil
347 (message "File %s could not be read." 326 (progn
348 ede-project-placeholder-cache-file)) 327 (set-buffer (find-file-noselect ede-project-placeholder-cache-file t))
349 328 (erase-buffer)
350 ))) 329 (insert ";; EDE project cache file.
330;; This contains a list of projects you have visited.\n(")
331 (while p
332 (when (and (car p) (ede-project-p p))
333 (let ((f (oref (car p) file)))
334 (when (file-exists-p f)
335 (insert "\n \"" f "\""))))
336 (setq p (cdr p)))
337 (while c
338 (insert "\n \"" (car c) "\"")
339 (setq c (cdr c)))
340 (insert "\n)\n")
341 (condition-case nil
342 (save-buffer 0)
343 (error
344 (message "File %s could not be saved."
345 ede-project-placeholder-cache-file)))
346 (kill-buffer (current-buffer))
347 )
348 (error
349 (message "File %s could not be read."
350 ede-project-placeholder-cache-file))
351
352 ))))
351 353
352(defun ede-load-cache () 354(defun ede-load-cache ()
353 "Load the cache of EDE projects." 355 "Load the cache of EDE projects."
diff --git a/lisp/cedet/ede/cpp-root.el b/lisp/cedet/ede/cpp-root.el
index 47ba16ade7f..719289765a3 100644
--- a/lisp/cedet/ede/cpp-root.el
+++ b/lisp/cedet/ede/cpp-root.el
@@ -507,7 +507,10 @@ This is for project include paths and spp source files."
507 (lambda (F) 507 (lambda (F)
508 (let* ((expfile (ede-expand-filename root F)) 508 (let* ((expfile (ede-expand-filename root F))
509 (table (when expfile 509 (table (when expfile
510 (semanticdb-file-table-object expfile))) 510 ;; Disable EDE init on preprocessor file load
511 ;; otherwise we recurse, cause errs, etc.
512 (let ((ede-constructing t))
513 (semanticdb-file-table-object expfile))))
511 ) 514 )
512 (cond 515 (cond
513 ((not (file-exists-p expfile)) 516 ((not (file-exists-p expfile))
diff --git a/lisp/cedet/ede/proj.el b/lisp/cedet/ede/proj.el
index 702e35f0b1f..99a5978b005 100644
--- a/lisp/cedet/ede/proj.el
+++ b/lisp/cedet/ede/proj.el
@@ -104,6 +104,7 @@ distributed, and each should have a corresponding rule to build it.")
104 :initform nil 104 :initform nil
105 :type (or null symbol) 105 :type (or null symbol)
106 :custom (choice (const :tag "None" nil) 106 :custom (choice (const :tag "None" nil)
107 (symbol :tag "Custom Compiler Symbol")
107 :slotofchoices availablecompilers) 108 :slotofchoices availablecompilers)
108 :label "Compiler for building sources" 109 :label "Compiler for building sources"
109 :group make 110 :group make
@@ -116,6 +117,7 @@ of these compiler resources, and global customization thereof.")
116 :initform nil 117 :initform nil
117 :type (or null symbol) 118 :type (or null symbol)
118 :custom (choice (const :tag "None" nil) 119 :custom (choice (const :tag "None" nil)
120 (symbol :tag "Custom Linker Symbol")
119 :slotofchoices availablelinkers) 121 :slotofchoices availablelinkers)
120 :label "Linker for combining intermediate object files." 122 :label "Linker for combining intermediate object files."
121 :group make 123 :group make
diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el
index 3c93a8794b1..909902a71fe 100644
--- a/lisp/cedet/semantic.el
+++ b/lisp/cedet/semantic.el
@@ -899,7 +899,8 @@ Throw away all the old tags, and recreate the tag database."
899 ;; and Semantic are both enabled. Is there a better way? 899 ;; and Semantic are both enabled. Is there a better way?
900 (define-key map [menu-bar cedet-menu] 900 (define-key map [menu-bar cedet-menu]
901 (list 'menu-item "Development" cedet-menu-map 901 (list 'menu-item "Development" cedet-menu-map
902 :enable (quote (not (bound-and-true-p global-ede-mode))))) 902 :enable (quote (not (and menu-bar-mode
903 (bound-and-true-p global-ede-mode))))))
903 ;; (define-key km "-" 'senator-fold-tag) 904 ;; (define-key km "-" 'senator-fold-tag)
904 ;; (define-key km "+" 'senator-unfold-tag) 905 ;; (define-key km "+" 'senator-unfold-tag)
905 map)) 906 map))
diff --git a/lisp/cedet/semantic/analyze/fcn.el b/lisp/cedet/semantic/analyze/fcn.el
index 42bc482a1df..4300c89c9df 100644
--- a/lisp/cedet/semantic/analyze/fcn.el
+++ b/lisp/cedet/semantic/analyze/fcn.el
@@ -245,6 +245,8 @@ used by the analyzer debugger."
245 (semantic-scope-set-typecache scope nil) 245 (semantic-scope-set-typecache scope nil)
246 ))))) 246 )))))
247 247
248(autoload 'semantic-tag-similar-p "semantic/tag-ls")
249
248(defun semantic-analyze-dereference-metatype-stack (type scope &optional type-declaration) 250(defun semantic-analyze-dereference-metatype-stack (type scope &optional type-declaration)
249 "Dereference metatypes repeatedly until we hit a real TYPE. 251 "Dereference metatypes repeatedly until we hit a real TYPE.
250Uses `semantic-analyze-dereference-metatype'. 252Uses `semantic-analyze-dereference-metatype'.
diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el
index 2f8cf08af3e..3c991ea8555 100644
--- a/lisp/cedet/semantic/bovine/c.el
+++ b/lisp/cedet/semantic/bovine/c.el
@@ -529,7 +529,7 @@ code to parse."
529(define-lex-regex-analyzer semantic-lex-c-ifdef 529(define-lex-regex-analyzer semantic-lex-c-ifdef
530 "Code blocks wrapped up in #ifdef. 530 "Code blocks wrapped up in #ifdef.
531Uses known macro tables in SPP to determine what block to skip." 531Uses known macro tables in SPP to determine what block to skip."
532 "^\\s-*#\\s-*\\(ifndef\\|ifdef\\)\\s-+\\(\\(\\sw\\|\\s_\\)+\\)$" 532 "^\\s-*#\\s-*\\(ifndef\\|ifdef\\)\\s-+\\(\\(\\sw\\|\\s_\\)+\\)\\([ \t\C-m].*\\)?$"
533 (semantic-c-do-lex-ifdef)) 533 (semantic-c-do-lex-ifdef))
534 534
535(defun semantic-c-do-lex-ifdef () 535(defun semantic-c-do-lex-ifdef ()
diff --git a/lisp/cedet/semantic/bovine/el.el b/lisp/cedet/semantic/bovine/el.el
index a8ddbe106f7..07e0e08bbaf 100644
--- a/lisp/cedet/semantic/bovine/el.el
+++ b/lisp/cedet/semantic/bovine/el.el
@@ -940,8 +940,11 @@ ELisp variables can be pretty long, so track this one too.")
940(define-child-mode lisp-mode emacs-lisp-mode 940(define-child-mode lisp-mode emacs-lisp-mode
941 "Make `lisp-mode' inherit mode local behavior from `emacs-lisp-mode'.") 941 "Make `lisp-mode' inherit mode local behavior from `emacs-lisp-mode'.")
942 942
943;;;###autoload
943(defun semantic-default-elisp-setup () 944(defun semantic-default-elisp-setup ()
944 "Setup hook function for Emacs Lisp files and Semantic." 945 "Setup hook function for Emacs Lisp files and Semantic."
946 ;; This is here mostly to get this file loaded when a .el file is
947 ;; loaded into Emacs.
945 ) 948 )
946 949
947(add-hook 'emacs-lisp-mode-hook 'semantic-default-elisp-setup) 950(add-hook 'emacs-lisp-mode-hook 'semantic-default-elisp-setup)
@@ -960,6 +963,12 @@ ELisp variables can be pretty long, so track this one too.")
960 '(require 'semantic/db-el) 963 '(require 'semantic/db-el)
961 ) 964 )
962 965
966
963(provide 'semantic/bovine/el) 967(provide 'semantic/bovine/el)
964 968
969;; Local variables:
970;; generated-autoload-file: "../loaddefs.el"
971;; generated-autoload-load-name: "semantic/bovine/el"
972;; End:
973
965;;; semantic/bovine/el.el ends here 974;;; semantic/bovine/el.el ends here
diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el
index 6c2b97a677a..b42e24fb9c0 100644
--- a/lisp/cedet/semantic/complete.el
+++ b/lisp/cedet/semantic/complete.el
@@ -1667,7 +1667,7 @@ Display mechanism using tooltip for a list of possible completions.")
1667 (setq msg "..."))) 1667 (setq msg "...")))
1668 ((eq mode 'verbose) 1668 ((eq mode 'verbose)
1669 ;; Always show extended match set. 1669 ;; Always show extended match set.
1670 (oset obj max-tags semantic-displayor-tooltip-max-tags) 1670 (oset obj max-tags-initial semantic-displayor-tooltip-max-tags)
1671 (setq max-tags semantic-displayor-tooltip-max-tags))) 1671 (setq max-tags semantic-displayor-tooltip-max-tags)))
1672 (unless msg 1672 (unless msg
1673 (oset obj shown t) 1673 (oset obj shown t)
diff --git a/lisp/cedet/semantic/ctxt.el b/lisp/cedet/semantic/ctxt.el
index 2c0b428c195..629bbdee561 100644
--- a/lisp/cedet/semantic/ctxt.el
+++ b/lisp/cedet/semantic/ctxt.el
@@ -357,6 +357,87 @@ beginning and end of a command."
357 (def-edebug-spec semantic-with-buffer-narrowed-to-command 357 (def-edebug-spec semantic-with-buffer-narrowed-to-command
358 (def-body)))) 358 (def-body))))
359 359
360(define-overloadable-function semantic-ctxt-end-of-symbol (&optional point)
361 "Move point to the end of the current symbol under POINT.
362This skips forward over symbols in a complex reference.
363For example, in the C statement:
364 this.that().entry;
365
366If the cursor is on 'this', will move point to the ; after entry.")
367
368(defun semantic-ctxt-end-of-symbol-default (&optional point)
369 "Move point to the end of the current symbol under POINT.
370This will move past type/field names when applicable.
371Depends on `semantic-type-relation-separator-character', and will
372work on C like languages."
373 (if point (goto-char point))
374 (let* ((fieldsep1 (mapconcat (lambda (a) (regexp-quote a))
375 semantic-type-relation-separator-character
376 "\\|"))
377 ;; NOTE: The [ \n] expression below should used \\s-, but that
378 ;; doesn't work in C since \n means end-of-comment, and isn't
379 ;; really whitespace.
380 (fieldsep (concat "[ \t\n\r]*\\(" fieldsep1 "\\)[ \t\n\r]*\\(\\w\\|\\s_\\)"))
381 (case-fold-search semantic-case-fold)
382 (continuesearch t)
383 (end nil)
384 )
385 (with-syntax-table semantic-lex-syntax-table
386 (cond ((looking-at "\\w\\|\\s_")
387 ;; In the middle of a symbol, move to the end.
388 (forward-sexp 1))
389 ((looking-at fieldsep1)
390 ;; We are in a fine spot.. do nothing.
391 nil
392 )
393 ((save-excursion
394 (and (condition-case nil
395 (progn (forward-sexp -1)
396 (forward-sexp 1)
397 t)
398 (error nil))
399 (looking-at fieldsep1)))
400 (setq symlist (list ""))
401 (forward-sexp -1)
402 ;; Skip array expressions.
403 (while (looking-at "\\s(") (forward-sexp -1))
404 (forward-sexp 1))
405 )
406 ;; Set the current end marker.
407 (setq end (point))
408
409 ;; Cursor is at the safe end of some symbol. Look until we
410 ;; find the logical end of this current complex symbol.
411 (condition-case nil
412 (while continuesearch
413 ;; If there are functional arguments, arrays, etc, skip them.
414 (when (looking-at "\\s(")
415 (forward-sexp 1))
416
417 ;; If there is a field separator, then skip that, plus
418 ;; the next expected symbol.
419 (if (not (looking-at fieldsep1))
420 ;; We hit the end.
421 (error nil)
422
423 ;; Skip the separator and the symbol.
424 (goto-char (match-end 0))
425
426 (if (looking-at "\\w\\|\\s_")
427 ;; Skip symbols
428 (forward-sexp 1)
429 ;; No symbol, exit the search...
430 (setq continuesearch nil))
431
432 (setq end (point)))
433
434 ;; Cont...
435 )
436
437 ;; Restore position if we go to far....
438 (error (goto-char end)) )
439
440 )))
360 441
361(define-overloadable-function semantic-ctxt-current-symbol (&optional point) 442(define-overloadable-function semantic-ctxt-current-symbol (&optional point)
362 "Return the current symbol the cursor is on at POINT in a list. 443 "Return the current symbol the cursor is on at POINT in a list.
@@ -391,7 +472,7 @@ Depends on `semantic-type-relation-separator-character'."
391 ;; In the middle of a symbol, move to the end. 472 ;; In the middle of a symbol, move to the end.
392 (forward-sexp 1)) 473 (forward-sexp 1))
393 ((looking-at fieldsep1) 474 ((looking-at fieldsep1)
394 ;; We are in a find spot.. do nothing. 475 ;; We are in a fine spot.. do nothing.
395 nil 476 nil
396 ) 477 )
397 ((save-excursion 478 ((save-excursion
diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el
index e8784c4f85c..8d9cfcccd7d 100644
--- a/lisp/cedet/semantic/db.el
+++ b/lisp/cedet/semantic/db.el
@@ -899,7 +899,7 @@ If file does not have tags available, and DONTLOAD is nil,
899then load the tags for FILE, and create a new table object for it. 899then load the tags for FILE, and create a new table object for it.
900DONTLOAD does not affect the creation of new database objects." 900DONTLOAD does not affect the creation of new database objects."
901 ;; (message "Object Translate: %s" file) 901 ;; (message "Object Translate: %s" file)
902 (when (and file (file-exists-p file)) 902 (when (and file (file-exists-p file) (file-regular-p file))
903 (let* ((default-directory (file-name-directory file)) 903 (let* ((default-directory (file-name-directory file))
904 (tab (semanticdb-file-table-object-from-hash file)) 904 (tab (semanticdb-file-table-object-from-hash file))
905 (fullfile nil)) 905 (fullfile nil))
diff --git a/lisp/cedet/semantic/decorate/mode.el b/lisp/cedet/semantic/decorate/mode.el
index fc791f52da1..a4aa535eb1a 100644
--- a/lisp/cedet/semantic/decorate/mode.el
+++ b/lisp/cedet/semantic/decorate/mode.el
@@ -64,6 +64,14 @@ add items to this list."
64 "Return the STYLE's highlighter function." 64 "Return the STYLE's highlighter function."
65 (intern (format "%s-highlight" style))) 65 (intern (format "%s-highlight" style)))
66 66
67(defsubst semantic-decorate-style-predicate-default (style)
68 "Return the STYLE's predicate function."
69 (intern (format "%s-p-default" style)))
70
71(defsubst semantic-decorate-style-highlighter-default (style)
72 "Return the STYLE's highlighter function."
73 (intern (format "%s-highlight-default" style)))
74
67;;; Base decoration API 75;;; Base decoration API
68;; 76;;
69(defsubst semantic-decoration-p (object) 77(defsubst semantic-decoration-p (object)
@@ -265,8 +273,6 @@ minor mode is enabled."
265 (semantic-make-local-hook 'semantic-after-toplevel-cache-change-hook) 273 (semantic-make-local-hook 'semantic-after-toplevel-cache-change-hook)
266 (add-hook 'semantic-after-toplevel-cache-change-hook 274 (add-hook 'semantic-after-toplevel-cache-change-hook
267 'semantic-decorate-tags-after-full-reparse nil t) 275 'semantic-decorate-tags-after-full-reparse nil t)
268 ;; Decorate includes by default
269 (require 'semantic/decorate/include)
270 ;; Add decorations to available tags. The above hooks ensure 276 ;; Add decorations to available tags. The above hooks ensure
271 ;; that new tags will be decorated when they become available. 277 ;; that new tags will be decorated when they become available.
272 (semantic-decorate-add-decorations (semantic-fetch-available-tags))) 278 (semantic-decorate-add-decorations (semantic-fetch-available-tags)))
@@ -325,6 +331,8 @@ Return non-nil if the decoration style is enabled."
325 (flag (if arg 331 (flag (if arg
326 (> (prefix-numeric-value arg) 0) 332 (> (prefix-numeric-value arg) 0)
327 (not (cdr style))))) 333 (not (cdr style)))))
334 (when (null style)
335 (error "Unknown decoration style %s" name))
328 (unless (eq (cdr style) flag) 336 (unless (eq (cdr style) flag)
329 ;; Store the new flag. 337 ;; Store the new flag.
330 (setcdr style flag) 338 (setcdr style flag)
@@ -368,7 +376,8 @@ DOC is a documentation string describing the decoration style NAME.
368It is appended to auto-generated doc strings. 376It is appended to auto-generated doc strings.
369An Optional list of FLAGS can also be specified. Flags are: 377An Optional list of FLAGS can also be specified. Flags are:
370 :enabled <value> - specify the default enabled value for NAME. 378 :enabled <value> - specify the default enabled value for NAME.
371 379 :load <value> - specify a feature (as a string) with the rest of
380 the definition for decoration mode NAME.
372 381
373This defines two new overload functions respectively called `NAME-p' 382This defines two new overload functions respectively called `NAME-p'
374and `NAME-highlight', for which you must provide a default 383and `NAME-highlight', for which you must provide a default
@@ -386,9 +395,14 @@ To add other kind of decorations on a tag, `NAME-highlight' must use
386decoration API found in this library." 395decoration API found in this library."
387 (let ((predicate (semantic-decorate-style-predicate name)) 396 (let ((predicate (semantic-decorate-style-predicate name))
388 (highlighter (semantic-decorate-style-highlighter name)) 397 (highlighter (semantic-decorate-style-highlighter name))
398 (predicatedef (semantic-decorate-style-predicate-default name))
399 (highlighterdef (semantic-decorate-style-highlighter-default name))
389 (defaultenable (if (plist-member flags :enabled) 400 (defaultenable (if (plist-member flags :enabled)
390 (plist-get flags :enabled) 401 (plist-get flags :enabled)
391 t)) 402 t))
403 (loadfile (if (plist-member flags :load)
404 (plist-get flags :load)
405 nil))
392 ) 406 )
393 `(progn 407 `(progn
394 ;; Clear the menu cache so that new items are added when 408 ;; Clear the menu cache so that new items are added when
@@ -408,7 +422,19 @@ decoration API found in this library."
408 (add-to-list 'semantic-decoration-styles 422 (add-to-list 'semantic-decoration-styles
409 (cons ',(symbol-name name) 423 (cons ',(symbol-name name)
410 ,defaultenable)) 424 ,defaultenable))
411 ))) 425 ;; If there is a load file, then create the autoload tokens for
426 ;; those functions to load the token, but only if the fsym
427 ;; doesn't exist yet.
428 (when (stringp ,loadfile)
429 (unless (fboundp ',predicatedef)
430 (autoload ',predicatedef ',loadfile "Return non-nil to decorate TAG."
431 nil 'function))
432
433 (unless (fboundp ',highlighterdef)
434 (autoload ',highlighterdef ',loadfile "Decorate TAG."
435 nil 'function))
436 ))
437 ))
412 438
413;;; Predefined decoration styles 439;;; Predefined decoration styles
414;; 440;;
@@ -514,6 +540,16 @@ Use a primary decoration."
514 (semantic-set-tag-face 540 (semantic-set-tag-face
515 tag 'semantic-decoration-on-protected-members-face)) 541 tag 'semantic-decoration-on-protected-members-face))
516 542
543;;; Decoration Modes in other files
544;;
545(define-semantic-decoration-style semantic-decoration-on-includes
546 "Highlight class members that are includes.
547This mode provides a nice context menu on the include statements."
548 :enabled t
549 :load "semantic/decorate/include")
550
551
552
517(provide 'semantic/decorate/mode) 553(provide 'semantic/decorate/mode)
518 554
519;; Local variables: 555;; Local variables:
diff --git a/lisp/cedet/semantic/ede-grammar.el b/lisp/cedet/semantic/ede-grammar.el
index cb2a1faaac0..17859e232a3 100644
--- a/lisp/cedet/semantic/ede-grammar.el
+++ b/lisp/cedet/semantic/ede-grammar.el
@@ -146,7 +146,7 @@ Lays claim to all -by.el, and -wy.el files."
146 (let* ((package (semantic-grammar-create-package)) 146 (let* ((package (semantic-grammar-create-package))
147 (fname (progn (string-match ".*/\\(.+\\.el\\)" package) 147 (fname (progn (string-match ".*/\\(.+\\.el\\)" package)
148 (match-string 1 package))) 148 (match-string 1 package)))
149 (src (with-current-buffer fname (buffer-file-name))) 149 (src (ede-expand-filename obj fname))
150 (csrc (concat (file-name-sans-extension src) ".elc"))) 150 (csrc (concat (file-name-sans-extension src) ".elc")))
151 (if (< emacs-major-version 24) 151 (if (< emacs-major-version 24)
152 ;; Does not have `byte-recompile-file' 152 ;; Does not have `byte-recompile-file'
diff --git a/lisp/cedet/semantic/edit.el b/lisp/cedet/semantic/edit.el
index b0540af373d..a27eab5404c 100644
--- a/lisp/cedet/semantic/edit.el
+++ b/lisp/cedet/semantic/edit.el
@@ -141,8 +141,9 @@ Argument START, END, and LENGTH specify the bounds of the change."
141 (setq semantic-unmatched-syntax-cache-check t) 141 (setq semantic-unmatched-syntax-cache-check t)
142 (let ((inhibit-point-motion-hooks t) 142 (let ((inhibit-point-motion-hooks t)
143 ) 143 )
144 (run-hook-with-args 'semantic-change-functions start end length) 144 (save-match-data
145 )) 145 (run-hook-with-args 'semantic-change-functions start end length)
146 )))
146 147
147(defun semantic-changes-in-region (start end &optional buffer) 148(defun semantic-changes-in-region (start end &optional buffer)
148 "Find change overlays which exist in whole or in part between START and END. 149 "Find change overlays which exist in whole or in part between START and END.
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el
index 2d53c857c1e..ce658cd5d54 100644
--- a/lisp/cedet/semantic/grammar.el
+++ b/lisp/cedet/semantic/grammar.el
@@ -1484,7 +1484,10 @@ expression then Lisp symbols are completed."
1484 (interactive) 1484 (interactive)
1485 (if (semantic-grammar-in-lisp-p) 1485 (if (semantic-grammar-in-lisp-p)
1486 ;; We are in lisp code. Do lisp completion. 1486 ;; We are in lisp code. Do lisp completion.
1487 (lisp-complete-symbol) 1487 (let ((completion-at-point-functions
1488 (append '(lisp-completion-at-point)
1489 completion-at-point-functions)))
1490 (completion-at-point))
1488 ;; We are not in lisp code. Do rule completion. 1491 ;; We are not in lisp code. Do rule completion.
1489 (let* ((nonterms (semantic-find-tags-by-class 'nonterminal (current-buffer))) 1492 (let* ((nonterms (semantic-find-tags-by-class 'nonterminal (current-buffer)))
1490 (sym (car (semantic-ctxt-current-symbol))) 1493 (sym (car (semantic-ctxt-current-symbol)))
diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el
index 9899ab974f7..6c223c2b9f2 100644
--- a/lisp/cedet/semantic/idle.el
+++ b/lisp/cedet/semantic/idle.el
@@ -434,16 +434,27 @@ datasets."
434 434
435(defun semantic-idle-scheduler-work-parse-neighboring-files () 435(defun semantic-idle-scheduler-work-parse-neighboring-files ()
436 "Parse all the files in similar directories to buffers being edited." 436 "Parse all the files in similar directories to buffers being edited."
437 ;; Let's check to see if EDE matters. 437 ;; Let's tell EDE to ignore all the files we're about to load
438 (let ((ede-auto-add-method 'never)) 438 (let ((ede-auto-add-method 'never)
439 (dolist (a auto-mode-alist) 439 (matching-auto-mode-patterns nil))
440 (when (eq (cdr a) major-mode) 440 ;; Collect all patterns matching files of the same mode we edit.
441 (dolist (file (directory-files default-directory t (car a) t)) 441 (mapc (lambda (pat) (and (eq (cdr pat) major-mode)
442 (semantic-throw-on-input 'parsing-mode-buffers) 442 (push (car pat) matching-auto-mode-patterns)))
443 (save-excursion 443 auto-mode-alist)
444 (semanticdb-file-table-object file) 444 ;; Loop over all files, and if one matches our mode, we force its
445 )))) 445 ;; table to load.
446 )) 446 (dolist (file (directory-files default-directory t ".*" t))
447 (catch 'found
448 (mapc (lambda (pat)
449 (semantic-throw-on-input 'parsing-mode-buffers)
450 ;; We use string-match instead of passing the pattern
451 ;; into directory files, because some patterns don't
452 ;; work with directory files.
453 (and (string-match pat file)
454 (save-excursion
455 (semanticdb-file-table-object file))
456 (throw 'found t)))
457 matching-auto-mode-patterns)))))
447 458
448 459
449;;; REPARSING 460;;; REPARSING
@@ -840,17 +851,18 @@ visible, then highlight it."
840 ) 851 )
841 (cond ((semantic-overlay-p region) 852 (cond ((semantic-overlay-p region)
842 (with-current-buffer (semantic-overlay-buffer region) 853 (with-current-buffer (semantic-overlay-buffer region)
843 (goto-char (semantic-overlay-start region)) 854 (save-excursion
844 (when (pos-visible-in-window-p 855 (goto-char (semantic-overlay-start region))
845 (point) (get-buffer-window (current-buffer) 'visible)) 856 (when (pos-visible-in-window-p
846 (if (< (semantic-overlay-end region) (point-at-eol)) 857 (point) (get-buffer-window (current-buffer) 'visible))
847 (pulse-momentary-highlight-overlay 858 (if (< (semantic-overlay-end region) (point-at-eol))
848 region semantic-idle-symbol-highlight-face) 859 (pulse-momentary-highlight-overlay
849 ;; Not the same 860 region semantic-idle-symbol-highlight-face)
850 (pulse-momentary-highlight-region 861 ;; Not the same
851 (semantic-overlay-start region) 862 (pulse-momentary-highlight-region
852 (point-at-eol) 863 (semantic-overlay-start region)
853 semantic-idle-symbol-highlight-face))) 864 (point-at-eol)
865 semantic-idle-symbol-highlight-face))))
854 )) 866 ))
855 ((vectorp region) 867 ((vectorp region)
856 (let ((start (aref region 0)) 868 (let ((start (aref region 0))
diff --git a/lisp/cedet/semantic/lex.el b/lisp/cedet/semantic/lex.el
index ba862479be5..feead78985c 100644
--- a/lisp/cedet/semantic/lex.el
+++ b/lisp/cedet/semantic/lex.el
@@ -437,7 +437,7 @@ PROPSPECS must be a list of (TYPE PROPERTY VALUE)."
437 (if default 437 (if default
438 (message 438 (message
439 "*Warning* default value of <%s> tokens changed to %S, was %S" 439 "*Warning* default value of <%s> tokens changed to %S, was %S"
440 type default token)) 440 type token default))
441 (setq default token))) 441 (setq default token)))
442 ;; Ensure the default matching spec is the first one. 442 ;; Ensure the default matching spec is the first one.
443 (semantic-lex-type-set type (cons default (nreverse alist)))) 443 (semantic-lex-type-set type (cons default (nreverse alist))))
diff --git a/lisp/cedet/semantic/wisent/python.el b/lisp/cedet/semantic/wisent/python.el
index 8ca398ef271..719868f7635 100644
--- a/lisp/cedet/semantic/wisent/python.el
+++ b/lisp/cedet/semantic/wisent/python.el
@@ -485,6 +485,20 @@ Return a list as per `semantic-ctxt-current-symbol'.
485Return nil if there is nothing relevant." 485Return nil if there is nothing relevant."
486 nil) 486 nil)
487 487
488;;; Tag Formatting
489;;
490(define-mode-local-override semantic-format-tag-abbreviate python-mode (tag &optional parent color)
491 "Format an abbreviated tag for python.
492Shortens 'code' tags, but passes through for others."
493 (cond ((semantic-tag-of-class-p tag 'code)
494 ;; Just take the first line.
495 (let ((name (semantic-tag-name tag)))
496 (when (string-match "\n" name)
497 (setq name (substring name 0 (match-beginning 0))))
498 name))
499 (t
500 (semantic-format-tag-abbreviate-default tag parent color))))
501
488;;; Enable Semantic in `python-mode'. 502;;; Enable Semantic in `python-mode'.
489;; 503;;
490 504
diff --git a/lisp/cedet/srecode/args.el b/lisp/cedet/srecode/args.el
index d6798f7523d..6bc78295fa7 100644
--- a/lisp/cedet/srecode/args.el
+++ b/lisp/cedet/srecode/args.el
@@ -26,6 +26,7 @@
26;; a set of simple arguments for srecode templates. 26;; a set of simple arguments for srecode templates.
27 27
28(require 'srecode/dictionary) 28(require 'srecode/dictionary)
29(require 'ede)
29 30
30;;; Code: 31;;; Code:
31 32
diff --git a/lisp/cedet/srecode/compile.el b/lisp/cedet/srecode/compile.el
index 0d68036c433..542fd49f8e5 100644
--- a/lisp/cedet/srecode/compile.el
+++ b/lisp/cedet/srecode/compile.el
@@ -200,10 +200,11 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
200 "Compile a semantic recode template file into a mode-local variable." 200 "Compile a semantic recode template file into a mode-local variable."
201 (interactive) 201 (interactive)
202 (unless (semantic-active-p) 202 (unless (semantic-active-p)
203 (error "You have to activate semantic-mode to compile SRecode templates.")) 203 (error "You have to activate semantic-mode to compile SRecode templates"))
204 (require 'srecode/insert) 204 (require 'srecode/insert)
205 (message "Compiling template %s..." 205 (when (called-interactively-p 'interactive)
206 (file-name-nondirectory (buffer-file-name))) 206 (message "Compiling template %s..."
207 (file-name-nondirectory (buffer-file-name))))
207 (let ((tags (semantic-fetch-tags)) 208 (let ((tags (semantic-fetch-tags))
208 (tag nil) 209 (tag nil)
209 (class nil) 210 (class nil)
@@ -288,10 +289,11 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
288 ) 289 )
289 ;; Continue 290 ;; Continue
290 (setq tags (cdr tags))) 291 (setq tags (cdr tags)))
291 292
292 ;; MSG - Before install since nreverse whacks our list. 293 ;; MSG - Before install since nreverse whacks our list.
293 (message "%d templates compiled for %s" 294 (when (called-interactively-p 'interactive)
294 (length table) mode) 295 (message "%d templates compiled for %s"
296 (length table) mode))
295 297
296 ;; 298 ;;
297 ;; APPLY TO MODE 299 ;; APPLY TO MODE
@@ -316,12 +318,14 @@ Arguments ESCAPE-START and ESCAPE-END are the current escape sequences in use."
316 (if (stringp project) 318 (if (stringp project)
317 (setq priority (+ 50 defaultdelta)) 319 (setq priority (+ 50 defaultdelta))
318 (setq priority (+ 80 defaultdelta)))) 320 (setq priority (+ 80 defaultdelta))))
319 (message "Templates %s has estimated priority of %d" 321 (when (called-interactively-p 'interactive)
320 (file-name-nondirectory (buffer-file-name)) 322 (message "Templates %s has estimated priority of %d"
321 priority)) 323 (file-name-nondirectory (buffer-file-name))
322 (message "Compiling templates %s priority %d... done!" 324 priority)))
323 (file-name-nondirectory (buffer-file-name)) 325 (when (called-interactively-p 'interactive)
324 priority)) 326 (message "Compiling templates %s priority %d... done!"
327 (file-name-nondirectory (buffer-file-name))
328 priority)))
325 329
326 ;; Save it up! 330 ;; Save it up!
327 (srecode-compile-template-table table mode priority application framework project vars) 331 (srecode-compile-template-table table mode priority application framework project vars)
diff --git a/lisp/cedet/srecode/java.el b/lisp/cedet/srecode/java.el
index 29a8465c45c..1b8922c2746 100644
--- a/lisp/cedet/srecode/java.el
+++ b/lisp/cedet/srecode/java.el
@@ -27,6 +27,7 @@
27 27
28(require 'srecode/dictionary) 28(require 'srecode/dictionary)
29(require 'semantic/find) 29(require 'semantic/find)
30(require 'ede)
30 31
31;;;###autoload 32;;;###autoload
32(defun srecode-semantic-handle-:java (dict) 33(defun srecode-semantic-handle-:java (dict)
diff --git a/lisp/cedet/srecode/srt-wy.el b/lisp/cedet/srecode/srt-wy.el
index 5560d35a70c..450f57d943c 100644
--- a/lisp/cedet/srecode/srt-wy.el
+++ b/lisp/cedet/srecode/srt-wy.el
@@ -131,6 +131,10 @@
131 ((SET symbol insertable-string-list newline) 131 ((SET symbol insertable-string-list newline)
132 (wisent-raw-tag 132 (wisent-raw-tag
133 (semantic-tag-new-variable $2 nil $3))) 133 (semantic-tag-new-variable $2 nil $3)))
134 ((SET symbol number newline)
135 (wisent-raw-tag
136 (semantic-tag-new-variable $2 nil
137 (list $3))))
134 ((SHOW symbol newline) 138 ((SHOW symbol newline)
135 (wisent-raw-tag 139 (wisent-raw-tag
136 (semantic-tag-new-variable $2 nil t)))) 140 (semantic-tag-new-variable $2 nil t))))
@@ -290,8 +294,8 @@ It ignores whitespace, newlines and comments."
290 srecode-template-separator-block 294 srecode-template-separator-block
291 srecode-template-wy--<keyword>-keyword-analyzer 295 srecode-template-wy--<keyword>-keyword-analyzer
292 srecode-template-property-analyzer 296 srecode-template-property-analyzer
293 srecode-template-wy--<symbol>-regexp-analyzer
294 srecode-template-wy--<number>-regexp-analyzer 297 srecode-template-wy--<number>-regexp-analyzer
298 srecode-template-wy--<symbol>-regexp-analyzer
295 srecode-template-wy--<string>-sexp-analyzer 299 srecode-template-wy--<string>-sexp-analyzer
296 srecode-template-wy--<punctuation>-string-analyzer 300 srecode-template-wy--<punctuation>-string-analyzer
297 semantic-lex-default-action 301 semantic-lex-default-action