Function: bibtex-count-entries

bibtex-count-entries is an interactive and byte-compiled function defined in bibtex.el.gz.

Signature

(bibtex-count-entries &optional COUNT-STRING-ENTRIES)

Documentation

Count number of entries in current buffer or region.

With prefix argument COUNT-STRING-ENTRIES count all entries, otherwise count all entries except @String entries. If mark is active count entries in region, if not in whole buffer.

Probably introduced at or before Emacs version 20.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/bibtex.el.gz
(defun bibtex-count-entries (&optional count-string-entries)
  "Count number of entries in current buffer or region.
With prefix argument COUNT-STRING-ENTRIES count all entries,
otherwise count all entries except @String entries.
If mark is active count entries in region, if not in whole buffer."
  (interactive "P")
  (let ((number 0)
        (bibtex-sort-ignore-string-entries (not count-string-entries)))
    (save-restriction
      (if mark-active (narrow-to-region (region-beginning) (region-end)))
      (bibtex-map-entries (lambda (_key _beg _end) (setq number (1+ number)))))
    (message "%s contains %d entries."
             (if mark-active "Region" "Buffer")
             number)))