Subject: Re: bug#17985: 24.3.92; doc-view-open-text raises wrong-type-argument error
From: Tassilo Horn <[email-masked]>
To: Stephen Berman <[email-masked]>
Cc: [email-masked]
Date: Mon, 28 Jul 2014 11:10:06 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Stephen Berman <[email-masked]> writes:

> If I'm using Gnus to read mail with an attachment, I can type `c' on
> the attachment to view it in another buffer, and if the attachment is
> something that Doc View can handle, I can type `C-c C-c' in the buffer
> to view the rendered image of the attachment.  But if I then type `C-c
> C-t' (doc-view-open-text) to view the ascii text of the attachment, I
> get this error:
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   file-name-nondirectory(nil)
>   doc-view-open-text()
>   call-interactively(doc-view-open-text nil nil)
>   command-execute(doc-view-open-text)
>
> The reason is that Doc View expects the buffer to be visiting a file.
> But with an mail attachment, that does not have to be the case (when I
> type `C-c C-c', Doc View says: "The buffer has been modified.  Save the
> changes? (y or n)", but if I answer "n", it still renders the image).
> The following patch lets me view the ascii text whether or not the
> buffer containing the document is visiting a file.  (The patch is
> against emacs-24; the error also happens in trunk.)

Thanks, I've committed it on the trunk.  (As it's not a regression, I
don't think it should go in emacs-24.)

,----
| revno: 117599
| author: Stephen Berman  <[email-masked]>
| committer: Tassilo Horn <[email-masked]>
| branch nick: trunk
| timestamp: Mon 2014-07-28 11:07:56 +0200
| message:
|   Open doc text also if it's not saved to a file.
|   
|   * doc-view.el (doc-view-open-text): Don't require that the
|   document is saved in a file (e.g., email attachment).
`----

Bye,
Tassilo