From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" 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 07:44:14 -0800 Message-ID: <001d01c98096$1bb8b7b0$0200a8c0@us.oracle.com> References: <87tz7lt6n7.fsf@thinkpad.tsdh.de> Reply-To: Drew Adams , 2058@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1233072331 21308 80.91.229.12 (27 Jan 2009 16:05:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 Jan 2009 16:05:31 +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 17:06:44 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 1LRqRw-0004tf-0U for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jan 2009 17:06:06 +0100 Original-Received: from localhost ([127.0.0.1]:46648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRqQZ-0004Uv-66 for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jan 2009 11:04:39 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LRqPY-0003jN-IH for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 11:03:36 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LRqPW-0003gg-7I for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 11:03:34 -0500 Original-Received: from [199.232.76.173] (port=60096 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRqPV-0003gN-1p for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 11:03:33 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:35769) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LRqPU-00055T-4N for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 11: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 n0RG3TXs027743; Tue, 27 Jan 2009 08:03:30 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n0RFo3tN024147; Tue, 27 Jan 2009 07:50:03 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: "Drew Adams" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 27 Jan 2009 15:50:03 +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.123307107522783 (code B ref -1); Tue, 27 Jan 2009 15:50:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 27 Jan 2009 15:44:35 +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 n0RFiVnV022777 for ; Tue, 27 Jan 2009 07:44:32 -0800 Original-Received: from mx10.gnu.org ([199.232.76.166]:59148) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LRq5V-0007Lu-11 for emacs-pretest-bug@gnu.org; Tue, 27 Jan 2009 10:42:53 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LRq74-0002FT-73 for emacs-pretest-bug@gnu.org; Tue, 27 Jan 2009 10:44:30 -0500 Original-Received: from rcsinet11.oracle.com ([148.87.113.123]:58102 helo=rgminet11.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LRq73-0002FL-FE for emacs-pretest-bug@gnu.org; Tue, 27 Jan 2009 10:44:29 -0500 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n0RFkGeT028361 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 27 Jan 2009 15:46:17 GMT Original-Received: from acsmt703.oracle.com (acsmt703.oracle.com [141.146.40.81]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n0RFiFFc002249; Tue, 27 Jan 2009 15:44:16 GMT Original-Received: from dradamslap1 (/24.5.128.33) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Jan 2009 15:44:14 +0000 X-Mailer: Microsoft Office Outlook 11 In-reply-to: <87tz7lt6n7.fsf@thinkpad.tsdh.de> Thread-Index: AcmAZXKh27AgVbfKRkaR0lV3swMa1wAKMkRg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: acsmt703.oracle.com [141.146.40.81] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090207.497F2BD0.0240:SCFSTAT928724,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-CrossAssassin-Score: 2 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 27 Jan 2009 11: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:24622 gmane.emacs.pretest.bugs:23790 Archived-At: Hi Tassilo and Alan, The discussion so far has already covered pretty much everything: - it's typically a user-error case, not a use case - the message is too long (probably for all cases - my guess) - the message is too complex and inappropriate for this error case > 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? Yes, I think so. Dunno if doc-view handles an existing empty file - I'd guess not. If it does not then there are two error cases here: (1) a new, empty buffer and (2) an existing empty file. It would be good to treat each of these error cases specially: differently from the normal doc-view bad-PDF error intended by the current message. In both of these cases, the buffer should not be put in doc-view mode, but just kicked into fundamental mode with an error message. The message should not assume the user knows anything about doc view or PDF files. It should just point out that the file (a) doesn't exist or (b) is empty. An alternative would be not to visit the empty file at all - just display an error. But there might be a (marginal) use case for letting the user edit the file in some non-doc-view mode (e.g. fundamental) and even save it. FWIW, I came upon this by trying to create a few phony files to do some Dired, shell etc. testing with. I wanted files (not just buffers) with different, recognized extensions, and I didn't want to take the time to find real PDF files etc. and copy them. Yes, I could have created files with a different extension (*.el, *.txt) and then renamed them, but I didn't. ;-) Another case is what happens if a user visits a non-empty text file named foo.pdf? Again, the buffer should be put in fundamental mode and an error message raised. The message should say that *.pdf is associated with doc-view mode, but this is not a well-formed PDF file. IOW, the not-valid-PDF message must make sense also to a user unfamiliar with images. If you want to give additional info about the invalid PDF in the case of a normal bad-PDF file, then consider giving first such a short message, but mention that the user can hit some key for more information. When s?he hits that key, pop up a buffer with the detailed diagnosis for the bad PDF. FYI - I filed a similar bug for image file: #2077.