all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Autocompletion of Emacs Lisp Symbols in Buffer
@ 2010-05-06 13:30 Dirk80
  0 siblings, 0 replies; 7+ messages in thread
From: Dirk80 @ 2010-05-06 13:30 UTC (permalink / raw
  To: Help-gnu-emacs


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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-05-08  3:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.26.1273152642.10435.help-gnu-emacs@gnu.org>
2010-05-06 17:05 ` Autocompletion of Emacs Lisp Symbols in Buffer Xah Lee
2010-05-06 19:41   ` Lennart Borgman
2010-05-07  9:45   ` Dirk80
     [not found]   ` <mailman.9.1273238866.2075.help-gnu-emacs@gnu.org>
2010-05-07 14:21     ` Andreas Politz
2010-05-08  3:03     ` Xah Lee
2010-05-07  2:47 ` Stefan Monnier
2010-05-06 13:30 Dirk80

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.