From 2d2cab9d97d3e84e5b7158181523fe2c5bbffe85 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 16 Apr 2023 17:06:41 -0500 Subject: uhhh --- lisp/acdw.el | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) (limited to 'lisp/acdw.el') diff --git a/lisp/acdw.el b/lisp/acdw.el index 46079f6..63291d3 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -184,7 +184,9 @@ prefix ARG is non-nil; then it just saves them." (user-error "Buffer not attached to file")) (hack-dir-local-variables) (let ((print-level nil) - (print-length nil)) + (print-length nil) + (before-save-hook nil) + (after-save-hook nil)) (when-let ((new-words (cl-remove-if (lambda (el) (eq el '\.\.\.)) ; XXX: NO IDEA ; where this came from @@ -330,5 +332,46 @@ include the time. When called with \\[universal-argument] (fill-paragraph-function nil)) (fill-paragraph))) +(defun fill-with-double-spaced-sentences-dwim (&optional start end) + "Fill paragraph or region, double-spacing sentences." + (interactive) + (let ((sentence-end-double-space t)) + (unless (region-active-p) + (mark-paragraph)) + (repunctuate-sentences :no-query + (region-beginning) + (region-end)) + (fill-region (region-beginning) + (region-end)))) + +(defun fill-with-double-spaced-sentences-dwim (&optional start end) + "Fill from START to END, double-spacing sentences. +If START to END aren't given, or if a region isn't in use, fill +the current paragraph." + (interactive "*r") + (let ((sentence-end-double-space t)) + (save-mark-and-excursion + (save-restriction + (unless (region-active-p) + (setq start (progn (start-of-paragraph-text) + (point)) + end (progn (end-of-paragraph-text) + (point)))) + (narrow-to-region start end) + (goto-char (point-min)) + (repunctuate-sentences :no-query) + (fill-region (point-min) + (point-max)))))) + +(defun acdw-elisp-package-prepare (&optional file) + "Do all the elisp-package-preparing stuff on FILE. +If FILE is nil or not given, do it on the current buffer." + (with-current-buffer (if file (find-file-noselect file) (current-buffer)) + (check-parens) + (checkdoc) + (package-lint-buffer) + ;; TODO: use `lm-commentary' to write to README.org + )) + (provide 'acdw) ;;; acdw.el ends here -- cgit 1.4.1-21-gabe81