Bug 364030 - String delimiters option not obeyed
Summary: String delimiters option not obeyed
Status: RESOLVED FIXED
Alias: None
Product: KBibTeX
Classification: Applications
Component: Loading/saving files (show other bugs)
Version: 0.6
Platform: Gentoo Packages Linux
: NOR critical
Target Milestone: ---
Assignee: Thomas Fischer
URL: http://mirrors.ctan.org/info/bibtex/t...
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-06 16:46 UTC by Fred Labrosse
Modified: 2016-08-11 19:35 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fred Labrosse 2016-06-06 16:46:36 UTC
It used to be the case that I could set string delimiters to be quotes rather than curly braces.  In fact, there is an option for that on the file settings panel (why this is not accessible from the settings menu is a mystery to me).  However, even if I set that to be "...", the delimiters of my file are changed to {...}.

Reproducible: Always

Steps to Reproduce:
1. Open a file where string delimiters are quotes.
2. Check the option is set to be quotes.
3. Save the file.

Actual Results:  
The delimiters are now brackets.

Expected Results:  
The delimiters should be quotes.

In general, an application that opens a text file and saves it differently without the user having done anything to the file is a bad idea.  I consider this as similar to losing data.  Indeed, this implies that change tracking (such as svn) will create a complete new file, when in fact the data is the same.

This used to work.

Linked to that, other options on the panel are not remembered.  For example, I have un-ticked the protect casing option (I do that myself if needed) and it comes back the next time I open kbibtex.
Comment 1 Thomas Fischer 2016-06-12 11:37:12 UTC
> This used to work.
Handling of quotation marks was broken in special cases, and as such curly brackets got enforced.

The problem is due the fact that KBibTeX could not handle cases where the user's text (title, author, ...) contained quotation marks. For example, a title like 'A "B" C' would have been written as
title = "A "B" C"
which is invalid. To avoid such problems, curly brackets got enforced when writing .bib files.

As of commit 81f383f0eab238e, currently only available on my private repository [1] in branch bugs/kde364030, KBibTeX will try to detect those problems and will write the title as follows:
title = "A {"}B{"} C".

This is the supposed behaviour as of described in "Tame the BeaST" (p. 20) [2].

Please test the commit referred to above to confirm if the problem is fixed for you.

> Linked to that, other options on the panel are not remembered.
> For example, I have un-ticked the protect casing option (I do that
> myself if needed) and it comes back the next time I open kbibtex.
That is a different problem I am going to investigate next.

[1] https://quickgit.kde.org/?p=clones%2Fkbibtex%2Fthomasfischer%2Fkbibtex.git
[2] http://mirrors.ctan.org/info/bibtex/tamethebeast/ttb_en.pdf
Comment 2 Thomas Fischer 2016-06-12 12:59:33 UTC
(In reply to Thomas Fischer from comment #1)
> > Linked to that, other options on the panel are not remembered.
> > For example, I have un-ticked the protect casing option (I do that
> > myself if needed) and it comes back the next time I open kbibtex.
> That is a different problem I am going to investigate next.
The 'protect titles' has been changed to be tri-state. Please check commit 256199b1bf7021c558a9e:
http://commits.kde.org/clones/kbibtex/thomasfischer/kbibtex/256199b1bf7021c558a9e2fa3e5b623e1f9da72d
Comment 3 Fred Labrosse 2016-06-16 08:06:03 UTC
(In reply to Thomas Fischer from comment #1)
> > This used to work.
> Handling of quotation marks was broken in special cases, and as such curly
> brackets got enforced.
> 
> The problem is due the fact that KBibTeX could not handle cases where the
> user's text (title, author, ...) contained quotation marks. For example, a
> title like 'A "B" C' would have been written as
> title = "A "B" C"
> which is invalid. To avoid such problems, curly brackets got enforced when
> writing .bib files.
> 
> As of commit 81f383f0eab238e, currently only available on my private
> repository [1] in branch bugs/kde364030, KBibTeX will try to detect those
> problems and will write the title as follows:
> title = "A {"}B{"} C".
> 
> This is the supposed behaviour as of described in "Tame the BeaST" (p. 20)
> [2].
> 
> Please test the commit referred to above to confirm if the problem is fixed
> for you.
> 
> > Linked to that, other options on the panel are not remembered.
> > For example, I have un-ticked the protect casing option (I do that
> > myself if needed) and it comes back the next time I open kbibtex.
> That is a different problem I am going to investigate next.
> 
> [1]
> https://quickgit.kde.org/?p=clones%2Fkbibtex%2Fthomasfischer%2Fkbibtex.git
> [2] http://mirrors.ctan.org/info/bibtex/tamethebeast/ttb_en.pdf

I can't see that commit at the given URL so I can't check.

Thanks for looking into it.
Comment 4 Fred Labrosse 2016-06-16 08:09:04 UTC
(In reply to Thomas Fischer from comment #2)
> (In reply to Thomas Fischer from comment #1)
> > > Linked to that, other options on the panel are not remembered.
> > > For example, I have un-ticked the protect casing option (I do that
> > > myself if needed) and it comes back the next time I open kbibtex.
> > That is a different problem I am going to investigate next.
> The 'protect titles' has been changed to be tri-state. Please check commit
> 256199b1bf7021c558a9e:
> http://commits.kde.org/clones/kbibtex/thomasfischer/kbibtex/
> 256199b1bf7021c558a9e2fa3e5b623e1f9da72d

I have just installed that.  I can confirm the tri-state nature of the switch.  However, its status is not saved.  If I save the file with it checked (not my usual use) or half-checked (not sure this is how this state is called), save, reopen, then it is not checked.
Comment 5 Thomas Fischer 2016-06-24 20:08:01 UTC
> I have just installed that.  I can confirm the tri-state nature of the
> switch.  However, its status is not saved.  If I save the file with it
> checked (not my usual use) or half-checked (not sure this is how this state
> is called), save, reopen, then it is not checked.
Please try the lastest commit (0eed6a077cbb7cb05ebf9aa1c3766c887f0241ad) if the situation has improved.
Comment 6 Fred Labrosse 2016-06-27 10:08:09 UTC
This one seems to work, and the strings are properly delimited.  Thanks.
Comment 7 Thomas Fischer 2016-08-11 19:35:26 UTC
Closing bug...