Subject: Re: bug#43682: 28.0.50; Clean up nnimap server buffers?

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 29 Sep 2020 16:51:39 +0200

Eric Abrahamsen <[email-masked]> writes:

> -            (ignore-errors              ;E.g. "buffer foo has no process".
> -              (nnimap-send-command "NOOP"))))))))
> +	    (condition-case err
> +		(process-send-string "NOOP")
> +	      (error

As Robert notes, you can't do that; it'll mess up the machiner.

> +	       (if (string-search "has no process" (cdr err))
> +		   (let ((buf (current-buffer)))
> +		     (setq nnimap-process-buffers
> +			   (delq buf nnimap-process-buffers))
> +		     (kill-buffer buf))
> +		 (signal (car err) (cdr err)))))))))))

But why look for a string?  You can just check whether the process is
dead or not.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no