summary refs log tree commit diff stats
path: root/lisp/acdw.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/acdw.el')
-rw-r--r--lisp/acdw.el45
1 files changed, 44 insertions, 1 deletions
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."
184 (user-error "Buffer not attached to file")) 184 (user-error "Buffer not attached to file"))
185 (hack-dir-local-variables) 185 (hack-dir-local-variables)
186 (let ((print-level nil) 186 (let ((print-level nil)
187 (print-length nil)) 187 (print-length nil)
188 (before-save-hook nil)
189 (after-save-hook nil))
188 (when-let ((new-words (cl-remove-if 190 (when-let ((new-words (cl-remove-if
189 (lambda (el) (eq el '\.\.\.)) ; XXX: NO IDEA 191 (lambda (el) (eq el '\.\.\.)) ; XXX: NO IDEA
190 ; where this came from 192 ; where this came from
@@ -330,5 +332,46 @@ include the time. When called with \\[universal-argument]
330 (fill-paragraph-function nil)) 332 (fill-paragraph-function nil))
331 (fill-paragraph))) 333 (fill-paragraph)))
332 334
335(defun fill-with-double-spaced-sentences-dwim (&optional start end)
336 "Fill paragraph or region, double-spacing sentences."
337 (interactive)
338 (let ((sentence-end-double-space t))
339 (unless (region-active-p)
340 (mark-paragraph))
341 (repunctuate-sentences :no-query
342 (region-beginning)
343 (region-end))
344 (fill-region (region-beginning)
345 (region-end))))
346
347(defun fill-with-double-spaced-sentences-dwim (&optional start end)
348 "Fill from START to END, double-spacing sentences.
349If START to END aren't given, or if a region isn't in use, fill
350the current paragraph."
351 (interactive "*r")
352 (let ((sentence-end-double-space t))
353 (save-mark-and-excursion
354 (save-restriction
355 (unless (region-active-p)
356 (setq start (progn (start-of-paragraph-text)
357 (point))
358 end (progn (end-of-paragraph-text)
359 (point))))
360 (narrow-to-region start end)
361 (goto-char (point-min))
362 (repunctuate-sentences :no-query)
363 (fill-region (point-min)
364 (point-max))))))
365
366(defun acdw-elisp-package-prepare (&optional file)
367 "Do all the elisp-package-preparing stuff on FILE.
368If FILE is nil or not given, do it on the current buffer."
369 (with-current-buffer (if file (find-file-noselect file) (current-buffer))
370 (check-parens)
371 (checkdoc)
372 (package-lint-buffer)
373 ;; TODO: use `lm-commentary' to write to README.org
374 ))
375
333(provide 'acdw) 376(provide 'acdw)
334;;; acdw.el ends here 377;;; acdw.el ends here