GNU bug report logs - #3865
23.0.95; doc-view-mode with PDF without PNG support

Previous Next

Package: emacs;

Reported by: reiner.steib <at> gmx.de

Date: Thu, 16 Jul 2009 09:05:04 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 3865 in the body.
You can then email your comments to 3865 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3865; Package emacs. (Thu, 16 Jul 2009 09:05:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to reiner.steib <at> gmx.de:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 16 Jul 2009 09:05:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Reiner Steib <reinersteib+gmane <at> imap.cc>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.0.95; doc-view-mode with PDF without PNG support
Date: Thu, 16 Jul 2009 11:01:43 +0200
Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

To reproduce:

   M-x toggle-debug-on-error RET
   M-x toggle-debug-on-quit RET
   C-x C-f some-pdf-file.pdf

I get the message:

    No PNG support available or some conversion utility for pdf files is
    missing.  Type C-c C-c to switch to fundamental-mode, C-c C-t to
    show the doc as text in a separate buffer or k to kill this buffer.

I don't have the png-DLL installed:
  (image-type-available-p 'png) -> nil
Maybe also some of the conversion programs are not installed.  But I  
just wanted to view/edit the PDF file.

Problems:

- The message is too long to be read in the echo area.

- When pressing some key (e.g. `down'), I get "image-next-line: Invalid
  image specification". So the first message disappears as soon as the
  user does a movement.

This hit me several times.  I didn't realize the message so I killed the
buffer and used `find-file-literally'.

I think the right behavior would be either...

(1) Switch to fundamental-mode automatically if doc-view-mode cannot do
    anything useful and just display a message.

(2) Instead of telling about `C-c C-c', `C-c C-t' and `k', use a
    (y-or-n-p) dialog.

In GNU Emacs 23.0.95.1 (i386-mingw-nt6.0.6001)
 of 2009-06-20 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 6.0.6001
configured using `configure --with-gcc (3.4)'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: DEU
  value of $XMODIFIERS: nil
  locale-coding-system: cp1252
  default-enable-multibyte-characters: t

Major mode: Debugger

Minor modes in effect:
  show-paren-mode: t
  savehist-mode: t
  recentf-mode: t
  msb-mode: t
  iswitchb-mode: t
  desktop-save-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <tool-bar> <server-start>
<help-echo> <help-echo> <down-mouse-1> <mouse-1> C-x
C-f <up> <up> <up> <up> C-g M-x t o g g <tab> d e <tab>
e <tab> <return> M-x <up> <end> <backspace> <backspace>
<backspace> <backspace> <backspace> q <tab> <return>
C-x C-f <up> <up> <up> <return> <down> M-x r e p o
r t - e m <tab> <return>

Recent messages:
Cleaning up the recentf list...done (0 removed)
No desktop file.
For information about GNU Emacs and the GNU system, type C-h C-a.
Quit
Debug on Error enabled globally
Debug on Quit enabled globally
No PNG support available or some conversion utility for pdf files is  
missing.  Type C-c C-c to switch to fundamental-mode, C-c C-t to show  
the doc as text in a separate buffer  or k to kill this buffer.
Error during redisplay: (wrong-type-argument numberp nil)
Entering debugger...
Error during redisplay: (wrong-type-argument numberp nil) [4 times]

*Backtrace*:
Debugger entered--Lisp error: (error "Invalid image specification")
  image-size(nil)
  image-next-line(1)
  call-interactively(image-next-line nil nil)


Bye, Reiner



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3865; Package emacs. (Fri, 17 Jul 2009 18:55:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tassilo Horn <tassilo <at> member.fsf.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 17 Jul 2009 18:55:05 GMT) Full text and rfc822 format available.

Message #10 received at 3865 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Tassilo Horn <tassilo <at> member.fsf.org>
To: emacs-devel <at> gnu.org
Cc: 3865 <at> debbugs.gnu.org
Subject: Patch for #3865: Would somebody please commit on HEAD and branch?
Date: Fri, 17 Jul 2009 20:51:58 +0200
Hi all,

this patch fixes the inconveniences Reiner pointed out in #3865.  Could
somebody please commit it for me on branch and head?

I'm to busy to read up how to merge between branches with CVS -- I'm
going to marry tomorrow! :-)

--8<---------------cut here---------------start------------->8---
2009-07-16  Tassilo Horn  <tassilo <at> 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.
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
Index: lisp/doc-view.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/doc-view.el,v
retrieving revision 1.87
diff -u -r1.87 doc-view.el
--- lisp/doc-view.el	2 Apr 2009 21:12:56 -0000	1.87
+++ lisp/doc-view.el	17 Jul 2009 18:44:18 -0000
@@ -1078,15 +1078,12 @@
 		  "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 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)
+	     (yes-or-no-p "Cannot render file.  View extracted text instead? "))
+	(doc-view-open-text)
+      (doc-view-toggle-display))))
 
 (defvar bookmark-make-record-function) 
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3865; Package emacs. (Fri, 17 Jul 2009 19:25:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bastien <bastienguerry <at> googlemail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 17 Jul 2009 19:25:05 GMT) Full text and rfc822 format available.

Message #15 received at 3865 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Bastien <bastienguerry <at> googlemail.com>
To: emacs-devel <at> gnu.org
Cc: 3865 <at> debbugs.gnu.org
Subject: Re: Patch for #3865: Would somebody please commit on HEAD and branch?
Date: Fri, 17 Jul 2009 21:17:28 +0200
Tassilo Horn <tassilo <at> member.fsf.org> writes:

> this patch fixes the inconveniences Reiner pointed out in #3865.  Could
> somebody please commit it for me on branch and head?

I'm willing to do this.

> I'm to busy to read up how to merge between branches with CVS -- I'm
> going to marry tomorrow! :-)

I also need to learn how to do this.  Pointers anyone? 

-- 
 Bastien



Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. (Fri, 17 Jul 2009 19:50:04 GMT) Full text and rfc822 format available.

Notification sent to reiner.steib <at> gmx.de:
bug acknowledged by developer. (Fri, 17 Jul 2009 19:50:04 GMT) Full text and rfc822 format available.

Message #20 received at 3865-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: emacs-devel <at> gnu.org
Cc: 3865-done <at> debbugs.gnu.org
Subject: Re: Patch for #3865: Would somebody please commit on HEAD and branch?
Date: Fri, 17 Jul 2009 15:44:39 -0400
Tassilo Horn <tassilo <at> member.fsf.org> writes:

> this patch fixes the inconveniences Reiner pointed out in #3865.  Could
> somebody please commit it for me on branch and head?

I've checked it into the trunk.  I don't think this is serious enough to
commit to the branch.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3865; Package emacs. (Sun, 19 Jul 2009 05:40:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 19 Jul 2009 05:40:05 GMT) Full text and rfc822 format available.

Message #25 received at 3865 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: emacs-devel <at> gnu.org
Cc: 3865 <at> debbugs.gnu.org
Subject: Re: Patch for #3865: Would somebody please commit on HEAD and branch?
Date: Sun, 19 Jul 2009 01:34:46 -0400
> +    (if (and (executable-find doc-view-pdftotext-program)
> +	     (yes-or-no-p "Cannot render file.  View extracted text instead? "))
> +	(doc-view-open-text)
> +      (doc-view-toggle-display))))

Please avoid modal UIs wherever possible.  E.g. rather than ask with
yes-or-no-p, just choose one of the two branches (maybe based on
a config var) and output a message explaining how to get the
other branch.


        Stefan



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Sun, 16 Aug 2009 14:24:19 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 313 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.