From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: org-file-apps settings? Date: Fri, 16 Sep 2016 07:46:34 -0400 Message-ID: References: <87twdgdzu7.fsf@yandex.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c0bd7d4a6aa37053c9e8388 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkrbK-00032G-83 for emacs-orgmode@gnu.org; Fri, 16 Sep 2016 07:46:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkrbH-0001Um-T1 for emacs-orgmode@gnu.org; Fri, 16 Sep 2016 07:46:37 -0400 Received: from mail-io0-x231.google.com ([2607:f8b0:4001:c06::231]:35486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkrbH-0001UZ-Nc for emacs-orgmode@gnu.org; Fri, 16 Sep 2016 07:46:35 -0400 Received: by mail-io0-x231.google.com with SMTP id m186so22605260ioa.2 for ; Fri, 16 Sep 2016 04:46:35 -0700 (PDT) In-Reply-To: <87twdgdzu7.fsf@yandex.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" Cc: Org Mode --94eb2c0bd7d4a6aa37053c9e8388 Content-Type: text/plain; charset=UTF-8 Huh. I am not really able to figure this out. I imagine that part of the problem may be that org tries to use mailcap as a method, and I don't have any mailcap files. So I attempted this, which does not work: '((system . "/usr/bin/xdg-open %s") (auto-mode . emacs) ("\\.odt\\'" . system) ("\\.mm\\'" . default) ("\\.x?html?\\'" . default) ("\\.pdf\\'" . default) ) *Messages* reports that xdg-open has been run, but the file doesn't actually run. seting the odt entry to "/usr/bin/libreoffice %s" doesn't seem to have any effect at all -- the file just opens in emacs. The only thing that works for now is this bizarre workaround: '((system . "/usr/bin/libreoffice %s") (auto-mode . emacs) ("odt" . system) ("\\.odt\\'" . "system") ("\\.mm\\'" . default) ("\\.x?html?\\'" . default) ("\\.pdf\\'" . default)) I don't undertand why this would work while the others don't. Of course, this is a pretty lousy workaround since now everything opens in libreoffice by default! On Fri, Sep 16, 2016 at 4:16 AM, Colin Baxter wrote: > On Thu, Sep 15 2016, Matt Price wrote: > > > hi Everyone, > > I have been through this a million times, but I never seem to remember, > and have a hard time finding > > the answer online or in my archives. > > > > On a Linux system, how should I set org-file-apps to allow org to open > odt files in libreoffice, html files > > in Firefox, and pdf files in evince (especially in export-and-open > commands)? > > > > I have tried a couple of htings; this is what C-h v org-file-apps > currently says: > > > > Its value is ((remote . emacs) (system . mailcap) (t . mailcap)) > > Original value was > > ((auto-mode . emacs) > > ("\\.mm\\'" . default) > > ("\\.x?html?\\'" . default) > > ("\\.pdf\\'" . default)) > > > > There's no /etc/mailcap on my mahcine (?), and .mailcap reads: > > > > */*; xdg-open "%s" > > > > Running `xdg-open file.odt` from a terminal will open the file in > libreoffice, but exporting to odt and > > opening with C-c C-e o O opens the file in emacs. What should I try > next? Thank you! > > m > > Hi Matt, > > I can't stand evince so I've explicitly modified the default for pdf > files to open xpdf. It could also be used to make open-office files use the > application you want: > > (add-hook 'org-mode-hook > '(lambda () > (delete '("\\.pdf\\'" . default) org-file-apps) > (add-to-list 'org-file-apps '("\\.pdf\\'" . "xpdf %s")))) > > > Best Wishes. > --94eb2c0bd7d4a6aa37053c9e8388 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Huh.=C2=A0 I am not really able to figure this out. I= imagine that part of the problem may be that org tries to use mailcap as a= method, and I don't have any mailcap files. So I attempted this, which= does not work:

'((system . "/usr/bin/xdg-open %s")=C2=A0 (auto-mode . emacs)
=C2=A0 ("\\.odt\\'" . system)=
=C2=A0 ("\\.mm\\'" . default)
=C2=A0 ("\\.x?html?= \\'" . default)
=C2=A0 ("\\.pdf\\'" . default) )<= br>
*Messages* reports that xdg-open has been run, but the fi= le doesn't actually run.=C2=A0 seting the odt entry to "/usr/bin/l= ibreoffice %s" doesn't seem to have any effect at all -- the file = just opens in emacs. The only thing that works for now is this bizarre work= around:
'((system . "/usr/bin/libreoffice %s")
=C2=A0= =C2=A0 (auto-mode . emacs)
=C2=A0=C2=A0 ("odt" . system)
= =C2=A0 ("\\.odt\\'" . "system")
=C2=A0 ("\\= .mm\\'" . default)
=C2=A0 ("\\.x?html?\\'" . defa= ult)
=C2=A0 ("\\.pdf\\'" . default))
I don&#= 39;t undertand why this would work while the others don't. Of course, t= his is a pretty lousy workaround since now everything opens in libreoffice = by default!

On Fri, Sep 16, 2016 at 4:16 AM, Colin Baxter &= lt;m43cap@yandex.com= > wrote:
On Thu, Sep 15 2016, Matt Price wrote:

> hi Everyone,
> I have been through this a million times, but I never seem to remember= , and have a hard time finding
> the answer online or in my archives.
>
> On a Linux system, how should I set org-file-apps to allow org to open= odt files in libreoffice, html files
> in Firefox, and pdf files in evince (especially in export-and-open com= mands)?
>
> I have tried a couple of htings; this is what C-h v org-file-apps curr= ently says:
>
> Its value is ((remote . emacs) (system . mailcap) (t . mailcap))
> Original value was
> ((auto-mode . emacs)
>=C2=A0 ("\\.mm\\'" . default)
>=C2=A0 ("\\.x?html?\\'" . default)
>=C2=A0 ("\\.pdf\\'" . default))
>
> There's no /etc/mailcap on my mahcine (?), and .mailcap reads:
>
> */*; xdg-open "%s"
>
> Running `xdg-open file.odt` from a terminal will open the file in libr= eoffice, but exporting to odt and
> opening with C-c C-e o O opens the file in emacs.=C2=A0 What should I = try next? Thank you!
> m

Hi Matt,

I can't stand evince so I've explicitly modified the default for pd= f
files to open xpdf. It could also be used to make open-office files use the=
application you want:

(add-hook 'org-mode-hook
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'(lambda ()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (delete '("\\.pdf\\'= " . default) org-file-apps)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (add-to-list 'org-file-apps &= #39;("\\.pdf\\'" . "xpdf %s"))))


Best Wishes.

--94eb2c0bd7d4a6aa37053c9e8388--