[Top][All Lists]

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

Re: "Tab-fix"

From: Pascal J. Bourguignon
Subject: Re: "Tab-fix"
Date: Tue, 22 Jul 2008 08:54:46 +0200
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.2 (gnu/linux)

denebet <address@hidden> writes:

> I have put the stuff found at
> <>
>  in my .emacs to get autocompletion bound to tab in C(++) editing mode while
> keeping the completion of file name in mini-buffers.
> (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 'c-mode-hook          'my-tab-fix)
> (add-hook 'sh-mode-hook         'my-tab-fix)
> (add-hook 'emacs-lisp-mode-hook 'my-tab-fix)
> Unfortunately, it seems not to work, at least while editing cpp files.
> Any idea ?

In a *.cpp buffer, type: M-: major-mode RET
What do you get?

__Pascal Bourguignon__           
The rule for today:
Touch my tail, I shred your hand.
New rule tomorrow.

reply via email to

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