From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Peter Lee Newsgroups: gmane.emacs.help Subject: Re: Slickedit features in Emacs? Date: Fri, 23 May 2003 15:44:09 GMT Organization: Prodigy Internet http://www.prodigy.com Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <87e77d96.0305211059.3e15858a@posting.google.com> <87e77d96.0305212307.60c099ef@posting.google.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1053705744 24252 80.91.224.249 (23 May 2003 16:02:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 23 May 2003 16:02:24 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Fri May 23 18:02:15 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 19JEtn-0005pz-00 for ; Fri, 23 May 2003 17:56:03 +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 19JEjV-0007Zw-C1 for gnu-help-gnu-emacs@m.gmane.org; Fri, 23 May 2003 11:45:25 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed-east.nntpserver.com!nntpserver.com!diablo.voicenet.com!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr28.news.prodigy.com.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:YvLGV4++Dr5UhWoswYjAk3/OGcU= Original-Lines: 26 Original-NNTP-Posting-Host: 216.62.199.3 Original-X-Complaints-To: abuse@prodigy.net Original-X-Trace: newssvr28.news.prodigy.com 1053704649 ST000 216.62.199.3 (Fri, 23 May 2003 10:44:09 CDT) Original-NNTP-Posting-Date: Fri, 23 May 2003 10:44:09 CDT X-UserInfo1: Q[OSS\WGPZYKRT\YN[OJNW@@YJ_ZTB\MV@BL\QMIWIWTEPIB_NVUAH_[BL[\IRKIANGGJBFNJF_DOLSCENSY^U@FRFUEXR@KFXYDBPWBCDQJA@X_DCBHXR[C@\EOKCJLED_SZ@RMWYXYWE_P@\\GOIW^@SYFFSWHFIXMADO@^[ADPRPETLBJ]RDGENSKQQZN Original-Xref: shelby.stanford.edu gnu.emacs.help:113627 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:10123 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10123 >>>>> "Mark" == Mark Mynsted 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.