unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Arnaldo Mandel <am@ime.usp.br>
Subject: Re: MS Word mode?
Date: Fri, 8 Nov 2002 11:52:33 -0200	[thread overview]
Message-ID: <15819.49569.674208.505936@gargle.gargle.HOWL> (raw)
In-Reply-To: <87fzudc5k0.fsf@emacswiki.org>

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

  parent reply	other threads:[~2002-11-08 13:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1036696597.23451.help-gnu-emacs@gnu.org>
2002-11-07 23:40 ` MS Word mode? Alex Schroeder
2002-11-08 10:48   ` Christian Lemburg
2002-11-08 11:24   ` Tiarnan
2002-11-08 13:52   ` Arnaldo Mandel [this message]
     [not found]   ` <mailman.1036765729.27121.help-gnu-emacs@gnu.org>
2002-11-08 17:24     ` Alex Schroeder
     [not found] <mailman.1036693626.13090.help-gnu-emacs@gnu.org>
2002-11-07 18:59 ` Bruce Mobarry
2002-11-08  6:18 ` Julien Avarre
2002-11-08  9:15 ` Thomas Link
2002-11-09 18:40 ` Kin Cho
2002-11-07 18:01 Tiarnan
2002-11-07 18:48 ` Roger Mason

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=15819.49569.674208.505936@gargle.gargle.HOWL \
    --to=am@ime.usp.br \
    /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.
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).