[9084] in Athena Bugs
emacs 18.57 process code
daemon@ATHENA.MIT.EDU (kkkken@Athena.MIT.EDU)
Thu Mar 12 23:18:27 1992
From: kkkken@Athena.MIT.EDU
Date: Thu, 12 Mar 92 23:18:12 -0500
To: bugs@Athena.MIT.EDU
Guess what --- another emacs process bug.
In xemacs only (I think), m-x ftp-find-file *often* loses, saying
"login failed", but displaying a buffer of a successful login. I
tracked it down to our favorite function, (accept-process-output).
This function will sometimes change the notion of the current buffer
(i.e., what (current-buffer) returns and what (set-buffer) sets). It
confuses ftp.el's login procedure by switching the current buffer from
its ftp process buffer to whatever the visible buffer is --- lose!
Anyway, this code will work around it... I recommend it for the
serious elisp hacker's .emacs file:
;; Fix a totally gross bug in accept-process-output that causes it to
;; lose the notion of current buffer! (Seems to be a problem in
;; xemacs only.)
(fset 'old-accept-process-output (symbol-function 'accept-process-output))
(defun accept-process-output (proc)
(let ((b (current-buffer)))
(old-accept-process-output proc)
(if (not (eq b (current-buffer)))
(set-buffer b)))) ;;;; Get it straight, man!
If you want, you can make it do something more interesting by changing
the last line to, say, setq some global to record the fact that
accept-process-output (now called "old-accept-process-output"!) lost,
and spew in the minibuffer line. I did this, and it loses early, and
loses often.
Could you forward the bug report to the appropriate place? Or better,
fix it.. or better still, rewrite emacs' process code...
-Ken