Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mimsy!oddjob!matt From: matt@oddjob.UChicago.EDU (Matt Crawford) Newsgroups: comp.emacs Subject: Re: Gnu ELisp define-key question Message-ID: <3886@oddjob.UChicago.EDU> Date: Tue, 14-Jul-87 20:41:41 EDT Article-I.D.: oddjob.3886 Posted: Tue Jul 14 20:41:41 1987 Date-Received: Fri, 17-Jul-87 00:59:01 EDT References: <760002@hpwale.HP.COM> Reply-To: matt@oddjob.uchicago.edu (Matt Crawford) Organization: Fort Mudge Perloo and Fire Brigade Lines: 29 In article <760002@hpwale.HP.COM> frede@hpwale.HP.COM (Fred Ehrhardt) writes: ) Is there a way, in the mode *.el files, to prevent *conditionally* the ) re-binding of a key sequence, in the event that key is already bound? ) Such as [pardon my ELisp]: ) (if (not (is-bound "\eS")) ) (define-key etc.... I do this in my setup file for tvi-955 terminals: ;; move the old function of C-A (define-key esc-map "I" (key-binding "\^A")) ; BACK TAB (define-key global-map "\^A" 'funct-key) It moves whatever the old definition of C-A is to M-I. I have this in my text-mode-hook: (let ((k (where-is-internal 'fill-paragraph nil t))) (and k (global-set-key k 'fill-paragraph-cleverly))) It replaces fill-paragraph with fill-paragraph-cleverly on the first key it is found to be bound to. You probably want to use: (or (key-binding "\eS") (global-set-key "\eS" 'your-fun)) ________________________________________________________ Matt University matt@oddjob.uchicago.edu Crawford of Chicago {astrovax,ihnp4}!oddjob!matt