From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Qs on obarrays Date: Wed, 12 Oct 2005 10:14:40 -0700 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1129137424 32249 80.91.229.2 (12 Oct 2005 17:17:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 12 Oct 2005 17:17:04 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 12 19:17:02 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EPkBu-0008Bo-SJ for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Oct 2005 19:14:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EPkBu-0003bJ-92 for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Oct 2005 13:14:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EPkBh-0003bC-TT for help-gnu-emacs@gnu.org; Wed, 12 Oct 2005 13:14:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EPkBg-0003az-3m for help-gnu-emacs@gnu.org; Wed, 12 Oct 2005 13:14:45 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EPkBg-0003aw-1S for help-gnu-emacs@gnu.org; Wed, 12 Oct 2005 13:14:44 -0400 Original-Received: from [148.87.122.32] (helo=rgminet03.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EPkBf-0006NW-TD for help-gnu-emacs@gnu.org; Wed, 12 Oct 2005 13:14:44 -0400 Original-Received: from rgmsgw301.us.oracle.com (rgmsgw301.us.oracle.com [138.1.186.50]) by rgminet03.oracle.com (Switch-3.1.6/Switch-3.1.7) with ESMTP id j9CHEf6D031686 for ; Wed, 12 Oct 2005 11:14:41 -0600 Original-Received: from rgmsgw301.us.oracle.com (localhost [127.0.0.1]) by rgmsgw301.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id j9CHEfDg004156 for ; Wed, 12 Oct 2005 11:14:41 -0600 Original-Received: from dradamslap (dradams-lap.us.oracle.com [130.35.177.126]) by rgmsgw301.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id j9CHEeXN004151 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Wed, 12 Oct 2005 11:14:40 -0600 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:30176 Archived-At: An alternative is to change just the predicate to check the standard obarray: (let ((my-obarray (make-vector 7 0))) (dolist (name my-names) (intern name my-obarray)) (all-completions "" my-obarray (lambda (symbol) (commandp (intern (symbol-name symbol)))))) I ended up doing something similar, since the original predicate (commandp) will only work with the standard `obarray' (as Pascal pointed out so well). Actually, I don't bother creating a new obarray, after all. I just use an alist (easier to manipulate) and redefine the predicate to work with that: (all-completions "" my-alist (lambda (elt) (commandp (intern (car elt))))) Or, more generally (what I really do): (when (arrayp minibuffer-completion-table) (setq minibuffer-completion-predicate `(lambda (elt) (funcall ',minibuffer-completion-predicate (intern (car elt)))))) (setq minibuffer-completion-table my-alist) ; Built by filtering `minibuffer-completion-table'. ... (all-completions "" minibuffer-completion-table minibuffer-completion-predicate) Thanks to all for the input.