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

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

Re: How to detect C-u supplied arguments from other prefix arguments


From: Stefan Monnier
Subject: Re: How to detect C-u supplied arguments from other prefix arguments
Date: Thu, 09 Aug 2007 13:49:54 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

> 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


reply via email to

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