emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: org-bibtex-read strips too many braces (8.3.4-39-ge0acd8-elpaplus)
@ 2016-04-19  9:35 timor
  2016-04-19 19:28 ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: timor @ 2016-04-19  9:35 UTC (permalink / raw)
  To: emacs-orgmode

When using org-bibtex-read-buffer, I noticed that the following title
field in a bibtex entry:

...
{{MASTER}: {A} {Multicore} {Cache} {Energy}-{Saving}
                  {Technique} {Using} {Dynamic} {Cache}
                  {Reconfiguration}}
...

is read in as

"MASTER}: {A} {Multicore} {Cache} {Energy}-{Saving}
                  {Technique} {Using} {Dynamic} {Cache}
                  {Reconfiguration"

I believe this is due to the duplicate '(123 . 125) element in org-bibtex-read
(org-bibtex.el:634), and was supposed to clean up fields that were
formatted like this:

{{Unnecessary Braces in Title.}}

I do think, however, that the correct behavior would be to only strip
the outer pair of braces.

regards,
timor


Emacs  : GNU Emacs 24.5.1 (i686-pc-mingw32)
 of 2015-04-11 on LEG570
Package: Org-mode version 8.3.4 (8.3.4-39-ge0acd8-elpaplus @
<removed>/AppData/Roaming/.emacs.d/elpa/org-plus-contrib-20160418/)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug: org-bibtex-read strips too many braces (8.3.4-39-ge0acd8-elpaplus)
  2016-04-19  9:35 Bug: org-bibtex-read strips too many braces (8.3.4-39-ge0acd8-elpaplus) timor
@ 2016-04-19 19:28 ` Nicolas Goaziou
  2016-04-19 20:43   ` timor
       [not found]   ` <8bc728b4a52f486ba02cb5cec495a91f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
  0 siblings, 2 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2016-04-19 19:28 UTC (permalink / raw)
  To: timor; +Cc: emacs-orgmode

Hello,

timor <timor.dd@gmail.com> writes:

> When using org-bibtex-read-buffer, I noticed that the following title
> field in a bibtex entry:
>
> ...
> {{MASTER}: {A} {Multicore} {Cache} {Energy}-{Saving}
>                   {Technique} {Using} {Dynamic} {Cache}
>                   {Reconfiguration}}
> ...
>
> is read in as
>
> "MASTER}: {A} {Multicore} {Cache} {Energy}-{Saving}
>                   {Technique} {Using} {Dynamic} {Cache}
>                   {Reconfiguration"
>
> I believe this is due to the duplicate '(123 . 125) element in org-bibtex-read
> (org-bibtex.el:634), and was supposed to clean up fields that were
> formatted like this:
>
> {{Unnecessary Braces in Title.}}
>
> I do think, however, that the correct behavior would be to only strip
> the outer pair of braces.

So, do you think that returning {Unnecessary Braces in Title.} instead
of the above would be fine?

If that's the case, we could indeed remove the duplicate '(123 . 125).

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug: org-bibtex-read strips too many braces (8.3.4-39-ge0acd8-elpaplus)
  2016-04-19 19:28 ` Nicolas Goaziou
@ 2016-04-19 20:43   ` timor
  2016-04-20 21:10     ` Nicolas Goaziou
       [not found]   ` <8bc728b4a52f486ba02cb5cec495a91f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
  1 sibling, 1 reply; 6+ messages in thread
From: timor @ 2016-04-19 20:43 UTC (permalink / raw)
  To: mail; +Cc: emacs-orgmode

Hello Nicolas,

2016-04-19 21:28 GMT+02:00 Nicolas Goaziou <mail@nicolasgoaziou.fr>:
> So, do you think that returning {Unnecessary Braces in Title.} instead
> of the above would be fine?

Yes. Looking at the BibTeX Files I am dealing with, the use of inner
braces is usually justified (except for the example I gave, but it is
not org-mode's job to correct poor BibTeX, I think).  Therefore they
should be kept intact when reading the field.

> If that's the case, we could indeed remove the duplicate '(123 . 125).
Very nice.

regards,
timor

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug: org-bibtex-read strips too many braces (8.3.4-39-ge0acd8-elpaplus)
       [not found]   ` <8bc728b4a52f486ba02cb5cec495a91f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
@ 2016-04-20  7:45     ` Eric S Fraga
  2016-04-20  9:16       ` timor
  0 siblings, 1 reply; 6+ messages in thread
From: Eric S Fraga @ 2016-04-20  7:45 UTC (permalink / raw)
  To: timor; +Cc: emacs-orgmode@gnu.org, mail@nicolasgoaziou.fr

On Tuesday, 19 Apr 2016 at 20:43, timor wrote:
> Yes. Looking at the BibTeX Files I am dealing with, the use of inner
> braces is usually justified (except for the example I gave, but it is
> not org-mode's job to correct poor BibTeX, I think).  Therefore they
> should be kept intact when reading the field.

Inner braces need to be preserved as they are often there to protect
capitalisation, e.g. for TLAs and names like McDonald, but also for
compound names such as {van der Waals} which together form a single
component of a name.  So it's not just the title that needs to be
treated carefully but other entries (author, editor, booktitle).

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.90.1, Org release_8.3.3-535-g7213aa

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug: org-bibtex-read strips too many braces (8.3.4-39-ge0acd8-elpaplus)
  2016-04-20  7:45     ` Eric S Fraga
@ 2016-04-20  9:16       ` timor
  0 siblings, 0 replies; 6+ messages in thread
From: timor @ 2016-04-20  9:16 UTC (permalink / raw)
  To: Eric S Fraga, mail@nicolasgoaziou.fr, emacs-orgmode@gnu.org

2016-04-20 9:45 GMT+02:00 Eric S Fraga <e.fraga@ucl.ac.uk>:
> So it's not just the title that needs to be
> treated carefully but other entries (author, editor, booktitle).

You are correct.  The piece of code in question is actually called for
all fields, not only title.  I was using the title as an example.  So
if this is changed, it will also preserve the inner braces for all the
other fields.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug: org-bibtex-read strips too many braces (8.3.4-39-ge0acd8-elpaplus)
  2016-04-19 20:43   ` timor
@ 2016-04-20 21:10     ` Nicolas Goaziou
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2016-04-20 21:10 UTC (permalink / raw)
  To: timor; +Cc: emacs-orgmode

Hello,

timor <timor.dd@gmail.com> writes:

>> If that's the case, we could indeed remove the duplicate '(123 . 125).

> Very nice.

Done, in master branch.

There are actually no tests for org-bibtex.el. Anyone using this library
(or not!) is more than welcome to write some, BTW.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-04-20 21:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-19  9:35 Bug: org-bibtex-read strips too many braces (8.3.4-39-ge0acd8-elpaplus) timor
2016-04-19 19:28 ` Nicolas Goaziou
2016-04-19 20:43   ` timor
2016-04-20 21:10     ` Nicolas Goaziou
     [not found]   ` <8bc728b4a52f486ba02cb5cec495a91f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2016-04-20  7:45     ` Eric S Fraga
2016-04-20  9:16       ` timor

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).