* Empty buffer
@ 2006-02-04 22:23 BRUCE INGALLS
2006-02-06 19:04 ` Kevin Rodgers
0 siblings, 1 reply; 2+ messages in thread
From: BRUCE INGALLS @ 2006-02-04 22:23 UTC (permalink / raw)
<aside>
After some critiques of the internationalization of the EMacro site, I
put it back into English. On the home page, only, there is an i18n tab
to google-translate it to your native language. Let me know if such is
useful.
I noticed that it is not possible to have XHTML 1.1 compliant PHP, as
PHP chokes on
<?xml
tags. Feel free, to steer me to the proper resource for such.
</aside>
<Emacs>
What I am trying to do, is grab the first IP address, which is not a
netmask, nor 127.0.0.1.
Here is my first attempt:
(require 'net-utils)
(save-excursion
(ipconfig)
(set-buffer "*Ipconfig*")
(goto-char (point-min))
(search-forward-regexp "[0-9]" nil t)
(match-beginning 1)))
Unfortunately, I cannot capture the output of ipconfig():
(save-excursion
(ipconfig)
(set-buffer "*Ipconfig*")
(buffer-string)))
Thanks for any help!
</Emacs>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Empty buffer
2006-02-04 22:23 Empty buffer BRUCE INGALLS
@ 2006-02-06 19:04 ` Kevin Rodgers
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2006-02-06 19:04 UTC (permalink / raw)
BRUCE INGALLS wrote:
> What I am trying to do, is grab the first IP address, which is not a
> netmask, nor 127.0.0.1.
> Here is my first attempt:
>
> (require 'net-utils)
> (save-excursion
> (ipconfig)
> (set-buffer "*Ipconfig*")
> (goto-char (point-min))
> (search-forward-regexp "[0-9]" nil t)
> (match-beginning 1)))
>
> Unfortunately, I cannot capture the output of ipconfig():
>
> (save-excursion
> (ipconfig)
> (set-buffer "*Ipconfig*")
> (buffer-string)))
That's because ipconfig uses start-process (via net-utils-run-program)
to run netstat-program as a subprocess, and its complete output is not
immediately available. But since net-utils-run-program returns the
buffer:
(save-excursion
(let* ((ipconfig-buffer (ipconfig))
(ipconfig-process (get-buffer-process ipconfig-buffer)))
(while (eq (process-status ipconfig-process) 'run)
(sit-for 0 10 t))
(set-buffer ipconfig-buffer)
(buffer-string)))
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-02-06 19:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-04 22:23 Empty buffer BRUCE INGALLS
2006-02-06 19:04 ` Kevin Rodgers
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).