Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 100137. ------------------------------------------------------------ revno: 100137 committer: Glenn Morris branch nick: trunk timestamp: Mon 2010-05-03 20:33:04 -0700 message: Regenerate configure, src/config.in. diff: === modified file 'configure' --- configure 2010-05-03 02:15:26 +0000 +++ configure 2010-05-04 03:33:04 +0000 @@ -703,6 +703,8 @@ GZIP_PROG MAKEINFO LIB_MATH +C_SWITCH_MACHINE +C_SWITCH_SYSTEM CRT_DIR LIBSOUND PKG_CONFIG @@ -711,6 +713,8 @@ CFLAGS_SOUND SET_MAKE XMKMF +LD_SWITCH_X_SITE_AUX +LD_SWITCH_X_SITE_AUX_RPATH NS_OBJ NS_SUPPORT HAVE_XSERVER @@ -775,11 +779,8 @@ bitmapdir gamedir gameuser -c_switch_system -c_switch_machine unexec LD_SWITCH_X_SITE -LD_SWITCH_X_SITE_AUX C_SWITCH_X_SITE C_SWITCH_X_SYSTEM X_TOOLKIT_TYPE @@ -806,6 +807,7 @@ CYGWIN_OBJ PRE_ALLOC_OBJ POST_ALLOC_OBJ +LD_SWITCH_SYSTEM_TEMACS LTLIBOBJS' ac_subst_files='' ac_user_opts=' @@ -5866,15 +5868,7 @@ #ifndef LIBS_SYSTEM #define LIBS_SYSTEM #endif -#ifndef C_SWITCH_SYSTEM -#define C_SWITCH_SYSTEM -#endif -#ifndef C_SWITCH_MACHINE -#define C_SWITCH_MACHINE -#endif configure___ libsrc_libs=LIBS_SYSTEM -configure___ c_switch_system=C_SWITCH_SYSTEM -configure___ c_switch_machine=C_SWITCH_MACHINE configure___ LIBX=-lX11 @@ -5908,10 +5902,6 @@ #define LD_SWITCH_SYSTEM #endif -#ifndef LD_SWITCH_X_SITE_AUX -#define LD_SWITCH_X_SITE_AUX -#endif - configure___ ld_switch_system=LD_SWITCH_SYSTEM #ifdef THIS_IS_CONFIGURE @@ -5952,12 +5942,98 @@ ac_link="$ac_link $ld_switch_system" + +C_SWITCH_MACHINE= +if test "$machine" = "alpha"; then + { $as_echo "$as_me:$LINENO: checking whether __ELF__ is declared" >&5 +$as_echo_n "checking whether __ELF__ is declared... " >&6; } +if test "${ac_cv_have_decl___ELF__+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef __ELF__ + (void) __ELF__; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl___ELF__=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl___ELF__=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___ELF__" >&5 +$as_echo "$ac_cv_have_decl___ELF__" >&6; } + + if test "$ac_cv_have_decl___ELF__" = "yes"; then + ## With ELF, make sure that all common symbols get allocated to in the + ## data section. Otherwise, the dump of temacs may miss variables in + ## the shared library that have been initialized. For example, with + ## GNU libc, __malloc_initialized would normally be resolved to the + ## shared library's .bss section, which is fatal. + if test "x$GCC" = "xyes"; then + C_SWITCH_MACHINE="-fno-common" + else + { { $as_echo "$as_me:$LINENO: error: What gives? Fix me if DEC Unix supports ELF now." >&5 +$as_echo "$as_me: error: What gives? Fix me if DEC Unix supports ELF now." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi + + + +C_SWITCH_SYSTEM= +## Some programs in src produce warnings saying certain subprograms +## are too complex and need a MAXMEM value greater than 2000 for +## additional optimization. --nils@exp-math.uni-essen.de +test "$opsys" = "aix4.2" && test "x$GCC" = "xyes" && \ + C_SWITCH_SYSTEM="-ma -qmaxmem=4000" +## gnu-linux might need -D_BSD_SOURCE on old libc5 systems. +## It is redundant in glibc2, since we define _GNU_SOURCE. + + + ### Make sure subsequent tests use flags consistent with the build flags. if test x"${OVERRIDE_CPPFLAGS}" != x; then CPPFLAGS="${OVERRIDE_CPPFLAGS}" else - CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS" + CPPFLAGS="$C_SWITCH_SYSTEM $C_SWITCH_MACHINE $CPPFLAGS" fi @@ -9728,17 +9804,19 @@ ## Workaround for bug in autoconf <= 2.62. ## http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg01551.html ## No need to do anything special for these standard directories. -## This is an experiment, take it out if it causes problems. if test -n "${x_libraries}" && test x"${x_libraries}" != xNONE; then x_libraries=`echo :${x_libraries}: | sed -e 's|:/usr/lib64:|:|g' -e 's|:/lib64:|:|g' -e 's|^:||' -e 's|:$||'` fi +LD_SWITCH_X_SITE_AUX= +LD_SWITCH_X_SITE_AUX_RPATH= if test "${x_libraries}" != NONE; then if test -n "${x_libraries}"; then LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"` LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"` + LD_SWITCH_X_SITE_AUX_RPATH=`echo ${LD_SWITCH_X_SITE_AUX} | sed -e 's/-R/-Wl,-rpath,/'` fi x_default_search_path="" x_search_path=${x_libraries} @@ -9761,6 +9839,9 @@ fi done fi + + + if test "${x_includes}" != NONE && test -n "${x_includes}"; then C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"` fi @@ -25991,9 +26072,6 @@ - - - ## Used in lwlib/Makefile.in. @@ -26037,11 +26115,6 @@ cat >>confdefs.h <<_ACEOF -#define LD_SWITCH_X_SITE_AUX ${LD_SWITCH_X_SITE_AUX} -_ACEOF - - -cat >>confdefs.h <<_ACEOF #define C_SWITCH_X_SITE ${C_SWITCH_X_SITE} _ACEOF @@ -26189,6 +26262,30 @@ +case "$opsys" in + aix4-2) LD_SWITCH_SYSTEM_TEMACS="-Wl,-bnodelcsect" ;; + + darwin) + ## The -headerpad option tells ld (see man page) to leave room at the + ## end of the header for adding load commands. Needed for dumping. + ## 0x690 is the total size of 30 segment load commands (at 56 + ## each); under Cocoa 31 commands are required. + if test "$HAVE_NS" = "yes"; then + libs_nsgui="-framework AppKit" + headerpad_extra=6C8 + else + libs_nsgui= + headerpad_extra=690 + fi + LD_SWITCH_SYSTEM_TEMACS="-prebind $libs_nsgui -Xlinker -headerpad -Xlinker $headerpad_extra" + ;; + + *) LD_SWITCH_SYSTEM_TEMACS= ;; +esac + + + + === modified file 'src/config.in' --- src/config.in 2010-04-27 06:20:03 +0000 +++ src/config.in 2010-05-04 03:33:04 +0000 @@ -807,10 +807,6 @@ its own, you might want to add "-L/..." or something similar. */ #undef LD_SWITCH_X_SITE -/* Define LD_SWITCH_X_SITE_AUX with an -R option in case it's needed (for - Solaris, for example). */ -#undef LD_SWITCH_X_SITE_AUX - /* Define to 1 if localtime caches TZ. */ #undef LOCALTIME_CACHE ------------------------------------------------------------ revno: 100136 committer: Glenn Morris branch nick: trunk timestamp: Mon 2010-05-03 20:26:38 -0700 message: Yet another missing piece of C_SWITCH commit. * Makefile.in (C_SWITCH_SYSTEM): Use @C_SWITCH_SYSTEM@ rather than @c_switch_system@. * oldXMenu/Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE): Use @C_SWITCH_SYSTEM@, @C_SWITCH_MACHINE@ rather than @c_switch_system@, @c_switch_machine@. diff: === modified file 'ChangeLog' --- ChangeLog 2010-05-04 03:13:35 +0000 +++ ChangeLog 2010-05-04 03:26:38 +0000 @@ -8,6 +8,8 @@ * configure.in (C_SWITCH_MACHINE, C_SWITCH_SYSTEM): New output variables, replacing c_switch_machine, c_switch_system. + * Makefile.in (C_SWITCH_SYSTEM): Use @C_SWITCH_SYSTEM@ rather than + @c_switch_system@. 2010-05-03 Glenn Morris === modified file 'Makefile.in' --- Makefile.in 2010-03-18 05:17:11 +0000 +++ Makefile.in 2010-05-04 03:26:38 +0000 @@ -70,7 +70,7 @@ CC=@CC@ CPP=@CPP@ -C_SWITCH_SYSTEM=@c_switch_system@ +C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ ALLOCA=@ALLOCA@ LN_S=@LN_S@ CFLAGS=@CFLAGS@ === modified file 'oldXMenu/ChangeLog' --- oldXMenu/ChangeLog 2010-04-27 05:24:53 +0000 +++ oldXMenu/ChangeLog 2010-05-04 03:26:38 +0000 @@ -1,3 +1,9 @@ +2010-05-04 Glenn Morris + + * Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE): Use + @C_SWITCH_SYSTEM@, @C_SWITCH_MACHINE@ rather than + @c_switch_system@, @c_switch_machine@. + 2010-04-27 Dan Nicolaescu * Makefile.in (C_SWITCH_X_SYSTEM): Define using autoconf. === modified file 'oldXMenu/Makefile.in' --- oldXMenu/Makefile.in 2010-04-27 05:24:53 +0000 +++ oldXMenu/Makefile.in 2010-05-04 03:26:38 +0000 @@ -47,8 +47,8 @@ VPATH=@srcdir@ C_SWITCH_X_SITE=@C_SWITCH_X_SITE@ C_SWITCH_X_SYSTEM=@C_SWITCH_X_SYSTEM@ -C_SWITCH_SYSTEM=@c_switch_system@ -C_SWITCH_MACHINE=@c_switch_machine@ +C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ +C_SWITCH_MACHINE=@C_SWITCH_MACHINE@ EXTRA=insque.o CC=@CC@ ------------------------------------------------------------ revno: 100135 committer: Glenn Morris branch nick: trunk timestamp: Mon 2010-05-03 20:20:50 -0700 message: Missing lwlib part of earlier C_SWITCH commit. * lwlib/Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE): Use @C_SWITCH_SYSTEM@, @C_SWITCH_MACHINE@ instead of @c_switch_system@, @c_switch_machine@. diff: === modified file 'lwlib/ChangeLog' --- lwlib/ChangeLog 2010-04-27 05:24:53 +0000 +++ lwlib/ChangeLog 2010-05-04 03:20:50 +0000 @@ -1,3 +1,9 @@ +2010-05-04 Glenn Morris + + * Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE): + Use @C_SWITCH_SYSTEM@, @C_SWITCH_MACHINE@ instead of + @c_switch_system@, @c_switch_machine@. + 2010-04-27 Dan Nicolaescu * Makefile.in (C_SWITCH_X_SYSTEM): Define using autoconf. === modified file 'lwlib/Makefile.in' --- lwlib/Makefile.in 2010-04-27 05:24:53 +0000 +++ lwlib/Makefile.in 2010-05-04 03:20:50 +0000 @@ -1,6 +1,6 @@ # Copyright (C) 1992, 1993 Lucid, Inc. -# Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +# 2009, 2010 Free Software Foundation, Inc. # # This file is part of the Lucid Widget Library. # @@ -27,8 +27,8 @@ VPATH=@srcdir@ C_SWITCH_X_SITE=@C_SWITCH_X_SITE@ C_SWITCH_X_SYSTEM=@C_SWITCH_X_SYSTEM@ -C_SWITCH_SYSTEM=@c_switch_system@ -C_SWITCH_MACHINE=@c_switch_machine@ +C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ +C_SWITCH_MACHINE=@C_SWITCH_MACHINE@ CC=@CC@ CFLAGS=@CFLAGS@ ------------------------------------------------------------ revno: 100134 committer: Glenn Morris branch nick: trunk timestamp: Mon 2010-05-03 20:17:05 -0700 message: * admin/CPP-DEFINES: Remove some no-longer-used defines. diff: === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2010-04-27 08:09:01 +0000 +++ admin/CPP-DEFINES 2010-05-04 03:17:05 +0000 @@ -103,8 +103,6 @@ CLASH_DETECTION COFF_BSD_SYMBOLS CRT0_DUMMIES -C_SWITCH_MACHINE -C_SWITCH_SYSTEM C_SWITCH_X_SYSTEM DATA_SEG_BITS DATA_START @@ -223,10 +221,7 @@ IS_DIRECTORY_SEP KERNEL_FILE LDAV_SYMBOL -LD_SWITCH_MACHINE -LD_SWITCH_MACHINE_TEMACS LD_SWITCH_SYSTEM -LD_SWITCH_SYSTEM_TEMACS LD_SWITCH_SYSTEM_tmp LD_SWITCH_X_DEFAULT LIBS_MACHINE ------------------------------------------------------------ revno: 100133 committer: Glenn Morris branch nick: trunk timestamp: Mon 2010-05-03 20:13:35 -0700 message: Move LD_SWITCH_X_SITE_AUX from cpp to autoconf. * configure.in (LD_SWITCH_X_SITE_AUX): Use AC_SUBST only, not AC_DEFINE as well. (LD_SWITCH_X_SITE_AUX_RPATH): New output variable. * nt/config.nt (LD_SWITCH_X_SITE_AUX): Remove. * src/s/gnu-linux.h (LD_SWITCH_SYSTEM): Use LD_SWITCH_X_SITE_AUX as a shell variable. * src/s/netbsd.h (LD_SWITCH_SYSTEM_tmp): Remove. (LD_SWITCH_SYSTEM): Use $LD_SWITCH_X_SITE_AUX_RPATH. * src/s/openbsd.h (LD_SWITCH_SYSTEM_tmp): Remove. (LD_SWITCH_SYSTEM): Use $LD_SWITCH_X_SITE_AUX_RPATH instead of LD_SWITCH_SYSTEM_tmp. * src/Makefile.in (LD_SWITCH_X_SITE_AUX, LD_SWITCH_X_SITE_AUX_RPATH): New variables, set by configure. diff: === modified file 'ChangeLog' --- ChangeLog 2010-05-04 03:06:27 +0000 +++ ChangeLog 2010-05-04 03:13:35 +0000 @@ -1,5 +1,9 @@ 2010-05-04 Glenn Morris + * configure.in (LD_SWITCH_X_SITE_AUX): Use AC_SUBST only, not AC_DEFINE + as well. + (LD_SWITCH_X_SITE_AUX_RPATH): New output variable. + * configure.in (LD_SWITCH_SYSTEM_TEMACS): New output variable. * configure.in (C_SWITCH_MACHINE, C_SWITCH_SYSTEM): New output === modified file 'configure.in' --- configure.in 2010-05-04 03:06:27 +0000 +++ configure.in 2010-05-04 03:13:35 +0000 @@ -917,10 +917,6 @@ #define LD_SWITCH_SYSTEM #endif -#ifndef LD_SWITCH_X_SITE_AUX -#define LD_SWITCH_X_SITE_AUX -#endif - configure___ ld_switch_system=LD_SWITCH_SYSTEM #ifdef THIS_IS_CONFIGURE @@ -1326,17 +1322,19 @@ ## Workaround for bug in autoconf <= 2.62. ## http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg01551.html ## No need to do anything special for these standard directories. -## This is an experiment, take it out if it causes problems. if test -n "${x_libraries}" && test x"${x_libraries}" != xNONE; then x_libraries=`echo :${x_libraries}: | sed -e 's|:/usr/lib64:|:|g' -e 's|:/lib64:|:|g' -e 's|^:||' -e 's|:$||'` fi +LD_SWITCH_X_SITE_AUX= +LD_SWITCH_X_SITE_AUX_RPATH= if test "${x_libraries}" != NONE; then if test -n "${x_libraries}"; then LD_SWITCH_X_SITE=-L`echo ${x_libraries} | sed -e "s/:/ -L/g"` LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"` + LD_SWITCH_X_SITE_AUX_RPATH=`echo ${LD_SWITCH_X_SITE_AUX} | sed -e 's/-R/-Wl,-rpath,/'` fi x_default_search_path="" x_search_path=${x_libraries} @@ -1359,6 +1357,9 @@ fi done fi +AC_SUBST(LD_SWITCH_X_SITE_AUX) +AC_SUBST(LD_SWITCH_X_SITE_AUX_RPATH) + if test "${x_includes}" != NONE && test -n "${x_includes}"; then C_SWITCH_X_SITE=-I`echo ${x_includes} | sed -e "s/:/ -I/g"` fi @@ -2829,7 +2830,6 @@ AC_SUBST(gameuser) AC_SUBST(unexec) AC_SUBST(LD_SWITCH_X_SITE) -AC_SUBST(LD_SWITCH_X_SITE_AUX) AC_SUBST(C_SWITCH_X_SITE) AC_SUBST(C_SWITCH_X_SYSTEM) AC_SUBST(CFLAGS) @@ -2863,9 +2863,6 @@ HAVE_X_WINDOWS above and your X libraries aren't in a place that your loader can find on its own, you might want to add "-L/..." or something similar.]) -AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE_AUX, ${LD_SWITCH_X_SITE_AUX}, - [Define LD_SWITCH_X_SITE_AUX with an -R option - in case it's needed (for Solaris, for example).]) AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE, ${C_SWITCH_X_SITE}, [Define C_SWITCH_X_SITE to contain any special flags your compiler may need to deal with X Windows. For instance, if you've defined === modified file 'nt/ChangeLog' --- nt/ChangeLog 2010-04-20 15:46:52 +0000 +++ nt/ChangeLog 2010-05-04 03:13:35 +0000 @@ -1,3 +1,7 @@ +2010-05-04 Glenn Morris + + * config.nt (LD_SWITCH_X_SITE_AUX): Remove. + 2010-04-20 Lewis Perin (tiny change) * emacs.manifest: Add trustInfo section to Windows manifest. === modified file 'nt/config.nt' --- nt/config.nt 2010-01-13 08:35:10 +0000 +++ nt/config.nt 2010-05-04 03:13:35 +0000 @@ -325,10 +325,6 @@ something similar. */ #undef LD_SWITCH_X_SITE -/* Define LD_SWITCH_X_SITE_AUX with an -R option - in case it's needed (for Solaris, for example). */ -#undef LD_SWITCH_X_SITE_AUX - /* Define C_SWITCH_X_SITE to contain any special flags your compiler may need to deal with X Windows. For instance, if you've defined HAVE_X_WINDOWS above and your X include files aren't in a place === modified file 'src/ChangeLog' --- src/ChangeLog 2010-05-04 03:06:27 +0000 +++ src/ChangeLog 2010-05-04 03:13:35 +0000 @@ -1,5 +1,15 @@ 2010-05-04 Glenn Morris + * s/gnu-linux.h (LD_SWITCH_SYSTEM): Use LD_SWITCH_X_SITE_AUX as a shell + variable. + * s/netbsd.h (LD_SWITCH_SYSTEM_tmp): Remove. + (LD_SWITCH_SYSTEM): Use $LD_SWITCH_X_SITE_AUX_RPATH. + * s/openbsd.h (LD_SWITCH_SYSTEM_tmp): Remove. + (LD_SWITCH_SYSTEM): Use $LD_SWITCH_X_SITE_AUX_RPATH instead of + LD_SWITCH_SYSTEM_tmp. + * Makefile.in (LD_SWITCH_X_SITE_AUX, LD_SWITCH_X_SITE_AUX_RPATH): + New variables, set by configure. + * s/aix4-2.h (LD_SWITCH_SYSTEM_TEMACS): Move to configure.in. * s/darwin.h (HEADERPAD_EXTRA, LIBS_NSGUI): Remove. (LD_SWITCH_SYSTEM_TEMACS): Move to configure.in. === modified file 'src/Makefile.in' --- src/Makefile.in 2010-05-04 03:06:27 +0000 +++ src/Makefile.in 2010-05-04 03:13:35 +0000 @@ -77,6 +77,11 @@ ## This holds any special options for linking temacs only (ie, not ## used by configure). LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@ +## Next two must come before LD_SWITCH_SYSTEM. +## If needed, a -R option that says where to find X windows at run time. +LD_SWITCH_X_SITE_AUX=@LD_SWITCH_X_SITE_AUX@ +## As above, but using -rpath instead. +LD_SWITCH_X_SITE_AUX_RPATH=@LD_SWITCH_X_SITE_AUX_RPATH@ LIBTIFF=@LIBTIFF@ LIBJPEG=@LIBJPEG@ === modified file 'src/s/gnu-linux.h' --- src/s/gnu-linux.h 2010-04-27 07:02:12 +0000 +++ src/s/gnu-linux.h 2010-05-04 03:13:35 +0000 @@ -1,6 +1,7 @@ /* This file is the configuration file for Linux-based GNU systems Copyright (C) 1985, 1986, 1992, 1994, 1996, 1999, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -171,12 +172,12 @@ #define START_FILES pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o /* Here is how to find X Windows. LD_SWITCH_X_SITE_AUX gives an -R option - says where to find X windows at run time. */ + that says where to find X windows at run time. */ #ifdef __mips__ -#define LD_SWITCH_SYSTEM -G 0 LD_SWITCH_X_SITE_AUX +#define LD_SWITCH_SYSTEM -G 0 $(LD_SWITCH_X_SITE_AUX) #else -#define LD_SWITCH_SYSTEM LD_SWITCH_X_SITE_AUX +#define LD_SWITCH_SYSTEM $(LD_SWITCH_X_SITE_AUX) #endif /* __mips__ */ #ifdef emacs @@ -192,11 +193,6 @@ #define LIB_GCC #define LIB_STANDARD -lgcc -lc -lgcc $(CRT_DIR)/crtn.o -/* _BSD_SOURCE is redundant, at least in glibc2, since we define - _GNU_SOURCE. Left in in case it's relevant to libc5 systems and - anyone's still using Emacs on those. --fx 2002-12-14 */ -/* #define C_SWITCH_SYSTEM -D_BSD_SOURCE */ - #ifdef HAVE_LIBNCURSES #define TERMINFO #define LIBS_TERMCAP -lncurses === modified file 'src/s/netbsd.h' --- src/s/netbsd.h 2010-04-27 03:14:14 +0000 +++ src/s/netbsd.h 2010-05-04 03:13:35 +0000 @@ -43,11 +43,9 @@ #define AMPERSAND_FULL_NAME -/* Here is how to find X Windows. LD_SWITCH_X_SITE_AUX gives an -R option - says where to find X windows at run time. We convert it to a -rpath option - which is what OSF1 uses. */ -#define LD_SWITCH_SYSTEM_tmp `echo LD_SWITCH_X_SITE_AUX | sed -e 's/-R/-Wl,-rpath,/'` -#define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_tmp -Wl,-rpath,/usr/pkg/lib -L/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib +/* LD_SWITCH_X_SITE_AUX_RPATH gives a -rpath option (which is what + OSF1 uses) that says where to find X windows at run time. */ +#define LD_SWITCH_SYSTEM $(LD_SWITCH_X_SITE_AUX_RPATH) -Wl,-rpath,/usr/pkg/lib -L/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib /* On post 1.3 releases of NetBSD, gcc -nostdlib also clears the library search parth, i.e. it won't search /usr/lib === modified file 'src/s/openbsd.h' --- src/s/openbsd.h 2010-04-23 22:18:49 +0000 +++ src/s/openbsd.h 2010-05-04 03:13:35 +0000 @@ -3,13 +3,6 @@ /* Mostly the same as NetBSD. */ #include "netbsd.h" -/* This very-badly named symbol is conditionally defined in netbsd.h. - Better would be either to not need it in the first place, or to choose - a more descriptive name. */ -#ifndef LD_SWITCH_SYSTEM_tmp -#define LD_SWITCH_SYSTEM_tmp /* empty */ -#endif - /* David Mazieres says this is necessary. Otherwise Emacs dumps core when run -nw. */ #undef LIBS_TERMCAP @@ -21,7 +14,7 @@ /* Han Boetes says this is necessary, otherwise Emacs dumps core on elf systems. */ -#define LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_tmp -Z +#define LD_SWITCH_SYSTEM $(LD_SWITCH_X_SITE_AUX_RPATH) -Z /* arch-tag: 7e3f65ca-3f48-4237-933f-2b208b21e8e2 (do not change this comment) */ ------------------------------------------------------------ revno: 100132 committer: Glenn Morris branch nick: trunk timestamp: Mon 2010-05-03 20:06:27 -0700 message: Move LD_SWITCH_SYSTEM_TEMACS from cpp to autoconf. * configure.in (LD_SWITCH_SYSTEM_TEMACS): New output variable. * src/s/aix4-2.h (LD_SWITCH_SYSTEM_TEMACS): Move to configure.in. * src/s/darwin.h (HEADERPAD_EXTRA, LIBS_NSGUI): Remove. (LD_SWITCH_SYSTEM_TEMACS): Move to configure.in. * src/Makefile.in (LD_SWITCH_SYSTEM_TEMACS): New variable, set by configure. (TEMACS_LDFLAGS): Use $LD_SWITCH_SYSTEM_TEMACS. diff: === modified file 'ChangeLog' --- ChangeLog 2010-05-04 02:56:19 +0000 +++ ChangeLog 2010-05-04 03:06:27 +0000 @@ -1,5 +1,7 @@ 2010-05-04 Glenn Morris + * configure.in (LD_SWITCH_SYSTEM_TEMACS): New output variable. + * configure.in (C_SWITCH_MACHINE, C_SWITCH_SYSTEM): New output variables, replacing c_switch_machine, c_switch_system. === modified file 'configure.in' --- configure.in 2010-05-04 02:56:19 +0000 +++ configure.in 2010-05-04 03:06:27 +0000 @@ -2992,6 +2992,30 @@ AC_SUBST(PRE_ALLOC_OBJ) AC_SUBST(POST_ALLOC_OBJ) + +case "$opsys" in + aix4-2) LD_SWITCH_SYSTEM_TEMACS="-Wl,-bnodelcsect" ;; + + darwin) + ## The -headerpad option tells ld (see man page) to leave room at the + ## end of the header for adding load commands. Needed for dumping. + ## 0x690 is the total size of 30 segment load commands (at 56 + ## each); under Cocoa 31 commands are required. + if test "$HAVE_NS" = "yes"; then + libs_nsgui="-framework AppKit" + headerpad_extra=6C8 + else + libs_nsgui= + headerpad_extra=690 + fi + LD_SWITCH_SYSTEM_TEMACS="-prebind $libs_nsgui -Xlinker -headerpad -Xlinker $headerpad_extra" + ;; + + *) LD_SWITCH_SYSTEM_TEMACS= ;; +esac +AC_SUBST(LD_SWITCH_SYSTEM_TEMACS) + + AH_TOP([/* GNU Emacs site configuration template file. Copyright (C) 1988, 1993, 1994, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. === modified file 'src/ChangeLog' --- src/ChangeLog 2010-05-04 02:56:19 +0000 +++ src/ChangeLog 2010-05-04 03:06:27 +0000 @@ -1,5 +1,11 @@ 2010-05-04 Glenn Morris + * s/aix4-2.h (LD_SWITCH_SYSTEM_TEMACS): Move to configure.in. + * s/darwin.h (HEADERPAD_EXTRA, LIBS_NSGUI): Remove. + (LD_SWITCH_SYSTEM_TEMACS): Move to configure.in. + * Makefile.in (LD_SWITCH_SYSTEM_TEMACS): New variable, set by configure. + (TEMACS_LDFLAGS): Use $LD_SWITCH_SYSTEM_TEMACS. + * s/aix4-2.h (C_SWITCH_SYSTEM): * m/alpha.h (C_SWITCH_MACHINE): Move to configure.in. === modified file 'src/Makefile.in' --- src/Makefile.in 2010-05-04 02:56:19 +0000 +++ src/Makefile.in 2010-05-04 03:06:27 +0000 @@ -74,6 +74,9 @@ C_SWITCH_MACHINE=@C_SWITCH_MACHINE@ ## System-specific CFLAGS. C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ +## This holds any special options for linking temacs only (ie, not +## used by configure). +LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@ LIBTIFF=@LIBTIFF@ LIBJPEG=@LIBJPEG@ @@ -201,12 +204,6 @@ #endif /* (defined (BSD_SYSTEM) && !defined (COFF)) */ #endif /* LD_SWITCH_SYSTEM */ -/* This holds special options for linking temacs - that should be used for linking anything else. */ -#ifndef LD_SWITCH_SYSTEM_TEMACS -#define LD_SWITCH_SYSTEM_TEMACS -#endif - /* These macros are for switches specifically related to X Windows. */ #ifndef LD_SWITCH_X_SITE #define LD_SWITCH_X_SITE @@ -326,7 +323,7 @@ /* Flags to pass to LD only for temacs. */ /* Do not split this line with a backslash. That can cause trouble with some cpps. */ -TEMACS_LDFLAGS = LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_TEMACS +TEMACS_LDFLAGS = LD_SWITCH_SYSTEM $(LD_SWITCH_SYSTEM_TEMACS) /* A macro which other sections of Makefile can redefine to munge the flags before they are passed to LD. This is helpful if you have === modified file 'src/s/aix4-2.h' --- src/s/aix4-2.h 2010-05-04 02:56:19 +0000 +++ src/s/aix4-2.h 2010-05-04 03:06:27 +0000 @@ -100,9 +100,6 @@ #define LIBS_SYSTEM -lrts -lIM -liconv #endif -#define LD_SWITCH_SYSTEM_TEMACS -Wl,-bnodelcsect - - /* Use terminfo instead of termcap. */ === modified file 'src/s/darwin.h' --- src/s/darwin.h 2010-04-26 17:10:09 +0000 +++ src/s/darwin.h 2010-05-04 03:06:27 +0000 @@ -163,13 +163,8 @@ /* Definitions for how to compile & link. */ #ifdef HAVE_NS -#define LIBS_NSGUI -framework AppKit #define SYSTEM_PURESIZE_EXTRA 200000 -#define HEADERPAD_EXTRA 6C8 -#else /* !HAVE_NS */ -#define LIBS_NSGUI -#define HEADERPAD_EXTRA 690 -#endif /* !HAVE_NS */ +#endif /* On Darwin, res_init appears not to be useful: see bug#562 and http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01467.html */ @@ -177,12 +172,6 @@ #undef HAVE_RES_INIT #undef HAVE_LIBRESOLV -/* The -headerpad option tells ld (see man page) to leave room at the - end of the header for adding load commands. Needed for dumping. - 0x690 is the total size of 30 segment load commands (at 56 - each); under Cocoa 31 commands are required. */ -#define LD_SWITCH_SYSTEM_TEMACS -prebind LIBS_NSGUI -Xlinker -headerpad -Xlinker HEADERPAD_EXTRA - #ifdef emacs #define malloc unexec_malloc #define realloc unexec_realloc ------------------------------------------------------------ revno: 100131 committer: Glenn Morris branch nick: trunk timestamp: Mon 2010-05-03 19:56:19 -0700 message: Move C_SWITCH_MACHINE, C_SWITCH_SYSTEM from cpp to autoconf. * configure.in (C_SWITCH_MACHINE, C_SWITCH_SYSTEM): New output variables, replacing c_switch_machine, c_switch_system. * src/s/aix4-2.h (C_SWITCH_SYSTEM): * src/m/alpha.h (C_SWITCH_MACHINE): Move to configure.in. * src/Makefile.in (C_SWITCH_MACHINE, C_SWITCH_SYSTEM): New variables, set by configure. (ALL_CFLAGS): Use $C_SWITCH_MACHINE and $C_SWITCH_SYSTEM in place of $c_switch_machine and $c_switch_system. * lib-src/Makefile.in: Use @C_SWITCH_SYSTEM@, @C_SWITCH_MACHINE@ rather than @c_switch_system@, @c_switch_machine@. diff: === modified file 'ChangeLog' --- ChangeLog 2010-05-03 02:10:43 +0000 +++ ChangeLog 2010-05-04 02:56:19 +0000 @@ -1,3 +1,8 @@ +2010-05-04 Glenn Morris + + * configure.in (C_SWITCH_MACHINE, C_SWITCH_SYSTEM): New output + variables, replacing c_switch_machine, c_switch_system. + 2010-05-03 Glenn Morris * configure.in (LIBXT_OTHER, LIBX_OTHER): New output variables. === modified file 'configure.in' --- configure.in 2010-05-03 02:10:43 +0000 +++ configure.in 2010-05-04 02:56:19 +0000 @@ -883,15 +883,7 @@ #ifndef LIBS_SYSTEM #define LIBS_SYSTEM #endif -#ifndef C_SWITCH_SYSTEM -#define C_SWITCH_SYSTEM -#endif -#ifndef C_SWITCH_MACHINE -#define C_SWITCH_MACHINE -#endif configure___ libsrc_libs=LIBS_SYSTEM -configure___ c_switch_system=C_SWITCH_SYSTEM -configure___ c_switch_machine=C_SWITCH_MACHINE configure___ LIBX=-lX11 @@ -969,12 +961,43 @@ ac_link="$ac_link $ld_switch_system" + +C_SWITCH_MACHINE= +if test "$machine" = "alpha"; then + AC_CHECK_DECL([__ELF__]) + if test "$ac_cv_have_decl___ELF__" = "yes"; then + ## With ELF, make sure that all common symbols get allocated to in the + ## data section. Otherwise, the dump of temacs may miss variables in + ## the shared library that have been initialized. For example, with + ## GNU libc, __malloc_initialized would normally be resolved to the + ## shared library's .bss section, which is fatal. + if test "x$GCC" = "xyes"; then + C_SWITCH_MACHINE="-fno-common" + else + AC_MSG_ERROR([What gives? Fix me if DEC Unix supports ELF now.]) + fi + fi +fi +AC_SUBST(C_SWITCH_MACHINE) + + +C_SWITCH_SYSTEM= +## Some programs in src produce warnings saying certain subprograms +## are too complex and need a MAXMEM value greater than 2000 for +## additional optimization. --nils@exp-math.uni-essen.de +test "$opsys" = "aix4.2" && test "x$GCC" != "xyes" && \ + C_SWITCH_SYSTEM="-ma -qmaxmem=4000" +## gnu-linux might need -D_BSD_SOURCE on old libc5 systems. +## It is redundant in glibc2, since we define _GNU_SOURCE. +AC_SUBST(C_SWITCH_SYSTEM) + + ### Make sure subsequent tests use flags consistent with the build flags. if test x"${OVERRIDE_CPPFLAGS}" != x; then CPPFLAGS="${OVERRIDE_CPPFLAGS}" else - CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS" + CPPFLAGS="$C_SWITCH_SYSTEM $C_SWITCH_MACHINE $CPPFLAGS" fi dnl For AC_FUNC_GETLOADAVG, at least: @@ -2804,8 +2827,6 @@ AC_SUBST(bitmapdir) AC_SUBST(gamedir) AC_SUBST(gameuser) -AC_SUBST(c_switch_system) -AC_SUBST(c_switch_machine) AC_SUBST(unexec) AC_SUBST(LD_SWITCH_X_SITE) AC_SUBST(LD_SWITCH_X_SITE_AUX) === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2010-04-26 18:14:24 +0000 +++ lib-src/ChangeLog 2010-05-04 02:56:19 +0000 @@ -1,3 +1,8 @@ +2010-05-04 Glenn Morris + + * Makefile.in: Use @C_SWITCH_SYSTEM@, @C_SWITCH_MACHINE@ rather than + @c_switch_system@, @c_switch_machine@. + 2010-04-26 Dan Nicolaescu * Makefile.in (LIBS_MACHINE): Remove all uses, unused. === modified file 'lib-src/Makefile.in' --- lib-src/Makefile.in 2010-04-26 18:23:01 +0000 +++ lib-src/Makefile.in 2010-05-04 02:56:19 +0000 @@ -34,8 +34,8 @@ version=@version@ configuration=@configuration@ EXEEXT=@EXEEXT@ -C_SWITCH_SYSTEM=@c_switch_system@ -C_SWITCH_MACHINE=@c_switch_machine@ +C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ +C_SWITCH_MACHINE=@C_SWITCH_MACHINE@ # Program name transformation. TRANSFORM = @program_transform_name@ === modified file 'src/ChangeLog' --- src/ChangeLog 2010-05-04 02:51:49 +0000 +++ src/ChangeLog 2010-05-04 02:56:19 +0000 @@ -1,3 +1,13 @@ +2010-05-04 Glenn Morris + + * s/aix4-2.h (C_SWITCH_SYSTEM): + * m/alpha.h (C_SWITCH_MACHINE): + Move to configure.in. + * Makefile.in (C_SWITCH_MACHINE, C_SWITCH_SYSTEM): + New variables, set by configure. + (ALL_CFLAGS): Use $C_SWITCH_MACHINE and $C_SWITCH_SYSTEM in place of + $c_switch_machine and $c_switch_system. + 2010-05-04 Dan Nicolaescu * s/hpux10-20.h (LIB_STANDARD): New definition. === modified file 'src/Makefile.in' --- src/Makefile.in 2010-05-04 02:51:49 +0000 +++ src/Makefile.in 2010-05-04 02:56:19 +0000 @@ -70,6 +70,11 @@ CRT_DIR=@CRT_DIR@ +## Machine-specific CFLAGS. +C_SWITCH_MACHINE=@C_SWITCH_MACHINE@ +## System-specific CFLAGS. +C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ + LIBTIFF=@LIBTIFF@ LIBJPEG=@LIBJPEG@ LIBPNG=@LIBPNG@ @@ -232,7 +237,7 @@ /* C_SWITCH_X_SITE must come before C_SWITCH_X_SYSTEM since it may have -I options that should override those two. */ -ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} @c_switch_machine@ @c_switch_system@ @C_SWITCH_X_SITE@ @C_SWITCH_X_SYSTEM@ ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} ${GCONF_CFLAGS} ${CFLAGS} @FREETYPE_CFLAGS@ @FONTCONFIG_CFLAGS@ @LIBOTF_CFLAGS@ @M17N_FLT_CFLAGS@ ${DEPFLAGS} +ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} ${C_SWITCH_MACHINE} ${C_SWITCH_SYSTEM} @C_SWITCH_X_SITE@ @C_SWITCH_X_SYSTEM@ ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} ${GCONF_CFLAGS} ${CFLAGS} @FREETYPE_CFLAGS@ @FONTCONFIG_CFLAGS@ @LIBOTF_CFLAGS@ @M17N_FLT_CFLAGS@ ${DEPFLAGS} ALL_OBJC_CFLAGS=$(ALL_CFLAGS) @GNU_OBJC_CFLAGS@ .SUFFIXES: .m @@ -968,7 +973,7 @@ keymap.h blockinput.h atimer.h systime.h $(INTERVALS_H) \ xterm.h w32term.h nsterm.h nsgui.h lisp.h $(config_h) xdisp.o: xdisp.c macros.h commands.h process.h indent.h buffer.h dispextern.h \ - coding.h termchar.h frame.h window.h disptab.h termhooks.h character.h \ + coding.h termchar.h frame.h window.h disptab.h termhooks.h character.h \ charset.h lisp.h $(config_h) keyboard.h $(INTERVALS_H) region-cache.h \ xterm.h w32term.h nsterm.h nsgui.h msdos.h composite.h fontset.h ccl.h \ blockinput.h atimer.h systime.h keymap.h font.h === modified file 'src/m/alpha.h' --- src/m/alpha.h 2010-04-25 22:16:58 +0000 +++ src/m/alpha.h 2010-05-04 02:56:19 +0000 @@ -77,16 +77,6 @@ /* #define SYSTEM_MALLOC */ #ifdef __ELF__ -/* With ELF, make sure that all common symbols get allocated to in the - data section. Otherwise, the dump of temacs may miss variables in - the shared library that have been initialized. For example, with - GNU libc, __malloc_initialized would normally be resolved to the - shared library's .bss section, which is fatal. */ -# ifdef __GNUC__ -# define C_SWITCH_MACHINE -fno-common -# else -# error What gives? Fix me if DEC Unix supports ELF now. -# endif #undef UNEXEC #define UNEXEC unexelf.o === modified file 'src/s/aix4-2.h' --- src/s/aix4-2.h 2010-05-01 20:19:41 +0000 +++ src/s/aix4-2.h 2010-05-04 02:56:19 +0000 @@ -1,6 +1,6 @@ /* -Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 - Free Software Foundation, Inc. +Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, + 2010 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -118,13 +118,6 @@ /* AIX doesn't define this. */ #define unix 1 -#ifndef __GNUC__ -/* Some programs in src produce warnings saying certain subprograms - are to comples and need a MAXMEM value greater than 2000 for - additional optimization. --nils@exp-math.uni-essen.de */ -#define C_SWITCH_SYSTEM -ma -qmaxmem=4000 -#endif - /* string.h defines rindex as a macro, at least with native cc, so we lose declaring char * rindex without this. It is just a guess which versions of AIX need this definition. */ ------------------------------------------------------------ revno: 100130 committer: Dan Nicolaescu branch nick: trunk timestamp: Mon 2010-05-03 19:51:49 -0700 message: * s/hpux10-20.h (LIB_STANDARD): New definition. * Makefile.in (ORDINARY_LINK): Remove setting LIB_STANDARD based on it, not used anymore. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-05-03 15:01:21 +0000 +++ src/ChangeLog 2010-05-04 02:51:49 +0000 @@ -1,3 +1,9 @@ +2010-05-04 Dan Nicolaescu + + * s/hpux10-20.h (LIB_STANDARD): New definition. + * Makefile.in (ORDINARY_LINK): Remove setting LIB_STANDARD based + on it, not used anymore. + 2010-05-03 Chong Yidong * eval.c (internal_condition_case_n): Rename from === modified file 'src/Makefile.in' --- src/Makefile.in 2010-05-03 02:10:43 +0000 +++ src/Makefile.in 2010-05-04 02:51:49 +0000 @@ -172,15 +172,9 @@ #undef register /* Some machines do not find the standard C libraries in the usual place. */ -#ifndef ORDINARY_LINK -#ifndef LIB_STANDARD -#define LIB_STANDARD -lc -#endif -#else #ifndef LIB_STANDARD #define LIB_STANDARD #endif -#endif /* Under GNUstep, putting libc on the link line causes problems. */ #ifdef NS_IMPL_GNUSTEP === modified file 'src/s/hpux10-20.h' --- src/s/hpux10-20.h 2010-04-28 07:01:43 +0000 +++ src/s/hpux10-20.h 2010-05-04 02:51:49 +0000 @@ -134,6 +134,8 @@ #define LIBS_SYSTEM -l:libdld.sl +#define LIB_STANDARD -lc + /* Rainer Malzbender says definining HAVE_XRMSETDATABASE allows Emacs to compile on HP-UX 10.20 using GCC. */ @@ -154,9 +156,6 @@ #undef _FILE_OFFSET_BITS -/* otherwise sigunblock wont be defined */ -#define POSIX_SIGNALS - /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section when Emacs is dumped. If you define this, the preloaded Lisp ------------------------------------------------------------ revno: 100129 committer: Juanma Barranquero branch nick: trunk timestamp: Tue 2010-05-04 00:42:19 +0200 message: * ibuffer.el: Update autoload checksum. diff: === modified file 'lisp/ibuffer.el' --- lisp/ibuffer.el 2010-01-13 12:34:53 +0000 +++ lisp/ibuffer.el 2010-05-03 22:42:19 +0000 @@ -2641,7 +2641,7 @@ ;;;;;; ibuffer-backward-filter-group ibuffer-forward-filter-group ;;;;;; ibuffer-toggle-filter-group ibuffer-mouse-toggle-filter-group ;;;;;; ibuffer-interactive-filter-by-mode ibuffer-mouse-filter-by-mode -;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "4fb4f1a32cf4ecf4669a133a866f4a14") +;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "e1272bfdc7c3b6e926b2a68155217303") ;;; Generated autoloads from ibuf-ext.el (autoload 'ibuffer-auto-mode "ibuf-ext" "\ ------------------------------------------------------------ revno: 100128 committer: Juanma Barranquero branch nick: trunk timestamp: Tue 2010-05-04 00:38:50 +0200 message: * mm-util.el (mm-decompress-buffer): Use `delete-file'. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-05-03 00:41:45 +0000 +++ lisp/gnus/ChangeLog 2010-05-03 22:38:50 +0000 @@ -1,3 +1,8 @@ +2010-05-03 Juanma Barranquero + + * mm-util.el (mm-decompress-buffer): Use `delete-file'; + alias `jka-compr-delete-temp-file' no longer exists. + 2010-05-03 Stefan Monnier Use define-minor-mode in Gnus where applicable. === modified file 'lisp/gnus/mm-util.el' --- lisp/gnus/mm-util.el 2010-04-23 16:15:51 +0000 +++ lisp/gnus/mm-util.el 2010-05-03 22:38:50 +0000 @@ -1563,7 +1563,7 @@ (error (setq err-msg (error-message-string err))))) (when (file-exists-p err-file) - (ignore-errors (jka-compr-delete-temp-file err-file))) + (ignore-errors (delete-file err-file))) (when inplace (unless err-msg (delete-region (point-min) (point-max)) ------------------------------------------------------------ revno: 100127 committer: Chong Yidong branch nick: trunk timestamp: Mon 2010-05-03 11:01:21 -0400 message: Add optional arg to delete-file to force deletion (Bug#6070). * eval.c (internal_condition_case_n): Rename from internal_condition_case_2. (internal_condition_case_2): New function. * xdisp.c (safe_call): Use internal_condition_case_n. * fileio.c (Fdelete_file, internal_delete_file): New arg FORCE. (internal_delete_file, Frename_file): Callers changed. * buffer.c (Fkill_buffer): * callproc.c (delete_temp_file): Callers changed (Bug#6070). * lisp.h: Update prototypes. * diff.el (diff-sentinel): * epg.el (epg--make-temp-file, epg-decrypt-string) (epg-verify-string, epg-sign-string, epg-encrypt-string): * jka-compr.el (jka-compr-partial-uncompress) (jka-compr-call-process, jka-compr-write-region, jka-compr-load): * server.el (server-sentinel): Use delete-file's new FORCE arg (Bug#6070). diff: === modified file 'etc/NEWS' --- etc/NEWS 2010-05-02 05:56:30 +0000 +++ etc/NEWS 2010-05-03 15:01:21 +0000 @@ -109,6 +109,11 @@ ** completion-at-point is now an alias for complete-symbol. +** mouse-region-delete-keys has been deleted. + +** If delete-file is called with a prefix argument, it really deletes, +regardless of the value of `delete-by-moving-to-trash'. + * Changes in Specialized Modes and Packages in Emacs 24.1 @@ -181,6 +186,9 @@ * Lisp changes in Emacs 24.1 +** delete-file now accepts an optional second arg, FORCE, which says +to always delete and ignore the value of delete-by-moving-to-trash. + ** buffer-substring-filters is obsoleted by filter-buffer-substring-functions. ** New completion style `substring'. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-05-03 12:46:56 +0000 +++ lisp/ChangeLog 2010-05-03 15:01:21 +0000 @@ -1,3 +1,16 @@ +2010-05-03 Chong Yidong + + * diff.el (diff-sentinel): + + * epg.el (epg--make-temp-file, epg-decrypt-string) + (epg-verify-string, epg-sign-string, epg-encrypt-string): + + * jka-compr.el (jka-compr-partial-uncompress) + (jka-compr-call-process, jka-compr-write-region, jka-compr-load): + + * server.el (server-sentinel): Use delete-file's new FORCE arg + (Bug#6070). + 2010-05-03 Stefan Monnier Use define-minor-mode where applicable. @@ -100,19 +113,6 @@ (tramp-handle-file-local-copy, tramp-handle-write-region) (tramp-method-out-of-band-p): Use `tramp-get-inline-coding'. -2010-05-01 Chong Yidong - - * server.el (server-sentinel, server-start, server-force-delete): - - * jka-compr.el (jka-compr-partial-uncompress) - (jka-compr-call-process, jka-compr-write-region, jka-compr-load): - - * epg.el (epg--make-temp-file, epg-decrypt-string) - (epg-encrypt-string, epg-verify-string, epg-sign-string): - - * diff.el (diff-sentinel): Bind delete-by-moving-to-trash to nil - before deleting (Bug#6070). - 2010-05-01 Stefan Monnier * bindings.el (mode-line-abbrev-mode, mode-line-auto-fill-mode): === modified file 'lisp/diff.el' --- lisp/diff.el 2010-05-01 02:19:40 +0000 +++ lisp/diff.el 2010-05-03 15:01:21 +0000 @@ -64,9 +64,8 @@ "Code run when the diff process exits. CODE is the exit code of the process. It should be 0 only if no diffs were found." - (let (delete-by-moving-to-trash) - (if diff-old-temp-file (delete-file diff-old-temp-file)) - (if diff-new-temp-file (delete-file diff-new-temp-file))) + (if diff-old-temp-file (delete-file diff-old-temp-file t)) + (if diff-new-temp-file (delete-file diff-new-temp-file t)) (save-excursion (goto-char (point-max)) (let ((inhibit-read-only t)) === modified file 'lisp/epg.el' --- lisp/epg.el 2010-05-01 02:19:40 +0000 +++ lisp/epg.el 2010-05-03 15:01:21 +0000 @@ -1898,8 +1898,7 @@ ;; Cleanup the tempfile. (and tempfile (file-exists-p tempfile) - (let (delete-by-moving-to-trash) - (delete-file tempfile))) + (delete-file tempfile t)) ;; Cleanup the tempdir. (and tempdir (file-directory-p tempdir) @@ -1999,8 +1998,7 @@ (epg-read-output context)) (epg-delete-output-file context) (if (file-exists-p input-file) - (let (delete-by-moving-to-trash) - (delete-file input-file))) + (delete-file input-file t)) (epg-reset context)))) (defun epg-start-verify (context signature &optional signed-text) @@ -2097,8 +2095,7 @@ (epg-delete-output-file context) (if (and input-file (file-exists-p input-file)) - (let (delete-by-moving-to-trash) - (delete-file input-file))) + (delete-file input-file)) (epg-reset context)))) (defun epg-start-sign (context plain &optional mode) @@ -2205,8 +2202,7 @@ (epg-read-output context)) (epg-delete-output-file context) (if input-file - (let (delete-by-moving-to-trash) - (delete-file input-file))) + (delete-file input-file t)) (epg-reset context)))) (defun epg-start-encrypt (context plain recipients @@ -2326,8 +2322,7 @@ (epg-read-output context)) (epg-delete-output-file context) (if input-file - (let (delete-by-moving-to-trash) - (delete-file input-file))) + (delete-file input-file t)) (epg-reset context)))) (defun epg-start-export-keys (context keys) === modified file 'lisp/jka-compr.el' --- lisp/jka-compr.el 2010-05-01 02:19:40 +0000 +++ lisp/jka-compr.el 2010-05-03 15:01:21 +0000 @@ -181,8 +181,7 @@ null-device)) jka-compr-acceptable-retval-list) (jka-compr-error prog args infile message err-file)) - (let (delete-by-moving-to-trash) - (delete-file err-file)))) + (delete-file err-file t))) ;; Run the uncompression program directly. ;; We get the whole file and must delete what we don't want. @@ -224,8 +223,7 @@ ""))) jka-compr-acceptable-retval-list) (jka-compr-error prog args infile message err-file)) - (let (delete-by-moving-to-trash) - (delete-file err-file)))) + (delete-file err-file t))) (or (eq 0 (apply 'call-process prog infile (if (stringp output) temp output) @@ -337,8 +335,7 @@ (and append can-append) 'dont)) (erase-buffer)) ) - (let (delete-by-moving-to-trash) - (delete-file temp-file)) + (delete-file temp-file t) (and compress-message @@ -604,8 +601,7 @@ (setq file (file-name-sans-extension file))) (setcar l file))) - (let (delete-by-moving-to-trash) - (delete-file local-copy))) + (delete-file local-copy)) t)) === modified file 'lisp/server.el' --- lisp/server.el 2010-05-01 02:19:40 +0000 +++ lisp/server.el 2010-05-03 15:01:21 +0000 @@ -345,8 +345,7 @@ (and (process-contact proc :server) (eq (process-status proc) 'closed) (ignore-errors - (let (delete-by-moving-to-trash) - (delete-file (process-get proc :server-file))))) + (delete-file (process-get proc :server-file) t))) (server-log (format "Status changed to %s: %s" (process-status proc) msg) proc) (server-delete-client proc)) === modified file 'src/ChangeLog' --- src/ChangeLog 2010-05-03 02:10:43 +0000 +++ src/ChangeLog 2010-05-03 15:01:21 +0000 @@ -1,3 +1,19 @@ +2010-05-03 Chong Yidong + + * eval.c (internal_condition_case_n): Rename from + internal_condition_case_2. + (internal_condition_case_2): New function. + + * xdisp.c (safe_call): Use internal_condition_case_n. + + * fileio.c (Fdelete_file, internal_delete_file): New arg FORCE. + (internal_delete_file, Frename_file): Callers changed. + + * buffer.c (Fkill_buffer): + * callproc.c (delete_temp_file): Callers changed (Bug#6070). + + * lisp.h: Update prototypes. + 2010-05-03 Glenn Morris * Makefile.in (LIBX_EXTRA, LIBX_BASE): New variables. === modified file 'src/buffer.c' --- src/buffer.c 2010-04-20 23:05:30 +0000 +++ src/buffer.c 2010-05-03 15:01:21 +0000 @@ -1547,7 +1547,7 @@ Lisp_Object tem; tem = Fsymbol_value (intern ("delete-auto-save-files")); if (! NILP (tem)) - internal_delete_file (b->auto_save_file_name); + internal_delete_file (b->auto_save_file_name, Qt); } if (b->base_buffer) === modified file 'src/callproc.c' --- src/callproc.c 2010-04-02 03:10:33 +0000 +++ src/callproc.c 2010-05-03 15:01:21 +0000 @@ -856,7 +856,7 @@ /* Suppress jka-compr handling, etc. */ int count = SPECPDL_INDEX (); specbind (intern ("file-name-handler-alist"), Qnil); - internal_delete_file (name); + internal_delete_file (name, Qt); unbind_to (count, Qnil); return Qnil; } === modified file 'src/eval.c' --- src/eval.c 2010-04-29 12:42:01 +0000 +++ src/eval.c 2010-05-03 15:01:21 +0000 @@ -1563,12 +1563,61 @@ return val; } +/* Like internal_condition_case_1 but call BFUN with ARG1 and ARG2 as + its arguments. */ + +Lisp_Object +internal_condition_case_2 (bfun, arg1, arg2, handlers, hfun) + Lisp_Object (*bfun) (); + Lisp_Object arg1; + Lisp_Object arg2; + Lisp_Object handlers; + Lisp_Object (*hfun) (); +{ + Lisp_Object val; + struct catchtag c; + struct handler h; + + /* Since Fsignal will close off all calls to x_catch_errors, + we will get the wrong results if some are not closed now. */ +#if HAVE_X_WINDOWS + if (x_catching_errors ()) + abort (); +#endif + + c.tag = Qnil; + c.val = Qnil; + c.backlist = backtrace_list; + c.handlerlist = handlerlist; + c.lisp_eval_depth = lisp_eval_depth; + c.pdlcount = SPECPDL_INDEX (); + c.poll_suppress_count = poll_suppress_count; + c.interrupt_input_blocked = interrupt_input_blocked; + c.gcpro = gcprolist; + c.byte_stack = byte_stack_list; + if (_setjmp (c.jmp)) + { + return (*hfun) (c.val); + } + c.next = catchlist; + catchlist = &c; + h.handler = handlers; + h.var = Qnil; + h.next = handlerlist; + h.tag = &c; + handlerlist = &h; + + val = (*bfun) (arg1, arg2); + catchlist = c.next; + handlerlist = h.next; + return val; +} /* Like internal_condition_case but call BFUN with NARGS as first, and ARGS as second argument. */ Lisp_Object -internal_condition_case_2 (bfun, nargs, args, handlers, hfun) +internal_condition_case_n (bfun, nargs, args, handlers, hfun) Lisp_Object (*bfun) (); int nargs; Lisp_Object *args; === modified file 'src/fileio.c' --- src/fileio.c 2010-05-01 02:58:41 +0000 +++ src/fileio.c 2010-05-03 15:01:21 +0000 @@ -2194,11 +2194,17 @@ return Qnil; } -DEFUN ("delete-file", Fdelete_file, Sdelete_file, 1, 1, "fDelete file: ", +DEFUN ("delete-file", Fdelete_file, Sdelete_file, 1, 2, "fDelete file: \nP", doc: /* Delete file named FILENAME. If it is a symlink, remove the symlink. -If file has multiple names, it continues to exist with the other names. */) - (filename) +If file has multiple names, it continues to exist with the other names. + +If optional arg FORCE is non-nil, really delete the file regardless of +`delete-by-moving-to-trash'. Otherwise, \"deleting\" actually moves +it to the system's trash can if `delete-by-moving-to-trash' is non-nil. +Interactively, FORCE is non-nil if called with a prefix arg. */) + (filename, force) Lisp_Object filename; + Lisp_Object force; { Lisp_Object handler; Lisp_Object encoded_file; @@ -2217,7 +2223,7 @@ if (!NILP (handler)) return call2 (handler, Qdelete_file, filename); - if (delete_by_moving_to_trash) + if (delete_by_moving_to_trash && NILP (force)) return call1 (Qmove_file_to_trash, filename); encoded_file = ENCODE_FILE (filename); @@ -2234,14 +2240,15 @@ return Qt; } -/* Delete file FILENAME, returning 1 if successful and 0 if failed. */ +/* Delete file FILENAME, returning 1 if successful and 0 if failed. + FORCE means to ignore `delete-by-moving-to-trash'. */ int -internal_delete_file (filename) - Lisp_Object filename; +internal_delete_file (Lisp_Object filename, Lisp_Object force) { Lisp_Object tem; - tem = internal_condition_case_1 (Fdelete_file, filename, + + tem = internal_condition_case_2 (Fdelete_file, filename, force, Qt, internal_delete_file_1); return NILP (tem); } @@ -2335,7 +2342,7 @@ ) call2 (Qdelete_directory, file, Qt); else - Fdelete_file (file); + Fdelete_file (file, Qt); unbind_to (count, Qnil); } else === modified file 'src/lisp.h' --- src/lisp.h 2010-04-29 12:42:01 +0000 +++ src/lisp.h 2010-05-03 15:01:21 +0000 @@ -2901,7 +2901,8 @@ extern Lisp_Object internal_lisp_condition_case P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); extern Lisp_Object internal_condition_case P_ ((Lisp_Object (*) (void), Lisp_Object, Lisp_Object (*) (Lisp_Object))); extern Lisp_Object internal_condition_case_1 P_ ((Lisp_Object (*) (Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object))); -extern Lisp_Object internal_condition_case_2 P_ ((Lisp_Object (*) (int, Lisp_Object *), int, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object))); +extern Lisp_Object internal_condition_case_2 P_ ((Lisp_Object (*) (Lisp_Object, Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object))); +extern Lisp_Object internal_condition_case_n P_ ((Lisp_Object (*) (int, Lisp_Object *), int, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object))); extern void specbind P_ ((Lisp_Object, Lisp_Object)); extern void record_unwind_protect P_ ((Lisp_Object (*) (Lisp_Object), Lisp_Object)); extern Lisp_Object unbind_to P_ ((int, Lisp_Object)); @@ -3059,7 +3060,7 @@ EXFUN (Fread_file_name, 6); extern Lisp_Object close_file_unwind P_ ((Lisp_Object)); extern void report_file_error P_ ((const char *, Lisp_Object)) NO_RETURN; -extern int internal_delete_file P_ ((Lisp_Object)); +extern int internal_delete_file P_ ((Lisp_Object, Lisp_Object)); extern void syms_of_fileio P_ ((void)); extern Lisp_Object make_temp_name P_ ((Lisp_Object, int)); EXFUN (Fmake_symbolic_link, 3); === modified file 'src/xdisp.c' --- src/xdisp.c 2010-05-01 18:11:20 +0000 +++ src/xdisp.c 2010-05-03 15:01:21 +0000 @@ -2451,7 +2451,7 @@ specbind (Qinhibit_redisplay, Qt); /* Use Qt to ensure debugger does not run, so there is no possibility of wanting to redisplay. */ - val = internal_condition_case_2 (Ffuncall, nargs, args, Qt, + val = internal_condition_case_n (Ffuncall, nargs, args, Qt, safe_eval_handler); UNGCPRO; val = unbind_to (count, val); ------------------------------------------------------------ revno: 100126 committer: Juanma Barranquero branch nick: trunk timestamp: Mon 2010-05-03 14:46:56 +0200 message: Fix typo. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-05-03 02:29:46 +0000 +++ lisp/ChangeLog 2010-05-03 12:46:56 +0000 @@ -22,7 +22,7 @@ * simple.el (with-wrapper-hook): Move. (buffer-substring-filters): Mark obsolete. (filter-buffer-substring-functions): New variable. - (buffer-substring-filters): Use it. Remove unused arg `noprops'. + (filter-buffer-substring): Use it. Remove unused arg `noprops'. Use a mode-line spec rather than a static string in Semantic. * cedet/semantic/util-modes.el: ------------------------------------------------------------ revno: 100125 committer: Glenn Morris branch nick: trunk timestamp: Sun 2010-05-02 23:23:01 -0700 message: Fix some ChangeLog attributions. diff: === modified file 'lisp/org/ChangeLog' --- lisp/org/ChangeLog 2010-05-03 02:29:46 +0000 +++ lisp/org/ChangeLog 2010-05-03 06:23:01 +0000 @@ -109,8 +109,6 @@ (org-html-entities): Constant removed. (org-export-visible): Add the new export commands. - * org-entities.el: New file. - * org-docbook.el (org-docbook-do-expand): Use new entity code. * org-ascii.el (org-export-ascii-entities): New variable. @@ -121,6 +119,11 @@ (org-ascii-replace-entities): New function. 2010-04-10 Carsten Dominik + Ulf Stegemann + + * org-entities.el: New file. + +2010-04-10 Carsten Dominik * org-html.el (org-html-level-start): Catch the case that target might be nil. @@ -824,6 +827,10 @@ * org-latex.el (org-export-latex-treat-backslash-char): Do not by accident protect a character that is before a backslash. +2010-04-10 Paul Sexton + + * org-ctags.el: New file. + 2010-04-10 Carsten Dominik * org-agenda.el (org-diary-class): Use @@ -1102,9 +1109,7 @@ * org-exp.el (org-export-select-backend-specific-text): Add the special beamer tags. - * org-beamer.el - (org-export-preprocess-before-selecting-backend-code-hook): New - file. + * org-beamer.el: New file. * org-latex.el (org-export-latex-after-initial-vars-hook): New hook. (org-export-as-latex): Run ------------------------------------------------------------ revno: 100124 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2010-05-02 22:29:46 -0400 message: Use define-minor-mode where applicable. * mh-show.el (mh-showing-mode): Move function to mh-e.el. * mh-e.el (mh-showing-mode): * url-dired.el (url-dired-minor-mode): * org-table.el (orgtbl-mode): * view.el (view-mode): * type-break.el (type-break-query-mode) (type-break-mode-line-message-mode): * textmodes/reftex.el (reftex-mode): * term/vt100.el (vt100-wide-mode): * tar-mode.el (tar-subfile-mode): * savehist.el (savehist-mode): * ibuf-ext.el (ibuffer-auto-mode): * composite.el (auto-composition-mode): * progmodes/vhdl-mode.el (vhdl-electric-mode, vhdl-stutter-mode): Use define-minor-mode. (vhdl-mode): Use static mode-line format. (vhdl-mode-line-update): Delete. (vhdl-create-mode-menu, vhdl-activate-customizations) (vhdl-hs-minor-mode): Don't bother calling it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-05-02 05:56:30 +0000 +++ lisp/ChangeLog 2010-05-03 02:29:46 +0000 @@ -1,3 +1,22 @@ +2010-05-03 Stefan Monnier + + Use define-minor-mode where applicable. + * view.el (view-mode): + * type-break.el (type-break-query-mode) + (type-break-mode-line-message-mode): + * textmodes/reftex.el (reftex-mode): + * term/vt100.el (vt100-wide-mode): + * tar-mode.el (tar-subfile-mode): + * savehist.el (savehist-mode): + * ibuf-ext.el (ibuffer-auto-mode): + * composite.el (auto-composition-mode): + * progmodes/vhdl-mode.el (vhdl-electric-mode, vhdl-stutter-mode): + Use define-minor-mode. + (vhdl-mode): Use static mode-line format. + (vhdl-mode-line-update): Delete. + (vhdl-create-mode-menu, vhdl-activate-customizations) + (vhdl-hs-minor-mode): Don't bother calling it. + 2010-05-02 Stefan Monnier * simple.el (with-wrapper-hook): Move. === modified file 'lisp/composite.el' --- lisp/composite.el 2010-05-01 18:53:23 +0000 +++ lisp/composite.el 2010-05-03 02:29:46 +0000 @@ -745,14 +745,13 @@ (setq func 'compose-gstring-for-terminal)) (funcall func gstring)))) -(make-variable-buffer-local 'auto-composition-mode) (put 'auto-composition-mode 'permanent-local t) (make-variable-buffer-local 'auto-composition-function) (setq-default auto-composition-function 'auto-compose-chars) ;;;###autoload -(defun auto-composition-mode (&optional arg) +(define-minor-mode auto-composition-mode "Toggle Auto Composition mode. With ARG, turn Auto Composition mode off if and only if ARG is a non-positive number; if ARG is nil, toggle Auto Composition mode; anything else turns Auto @@ -762,12 +761,7 @@ by functions registered in `composition-function-table' (which see). You can use `global-auto-composition-mode' to turn on -Auto Composition mode in all buffers (this is the default)." - (interactive "P") - (setq auto-composition-mode - (if arg - (or (not (integerp arg)) (> arg 0)) - (not auto-composition-mode)))) +Auto Composition mode in all buffers (this is the default).") ;;;###autoload (defun global-auto-composition-mode (&optional arg) === modified file 'lisp/ibuf-ext.el' --- lisp/ibuf-ext.el 2010-01-13 08:35:10 +0000 +++ lisp/ibuf-ext.el 2010-05-03 02:29:46 +0000 @@ -91,11 +91,6 @@ (defvar ibuffer-tmp-show-regexps nil "A list of regexps which should match buffer names to always show.") -(defvar ibuffer-auto-mode nil - "If non-nil, Ibuffer auto-mode should be enabled for this buffer. -Do not set this variable directly! Use the function -`ibuffer-auto-mode' instead.") - (defvar ibuffer-auto-buffers-changed nil) (defcustom ibuffer-saved-filters '(("gnus" @@ -220,6 +215,16 @@ (ibuffer-included-in-filters-p buf ibuffer-filtering-qualifiers) (ibuffer-buf-matches-predicates buf ibuffer-always-show-predicates))))) +;;;###autoload +(define-minor-mode ibuffer-auto-mode + "Toggle use of Ibuffer's auto-update facility. +With numeric ARG, enable auto-update if and only if ARG is positive." + nil nil nil + (unless (derived-mode-p 'ibuffer-mode) + (error "This buffer is not in Ibuffer mode")) + (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed) ; Initialize state vector + (add-hook 'post-command-hook 'ibuffer-auto-update-changed)) + (defun ibuffer-auto-update-changed () (when (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed) (dolist (buf (buffer-list)) @@ -230,20 +235,6 @@ (ibuffer-update nil t))))))) ;;;###autoload -(defun ibuffer-auto-mode (&optional arg) - "Toggle use of Ibuffer's auto-update facility. -With numeric ARG, enable auto-update if and only if ARG is positive." - (interactive) - (unless (derived-mode-p 'ibuffer-mode) - (error "This buffer is not in Ibuffer mode")) - (set (make-local-variable 'ibuffer-auto-mode) - (if arg - (plusp arg) - (not ibuffer-auto-mode))) - (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed) ; Initialize state vector - (add-hook 'post-command-hook 'ibuffer-auto-update-changed)) - -;;;###autoload (defun ibuffer-mouse-filter-by-mode (event) "Enable or disable filtering by the major mode chosen via mouse." (interactive "e") === modified file 'lisp/mh-e/ChangeLog' --- lisp/mh-e/ChangeLog 2010-03-24 18:02:56 +0000 +++ lisp/mh-e/ChangeLog 2010-05-03 02:29:46 +0000 @@ -1,3 +1,8 @@ +2010-05-03 Stefan Monnier + + * mh-show.el (mh-showing-mode): Move function to mh-e.el. + * mh-e.el (mh-showing-mode): Use define-minor-mode. + 2010-03-24 Juanma Barranquero * mh-scan.el (mh-scan-cmd-note-width): Doc fix. === modified file 'lisp/mh-e/mh-e.el' --- lisp/mh-e/mh-e.el 2010-01-13 08:35:10 +0000 +++ lisp/mh-e/mh-e.el 2010-05-03 02:29:46 +0000 @@ -287,8 +287,10 @@ (defvar mh-show-buffer nil "Buffer that displays message for this folder.") -(defvar mh-showing-mode nil - "If non-nil, show the message in a separate window.") +(define-minor-mode mh-showing-mode + "Minor mode to show the message in a separate window." + ;; FIXME: maybe this should be moved to mh-show.el. + :lighter " Show") (defvar mh-view-ops nil "Stack of operations that change the folder view. === modified file 'lisp/mh-e/mh-show.el' --- lisp/mh-e/mh-show.el 2010-01-13 08:35:10 +0000 +++ lisp/mh-e/mh-show.el 2010-05-03 02:29:46 +0000 @@ -170,16 +170,6 @@ (run-hooks 'mh-show-hook))) ;;;###mh-autoload -(defun mh-showing-mode (&optional arg) - "Change whether messages should be displayed. - -With ARG, display messages if ARG is positive, otherwise don't display them." - (setq mh-showing-mode - (if (null arg) - (not mh-showing-mode) - (> (prefix-numeric-value arg) 0)))) - -;;;###mh-autoload (defun mh-start-of-uncleaned-message () "Position uninteresting headers off the top of the window." (let ((case-fold-search t)) === modified file 'lisp/org/ChangeLog' --- lisp/org/ChangeLog 2010-04-15 10:11:52 +0000 +++ lisp/org/ChangeLog 2010-05-03 02:29:46 +0000 @@ -1,8 +1,11 @@ +2010-05-03 Stefan Monnier + + * org-table.el (orgtbl-mode): Use define-minor-mode. + 2010-04-10 Carsten Dominik - * org.el (org-insert-link): Find the link buffer on visible - frames. - (org-export-latex-default-packages-alist): hyperref must be loaded + * org.el (org-insert-link): Find the link buffer on visible frames. + (org-export-latex-default-packages-alist): Hyperref must be loaded late. (org-open-file): More care with the new matching for file links. === modified file 'lisp/org/org-table.el' --- lisp/org/org-table.el 2010-04-15 10:11:52 +0000 +++ lisp/org/org-table.el 2010-05-03 02:29:46 +0000 @@ -3401,11 +3401,6 @@ ;; active, this binding is ignored inside tables and replaced with a ;; modified self-insert. -(defvar orgtbl-mode nil - "Variable controlling `orgtbl-mode', a minor mode enabling the `org-mode' -table editor in arbitrary modes.") -(make-variable-buffer-local 'orgtbl-mode) - (defvar orgtbl-mode-map (make-keymap) "Keymap for `orgtbl-mode'.") @@ -3426,49 +3421,51 @@ 0 (quote 'org-table) 'prepend)) "Extra font-lock-keywords to be added when orgtbl-mode is active.") +;; Install it as a minor mode. +(put 'orgtbl-mode :included t) +(put 'orgtbl-mode :menu-tag "Org Table Mode") ;;;###autoload -(defun orgtbl-mode (&optional arg) +(define-minor-mode orgtbl-mode "The `org-mode' table editor as a minor mode for use in other modes." - (interactive) + :lighter " OrgTbl" :keymap orgtbl-mode-map (org-load-modules-maybe) - (if (org-mode-p) - ;; Exit without error, in case some hook functions calls this - ;; by accident in org-mode. - (message "Orgtbl-mode is not useful in org-mode, command ignored") - (setq orgtbl-mode - (if arg (> (prefix-numeric-value arg) 0) (not orgtbl-mode))) - (if orgtbl-mode - (progn - (and (orgtbl-setup) (defun orgtbl-setup () nil)) - ;; Make sure we are first in minor-mode-map-alist - (let ((c (assq 'orgtbl-mode minor-mode-map-alist))) - (and c (setq minor-mode-map-alist - (cons c (delq c minor-mode-map-alist))))) - (org-set-local (quote org-table-may-need-update) t) - (org-add-hook 'before-change-functions 'org-before-change-function - nil 'local) - (org-set-local 'org-old-auto-fill-inhibit-regexp - auto-fill-inhibit-regexp) - (org-set-local 'auto-fill-inhibit-regexp - (if auto-fill-inhibit-regexp - (concat orgtbl-line-start-regexp "\\|" - auto-fill-inhibit-regexp) - orgtbl-line-start-regexp)) - (org-add-to-invisibility-spec '(org-cwidth)) - (when (fboundp 'font-lock-add-keywords) - (font-lock-add-keywords nil orgtbl-extra-font-lock-keywords) - (org-restart-font-lock)) - (easy-menu-add orgtbl-mode-menu) - (run-hooks 'orgtbl-mode-hook)) - (setq auto-fill-inhibit-regexp org-old-auto-fill-inhibit-regexp) - (org-table-cleanup-narrow-column-properties) - (org-remove-from-invisibility-spec '(org-cwidth)) - (remove-hook 'before-change-functions 'org-before-change-function t) - (when (fboundp 'font-lock-remove-keywords) - (font-lock-remove-keywords nil orgtbl-extra-font-lock-keywords) - (org-restart-font-lock)) - (easy-menu-remove orgtbl-mode-menu) - (force-mode-line-update 'all)))) + (cond + ((org-mode-p) + ;; Exit without error, in case some hook functions calls this + ;; by accident in org-mode. + (message "Orgtbl-mode is not useful in org-mode, command ignored")) + (orgtbl-mode + (and (orgtbl-setup) (defun orgtbl-setup () nil)) ;; FIXME: Yuck!?! + ;; Make sure we are first in minor-mode-map-alist + (let ((c (assq 'orgtbl-mode minor-mode-map-alist))) + ;; FIXME: maybe it should use emulation-mode-map-alists? + (and c (setq minor-mode-map-alist + (cons c (delq c minor-mode-map-alist))))) + (org-set-local (quote org-table-may-need-update) t) + (org-add-hook 'before-change-functions 'org-before-change-function + nil 'local) + (org-set-local 'org-old-auto-fill-inhibit-regexp + auto-fill-inhibit-regexp) + (org-set-local 'auto-fill-inhibit-regexp + (if auto-fill-inhibit-regexp + (concat orgtbl-line-start-regexp "\\|" + auto-fill-inhibit-regexp) + orgtbl-line-start-regexp)) + (org-add-to-invisibility-spec '(org-cwidth)) + (when (fboundp 'font-lock-add-keywords) + (font-lock-add-keywords nil orgtbl-extra-font-lock-keywords) + (org-restart-font-lock)) + (easy-menu-add orgtbl-mode-menu)) + (t + (setq auto-fill-inhibit-regexp org-old-auto-fill-inhibit-regexp) + (org-table-cleanup-narrow-column-properties) + (org-remove-from-invisibility-spec '(org-cwidth)) + (remove-hook 'before-change-functions 'org-before-change-function t) + (when (fboundp 'font-lock-remove-keywords) + (font-lock-remove-keywords nil orgtbl-extra-font-lock-keywords) + (org-restart-font-lock)) + (easy-menu-remove orgtbl-mode-menu) + (force-mode-line-update 'all)))) (defun org-table-cleanup-narrow-column-properties () "Remove all properties related to narrow-column invisibility." @@ -3483,11 +3480,6 @@ (while (setq s (text-property-any s (point-max) 'invisible 'org-cwidth)) (remove-text-properties s (1+ s) '(invisible t))))) -;; Install it as a minor mode. -(put 'orgtbl-mode :included t) -(put 'orgtbl-mode :menu-tag "Org Table Mode") -(add-minor-mode 'orgtbl-mode " OrgTbl" orgtbl-mode-map) - (defun orgtbl-make-binding (fun n &rest keys) "Create a function for binding in the table minor mode. FUN is the command to call inside a table. N is used to create a unique === modified file 'lisp/progmodes/vhdl-mode.el' --- lisp/progmodes/vhdl-mode.el 2010-01-13 08:35:10 +0000 +++ lisp/progmodes/vhdl-mode.el 2010-05-03 02:29:46 +0000 @@ -199,21 +199,6 @@ "Customizations for modes." :group 'vhdl) -(defcustom vhdl-electric-mode t - "*Non-nil enables electrification (automatic template generation). -If nil, template generators can still be invoked through key bindings and -menu. Is indicated in the modeline by \"/e\" after the mode name and can be -toggled by `\\[vhdl-electric-mode]'." - :type 'boolean - :group 'vhdl-mode) - -(defcustom vhdl-stutter-mode t - "*Non-nil enables stuttering. -Is indicated in the modeline by \"/s\" after the mode name and can be toggled -by `\\[vhdl-stutter-mode]'." - :type 'boolean - :group 'vhdl-mode) - (defcustom vhdl-indent-tabs-mode nil "*Non-nil means indentation can insert tabs. Overrides local variable `indent-tabs-mode'." @@ -3466,13 +3451,11 @@ ("Mode" ["Electric Mode" (progn (customize-set-variable 'vhdl-electric-mode - (not vhdl-electric-mode)) - (vhdl-mode-line-update)) + (not vhdl-electric-mode))) :style toggle :selected vhdl-electric-mode :keys "C-c C-m C-e"] ["Stutter Mode" (progn (customize-set-variable 'vhdl-stutter-mode - (not vhdl-stutter-mode)) - (vhdl-mode-line-update)) + (not vhdl-stutter-mode))) :style toggle :selected vhdl-stutter-mode :keys "C-c C-m C-s"] ["Indent Tabs Mode" (progn (customize-set-variable 'vhdl-indent-tabs-mode @@ -4670,7 +4653,10 @@ (interactive) (kill-all-local-variables) (setq major-mode 'vhdl-mode) - (setq mode-name "VHDL") + (setq mode-name '("VHDL" + (vhdl-electric-mode "/" (vhdl-stutter-mode "/")) + (vhdl-electric-mode "e") + (vhdl-stutter-mode "s"))) ;; set maps and tables (use-local-map vhdl-mode-map) @@ -4737,7 +4723,6 @@ ;; miscellaneous (vhdl-ps-print-init) (vhdl-write-file-hooks-init) - (vhdl-mode-line-update) (message "VHDL Mode %s.%s" vhdl-version (if noninteractive "" " See menu for documentation and release notes.")) @@ -4757,8 +4742,7 @@ (vhdl-write-file-hooks-init) (vhdl-update-mode-menu) (vhdl-hideshow-init) - (run-hooks 'menu-bar-update-hook) - (vhdl-mode-line-update)) + (run-hooks 'menu-bar-update-hook)) (defun vhdl-write-file-hooks-init () "Add/remove hooks when buffer is saved." @@ -8055,31 +8039,15 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Enabling/disabling -(defun vhdl-mode-line-update () - "Update the modeline string for VHDL major mode." - (setq mode-name (concat "VHDL" - (and (or vhdl-electric-mode vhdl-stutter-mode) "/") - (and vhdl-electric-mode "e") - (and vhdl-stutter-mode "s"))) - (force-mode-line-update t)) - -(defun vhdl-electric-mode (arg) +(define-minor-mode vhdl-electric-mode "Toggle VHDL electric mode. Turn on if ARG positive, turn off if ARG negative, toggle if ARG zero or nil." - (interactive "P") - (setq vhdl-electric-mode - (cond ((or (not arg) (zerop arg)) (not vhdl-electric-mode)) - ((> arg 0) t) (t nil))) - (vhdl-mode-line-update)) + :global t) -(defun vhdl-stutter-mode (arg) +(define-minor-mode vhdl-stutter-mode "Toggle VHDL stuttering mode. Turn on if ARG positive, turn off if ARG negative, toggle if ARG zero or nil." - (interactive "P") - (setq vhdl-stutter-mode - (cond ((or (not arg) (zerop arg)) (not vhdl-stutter-mode)) - ((> arg 0) t) (t nil))) - (vhdl-mode-line-update)) + :global t) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Stuttering @@ -12533,7 +12501,7 @@ (add-hook 'hs-minor-mode-hook 'hs-hide-all) (remove-hook 'hs-minor-mode-hook 'hs-hide-all)) (hs-minor-mode arg) - (vhdl-mode-line-update))) ; hack to update menu bar + (force-mode-line-update))) ; hack to update menu bar ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; === modified file 'lisp/savehist.el' --- lisp/savehist.el 2010-01-13 08:35:10 +0000 +++ lisp/savehist.el 2010-05-03 02:29:46 +0000 @@ -59,17 +59,6 @@ :version "22.1" :group 'minibuffer) -;;;###autoload -(defcustom savehist-mode nil - "Mode for automatic saving of minibuffer history. -Set this by calling the `savehist-mode' function or using the customize -interface." - :type 'boolean - :set (lambda (symbol value) (savehist-mode (or value 0))) - :initialize 'custom-initialize-default - :require 'savehist - :group 'savehist) - (defcustom savehist-save-minibuffer-history t "If non-nil, save all recorded minibuffer histories. If you want to save only specific histories, use `savehist-save-hook' to @@ -181,7 +170,7 @@ ;; Functions. ;;;###autoload -(defun savehist-mode (arg) +(define-minor-mode savehist-mode "Toggle savehist-mode. Positive ARG turns on `savehist-mode'. When on, savehist-mode causes minibuffer history to be saved periodically and when exiting Emacs. @@ -191,11 +180,7 @@ This mode should normally be turned on from your Emacs init file. Calling it at any other time replaces your current minibuffer histories, which is probably undesirable." - (interactive "P") - (setq savehist-mode - (if (null arg) - (not savehist-mode) - (> (prefix-numeric-value arg) 0))) + :global t (if (not savehist-mode) (savehist-uninstall) (when (and (not savehist-loaded) @@ -214,11 +199,7 @@ (setq savehist-mode nil) (savehist-uninstall) (signal (car errvar) (cdr errvar))))) - (savehist-install) - (run-hooks 'savehist-mode-hook)) - ;; Return the new setting. - savehist-mode) -(add-minor-mode 'savehist-mode "") + (savehist-install))) (defun savehist-load () "Load the variables stored in `savehist-file' and turn on `savehist-mode'. === modified file 'lisp/tar-mode.el' --- lisp/tar-mode.el 2010-04-18 23:49:58 +0000 +++ lisp/tar-mode.el 2010-05-03 02:29:46 +0000 @@ -137,7 +137,6 @@ (defvar tar-parse-info nil) (defvar tar-superior-buffer nil) (defvar tar-superior-descriptor nil) -(defvar tar-subfile-mode nil) (defvar tar-file-name-coding-system nil) (put 'tar-superior-buffer 'permanent-local t) @@ -672,29 +671,21 @@ (signal (car err) (cdr err))))) -(defun tar-subfile-mode (p) +(define-minor-mode tar-subfile-mode "Minor mode for editing an element of a tar-file. This mode arranges for \"saving\" this buffer to write the data into the tar-file buffer that it came from. The changes will actually appear on disk when you save the tar-file's buffer." - (interactive "P") + ;; Don't do this, because it is redundant and wastes mode line space. + ;; :lighter " TarFile" + nil nil nil (or (and (boundp 'tar-superior-buffer) tar-superior-buffer) (error "This buffer is not an element of a tar file")) - ;; Don't do this, because it is redundant and wastes mode line space. - ;; (or (assq 'tar-subfile-mode minor-mode-alist) - ;; (setq minor-mode-alist (append minor-mode-alist - ;; (list '(tar-subfile-mode " TarFile"))))) - (make-local-variable 'tar-subfile-mode) - (setq tar-subfile-mode - (if (null p) - (not tar-subfile-mode) - (> (prefix-numeric-value p) 0))) (cond (tar-subfile-mode (add-hook 'write-file-functions 'tar-subfile-save-buffer nil t) ;; turn off auto-save. (auto-save-mode -1) - (setq buffer-auto-save-file-name nil) - (run-hooks 'tar-subfile-mode-hook)) + (setq buffer-auto-save-file-name nil)) (t (remove-hook 'write-file-functions 'tar-subfile-save-buffer t)))) === modified file 'lisp/term/vt100.el' --- lisp/term/vt100.el 2010-01-13 08:35:10 +0000 +++ lisp/term/vt100.el 2010-05-03 02:29:46 +0000 @@ -41,19 +41,13 @@ (tty-run-terminal-initialization (selected-frame) "lk201")) ;;; Controlling the screen width. -(defvar vt100-wide-mode (= (frame-width) 132) - "t if vt100 is in 132-column mode.") - -(defun vt100-wide-mode (&optional arg) +(define-minor-mode vt100-wide-mode "Toggle 132/80 column mode for vt100s. With positive argument, switch to 132-column mode. With negative argument, switch to 80-column mode." - (interactive "P") - (setq vt100-wide-mode - (if (null arg) (not vt100-wide-mode) - (> (prefix-numeric-value arg) 0))) - (send-string-to-terminal (if vt100-wide-mode "\e[?3h" "\e[?3l")) - (set-frame-width terminal-frame (if vt100-wide-mode 132 80))) + :global t :initial-value (= (frame-width) 132) + (send-string-to-terminal (if vt100-wide-mode "\e[?3h" "\e[?3l")) + (set-frame-width terminal-frame (if vt100-wide-mode 132 80))) ;; arch-tag: 9ff41f24-a7c9-4dee-9cf2-fbaa951eb840 ;;; vt100.el ends here === modified file 'lisp/textmodes/reftex.el' --- lisp/textmodes/reftex.el 2010-01-13 08:35:10 +0000 +++ lisp/textmodes/reftex.el 2010-05-03 02:29:46 +0000 @@ -305,10 +305,6 @@ (defconst reftex-version "RefTeX version 4.31" "Version string for RefTeX.") -(defvar reftex-mode nil - "Determines if RefTeX mode is active.") -(make-variable-buffer-local 'reftex-mode) - (defvar reftex-mode-map (make-sparse-keymap) "Keymap for RefTeX mode.") @@ -504,8 +500,10 @@ "Turn on RefTeX mode." (reftex-mode t)) +(put 'reftex-mode :included '(memq major-mode '(latex-mode tex-mode))) +(put 'reftex-mode :menu-tag "RefTeX Mode") ;;;###autoload -(defun reftex-mode (&optional arg) +(define-minor-mode reftex-mode "Minor mode with distinct support for \\label, \\ref and \\cite in LaTeX. \\A Table of Contents of the entire (multifile) document with browsing @@ -535,11 +533,7 @@ on the menu bar. ------------------------------------------------------------------------------" - - (interactive "P") - (setq reftex-mode (not (or (and (null arg) reftex-mode) - (<= (prefix-numeric-value arg) 0)))) - + :lighter " Ref" :keymap reftex-mode-map (if reftex-mode (progn ;; Mode was turned on @@ -565,24 +559,10 @@ (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib) (modify-syntax-entry ?\" "." reftex-syntax-table-for-bib) (modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib) - (modify-syntax-entry ?\] "." reftex-syntax-table-for-bib) - - (run-hooks 'reftex-mode-hook)) + (modify-syntax-entry ?\] "." reftex-syntax-table-for-bib)) ;; Mode was turned off (easy-menu-remove reftex-mode-menu))) -(if (fboundp 'add-minor-mode) - ;; Use it so that we get the extras - (progn - (put 'reftex-mode :included '(memq major-mode '(latex-mode tex-mode))) - (put 'reftex-mode :menu-tag "RefTeX Mode") - (add-minor-mode 'reftex-mode " Ref" reftex-mode-map)) - ;; The standard way - (unless (assoc 'reftex-mode minor-mode-alist) - (push '(reftex-mode " Ref") minor-mode-alist)) - (unless (assoc 'reftex-mode minor-mode-map-alist) - (push (cons 'reftex-mode reftex-mode-map) minor-mode-map-alist))) - (defvar reftex-docstruct-symbol) (defun reftex-kill-buffer-hook () "Save RefTeX's parse file for this buffer if the information has changed." @@ -625,11 +605,11 @@ ;;; ;;; Multibuffer Variables ;;; -;;; Technical notes: These work as follows: We keep just one list -;;; of labels for each master file - this can save a lot of memory. -;;; `reftex-master-index-list' is an alist which connects the true file name -;;; of each master file with the symbols holding the information on that -;;; document. Each buffer has local variables which point to these symbols. +;; Technical notes: These work as follows: We keep just one list +;; of labels for each master file - this can save a lot of memory. +;; `reftex-master-index-list' is an alist which connects the true file name +;; of each master file with the symbols holding the information on that +;; document. Each buffer has local variables which point to these symbols. ;; List of variables which handle the multifile stuff. ;; This list is used to tie, untie, and reset these symbols. === modified file 'lisp/type-break.el' --- lisp/type-break.el 2010-01-13 08:35:10 +0000 +++ lisp/type-break.el 2010-05-03 02:29:46 +0000 @@ -152,13 +152,6 @@ :type 'sexp :group 'type-break) -(defcustom type-break-query-mode t - "Non-nil means ask whether or not to prompt user for breaks. -If so, call the function specified in the value of the variable -`type-break-query-function' to do the asking." - :type 'boolean - :group 'type-break) - (defcustom type-break-query-function 'yes-or-no-p "Function to use for making query for a typing break. It should take a string as an argument, the prompt. @@ -245,14 +238,6 @@ ;; Mode line frobs -(defcustom type-break-mode-line-message-mode nil - "Non-nil means put type-break related messages in the mode line. -Otherwise, messages typically go in the echo area. - -See also `type-break-mode-line-format' and its members." - :type 'boolean - :group 'type-break) - (defvar type-break-mode-line-format '(type-break-mode-line-message-mode ("" @@ -447,7 +432,7 @@ (message "Type Break mode is disabled"))))) type-break-mode) -(defun type-break-mode-line-message-mode (&optional prefix) +(define-minor-mode type-break-mode-line-message-mode "Enable or disable warnings in the mode line about typing breaks. A negative PREFIX argument disables this mode. @@ -462,16 +447,9 @@ `global-mode-string' `type-break-mode-line-break-message' `type-break-mode-line-warning'" - (interactive "P") - (setq type-break-mode-line-message-mode - (>= (prefix-numeric-value prefix) 0)) - (and (called-interactively-p 'interactive) - (if type-break-mode-line-message-mode - (message "type-break-mode-line-message-mode is enabled") - (message "type-break-mode-line-message-mode is disabled"))) - type-break-mode-line-message-mode) + :global t) -(defun type-break-query-mode (&optional prefix) +(define-minor-mode type-break-query-mode "Enable or disable warnings in the mode line about typing breaks. When enabled, the user is periodically queried about whether to take a @@ -483,14 +461,7 @@ The user may also enable or disable this mode simply by setting the variable of the same name." - (interactive "P") - (setq type-break-query-mode - (>= (prefix-numeric-value prefix) 0)) - (and (called-interactively-p 'interactive) - (if type-break-query-mode - (message "type-break-query-mode is enabled") - (message "type-break-query-mode is disabled"))) - type-break-query-mode) + :global t) ;;; session file functions === modified file 'lisp/url/ChangeLog' --- lisp/url/ChangeLog 2010-03-25 01:14:42 +0000 +++ lisp/url/ChangeLog 2010-05-03 02:29:46 +0000 @@ -1,3 +1,7 @@ +2010-05-03 Stefan Monnier + + * url-dired.el (url-dired-minor-mode): Use define-minor-mode. + 2010-03-24 Teodor Zlatanov * url-http.el (url-http-parse-headers): Fix wrong variable name. === modified file 'lisp/url/url-dired.el' --- lisp/url/url-dired.el 2010-01-13 08:35:10 +0000 +++ lisp/url/url-dired.el 2010-05-03 02:29:46 +0000 @@ -31,11 +31,6 @@ map) "Keymap used when browsing directories.") -(defvar url-dired-minor-mode nil - "Whether we are in url-dired-minor-mode.") - -(make-variable-buffer-local 'url-dired-minor-mode) - (defun url-dired-find-file () "In dired, visit the file or directory named on this line." (interactive) @@ -48,39 +43,9 @@ (mouse-set-point event) (url-dired-find-file)) -(defun url-dired-minor-mode (&optional arg) +(define-minor-mode url-dired-minor-mode "Minor mode for directory browsing." - (interactive "P") - (cond - ((null arg) - (setq url-dired-minor-mode (not url-dired-minor-mode))) - ((equal 0 arg) - (setq url-dired-minor-mode nil)) - (t - (setq url-dired-minor-mode t)))) - -(if (not (fboundp 'add-minor-mode)) - (defun add-minor-mode (toggle name &optional keymap after toggle-fun) - "Add a minor mode to `minor-mode-alist' and `minor-mode-map-alist'. -TOGGLE is a symbol which is used as the variable which toggle the minor mode, -NAME is the name that should appear in the modeline (it should be a string -beginning with a space), KEYMAP is a keymap to make active when the minor -mode is active, and AFTER is the toggling symbol used for another minor -mode. If AFTER is non-nil, then it is used to position the new mode in the -minor-mode alists. TOGGLE-FUN specifies an interactive function that -is called to toggle the mode on and off; this affects what appens when -button2 is pressed on the mode, and when button3 is pressed somewhere -in the list of modes. If TOGGLE-FUN is nil and TOGGLE names an -interactive function, TOGGLE is used as the toggle function. - -Example: (add-minor-mode 'view-minor-mode \" View\" view-mode-map)" - (if (not (assq toggle minor-mode-alist)) - (setq minor-mode-alist (cons (list toggle name) minor-mode-alist))) - (if (and keymap (not (assq toggle minor-mode-map-alist))) - (setq minor-mode-map-alist (cons (cons toggle keymap) - minor-mode-map-alist))))) - -(add-minor-mode 'url-dired-minor-mode " URL" url-dired-minor-mode-map) + :lighter " URL" :keymap url-dired-minor-mode-map) (defun url-find-file-dired (dir) "\"Edit\" directory DIR, but with additional URL-friendly bindings." === modified file 'lisp/view.el' --- lisp/view.el 2010-04-18 23:49:58 +0000 +++ lisp/view.el 2010-05-03 02:29:46 +0000 @@ -161,14 +161,6 @@ "Overlay used to display where a search operation found its match. This is local in each buffer, once it is used.") (make-variable-buffer-local 'view-overlay) - -(unless (assq 'view-mode minor-mode-alist) - (setq minor-mode-alist - (cons (list 'view-mode - (propertize " View" - 'local-map mode-line-minor-mode-keymap - 'help-echo "mouse-3: minor mode menu")) - minor-mode-alist))) ;; Define keymap inside defvar to make it easier to load changes. ;; Some redundant "less"-like key bindings below have been commented out. @@ -230,10 +222,6 @@ (define-key map "?" 'describe-mode) ; Maybe do as less instead? See above. (define-key map "h" 'describe-mode) map)) - -(or (assq 'view-mode minor-mode-map-alist) - (setq minor-mode-map-alist - (cons (cons 'view-mode view-mode-map) minor-mode-map-alist))) ;;; Commands that enter or exit view mode. @@ -393,7 +381,7 @@ exit-action))) ;;;###autoload -(defun view-mode (&optional arg) +(define-minor-mode view-mode ;; In the following documentation string we have to use some explicit key ;; bindings instead of using the \\[] construction. The reason for this ;; is that most commands have more than one key binding. @@ -473,11 +461,8 @@ then \\[View-leave], \\[View-quit] and \\[View-kill-and-leave] will return to that buffer. Entry to view-mode runs the normal hook `view-mode-hook'." - (interactive "P") - (unless (and arg ; Do nothing if already OK. - (if (> (prefix-numeric-value arg) 0) view-mode (not view-mode))) - (if view-mode (view-mode-disable) - (view-mode-enable)))) + :lighter " View" :keymap view-mode-map + (if view-mode (view-mode-enable) (view-mode-disable))) (defun view-mode-enable () "Turn on View mode."