From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Greg Hill Newsgroups: gmane.emacs.help Subject: Moving a symbol from one obarray to another Date: Mon, 23 Dec 2002 19:22:09 -0800 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Trace: main.gmane.org 1040700280 31360 80.91.224.249 (24 Dec 2002 03:24:40 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 24 Dec 2002 03:24:40 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18QfgL-00089d-00 for ; Tue, 24 Dec 2002 04:24:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18QfgO-0003cf-06 for gnu-help-gnu-emacs@m.gmane.org; Mon, 23 Dec 2002 22:24:40 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18QfgC-0003YA-00 for help-gnu-emacs@gnu.org; Mon, 23 Dec 2002 22:24:28 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18QfgA-0003T9-00 for help-gnu-emacs@gnu.org; Mon, 23 Dec 2002 22:24:27 -0500 Original-Received: from renfield.synergymicro.com ([153.105.4.30] helo=synergymicro.com) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18Qfg9-0003NL-00 for help-gnu-emacs@gnu.org; Mon, 23 Dec 2002 22:24:25 -0500 Original-Received: from synergy.synergy.encinitas.ca.us ([153.105.4.29]) by synergymicro.com (8.9.3/8.9.3) with ESMTP id TAA31680 for ; Mon, 23 Dec 2002 19:25:57 -0800 Original-Received: from [198.17.100.22] (G-Hill-Mac [198.17.100.22])TAA09558 for ; Mon, 23 Dec 2002 19:29:46 -0800 In-Reply-To: Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:4988 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:4988 My objective is to move a symbol from one obarray to another. The following routine seems to do that ok. (defun move-symbol (sym-name from-obarray to-obarray) "Move symbol named SYM-NAME from FROM-OBARRAY to TO-OBARRAY" (let ((old-sym (intern-soft sym-name from-obarray)) (new-sym (intern sym-name to-obarray)) ) (set new-sym (symbol-value old-sym)) (fset new-sym (symbol-function old-sym)) (setplist new-sym (symbol-plist old-sym)) (unintern sym-name from-obarray) )) My question is, is there a more efficient way to do that, e.g. without creating a whole new symbol and destroying the old one? --Greg