Article View: gnu.emacs.bug
Article #1143Running info screws up text-mode bindings; copy-keymap alternative
From: Ashwin Ram
Date: Thu, 03 Nov 1988 21:41
Date: Thu, 03 Nov 1988 21:41
34 lines
1863 bytes
1863 bytes
GNU Emacs 18.48.0 of Thu Oct 27 1988 on leo.ring.cs.yale.edu (domain/ix)
When I do a M-x info, the ^C^C binding in my text-mode buffers gets screwed
up (it puts the text-mode buffer into info-mode). Presumably the problem is
with the following code in lisp/info.el:
(defvar Info-edit-map nil
"Local keymap used within `e' command of Info.")
(if Info-edit-map
nil
(setq Info-edit-map (copy-keymap text-mode-map))
(define-key Info-edit-map "\C-c\C-c" 'Info-cease-edit))
Info-edit-map should be independent of text-mode-map, but copy-keymap does
not do this correctly.
-----
Situations like this occur pretty often (e.g., TeX-shell is a copy of
shell-mode). Rather than making a deep copy of a keymap just to change one
or two bindings (inefficient), or using a shallow copy (incorrect), why not
allow a keymap to have a "superior" keymap that it inherits bindings from?
At present, all bindings are inherited from the global-map unless explicitly
overruled by a local map. I suggest that this idea should be extended so
that a keymap can specify where to default to. E.g., Info-edit-map -->
text-mode-map --> global-map. This might be represented, say, by
representing the superior keymap, if any, as a non-nil lastcdr of the keymap,
and adding user functions to access and change this.
-- Ashwin.
ARPA: Ram-Ashwin@cs.yale.edu
UUCP: {decvax,ucbvax,harvard,cmcl2,...}!yale!Ram-Ashwin
BITNET: Ram@yalecs
Technical Details
Message-ID:
<8811032141.AA12475@ELI.CS.YALE.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!YALE.ARPA!ram-ashwinShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!YALE.ARPA!ram-ashwin From: ram-ashwin@YALE.ARPA (Ashwin Ram) Newsgroups: gnu.emacs.bug Subject: Running info screws up text-mode bindings; copy-keymap alternative Message-ID: <8811032141.AA12475@ELI.CS.YALE.EDU> Date: 3 Nov 88 21:41:48 GMT Sender: bob@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 34