From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!not-for-mail
From: Markus Triska <markus.triska@gmx.at>
Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs
Subject: bug#577: 23.0.60; editing image files in non-X frames
Date: Sat, 19 Jul 2008 13:39:38 +0200 (CEST)
Message-ID: <20080719113938.E934599A0AF@mt-computer.local>
Reply-To: Markus Triska <markus.triska@gmx.at>, 577@emacsbugs.donarmstrong.com
NNTP-Posting-Host: lo.gmane.org
X-Trace: ger.gmane.org 1216469252 6669 80.91.229.12 (19 Jul 2008 12:07:32 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 19 Jul 2008 12:07:32 +0000 (UTC)
To: emacs-pretest-bug@gnu.org
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 19 14:08:21 2008
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>
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 1KKBEa-0003rL-RM
	for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Jul 2008 14:08:21 +0200
Original-Received: from localhost ([127.0.0.1]:55178 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43)
	id 1KKBDh-0007n6-Ia
	for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Jul 2008 08:07:25 -0400
Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1KKBDd-0007m8-46
	for bug-gnu-emacs@gnu.org; Sat, 19 Jul 2008 08:07:21 -0400
Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1KKBDc-0007lR-Dd
	for bug-gnu-emacs@gnu.org; Sat, 19 Jul 2008 08:07:20 -0400
Original-Received: from [199.232.76.173] (port=51411 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1KKBDc-0007lO-AG
	for bug-gnu-emacs@gnu.org; Sat, 19 Jul 2008 08:07:20 -0400
Original-Received: from rzlab.ucr.edu ([138.23.92.77]:44758)
	by monty-python.gnu.org with esmtps
	(TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60)
	(envelope-from <debbugs@rzlab.ucr.edu>) id 1KKBDc-0004Ky-55
	for bug-gnu-emacs@gnu.org; Sat, 19 Jul 2008 08:07:20 -0400
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 m6JC7Hot017666; 
	Sat, 19 Jul 2008 05:07:17 -0700
Original-Received: (from debbugs@localhost)
	by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m6JBo35w012203;
	Sat, 19 Jul 2008 04:50:03 -0700
X-Loop: don@donarmstrong.com
Resent-From: Markus Triska <markus.triska@gmx.at>
Resent-To: bug-submit-list@donarmstrong.com
Resent-CC: Emacs Bugs <bug-gnu-emacs@gnu.org>
Resent-Date: Sat, 19 Jul 2008 11:50:02 +0000
Resent-Message-ID: <handler.577.B.121646761410525@emacsbugs.donarmstrong.com>
Resent-Sender: don@donarmstrong.com
X-Emacs-PR-Message: report 577
X-Emacs-PR-Package: emacs
X-Emacs-PR-Keywords: 
Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.121646761410525
	(code B ref -1); Sat, 19 Jul 2008 11:50:02 +0000
Original-Received: (at submit) by emacsbugs.donarmstrong.com; 19 Jul 2008 11:40:14 +0000
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 m6JBe7k6010044
	for <submit@emacsbugs.donarmstrong.com>; Sat, 19 Jul 2008 04:40:08 -0700
Original-Received: from mail.gnu.org ([199.232.76.166]:43027 helo=mx10.gnu.org)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <triska@gmx.at>) id 1KKAmd-0003oM-VR
	for emacs-pretest-bug@gnu.org; Sat, 19 Jul 2008 07:39:28 -0400
Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim
	4.60) (envelope-from <triska@gmx.at>) id 1KKAnD-00035z-6b
	for emacs-pretest-bug@gnu.org; Sat, 19 Jul 2008 07:40:06 -0400
Original-Received: from mail.gmx.net ([213.165.64.20]:33151)
	by monty-python.gnu.org with smtp (Exim 4.60)
	(envelope-from <triska@gmx.at>) id 1KKAnC-00035N-Mv
	for emacs-pretest-bug@gnu.org; Sat, 19 Jul 2008 07:40:03 -0400
Original-Received: (qmail invoked by alias); 19 Jul 2008 11:40:00 -0000
Original-Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO
	mt-computer.local) [62.178.240.212]
	by mail.gmx.net (mp011) with SMTP; 19 Jul 2008 13:40:00 +0200
X-Authenticated: #4064391
X-Provags-ID: V01U2FsdGVkX1+/meMMr8e/EZ6SC/tLIrqIJwuJ1PKhnMdwzsJ3Wj
	oE7NczW9fz3iQZ
Original-Received: by mt-computer.local (Postfix, from userid 502)
	id E934599A0AF; Sat, 19 Jul 2008 13:39:38 +0200 (CEST)
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.57
X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3)
X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3)
Resent-Date: Sat, 19 Jul 2008 08:07:20 -0400
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" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
	<mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
	<mailto:bug-gnu-emacs-request@gnu.org?subject=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:18754 gmane.emacs.pretest.bugs:22737
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/18754>

When I do "emacs -Q -nw sample.png", I cannot use C-n etc. on the
image data. The following patch fixes this.


2008-07-19  Markus Triska  <markus.triska@gmx.at>

	* image-mode.el (image-mode): Set image-mode-text-map when image
	cannot be displayed.


diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 5ffbfe1..fb2eaf1 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -333,13 +333,14 @@ to toggle between display as an image and display as text."
   (image-mode-setup-winprops)
 
   (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t)
-  (if (and (display-images-p)
-	   (not (image-get-display-property)))
-      (image-toggle-display)
-    ;; Set next vars when image is already displayed but local
-    ;; variables were cleared by kill-all-local-variables
-    (use-local-map image-mode-map)
-    (setq cursor-type nil truncate-lines t))
+  (if (display-images-p)
+      (if (not (image-get-display-property))
+	  (image-toggle-display)
+	;; Set next vars when image is already displayed but local
+	;; variables were cleared by kill-all-local-variables
+	(use-local-map image-mode-map)
+	(setq cursor-type nil truncate-lines t))
+    (use-local-map image-mode-text-map))
   (run-mode-hooks 'image-mode-hook)
   (if (display-images-p)
       (message "%s" (concat