summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorroot <none@none>2006-04-26 10:48:09 +0000
committerroot <none@none>2006-04-26 10:48:09 +0000
commit4becf6f9e596b45401680c4947e2d92c953d5e08 (patch)
tree3bb03a16daa8c780bf60c622dc288eb01cfca145 /elisp
downloadpylint-git-4becf6f9e596b45401680c4947e2d92c953d5e08.tar.gz
forget the past.
forget the past.
Diffstat (limited to 'elisp')
-rw-r--r--elisp/pylint.el37
-rw-r--r--elisp/startup17
2 files changed, 54 insertions, 0 deletions
diff --git a/elisp/pylint.el b/elisp/pylint.el
new file mode 100644
index 000000000..84f5da698
--- /dev/null
+++ b/elisp/pylint.el
@@ -0,0 +1,37 @@
+
+;; adapted from pychecker for pylint
+(defun my-python-hook ()
+ (defun pylint ()
+ "Run pylint against the file behind the current buffer after
+ checking if unsaved buffers should be saved."
+
+ (interactive)
+ (let* ((file (buffer-file-name (current-buffer)))
+ (command (concat "pylint --parseable=y \"" file "\"")))
+ (save-some-buffers (not compilation-ask-about-save) nil) ; save files.
+ (compile-internal command "No more errors or warnings" "pylint")))
+ (local-set-key [f1] 'pylint)
+ (local-set-key [f2] 'previous-error)
+ (local-set-key [f3] 'next-error)
+
+ (define-key
+ py-mode-map
+ [menu-bar Python pylint-separator]
+ '("--" . pylint-seperator))
+
+ (define-key
+ py-mode-map
+ [menu-bar Python next-error]
+ '("Next error" . next-error))
+ (define-key
+ py-mode-map
+ [menu-bar Python prev-error]
+ '("Previous error" . previous-error))
+ (define-key
+ py-mode-map
+ [menu-bar Python lint]
+ '("Pylint" . pylint))
+
+ )
+
+(add-hook 'python-mode-hook 'my-python-hook)
diff --git a/elisp/startup b/elisp/startup
new file mode 100644
index 000000000..ad9d07188
--- /dev/null
+++ b/elisp/startup
@@ -0,0 +1,17 @@
+;; -*-emacs-lisp-*-
+;;
+;; Emacs startup file for the Debian GNU/Linux %PACKAGE% package
+;;
+;; Originally contributed by Nils Naumann <naumann@unileoben.ac.at>
+;; Modified by Dirk Eddelbuettel <edd@debian.org>
+;; Adapted for dh-make by Jim Van Zandt <jrv@vanzandt.mv.com>
+
+;; The %PACKAGE% package follows the Debian/GNU Linux 'emacsen' policy and
+;; byte-compiles its elisp files for each 'emacs flavor' (emacs19,
+;; xemacs19, emacs20, xemacs20...). The compiled code is then
+;; installed in a subdirectory of the respective site-lisp directory.
+;; We have to add this to the load-path:
+(setq load-path (cons (concat "/usr/share/"
+ (symbol-name flavor)
+ "/site-lisp/%PACKAGE%") load-path))
+(load-library "pylint")