Function: reftex-make-cite-echo-string

reftex-make-cite-echo-string is an autoloaded and byte-compiled function defined in reftex-cite.el.gz.

Signature

(reftex-make-cite-echo-string ENTRY DOCSTRUCT-SYMBOL)

Documentation

Format a bibtex ENTRY for the echo area and cache the result.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/reftex-cite.el.gz
;;;###autoload
(defun reftex-make-cite-echo-string (entry docstruct-symbol)
  "Format a bibtex ENTRY for the echo area and cache the result."
  (let* ((key (reftex-get-bib-field "&key" entry))
         (string
          (let* ((reftex-cite-punctuation '(" " " & " " etal.")))
            (reftex-format-citation entry reftex-cite-view-format)))
         (cache (assq 'bibview-cache (symbol-value docstruct-symbol)))
         (cache-entry (assoc key (cdr cache))))
    (unless cache
      ;; This docstruct has no cache - make one.
      (set docstruct-symbol (cons (cons 'bibview-cache nil)
                                  (symbol-value docstruct-symbol))))
    (when reftex-cache-cite-echo
      (setq key (copy-sequence key))
      (set-text-properties 0 (length key) nil key)
      (set-text-properties 0 (length string) nil string)
      (if cache-entry
          (unless (string= (cdr cache-entry) string)
            (setcdr cache-entry string)
            (put reftex-docstruct-symbol 'modified t))
        (push (cons key string) (cdr cache))
        (put reftex-docstruct-symbol 'modified t)))
    string))