GNU bug report logs - #13831
24.3.50; [PATCH] net-utils-mode have no revert-buffer function

Previous Next

Package: emacs;

Reported by: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>

Date: Wed, 27 Feb 2013 09:33:02 UTC

Severity: wishlist

Tags: patch

Found in version 24.3.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #53 received at 13831 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
Cc: 13831 <at> debbugs.gnu.org
Subject: Re: bug#13831: 24.3.50;
	[PATCH] net-utils-mode have no revert-buffer function
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




This bug report was last modified 12 years and 69 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.