changeset 103948:53e13148fb68

* doc-view.el (doc-view-initiate-display): Add yes-or-no-p if rendering of pngs is not possible instead of messaging a long description.
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 17 Jul 2009 19:43:49 +0000
parents 37177e1f2fcb
children d7999ea3bbc2
files lisp/ChangeLog lisp/doc-view.el
diffstat 2 files changed, 14 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Jul 17 15:45:08 2009 +0000
+++ b/lisp/ChangeLog	Fri Jul 17 19:43:49 2009 +0000
@@ -1,3 +1,9 @@
+2009-07-17  Tassilo Horn  <tassilo@member.fsf.org>
+
+	* doc-view.el (doc-view-initiate-display): Add yes-or-no-p if
+	rendering of pngs is not possible instead of messaging a long
+	description.
+
 2009-07-17  David De La Harpe Golden  <david@harpegolden.net>
 
 	* w32-fns.el (x-selection-owner-p): New function.
--- a/lisp/doc-view.el	Fri Jul 17 15:45:08 2009 +0000
+++ b/lisp/doc-view.el	Fri Jul 17 19:43:49 2009 +0000
@@ -1078,15 +1078,14 @@
 		  "editing or viewing the document."))))
     (message
      "%s"
-     (substitute-command-keys
-      (concat "No PNG support available or some conversion utility for "
-	      (file-name-extension doc-view-buffer-file-name)" files is missing.  "
-	      "Type \\[doc-view-toggle-display] to switch to "
-	      (if (eq doc-view-doc-type 'ps)
-		  "ps-mode"
-		"fundamental-mode")
-	      ", \\[doc-view-open-text] to show the doc as text in a separate buffer "
-	      " or \\[doc-view-kill-proc-and-buffer] to kill this buffer.")))))
+     (concat "No PNG support is available, or some conversion utility for "
+	     (file-name-extension doc-view-buffer-file-name)
+	     " files is missing."))
+    (if (and (executable-find doc-view-pdftotext-program)
+	     (y-or-n-p
+	      "Unable to render file.  View extracted text instead? "))
+	(doc-view-open-text)
+      (doc-view-toggle-display))))
 
 (defvar bookmark-make-record-function)