🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #87887

Comments on default `outline-minor-mode-map' (19.22)

#87887
From: Matthew Swift
Date: Wed, 24 Aug 1994 18:38
49 lines
3402 bytes

I've come across an inconvenient aspect of the default definition of
`outline-minor-mode-map'; I understand that there may be good reasons for it
being the way it is. I will just make my case.

`outline-minor-mode-map''s default definition in outline.el simply refers to
`outline-mode-map' via a user-settable prefix (\C-c by default).  

The default definition of `outline-mode-map', in turn, specifies  8 bindings,
and then the value of `text-mode-map' "behind" them (so that bindings in
`text-mode-map' would defer to those 8, and any other alterations to
`outline-mode-map').  This is undoubtedly the right definition for using
outline major mode, but it is NOT a suitable definition for a minor mode map,
as the following scenario might convince you.

Suppose I am in XYZ major mode, and in outline minor mode.  Mode-specific
commands conventionally use the prefix \C-c, so it would be normal to define,
say, \C-c\C-c to do something useful in XYZ mode.  I am sure that it won't
conflict with anything in outline-minor-mode-map, because \C-c\C-c doesn't do
anything in outline major mode (and therefore neither in outline minor mode).
Wrong!  Why?  Because it might do something in TEXT MODE.  Notice that in this
situation, I can (define-key XYZ-mode-map "\C-c\C-c" 'foo) and it will NOT be
visible.  And that (define-key text-mode-map "\C-c\C-c" 'bar) will affect the
keymap in all buffers under outline minor mode.  If I am in XYZ mode, I could
rightly be confused why changing text-mode-map will effect my editing. 


It is a limitation on outline minor mode to make it inherit its keymap from a
major mode; it effectively places an _arbitrary_ major mode's keymap _in front
of_ the current major mode's keymap, and this is contrary to the conceptual
structure of keymap priority.

Anyone agree?

I am ambivalent about the fact that `outline-minor-mode-map' is not independent
of `outline-mode-map'; I can see the convenience.

I suggest that `outline-minor-mode-map' be defined, explicitly, initially,
exactly the same as `outline-mode-map', with the exception that it is not
shadowed by `text-mode-map'.  The only possibly undesirable side effect is that
subsequent alterations to `outline-mode-map' will not be inherited by
`outline-minor-mode-map' and vice versa.  This can be worked around by either
doubling-up all `define-key''s (one for the major and one for the minor map),
or it can be eliminated by implementing the two keymaps in such a way that they
referred to a single common keymap, with the difference being only that the
major mode's keymap is additionally shadowed by `text-mode-map'.

Matt Swift
Technical Details
Message-ID: <199408241828.OAA73919@acs3>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!panix!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!acs.bu.edu!swift

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,a436b062f6f1612e,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1994-08-24 11:43:16 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!panix!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!acs.bu.edu!swift
From: swift@acs.bu.edu (Matthew Swift)
Newsgroups: gnu.emacs.bug
Subject: Comments on default `outline-minor-mode-map' (19.22)
Date: 24 Aug 1994 14:38:55 -0400
Organization: GNUs Not Usenet
Lines: 50
Sender: daemon@cis.ohio-state.edu
Approved: bug-gnu-emacs@prep.ai.mit.edu
Distribution: gnu
Message-ID: <199408241828.OAA73919@acs3>
Reply-To: swift@bu.edu