all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* X-windows performance over slow connections.
@ 2007-01-18 23:35 Bill Zaumen
  2007-01-19 10:49 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Bill Zaumen @ 2007-01-18 23:35 UTC (permalink / raw)


This is really more of a feature request than a bug report.
emacs 21.4.1 (i486-pc-lunux-gnu, X toolkit, Xaw3d scroll bars)
and built on 2006-06-17.  I'm running ubuntu 6.06.

When I run ssh -C -X to connect to my home system over an ADSL
connection (unfortunately, in the 'slow' direction), it takes
well over a minute to start emacs.  I suspect this is due to the
menu, toolbar, scrollbars, and other X-windows features it uses.
Compression helps slightly, but is not quite enough.  I tried
to fix the problem by defining an environment variable named
EMACS_NET_PROFILE which, if defined, has the value "slow", "medium"
or "fast" to denote the speed of one's connection.  For slower
connections, it then turns off scroll bars, tool tips, menus, and
the tool bar based on the value of this variable.  Functionally,
this works as one would expect, however over a slow connection, I
can see the tool bar appear and then eventually go away: it seems
that the tool bar is created before my .emacs file is read, so
emacs takes about as long as before to get started.

It would be useful if one could use the environment variable I
defined or some other mechanism to suppress these features for
low bandwidth connections so that emacs starts faster.
You can set up SSH to pass particular environment variables so you 
could type something like

	EMACS_NET_PROFILE=slow ssh -C -X foo.net

and then just start emacs on foo.net, so that the normal keyboard
mappings work (e..g, the use of the ALT key as a META key on PC
keyboards).  This avoids the need to use special command-line options
(e.g., when emacs is started from a script).

I've enclosed the LISP code below - it is adequate for functional
testing but does not seem to be called early enough.

---------------------------------------------------

;;; When run remotely (e.g., via ssh -X) on a slow link such as
;;; a home ADSL link accessing the home machine from the Internet,
;;; emacs takes a long time to start up - over a minute.  The
;;; slow starting time is due primarily to X windows.  The
;;; function adapt-to-network-speed attempts to turn off emacs
;;; facilities that are nice to have but expensive to run on
;;; very slow network connections. It uses an environment
;;; variable EMACS_NET_PROFILE to determine the type of connection.
;;;
;;; There is no attempt to adapt to current network conditions,
;;; but rather a classification as to the type of network
;;; connection is made on the basis of the best-case or typical-case
;;; performance one can get, and as a result a statically determined
;;; value can be used.  These values are
;;;
;;;   "slow" - typical of dialup or ADSL in the 'slow' direction.
;;;   "medium" - perhaps 300 Kbits/sec in either direction.
;;;   "fast" - one Megabit per second or higher.
;;;
;;; It is possible to configure SSH to pass environment variables
;;; and this can defined in a configuration file.  The server will,
;;; however, have to be configured to accept the variables one wants
;;; to use.  See the manual pages for ssh_config and sshd_config.

(defun adapt-to-network-speed ()
  "Reads the environment variable EMACS_NET_PROFILE, whose values
are 'slow', 'medium', and 'fast', and configures emacs appropriately.
Intended to be called when emacs starts up with the environment variable
set on the basis of the type of network connection."

  (let ((speed (getenv "EMACS_NET_PROFILE")))
    (if speed
	(cond ((equal speed "slow")
	       (scroll-bar-mode -1)
	       (tool-bar-mode 0)
	       (tooltip-mode 0)
	       (menu-bar-mode 0))
	      ((equal speed "medium")
	       (tool-bar-mode 0))
	      ((equal speed "fast") t)
	      (t
	       (print 
		"Illegal value for environment variable EMACS_NET_PROFILE"
		t))))))

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-01-27 18:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-18 23:35 X-windows performance over slow connections Bill Zaumen
2007-01-19 10:49 ` Eli Zaretskii
2007-01-20  6:17   ` Kevin Rodgers
2007-01-20 14:06     ` Eli Zaretskii
2007-01-22  6:53       ` Kevin Rodgers
2007-01-27 18:13         ` Eli Zaretskii
2007-01-20 18:07     ` Richard Stallman
     [not found]   ` <mailman.3337.1169273850.2155.bug-gnu-emacs@gnu.org>
2007-01-20 22:53     ` Tom Horsley
2007-01-21  6:06   ` Bill Zaumen
2007-01-21 10:12     ` Andreas Schwab

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.