0

After upgrading to Emacs 27, I noticed that, for any org document, C-c C-e l o now behaves on my computer as C-c C-e l p: i.e., the pdf is correctly produced, but is not displayed anymore on side window.

Even when opening the document with emacs -q, I have the same behavior, so I guess that the problem is not related to my init file. (However, all my pdfs used to be displayed in Emacs with pdf-tools and not with the standard doc-view: don't know if this may be part of the problem.)

Anyway, when I run a C-c C-e l o on a file essai.org, I have the following output in the *Messages* buffer:

Processing LaTeX file essai.tex...
PDF file produced.
Running /usr/bin/xdg-open /home/fs/Documents/essai.pdf...done

but no buffer is created and displayed within Emacs for the pdf output. I have no clue for that problem...

Thanks!

Philopolis
  • 1,094
  • 8
  • 14
  • 1
    Thank you for bringing this up, I have been experiencing exactly the same problem since updating to Emacs 27 - hopefully somebody can help us with that. – perceg Sep 10 '20 at 01:23
  • Just to know: what is your OS or Linux distro? Many of the problems or bugs I reported on Emacs Stackexchange recently were actually due to my OS (Linux Manjaro) rather than Emacs itself. Since very few Emacs 27 users seem to have this problem, I guess than once again, there might be something wrong with Manjaro (or ArchLinux) system packages... – Philopolis Sep 10 '20 at 09:56
  • 1
    I am also experiencing the same problem with emacs 27.1 running on Windows 10 build 19041.450. There is no problem viewing PDF files on emacs 26.3. – Alvin Sim Sep 11 '20 at 14:03
  • I also run Linux Manjaro, Manjaro ARM Linux 20.09. After experiencing this issue with Emacs 27 I downgraded to Emacs 26.3 from AUR repository, and C-c C-e l o opens the pdfs as it used to. So, it doesn't appear to be a Manjaro issue. – perceg Sep 11 '20 at 12:00
  • (This should have been a comment, not an answer ;)) But it may be a Manjaro-related issue as well. There may be something in Emacs 27 which is not compatible with specific Arch/Manjaro librairies. Don't know how to report that, though. – Philopolis Sep 11 '20 at 12:06
  • 1
    It's probably not an emacs issue at all: what happens when you run `usr/bin/xdg-open /home/fs/Documents/essai.pdf` from the command line? – NickD Sep 14 '20 at 19:48
  • 1
    ... and it's also a matter of expectations: apparently, some setting in emacs says "display pdfs using an external application" which is why `xdg-open` is called, but you are expecting the pdf to be opened in an emacs buffer using `docview` or perhaps `pdf-tools`. – NickD Sep 14 '20 at 19:51
  • Thanks NickD. When I run this command, this simply opens the pdf with evince. What I don't understand is: where does does this setting ("display pdfs using an external application") come from, and what is its relationship with the update to Emacs 27.1? (Given that, obviously, my init file did not change in the meanwhile.) – Philopolis Sep 15 '20 at 04:32
  • Btw, the value of `org-file-apps` is still the default value: `((auto-mode . emacs) ("\\.mm\\'" . default) ("\\.x?html?\\'" . default) ("\\.pdf\\'" . default))`. Don't really understand why `xdg-open` is involved now... – Philopolis Sep 15 '20 at 08:34
  • 1
    Does this answer your question? [How to use pdf-tools (pdf-view-mode) in emacs?](https://emacs.stackexchange.com/questions/19686/how-to-use-pdf-tools-pdf-view-mode-in-emacs) – Tyler Sep 16 '20 at 03:05
  • Might or might not be the same issue. I'm not sure that `pdf-tools` is really *the* problem here, and an identical problem could happen even with good old DocView. Feedbacks of other users having confirmed the issue in this thread would be useful (but I suspect that some of them might not be `pdf-tools`-users). – Philopolis Sep 16 '20 at 09:03

1 Answers1

2

A solution kindly given by a member of org-mode mailing list: simply add

(push '("\\.pdf\\'" . emacs) org-file-apps)

in the .emacs file.

This works for me.

Philopolis
  • 1,094
  • 8
  • 14
  • Unfortunately, this is not working for me. In the *Messages* buffer, I see this message 'Conversion utility "rungs" not available for pdf'. Is this solution OS-specific? I am on Windows 10. – Alvin Sim Sep 16 '20 at 13:04
  • 1
    Ignore my comment. It was something in my emacs config that prevented it to open PDF files with this solution. It is working now. – Alvin Sim Sep 16 '20 at 13:52
  • Good to know! Just a question: do you use `pdf-tools` to display your pdfs, or just the standard DocView? (See @Tyler comment above.) – Philopolis Sep 16 '20 at 14:37
  • I believe I am using DocView. I was getting DocView specific errors when I opened PDF files in emacs-27.1. – Alvin Sim Sep 18 '20 at 11:45