Article View: gnu.emacs.help
Article #189490processes in 18.56
From: Dirk Grunwald
Date: Tue, 29 Jan 1991 23:35
Date: Tue, 29 Jan 1991 23:35
131 lines
5096 bytes
5096 bytes
earlier, I'd posted about a problem with 18.56 sucking down 90% cpu
time on a DECstation w/ultrix 4.1. The machine is configured as
s-bsd4.3.h, m-pmax.h. Emac was compiled with 'cc -O'.
I tracked the problem down to a mail-verify script that I hacked a
while ago. This sends a vrfy message to an SMTP process to verify mail
addresses. This worked before I upgraded to Emacs 18.56, but I update
to Ultrix 4.1 from 3.1 at the same time. I see several changes for
processes, but I'm wondering if anything in those changes could have
broken the following (or if it was broken to begin with).
;; Copyright (C) 1989 Free Software Foundation, if they want it
;; This file is part of GNU Emacs.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY. No author or distributor
;; accepts responsibility to anyone for the consequences of using it
;; or for whether it serves any particular purpose or works at all,
;; unless he says so in writing. Refer to the GNU Emacs General Public
;; License for full details.
;; Everyone is granted permission to copy, modify and redistribute
;; GNU Emacs, but only under the conditions described in the
;; GNU Emacs General Public License. A copy of this license is
;; supposed to have been given to you along with GNU Emacs so you
;; can know your rights and responsibilities. It should be in a
;; file named COPYING. Among other things, the copyright notice
;; and this notice must be preserved on all copies.
;;
;; Author Dirk Grunwald (grunwald@cs.uiuc.edu)
;; modified from finger.el, but largely different.
;;
(defvar mail-verify-stream nil)
(defun mail-verify (who)
"Verify mail address for users."
(interactive
(list
;;
;; If in the *mail* buffer, pick the name off the To: line
;;
(let
((target
(cond
((eq major-mode 'mail-mode) "[Tt][Oo]:")
((or
(eq major-mode 'gnus-Article-mode)
(eq major-mode 'vm-mode)) "[Ff][Rr][Oo][Mm] *:")
(t nil)))
(to-name "")
from to)
(if target
(save-excursion
(goto-char (point-min))
(re-search-forward target)
(skip-chars-forward "\C-i ")
(setq from (point))
(re-search-forward ",\\| \\|$\\|(")
(if (and
(> (point) from)
(looking-at "[ \t]"))
(backward-char 1))
(setq to (point))
(setq to-name (buffer-substring from to))
))
(read-string "Verify mail address for: "
to-name))))
(let
(mail-query-system (default-system-name (system-name)))
(if (null who) (setq who (user-real-login-name)))
(if (string-match "@" who)
(setq default-system-name
(let*
((from (1+ (string-match "@" who)))
(to (string-match " \\|\n" who from)))
(substring who from to))))
(setq mail-query-system
(read-string
"Query which mailer?: " default-system-name ))
(with-output-to-temp-buffer "*verify-mail*"
(let ((stream (open-network-stream
"mail-verify" "*verify-mail*"
mail-query-system
"smtp")))
(setq mail-verify-stream stream)
(set-process-sentinel stream 'mail-verify-process-sentinel)
(set-process-filter stream 'mail-verify-process-filter)
(process-send-string stream (concat "VRFY " who "\n"))
(process-send-string mail-verify-stream "QUIT\n")
(process-send-eof mail-verify-stream)
))))
(defun mail-verify-process-sentinel (process s)
(accept-process-output)
(save-excursion
(set-buffer "*verify-mail*")
(goto-char (point-min))
(replace-string "\C-m" "")))
(defun mail-verify-process-filter (process string)
(let
(( this-buffer (current-buffer)))
(set-buffer "*verify-mail*")
(goto-char (point-max))
(cond
((string-match "^220 " string) t)
((string-match "^221 " string) t)
((string-match "^250 " string)
(progn
(insert (substring string 4))))
((string-match "^550-" string) (insert (substring string 4)))
(t (insert string)))
(goto-char (point-min))
(replace-string "\C-m" "")
;;
;; if verify is visible, move the last line to the bottom of that window
;;
(let ((here (selected-window)))
(let ((webster-window (get-buffer-window "*verify-mail*")))
(if (windowp webster-window)
(progn
(select-window webster-window)
(recenter -1)
(select-window here)))))
(set-buffer this-buffer)))
Technical Details
Message-ID:
<1991Jan29.233532.16168@csn.org>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!csn!news!grunwaldShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103b8b,84ba9bc7818adc7 X-Google-Attributes: gid103b8b,public X-Google-ArrivalTime: 1991-01-29 21:53:28 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!csn!news!grunwald From: grunwald@foobar.colorado.edu (Dirk Grunwald) Newsgroups: gnu.emacs.help Subject: processes in 18.56 Message-ID: <1991Jan29.233532.16168@csn.org> Date: 29 Jan 91 23:35:32 GMT Sender: news@csn.org (news) Reply-To: grunwald@foobar.colorado.edu Distribution: gnu Organization: University of Colorado at Boulder Lines: 131 Nntp-Posting-Host: foobar.colorado.edu