From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/42494 Path: main.gmane.org!not-for-mail From: Joakim Hove Newsgroups: gmane.emacs.gnus.general Subject: Re: What view for these nasty word *.doc files Date: 24 Jan 2002 09:32:16 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035177728 12057 80.91.224.250 (21 Oct 2002 05:22:08 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 05:22:08 +0000 (UTC) Cc: Return-Path: Original-Received: (qmail 23573 invoked from network); 24 Jan 2002 08:33:01 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 24 Jan 2002 08:33:01 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16TfJL-00011z-00; Thu, 24 Jan 2002 02:32:43 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 24 Jan 2002 02:32:35 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id CAA14127 for ; Thu, 24 Jan 2002 02:32:23 -0600 (CST) Original-Received: (qmail 23566 invoked by alias); 24 Jan 2002 08:32:22 -0000 Original-Received: (qmail 23561 invoked from network); 24 Jan 2002 08:32:22 -0000 Original-Received: from solan.itea.ntnu.no (129.241.190.100) by gnus.org with SMTP; 24 Jan 2002 08:32:22 -0000 Original-Received: from metropolis.phys.ntnu.no.phys.ntnu.nu (metropolis.phys.ntnu.no [129.241.48.32]) by solan.itea.ntnu.no (8.12.1/8.12.1) with ESMTP id g0O8WGOM000247; Thu, 24 Jan 2002 09:32:16 +0100 (MET) Original-To: Harry Putnam In-Reply-To: (Harry Putnam's message of "Wed, 23 Jan 2002 15:00:30 -0800") Original-Lines: 34 User-Agent: Gnus/5.090003 (Oort Gnus v0.03) Emacs/20.7 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:42494 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:42494 --=-=-= Harry Putnam writes: > What technique do people use to open these nasty word *.doc files? > I mean besides threatening to shoot the sender... On Linux I use the program antiword: which aI reckon better than catdoc. And the following lisp (documentation unfortunately in norwegian - please ask if you have questions.): --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=word-lisp.el Content-Transfer-Encoding: 8bit ;; Free Sowftare ;; Joakim Hove ;; ;; (defun load-doc-file-internal (doc-file) "The backend for loading doc-files" (let* ((txt-file (concat (file-name-sans-extension doc-file) ".txt")) (txt-buffer (get-buffer-create (concat (file-name-sans-extension (file-name-nondirectory doc-file)) ".txt")))) (shell-command (format "antiword %s" doc-file)) (set-buffer txt-buffer) (insert-buffer "*Shell Command Output*") (switch-to-buffer txt-buffer) (delete-other-windows) (set-visited-file-name txt-file) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun load-doc-file (doc-file) "Lar deg spesifisere et navn på an word fil, og kjører så antiword på denne." (interactive "fName of word file to load: ") (load-doc-file-internal doc-file) ) (defun load-doc-cmd () "Lar deg load word-filer fra kommandolinjen : %bash emacs -f load-doc-cmd word-file.doc" (interactive) (let* ((arg-index 0) (arg-file) (arg (nth arg-index command-line-args))) (while (and (not (string= arg "load-doc-cmd")) (< arg-index (length command-line-args))) (setq arg-index (1+ arg-index)) (setq arg (nth arg-index command-line-args)) ) (if (string= arg "load-doc-cmd") (progn (setq arg-file (nth (1+ arg-index) command-line-args)) (load-doc-file-internal arg-file) ) ) ) (setq command-line-args-left (cdr command-line-args-left)) ) (defun load-word-file (doc-file) "Lar deg spesifisere et navn på an word fil, og kjører så antiword på denne." (interactive "fName of word file to load: ") (load-doc-file-internal doc-file) ) --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit This lisp defines two functions: load-word-file - which is used to open a word file load-doc-cmd - which is used on the command line, i.e. bash% emacs -f load-doc-cmd DocFile.doc will open fire up emacs, and then load the wordfile "DocFile.doc". Joakim Hove -- ==== Joakim Hove www.phys.ntnu.no/~hove/ ======================= || Institutt for fysikk (735) 93637 / E3-166 | Skøyensgate 10D || || N - 7491 Trondheim hove@phys.ntnu.no | N - 7030 Trondheim || ================================================= 73 93 31 68 ========= --=-=-=--