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

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

Re: Password processing in Lisp


From: Friedrich Dominicus
Subject: Re: Password processing in Lisp
Date: 30 Dec 2002 08:59:50 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Military Intelligence)

tennis_smith@yahoo.com (Tennis Smith) writes:

> Hi. I'm trying to write a lisp function that will
> automatically telnet and login to a router.  Unfortunately,
> when I get to password processing, it expects me to type in
> the minibuffer.  How can I get around that programatically
> and send the password from my defun?

I assume you are using the telnet.el file. If that is the case you
should check this
;; You can use the global telnet-host-properties to associate a telnet
;; program and login name with each host you regularly telnet to.


setting it may work. But I guess the problem is this line:
           (let ((password (comint-read-noecho "Password: " t)))
             (setq telnet-count 0)
             (process-send-string proc (concat password telnet-new-line))))

in function telnet-initial-filter. 

If that is the case you must change this lines for your needs. 

I would use the telnet-host-properties for it and extend it. 



Regards
Friedrich
>From help-gnu-emacs-bounces@gnu.org  Mon Dec 30 03:20:28 2002
Path: 
shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!snoopy.risq.qc.ca!newsfeed.news2me.com!newsfeed-west.nntpserver.com!hub1.meganetnews.com!nntpserver.com!telocity-west!DIRECTV!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,comp.lang.perl.modules
Followup-To: comp.lang.perl.modules
Date: 30 Dec 2002 08:20:15 GMT
Organization: earthfriends
Message-ID: <m1hecvx6u0.gnus@usa.net>
References: <m28yy8gt8p.fsf@sbcglobal.net>
User-Agent: Gnus/5.090008 (Oort Gnus v0.08) XEmacs/21.4 (Military
 Intelligence, i686-redhat-linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@supernews.com
Lines: 44
Xref: shelby.stanford.edu gnu.emacs.help:108595 comp.lang.perl.modules:57715
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: Mon, 30 Dec 2002 08:20:28 -0000

[fu-t set]

in gnu.emacs.help i read:

>I'm sneaking in a perl question that is only slightly related to
>emacs.

it'd be a lot better answered in comp.lang.perl.misc or .modules.

>I'd like to have somekind of line editing available during user
>input to a perl script.
>
>By default it seems none is available.  Any attempt to navigate or
>edit an input line produces control chars.  Only backspace works to
>edit.

that's all that is provided by your system's terminal driver.  (probably
there are some other functions too, but nowhere near what emacs provides.)
most likely you want to special case terminal input to use Term::ReadLine.

>I think Term::ReadLine is the tool for this but couldn't figure out
>how to deploy it.

,----[ from ``perldoc Term::ReadLine'' ]
| NAME
|        Term::ReadLine - Perl interface to various "readline"
|        packages. If no real package is found, substitutes stubs
|        instead of basic functions.
| 
| SYNOPSIS
|          use Term::ReadLine;
|          $term = new Term::ReadLine 'Simple Perl calc';
|          $prompt = "Enter your arithmetic expression: ";
|          $OUT = $term->OUT || STDOUT;
|          while ( defined ($_ = $term->readline($prompt)) ) {
|            $res = eval($_), "\n";
|            warn $@ if $@;
|            print $OUT $res, "\n" unless $@;
|            $term->addhistory($_) if /\S/;
|          }
`----

-- 
bringing you boring signatures for 17 years
>From rhuelga@multinterior.com Mon Dec 30 07:34:48 2002
Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13)
        id 18Sz84-00004w-00
        for help-gnu-emacs@gnu.org; Mon, 30 Dec 2002 07:34:48 -0500
Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13)
        id 18Sz7o-00083F-00
        for help-gnu-emacs@gnu.org; Mon, 30 Dec 2002 07:34:34 -0500
Received: from valiant.concentric.net ([207.155.252.9]
        helo=valiant.cnchost.com)
        by monty-python.gnu.org with esmtp (Exim 4.10.13)       id 
18Sz7j-0007xT-00
        for help-gnu-emacs@gnu.org; Mon, 30 Dec 2002 07:34:27 -0500
Received: from multinterior.com (195-57-122-214.uc.nombres.ttd.es
        [195.57.122.214])       by valiant.cnchost.com
        id HAA26644; Mon, 30 Dec 2002 07:34:24 -0500 (EST)
        [ConcentricHost SMTP Relay 1.15]
Errors-To: <rhuelga@multinterior.com>
Date: Mon, 30 Dec 2002 13:32:11 +0100
Mime-Version: 1.0 (Apple Message framework v551)
Content-Type: text/plain; charset=US-ASCII; format=flowed
From: Roberto Huelga <rhuelga@multinterior.com>
To: help-gnu-emacs@gnu.org
Content-Transfer-Encoding: 7bit
Message-Id: <B848CC90-1BF2-11D7-A548-00039368DF30@multinterior.com>
X-Mailer: Apple Mail (2.551)
Subject: Autoinsert
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: Mon, 30 Dec 2002 12:34:49 -0000

        Hello to every body.

        I'm starting with the skeletons and autoinsert. Skeletons and abbrevs 
work fine, but the autoinsert doesn't expand the tag.
        In my .emacs file I have the following lines about autoinsert:

(require 'autoinsert)
(add-hook 'find-file-hook 'auto-insert)
(define-auto-insert "\\.\\(H\\|hh\\|hxx\\|hpp\\)\\'" "cxx-header.hh")

        And the cxx-header.hh file is like this:

#ifndef __%B_%E__
#define __%B_%E__

class %@
{

};

#endif

        And nothing is expanded. Someone can help me? (I don't want to use 
skeletons here)


        A lot of Thanks




reply via email to

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