From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: How to detect C-u supplied arguments from other prefix arguments Date: Thu, 09 Aug 2007 13:49:54 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1186684874 31116 80.91.229.12 (9 Aug 2007 18:41:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 9 Aug 2007 18:41:14 +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 Aug 09 20:41:11 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 1IJCwY-00078p-I7 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Aug 2007 20:41:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IJCwY-0000NG-3R for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Aug 2007 14:41:10 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!nx01.iad01.newshosting.com!newshosting.com!216.196.98.140.MISMATCH!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.umontreal.ca!news.umontreal.ca.POSTED!not-for-mail Original-NNTP-Posting-Date: Thu, 09 Aug 2007 12:49:54 -0500 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:lZBlrshTycSyAhTW5wDZwLbvh7Q= Original-Lines: 16 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 132.204.27.213 Original-X-Trace: sv3-UAh7p9sRduxPuO+r2hoHNTCmxCeH8BgK5VmaawfTQL18TYZPQ7TGJq0T9wQbJ5Kigp/gEi4qjGHXSS7!bradpucWudq2sk3b5umlbVJKp2iDu8Lq9xjxSALpex8zkyli6YcQjzGWvuxSjMpXALslncxq9Rk4!u0xm1tmNbNHil12uig== Original-X-Complaints-To: abuse@umontreal.ca X-DMCA-Complaints-To: abuse@umontreal.ca X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.35 Original-Xref: shelby.stanford.edu gnu.emacs.help:150873 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:46451 Archived-At: > I'd like to detect whether prefix arguments of a command are supplied > by C-u or otherwise. > My idea is to use this-command-keys and compare it to some string, > like the following pseudo code: > (defun bla (arg) > (interactive "p") Use (interactive "P") and then `arg' will have different shapes in the different cases: either nil, or a number (if entered via C-u N1 N2 N3, or via C-N1 C-N2 C-N3), or a one-element list containing a number 4^N if entered via sequence of N times C-u. Stefan