Path: utzoo!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!tektronix!reed!ogccse!littlei!omepd!merlyn From: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) Newsgroups: gnu.emacs Subject: appending to keyboard-translate-table (was Re: Anything You Can Do... (really, elisp question)) Message-ID: <4312@omepd.UUCP> Date: 16 Apr 89 23:15:36 GMT References: <4943@tekgvs.LABS.TEK.COM> Sender: news@omepd.UUCP Reply-To: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) Distribution: usa Organization: Stonehenge; netaccess via BiiN, Hillsboro, Oregon, USA Lines: 37 In-reply-to: jans@tekgvs.LABS.TEK.COM (Jan Steinman) In article <4943@tekgvs.LABS.TEK.COM>, jans@tekgvs (Jan Steinman) writes: | Just what I was thinking, as I've done this to swap backspace with rubout, but | here's a question: why must you rebuild the entire list from scratch? Note | that the example given undoes any backspace/rubout swap that was put in | site-init.el. I've tried: | | (aset keyboard-translate-table ?\177 ?\010) | (aset keyboard-translate-table ?\010 ?\177) | | which didn't work, probably because keyboard-translate-table is a list rather | than an string. Other than using some ungodly combination of cons/car/cdr, is | there some way to index into and modify keyboard-translate-table without | building it from scratch? Not a list, but either nil or a string (possibly less than 128 chars). You first need to extend it in a non-change way, and then do your asets, like so: (or keyboard-translate-table (setq keyboard-translate-table "")) ; first ensure it is a string, not nil (while (< (length keyboard-translate-table) 128) (setq keyboard-translate-table (concat keyboard-translate-table (list (length keyboard-translate-table))))) ; now force it to 128 chars (aset keyboard-translate-table ?\177 ?\010) (aset keyboard-translate-table ?\010 ?\177) ; and do the changes There. Try that (he says, defiantly...)... -- /=====Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095========\ { on contract to BiiN (for now :-) Hillsboro, Oregon, USA. } {<@intel-iwarp.arpa:merlyn@intelob.intel.com> ...!uunet!tektronix!biin!merlyn } \=====Cute quote: "Welcome to Oregon... home of the California Raisins!"======/