]> git.eshelyaron.com Git - emacs.git/commitdiff
(bibtex-autokey-titleword-ignore): Fix regexp. bug#2385.
authorRoland Winkler <Roland.Winkler@physik.uni-erlangen.de>
Fri, 20 Feb 2009 04:19:57 +0000 (04:19 +0000)
committerRoland Winkler <Roland.Winkler@physik.uni-erlangen.de>
Fri, 20 Feb 2009 04:19:57 +0000 (04:19 +0000)
(bibtex-autokey-get-title): Observe case for
bibtex-autokey-titleword-ignore.

lisp/ChangeLog
lisp/textmodes/bibtex.el

index dbcde9f20788758ddc589d16e8e132acfb5b51da..8c5303410cada79b27524bcffee081607cb1235b 100644 (file)
@@ -1,3 +1,10 @@
+2009-02-20  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
+
+       * textmodes/bibtex.el (bibtex-autokey-titleword-ignore): Fix
+       regexp (Bug#2385).
+       (bibtex-autokey-get-title): Observe case for
+       bibtex-autokey-titleword-ignore.
+
 2009-02-20  Chong Yidong  <cyd@stupidchicken.com>
 
        * server.el (server-start): Make the warning more
index ebe17d7e809c5ded6c613fedd599c3cf60e98385..edc4b6562b48c39d69e47e23a62c32795000a8a3 100644 (file)
@@ -746,11 +746,11 @@ See `bibtex-generate-autokey' for details."
 
 (defcustom bibtex-autokey-titleword-ignore
   '("A" "An" "On" "The" "Eine?" "Der" "Die" "Das"
-    "[^[:upper:]].*" ".*[^[:upper:]0-9].*")
+    "[^[:upper:]].*" ".*[^[:upper:][:lower:]0-9].*")
   "Determines words from the title that are not to be used in the key.
 Each item of the list is a regexp.  If a word of the title matches a
 regexp from that list, it is not included in the title part of the key.
-See `bibtex-generate-autokey' for details."
+Case is significant.  See `bibtex-generate-autokey' for details."
   :group 'bibtex-autokey
   :type '(repeat regexp))
 
@@ -2307,6 +2307,10 @@ Return the result as a string"
     ;; gather words from titlestring into a list.  Ignore
     ;; specific words and use only a specific amount of words.
     (let ((counter 0)
+         (ignore-re (concat "\\`\\(?:"
+                             (mapconcat 'identity
+                                        bibtex-autokey-titleword-ignore "\\|")
+                             "\\)\\'"))
           titlewords titlewords-extra word)
       (while (and (or (not (numberp bibtex-autokey-titlewords))
                       (< counter (+ bibtex-autokey-titlewords
@@ -2315,13 +2319,9 @@ Return the result as a string"
         (setq word (match-string 0 titlestring)
               titlestring (substring titlestring (match-end 0)))
         ;; Ignore words matched by one of the elements of
-        ;; `bibtex-autokey-titleword-ignore'
-        (unless (let ((lst bibtex-autokey-titleword-ignore))
-                  (while (and lst
-                              (not (string-match (concat "\\`\\(?:" (car lst)
-                                                         "\\)\\'") word)))
-                    (setq lst (cdr lst)))
-                  lst)
+        ;; `bibtex-autokey-titleword-ignore'.  Case is significant.
+        (unless (let (case-fold-search)
+                 (string-match ignore-re word))
           (setq counter (1+ counter))
           (if (or (not (numberp bibtex-autokey-titlewords))
                   (<= counter bibtex-autokey-titlewords))