summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/Makefile7
-rwxr-xr-xmisc/perl_checker-vim3
-rw-r--r--misc/perl_checker.el10
-rw-r--r--misc/perl_checker.vim1
4 files changed, 21 insertions, 0 deletions
diff --git a/misc/Makefile b/misc/Makefile
new file mode 100644
index 0000000..70c3def
--- /dev/null
+++ b/misc/Makefile
@@ -0,0 +1,7 @@
+PREFIX = /usr
+DATADIR = $(PREFIX)/share
+
+install:
+ install -D -m 644 perl_checker.vim $(DESTDIR)$(DATADIR)/vim/ftplugin/perl_checker.vim
+ install -D -m 644 perl_checker.el $(DESTDIR)/etc/emacs/site-start.d/perl_checker.el
+ install -D perl_checker-vim $(DESTDIR)$(PREFIX)/bin/perl_checker-vim
diff --git a/misc/perl_checker-vim b/misc/perl_checker-vim
new file mode 100755
index 0000000..a32478b
--- /dev/null
+++ b/misc/perl_checker-vim
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+perl_checker --restrict-to-files "$@" > errors.err && vim -c ':copen 4' -c ':so /usr/share/vim/ftplugin/perl_checker.vim' -q
diff --git a/misc/perl_checker.el b/misc/perl_checker.el
new file mode 100644
index 0000000..135cb99
--- /dev/null
+++ b/misc/perl_checker.el
@@ -0,0 +1,10 @@
+(defun run-perl_checker ()
+ (interactive)
+ (save-some-buffers 1)
+ (compile (concat "perl_checker --restrict-to-files " (buffer-file-name (current-buffer)))))
+
+(let ((hook '(lambda ()
+ (local-set-key [(control return)] 'run-perl_checker)
+ )))
+ (add-hook 'perl-mode-hook hook)
+ (add-hook 'cperl-mode-hook hook))
diff --git a/misc/perl_checker.vim b/misc/perl_checker.vim
new file mode 100644
index 0000000..1b34dc2
--- /dev/null
+++ b/misc/perl_checker.vim
@@ -0,0 +1 @@
+setlocal errorformat=%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c-%n,%Z%m