🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #98319

Re: Substituting key bindings in documentation strings are very slow

#98319
From: Joe Wells
Date: Sun, 13 Oct 1991 00:35
28 lines
2194 bytes
In article <9110112035.AA16696@ericad.ericsson.se> etxjojm@ericad.ericsson.SE (Jonas Jaernestroem TG/HDK) writes:

   In the general hints for writing major modes it says that you should use
   \\<local-map> and \\[command] in the documentation string for the major
   mode in order to enshure that you display the keymap currently in effect.

   This sounds very nice but when I inserted my 64 entries and then did
   C-h m (describe-mode) it took 35 seconds to compute the contents
   (before it was displayed) on a Sun sparc SLC 16MByte machine.

The problem you mention happens because the code for printing key bindings
(substitute-command-keys) traverses the key binding tree once for each
\\[command] you mention.  If you have defined any significant number of
keys, then this will be horribly slow, perhaps because the key bindings
will be spread throughout memory.

I've been meaning to fix this function for about a year and a half, but
have never gotten around to it.  Specifically, in addition to having
substitute-command-keys traverse the key binding tree once, I want to be
able to batch together a number of calls to substitute-command-keys to
have them all share the results of a single traversal of the key binding
tree.  This is to speed up fast-apropos.el even more.

Perhaps someone will be inspired by this message to write the necessary
code and integrate it with fast-apropos.el.

-- 
Joe Wells <jbw@cs.bu.edu>
Technical Details
Message-ID: <JBW.91Oct12203514@bigbird.bu.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!fauern!ira.uka.de!yale.edu!qt.cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!bigbird.bu.edu!jbw
References: <9110112035.AA16696@ericad.ericsson.se>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,19fd2bd9a08a0d02
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1991-10-12 17:35:14 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!fauern!ira.uka.de!yale.edu!qt.cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!bigbird.bu.edu!jbw
From: jbw@bigbird.bu.edu (Joe Wells)
Newsgroups: gnu.emacs.bug
Subject: Re: Substituting key bindings in documentation strings are very slow
Message-ID: <JBW.91Oct12203514@bigbird.bu.edu>
Date: 13 Oct 91 00:35:14 GMT
References: <9110112035.AA16696@ericad.ericsson.se>
Sender: gnulists@ai.mit.edu
Distribution: gnu
Organization: Boston University Computer Science Department
Lines: 28
Approved: bug-gnu-emacs@prep.ai.mit.edu