[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compare recent-keys to [home], [end], etc?
From: |
Jambunathan K |
Subject: |
Re: Compare recent-keys to [home], [end], etc? |
Date: |
Sun, 05 Aug 2012 12:34:35 +0530 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1 (windows-nt) |
> 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 <how do I designate the [home] key here?> ) ... )
> ...
> )
>
> 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
--