diff options
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | README.emacs | 21 | ||||
-rw-r--r-- | misc/Makefile | 7 | ||||
-rwxr-xr-x | misc/perl_checker-vim | 3 | ||||
-rw-r--r-- | misc/perl_checker.el | 10 | ||||
-rw-r--r-- | misc/perl_checker.vim | 1 |
6 files changed, 46 insertions, 3 deletions
@@ -5,7 +5,7 @@ RPM ?= $(HOME)/rpm PREFIX = /usr BINDIR = $(PREFIX)/bin VENDORLIB = $(shell eval "`perl -V:installvendorlib`"; echo $$installvendorlib) -INSTALLVENDORLIB = $(shell echo $(VENDORLIB) | sed 's,/usr,$(PREFIX),') +INSTALLVENDORLIB = $(DESTDIR)$(VENDORLIB) PERL_CHECKER_TARGET = native-code GENERATED = MDK/Common.pm index.html perl_checker.src/perl_checker @@ -34,8 +34,9 @@ clean: find -name "*~" | xargs rm -rf install: clean all - install -d $(BINDIR) $(INSTALLVENDORLIB)/MDK/Common - install perl_checker.src/perl_checker $(BINDIR) + install -d $(DESTDIR)$(BINDIR) $(INSTALLVENDORLIB)/MDK/Common + $(MAKE) -C misc install + install perl_checker.src/perl_checker $(DESTDIR)$(BINDIR) install -m 644 MDK/Common.pm $(INSTALLVENDORLIB)/MDK install -m 644 MDK/Common/*.pm $(INSTALLVENDORLIB)/MDK/Common tar c `find perl_checker_fake_packages -name "*.pm"` | tar xC $(INSTALLVENDORLIB) diff --git a/README.emacs b/README.emacs new file mode 100644 index 0000000..d3733a2 --- /dev/null +++ b/README.emacs @@ -0,0 +1,21 @@ +To use under emacs, simply add the following line to your .emacs, +then when you visit a perl file, you can use Ctrl-Return to run perl_checker +on this file + + (global-set-key [(control return)] (lambda () (interactive) (save-some-buffers 1) (compile (concat "perl_checker --restrict-to-files " (buffer-file-name (current-buffer)))))) + +perl_checker --restrict-to-files scanner.pm > errors.err ; vim -c ':copen 4' -c ':so /usr/share/vim/ftplugin/perl_checker.vim' -q + + + +/usr/share/vim/ftplugin/perl_checker.vim + +" Error formats +setlocal efm= + \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:, + \%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m, + \%+EReference\ to\ unbound\ regexp\ name\ %m, + \%Eocamlyacc:\ e\ -\ line\ %l\ of\ \"%f\"\\,\ %m, + \%Wocamlyacc:\ w\ -\ %m, + \%-Zmake%.%#, + \%C%m 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 |