aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1997-12-09 22:43:32 +0000
committerKarl Heuer1997-12-09 22:43:32 +0000
commit03dbb1e75ab2d6cbe46e28fb5e943d5a88a5f149 (patch)
tree3d269188e45531277c21105974a36e0e6eaf1395
parentc743cc52aba26ecfbecda269a308c9c36383fdc5 (diff)
downloademacs-03dbb1e75ab2d6cbe46e28fb5e943d5a88a5f149.tar.gz
emacs-03dbb1e75ab2d6cbe46e28fb5e943d5a88a5f149.zip
(bibtex-generate-autokey): Doc fix.
-rw-r--r--lisp/textmodes/bibtex.el137
1 files changed, 62 insertions, 75 deletions
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index 2f97b1056ea..93176bb9a89 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -1943,81 +1943,68 @@ the value of `bibtex-text-indentation', minus 2."
1943 (bibtex-autokey-get-titles titlestring))) 1943 (bibtex-autokey-get-titles titlestring)))
1944 1944
1945(defun bibtex-generate-autokey () 1945(defun bibtex-generate-autokey ()
1946 ;; Generates automatically a key from the author/editor and the 1946 "Automatically generate a key from the author/editor and the title field.
1947 ;; title field. This will only work for entries where each field 1947This will only work for entries where each field begins on a separate line.
1948 ;; begins on a separate line. 1948The generation algorithm works as follows:
1949 ;; The generation algorithm works as follows: 1949 1. Use the value of `bibtex-autokey-prefix-string' as a prefix.
1950 ;; 1. Use the value of `bibtex-autokey-prefix-string' as a prefix. 1950 2. If there is a non-empty author (preferred) or editor field,
1951 ;; 2. If there is a non-empty author (preferred) or editor field, 1951 use it as the name part of the key.
1952 ;; use it as the name part of the key. 1952 3. Change any substring found in `bibtex-autokey-name-change-strings'
1953 ;; 3. Change any substring found in 1953 to the corresponding new one (see documentation of this variable for
1954 ;; `bibtex-autokey-name-change-strings' to the corresponding new 1954 further detail).
1955 ;; one (see documentation of this variable for further detail). 1955 4. For each of at least the first `bibtex-autokey-names' names in
1956 ;; 4. For every of at least first `bibtex-autokey-names' names in 1956 the name field, determine the last name. If there are at most
1957 ;; the name field, determine the last name. If there are maximal 1957 `bibtex-autokey-names' + `bibtex-autokey-names-stretch'
1958 ;; `bibtex-autokey-names' + `bibtex-autokey-names-stretch' 1958 names, all names are used.
1959 ;; names, all names are used. 1959 5. From each last name, take at least `bibtex-autokey-name-length'
1960 ;; 5. From every last name, take at least 1960 characters (abort only after a consonant or at a word end).
1961 ;; `bibtex-autokey-name-length' characters (abort only after a 1961 6. Unless `bibtex-autokey-preserve-case' is non-nil, convert all
1962 ;; consonant or at a word end). 1962 last names to lowercase letters.
1963 ;; 6. Unless `bibtex-autokey-preserve-case' is non-nil, convert all 1963 7. Build the name part of the key by concatenating all abbreviated last
1964 ;; last names to lowercase letters. 1964 names with the string `bibtex-autokey-name-separator' between any two.
1965 ;; 7. Build the name part of the key by concatenating all 1965 If there are more names than are used in the name part, prepend the
1966 ;; abbreviated last names with the string 1966 string contained in `bibtex-autokey-additional-names'.
1967 ;; `bibtex-autokey-name-separator' between any two. If there are 1967 8. Build the year part of the key by truncating the contents of
1968 ;; more names than are used in the name part, prepend the string 1968 the year field to the rightmost `bibtex-autokey-year-length'
1969 ;; contained in `bibtex-autokey-additional-names'. 1969 digits (useful values are 2 and 4). If the year field is
1970 ;; 8. Build the year part of the key by truncating the contents of 1970 absent, but the entry has a valid crossref field and the
1971 ;; the year field to the rightmost `bibtex-autokey-year-length' 1971 variable `bibtex-autokey-year-use-crossref-entry' is non-nil,
1972 ;; digits (useful values are 2 and 4). If the year field is 1972 use the year field of the crossreferenced entry instead.
1973 ;; absent, but the entry has a valid crossref field and the 1973 9. For the title part of the key change the contents of the title field
1974 ;; variable `bibtex-autokey-year-use-crossref-entry' is non-nil, 1974 of the reference according to `bibtex-autokey-titleword-change-strings'
1975 ;; use the year field of the crossreferenced entry instead. 1975 to the corresponding new one (see documentation of this variable for
1976 ;; 9. For the title part of the key change the contents of the 1976 further detail).
1977 ;; title field of the reference according to 197710. Abbreviate the result to the string up to (but not including)
1978 ;; `bibtex-autokey-titleword-change-strings' to the 1978 the first occurrence of a regexp matched by the items of
1979 ;; corresponding new one (see documentation of this variable for 1979 `bibtex-autokey-title-terminators' and delete the first word if it
1980 ;; further detail). 1980 appears in `bibtex-autokey-titleword-first-ignore'. Use at least the
1981 ;; 10. Abbreviate the result to the string up to (but not including) 1981 first `bibtex-autokey-titlewords' capitalized words from this
1982 ;; the first occurrence of a regexp matched by the items of 1982 abbreviated title. If the abbreviated title ends after at most
1983 ;; `bibtex-autokey-title-terminators' and delete the first 1983 `bibtex-autokey-titlewords' + `bibtex-autokey-titlewords-stretch'
1984 ;; word if it appears in 1984 capitalized words, all capitalized words from the abbreviated title are
1985 ;; `bibtex-autokey-titleword-first-ignore'. Build the title part 1985 used.
1986 ;; of the key by using at least the first 198611. Unless `bibtex-autokey-preserve-case' is non-nil, convert all
1987 ;; `bibtex-autokey-titlewords' capitalized words from this 1987 used title words to lowercase letters.
1988 ;; abbreviated title. If the abbreviated title ends after 198812. For each word that appears in `bibtex-autokey-titleword-abbrevs', use
1989 ;; maximal `bibtex-autokey-titlewords' + 1989 the corresponding abbreviation (see documentation of this variable for
1990 ;; `bibtex-autokey-titlewords-stretch' capitalized words, all 1990 further detail).
1991 ;; capitalized words from the abbreviated title are used. 199113. From each title word not generated by an abbreviation, take at least
1992 ;; 11. Unless `bibtex-autokey-preserve-case' is non-nil, convert all 1992 `bibtex-autokey-titleword-length' characters (abort only after a
1993 ;; used titlewords to lowercase letters. 1993 consonant or at a word end).
1994 ;; 12. For every used title word that appears in 199414. Build the title part of the key by concatenating all abbreviated title
1995 ;; `bibtex-autokey-titleword-abbrevs' use the corresponding 1995 words with the string `bibtex-autokey-titleword-separator' between any
1996 ;; abbreviation (see documentation of this variable for further 1996 two.
1997 ;; detail). 199715. Finally, to get the key, concatenate `bibtex-autokey-prefix-string';
1998 ;; 13. From every title word not generated by an abbreviation, take 1998 the name part; `bibtex-autokey-name-year-separator' if the name and year
1999 ;; at least `bibtex-autokey-titleword-length' characters (abort 1999 are both nonempty; the year part; `bibtex-autokey-year-title-separator'
2000 ;; only after a consonant or at a word end). 2000 if the title and either name or year are nonempty; and the title part.
2001 ;; 14. Build the title part of the key by concatenating all 200116. If the value of `bibtex-autokey-before-presentation-hook' is non-nil,
2002 ;; abbreviated title words with the string 2002 it must be a function taking one argument. This function is then
2003 ;; `bibtex-autokey-titleword-separator' between any two. 2003 called with the generated key as the argument. The return value of
2004 ;; 15. At least, to get the key, concatenate 2004 this function (a string) is used as the key.
2005 ;; `bibtex-autokey-prefix-string', the name part, the year part 200517. If the value of `bibtex-autokey-edit-before-use' is non-nil,
2006 ;; and the title part with `bibtex-autokey-name-year-separator' 2006 the key is then presented in the minibuffer to the user, where
2007 ;; between the name part and the year part if both are non-empty 2007 it can be edited. The key given by the user is then used."
2008 ;; and `bibtex-autokey-year-title-separator' between the year
2009 ;; part and the title part if both are non-empty. If the year
2010 ;; part is empty, but not the other two parts,
2011 ;; `bibtex-autokey-year-title-separator' is used as well.
2012 ;; 16. If the value of `bibtex-autokey-before-presentation-hook' is
2013 ;; non-nil, it must be a function taking one argument. This
2014 ;; function is then called with the generated key as the
2015 ;; argument. The return value of this function (a string) is
2016 ;; used as the key.
2017 ;; 17. If the value of `bibtex-autokey-edit-before-use' is non-nil,
2018 ;; the key is then presented in the minibuffer to the user,
2019 ;; where it can be edited. The key given by the user is then
2020 ;; used.
2021 2008
2022 (let* ((pnt (point)) 2009 (let* ((pnt (point))
2023 (min (bibtex-beginning-of-entry)) 2010 (min (bibtex-beginning-of-entry))