From 1281bd51e87b6dc3f94418e70d7df5f634133b47 Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Thu, 13 Jan 2011 21:17:15 +0100 Subject: [PATCH] (doc-view-initiate-display): Fall back to normal mode when doc-view-mode cannot be enabled, also when extracting the document text into a separate buffer (bug#6446). --- lisp/ChangeLog | 3 +++ lisp/doc-view.el | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 78a20ea5e43..7adc4359c58 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,9 @@ * doc-view.el (doc-view-open-text): Use meaningful text buffer name. Keep original document's directory as default-directory (bug#6446). + (doc-view-initiate-display): Fall back to normal mode when + doc-view-mode cannot be enabled, also when extracting the document + text into a separate buffer (bug#6446). * simple.el (shell-command): Don't error out if shell command buffer contains text with non-nil read-only property when erasing diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 30b3f56956e..b4fd17ca453 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1243,11 +1243,11 @@ If BACKWARD is non-nil, jump to the previous match." (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)))) + (when (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) -- 2.39.5