Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.emacs Subject: Re: syntax for function with argument Message-ID: <1990Sep18.035904.5608@iwarp.intel.com> Date: 18 Sep 90 03:59:04 GMT References: <1990Sep17.224911.22873@sics.se> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Distribution: comp.emacs Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 39 In-Reply-To: ag@sics.se (Anders G|ransson) In article <1990Sep17.224911.22873@sics.se>, ag@sics (Anders G|ransson) writes: | Suppose you want to assign a key-combination to a function by putting | (define-key-fully global-map "xyz" *something*) in your init-file but | you want to use the variant of the function you get when it is | supplied with an argument. | That is, you want to achieve the result of "C-u (arg) M-x foo" | by the key-combination "xyz". What is the *something* in this case? | | | I guess this is explained in the manual somewhere but I haven't | been able to find it. So if some kind soul could email me the | answer I'd be grateful. Nope. It may be in the manual, and if it is, I haven't seen it, but it'd be something more like this: (define xyz-with-prefix () (interactive) (let prefix-arg '(1) ; or whatever you're calling with ; see (describe-variable 'prefix-arg) (call-interactively 'xyz))) (define-key global-map "f" 'xyz-with-prefix) There's no way to do it from just define-key. Alternatively, you can lookup the arglist of 'xyz (at the proper place in the source), and feed it arguments like: (define xyz-with-prefix () (interactive) (xyz some-arg some-other-arg)) Just another elisp hacker, -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/