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 12:02:36 +0000 Message-ID: <20090127120236.GB2116@muc.de> References: <87tz7lt6n7.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 1233057907 1432 80.91.229.12 (27 Jan 2009 12:05:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 Jan 2009 12:05:07 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org To: Tassilo Horn , 2058@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 27 13:06:15 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 1LRmhO-0002zF-2X for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jan 2009 13:05:52 +0100 Original-Received: from localhost ([127.0.0.1]:54008 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRmg6-00010l-7n for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jan 2009 07:04:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LRmfG-0000h3-5b for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 07:03:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LRmfE-0000gW-Rf for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 07:03:33 -0500 Original-Received: from [199.232.76.173] (port=52021 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRmfE-0000gG-FO for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 07:03:32 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:38046) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LRmfD-0006Oj-Pt for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 07: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 n0RC3T2l028926; Tue, 27 Jan 2009 04:03:29 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n0RBo4pY025429; Tue, 27 Jan 2009 03:50: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 11:50: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 submit@emacsbugs.donarmstrong.com id=B.123305663624015 (code B ref -1); Tue, 27 Jan 2009 11:50:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 27 Jan 2009 11:43:56 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0RBho7r024009 for ; Tue, 27 Jan 2009 03:43:51 -0800 Original-Received: from mx10.gnu.org ([199.232.76.166]:46014) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LRmKa-0003Dg-9d for emacs-pretest-bug@gnu.org; Tue, 27 Jan 2009 06:42:12 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LRmM6-0003gz-6K for emacs-pretest-bug@gnu.org; Tue, 27 Jan 2009 06:43:47 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:4119 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LRmM5-0003gp-Gr for emacs-pretest-bug@gnu.org; Tue, 27 Jan 2009 06:43:45 -0500 Original-Received: (qmail 35343 invoked by uid 3782); 27 Jan 2009 11:43:43 -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 12:43:41 +0100 Original-Received: (qmail 4998 invoked by uid 1000); 27 Jan 2009 12:02:36 -0000 Content-Disposition: inline In-Reply-To: <87tz7lt6n7.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-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-MIME-Autoconverted: from 8bit to quoted-printable by rzlab.ucr.edu id n0RC3T2l028926 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 27 Jan 2009 07:03:33 -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:24607 gmane.emacs.pretest.bugs:23784 Archived-At: Hi, Tassilo, On Tue, Jan 27, 2009 at 10:55:40AM +0100, Tassilo Horn wrote: > "Drew Adams" writes: > Hi Drew, > > emacs -Q > > 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. > > An extremely long message appeared in the echo area: > > "No image (png) support available or some conversion utility for pdf > > files is missing. Type C-c C-c to switch to an editing mode or C-c > > C-t to open a buffer showing the doc as text." It's particularly long and confusing for a non-existent document. Emacs shouldn't alarm users. > > 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 . ;-( > > I tried again, and this time I tried to type `C-c C-t', since the=20 > > message indicated that that would open the buffer as text. That too > > led to errors. > Yeah, in the background it tries to run pdftotext on the pdf, to extrac= t > the plain text contents. > > I don't know exactly what happened, but you will, as soon as you try > > it. ;-) > Sure. So what's your advice how to handle this situation? Check if th= e > 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. "... to switch to an editing mode " is particularly bad. It should be less vague, stating the mode (text mode?). "... to open a buffer showing the doc as text" would be better as "to show the doc as text". > Bye, > Tassilo --=20 Alan Mackenzie (N=FCrnberg, Germany).