unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Help to view .doc files with no-word.el & antiword please
@ 2009-08-23 10:36 rpd
  0 siblings, 0 replies; 11+ messages in thread
From: rpd @ 2009-08-23 10:36 UTC (permalink / raw)
  To: Help-gnu-emacs


Hi
I am trying to use no-word.el & antiword.exe to view .doc files in Emacs but 
unsuccessfully at the moment.
I have had a recent post with knubee on this but I still need help.

Here is my .emacs code:

;;;;==========View .DOC with noword.el & antiword====================
;;;
;;requires antiword
;(add-to-list 'load-path "C:\\antiword")
;(add-to-list 'exec-path "C:\\antiword\\antiword.exe")
;(require 'antiword)
;(load-library "C:\\Users\\Dad\\Emacs\\emacsaddons\\no-word")
;(load "C:\\Users\\Dad\\Emacs\\emacsaddons\\no-word.el")

;(when (locate-library "no-word")
;  (require 'no-word)
;  (add-to-list 'auto-mode-alist '("\\.doc\\'" . no-word))
;;;from gnuforum emacs nabble help forum knubee code
;(load "C:\\Users\\Dad\\Emacs\\emacsaddons\\no-word.el")
(autoload 'no-word "no-word" "word to txt")
  (add-to-list 'auto-mode-alist '("\\.doc\\'" . no-word))
  (add-to-list 'exec-path "C:\\antiword\\")
;==

As can be seen I have several repeat lines of code here (several commented
out) but no matter what combination I use I cannot get to view .doc files
(usually getting the error msg I give below).
When I try loading no-word.el it still doesn't work- I get a command in
minibuffer about coding(default) & if I [ret] then I get this error msg: 

'antiword' is not recognized as an internal or external command, 
operable program or batch file. 

I have also placed no-word.el in emacs/site-lisp directory but I still get
the same error message. 

I am most grateful if someone could advise me & help me fix this code so I
can use no-word.el & antiword to view .doc files- many thanks


-- 
View this message in context: http://www.nabble.com/Help-to-view-.doc-files-with-no-word.el---antiword-please-tp25102080p25102080.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





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

* Re: Help to view .doc files with no-word.el & antiword please
       [not found] <mailman.5189.1251023783.2239.help-gnu-emacs@gnu.org>
@ 2009-08-23 10:50 ` Joost Kremers
       [not found]   ` <slrnh94hka.kph.joostkremers@j.kremers4.news.arnhem.chello.nl>
       [not found] ` <87r5v1ime4.fsf@lion.rapttech.com.au>
  1 sibling, 1 reply; 11+ messages in thread
From: Joost Kremers @ 2009-08-23 10:50 UTC (permalink / raw)
  To: help-gnu-emacs

rpd wrote:
> As can be seen I have several repeat lines of code here (several commented
> out) but no matter what combination I use I cannot get to view .doc files
> (usually getting the error msg I give below).
> When I try loading no-word.el it still doesn't work- I get a command in
> minibuffer about coding(default)

which, from the looks of it, is exactly what is expected: no-word is by default
configured to ask you for an encoding.

> & if I [ret] then I get this error msg: 
> 
> 'antiword' is not recognized as an internal or external command, 
> operable program or batch file. 

this is not an emacs error but an error from the DOS command shell. it means
that the antiword executable cannot be found. since no-word doesn't allow you to
customize this location (which is a bug, if you ask me) you'll either have to
modify the code or (easier) put the antiword executable in your $PATH.


-- 
Joost Kremers                                      joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


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

* Re: Help to view .doc files with no-word.el & antiword please
       [not found]   ` <slrnh94o4t.kph.joostkremers@j.kremers4.news.arnhem.chello.nl>
@ 2009-08-25  5:44     ` Tim X
  0 siblings, 0 replies; 11+ messages in thread
From: Tim X @ 2009-08-25  5:44 UTC (permalink / raw)
  To: help-gnu-emacs

Joost Kremers <joostkremers@yahoo.com> writes:

> Tim X wrote:
>> Although not a direct solution, you may find the following useful. I use
>> it to convert various different formats to text for viewing within
>> emacs. 
>
> you know about doc-view-mode? it can be used to view pdf, ps and dvi files in
> emacs. though it doesn't handle .doc files...

Yep, know about it, but it doesn't meet my needs. I need the contents in
text, not as images and I find my approach faster and easier to add
additional converters etc.

Tim. 
-- 
tcross (at) rapttech dot com dot au


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

* Re: Help to view .doc files with no-word.el & antiword please
       [not found]       ` <mailman.5240.1251110919.2239.help-gnu-emacs@gnu.org>
@ 2009-08-25  7:20         ` Joost Kremers
  2009-08-25 11:51           ` rpd
                             ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Joost Kremers @ 2009-08-25  7:20 UTC (permalink / raw)
  To: help-gnu-emacs

rpd wrote:
>
> Hi Joost
>
> Many thanks for your helpful replies. 
> I have no got Emacs to find antiword (& it opens in cmd/dos shell)
>
> However every MS Word .doc I open I get an error message:
> - is not a Word Document

mmm... on unix, the dash usually means standard input, so what i think is
happening is that no-word calls antiword and tries to pipe the .doc file to it,
but antiword doesn't understand, it thinks it needs to process a file named `-'.
it could be that the windows port of antiword doesn't support reading from
stdin.

what happens if you try to open a file with M-x no-word-find-file rather than
with C-x C-f? i suspect that should work better.


-- 
Joost Kremers                                      joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


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

* Re: Help to view .doc files with no-word.el & antiword please
  2009-08-25  7:20         ` Joost Kremers
@ 2009-08-25 11:51           ` rpd
       [not found]           ` <mailman.5300.1251201164.2239.help-gnu-emacs@gnu.org>
  2009-08-25 18:44           ` Eli Zaretskii
  2 siblings, 0 replies; 11+ messages in thread
From: rpd @ 2009-08-25 11:51 UTC (permalink / raw)
  To: Help-gnu-emacs


Joost
Thanks for your further advice but when I try M-x no-word-find-file

I get this error message:
I can't open '~/Charliemissing.doc' for reading

(am I in the right directory? it should be C:\Users\Dad\Charliemissing.doc)

Anymore ideas?


Joost Kremers wrote:
> 
> rpd wrote:
>>
>> Hi Joost
>>
>> Many thanks for your helpful replies. 
>> I have no got Emacs to find antiword (& it opens in cmd/dos shell)
>>
>> However every MS Word .doc I open I get an error message:
>> - is not a Word Document
> 
> mmm... on unix, the dash usually means standard input, so what i think is
> happening is that no-word calls antiword and tries to pipe the .doc file
> to it,
> but antiword doesn't understand, it thinks it needs to process a file
> named `-'.
> it could be that the windows port of antiword doesn't support reading from
> stdin.
> 
> what happens if you try to open a file with M-x no-word-find-file rather
> than
> with C-x C-f? i suspect that should work better.
> 
> 
> -- 
> Joost Kremers                                      joostkremers@yahoo.com
> Selbst in die Unterwelt dringt durch Spalten Licht
> EN:SiS(9)
> 
> 

-- 
View this message in context: http://www.nabble.com/Help-to-view-.doc-files-with-no-word.el---antiword-please-tp25102080p25132797.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





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

* Re: Help to view .doc files with no-word.el & antiword please
       [not found]           ` <mailman.5300.1251201164.2239.help-gnu-emacs@gnu.org>
@ 2009-08-25 12:20             ` Joost Kremers
  2009-08-25 16:35               ` rpd
  0 siblings, 1 reply; 11+ messages in thread
From: Joost Kremers @ 2009-08-25 12:20 UTC (permalink / raw)
  To: help-gnu-emacs

rpd wrote:
>
> Joost
> Thanks for your further advice but when I try M-x no-word-find-file
>
> I get this error message:
> I can't open '~/Charliemissing.doc' for reading
>
> (am I in the right directory? it should be C:\Users\Dad\Charliemissing.doc)
>
> Anymore ideas?

emacs on windows (at least vista, haven't tried other versions) thinks a user's
home directory is "C:\Users\<username>\Application Data\some_subdir" for
some reason i don't understand. so the tilde character ~ expands to that, not to
C:\Users\<username>, as one might expect.

if you type the full path to the file, it should work. (or, IMHO the better
option, create a HOME environment variable and set it to "C:\Users\<username>".
google should have info on how to do that.)


-- 
Joost Kremers                                      joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


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

* Re: Help to view .doc files with no-word.el & antiword please
  2009-08-25 12:20             ` Joost Kremers
@ 2009-08-25 16:35               ` rpd
  2009-08-25 17:01                 ` rpd
       [not found]                 ` <mailman.5329.1251219674.2239.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 11+ messages in thread
From: rpd @ 2009-08-25 16:35 UTC (permalink / raw)
  To: Help-gnu-emacs


Joost

Thanks once more.
Now when I get the right direcory path I get this error message:

c:/Users/Dad/Charliemissing.doc is not a Word Document.

(but Charliemissing.doc IS a Word .doc(!))

I don't think Emacs & antiword & no-word.el like me!

Anymore ideas? Thanks & regards


Joost Kremers wrote:
> 
> rpd wrote:
>>
>> Joost
>> Thanks for your further advice but when I try M-x no-word-find-file
>>
>> I get this error message:
>> I can't open '~/Charliemissing.doc' for reading
>>
>> (am I in the right directory? it should be
>> C:\Users\Dad\Charliemissing.doc)
>>
>> Anymore ideas?
> 
> emacs on windows (at least vista, haven't tried other versions) thinks a
> user's
> home directory is "C:\Users\<username>\Application Data\some_subdir" for
> some reason i don't understand. so the tilde character ~ expands to that,
> not to
> C:\Users\<username>, as one might expect.
> 
> if you type the full path to the file, it should work. (or, IMHO the
> better
> option, create a HOME environment variable and set it to
> "C:\Users\<username>".
> google should have info on how to do that.)
> 
> 
> -- 
> Joost Kremers                                      joostkremers@yahoo.com
> Selbst in die Unterwelt dringt durch Spalten Licht
> EN:SiS(9)
> 
> 

-- 
View this message in context: http://www.nabble.com/Help-to-view-.doc-files-with-no-word.el---antiword-please-tp25102080p25137851.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





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

* Re: Help to view .doc files with no-word.el & antiword please
  2009-08-25 16:35               ` rpd
@ 2009-08-25 17:01                 ` rpd
       [not found]                 ` <mailman.5329.1251219674.2239.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 11+ messages in thread
From: rpd @ 2009-08-25 17:01 UTC (permalink / raw)
  To: Help-gnu-emacs


Hi Joost

I do not know what the previous error message was (possibly I had the wrong
file path?!)
BUT I am now able to open Word .doc files with M-x no-word-find-file [RET]
(then enter file path & when I get the path to the file right!).

Many thanks for all your help,regards

rpd wrote:
> 
> Joost
> 
> Thanks once more.
> Now when I get the right direcory path I get this error message:
> 
> c:/Users/Dad/Charliemissing.doc is not a Word Document.
> 
> (but Charliemissing.doc IS a Word .doc(!))
> 
> I don't think Emacs & antiword & no-word.el like me!
> 
> Anymore ideas? Thanks & regards
> 
> 
> Joost Kremers wrote:
>> 
>> rpd wrote:
>>>
>>> Joost
>>> Thanks for your further advice but when I try M-x no-word-find-file
>>>
>>> I get this error message:
>>> I can't open '~/Charliemissing.doc' for reading
>>>
>>> (am I in the right directory? it should be
>>> C:\Users\Dad\Charliemissing.doc)
>>>
>>> Anymore ideas?
>> 
>> emacs on windows (at least vista, haven't tried other versions) thinks a
>> user's
>> home directory is "C:\Users\<username>\Application Data\some_subdir" for
>> some reason i don't understand. so the tilde character ~ expands to that,
>> not to
>> C:\Users\<username>, as one might expect.
>> 
>> if you type the full path to the file, it should work. (or, IMHO the
>> better
>> option, create a HOME environment variable and set it to
>> "C:\Users\<username>".
>> google should have info on how to do that.)
>> 
>> 
>> -- 
>> Joost Kremers                                      joostkremers@yahoo.com
>> Selbst in die Unterwelt dringt durch Spalten Licht
>> EN:SiS(9)
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Help-to-view-.doc-files-with-no-word.el---antiword-please-tp25102080p25138304.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





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

* Re: Help to view .doc files with no-word.el & antiword please
  2009-08-25  7:20         ` Joost Kremers
  2009-08-25 11:51           ` rpd
       [not found]           ` <mailman.5300.1251201164.2239.help-gnu-emacs@gnu.org>
@ 2009-08-25 18:44           ` Eli Zaretskii
  2 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2009-08-25 18:44 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Joost Kremers <joostkremers@yahoo.com>
> Date: 25 Aug 2009 07:20:53 GMT
> 
> mmm... on unix, the dash usually means standard input, so what i think is
> happening is that no-word calls antiword and tries to pipe the .doc file to it,
> but antiword doesn't understand, it thinks it needs to process a file named `-'.
> it could be that the windows port of antiword doesn't support reading from
> stdin.

Antiword does support it on Windows, but it sounds like the binary the
OP has fails to read stdin in binary mode in this case.  An error
message one would normally see with this bug would be "- is not a Word
document".




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

* Re: Help to view .doc files with no-word.el & antiword please
       [not found] ` <87r5v1ime4.fsf@lion.rapttech.com.au>
       [not found]   ` <slrnh94o4t.kph.joostkremers@j.kremers4.news.arnhem.chello.nl>
@ 2009-08-25 21:34   ` rpd
  1 sibling, 0 replies; 11+ messages in thread
From: rpd @ 2009-08-25 21:34 UTC (permalink / raw)
  To: Help-gnu-emacs


Hi Tim X-2

Thanks for your txutils.el
I will give it a try as soon as I can & if I get any problems I will post
here!

Many thanks, regards


Tim X-2 wrote:
> 
> rpd <richard@dickinson350.freeserve.co.uk> writes:
> 
>> Hi
>> I am trying to use no-word.el & antiword.exe to view .doc files in Emacs
>> but 
>> unsuccessfully at the moment.
>> I have had a recent post with knubee on this but I still need help.
>>
>> Here is my .emacs code:
>>
> 
> Although not a direct solution, you may find the following useful. I use
> it to convert various different formats to text for viewing within
> emacs. 
> 
> ;;      Filename: /home/tcross/projects/emacs-convert/txutils.el
> ;; Creation Date: Wednesday, 20 September 2006 10:13 PM EST
> ;; Last Modified: Monday, 21 January 2008 01:15 PM EST
> ;;       Version: 2.0
> ;;        Author: Tim Cross <tcross@une.edu.au>
> ;;   Description: Convert files from doc, ps, pdf, ppt to a format
> ;;                which can be viewed within emacs (i.e. text or html)
> 
> ;;; Copyright (C) 2006. Tim Cross <tcross@une.edu.au>
> ;;; All Rights Reserved.
> ;;;
> ;;; This file is not part of GNU Emacs, but the same permissions apply.
> ;;;
> ;;; GNU Emacs is free software; you can redistribute it and/or modify
> ;;; it under the terms of the GNU General Public License as published by
> ;;; the Free Software Foundation; either version 2, or (at your option)
> ;;; any later version.
> ;;;
> ;;; GNU Emacs is distributed in the hope that it will be useful,
> ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
> ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> ;;; GNU General Public License for more details.
> ;;;
> ;;; You should have received a copy of the GNU General Public License
> ;;; along with GNU Emacs; see the file COPYING.  If not, write to
> ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
> ;;;
> ;;; Commentary
> ;;; ==========
> ;;;
> ;;; The very simple idea behind this basic utility is to make accessing
> ;;; files in .doc, .pdf, .ps and .ppt more easily accessible without
> ;;; having to leave emacs or manually convert the file format prior
> ;;; to being able to view the contents in emacs.
> ;;;
> ;;; There are packages which will enable calls to external viewers
> ;;; for files of specific formats, such as xpdf for pdf etc. However,
> ;;; I wanted to have everything within emacs as this makes integration,
> ;;; cutting/pasting etc a lot easier, plus as a blind user, most
> ;;; external utilities are of little use because they don't also include
> ;;; speech support.
> ;;;
> ;;; The objective here is to have things setup so that when browsing
> ;;; a directory with dired, you can just hit 'v' for any file you want to
> ;;; view and you will be presented with a text or html version without
> ;;; needing to do any manual conversion - or even careing about what
> ;;; would need to be done.
> ;;;
> ;;; You need the following packages (or at least utilities which will
> ;;; do the same thing). Most of these are fairly standard with many Linux 
> ;;; distros these days. 
> ;;; The wv utilities which contain wvText for converting MS Word docs
> ;;; The xpdf utilities which include pdftotext for converting PDF to text
> ;;; The Ghostscript package which contains pstotext for converting PS to
> text
> ;;; The ppthtml utility for converting MS Power Point files to html
> ;;; A configured and working browse-url setup. I use w3m as my browser
> ;;;
> ;;; Customizing 
> ;;; ===========
> ;;;
> ;;; The easiest way to customize the conversion utility settings is to
> ;;; use M-x customize-group <RET> txutils <RET>
> ;;;
> ;;; In the txutils customize group, you will find just one setting, which
> ;;; is an alist of values indexed by a regular expression that matches
> against
> ;;; file extensions - a crude way of determining the source filetype
> ;;; (i.e. *.doc, *.pdf, *.ps, *.ppt, *.xls, *.html etc). See the
> ;;; documentation for more details.
> ;;;
> ;;; Installation 
> ;;; ============
> ;;; 
> ;;; Pretty straight forward. Place this file somewhere in your load path 
> ;;; and put a (require 'txutils) in your .emacs. You may want to byte
> ;;; compile this file.
> ;;;
> ;;; Thanks
> ;;; ======
> ;;;
> ;;; A number of people provided suggestions on how to improve both my
> elisp
> ;;; and the program itself. In particular, thanks goes to
> ;;; Lukas Loehrer
> ;;; Vinicius Jose Latorre
> ;;; Andreas Roehler
> ;;;
> ;;; plus a few others who gave general suggestions, feedback and
> ;;; encouragement. Thanks to everyone for taking the time and putting
> ;;; in the effort, its greatly appreciated.
> ;;; 
> ;;; Reporting Bugs
> ;;; ==============
> ;;; 
> ;;; This is the first bit of elisp I've allowed out into the world and 
> ;;; while I am really learning to love both elisp and cl lisp, I'm still 
> ;;; very much a novice. Therefore, there IS bugs and probably some pretty 
> ;;; poor style within this stuff. Feedback, bug reports and suggestions 
> ;;; always welcome. Send e-mail to tcross@une.edu.au
> ;;;
> ;;; Emacspeak Users Note - I've not attempted to enhance this code to
> provide 
> ;;; better spoken or audio icon feedback. When the code matures a bit and
> ;;; once I get some feedback, I will see if a re-worked version can be 
> ;;; included in emacspeak. In the meantime, feel free to use 'advice' to 
> ;;; improve things. 
> 
> (require 'custom)
> (require 'browse-url)
> 
> ; make-temp-file is part of apel prior to emacs 22
> ;(static-when (= emacs-major-version 21)
> ;  (require 'poe))
> 
> (defgroup txutils nil
>   "Customize group for txutils."
>   :prefix "txutils-"
>   :group 'External)
> 
> (defcustom txutils-convert-alist
>   '( ;; MS Word
>     ("\\.\\(?:DOC\\|doc\\)$"     doc  "/usr/bin/wvText"    nil nil nil nil
> nil)
>     ;; PDF
>     ("\\.\\(?:PDF\\|pdf\\)$"     pdf  "/usr/bin/pdftotext" nil nil nil nil
> nil)
>     ;; PostScript
>     ("\\.\\(?:PS\\|ps\\)$"       ps   "/usr/bin/pstotext"  "-output" t nil
> nil nil)
>     ;; MS PowerPoint
>     ("\\.\\(?:PPT\\|ppt\\)$"     ppt  "/usr/bin/ppthtml"   nil nil nil t
> t))
> 
>   "*Association for program convertion.
> 
> Each element has the following form:
> 
> (REGEXP SYMBOL CONVERTER SWITCHES INVERT REDIRECT-INPUT REDIRECT-OUTPUT
> HTML-OUTPUT)
> 
> Where:
> 
> REGEXP		   is a regexp to match file type to convert.
> 
> SYMBOL		   is a symbol to designate the fyle type.
> 
> CONVERTER	   is a program to convert the fyle type to text or HTML.
> 
> SWITCHES	   is a string which gives command line switches for the
> conversion 
>                program. Nil means there are no switches needed.
> 
> INVERT		   indicates if input and output program option is to be 
>                inverted or not.  Non-nil means to invert, that is, output 
>                option first then input option.  Nil means do not invert, 
>                that is, input option first then output option.
> 
> REDIRECT-INPUT indicates to use < to direct input from the input
>                file. This is useful for utilities which accept input
>                from stdin rather than a file.
> 
> REDIRECT-OUTPUT indicates to use > to direct output to the output
>                file. This is useful for utilities that only send output to 
>                stdout.
> 
> HTML-OUTPUT    Indicates the conversion program creates HTML output 
>                rather than plain text."
> 
>   :type '(repeat
>           (list :tag "Convertion"
>                 (regexp  :tag "File Type Regexp")
>                 (symbol  :tag "File Type Symbol")
>                 (string  :tag "Converter")
>                 (choice  :menu-tag "Output Option"
>                          :tag "Output Option"
>                          (const :tag "None" nil)
>                          string)
>                 (boolean :tag "Invert I/O Option")
>                 (boolean :tag "Redirect Standard Input")
>                 (boolean :tag "Redirect Standard Output")
>                 (boolean :tag "HTML Output")))
>   :group 'txutils)
> 
> (defun txutils-run-command (cmd &optional output-buffer)
>   "Execute shell command with arguments, putting output in buffer."
>   (= 0 (shell-command cmd (if output-buffer
>                               output-buffer
>                             "*txutils-output*")
>                           (if output-buffer
>                               "*txutils-output*"))))
> 
> (defun txutils-quote-expand-file-name (file-name)
>   "Expand file name and quote special chars if required."
>   (shell-quote-argument (expand-file-name file-name)))
> 
> (defun txutils-file-alist (file-name)
>   "Return alist associated with file of this type."
>   (let ((al txutils-convert-alist))
>     (while (and al 
>                 (not (string-match (caar al) file-name)))
>       (setq al (cdr al)))
>     (if al
>         (cdar al)
>       nil)))
> 
> (defun txutils-make-temp-name (orig-name type-alist)
>   "Create a temp file name from original file name"
>   (make-temp-file (file-name-sans-extension 
>                    (file-name-nondirectory orig-name)) nil
>                   (if (nth 7 type-alist)
>                       ".html"
>                     ".txt")))
> 
> (defun txutils-build-cmd (input-file output-file type-alist)
>   "Create the command string from conversion alist."
>   (let ((f1 (if (nth 3 type-alist)
>                 output-file
>               input-file))
>         (f2 (if (nth 3 type-alist)
>                 input-file
>               output-file)))
>     (concat
>      (nth 1 type-alist)
>      (if (nth 2 type-alist)               ; Add cmd line switches
>          (concat " " (nth 2 type-alist)))
>      (if (nth 4 type-alist)          ; redirect input (which may be output
>          (concat " < " f1)           ; if arguments are inverted!)
>        (concat " " f1))
>      (if (nth 5 type-alist)          ; redirect output (see above comment)
>          (concat " > " f2)
>        (concat " " f2)))))
> 
> (defun txutils-do-file-conversion (file-name)
>   "Based on file extension, convert file to text. Return name of text
> file"
>   (interactive "fFile to convert: ")
>   (let ((f-alist (txutils-file-alist file-name))
>         output-file)
>     (when f-alist
>       (message "Performing file conversion for %s." file-name)
>       (setq output-file (txutils-make-temp-name file-name f-alist))
>       (message "Command: %s" (txutils-build-cmd file-name output-file
> f-alist))
>       (if (txutils-run-command 
>            (txutils-build-cmd (txutils-quote-expand-file-name file-name)
>                               (txutils-quote-expand-file-name 
>                                output-file) f-alist))
>           output-file
>         file-name))))
> 
> (defadvice view-file (around txutils pre act comp)
>   "Perform file conversion or call web browser to view contents of file."
>   (let ((file-arg (ad-get-arg 0)))
>     (if (txutils-file-alist file-arg)
>       (ad-set-arg 0 (txutils-do-file-conversion file-arg)))
>     (if (string-match "\\.\\(?:HTML?\\|html?\\)$" (ad-get-arg 0))
>         (browse-url-of-file (ad-get-arg 0))
>       ad-do-it)))
> 
> (provide 'txutils)
> 
> 
> 
> -- 
> tcross (at) rapttech dot com dot au
> 
> 

-- 
View this message in context: http://www.nabble.com/Help-to-view-.doc-files-with-no-word.el---antiword-please-tp25102080p25142529.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





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

* Re: Help to view .doc files with no-word.el & antiword please
       [not found]                 ` <mailman.5329.1251219674.2239.help-gnu-emacs@gnu.org>
@ 2009-08-26  6:50                   ` Joost Kremers
  0 siblings, 0 replies; 11+ messages in thread
From: Joost Kremers @ 2009-08-26  6:50 UTC (permalink / raw)
  To: help-gnu-emacs

rpd wrote:
>
> Hi Joost
>
> I do not know what the previous error message was (possibly I had the wrong
> file path?!)
> BUT I am now able to open Word .doc files with M-x no-word-find-file [RET]
> (then enter file path & when I get the path to the file right!).

note that you can use TAB completion: type the first few characters of a file or
directory name and hit TAB: emacs will then complete as much of the name as it
can (or show you the various options if it can't.) that way, it becomes very
difficult to get the file name wrong.


-- 
Joost Kremers                                      joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


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

end of thread, other threads:[~2009-08-26  6:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.5189.1251023783.2239.help-gnu-emacs@gnu.org>
2009-08-23 10:50 ` Help to view .doc files with no-word.el & antiword please Joost Kremers
     [not found]   ` <slrnh94hka.kph.joostkremers@j.kremers4.news.arnhem.chello.nl>
     [not found]     ` <slrnh94n0a.kph.joostkremers@j.kremers4.news.arnhem.chello.nl>
     [not found]       ` <mailman.5240.1251110919.2239.help-gnu-emacs@gnu.org>
2009-08-25  7:20         ` Joost Kremers
2009-08-25 11:51           ` rpd
     [not found]           ` <mailman.5300.1251201164.2239.help-gnu-emacs@gnu.org>
2009-08-25 12:20             ` Joost Kremers
2009-08-25 16:35               ` rpd
2009-08-25 17:01                 ` rpd
     [not found]                 ` <mailman.5329.1251219674.2239.help-gnu-emacs@gnu.org>
2009-08-26  6:50                   ` Joost Kremers
2009-08-25 18:44           ` Eli Zaretskii
     [not found] ` <87r5v1ime4.fsf@lion.rapttech.com.au>
     [not found]   ` <slrnh94o4t.kph.joostkremers@j.kremers4.news.arnhem.chello.nl>
2009-08-25  5:44     ` Tim X
2009-08-25 21:34   ` rpd
2009-08-23 10:36 rpd

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