From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dieter Wilhelm Newsgroups: gmane.emacs.help Subject: How to detect C-u supplied arguments from other prefix arguments Date: Tue, 07 Aug 2007 23:46:33 +0200 Organization: The Church of Emacs Message-ID: <87wsw7hvba.fsf@debby.local.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1186523192 9262 80.91.229.12 (7 Aug 2007 21:46:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Aug 2007 21:46:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Aug 07 23:46:30 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 1IIWsj-0005ri-MC for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Aug 2007 23:46:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IIWsi-0004cz-DS for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Aug 2007 17:46:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IIWs9-0004Sb-6s for help-gnu-emacs@gnu.org; Tue, 07 Aug 2007 17:45:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IIWs4-0004Pd-Vx for help-gnu-emacs@gnu.org; Tue, 07 Aug 2007 17:45:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IIWs4-0004PW-R1 for help-gnu-emacs@gnu.org; Tue, 07 Aug 2007 17:45:44 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.186]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IIWrs-0003Al-5z for help-gnu-emacs@gnu.org; Tue, 07 Aug 2007 17:45:33 -0400 Original-Received: from [89.12.127.14] (helo=debby.local.net) by mrelayeu.kundenserver.de (node=mrelayeu5) with ESMTP (Nemesis), id 0ML25U-1IIWrl2sit-0004iK; Tue, 07 Aug 2007 23:45:25 +0200 Original-Received: from dieter by debby.local.net with local (Exim 4.63) (envelope-from ) id 1IIWsr-00015z-7G for help-gnu-emacs@gnu.org; Tue, 07 Aug 2007 23:46:33 +0200 User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Provags-ID: V01U2FsdGVkX18vrlGCcWAcNHoORbuxvq+1Kt4pZ7CDmrdbWgD qvApRgqSwpCwqM6/ElLHj2/23HD4ORJMFe8i+4fPY1I6zVBAx3 9h2TITdEgQ3RtLRNAMaS3Ahmvv+pAer X-Detected-Kernel: Linux 2.6? (barebone, rare!) 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:46390 Archived-At: 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