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

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

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


From: Dieter Wilhelm
Subject: How to detect C-u supplied arguments from other prefix arguments
Date: Tue, 07 Aug 2007 23:46:33 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Hi

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")
  (when (string= "C-u" (substring (this-command-keys) 0 2))
    (message "hurray")))

I just don't understand how to compare key sequences.  Or maybe
there's better way of doing it?

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany




reply via email to

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