[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Completion in Auctex
From: |
denebet |
Subject: |
Re: Completion in Auctex |
Date: |
Mon, 22 Sep 2008 08:53:28 +0200 |
User-agent: |
KNode/0.10.9 |
Ross A. Laird wrote:
> I don't know if this is what you are looking for, but in auctex you can
> type M-/ (alt-forward slash) and it will complete words that are not
> commands (e.g. words that exist previously in the document).
Thanks.
Yes, this is what I was looking for but didn't find it because a long time
ago I set completion in programming modes to [TAB] and forgot to set it
for text mode.
In case it could be useful for people reading this group and who think that
M-/ is not a very user friendly shortcut :
from
<http://www.emacsblog.org/2007/03/12/tab-completion-everywhere/>
-------------
(defun indent-or-expand (arg)
"Either indent according to mode, or expand the word preceding
point."
(interactive "*P")
(if (and
(or (bobp) (= ?w (char-syntax (char-before))))
(or (eobp) (not (= ?w (char-syntax (char-after))))))
(dabbrev-expand arg)
(indent-according-to-mode)))
(defun my-tab-fix ()
(local-set-key [tab] 'indent-or-expand))
(add-hook 'text-mode-hook 'my-tab-fix) ;; for auctex
(add-hook 'c++-mode-hook 'my-tab-fix) ;; for c++
;; and so on
---------------
Have a nice day