[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Slickedit features in Emacs?
From: |
Mark Mynsted |
Subject: |
Re: Slickedit features in Emacs? |
Date: |
23 May 2003 08:38:55 -0500 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
>>>>> "Stefan" == Stefan Monnier
>>>>> <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> 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' ?
That is great.
Now the following will work exactly as requested, i.e. it will work
for any mode that triggers the c-mode-common-hook:
(define-skeleton my-skeleton-c-if
"Insert a c if statement" nil
"if (" > _ ")" \n
"{" '(indent-for-tab-command) \n
\n
"}" '(indent-for-tab-command))
(defun my-c-mode-common-hook ()
(define-abbrev local-abbrev-table "ifx" "" 'my-skeleton-c-if))
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
Thank you Stefan!
--
-MM
I rarely read email from this address /"\
because of spam. \ / ASCII Ribbon Campaign
I MAY see it if you put #NOTSPAM# X Against HTML Mail
in the subject line. / \
- Re: Slickedit features in Emacs?, (continued)
- Re: Slickedit features in Emacs?, Benjamin Rutt, 2003/05/21
- Re: Slickedit features in Emacs?, Henrik Jönsson, 2003/05/22
- Re: Slickedit features in Emacs?, Bruce Ashfield, 2003/05/22
- Re: Slickedit features in Emacs?, Stefan Monnier, 2003/05/22
- Re: Slickedit features in Emacs?, Peter Lee, 2003/05/22
- Re: Slickedit features in Emacs?, Mark Mynsted, 2003/05/22
- Re: Slickedit features in Emacs?, Peter Lee, 2003/05/22
- Re: Slickedit features in Emacs?, Kai Großjohann, 2003/05/22
- Re: Slickedit features in Emacs?, Mark Mynsted, 2003/05/22
- Re: Slickedit features in Emacs?, Stefan Monnier, 2003/05/22
- Re: Slickedit features in Emacs?,
Mark Mynsted <=
- Re: Slickedit features in Emacs?, Peter Lee, 2003/05/23
Re: Slickedit features in Emacs?, Peter Lee, 2003/05/21
Re: Slickedit features in Emacs?, Burton Samograd, 2003/05/21
Re: Slickedit features in Emacs?, Phillip Lord, 2003/05/21
Re: Slickedit features in Emacs?, Ole Laursen, 2003/05/21
Re: Slickedit features in Emacs?, Stefan Monnier, 2003/05/21
Re: Slickedit features in Emacs?, Kai Großjohann, 2003/05/22