From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Brent Goodrick Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#5062: 23.1.50; image-toggle-display overwrites nxml-mode local key map Date: Fri, 27 Nov 2009 16:44:30 -0800 Message-ID: Reply-To: Brent Goodrick , 5062@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1259370467 19306 80.91.229.12 (28 Nov 2009 01:07:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Nov 2009 01:07:47 +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 Nov 28 02:07:39 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 1NEBmj-0007Dz-4a for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Nov 2009 02:07:37 +0100 Original-Received: from localhost ([127.0.0.1]:38055 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NEBmi-0003Wi-EI for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Nov 2009 20:07:36 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NEBmd-0003W4-8A for bug-gnu-emacs@gnu.org; Fri, 27 Nov 2009 20:07:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NEBmY-0003UT-Gw for bug-gnu-emacs@gnu.org; Fri, 27 Nov 2009 20:07:30 -0500 Original-Received: from [199.232.76.173] (port=39757 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NEBmY-0003UQ-EE for bug-gnu-emacs@gnu.org; Fri, 27 Nov 2009 20:07:26 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:35061) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NEBmY-0000jS-4Y for bug-gnu-emacs@gnu.org; Fri, 27 Nov 2009 20:07:26 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAS17MCX022057; Fri, 27 Nov 2009 17:07:23 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nAS0o4Sr019987; Fri, 27 Nov 2009 16:50:04 -0800 Resent-Date: Fri, 27 Nov 2009 16:50:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Brent Goodrick Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Sat, 28 Nov 2009 00:50:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 5062 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125936907619532 (code B ref -1); Sat, 28 Nov 2009 00:50:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 28 Nov 2009 00:44:36 +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.14.3/8.14.3/Debian-5) with ESMTP id nAS0iYwe019529 for ; Fri, 27 Nov 2009 16:44:35 -0800 Original-Received: from mx10.gnu.org ([199.232.76.166]:38389) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1NEBQP-0007JP-Sg for emacs-pretest-bug@gnu.org; Fri, 27 Nov 2009 19:44:34 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NEBQO-0007c6-B3 for emacs-pretest-bug@gnu.org; Fri, 27 Nov 2009 19:44:33 -0500 Original-Received: from mail-bw0-f215.google.com ([209.85.218.215]:53031) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NEBQN-0007bs-T5 for emacs-pretest-bug@gnu.org; Fri, 27 Nov 2009 19:44:32 -0500 Original-Received: by bwz7 with SMTP id 7so768807bwz.26 for ; Fri, 27 Nov 2009 16:44:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=YRJl5EjRw/eBqVwSfjuMghhCOFebK734CvWRRZeOYkU=; b=XKDfAaHnqVPpRPGSNU4GaTUBOBk/r0M06G2NqTlqND06D7HehlxfPU41o6s1uqZ71y j6o3LUHmUO558q1FQHWDYj/ySHq3tGbDn6xpsnKRBjQcQ/zmH2OYj7hqH8fJ+NMyIcV8 9exiuPvrfrKbITE+zet3KnxA12LaHVZF13cUk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Bm47T/67TCy750JphoA9bImUl/HX/nhxKzSN32Q0xK8/0C4MEN73omZwCpLxCYqCXo HaUzu5Rzz6Mf6btvkf+YaGH3RNxGjZmXyJb+7N5fD0xT27K1YnBhJ1oyDlDpbMSuBhlK BJWlFrb7Z3CTUlXFcwgry6P2QgqQT7/MVvL8A= Original-Received: by 10.204.152.154 with SMTP id g26mr1745214bkw.54.1259369070066; Fri, 27 Nov 2009 16:44:30 -0800 (PST) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Fri, 27 Nov 2009 20:07:30 -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:33001 gmane.emacs.pretest.bugs:25252 Archived-At: Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list. Please describe exactly what actions triggered the bug and the precise symptoms of the bug. If you can, give a recipe starting from `emacs -Q': Insure that you have Emacs 23 built on Debian Squeeze Linux with librsvg2 library (or similar OS's and libraries), just to get the image-mode to interact with nxml-mode in its keybindings for a .svg file which is an XML derivative for SVG files. Then proceed as follows: 1. Store the following XML content into a file called /tmp/test.svg --- cut below this line --- Sample Title Sample Description 10px 1px --- cut above this line --- 2. Run emacs -Q and wait for it to load and map into the display. 3. Type C-x C-f /tmp/test.svg and see that the image of the file is displayed. 4. Type C-c C-c and note that the XML is shown. All correct behavior so far. 5. Type C-h k C-M-n and notice that the key for C-M-n is bound to `forward-list' which is not correct because the .svg file is a xml file, that, by default, should be bound to `nxml-forward-element' by the defvar for nxml-mode-map inside share/emacs/23.1.50/lisp/nxml/nxml-mode.el.gz. Notice also that nxml-mode applies its own local map with this call inside the `nxml-mode' function: (use-local-map nxml-mode-map) But compare that with `image-toggle-display' where it either calls: (use-local-map image-mode-text-map) or (use-local-map image-mode-map) Neither of which respects the nxml-mode's bindings. For validation, you can inject a "trampoline" function on `use-local-map' to show who overwrites the local map, as follows: (progn (defun xx-new-use-local-map (&rest args) (message "xx-new-use-local-map called from:\n") (backtrace) (apply xx-orig-use-local-map args)) (when (not (boundp 'xx-orig-use-local-map)) (setq xx-orig-use-local-map (symbol-function 'use-local-map)) (fset 'use-local-map 'xx-new-use-local-map))) where the "xx-*" functions were arbitrary for this bug report. Once xx-new-use-local-map is injected as given above, then use C-h C-e to see what happens when you first execute C-x C-f /tmp/test.svg, and then see it again when hitting C-c C-c while in the test.svg buffer. You will see that image-mode function obliterates the local map set by the `nxml-mode' function. I don't know what the correct solution here should be, and many questions arise: a. Should image-mode be a minor mode of nxml-mode, or, b. Should `image-mode' stash a copy of the current buffers (current-local-map), and restore it afterwards, but also applying the special binding for C-c C-c, or, c. Should `image-mode' make the other modes local map be the parent of its own local map? I'm thinking (c)? Thanks to whomever added SVG capabilities to Emacs! bgoodr If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. For information about debugging Emacs, please read the file /home/brentg/install/Linux.x86_64/share/emacs/23.1.50/etc/DEBUG. Emacs did not crash. In GNU Emacs 23.1.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.18.2) of 2009-10-31 on hungover Windowing system distributor `The X.Org Foundation', version 11.0.10605000 configured using `configure '--with-x-toolkit' '--with-xft' '--prefix=/home/brentg/install/Linux.x86_64'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: nXML Minor modes in effect: image-minor-mode: t tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-x C-f C-v / t m p / C-x h C-b C-b C-b C-g C-x C-f C-SPC M-b C-b / t m p C-d C-d C-d C-d C-d / t e s t . s v g C-v C-x C-s C-x C-v C-c C-c C-h k C-M-n M-x r e p o r t - e m Recent messages: File mode specification error: (error "Cannot determine image type") call-interactively: End of buffer Mark set Saving file /tmp/test.svg... Wrote /tmp/test.svg Using vacuous schema Type C-c C-c to view the image as text. Repeat this command to go back to displaying the image Type C-x 1 to delete the help window. Load-path shadows: None found. Features: (shadow mail-extr message ecomplete rfc822 mml mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock sha1 hex-util hashcash mail-utils emacsbug sendmail help-fns help-mode view nxml-uchnm rng-xsd xsd-regexp rng-cmpct regexp-opt rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns easymenu nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc xmltok cl cl-19 jka-compr image-mode tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gtk x-toolkit x multi-tty emacs)