util | maxheisinger.at
Unfill Paragraphs in Emacs emacs
Quite often I like my texts broken up to some line width. Some forms require paragraphs to be without newlines though, so I have to convert the text back to unjustified form. As I'm using Emacs heavily, this elisp snippet comes in handy sometimes:
(defun unfill-paragraph () (interactive) (let ((fill-column 9999999)) (fill-paragraph)))
Run Limboole From Org-Mode emacs
I really like Org Babel's Execute feature, using C-c C-c
. The
following snippet implements an execution function for limboole.
Just start a limboole
source-block and optionally add :mode
, with
valid values being sat
or validity
. It internally just checks for
the first character, so s
or v
are also okay. By default, it
behaves like limboole and executes the validity check.
(defun org-babel-execute:limboole (body params) "Execute a block of Limboole code with org-babel. Takes the parameters :mode satisfiability and :mode validity." (let ((mode (assoc :mode params))) (when (not mode) (setq (mode (cons :mode "v")))) (setq mode (cdr mode)) (message "executing limboole source block, mode %s" mode) (org-babel-eval (s-concat "limboole " (cond ((s-starts-with? "s" mode) "-s") ((s-starts-with? "v" mode) "") (t (error ":mode must either be sat or validity")))) body)))