diff options
| author | Roland Winkler | 2009-02-20 04:19:57 +0000 |
|---|---|---|
| committer | Roland Winkler | 2009-02-20 04:19:57 +0000 |
| commit | 6801feefec23eae48103fe3d675e6dbff9fd6f77 (patch) | |
| tree | 976117536b2c1e3eaedf6696adc0fca2e061fb8b | |
| parent | c31ee0038d78e1e23707c1f06282dbfe21c56f59 (diff) | |
| download | emacs-6801feefec23eae48103fe3d675e6dbff9fd6f77.tar.gz emacs-6801feefec23eae48103fe3d675e6dbff9fd6f77.zip | |
(bibtex-autokey-titleword-ignore): Fix regexp. bug#2385.
(bibtex-autokey-get-title): Observe case for
bibtex-autokey-titleword-ignore.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/textmodes/bibtex.el | 18 |
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 @@ | |||
| 1 | 2009-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 | |||
| 1 | 2009-02-20 Chong Yidong <cyd@stupidchicken.com> | 8 | 2009-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. |
| 751 | Each item of the list is a regexp. If a word of the title matches a | 751 | Each item of the list is a regexp. If a word of the title matches a |
| 752 | regexp from that list, it is not included in the title part of the key. | 752 | regexp from that list, it is not included in the title part of the key. |
| 753 | See `bibtex-generate-autokey' for details." | 753 | Case 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)) |