From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: Need help with creating shortcuts Date: Sun, 24 Jun 2012 15:51:32 +0200 Organization: Informatimago Message-ID: <87ehp4byxn.fsf@kuiper.lan.informatimago.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1340546121 18821 80.91.229.3 (24 Jun 2012 13:55:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 24 Jun 2012 13:55:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 24 15:55:17 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SinHW-0003j8-De for geh-help-gnu-emacs@m.gmane.org; Sun, 24 Jun 2012 15:55:14 +0200 Original-Received: from localhost ([::1]:44473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SinHW-0007BB-Dy for geh-help-gnu-emacs@m.gmane.org; Sun, 24 Jun 2012 09:55:14 -0400 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-X-Trace: individual.net T8O62XoQVPPij0/wvTPBZw5M7+l5YWDeCOWHGYgpL1ZYCcoaVMf7MQCZE5rhFGsiWS Cancel-Lock: sha1:ZDRjYmZiZjE5NjA5MzBlNDc2MmQxMTQwZTVlMTM5MGU5MWJhYjBkMQ== sha1:hFgQ3R9/LXYrBKiG9lbU5WEHMgw= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:193022 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85417 Archived-At: C K Kashyap writes: > Hi All, > I've been defining functions to create shortcuts  > > (defun (hw) (progn  >        (delete-fun) ; This is another function that deletes the actual function name from the buffer >        (insert "Hello World")) > > I invoke it as follows - (hw)C-X-e, this removes (hw) and replaces it with Hello World. > > the problem is that I have to type parenthesis. I explored > abbreviations but they cannot seem to be parameterized. Can someone > please suggest an alternative? Write it like this: (defun hw () (interactive) ; makes it a command. (insert "Hello World")) Call it like this: M-x hw RET -- __Pascal Bourguignon__ http://www.informatimago.com/ A bad day in () is better than a good day in {}.