Add +org-unsmartify

This commit is contained in:
Case Duckworth 2022-04-02 13:54:19 -05:00
parent 2876e85cf6
commit 2e488c508f
1 changed files with 14 additions and 0 deletions

View File

@ -568,5 +568,19 @@ and POST-PROCESS are passed to `org-export-to-file'."
(interactive)
(+org-export-clip-to-html nil :subtree))
;;; Unsmartify quotes and dashes and stuff.
(defun +org-unsmartify ()
"Replace \"smart\" punctuation with their \"dumb\" counterparts."
(interactive)
(save-excursion
(goto-char (point-min))
(while (re-search-forward "[“”‘’–—]" nil t)
(let ((replace (pcase (match-string 0)
((or "" "") "\"")
((or "" "") "'")
("" "--")
("" "---"))))
(replace-match replace nil nil)))))
(provide '+org)
;;; +org.el ends here