From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: james Newsgroups: gmane.emacs.help Subject: Re: Running .emacs style commands within emacs Date: Tue, 20 May 2008 11:05:54 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1211340791 25404 80.91.229.12 (21 May 2008 03:33:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 May 2008 03:33:11 +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 May 21 05:33:48 2008 Return-path: 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 1Jyf5G-0005b2-DG for geh-help-gnu-emacs@m.gmane.org; Wed, 21 May 2008 05:33:46 +0200 Original-Received: from localhost ([127.0.0.1]:50129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jyf4W-0007U8-18 for geh-help-gnu-emacs@m.gmane.org; Tue, 20 May 2008 23:33:00 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!25g2000hsx.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 18 Original-NNTP-Posting-Host: 166.37.126.56 Original-X-Trace: posting.google.com 1211306754 14543 127.0.0.1 (20 May 2008 18:05:54 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 20 May 2008 18:05:54 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 25g2000hsx.googlegroups.com; posting-host=166.37.126.56; posting-account=AV4RFwoAAACWWwc6_nSHwKjd2sVlDEwQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:158807 X-Mailman-Approved-At: Tue, 20 May 2008 23:32:01 -0400 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:54189 Archived-At: On May 19, 6:51 pm, "Ben Forbes" wrote: > In my .emacs init file I have commands like > > (fset 'delete-whole-line "\C-a\C-k\C-k") > > How can I run a command like this from within emacs? It doesn't seem to be > recognized when I try "M-x fset". M-x only allows you to run interactive commands, which fset is not. If you want to run an arbitrary lisp expression (very useful for giving variables buffer-local values), you can use M-x eval-expression (bound to M-: on my emacs), then you can type in your s-expression in the minibuffer: (setq c-basic-offset 3) (or you could just type it in the buffer and C-x-e, as others have mentioned)