Function: bibtex-autokey-abbrev

bibtex-autokey-abbrev is a byte-compiled function defined in bibtex.el.gz.

Signature

(bibtex-autokey-abbrev STRING LEN)

Documentation

Return an abbreviation of STRING with at least LEN characters.

If LEN is positive the abbreviation is terminated only after a consonant or at the word end. If LEN is negative the abbreviation is strictly enforced using abs (LEN) characters. If LEN is not a number, STRING is returned unchanged.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/bibtex.el.gz
(defun bibtex-autokey-abbrev (string len)
  "Return an abbreviation of STRING with at least LEN characters.
If LEN is positive the abbreviation is terminated only after a consonant
or at the word end.  If LEN is negative the abbreviation is strictly
enforced using abs (LEN) characters.  If LEN is not a number, STRING
is returned unchanged."
  (cond ((or (not (numberp len))
             (<= (length string) (abs len)))
         string)
        ((equal len 0)
         "")
        ((< len 0)
         (substring string 0 (abs len)))
        (t (let* ((case-fold-search t)
                  (abort-char (string-match "[^aeiou]" string (1- len))))
             (if abort-char
                 (substring string 0 (1+ abort-char))
               string)))))