emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-file-apps settings?
@ 2016-09-15 13:27 Matt Price
  2016-09-15 17:18 ` Adam Porter
  2016-09-16  8:16 ` Colin Baxter
  0 siblings, 2 replies; 5+ messages in thread
From: Matt Price @ 2016-09-15 13:27 UTC (permalink / raw)
  To: Org Mode

[-- Attachment #1: Type: text/plain, Size: 884 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1097 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-file-apps settings?
  2016-09-15 13:27 org-file-apps settings? Matt Price
@ 2016-09-15 17:18 ` Adam Porter
  2016-09-16  8:16 ` Colin Baxter
  1 sibling, 0 replies; 5+ messages in thread
From: Adam Porter @ 2016-09-15 17:18 UTC (permalink / raw)
  To: emacs-orgmode

Hi Matt,

I'm not sure what the solution is for your system, but here's my
configuration:

org-file-apps is a variable defined in `org.el'.
Its value is ((auto-mode . emacs)
 ("\\.mm\\'" . default)
 ("\\.x?html?\\'" . default)
 ("\\.pdf\\'" . default))

I'm on Ubuntu Trusty on this system, and /etc/mailcap is a large file
containing many specific references to opendocument filetypes, etc.
When I export to ODT with "C-c C-e o O", the resulting file opens in
LibreOffice.

Hope this helps.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-file-apps settings?
  2016-09-15 13:27 org-file-apps settings? Matt Price
  2016-09-15 17:18 ` Adam Porter
@ 2016-09-16  8:16 ` Colin Baxter
  2016-09-16 11:46   ` Matt Price
  1 sibling, 1 reply; 5+ messages in thread
From: Colin Baxter @ 2016-09-16  8:16 UTC (permalink / raw)
  To: Matt Price; +Cc: Org Mode

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-file-apps settings?
  2016-09-16  8:16 ` Colin Baxter
@ 2016-09-16 11:46   ` Matt Price
  2016-09-17 15:30     ` Adam Porter
  0 siblings, 1 reply; 5+ messages in thread
From: Matt Price @ 2016-09-16 11:46 UTC (permalink / raw)
  Cc: Org Mode

[-- Attachment #1: Type: text/plain, Size: 2493 bytes --]

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 <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
> 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.
>

[-- Attachment #2: Type: text/html, Size: 3450 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-file-apps settings?
  2016-09-16 11:46   ` Matt Price
@ 2016-09-17 15:30     ` Adam Porter
  0 siblings, 0 replies; 5+ messages in thread
From: Adam Porter @ 2016-09-17 15:30 UTC (permalink / raw)
  To: emacs-orgmode

Matt Price <moptop99@gmail.com> writes:

> 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!

That is really weird, all right.  If it would help any, I could send you
my /etc/mailcap file.  Since Arch doesn't use one, maybe you could just
drop the one from my Ubuntu system in, and maybe it would work without
causing other problems...

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-17 15:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-15 13:27 org-file-apps settings? Matt Price
2016-09-15 17:18 ` Adam Porter
2016-09-16  8:16 ` Colin Baxter
2016-09-16 11:46   ` Matt Price
2016-09-17 15:30     ` Adam Porter

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).