comparison lib-src/emacsclient.c @ 83403:51eb0aa362f3

Store client's environment in terminal parameters, not server parameters. * lisp/loadup.el: Don't load server. * lisp/ldefs-boot.el: Update. * lib-src/emacsclient.c (main): Send environment only when a new display is created. * lisp/server.el (server-save-buffers-kill-display): Add autoload cookie. Move stuff not specific to server into `save-buffers-kill-display'. * lisp/files.el (save-buffers-kill-display): New function. (ctl-x-map): Bind it to C-x C-c. * lisp/frame.el (terminal-getenv): New function. * lisp/international/mule-cmds.el (set-locale-environment): Use it. * lisp/frame.el (with-terminal-environment): New macro. * lisp/server.el (server-getenv, server-with-client-environment): Remove. (server-getenv-from, server-with-environment): New functions. (server-process-filter): Change syntax of environment variables. Put environment into terminal parameters, not client parameters. * lisp/term/rxvt.el: Don't require server. (rxvt-set-background-mode): Use terminal-getenv, not server-getenv. * lisp/term/x-win.el (x-initialize-window-system): Ditto. * lisp/term/xterm.el (terminal-init-xterm): Ditto. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-443
author Karoly Lorentey <lorentey@elte.hu>
date Sat, 19 Nov 2005 19:17:56 +0000
parents f4766b398a30
children b98066f4aa10
comparison
equal deleted inserted replaced
83402:606eab743857 83403:51eb0aa362f3
693 693
694 /* First of all, send our version number for verification. */ 694 /* First of all, send our version number for verification. */
695 fprintf (out, "-version %s ", VERSION); 695 fprintf (out, "-version %s ", VERSION);
696 696
697 /* Send over our environment. */ 697 /* Send over our environment. */
698 { 698 if (!current_frame)
699 extern char **environ; 699 {
700 int i; 700 extern char **environ;
701 for (i = 0; environ[i]; i++) 701 int i;
702 { 702 for (i = 0; environ[i]; i++)
703 char *name = xstrdup (environ[i]); 703 {
704 char *value = strchr (name, '='); 704 char *name = xstrdup (environ[i]);
705 if (value && strlen (value) > 1) 705 char *value = strchr (name, '=');
706 { 706 fprintf (out, "-env ");
707 *value++ = 0; 707 quote_argument (environ[i], out);
708 fprintf (out, "-env "); 708 fprintf (out, " ");
709 quote_argument (name, out); 709 }
710 fprintf (out, " "); 710 }
711 quote_argument (value, out);
712 fprintf (out, " ");
713 fflush (out);
714 }
715 free (name);
716 }
717 }
718 711
719 retry: 712 retry:
720 if (nowait) 713 if (nowait)
721 fprintf (out, "-nowait "); 714 fprintf (out, "-nowait ");
722 715