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

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

Re: execute after char/string


From: Andreas Politz
Subject: Re: execute after char/string
Date: Thu, 27 Nov 2008 23:15:59 +0100
User-agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018)

Barry Margolin wrote:
In article <9dddf442-089c-495a-af1c-072cc80ad2b0@n33g2000pri.googlegroups.com>,
 Steve Chow <msweaksauce@hotmail.com> wrote:

is there a way I can execute a function/macro after I've inserted a
character or string? In this case I'd like execute a function after
typing . or -> in c-mode. I tried using global-set-key but then of
course it won't let me enter those characters into the buffer.

See after-change-functions.


A spicedup self-insert-command is much simpler I think.

(defun super-dot-minus-arrow (&optional arg)
  (interactive "p")
  (self-insert-command arg)
  (do-some-more-stuff-when-apropriate))

(define-key your-map (kbd ".") 'super-dot-minus-arrow)

-ap


reply via email to

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