Skip to content

Instantly share code, notes, and snippets.

View ckopsa's full-sized avatar
🏠
Working from home

Colton Kopsa ckopsa

🏠
Working from home
  • MG Stover
  • Utah
  • 05:29 (UTC -06:00)
View GitHub Profile
@ckopsa
ckopsa / chatgpt-spell-check.el
Last active January 4, 2024 18:57
Uses chatgpt-shell to make spelling and grammar fixes
(defun chatgpt-shell-check-and-correct-paragraph ()
"Check and correct the current paragraph using ChatGPT."
(interactive)
(let* ((bounds (bounds-of-thing-at-point 'paragraph))
(start (car bounds))
(end (cdr bounds))
(original-text (buffer-substring-no-properties start end))
(point-offset (- end (point))) ; Save the offset of point from end
(checked-text (chatgpt-shell-check-paragraph original-text)))
(when checked-text