From: Dirk80 <dirk@dirkundsari.de>
To: Help-gnu-emacs@gnu.org
Subject: Autocompletion of Emacs Lisp Symbols in Buffer
Date: Thu, 6 May 2010 06:30:31 -0700 (PDT) [thread overview]
Message-ID: <28473645.post@talk.nabble.com> (raw)
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.
next reply other threads:[~2010-05-06 13:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-06 13:30 Dirk80 [this message]
[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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=28473645.post@talk.nabble.com \
--to=dirk@dirkundsari.de \
--cc=Help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).