GNU bug report logs -
#17985
24.3.92; doc-view-open-text raises wrong-type-argument error
Previous Next
Reported by: Stephen Berman <stephen.berman <at> gmx.net>
Date: Thu, 10 Jul 2014 12:28:01 UTC
Severity: normal
Found in version 24.3.92
Done: Tassilo Horn <tsdh <at> gnu.org>
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 17985 in the body.
You can then email your comments to 17985 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#17985
; Package
emacs
.
(Thu, 10 Jul 2014 12:28:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stephen Berman <stephen.berman <at> gmx.net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 10 Jul 2014 12:28:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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.)
Steve Berman
In GNU Emacs 24.3.92.7 (x86_64-suse-linux-gnu, GTK+ Version 3.10.4)
of 2014-07-10 on rosalinde
Repository revision: 117368 monnier <at> iro.umontreal.ca-20140709185406-m0q0fjepl42pcrqx
Windowing system distributor `The X.Org Foundation', version 11.0.11403901
System Description: openSUSE 13.1 (Bottle) (x86_64)
Configured using:
`configure --without-toolkit-scroll-bars CFLAGS=-g3'
Important settings:
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
=== modified file 'lisp/doc-view.el'
*** lisp/doc-view.el 2014-04-04 17:42:55 +0000
--- lisp/doc-view.el 2014-07-10 11:54:18 +0000
***************
*** 1402,1412 ****
(interactive)
(if doc-view--current-converter-processes
(message "DocView: please wait till conversion finished.")
! (let ((txt (expand-file-name "doc.txt" (doc-view--current-cache-dir))))
(if (file-readable-p txt)
(let ((name (concat "Text contents of "
! (file-name-nondirectory buffer-file-name)))
! (dir (file-name-directory buffer-file-name)))
(with-current-buffer (find-file txt)
(rename-buffer name)
(setq default-directory dir)))
--- 1402,1413 ----
(interactive)
(if doc-view--current-converter-processes
(message "DocView: please wait till conversion finished.")
! (let ((txt (expand-file-name "doc.txt" (doc-view--current-cache-dir)))
! (bname (or buffer-file-name (buffer-name))))
(if (file-readable-p txt)
(let ((name (concat "Text contents of "
! (file-name-nondirectory bname)))
! (dir (or (file-name-directory bname) default-directory)))
(with-current-buffer (find-file txt)
(rename-buffer name)
(setq default-directory dir)))
Reply sent
to
Tassilo Horn <tsdh <at> gnu.org>
:
You have taken responsibility.
(Mon, 28 Jul 2014 09:13:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Stephen Berman <stephen.berman <at> gmx.net>
:
bug acknowledged by developer.
(Mon, 28 Jul 2014 09:13:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 17985-close <at> debbugs.gnu.org (full text, mbox):
Stephen Berman <stephen.berman <at> gmx.net> 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 <stephen.berman <at> gmx.net>
| committer: Tassilo Horn <tsdh <at> gnu.org>
| 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
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#17985
; Package
emacs
.
(Mon, 28 Jul 2014 09:22:02 GMT)
Full text and
rfc822 format available.
Message #13 received at 17985 <at> debbugs.gnu.org (full text, mbox):
> From: Tassilo Horn <tsdh <at> gnu.org>
> Date: Mon, 28 Jul 2014 11:10:06 +0200
> Cc: 17985-close <at> debbugs.gnu.org
>
> Thanks, I've committed it on the trunk. (As it's not a regression, I
> don't think it should go in emacs-24.)
IMO, as the bug is quite an annoyance, and the fix is so simple and
obviously correct, it should go to emacs-24.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#17985
; Package
emacs
.
(Mon, 28 Jul 2014 09:36:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 17985 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Thanks, I've committed it on the trunk. (As it's not a regression, I
>> don't think it should go in emacs-24.)
>
> IMO, as the bug is quite an annoyance, and the fix is so simple and
> obviously correct, it should go to emacs-24.
Ok, done.
Bye,
Tassilo
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#17985
; Package
emacs
.
(Mon, 28 Jul 2014 10:08:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 17985 <at> debbugs.gnu.org (full text, mbox):
On Mon, 28 Jul 2014 11:33:32 +0200 Tassilo Horn <tsdh <at> gnu.org> wrote:
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> Thanks, I've committed it on the trunk. (As it's not a regression, I
>>> don't think it should go in emacs-24.)
>>
>> IMO, as the bug is quite an annoyance, and the fix is so simple and
>> obviously correct, it should go to emacs-24.
>
> Ok, done.
Thanks.
Steve Berman
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 25 Aug 2014 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 10 years and 361 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.