From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/6767 Path: main.gmane.org!not-for-mail From: Hallvard B Furuseth Newsgroups: gmane.emacs.gnus.general Subject: Re: Is Username Expansion possible in GNUS? Date: Tue, 18 Jun 1996 18:33:22 +0200 (MET DST) Message-ID: <199606181633.SAA23345@durin.uio.no> References: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035147174 4652 80.91.224.250 (20 Oct 2002 20:52:54 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 20:52:54 +0000 (UTC) Cc: ding@ifi.uio.no Return-Path: ding-request@ifi.uio.no Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by deanna.miranova.com (8.7.5/8.6.9) with SMTP id KAA15256 for ; Tue, 18 Jun 1996 10:03:59 -0700 Original-Received: from goggins.uio.no (6089@goggins.uio.no [129.240.201.2]) by ifi.uio.no with SMTP (8.6.11/ifi2.4) id for ; Tue, 18 Jun 1996 18:33:38 +0200 Original-Received: from ulrik.uio.no by goggins.uio.no with local-SMTP (PP) id <11079-0@goggins.uio.no>; Tue, 18 Jun 1996 18:33:24 +0200 Original-Received: by durin.uio.no ; Tue, 18 Jun 1996 18:33:22 +0200 (MET DST) Original-To: Sudish Joseph In-reply-to: Xref: main.gmane.org gmane.emacs.gnus.general:6767 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:6767 > Not beautiful, but it works. Well, if you want to nice it up a bit... BTW, replaced : with \n to speed up the regexp. (defun getpwnam (name) "Results of getpwnam(name) as a list of 9 strings; nil on failure" (save-excursion (set-buffer (get-buffer-create " *getpwnam*")) (erase-buffer) ; Just in case (prog1 (and (zerop (call-process "perl" nil t nil "-e" (format "print join '\n', getpwnam('%s')" name))) (not (bobp)) (progn (goto-char 1) (progn;save-match-data (and (looking-at "\\(.*\\)\n\\(.*\\)\n\\(.*\\)\n\\(.*\\)\n\\(.*\\)\n\\(.*\\)\n\\(.*\\)\n\\(.*\\)\n\\(.*\\)") (mapcar 'match-string '(1 2 3 4 5 6 7 8 9)))))) (kill-buffer (current-buffer))))) Regards, Hallvard