emacs-diffs
[Top][All Lists]
Advanced

[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 17:42:43 -0500

Index: emacs/lisp/progmodes/flymake.el
diff -c emacs/lisp/progmodes/flymake.el:1.7 emacs/lisp/progmodes/flymake.el:1.8
*** emacs/lisp/progmodes/flymake.el:1.7 Fri Nov 26 23:56:39 2004
--- emacs/lisp/progmodes/flymake.el     Thu Mar 24 22:42:42 2005
***************
*** 1,6 ****
  ;;; flymake.el -- a universal on-the-fly syntax checker
  
! ;; Copyright (C) 2003 Free Software Foundation
  
  ;; Author:  Pavel Kobiakov <address@hidden>
  ;; Maintainer: Pavel Kobiakov <address@hidden>
--- 1,6 ----
  ;;; flymake.el -- a universal on-the-fly syntax checker
  
! ;; Copyright (C) 2003, 2005  Free Software Foundation
  
  ;; Author:  Pavel Kobiakov <address@hidden>
  ;; Maintainer: Pavel Kobiakov <address@hidden>
***************
*** 170,176 ****
      tmp))
  
  (defun flymake-set-at (list pos val)
!   "Set VAL at position POS in LIST"
    (let ((tmp (copy-sequence list)))   ; (???)
      (setcar (nthcdr pos tmp) val)
      tmp))
--- 170,176 ----
      tmp))
  
  (defun flymake-set-at (list pos val)
!   "Set VAL at position POS in LIST."
    (let ((tmp (copy-sequence list)))   ; (???)
      (setcar (nthcdr pos tmp) val)
      tmp))
***************
*** 231,237 ****
  (defun flymake-set-buffer-value (buffer name value)
    (puthash name value (flymake-get-buffer-data buffer)))
  
! (defvar flymake-output-residual nil "")
  
  (make-variable-buffer-local 'flymake-output-residual)
  
--- 231,237 ----
  (defun flymake-set-buffer-value (buffer name value)
    (puthash name value (flymake-get-buffer-data buffer)))
  
! (defvar flymake-output-residual nil)
  
  (make-variable-buffer-local 'flymake-output-residual)
  
***************
*** 253,274 ****
      (".+[0-9]+\\.tex$" flymake-master-tex-init flymake-master-cleanup 
flymake-get-real-file-name)
      (".+\\.tex$" flymake-simple-tex-init flymake-simple-cleanup 
flymake-get-real-file-name)
      (".+\\.idl$" flymake-simple-make-init flymake-simple-cleanup 
flymake-get-real-file-name)
!                                       ;                                       
     (".+\\.cpp$" 1)
!                                       ;                                       
     (".+\\.java$" 3)
!                                       ;                                       
     (".+\\.h$" 2 (".+\\.cpp$" ".+\\.c$")
!                                       ;                                       
         ("[ \t]*#[ \t]*include[ \t]*\"\\([\w0-9/\\_\.]*[/\\]*\\)\\(%s\\)\"" 1 
2))
!                                       ;                                       
     (".+\\.idl$" 1)
!                                       ;                                       
     (".+\\.odl$" 1)
!                                       ;                                       
     (".+[0-9]+\\.tex$" 2 (".+\\.tex$")
!                                       ;                                       
         ("[ \t]*\\input[ \t]*{\\(.*\\)\\(%s\\)}" 1 2 ))
!                                       ;                                       
     (".+\\.tex$" 1)
      )
    "*Files syntax checking is allowed for."
    :group 'flymake
    :type '(repeat (string symbol symbol symbol)))
  
  (defun flymake-get-file-name-mode-and-masks (file-name)
!   "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))
--- 253,274 ----
      (".+[0-9]+\\.tex$" flymake-master-tex-init flymake-master-cleanup 
flymake-get-real-file-name)
      (".+\\.tex$" flymake-simple-tex-init flymake-simple-cleanup 
flymake-get-real-file-name)
      (".+\\.idl$" flymake-simple-make-init flymake-simple-cleanup 
flymake-get-real-file-name)
!     ;; (".+\\.cpp$" 1)
!     ;; (".+\\.java$" 3)
!     ;; (".+\\.h$" 2 (".+\\.cpp$" ".+\\.c$")
!     ;; ("[ \t]*#[ \t]*include[ \t]*\"\\([\w0-9/\\_\.]*[/\\]*\\)\\(%s\\)\"" 1 
2))
!     ;; (".+\\.idl$" 1)
!     ;; (".+\\.odl$" 1)
!     ;; (".+[0-9]+\\.tex$" 2 (".+\\.tex$")
!     ;; ("[ \t]*\\input[ \t]*{\\(.*\\)\\(%s\\)}" 1 2 ))
!     ;; (".+\\.tex$" 1)
      )
    "*Files syntax checking is allowed for."
    :group 'flymake
    :type '(repeat (string symbol symbol symbol)))
  
  (defun flymake-get-file-name-mode-and-masks (file-name)
!   "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))
***************
*** 289,296 ****
  (defun flymake-get-init-function (file-name)
    "Return init function to be used for the file."
    (let* ((init-f  (nth 0 (flymake-get-file-name-mode-and-masks file-name))))
!                                       ;(flymake-log 0 "calling %s" init-f)
!                                       ;(funcall init-f (current-buffer))
      init-f))
  
  (defun flymake-get-cleanup-function (file-name)
--- 289,296 ----
  (defun flymake-get-init-function (file-name)
    "Return init function to be used for the file."
    (let* ((init-f  (nth 0 (flymake-get-file-name-mode-and-masks file-name))))
!     ;;(flymake-log 0 "calling %s" init-f)
!     ;;(funcall init-f (current-buffer))
      init-f))
  
  (defun flymake-get-cleanup-function (file-name)
***************
*** 387,392 ****
--- 387,393 ----
  
  (defun flymake-build-relative-filename (from-dir to-dir)
    "Return rel: FROM-DIR/rel == TO-DIR."
+   ;; FIXME: Why not use `file-relative-name'?
    (if (not (equal (elt from-dir 0) (elt to-dir 0)))
        (error "First chars in file names %s, %s must be equal (same drive)"
             from-dir to-dir)
***************
*** 413,419 ****
        (or rel "./"))))
  
  (defcustom flymake-master-file-dirs '("." "./src" "./UnitTest")
!   "Dirs where to llok for master files."
    :group 'flymake
    :type '(repeat (string)))
  
--- 414,420 ----
        (or rel "./"))))
  
  (defcustom flymake-master-file-dirs '("." "./src" "./UnitTest")
!   "Dirs where to look for master files."
    :group 'flymake
    :type '(repeat (string)))
  
***************
*** 426,433 ****
  (defvar flymake-included-file-name)
  
  (defun flymake-find-possible-master-files (file-name master-file-dirs masks)
!   "Find (by name and location) all posible master files.
! Mater 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)
--- 427,434 ----
  (defvar flymake-included-file-name)
  
  (defun flymake-find-possible-master-files (file-name master-file-dirs masks)
!   "Find (by name and location) all possible master files.
! 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)
***************
*** 512,527 ****
                  (when (flymake-check-include source-file-name inc-path 
inc-name include-dirs)
                    (setq found t)
                    ;;  replace-match is not used here as it fails in
!                   ;; xemacs with 'last match not a buffer' error as
                    ;; check-includes calls replace-in-string
                    (flymake-replace-region (current-buffer) match-beg match-end
                                            (file-name-nondirectory 
patched-source-file-name))))
                (forward-line 1)))
            (when found
              (flymake-save-buffer-in-file (current-buffer) 
patched-master-file-name)))
!                                       ;+(flymake-log 3 "killing buffer %s" 
(buffer-name master-file-temp-buffer))
        (kill-buffer master-file-temp-buffer)))
!                                       ;+(flymake-log 3 "check-patch master 
file %s: %s" master-file-name found)
      (when found
        (flymake-log 2 "found master file %s" master-file-name))
      found))
--- 513,528 ----
                  (when (flymake-check-include source-file-name inc-path 
inc-name include-dirs)
                    (setq found t)
                    ;;  replace-match is not used here as it fails in
!                   ;; XEmacs with 'last match not a buffer' error as
                    ;; check-includes calls replace-in-string
                    (flymake-replace-region (current-buffer) match-beg match-end
                                            (file-name-nondirectory 
patched-source-file-name))))
                (forward-line 1)))
            (when found
              (flymake-save-buffer-in-file (current-buffer) 
patched-master-file-name)))
!       ;;+(flymake-log 3 "killing buffer %s" (buffer-name 
master-file-temp-buffer))
        (kill-buffer master-file-temp-buffer)))
!     ;;+(flymake-log 3 "check-patch master file %s: %s" master-file-name found)
      (when found
        (flymake-log 2 "found master file %s" master-file-name))
      found))
***************
*** 866,872 ****
        (overlay-put ov 'help-echo      tooltip-text)
        (overlay-put ov 'flymake-overlay  t)
        (overlay-put ov 'priority 100)
!                                       ;+(flymake-log 3 "created overlay %s" 
ov)
        ov)
      (flymake-log 3 "created an overlay at (%d-%d)" beg end)))
  
--- 867,873 ----
        (overlay-put ov 'help-echo      tooltip-text)
        (overlay-put ov 'flymake-overlay  t)
        (overlay-put ov 'priority 100)
!       ;;+(flymake-log 3 "created overlay %s" ov)
        ov)
      (flymake-log 3 "created an overlay at (%d-%d)" beg end)))
  
***************
*** 878,884 ****
        (while (consp ov)
        (when (flymake-overlay-p (car ov))
          (delete-overlay (car ov))
!                                       ;+(flymake-log 3 "deleted overlay %s" 
ov)
          )
        (setq ov (cdr ov))))))
  
--- 879,885 ----
        (while (consp ov)
        (when (flymake-overlay-p (car ov))
          (delete-overlay (car ov))
!         ;;+(flymake-log 3 "deleted overlay %s" ov)
          )
        (setq ov (cdr ov))))))
  
***************
*** 893,900 ****
        (setq ov (cdr ov)))))
  
  (defface flymake-errline-face
!                                       ;+   '((((class color)) (:foreground 
"OrangeRed" :bold t :underline t))
!                                       ;+   '((((class color)) (:underline 
"OrangeRed"))
    '((((class color)) (:background "LightPink"))
      (t (:bold t)))
    "Face used for marking error lines."
--- 894,901 ----
        (setq ov (cdr ov)))))
  
  (defface flymake-errline-face
!   ;;+   '((((class color)) (:foreground "OrangeRed" :bold t :underline t))
!   ;;+   '((((class color)) (:underline "OrangeRed"))
    '((((class color)) (:background "LightPink"))
      (t (:bold t)))
    "Face used for marking error lines."
***************
*** 970,976 ****
  
  (defun flymake-split-output (output)
    "Split OUTPUT into lines.
! Return last one as residual if it does not end with newline char. Returns 
((lines) residual)."
    (when (and output (> (length output) 0))
      (let* ((lines (flymake-split-string output "[\n\r]+"))
           (complete (equal "\n" (char-to-string (aref output (1- (length 
output))))))
--- 971,978 ----
  
  (defun flymake-split-output (output)
    "Split OUTPUT into lines.
! Return last one as residual if it does not end with newline char.
! Returns ((LINES) RESIDUAL)."
    (when (and output (> (length output) 0))
      (let* ((lines (flymake-split-string output "[\n\r]+"))
           (complete (equal "\n" (char-to-string (aref output (1- (length 
output))))))
***************
*** 1007,1046 ****
  (defvar flymake-err-line-patterns ; regexp file-idx line-idx col-idx 
(optional) text-idx(optional), match-end to end of string is error text
    (append
     '(
!                                       ; MS Visual C++ 6.0
       ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) \: 
\\(\\(error\\|warning\\|fatal error\\) \\(C[0-9]+\\):[ \t\n]*\\(.+\\)\\)"
        1 3 nil 4)
!                                       ; jikes
       
("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[0-9]+\:[0-9]+\:[0-9]+\: 
\\(\\(Error\\|Warning\\|Caution\\|Semantic Error\\):[ \t\n]*\\(.+\\)\\)"
        1 3 nil 4)
!                                       ; MS midl
       ("midl[ ]*:[ ]*\\(command line error .*\\)"
        nil nil nil 1)
!                                       ; MS C#
       ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\),[0-9]+)\: 
\\(\\(error\\|warning\\|fatal error\\) \\(CS[0-9]+\\):[ \t\n]*\\(.+\\)\\)"
        1 3 nil 4)
!                                       ; perl
       ("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]" 2 3 nil 1)
!                                       ; LaTeX warnings (fileless) ("\\(LaTeX 
\\(Warning\\|Error\\): .*\\) on input line \\([0-9]+\\)" 20 3 nil 1)
!                                       ; ant/javac
       (" *\\(\\[javac\\]\\)? 
*\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)"
        2 4 nil 5))
     ;; compilation-error-regexp-alist)
     (flymake-reformat-err-line-patterns-from-compile-el 
compilation-error-regexp-alist-alist))
!   "patterns for matching error/warning lines, (regexp file-idx line-idx 
err-text-idx). Use flymake-reformat-err-line-patterns-from-compile-el to add 
patterns from compile.el")
! 
!                                       ;(defcustom flymake-err-line-patterns
!                                       ;  '(
!                                       ;    ; MS Visual C++ 6.0
!                                       ;    
("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) \: 
\\(\\(error\\|warning\\|fatal error\\) \\(C[0-9]+\\):[ \t\n]*\\(.+\\)\\)"
!                                       ;       1 3 4)
!                                       ;   ; jikes
!                                       ;   
("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[0-9]+\:[0-9]+\:[0-9]+\: 
\\(\\(Error\\|Warning\\|Caution\\):[ \t\n]*\\(.+\\)\\)"
!                                       ;       1 3 4))
!                                       ;    "patterns for matching 
error/warning lines, (regexp file-idx line-idx err-text-idx)"
!                                       ;   :group 'flymake
!                                       ;   :type '(repeat (string number 
number number))
!                                       ;)
  
  (defun flymake-parse-line (line)
    "Parse LINE to see if it is an error of warning.
--- 1009,1051 ----
  (defvar flymake-err-line-patterns ; regexp file-idx line-idx col-idx 
(optional) text-idx(optional), match-end to end of string is error text
    (append
     '(
!      ;; MS Visual C++ 6.0
       ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) \: 
\\(\\(error\\|warning\\|fatal error\\) \\(C[0-9]+\\):[ \t\n]*\\(.+\\)\\)"
        1 3 nil 4)
!      ;; jikes
       
("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[0-9]+\:[0-9]+\:[0-9]+\: 
\\(\\(Error\\|Warning\\|Caution\\|Semantic Error\\):[ \t\n]*\\(.+\\)\\)"
        1 3 nil 4)
!      ;; MS midl
       ("midl[ ]*:[ ]*\\(command line error .*\\)"
        nil nil nil 1)
!      ;; MS C#
       ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\),[0-9]+)\: 
\\(\\(error\\|warning\\|fatal error\\) \\(CS[0-9]+\\):[ \t\n]*\\(.+\\)\\)"
        1 3 nil 4)
!      ;; perl
       ("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]" 2 3 nil 1)
!      ;; LaTeX warnings (fileless) ("\\(LaTeX \\(Warning\\|Error\\): .*\\) on 
input line \\([0-9]+\\)" 20 3 nil 1)
!      ;; ant/javac
       (" *\\(\\[javac\\]\\)? 
*\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)"
        2 4 nil 5))
     ;; compilation-error-regexp-alist)
     (flymake-reformat-err-line-patterns-from-compile-el 
compilation-error-regexp-alist-alist))
!   "Patterns for matching error/warning lines.
! \(REGEXP FILE-IDX LINE-IDX ERR-TEXT-IDX).
! Use `flymake-reformat-err-line-patterns-from-compile-el' to add patterns
! from compile.el")
! 
! ;;(defcustom flymake-err-line-patterns
! ;;  '(
! ;;    ; MS Visual C++ 6.0
! ;;    ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) \: 
\\(\\(error\\|warning\\|fatal error\\) \\(C[0-9]+\\):[ \t\n]*\\(.+\\)\\)"
! ;;       1 3 4)
! ;;   ; jikes
! ;;   
("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[0-9]+\:[0-9]+\:[0-9]+\: 
\\(\\(Error\\|Warning\\|Caution\\):[ \t\n]*\\(.+\\)\\)"
! ;;       1 3 4))
! ;;    "patterns for matching error/warning lines, (regexp file-idx line-idx 
err-text-idx)"
! ;;   :group 'flymake
! ;;   :type '(repeat (string number number number))
! ;;)
  
  (defun flymake-parse-line (line)
    "Parse LINE to see if it is an error of warning.
***************
*** 1133,1139 ****
    (if (flymake-get-project-include-dirs-from-cache basedir)
        (progn
        (flymake-get-project-include-dirs-from-cache basedir))
!                                       ;else
      (let* ((command-line  (concat "make -C\"" basedir "\" 
DUMPVARS=INCLUDE_DIRS dumpvars"))
           (output        (shell-command-to-string command-line))
           (lines         (flymake-split-string output "\n"))
--- 1138,1144 ----
    (if (flymake-get-project-include-dirs-from-cache basedir)
        (progn
        (flymake-get-project-include-dirs-from-cache basedir))
!     ;;else
      (let* ((command-line  (concat "make -C\"" basedir "\" 
DUMPVARS=INCLUDE_DIRS dumpvars"))
           (output        (shell-command-to-string command-line))
           (lines         (flymake-split-string output "\n"))
***************
*** 1317,1323 ****
    (call-interactively 'compile))
  
  (defvar flymake-is-running nil
!   "If t, flymake syntax check process is running for the current buffer")
  
  (make-variable-buffer-local 'flymake-is-running)
  
--- 1322,1328 ----
    (call-interactively 'compile))
  
  (defvar flymake-is-running nil
!   "If t, flymake syntax check process is running for the current buffer.")
  
  (make-variable-buffer-local 'flymake-is-running)
  
***************
*** 1361,1367 ****
    (flymake-set-buffer-var buffer 'flymake-check-start-time check-start-time))
  
  (defvar flymake-check-was-interrupted nil
!   "t if syntax check was killed by flymake-compile")
  
  (make-variable-buffer-local 'flymake-check-was-interrupted)
  
--- 1366,1372 ----
    (flymake-set-buffer-var buffer 'flymake-check-start-time check-start-time))
  
  (defvar flymake-check-was-interrupted nil
!   "Non-nil if syntax check was killed by `flymake-compile'.")
  
  (make-variable-buffer-local 'flymake-check-was-interrupted)
  
***************
*** 1378,1384 ****
  
  (defun flymake-on-timer-event (buffer)
    "Start a syntax check for buffer BUFFER if necessary."
!                                       ;+(flymake-log 3 "timer: running=%s, 
time=%s, cur-time=%s" (flymake-get-buffer-is-running buffer) 
(flymake-get-buffer-last-change-time buffer) (flymake-float-time))
    (when (and (bufferp buffer) (not (flymake-get-buffer-is-running buffer)))
      (save-excursion
        (set-buffer buffer)
--- 1383,1389 ----
  
  (defun flymake-on-timer-event (buffer)
    "Start a syntax check for buffer BUFFER if necessary."
!   ;;+(flymake-log 3 "timer: running=%s, time=%s, cur-time=%s" 
(flymake-get-buffer-is-running buffer) (flymake-get-buffer-last-change-time 
buffer) (flymake-float-time))
    (when (and (bufferp buffer) (not (flymake-get-buffer-is-running buffer)))
      (save-excursion
        (set-buffer buffer)
***************
*** 1474,1480 ****
        nil)))
  
  (defun flymake-goto-file-and-line (file line)
!   "Try to get buffer for file and goto line line in it"
    (if (not (file-exists-p file))
        (flymake-log 1 "file %s does not exists" file)
      (progn
--- 1479,1485 ----
        nil)))
  
  (defun flymake-goto-file-and-line (file line)
!   "Try to get buffer for FILE and goto line LINE in it."
    (if (not (file-exists-p file))
        (flymake-log 1 "file %s does not exists" file)
      (progn
***************
*** 1590,1596 ****
      (setq after-change-functions (cons 'flymake-after-change-function 
after-change-functions))
      (add-hook 'after-save-hook 'flymake-after-save-hook)
      (add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook)
!                                       ;+(add-hook 'find-file-hooks 
'flymake-find-file-hook)
  
      (flymake-report-status (current-buffer) "" "")
  
--- 1595,1601 ----
      (setq after-change-functions (cons 'flymake-after-change-function 
after-change-functions))
      (add-hook 'after-save-hook 'flymake-after-save-hook)
      (add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook)
!     ;;+(add-hook 'find-file-hook 'flymake-find-file-hook)
  
      (flymake-report-status (current-buffer) "" "")
  
***************
*** 1608,1614 ****
      (setq after-change-functions (delq 'flymake-after-change-function  
after-change-functions))
      (remove-hook 'after-save-hook (function flymake-after-save-hook) t)
      (remove-hook 'kill-buffer-hook (function flymake-kill-buffer-hook) t)
!                                       ;+(remove-hook 'find-file-hooks 
(function flymake-find-file-hook) t)
  
      (flymake-delete-own-overlays (current-buffer))
  
--- 1613,1619 ----
      (setq after-change-functions (delq 'flymake-after-change-function  
after-change-functions))
      (remove-hook 'after-save-hook (function flymake-after-save-hook) t)
      (remove-hook 'kill-buffer-hook (function flymake-kill-buffer-hook) t)
!     ;;+(remove-hook 'find-file-hook (function flymake-find-file-hook) t)
  
      (flymake-delete-own-overlays (current-buffer))
  
***************
*** 1627,1634 ****
    :type 'boolean)
  
  (defun flymake-after-change-function (start stop len)
!   "Start syntax check for current buffer if it isn't already running"
!                                       ;+(flymake-log 0 "setting change time 
to %s" (flymake-float-time))
    (let((new-text (buffer-substring start stop)))
      (when (and flymake-start-syntax-check-on-newline (equal new-text "\n"))
        (flymake-log 3 "starting syntax check as new-line has been seen")
--- 1632,1639 ----
    :type 'boolean)
  
  (defun flymake-after-change-function (start stop len)
!   "Start syntax check for current buffer if it isn't already running."
!   ;;+(flymake-log 0 "setting change time to %s" (flymake-float-time))
    (let((new-text (buffer-substring start stop)))
      (when (and flymake-start-syntax-check-on-newline (equal new-text "\n"))
        (flymake-log 3 "starting syntax check as new-line has been seen")
***************
*** 1647,1656 ****
      (flymake-set-buffer-timer (current-buffer) nil)))
  
  (defun flymake-find-file-hook ()
!                                       ;+(when 
flymake-start-syntax-check-on-find-file
!                                       ;+    (flymake-log 3 "starting syntax 
check on file open")
!                                       ;+    
(flymake-start-syntax-check-for-current-buffer)
!                                       ;+)
    (when (and (not (local-variable-p 'flymake-mode (current-buffer)))
             (flymake-can-syntax-check-file (buffer-file-name 
(current-buffer))))
      (flymake-mode)
--- 1652,1661 ----
      (flymake-set-buffer-timer (current-buffer) nil)))
  
  (defun flymake-find-file-hook ()
!   ;;+(when flymake-start-syntax-check-on-find-file
!   ;;+    (flymake-log 3 "starting syntax check on file open")
!   ;;+    (flymake-start-syntax-check-for-current-buffer)
!   ;;+)
    (when (and (not (local-variable-p 'flymake-mode (current-buffer)))
             (flymake-can-syntax-check-file (buffer-file-name 
(current-buffer))))
      (flymake-mode)
***************
*** 1691,1702 ****
      (forward-char)))
  
  (defun flymake-goto-line (line-no)
!   "goto-line, then skip whitespace"
    (goto-line line-no)
    (flymake-skip-whitespace))
  
  (defun flymake-goto-next-error ()
!   "go to next error in err ring"
    (interactive)
    (let ((line-no (flymake-get-next-err-line-no (flymake-get-buffer-err-info 
(current-buffer)) (flymake-current-line-no))))
      (when (not line-no)
--- 1696,1707 ----
      (forward-char)))
  
  (defun flymake-goto-line (line-no)
!   "Go to line LINE-NO, then skip whitespace."
    (goto-line line-no)
    (flymake-skip-whitespace))
  
  (defun flymake-goto-next-error ()
!   "Go to next error in err ring."
    (interactive)
    (let ((line-no (flymake-get-next-err-line-no (flymake-get-buffer-err-info 
(current-buffer)) (flymake-current-line-no))))
      (when (not line-no)
***************
*** 1707,1713 ****
        (flymake-log 1 "no errors in current buffer"))))
  
  (defun flymake-goto-prev-error ()
!   "go to prev error in err ring"
    (interactive)
    (let ((line-no (flymake-get-prev-err-line-no (flymake-get-buffer-err-info 
(current-buffer)) (flymake-current-line-no))))
      (when (not line-no)
--- 1712,1718 ----
        (flymake-log 1 "no errors in current buffer"))))
  
  (defun flymake-goto-prev-error ()
!   "Go to prev error in err ring."
    (interactive)
    (let ((line-no (flymake-get-prev-err-line-no (flymake-get-buffer-err-info 
(current-buffer)) (flymake-current-line-no))))
      (when (not line-no)
***************
*** 1756,1768 ****
      pos))
  
  (defun flymake-delete-temp-directory (dir-name)
!   "attempt to delete temp dir created by 
flymake-create-temp-with-folder-structure, do not fail on error."
    (let* ((temp-dir    (flymake-get-temp-dir))
         (suffix      (substring dir-name (1+ (length temp-dir))))
         (slash-pos   nil))
  
      (while (> (length suffix) 0)
!                                       ;+(flymake-log 0 "suffix=%s" suffix)
        (flymake-safe-delete-directory (file-truename (concat 
(flymake-ensure-ends-with-slash temp-dir) suffix)))
        (setq slash-pos (flymake-strrchr suffix (string-to-char "/")))
        (if slash-pos
--- 1761,1773 ----
      pos))
  
  (defun flymake-delete-temp-directory (dir-name)
!   "Attempt to delete temp dir created by 
`flymake-create-temp-with-folder-structure', do not fail on error."
    (let* ((temp-dir    (flymake-get-temp-dir))
         (suffix      (substring dir-name (1+ (length temp-dir))))
         (slash-pos   nil))
  
      (while (> (length suffix) 0)
!       ;;+(flymake-log 0 "suffix=%s" suffix)
        (flymake-safe-delete-directory (file-truename (concat 
(flymake-ensure-ends-with-slash temp-dir) suffix)))
        (setq slash-pos (flymake-strrchr suffix (string-to-char "/")))
        (if slash-pos
***************
*** 1786,1793 ****
      (flymake-set-buffer-last-change-time buffer nil)))
  
  (defun flymake-get-real-file-name (buffer file-name-from-err-msg)
!   "Translate file name from error message to `real' file name.
! Return full-name. Names are real, not patched."
    (let* ((real-name              nil)
         (source-file-name       (buffer-file-name buffer))
         (master-file-name       (flymake-get-buffer-value buffer 
"master-file-name"))
--- 1791,1798 ----
      (flymake-set-buffer-last-change-time buffer nil)))
  
  (defun flymake-get-real-file-name (buffer file-name-from-err-msg)
!   "Translate file name from error message to \"real\" file name.
! Return full-name.  Names are real, not patched."
    (let* ((real-name              nil)
         (source-file-name       (buffer-file-name buffer))
         (master-file-name       (flymake-get-buffer-value buffer 
"master-file-name"))
***************
*** 1805,1811 ****
        (setq file-name-from-err-msg source-file-name))
  
      (setq real-name (flymake-get-full-patched-file-name 
file-name-from-err-msg base-dirs files))
!                                       ; if real-name is nil, than file name 
from err msg is none of the files we've patched
      (if (not real-name)
        (setq real-name (flymake-get-full-nonpatched-file-name 
file-name-from-err-msg base-dirs)))
      (if (not real-name)
--- 1810,1816 ----
        (setq file-name-from-err-msg source-file-name))
  
      (setq real-name (flymake-get-full-patched-file-name 
file-name-from-err-msg base-dirs files))
!     ;; if real-name is nil, than file name from err msg is none of the files 
we've patched
      (if (not real-name)
        (setq real-name (flymake-get-full-nonpatched-file-name 
file-name-from-err-msg base-dirs)))
      (if (not real-name)
***************
*** 1825,1831 ****
        (let* ((this-dir        (nth (1- base-dirs-count) base-dirs))
               (this-file       (nth 0 (nth (1- file-count) files)))
               (this-real-name  (nth 1 (nth (1- file-count) files))))
!                                       ;+(flymake-log 0 "this-dir=%s 
this-file=%s this-real=%s msg-file=%s" this-dir this-file this-real-name 
file-name-from-err-msg)
          (when (and this-dir this-file (flymake-same-files
                                         
(flymake-get-absolute-file-name-basedir file-name-from-err-msg this-dir)
                                         this-file))
--- 1830,1836 ----
        (let* ((this-dir        (nth (1- base-dirs-count) base-dirs))
               (this-file       (nth 0 (nth (1- file-count) files)))
               (this-real-name  (nth 1 (nth (1- file-count) files))))
!         ;;+(flymake-log 0 "this-dir=%s this-file=%s this-real=%s msg-file=%s" 
this-dir this-file this-real-name file-name-from-err-msg)
          (when (and this-dir this-file (flymake-same-files
                                         
(flymake-get-absolute-file-name-basedir file-name-from-err-msg this-dir)
                                         this-file))
***************
*** 1941,1947 ****
    (flymake-simple-make-init-impl buffer 'flymake-create-temp-inplace t t 
"Makefile" 'flymake-get-make-cmdline))
  
  (defun flymake-master-make-init (buffer get-incl-dirs-f master-file-masks 
include-regexp-list)
!   "create make command line for a source file checked via master file 
compilation"
    (let* ((make-args nil)
         (temp-master-file-name 
(flymake-init-create-temp-source-and-master-buffer-copy
                                 buffer get-incl-dirs-f 
'flymake-create-temp-inplace
--- 1946,1952 ----
    (flymake-simple-make-init-impl buffer 'flymake-create-temp-inplace t t 
"Makefile" 'flymake-get-make-cmdline))
  
  (defun flymake-master-make-init (buffer get-incl-dirs-f master-file-masks 
include-regexp-list)
!   "Create make command line for a source file checked via master file 
compilation."
    (let* ((make-args nil)
         (temp-master-file-name 
(flymake-init-create-temp-source-and-master-buffer-copy
                                 buffer get-incl-dirs-f 
'flymake-create-temp-inplace
***************
*** 1971,1977 ****
    (flymake-simple-make-init-impl buffer 
'flymake-create-temp-with-folder-structure nil nil "build.xml" 
'flymake-get-ant-cmdline))
  
  (defun flymake-simple-java-cleanup (buffer)
!   "cleanup after flymake-simple-make-java-init -- delete temp file and dirs"
    (let* ((temp-source-file-name (flymake-get-buffer-value buffer 
"temp-source-file-name")))
      (flymake-safe-delete-file temp-source-file-name)
      (when temp-source-file-name
--- 1976,1982 ----
    (flymake-simple-make-init-impl buffer 
'flymake-create-temp-with-folder-structure nil nil "build.xml" 
'flymake-get-ant-cmdline))
  
  (defun flymake-simple-java-cleanup (buffer)
!   "Cleanup after `flymake-simple-make-java-init' -- delete temp file and 
dirs."
    (let* ((temp-source-file-name (flymake-get-buffer-value buffer 
"temp-source-file-name")))
      (flymake-safe-delete-file temp-source-file-name)
      (when temp-source-file-name
***************
*** 1987,1993 ****
  
  ;;;; tex-specific init-cleanup routines
  (defun flymake-get-tex-args (file-name)
!                                       ;(list "latex" (list "-c-style-errors" 
file-name))
    (list "texify" (list "--pdf" "--tex-option=-c-style-errors" file-name)))
  
  (defun flymake-simple-tex-init (buffer)
--- 1992,1998 ----
  
  ;;;; tex-specific init-cleanup routines
  (defun flymake-get-tex-args (file-name)
!   ;;(list "latex" (list "-c-style-errors" file-name))
    (list "texify" (list "--pdf" "--tex-option=-c-style-errors" file-name)))
  
  (defun flymake-simple-tex-init (buffer)
***************
*** 2010,2014 ****
  
  (provide 'flymake)
  
! ;;; arch-tag: 8f0d6090-061d-4cac-8862-7c151c4a02dd
  ;;; flymake.el ends here
--- 2015,2019 ----
  
  (provide 'flymake)
  
! ;; arch-tag: 8f0d6090-061d-4cac-8862-7c151c4a02dd
  ;;; flymake.el ends here




reply via email to

[Prev in Thread] Current Thread [Next in Thread]