help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Autocompletion of Emacs Lisp Symbols in Buffer


From: Xah Lee
Subject: Re: Autocompletion of Emacs Lisp Symbols in Buffer
Date: Thu, 6 May 2010 10:05:37 -0700 (PDT)
User-agent: G2/1.0

On May 6, 6:30 am, Dirk80 <d...@dirkundsari.de> wrote:
> 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.

it is already implemented. The command is lisp-complete-symbol, the
shortcut is Meta+Tab.

Because Meta is often Alt, and Alt+Tab is used by the OS, so you can
do is press Esc Tab.

However, that is very inconvenient, so i created my own key.

(defun call-keyword-completion ()
  "Call the command that has keyboard shortcut M-TAB."
  (interactive)
  (call-interactively (key-binding (kbd "M-TAB")))
)

then give a shortcut to call-keyword-completion, e.g. on Dvorak
keyboard i have
(global-set-key (kbd "M-y") 'call-keyword-completion)

also, you might bind Meta+Shift+y for dabbrev-expand, which does
completion by words already in the buffer. (e.g. from your own
functions, variables)

I think this Meta+Tab conflict with Alt+Tab used by Windows, Mac,
Linux, is a major emacs usability problem. It forces people to make a
choice between a “emacs world” and all others. In the past when i
asked what other heavy emacs users do, seems they either have
completely alterted their keyboard shortcuts on their system so that
emacs's way prevales, or simply doesn't do anything about it, and just
press Esc Tab for completion.

  Xah
∑ http://xahlee.org/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]