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


View this message in rfc822 format

From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 13831 <at> debbugs.gnu.org
Subject: bug#13831: 24.3.50; [PATCH] net-utils-mode have no revert-buffer function
Date: Fri, 01 Mar 2013 16:22:20 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> 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?

Ok, this allow reverting from somewhere else (e.g ibuffer, helm):


diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el
index cc28bab..5e27c0e 100644
--- a/lisp/net/net-utils.el
+++ b/lisp/net/net-utils.el
@@ -358,7 +358,7 @@ This variable is only used if the variable
 ;; Todo: This data could be saved in a bookmark.
 (defvar net-utils--revert-cmd nil)
 
-(defun net-utils-run-simple (buffer program-name args)
+(defun net-utils-run-simple (buffer program-name args &optional nodisplay)
   "Run a network utility for diagnostic output only."
   (with-current-buffer (if (stringp buffer) (get-buffer-create buffer) buffer)
     (let ((proc (get-buffer-process (current-buffer))))
@@ -369,13 +369,14 @@ This variable is only used if the variable
       (erase-buffer))
     (net-utils-mode)
     (setq-local net-utils--revert-cmd
-                `(net-utils-run-simple ,(current-buffer) ,program-name ,args))
+                `(net-utils-run-simple ,(current-buffer)
+                                       ,program-name ,args 'nodisplay))
     (set-process-filter
          (apply 'start-process program-name
                 (current-buffer) program-name args)
          'net-utils-remove-ctrl-m-filter)
     (goto-char (point-min))
-    (display-buffer (current-buffer))))
+    (unless nodisplay (display-buffer (current-buffer)))))
 
 (defun net-utils--revert-function (&optional ignore-auto noconfirm)
   (message "Reverting `%s'..." (buffer-name))

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




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.