From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#8177: 24.0.50; `find-file' 2nd time for image file - regression Date: Sat, 05 Mar 2011 10:54:35 +0200 Message-ID: <83ipvyhrqs.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1299316062 25903 80.91.229.12 (5 Mar 2011 09:07:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 5 Mar 2011 09:07:42 +0000 (UTC) Cc: 8177-done@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 05 10:07:38 2011 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.69) (envelope-from ) id 1PvnSb-0002aO-0a for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Mar 2011 10:07:37 +0100 Original-Received: from localhost ([127.0.0.1]:59782 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvnSZ-00009M-0G for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Mar 2011 04:07:35 -0500 Original-Received: from [140.186.70.92] (port=44264 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvnS0-000090-8Z for bug-gnu-emacs@gnu.org; Sat, 05 Mar 2011 04:07:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PvnRt-0003cd-T2 for bug-gnu-emacs@gnu.org; Sat, 05 Mar 2011 04:07:00 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PvnRt-0003cZ-Q5 for bug-gnu-emacs@gnu.org; Sat, 05 Mar 2011 04:06:53 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PvnIM-000625-7G for bug-gnu-emacs@gnu.org; Sat, 05 Mar 2011 03:57:02 -0500 Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Mar 2011 08:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 8177 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 8177@debbugs.gnu.org, eliz@gnu.org Original-Received: via spool by 8177-done@debbugs.gnu.org id=D8177.129931540423165 (code D ref 8177); Sat, 05 Mar 2011 08:57:02 +0000 Original-Received: (at 8177-done) by debbugs.gnu.org; 5 Mar 2011 08:56:44 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PvnI3-00061Z-Sv for submit@debbugs.gnu.org; Sat, 05 Mar 2011 03:56:44 -0500 Original-Received: from mtaout23.012.net.il ([80.179.55.175]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PvnI1-00061L-Fb for 8177-done@debbugs.gnu.org; Sat, 05 Mar 2011 03:56:43 -0500 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LHK00300U2DE200@a-mtaout23.012.net.il> for 8177-done@debbugs.gnu.org; Sat, 05 Mar 2011 10:56:34 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.126.183.216]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LHK00394U69D440@a-mtaout23.012.net.il>; Sat, 05 Mar 2011 10:56:34 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 05 Mar 2011 03:57:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org 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:44647 Archived-At: > From: "Drew Adams" > Date: Sat, 5 Mar 2011 00:03:51 -0800 > Cc: > > 1. This is a regression; it works fine in Emacs 22 and Emacs 23. > > M-: (find-file "...foo.jpg") > > where `...foo.jpg' is an absolute file name of an image file (of a type > that is supported). The image is displayed - no problem. Good. > > Now repeat it: > M-: (find-file "...foo.jpg") > > This time you get an annoying dialog. You should just see the image > again. Similarly, if you hit RET on the file name in Dired - first time > is OK, second time you get sent down the rabbit hole. My bad; fixed now. If you want to try the change, but cannot dump Emacs, apply the patch below, recompile files.el, and manually load files.elc (followed by ls-lisp.elc) into Emacs. > 2. In addition (but this is *not* the main point of this bug report), > the annoying dialog you get uses multiple lines of text (6!) to prompt > in the minibuffer (or in a popup, depending on how you invoke the > function) for a y-or-n answer. The prompt text is *far* too long and > pretty much incomprehensible to an average user. I didn't do anything about this part; suggest a separate bug report, as it's unrelated. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-05 04:11:05 +0000 +++ lisp/ChangeLog 2011-03-05 08:48:52 +0000 @@ -1,3 +1,9 @@ +2011-03-05 Eli Zaretskii + + * files.el (find-file-noselect): Don't ask about re-visiting + non-literally if the file is already visited in image-mode. + (Bug#8177) + 2011-03-05 Glenn Morris * eshell/esh-mode.el (eshell-kill-buffer-function): New function. === modified file 'lisp/files.el' --- lisp/files.el 2011-03-03 08:10:52 +0000 +++ lisp/files.el 2011-03-05 08:48:52 +0000 @@ -1894,8 +1894,8 @@ the various files." (not nonexistent) ;; It is confusing to ask whether to visit ;; non-literally if they have the file in - ;; hexl-mode. - (not (eq major-mode 'hexl-mode))) + ;; hexl-mode or image-mode. + (not (memq major-mode '(hexl-mode image-mode)))) (if (buffer-modified-p) (if (y-or-n-p (format