Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ames!ucbcad!ucbvax!decvax!tektronix!uw-beaver!fluke!ssc-vax!cxsea!blm From: blm@cxsea.UUCP Newsgroups: comp.emacs Subject: Re: GNU Emacs - loadst - Modeline garbaged until next update. Message-ID: <1089@cxsea.UUCP> Date: Fri, 20-Feb-87 12:25:32 EST Article-I.D.: cxsea.1089 Posted: Fri Feb 20 12:25:32 1987 Date-Received: Thu, 26-Feb-87 22:48:29 EST References: <415@vsedev.VSE.COM> Reply-To: blm@cxsea.UUCP (Brian Matthews) Organization: Computer X Inc. Lines: 33 Keywords: GNU, Emacs, loadst, modeline In article <415@vsedev.VSE.COM> ron@vsedev.VSE.COM (Ron Flax) writes: |I have a rather strange problem with GNU Emacs' modeline while running |loadst to display time & load information. The problem is this, |the time & load is displayed normally, then I spawn a subshell (isn't |System V wonderful...), when I return... the time portion of the time |& load string has several extra numbers preceding the real time & load |string. Of course this all goes away as soon as Emacs updates the |modeline, but for a minute or so it is grossly incorrect. Sigh. I remember this problem on an old Gosling Emacs running on BSD4.1 four years ago. What happens is that while you're in the subshell, loadst is still spitting out the time and statistics. When you return to Emacs, the first time that sub-process is read from, you get all of the time and load information loadst has been spitting out, which is subsequently displayed in the mode line. Hence, lots of strange numbers before the correct time and load. The fix is relatively easy. I've fixed it in Unipress 2.10, but the same thing should be possible for GNU. Basically, find the [em]lisp file that starts loadst (clock.ml for Unipress users), and remove the code that adds a -n to the end of the loadst command. This will make loadst add a new-line to the end of each time/statistics line. Then, in the function that reads from the sub-process, have it do two things to the string it reads. First, strip the trailing new-line, and second, remove everything up to the (now) last new-line. Display this new string. Only the last output of loadst is displayed, which is what you want. -- Brian L. Matthews "Facts are impotent against ...{mnetor,uw-beaver!ssc-vax}!cxsea!blm loud and frequent assertion." +1 206 251 6811 Computer X Inc. - a division of Motorola New Enterprises