🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #98335

Re: changeable baud_rate (SOURCE)

#98335
From: Johan Vromans
Date: Thu, 15 Aug 1991 20:46
55 lines
2282 bytes
In article <JBW.91Aug10220158@maverick.uswest.com> jbw@maverick.USwest.COM (Joe Wells) writes:

   In reference to the quoted article, it should be possible to set Emacs's
   idea of the bps rate of the communication link to the user.  This is
   especially important, as pointed out below, when the connection goes
   through multiple links with different bps rates.  It would be enough to
   make baud_rate in dispnew.c a forwarded int Lisp variable.

This little goodie I coocked up a long time ago (18.55). Won't be hard
to adapt for 18.57.

Add this to dispnew.c:

    DEFUN ("fake-baud-rate", Ffake_baud_rate, Sfake_baud_rate, 1, 1, 0,
      "Let Emacs think this is the speed of the terminal.")
      (n)
	 Lisp_Object n;
    {
      int i, rate;
      extern short ospeed;
      static int baud_convert[] =
    #ifdef BAUD_CONVERT
	BAUD_CONVERT;
    #else
	{
	  0, 50, 75, 110, 135, 150, 200, 300, 600, 1200,
	  1800, 2400, 4800, 9600, 19200, 38400
	};
    #endif


      CHECK_NUMBER (n, 0);
      rate = XINT(n);
      if (rate >= 300 && rate <= 19200) {
	baud_rate = rate;
	for (i=0; baud_convert[i] < rate; i++);
	ospeed = i;
	calculate_costs ();
	return Qt;
      }
      return Qnil;
    }

Of course, you also have to add this to routine syms_of_display:

    defsubr (&Sfake_baud_rate);

Happy hacking!

	Johan
-- 
Johan Vromans				       jv@mh.nl via internet backbones
Multihouse Automatisering bv		       uucp: ..!{uunet,hp4nl}!mh.nl!jv
Doesburgweg 7, 2803 PL Gouda, The Netherlands  phone/fax: +31 1820 62911/62500
------------------------ "Arms are made for hugging" -------------------------
Technical Details
Message-ID: <1991Aug15.204626.2198@pronto.mh.nl>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!mh.NL!jv
References: jv@mh.NL (Johan Vromans)

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,709083a9d5fb135c,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1991-08-15 13:46:26 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!mh.NL!jv
From: jv@mh.NL (Johan Vromans)
Newsgroups: gnu.emacs.bug
Subject: Re: changeable baud_rate (SOURCE)
Message-ID: <1991Aug15.204626.2198@pronto.mh.nl>
Date: 15 Aug 91 20:46:26 GMT
References: jv@mh.NL (Johan Vromans)
Sender: jv@mh.nl (Johan Vromans)
Distribution: gnu
Organization: Multihouse Automation, the Netherlands
Lines: 55
Approved: bug-gnu-emacs@prep.ai.mit.edu