From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: Calling a function interactively with a universal argument Date: Thu, 14 Jun 2007 23:21:07 +1000 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <87zm32u0xo.fsf@lion.rapttech.com.au> References: <1181736261.747222.187410@q19g2000prn.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1181828548 30104 80.91.229.12 (14 Jun 2007 13:42:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 14 Jun 2007 13:42:28 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 14 15:42:27 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hypal-0006lz-1i for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Jun 2007 15:42:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hypak-0005jE-Nk for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Jun 2007 09:42:26 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!xs4all!feeder.news-service.com!138.199.65.86.MISMATCH!sn-xt-ams-06!sn-xt-ams-05!sn-ams!sn-feed-ams-01!sn-post-ams-01!sn-post-ams-02!sn-post-sjc-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:afqsZvAQBUuP5vUQKS1FIzj8YP4= Original-X-Complaints-To: abuse@supernews.com Original-Lines: 39 Original-Xref: shelby.stanford.edu gnu.emacs.help:149471 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:45057 Archived-At: "spamfilteraccount@gmail.com" writes: > 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)) > > > > I've seen call-interactively, but it doesn't allow me to specify the > actual interactive arguments to call the command with. > have a look at defadvice in the elisp manual. It should allow you to do what you want. tim -- tcross (at) rapttech dot com dot au