Re: [LyX/master] Add an "Automatic" bibliography processor pref option

2017-01-14 Thread Jürgen Spitzmüller
Am Samstag, den 14.01.2017, 10:52 -0500 schrieb Richard Heck:
> Sorry, thought the change was to a BufferParam, but it's to a
> preference, isn't it?

Yes. I nevertheless bumped the prefs format meanwhile.

Jürgen

> 
> rh
> 

signature.asc
Description: This is a digitally signed message part


Re: [LyX/master] Add an "Automatic" bibliography processor pref option

2017-01-14 Thread Richard Heck
On 01/14/2017 09:44 AM, Guillaume Munch wrote:
> Le 13/01/2017 à 23:28, Richard Heck a écrit :
>>
>> Format change?
>>
>
> It does not look like it to me. 

Sorry, thought the change was to a BufferParam, but it's to a
preference, isn't it?

rh



Re: [LyX/master] Add an "Automatic" bibliography processor pref option

2017-01-14 Thread Guillaume Munch

Le 13/01/2017 à 23:28, Richard Heck a écrit :


Format change?



It does not look like it to me. However:


/// Return the actual bibtex command (lyxrc or buffer param)
-   std::string const & bibtexCommand() const;
+   std::string const bibtexCommand() const;


I saw const-value return types a few times in the code. It seems that
this was advised in certain circumstances in old C++, but this is now
discouraged (essentially because it prevents automatic move operations
and serves no good enough purpose). See for instance
.

Guillaume




Re: [LyX/master] Add an "Automatic" bibliography processor pref option

2017-01-13 Thread Richard Heck

Format change?


On 01/13/2017 01:21 PM, Juergen Spitzmueller wrote:
> commit 1eb43536da25a9617e3d471b3e24d0c4a239c21b
> Author: Juergen Spitzmueller 
> Date:   Fri Jan 13 19:18:35 2017 +0100
>
> Add an "Automatic" bibliography processor pref option
> 
> This is now set as default. It selects biber for Biblatex (with
> fall-back to first bibtex8, then bibtex, if the former is not
> installed), and bibtex for BibTeX-based engines.
> 
> With this, users do not normally need to care for the processor when
> they switch cite engines.
> ---
>  lib/doc/UserGuide.lyx  |   75 
> +---
>  src/BufferParams.cpp   |   16 +++-
>  src/BufferParams.h |2 +-
>  src/LyXRC.cpp  |2 +-
>  src/frontends/qt4/GuiPrefs.cpp |1 +
>  5 files changed, 79 insertions(+), 17 deletions(-)
>
> diff --git a/lib/doc/UserGuide.lyx b/lib/doc/UserGuide.lyx
> index 0a4d137..9774567 100644
> --- a/lib/doc/UserGuide.lyx
> +++ b/lib/doc/UserGuide.lyx
> @@ -1,5 +1,5 @@
>  #LyX 2.3 created this file. For more info see http://www.lyx.org/
> -\lyxformat 528
> +\lyxformat 530
>  \begin_document
>  \begin_header
>  \save_transient_properties true
> @@ -29322,7 +29322,7 @@ bibtex8 allows all characters that are possible to 
> encode in an 8-bit encoding
>  bibtex
>  \family default
>  , works with all bibliography packages
> -\change_inserted -712698321 1483887200
> +\change_inserted -712698321 1484330876
>  , although more complex 
>  \family sans
>  Biblatex
> @@ -29336,16 +29336,57 @@ Biblatex
>  
>  \begin_layout Standard
>  
> -\change_inserted -712698321 1483887384
> -In addition to these, you can set a specific processor for Japanese documents
> - in 
> +\change_inserted -712698321 1484331301
> +By default (with 
> +\begin_inset Quotes eld
> +\end_inset
> +
> +Default
> +\begin_inset Quotes erd
> +\end_inset
> +
> + bibliography processor set in 
> +\family sans
> +Document\SpecialChar menuseparator
> +Settings\SpecialChar menuseparator
> +Bibliography
> +\family default
> + and 
> +\begin_inset Quotes eld
> +\end_inset
> +
> +Automatic
> +\begin_inset Quotes erd
> +\end_inset
> +
> + bibliography processor in 
>  \family sans
>  Tools\SpecialChar menuseparator
>  Preferences\SpecialChar menuseparator
>  Output\SpecialChar menuseparator
>  LaTeX
>  \family default
> -.
> +), \SpecialChar LyX
> + selects the most appropriate (available) processor for the current bibliogra
> +phy approach (
> +\family sans
> +biber
> +\family default
> + for Biblatex, 
> +\family sans
> +bibtex
> +\family default
> + for Bib\SpecialChar TeX
> +-based bibliography styles).
> + This should suit most needs.
> +\change_unchanged
> +
> +\end_layout
> +
> +\begin_layout Standard
> +
> +\change_inserted -712698321 1484331395
> +In Japanese documents, a specific processor is used.
>   By default, this is 
>  \family sans
>  pbibtex
> @@ -29355,11 +29396,14 @@ pbibtex
>  bibtex
>  \family default
>   variant specifically aimed at Japanese.
> - It is automatically used, instead of 
> + You can adjust it in 
>  \family sans
> -bibtex
> +Tools\SpecialChar menuseparator
> +Preferences\SpecialChar menuseparator
> +Output\SpecialChar menuseparator
> +LaTeX
>  \family default
> -, in Japanese documents.
> +.
>  \change_unchanged
>  
>  \end_layout
> @@ -29369,11 +29413,16 @@ bibtex
>  \change_deleted -712698321 1483886683
>  Bib\SpecialChar TeX
>  
> -\change_inserted -712698321 1483887395
> -The selected processor
> +\change_inserted -712698321 1484331419
> +Selected bibliography processors
>  \change_unchanged
> - can be controlled with options that you can add below the specification
> - of the variants.
> + can be controlled with options that you can add below the 
> +\change_deleted -712698321 1484331437
> +specification of the variants
> +\change_inserted -712698321 1484331439
> +selection
> +\change_unchanged
> +.
>   Before adding options, it is strongly recommended that you read the manual
>   
>  \change_inserted -712698321 1483886810
> diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
> index f6e7f50..46baa3b 100644
> --- a/src/BufferParams.cpp
> +++ b/src/BufferParams.cpp
> @@ -3355,14 +3355,26 @@ vector BufferParams::citeStyles() const
>  }
>  
>  
> -string const & BufferParams::bibtexCommand() const
> +string const BufferParams::bibtexCommand() const
>  {
> + // Return document-specific setting if available
>   if (bibtex_command != "default")
>   return bibtex_command;
> + // For Japanese, return the specific program
>   else if (encoding().package() == Encoding::japanese)
>   return lyxrc.jbibtex_command;
> - else
> + // Else return the processor set in prefs
> + else if (lyxrc.bibtex_command != "automatic")
>   return lyxrc.bibtex_command;
> + // Automatic means: find the most suitable for the current cite 
> framework
> + if (useBiblatex()) {
>