emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BibTeX-mode: Key generation when latin-1 characters appear in author


From: Stefan Monnier
Subject: Re: BibTeX-mode: Key generation when latin-1 characters appear in author field
Date: Wed, 06 Apr 2005 13:31:38 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> Now, press `C-c C-c' inside the entry -- Emacs suggests `blöd05:_test'
> as the key to use -- and hit RET: Emacs writes in the minibuffer `New
> inserted entry yields duplicate key'.

Does the patch below fix the problem for you?


        Stefan


--- bibtex.el   26 jan 2005 14:25:43 -0500      1.91
+++ bibtex.el   06 avr 2005 13:30:04 -0400      
@@ -1,6 +1,6 @@
 ;;; bibtex.el --- BibTeX mode for GNU Emacs
 
-;; Copyright (C) 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2004
+;; Copyright (C) 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2004, 2005
 ;;           Free Software Foundation, Inc.
 
 ;; Author: Stefan Schoef <address@hidden>
@@ -652,7 +652,7 @@
 
 (defcustom bibtex-autokey-titleword-ignore
   '("A" "An" "On" "The" "Eine?" "Der" "Die" "Das"
-    "[^A-Z].*" ".*[^A-Z0-9].*")
+    "[^[:upper:]].*" ".*[^[:upper:]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.
@@ -1063,10 +1063,10 @@
 (defconst bibtex-entry-type (concat "@" bibtex-field-name)
   "Regexp matching the type part of a BibTeX entry.")
 
-(defconst bibtex-reference-key "[][a-zA-Z0-9.:;?!`'/address@hidden|()<>&_^$-]+"
+(defconst bibtex-reference-key "[][[:alnum:].:;?!`'/address@hidden|()<>&_^$-]+"
   "Regexp matching the reference key part of a BibTeX entry.")
 
-(defconst bibtex-field-const "[][a-zA-Z0-9.:;?!`'/address@hidden|<>&_^$-]+"
+(defconst bibtex-field-const "[][[:alnum:].:;?!`'/address@hidden|<>&_^$-]+"
   "Regexp matching a BibTeX field constant.")
 
 (defconst bibtex-entry-head
@@ -2088,7 +2088,7 @@
 (defun bibtex-autokey-demangle-name (fullname)
   "Get the last part from a well-formed FULLNAME and perform abbreviations."
   (let* (case-fold-search
-         (name (cond ((string-match "\\([A-Z][^, ]*\\)[^,]*," fullname)
+         (name (cond ((string-match "\\([[:upper:]][^, ]*\\)[^,]*," fullname)
                       ;; Name is of the form "von Last, First" or
                       ;; "von Last, Jr, First"
                       ;; --> Take the first capital part before the comma
@@ -2097,7 +2097,7 @@
                       ;; Strange name: we have a comma, but nothing capital
                       ;; So we accept even lowercase names
                       (match-string 1 fullname))
-                     ((string-match "\\(\\<[a-z][^ ]* +\\)+\\([A-Z][^ ]*\\)"
+                     ((string-match "\\(\\<[[:lower:]][^ ]* 
+\\)+\\([[:upper:]][^ ]*\\)"
                                     fullname)
                       ;; name is of the form "First von Last", "von Last",
                       ;; "First von von Last", or "d'Last"
@@ -2782,7 +2782,7 @@
   (set (make-local-variable 'comment-start-skip)
        (concat (regexp-quote bibtex-comment-start) "\\>[ \t]*"))
   (set (make-local-variable 'comment-column) 0)
-  (set (make-local-variable 'defun-prompt-regexp) "^[ address@hidden \t]*")
+  (set (make-local-variable 'defun-prompt-regexp) "^[ 
address@hidden:alnum:]]+[ \t]*")
   (set (make-local-variable 'outline-regexp) "[ \t]*@")
   (set (make-local-variable 'fill-paragraph-function) 'bibtex-fill-field)
   (set (make-local-variable 'fill-prefix) (make-string (+ bibtex-entry-offset



reply via email to

[Prev in Thread] Current Thread [Next in Thread]