Function: substitute-quotes

substitute-quotes is a byte-compiled function defined in help.el.gz.

Signature

(substitute-quotes STRING)

Documentation

Substitute quote characters in STRING for display.

Each grave accent ` is replaced by left quote, and each apostrophe ' is replaced by right quote. Which left and right quote characters to use is determined by the variable text-quoting-style(var)/text-quoting-style(fun).

View in manual

Probably introduced at or before Emacs version 29.1.

Source Code

;; Defined in /usr/src/emacs/lisp/help.el.gz
(defun substitute-quotes (string)
  "Substitute quote characters in STRING for display.
Each grave accent \\=` is replaced by left quote, and each
apostrophe \\=' is replaced by right quote.  Which left and right
quote characters to use is determined by the variable
`text-quoting-style'."
  (cond ((eq (text-quoting-style) 'curve)
         (string-replace "`" "‘"
                         (string-replace "'" "’" string)))
        ((eq (text-quoting-style) 'straight)
         (string-replace "`" "'" string))
        (t string)))