Skip to main content
2 of 5
added 407 characters in body
scribe
  • 1.1k
  • 7
  • 17

Does Emacs have a builtin way to fix curly quotes' orientation?

I am working on a package that makes an API call and gets strings with improperly oriented curly quotes, e. g.,

The word ’syneresis’ comes from Greek roots meaning ’take’ and ’together’.

Is there a clean builtin way (function I could call) to fix issues like this?

Edit: Example:

(fix-quotes "’syneresis’ comes from Greek roots meaning ’take’")
    => ‘syneresis’ comes from Greek roots meaning ‘take’

Which looks like this:

‘syneresis’ comes from Greek roots meaning ‘take’

See here for curly quotes reference. Note that in the original string we only had ending quotes.

scribe
  • 1.1k
  • 7
  • 17