From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.help Subject: Re: Compare recent-keys to [home], [end], etc? Date: Sun, 05 Aug 2012 12:34:35 +0530 Message-ID: <81vcgx4y64.fsf@gmail.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1344150304 25052 80.91.229.3 (5 Aug 2012 07:05:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 5 Aug 2012 07:05:04 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: rjdtoday@yahoo.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Aug 05 09:05:05 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sxutc-0005FS-Nr for geh-help-gnu-emacs@m.gmane.org; Sun, 05 Aug 2012 09:05:04 +0200 Original-Received: from localhost ([::1]:37665 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sxutc-0001ea-09 for geh-help-gnu-emacs@m.gmane.org; Sun, 05 Aug 2012 03:05:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxutW-0001eU-VT for help-gnu-emacs@gnu.org; Sun, 05 Aug 2012 03:04:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SxutW-00034E-4y for help-gnu-emacs@gnu.org; Sun, 05 Aug 2012 03:04:58 -0400 Original-Received: from mail-pb0-f41.google.com ([209.85.160.41]:59886) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxutV-00034A-V5 for help-gnu-emacs@gnu.org; Sun, 05 Aug 2012 03:04:58 -0400 Original-Received: by pbbjt11 with SMTP id jt11so339425pbb.0 for ; Sun, 05 Aug 2012 00:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=HbZaSwbSWxqFBxozVLpU3VaHz0Ci3tGuMatlGFEs+AU=; b=ISiMgFNliIpQP/jvhrcFYsMq8rhQW4I/HRIYWdYKibbe9qt017DGFdL9oQ2P2fPgwq VnX2vZtRD/JJphy0pSUkTe+B7Be7WEt220oMxeTCtIoifZJE/FwDtrCLuSd2vVj26nqA K9A8cG3oM7EIM9OYjDFYvLkDkvtm5BLAPjBpSUHdZ57YKd0VRdcDrLjkRAq9007p6bP9 n8WIXvEB5lEh60t68siX12Qty8RzC9nf6fAbvxOeIPsHoNegx50A8T2shs7+l6DpZJNm IhUv+FRb1oILM6ugPvuzRVAdtVdRyVfUmSMBD6jSJ2OFFF5ZLLuKe3RDPYkUwA3jQwA/ O/ZQ== Original-Received: by 10.68.135.36 with SMTP id pp4mr9731984pbb.19.1344150296729; Sun, 05 Aug 2012 00:04:56 -0700 (PDT) Original-Received: from JAMBU-NETBOOK ([101.63.156.69]) by mx.google.com with ESMTPS id sf2sm3263730pbc.57.2012.08.05.00.04.53 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Aug 2012 00:04:55 -0700 (PDT) In-Reply-To: (rjdtoday@yahoo.com's message of "Sat, 4 Aug 2012 20:37:03 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (windows-nt) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.41 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:86212 Archived-At: > How can I tell whether a key in recent-keys is the [home] key? > > I get the key and test it with the following: > > (let ( (lastkey > (let* ((recent-keys (recent-keys)) > (keys-length (length recent-keys)) > ) > (aref recent-keys (- keys-length (length (this-command-keys)) 1)) > ) > ) > ) > (if (= lastkey ) ... ) > ... > ) > > I've experimented by using the letter A instead of [home], i.e. with (if (= lastkey 65) ... ). That works if lastkey is 'A', but gives the error "Wrong type argument" if lastkey is [home], [end], or similar. > > Is there something I can use in that "if" statement so that I can compare anything in recent-keys to [home]? > Have your tried this: (eq last-key 'home) I am guessing here, based on a quick examination with M-x pp-eval-expression RET (recent-keys) RET --