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

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

Re: Help with simple function


From: Kalle Olavi Niemitalo
Subject: Re: Help with simple function
Date: 10 Jan 2003 00:44:35 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Peter Davis <pd@world.std.com> writes:

> Wow!  Thanks *very* much.  Can I use your name/contact info in the
> .gnus sources?

Name and email address, sure; but the rest I'm trying to keep out
of databases.

> I thought I had to do defvar or something like that.

It's good practice, but not required.  With defvar, you can
attach a documentation string to the variable.  It also makes
Emacs remember which file defined the variable, so that you can
easily browse it if you just remember the name of the variable,
and M-x unload-feature can undefine the variable.  Finally, the
byte compiler warns if you use undefined variables; but this only
matters if you compile your ~/.gnus, and you can disable those
warnings (see byte-compile-warnings) if you want.

> The Perl script lists some info on each message as its processed, so
> it would be nice to see the output in a buffer as it's being
> generated.  That's really just a frill, though.

This might work:

  (let ((output (get-buffer-create "*popfetch*")))
    (with-current-buffer output
      (erase-buffer))
    (display-buffer output)
    (dolist (server pd-pop-servers)
      (call-process "perl" nil output t
                    "c:/home/popfetch.pl"
                    (plist-get server :server)
                    (plist-get server :username)
                    (pd-server-password server))))

Actually, if you store server names as symbols (:server
mail.mywork.com ...) like you originally wrote, this loop will
have to convert them to strings with symbol-name.


reply via email to

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