Commit 83319045 authored by Lars Magne Ingebrigtsen's avatar Lars Magne Ingebrigtsen
Browse files

* progmodes/flymake.el (flymake-mode): If the buffer isn't

associated with a file, refuse to run instead of erroring out
(bug#6084).
parent a8392169
2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
* progmodes/flymake.el (flymake-mode): If the buffer isn't
associated with a file, refuse to run instead of erroring out
(bug#6084).
* textmodes/fill.el (fill-region): Remove the "Ordinarily" from
the doc string, since it appears that using `fill-column' always
controls the width (bug#7845).
......
......@@ -1339,8 +1339,12 @@ With arg, turn Flymake mode on if and only if arg is positive."
;; Turning the mode ON.
(flymake-mode
(if (not (flymake-can-syntax-check-file buffer-file-name))
(flymake-log 2 "flymake cannot check syntax in buffer %s" (buffer-name))
(cond
((not buffer-file-name)
(message "Flymake unable to run without a buffer file name"))
((not (flymake-can-syntax-check-file buffer-file-name))
(flymake-log 2 "flymake cannot check syntax in buffer %s" (buffer-name)))
(t
(add-hook 'after-change-functions 'flymake-after-change-function nil t)
(add-hook 'after-save-hook 'flymake-after-save-hook nil t)
(add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook nil t)
......@@ -1352,7 +1356,7 @@ With arg, turn Flymake mode on if and only if arg is positive."
(run-at-time nil 1 'flymake-on-timer-event (current-buffer)))
(when flymake-start-syntax-check-on-find-file
(flymake-start-syntax-check))))
(flymake-start-syntax-check)))))
;; Turning the mode OFF.
(t
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment