From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!not-for-mail
From: Paul Heinrich Dietrich <paul.heinrich.dietrich@gmail.com>
Newsgroups: gmane.emacs.help
Subject: Newby trying to do a macro key binding, I think
Date: Tue, 17 Nov 2009 17:41:52 -0800 (PST)
Message-ID: <26401079.post@talk.nabble.com>
NNTP-Posting-Host: lo.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: ger.gmane.org 1258524624 12179 80.91.229.12 (18 Nov 2009 06:10:24 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 18 Nov 2009 06:10:24 +0000 (UTC)
To: Help-gnu-emacs@gnu.org
Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 18 07:10:16 2009
Return-path: <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org>
Envelope-to: geh-help-gnu-emacs@m.gmane.org
Original-Received: from lists.gnu.org ([199.232.76.165])
	by lo.gmane.org with esmtp (Exim 4.50)
	id 1NAdk7-00060Q-OU
	for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Nov 2009 07:10:16 +0100
Original-Received: from localhost ([127.0.0.1]:59752 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43)
	id 1NAdk7-000644-0U
	for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Nov 2009 01:10:15 -0500
Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NAZYW-00077F-PF
	for help-gnu-emacs@gnu.org; Tue, 17 Nov 2009 20:42:00 -0500
Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1NAZYR-000710-KH
	for Help-gnu-emacs@gnu.org; Tue, 17 Nov 2009 20:41:59 -0500
Original-Received: from [199.232.76.173] (port=33969 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NAZYR-00070Y-Cp
	for Help-gnu-emacs@gnu.org; Tue, 17 Nov 2009 20:41:55 -0500
Original-Received: from kuber.nabble.com ([216.139.236.158]:42683)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <bounces@nabble.com>) id 1NAZYQ-0005Td-Sf
	for Help-gnu-emacs@gnu.org; Tue, 17 Nov 2009 20:41:55 -0500
Original-Received: from isper.nabble.com ([192.168.236.156])
	by kuber.nabble.com with esmtp (Exim 4.63)
	(envelope-from <bounces@nabble.com>) id 1NAZYO-0000z5-M5
	for Help-gnu-emacs@gnu.org; Tue, 17 Nov 2009 17:41:52 -0800
X-Nabble-From: paul.heinrich.dietrich@gmail.com
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Mailman-Approved-At: Wed, 18 Nov 2009 01:06:47 -0500
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 <help-gnu-emacs.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/help-gnu-emacs>,
	<mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/help-gnu-emacs>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/help-gnu-emacs>,
	<mailto:help-gnu-emacs-request@gnu.org?subject=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:69865
Archived-At: <http://permalink.gmane.org/gmane.emacs.help/69865>


How do you write the code for a macro and key binding (I think that's how to
do it) in your .emacs file so that you can hit a key, say f5, and the
following command is automatically entered:

C-x d /me@servername#99:/home/directory/path/

I've tried a billion variations on a theme, but can't get it to work.  For
example, I tried

C-x (C-x d /me@servername#99:/home/directory/path/C-x)

and I forget the routine now, but did something with kbd and names and
managed to get the code into my .emacs file.  The first problem is that the
main part of it (/me@servername#99:/home/directory/path/) wouldn't appear
because as I created the macro, Emacs tried to suggest a path that was
wildly different, so I had to backspace about 15 times and then type it, but
when I get the macro code into the .emacs file, all I see are a lot of
backspace backspace backspace...and no path.

No biggee, so I tried putting quotes around it, ?\ in front of it, etc.

What did I do wrong?  Go easy, I'm in the earliest learning stages of Emacs.

Next, I'm guessing I want to use a key binding.  Let's say I called the
macro pathfinder.  I think I would establish the key binding like this:

(global-set-key "\C-c a") 'pathfinder)

or

;(global-set-key [f5] 'pathfinder)

depending on whether I want to call it with f5 or C-c a.  Any help is
appreciated.  Thanks.
-- 
View this message in context: http://old.nabble.com/Newby-trying-to-do-a-macro-key-binding%2C-I-think-tp26401079p26401079.html
Sent from the Emacs - Help mailing list archive at Nabble.com.