Function: org-export-activate-smart-quotes

org-export-activate-smart-quotes is a byte-compiled function defined in ox.el.gz.

Signature

(org-export-activate-smart-quotes S ENCODING INFO &optional ORIGINAL)

Documentation

Replace regular quotes with "smart" quotes in string S.

ENCODING is a symbol among :html, :latex, :texinfo and
:utf-8. INFO is a plist used as a communication channel.

The function has to retrieve information about string surroundings in parse tree. It can only happen with an unmodified string. Thus, if S has already been through another process, a non-nil ORIGINAL optional argument will provide that original string.

Return the new string.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox.el.gz
(defun org-export-activate-smart-quotes (s encoding info &optional original)
  "Replace regular quotes with \"smart\" quotes in string S.

ENCODING is a symbol among `:html', `:latex', `:texinfo' and
`:utf-8'.  INFO is a plist used as a communication channel.

The function has to retrieve information about string
surroundings in parse tree.  It can only happen with an
unmodified string.  Thus, if S has already been through another
process, a non-nil ORIGINAL optional argument will provide that
original string.

Return the new string."
  (let ((quote-status
	 (copy-sequence (org-export--smart-quote-status (or original s) info))))
    (replace-regexp-in-string
     "['\"]"
     (lambda (match)
       (or (plist-get
	    (cdr (assq (pop quote-status)
		       (cdr (assoc (plist-get info :language)
				   org-export-smart-quotes-alist))))
	    encoding)
	   match))
     s nil t)))