summaryrefslogtreecommitdiff
path: root/lisp/cedet/semantic/idle.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/cedet/semantic/idle.el')
-rw-r--r--lisp/cedet/semantic/idle.el54
1 files changed, 33 insertions, 21 deletions
diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el
index 9899ab974f..6c223c2b9f 100644
--- a/lisp/cedet/semantic/idle.el
+++ b/lisp/cedet/semantic/idle.el
@@ -434,16 +434,27 @@ datasets."
(defun semantic-idle-scheduler-work-parse-neighboring-files ()
"Parse all the files in similar directories to buffers being edited."
- ;; Let's check to see if EDE matters.
- (let ((ede-auto-add-method 'never))
- (dolist (a auto-mode-alist)
- (when (eq (cdr a) major-mode)
- (dolist (file (directory-files default-directory t (car a) t))
- (semantic-throw-on-input 'parsing-mode-buffers)
- (save-excursion
- (semanticdb-file-table-object file)
- ))))
- ))
+ ;; Let's tell EDE to ignore all the files we're about to load
+ (let ((ede-auto-add-method 'never)
+ (matching-auto-mode-patterns nil))
+ ;; Collect all patterns matching files of the same mode we edit.
+ (mapc (lambda (pat) (and (eq (cdr pat) major-mode)
+ (push (car pat) matching-auto-mode-patterns)))
+ auto-mode-alist)
+ ;; Loop over all files, and if one matches our mode, we force its
+ ;; table to load.
+ (dolist (file (directory-files default-directory t ".*" t))
+ (catch 'found
+ (mapc (lambda (pat)
+ (semantic-throw-on-input 'parsing-mode-buffers)
+ ;; We use string-match instead of passing the pattern
+ ;; into directory files, because some patterns don't
+ ;; work with directory files.
+ (and (string-match pat file)
+ (save-excursion
+ (semanticdb-file-table-object file))
+ (throw 'found t)))
+ matching-auto-mode-patterns)))))
;;; REPARSING
@@ -840,17 +851,18 @@ visible, then highlight it."
)
(cond ((semantic-overlay-p region)
(with-current-buffer (semantic-overlay-buffer region)
- (goto-char (semantic-overlay-start region))
- (when (pos-visible-in-window-p
- (point) (get-buffer-window (current-buffer) 'visible))
- (if (< (semantic-overlay-end region) (point-at-eol))
- (pulse-momentary-highlight-overlay
- region semantic-idle-symbol-highlight-face)
- ;; Not the same
- (pulse-momentary-highlight-region
- (semantic-overlay-start region)
- (point-at-eol)
- semantic-idle-symbol-highlight-face)))
+ (save-excursion
+ (goto-char (semantic-overlay-start region))
+ (when (pos-visible-in-window-p
+ (point) (get-buffer-window (current-buffer) 'visible))
+ (if (< (semantic-overlay-end region) (point-at-eol))
+ (pulse-momentary-highlight-overlay
+ region semantic-idle-symbol-highlight-face)
+ ;; Not the same
+ (pulse-momentary-highlight-region
+ (semantic-overlay-start region)
+ (point-at-eol)
+ semantic-idle-symbol-highlight-face))))
))
((vectorp region)
(let ((start (aref region 0))