← Back to team overview

vm team mailing list archive

Re: [Question #130560]: supercite with vm 7.19 and "lastname, first" citation problem

 

Question #130560 on VM changed:
https://answers.launchpad.net/vm/+question/130560

Arik proposed the following answer:
I also don't have any experience with supercite, but I think I may have
found the culprit (though I did not test this, but calling the function
directly yields the expected results). Try applying this patch to
supercite.el

--- supercite.el  2010-10-21 12:31:23.000000000 -0400                                                             
+++ supercite.el  2010-10-21 12:31:23.000000000 -0400                                                             
@@ -1,4 +1,8 @@
-  (if (string-match "\\([ \t]*\\)\\([^ \t._]+\\)\\([ \t]*\\)" namestring)                                              
-      (cons (match-string 2 namestring)                                                                                
-       (sc-attribs-chop-namestring (substring namestring (match-end 3))))))                                            
+  (if (string-match "\\([ \t]*\\)\\([^ \t._]+\\),\\([ \t]*\\)" namestring)                                             
+     (let ((lastname (match-string 2 namestring)))                                                                     
+       (append (sc-attribs-chop-namestring (substring namestring (match-beginning 3)))                                 
+               (list lastname)))                                                                                       
+   (if (string-match "\\([ \t]*\\)\\([^ \t._]+\\)\\([ \t]*\\)" namestring)                                             
+       (cons (match-string 2 namestring)                                                                               
+             (sc-attribs-chop-namestring (substring namestring (match-end 3)))))))

Normal string:

~ $ (setq name "John X Doe")
John X Doe
~ $ (sc-attribs-chop-namestring name)
("John" "X" "Doe")

last first string:

~ $ (setq name "Doe, John X")
Doe, John X
~ $ (sc-attribs-chop-namestring name)
("John" "X" "Doe")
~ $ 

Thanks,
~Arik

You received this question notification because you are a member of VM
development team, which is an answer contact for VM.



References