summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorroot <devnull@localhost>2006-04-26 10:48:09 +0000
committerroot <devnull@localhost>2006-04-26 10:48:09 +0000
commiteea76f1da01a33dec2afc42119e001e4350aaea2 (patch)
tree3bb03a16daa8c780bf60c622dc288eb01cfca145 /elisp
downloadpylint-eea76f1da01a33dec2afc42119e001e4350aaea2.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 0000000..84f5da6
--- /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 0000000..ad9d071
--- /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")