summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-03-14 17:03:27 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2016-03-14 17:03:27 +0100
commitd54ba0d8cdc5bca846e547eaf01aa94f73202b67 (patch)
treed9d85de49443fac119a86ebe4f5f18c7659372da
parentba6d51bbfc01f04b4efbbb8e4013a1d375ca0b6a (diff)
downloadlr-d54ba0d8cdc5bca846e547eaf01aa94f73202b67.tar.gz
lr-d54ba0d8cdc5bca846e547eaf01aa94f73202b67.tar.xz
lr-d54ba0d8cdc5bca846e547eaf01aa94f73202b67.zip
contrib: add lr.el
-rw-r--r--contrib/lr.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/contrib/lr.el b/contrib/lr.el
new file mode 100644
index 0000000..ea9d264
--- /dev/null
+++ b/contrib/lr.el
@@ -0,0 +1,19 @@
+;;; lr.el --- run `lr' and display the results
+
+(define-compilation-mode lr-mode "Lr"
+  (set (make-local-variable 'compilation-error-regexp-alist)
+       '(("\\([^ \n']+\\)[*/=>@|]$" 1)
+         ("\\([^ \n']+\\)$" 1)
+         ("'\\(.+\\)'$" 1)))
+  (set (make-local-variable 'next-error-highlight) nil))
+
+(defun lr (command-args)
+  "Run lr, with user-specified args, and collect output in a buffer.
+While lr runs asynchronously, you can use \\[next-error] (M-x next-error),
+or RET in the *lr* buffer, to go to the files lr found."
+  (interactive (list (read-shell-command "Run lr (like this): "
+                                         "lr " 'lr-history)))
+  (compilation-start command-args 'lr-mode))
+
+(provide 'lr)
+;;; lr.el ends here