From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Ankur Jain" Newsgroups: gmane.emacs.help Subject: Re: Join Multiple Lines Date: Thu, 31 May 2007 10:25:00 +0530 Message-ID: References: <1180527603.726755.118550@g4g2000hsf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1260042993==" X-Trace: sea.gmane.org 1180587339 24678 80.91.229.12 (31 May 2007 04:55:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 31 May 2007 04:55:39 +0000 (UTC) To: weber , "Gnu Emacs Mailing List" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 31 06:55:32 2007 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 1Htch7-0003W5-85 for geh-help-gnu-emacs@m.gmane.org; Thu, 31 May 2007 06:55:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Htch6-0003VZ-9L for geh-help-gnu-emacs@m.gmane.org; Thu, 31 May 2007 00:55:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Htcgq-0003VT-4G for help-gnu-emacs@gnu.org; Thu, 31 May 2007 00:55:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Htcgo-0003VH-1V for help-gnu-emacs@gnu.org; Thu, 31 May 2007 00:55:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Htcgn-0003VE-SN for help-gnu-emacs@gnu.org; Thu, 31 May 2007 00:55:09 -0400 Original-Received: from nz-out-0506.google.com ([64.233.162.225]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Htcgl-0007hT-NL for help-gnu-emacs@gnu.org; Thu, 31 May 2007 00:55:08 -0400 Original-Received: by nz-out-0506.google.com with SMTP id z3so36843nzf for ; Wed, 30 May 2007 21:55:01 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=VAD3KeRWBbvedd6e4ae2/yG71j7a1T1ir3GLpeUqh7SLQwypiQ0W8Ynf1lV1eDyqVlGehXDQGeczw3TAo4yzXu/Myokex/Fxw3eyKvW1kg8T3qte1sueKXnsn4mpzJKBF/ZgXVj+b4iavN9dut1IuFtoIM3PdwlwDxr6FHf2yoQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=TByqTeFdy1fXELYwl5oqgWFgX1v6zBQLWpNnnIaDC0MLB3s88q8AKB5k8zbTNzZRHS/mujVFzYw1nsn5Hkxu5Us8+0eHMM1KLI+hYnCB2jtS3T6/AsWeqoQHZ/Szj29BhBvgIHdS1rvaVVYxbe13KRnZ5JvTUkJtWiGbKPWH7wk= Original-Received: by 10.142.72.21 with SMTP id u21mr8560wfa.1180587300627; Wed, 30 May 2007 21:55:00 -0700 (PDT) Original-Received: by 10.142.113.15 with HTTP; Wed, 30 May 2007 21:55:00 -0700 (PDT) In-Reply-To: X-detected-kernel: Linux 2.4-2.6 (Google crawlbot) 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:44561 Archived-At: --===============1260042993== Content-Type: multipart/alternative; boundary="----=_Part_7828_2366211.1180587300583" ------=_Part_7828_2366211.1180587300583 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I apologize....I pasted wrongly...it's working perfectly....great feature... can you try to get this function available by default in future emacs version? Regards Ankur Jain On 5/31/07, Ankur Jain wrote: > > Hi weber, > > I pasted this code in my .emacs and restarted Emacs. I got the following > error : > > Symbol's value as variable is void: On > > To ensure normal operation, you should investigate the cause of the error > in your initialization file and remove it. Start Emacs with the > `--debug-init' option to view a complete error backtrace > > > Thanks > Ankur > > > On 5/30/07, weber < hugows@gmail.com> wrote: > > > > On 29 maio, 03:45, "Ankur Jain" < jainan...@gmail.com> wrote: > > > Hi, > > > > > > How can I join multiple lines into one line using Emacs. > > > > > > I know the command "join-line" to join the current line with previous; > > how > > > to do it for multiple lines? > > > > > > Can I execute it multiple times for a set of lines. If yes, please let > > me > > > know how to do that? > > > > > > Regards > > > Ankur Jain > > > > I just wrote and tested this function. > > Just mark the region and do a join-region. > > Tell me if it helped, > > -weber > > > > (defun join-region (beg end) > > "Apply join-line over region." > > (interactive "r") > > (if mark-active > > (let ((beg (region-beginning)) > > (end (copy-marker (region-end)))) > > (goto-char beg) > > (while (< (point) end) > > (join-line 1))))) > > > > > > > > > > > -- > Regards > Ankur Jain > > http://ankurjain.org -- Regards Ankur Jain http://ankurjain.org ------=_Part_7828_2366211.1180587300583 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline I apologize....I pasted wrongly...it's working perfectly....great feature...

can you try to get this function available by default in future emacs version?

Regards
Ankur Jain

On 5/31/07, Ankur Jain <jainankur@gmail.com> wrote:
Hi weber,

I pasted this code in my .emacs and restarted Emacs. I got the following error :

Symbol's value as variable is void: On

To ensure normal operation, you should investigate the cause of the error in your initialization file and remove it.  Start Emacs with the `--debug-init' option to view a complete error backtrace


Thanks
Ankur



On 5/30/07, weber < hugows@gmail.com> wrote:
On 29 maio, 03:45, "Ankur Jain" < jainan...@gmail.com> wrote:
> Hi,
>
> How can I join multiple lines into one line using Emacs.
>
> I know the command "join-line" to join the current line with previous; how
> to do it for multiple lines?
>
> Can I execute it multiple times for a set of lines. If yes, please let me
> know how to do that?
>
> Regards
> Ankur Jain

I just wrote and tested this function.
Just mark the region and do a join-region.
Tell me if it helped,
-weber

(defun join-region (beg end)
  "Apply join-line over region."
  (interactive "r")
  (if mark-active
          (let ((beg (region-beginning))
                        (end (copy-marker (region-end))))
                (goto-char beg)
                (while (< (point) end)
                  (join-line 1)))))






--
Regards
Ankur Jain

http://ankurjain.org



--
Regards
Ankur Jain

http://ankurjain.org ------=_Part_7828_2366211.1180587300583-- --===============1260042993== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ help-gnu-emacs mailing list help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs --===============1260042993==--