Function: bibtex-parse-buffers-stealthily

bibtex-parse-buffers-stealthily is a byte-compiled function defined in bibtex.el.gz.

Signature

(bibtex-parse-buffers-stealthily)

Documentation

Parse buffer in the background during idle time.

Called by run-with-idle-timer. Whenever Emacs has been idle for bibtex-parse-keys-timeout seconds, parse all BibTeX buffers which have been modified after last parsing. Parsing initializes bibtex-reference-keys and bibtex-strings(var)/bibtex-strings(fun).

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/bibtex.el.gz
(defun bibtex-parse-buffers-stealthily ()
  "Parse buffer in the background during idle time.
Called by `run-with-idle-timer'.  Whenever Emacs has been idle
for `bibtex-parse-keys-timeout' seconds, parse all BibTeX buffers
which have been modified after last parsing.
Parsing initializes `bibtex-reference-keys' and `bibtex-strings'."
  (save-excursion
    (let ((buffers (buffer-list))
          (strings-init (bibtex-string-files-init)))
      (while (and buffers (not (input-pending-p)))
        (set-buffer (car buffers))
        (if (and (eq major-mode 'bibtex-mode)
                 (not (eq (buffer-modified-tick)
                          bibtex-buffer-last-parsed-tick)))
            (save-restriction
              (widen)
              ;; Output no progress messages in `bibtex-parse-keys'
              ;; because when in `y-or-n-p' that can hide the question.
              (if (and (listp (bibtex-parse-keys t))
                       ;; update `bibtex-strings'
                       (listp (bibtex-parse-strings strings-init t)))

                  ;; remember that parsing was successful
                  (setq bibtex-buffer-last-parsed-tick (buffer-modified-tick)))))
        (setq buffers (cdr buffers))))))