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+ (oursleves) excluded.""" 122 try: 123- try: 124- source = open (file, "r").read() 125- code = compile (source, file, "exec") 126- # Other exceptions (shouldn't be any...) will (correctly) fall 127- # through to "final". 128- except (OverflowError, SyntaxError, ValueError): 129- # FIXME: When can compile() raise anything else than 130- # SyntaxError ???? 131- format_exception (file, False) 132- return 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- print '_emacs_out (', 258- for n in names: 259- if name == n[:l]: 260- if base: print '"%s.%s"' % (base, n), 261- else: print '"%s"' % n, 262- print ')' 263+ matches = c.global_matches (text) 264+ print '_emacs_out (', 265+ for elt in matches: 266+ print '"%s"' % elt, 267+ print ')' 268+ except: 269+ print '_emacs_out ()' 270 271-def ehelp (name, imports): 272- """Get help on string NAME. 273+def ehelp (name, g, l): 274+ """Get help on string NAME using globals G and locals L. 275 First try to eval name for, e.g. user definitions where we need 276 the object. Otherwise try the string form.""" 277- locls = {} 278- if imports: 279- try: exec imports in locls 280- except: pass 281- try: help (eval (name, globals(), locls)) 282+ try: help (eval (name, g, l)) 283 except: help (name) 284 285 def eimport (mod, dir): 286 """Import module MOD with directory DIR at the head of the search path. 287 NB doesn't load from DIR if MOD shadows a system module.""" 288- from __main__ import __dict__ 289- 290 path0 = sys.path[0] 291 sys.path[0] = dir 292 try: 293 try: 294- if __dict__.has_key(mod) and inspect.ismodule (__dict__[mod]): 295- reload (__dict__[mod]) 296+ if globals().has_key(mod) and inspect.ismodule (eval (mod)): 297+ reload(eval (mod)) 298 else: 299- __dict__[mod] = __import__ (mod) 300+ globals ()[mod] = __import__ (mod) 301 except: 302 (type, value, tb) = sys.exc_info () 303 print "Traceback (most recent call last):" 304@@ -216,17 +107,6 @@ def eimport (mod, dir): 305 finally: 306 sys.path[0] = path0 307 308-def modpath (module): 309- """Return the source file for the given MODULE (or None). 310-Assumes that MODULE.py and MODULE.pyc are in the same directory.""" 311- try: 312- path = __import__ (module).__file__ 313- if path[-4:] == '.pyc' and os.path.exists (path[0:-1]): 314- path = path[:-1] 315- print "_emacs_out", path 316- except: 317- print "_emacs_out ()" 318- 319-# print '_emacs_ok' # ready for input and can call continuation 320+print '_emacs_ok' # ready for input and can call continuation 321 322 # arch-tag: d90408f3-90e2-4de4-99c2-6eb9c7b9ca46 323Index: lisp/Makefile.in 324=================================================================== 325RCS file: /cvsroot/emacs/emacs/lisp/Makefile.in,v 326retrieving revision 1.85 327diff -u -b -r1.85 Makefile.in 328--- lisp/Makefile.in 20 Mar 2007 09:47:12 -0000 1.85 329+++ lisp/Makefile.in 2 Jun 2007 16:22:06 -0000 330@@ -281,6 +281,7 @@ 331 $(MAKE) $(MFLAGS) autoloads; \ 332 else \ 333 cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el; \ 334+ chmod u+w $(lisp)/loaddefs.el; \ 335 fi 336 337 maintainer-clean: distclean 338Index: mac/inc/m-mac.h 339=================================================================== 340RCS file: /cvsroot/emacs/emacs/mac/inc/m-mac.h,v 341retrieving revision 1.10 342diff -u -b -r1.10 m-mac.h 343--- mac/inc/m-mac.h 16 Jan 2007 02:34:26 -0000 1.10 344+++ mac/inc/m-mac.h 2 Jun 2007 16:22:07 -0000 345@@ -27,9 +27,11 @@ 346 347 /* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word 348 is the most significant byte. */ 349- 350+#ifdef __BIG_ENDIAN__ 351 #define WORDS_BIG_ENDIAN 352- 353+#else 354+#undef WORDS_BIG_ENDIAN 355+#endif 356 /* Define NO_ARG_ARRAY if you cannot take the address of the first of a 357 * group of arguments and treat it as an array of the arguments. */ 358 359@@ -70,7 +72,7 @@ 360 Then the function dump-emacs will not be defined 361 and temacs will do (load "loadup") automatically unless told otherwise. */ 362 363-#define CANNOT_DUMP 364+/* #define CANNOT_DUMP */ 365 366 /* Define VIRT_ADDR_VARIES if the virtual addresses of 367 pure and impure space as loaded can vary, and even their 368Index: src/dispnew.c 369=================================================================== 370RCS file: /cvsroot/emacs/emacs/src/dispnew.c,v 371retrieving revision 1.392 372diff -u -b -r1.392 dispnew.c 373--- src/dispnew.c 16 Apr 2007 16:24:33 -0000 1.392 374+++ src/dispnew.c 2 Jun 2007 16:22:08 -0000 375@@ -6837,7 +6837,8 @@ 376 #endif /* HAVE_NTGUI */ 377 378 #ifdef MAC_OS 379- if (!inhibit_window_system) 380+ /* treat tty /dev/stdin as emacs -nw */ 381+ if (!inhibit_window_system && !isatty(0)) 382 { 383 Vwindow_system = intern ("mac"); 384 Vwindow_system_version = make_number (1); 385Index: src/lread.c 386=================================================================== 387RCS file: /cvsroot/emacs/emacs/src/lread.c,v 388retrieving revision 1.369 389diff -u -b -r1.369 lread.c 390--- src/lread.c 28 Mar 2007 08:16:19 -0000 1.369 391+++ src/lread.c 2 Jun 2007 16:22:08 -0000 392@@ -3783,8 +3783,11 @@ 393 if (NILP (Vpurify_flag)) 394 normal = PATH_LOADSEARCH; 395 else 396+#ifdef EMACS_UNDUMPED 397+ normal = PATH_LOADSEARCH; /* for dumping from universal binary after install */ 398+#else 399 normal = PATH_DUMPLOADSEARCH; 400- 401+#endif 402 /* In a dumped Emacs, we normally have to reset the value of 403 Vload_path from PATH_LOADSEARCH, since the value that was dumped 404 uses ../lisp, instead of the path of the installed elisp 405Index: src/mac.c 406=================================================================== 407RCS file: /cvsroot/emacs/emacs/src/mac.c,v 408retrieving revision 1.77 409diff -u -b -r1.77 mac.c 410--- src/mac.c 19 Apr 2007 08:41:05 -0000 1.77 411+++ src/mac.c 2 Jun 2007 16:22:08 -0000 412@@ -68,6 +68,8 @@ 413 #include <unistd.h> 414 #endif 415 416+#include <CoreFoundation/CoreFoundation.h> /* to get user locale */ 417+ 418 /* The system script code. */ 419 static int mac_system_script_code; 420 421@@ -4950,26 +4952,26 @@ 422 423 #endif /* TARGET_API_MAC_CARBON */ 424 425- 426 static Lisp_Object 427 mac_get_system_locale () 428 { 429- OSStatus err; 430- LangCode lang; 431- RegionCode region; 432- LocaleRef locale; 433- Str255 str; 434- 435- lang = GetScriptVariable (smSystemScript, smScriptLang); 436- region = GetScriptManagerVariable (smRegionCode); 437- err = LocaleRefFromLangOrRegionCode (lang, region, &locale); 438- if (err == noErr) 439- err = LocaleRefGetPartString (locale, kLocaleAllPartsMask, 440- sizeof (str), str); 441- if (err == noErr) 442- return build_string (str); 443- else 444- return Qnil; 445+ Lisp_Object object = Qnil; 446+ CFLocaleRef locale = CFLocaleCopyCurrent(); 447+ if (locale) { 448+ CFStringRef string = CFLocaleGetValue(locale, kCFLocaleIdentifier); 449+ if (string) { 450+ CFDataRef data = CFStringCreateExternalRepresentation(kCFAllocatorDefault, string, kCFStringEncodingUTF8, 0); 451+ if (data) { 452+ const UInt8 *sdata = CFDataGetBytePtr(data); 453+ if (sdata) 454+ object = build_string(sdata); 455+ CFRelease(data); 456+ } 457+ CFRelease(string); 458+ } 459+ CFRelease(locale); 460+ } 461+ return object; 462 } 463 464 465Index: src/s/darwin.h 466=================================================================== 467RCS file: /cvsroot/emacs/emacs/src/s/darwin.h,v 468retrieving revision 1.28 469diff -u -b -r1.28 darwin.h 470--- src/s/darwin.h 9 Apr 2007 09:18:54 -0000 1.28 471+++ src/s/darwin.h 2 Jun 2007 16:22:08 -0000 472@@ -35,6 +35,7 @@ 473 /* BSD4_3 and BSD4_4 are already defined in sys/param.h */ 474 /* #define BSD4_3 */ 475 /* #define BSD4_4 */ 476+/* sigpause is POSIX, undef BSD_SYSTEM??*/ 477 #define BSD_SYSTEM 478 /* #define VMS */ 479 480@@ -264,7 +265,7 @@ 481 482 /* Link in the Carbon lib. */ 483 #ifdef HAVE_CARBON 484-#define LIBS_CARBON -framework Carbon -framework QuickTime 485+#define LIBS_CARBON -framework Carbon -framework QuickTime -framework CoreFoundation 486 #else 487 #define LIBS_CARBON 488 #endif 489@@ -273,7 +274,8 @@ 490 end of the header for adding load commands. Needed for dumping. 491 0x690 is the total size of 30 segment load commands (at 56 492 each). */ 493-#define LD_SWITCH_SYSTEM_TEMACS -prebind LIBS_CARBON -Xlinker -headerpad -Xlinker 690 494+/* headerpad now set in encompassing Makefile */ 495+#define LD_SWITCH_SYSTEM_TEMACS -prebind LIBS_CARBON 496 497 #define C_SWITCH_SYSTEM_TEMACS -Dtemacs 498 499