Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: Tools/Scripts/webkitpy/thirdparty/pylint/doc/flymake.txt

Issue 18418010: Check in the thirdparty libs needed for webkitpy. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Tools/Scripts/webkitpy/thirdparty/pylint/doc/flymake.txt
diff --git a/Tools/Scripts/webkitpy/thirdparty/pylint/doc/flymake.txt b/Tools/Scripts/webkitpy/thirdparty/pylint/doc/flymake.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1b068afc135a68ef9c7da5867f014dbe75b4033c
--- /dev/null
+++ b/Tools/Scripts/webkitpy/thirdparty/pylint/doc/flymake.txt
@@ -0,0 +1,60 @@
+To enable flymake for python, insert the following into your .emacs ::
+
+ ;; Configure flymake for python
+ (setq pylint "epylint")
+ (when (load "flymake" t)
+ (defun flymake-pylint-init ()
+ (let* ((temp-file (flymake-init-create-temp-buffer-copy
+ 'flymake-create-temp-inplace))
+ (local-file (file-relative-name
+ temp-file
+ (file-name-directory buffer-file-name))))
+ (list (expand-file-name pylint "") (list local-file))))
+ (add-to-list 'flymake-allowed-file-name-masks
+ '("\\.py\\'" flymake-pylint-init)))
+
+ ;; Set as a minor mode for python
+ (add-hook 'python-mode-hook '(lambda () (flymake-mode)))
+
+Above stuff is in pylint/elisp/pylint-flymake.el, which should be automatically
+installed on debian systems, in which cases you don't have to put it in your .emacs file.
+
+Other things you may find useful to set ::
+
+ ;; Configure to wait a bit longer after edits before starting
+ (setq-default flymake-no-changes-timeout '3)
+
+ ;; Keymaps to navigate to the errors
+ (add-hook 'python-mode-hook '(lambda () (define-key python-mode-map "\C-cn" 'flymake-goto-next-error)))
+ (add-hook 'python-mode-hook '(lambda () (define-key python-mode-map "\C-cp" 'flymake-goto-prev-error)))
+
+
+Finally, by default flymake only displays the extra information about the error when you
+hover the mouse over the highlighted line. The following will use the minibuffer to display
+messages when you the cursor is on the line.
+
+ ;; To avoid having to mouse hover for the error message, these functions make flymake error messages
+ ;; appear in the minibuffer
+ (defun show-fly-err-at-point ()
+ "If the cursor is sitting on a flymake error, display the message in the minibuffer"
+ (require 'cl)
+ (interactive)
+ (let ((line-no (line-number-at-pos)))
+ (dolist (elem flymake-err-info)
+ (if (eq (car elem) line-no)
+ (let ((err (car (second elem))))
+ (message "%s" (flymake-ler-text err)))))))
+
+ (add-hook 'post-command-hook 'show-fly-err-at-point)
+
+
+Alternative, if you only wish to pollute the minibuffer after an explicit flymake-goto-* then use
+the following instead of a post-command-hook
+
+ (defadvice flymake-goto-next-error (after display-message activate compile)
+ "Display the error in the mini-buffer rather than having to mouse over it"
+ (show-fly-err-at-point))
+
+ (defadvice flymake-goto-prev-error (after display-message activate compile)
+ "Display the error in the mini-buffer rather than having to mouse over it"
+ (show-fly-err-at-point))
« no previous file with comments | « Tools/Scripts/webkitpy/thirdparty/pylint/doc/features.txt ('k') | Tools/Scripts/webkitpy/thirdparty/pylint/doc/manual.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698