Re: [O] Set org-file-apps to open a *.doc file under linux with Word ?

2013-12-05 Thread Achim Gratz
AW alexander.willand at t-online.de writes:
 But how can I set org-file-apps to open a *.doc file with MS Word under Linux?

It's probably easiest to put that into a wrapper script and associate it
with .doc/.docx on your desktop environment.  That way you probably wouldn't
even need to customize anything within Emacs or at least could avoid the
vagaries of UNIX vs. Windows quoting.


Regards,
Achim.




Re: [O] Set org-file-apps to open a *.doc file under linux with Word ?

2013-12-05 Thread AW
Am Mittwoch, 4. Dezember 2013, 18:26:46 schrieb Nick Nick Dokos:
 AW alexander.will...@t-online.de writes:
  Hi!
... 
 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.
 

I get no error message, but nothing happens, except Emacs telling me it has 
run the command.

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

LibreOffice changes the content of word files slightly and for folks who panic 
if 
not everything is like expected, that's too much already.

You know, if you are the guy who works with LaTeX, word users tend to be 
somehow narrow minded.

However, thank you. I tried something different now: I wrote a bash script, 
just two lines:

#!/bin/bash

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

On the command line word.sh works.

But in .emacs the lines

(add-to-list 'org-file-apps
 '(\\.docx . exec /home/AW/bin/word.sh %s))

don't. What am I doing in the wrong way?

Regards, 

Alexander



Re: [O] Set org-file-apps to open a *.doc file under linux with Word ?

2013-12-05 Thread AW
Am Donnerstag, 5. Dezember 2013, 08:48:11 schrieb Jambunathan K:
 Nick Dokos ndo...@gmail.com writes:
  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
 
 The easiest way to get the same effect is to use
 
 M-x customize-variable RET org-file-apps RET
 
 and specify a command.  Once it is saved, the .emacs will have the
 resulting nightmarish string :-)
 
 
 
 Another way to quote a string would be to use
 
M-x pp-eval-expression RET (read-string Enter string: ) RET
 
 and copy-paste the output from *Pp Eval Output* to .emacs or .el file.

Thank you, customization worked, but it did not start word -- I'm going 
another way now.

Regards,

Alexander



Re: [O] Set org-file-apps to open a *.doc file under linux with Word ?

2013-12-05 Thread AW
Am Donnerstag, 5. Dezember 2013, 09:01:40 schrieb  Achim Gratz:
 AW alexander.willand at t-online.de writes:
  But how can I set org-file-apps to open a *.doc file with MS Word under
  Linux?
 It's probably easiest to put that into a wrapper script and associate it
 with .doc/.docx on your desktop environment.  That way you probably wouldn't
 even need to customize anything within Emacs or at least could avoid the
 vagaries of UNIX vs. Windows quoting.
 
 
 Regards,
 Achim.

Great idea, thank you! Doesn't work yet (I'm lacking of lisp knowledge very 
much), see my other mail re Nick Dokos.

Regards,

Alexander



Re: [O] Set org-file-apps to open a *.doc file under linux with Word ?

2013-12-05 Thread Jambunathan K
AW alexander.will...@t-online.de writes:

 Thank you, customization worked, but it did not start word -- I'm going 
 another way now.

I am playing a guessing game and don't know what I am saying.  Try this.


M-: (shell-quote-argument (read-string Enter string:))
 

When prompted enter

whatever wine whatever %s

Now put whatever string you get in *Pp Eval Output* DIRECTLY in to your
.emacs.  See the attached snippet.el for an idea of what I get.

Instead of passing env as part of the command, I think you can add this
to your .emacs.

(setenv WINEPREFIX /home/AW/.wine-office)

You can also do

M-x setenv

to set environment variables.



snippet.el
Description: application/emacs-lisp


Re: [O] Set org-file-apps to open a *.doc file under linux with Word ?

2013-12-05 Thread Jambunathan K

AW alexander.will...@t-online.de writes:
 Thank you, customization worked, but it did not start word -- I'm going 
 another way now.

I am playing a guessing game and really don't know what I am saying.

Try this.


M-: (shell-quote-argument (read-string Enter string:))
 

When prompted enter

whatever wine whatever %s

Now put whatever string you get in *Pp Eval Output* DIRECTLY in to your
.emacs.  See the attached snippet.el for what I get.

Instead of passing env as part of the command, I think you can add this
to your .emacs.

(setenv WINEPREFIX /home/AW/.wine-office)

You can also do

M-x setenv

to set environment variables.



snippet.el
Description: application/emacs-lisp


Re: [O] Set org-file-apps to open a *.doc file under linux with Word ?

2013-12-05 Thread AW
Am Donnerstag, 5. Dezember 2013, 20:51:04 schrieb Jambunathan K:
 AW alexander.will...@t-online.de writes:
  Thank you, customization worked, but it did not start word -- I'm going
  another way now.
 
 I am playing a guessing game and really don't know what I am saying.
 
 Try this.
 
 
 M-: (shell-quote-argument (read-string Enter string:))
  
 
 When prompted enter
 
 whatever wine whatever %s
 
 Now put whatever string you get in *Pp Eval Output* DIRECTLY in to your
 .emacs.  See the attached snippet.el for what I get.
 
 Instead of passing env as part of the command, I think you can add this
 to your .emacs.
 
 (setenv WINEPREFIX /home/AW/.wine-office)
 
 You can also do
 
 M-x setenv
 
 to set environment variables.

I found out, that things are much more complicated: 

I wrote a bash script word.sh (see my other mail on this) and tried to figure 
out how to pass a filename to it. Even this is not obvious, because from the 
viewpoint of Word under Wine filenames differ from the real filename in the 
system. I did not suceed to make Word start and open a file foo.docx. You know, 
something weird as

word.sh C:/users/AW/Meine Dokumente/Dokumente/temp/foo.docx

made Word start, but not open a document, and Word complains about missing dot 
something. And often people send files with names which are a pain to read, 
including $ -signs, brackets and whatever. 

The whole thing is way too difficult for me and I have to dismiss the idea.

Thanks to you and everyone who offered help, but it was not a good idea.

Regards,

Alexander






Re: [O] Set org-file-apps to open a *.doc file under linux with Word ?

2013-12-05 Thread Jambunathan K
AW alexander.will...@t-online.de writes:

 I found out, that things are much more complicated:

Did you try my suggestion?

What happened?

I gave a snippet.el.  You just need to copy paste that to .emacs.  It is
easy to figure out where and how.

(I know nothing about shell programming or environment variables and
such things)

 Thanks to you and everyone who offered help, but it was not a good
 idea.

You are running away.  We aren't.

Give it a try, Buddy.  We will figure out something and make you happy.




Re: [O] Set org-file-apps to open a *.doc file under linux with Word ?

2013-12-05 Thread Achim Gratz
AW writes:
 #!/bin/bash

 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

 On the command line word.sh works.

 But in .emacs the lines

 (add-to-list 'org-file-apps
  '(\\.docx . exec /home/AW/bin/word.sh %s))

 don't. What am I doing in the wrong way?

exec is a shell built-in.  Try:

--8---cut here---start-8---
#!/bin/sh
exec 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
--8---cut here---end---8---

Then drop the exec from the emacs association to docx.


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

Samples for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra




Re: [O] Set org-file-apps to open a *.doc file under linux with Word ?

2013-12-05 Thread Jambunathan K
Nick Dokos ndo...@gmail.com writes:

 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 easiest way to get the same effect is to use

M-x customize-variable RET org-file-apps RET

and specify a command.  Once it is saved, the .emacs will have the
resulting nightmarish string :-)



Another way to quote a string would be to use

   M-x pp-eval-expression RET (read-string Enter string: ) RET

and copy-paste the output from *Pp Eval Output* to .emacs or .el file.



[O] Set org-file-apps to open a *.doc file under linux with Word ?

2013-12-04 Thread AW
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))

But I get:

Invalid read syntax: . in wrong context

Any suggestions would be welcome!

Regards,

Alexander




Re: [O] Set org-file-apps to open a *.doc file under linux with Word ?

2013-12-04 Thread Nick Dokos
AW alexander.will...@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




Re: [O] Set org-file-apps to open a *.doc file under linux with Word ?

2013-12-04 Thread Jambunathan K

Nick Dokos ndo...@gmail.com writes:

 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

The easiest way to get the same effect is to use

M-x customize-variable RET org-file-apps RET

and specify a command.  Once it is saved, the .emacs will have the
resulting nightmarish string :-)



Another way to quote a string would be to use

   M-x pp-eval-expression RET (read-string Enter string: ) RET

and copy-paste the output from *Pp Eval Output* to .emacs or .el file.