all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Juri Linkov <juri@jurta.org>
Cc: Tassilo Horn <tassilo@member.fsf.org>,
	5102@emacsbugs.donarmstrong.com, harven <harven@free.fr>
Subject: bug#5102: 23.1; doc-view on a buffer not linked to a file
Date: Sun, 06 Dec 2009 21:38:40 -0500	[thread overview]
Message-ID: <jwviqcjjyph.fsf-monnier+emacsbugreports@gnu.org> (raw)
In-Reply-To: <87pr6t58rg.fsf@mail.jurta.org> (Juri Linkov's message of "Sun, 06 Dec 2009 01:23:39 +0200")

>>> No, it cannot handle non-file buffers, because ghostscript and friends
>>> only handle input files and don't support piping in the output.  So the
>> It already has special code for Tramp and jka-compr files, where it
>> saves the buffer's content to a temp file.
>> Harven(?), does the patch below help?
> Mails to Harven bounce back with the error:
>   <harven@free.fr>: host mx1.free.fr said: 550 5.2.1 This mailbox
>     has been blocked due to inactivity (in reply to RCPT TO command)
> So I tried out your patch and it fails with:
>   Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>     file-name-nondirectory(nil)
>     doc-view-mode()
>     doc-view-toggle-display()
>     call-interactively(doc-view-toggle-display nil nil)
> I don't understand how do you expect it to work.

Witha bit more help.  I've installed the patch below which seems to work
for me,


        Stefan


--- doc-view.el.~1.93.~	2009-11-30 22:13:35.000000000 -0500
+++ doc-view.el	2009-12-06 21:35:39.000000000 -0500
@@ -563,7 +563,7 @@
     (setq doc-view-current-cache-dir
 	  (file-name-as-directory
 	   (expand-file-name
-	    (concat (file-name-nondirectory buffer-file-name)
+	    (concat (file-name-nondirectory doc-view-buffer-file-name)
 		    "-"
 		    (let ((file doc-view-buffer-file-name))
 		      (with-temp-buffer
@@ -1228,6 +1228,7 @@
     (set (make-local-variable 'doc-view-buffer-file-name)
 	 (cond
 	  (jka-compr-really-do-compress
+           ;; FIXME: there's a risk of name conflicts here.
 	   (expand-file-name
 	    (file-name-nondirectory
 	     (file-name-sans-extension buffer-file-name))
@@ -1237,9 +1238,12 @@
 	  ;; supposed to return nil for things like local files accessed via
 	  ;; `su' or via file://...
 	  ((let ((file-name-handler-alist nil))
-	     (not (file-readable-p buffer-file-name)))
+	     (not (and buffer-file-name (file-readable-p buffer-file-name))))
+           ;; FIXME: there's a risk of name conflicts here.
 	   (expand-file-name
+	    (if buffer-file-name
 	    (file-name-nondirectory buffer-file-name)
+              (buffer-name))
 	    doc-view-cache-directory))
 	  (t buffer-file-name)))
     (when (not (string= doc-view-buffer-file-name buffer-file-name))





  reply	other threads:[~2009-12-07  2:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <jwv638i610l.fsf-monnier+emacsbugreports@gnu.org>
2009-12-02 12:17 ` bug#5102: 23.1; doc-view on a buffer not linked to a file harven
2009-12-04 21:50   ` Juri Linkov
2009-12-04 22:43     ` Tassilo Horn
2009-12-04 23:18       ` Drew Adams
2009-12-05 10:12         ` Tassilo Horn
2009-12-05 18:49       ` Stefan Monnier
2009-12-05 23:23         ` Juri Linkov
2009-12-07  2:38           ` Stefan Monnier [this message]
2009-12-07 17:51             ` Juri Linkov
2009-12-07 19:30   ` bug#5102: marked as done (23.1; doc-view on a buffer not linked to a file) Emacs bug Tracking System

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwviqcjjyph.fsf-monnier+emacsbugreports@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=5102@emacsbugs.donarmstrong.com \
    --cc=harven@free.fr \
    --cc=juri@jurta.org \
    --cc=tassilo@member.fsf.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.