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 13:43:46 +0100 Message-ID: <87ab9ckjgd.fsf@thinkpad.tsdh.de> References: <87tz7lt6n7.fsf@thinkpad.tsdh.de> <20090127120236.GB2116@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=us-ascii X-Trace: ger.gmane.org 1233061439 12974 80.91.229.12 (27 Jan 2009 13:03:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 Jan 2009 13:03:59 +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 14:05:09 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 1LRncg-000438-UD for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jan 2009 14:04:59 +0100 Original-Received: from localhost ([127.0.0.1]:42287 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRnbP-00010E-4z for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jan 2009 08:03:39 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LRnbK-0000zL-JI for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 08:03:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LRnbJ-0000yh-Mq for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 08:03:34 -0500 Original-Received: from [199.232.76.173] (port=60487 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRnbJ-0000yZ-BF for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 08:03:33 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:45317) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LRnbH-0005rk-Pd for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 08:03: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 n0RD3TkX012000; Tue, 27 Jan 2009 05:03:29 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n0RCo5xi008532; Tue, 27 Jan 2009 04:50: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 12:50:05 +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.12330602357083 (code B ref 2058); Tue, 27 Jan 2009 12:50:05 +0000 Original-Received: (at 2058) by emacsbugs.donarmstrong.com; 27 Jan 2009 12:43:55 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0RChqaj007075 for <2058@emacsbugs.donarmstrong.com>; Tue, 27 Jan 2009 04:43:53 -0800 Original-Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.fastmail.fm (Postfix) with ESMTP id 84ABA25BABA; Tue, 27 Jan 2009 07:43:51 -0500 (EST) Original-Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 27 Jan 2009 07:43:51 -0500 X-Sasl-enc: blrxrICtJogatluxWSfIKyOHa/aQp8HQlrEdfcXEkpVr 1233060231 Original-Received: from thinkpad.tsdh.de (kobz-590f9e88.pool.einsundeins.de [89.15.158.136]) by mail.messagingengine.com (Postfix) with ESMTPA id C543530F2E; Tue, 27 Jan 2009 07:43:49 -0500 (EST) In-Reply-To: <20090127120236.GB2116@muc.de> (Alan Mackenzie's message of "Tue, 27 Jan 2009 12:02:36 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 27 Jan 2009 08:03: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:24609 gmane.emacs.pretest.bugs:23785 Archived-At: 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-existing and empty files. >> > 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 previous >> > 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. >> 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? > "... 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... > "... 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