From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jay Belanger Newsgroups: gmane.emacs.devel Subject: Behavior of `this-command-keys' Date: Mon, 11 Sep 2006 12:54:02 -0500 Message-ID: <87hczel26d.fsf@vh213602.truman.edu> Reply-To: belanger@truman.edu NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1157997260 14062 80.91.229.2 (11 Sep 2006 17:54:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 11 Sep 2006 17:54:20 +0000 (UTC) Cc: belanger@truman.edu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 11 19:54:16 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GMpz6-0004nm-CD for ged-emacs-devel@m.gmane.org; Mon, 11 Sep 2006 19:54:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GMpz6-0007Eo-1c for ged-emacs-devel@m.gmane.org; Mon, 11 Sep 2006 13:54:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GMpyv-0007Ej-7h for emacs-devel@gnu.org; Mon, 11 Sep 2006 13:54:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GMpyu-0007ET-Kx for emacs-devel@gnu.org; Mon, 11 Sep 2006 13:54:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GMpyu-0007EQ-GR for emacs-devel@gnu.org; Mon, 11 Sep 2006 13:54:04 -0400 Original-Received: from [150.243.160.94] (helo=uranium.truman.edu) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GMq0E-0004z6-1x for emacs-devel@gnu.org; Mon, 11 Sep 2006 13:55:26 -0400 Original-Received: from uranium.truman.edu (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with SMTP id E3A83579BC for ; Mon, 11 Sep 2006 13:00:38 -0500 (CDT) Original-Received: from vh213602.truman.edu.truman.edu (vh213602.truman.edu [150.243.64.4]) by uranium.truman.edu (Postfix) with ESMTP id C660851ED5; Mon, 11 Sep 2006 13:00:37 -0500 (CDT) Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:59696 Archived-At: The behavior of `this-command-keys' doesn't seem to match its documentation; perhaps I'm misunderstanding something. The documentation for `this-command-keys' is: This function returns a string or vector containing the key sequence that invoked the present command, plus any previous commands that generated the prefix argument for this command. However, if the command has called `read-key-sequence', it returns the last read key sequence. *Note Key Sequence Input::. The value is a string if all events in the sequence were characters that fit in a string. *Note Input Events::. Consider something like: (defun test () (interactive) (sit-for 1) (setq result (this-command-keys))) (global-set-key "a" 'test) To me, it sounds like as if `result' should equal "a" (the key which calls the function) if "ab" were pressed, whether or not the `sit-for' had run its course. However, `result' equals "a" or "ab" depending on how close together the "a" and "b" are pressed. Jay