all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* how to handle buffer modifications that are not to be saved
@ 2012-03-31 19:06 Will Parsons
  2012-03-31 20:14 ` PJ Weisberg
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Will Parsons @ 2012-03-31 19:06 UTC (permalink / raw)
  To: help-gnu-emacs

I recently discovered a utility (Perl script) to convert a Word .docx
file to plain text (http://docx2txt.sourceforge.net/).  The author
thoughtfully provides the following addition to .emacs for viewing a
.docx file within Emacs using the utility:
----------------
(add-to-list 'auto-mode-alist '("\\.docx\\'" . docx2txt))

(defun docx2txt ()
  "Run docx2txt on the entire buffer."
  (shell-command-on-region (point-min) (point-max) "docx2txt.pl" t t))
----------------
He also warns:

  Be warned that with above ~/.emacs code addition, if you happen to
  save the buffer/file, it will overwrite the .docx file with the text
  content.

I would like to avoid the danger of unintentionally overwriting the
original file.  I know I could do that my renaming the buffer to end
in .txt rather than .docx, but really I probably don't want a separate
text file, or have to answer a question about saving a modified
buffer.  What would be the recommended way of simply making the
converted .docx buffer temporary, so I don't have to worry about
saving it accidentally, or answering any questions about saving it
when exiting?

-- 
Will


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

end of thread, other threads:[~2012-04-03  5:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-31 19:06 how to handle buffer modifications that are not to be saved Will Parsons
2012-03-31 20:14 ` PJ Weisberg
     [not found] ` <mailman.231.1333224894.20052.help-gnu-emacs@gnu.org>
2012-04-01 18:27   ` Will Parsons
2012-04-03  5:13 ` Kevin Rodgers

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.