From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marc Tfardy Newsgroups: gmane.emacs.help Subject: Re: problems with save-excursion Date: Thu, 09 Mar 2006 11:39:02 +0100 Message-ID: <47aev8Feeg51U1@individual.net> References: <1141857397.880352.44860@u72g2000cwu.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1142019387 22486 80.91.229.2 (10 Mar 2006 19:36:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Mar 2006 19:36:27 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 10 20:36:20 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FHnPD-0000GK-2o for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Mar 2006 20:36:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FHnPC-0008J6-HA for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Mar 2006 14:36:06 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!pln-w!lotsanews.com!newsfeed.icl.net!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-X-Trace: individual.net PRxTUv5Jg3SFN49/dAxwQgj4/yWw3KHEjY13Ws6MsPeyakv//P User-Agent: Thunderbird 1.5 (Windows/20051201) In-Reply-To: <1141857397.880352.44860@u72g2000cwu.googlegroups.com> Original-Xref: shelby.stanford.edu gnu.emacs.help:138059 Original-To: help-gnu-emacs@gnu.org 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:33699 Archived-At: filcab@gmail.com schrieb: > I have the following function: > (defun copy-line () > (interactive) > (save-excursion > (beginning-of-line) > (set-mark-command) > (end-of-line) > (copy-region-as-kill))) > > But it's not working... > It says: > save-excursion: Wrong number of arguments: #[(arg) ... (some trash) > > > Any clues? You may try: (defun copy-line () (interactive) (save-excursion (let (beg) (beginning-of-line) (setq beg (point)) (end-of-line) (copy-region-as-kill beg (point))))) regards Marc