aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/textmodes/bibtex.el18
2 files changed, 16 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index dbcde9f2078..8c5303410ca 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12009-02-20 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
2
3 * textmodes/bibtex.el (bibtex-autokey-titleword-ignore): Fix
4 regexp (Bug#2385).
5 (bibtex-autokey-get-title): Observe case for
6 bibtex-autokey-titleword-ignore.
7
12009-02-20 Chong Yidong <cyd@stupidchicken.com> 82009-02-20 Chong Yidong <cyd@stupidchicken.com>
2 9
3 * server.el (server-start): Make the warning more 10 * server.el (server-start): Make the warning more
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index ebe17d7e809..edc4b6562b4 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -746,11 +746,11 @@ See `bibtex-generate-autokey' for details."
746 746
747(defcustom bibtex-autokey-titleword-ignore 747(defcustom bibtex-autokey-titleword-ignore
748 '("A" "An" "On" "The" "Eine?" "Der" "Die" "Das" 748 '("A" "An" "On" "The" "Eine?" "Der" "Die" "Das"
749 "[^[:upper:]].*" ".*[^[:upper:]0-9].*") 749 "[^[:upper:]].*" ".*[^[:upper:][:lower:]0-9].*")
750 "Determines words from the title that are not to be used in the key. 750 "Determines words from the title that are not to be used in the key.
751Each item of the list is a regexp. If a word of the title matches a 751Each item of the list is a regexp. If a word of the title matches a
752regexp from that list, it is not included in the title part of the key. 752regexp from that list, it is not included in the title part of the key.
753See `bibtex-generate-autokey' for details." 753Case is significant. See `bibtex-generate-autokey' for details."
754 :group 'bibtex-autokey 754 :group 'bibtex-autokey
755 :type '(repeat regexp)) 755 :type '(repeat regexp))
756 756
@@ -2307,6 +2307,10 @@ Return the result as a string"
2307 ;; gather words from titlestring into a list. Ignore 2307 ;; gather words from titlestring into a list. Ignore
2308 ;; specific words and use only a specific amount of words. 2308 ;; specific words and use only a specific amount of words.
2309 (let ((counter 0) 2309 (let ((counter 0)
2310 (ignore-re (concat "\\`\\(?:"
2311 (mapconcat 'identity
2312 bibtex-autokey-titleword-ignore "\\|")
2313 "\\)\\'"))
2310 titlewords titlewords-extra word) 2314 titlewords titlewords-extra word)
2311 (while (and (or (not (numberp bibtex-autokey-titlewords)) 2315 (while (and (or (not (numberp bibtex-autokey-titlewords))
2312 (< counter (+ bibtex-autokey-titlewords 2316 (< counter (+ bibtex-autokey-titlewords
@@ -2315,13 +2319,9 @@ Return the result as a string"
2315 (setq word (match-string 0 titlestring) 2319 (setq word (match-string 0 titlestring)
2316 titlestring (substring titlestring (match-end 0))) 2320 titlestring (substring titlestring (match-end 0)))
2317 ;; Ignore words matched by one of the elements of 2321 ;; Ignore words matched by one of the elements of
2318 ;; `bibtex-autokey-titleword-ignore' 2322 ;; `bibtex-autokey-titleword-ignore'. Case is significant.
2319 (unless (let ((lst bibtex-autokey-titleword-ignore)) 2323 (unless (let (case-fold-search)
2320 (while (and lst 2324 (string-match ignore-re word))
2321 (not (string-match (concat "\\`\\(?:" (car lst)
2322 "\\)\\'") word)))
2323 (setq lst (cdr lst)))
2324 lst)
2325 (setq counter (1+ counter)) 2325 (setq counter (1+ counter))
2326 (if (or (not (numberp bibtex-autokey-titlewords)) 2326 (if (or (not (numberp bibtex-autokey-titlewords))
2327 (<= counter bibtex-autokey-titlewords)) 2327 (<= counter bibtex-autokey-titlewords))