help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling a function interactively with a universal argument


From: Kevin Rodgers
Subject: Re: Calling a function interactively with a universal argument
Date: Thu, 14 Jun 2007 20:14:53 -0600
User-agent: Thunderbird 1.5.0.12 (Macintosh/20070509)

spamfilteraccount@gmail.com wrote:
Is it possible to call a function from a program with a certain
universal argument?

I'd like to a redefine a standard command, but *without* bothering to
use its actual lisp interface, so I want to call the function from a
program as a user would, supplying only a universal argument or not.


I'd like to override find-tag behavior, so that it does something
after reading the interactive arguments, but before invoking the
original command:


(defun my-find-tag ()
   ; the result of (interactive-form 'find-tag) should be substituted
here somehow as an interactive specifier, because I want the same
interactive behavior (I can copy it of course manually, but it would
be nicer to copy here the interactive specification of find-tag
programatically)

  (if my-find-tags was called with C-u then do something
       otherwise do something else)

  (call original find-tag with the interactive arugments received))

(defadvice find-tag (before universal-argument activate)
"If called with \\[universal-argument], do SOMETHING, other do SOMETHING-ELSE."
  (if (consp current-prefix-arg)
      (something)
    (something-else)))

I've seen call-interactively, but it doesn't allow me to specify the
actual interactive arguments to call the command with.

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

[Prev in Thread] Current Thread [Next in Thread]