Add +org-unsmartify
This commit is contained in:
parent
2876e85cf6
commit
2e488c508f
14
lisp/+org.el
14
lisp/+org.el
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue