[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Flymake tweak

From: Rob Getter
Subject: Flymake tweak
Date: Thu, 03 Feb 2011 18:42:40 -0500

This change adds a check pending flag that gets set if
flymake-start-syntax-check is called while a syntax check is in progress. If
the flag is set when a syntax check completes, then another syntax check will
be run. The flag is cleared whenever a syntax check is begun. The result is
that when syntax checking is complete, the result accurately represents the
correctness of the buffer's contents. 

2011-02-03  Rob Getter  <address@hidden>

        * lisp/progmodes/flymake.el (flymake-check-pending 
flymake-start-syntax-check flymake-start-syntax-check-process): Start a new
syntax check if changes are made while a check is in progress.

*** c:\Program Files\emacs-23.2\lisp\progmodes\flymake.el       Sat Apr 03 
--- new\flymake.el      Thu Feb 03 17:56:09 2011
*** 43,48 ****
--- 43,52 ----
    "If t, flymake syntax check process is running for the current buffer.")
  (make-variable-buffer-local 'flymake-is-running)
+ (defvar flymake-check-pending nil
+   "If t, flymake is waiting on a previous syntax check before running a new
+ (make-variable-buffer-local 'flymake-check-pending)
  (defvar flymake-timer nil
    "Timer for starting syntax check.")
  (make-variable-buffer-local 'flymake-timer)
*************** It's flymake process filter."
*** 615,621 ****
                  (flymake-post-syntax-check exit-status command)
!                 (setq flymake-is-running nil))))
           (let ((err-str (format "Error in process sentinel for buffer %s:
                                  source-buffer (error-message-string err))))
--- 619,627 ----
                  (flymake-post-syntax-check exit-status command)
!                 (setq flymake-is-running nil)
!                 (when flymake-check-pending
!                   (flymake-start-syntax-check)))))
           (let ((err-str (format "Error in process sentinel for buffer %s:
                                  source-buffer (error-message-string err))))
*************** For the format of LINE-ERR-INFO, see `fl
*** 1120,1125 ****
--- 1126,1133 ----
    "Start syntax checking for current buffer."
    (flymake-log 3 "flymake is running: %s" flymake-is-running)
+   (when flymake-is-running
+     (setq flymake-check-pending t))
    (when (and (not flymake-is-running)
               (flymake-can-syntax-check-file buffer-file-name))
      (when (or (not flymake-compilation-prevents-syntax-check)
*************** For the format of LINE-ERR-INFO, see `fl
*** 1158,1163 ****
--- 1166,1172 ----
            (push process flymake-processes)
            (setq flymake-is-running t)
+           (setq flymake-check-pending nil)
            (setq flymake-last-change-time nil)
            (setq flymake-check-start-time (flymake-float-time))

Rob Getter

reply via email to

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