From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Decebal Newsgroups: gmane.emacs.help Subject: Re: Writing a function for a indented copy of a region Date: Wed, 17 Dec 2008 16:49:29 -0800 (PST) Organization: http://groups.google.com Message-ID: <95579c65-3983-4db3-9abe-2eb7fb67af11@r36g2000prf.googlegroups.com> References: <1229543337.962004@arno.fh-trier.de> <38ccb458-3f76-4461-bf75-57c674affae9@c36g2000prc.googlegroups.com> <1229560143.209829@arno.fh-trier.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1229564446 30867 80.91.229.12 (18 Dec 2008 01:40:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Dec 2008 01:40:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 18 02:41:50 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 1LD7td-0005pY-Gm for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Dec 2008 02:41:49 +0100 Original-Received: from localhost ([127.0.0.1]:50054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LD7sR-00084r-AR for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Dec 2008 20:40:35 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!r36g2000prf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-NNTP-Posting-Host: 84.53.123.169 Original-X-Trace: posting.google.com 1229561369 6729 127.0.0.1 (18 Dec 2008 00:49:29 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 18 Dec 2008 00:49:29 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: r36g2000prf.googlegroups.com; posting-host=84.53.123.169; posting-account=K-cdeAoAAAD_0d505kUtHXJaT5LFIu-3 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.9.0.5) Gecko/2008120121 Firefox/3.0.5,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:165432 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:60762 Archived-At: On 18 dec, 01:27, Andreas Politz wrote: > > Looking at your code I should replace: > > =A0 =A0 =A0 =A0 (indent-rigidly (region-beginning) (region-end) indent) > > =A0 =A0 =A0 =A0 (if do-kill > > =A0 =A0 =A0 =A0 =A0 =A0 (kill-region (region-beginning) (region-end)) > > =A0 =A0 =A0 =A0 =A0 (copy-region-as-kill (region-beginning) (region-end= )) > > =A0 =A0 =A0 =A0 =A0 (undo) > > =A0 =A0 =A0 =A0 =A0 ) > > with: > > =A0 =A0 =A0 =A0 (kill-new (replace-regexp-in-string > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"^" > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(format (format "%%%ds" indent) = "") > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(filter-buffer-substring (region= -beginning) (region- > > end) do-kill) > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0) > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ) > > > but then I get that filter-buffer-substring is void. What am I doing > > wrong? > > You are using a undefined function ? Looks like it yes. But http://www.gnu.org/software/emacs/elisp/html_node/Bu= ffer-Contents.html says that the functions exists. ???