diff options
| author | Daniel Colascione | 2014-02-13 14:37:29 -0800 |
|---|---|---|
| committer | Daniel Colascione | 2014-02-13 14:37:29 -0800 |
| commit | 0b87142f24a5dd0d81c26aeea21feec50bbc1044 (patch) | |
| tree | f7527551c4a20f5d2c4dff4152f8634aa5383543 /lisp | |
| parent | e2607667a1c5a0dd147478fee40010506548b8d9 (diff) | |
| download | emacs-0b87142f24a5dd0d81c26aeea21feec50bbc1044.tar.gz emacs-0b87142f24a5dd0d81c26aeea21feec50bbc1044.zip | |
Fix flymake in narrowed buffers
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/progmodes/flymake.el | 48 |
2 files changed, 31 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 156c2440de5..c0d08e0a6e8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-02-13 Daniel Colascione <dancol@dancol.org> | ||
| 2 | |||
| 3 | * progmodes/flymake.el (flymake-post-syntax-check): Widen buffer | ||
| 4 | when adding overlays so that line numbers from compiler match line | ||
| 5 | numbers we use. | ||
| 6 | |||
| 1 | 2014-02-13 Glenn Morris <rgm@gnu.org> | 7 | 2014-02-13 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * mail/rmail.el (rmail-probe): Be less strict. (Bug#16743) | 9 | * mail/rmail.el (rmail-probe): Be less strict. (Bug#16743) |
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 125ee631da6..10aed7db3c9 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el | |||
| @@ -555,29 +555,31 @@ It's flymake process filter." | |||
| 555 | (setq flymake-is-running nil)))))))) | 555 | (setq flymake-is-running nil)))))))) |
| 556 | 556 | ||
| 557 | (defun flymake-post-syntax-check (exit-status command) | 557 | (defun flymake-post-syntax-check (exit-status command) |
| 558 | (setq flymake-err-info flymake-new-err-info) | 558 | (save-restriction |
| 559 | (setq flymake-new-err-info nil) | 559 | (widen) |
| 560 | (setq flymake-err-info | 560 | (setq flymake-err-info flymake-new-err-info) |
| 561 | (flymake-fix-line-numbers | 561 | (setq flymake-new-err-info nil) |
| 562 | flymake-err-info 1 (count-lines (point-min) (point-max)))) | 562 | (setq flymake-err-info |
| 563 | (flymake-delete-own-overlays) | 563 | (flymake-fix-line-numbers |
| 564 | (flymake-highlight-err-lines flymake-err-info) | 564 | flymake-err-info 1 (count-lines (point-min) (point-max)))) |
| 565 | (let (err-count warn-count) | 565 | (flymake-delete-own-overlays) |
| 566 | (setq err-count (flymake-get-err-count flymake-err-info "e")) | 566 | (flymake-highlight-err-lines flymake-err-info) |
| 567 | (setq warn-count (flymake-get-err-count flymake-err-info "w")) | 567 | (let (err-count warn-count) |
| 568 | (flymake-log 2 "%s: %d error(s), %d warning(s) in %.2f second(s)" | 568 | (setq err-count (flymake-get-err-count flymake-err-info "e")) |
| 569 | (buffer-name) err-count warn-count | 569 | (setq warn-count (flymake-get-err-count flymake-err-info "w")) |
| 570 | (- (float-time) flymake-check-start-time)) | 570 | (flymake-log 2 "%s: %d error(s), %d warning(s) in %.2f second(s)" |
| 571 | (setq flymake-check-start-time nil) | 571 | (buffer-name) err-count warn-count |
| 572 | 572 | (- (float-time) flymake-check-start-time)) | |
| 573 | (if (and (equal 0 err-count) (equal 0 warn-count)) | 573 | (setq flymake-check-start-time nil) |
| 574 | (if (equal 0 exit-status) | 574 | |
| 575 | (flymake-report-status "" "") ; PASSED | 575 | (if (and (equal 0 err-count) (equal 0 warn-count)) |
| 576 | (if (not flymake-check-was-interrupted) | 576 | (if (equal 0 exit-status) |
| 577 | (flymake-report-fatal-status "CFGERR" | 577 | (flymake-report-status "" "") ; PASSED |
| 578 | (format "Configuration error has occurred while running %s" command)) | 578 | (if (not flymake-check-was-interrupted) |
| 579 | (flymake-report-status nil ""))) ; "STOPPED" | 579 | (flymake-report-fatal-status "CFGERR" |
| 580 | (flymake-report-status (format "%d/%d" err-count warn-count) "")))) | 580 | (format "Configuration error has occurred while running %s" command)) |
| 581 | (flymake-report-status nil ""))) ; "STOPPED" | ||
| 582 | (flymake-report-status (format "%d/%d" err-count warn-count) ""))))) | ||
| 581 | 583 | ||
| 582 | (defun flymake-parse-output-and-residual (output) | 584 | (defun flymake-parse-output-and-residual (output) |
| 583 | "Split OUTPUT into lines, merge in residual if necessary." | 585 | "Split OUTPUT into lines, merge in residual if necessary." |