emacs-devel
[Top][All Lists]
Advanced

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

RE: `this-command-keys-vector', prefix keys, and Customize


From: Drew Adams
Subject: RE: `this-command-keys-vector', prefix keys, and Customize
Date: Fri, 7 Feb 2014 15:05:59 -0800 (PST)

> Or is there some function `same-key' that handles all such
> forms of keys, testing for equivalence, so I could test
> (same-key ACTUAL-PREFIX OPTION-PREFIX)?
>
> If not, and I need to roll my own such test function,
> what are the possible forms of a prefix key as a vector?
> 
> Is it enough to unwrap any list elements in the vector?

Doing only that seems to work so far (but with only a little
testing).

(defun uncons (obj) "..." (if (consp obj) (car obj) obj))

(defun same-vector-key-p (key1 key2) "..."
       (equal (apply #'vector (mapcar #'uncons key1))
              (apply #'vector (mapcar #'uncons key2)))))

But I do wonder whether there is a predefined function for
this kind of thing.  And whether this is the right way to
approach the problem.



reply via email to

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