From: Brent Goodrick <bgoodr@gmail.com>
To: emacs-pretest-bug@gnu.org
Subject: bug#5062: 23.1.50; image-toggle-display overwrites nxml-mode local key map
Date: Fri, 27 Nov 2009 16:44:30 -0800 [thread overview]
Message-ID: <e38bce640911271644l148dbc9g1fb378e6b4dbc248@mail.gmail.com> (raw)
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 ---
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="400px" height="400px" viewBox="0 0 4000 4000"
xmlns="http://www.w3.org/2000/svg" version="1.1">
<title>Sample Title</title>
<desc>Sample Description</desc>
<g transform="translate(200,200)">
<rect x="0" y="0" width="400" height="400"
fill="none" stroke="blue" stroke-width="10px"/>
<g transform="translate(50,25)">
<text x="0" y="0" fill="white" stroke="none">10px</text>
</g>
</g>
<g transform="translate(200,1000)">
<rect x="0" y="0" width="400" height="400"
fill="none" stroke="green" stroke-width="10px"/>
<g transform="translate(50,25)">
<text x="0" y="0" fill="white" stroke="none">1px</text>
</g>
</g>
</svg>
--- 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 <backspace> C-b C-b C-b
C-g C-x C-f C-SPC M-b C-b <backspace> / t m p C-d C-d
C-d C-d C-d / t e s t . s v g <return> C-v <help-echo>
<help-echo> <help-echo> <down-mouse-2> <mouse-2> C-x
C-s C-x C-v <return> C-c C-c C-h k C-M-n M-x r e p
o r t - e m <tab> <return>
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)
next reply other threads:[~2009-11-28 0:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <878wdixvgt.fsf@mail.jurta.org>
2009-11-28 0:44 ` Brent Goodrick [this message]
2009-11-28 2:25 ` bug#5062: 23.1.50; image-toggle-display overwrites nxml-mode local key map Stefan Monnier
2009-11-28 15:26 ` Brent Goodrick
2009-11-28 17:49 ` Juri Linkov
2009-11-28 20:21 ` Stefan Monnier
2009-11-28 22:54 ` Juri Linkov
2009-11-29 15:36 ` Stefan Monnier
2009-11-29 16:03 ` Juri Linkov
2009-11-29 18:33 ` Stefan Monnier
2009-11-29 22:00 ` Lennart Borgman
2009-11-29 22:08 ` Juri Linkov
2009-11-29 23:16 ` Lennart Borgman
2009-12-03 0:59 ` bug#5062: " Juri Linkov
2009-12-03 1:37 ` Lennart Borgman
2009-12-03 3:08 ` Kevin Rodgers
2009-12-03 3:31 ` Lennart Borgman
2009-12-03 3:30 ` Stefan Monnier
2009-12-03 0:57 ` bug#5062: 23.1.50; " Juri Linkov
2009-12-03 3:28 ` Stefan Monnier
2009-12-03 5:00 ` Jason Rumney
2009-12-04 0:05 ` Juri Linkov
2009-12-04 22:00 ` bug#5062: marked as done (23.1.50; image-toggle-display overwrites nxml-mode local key map) Emacs bug Tracking System
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e38bce640911271644l148dbc9g1fb378e6b4dbc248@mail.gmail.com \
--to=bgoodr@gmail.com \
--cc=5062@emacsbugs.donarmstrong.com \
--cc=emacs-pretest-bug@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).