From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#5102: 23.1; doc-view on a buffer not linked to a file Date: Sun, 06 Dec 2009 21:38:40 -0500 Message-ID: References: <87ljhlbmdt.fsf@ergodik.univ-brest.fr> <87bpiezfov.fsf@mail.jurta.org> <87zl5ygy1f.fsf@thinkpad.tsdh.de> <87pr6t58rg.fsf@mail.jurta.org> Reply-To: Stefan Monnier , 5102@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1260154090 24632 80.91.229.12 (7 Dec 2009 02:48:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Dec 2009 02:48:10 +0000 (UTC) Cc: Tassilo Horn , 5102@emacsbugs.donarmstrong.com, harven To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 07 03:48:04 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NHTdr-0005en-NG for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Dec 2009 03:48:04 +0100 Original-Received: from localhost ([127.0.0.1]:45360 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHTdr-00010f-EH for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Dec 2009 21:48:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHTdO-0000ah-UF for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2009 21:47:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHTdK-0000WW-6R for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2009 21:47:34 -0500 Original-Received: from [199.232.76.173] (port=56897 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHTdJ-0000WT-Un for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2009 21:47:30 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:51534) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NHTdJ-0002dT-D7 for bug-gnu-emacs@gnu.org; Sun, 06 Dec 2009 21:47:29 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB72lPwY025962; Sun, 6 Dec 2009 18:47:27 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nB72j79N025701; Sun, 6 Dec 2009 18:45:07 -0800 Resent-Date: Sun, 6 Dec 2009 18:45:07 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Mon, 07 Dec 2009 02:45:06 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 5102 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5102-submit@emacsbugs.donarmstrong.com id=B5102.126015352825059 (code B ref 5102); Mon, 07 Dec 2009 02:45:06 +0000 Original-Received: (at 5102) by emacsbugs.donarmstrong.com; 7 Dec 2009 02:38:48 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.183]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB72ckUF025055 for <5102@emacsbugs.donarmstrong.com>; Sun, 6 Dec 2009 18:38:48 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArgEAGP5G0tMCrV1/2dsb2JhbACBS9QbgicJggMEih6DKw X-IronPort-AV: E=Sophos;i="4.47,351,1257138000"; d="scan'208";a="50815588" Original-Received: from 76-10-181-117.dsl.teksavvy.com (HELO pastel.home) ([76.10.181.117]) by ironport2-out.pppoe.ca with ESMTP; 06 Dec 2009 21:38:41 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id A515680B4; Sun, 6 Dec 2009 21:38:40 -0500 (EST) In-Reply-To: <87pr6t58rg.fsf@mail.jurta.org> (Juri Linkov's message of "Sun, 06 Dec 2009 01:23:39 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Sun, 06 Dec 2009 21:47:34 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:33342 Archived-At: >>> 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: > : 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))