From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#2058: 23.0.60; bewildering behavior when visit new file throw.pdf Date: Tue, 27 Jan 2009 15:46:59 +0100 Message-ID: <871vuoajrw.fsf@thinkpad.tsdh.de> References: <87tz7lt6n7.fsf@thinkpad.tsdh.de> <20090127120236.GB2116@muc.de> <87ab9ckjgd.fsf@thinkpad.tsdh.de> <20090127144220.GA6134@muc.de> Reply-To: Tassilo Horn , 2058@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1233068842 7193 80.91.229.12 (27 Jan 2009 15:07:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 Jan 2009 15:07:22 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, 2058@emacsbugs.donarmstrong.com To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 27 16:08:32 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 1LRpVh-0006RD-0B for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jan 2009 16:05:54 +0100 Original-Received: from localhost ([127.0.0.1]:59854 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRpUO-0007D3-At for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jan 2009 10:04:32 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LRpTV-0006e4-Tv for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 10:03:37 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LRpTR-0006bO-TV for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 10:03:36 -0500 Original-Received: from [199.232.76.173] (port=41467 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRpTR-0006b5-J7 for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 10:03:33 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:37973) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LRpTQ-0004oK-Kd for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 10:03:33 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0RF3Tw0011821; Tue, 27 Jan 2009 07:03:30 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n0REt5Vh009506; Tue, 27 Jan 2009 06:55:05 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Tassilo Horn Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 27 Jan 2009 14:55:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2058 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 2058-submit@emacsbugs.donarmstrong.com id=B2058.12330676328039 (code B ref 2058); Tue, 27 Jan 2009 14:55:04 +0000 Original-Received: (at 2058) by emacsbugs.donarmstrong.com; 27 Jan 2009 14:47:12 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from deliver.uni-koblenz.de (deliver.uni-koblenz.de [141.26.64.15]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0REl1dA008030 for <2058@emacsbugs.donarmstrong.com>; Tue, 27 Jan 2009 06:47:02 -0800 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id A4211789B102; Tue, 27 Jan 2009 15:47:00 +0100 (CET) Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05128-07; Tue, 27 Jan 2009 15:46:59 +0100 (CET) X-CHKRCPT: Envelopesender vrfy tassilo@member.fsf.org Original-Received: from thinkpad.tsdh.de (dhcp37.uni-koblenz.de [141.26.71.37]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 35E76789B033; Tue, 27 Jan 2009 15:46:59 +0100 (CET) In-Reply-To: <20090127144220.GA6134@muc.de> (Alan Mackenzie's message of "Tue, 27 Jan 2009 14:42:20 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-Virus-Scanned: amavisd-new at uni-koblenz.de X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 27 Jan 2009 10:03:36 -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:24618 gmane.emacs.pretest.bugs:23787 Archived-At: Alan Mackenzie writes: Hi Alan, >> But how should I know that. The best I can do is to handle >> non-existing and empty files. > > Does an empty/non-existent file have any meaning in this mode? No, they'll break it as Drew pointed out. > Is doc-view-mode an editing mode as well as a viewing mode? Only viewing, although you can toggle between viewing in doc-view-mode and editing (fundamental-mode or ps-mode with doc-view-minor-mode) with C-c C-c. >> > What on earth is doc-view-mode? Hmm. C-h f doc-view-mode . ;-( > >> Emacs 23. > > Yes, I know. :-) I was looking at the doc string in doc-view.el from > 2009-01-05. Here's the output from that C-h f: > > doc-view-mode is an interactive autoloaded Lisp function in > `doc-view.el'. > > (doc-view-mode) > > Major mode in DocView buffers. > You can use > Uses keymap "doc-view-mode-map", which is not currently defined. > M-x doc-view-toggle-display to > toggle between displaying the document or editing it as text. > > Uses keymap "doc-view-mode-map", which is not currently defined. > > It doesn't work well before the `doc-view-mode-map' keymap is loaded. > But mainly, it doesn't say at all what doc-view-mode is for. Could you > maybe put something about the mode's purpose into the doc string? > Possibly this comment from doc-view.el: > > ;; DocView is a document viewer for Emacs. It converts PDF, PS and D= VI files > ;; to a set of PNG files, one PNG for each page, and displays the PNG= images > ;; inside an Emacs buffer. This buffer uses `doc-view-mode' which pr= ovides > ;; convenient key bindings for browsing the document. > > , or more succinctly: > > Doc View Mode is an Emacs document viewer. It displays PDF, PS and > DVI files (as PNG images) in Emacs buffers. Yes, I'll fix that. The current doc-string is really awful. ;-) >> >> Sure. So what's your advice how to handle this situation? Check if >> >> the file is existent (and non-empty) and if not, print a message and >> >> fallback to fundamental mode? > >> > Whatever is done, don't force the poor bewildered user to make a >> > decision. Perform whatever error handling is appropriate and display >> > a message, and let her get out without further ado. > >> The message is no problem, but what to do with the open request. Open >> the (presumably) mistyped file in fundamental-mode? > > That's more or less what the .gzip mode (can't remember it's exact name) > does - it displays the raw unintelligible file. Ok, I will make it so. >> > "... to switch to an editing mode " is particularly bad. It should be >> > less vague, stating the mode (text mode?). > >> Well, it's ps-mode for PostScript files and fundamental-mode for PDF and >> DVI files. Making that explicit would enlarge the message even more... > > Er, "... to switch to ps-mode" and "... to switch to fundamental mode" > are shorter. Surely you can determine the exact prompt at run time? Thanks for your confidence in me. But yes, it can be done easily. ;-) > Bis sp=E4ter! Jawollja!