From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Francisco Borges Newsgroups: gmane.emacs.help Subject: Re: local key swap? alternatives? Date: Thu, 8 Sep 2005 16:57:15 +0200 Organization: Alfa Informatica - Rijksuniversiteit Groningen Message-ID: <20050908145715.GB21689@let.rug.nl> References: <20050901124642.GB13963@let.rug.nl> <20050907135325.GA13168@let.rug.nl> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1126192568 26169 80.91.229.2 (8 Sep 2005 15:16:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Sep 2005 15:16:08 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 08 17:15:57 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EDO0q-00038F-5P for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Sep 2005 17:08:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EDO0p-0005Eq-HP for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Sep 2005 11:08:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EDNys-0004Zj-27 for help-gnu-emacs@gnu.org; Thu, 08 Sep 2005 11:06:26 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EDNyq-0004WQ-1I for help-gnu-emacs@gnu.org; Thu, 08 Sep 2005 11:06:24 -0400 Original-Received: from [129.125.8.60] (helo=dep.let.rug.nl) by monty-python.gnu.org with smtp (Exim 4.34) id 1EDNuZ-0007hL-G4 for help-gnu-emacs@gnu.org; Thu, 08 Sep 2005 11:01:59 -0400 Original-Received: from dep.let.rug.nl ([129.125.8.60]) by dep.let.rug.nl (SMSSMTP 4.1.0.19) with SMTP id M2005090816523408257 for ; Thu, 08 Sep 2005 16:52:34 +0200 Original-Received: from loki (postfix@loki.let.rug.nl [129.125.8.86]) by dep.let.rug.nl (8.12.10/8.12.10) with ESMTP id j88EqXVk023684 for ; Thu, 8 Sep 2005 16:52:34 +0200 (MEST) Original-Received: by loki (Postfix, from userid 7006) id 7AAC3E9D5; Thu, 8 Sep 2005 16:57:17 +0200 (CEST) Original-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: X-Operating-System: Linux/2.6.8-1-686 (i686) X-Editor: GNU Emacs 22.0.50.1 User-Agent: Mutt/1.5.9i X-Whitelist: OK X-Scanned-By: milter-spamc/0.25.321 (dep.let.rug.nl [129.125.8.60]); Thu, 08 Sep 2005 16:52:34 +0200 X-MIME-Autoconverted: from 8bit to quoted-printable by dep.let.rug.nl id j88EqXVk023684 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:29329 Archived-At: =BB On Wed, Sep 07, 2005 at 11:47AM -0600, Kevin Rodgers wrote: > If you have many such functions, you'd want to abstract the common part= s > with a function-defining macro: > > (defmacro define-my-insert (name char) > "Define the `my-NAME' command, to insert CHAR." > `(defun ,(intern (format "my-%s" name)) (&optional arg) > ,(format "Insert \"%c\" at point. > With a prefix ARG, insert that many characters." > char) > (interactive "p") > (insert-char ,char (or arg 1)))) > > (define-my-insert four ?4) > (define-my-insert dollar ?$) That's great! Thanks a lot! Cheers, Francisco.