emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* use of 'system in ox-odt.el
@ 2015-05-19 14:45 Matt Price
  2015-05-19 14:57 ` Rasmus
  0 siblings, 1 reply; 12+ messages in thread
From: Matt Price @ 2015-05-19 14:45 UTC (permalink / raw)
  To: Org Mode

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

Hi,

When I export-and-open to odt, org doesn't open the resultant odt, even
though I get a message:

Running xdg-open /home/matt/RLG231/RLG231Syllabus.odt...done

org-open-file works fine on links in an org buffer, and an anser on the
following stackoverflow page suggests the issue is in ox-odt.el:

http://stackoverflow.com/questions/24434854/emacs-org-odt-export-as-odf-and-open-odt-outside-emacs

Below is a git diff for the suggested change:

diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index 163f580..80650b1 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -94,7 +94,7 @@
     (?O "As ODT file and open"
         (lambda (a s v b)
           (if a (org-odt-export-to-odt t s v)
-        (org-open-file (org-odt-export-to-odt nil s v) 'system))))))
+        (org-open-file (org-odt-export-to-odt nil s v) ))))))
   :options-alist
   '((:odt-styles-file "ODT_STYLES_FILE" nil nil t)
     (:description "DESCRIPTION" nil nil newline)

----------------------------

I'm not sure what 'system does in the changed line -- the documentation
suggests a non-nil argument here will result in the odt file being opened
in a buffer rather than in a browser. Nocolas, others, does this look like
a bug? sorry I don't know more.

M

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

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

* Re: use of 'system in ox-odt.el
  2015-05-19 14:45 use of 'system in ox-odt.el Matt Price
@ 2015-05-19 14:57 ` Rasmus
       [not found]   ` <CAN_Dec_p7ZsHFKHpS7ha62Rq0apawmqXBj5Jho1ceZ1d05SLKw@mail.gmail.com>
  0 siblings, 1 reply; 12+ messages in thread
From: Rasmus @ 2015-05-19 14:57 UTC (permalink / raw)
  To: emacs-orgmode

Matt Price <moptop99@gmail.com> writes:

> When I export-and-open to odt, org doesn't open the resultant odt, even
> though I get a message:
>
> Running xdg-open /home/matt/RLG231/RLG231Syllabus.odt...done
>
> org-open-file works fine on links in an org buffer, and an anser on the
> following stackoverflow page suggests the issue is in ox-odt.el:

With your change it open the odt file as a tar-mode file from Emacs -q.
Without your change it doesn't open it at all.  BTW: My Emacs also doesn't
open html exports in Fx files when I use C-c C-e h-o.  I never tried to
debug it though...


Rasmus

-- 
9000!

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

* Re: use of 'system in ox-odt.el
       [not found]   ` <CAN_Dec_p7ZsHFKHpS7ha62Rq0apawmqXBj5Jho1ceZ1d05SLKw@mail.gmail.com>
@ 2015-05-19 18:19     ` Matt Price
  2015-05-19 20:38       ` Suvayu Ali
  0 siblings, 1 reply; 12+ messages in thread
From: Matt Price @ 2015-05-19 18:19 UTC (permalink / raw)
  To: Org Mode

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

Resenting to list (sorry rasmus)
---------- Forwarded message ----------
From: "Matt Price" <moptop99@gmail.com>
Date: May 19, 2015 11:04
Subject: Re: [O] use of 'system in ox-odt.el
To: "Rasmus" <rasmus@gmx.us>
Cc:



On Tue, May 19, 2015 at 10:57 AM, Rasmus <rasmus@gmx.us> wrote:

> Matt Price <moptop99@gmail.com> writes:
>
> > When I export-and-open to odt, org doesn't open the resultant odt, even
> > though I get a message:
> >
> > Running xdg-open /home/matt/RLG231/RLG231Syllabus.odt...done
> >
> > org-open-file works fine on links in an org buffer, and an anser on the
> > following stackoverflow page suggests the issue is in ox-odt.el:
>
> With your change it open the odt file as a tar-mode file from Emacs -q.
> Without your change it doesn't open it at all.  BTW: My Emacs also doesn't
> open html exports in Fx files when I use C-c C-e h-o.  I never tried to
> debug it though...
>
>
Yeah, I just got that too -- I realized I hadn't been testing it in the
right environment, shoot.  this modification worked for me (also form the
same forum):


 (setcdr (assq 'system org-file-apps-defaults-gnu ) '(call-process
"xdg-open" nil 0 nil file))

Not sure why this should work when the default fails.  Fx opens html
exports for me with C-c C-e h-o -- also not sure why that should work and
odt fail.

m


> Rasmus
>
> --
> 9000!
>
>
>

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

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

* Re: use of 'system in ox-odt.el
  2015-05-19 18:19     ` Matt Price
@ 2015-05-19 20:38       ` Suvayu Ali
  2015-05-20  9:50         ` Rasmus
  0 siblings, 1 reply; 12+ messages in thread
From: Suvayu Ali @ 2015-05-19 20:38 UTC (permalink / raw)
  To: emacs-orgmode

On Tue, May 19, 2015 at 02:19:10PM -0400, Matt Price wrote:
> On Tue, May 19, 2015 at 10:57 AM, Rasmus <rasmus@gmx.us> wrote:
> 
> > Matt Price <moptop99@gmail.com> writes:
> >
> > > When I export-and-open to odt, org doesn't open the resultant odt, even
> > > though I get a message:
> > >
> > > Running xdg-open /home/matt/RLG231/RLG231Syllabus.odt...done
> > >
> > > org-open-file works fine on links in an org buffer, and an anser on the
> > > following stackoverflow page suggests the issue is in ox-odt.el:
> >
> > With your change it open the odt file as a tar-mode file from Emacs -q.
> > Without your change it doesn't open it at all.  BTW: My Emacs also doesn't
> > open html exports in Fx files when I use C-c C-e h-o.  I never tried to
> > debug it though...
> >
> >
> Yeah, I just got that too -- I realized I hadn't been testing it in the
> right environment, shoot.  this modification worked for me (also form the
> same forum):
> 
> 
>  (setcdr (assq 'system org-file-apps-defaults-gnu ) '(call-process
> "xdg-open" nil 0 nil file))
> 
> Not sure why this should work when the default fails.  Fx opens html
> exports for me with C-c C-e h-o -- also not sure why that should work and
> odt fail.

Do you have a mailcap which says otherwise?  That's what I would suspect
given the doc string for org-file-apps and the default value of
org-file-apps-defaults-gnu on my system.

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: use of 'system in ox-odt.el
  2015-05-19 20:38       ` Suvayu Ali
@ 2015-05-20  9:50         ` Rasmus
  2015-05-20 11:03           ` Suvayu Ali
  0 siblings, 1 reply; 12+ messages in thread
From: Rasmus @ 2015-05-20  9:50 UTC (permalink / raw)
  To: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> Do you have a mailcap which says otherwise?  That's what I would suspect
> given the doc string for org-file-apps and the default value of
> org-file-apps-defaults-gnu on my system.

I have this in my mailcap

    application/msword;              antiword %s;
    application/pdf; 		     evince %s;
    application/vnd.lotus-organizer; emacsclient -ca '' %s;
    application/zip                  file-roller %s;

Org does not open my html and odt files.  It does open pdf files.  This is
using emacs -q.  I use Gnome 3.16 and xdg-open works as expected from the
terminal.

—Rasmus

-- 
May contains speling mistake

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

* Re: use of 'system in ox-odt.el
  2015-05-20  9:50         ` Rasmus
@ 2015-05-20 11:03           ` Suvayu Ali
  2015-05-20 11:21             ` Rasmus
  0 siblings, 1 reply; 12+ messages in thread
From: Suvayu Ali @ 2015-05-20 11:03 UTC (permalink / raw)
  To: emacs-orgmode

On Wed, May 20, 2015 at 11:50:03AM +0200, Rasmus wrote:
> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
> 
> > Do you have a mailcap which says otherwise?  That's what I would suspect
> > given the doc string for org-file-apps and the default value of
> > org-file-apps-defaults-gnu on my system.
> 
> I have this in my mailcap
> 
>     application/msword;              antiword %s;
>     application/pdf; 		     evince %s;
>     application/vnd.lotus-organizer; emacsclient -ca '' %s;
>     application/zip                  file-roller %s;
> 
> Org does not open my html and odt files.  It does open pdf files.  This is
> using emacs -q.  I use Gnome 3.16 and xdg-open works as expected from the
> terminal.

There should also be a system-wide setting in /etc/mailcap.  On my
Fedora machine, the system-wide settings all look like this:

  text/html; /usr/bin/xdg-open %s ; copiousoutput

If yours doesn't, you could override it in ~/.mailcap.  If that doesn't
fix things, I'm out of ideas :-|.

GL,

> May contains speling mistake
> 

Funnny ;)

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: use of 'system in ox-odt.el
  2015-05-20 11:03           ` Suvayu Ali
@ 2015-05-20 11:21             ` Rasmus
  2015-05-20 17:42               ` Suvayu Ali
  0 siblings, 1 reply; 12+ messages in thread
From: Rasmus @ 2015-05-20 11:21 UTC (permalink / raw)
  To: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> On Wed, May 20, 2015 at 11:50:03AM +0200, Rasmus wrote:
>> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
>> 
>
>> > Do you have a mailcap which says otherwise?  That's what I would suspect
>> > given the doc string for org-file-apps and the default value of
>> > org-file-apps-defaults-gnu on my system.
>> 
>> I have this in my mailcap
>> 
>>     application/msword;              antiword %s;
>>     application/pdf; 		     evince %s;
>>     application/vnd.lotus-organizer; emacsclient -ca '' %s;
>>     application/zip                  file-roller %s;
>> 
>> Org does not open my html and odt files.  It does open pdf files.  This is
>> using emacs -q.  I use Gnome 3.16 and xdg-open works as expected from the
>> terminal.
>
> There should also be a system-wide setting in /etc/mailcap.  On my
> Fedora machine, the system-wide settings all look like this:
>
>   text/html; /usr/bin/xdg-open %s ; copiousoutput
>
> If yours doesn't, you could override it in ~/.mailcap.  If that doesn't
> fix things, I'm out of ideas :-|.

Now it get the message

    Running /usr/bin/xdg-open /tmp/test.html ...done

But it doesn't actually open the file...  The same happens when I mark the
file in dired and says & xdg-open.  From the terminal it works fine.

Weird.

—Rasmus

-- 
Send from my Emacs

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

* Re: use of 'system in ox-odt.el
  2015-05-20 11:21             ` Rasmus
@ 2015-05-20 17:42               ` Suvayu Ali
  2015-05-21  0:29                 ` Matt Price
  0 siblings, 1 reply; 12+ messages in thread
From: Suvayu Ali @ 2015-05-20 17:42 UTC (permalink / raw)
  To: emacs-orgmode

On Wed, May 20, 2015 at 01:21:34PM +0200, Rasmus wrote:
> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
> 
> > On Wed, May 20, 2015 at 11:50:03AM +0200, Rasmus wrote:
> >> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
> >> 
> >
> >> > Do you have a mailcap which says otherwise?  That's what I would suspect
> >> > given the doc string for org-file-apps and the default value of
> >> > org-file-apps-defaults-gnu on my system.
> >> 
> >> I have this in my mailcap
> >> 
> >>     application/msword;              antiword %s;
> >>     application/pdf; 		     evince %s;
> >>     application/vnd.lotus-organizer; emacsclient -ca '' %s;
> >>     application/zip                  file-roller %s;
> >> 
> >> Org does not open my html and odt files.  It does open pdf files.  This is
> >> using emacs -q.  I use Gnome 3.16 and xdg-open works as expected from the
> >> terminal.
> >
> > There should also be a system-wide setting in /etc/mailcap.  On my
> > Fedora machine, the system-wide settings all look like this:
> >
> >   text/html; /usr/bin/xdg-open %s ; copiousoutput
> >
> > If yours doesn't, you could override it in ~/.mailcap.  If that doesn't
> > fix things, I'm out of ideas :-|.
> 
> Now it get the message
> 
>     Running /usr/bin/xdg-open /tmp/test.html ...done
> 
> But it doesn't actually open the file...  The same happens when I mark the
> file in dired and says & xdg-open.  From the terminal it works fine.

You are on Gnome, rt?  I think there is a long standing "bug" in
gvfs-open (which is called by xdg-open).

See the following:
http://lists.gnu.org/archive/html/emacs-devel/2009-07/msg00279.html
https://bugzilla.gnome.org/show_bug.cgi?id=652262

I came across this a long time ago trying to investigate why xdg-open
didn't work when running asynchronously like your example.

  http://thread.gmane.org/gmane.emacs.help/93430

Hope this helps,

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: use of 'system in ox-odt.el
  2015-05-20 17:42               ` Suvayu Ali
@ 2015-05-21  0:29                 ` Matt Price
  2015-05-21  8:18                   ` Rasmus
  0 siblings, 1 reply; 12+ messages in thread
From: Matt Price @ 2015-05-21  0:29 UTC (permalink / raw)
  To: suvayu ali; +Cc: Org Mode

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

On May 20, 2015 1:43 PM, "Suvayu Ali" <fatkasuvayu+linux@gmail.com> wrote:
>
> On Wed, May 20, 2015 at 01:21:34PM +0200, Rasmus wrote:
> > Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
> >
> > > On Wed, May 20, 2015 at 11:50:03AM +0200, Rasmus wrote:
> > >> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
> > >>
> > >
> > >> > Do you have a mailcap which says otherwise?  That's what I would
suspect
> > >> > given the doc string for org-file-apps and the default value of
> > >> > org-file-apps-defaults-gnu on my system.
> > >>
> > >> I have this in my mailcap
> > >>
> > >>     application/msword;              antiword %s;
> > >>     application/pdf;                    evince %s;
> > >>     application/vnd.lotus-organizer; emacsclient -ca '' %s;
> > >>     application/zip                  file-roller %s;
> > >>
> > >> Org does not open my html and odt files.  It does open pdf files.
This is
> > >> using emacs -q.  I use Gnome 3.16 and xdg-open works as expected
from the
> > >> terminal.
> > >
> > > There should also be a system-wide setting in /etc/mailcap.  On my
> > > Fedora machine, the system-wide settings all look like this:
> > >
> > >   text/html; /usr/bin/xdg-open %s ; copiousoutput
> > >
> > > If yours doesn't, you could override it in ~/.mailcap.  If that
doesn't
> > > fix things, I'm out of ideas :-|.
> >
> > Now it get the message
> >
> >     Running /usr/bin/xdg-open /tmp/test.html ...done
> >
> > But it doesn't actually open the file...  The same happens when I mark
the
> > file in dired and says & xdg-open.  From the terminal it works fine.
>
> You are on Gnome, rt?  I think there is a long standing "bug" in
> gvfs-open (which is called by xdg-open).
>
> See the following:
> http://lists.gnu.org/archive/html/emacs-devel/2009-07/msg00279.html
> https://bugzilla.gnome.org/show_bug.cgi?id=652262
>
> I came across this a long time ago trying to investigate why xdg-open
> didn't work when running asynchronously like your example.
>
>   http://thread.gmane.org/gmane.emacs.help/93430
>
> Hope this helps,
>
> --
> Suvayu

I think those bug reports describe the problem precisely.  I am also on
gnome and have much the same problem.

>
> Open source is the future. It sets us free.
>

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

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

* Re: use of 'system in ox-odt.el
  2015-05-21  0:29                 ` Matt Price
@ 2015-05-21  8:18                   ` Rasmus
  2015-05-21 15:21                     ` Matt Price
  0 siblings, 1 reply; 12+ messages in thread
From: Rasmus @ 2015-05-21  8:18 UTC (permalink / raw)
  To: emacs-orgmode

Matt Price <moptop99@gmail.com> writes:

>> You are on Gnome, rt?  I think there is a long standing "bug" in
>> gvfs-open (which is called by xdg-open).
>>
>> See the following:
>> http://lists.gnu.org/archive/html/emacs-devel/2009-07/msg00279.html
>> https://bugzilla.gnome.org/show_bug.cgi?id=652262
>>
>> I came across this a long time ago trying to investigate why xdg-open
>> didn't work when running asynchronously like your example.
>>
>>   http://thread.gmane.org/gmane.emacs.help/93430

> I think those bug reports describe the problem precisely.  I am also on
> gnome and have much the same problem.

2 minutes research suggest that I cannot tell xdg-open to use another
backend other than through environment variables, viz. BROWSER, DE,
DESKTOP_SESSION.  Unfortunately, I was not able to make this work by just
setting the DESKTOP_SESSION in either the shell starting Emacs or via
setenv.

So I guess on could use an xdg-open alternative or hardcode programs in
mailcap...

Rasmus

-- 
A page of history is worth a volume of logic

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

* Re: use of 'system in ox-odt.el
  2015-05-21  8:18                   ` Rasmus
@ 2015-05-21 15:21                     ` Matt Price
  2015-05-21 17:30                       ` Rasmus
  0 siblings, 1 reply; 12+ messages in thread
From: Matt Price @ 2015-05-21 15:21 UTC (permalink / raw)
  Cc: Org Mode

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

On May 21, 2015 04:32, "Rasmus" <rasmus@gmx.us> wrote:
>
> Matt Price <moptop99@gmail.com> writes:
>
> >> You are on Gnome, rt?  I think there is a long standing "bug" in
> >> gvfs-open (which is called by xdg-open).
> >>
> >> See the following:
> >> http://lists.gnu.org/archive/html/emacs-devel/2009-07/msg00279.html
> >> https://bugzilla.gnome.org/show_bug.cgi?id=652262
> >>
> >> I came across this a long time ago trying to investigate why xdg-open
> >> didn't work when running asynchronously like your example.
> >>
> >>   http://thread.gmane.org/gmane.emacs.help/93430
>
> > I think those bug reports describe the problem precisely.  I am also on
> > gnome and have much the same problem.
>
> 2 minutes research suggest that I cannot tell xdg-open to use another
> backend other than through environment variables, viz. BROWSER, DE,
> DESKTOP_SESSION.  Unfortunately, I was not able to make this work by just
> setting the DESKTOP_SESSION in either the shell starting Emacs or via
> setenv.
>
> So I guess on could use an xdg-open alternative or hardcode programs in
> mailcap...

Did you try this:

 (setcdr (assq 'system org-file-apps-defaults-gnu ) '(call-process
"xdg-open" nil 0 nil file))

That works for me.

>
> Rasmus
>
> --
> A page of history is worth a volume of logic
>
>

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

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

* Re: use of 'system in ox-odt.el
  2015-05-21 15:21                     ` Matt Price
@ 2015-05-21 17:30                       ` Rasmus
  0 siblings, 0 replies; 12+ messages in thread
From: Rasmus @ 2015-05-21 17:30 UTC (permalink / raw)
  To: emacs-orgmode

Matt Price <moptop99@gmail.com> writes:

> Did you try this:
>
>  (setcdr (assq 'system org-file-apps-defaults-gnu ) '(call-process
> "xdg-open" nil 0 nil file))
>
> That works for me.

It works for odt, but not html.

-- 
Slowly unravels in a ball of yarn and the devil collects it

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

end of thread, other threads:[~2015-05-21 17:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-19 14:45 use of 'system in ox-odt.el Matt Price
2015-05-19 14:57 ` Rasmus
     [not found]   ` <CAN_Dec_p7ZsHFKHpS7ha62Rq0apawmqXBj5Jho1ceZ1d05SLKw@mail.gmail.com>
2015-05-19 18:19     ` Matt Price
2015-05-19 20:38       ` Suvayu Ali
2015-05-20  9:50         ` Rasmus
2015-05-20 11:03           ` Suvayu Ali
2015-05-20 11:21             ` Rasmus
2015-05-20 17:42               ` Suvayu Ali
2015-05-21  0:29                 ` Matt Price
2015-05-21  8:18                   ` Rasmus
2015-05-21 15:21                     ` Matt Price
2015-05-21 17:30                       ` Rasmus

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