PageRenderTime 43ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/editor/Process.cs

http://github.com/toshok/shelisp
C# | 72 lines | 52 code | 17 blank | 3 comment | 0 complexity | 0d9f002f4d61f55e15c92e916ec5c575 MD5 | raw file
Possible License(s): GPL-3.0
  1. using System;
  2. using System.Diagnostics;
  3. using System.IO;
  4. using Shelisp;
  5. namespace Shemacs.Editor {
  6. public class Process {
  7. public Process ()
  8. {
  9. // set up the initial environment here
  10. foreach (string varname in System.Environment.GetEnvironmentVariables().Keys) {
  11. var varvalue = System.Environment.GetEnvironmentVariable(varname);
  12. Vinitial_environment = new List (new Shelisp.String(varname + "=" + varvalue), Vinitial_environment);
  13. }
  14. // XXX sad sad copy - reverse twice.
  15. // fix this when Fcopy_sequence is added, and we start passing the L to ctors
  16. Vprocess_environment = List.reverse (List.reverse (Vinitial_environment));
  17. }
  18. [LispBuiltin]
  19. public Shelisp.Object Vprocess_environment = L.Qnil;
  20. [LispBuiltin]
  21. public Shelisp.Object Vinitial_environment = L.Qnil;
  22. [LispBuiltin]
  23. public static Shelisp.Object getenv_internal (L l, Shelisp.Object envvar, [LispOptional] Shelisp.Object env)
  24. {
  25. Console.WriteLine ("getenv_internal {0}", envvar);
  26. return L.Qnil;
  27. }
  28. [LispBuiltin (DocString = @"*File name to load inferior shells from.
  29. Initialized from the SHELL environment variable, or to a system-dependent
  30. default if SHELL is not set.")]
  31. public Shelisp.Object Vshell_file_name = (Shelisp.String)Environment.GetEnvironmentVariable ("SHELL");
  32. [LispBuiltin]
  33. public Shelisp.Object Vexec_path = (Shelisp.String)(Environment.GetEnvironmentVariable ("EMACSPATH") ?? "/usr/local/libexec/emacs/24.0.94/x86_64-apple-darwin11.3.0");
  34. [LispBuiltin]
  35. public Shelisp.Object Fuser_full_name (L l)
  36. {
  37. return (Shelisp.String)"Chris Toshok"; // XXX
  38. }
  39. [LispBuiltin]
  40. public static Shelisp.Object Fget_buffer_process (L l, Shelisp.Object buffer)
  41. {
  42. return L.Qnil;
  43. }
  44. [LispBuiltin (DocString = "The host name of the machine Emacs is running on.")]
  45. public Shelisp.Object Vsystem_name = (Shelisp.String)"localhost"; // XXX
  46. [LispBuiltin (DocString = "The full name of the user logged in.")]
  47. public Shelisp.Object Vuser_full_name = (Shelisp.String)"Chris Toshok"; // XXX
  48. [LispBuiltin (DocString = "The user's name, taken from environment variables if possible.")]
  49. public Shelisp.Object Vuser_login_name = (Shelisp.String)"toshok"; // XXX
  50. [LispBuiltin (DocString = "The user's name, based upon the real uid only.")]
  51. public Shelisp.Object Vuser_real_login_name = (Shelisp.String)"toshok"; // XXX
  52. [LispBuiltin (DocString = "The release of the operating system Emacs is running on.")]
  53. public Shelisp.Object Voperating_system_release = (Shelisp.String)"10.7.3"; // XXX
  54. }
  55. }