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

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

RE: [External] : Accessing arg with (interactive "P")


From: carlmarcos
Subject: RE: [External] : Accessing arg with (interactive "P")
Date: Wed, 6 Jul 2022 23:01:19 +0200 (CEST)

Jul 6, 2022, 00:55 by drew.adams@oracle.com:

>> I have the following elisp function, using `current-prefix-arg` to
>> decide subsequent processing.
>>
>> Having made the command examine it directly, the usual method for
>> accessing it is with
>> (interactive "P").  The problem is that I do not know how to examine
>> the prefix arg through
>>  the interactive clause.
>>
>> (defun poke (&optional prefix)
>>   "TODO"
>>   (interactive "P")
>>   (cond
>>    ((equal current-prefix-arg nil)   ; no C-u
>>     (setq workbench-poke-name-mode 1))
>>    ((equal current-prefix-arg '(4))  ; C-u
>>     (arktika-workbench))
>>
>
> Not sure what your question is or what it is that
> you want to do.  But change `current-prefix-arg'
> to `prefix' and your code will do what I'm guessing
> you want it to do.
>
It does do what I want.


reply via email to

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