From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kalle Olavi Niemitalo Newsgroups: gmane.emacs.help Subject: Re: Help with simple function Date: 09 Jan 2003 21:26:55 +0200 Organization: Oulun Puhelin Oyj - Baana Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87znqayvi8.fsf@Astalo.y2000.kon.iki.fi> References: <4r8i1eev.fsf@bitstream.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1042145010 18812 80.91.224.249 (9 Jan 2003 20:43:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 9 Jan 2003 20:43:30 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18WjWR-0004t5-00 for ; Thu, 09 Jan 2003 21:43:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18Wilq-0001hh-02 for gnu-help-gnu-emacs@m.gmane.org; Thu, 09 Jan 2003 14:55:18 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed1.bredband.com!bredband!uio.no!newsfeed.song.fi!news.suomi.net!Astalo.Niemitalo.local!news Original-Newsgroups: comp.emacs.xemacs,gnu.emacs.help,gnu.emacs.gnus Original-Lines: 43 Original-NNTP-Posting-Host: addr-213-139-163-48.suomi.net Original-X-Trace: plaza.suomi.net 1042140964 19080 213.139.163.48 (9 Jan 2003 19:36:04 GMT) Original-X-Complaints-To: abuse@mail.suomi.net Original-NNTP-Posting-Date: Thu, 9 Jan 2003 19:36:04 +0000 (UTC) X-Accept-Language: fi;q=1.0, en;q=0.9, sv;q=0.5, de;q=0.1 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Original-Xref: shelby.stanford.edu comp.emacs.xemacs:69307 gnu.emacs.help:108783 gnu.emacs.gnus:63043 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:5312 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:5312 Peter Davis writes: > I don't even know how to create the pop-servers variable so it > will accept this list format. If you assign a value to a variable (with setq), you implicitly create it. Variables thus created accept all types of values. Only some built-in variables have type restrictions. Of course, there is plenty of code that assumes that the value of compile-command is a string, for example; but if you choose a name that is not already in use, there is no conflict. > 2) Have emacs/XEmacs prompt for the password the first time this is > used, and store it in there (so I don't have to keep it in my .gnus > file) (defun pd-server-password (server) "Return the password for SERVER. If it is empty, prompt for it and save the value." (let ((password (plist-get server :password))) (when (equal password "") (setq password (read-passwd (format "Password for %s@%s: " (plist-get server :username) (plist-get server :server)))) ;; The docstring of plist-put says you should save the value it ;; returns. However, we know that :password is already a key ;; in the plist, so plist-put will destructively change the value. (plist-put server :password password)) password)) > 3) Call the Perl script once for each server, passing the arguments, > password, etc. (with-output-to-temp-buffer "*popfetch*" (dolist (server pop-servers) (call-process "perl" nil standard-output nil "c:/home/popfetch.pl" (plist-get server :server) (plist-get server :username) (pd-server-password server)))) One should probably display the buffer earlier.