From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 13831@debbugs.gnu.org
Subject: bug#13831: 24.3.50; [PATCH] net-utils-mode have no revert-buffer function
Date: Thu, 28 Feb 2013 07:18:17 +0100 [thread overview]
Message-ID: <877gltm05y.fsf@gmail.com> (raw)
In-Reply-To: <jwvvc9dkqk0.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 27 Feb 2013 23:51:54 -0500")
Hi Stefan,
Stefan Monnier <monnier@iro.umontreal.ca> 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
next prev parent reply other threads:[~2013-02-28 6:18 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-27 9:30 bug#13831: 24.3.50; [PATCH] net-utils-mode have no revert-buffer function Thierry Volpiatto
2013-02-27 9:48 ` Thierry Volpiatto
2013-02-27 10:11 ` Andreas Schwab
2013-02-27 10:50 ` Thierry Volpiatto
2013-02-27 11:57 ` Andreas Schwab
2013-02-27 12:03 ` Thierry Volpiatto
2013-02-27 14:08 ` Stefan Monnier
2013-02-27 14:35 ` Thierry Volpiatto
2013-02-27 15:25 ` Stefan Monnier
2013-02-27 16:36 ` Thierry Volpiatto
2013-02-28 4:51 ` Stefan Monnier
2013-02-28 6:18 ` Thierry Volpiatto [this message]
2013-02-28 14:04 ` Stefan Monnier
2013-02-28 19:45 ` Thierry Volpiatto
2013-03-01 3:05 ` Stefan Monnier
2013-03-01 7:02 ` Thierry Volpiatto
2013-03-01 14:29 ` Stefan Monnier
2013-03-01 15:22 ` Thierry Volpiatto
2013-03-01 17:28 ` Stefan Monnier
2013-03-01 19:07 ` Thierry Volpiatto
2013-03-11 18:31 ` Stefan Monnier
2013-03-13 14:43 ` Thierry Volpiatto
2013-03-13 17:52 ` Stefan Monnier
2013-03-13 20:12 ` Thierry Volpiatto
2013-03-03 6:16 ` Thierry Volpiatto
2013-03-01 14:30 ` Thierry Volpiatto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877gltm05y.fsf@gmail.com \
--to=thierry.volpiatto@gmail.com \
--cc=13831@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).