91fbe5a6b164

More
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Thu, 09 Nov 2023 12:24:16 -0500
parents 8148377ec342
children b649bb0dda87
branches/tags (none)
files htoprc lisp/parens.lisp vim/vimrc

Changes

--- a/htoprc	Tue Nov 07 10:05:28 2023 -0500
+++ b/htoprc	Thu Nov 09 12:24:16 2023 -0500
@@ -38,7 +38,7 @@
 column_meter_modes_0=1 1 1
 column_meters_1=RightCPUs2 Tasks LoadAverage Uptime
 column_meter_modes_1=1 2 2 2
-tree_view=1
+tree_view=0
 sort_key=46
 tree_sort_key=0
 sort_direction=-1
@@ -48,7 +48,7 @@
 screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT M_SHARE STATE PERCENT_CPU PERCENT_MEM TIME Command
 .sort_key=PERCENT_CPU
 .tree_sort_key=PID
-.tree_view=1
+.tree_view=0
 .tree_view_always_by_pid=1
 .sort_direction=-1
 .tree_sort_direction=1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/parens.lisp	Thu Nov 09 12:24:16 2023 -0500
@@ -0,0 +1,58 @@
+(eval-when (:compile-toplevel :load-toplevel :execute)
+  (ql:quickload
+    '(:adopt :losh :parenscript)
+    :silent t))
+
+(defpackage :parens
+  (:use :cl :iterate :losh)
+  (:export :toplevel :*ui*))
+
+(defpackage :parenscript-user
+  (:use :cl :parenscript))
+
+(in-package :parens)
+
+;;;; Run ----------------------------------------------------------------------
+(defun compile-with-parenscript (in-stream out-stream)
+  (let ((parenscript:*parenscript-stream* out-stream))
+    (ps:ps-compile-stream in-stream)))
+
+(defun run ()
+  (compile-with-parenscript *standard-input* *standard-output*))
+
+
+;;;; User Interface -----------------------------------------------------------
+(defparameter *option-help*
+  (adopt:make-option 'help
+    :help "Display help and exit."
+    :long "help"
+    :short #\h
+    :reduce (constantly t)))
+
+
+(adopt:define-string *help-text*
+  "parens is a helper program to invoke the parenscript compiler for standalone ~
+   files, so you can just use parenscript without the Common Lisp bits.")
+
+(defparameter *examples*
+  '(("Compile:" . "cat foo.lisp | parens > out.js")))
+
+(defparameter *ui*
+  (adopt:make-interface
+    :name "parens"
+    :usage "[OPTIONS]"
+    :summary "standalone parenscript compiler"
+    :help *help-text*
+    :examples *examples*
+    :contents (list *option-help*)))
+
+
+(defun toplevel ()
+  (multiple-value-bind (arguments options) (adopt:parse-options-or-exit *ui*)
+    (handler-case
+        (if (gethash 'help options)
+          (adopt:print-help-and-exit *ui*)
+          (progn (assert (null arguments))
+                 (run)))
+      (error (e) (adopt:print-error-and-exit e)))))
+
--- a/vim/vimrc	Tue Nov 07 10:05:28 2023 -0500
+++ b/vim/vimrc	Thu Nov 09 12:24:16 2023 -0500
@@ -1375,6 +1375,7 @@
     au FileType cs setlocal commentstring=//\ %s
     au FileType arduino setlocal commentstring=//\ %s
     au FileType pandabt setlocal commentstring=//\ %s
+    au FileType nextflow setlocal commentstring=//\ %s
 augroup END
 
 " }}}