Bug 971162

Summary: org-mode export to pdf with command 'd' does not open pdf file
Product: [Fedora] Fedora Reporter: Fredrik Nyqvist <fredrik.nyqvist94>
Component: emacsAssignee: Petr Hracek <phracek>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: fredrik.nyqvist94, jonathan.underwood, phracek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: emacs-24.3-11.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-18 00:33:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
org-file for export to pdf none

Description Fredrik Nyqvist 2013-06-05 20:55:59 UTC
Description of problem:
I want to export an .org file to .pdf with emacs org-mode. I can do this with the command C-c C-e d. This should also open the pdf file after the export is done, but it does not.

Version-Release number of selected component (if applicable):
GNU Emacs 24.2.1

How reproducible:
Always

Steps to Reproduce:
1. Create a .org file with emacs.
2. Export the file within emacs to pdf with the command C-c C-e d

Actual results:
The pdf file is generated but not automatically opened after export.

Expected results:
The pdf file should be opened in with the default pdf reader after export.

Additional info:

Comment 1 Petr Hracek 2013-06-13 13:23:12 UTC
Could you please attached any org file for testing?

I will investigate on that issue.

Thank you in advance.

Comment 2 Petr Hracek 2013-06-13 13:34:09 UTC
Well. I thought that the org file has some special format.
But it can be the random file.

By the way how did you exported PDF?
org-export-as-pdf?

Comment 3 Fredrik Nyqvist 2013-06-13 19:39:10 UTC
Created attachment 760931 [details]
org-file for export to pdf

Comment 4 Fredrik Nyqvist 2013-06-13 19:40:07 UTC
I have attached the file I was working on. I use the command:
org-export-as-pdf-and-open

which should be the same as C-c C-e d

Thanks.

Comment 5 Petr Hracek 2013-06-25 10:21:40 UTC
Hi Fredrik,

Could you please tell me whether this command on command line works?
xdg-open <your.pdf>

It should be default PDF program for emacs.

What is output of your C-c C-e d macro?

Comment 6 Fredrik Nyqvist 2013-06-25 19:04:26 UTC
Hi Petr,

Yes the command xdg-open works fine for me. The output I get (from the message buffer) is:

Exporting to PDF...
Exporting to LaTeX...
Saving file /home/fredrik/Documents/Anteckningar/Firefox/Firefox_Extentions.tex...
Wrote /home/fredrik/Documents/Anteckningar/Firefox/Firefox_Extentions.tex
Saving file /home/fredrik/Documents/Anteckningar/Firefox/Firefox_Extentions.tex...
Wrote /home/fredrik/Documents/Anteckningar/Firefox/Firefox_Extentions.tex
LaTeX export done, pushed to kill ring and clipboard
Processing LaTeX file /home/fredrik/Documents/Anteckningar/Firefox/Firefox_Extentions.tex...done
Exporting to PDF...done

is this enough or should I look for output somewhere else?

Comment 7 Petr Hracek 2013-06-26 07:05:30 UTC
Hi Fredrik,

Thank you for the buffer.
I found that in /usr/share/emacs/24.2/lisp/org/org.el{c} is declared variable like org-file-apps
This variable refers to default PDF viewer:
("\\.pdf\\'" . default)

when the default is exchanged with another PDF viewer like xpdf then generated pdf file is successfully opened in emacs window.

Comment 8 Fredrik Nyqvist 2013-06-26 21:34:39 UTC
Hi Petr,

OK, good. Thank you for the information!

Will this be changed?

Comment 9 Petr Hracek 2013-08-13 11:34:48 UTC
Well it seems as on my computer that default application is not 
setup.

I suggest to do that test:
1) get what the application is assigned to pdf
   command is: xdg-mime query filetype <full_path_to_pdf>
   Output should be:
   application/pdf
2) get application is setup as default
   command is: xdg-mime query default application/pdf
   In my system (F19) result is:
   evince.desktop

It seems like emacs does not honor xdg and I think that it is OS specific.
I have to clarify that.

Comment 10 Petr Hracek 2013-08-14 13:21:06 UTC
For Fedora case raw will be change so:
("\\.pdf\\'" . xdg-open)
which mean that default application will be taken from evince.

Comment 11 Fedora Update System 2013-08-15 06:44:39 UTC
emacs-24.3-11.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/emacs-24.3-11.fc19

Comment 12 Petr Hracek 2013-08-15 06:48:18 UTC
scm-commit rawhide (https://lists.fedoraproject.org/pipermail/scm-commits/Week-of-Mon-20130812/1092351.html)
scm-commit f19 (https://lists.fedoraproject.org/pipermail/scm-commits/Week-of-Mon-20130812/1092357.html) -> MODIFIED

Steps how to validate that fix are above.

Comment 13 Fredrik Nyqvist 2013-08-15 15:37:57 UTC
Thank you for the fix I will test this when I get back my Fedora computer.

Comment 14 Fedora Update System 2013-08-15 23:27:13 UTC
Package emacs-24.3-11.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing emacs-24.3-11.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-14826/emacs-24.3-11.fc19
then log in and leave karma (feedback).

Comment 15 Fedora Update System 2013-08-18 00:33:19 UTC
emacs-24.3-11.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 16 Fredrik Nyqvist 2013-08-18 17:43:45 UTC
Hi, when I try to do this in Fedora 19 KDE version the PDF opens but inside of Emacs and not in Okular which is set as the default PDF reader.