Subject: bug#13831: 24.3.50; [PATCH] net-utils-mode have no revert-buffer function

From: Stefan Monnier <[email-masked]>
Date: Fri, 01 Mar 2013 09:29:23 -0500

> Here your patch modified, I have simplified
> `net-utils-remove-ctrl-m-filter'.

Actually, my patch is already in the trunk.  Could you make the patch
relative to trunk's version?

> +  (save-selected-window
> +    (set-buffer (process-buffer process))
> +    (save-excursion
> +      (let ((inhibit-read-only t)
> +            (filtered-string output-string))
> +        (while (string-match "\r" filtered-string)
> +          (setq filtered-string
> +                (replace-match "" nil nil filtered-string)))
> +        ;; Insert the text, moving the process-marker.
> +        (goto-char (process-mark process))
> +        (insert filtered-string)
> +        (set-marker (process-mark process) (point))))))

This code does not affect the selected-window, so there shouldn't be any
save-selected-window.  Instead it should use with-current-buffer.

BTW, I think the desired behavior is not the same for all net-utils
tools.  E.g. for ping, we'd like point to stay at the end.  So you above
change is good but it should be completed with changes in the relevant
commands to set window-point-insertion-type when necessary.

        Stefan