From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dirk80 Newsgroups: gmane.emacs.help Subject: Autocompletion of Emacs Lisp Symbols in Buffer Date: Thu, 6 May 2010 06:30:31 -0700 (PDT) Message-ID: <28473645.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1273165576 3424 80.91.229.12 (6 May 2010 17:06:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 6 May 2010 17:06:16 +0000 (UTC) To: Help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 06 19:06:15 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OA4Wd-00042p-EB for geh-help-gnu-emacs@m.gmane.org; Thu, 06 May 2010 19:06:15 +0200 Original-Received: from localhost ([127.0.0.1]:36624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OA4Um-0001sb-PE for geh-help-gnu-emacs@m.gmane.org; Thu, 06 May 2010 13:04:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OA1A1-00024q-90 for help-gnu-emacs@gnu.org; Thu, 06 May 2010 09:30:41 -0400 Original-Received: from [140.186.70.92] (port=51657 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OA19z-00023S-Tg for Help-gnu-emacs@gnu.org; Thu, 06 May 2010 09:30:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OA19y-00086Z-F9 for Help-gnu-emacs@gnu.org; Thu, 06 May 2010 09:30:39 -0400 Original-Received: from kuber.nabble.com ([216.139.236.158]:37277) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OA19y-00085i-Ad for Help-gnu-emacs@gnu.org; Thu, 06 May 2010 09:30:38 -0400 Original-Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1OA19r-0004jq-B8 for Help-gnu-emacs@gnu.org; Thu, 06 May 2010 06:30:31 -0700 X-Nabble-From: dirk@dirkundsari.de X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:73511 Archived-At: When I'm in lisp-interaction-mode or emacs-lisp mode, i.e. I'm writing emacs-lisp code in a buffer, then I would like to have the feature of autocompletion when I'm pressing tab. Example: I'm typing insert-buf. Then the possible completions would be: insert-buf insert-buffer insert-buffer-substring-no-properties insert-buffer-substring-as-yank insert-buffer-substring The completion algorithm of the minibuffer can do this. But I would like to have that feature when I'm programming code in a normal buffer. My idea is the following: I know that obarray contains the symbol table. So I wrote a fucntion which inserts all symbols of obarray into a buffer. (defun insert-obarray-entries-into-temp-buffer (symbol) (save-excursion (set-buffer (get-buffer-create "*temp*")) (insert (concat (symbol-name symbol) "\n")))) (mapatoms 'insert-obarray-entries-into-temp-buffer obarray) Now I can use (dabbrev-expand nil). I have a smart-tab function in my .emacs file. This function is bound to "tab" and calls (dabbrev-expand nil) when point is for example at the end of a word. Ok, I have more or less a solution. But I think that my solution is just a workaround. And each time, when a new symbol is inserted into obarray I would have to update the temporary created buffer. How would you solve this problem or have you already solved it? Thank you! Greetings, Dirk -- View this message in context: http://old.nabble.com/Autocompletion-of-Emacs-Lisp-Symbols-in-Buffer-tp28473645p28473645.html Sent from the Emacs - Help mailing list archive at Nabble.com.