Function: reftex-bibtex-selection-callback

reftex-bibtex-selection-callback is a byte-compiled function defined in reftex-cite.el.gz.

Signature

(reftex-bibtex-selection-callback DATA IGNORE NO-REVISIT)

Documentation

Callback function to be called from the BibTeX selection, in order to display context. This function is relatively slow and not recommended for follow mode. It works OK for individual lookups.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/reftex-cite.el.gz
(defun reftex-bibtex-selection-callback (data _ignore no-revisit)
  "Callback function to be called from the BibTeX selection, in
order to display context.  This function is relatively slow and not
recommended for follow mode.  It works OK for individual lookups."
  (let ((win (selected-window))
        (key (reftex-get-bib-field "&key" data))
        bibfile-list item bibtype)

    (catch 'exit
      (with-current-buffer reftex-call-back-to-this-buffer
        (setq bibtype (reftex-bib-or-thebib))
        (cond
         ((eq bibtype 'bib)
;        ((assq 'bib (symbol-value reftex-docstruct-symbol))
          (setq bibfile-list (reftex-get-bibfile-list)))
         ((eq bibtype 'thebib)
;        ((assq 'thebib (symbol-value reftex-docstruct-symbol))
          (setq bibfile-list
                (reftex-uniquify
                 (mapcar #'cdr
                         (reftex-all-assq
                          'thebib (symbol-value reftex-docstruct-symbol))))
                item t))
         (reftex-default-bibliography
          (setq bibfile-list (reftex-default-bibliography)))
         (t (ding) (throw 'exit nil))))

      (when no-revisit
        (setq bibfile-list (reftex-visited-files bibfile-list)))

      (condition-case nil
          (reftex-pop-to-bibtex-entry
           key bibfile-list (not reftex-keep-temporary-buffers) t item)
        (error (ding))))

    (select-window win)))