Thread: [Ebib-users] error at startup
Brought to you by:
joostkremers
From: Abel M. <abe...@fr...> - 2007-03-18 23:29:11
|
Dear users, I'm trying ebib with emacs 21.4.1 under a NetBSD environment. `ebib.el' is in the load-path. As I load ebib I get the following message: Wrong number of arguments: #[(list-var element &optional append) "^H J\235\203 ^@ J\207 \203^X^@\302 J^HC\"\202^\^@^H JBL\207" [element list-var append] 4 1381158]\ , 4 Really I can't figure out how to work in out. Any idea? Thank you! |
From: Joost K. <joo...@fa...> - 2007-03-19 11:00:45
|
Hi, > I'm trying ebib with emacs 21.4.1 under a NetBSD environment. `ebib.el' is > in the load-path. As I load ebib I get the following message: > > Wrong number of arguments: #[(list-var element &optional append) "^H J\235\203 > ^@ J\207 > \203^X^@\302 J^HC\"\202^\^@^H JBL\207" [element list-var append] 4 1381158]\ > , 4 Mmm... that doesn't look good. ;-) > Really I can't figure out how to work in out. Any idea? Well, it seems that a fear I had is now becoming reality... I suspect the problem is with the macro add-to-listq. In Emacs 22, add-to-list allows an optional argument that XEmacs doesn't allow. I defined add-to-listq to work around this. Now it seems that Emacs 21 also doesn't know about this argument... A quick fix would be to replace the definition of add-to-listq in the source file with the following (it appears at the top of the file, directly after the license and copyright notice): (defmacro add-to-listq (listvar element &optional append fn) (if (or (featurep 'xemacs) (string< emacs-version "22")) `(add-to-list (quote ,listvar) ,element ,append) `(add-to-list (quote ,listvar) ,element ,append ,fn))) Not sure if this is the best way to test for the version of Emacs, but it should work for you. HTH -- Joost Kremers, PhD University of Cologne Institute for German Language and Literature Albertus Magnus Platz 50923 Cologne, Germany Tel. +49 221 / 4703807 |
From: Abel M. <abe...@fr...> - 2007-03-28 14:59:31
|
> Mmm... I've never come across something like this before... Didn't even > know it was possible at all in BibTeX. Sorry, I'm new to BibTeX. The file is imported from Connotea at www.connotea.org. I've load it in Emacs with bibtex-mode and did a bibtex-convert-alien without complaints so I thought the format was right. > If you have no problem with storing the different keywords in a single > keywords field, then the following code will do this: No problem at all, I replaced the code in ebib.el and it works fine. > Now, when I tested this code on the BibTeX entry you provide, I noticed > another thing: the author field in your sample entry has newlines in it. In > itself, that's not a problem, but it turns out that Ebib treats it as a > so-called "raw" field, which it shouldn't do. I tracked down the problem, > and it seems to be an inconsistency (not to say "bug"...) in Emacs. I don't > have a fix for this yet. In principle, this won't be a problem as long as > you don't toggle the field's "raw" status. It's OK for me. Thank you very much indeed! |
From: Abel M. <abe...@fr...> - 2007-03-19 13:02:16
|
Dear Joost, Thank you for your quick answer! I've replaced add-to-listq as you've suggested. Now I'm getting this answer when I load ebib: Symbol's function definition is void: defentry It doesn't look that bad #8^) but it doesn't work yet. Regards, On Mon, Mar 19, 2007 at 11:59:23AM +0100, Joost Kremers wrote: > Hi, > > > I'm trying ebib with emacs 21.4.1 under a NetBSD environment. `ebib.el' is > > in the load-path. As I load ebib I get the following message: > > > > Wrong number of arguments: #[(list-var element &optional append) "^H J\235\203 > > ^@ J\207 > > \203^X^@\302 J^HC\"\202^\^@^H JBL\207" [element list-var append] 4 1381158]\ > > , 4 > > Mmm... that doesn't look good. ;-) > > > Really I can't figure out how to work in out. Any idea? > > Well, it seems that a fear I had is now becoming reality... I suspect the > problem is with the macro add-to-listq. In Emacs 22, add-to-list allows an > optional argument that XEmacs doesn't allow. I defined add-to-listq to work > around this. Now it seems that Emacs 21 also doesn't know about this > argument... > > A quick fix would be to replace the definition of add-to-listq in the > source file with the following (it appears at the top of the file, directly > after the license and copyright notice): > > (defmacro add-to-listq (listvar element &optional append fn) > (if (or (featurep 'xemacs) > (string< emacs-version "22")) > `(add-to-list (quote ,listvar) ,element ,append) > `(add-to-list (quote ,listvar) ,element ,append ,fn))) > > Not sure if this is the best way to test for the version of Emacs, but it > should work for you. > > HTH > > -- > Joost Kremers, PhD > University of Cologne > Institute for German Language and Literature > Albertus Magnus Platz > 50923 Cologne, Germany > Tel. +49 221 / 4703807 > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Ebib-users mailing list > Ebi...@li... > https://lists.sourceforge.net/lists/listinfo/ebib-users |
From: Joost K. <joo...@fa...> - 2007-03-28 17:54:06
|
On Wed, Mar 28, 2007 at 11:59:24AM -0300, Abel Morabito wrote: > > Mmm... I've never come across something like this before... Didn't even > > know it was possible at all in BibTeX. > > Sorry, I'm new to BibTeX. The file is imported from Connotea at > www.connotea.org. I've load it in Emacs with bibtex-mode and did a > bibtex-convert-alien without complaints so I thought the format was right. i've looked into it a bit. the thing is, BibTeX ignores any fields that it doesn't know/care about. the keywords field is not normally type-set, so BibTeX just skips over it, and it doesn't care how many there are. on the other hand, if you have two title fields or something, BibTeX *does* issue a warning, and ignores the second one. i'll have to think a little bit about how i'm gonna handle this. > > Now, when I tested this code on the BibTeX entry you provide, I noticed > > another thing: the author field in your sample entry has newlines in it. In > > itself, that's not a problem, but it turns out that Ebib treats it as a > > so-called "raw" field, which it shouldn't do. I tracked down the problem, > > and it seems to be an inconsistency (not to say "bug"...) in Emacs. I don't > > have a fix for this yet. In principle, this won't be a problem as long as > > you don't toggle the field's "raw" status. > > It's OK for me. i looked at the problem a bit further, and it turns out it is certainly not a bug, or even inconsistent behaviour of emacs. i have a fix for it which i'll include in the next version. let me know if you need/want it earlier. joost -- Joost Kremers Life has its moments |
From: Joost K. <joo...@fa...> - 2007-03-19 13:14:32
|
On Mon, Mar 19, 2007 at 02:02:06PM +0100, Abel Morabito wrote: > Dear Joost, > > Thank you for your quick answer! I've replaced add-to-listq as you've > suggested. Now I'm getting this answer when I load ebib: > > Symbol's function definition is void: defentry > > It doesn't look that bad #8^) but it doesn't work yet. you still have a .ebibrc in your home directory, i suspect. since ebib 1.x this file is only used for key bindings, everything else is done through ebib's customise buffer. if you haven't edited .ebibrc at all, just delete it, all the entry type definitions are now predefined in ebib.el. if you've defined your own entry types, you're unfortunately gonna have to do them again through ebib's customisation buffer... if you have some key binding customisations in .ebibrc, keep those, and delete everything else in the file. HTH -- Joost Kremers, PhD University of Cologne Institute for German Language and Literature Albertus Magnus Platz 50923 Cologne, Germany Tel. +49 221 / 4703807 |
From: Abel M. <abe...@fr...> - 2007-03-29 21:58:34
|
Dear Joost, I'm using ebib seamlessly by now --it's a nice tool indeed. I'll pay attention to your comments and surely I'm writing you soon. Thank you again! > > i've looked into it a bit. the thing is, BibTeX ignores any fields that it > doesn't know/care about. the keywords field is not normally type-set, so > BibTeX just skips over it, and it doesn't care how many there are. > > on the other hand, if you have two title fields or something, BibTeX *does* > issue a warning, and ignores the second one. > > i'll have to think a little bit about how i'm gonna handle this. > > > > Now, when I tested this code on the BibTeX entry you provide, I noticed > > > another thing: the author field in your sample entry has newlines in it. In > > > itself, that's not a problem, but it turns out that Ebib treats it as a > > > so-called "raw" field, which it shouldn't do. I tracked down the problem, > > > and it seems to be an inconsistency (not to say "bug"...) in Emacs. I don't > > > have a fix for this yet. In principle, this won't be a problem as long as > > > you don't toggle the field's "raw" status. > > > > It's OK for me. > > i looked at the problem a bit further, and it turns out it is certainly not > a bug, or even inconsistent behaviour of emacs. i have a fix for it which > i'll include in the next version. let me know if you need/want it earlier. > > joost > > > -- > Joost Kremers > Life has its moments > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Ebib-users mailing list > Ebi...@li... > https://lists.sourceforge.net/lists/listinfo/ebib-users |
From: Abel M. <abe...@fr...> - 2007-03-19 14:25:48
|
Dear Joost, Ebib loads with no error messages now. I've deleted ".ebibrc" as you've told me. Thank you! Regards, On Mon, Mar 19, 2007 at 02:13:19PM +0100, Joost Kremers wrote: > On Mon, Mar 19, 2007 at 02:02:06PM +0100, Abel Morabito wrote: > > Dear Joost, > > > > Thank you for your quick answer! I've replaced add-to-listq as you've > > suggested. Now I'm getting this answer when I load ebib: > > > > Symbol's function definition is void: defentry > > > > It doesn't look that bad #8^) but it doesn't work yet. > > you still have a .ebibrc in your home directory, i suspect. since ebib 1.x > this file is only used for key bindings, everything else is done through > ebib's customise buffer. if you haven't edited .ebibrc at all, just delete > it, all the entry type definitions are now predefined in ebib.el. > > if you've defined your own entry types, you're unfortunately gonna have to > do them again through ebib's customisation buffer... > > if you have some key binding customisations in .ebibrc, keep those, and > delete everything else in the file. > > HTH > > -- > Joost Kremers, PhD > University of Cologne > Institute for German Language and Literature > Albertus Magnus Platz > 50923 Cologne, Germany > Tel. +49 221 / 4703807 > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Ebib-users mailing list > Ebi...@li... > https://lists.sourceforge.net/lists/listinfo/ebib-users |
From: Abel M. <abe...@fr...> - 2007-04-03 15:41:30
|
Dear Joost, I'm OK reading bib files with multiple keywords entries applying the ebib-find-bibtex-fields you've sent me. Some systems at present produce this kind of output -Connotea and Zotero at least. Certainly such files don't seem to be well formatted -as you've suggested before-. Just an idea as an ebib user, could this feature be optional in a future release? I mean having the choice of reading bib files with multiple keywords fields if necessary. What do you think? Best regards, |
From: Joost K. <joo...@fa...> - 2007-04-04 00:03:51
|
Hi Abel, > I'm OK reading bib files with multiple keywords entries applying the > ebib-find-bibtex-fields you've sent me. > > Some systems at present produce this kind of output -Connotea and Zotero at > least. Certainly such files don't seem to be well formatted -as you've > suggested before-. > > Just an idea as an ebib user, could this feature be optional in a future > release? I mean having the choice of reading bib files with multiple > keywords fields if necessary. What do you think? Right now, I'm thinking about a good way to implement it. The way I've done it in the function I sent you is to simply test for each field that is read whether it already exists. I don't really like that, because it slows down the loading of a bib file, and it is unnecessary most of the time. Even if it's a user-configurable option, the most straight-forward implementation would require a test for every field being read. So I'm trying to think of a way to implement it without causing too much extra overhead if the option is switched off. That shouldn't be impossible. -- Joost Kremers Life has its moments |
From: Joost K. <joo...@fa...> - 2007-03-19 17:10:33
|
On Mon, Mar 19, 2007 at 03:20:17PM +0100, Abel Morabito wrote: > Ebib loads with no error messages now. I've deleted ".ebibrc" as you've told > me. Thank you! Great! ;-) -- Joost Kremers Life has its moments |
From: Abel M. <abe...@fr...> - 2007-03-20 22:50:55
|
Dear Joost, I'm starting with ebib seamlessly indeed #8^) I've just byte-compiled ebib.el from emacs and it's returned the next message: ** The following functions are not known to be defined: region-active-p, make-extent, set-extent-face, set-extent-endpoints, extent-start-position, extent-end-position, detach-extent, char-to-int I hope this to be helpful in some way. Regards, |
From: Joost K. <joo...@fa...> - 2007-03-20 23:04:55
|
hi abel, > I'm starting with ebib seamlessly indeed #8^) > > I've just byte-compiled ebib.el from emacs and it's returned the next > message: > > ** The following functions are not known to be defined: > region-active-p, make-extent, set-extent-face, > set-extent-endpoints, extent-start-position, extent-end-position, > detach-extent, char-to-int these are all functions exclusive to XEmacs. GNU/Emacs indeed doesn't know about them. that's no problem, however, because they're only used when you run Ebib in XEemacs. in GNU/Emacs, equivalent functions are used. so you can safely ignore this message. -- Joost Kremers Life has its moments |
From: Abel M. <abe...@fr...> - 2007-03-21 02:10:38
|
Dear Joost, It's OK. Thank you again! On Wed, Mar 21, 2007 at 12:03:35AM +0100, Joost Kremers wrote: > hi abel, > > > I'm starting with ebib seamlessly indeed #8^) > > > > I've just byte-compiled ebib.el from emacs and it's returned the next > > message: > > > > ** The following functions are not known to be defined: > > region-active-p, make-extent, set-extent-face, > > set-extent-endpoints, extent-start-position, extent-end-position, > > detach-extent, char-to-int > > these are all functions exclusive to XEmacs. GNU/Emacs indeed doesn't know > about them. that's no problem, however, because they're only used when you > run Ebib in XEemacs. in GNU/Emacs, equivalent functions are used. so you > can safely ignore this message. > > -- > Joost Kremers > Life has its moments > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Ebib-users mailing list > Ebi...@li... > https://lists.sourceforge.net/lists/listinfo/ebib-users |
From: Abel M. <abe...@fr...> - 2007-03-28 10:17:29
|
Dear users, I'm working with an imported bib database with multiple keywords field, with entries like this: @Article{Andrew2005, author="Andrew, Pal and Tucker, Daniel and Valentine, William and Roze, St{\~A}?phane and Gabriel, Sylvie and Cordonnier, Daniel", title="Cost-effectiveness of irbesartan in diabetic nephropathy: a systematic review of published studies.", journal="Nephrology, dialysis, transplantation : official publication of the European Dialysis and Transplant Association - European Renal Association", year="2005", month="Jun", day="xx", volume="20", issue="6", pages="1103--9", keywords="irbesartan", keywords="nephropathy", keywords="diabetes", keywords="Full text", keywords="economics", keywords="PND2007", note="10.1093/ndt/gfh802", url="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=15855214&dopt=Abstract" } Ebib just reads the last keywords field, in this case PND2007, and deletes the previos ones. The same entry is now saved: @article{Andrew2005, author = "Andrew, Pal and Tucker, Daniel and Valentine, William and Roze, St{\~A}?phane and Gabriel, Sylvie and Cordonnier, Daniel", title = "Cost-effectiveness of irbesartan in diabetic nephropathy: a systematic review of published studies.", journal = "Nephrology, dialysis, transplantation : official publication of the European Dialysis and Transplant Association - European Renal Association", year = "2005", month = "Jun", day = "xx", volume = "20", issue = "6", pages = "1103--9", keywords = "PND2007", note = "10.1093/ndt/gfh802", url = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=15855214&dopt=Abstract" } It seems ebib works with keywords written in one line, for instance @article{Andrew2005, author = "Andrew, Pal and Tucker, Daniel and Valentine, William and Roze, St{\~A}?phane and Gabriel, Sylvie and Cordonnier, Daniel", title = "Cost-effectiveness of irbesartan in diabetic nephropathy: a systematic review of published studies.", journal = "Nephrology, dialysis, transplantation : official publication of the European Dialysis and Transplant Association - European Renal Association", year = "2005", month = "Jun", day = "xx", volume = "20", issue = "6", pages = "1103--9", keywords = {PND2007, ARB}, note = "10.1093/ndt/gfh802", url = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=15855214&dopt=Abstract" } How could I work this out so I can use the original bib file without editing every keywords field? Thank you! |
From: Joost K. <joo...@fa...> - 2007-03-28 12:20:11
|
Hi Abel, On Wed, Mar 28, 2007 at 07:17:20AM -0300, Abel Morabito wrote: > I'm working with an imported bib database with multiple keywords field, with > entries like this: > [...] > keywords="irbesartan", > keywords="nephropathy", > keywords="diabetes", > keywords="Full text", > keywords="economics", > keywords="PND2007", [...] Mmm... I've never come across something like this before... Didn't even know it was possible at all in BibTeX. > Ebib just reads the last keywords field, in this case PND2007, and deletes > the previos ones. Yes. Ebib stores each entry in a hash table and uses the field names as the keys. Since each key can only appear once in a hash table, each `keywords' field replaces the previous one. > It seems ebib works with keywords written in one line, for instance Yep. That would be the way to do it. It wouldn't be easy to modify Ebib to allow multiple `keywords' fields. As I said, because I use hash tables to store the entries, and hash tables don't allow it on principle, I would have to rewrite Ebib from scratch using some other storage method (which I'm not about to do. ;-) Alternatively, it would be possible to put the different keywords values in a list and store that as the value of the keywords field in the hash table. That, too, would take some time to implement, however, as it raises questions about how to display this on the screen, etc. > How could I work this out so I can use the original bib file without editing > every keywords field? If you have no problem with storing the different keywords in a single keywords field, then the following code will do this: #v+ (defun ebib-find-bibtex-fields (entry-type limit) "Finds the fields of the BibTeX entry that starts on the line POINT is on. Returns a hash table containing all the fields and values, or NIL if none were found. ENTRY-TYPE is the type of the entry, which will be recorded in the hash table. Before the search starts, POINT is moved back to the beginning of the line." (beginning-of-line) (let ((fields (make-hash-table :size 15))) (while (progn (skip-chars-forward "^," limit) ; we must move to the next comma, (eq (char-after) ?,)) ; and make sure we are really on a comma. (skip-chars-forward "\"#%'(),={} \n\t\f" limit) (let ((beg (point))) (when (looking-at-goto-end (concat "\\(" ebib-bibtex-identifier "\\)[ \t\n\f]*=") 1) (let ((field-type (intern (downcase (buffer-substring-no-properties beg (point)))))) (unless (eq field-type 'type*) ; the 'type*' key holds the entry type, so we can't use it (let ((field-contents (ebib-get-field-contents limit))) (when field-contents (let ((existing-contents (gethash field-type fields))) (if existing-contents (puthash field-type (from-raw (concat (to-raw existing-contents) "; " (to-raw field-contents))) fields) (puthash field-type field-contents fields)))))))))) (when (> (hash-table-count fields) 0) (puthash 'type* entry-type fields) fields))) #v- Replace the function ebib-find-bibtex-fields in ebib.el with this new definition, and load your .bib file again. Ebib will concatenate all the keywords fields into one keywords field, separated by a semicolon and a space. Now, when I tested this code on the BibTeX entry you provide, I noticed another thing: the author field in your sample entry has newlines in it. In itself, that's not a problem, but it turns out that Ebib treats it as a so-called "raw" field, which it shouldn't do. I tracked down the problem, and it seems to be an inconsistency (not to say "bug"...) in Emacs. I don't have a fix for this yet. In principle, this won't be a problem as long as you don't toggle the field's "raw" status. (This problem only occurs with multiline field values that are surrounded by quotes, not when they're surrounded by braces. Ebib uses braces, so the problem won't occur with multiline values created with Ebib.) -- Joost Kremers, PhD University of Cologne Institute for German Language and Literature Albertus Magnus Platz 50923 Cologne, Germany Tel. +49 221 / 4703807 |