From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#13831: 24.3.50; [PATCH] net-utils-mode have no revert-buffer function Date: Thu, 28 Feb 2013 07:18:17 +0100 Organization: Emacs Helm Message-ID: <877gltm05y.fsf@gmail.com> References: <87liaam7dh.fsf@gmail.com> <87hakym6il.fsf@gmail.com> <87d2vmm3nh.fsf@gmail.com> <871uc1ese2.fsf@gmail.com> <87k3ptbtoj.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1362032353 3540 80.91.229.3 (28 Feb 2013 06:19:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Feb 2013 06:19:13 +0000 (UTC) Cc: 13831@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 28 07:19:35 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UAwq6-0007gA-DP for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Feb 2013 07:19:34 +0100 Original-Received: from localhost ([::1]:50274 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAwpl-0000z0-AB for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Feb 2013 01:19:13 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAwpg-0000y2-Qa for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2013 01:19:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAwpf-0007uG-Li for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2013 01:19:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAwpf-0007uC-He for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2013 01:19:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UAwrV-0003WH-QX for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2013 01:21:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Feb 2013 06:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13831 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 13831-submit@debbugs.gnu.org id=B13831.136203242413481 (code B ref 13831); Thu, 28 Feb 2013 06:21:01 +0000 Original-Received: (at 13831) by debbugs.gnu.org; 28 Feb 2013 06:20:24 +0000 Original-Received: from localhost ([127.0.0.1]:54833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAwqu-0003VO-Dz for submit@debbugs.gnu.org; Thu, 28 Feb 2013 01:20:24 -0500 Original-Received: from mail-wi0-f175.google.com ([209.85.212.175]:40623) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAwqs-0003VH-LL for 13831@debbugs.gnu.org; Thu, 28 Feb 2013 01:20:23 -0500 Original-Received: by mail-wi0-f175.google.com with SMTP id l13so7263647wie.2 for <13831@debbugs.gnu.org>; Wed, 27 Feb 2013 22:18:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=7sVHHkOUpTmBBx8Vo/ld38f52/iZC+79dpeWi5A/RzI=; b=LqdnC5nGcQgm/zf+CfDEb0/E+OoPl/FcYwpkHogbLefDb8IfZaPH3LhxWSI4CYq6h3 XvYPHzXKv/XEynh4wpp9xIfn3lSiLSIIbMnbu0u5Ar92/4WeyWMURxTAc2xo/VGJ+Ynu b4UmN+Ka45CXkrCxkMjCl1+0+AAZAoMe/Iv8w3hfyf3aOgyP1GTMzk54LuU2iHOzqxhH NOS1oQhwtsquGfGf/2TCQWSxk1Cl6RuH0MpX/SqH/gycJmudhg1bDGIgrlU3v08Y4tnC B5jkx806ZsIAnBur3+08mfPbMbwh0TQHap6b7hQOW+nMnQCH14FhxQLeNvNHQzXARs9V r5gQ== X-Received: by 10.194.170.165 with SMTP id an5mr8508486wjc.41.1362032307411; Wed, 27 Feb 2013 22:18:27 -0800 (PST) Original-Received: from dell-14z (lbe83-2-78-243-104-167.fbx.proxad.net. [78.243.104.167]) by mx.google.com with ESMTPS id bj9sm31238937wib.4.2013.02.27.22.18.25 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 27 Feb 2013 22:18:26 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Wed, 27 Feb 2013 23:51:54 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:71938 Archived-At: Hi Stefan, Stefan Monnier writes: > Setting the process-filter to t seems odd, so I changed it to nil. > Also I renamed the new functions and vars to use a "net-utils--" prefix. > And I got rid of net-utils-mode-process. Finally, I removed the `g' > binding, since it's already provided by `special-mode-map'. > > Oh, and now I see that the revert function uses a different code > (e.g. different process filter) than the original code. That's weird. > Why not call net-utils-run-simple from the revert function? Oh, right > because net-utils-run-simple kills its buffer first. > OK, can you test the patch below which changes net-utils-run-simple such > that it doesn't kill the buffer, thus making the revert function > much simpler? It doesn't work: --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (wrong-type-argument stringp nil) start-process(nil "*netstat*" nil) apply(start-process nil "*netstat*" nil nil) (setq net-utils-mode-process (apply (quote start-process) net-utils-program-name (buffer-name) net-utils-program-name net-utils-program-args)) (let ((inhibit-read-only t)) (erase-buffer) (setq net-utils-mode-process (apply (quote start-process) net-utils-program-name (buffer-name) net-utils-program-name net-utils-program-args)) (set-process-filter net-utils-mode-process (function (lambda (process output-string) (let ((filtered-string output-string)) (set-buffer (process-buffer process)) (let ((inhibit-read-only t)) (while (string-match "" filtered-string) (setq filtered-string ...)) (save-excursion (goto-char ...) (insert filtered-string) (set-marker ... ...))))))) (set-process-sentinel net-utils-mode-process (function (lambda (process event) (if (string= event "finished\n") (progn (message "Reverting `%s' done" (process-buffer process)))))))) net-utils-revert-function(t nil) revert-buffer(t) call-interactively(revert-buffer nil nil) command-execute(revert-buffer) --8<---------------cut here---------------end--------------->8--- I will modify your patch to make it working as soon as possible (not today). You can install my patch which is working, and we make changes in one or two days with your patch modified.(Or just wait) > Feel free do those conversions (tho I see that there's a difference in > that using net-utils-run-simple means that no header gets inserted; this > difference between net-utils-run-simple and net-utils-run-simple should > probably be eliminated by always inserting a standard header built from > program-name and args). Yes the header is not important (for traceroute unneeded). Thanks. -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997