Function: preview--string

preview--string is a byte-compiled function defined in preview.el.

Signature

(preview--string OV USE-ICON HELPSTRING &optional CLICK1)

Documentation

Generate a string for preview overlay OV.

If USE-ICON is non-nil, then use it instead of the preview-image of OV. Pass HELPSTRING and CLICK1 to preview-make-clickable.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.2.0/preview.el
(defun preview--string (ov use-icon helpstring &optional click1)
  "Generate a string for preview overlay OV.
If USE-ICON is non-nil, then use it instead of the `preview-image' of
OV.  Pass HELPSTRING and CLICK1 to `preview-make-clickable'."
  ;; Add new lines at beginning or end of string to separate the string
  ;; only for when the overlay starts or ends on its own line.
  (concat
   (or (when (eq preview-at-point-placement 'after-string)
         (with-current-buffer (overlay-buffer ov)
           (save-excursion
             (save-restriction
               (widen)
               (goto-char (overlay-end ov))
               (when (eolp) "\n")))))
       "")
   (preview-make-clickable
    (overlay-get ov 'preview-map)
    (or use-icon (overlay-get ov 'preview-image))
    helpstring
    click1)
   (or (when (eq preview-at-point-placement 'before-string)
         (with-current-buffer (overlay-buffer ov)
           (save-excursion
             (save-restriction
               (widen)
               (goto-char (overlay-start ov))
               (when (bolp) "\n")))))
       "")))