From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Mark Mynsted Newsgroups: gmane.emacs.help Subject: Re: Slickedit features in Emacs? Date: 23 May 2003 08:38:55 -0500 Organization: Uncle John's Band Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <87e77d96.0305211059.3e15858a@posting.google.com> <5ln0hed77z.fsf@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1053697460 7731 80.91.224.249 (23 May 2003 13:44:20 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 23 May 2003 13:44:20 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Fri May 23 15:44:19 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19JCmm-0001jN-00 for ; Fri, 23 May 2003 15:40:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19JCme-0001G3-L6 for gnu-help-gnu-emacs@m.gmane.org; Fri, 23 May 2003 09:40:32 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!204.68.152.1!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-NNTP-Posting-Host: 204.68.152.1 Original-X-Trace: fu-berlin.de 1053697136 1043201 204.68.152.1 (16 [148877]) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-Xref: shelby.stanford.edu gnu.emacs.help:113616 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10112 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10112 >>>>> "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' ? 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. / \