Variable: bibtex-maintain-sorted-entries

bibtex-maintain-sorted-entries is a customizable variable defined in bibtex.el.gz.

Value

nil

Documentation

If non-nil, BibTeX mode maintains all entries in sorted order.

Allowed non-nil values are:
plain or t Sort entries alphabetically by keys.
crossref Sort entries alphabetically by keys unless an entry has a
             crossref field. These crossrefed entries are placed in
             alphabetical order immediately preceding the main entry.
entry-class The entries are divided into classes according to their
             entry type, see bibtex-sort-entry-class. Within each class
             sort entries alphabetically by keys.
(INDEX-FUN PREDICATE)
(INDEX-FUN PREDICATE INIT-FUN) Sort entries using INDEX-FUN and PREDICATE.
             Function INDEX-FUN is called for each entry with point at the
             end of the head of the entry. Its return values are used to
             sort the entries using PREDICATE. Function PREDICATE takes two
             arguments INDEX1 and INDEX2 as returned by INDEX-FUN.
             It should return non-nil if INDEX1 should sort before INDEX2.
             If INIT-FUN is non-nil, it should be a function that is called
             with no arguments to initialize the sorting.
See also bibtex-sort-ignore-string-entries.

This variable was added, or its default value changed, in Emacs 28.1.

Probably introduced at or before Emacs version 22.1.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/bibtex.el.gz
(defcustom bibtex-maintain-sorted-entries nil
  "If non-nil, BibTeX mode maintains all entries in sorted order.
Allowed non-nil values are:
plain or t   Sort entries alphabetically by keys.
crossref     Sort entries alphabetically by keys unless an entry has a
             crossref field.  These crossrefed entries are placed in
             alphabetical order immediately preceding the main entry.
entry-class  The entries are divided into classes according to their
             entry type, see `bibtex-sort-entry-class'.  Within each class
             sort entries alphabetically by keys.
(INDEX-FUN PREDICATE)
(INDEX-FUN PREDICATE INIT-FUN)  Sort entries using INDEX-FUN and PREDICATE.
             Function INDEX-FUN is called for each entry with point at the
             end of the head of the entry.  Its return values are used to
             sort the entries using PREDICATE.  Function PREDICATE takes two
             arguments INDEX1 and INDEX2 as returned by INDEX-FUN.
             It should return non-nil if INDEX1 should sort before INDEX2.
             If INIT-FUN is non-nil, it should be a function that is called
             with no arguments to initialize the sorting.
See also `bibtex-sort-ignore-string-entries'."
  :group 'bibtex
  :version "28.1"
  :type '(choice (const nil)
                 (const t)
                 (const plain)
                 (const crossref)
                 (const entry-class)
                 (group :tag "Custom scheme"
                        (function :tag "Index-Fun")
                        (function :tag "Predicate")
                        (option (function :tag "Init-Fun"))))
  :safe (lambda (a) (memq a '(nil t plain crossref entry-class))))