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:21: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="===============1015256573==" X-Trace: sea.gmane.org 1180587100 24186 80.91.229.12 (31 May 2007 04:51:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 31 May 2007 04:51:40 +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:51:33 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 1HtcdI-0002y4-L7 for geh-help-gnu-emacs@m.gmane.org; Thu, 31 May 2007 06:51:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HtcdH-0001eo-Jv for geh-help-gnu-emacs@m.gmane.org; Thu, 31 May 2007 00:51:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Htcd1-0001ej-GV for help-gnu-emacs@gnu.org; Thu, 31 May 2007 00:51:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Htccy-0001eX-Um for help-gnu-emacs@gnu.org; Thu, 31 May 2007 00:51:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Htccy-0001eU-OL for help-gnu-emacs@gnu.org; Thu, 31 May 2007 00:51:12 -0400 Original-Received: from nz-out-0506.google.com ([64.233.162.233]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Htccv-0007QC-Mh for help-gnu-emacs@gnu.org; Thu, 31 May 2007 00:51:11 -0400 Original-Received: by nz-out-0506.google.com with SMTP id z3so36224nzf for ; Wed, 30 May 2007 21:51: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=UG4b8U268ipHaWNmQb8XuFFjNErZcjHXSDiYnspet8HftrDc3yTmItTdn94mLlEqyQeQkTDm2zleer5WeIO0Cr7bXsZ5gLL0NRO4cR7jSiV9dBMWKOY02BNqSj/lpYSWyb+jNjr08DgrZze8vBCAvI6XjDt3coxh6swOeqcUS1s= 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=V8SAEImsRsYAledcNkbZcr0iE0bFod6o5JKFJjV64tMXmCMCHc69WYsZRgRUkO9O/8iEmmhmvIFhbr/zj9b/h+xx32T68JYDg0ddjejDUAeqKWWCQOkJFzisV9GdhrR38jbWnng+NdsXnfjqdebCFpcgqOvD3TsSkc6lpTelXRg= Original-Received: by 10.143.45.8 with SMTP id x8mr7964wfj.1180587060537; Wed, 30 May 2007 21:51:00 -0700 (PDT) Original-Received: by 10.142.113.15 with HTTP; Wed, 30 May 2007 21:51:00 -0700 (PDT) In-Reply-To: <1180527603.726755.118550@g4g2000hsf.googlegroups.com> 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:44560 Archived-At: --===============1015256573== Content-Type: multipart/alternative; boundary="----=_Part_7804_21717772.1180587060496" ------=_Part_7804_21717772.1180587060496 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 wrote: > > On 29 maio, 03:45, "Ankur Jain" 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 ------=_Part_7804_21717772.1180587060496 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 ------=_Part_7804_21717772.1180587060496-- --===============1015256573== 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 --===============1015256573==--