[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/progmodes/flymake.el
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/progmodes/flymake.el |
Date: |
Thu, 24 Mar 2005 19:17:42 -0500 |
Index: emacs/lisp/progmodes/flymake.el
diff -c emacs/lisp/progmodes/flymake.el:1.10
emacs/lisp/progmodes/flymake.el:1.11
*** emacs/lisp/progmodes/flymake.el:1.10 Fri Mar 25 00:06:07 2005
--- emacs/lisp/progmodes/flymake.el Fri Mar 25 00:17:42 2005
***************
*** 269,281 ****
"Return the corresponding entry from `flymake-allowed-file-name-masks'."
(unless (stringp file-name)
(error "Invalid file-name"))
! (let ((count (length flymake-allowed-file-name-masks))
! (idx 0)
(mode-and-masks nil))
! (while (and (not mode-and-masks) (< idx count))
! (if (string-match (nth 0 (nth idx flymake-allowed-file-name-masks))
file-name)
! (setq mode-and-masks (cdr (nth idx flymake-allowed-file-name-masks))))
! (setq idx (1+ idx)))
(flymake-log 3 "file %s, init=%s" file-name (car mode-and-masks))
mode-and-masks))
--- 269,280 ----
"Return the corresponding entry from `flymake-allowed-file-name-masks'."
(unless (stringp file-name)
(error "Invalid file-name"))
! (let ((fnm flymake-allowed-file-name-masks)
(mode-and-masks nil))
! (while (and (not mode-and-masks) fnm)
! (if (string-match (car (car fnm)) file-name)
! (setq mode-and-masks (cdr (car fnm))))
! (setq fnm (cdr fnm)))
(flymake-log 3 "file %s, init=%s" file-name (car mode-and-masks))
mode-and-masks))
***************
*** 323,337 ****
(flymake-get-buildfile-from-cache source-dir-name))
(let* ((buildfile-dir nil)
(buildfile nil)
- (dir-count (length dirs))
- (dir-idx 0)
(found nil))
! (while (and (not found) (< dir-idx dir-count))
! (setq buildfile-dir (concat source-dir-name (nth dir-idx dirs)))
(setq buildfile (concat buildfile-dir "/" buildfile-name))
(when (file-exists-p buildfile)
(setq found t))
! (setq dir-idx (1+ dir-idx)))
(if found
(progn
(flymake-log 3 "found buildfile at %s/%s" buildfile-dir
buildfile-name)
--- 322,334 ----
(flymake-get-buildfile-from-cache source-dir-name))
(let* ((buildfile-dir nil)
(buildfile nil)
(found nil))
! (while (and (not found) dirs)
! (setq buildfile-dir (concat source-dir-name (car dirs)))
(setq buildfile (concat buildfile-dir "/" buildfile-name))
(when (file-exists-p buildfile)
(setq found t))
! (setq dirs (cdr dirs)))
(if found
(progn
(flymake-log 3 "found buildfile at %s/%s" buildfile-dir
buildfile-name)
***************
*** 412,442 ****
Master files are .cpp and .c for and .h. Files are searched for
starting from the .h directory and max max-level parent dirs.
File contents are not checked."
! (let* ((dir-idx 0)
! (dir-count (length master-file-dirs))
(files nil)
! (done nil)
! (masks-count (length masks)))
! (while (and (not done) (< dir-idx dir-count))
! (let* ((dir (concat (flymake-fix-file-name (file-name-directory
file-name)) "/" (nth dir-idx master-file-dirs)))
! (masks-idx 0))
! (while (and (file-exists-p dir) (not done) (< masks-idx masks-count))
! (let* ((mask (nth masks-idx masks))
! (dir-files (directory-files dir t mask))
! (file-count (length dir-files))
! (file-idx 0))
!
! (flymake-log 3 "dir %s, %d file(s) for mask %s" dir file-count mask)
! (while (and (not done) (< file-idx file-count))
! (when (not (file-directory-p (nth file-idx dir-files)))
! (setq files (cons (nth file-idx dir-files) files))
(when (>= (length files) flymake-master-file-count-limit)
(flymake-log 3 "master file count limit (%d) reached"
flymake-master-file-count-limit)
(setq done t)))
! (setq file-idx (1+ file-idx))))
! (setq masks-idx (1+ masks-idx))))
! (setq dir-idx (1+ dir-idx)))
(when files
(let ((flymake-included-file-name (file-name-nondirectory file-name)))
(setq files (sort files 'flymake-master-file-compare))))
--- 409,437 ----
Master files are .cpp and .c for and .h. Files are searched for
starting from the .h directory and max max-level parent dirs.
File contents are not checked."
! (let* ((dirs master-file-dirs)
(files nil)
! (done nil))
! (while (and (not done) dirs)
! (let* ((dir (concat (flymake-fix-file-name (file-name-directory
file-name))
! "/" (car dirs)))
! (masks masks))
! (while (and (file-exists-p dir) (not done) masks)
! (let* ((mask (car masks))
! (dir-files (directory-files dir t mask)))
!
! (flymake-log 3 "dir %s, %d file(s) for mask %s"
! dir (length dir-files) mask)
! (while (and (not done) dir-files)
! (when (not (file-directory-p (car dir-files)))
! (setq files (cons (car dir-files) files))
(when (>= (length files) flymake-master-file-count-limit)
(flymake-log 3 "master file count limit (%d) reached"
flymake-master-file-count-limit)
(setq done t)))
! (setq dir-files (cdr dir-files))))
! (setq masks (cdr masks))))
! (setq dirs (cdr dirs)))
(when files
(let ((flymake-included-file-name (file-name-nondirectory file-name)))
(setq files (sort files 'flymake-master-file-compare))))
***************
*** 540,557 ****
Return t if it can be found via include path using INC-PATH and INC-NAME."
(if (file-name-absolute-p inc-path)
(flymake-same-files source-file-name (concat inc-path "/" inc-name))
! (let* ((count (length include-dirs))
! (idx 0)
! (file-name nil)
(found nil))
! (while (and (not found) (< idx count))
! (setq file-name (concat (file-name-directory source-file-name) "/" (nth
idx include-dirs)))
(if (> (length inc-path) 0)
(setq file-name (concat file-name "/" inc-path)))
(setq file-name (concat file-name "/" inc-name))
(when (flymake-same-files source-file-name file-name)
(setq found t))
! (setq idx (1+ idx)))
found)))
(defun flymake-find-buffer-for-file (file-name)
--- 535,551 ----
Return t if it can be found via include path using INC-PATH and INC-NAME."
(if (file-name-absolute-p inc-path)
(flymake-same-files source-file-name (concat inc-path "/" inc-name))
! (let* ((file-name nil)
(found nil))
! (while (and (not found) include-dirs)
! (setq file-name (concat (file-name-directory source-file-name)
! "/" (car include-dirs)))
(if (> (length inc-path) 0)
(setq file-name (concat file-name "/" inc-path)))
(setq file-name (concat file-name "/" inc-name))
(when (flymake-same-files source-file-name file-name)
(setq found t))
! (setq include-dirs (cdr include-dirs)))
found)))
(defun flymake-find-buffer-for-file (file-name)
***************
*** 1026,1043 ****
(line-no 0)
(err-type "e")
(err-text nil)
! (count (length flymake-err-line-patterns))
! (idx 0)
(matched nil))
! (while (and (< idx count) (not matched))
! (when (string-match (car (nth idx flymake-err-line-patterns)) line)
! (let* ((file-idx (nth 1 (nth idx flymake-err-line-patterns)))
! (line-idx (nth 2 (nth idx flymake-err-line-patterns))))
(setq raw-file-name (if file-idx (match-string file-idx line) nil))
(setq line-no (if line-idx (string-to-int (match-string
line-idx line)) 0))
! (setq err-text (if (> (length (nth idx
flymake-err-line-patterns)) 4)
! (match-string (nth 4 (nth idx
flymake-err-line-patterns)) line)
(flymake-patch-err-text (substring line
(match-end 0)))))
(or err-text (setq err-text "<no error text>"))
(if (and err-text (string-match "^[wW]arning" err-text))
--- 1020,1036 ----
(line-no 0)
(err-type "e")
(err-text nil)
! (patterns flymake-err-line-patterns)
(matched nil))
! (while (and patterns (not matched))
! (when (string-match (car (car patterns)) line)
! (let* ((file-idx (nth 1 (car patterns)))
! (line-idx (nth 2 (car patterns))))
(setq raw-file-name (if file-idx (match-string file-idx line) nil))
(setq line-no (if line-idx (string-to-int (match-string
line-idx line)) 0))
! (setq err-text (if (> (length (car patterns)) 4)
! (match-string (nth 4 (car patterns)) line)
(flymake-patch-err-text (substring line
(match-end 0)))))
(or err-text (setq err-text "<no error text>"))
(if (and err-text (string-match "^[wW]arning" err-text))
***************
*** 1046,1052 ****
(flymake-log 3 "parse line: file-idx=%s line-idx=%s file=%s line=%s
text=%s" file-idx line-idx
raw-file-name line-no err-text)
(setq matched t)))
! (setq idx (1+ idx)))
(if matched
(flymake-ler-make-ler raw-file-name line-no err-type err-text)
())))
--- 1039,1045 ----
(flymake-log 3 "parse line: file-idx=%s line-idx=%s file=%s line=%s
text=%s" file-idx line-idx
raw-file-name line-no err-text)
(setq matched t)))
! (setq patterns (cdr patterns)))
(if matched
(flymake-ler-make-ler raw-file-name line-no err-type err-text)
())))