up | maxheisinger.at

util | maxheisinger.at

Self-Compile Emacs for more Performance   emacs

A custom Emacs compile using the Lucid toolkit (and relying on X11) may give you a significant performance uplift. A guide is posted here.

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)))

Pretty-Print the Line as S-Expression   emacs

This is really nice when working on all kinds of parsers. I often want to pretty-print the s-expr that I see on the current line. Using the function below, the buffer *pp-current-line-sexp* will be filled with the pretty-printed s-expr.

(defun pp-current-line-sexp ()
  "Pretty-print the s-expr at the current line into a buffer named
*pp-current-line-sexp*"
  (interactive)
  (let ((line (buffer-substring-no-properties (line-beginning-position) (line-end-position)))
    (buf (get-buffer-create "*pp-current-line-sexp*")))
    (with-current-buffer buf
      (erase-buffer)
      (pp (read line) buf)
      (beginning-of-buffer))))

Example for isync / mbsync   mail

The isync project with the mbsync tool is nice for synchronizing an IMAP account with a local machine. While there seem to be some issues with Google and Outlook accounts, other services still work very well with this tool. Below, you find an example configuration that could be run using mbsync -c <config>. Instead of PassCmd and the pass tool, you can also provide the password in other ways, although the combination with pass seems to be the most sensible.

If there are issues with the mail server dropping the connection because of too many requests, one may add PipelineDepth 5 to the IMAPAccount.

Expunge Both
Create Near

IMAPAccount ex
Host imap.example.org
User mail@example.org
CertificateFile /etc/ssl/certs/ca-certificates.crt
PassCmd "pass ex"
TLSType IMAPS

IMAPStore ex-remote
Account ex

MaildirStore ex-local
Path ~/mail/ex/
Inbox ~/mail/ex/inbox
SubFolders Verbatim

Channel ex
Far :ex-remote:
Near :ex-local:
Patterns *
CopyArrivalDate yes
Sync All

Author: Max Heisinger

Created: 2025-10-03 Fri 08:36