;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/fill-incal.el (require 'dwim) (require 'message) (setq sentence-end-double-space nil) (setq fill-nobreak-predicate (list #'fill-single-char-nobreak-p #'fill-single-word-nobreak-p)) (let ((fill-col 62)) (setq-default fill-column fill-col) (setq message-fill-column fill-col)) (defun fill-down (beg end &optional justify) (interactive (if (use-region-p) `(,@(use-region) ,current-prefix-arg) (list (pos-bol) (save-excursion (forward-paragraph) (point)) current-prefix-arg))) (cond ((member 4 justify) (unfill beg end)) ((member 16 justify) (canonically-space-region beg end)) ((fill-region beg end)))) (defun unfill (&optional beg end) "\nhttp://emacswiki.org/emacs/unfillregion" (interactive (use-region)) (or beg (setq beg (point-min))) (or end (setq end (point-max))) (let ((fill-column (point-max))) (fill-region beg end) )) (provide 'fill-incal)