[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MS Word mode?
From: |
Arnaldo Mandel |
Subject: |
Re: MS Word mode? |
Date: |
Fri, 8 Nov 2002 11:52:33 -0200 |
Alex Schroeder wrote (on Nov 8, 2002):
> Actually all you need is this:
>
> (add-to-list 'auto-mode-alist '("\\.doc\\'" . no-word))
>
> (defun no-word ()
> "Run antiword on the entire buffer."
> (shell-command-on-region (point-min) (point-max) "antiword - " t t))
On my system there are lots of filenames ending in .doc whose files
are not Word files. So I modified your function thusly
(defun no-word ()
"Run antiword on the entire buffer."
(if (string-match "Microsoft "
(shell-command-to-string (concat "file " buffer-file-name)))
(shell-command-on-region (point-min) (point-max) "antiword - " t t)))
Works in Solaris and Linux, and should work on other unixes as well.
am
- MS Word mode?, Tiarnan, 2002/11/07
- Re: MS Word mode?, Julien Avarre, 2002/11/08
- Re: MS Word mode?, Julien Avarre, 2002/11/08
- Re: MS Word mode?, Thomas Link, 2002/11/08
- Re: MS Word mode?, Kin Cho, 2002/11/09