From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie 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 14:42:20 +0000 Message-ID: <20090127144220.GA6134@muc.de> References: <87tz7lt6n7.fsf@thinkpad.tsdh.de> <20090127120236.GB2116@muc.de> <87ab9ckjgd.fsf@thinkpad.tsdh.de> Reply-To: Alan Mackenzie , 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 1233067717 2710 80.91.229.12 (27 Jan 2009 14:48:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 Jan 2009 14:48:37 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, 2058@emacsbugs.donarmstrong.com To: Tassilo Horn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 27 15:49:50 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 1LRpE7-0007yj-Uo for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jan 2009 15:47:44 +0100 Original-Received: from localhost ([127.0.0.1]:44190 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRpCp-0001yJ-SN for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jan 2009 09:46:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LRpA6-00010P-PD for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 09:43:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LRpA5-0000zY-6F for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 09:43:34 -0500 Original-Received: from [199.232.76.173] (port=54531 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRpA4-0000zS-R2 for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 09:43:32 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:45500) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LRpA4-0001VQ-4z for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 09:43:32 -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 n0REhTVK006791; Tue, 27 Jan 2009 06:43:29 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n0REU435003082; Tue, 27 Jan 2009 06:30:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Alan Mackenzie Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 27 Jan 2009 14:30: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.1233066210721 (code B ref 2058); Tue, 27 Jan 2009 14:30:04 +0000 Original-Received: (at 2058) by emacsbugs.donarmstrong.com; 27 Jan 2009 14:23:30 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mail.muc.de (qmailr@colin.muc.de [193.149.48.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0RENQAE000699 for <2058@emacsbugs.donarmstrong.com>; Tue, 27 Jan 2009 06:23:28 -0800 Original-Received: (qmail 76910 invoked by uid 3782); 27 Jan 2009 14:23:25 -0000 Original-Received: from acm.muc.de (pD9E525D8.dip.t-dialin.net [217.229.37.216]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Tue, 27 Jan 2009 15:23:24 +0100 Original-Received: (qmail 7168 invoked by uid 1000); 27 Jan 2009 14:42:20 -0000 Content-Disposition: inline In-Reply-To: <87ab9ckjgd.fsf@thinkpad.tsdh.de> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-MIME-Autoconverted: from 8bit to quoted-printable by rzlab.ucr.edu id n0REhTVK006791 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 27 Jan 2009 09:43: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:24613 gmane.emacs.pretest.bugs:23786 Archived-At: Hi, Tassilo, On Tue, Jan 27, 2009 at 01:43:46PM +0100, Tassilo Horn wrote: > Alan Mackenzie writes: > Hi Alan, > >> > I did C-x C-f throw.pdf, with no existing file throw.pdf. The > >> > ensuing messages and interaction were bewildering. > >> Is that really a use-case? > > No, it's an error case. The user wanted to visit throw.ldf, which is > > a text based document format used only in his own company. But he > > mistyped it. He also knows nothing about png images, and really > > doesn't want to have to learn. > But how should I know that. The best I can do is to handle non-existin= g > and empty files. Does an empty/non-existent file have any meaning in this mode? Is doc-view-mode an editing mode as well as a viewing mode? > >> > But the new, empty file throw.pdf appeared to be visited with no > >> > problem. I tried to type into it. That threw me back to the previo= us > >> > buffer I had been in (Dired), and crazy error msgs were displayed. > >> The buffer was in doc-view-mode which has its own keymap, and most > >> probably you've hit k or q, which kills/buries the buffer. > > 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. > >> 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. > > "... to switch to an editing mode " is particularly bad. It should b= e > > less vague, stating the mode (text mode?). > Well, it's ps-mode for PostScript files and fundamental-mode for PDF an= d > 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? > > "... to open a buffer showing the doc as text" would be better as "to > > show the doc as text". > Will be fixed as soon as I come to it. > Bye, > Tassilo Bis sp=E4ter! --=20 Alan Mackenzie (Nuremberg, Germany).