From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: `this-command-keys-vector', prefix keys, and Customize Date: Fri, 7 Feb 2014 15:05:59 -0800 (PST) Message-ID: <137bbae1-bee5-4ba0-bd70-a13d51e7cd4f@default> References: <1e92962b-bb8c-42f7-92ab-ec18b183edcd@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1391814381 1410 80.91.229.3 (7 Feb 2014 23:06:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Feb 2014 23:06:21 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 08 00:06:27 2014 Return-path: Envelope-to: ged-emacs-devel@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 1WBuV7-0005gN-H5 for ged-emacs-devel@m.gmane.org; Sat, 08 Feb 2014 00:06:25 +0100 Original-Received: from localhost ([::1]:44145 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBuV6-0007HY-Pj for ged-emacs-devel@m.gmane.org; Fri, 07 Feb 2014 18:06:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBuUu-0007HJ-U2 for emacs-devel@gnu.org; Fri, 07 Feb 2014 18:06:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WBuUl-0001VZ-Ui for emacs-devel@gnu.org; Fri, 07 Feb 2014 18:06:12 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:39716) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBuUl-0001VN-M0 for emacs-devel@gnu.org; Fri, 07 Feb 2014 18:06:03 -0500 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s17N617l028087 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 7 Feb 2014 23:06:02 GMT Original-Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s17N60PU007159 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 7 Feb 2014 23:06:01 GMT Original-Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userz7022.oracle.com (8.14.5+Sun/8.14.4) with ESMTP id s17N60fX007088 for ; Fri, 7 Feb 2014 23:06:00 GMT In-Reply-To: <1e92962b-bb8c-42f7-92ab-ec18b183edcd@default> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:169476 Archived-At: > 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? >=20 > 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.