1Index: Makefile.in 2=================================================================== 3RCS file: /cvsroot/emacs/emacs/Makefile.in,v 4retrieving revision 1.321 5diff -u -b -r1.321 Makefile.in 6--- Makefile.in 3 Feb 2007 21:49:10 -0000 1.321 7+++ Makefile.in 2 Jun 2007 16:22:06 -0000 8@@ -384,8 +384,12 @@ 9 exec_prefix=${exec_prefix} bindir=${bindir} \ 10 libexecdir=${libexecdir} archlibdir=${archlibdir} \ 11 INSTALL_STRIP=${INSTALL_STRIP}) 12- ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} $(DESTDIR)${bindir}/$(EMACSFULL) 13- -chmod 1755 $(DESTDIR)${bindir}/$(EMACSFULL) 14+ if [ -f src/emacs-undumped ]; then \ 15+ ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs-undumped $(DESTDIR)${bindir}/; \ 16+ else \ 17+ ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} $(DESTDIR)${bindir}/$(EMACSFULL); \ 18+ chmod 1755 $(DESTDIR)${bindir}/$(EMACSFULL); \ 19+ fi 20 rm -f $(DESTDIR)${bindir}/$(EMACS) 21 -ln $(DESTDIR)${bindir}/$(EMACSFULL) $(DESTDIR)${bindir}/$(EMACS) 22 -unset CDPATH; \ 23Index: configure 24=================================================================== 25RCS file: /cvsroot/emacs/emacs/configure,v 26retrieving revision 1.202.2.5 27diff -u -b -r1.202.2.5 configure 28--- configure 20 May 2007 18:05:49 -0000 1.202.2.5 29+++ configure 2 Jun 2007 16:22:06 -0000 30@@ -2354,15 +2354,16 @@ 31 ## Apple Darwin / Mac OS X 32 *-apple-darwin* ) 33 case "${canonical}" in 34- i[3456]86-* ) machine=intel386 ;; 35- powerpc-* ) machine=powermac ;; 36+ i[3456]86-* ) machine=mac ;; 37+ powerpc-* ) machine=mac ;; 38+ mac-apple-darwin* ) machine=mac;; 39 * ) unported=yes ;; 40 esac 41 opsys=darwin 42 # Define CPP as follows to make autoconf work correctly. 43 CPP="${CC-cc} -E -no-cpp-precomp" 44 # Use fink packages if available. 45- if test -d /sw/include && test -d /sw/lib; then 46+ if false && test -d /sw/include && test -d /sw/lib; then 47 GCC_TEST_OPTIONS="-I/sw/include -L/sw/lib" 48 CPP="${CPP} ${GCC_TEST_OPTIONS}" 49 NON_GCC_TEST_OPTIONS=${GCC_TEST_OPTIONS} 50@@ -3103,6 +3104,7 @@ 51 case "${canonical}" in 52 *-cygwin ) opsys=cygwin ;; 53 *-darwin* ) opsys=darwin 54+ machine=mac #For univeral building 55 CPP="${CC-cc} -E -no-cpp-precomp" 56 ;; 57 *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;; 58Index: etc/emacs.py 59=================================================================== 60RCS file: /cvsroot/emacs/emacs/etc/emacs.py,v 61retrieving revision 1.12.2.2 62diff -u -b -r1.12.2.2 emacs.py 63--- etc/emacs.py 28 Apr 2007 19:59:28 -0000 1.12.2.2 64+++ etc/emacs.py 2 Jun 2007 16:22:06 -0000 65@@ -1,7 +1,7 @@ 66 """Definitions used by commands sent to inferior Python in python.el.""" 67 68-# Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. 69-# Author: Dave Love <fx@gnu.org> 70+# Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. 71+# Author: Dave Love <d.love@dl.ac.uk> 72 73 # This file is part of GNU Emacs. 74 75@@ -20,195 +20,86 @@ 76 # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 77 # Boston, MA 02110-1301, USA. 78 79-import os, sys, traceback, inspect, __main__ 80-from sets import Set 81+import os, sys, traceback, inspect, rlcompleter, __main__ 82 83-__all__ = ["eexecfile", "eargs", "complete", "ehelp", "eimport", "modpath"] 84- 85-def format_exception (filename, should_remove_self): 86- type, value, tb = sys.exc_info () 87- sys.last_type = type 88- sys.last_value = value 89- sys.last_traceback = tb 90- if type is SyntaxError: 91- try: # parse the error message 92- msg, (dummy_filename, lineno, offset, line) = value 93- except: 94- pass # Not the format we expect; leave it alone 95- else: 96- # Stuff in the right filename 97- value = SyntaxError(msg, (filename, lineno, offset, line)) 98- sys.last_value = value 99- res = traceback.format_exception_only (type, value) 100- # There are some compilation errors which do not provide traceback so we 101- # should not massage it. 102- if should_remove_self: 103- tblist = traceback.extract_tb (tb) 104- del tblist[:1] 105- res = traceback.format_list (tblist) 106- if res: 107- res.insert(0, "Traceback (most recent call last):\n") 108- res[len(res):] = traceback.format_exception_only (type, value) 109- # traceback.print_exception(type, value, tb) 110- for line in res: print line, 111+__all__ = ["eexecfile", "args", "complete", "ehelp", "eimport"] 112 113 def eexecfile (file): 114 """Execute FILE and then remove it. 115- Execute the file within the __main__ namespace. 116 If we get an exception, print a traceback with the top frame 117- (ourselves) excluded.""" 118- # We cannot use real execfile since it has a bug where the file stays 119- # locked forever (under w32) if SyntaxError occurs. 120- # --- code based on code.py and PyShell.py. 121- try: 122- try: 123- source = open (file, "r").read() 124- code = compile (source, file, "exec") 125- # Other exceptions (shouldn't be any...) will (correctly) fall 126- # through to "final". 127- except (OverflowError, SyntaxError, ValueError): 128- # FIXME: When can compile() raise anything else than 129- # SyntaxError ???? 130- format_exception (file, False) 131- return 132+ (oursleves) excluded.""" 133 try: 134- exec code in __main__.__dict__ 135+ try: execfile (file, globals (), globals ()) 136 except: 137- format_exception (file, True) 138+ (type, value, tb) = sys.exc_info () 139+ # Lose the stack frame for this location. 140+ tb = tb.tb_next 141+ if tb is None: # print_exception won't do it 142+ print "Traceback (most recent call last):" 143+ traceback.print_exception (type, value, tb) 144 finally: 145 os.remove (file) 146 147-def eargs (name, imports): 148+def eargs (name): 149 "Get arglist of NAME for Eldoc &c." 150 try: 151- if imports: exec imports 152 parts = name.split ('.') 153 if len (parts) > 1: 154 exec 'import ' + parts[0] # might fail 155 func = eval (name) 156- if inspect.isbuiltin (func) or type(func) is type: 157+ if inspect.isbuiltin (func): 158 doc = func.__doc__ 159 if doc.find (' ->') != -1: 160 print '_emacs_out', doc.split (' ->')[0] 161- else: 162+ elif doc.find ('\n') != -1: 163 print '_emacs_out', doc.split ('\n')[0] 164 return 165 if inspect.ismethod (func): 166 func = func.im_func 167 if not inspect.isfunction (func): 168- print '_emacs_out ' 169 return 170 (args, varargs, varkw, defaults) = inspect.getargspec (func) 171 # No space between name and arglist for consistency with builtins. 172 print '_emacs_out', \ 173 func.__name__ + inspect.formatargspec (args, varargs, varkw, 174 defaults) 175- except: 176- print "_emacs_out " 177- 178-def all_names (object): 179- """Return (an approximation to) a list of all possible attribute 180- names reachable via the attributes of OBJECT, i.e. roughly the 181- leaves of the dictionary tree under it.""" 182- 183- def do_object (object, names): 184- if inspect.ismodule (object): 185- do_module (object, names) 186- elif inspect.isclass (object): 187- do_class (object, names) 188- # Might have an object without its class in scope. 189- elif hasattr (object, '__class__'): 190- names.add ('__class__') 191- do_class (object.__class__, names) 192- # Probably not a good idea to try to enumerate arbitrary 193- # dictionaries... 194- return names 195- 196- def do_module (module, names): 197- if hasattr (module, '__all__'): # limited export list 198- names.union_update (module.__all__) 199- for i in module.__all__: 200- do_object (getattr (module, i), names) 201- else: # use all names 202- names.union_update (dir (module)) 203- for i in dir (module): 204- do_object (getattr (module, i), names) 205- return names 206- 207- def do_class (object, names): 208- ns = dir (object) 209- names.union_update (ns) 210- if hasattr (object, '__bases__'): # superclasses 211- for i in object.__bases__: do_object (i, names) 212- return names 213- 214- return do_object (object, Set ([])) 215+ except: pass 216 217-def complete (name, imports): 218+def complete (text, namespace = None): 219 """Complete TEXT in NAMESPACE and print a Lisp list of completions. 220- Exec IMPORTS first.""" 221- import __main__, keyword 222- 223- def class_members(object): 224- names = dir (object) 225- if hasattr (object, '__bases__'): 226- for super in object.__bases__: 227- names = class_members (super) 228- return names 229- 230- names = Set ([]) 231- base = None 232+ NAMESPACE is currently not used.""" 233+ if namespace is None: namespace = __main__.__dict__ 234+ c = rlcompleter.Completer (namespace) 235 try: 236- dict = __main__.__dict__.copy() 237- if imports: exec imports in dict 238- l = len (name) 239- if not "." in name: 240- for list in [dir (__builtins__), keyword.kwlist, dict.keys()]: 241- for elt in list: 242- if elt[:l] == name: names.add(elt) 243+ if '.' in text: 244+ matches = c.attr_matches (text) 245 else: 246- base = name[:name.rfind ('.')] 247- name = name[name.rfind('.')+1:] 248- try: 249- object = eval (base, dict) 250- names = Set (dir (object)) 251- if hasattr (object, '__class__'): 252- names.add('__class__') 253- names.union_update (class_members (object)) 254- except: names = all_names (dict) 255- except: return [] 256- l = len(name) 257+ matches = c.global_matches (text) 258 print '_emacs_out (', 259- for n in names: 260- if name == n[:l]: 261- if base: print '"%s.%s"' % (base, n), 262- else: print '"%s"' % n, 263+ for elt in matches: 264+ print '"%s"' % elt, 265 print ')' 266+ except: 267+ print '_emacs_out ()' 268 269-def ehelp (name, imports): 270- """Get help on string NAME. 271+def ehelp (name, g, l): 272+ """Get help on string NAME using globals G and locals L. 273 First try to eval name for, e.g. user definitions where we need 274 the object. Otherwise try the string form.""" 275- locls = {} 276- if imports: 277- try: exec imports in locls 278- except: pass 279- try: help (eval (name, globals(), locls)) 280+ try: help (eval (name, g, l)) 281 except: help (name) 282 283 def eimport (mod, dir): 284 """Import module MOD with directory DIR at the head of the search path. 285 NB doesn't load from DIR if MOD shadows a system module.""" 286- from __main__ import __dict__ 287- 288 path0 = sys.path[0] 289 sys.path[0] = dir 290 try: 291 try: 292- if __dict__.has_key(mod) and inspect.ismodule (__dict__[mod]): 293- reload (__dict__[mod]) 294+ if globals().has_key(mod) and inspect.ismodule (eval (mod)): 295+ reload(eval (mod)) 296 else: 297- __dict__[mod] = __import__ (mod) 298+ globals ()[mod] = __import__ (mod) 299 except: 300 (type, value, tb) = sys.exc_info () 301 print "Traceback (most recent call last):" 302@@ -216,17 +107,6 @@ 303 finally: 304 sys.path[0] = path0 305 306-def modpath (module): 307- """Return the source file for the given MODULE (or None). 308-Assumes that MODULE.py and MODULE.pyc are in the same directory.""" 309- try: 310- path = __import__ (module).__file__ 311- if path[-4:] == '.pyc' and os.path.exists (path[0:-1]): 312- path = path[:-1] 313- print "_emacs_out", path 314- except: 315- print "_emacs_out ()" 316- 317-# print '_emacs_ok' # ready for input and can call continuation 318+print '_emacs_ok' # ready for input and can call continuation 319 320 # arch-tag: d90408f3-90e2-4de4-99c2-6eb9c7b9ca46 321Index: lisp/Makefile.in 322=================================================================== 323RCS file: /cvsroot/emacs/emacs/lisp/Makefile.in,v 324retrieving revision 1.85 325diff -u -b -r1.85 Makefile.in 326--- lisp/Makefile.in 20 Mar 2007 09:47:12 -0000 1.85 327+++ lisp/Makefile.in 2 Jun 2007 16:22:06 -0000 328@@ -281,6 +281,7 @@ 329 $(MAKE) $(MFLAGS) autoloads; \ 330 else \ 331 cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el; \ 332+ chmod u+w $(lisp)/loaddefs.el; \ 333 fi 334 335 maintainer-clean: distclean 336Index: mac/inc/m-mac.h 337=================================================================== 338RCS file: /cvsroot/emacs/emacs/mac/inc/m-mac.h,v 339retrieving revision 1.10 340diff -u -b -r1.10 m-mac.h 341--- mac/inc/m-mac.h 16 Jan 2007 02:34:26 -0000 1.10 342+++ mac/inc/m-mac.h 2 Jun 2007 16:22:07 -0000 343@@ -27,9 +27,11 @@ 344 345 /* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 346 is the most significant byte. */ 347- 348+#ifdef __BIG_ENDIAN__ 349 #define WORDS_BIG_ENDIAN 350- 351+#else 352+#undef WORDS_BIG_ENDIAN 353+#endif 354 /* Define NO_ARG_ARRAY if you cannot take the address of the first of a 355 * group of arguments and treat it as an array of the arguments. */ 356 357@@ -70,7 +72,7 @@ 358 Then the function dump-emacs will not be defined 359 and temacs will do (load "loadup") automatically unless told otherwise. */ 360 361-#define CANNOT_DUMP 362+/* #define CANNOT_DUMP */ 363 364 /* Define VIRT_ADDR_VARIES if the virtual addresses of 365 pure and impure space as loaded can vary, and even their 366Index: src/dispnew.c 367=================================================================== 368RCS file: /cvsroot/emacs/emacs/src/dispnew.c,v 369retrieving revision 1.392 370diff -u -b -r1.392 dispnew.c 371--- src/dispnew.c 16 Apr 2007 16:24:33 -0000 1.392 372+++ src/dispnew.c 2 Jun 2007 16:22:08 -0000 373@@ -6837,7 +6837,8 @@ 374 #endif /* HAVE_NTGUI */ 375 376 #ifdef MAC_OS 377- if (!inhibit_window_system) 378+ /* treat tty /dev/stdin as emacs -nw */ 379+ if (!inhibit_window_system && !isatty(0)) 380 { 381 Vwindow_system = intern ("mac"); 382 Vwindow_system_version = make_number (1); 383Index: src/lread.c 384=================================================================== 385RCS file: /cvsroot/emacs/emacs/src/lread.c,v 386retrieving revision 1.369 387diff -u -b -r1.369 lread.c 388--- src/lread.c 28 Mar 2007 08:16:19 -0000 1.369 389+++ src/lread.c 2 Jun 2007 16:22:08 -0000 390@@ -3783,8 +3783,11 @@ 391 if (NILP (Vpurify_flag)) 392 normal = PATH_LOADSEARCH; 393 else 394+#ifdef EMACS_UNDUMPED 395+ normal = PATH_LOADSEARCH; /* for dumping from universal binary after install */ 396+#else 397 normal = PATH_DUMPLOADSEARCH; 398- 399+#endif 400 /* In a dumped Emacs, we normally have to reset the value of 401 Vload_path from PATH_LOADSEARCH, since the value that was dumped 402 uses ../lisp, instead of the path of the installed elisp 403Index: src/mac.c 404=================================================================== 405RCS file: /cvsroot/emacs/emacs/src/mac.c,v 406retrieving revision 1.77 407diff -u -b -r1.77 mac.c 408--- src/mac.c 19 Apr 2007 08:41:05 -0000 1.77 409+++ src/mac.c 2 Jun 2007 16:22:08 -0000 410@@ -68,6 +68,8 @@ 411 #include <unistd.h> 412 #endif 413 414+#include <CoreFoundation/CoreFoundation.h> /* to get user locale */ 415+ 416 /* The system script code. */ 417 static int mac_system_script_code; 418 419@@ -4950,26 +4952,26 @@ 420 421 #endif /* TARGET_API_MAC_CARBON */ 422 423- 424 static Lisp_Object 425 mac_get_system_locale () 426 { 427- OSStatus err; 428- LangCode lang; 429- RegionCode region; 430- LocaleRef locale; 431- Str255 str; 432- 433- lang = GetScriptVariable (smSystemScript, smScriptLang); 434- region = GetScriptManagerVariable (smRegionCode); 435- err = LocaleRefFromLangOrRegionCode (lang, region, &locale); 436- if (err == noErr) 437- err = LocaleRefGetPartString (locale, kLocaleAllPartsMask, 438- sizeof (str), str); 439- if (err == noErr) 440- return build_string (str); 441- else 442- return Qnil; 443+ Lisp_Object object = Qnil; 444+ CFLocaleRef locale = CFLocaleCopyCurrent(); 445+ if (locale) { 446+ CFStringRef string = CFLocaleGetValue(locale, kCFLocaleIdentifier); 447+ if (string) { 448+ CFDataRef data = CFStringCreateExternalRepresentation(kCFAllocatorDefault, string, kCFStringEncodingUTF8, 0); 449+ if (data) { 450+ const UInt8 *sdata = CFDataGetBytePtr(data); 451+ if (sdata) 452+ object = build_string(sdata); 453+ CFRelease(data); 454+ } 455+ CFRelease(string); 456+ } 457+ CFRelease(locale); 458+ } 459+ return object; 460 } 461 462 463Index: src/s/darwin.h 464=================================================================== 465RCS file: /cvsroot/emacs/emacs/src/s/darwin.h,v 466retrieving revision 1.28 467diff -u -b -r1.28 darwin.h 468--- src/s/darwin.h 9 Apr 2007 09:18:54 -0000 1.28 469+++ src/s/darwin.h 2 Jun 2007 16:22:08 -0000 470@@ -35,6 +35,7 @@ 471 /* BSD4_3 and BSD4_4 are already defined in sys/param.h */ 472 /* #define BSD4_3 */ 473 /* #define BSD4_4 */ 474+/* sigpause is POSIX, undef BSD_SYSTEM??*/ 475 #define BSD_SYSTEM 476 /* #define VMS */ 477 478@@ -264,7 +265,7 @@ 479 480 /* Link in the Carbon lib. */ 481 #ifdef HAVE_CARBON 482-#define LIBS_CARBON -framework Carbon -framework QuickTime 483+#define LIBS_CARBON -framework Carbon -framework QuickTime -framework CoreFoundation 484 #else 485 #define LIBS_CARBON 486 #endif 487@@ -273,7 +274,8 @@ 488 end of the header for adding load commands. Needed for dumping. 489 0x690 is the total size of 30 segment load commands (at 56 490 each). */ 491-#define LD_SWITCH_SYSTEM_TEMACS -prebind LIBS_CARBON -Xlinker -headerpad -Xlinker 690 492+/* headerpad now set in encompassing Makefile */ 493+#define LD_SWITCH_SYSTEM_TEMACS -prebind LIBS_CARBON 494 495 #define C_SWITCH_SYSTEM_TEMACS -Dtemacs 496 497