help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs like line editing during perl input.


From: Kai Großjohann
Subject: Re: Emacs like line editing during perl input.
Date: Tue, 31 Dec 2002 16:14:54 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu)

Harry Putnam <hgp@sbcglobal.net> writes:

> I'd like to have somekind of line editing available during user
> input to a perl script.

Here is an example program using Term::ReadLine that worked for me.

#!/usr/sw/perl/default/bin/perl -w
use Term::ReadLine;
my $t = Term::ReadLine->new('Do nothing');
my $inp = '';   # input from user
print "Type quit to quit.\n";
do {
    $inp = $t->readline("> ");
} while ( $inp ne 'quit' );
exit 0;

Don't forget to change the first line.  It's really as easy as
calling $x->readline($prompt) to read a line after creating the
Term::ReadLine object $x.

-- 
Ambibibentists unite!
>From help-gnu-emacs-bounces@gnu.org  Tue Dec 31 10:20:20 2002
Path: 
shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!p50877dc3.dip.t-dialin.NET!not-for-mail
From: kai.grossjohann@uni-duisburg.de (Kai =?iso-8859-1?q?Gro=DFjohann?=)
Newsgroups: gnu.emacs.help
Date: Tue, 31 Dec 2002 16:16:15 +0100
Organization: University of Dortmund, Germany
Lines: 10
Message-ID: <843coejk1s.fsf@lucy.cs.uni-dortmund.de>
References: <aura5l$7ud$1@panix3.panix.com>
NNTP-Posting-Host: p50877dc3.dip.t-dialin.net (80.135.125.195)
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: fu-berlin.de 1041347785 10419269 80.135.125.195 (16 [73968])
User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50
 (i686-pc-linux-gnu)
Cancel-Lock: sha1:UCTqZOZ05bDCrJg8vxsQvaDKzCE=
Xref: shelby.stanford.edu gnu.emacs.help:108625
To: help-gnu-emacs@gnu.org
Subject: Re: In *shell*, what *might* cause ^c^z and ^c^c to not work?
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 31 Dec 2002 15:20:20 -0000

dkcombs@panix.com (David Combs) writes:

> Anyway, when in *Shell*, and want to control-z
> out of a program running there, C-c C-z doesn't
> work -- nor C-c C-c, either.

What does C-h k C-c C-c or C-h k C-c C-z say while in shell mode?

-- 
Ambibibentists unite!
>From help-gnu-emacs-bounces@gnu.org  Tue Dec 31 10:35:26 2002
Path: 
shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
From: Harry Putnam <hgp@sbcglobal.net>
Newsgroups: gnu.emacs.help
Date: Tue, 31 Dec 2002 07:30:35 -0800
Organization: Still searching...
Message-ID: <m2ptriw6hw.fsf@sbcglobal.net>
References: <m28yy8gt8p.fsf@sbcglobal.net>
        <8465tajk41.fsf@lucy.cs.uni-dortmund.de>
User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50
 (i686-pc-linux-gnu)
Cancel-Lock: sha1:6K0qT+UXO7zu/M+izV54GeIFFtM=
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@supernews.com
Lines: 13
Xref: shelby.stanford.edu gnu.emacs.help:108626
To: help-gnu-emacs@gnu.org
Subject: Re: Emacs like line editing during perl input.
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 31 Dec 2002 15:35:26 -0000

kai.grossjohann@uni-duisburg.de (Kai Großjohann) writes:

> #!/usr/sw/perl/default/bin/perl -w
> use Term::ReadLine;
> my $t = Term::ReadLine->new('Do nothing');
> my $inp = ''; # input from user
> print "Type quit to quit.\n";

Ha... heres somethuing I can follow.  Thanks Kai.
Seems to automatically have emacs like line editing.

And indulging myself in childish mode too..
Hey `Those Who Know Me'  ... Na na na naaa na
>From help-gnu-emacs-bounces@gnu.org  Tue Dec 31 12:35:19 2002
Path: 
shelby.stanford.edu!newsfeed.stanford.edu!news.uchicago.edu!yellow.newsread.com!netaxs.com!newsread.com!feed3.newsreader.com!newsreader.com!news-xfer.cox.net!cox.net!sn-xit-03!sn-xit-06!sn-post-01!supernews.com!news.supernews.com!not-for-mail
From: those who know me have no need of my name <not-a-real-address@usa.net>
Newsgroups: gnu.emacs.help
Date: 31 Dec 2002 17:29:59 GMT
Organization: earthfriends
Message-ID: <m1fzsertaz.gnus@usa.net>
User-Agent: Gnus/5.090008 (Oort Gnus v0.08) XEmacs/21.4 (Military
 Intelligence, i686-redhat-linux)
References: <m28yy8gt8p.fsf@sbcglobal.net>
        <8465tajk41.fsf@lucy.cs.uni-dortmund.de>
        <m2ptriw6hw.fsf@sbcglobal.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@supernews.com
Lines: 19
Xref: shelby.stanford.edu gnu.emacs.help:108627
To: help-gnu-emacs@gnu.org
Subject: Re: Emacs like line editing during perl input.
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 31 Dec 2002 17:35:19 -0000

in gnu.emacs.help i read:
>kai.grossjohann@uni-duisburg.de (Kai Großjohann) writes:

>> #!/usr/sw/perl/default/bin/perl -w
>> use Term::ReadLine;
>> my $t = Term::ReadLine->new('Do nothing');

[then use the object]

>Ha... heres somethuing I can follow.  Thanks Kai.
>Seems to automatically have emacs like line editing.
>
>And indulging myself in childish mode too..
>Hey `Those Who Know Me'  ... Na na na naaa na

i told you it was trivial perl programming.

-- 
bringing you boring signatures for 17 years
>From help-gnu-emacs-bounces@gnu.org  Tue Dec 31 14:20:09 2002
Path: 
shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!spool0900.news.uu.net!reader0900.news.uu.net!not-for-mail
Sender: zhuang@blinky.bloomberg.com
Newsgroups: gnu.emacs.help
From: zghuang@bloombergREMOVETHISPART.net (Z. Huang)
Date: 31 Dec 2002 14:16:58 -0500
Message-ID: <yq0c65tavw0l.fsf@blinky.bloomberg.com>
Organization: www.bloomberg.com
X-Newsreader: Gnus v5.7/Emacs 20.7
Lines: 4
NNTP-Posting-Host: 199.172.169.19
X-Trace: 1041362219 reader0.ash.ops.us.uu.net 4889 199.172.169.19
Xref: shelby.stanford.edu gnu.emacs.help:108628
To: help-gnu-emacs@gnu.org
Subject: where is a function defined
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 31 Dec 2002 19:20:09 -0000


  load-path seems to be not I wanted. I have to go to each of the directories
to find a symbol that I need. Is there any simpler way to find the definition
of a function?
>From ams@kemisten.nu Tue Dec 31 14:38:13 2002
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
        id 18TSDN-0001VU-00
        for help-gnu-emacs@gnu.org; Tue, 31 Dec 2002 14:38:13 -0500
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
        id 18TSDK-0001P5-00
        for help-gnu-emacs@gnu.org; Tue, 31 Dec 2002 14:38:12 -0500
Received: from mailhost.bonet.ac ([194.165.224.191])
        by monty-python.gnu.org with esmtp (Exim 4.10.13)
        id 18TSDK-0001Oo-00
        for help-gnu-emacs@gnu.org; Tue, 31 Dec 2002 14:38:10 -0500
Received: from lgh163a.kemisten.nu (lgh163a.kemisten.nu [212.32.172.173])
        by mailhost.bonet.ac (8.8.8/8.8.8) with ESMTP id UAA03907;
        Tue, 31 Dec 2002 20:38:09 +0100 (MET)
Received: from ams by lgh163a.kemisten.nu with local (Exim 3.36 #1 (Debian))
        id 18TSDJ-0004xk-00; Tue, 31 Dec 2002 20:38:09 +0100
From: "Alfred M. Szmidt" <ams@kemisten.nu>
To: zghuang@bloombergREMOVETHISPART.net
In-reply-to: <yq0c65tavw0l.fsf@blinky.bloomberg.com>
        (zghuang@bloombergREMOVETHISPART.net)
References: <yq0c65tavw0l.fsf@blinky.bloomberg.com>
Message-Id: <E18TSDJ-0004xk-00@lgh163a.kemisten.nu>
Date: Tue, 31 Dec 2002 20:38:09 +0100
cc: help-gnu-emacs@gnu.org
Subject: Re: where is a function defined
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 31 Dec 2002 19:38:14 -0000

     load-path seems to be not I wanted. I have to go to each of the
   directories to find a symbol that I need. Is there any simpler way
   to find the definition of a function?

Maybe I misunderstood the question, but what is wrong with using `C-h
C-f' (describe-function)?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]