Subject: bug#6446: 23.2; doc-view-mode and C-x C-v

From: Reiner Steib <[email-masked]>
Date: Thu, 17 Jun 2010 13:09:19 +0200

Recipe starting from `emacs -Q':

$ rm -fr c:/Users/*/AppData/Local/Temp/docview*

(adjust according to your value of `doc-view-cache-directory')

$ export emacsdir=p:/path/to/GNU/emacs-23.2

(adjust accordingly)

$ cd $emacsdir;
$ ./bin/emacs.exe -Q -f toggle-debug-on-error  
$emacsdir/etc/refcards/refcard.pdf

Emacs (doc-view-mode) prompts:

| Unable to render file.  View extracted text instead? (y or n) y

Hit `y'.  The extracted text is shown.  Fine.
Use find-alternate-file to re-open the PDf file:

| C-x C-v C-a C-k $emacsdir/etc/refcards/refcard.pdf

(<S-insert> in the lossage output inserted this.)

The buffer refcard.pdf now is in DocView mode.
Expected result: Get the prompt "View extracted text instead?" again.

Hit C-n, gives a backtrace:

| Debugger entered--Lisp error: (error "Invalid image specification")
|   image-size(nil)
|   image-next-line(1)
|   doc-view-next-line-or-next-page(1)
|   call-interactively(doc-view-next-line-or-next-page nil nil)

Second bug (or buglet): The message "No PNG support is available, or some
conversion utility for pdf files is missing." is not visible for the use
(unless looking at *Messages*).

Third bug (or buglet): The messages "(wrong-type-argument numberp nil)"

Forth bug (or buglet): With `C-x C-v' I expected the default-directory
to be $emacsdir/etc/refcards/ instead of some random cache dir.  And
maybe the filename could contain "refcard.pdf" (something like
refcard.pdf.txt, maybe).

In GNU Emacs 23.2.1 (i386-mingw-nt6.0.6002)
  of 2010-05-08 on G41R2F1
Windowing system distributor `Microsoft Corp.', version 6.0.6002
configured using `configure --with-gcc (3.4) --no-opt --cflags  
-Ic:/xpm/include'

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:
   tooltip-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   line-number-mode: t
   transient-mark-mode: t

Recent input:
y C-x C-v C-a C-k <help-echo> <help-echo> <S-insert>
<return> C-n M-x r e p o r t - e m a c s - b u g <
return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Debug on Error enabled globally
No PNG support is available, or some conversion utility for pdf files  
is missing.
Unable to render file.  View extracted text instead? (y or n)
Error during redisplay: (wrong-type-argument numberp nil) [3 times]
Entering debugger...
Error during redisplay: (wrong-type-argument numberp nil) [3 times]

Load-path shadows:
None found.

Features:
(shadow sort mail-extr message ecomplete rfc822 mml mml-sec
password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231
rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc
time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock sha1
hex-util hashcash mail-utils emacsbug help-mode view debug doc-view
easymenu jka-compr image-mode dired regexp-opt cus-start cus-load
tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32 disp-table
ls-lisp w32-win w32-vars tool-bar dnd fontset image fringe lisp-mode
register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse
jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
loaddefs button minibuffer faces cus-face files text-properties overlay
md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process multi-tty emacs)