all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Set org-file-apps to open a *.doc file under linux with Word ?
Date: Wed, 04 Dec 2013 18:26:46 -0500	[thread overview]
Message-ID: <87wqjk2o5l.fsf@alphaville.bos.redhat.com> (raw)
In-Reply-To: 1981916.uUsSrgBaOc@linux-j9m3.site

AW <alexander.willand@t-online.de> writes:

> Hi!
>
> I'm using orgmode as a replacement for folders, you know, real folders, lots 
> of paper inside. 
>
> In my orgfiles I link to many other files, mostly *.tex and *.pdf, links look 
> like
>
> [[./foo.pdf][About foo]]
>
> Sometimes I can't avoid to link to doc  or docx files. So I need my linux pc to 
> start word and load a certain file. 
>
> I'd like to link to *.doc files in the same way:
>
> [[./bar.doc][About that draft]]
>
> But how can I set org-file-apps to open a *.doc file with MS Word under Linux?  
> Word works, more or less. 
>
> To start word the command is:
>
> env WINEPREFIX="/home/AW/.wine-office" wine "C:\windows\command\start.exe" /Unix 
> "/home/AW/.wine-office/dosdevices/c:/users/AW/Start Menu/Programs/Microsoft 
> Office/Microsoft Word 2010.lnk"
>
> But how in the world can I put in my .emacs file? I tried:
>
>  (add-to-list 'org-file-apps 
>    '("\\.doc" . "\"env WINEPREFIX="/home/AW/.wine-office" wine 
> "C:/windows/command/start.exe" 
>  /Unix "/home/AW/.wine-office/dosdevices/c:/users/AW/Start 
> Menu/Programs/Microsoft Office/Microsoft Word 2010.lnk"\" %s"))
>

Off the top of my head, I would say

(add-to-list 'org-file-apps
             '("\\.doc" . "env WINEPREFIX=\"/home/AW/.wine-office\" wine \"C:\\windows\\command\\start.exe\" /Unix \"/home/AW/.wine-office/dosdevices/c:/users/AW/Start Menu/Programs/Microsoft Office/Microsoft Word 2010.lnk\""))


i.e. just the command you provided enclosed in double quotes, except that
certain characters within have to be escaped:

    " -> \"    
    \ -> \\

The long string will probably be broken up into multiple lines by some
mailer but it is supposed to be one long string with no newlines. I
don't know if the spaces in the path will cause problems.

Untested (except that I did evaluate the add-to-list and got no errors):
no Word and no wine here.

BTW, why not LibreOffice? Does it mishandle your .doc files?

Nick

  reply	other threads:[~2013-12-04 23:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-04 21:56 Set org-file-apps to open a *.doc file under linux with Word ? AW
2013-12-04 23:26 ` Nick Dokos [this message]
2013-12-05  3:12   ` Jambunathan K
2013-12-05  3:18   ` Jambunathan K
2013-12-05 13:36     ` AW
2013-12-05 15:17       ` Jambunathan K
2013-12-05 15:21       ` Jambunathan K
2013-12-05 16:35         ` AW
2013-12-05 16:40           ` Jambunathan K
2013-12-05 13:34   ` AW
2013-12-05 19:48     ` Achim Gratz
2013-12-05  9:01 ` Achim Gratz
2013-12-05 13:38   ` AW
  -- strict thread matches above, loose matches on Subject: below --
2013-12-04 21:37 AW
2013-12-04 21:55 ` AW
     [not found] ` <mailman.8139.1386193990.10748.help-gnu-emacs@gnu.org>
2013-12-04 22:10   ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wqjk2o5l.fsf@alphaville.bos.redhat.com \
    --to=ndokos@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.