unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Roland Winkler <roland.winkler@physik.uni-erlangen.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: proced.el [was: docstrings in dired.el]
Date: Sun, 25 May 2008 01:24:08 +0200	[thread overview]
Message-ID: <18488.41880.834837.593228@tfkp07.physik.uni-erlangen.de> (raw)
In-Reply-To: <uy75zfzq1.fsf@gnu.org>

> > > Well, maybe at least consider refactoring the current Lisp code so
> > > that the code which relies on `ps' is limited to a few functions with
> > > well-defined interfaces.  Then someone else could reimplement them in
> > > a portable fashion.
> > 
> > That's what I try anyway.
> 
> That's good to hear.  I hope, as part of that, you are planning on
> refactoring the usage of proced-command-alist and
> proced-sorting-schemes-alist to hide the dependency on `ps's options
> behind some more general API.

Well, on my GNU/linux system I have procps that supports sorting. As
far as I have been able to find out about ps for other system types,
they do not support any sorting. This is a bit nasty, because
sorting the cooked values in the output of ps can give different
results than sorting the raw data. Also, the START field gives me
some trouble. For systems like SunOS (then called STIME), it can
have values like "May 20" (note the space) and "17:55:11". Working
around such things for sorting and filtering will be ugly.
(I consider the START field as one of those proced should support
for sorting and filtering.)

> > I tend to think it is better to leave this unportable code in Lisp
> > than to move it to C, because I think the amount of unportable
> > code in C would be much much more.
> 
> Now I have a challenge in hand to prove that you are wrong.

If it gives a unified elisp interface, that would be nice...

> Obviously I can't decide what you work on, but let's not forget
> that we lived happily without proced at all (not even some simpler
> replacement), so I think there are more important things on which
> to work.

...Yet I agree with Stefan that a very fancy piece of code is
probably not worth the effort. 

I looked into the code of procps and found it very intransparent. On
the other hand, it seemed to me that the major complications in
procps concern the many different variants and dialects for the
options it can digest and the output it generates. Procps tries to
be a replacement for all the different versions and behaviors. Yet
the part of the code that collects the process information from the
system apparently does not contain, e.g., system-dependent
preprocessor flags. (Maybe I looked into the wrong part of the code,
but I didn't find them.) So maybe it is possible to have a not too
complicated emacs primitive that collects and returns the
information on system process (maybe with only one switch to
distinguish between user processes and all processes). Then the
cooking (sorting, filtering, etc.) could be done probably with less
effort in elisp.

Roland




  reply	other threads:[~2008-05-24 23:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-23  4:43 docstrings in dired.el Roland Winkler
2008-05-23  6:34 ` Michael Olson
2008-05-23  6:41 ` David Kastrup
2008-05-23  9:12 ` Eli Zaretskii
2008-05-23 10:11   ` proced.el [was: docstrings in dired.el] Roland Winkler
2008-05-23 11:19     ` Eli Zaretskii
2008-05-24  0:51       ` Roland Winkler
2008-05-24 16:12         ` Eli Zaretskii
2008-05-24 23:24           ` Roland Winkler [this message]
2008-05-25  3:09             ` Eli Zaretskii
2008-05-24 14:13       ` Richard M Stallman
2008-05-24 15:27         ` Eli Zaretskii
2008-05-24 18:57           ` proced.el Stefan Monnier
2008-05-24 19:26             ` proced.el Eli Zaretskii
2008-05-24 19:34               ` proced.el Stefan Monnier
2008-05-24  3:39   ` docstrings in dired.el Richard M Stallman
2008-05-24  7:20     ` Eli Zaretskii

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=18488.41880.834837.593228@tfkp07.physik.uni-erlangen.de \
    --to=roland.winkler@physik.uni-erlangen.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).