Function: org-texinfo-plain-text

org-texinfo-plain-text is a byte-compiled function defined in ox-texinfo.el.gz.

Signature

(org-texinfo-plain-text TEXT INFO)

Documentation

Transcode a TEXT string from Org to Texinfo.

TEXT is the string to transcode. INFO is a plist holding contextual information.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-texinfo.el.gz
;;;; Plain Text

(defun org-texinfo-plain-text (text info)
  "Transcode a TEXT string from Org to Texinfo.
TEXT is the string to transcode.  INFO is a plist holding
contextual information."
  ;; First protect @, { and }.
  (let ((output (org-texinfo--sanitize-content text)))
    ;; Activate smart quotes.  Be sure to provide original TEXT string
    ;; since OUTPUT may have been modified.
    (when (plist-get info :with-smart-quotes)
      (setq output
	    (org-export-activate-smart-quotes output :texinfo info text)))
    ;; LaTeX into @LaTeX{} and TeX into @TeX{}
    (let ((case-fold-search nil))
      (setq output (replace-regexp-in-string "\\(?:La\\)?TeX" "@\\&{}" output)))
    ;; Convert special strings.
    (when (plist-get info :with-special-strings)
      (setq output
	    (replace-regexp-in-string
	     "\\.\\.\\." "@dots{}"
	     (replace-regexp-in-string "\\\\-" "@-" output))))
    ;; Handle break preservation if required.
    (when (plist-get info :preserve-breaks)
      (setq output (replace-regexp-in-string
		    "\\(\\\\\\\\\\)?[ \t]*\n" " @*\n" output)))
    ;; Reverse sentence ending.  A sentence can end with a capital
    ;; letter.  Use non-breaking space if it shouldn't.
    (let ((case-fold-search nil))
      (replace-regexp-in-string
       "[A-Z]\\([.?!]\\)\\(?:[])]\\|'\\{1,2\\}\\)?\\(?: \\|$\\)"
       "@\\1"
       output nil nil 1))))