How to use elisp's closure
  Home FAQ Contact Sign in
gnu.emacs.help only
 
Advanced search
POPULAR GROUPS

more...

gnu.emacs.help Profile…
 Up
How to use elisp's closure         


Author: netawater
Date: Jun 16, 2008 07:15

In most usual modes, TAB key is bound to an indent function and
M-TAB key is bound to a complete symbol function.
I want to write a function if cursor is at the end of word then
try to complete symbol, else indent. It is my function.

(defun my-indent-or-complete (M-TAB-func TAB-func)
;; "If cursor is at the end of word then current mode;s M-TAB
function, else TAB"
(lambda ()
(interactive)
(if (looking-at "\\>")
(apply M-TAB-func '())
(apply TAB-func '())
))
)

Then I try to bound it to \t key:
Show full article (0.95Kb)
4 Comments
Re: How to use elisp's closure         


Author: beaubert
Date: Jun 16, 2008 08:49

On Monday 16 June 2008 16:15:21 netawater wrote:
> In most usual modes, TAB key is bound to an indent function and
> M-TAB key is bound to a complete symbol function.
> I want to write a function if cursor is at the end of word then
> try to complete symbol, else indent. It is my function.
>
Have a look at my previous post about tabkey2.el
It may be interesting for what you want to do ...

--
François BEAUBERT
ENSIAME/LME
Bureau A9
Université de Valenciennes - Le Mont Houy - 59313 Valenciennes Cedex 9
Téléphone: (0/33)3 27 51 19 72
Télécopie: (0/33)3 27 51 19 61
Mel: francois.beaubert@univ-valenciennes.fr
Show full article (0.73Kb)
no comments
Re: How to use elisp's closure         


Author: David Hansen
Date: Jun 16, 2008 08:42

On Mon, 16 Jun 2008 22:15:21 +0800 netawater wrote:
> In most usual modes, TAB key is bound to an indent function and
> M-TAB key is bound to a complete symbol function.
> I want to write a function if cursor is at the end of word then
> try to complete...
Show full article (1.53Kb)
no comments
Re: How to use elisp's closure         


Author: netawater
Date: Jun 17, 2008 06:02

beaubert writes:
Show full article (1.01Kb)
no comments
Re: How to use elisp's closure         


Author: netawater
Date: Jun 17, 2008 06:06

David Hansen gmx.net> writes:
> On Mon, 16 Jun 2008 22:15:21 +0800 netawater wrote:
>
>> In most usual modes, TAB key is bound to an indent function and
>> M-TAB key is bound to a complete symbol function.
>> I want to write a function...
Show full article (2.13Kb)
no comments