emacs wrapper add support for MacOSX

 

remove obscure code about multitty that I don't use

File modified: bin/wrapper.py

Change307 at Sun May 23 17:45:23 2010 +0200 by Ivan Kanis <ivan@mac.foo>

diff -r e9d448cdeec5 -r 02353f89da79 bin/wrapper.py
--- a/bin/wrapper.py	Sat May 22 19:57:53 2010 +0200
+++ b/bin/wrapper.py	Sun May 23 17:45:23 2010 +0200
@@ -48,33 +48,16 @@
 
     # Wrapper functions
     def emacs(self):
-        self.emacs_helper()
-
-    def emacs_helper(self):
-        import re
-        lisp = ''
-
-        self.add_argument('--no-site-file')
-        version = emacs_server()
+        # support Mac OSX
+        mac_path = "/Applications/Emacs.app/Contents/MacOS"
+        if os.path.exists(mac_path):
+	    os.chdir(mac_path)
+            self.change_command("./Emacs")
+	self.add_argument('--no-site-file')
         if 'lucia' in self.cmd:
             self.cmd.remove('lucia')
             self.env['ivan_user'] = 'lucia'
 
-        # multi tty
-        if re.compile("multi-tty").search(version):
-            self.change_command('emacsclient')
-            if 'DISPLAY' in os.environ:
-                self.add_argument('--current-frame')
-            else:
-                self.add_argument('--tty')
-                # and terminal size
-                lisp += "(signal-process (emacs-pid) 'WINCH)"
-                # fix multi tty and focus bug
-                lisp += '(top-level)'
-
-        if lisp != '':
-            self.add_argument('--eval')
-            self.add_argument(lisp)
         if "GPG_AGENT_INFO" in self.env:
             del self.env["GPG_AGENT_INFO"]
 
@@ -181,34 +164,6 @@
             self.change_command(self.env['EDITOR'])
 
 # utility functions
-def emacs_server():
-    """Returns version of emacs running or empty string"""
-    import socket
-
-    s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
-    socket_file = "/tmp/emacs" + str(os.getuid()) + "/server"
-    version = ''
-
-    if os.path.exists(socket_file):
-        try:
-            s.connect(socket_file)
-            s.send('-eval (emacs-version) -print\n')
-            version = s.recv(1024)
-            version = emacs_server_decode(version)
-        except:
-            pass
-    return version
-
-def emacs_server_decode(str):
-    import string
-
-    dict = {'&&' : '&',
-            '&-' : '-',
-            '&_' : ' '}
-
-    for old, new in dict.iteritems():
-        str = string.replace(str, old, new)
-    return str
 
 def french(env):
     """Set environmnent for french UI"""


back