Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bug#13622: 24.3.50; doc-view: Use (and prefer) soffice as default ODF->PDF converter

4 views
Skip to first unread message

Jambunathan K

unread,
Feb 3, 2013, 2:01:47 PM2/3/13
to 13...@debbugs.gnu.org

I am attaching a patch. Please apply to trunk.

Glenn Morris

unread,
Feb 5, 2013, 3:04:13 AM2/5/13
to Jambunathan K, 13...@debbugs.gnu.org
Jambunathan K wrote:

> I am attaching a patch. Please apply to trunk.

Some explanation as to why would be nice.

> +(defcustom doc-view-odf->pdf-converter-program
> + (cond
> + ((executable-find "soffice") "soffice")
> + ((executable-find "unoconv") "unoconv"))

This could end up being nil, which would give a type mismatch with 'file.

> :type 'file

>
> +(defcustom doc-view-odf->pdf-converter-function
> + (cond
> + ((string-match "unoconv\\'" doc-view-odf->pdf-converter-program)
> + #'doc-view-odf->pdf-converter-unoconv)
> + ((string-match "soffice\\'" doc-view-odf->pdf-converter-program)
> + #'doc-view-odf->pdf-converter-soffice))
> + "Function to call to convert a ODF file into a PDF file."
> + :type '(radio
> + (function-item doc-view-odf->pdf-converter-unoconv
> + :doc "Use unoconv")
> + (function-item doc-view-odf->pdf-converter-soffice
> + :doc "Use LibreOffice")
> + function)
> + :version "24.4")

Why do you need this, as opposed to a single function which calls
-program with a customizable -program-options argument?



Jambunathan K

unread,
Feb 5, 2013, 5:53:56 AM2/5/13
to Glenn Morris, 13...@debbugs.gnu.org
Glenn Morris <r...@gnu.org> writes:

> Jambunathan K wrote:
>
>> I am attaching a patch. Please apply to trunk.
>
> Some explanation as to why would be nice.

One is likely to have LibreOffice installed rather than unoconv.
Getting unoconv on non-Linux platforms could be cumbersome.

>
>> +(defcustom doc-view-odf->pdf-converter-program
>> + (cond
>> + ((executable-find "soffice") "soffice")
>> + ((executable-find "unoconv") "unoconv"))
>
> This could end up being nil, which would give a type mismatch with 'file.
>
>> :type 'file

What would you suggest? Use `choice'?

>>
>> +(defcustom doc-view-odf->pdf-converter-function
>> + (cond
>> + ((string-match "unoconv\\'" doc-view-odf->pdf-converter-program)
>> + #'doc-view-odf->pdf-converter-unoconv)
>> + ((string-match "soffice\\'" doc-view-odf->pdf-converter-program)
>> + #'doc-view-odf->pdf-converter-soffice))
>> + "Function to call to convert a ODF file into a PDF file."
>> + :type '(radio
>> + (function-item doc-view-odf->pdf-converter-unoconv
>> + :doc "Use unoconv")
>> + (function-item doc-view-odf->pdf-converter-soffice
>> + :doc "Use LibreOffice")
>> + function)
>> + :version "24.4")
>
> Why do you need this, as opposed to a single function which calls
> -program with a customizable -program-options argument?

I am mimicing what is done for recent mupdf changes.

,----
| (defcustom doc-view-pdf->png-converter-function
| (if (executable-find doc-view-pdfdraw-program)
| #'doc-view-pdf->png-converter-mupdf
| #'doc-view-pdf->png-converter-ghostscript)
| "Function to call to convert a PDF file into a PNG file."
| :type '(radio
| (function-item doc-view-pdf->png-converter-ghostscript
| :doc "Use ghostscript")
| (function-item doc-view-pdf->png-converter-mupdf
| :doc "Use mupdf")
| function)
| :version "24.4")
`----



Jambunathan K

unread,
Feb 5, 2013, 6:50:57 AM2/5/13
to Glenn Morris, 13...@debbugs.gnu.org

Glenn

I am interested in patch sailing through in whatever form that suits
maintainers. Crux of the patch is in how soffice needs to be used.
Rest all are fillers, that a reviewer can easily workaround.

Feel free to modify the patch in a way that is acceptable to you.

Jambunathan K.



Chong Yidong

unread,
Feb 9, 2013, 12:29:31 AM2/9/13
to Tassilo Horn, 13...@debbugs.gnu.org, Jambunathan K
Hi Tassilo,

Could you please review the changes suggested by Jambunathan K (and go
ahead and apply them if you agree)? Thanks.

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13622



Tassilo Horn

unread,
Feb 9, 2013, 5:03:20 AM2/9/13
to Chong Yidong, Jambunathan K, 13622...@debbugs.gnu.org
Chong Yidong <c...@gnu.org> writes:

Hi Chong,

> Could you please review the changes suggested by Jambunathan K (and go
> ahead and apply them if you agree)? Thanks.
>
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13622

Thanks for notifying.

Oh, I didn't know soffice up to now. That's a great change as it
removes the (optional) dependency to unoconv which probably nobody has
installed anyway.

I've committed the patch with some minor modification. Thanks,
Jambunathan!

Bye,
Tassilo



0 new messages