[Top][All Lists]

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

Re: Slickedit features in Emacs?

From: Peter Lee
Subject: Re: Slickedit features in Emacs?
Date: Fri, 23 May 2003 15:44:09 GMT
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (windows-nt)

>>>>> "Mark" == Mark Mynsted <address@hidden> writes:

>>>>> "Stefan" == Stefan Monnier
>>>>> <> writes:
    >>> - There should be a way to capture the name of the mode using
    >>> mode-name from the hook added to 'c-mode-common-hook, such
    >>> that when the hook gets called it finds the name, translates
    >>> that to the correct abbrev table name then adds the abbrev to
    >>> the applicable table.  If you get that working, I would like
    >>> to use it myself.  :-)

    Stefan> What's wrong with `local-abbrev-table' ?

    Mark> That is great.  Now the following will work exactly as
    Mark> requested, i.e. it will work for any mode that triggers the
    Mark> c-mode-common-hook:

    Mark> (define-skeleton my-skeleton-c-if "Insert a c if statement"
    Mark> nil "if (" > _ ")" \n "{" '(indent-for-tab-command) \n \n
    Mark> "}" '(indent-for-tab-command))

    Mark> (defun my-c-mode-common-hook () (define-abbrev
    Mark> local-abbrev-table "ifx" "" 'my-skeleton-c-if)) (add-hook
    Mark> 'c-mode-common-hook 'my-c-mode-common-hook)

Ahhh that's what I was looking for... Thanks Stefan and Mark.

reply via email to

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