From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Modifying Emacs to use the Mac OS X Keychain Services Date: Fri, 17 Jun 2011 16:31:09 -0400 Message-ID: <87oc1wp5de.fsf@stupidchicken.com> References: <87k4cnt9gv.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1308344094 26139 80.91.229.12 (17 Jun 2011 20:54:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 17 Jun 2011 20:54:54 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 17 22:54:48 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QXg3x-0006P2-5W for ged-emacs-devel@m.gmane.org; Fri, 17 Jun 2011 22:54:45 +0200 Original-Received: from localhost ([::1]:37111 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXg3v-0001d3-Vt for ged-emacs-devel@m.gmane.org; Fri, 17 Jun 2011 16:54:44 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:33284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXfhD-0003P6-K9 for emacs-devel@gnu.org; Fri, 17 Jun 2011 16:31:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QXfhC-0003pM-Df for emacs-devel@gnu.org; Fri, 17 Jun 2011 16:31:15 -0400 Original-Received: from vm-emlprdomr-06.its.yale.edu ([130.132.50.147]:53364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXfhC-0003pE-58 for emacs-devel@gnu.org; Fri, 17 Jun 2011 16:31:14 -0400 Original-Received: from furball (dhcp128036226014.central.yale.edu [128.36.226.14]) (authenticated bits=0) by vm-emlprdomr-06.its.yale.edu (8.14.4/8.14.4) with ESMTP id p5HKVBIb007986 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 17 Jun 2011 16:31:11 -0400 Original-Received: by furball (Postfix, from userid 1000) id DD34E1605D4; Fri, 17 Jun 2011 16:31:09 -0400 (EDT) In-Reply-To: (Stefan Monnier's message of "Wed, 15 Jun 2011 19:26:55 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Scanned-By: MIMEDefang 2.71 on 130.132.50.147 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 130.132.50.147 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:140626 Archived-At: Stefan Monnier writes: >> The Lisp_Misc_Save_Value holds a void pointer and an integer. Just >> provide convenience functions for yourself that take a >> Lisp_Misc_Save_Value and set the pointer to the SecKeychainRef or >> extract it back out. Use the `SAVE_VALUEP' and `XSAVE_VALUE' macros. > > That only works if you know for sure that this save_value indeed holds > a SecKeychainRef, which is only the case if Elisp can never get its hands > on it. I don't like the idea of having a first class Emacs Lisp object that's a proprietary Mac OS specific pointer object. If there is really no other way (such as an id number) to identify the SecKeychainRef, I think it's better to do what image.c does: make the Lisp representation the list specification used to generate the SecKeychainRef, keep an internal hash table that stores the SecKeychainRef that's never exposed to Lisp. Then the Lisp-visible functions would take the list spec as its argument and look up the SecKeychainRefs in the table.