]> code.delx.au - gnu-emacs/commitdiff
Merge from emacs--devo--0
authorMiles Bader <miles@gnu.org>
Fri, 19 Oct 2007 00:00:21 +0000 (00:00 +0000)
committerMiles Bader <miles@gnu.org>
Fri, 19 Oct 2007 00:00:21 +0000 (00:00 +0000)
Patches applied:

 * emacs--devo--0  (patch 890-898)

   - Update from CVS
   - Merge from emacs--rel--22

 * emacs--rel--22  (patch 122-128)

   - Update from CVS
   - Merge from gnus--rel--5.10

 * gnus--rel--5.10  (patch 257-258)

   - Merge from emacs--rel--22
   - Update from CVS

Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-270

92 files changed:
ChangeLog
FTP [deleted file]
admin/ChangeLog
admin/make-emacs
admin/nt/makedist.bat
configure
configure.in
doc/emacs/ChangeLog
doc/emacs/basic.texi
doc/emacs/building.texi
doc/emacs/calendar.texi
doc/emacs/custom.texi
doc/emacs/fixit.texi
doc/emacs/frames.texi
doc/emacs/glossary.texi
doc/emacs/text.texi
doc/emacs/trouble.texi
doc/lispref/ChangeLog
doc/lispref/text.texi
etc/NEWS
etc/NEWS.22
etc/PROBLEMS
lisp/ChangeLog
lisp/bindings.el
lisp/bs.el
lisp/dired.el
lisp/doc-view.el
lisp/emacs-lisp/advice.el
lisp/emacs-lisp/find-func.el
lisp/emerge.el
lisp/eshell/esh-cmd.el
lisp/faces.el
lisp/files.el
lisp/filesets.el
lisp/gnus/ChangeLog
lisp/gnus/gnus-sum.el
lisp/gnus/gnus-util.el
lisp/gnus/gnus-win.el
lisp/help-fns.el
lisp/ibuf-ext.el
lisp/indent.el
lisp/international/encoded-kb.el
lisp/loadhist.el
lisp/longlines.el
lisp/mail/sendmail.el
lisp/net/tramp.el
lisp/progmodes/cc-menus.el
lisp/progmodes/compile.el
lisp/progmodes/delphi.el
lisp/server.el
lisp/simple.el
lisp/term/xterm.el
lisp/textmodes/artist.el
lisp/textmodes/fill.el
lisp/textmodes/ispell.el
lisp/textmodes/org.el
lisp/time.el
lisp/tutorial.el
lisp/vc-hooks.el
lisp/vc.el
lisp/xt-mouse.el
nt/ChangeLog
nt/makefile.w32-in
src/ChangeLog
src/alloc.c
src/buffer.c
src/coding.c
src/config.in
src/data.c
src/dired.c
src/doc.c
src/eval.c
src/fileio.c
src/fns.c
src/frame.c
src/keyboard.c
src/keymap.c
src/lisp.h
src/lread.c
src/macfns.c
src/macselect.c
src/macterm.c
src/minibuf.c
src/print.c
src/process.c
src/textprop.c
src/w32fns.c
src/w32menu.c
src/window.c
src/xdisp.c
src/xfns.c
src/xselect.c

index f771639cb3d0937433d7125e3393cf6ba92221d4..387fcfc73f62aa3a12456f35b6384a7d2cec4893 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-10-17  Chong Yidong  <cyd@stupidchicken.com>
+
+       * configure.in (HAVE_RES_INIT): Define if res_init() exists.
+       (HAVE_LIBRESOLV): Also define if we are using res_init().
+
+2007-10-17  Glenn Morris  <rgm@gnu.org>
+
+       * FTP: Remove file, since it's just a duplicate of one in etc/.
+
 2007-10-05  Eli Zaretskii  <eliz@gnu.org>
 
        * config.bat: Fix configuring `doc' due to changes in the
diff --git a/FTP b/FTP
deleted file mode 100644 (file)
index 0337d46..0000000
--- a/FTP
+++ /dev/null
@@ -1,6 +0,0 @@
-For information about how to obtain GNU Emacs and other GNU software
-by FTP, please see <http://www.gnu.org/order/ftp.html>.
-
-Information about Emacs is also available at
-<http://www.gnu.org/software/emacs/>.
-
index 10cec99a09b98ac2243957a7bfe22157997bd18b..e73eb21327cd42dee7aa19baac5c1cf1024214c8 100644 (file)
@@ -1,3 +1,7 @@
+2007-10-17  Juanma Barranquero  <lekktu@gmail.com>
+
+       * make-emacs: Doc fix.
+
 2007-08-28  Glenn Morris  <rgm@gnu.org>
 
        * admin.el: Provide self.
 2005-10-17  Bill Wohler  <wohler@newt.com>
 
        * FOR-RELEASE (DOCUMENTATION): Removed lisp/toolbar from list
-       since it's gone. Also marked mh-e as done.
+       since it's gone.  Also marked mh-e as done.
 
 2005-10-11  Juanma Barranquero  <lekktu@gmail.com>
 
 
 2005-03-30  Marcelo Toledo  <marcelo@marcelotoledo.org>
 
-       * FOR-RELEASE (Documentation): Added check the Emacs Tutorial. The
-        first line of every tutorial must begin with a sentence saying
-        "Emacs Tutorial" in the respective language.  This should be
-        followed by "See end for copying conditions", likewise in the
-        respective language.
+       * FOR-RELEASE (Documentation): Added check the Emacs Tutorial.
+       The first line of every tutorial must begin with a sentence saying
+       "Emacs Tutorial" in the respective language.  This should be
+       followed by "See end for copying conditions", likewise in the
+       respective language.
 
 2005-03-29  Luc Teirlinck  <teirllm@auburn.edu>
 
index 23b4e1c637482915036277cead3c44bccba2a0be..94bf2092a8b19a3d2582981d52c66f8e88b834cb 100755 (executable)
@@ -68,7 +68,7 @@ Build Emacs.
  --help                        show this help
  --all                 make clean versionclean first
  --boot                        make boostrap, log to boot.log
- --enable-checking     ENABLE_CHECKING=1 (implies Lisp union type)
+ --enable-checking     ENABLE_CHECKING=1
  --no-warn             disable warnings
  --check-marked                GC_CHECK_MARKED_OBJECTS=1
  --optim               no debug defines
index 5afef00e9b31e3bc5cb05f8fba9711bbfe9fa478..db9446db36e4bbd797564ddead3029bdecb3bfbc 100755 (executable)
@@ -35,8 +35,8 @@ copy %3\README.W32 emacs-%1\README.W32
 rem Info-ZIP zip seems to be broken on Windows.\r
 rem It always writes to zip.zip and treats the zipfile argument as one\r
 rem of the files to go in it.\r
-rem zip -9 -r %2-bin-i386 emacs-%1/BUGS emacs-%1/README emacs-%1/README.W32 emacs-%1/INSTALL emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp emacs-%1/leim -x emacs.mdp *.pdb *.opt *~ CVS\r
-7z a -tZIP -mx=9 -xr!emacs.mdp -xr!*.pdb -xr!*.opt -xr!*~ -xr!CVS -xr!.arch-inventory %2-bin-i386.zip emacs-%1/BUGS emacs-%1/README emacs-%1/README.W32 emacs-%1/INSTALL emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp emacs-%1/leim emacs-%1/site-lisp\r
+rem zip -9 -r %2-bin-i386 emacs-%1/BUGS emacs-%1/COPYING emacs-%1/README emacs-%1/README.W32 emacs-%1/INSTALL emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp emacs-%1/leim -x emacs.mdp *.pdb *.opt *~ CVS\r
+7z a -tZIP -mx=9 -xr!emacs.mdp -xr!*.pdb -xr!*.opt -xr!*~ -xr!CVS -xr!.arch-inventory %2-bin-i386.zip emacs-%1/BUGS emacs-%1/COPYING emacs-%1/README emacs-%1/README.W32 emacs-%1/INSTALL emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp emacs-%1/leim emacs-%1/site-lisp\r
 del emacs-%1\README.W32\r
 if not (%4) == () goto end\r
 \r
@@ -49,8 +49,8 @@ copy %3\dump.bat emacs-%1\bin\dump.bat
 rem Info-ZIP zip seems to be broken on Windows.\r
 rem It always writes to zip.zip and treats the zipfile argument as one\r
 rem of the files to go in it.\r
-rem zip -9 -r %2-barebin-i386.zip emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc/DOC-X\r
-7z a -tZIP -mx=9 %2-barebin-i386.zip emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc/DOC-X\r
+rem zip -9 -r %2-barebin-i386.zip emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc/DOC-X emacs-%1/COPYING\r
+7z a -tZIP -mx=9 %2-barebin-i386.zip emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc/DOC-X emacs-%1/COPYING\r
 del emacs-%1\README.W32\r
 if not (%4) == () goto end\r
 \r
index a52e4dab258ce23b3c0a789762905047f69771b7..ae2dc481843bc86b5b38be6e13a34c0bfc4b02fa 100755 (executable)
--- a/configure
+++ b/configure
@@ -16310,12 +16310,11 @@ done
 
 
 
-
 
 
 for ac_func in gethostname getdomainname dup2 \
 rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \
-random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \
+random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime setsid \
 strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
 utimes setrlimit setpgid getcwd getwd shutdown getaddrinfo \
 __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \
@@ -18922,13 +18921,11 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h> /* for off_t */
-     #include <stdio.h>
+#include <stdio.h>
 int
 main ()
 {
-int (*fp) (FILE *, off_t, int) = fseeko;
-     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
+return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
   ;
   return 0;
 }
@@ -18968,13 +18965,11 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #define _LARGEFILE_SOURCE 1
-#include <sys/types.h> /* for off_t */
-     #include <stdio.h>
+#include <stdio.h>
 int
 main ()
 {
-int (*fp) (FILE *, off_t, int) = fseeko;
-     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
+return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
   ;
   return 0;
 }
@@ -20003,10 +19998,165 @@ _ACEOF
 fi
 
 
+# Do we have res_init, for detecting changes in /etc/resolv.conf?
+
+resolv=no
+{ echo "$as_me:$LINENO: checking for res_init" >&5
+echo $ECHO_N "checking for res_init... $ECHO_C" >&6; }
+if test "${ac_cv_func_res_init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define res_init to an innocuous variant, in case <limits.h> declares res_init.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define res_init innocuous_res_init
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char res_init (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef res_init
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char res_init ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_res_init || defined __stub___res_init
+choke me
+#endif
+
+int
+main ()
+{
+return res_init ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_res_init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_func_res_init=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_res_init" >&5
+echo "${ECHO_T}$ac_cv_func_res_init" >&6; }
+if test $ac_cv_func_res_init = yes; then
+  have_res_init=yes
+else
+  have_res_init=no
+fi
+
+if test "$have_res_init" = no; then
+  OLIBS="$LIBS"
+  LIBS="$LIBS -lresolv"
+  { echo "$as_me:$LINENO: checking for res_init with -lresolv" >&5
+echo $ECHO_N "checking for res_init with -lresolv... $ECHO_C" >&6; }
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+int
+main ()
+{
+res_init();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  have_res_init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       have_res_init=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  { echo "$as_me:$LINENO: result: $have_res_init" >&5
+echo "${ECHO_T}$have_res_init" >&6; }
+  if test "$have_res_init" = yes ; then
+    resolv=yes
+  fi
+  LIBS="$OLIBS"
+fi
+
+if test "$have_res_init" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_RES_INIT 1
+_ACEOF
+
+fi
+
 # Do we need the Hesiod library to provide the support routines?
 if test "$with_hesiod" = yes ; then
   # Don't set $LIBS here -- see comments above.
-  resolv=no
   { echo "$as_me:$LINENO: checking for res_send" >&5
 echo $ECHO_N "checking for res_send... $ECHO_C" >&6; }
 if test "${ac_cv_func_res_send+set}" = set; then
 
   if test "$resolv" = yes ; then
     RESOLVLIB=-lresolv
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBRESOLV 1
-_ACEOF
-
   else
     RESOLVLIB=
   fi
 
 fi
 
+# Do we need libresolv (due to res_init or Hesiod)?
+if test "$resolv" = yes ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBRESOLV 1
+_ACEOF
+
+fi
+
 # These tell us which Kerberos-related libraries to use.
 if test "${with_kerberos+set}" = set; then
 
index d1b8f492a41616bb0c2d27c99a29fd192f18e2ee..489d9f1a7a0868006133884c2d174c927ee9cb37 100644 (file)
@@ -2794,7 +2794,7 @@ AC_CHECK_HEADERS(maillock.h)
 
 AC_CHECK_FUNCS(gethostname getdomainname dup2 \
 rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \
-random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \
+random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime setsid \
 strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
 utimes setrlimit setpgid getcwd getwd shutdown getaddrinfo \
 __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \
@@ -2838,17 +2838,38 @@ AC_CHECK_FUNCS(getpt)
 # than to expect to find it in ncurses.
 AC_CHECK_LIB(ncurses, tparm)
 
+# Do we have res_init, for detecting changes in /etc/resolv.conf?
+
+resolv=no
+AC_CHECK_FUNC(res_init, have_res_init=yes, have_res_init=no)
+if test "$have_res_init" = no; then
+  OLIBS="$LIBS"
+  LIBS="$LIBS -lresolv"
+  AC_MSG_CHECKING(for res_init with -lresolv)
+  AC_TRY_LINK([#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h> ],
+    [res_init();],
+    have_res_init=yes, have_res_init=no)
+  AC_MSG_RESULT($have_res_init)
+  if test "$have_res_init" = yes ; then
+    resolv=yes
+  fi
+  LIBS="$OLIBS"
+fi
+
+if test "$have_res_init" = yes; then
+  AC_DEFINE(HAVE_RES_INIT, 1, [Define to 1 if res_init is available.])
+fi
+
 # Do we need the Hesiod library to provide the support routines?
 if test "$with_hesiod" = yes ; then
   # Don't set $LIBS here -- see comments above.
-  resolv=no
   AC_CHECK_FUNC(res_send, , [AC_CHECK_FUNC(__res_send, ,
      [AC_CHECK_LIB(resolv, res_send, resolv=yes,
                  [AC_CHECK_LIB(resolv, __res_send, resolv=yes)])])])
   if test "$resolv" = yes ; then
     RESOLVLIB=-lresolv
-    AC_DEFINE(HAVE_LIBRESOLV, 1,
-             [Define to 1 if you have the resolv library (-lresolv).])
   else
     RESOLVLIB=
   fi
@@ -2858,6 +2879,12 @@ if test "$with_hesiod" = yes ; then
        :, $RESOLVLIB)])
 fi
 
+# Do we need libresolv (due to res_init or Hesiod)?
+if test "$resolv" = yes ; then
+  AC_DEFINE(HAVE_LIBRESOLV, 1,
+            [Define to 1 if you have the resolv library (-lresolv).])
+fi
+
 # These tell us which Kerberos-related libraries to use.
 if test "${with_kerberos+set}" = set; then
   AC_CHECK_LIB(com_err, com_err)
index 9d5e6158f3ff0d797f0d37286b1315fa2b0008bc..68c150a67c9542abb824d616f41f5c8d957f7f6b 100644 (file)
@@ -1,3 +1,38 @@
+2007-10-18  Martin Rudalics  <rudalics@gmx.at>
+
+       * trouble.texi (Quitting): Fix typo.
+
+2007-10-18  Glenn Morris  <rgm@gnu.org>
+
+       * frames.texi (Mode Line Mouse): Mention minor mode names.
+
+2007-10-17  Juri Linkov  <juri@jurta.org>
+
+       * text.texi (Fill Commands): Undocument fill-paragraph-or-region.
+       fill-paragraph operates on the active region in Transient Mark mode.
+       (Fill Prefix, Format Indentation): Replace fill-paragraph-or-region
+       with fill-paragraph.
+
+       * basic.texi (Arguments): Replace fill-paragraph-or-region with
+       fill-paragraph.
+
+       * fixit.texi (Spelling): ispell-word operates on the active region
+       in Transient Mark mode.
+
+2007-10-17  Aaron S. Hawley  <aaronh@garden.org>
+
+       * building.texi (Source Buffers):
+       * custom.texi (Init Non-ASCII):
+       * glossary.texi (Glossary): Use "key binding" consistently.
+
+2007-10-17  Juanma Barranquero  <lekktu@gmail.com>
+
+       * calendar.texi (Diary): Fix directive.
+
+2007-10-16  Richard Stallman  <rms@gnu.org>
+
+       * calendar.texi (Diary): Clarify text about diary file example.
+
 2007-10-13  Eric S. Raymond  <esr@snark.thyrsus.com>
 
        * files.texi: Capitalize node names according to convention.
@@ -10,7 +45,7 @@
 
        * emacs.texi:
        * files.texi (Version Systems): Minor fixes to version-control material
-       suggseted by RMS and Robert J. Chassell.
+       suggested by RMS and Robert J. Chassell.
 
 2007-10-10  Eric S. Raymond  <esr@snark.thyrsus.com>
 
@@ -18,9 +53,9 @@
        * vc-xtra.texi:
        * vc1-xtra.texi:
        * vc2-xtra.texi: Merge in changes for new VC with fileset-oriented
-       operations.  Change of terminology from 'version' to `revision'.
+       operations.  Change of terminology from `version' to `revision'.
        Revise text for adequate description of VCSes with monotonic IDs.
-       * emacs.texi: Change of terminology from 'version' to `revision'.
+       * emacs.texi: Change of terminology from `version' to `revision'.
 
 2007-10-09  Eric S. Raymond  <esr@snark.thyrsus.com>
 
@@ -53,7 +88,7 @@
 2007-10-06  Eric S. Raymond  <esr@snark.thyrsus.com>
 
        * files.texi: Update the section on version control for 2007
-       conditions. None of these changes are new-VC-specific; that
+       conditions.  None of these changes are new-VC-specific; that
        will come later.
 
 2007-09-15  Glenn Morris  <rgm@gnu.org>
 
 2007-06-24  Karl Berry  <karl@gnu.org>
 
-       * emacs.texi: new Back-Cover Text.
+       * emacs.texi: New Back-Cover Text.
 
 2007-06-07  Alan Mackenzie  <acm@muc.de>
 
index 418d54f677b9cd3b6723ee228810a6fafa122b1e..333985e4a4ae4f99cf8deff108cfbfbdc70c9f94 100644 (file)
@@ -707,7 +707,7 @@ C-n} (move down a good fraction of a screen), @kbd{C-u C-u C-o} (make
 ``a lot'' of blank lines), and @kbd{C-u C-k} (kill four lines).
 
   Some commands care whether there is an argument, but ignore its
-value.  For example, the command @kbd{M-q} (@code{fill-paragraph-or-region})
+value.  For example, the command @kbd{M-q} (@code{fill-paragraph})
 fills text; with an argument, it justifies the text as well.
 (@xref{Filling}, for more information on @kbd{M-q}.)  Plain @kbd{C-u}
 is a handy way of providing an argument for such commands.
index 5689bf1fe34b1cc914556b5698152119b0860f05..45210118f775bd0b4351f1fe1406b29701b0d204 100644 (file)
@@ -911,7 +911,7 @@ places.
 
 @c @findex gdb-mouse-set-clear-breakpoint
 @c @findex gdb-mouse-toggle-breakpoint
-Many GDB commands can be entered using keybindings or the tool bar but
+Many GDB commands can be entered using key bindings or the tool bar but
 sometimes it is quicker to use the fringe.  These commands either
 manipulate breakpoints or control program execution.  When there is no
 fringe, you can use the margin but this is only present when the
index 1357784b920c1116a5949bf7a9bcf5007b43c124..6b28509473587ecc65827c34a4564ff3eae90f88 100644 (file)
@@ -989,9 +989,8 @@ events for today, for the immediate future, or for any specified
 date.
 
   The name of the diary file is specified by the variable
-@code{diary-file}; @file{~/diary} is the default.  A sample diary file
-is (note that the file format is essentially the same as that used by
-the external shell utility @samp{calendar}):
+@code{diary-file}; @file{~/diary} is the default.  Here's an example
+showing what that file looks like:
 
 @example
 12/22/1988  Twentieth wedding anniversary!!
@@ -1008,8 +1007,10 @@ April 15, 1989 Income tax due.
 @end example
 
 @noindent
-This example uses extra spaces to align the event descriptions of most
-of the entries.  Such formatting is purely a matter of taste.
+This format is essentially the same as the one used by the system's
+@command{calendar} utility.  This example uses extra spaces to align
+the event descriptions of most of the entries.  Such formatting is
+purely a matter of taste.
 
   Although you probably will start by creating a diary manually, Emacs
 provides a number of commands to let you view, add, and change diary
index 1276c45af702fe609a70261be3a3e7925b2c1460..29d1c902b7c868c59b727f3b7b28c90f73e2cb02 100644 (file)
@@ -2505,7 +2505,7 @@ Type @kbd{C-q}, followed by the key you want to bind, to insert @var{char}.
 
   @strong{Warning:} if you change the keyboard encoding, or change
 between multibyte and unibyte mode, or anything that would alter which
-code @kbd{C-q} would insert for that character, this keybinding may
+code @kbd{C-q} would insert for that character, this key binding may
 stop working.  It is therefore advisable to use one and only one
 coding system, for your init file as well as the files you edit.  For
 example, don't mix the @samp{latin-1} and @samp{latin-9} coding
index d1577e2f528d9a237b45119adb83cf5ff3c0c2a2..2d827f5a1a212dff08bc055f8ce9a67a9cc988f8 100644 (file)
@@ -325,7 +325,9 @@ you give an explicit command to do so.
   To check the spelling of the word around or before point, and
 optionally correct it as well, use the command @kbd{M-$}
 (@code{ispell-word}).  If the word is not correct, the command offers
-you various alternatives for what to do about it.
+you various alternatives for what to do about it.  When the mark is
+active in Transient Mark mode, this command operates on the active
+region like @code{ispell-region}.
 
 @findex ispell-buffer
 @findex ispell-region
index a45b582b455b792b12bb58e72e83d720ffe831f2..e1207738cfa187194d3e27894e63b3a107110b5f 100644 (file)
@@ -430,8 +430,8 @@ This menu is for specifying the frame's default font.
   You can use mouse clicks on window mode lines to select and manipulate
 windows.
 
-  Some areas of the mode line, such as the buffer name and the major
-mode name, have their own special mouse bindings.  These areas are
+  Some areas of the mode line, such as the buffer name, and major and minor
+mode names, have their own special mouse bindings.  These areas are
 highlighted when you hold the mouse over them, and information about
 the special bindings will be displayed (@pxref{Tooltips}).  This
 section's commands do not apply in those areas.
index f289c2ca1cbe8ea39d1c3c23f3f262a928d52f4b..a9109de667b326594ceb451c67948a82a34bc25f 100644 (file)
@@ -658,7 +658,7 @@ Justification means adding extra spaces within lines of text to make
 them extend exactly to a specified width.
 @xref{Format Justification}.
 
-@item Keybinding
+@item Key Binding
 See `binding.'
 
 @item Keyboard Macro
index 9cfd4ffe9226300ade43224ac57aca66e5b80fe7..c151c75e8bb66da41d681f010d2c0c74557e6900 100644 (file)
@@ -486,11 +486,9 @@ The section on init files says how to arrange this permanently for yourself.
 
 @table @kbd
 @item M-q
-Fill current paragraph or active region (@code{fill-paragraph-or-region}).
+Fill current paragraph (@code{fill-paragraph}).
 @item C-x f
 Set the fill column (@code{set-fill-column}).
-@item M-x fill-paragraph
-Fill current paragraph (@code{fill-paragraph}).
 @item M-x fill-region
 Fill each paragraph in the region (@code{fill-region}).
 @item M-x fill-region-as-paragraph
@@ -499,39 +497,35 @@ Fill the region, considering it as one paragraph.
 Center a line.
 @end table
 
+@kindex M-q
 @findex fill-paragraph
-  To refill a paragraph, use @kbd{M-x fill-paragraph}.  This operates
-on the paragraph that point is inside, or the one after point if point
-is between paragraphs.  Refilling works by removing all the
-line-breaks, then inserting new ones where necessary.
+  To refill a paragraph, use the command @kbd{M-q}
+(@code{fill-paragraph}).  This operates on the paragraph that point is
+inside, or the one after point if point is between paragraphs.
+Refilling works by removing all the line-breaks, then inserting new ones
+where necessary.  When the mark is active in Transient Mark mode, this
+command operates on the active region like @code{fill-region}.
 
 @findex fill-region
   To refill many paragraphs, use @kbd{M-x fill-region}, which
 finds the paragraphs in the region and fills each of them.
 
-@kindex M-q
-@findex fill-paragraph-or-region
-  The command @kbd{M-q} (@code{fill-paragraph-or-region}), operates on
-the active region like @code{fill-region} when the mark is active in
-Transient Mark mode.  Otherwise, it operates on the current paragraph
-like @code{fill-paragraph}.
-
 @findex fill-region-as-paragraph
-  @kbd{M-q}, @code{fill-paragraph} and @code{fill-region} use the same
-criteria as @kbd{M-h} for finding paragraph boundaries (@pxref{Paragraphs}).
-For more control, you can use @kbd{M-x fill-region-as-paragraph},
-which refills everything between point and mark as a single paragraph.
-This command deletes any blank lines within the region, so separate
-blocks of text end up combined into one block.
+  @kbd{M-q} and @code{fill-region} use the same criteria as @kbd{M-h}
+for finding paragraph boundaries (@pxref{Paragraphs}).  For more
+control, you can use @kbd{M-x fill-region-as-paragraph}, which refills
+everything between point and mark as a single paragraph.  This command
+deletes any blank lines within the region, so separate blocks of text
+end up combined into one block.
 
 @cindex justification
   A numeric argument to @kbd{M-q} tells it to @dfn{justify} the text
 as well as filling it.  This means that extra spaces are inserted to
 make the right margin line up exactly at the fill column.  To remove
 the extra spaces, use @kbd{M-q} with no argument.  (Likewise for
-@code{fill-paragraph} and @code{fill-region}.)  Another way to control
-justification, and choose other styles of filling, is with the
-@code{justification} text property; see @ref{Format Justification}.
+@code{fill-region}.)  Another way to control justification, and choose
+other styles of filling, is with the @code{justification} text
+property; see @ref{Format Justification}.
 
 @kindex M-s @r{(Text mode)}
 @cindex centering
@@ -595,7 +589,7 @@ fill prefix automatically (@pxref{Adaptive Fill}).
 @item C-x .
 Set the fill prefix (@code{set-fill-prefix}).
 @item M-q
-Fill a paragraph using current fill prefix (@code{fill-paragraph-or-region}).
+Fill a paragraph using current fill prefix (@code{fill-paragraph}).
 @item M-x fill-individual-paragraphs
 Fill the region, considering each change of indentation as starting a
 new paragraph.
@@ -2256,7 +2250,7 @@ margin width either with a numeric argument or in the minibuffer.
 
   Sometimes, as a result of editing, the filling of a paragraph becomes
 messed up---parts of the paragraph may extend past the left or right
-margins.  When this happens, use @kbd{M-q} (@code{fill-paragraph-or-region}) to
+margins.  When this happens, use @kbd{M-q} (@code{fill-paragraph}) to
 refill the paragraph.
 
   The fill prefix, if any, works in addition to the specified paragraph
index ea494445a4e3b5e17ea6973fb4f051bdfcb625c0..494637c8eeb205ed950a360c349c6c3b3c69ec81 100644 (file)
@@ -84,7 +84,7 @@ waiting for the operating system to do something, quitting is
 impossible unless special pains are taken for the particular system
 call within Emacs where the waiting occurs.  We have done this for the
 system calls that users are likely to want to quit from, but it's
-possible you will a case not handled.  In one very common
+possible you will encounter a case not handled.  In one very common
 case---waiting for file input or output using NFS---Emacs itself knows
 how to quit, but many NFS implementations simply do not allow user
 programs to stop waiting for NFS when the NFS server is hung.
index d95597e940b9a6e8e682fd6829b98ae78bfe1277..e0d9db962f9f3ca2975db1eca52346638e431f38 100644 (file)
@@ -1,3 +1,9 @@
+2007-10-17  Juri Linkov  <juri@jurta.org>
+
+       * text.texi (Filling): Update arguments of fill-paragraph.
+       fill-paragraph operates on the active region in Transient Mark mode.
+       Remove fill-paragraph-or-region.
+
 2007-10-13  Karl Berry  <karl@gnu.org>
 
        * elisp.texi (@dircategory): Move to after @copying,
index daaaf6c9b9de23e8c0dc7d9aae33c24b617cb178..5b935bc6e23c536d8601c3a301bf26373b2d038c 100644 (file)
@@ -1432,11 +1432,14 @@ as @code{full}.
   When you call the filling functions interactively, using a prefix
 argument implies the value @code{full} for @var{justify}.
 
-@deffn Command fill-paragraph justify
+@deffn Command fill-paragraph &optional justify region
 This command fills the paragraph at or after point.  If
 @var{justify} is non-@code{nil}, each line is justified as well.
 It uses the ordinary paragraph motion commands to find paragraph
 boundaries.  @xref{Paragraphs,,, emacs, The GNU Emacs Manual}.
+Interactively, when @var{region} is non-@code{nil} in Transient Mark
+mode and the mark is active, this command calls @code{fill-region}
+on the active region.
 @end deffn
 
 @deffn Command fill-region start end &optional justify nosqueeze to-eop
@@ -1453,12 +1456,6 @@ The variable @code{paragraph-separate} controls how to distinguish
 paragraphs.  @xref{Standard Regexps}.
 @end deffn
 
-@deffn Command fill-paragraph-or-region justify
-In Transient Mark mode, when the mark is active, this command calls
-@code{fill-region} on the active region.  Otherwise, it calls
-@code{fill-paragraph}.
-@end deffn
-
 @deffn Command fill-individual-paragraphs start end &optional justify citation-regexp
 This command fills each paragraph in the region according to its
 individual fill prefix.  Thus, if the lines of a paragraph were indented
index 21cb6b3ffffe16c07079221d2131f6f36e930495..62258f67ff45111570f1804ed7cbf88076b00daa 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -83,6 +83,9 @@ recenter the visited source file.  Its value can be a number (for example,
 ** The mode-line displays a `@' if the default-directory for the current buffer
 is on a remote machine, or a hyphen otherwise.
 
+** The mode-line displays a mode menu when mouse-1 is clicked on a minor mode,
+in the same way as it already did for major modes.
+
 ** The new command balance-windows-area balances windows both vertically
 and horizontally.
 
@@ -118,8 +121,9 @@ following arguments.
 +++
 ** M-q now fills the region if the region is active and
 `transient-mark-mode' is turned on.  Otherwise, it fills the current
-paragraph.  The new command bound to M-q is `fill-paragraph-or-region'.
+paragraph.
 
++++
 ** M-$ now checks spelling of the region if the region is active and
 `transient-mark-mode' is turned on.  Otherwise, it checks spelling of the
 word at point.
@@ -132,6 +136,10 @@ word at point.
 
 ** New command kill-matching-buffers kills buffers whose name matches a regexp.
 
+** `interprogram-paste-function' can now return one string or a list
+of strings.  In the latter case, Emacs puts the second and following
+strings on the kill ring.
+
 ** Minibuffer changes:
 
 *** isearch started in the minibuffer searches in the minibuffer history.
index 2b7c82dd7b6e0820a12dbb0c27799d1ad08d6228..867c58c47a43d2863a8974eb25c2d421bc7c8106 100644 (file)
@@ -324,7 +324,7 @@ need to quote the space with a C-q.  The underlying changes in the
 keymaps that are active in the minibuffer are described below under
 "New keymaps for typing file names".
 
-If you want the old behavior back, put these two key bindings to your
+If you want the old behavior back, add these two key bindings to your
 ~/.emacs init file:
 
   (define-key minibuffer-local-filename-completion-map
index 7ebf7ae8edd1a298607195b777cb6ac66075b70f..d098fcc2c11adcec7f47ebf25cb36c7c9791d659 100644 (file)
@@ -2204,6 +2204,13 @@ month names with consistent widths for some locales on some versions
 of Windows. This is caused by a deficiency in the underlying system
 library function.
 
+The functions set-time-zone-rule, and display-time-world (which uses it)
+do not work on Windows. Fixing this is difficult, since Windows uses
+localtime for the system clock, and any attempt to change the timezone
+would have to be accompanied by a clock change for the results to remain
+consistent. The way in which these functions are used is not intended to
+cause such system-wide disruption.
+
 Files larger than 4GB cause overflow in the size (represented as a
 32-bit integer) reported by `file-attributes'.  This affects Dired as
 well, since the Windows port uses a Lisp emulation of `ls' that relies
index d3fde16c4fa346a57b71adf876b829d2d33a01e4..4fe538b3bd4a2ba33c416b70b68781d39c3a7929 100644 (file)
@@ -1,3 +1,269 @@
+2007-10-18  Johan Bockg\e,Ae\e(Brd  <bojohan@gnu.org>
+
+       * net/tramp.el (tramp-rfn-eshadow-update-overlay): Save excursion.
+       Use `save-restriction' rather than `widen'.
+
+2007-10-18  Richard Stallman  <rms@gnu.org>
+
+       * time.el (display-time-world-time-format): Display day # not month #.
+
+2007-10-18  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * files.el (auto-mode-alist): Don't use doc-view for PS and EPS.
+
+       * doc-view.el: Remove version keyword.
+       (doc-view-ghostscript-program, doc-view-dvipdfm-program)
+       (doc-view-ps2pdf-program): Use executable-find.  Simplify custom type.
+       (doc-view-ghostscript-options): Improve custom type.
+       (doc-view-cache-directory, doc-view-conversion-buffer)
+       (doc-view-conversion-refresh-interval): Simplify custom type.
+
+2007-10-18  Tassilo Horn  <tassilo@member.fsf.org>
+
+       * doc-view.el (doc-view-dvi->pdf-sentinel, doc-view-dvi->pdf)
+       (doc-view-pdf/ps->png-sentinel, doc-view-pdf/ps->png)
+       (doc-view-pdf->txt-sentinel, doc-view-pdf->txt)
+       (doc-view-ps->pdf-sentinel, doc-view-ps->pdf): Remove superfluous
+       messages.
+       (doc-view-mode-map): Use the image-mode scrolling commands.  Don't
+       rebind C-x k.
+
+2007-10-18  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * doc-view.el (doc-view-ghostscript-options, doc-view-ps->pdf):
+       Add comment about "-dSAFER".
+
+2007-10-18  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * term/xterm.el: Don't require xt-mouse.
+       (terminal-init-xterm): Run terminal-init-xterm-hook rather than
+       calling turn-on-xterm-mouse-tracking-on-terminal directly.
+
+       * xt-mouse.el: Don't change the global function-key-map anny more.
+       (xterm-mouse-mode): Use terminal-init-xterm-hook.
+       Don't use after-make-frame-functions now that term/xterm.el calls
+       us directly.
+       (turn-on-xterm-mouse-tracking, turn-off-xterm-mouse-tracking):
+       Use turn-*-xterm-mouse-tracking-on-terminal.  Only once per terminal.
+       (turn-on-xterm-mouse-tracking-on-terminal): Make param optional.
+       Setup input-decode-map and remember that xterm-mouse-mode was
+       enabled in this terminal.
+       (turn-off-xterm-mouse-tracking-on-terminal): Only disable on those
+       terminals where it has been enabled.
+
+       * faces.el (tty-create-frame-with-faces): Make sure not only
+       tty-run-terminal-initialization but also set-locale-environment
+       are run only once per terminal.
+       (tty-run-terminal-initialization): Don't check if the terminal was
+       already initted.
+
+       * international/encoded-kb.el (encoded-kbd-setup-display): Be careful
+       not to remove keymaps that just happen to inherit from one of ours.
+       When setting up our keymap, make sure it won't be accidentally
+       modified by someone else.
+
+2007-10-18  Thien-Thi Nguyen  <ttn@gnuvola.org>
+
+       * textmodes/artist.el (artist-previous-line, artist-next-line):
+       * dired.el (dired-next-line, dired-previous-line):
+       * progmodes/delphi.el (delphi-newline):
+       * textmodes/org.el (org-columns-eval):
+       Use forward-line.
+
+       * emerge.el (emerge-setup): Use insert-buffer-substring.
+       (emerge-prepare-error-list, emerge-setup-with-ancestor): Likewise.
+
+2007-10-18  Juanma Barranquero  <lekktu@gmail.com>
+
+       * textmodes/fill.el (fill-individual-paragraphs): Doc fix.
+       (adaptive-fill-function): Doc fix.  Remove * from docstring.
+
+2007-10-18  Tom Horsley  <tom.horsley@att.net>
+
+       * simple.el (interprogram-paste-function): Doc fix.
+       (current-kill): Accept list of strings as well
+       as single string from `interprogram-paste-function'.
+
+2007-10-18  Glenn Morris  <rgm@gnu.org>
+
+       * ibuf-ext.el (ibuffer-saved-filter-groups): Doc fix.
+
+2007-10-18  Drew Adams  <drew.adams@oracle.com>
+
+       * bindings.el (mode-line-minor-mode-keymap):
+       Add mouse-minor-mode-menu on mouse-1.
+       (mode-line-modes): Add mouse-1 to help-echo text.
+       (mouse-minor-mode-menu, minor-mode-menu-from-indicator):
+       New functions.
+       (mode-line-minor-mode-help): Doc fix.
+
+2007-10-17  Juri Linkov  <juri@jurta.org>
+
+       * textmodes/fill.el (fill-paragraph-or-region): Remove function
+       at the request of RMS.
+       (fill-paragraph): Change `arg' to optional `justify'.  Add interactive
+       arg `region'.  Fix docstring.  At the first `or' branch add call to
+       `fill-region' if it the region is active in transient-mark-mode.
+
+       * bindings.el (esc-map): Bind M-q to fill-paragraph
+       instead of fill-paragraph-or-region.
+
+       * tutorial.el (tutorial--default-keys): Replace fill-paragraph-or-region
+       with fill-paragraph.
+
+       * textmodes/ispell.el (ispell-word): Add interactive arg `region'.
+       Fix docstring.
+
+       * indent.el (indent-for-tab-command): Change interactive spec from
+       "P" to "p".  Add check for interactive arg before indenting the
+       active region.
+
+       * files.el (auto-mode-alist): Add \\. before PDF/PS/DVI extensions.
+       Regroup.
+
+2007-10-17  Juanma Barranquero  <lekktu@gmail.com>
+
+       * emacs-lisp/find-func.el: Don't require loadhist.
+
+       * loadhist.el (feature-symbols, file-provides, file-requires)
+       (file-set-intersect, file-dependents): Simplify.
+       (unload-feature-special-hooks): Update list of special hooks.
+
+2007-10-17  Tassilo Horn  <tassilo@member.fsf.org>
+
+       * bindings.el (completion-ignored-extensions): Remove pdf and dvi
+       extensions since they can be viewed with doc-view.
+
+       * files.el (auto-mode-alist): Make doc-view-mode the default mode
+       for pdf, ps and dvi files.
+
+       * doc-view.el: Make doc-view-mode the standard mode for viewing
+       pdf, [e]ps and dvi files and add binding C-c C-c to toggle between
+       text and image display.  Add binding C-c C-e to switch to an
+       editing mode.
+       (doc-view-ghostscript-options, doc-view-ps->pdf): Add "-dSAFER" to
+       avoid security problems when rendering files from untrusted sources.
+
+2007-10-17  Aaron Hawley  <aaronh@garden.org>
+
+       * tutorial.el (tutorial--save-tutorial): Display message when tutorial
+       position is not saved.
+
+2007-10-17  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * doc-view.el: Mention xpdf.  Fix spelling of Ghostscript.
+       (doc-view-ghostscript-options): Fix typo in doc string.
+
+2007-10-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/compile.el (compilation-next-error-function): Fix timestamp
+       handling, so compilation-fake-loc works again.
+
+       * server.el (server-select-display): Nop if we do not support m-f-o-d.
+       (server-process-filter): Revert last change.
+
+       * vc.el (vc-diff-sentinel, vc-diff-internal): Revert some change in the
+       behavior unrelated to filesets.
+
+2007-10-17  Chong Yidong  <cyd@stupidchicken.com>
+
+       * longlines.el (longlines-wrap-follows-window-size): Integer value
+       specifies wrapping margin.
+       (longlines-mode, longlines-window-change-function):
+       Set window-specific wrapping margin based on the above.
+
+2007-10-17  John Wiegley  <johnw@newartisans.com>
+
+       * eshell/esh-cmd.el (eshell-complex-commands): Add "ls".
+
+2007-10-17  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * server.el (server-process-filter): Only set display if X11 is
+       supported.
+
+2007-10-17  Glenn Morris  <rgm@gnu.org>
+
+       * progmodes/cc-menus.el (cc-imenu-c++-generic-expression):
+       Tweak regexp to avoid stack overflow.
+
+2007-10-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * simple.el (reindent-then-newline-and-indent): Don't assume that
+       indent-according-to-mode preserves point.
+
+2007-10-16  Juanma Barranquero  <lekktu@gmail.com>
+
+       * bs.el (bs--make-header-match-string, bs-show-in-buffer)
+       (bs--nth-wrapper): Simplify.
+       (bs-select, bs--insert-one-entry): Simplify.  Use `when'.
+       (bs-buffer-list): Simplify.  Use `when'.  Use `string-match-p'.
+       (bs-sort-buffer-interns-are-last): Use `string-match-p'.
+       (bs-attributes-list, bs-max-window-height, bs-must-always-show-regexp)
+       (bs-maximal-buffer-name-column, bs-minimal-buffer-name-column)
+       (bs-configurations, bs-default-configuration)
+       (bs-alternative-configuration, bs-cycle-configuration-name)
+       (bs-string-show-always, bs-string-show-never, bs-string-current)
+       (bs-string-current-marked, bs-string-marked, bs-string-show-normally)
+       (bs-sort-functions, bs-default-sort-name): Remove * in docstrings.
+       (bs--redisplay, bs--goto-current-buffer, bs--current-buffer, bs-delete)
+       (bs-apply-sort-faces, bs-next-config-aux): Use `when'.
+       (bs--window-config-coming-from): Revert 2006-11-09 change.
+       (bs--restore-window-config): Keep the selected frame.
+       (bs--track-window-changes, bs--remove-hooks): New functions.
+       (bs-mode): Use `define-derived-mode'.  Set hook to track window changes.
+       (bs--create-header): Remove.
+       (bs--create-header-line): New function, based on `bs--create-header'.
+       (bs--show-header): Use `bs--create-header-line'.
+       (bs--show-with-configuration): Revert 2006-11-09 change.
+       Don't reuse window unless it is visible on the selected frame.
+       Restore window configuration (possibly in a different frame)
+       before creating any window.
+
+2007-10-16  Glenn Morris  <rgm@gnu.org>
+
+       * simple.el (blink-matching-open): Don't report false errors with
+       the `$' syntax class.
+
+2007-10-16  Richard Stallman  <rms@gnu.org>
+
+       * emacs-lisp/advice.el (ad-get-advice-info): Change to a function.
+       (ad-get-advice-info-macro): New macro, like old ad-get-advice-info.
+       (ad-is-advised, ad-get-advice-info-field)
+       (ad-set-advice-info-field): Use ad-get-advice-info-macro.
+
+2007-10-15  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc-hooks.el (vc-workfile-version): Compatibility alias.
+       (vc-default-working-revision): Compatibility for backends.
+
+2007-10-15  Juanma Barranquero  <lekktu@gmail.com>
+
+       * filesets.el (filesets-alist-get): Use `let' rather than `let*'.
+       (filesets-ormap, filesets-sort-case-sensitive-flag)
+       (filesets-remake-shortcut, filesets-ingroup-collect-files):
+       Fix typos in docstrings.
+       (filesets-conditional-sort, filesets-find-or-display-file)
+       (filesets-data-get-name, filesets-data-get-data)
+       (filesets-data-set, filesets-cmd-query-replace-getargs)
+       (filesets-ingroup-collect): Doc fixes.
+
+2007-10-15  Sam Steingold  <sds@gnu.org>
+
+       * mail/sendmail.el (sendmail-error-reporting-interactive)
+       (sendmail-error-reporting-non-interactive): New variables for
+       sendmail error reporting options to simplify support for imperfect
+       sendmail emulators.
+       (sendmail-send-it): Use them instead of list literals.
+
+2007-10-15  Juanma Barranquero  <lekktu@gmail.com>
+
+       * help-fns.el: Revert previous change; it creates a
+       dependency loop between advice.el and help-fns.el.
+
+2007-10-15  Juanma Barranquero  <lekktu@gmail.com>
+
+       * help-fns.el: Require advice when compiling.
+
 2007-10-14  Drew Adams  <drew.adams@oracle.com>
 
        * emacs-lisp/ring.el (ring-convert-sequence-to-ring)
 
 2007-10-13  Dan Nicolaescu  <dann@ics.uci.edu>
 
-       * frame.el (select-frame-set-input-focus): Fix typo
-       "max" -> "mac". Do not use a single clause cond.
+       * frame.el (select-frame-set-input-focus): Fix typo "max" -> "mac".
+       Do not use a single clause cond.
 
        * cus-start.el (all): Use test that does not match the X11 version
        for mac.
        (idlwave-complete-in-buffer):
        * textmodes/org.el (org-export-as-html, org-export-as-ascii)
        (org-fast-tag-selection):
-       * textmodes/reftex-sel.el (reftex-select-item):  Use mapc rather
+       * textmodes/reftex-sel.el (reftex-select-item): Use mapc rather
        than mapcar.
 
 2007-10-13  Dan Nicolaescu  <dann@ics.uci.edu>
        and some leftover logic regarding dedicated frames.  If showing
        concise startup screen, fit window to buffer.
        (command-line-1): If we will be using the splash screen, use
-       find-file instead of find-file-other-window to find additional
-       files.  Comment out unused code for coping with the old sit-for
-       behavior.
+       find-file instead of find-file-other-window to find additional files.
+       Comment out unused code for coping with the old sit-for behavior.
 
 2007-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
index 0e7bd15a494629d7a96715a127f6196adfb9eab2..19819c15d6005dc7f2608648d40836a4de14bb00 100644 (file)
@@ -289,6 +289,7 @@ Keymap to display on major mode.")
 
 (defvar mode-line-minor-mode-keymap
   (let ((map (make-sparse-keymap)))
+    (define-key map [mode-line down-mouse-1] 'mouse-minor-mode-menu)
     (define-key map [mode-line mouse-2] 'mode-line-minor-mode-help)
     (define-key map [mode-line down-mouse-3] 'mode-line-mode-menu-1)
     (define-key map [header-line down-mouse-3] 'mode-line-mode-menu-1)
@@ -331,7 +332,7 @@ Keymap to display on minor modes.")
         '("" mode-line-process)
         `(:propertize ("" minor-mode-alist)
                       mouse-face mode-line-highlight
-                      help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes"
+                      help-echo "mouse-1: minor mode, mouse-2: minor mode help, mouse-3: toggle minor modes"
                       local-map ,mode-line-minor-mode-keymap)
         (propertize "%n" 'help-echo "mouse-2: widen"
                     'mouse-face 'mode-line-highlight
@@ -492,8 +493,28 @@ Menu of mode operations in the mode line.")
   (interactive "@e")
   (x-popup-menu event mode-line-mode-menu))
 
+(defun mouse-minor-mode-menu (event)
+  "Show minor-mode menu for EVENT on minor modes area of the mode line."
+  (interactive "@e")
+  (let ((indicator (car (nth 4 (car (cdr event))))))
+    (minor-mode-menu-from-indicator indicator)))
+
+(defun minor-mode-menu-from-indicator (indicator)
+  "Show menu, if any, for minor mode specified by INDICATOR.
+Interactively, INDICATOR is read using completion."
+  (interactive (list (completing-read "Minor mode indicator: "
+                                      (describe-minor-mode-completion-table-for-indicator))))
+  (let ((minor-mode (lookup-minor-mode-from-indicator indicator)))
+    (if minor-mode
+        (let* ((map (cdr-safe (assq minor-mode minor-mode-map-alist)))
+               (menu (and (keymapp map) (lookup-key map [menu-bar]))))
+          (if menu
+              (popup-menu menu)
+            (message "No menu for minor mode `%s'" minor-mode)))
+      (error "Cannot find minor mode for `%s'" indicator))))
+
 (defun mode-line-minor-mode-help (event)
-  "Describe minor mode for EVENT occurred on minor modes area of the mode line."
+  "Describe minor mode for EVENT on minor modes area of the mode line."
   (interactive "@e")
   (let ((indicator (car (nth 4 (car (cdr event))))))
     (describe-minor-mode-from-indicator indicator)))
@@ -536,7 +557,7 @@ is okay.  See `mode-line-format'.")
        '(".elc" ".lof"
         ".glo" ".idx" ".lot"
         ;; TeX-related
-        ".dvi" ".fmt" ".tfm" ".pdf"
+        ".fmt" ".tfm"
         ;; Java compiled
         ".class"
         ;; CLISP
@@ -1035,7 +1056,7 @@ language you are using."
 (define-key ctl-x-map "rw" 'window-configuration-to-register)
 (define-key ctl-x-map "rf" 'frame-configuration-to-register)
 
-(define-key esc-map "q" 'fill-paragraph-or-region)
+(define-key esc-map "q" 'fill-paragraph)
 (define-key ctl-x-map "." 'set-fill-prefix)
 \f
 (define-key esc-map "{" 'backward-paragraph)
index 6390bd2dd81271a49189c6a61e450c499d0cbeda..bb2dbae83c0a5153eee22340702ba811b930d320 100644 (file)
     (""       2   2 left  "  ")
     ("File"   12 12 left  bs--get-file-name)
     (""       2   2 left  "  "))
-  "*List specifying the layout of a Buffer Selection Menu buffer.
+  "List specifying the layout of a Buffer Selection Menu buffer.
 Each entry specifies a column and is a list of the form of:
 \(HEADER MINIMUM-LENGTH MAXIMUM-LENGTH ALIGNMENT FUN-OR-STRING)
 
@@ -180,12 +180,7 @@ return a string representing the column's value."
 
 (defun bs--make-header-match-string ()
   "Return a regexp matching the first line of a Buffer Selection Menu buffer."
-  (let ((res "^\\(")
-       (ele bs-attributes-list))
-    (while ele
-      (setq res (concat res (car (car ele)) " *"))
-      (setq ele (cdr ele)))
-    (concat res "$\\)")))
+  (concat "^\\(" (mapconcat #'car bs-attributes-list " *") " *$\\)"))
 
 ;; Font-Lock-Settings
 (defvar bs-mode-font-lock-keywords
@@ -206,7 +201,7 @@ return a string representing the column's value."
   "Default font lock expressions for Buffer Selection Menu.")
 
 (defcustom bs-max-window-height 20
-  "*Maximal window height of Buffer Selection Menu."
+  "Maximal window height of Buffer Selection Menu."
   :group 'bs-appearance
   :type 'integer)
 
@@ -224,7 +219,7 @@ it is reset to nil.  Use `bs-must-always-show-regexp' to specify buffers
 that must always be shown regardless of the configuration.")
 
 (defcustom bs-must-always-show-regexp nil
-  "*Regular expression for specifying buffers to show always.
+  "Regular expression for specifying buffers to show always.
 A buffer whose name matches this regular expression will
 be shown regardless of current configuration of Buffer Selection Menu."
   :group 'bs
@@ -246,7 +241,7 @@ The function gets two arguments - the buffers to compare.
 It must return non-nil if the first buffer should sort before the second.")
 
 (defcustom bs-maximal-buffer-name-column 45
-  "*Maximum column width for buffer names.
+  "Maximum column width for buffer names.
 The column for buffer names has dynamic width.  The width depends on
 maximal and minimal length of names of buffers to show.  The maximal
 width is bounded by `bs-maximal-buffer-name-column'.
@@ -255,7 +250,7 @@ See also `bs-minimal-buffer-name-column'."
   :type 'integer)
 
 (defcustom bs-minimal-buffer-name-column 15
-  "*Minimum column width for buffer names.
+  "Minimum column width for buffer names.
 The column for buffer names has dynamic width.  The width depends on
 maximal and minimal length of names of buffers to show.  The minimal
 width is bounded by `bs-minimal-buffer-name-column'.
@@ -272,7 +267,7 @@ See also `bs-maximal-buffer-name-column'."
     ("files-and-scratch" "^\\*scratch\\*$" nil nil bs-visits-non-file
      bs-sort-buffer-interns-are-last)
     ("all-intern-last" nil nil nil nil bs-sort-buffer-interns-are-last))
-  "*List of all configurations you can use in the Buffer Selection Menu.
+  "List of all configurations you can use in the Buffer Selection Menu.
 A configuration describes which buffers appear in Buffer Selection Menu
 and also the order of buffers.  A configuration is a list with
 six elements.  The first element is a string and describes the configuration.
@@ -284,7 +279,7 @@ By setting these variables you define a configuration."
   :type '(repeat sexp))
 
 (defcustom bs-default-configuration "files"
-  "*Name of default configuration used by the Buffer Selection Menu.
+  "Name of default configuration used by the Buffer Selection Menu.
 \\<bs-mode-map>
 Will be changed using key \\[bs-select-next-configuration].
 Must be a string used in `bs-configurations' for naming a configuration."
@@ -292,7 +287,7 @@ Must be a string used in `bs-configurations' for naming a configuration."
   :type 'string)
 
 (defcustom bs-alternative-configuration "all"
-  "*Name of configuration used when calling `bs-show' with \
+  "Name of configuration used when calling `bs-show' with \
 \\[universal-argument] as prefix key.
 Must be a string used in `bs-configurations' for naming a configuration."
   :group 'bs
@@ -303,7 +298,7 @@ Must be a string used in `bs-configurations' for naming a configuration."
 Must be a string used in `bs-configurations' for naming a configuration.")
 
 (defcustom bs-cycle-configuration-name nil
-  "*Name of configuration used when cycling through the buffer list.
+  "Name of configuration used when cycling through the buffer list.
 A value of nil means to use current configuration `bs-default-configuration'.
 Must be a string used in `bs-configurations' for naming a configuration."
   :group 'bs
@@ -311,32 +306,32 @@ Must be a string used in `bs-configurations' for naming a configuration."
    string))
 
 (defcustom bs-string-show-always "+"
-  "*String added in column 1 indicating a buffer will always be shown."
+  "String added in column 1 indicating a buffer will always be shown."
   :group 'bs-appearance
   :type 'string)
 
 (defcustom bs-string-show-never "-"
-  "*String added in column 1 indicating a buffer will never be shown."
+  "String added in column 1 indicating a buffer will never be shown."
   :group 'bs-appearance
   :type 'string)
 
 (defcustom bs-string-current "."
-  "*String added in column 1 indicating the current buffer."
+  "String added in column 1 indicating the current buffer."
   :group 'bs-appearance
   :type 'string)
 
 (defcustom bs-string-current-marked "#"
-  "*String added in column 1 indicating the current buffer when it is marked."
+  "String added in column 1 indicating the current buffer when it is marked."
   :group 'bs-appearance
   :type 'string)
 
 (defcustom bs-string-marked ">"
-  "*String added in column 1 indicating a marked buffer."
+  "String added in column 1 indicating a marked buffer."
   :group 'bs-appearance
   :type 'string)
 
 (defcustom bs-string-show-normally  " "
-  "*String added in column 1 indicating an unmarked buffer."
+  "String added in column 1 indicating an unmarked buffer."
   :group 'bs-appearance
   :type 'string)
 
@@ -390,7 +385,7 @@ A value of `always' means to show buffer regardless of the configuration.")
     ("by mode"     bs--sort-by-mode     "Mode"   region)
     ("by filename" bs--sort-by-filename "File"   region)
     ("by nothing"  nil                  nil      nil))
-  "*List of all possible sorting aspects for Buffer Selection Menu.
+  "List of all possible sorting aspects for Buffer Selection Menu.
 You can add a new entry with a call to `bs-define-sort-function'.
 Each element is a list of four elements (NAME FUNCTION REGEXP-FOR-SORTING FACE).
 NAME specifies the sort order defined by function FUNCTION.
@@ -425,7 +420,7 @@ The new sort aspect will be inserted into list `bs-sort-functions'."
 This is an element of `bs-sort-functions'.")
 
 (defcustom bs-default-sort-name "by nothing"
-  "*Name of default sort behavior.
+  "Name of default sort behavior.
 Must be \"by nothing\" or a string used in `bs-sort-functions' for
 naming a sort behavior.  Default is \"by nothing\" which means no sorting."
   :group 'bs
@@ -445,7 +440,6 @@ defined by current configuration `bs-current-configuration'.")
 
 (defvar bs--window-config-coming-from nil
   "Window configuration before starting Buffer Selection Menu.")
-(make-variable-frame-local 'bs--window-config-coming-from)
 
 (defvar bs--intern-show-never "^ \\|\\*buffer-selection\\*"
   "Regular expression specifying which buffers never to show.
@@ -529,45 +523,43 @@ a special function.  SORT-DESCRIPTION is an element of `bs-sort-functions'."
   (setq sort-description (or sort-description bs--current-sort-function)
        list (or list (buffer-list)))
   (let ((result nil))
-    (while list
-      (let* ((buffername (buffer-name (car list)))
-            (int-show-never (string-match bs--intern-show-never buffername))
+    (dolist (buf list)
+      (let* ((buffername (buffer-name buf))
+            (int-show-never (string-match-p bs--intern-show-never buffername))
             (ext-show-never (and bs-dont-show-regexp
-                                 (string-match bs-dont-show-regexp
-                                               buffername)))
+                                 (string-match-p bs-dont-show-regexp
+                                                 buffername)))
             (extern-must-show (or (and bs-must-always-show-regexp
-                                       (string-match
+                                       (string-match-p
                                         bs-must-always-show-regexp
                                         buffername))
                                   (and bs-must-show-regexp
-                                       (string-match bs-must-show-regexp
-                                                     buffername))))
+                                       (string-match-p bs-must-show-regexp
+                                                       buffername))))
             (extern-show-never-from-fun (and bs-dont-show-function
                                              (funcall bs-dont-show-function
-                                                      (car list))))
+                                                      buf)))
             (extern-must-show-from-fun (and bs-must-show-function
                                             (funcall bs-must-show-function
-                                                     (car list))))
-            (show-flag (buffer-local-value 'bs-buffer-show-mark (car list))))
-       (if (or (eq show-flag 'always)
-               (and (or bs--show-all (not (eq show-flag 'never)))
-                    (not int-show-never)
-                    (or bs--show-all
-                        extern-must-show
-                        extern-must-show-from-fun
-                        (and (not ext-show-never)
-                             (not extern-show-never-from-fun)))))
-           (setq result (cons (car list)
-                              result)))
-       (setq list (cdr list))))
+                                                     buf)))
+            (show-flag (buffer-local-value 'bs-buffer-show-mark buf)))
+       (when (or (eq show-flag 'always)
+                 (and (or bs--show-all (not (eq show-flag 'never)))
+                      (not int-show-never)
+                      (or bs--show-all
+                          extern-must-show
+                          extern-must-show-from-fun
+                          (and (not ext-show-never)
+                               (not extern-show-never-from-fun)))))
+         (setq result (cons buf result)))))
     (setq result (reverse result))
     ;; The current buffer which was the start point of bs should be an element
     ;; of result list, so that we can leave with space and be back in the
     ;; buffer we started bs-show.
-    (if (and bs--buffer-coming-from
-            (buffer-live-p bs--buffer-coming-from)
-            (not (memq bs--buffer-coming-from result)))
-       (setq result (cons bs--buffer-coming-from result)))
+    (when (and bs--buffer-coming-from
+              (buffer-live-p bs--buffer-coming-from)
+              (not (memq bs--buffer-coming-from result)))
+      (setq result (cons bs--buffer-coming-from result)))
     ;; sorting
     (if (and sort-description
             (nth 1 sort-description))
@@ -587,8 +579,8 @@ If KEEP-LINE-P is non-nil the point will stay on current line.
 SORT-DESCRIPTION is an element of `bs-sort-functions'."
   (let ((line (1+ (count-lines 1 (point)))))
     (bs-show-in-buffer (bs-buffer-list nil sort-description))
-    (if keep-line-p
-       (goto-line line))
+    (when keep-line-p
+      (goto-line line))
     (beginning-of-line)))
 
 (defun bs--goto-current-buffer ()
@@ -602,10 +594,10 @@ actually the line which begins with character in `bs-string-current' or
        point)
     (save-excursion
       (goto-char (point-min))
-      (if (search-forward-regexp regexp nil t)
-         (setq point (- (point) 1))))
-    (if point
-       (goto-char point))))
+      (when (search-forward-regexp regexp nil t)
+       (setq point (1- (point)))))
+    (when point
+      (goto-char point))))
 
 (defun bs--current-config-message ()
   "Return a string describing the current `bs-mode' configuration."
@@ -614,7 +606,23 @@ actually the line which begins with character in `bs-string-current' or
     (format "Show buffer by configuration %S"
            bs-current-configuration)))
 
-(defun bs-mode ()
+(defun bs--track-window-changes (frame)
+  "Track window changes to refresh the buffer list.
+Used from `window-size-change-functions'."
+  (let ((win (get-buffer-window "*buffer-selection*" frame)))
+    (when win
+      (with-selected-window win
+       (bs-refresh)
+       (bs--set-window-height)))))
+
+(defun bs--remove-hooks ()
+  "Remove `bs--track-window-changes' and auxiliary hooks."
+  (remove-hook 'window-size-change-functions 'bs--track-window-changes)
+  ;; Remove itself
+  (remove-hook 'kill-buffer-hook 'bs--remove-hooks t)
+  (remove-hook 'change-major-mode-hook 'bs--remove-hooks t))
+
+(define-derived-mode bs-mode nil "Buffer-Selection-Menu"
   "Major mode for editing a subset of Emacs' buffers.
 \\<bs-mode-map>
 Aside from two header lines each line describes one buffer.
@@ -647,27 +655,27 @@ available Buffer Selection Menu configuration.
 to show always.
 \\[bs-visit-tags-table] -- call `visit-tags-table' on current line's buffer.
 \\[bs-help] -- display this help text."
-  (interactive)
-  (kill-all-local-variables)
-  (use-local-map bs-mode-map)
   (make-local-variable 'font-lock-defaults)
   (make-local-variable 'font-lock-verbose)
   (make-local-variable 'font-lock-global-modes)
   (buffer-disable-undo)
-  (setq major-mode 'bs-mode
-       mode-name "Buffer-Selection-Menu"
-       buffer-read-only t
+  (setq buffer-read-only t
        truncate-lines t
        show-trailing-whitespace nil
        font-lock-global-modes '(not bs-mode)
        font-lock-defaults '(bs-mode-font-lock-keywords t)
        font-lock-verbose nil)
-  (run-mode-hooks 'bs-mode-hook))
+  (add-hook 'window-size-change-functions 'bs--track-window-changes)
+  (add-hook 'kill-buffer-hook 'bs--remove-hooks nil t)
+  (add-hook 'change-major-mode-hook 'bs--remove-hooks nil t))
 
 (defun bs--restore-window-config ()
   "Restore window configuration on the current frame."
   (when bs--window-config-coming-from
-    (set-window-configuration bs--window-config-coming-from)
+    (let ((frame (selected-frame)))
+      (unwind-protect
+          (set-window-configuration bs--window-config-coming-from)
+       (select-frame frame)))
     (setq bs--window-config-coming-from nil)))
 
 (defun bs-kill ()
@@ -705,8 +713,8 @@ Raise an error if not on a buffer line."
   (beginning-of-line)
   (let ((line (+ (- bs-header-lines-length)
                 (count-lines 1 (point)))))
-    (if (< line 0)
-       (error "You are on a header row"))
+    (when (< line 0)
+      (error "You are on a header row"))
     (nth line bs-current-list)))
 
 (defun bs--update-current-line ()
@@ -736,19 +744,18 @@ Leave Buffer Selection Menu."
     (bury-buffer (current-buffer))
     (bs--restore-window-config)
     (switch-to-buffer buffer)
-    (if bs--marked-buffers
-       ;; Some marked buffers for selection
-       (let* ((all (delq buffer bs--marked-buffers))
-              (height (/ (1- (frame-height)) (1+ (length all)))))
-         (delete-other-windows)
-         (switch-to-buffer buffer)
-         (while all
-           (split-window nil height)
-           (other-window 1)
-           (switch-to-buffer (car all))
-           (setq all (cdr all)))
-         ;; goto window we have started bs.
-         (other-window 1)))))
+    (when bs--marked-buffers
+      ;; Some marked buffers for selection
+      (let* ((all (delq buffer bs--marked-buffers))
+            (height (/ (1- (frame-height)) (1+ (length all)))))
+       (delete-other-windows)
+       (switch-to-buffer buffer)
+       (dolist (buf all)
+         (split-window nil height)
+         (other-window 1)
+         (switch-to-buffer buf))
+       ;; goto window we have started bs.
+       (other-window 1)))))
 
 (defun bs-select-other-window ()
   "Select current line's buffer by `switch-to-buffer-other-window'.
@@ -912,11 +919,10 @@ WHAT is a value of nil, `never', or `always'."
     (delete-region (point) (save-excursion
                             (end-of-line)
                             (if (eobp) (point) (1+ (point)))))
-    (if (eobp)
-       (progn
-         (backward-delete-char 1)
-         (beginning-of-line)
-         (recenter -1)))
+    (when (eobp)
+      (backward-delete-char 1)
+      (beginning-of-line)
+      (recenter -1))
     (bs--set-window-height)))
 
 (defun bs-delete-backward ()
@@ -945,14 +951,14 @@ Default is `bs--current-sort-function'."
                              bs--current-sort-function)))
     (save-excursion
       (goto-char (point-min))
-      (if (and (nth 2 sort-description)
-              (search-forward-regexp (nth 2 sort-description) nil t))
-         (let ((inhibit-read-only t))
-           (put-text-property (match-beginning 0)
-                              (match-end 0)
-                              'face
-                              (or (nth 3 sort-description)
-                                  'region)))))))
+      (when (and (nth 2 sort-description)
+                (search-forward-regexp (nth 2 sort-description) nil t))
+       (let ((inhibit-read-only t))
+         (put-text-property (match-beginning 0)
+                            (match-end 0)
+                            'face
+                            (or (nth 3 sort-description)
+                                'region)))))))
 
 (defun bs-toggle-show-all ()
   "Toggle show all buffers / show buffers with current configuration."
@@ -983,10 +989,8 @@ Uses function `vc-toggle-read-only'."
 
 (defun bs--nth-wrapper (count fun &rest args)
   "Call COUNT times function FUN with arguments ARGS."
-  (setq count (or count 1))
-  (while (> count 0)
-    (apply fun args)
-    (setq count (1- count))))
+  (dotimes (i (or count 1))
+    (apply fun args)))
 
 (defun bs-up (arg)
   "Move cursor vertically up ARG lines in Buffer Selection Menu."
@@ -1026,7 +1030,7 @@ A value of nil means BUFFER belongs to a file."
 
 (defun bs-sort-buffer-interns-are-last (b1 b2)
   "Function for sorting internal buffers at the end of all buffers."
-  (string-match "^\\*" (buffer-name b2)))
+  (string-match-p "^\\*" (buffer-name b2)))
 
 ;; ----------------------------------------------------------------------
 ;; Configurations:
@@ -1108,8 +1112,8 @@ Will return the first if START-NAME is at end."
        (length (length list))
        pos)
     (while (and assocs (not pos))
-      (if (string= (car (car assocs)) start-name)
-         (setq pos (- length (length assocs))))
+      (when (string= (car (car assocs)) start-name)
+       (setq pos (- length (length assocs))))
       (setq assocs (cdr assocs)))
     (setq pos (1+ pos))
     (if (eq pos length)
@@ -1151,10 +1155,9 @@ and move point to current buffer."
     (erase-buffer)
     (setq bs--name-entry-length name-entry-length)
     (bs--show-header)
-    (while list
-      (bs--insert-one-entry (car list))
-      (insert "\n")
-      (setq list (cdr list)))
+    (dolist (buffer list)
+      (bs--insert-one-entry buffer)
+      (insert "\n"))
     (delete-backward-char 1)
     (bs--set-window-height)
     (bs--goto-current-buffer)
@@ -1348,27 +1351,21 @@ It goes over all columns described in `bs-attributes-list'
 and evaluates corresponding string.  Inserts string in current buffer;
 normally *buffer-selection*."
   (let ((string "")
-       (columns bs-attributes-list)
        (to-much 0)
         (apply-args (append (list bs--buffer-coming-from bs-current-list))))
     (save-excursion
-      (while columns
-       (set-buffer buffer)
-       (let ((min   (bs--get-value (nth 1 (car columns))))
-             ;;(max   (bs--get-value (nth 2 (car columns)))) refered no more
-             (align (nth 3 (car columns)))
-             (fun   (nth 4 (car columns)))
-             (val   nil)
-             new-string)
-         (setq val (bs--get-value fun apply-args))
-         (setq new-string (bs--format-aux val align (- min to-much)))
+      (set-buffer buffer)
+      (dolist (column bs-attributes-list)
+       (let* ((min (bs--get-value (nth 1 column)))
+              (new-string (bs--format-aux (bs--get-value (nth 4 column) ; fun
+                                                         apply-args)
+                                          (nth 3 column)                ; align
+                                          (- min to-much)))
+              (len (length new-string)))
          (setq string (concat string new-string))
-         (if (> (length new-string) min)
-             (setq to-much (- (length new-string) min)))
-         )                             ; let
-       (setq columns (cdr columns))))
-    (insert string)
-    string))
+         (when (> len min)
+           (setq to-much (- len min))))))
+    (insert string)))
 
 (defun bs--format-aux (string align len)
   "Pad STRING to length LEN with alignment ALIGN.
@@ -1382,28 +1379,26 @@ ALIGN is one of the symbols `left', `middle', or `right'."
 
 (defun bs--show-header ()
   "Insert header for Buffer Selection Menu in current buffer."
-  (dolist (string (bs--create-header))
-    (insert string "\n")))
+  (insert (bs--create-header-line #'identity)
+         "\n"
+         (bs--create-header-line (lambda (title)
+                                   (make-string (length title) ?-)))
+         "\n"))
 
 (defun bs--get-name-length ()
   "Return value of `bs--name-entry-length'."
   bs--name-entry-length)
 
-(defun bs--create-header ()
-  "Return all header lines used in Buffer Selection Menu as a list of strings."
-  (list (mapconcat (lambda (column)
-                    (bs--format-aux (bs--get-value (car column))
-                                    (nth 3 column) ; align
-                                    (bs--get-value (nth 1 column))))
-                  bs-attributes-list
-                  "")
-       (mapconcat (lambda (column)
-                    (let ((length (length (bs--get-value (car column)))))
-                      (bs--format-aux (make-string length ?-)
-                                      (nth 3 column) ; align
-                                      (bs--get-value (nth 1 column)))))
-                  bs-attributes-list
-                  "")))
+(defun bs--create-header-line (col)
+  "Generate a line for the header.
+COL is called for each column in `bs-attributes-list' as a
+function of one argument, the string heading for the column."
+  (mapconcat (lambda (column)
+              (bs--format-aux (funcall col (bs--get-value (car column)))
+                              (nth 3 column) ; align
+                              (bs--get-value (nth 1 column))))
+            bs-attributes-list
+            ""))
 
 (defun bs--show-with-configuration (name &optional arg)
   "Display buffer list of configuration with name NAME.
@@ -1424,14 +1419,14 @@ for buffer selection."
       (setq bs--buffer-coming-from (current-buffer)))
     (let ((liste (bs-buffer-list))
          (active-window (get-window-with-predicate
-                          (lambda (w)
-                            (string= (buffer-name (window-buffer w))
-                                     "*buffer-selection*")))))
+                         (lambda (w)
+                           (string= (buffer-name (window-buffer w))
+                                    "*buffer-selection*"))
+                         nil (selected-frame))))
       (if active-window
          (select-window active-window)
-        (modify-frame-parameters nil
-                                 (list (cons 'bs--window-config-coming-from
-                                             (current-window-configuration))))
+       (bs--restore-window-config)
+       (setq bs--window-config-coming-from (current-window-configuration))
        (when (> (window-height (selected-window)) 7)
           (split-window-vertically)
           (other-window 1)))
index 7bdb195543aa858de92824312b6a9be34ed92f17..16b53acb6da8ed1f72f7c04ff46008169f683c0a 100644 (file)
@@ -1682,14 +1682,14 @@ Otherwise, for buffers inheriting from dired-mode, call `toggle-read-only'."
   "Move down lines then position at filename.
 Optional prefix ARG says how many lines to move; default is one line."
   (interactive "p")
-  (next-line arg)
+  (forward-line arg)
   (dired-move-to-filename))
 
 (defun dired-previous-line (arg)
   "Move up lines then position at filename.
 Optional prefix ARG says how many lines to move; default is one line."
   (interactive "p")
-  (previous-line arg)
+  (forward-line (- arg))
   (dired-move-to-filename))
 
 (defun dired-next-dirline (arg &optional opoint)
index d7d2bb47abbe58d92cbd53a28faf4d0df6a26ba7..d93a8ca316d5d59e64275642bc5379f33f999ed2 100644 (file)
@@ -5,7 +5,6 @@
 ;; Author: Tassilo Horn <tassilo@member.fsf.org>
 ;; Maintainer: Tassilo Horn <tassilo@member.fsf.org>
 ;; Keywords: files, pdf, ps, dvi
-;; Version: <2007-10-02 Tue 18:21>
 
 ;; This file is part of GNU Emacs.
 
@@ -26,9 +25,9 @@
 
 ;;; Requirements:
 
-;; doc-view.el requires GNU Emacs 22.1 or newer.  You also need GhostScript,
-;; `dvipdfm' which comes with TeTeX and `pdftotext', which comes with poppler
-;; (http://poppler.freedesktop.org/).
+;; doc-view.el requires GNU Emacs 22.1 or newer.  You also need Ghostscript,
+;; `dvipdfm' which comes with teTeX and `pdftotext', which comes with xpdf
+;; (http://www.foolabs.com/xpdf/) or poppler (http://poppler.freedesktop.org/).
 
 ;;; Commentary:
 
 ;; inside an Emacs buffer.  This buffer uses `doc-view-mode' which provides
 ;; convenient key bindings for browsing the document.
 ;;
-;; To use it simply do
+;; To use it simply open a document file with
 ;;
-;;     M-x doc-view RET
+;;     C-x C-f ~/path/to/document RET
 ;;
-;; and you'll be queried for a document to open.
+;; and the document will be converted and displayed, if your emacs supports png
+;; images.  With `C-c C-c' you can toggle between the rendered images
+;; representation and the source text representation of the document.  With
+;; `C-c C-e' you can switch to an appropriate editing mode for the document.
 ;;
 ;; Since conversion may take some time all the PNG images are cached in a
 ;; subdirectory of `doc-view-cache-directory' and reused when you want to view
-;; that file again.  This reusing can be omitted if you provide a prefx
-;; argument to `doc-view'.  To delete all cached files use
+;; that file again.  To reconvert a document hit `g' (`doc-view-reconvert-doc')
+;; when displaying the document.  To delete all cached files use
 ;; `doc-view-clear-cache'.  To open the cache with dired, so that you can tidy
 ;; it out use `doc-view-dired-cache'.
 ;;
@@ -67,8 +69,6 @@
 ;; bottom-right corner of the desired slice.  To reset the slice use
 ;; `doc-view-reset-slice' (bound to `s r').
 ;;
-;; Dired users should have a look at `doc-view-dired'.
-;;
 ;; You can also search within the document.  The command `doc-view-search'
 ;; (bound to `C-s') queries for a search regexp and initializes a list of all
 ;; matching pages and messages how many match-pages were found.  After that you
 ;; conversion.  When that finishes and you're still viewing the document
 ;; (i.e. you didn't switch to another buffer) you're queried for the regexp
 ;; then.
+;;
+;; Dired users can simply hit `v' on a document file.  If it's a PS, PDF or DVI
+;; it will be opened using `doc-view-mode'.
+;;
 
 ;;; Configuration:
 
-;; Basically doc-view should be quite usable with its standard settings, so
-;; putting
-;;
-;;     (require 'doc-view)
-;;
-;; into your `user-init-file' should be enough.  If the images are too small or
-;; too big you should set the "-rXXX" option in `doc-view-ghostscript-options'
-;; to another value.  (The bigger your screen, the higher the value.)
+;; If the images are too small or too big you should set the "-rXXX" option in
+;; `doc-view-ghostscript-options' to another value.  (The bigger your screen,
+;; the higher the value.)
 ;;
 ;; This and all other options can be set with the customization interface.
 ;; Simply do
 ;;; Code:
 
 (require 'dired)
+(require 'image-mode)
 (eval-when-compile (require 'cl))
 
 ;;;; Customization Options
   :group 'multimedia
   :prefix "doc-view-")
 
-(defcustom doc-view-ghostscript-program "gs"
+(defcustom doc-view-ghostscript-program (executable-find "gs")
   "Program to convert PS and PDF files to PNG."
-  :type '(file)
+  :type 'file
   :group 'doc-view)
 
 (defcustom doc-view-ghostscript-options
-  '("-dNOPAUSE" "-sDEVICE=png16m" "-dTextAlphaBits=4"
-    "-dBATCH" "-dGraphicsAlphaBits=4" "-dQUIET"
-    "-r100")
-  "A list of options to give to ghostview."
-  :type '(sexp)
+  '("-dSAFER" ;; Avoid security problems when rendering files from untrusted
+             ;; sources.
+    "-dNOPAUSE" "-sDEVICE=png16m" "-dTextAlphaBits=4"
+    "-dBATCH" "-dGraphicsAlphaBits=4" "-dQUIET" "-r100")
+  "A list of options to give to ghostscript."
+  :type '(repeat string)
   :group 'doc-view)
 
-(defcustom doc-view-dvipdfm-program "dvipdfm"
+(defcustom doc-view-dvipdfm-program (executable-find "dvipdfm")
   "Program to convert DVI files to PDF.
 
 DVI file will be converted to PDF before the resulting PDF is
 converted to PNG."
-  :type '(file)
+  :type 'file
   :group 'doc-view)
 
-(defcustom doc-view-ps2pdf-program "ps2pdf"
+(defcustom doc-view-ps2pdf-program (executable-find "ps2pdf")
   "Program to convert PS files to PDF.
 
 PS files will be converted to PDF before searching is possible."
-  :type '(file)
+  :type 'file
   :group 'doc-view)
 
-(defcustom doc-view-pdftotext-program "pdftotext"
+(defcustom doc-view-pdftotext-program (executable-find "pdftotext")
   "Program to convert PDF files to plain text.
 
 Needed for searching."
-  :type '(file)
+  :type 'file
   :group 'doc-view)
 
 (defcustom doc-view-cache-directory (concat temporary-file-directory
                                            "doc-view")
   "The base directory, where the PNG images will be saved."
-  :type '(directory)
+  :type 'directory
   :group 'doc-view)
 
 (defcustom doc-view-conversion-buffer "*doc-view conversion output*"
   "The buffer where messages from the converter programs go to."
-  :type '(string)
+  :type 'string
   :group 'doc-view)
 
 (defcustom doc-view-conversion-refresh-interval 3
@@ -166,7 +167,7 @@ After such an refresh newly converted pages will be available for
 viewing.  If set to nil there won't be any refreshes and the
 pages won't be displayed before conversion of the whole document
 has finished."
-  :type '(string)
+  :type 'integer
   :group 'doc-view)
 
 ;;;; Internal Variables
@@ -201,7 +202,10 @@ has finished."
 (defvar doc-view-current-info nil
   "Only used internally.")
 
-;;;; DocView Keymap
+(defvar doc-view-current-display nil
+  "Only used internally.")
+
+;;;; DocView Keymaps
 
 (defvar doc-view-mode-map
   (let ((map (make-sparse-keymap)))
@@ -218,7 +222,6 @@ has finished."
     ;; Killing/burying the buffer (and the process)
     (define-key map (kbd "q")         'bury-buffer)
     (define-key map (kbd "k")         'doc-view-kill-proc-and-buffer)
-    (define-key map (kbd "C-x k")     'doc-view-kill-proc-and-buffer)
     ;; Slicing the image
     (define-key map (kbd "s s")       'doc-view-set-slice)
     (define-key map (kbd "s m")       'doc-view-set-slice-using-mouse)
@@ -229,15 +232,40 @@ has finished."
     (define-key map (kbd "C-S-n")     'doc-view-search-next-match)
     (define-key map (kbd "C-S-p")     'doc-view-search-previous-match)
     ;; Scrolling
+    (define-key map (kbd "<right>")   'image-forward-hscroll)
+    (define-key map (kbd "<left>")    'image-backward-hscroll)
+    (define-key map (kbd "<down>")    'image-next-line)
+    (define-key map (kbd "<up>")      'image-previous-line)
+    (define-key map (kbd "C-f")       'image-forward-hscroll)
+    (define-key map (kbd "C-b")       'image-backward-hscroll)
+    (define-key map (kbd "C-n")       'image-next-line)
+    (define-key map (kbd "C-p")       'image-previous-line)
     (define-key map (kbd "C-v")       'scroll-up)
     (define-key map (kbd "<mouse-4>") 'mwheel-scroll)
     (define-key map (kbd "<mouse-5>") 'mwheel-scroll)
     (define-key map (kbd "M-v")       'scroll-down)
     ;; Show the tooltip
     (define-key map (kbd "C-t")       'doc-view-show-tooltip)
+    ;; Toggle between text and image display or editing
+    (define-key map (kbd "C-c C-c")   'doc-view-toggle-display)
+    (define-key map (kbd "C-c C-e")   'doc-view-edit-doc)
+    ;; Reconvert the current document
+    (define-key map (kbd "g")         'doc-view-reconvert-doc)
     (suppress-keymap map)
     map)
-  "Keymap used by `doc-view-mode'.")
+  "Keymap used by `doc-view-mode' when displaying a doc as a set of images.")
+
+(defvar doc-view-mode-text-map
+  (let ((map (make-sparse-keymap)))
+    ;; Toggle between text and image display or editing
+    (define-key map (kbd "C-c C-c") 'doc-view-toggle-display)
+    (define-key map (kbd "C-c C-e") 'doc-view-edit-doc)
+    ;; Killing/burying the buffer (and the process)
+    (define-key map (kbd "q")         'bury-buffer)
+    (define-key map (kbd "k")         'doc-view-kill-proc-and-buffer)
+    (define-key map (kbd "C-x k")     'doc-view-kill-proc-and-buffer)
+    map)
+  "Keymap used by `doc-view-mode' when displaying a document as text.")
 
 ;;;; Navigation Commands
 
@@ -271,16 +299,16 @@ has finished."
                         (setq contexts (concat contexts "  - \"" m "\"\n")))
                       contexts)))))
     ;; Update the buffer
-    (setq inhibit-read-only t)
-    (erase-buffer)
-    (let ((beg (point)))
-      (doc-view-insert-image (nth (1- page) doc-view-current-files)
-                            :pointer 'arrow)
-      (put-text-property beg (point) 'help-echo doc-view-current-info))
-    (insert "\n" doc-view-current-info)
-    (goto-char (point-min))
-    (forward-char)
-    (setq inhibit-read-only nil)))
+    (let ((inhibit-read-only t))
+      (erase-buffer)
+      (let ((beg (point)))
+       (doc-view-insert-image (nth (1- page) doc-view-current-files)
+                              :pointer 'arrow)
+       (put-text-property beg (point) 'help-echo doc-view-current-info))
+      (insert "\n" doc-view-current-info)
+      (goto-char (point-min))
+      (forward-char))
+    (set-buffer-modified-p nil)))
 
 (defun doc-view-next-page (&optional arg)
   "Browse ARG pages forward."
@@ -317,52 +345,71 @@ has finished."
     (error (doc-view-previous-page)
           (goto-char (point-max)))))
 
+(defun doc-view-kill-proc ()
+  "Kill the current converter process."
+  (interactive)
+  (when doc-view-current-converter-process
+    (kill-process doc-view-current-converter-process))
+  (when doc-view-current-timer
+    (cancel-timer doc-view-current-timer)
+    (setq doc-view-current-timer nil))
+  (setq mode-line-process nil))
+
 (defun doc-view-kill-proc-and-buffer ()
   "Kill the current converter process and buffer."
   (interactive)
+  (doc-view-kill-proc)
   (when (eq major-mode 'doc-view-mode)
-    (when doc-view-current-converter-process
-      (kill-process doc-view-current-converter-process))
-    (when doc-view-current-timer
-      (cancel-timer doc-view-current-timer)
-      (setq doc-view-current-timer nil))
     (kill-buffer (current-buffer))))
 
 ;;;; Conversion Functions
 
-(defun doc-view-file-name-to-directory-name (file)
-  "Return the directory where the png files of FILE should be saved.
-
-It'a a subdirectory of `doc-view-cache-directory'."
+(defun doc-view-reconvert-doc (&rest args)
+  "Reconvert the current document.
+Should be invoked when the cached images aren't up-to-date."
+  (interactive)
+  (let ((inhibit-read-only t)
+       (doc doc-view-current-doc))
+    (doc-view-kill-proc)
+    ;; Clear the old cached files
+    (when (file-exists-p (doc-view-current-cache-dir))
+      (dired-delete-file (doc-view-current-cache-dir) 'always))
+    (doc-view-kill-proc-and-buffer)
+    (find-file doc)))
+
+(defun doc-view-current-cache-dir ()
+  "Return the directory where the png files of the current doc should be saved.
+It's a subdirectory of `doc-view-cache-directory'."
   (if doc-view-current-cache-dir
       doc-view-current-cache-dir
-    (file-name-as-directory
-     (concat (file-name-as-directory doc-view-cache-directory)
-            (with-temp-buffer
-              (insert-file-contents-literally file)
-              (md5 (current-buffer)))))))
+    (setq doc-view-current-cache-dir
+         (file-name-as-directory
+          (concat (file-name-as-directory doc-view-cache-directory)
+                  (let ((doc doc-view-current-doc))
+                    (with-temp-buffer
+                      (insert-file-contents-literally doc)
+                      (md5 (current-buffer)))))))))
 
 (defun doc-view-dvi->pdf-sentinel (proc event)
   "If DVI->PDF conversion was successful, convert the PDF to PNG now."
   (if (not (string-match "finished" event))
       (message "DocView: dvi->pdf process changed status to %s." event)
     (set-buffer (process-get proc 'buffer))
-    (setq doc-view-current-converter-process nil)
-    (message "DocView: finished conversion from DVI to PDF!")
+    (setq doc-view-current-converter-process nil
+         mode-line-process nil)
     ;; Now go on converting this PDF to a set of PNG files.
     (let* ((pdf (process-get proc 'pdf-file))
-          (png (concat (doc-view-file-name-to-directory-name
-                        doc-view-current-doc)
+          (png (concat (doc-view-current-cache-dir)
                        "page-%d.png")))
       (doc-view-pdf/ps->png pdf png))))
 
 (defun doc-view-dvi->pdf (dvi pdf)
   "Convert DVI to PDF asynchrounously."
-  (message "DocView: converting DVI to PDF now!")
   (setq doc-view-current-converter-process
-       (start-process "doc-view-dvi->pdf" doc-view-conversion-buffer
+       (start-process "dvi->pdf" doc-view-conversion-buffer
                       doc-view-dvipdfm-program
-                      "-o" pdf dvi))
+                      "-o" pdf dvi)
+       mode-line-process (list (format ":%s" doc-view-current-converter-process)))
   (set-process-sentinel doc-view-current-converter-process
                        'doc-view-dvi->pdf-sentinel)
   (process-put doc-view-current-converter-process 'buffer   (current-buffer))
@@ -373,24 +420,24 @@ It'a a subdirectory of `doc-view-cache-directory'."
   (if (not (string-match "finished" event))
       (message "DocView: converter process changed status to %s." event)
     (set-buffer (process-get proc 'buffer))
-    (setq doc-view-current-converter-process nil)
+    (setq doc-view-current-converter-process nil
+         mode-line-process nil)
     (when doc-view-current-timer
       (cancel-timer doc-view-current-timer)
       (setq doc-view-current-timer nil))
-    (message "DocView: finished conversion from PDF/PS to PNG!")
     ;; Yippie, finished.  Update the display!
     (doc-view-display doc-view-current-doc)))
 
 (defun doc-view-pdf/ps->png (pdf-ps png)
   "Convert PDF-PS to PNG asynchrounously."
-  (message "DocView: converting PDF or PS to PNG now!")
   (setq doc-view-current-converter-process
        (apply 'start-process
-              (append (list "doc-view-pdf/ps->png" doc-view-conversion-buffer
+              (append (list "pdf/ps->png" doc-view-conversion-buffer
                             doc-view-ghostscript-program)
                       doc-view-ghostscript-options
                       (list (concat "-sOutputFile=" png))
-                      (list pdf-ps))))
+                      (list pdf-ps)))
+       mode-line-process (list (format ":%s" doc-view-current-converter-process)))
   (process-put doc-view-current-converter-process
               'buffer (current-buffer))
   (set-process-sentinel doc-view-current-converter-process
@@ -398,7 +445,7 @@ It'a a subdirectory of `doc-view-cache-directory'."
   (when doc-view-conversion-refresh-interval
     (setq doc-view-current-timer
          (run-at-time "1 secs" doc-view-conversion-refresh-interval
-                      'doc-view-display
+                      'doc-view-display-maybe
                       doc-view-current-doc))))
 
 (defun doc-view-pdf->txt-sentinel (proc event)
@@ -407,8 +454,8 @@ It'a a subdirectory of `doc-view-cache-directory'."
     (let ((current-buffer (current-buffer))
          (proc-buffer    (process-get proc 'buffer)))
       (set-buffer proc-buffer)
-      (setq doc-view-current-converter-process nil)
-      (message "DocView: finished conversion from PDF to TXT!")
+      (setq doc-view-current-converter-process nil
+           mode-line-process nil)
       ;; If the user looks at the DocView buffer where the conversion was
       ;; performed, search anew.  This time it will be queried for a regexp.
       (when (eq current-buffer proc-buffer)
@@ -416,11 +463,11 @@ It'a a subdirectory of `doc-view-cache-directory'."
 
 (defun doc-view-pdf->txt (pdf txt)
   "Convert PDF to TXT asynchrounously."
-  (message "DocView: converting PDF to TXT now!")
   (setq doc-view-current-converter-process
-       (start-process "doc-view-pdf->txt" doc-view-conversion-buffer
+       (start-process "pdf->txt" doc-view-conversion-buffer
                       doc-view-pdftotext-program "-raw"
-                      pdf txt))
+                      pdf txt)
+       mode-line-process (list (format ":%s" doc-view-current-converter-process)))
   (set-process-sentinel doc-view-current-converter-process
                        'doc-view-pdf->txt-sentinel)
   (process-put doc-view-current-converter-process 'buffer (current-buffer)))
@@ -429,65 +476,45 @@ It'a a subdirectory of `doc-view-cache-directory'."
   (if (not (string-match "finished" event))
       (message "DocView: converter process changed status to %s." event)
     (set-buffer (process-get proc 'buffer))
-    (setq doc-view-current-converter-process nil)
-    (message "DocView: finished conversion from PS to PDF!")
+    (setq doc-view-current-converter-process nil
+         mode-line-process nil)
     ;; Now we can transform to plain text.
     (doc-view-pdf->txt (process-get proc 'pdf-file)
-                      (concat (doc-view-file-name-to-directory-name
-                               doc-view-current-doc)
+                      (concat (doc-view-current-cache-dir)
                               "doc.txt"))))
 
 (defun doc-view-ps->pdf (ps pdf)
   "Convert PS to PDF asynchronously."
-  (message "DocView: converting PS to PDF now!")
   (setq doc-view-current-converter-process
-       (start-process "doc-view-ps->pdf" doc-view-conversion-buffer
+       (start-process "ps->pdf" doc-view-conversion-buffer
                       doc-view-ps2pdf-program
-                      ps pdf))
+                      ps pdf
+                      ;; Avoid security problems when rendering files from
+                      ;; untrusted sources.
+                      "-dSAFER")
+       mode-line-process (list (format ":%s" doc-view-current-converter-process)))
   (set-process-sentinel doc-view-current-converter-process
                        'doc-view-ps->pdf-sentinel)
   (process-put doc-view-current-converter-process 'buffer   (current-buffer))
   (process-put doc-view-current-converter-process 'pdf-file pdf))
 
-(defun doc-view-convert-doc (doc)
-  "Convert DOC to a set of png files, one file per page.
-
-Those files are saved in the directory given by
-`doc-view-file-name-to-directory-name'."
+(defun doc-view-convert-current-doc ()
+  "Convert `doc-view-current-doc' to a set of png files, one file per page.
+Those files are saved in the directory given by the function
+`doc-view-current-cache-dir'."
   (clear-image-cache)
-  (let* ((dir (doc-view-file-name-to-directory-name doc))
-        (png-file (concat (file-name-as-directory dir) "page-%d.png")))
-    (when (file-exists-p dir)
-      (dired-delete-file dir 'always))
-    (make-directory dir t)
-    (if (not (string= (file-name-extension doc) "dvi"))
+  (let ((png-file (concat (doc-view-current-cache-dir)
+                         "page-%d.png")))
+    (make-directory doc-view-current-cache-dir t)
+    (if (not (string= (file-name-extension doc-view-current-doc) "dvi"))
        ;; Convert to PNG images.
-       (doc-view-pdf/ps->png doc png-file)
-      ;; DVI files have to be converted to PDF before GhostScript can process
+       (doc-view-pdf/ps->png doc-view-current-doc png-file)
+      ;; DVI files have to be converted to PDF before Ghostscript can process
       ;; it.
-      (doc-view-dvi->pdf doc
-                        (concat (file-name-as-directory dir)
+      (doc-view-dvi->pdf doc-view-current-doc
+                        (concat (file-name-as-directory doc-view-current-cache-dir)
                                 "doc.pdf")))))
 
-;;;; DocView Mode
-
-(define-derived-mode doc-view-mode nil "DocView"
-  "Major mode in DocView buffers.
-
-\\{doc-view-mode-map}"
-  :group 'doc-view
-  (setq buffer-read-only t)
-  (make-local-variable 'doc-view-current-files)
-  (make-local-variable 'doc-view-current-doc)
-  (make-local-variable 'doc-view-current-image)
-  (make-local-variable 'doc-view-current-page)
-  (make-local-variable 'doc-view-current-converter-process)
-  (make-local-variable 'doc-view-current-timer)
-  (make-local-variable 'doc-view-current-slice)
-  (make-local-variable 'doc-view-current-cache-dir)
-  (make-local-variable 'doc-view-current-info)
-  (make-local-variable 'doc-view-current-search-matches))
-
 ;;;; Slicing
 
 (defun doc-view-set-slice (x y width height)
@@ -555,19 +582,22 @@ Predicate for sorting `doc-view-current-files'."
        nil
       (string< a b))))
 
+(defun doc-view-display-maybe (doc)
+  "Call `doc-view-display' iff we're in the image display."
+  (when (eq doc-view-current-display 'image)
+    (doc-view-display doc)))
+
 (defun doc-view-display (doc)
   "Start viewing the document DOC."
-  (let ((dir (doc-view-file-name-to-directory-name doc)))
-    (set-buffer (format "*DocView: %s*" doc))
-    (setq doc-view-current-files
-         (sort (directory-files dir t "page-[0-9]+\\.png" t)
-               'doc-view-sort))
-    (when (> (length doc-view-current-files) 0)
-      (doc-view-goto-page doc-view-current-page))))
+  (set-buffer (get-file-buffer doc))
+  (setq doc-view-current-files
+       (sort (directory-files (doc-view-current-cache-dir) t
+                              "page-[0-9]+\\.png" t)
+             'doc-view-sort))
+  (when (> (length doc-view-current-files) 0)
+    (doc-view-goto-page doc-view-current-page)))
 
 (defun doc-view-buffer-message ()
-  (setq inhibit-read-only t)
-  (erase-buffer)
   (insert (propertize "Welcome to DocView!" 'face 'bold)
          "\n"
          "
@@ -580,12 +610,58 @@ For now these keys are useful:
 
 `q' : Bury this buffer.  Conversion will go on in background.
 `k' : Kill the conversion process and this buffer.\n")
-  (setq inhibit-read-only nil))
+  (set-buffer-modified-p nil))
 
 (defun doc-view-show-tooltip ()
   (interactive)
   (tooltip-show doc-view-current-info))
 
+;;;;; Toggle between text and image display
+
+(defun doc-view-toggle-display ()
+  "Start or stop displaying a document file as a set of images.
+This command toggles between showing the text of the document
+file and showing the document as a set of images."
+  (interactive)
+  (if (get-text-property (point-min) 'display)
+      ;; Switch to text display
+      (let ((inhibit-read-only t))
+       (erase-buffer)
+       (insert-file-contents doc-view-current-doc)
+       (use-local-map doc-view-mode-text-map)
+       (setq mode-name "DocView[text]"
+             doc-view-current-display 'text)
+       (if (called-interactively-p)
+           (message "Repeat this command to go back to displaying the file as images")))
+    ;; Switch to image display
+    (let ((inhibit-read-only t))
+      (erase-buffer)
+      (doc-view-buffer-message)
+      (setq doc-view-current-page (or doc-view-current-page 1))
+      (if (file-exists-p (doc-view-current-cache-dir))
+         (progn
+           (message "DocView: using cached files!")
+           (doc-view-display doc-view-current-doc))
+       (doc-view-convert-current-doc))
+      (use-local-map doc-view-mode-map)
+      (setq mode-name (format "DocView")
+           doc-view-current-display 'image)
+      (if (called-interactively-p)
+         (message "Repeat this command to go back to displaying the file as text"))))
+  (set-buffer-modified-p nil))
+
+;;;;; Leave doc-view-mode and open the file for edit
+
+(defun doc-view-edit-doc ()
+  "Leave `doc-view-mode' and open the current doc with an appropriate editing mode."
+  (interactive)
+  (let ((filename doc-view-current-doc)
+       (auto-mode-alist (append '(("\\.[eE]?[pP][sS]\\'" . ps-mode)
+                                  ("\\.\\(pdf\\|PDF\\|dvi\\|DVI\\)$" . fundamental-mode))
+                                auto-mode-alist)))
+    (kill-buffer (current-buffer))
+    (find-file filename)))
+
 ;;;; Searching
 
 (defun doc-view-search-internal (regexp file)
@@ -636,8 +712,7 @@ conversion finished."
   (interactive)
   ;; New search, so forget the old results.
   (setq doc-view-current-search-matches nil)
-  (let ((txt (concat (doc-view-file-name-to-directory-name
-                     doc-view-current-doc)
+  (let ((txt (concat (doc-view-current-cache-dir)
                     "doc.txt")))
     (if (file-readable-p txt)
        (progn
@@ -660,14 +735,12 @@ conversion finished."
            ;; Doc is a PS, so convert it to PDF (which will be converted to
            ;; TXT thereafter).
            (doc-view-ps->pdf doc-view-current-doc
-                             (concat (doc-view-file-name-to-directory-name
-                                      doc-view-current-doc)
+                             (concat (doc-view-current-cache-dir)
                                      "doc.pdf")))
           ((string= ext "dvi")
            ;; Doc is a DVI.  This means that a doc.pdf already exists in its
            ;; cache subdirectory.
-           (doc-view-pdf->txt (concat (doc-view-file-name-to-directory-name
-                                       doc-view-current-doc)
+           (doc-view-pdf->txt (concat (doc-view-current-cache-dir)
                                       "doc.pdf")
                               txt))
           (t (error "DocView doesn't know what to do"))))))))
@@ -698,52 +771,42 @@ conversion finished."
             (y-or-n-p "No more matches before current page.  Wrap to last match? "))
        (doc-view-goto-page (caar (last doc-view-current-search-matches)))))))
 
-;;;; User Interface Commands
+;;;; User interface commands and the mode
 
-;;;###autoload
-(defun doc-view (no-cache &optional file)
-  "Convert FILE to png and start viewing it.
-If no FILE is given, query for on.
-If this FILE is still in the cache, don't convert and use the
-existing page files.  With prefix arg NO-CACHE, don't use the
-cached files and convert anew."
-  (interactive "P")
-  (if (not (and (image-type-available-p 'png)
-               (display-images-p)))
-      (message "DocView: your emacs or display doesn't support png images.")
-    (let* ((doc (or file
-                   (expand-file-name
-                    (let ((completion-ignored-extensions
-                           ;; Don't hide files doc-view can display
-                           (remove-if (lambda (str)
-                                        (string-match "\\.\\(ps\\|pdf\\|dvi\\)$"
-                                                      str))
-                                      completion-ignored-extensions)))
-                      (read-file-name "File: " nil nil t)))))
-          (buffer (get-buffer-create (format "*DocView: %s*" doc)))
-          (dir (doc-view-file-name-to-directory-name doc)))
-      (switch-to-buffer buffer)
-      (doc-view-buffer-message)
-      (doc-view-mode)
-      (setq doc-view-current-doc doc)
-      (setq doc-view-current-page 1)
-      (if (not (and (file-exists-p dir)
-                   (not no-cache)))
-         (progn
-           (setq doc-view-current-cache-dir nil)
-           (doc-view-convert-doc doc-view-current-doc))
-       (message "DocView: using cached files!")
-       (doc-view-display doc-view-current-doc)))))
+(put 'doc-view-mode 'mode-class 'special)
 
-(defun doc-view-dired (no-cache)
-  "View the current dired file with doc-view.
-NO-CACHE is the same as in `doc-view'.
-
-You might want to bind this command to a dired key, e.g.
-
-    (define-key dired-mode-map (kbd \"C-c d\") 'doc-view-dired)"
-  (interactive "P")
-  (doc-view no-cache (dired-get-file-for-visit)))
+;;;###autoload
+(define-derived-mode doc-view-mode nil "DocView"
+  "Major mode in DocView buffers.
+You can use \\<doc-view-mode-map>\\[doc-view-toggle-display] to
+toggle between display as a set of images and display as text."
+  :group 'doc-view
+  (make-local-variable 'doc-view-current-files)
+  (make-local-variable 'doc-view-current-doc)
+  (make-local-variable 'doc-view-current-image)
+  (make-local-variable 'doc-view-current-page)
+  (make-local-variable 'doc-view-current-converter-process)
+  (make-local-variable 'doc-view-current-timer)
+  (make-local-variable 'doc-view-current-slice)
+  (make-local-variable 'doc-view-current-cache-dir)
+  (make-local-variable 'doc-view-current-info)
+  (make-local-variable 'doc-view-current-search-matches)
+  (setq doc-view-current-doc (buffer-file-name))
+  (insert-file-contents doc-view-current-doc)
+  (use-local-map doc-view-mode-text-map)
+  (setq mode-name "DocView[text]"
+       doc-view-current-display 'text
+       buffer-read-only t
+       revert-buffer-function 'doc-view-reconvert-doc)
+  ;; Switch to image display if possible
+  (if (and (display-images-p)
+          (image-type-available-p 'png)
+          (not (get-text-property (point-min) 'display)))
+      (doc-view-toggle-display))
+  (message
+   "%s"
+   (substitute-command-keys
+    "Type \\[doc-view-toggle-display] to toggle between image and text display.")))
 
 (defun doc-view-clear-cache ()
   "Delete the whole cache (`doc-view-cache-directory')."
index cabd0dd391ea9b61330ea3816ef6bc81962d2c3e..4a5c9149a4382d7cf568d5e35a7af683eefd3b6a 100644 (file)
@@ -2013,7 +2013,10 @@ On each iteration VAR will be bound to the name of an advised function
 (if (not (get 'ad-do-advised-functions 'lisp-indent-hook))
     (put 'ad-do-advised-functions 'lisp-indent-hook 1))
 
-(defmacro ad-get-advice-info (function)
+(defun ad-get-advice-info (function)
+  (get function 'ad-advice-info))
+
+(defmacro ad-get-advice-info-macro (function)
   `(get ,function 'ad-advice-info))
 
 (defmacro ad-set-advice-info (function advice-info)
@@ -2025,7 +2028,7 @@ On each iteration VAR will be bound to the name of an advised function
 (defmacro ad-is-advised (function)
   "Return non-nil if FUNCTION has any advice info associated with it.
 This does not mean that the advice is also active."
-  (list 'ad-get-advice-info function))
+  (list 'ad-get-advice-info-macro function))
 
 (defun ad-initialize-advice-info (function)
   "Initialize the advice info for FUNCTION.
@@ -2035,16 +2038,16 @@ Assumes that FUNCTION has not yet been advised."
 
 (defmacro ad-get-advice-info-field (function field)
   "Retrieve the value of the advice info FIELD of FUNCTION."
-  `(cdr (assq ,field (ad-get-advice-info ,function))))
+  `(cdr (assq ,field (ad-get-advice-info-macro ,function))))
 
 (defun ad-set-advice-info-field (function field value)
   "Destructively modify VALUE of the advice info FIELD of FUNCTION."
   (and (ad-is-advised function)
-       (cond ((assq field (ad-get-advice-info function))
+       (cond ((assq field (ad-get-advice-info-macro function))
              ;; A field with that name is already present:
-              (rplacd (assq field (ad-get-advice-info function)) value))
+              (rplacd (assq field (ad-get-advice-info-macro function)) value))
             (t;; otherwise, create a new field with that name:
-             (nconc (ad-get-advice-info function)
+             (nconc (ad-get-advice-info-macro function)
                     (list (cons field value)))))))
 
 ;; Don't make this a macro so we can use it as a predicate:
index 6a259ffd4f715405a2e2c4e241753dc4ad915fed..20b91b10547a0694093390e5cece95e467efc237 100644 (file)
@@ -46,8 +46,6 @@
 
 ;;; Code:
 
-(require 'loadhist)
-
 ;;; User variables:
 
 (defgroup find-function nil
index 0c1b3b170cdf57e3f94188e845309a5a0daa24fd..fd002409a7f59d0228307483221df5943b872e14 100644 (file)
@@ -633,7 +633,7 @@ This is *not* a user option, since Emerge uses it for its own processing.")
           (if output-file
               (concat "Output to file: " output-file)
             (concat "Output to buffer: " (buffer-name merge-buffer))))
-     (insert-buffer emerge-A-buffer)
+     (save-excursion (insert-buffer-substring emerge-A-buffer))
      (emerge-set-keys)
      (setq emerge-difference-list (emerge-make-diff-list file-A file-B))
      (setq emerge-number-of-differences (length emerge-difference-list))
@@ -712,7 +712,7 @@ This is *not* a user option, since Emerge uses it for its own processing.")
   (emerge-eval-in-buffer
    emerge-diff-error-buffer
    (erase-buffer)
-   (insert-buffer emerge-diff-buffer)
+   (save-excursion (insert-buffer-substring emerge-diff-buffer))
    (delete-matching-lines ok-regexp)))
 
 ;;; Top-level and setup functions for three-file mode.
@@ -802,7 +802,7 @@ This is *not* a user option, since Emerge uses it for its own processing.")
           (if output-file
               (concat "Output to file: " output-file)
             (concat "Output to buffer: " (buffer-name merge-buffer))))
-     (insert-buffer emerge-A-buffer)
+     (save-excursion (insert-buffer-substring emerge-A-buffer))
      (emerge-set-keys)
      (setq emerge-difference-list
           (emerge-make-diff3-list file-A file-B file-ancestor))
index d3194f3625aefa2bac49a273f02e0701f25d79e8..f999bdcdf6df5dfa728b10e79cf19205fb4dd76e 100644 (file)
@@ -204,7 +204,7 @@ which may be modified directly.  Any return value is ignored."
   :type 'hook
   :group 'eshell-cmd)
 
-(defcustom eshell-complex-commands nil
+(defcustom eshell-complex-commands '("ls")
   "*A list of commands names or functions, that determine complexity.
 That is, if a command is defined by a function named eshell/NAME,
 and NAME is part of this list, it is invoked as a complex command.
index 8a0ba7d221f28e71b8ae3a754918155f1dd062f1..1ced221692deb93d905171789deaac230546cbf5 100644 (file)
@@ -1947,8 +1947,10 @@ created."
          (modify-frame-parameters frame '((interprogram-cut-function . nil)))
          (modify-frame-parameters frame '((interprogram-paste-function . nil)))
 
-         (set-locale-environment nil frame)
-         (tty-run-terminal-initialization frame)
+          (unless (terminal-parameter frame 'terminal-initted)
+            (set-terminal-parameter frame 'terminal-initted t)
+            (set-locale-environment nil frame)
+            (tty-run-terminal-initialization frame))
          (frame-set-background-mode frame)
          (face-set-after-frame-default frame)
          (setq success t))
@@ -1981,10 +1983,7 @@ terminal type to a different value."
   ;; Load library for our terminal type.
   ;; User init file can set term-file-prefix to nil to prevent this.
   (with-selected-frame frame
-    (unless (or (null term-file-prefix)
-               ;; Don't reinitialize the terminal each time a new
-               ;; frame is opened on it.
-               (terminal-parameter frame 'terminal-initted))
+    (unless (null term-file-prefix)
       (let* (term-init-func)
        ;; First, load the terminal initialization file, if it is
        ;; available and it hasn't been loaded already.
index be28dec4c409b8d42784b2f3e0685f9e15a1612d..6d03ad24dbe608b92b75b0dc1f2aa30f4eae7a46 100644 (file)
@@ -2060,6 +2060,7 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\)\\'" . archive-mode)
      ("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode)
      ("\\.\\(dif\\|pat\\)\\'" . diff-mode) ; for MSDOG
      ("\\.[eE]?[pP][sS]\\'" . ps-mode)
+     ("\\.\\(?:PDF\\|DVI\\|pdf\\|dvi\\)" . doc-view-mode)
      ("configure\\.\\(ac\\|in\\)\\'" . autoconf-mode)
      ("BROWSE\\'" . ebrowse-tree-mode)
      ("\\.ebrowse\\'" . ebrowse-tree-mode)
index e5dde84785371833bb5856c38e14ecbc70e80290..d7a7dc9efa0727e785a81a0d35f870c2ef8e5e91 100644 (file)
@@ -158,7 +158,7 @@ COND-FN takes one argument: the current element."
        (setq rv (append rv (list elt)))))))
 
 (defun filesets-ormap (fsom-pred lst)
-  "Return the tail of FSOM-LST for the head of which FSOM-PRED is non-nil."
+  "Return the tail of LST for the head of which FSOM-PRED is non-nil."
   (let ((fsom-lst lst)
        (fsom-rv nil))
     (while (and (not (null fsom-lst))
@@ -535,7 +535,7 @@ computer environments."
   :group 'filesets)
 
 (defcustom filesets-sort-case-sensitive-flag t
-  "Non-nil means sorting of the filesete menu is case sensitive."
+  "Non-nil means sorting of the filesets menu is case sensitive."
   :set (function filesets-set-default)
   :type 'boolean
   :group 'filesets)
@@ -1091,10 +1091,7 @@ If NEGATIVE is non-nil, remove all directory names."
   "Return a sorted copy of LST, LST being a list of strings.
 If `filesets-sort-menu-flag' is nil, return LST itself.
 
-ACCESS-FN ... function to get the string value of LST's elements.
-
-If SIMPLY-DO-IT is non-nil, the list is sorted regardless of
-`filesets-sort-menu-flag'."
+ACCESS-FN ... function to get the string value of LST's elements."
   (if filesets-sort-menu-flag
       (let* ((fni (or access-fn
                      (function identity)))
@@ -1363,7 +1360,7 @@ not be opened."
     (find-file file)))
 
 (defun filesets-find-or-display-file (&optional file viewer)
-  "Visit FILE using an external viewer or open it in an Emacs buffer."
+  "Visit FILE using an external VIEWER or open it in an Emacs buffer."
   (interactive)
   (let* ((file (or file
                   (read-file-name "Find file: " nil nil viewer)))
@@ -1414,24 +1411,24 @@ not be opened."
     something)))
 
 (defun filesets-data-get-name (entry)
-  "Access to `filesets-data'.  Get the entry's name."
+  "Access to `filesets-data'.  Get the ENTRY's name."
   (car entry))
 
 (defun filesets-data-get-data (entry)
-  "Access to `filesets-data'.  Get the entry's data section."
+  "Access to `filesets-data'.  Get the ENTRY's data section."
   (cdr entry))
 
 (defun filesets-alist-get (alist key &optional default carp)
   "Get KEY's value in the association list ALIST.
 Return DEFAULT if not found.  Return (car VALUE) if CARP is non-nil."
-  (let* ((elt (assoc key alist)))
+  (let ((elt (assoc key alist)))
     (cond
-     (elt
-      (if carp
-         (cadr elt)
-       (cdr elt)))
-     (default default)
-     (t nil))))
+      (elt
+       (if carp
+          (cadr elt)
+        (cdr elt)))
+      (default default)
+      (t nil))))
 
 (defun filesets-data-get (entry key &optional default carp)
   "Extract the value for KEY in the data part of fileset ENTRY.
@@ -1439,7 +1436,7 @@ Return DEFAULT if not found.  Return (car VALUE) if CARP is non-nil."
   (filesets-alist-get (filesets-data-get-data entry) key default carp))
 
 (defun filesets-data-set (entry key value)
-  "Set the value for KEY in the data part of fileset ENTRY."
+  "Set the VALUE for KEY in the data part of fileset ENTRY."
   (let* ((alist (filesets-data-get-data entry))
         (elt (assoc key alist)))
     (if elt
@@ -1666,9 +1663,9 @@ Replace <file-name> or <<file-name>> with filename."
               filesets-commands)))
 
 
-;;; sampe commands
+;;; sample commands
 (defun filesets-cmd-query-replace-getargs ()
-  "Get arguments for `filesets-cmd-query-replace'."
+  "Get arguments for `query-replace' and `query-replace-regexp'."
   (let* ((from-string (read-string "Filesets query replace: "
                                   ""
                                   'query-replace-history))
@@ -1875,7 +1872,7 @@ User will be queried, if no fileset name is provided."
   (browse-url filesets-homepage))
 
 (defun filesets-remake-shortcut (count submenu)
-  "Remake a submenus shortcut when wrapping long menus."
+  "Remake a submenu's shortcut when wrapping long menus."
   (let* ((name (concat (filesets-get-shortcut count)
                       (substring (elt submenu 0) 2))))
     (if (listp submenu)
@@ -2032,7 +2029,7 @@ LOOKUP-NAME is used as lookup name for retrieving fileset specific settings."
          (lax-plist-put filesets-ingroup-cache emaster this))))
 
 (defun filesets-ingroup-collect-files (fs &optional remdupl-flag master depth)
-  "Helper function for `filesets-ingroup-collect'. Collect file names."
+  "Helper function for `filesets-ingroup-collect'.  Collect file names."
   (let* ((master       (or master
                           (filesets-entry-get-master fs)))
         (remdupl-flag (or remdupl-flag
@@ -2146,7 +2143,7 @@ FS is a fileset's name.  FLIST is a list returned by
                          `([,nm (filesets-file-open nil ',master ',fsn)])))))))))
 
 (defun filesets-ingroup-collect (fs remdupl-flag master)
-  "Collect names of included files & build submenu."
+  "Collect names of included files and build submenu."
   (filesets-ingroup-cache-put master nil)
   (filesets-message 2 "Filesets: parsing %S" master)
   (filesets-ingroup-collect-build-menu
index 89d9d75c60ec1f872908b292052e87511968a550..59a32921dc55fb075bd74636f970718ace715716 100644 (file)
@@ -1,3 +1,15 @@
+2007-10-15  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-util.el (gnus-string<): New function.
+
+       * gnus-sum.el (gnus-article-sort-by-author)
+       (gnus-article-sort-by-subject): Use it.
+
+2007-10-15  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-win.el (gnus-configure-windows): Focus on the frame for which
+       the frame-focus tag is set in gnus-buffer-configuration.
+
 2007-10-04  Juanma Barranquero  <lekktu@gmail.com>
 
        * sieve-manage.el (sieve-manage-interactive-login): Doc fix.
index 36e93796a63cef11d32fd256685ca0d95421e28d..8fb18d3a990ae26a302664e7c4272b3aac6523f4 100644 (file)
@@ -4674,7 +4674,7 @@ using some other form will lead to serious barfage."
 
 (defsubst gnus-article-sort-by-author (h1 h2)
   "Sort articles by root author."
-  (string-lessp
+  (gnus-string<
    (let ((extract (funcall
                   gnus-extract-address-components
                   (mail-header-from h1))))
@@ -4691,7 +4691,7 @@ using some other form will lead to serious barfage."
 
 (defsubst gnus-article-sort-by-subject (h1 h2)
   "Sort articles by root subject."
-  (string-lessp
+  (gnus-string<
    (downcase (gnus-simplify-subject-re (mail-header-subject h1)))
    (downcase (gnus-simplify-subject-re (mail-header-subject h2)))))
 
index 74aacdd2860c319a06f9558822425c3dc9dc434d..3d3e4148c2dde75588efa2c68aca789e24af00ff 100644 (file)
@@ -290,6 +290,15 @@ is slower."
   (not (or (string< s1 s2)
           (string= s1 s2))))
 
+(defun gnus-string< (s1 s2)
+  "Return t if first arg string is less than second in lexicographic order.
+Case is significant if and only if `case-fold-search' is nil.
+Symbols are also allowed; their print names are used instead."
+  (if case-fold-search
+      (string-lessp (downcase (if (symbolp s1) (symbol-name s1) s1))
+                   (downcase (if (symbolp s2) (symbol-name s2) s2)))
+    (string-lessp s1 s2)))
+
 ;;; Time functions.
 
 (defun gnus-file-newer-than (file date)
index 5c57aaa1886772a60020fef8db41e5c0b7358eae..7e1609cc196ddbf1fc4bd9b96d8287001700df8e 100644 (file)
@@ -471,7 +471,8 @@ See the Gnus manual for an explanation of the syntax used.")
          (gnus-configure-frame split)
          (run-hooks 'gnus-configure-windows-hook)
          (when gnus-window-frame-focus
-           (select-frame (window-frame gnus-window-frame-focus))))))))
+           (gnus-select-frame-set-input-focus
+            (window-frame gnus-window-frame-focus))))))))
 
 (defun gnus-delete-windows-in-gnusey-frames ()
   "Do a `delete-other-windows' in all frames that have Gnus windows."
index bf8d5f9a209a6869dd27016a55fc4a809054420c..befd83c76ef32b4a4028d4609bac1ea7457af6c8 100644 (file)
@@ -239,7 +239,7 @@ face (according to `face-differs-from-default-p')."
                                   ".elc"))
                                 load-path))
         (str (if (and elc-file (file-readable-p elc-file))
-                 (with-temp-buffer 
+                 (with-temp-buffer
                    (insert-file-contents-literally elc-file nil 0 256)
                    (buffer-string))))
         (src-file (and str
index 7847bed6f2da89b3a51e02283b38bf12783e82d6..2c39b7360977897bc3d44d9977b648a95a21717f 100644 (file)
@@ -180,8 +180,8 @@ QUALIFIERS is a list of the same form as
 
 See also the variables `ibuffer-filter-groups',
 `ibuffer-filtering-qualifiers', `ibuffer-filtering-alist', and the
-functions `ibuffer-switch-to-saved-filter-group',
-`ibuffer-save-filter-group'."
+functions `ibuffer-switch-to-saved-filter-groups',
+`ibuffer-save-filter-groups'."
   :type '(repeat sexp)
   :group 'ibuffer)
 
index db8958bd1ca5faae9fabe82aa87679360f127540..77354444cfa025d7554af2da502ef5382562fd1f 100644 (file)
@@ -86,10 +86,10 @@ If `transient-mark-mode' is turned on the region is active,
 indent the region.
 The function actually called to indent the line is determined by the value of
 `indent-line-function'."
-  (interactive "P")
+  (interactive "p")
   (cond
    ;; The region is active, indent it.
-   ((and transient-mark-mode mark-active
+   ((and arg transient-mark-mode mark-active
         (not (eq (region-beginning) (region-end))))
     (indent-region (region-beginning) (region-end)))
    ((or ;; indent-to-left-margin is only meant for indenting,
index 1ebdcd5cabd39d43786b809bc690c3054c6f8da2..d482b46525082e1c8a96d07cd03c17b627b47b03 100644 (file)
@@ -338,38 +338,63 @@ DISPLAY may be a display id, a frame, or nil for the selected frame's display."
     (when frame
       (with-selected-frame frame
        ;; Remove any previous encoded-kb keymap from input-decode-map.
-       (let ((m input-decode-map))
-         (if (equal (keymap-prompt m) "encoded-kb")
-             (setq input-decode-map (keymap-parent m))
-           (while (keymap-parent m)
-             (if (equal (keymap-prompt (keymap-parent m)) "encoded-kb")
-                 (set-keymap-parent m (keymap-parent (keymap-parent m))))
-             (setq m (keymap-parent m)))))
-
-       (if (keyboard-coding-system)
-           ;; We are turning on Encoded-kbd mode.
-           (let ((coding (keyboard-coding-system))
-                 (keymap (make-sparse-keymap "encoded-kb"))
-                 (cim (current-input-mode))
-                 result)
-             (set-keymap-parent keymap input-decode-map)
-             (setq input-decode-map keymap)
-             (unless (terminal-parameter nil 'encoded-kbd-saved-input-meta-mode)
-               (set-terminal-parameter nil 'encoded-kbd-saved-input-mode (nth 2 cim)))
-             (setq result (and coding (encoded-kbd-setup-keymap keymap coding)))
-             (if result
-                 (when (and (eq result 8)
-                            (memq (nth 2 cim) '(t nil)))
-                   (set-input-meta-mode 'use-8th-bit))
-               (set-terminal-parameter nil 'encoded-kbd-saved-input-meta-mode nil)
-               (error "Unsupported coding system in Encoded-kbd mode: %S"
-                      coding)))
-         ;; We are turning off Encoded-kbd mode.
-         (when (and (terminal-parameter nil 'encoded-kbd-saved-input-meta-mode)
-                    (not (equal (nth 2 (current-input-mode))
-                                (terminal-parameter nil 'encoded-kbd-saved-input-meta-mode))))
-           (set-input-meta-mode (terminal-parameter nil 'encoded-kbd-saved-input-meta-mode)))
-         (set-terminal-parameter nil 'saved-input-meta-mode nil))))))
+       (let ((m input-decode-map)
+              (child nil))
+          (while (keymapp m)
+            (if (not (equal (keymap-prompt m) "encoded-kb"))
+                (progn
+                  (setq child m)
+                  (setq m (keymap-parent m)))
+              ;; We've found an encoded-kb map, but maybe the prompt we get
+              ;; is really inherited from the encoded-kb map.
+              (let (mp)
+                (while (and (keymapp (setq mp (keymap-parent m)))
+                            (equal (keymap-prompt mp) "encoded-kb"))
+                  (setq child m)
+                  (setq m mp))
+                ;; (assert (equal (keymap-prompt m) "encoded-kb"))
+                ;; (assert (eq mp (keymap-parent m)))
+                ;; (assert (not (and (keymapp mp)
+                ;;                   (equal (keymap-prompt mp) "encoded-kb"))))
+                ;; (assert (eq m (if child
+                ;;                   (keymap-parent child) input-decode-map)))
+                ;; We can finally do the actual removal.
+                (if child
+                    (set-keymap-parent child mp)
+                  (setq input-decode-map mp))
+                (setq m mp))))))
+
+      (if (keyboard-coding-system)
+          ;; We are turning on Encoded-kbd mode.
+          (let ((coding (keyboard-coding-system))
+                (keymap (make-sparse-keymap "encoded-kb"))
+                (cim (current-input-mode))
+                result)
+            ;; Place `keymap' as the immediate parent of input-decode-map
+            ;; rather than on top, so that later `define-key' on
+            ;; input-decode-map don't end up accidentally changing our
+            ;; part of the keymap, which would lead to bugs when/if we later
+            ;; on remove that part.
+            (set-keymap-parent keymap (keymap-parent input-decode-map))
+            (set-keymap-parent input-decode-map keymap)
+            (unless (terminal-parameter nil 'encoded-kbd-saved-input-meta-mode)
+              (set-terminal-parameter nil 'encoded-kbd-saved-input-mode
+                                      (nth 2 cim)))
+            (setq result (and coding (encoded-kbd-setup-keymap keymap coding)))
+            (if result
+                (when (and (eq result 8)
+                           (memq (nth 2 cim) '(t nil)))
+                  (set-input-meta-mode 'use-8th-bit))
+              (set-terminal-parameter
+               nil 'encoded-kbd-saved-input-meta-mode nil)
+              (error "Unsupported coding system in Encoded-kbd mode: %S"
+                     coding)))
+        ;; We are turning off Encoded-kbd mode.
+        (let ((old (terminal-parameter nil 'encoded-kbd-saved-input-meta-mode)))
+          (when (and old (not (equal (nth 2 (current-input-mode)) old)))
+            (set-input-meta-mode old))
+          (set-terminal-parameter
+           nil 'encoded-kbd-saved-input-meta-mode nil))))))
 
 (provide 'encoded-kb)
 
index 4e9ee480d65b2bf9a97299da6df7c49f3b0c7410..95de0d822a35e3a599615a75328451bf1089327a 100644 (file)
   "Return the file and list of definitions associated with FEATURE.
 The value is actually the element of `load-history'
 for the file that did (provide FEATURE)."
-   (catch 'foundit
-     (mapc (lambda (x)
-            (if (member (cons 'provide feature) (cdr x))
-                (throw 'foundit x)))
-          load-history)
-     nil))
+  (catch 'foundit
+    (let ((element (cons 'provide feature)))
+      (dolist (x load-history nil)
+       (when (member element (cdr x))
+         (throw 'foundit x))))))
 
 (defun feature-file (feature)
   "Return the file name from which a given FEATURE was loaded.
@@ -72,32 +71,25 @@ A library name is equivalent to the file name that `load-library' would load."
   "Return the list of features provided by FILE as it was loaded.
 FILE can be a file name, or a library name.
 A library name is equivalent to the file name that `load-library' would load."
-  (let ((symbols (file-loadhist-lookup file))
-       provides)
-    (mapc (lambda (x)
-           (if (and (consp x) (eq (car x) 'provide))
-               (setq provides (cons (cdr x) provides))))
-         symbols)
-    provides))
+  (let (provides)
+    (dolist (x (file-loadhist-lookup file) provides)
+      (when (eq (car-safe x) 'provide)
+       (push x provides)))))
 
 (defun file-requires (file)
   "Return the list of features required by FILE as it was loaded.
 FILE can be a file name, or a library name.
 A library name is equivalent to the file name that `load-library' would load."
-  (let ((symbols (file-loadhist-lookup file))
-       requires)
-    (mapc (lambda (x)
-           (if (and (consp x) (eq (car x) 'require))
-               (setq requires (cons (cdr x) requires))))
-         symbols)
-    requires))
+  (let (requires)
+    (dolist (x (file-loadhist-lookup file) requires)
+      (when (eq (car-safe x) 'require)
+       (push x requires)))))
 
 (defsubst file-set-intersect (p q)
   "Return the set intersection of two lists."
-  (let ((ret nil))
+  (let (ret)
     (dolist (x p ret)
-      (if (memq x q) (setq ret (cons x ret))))
-    ret))
+      (when (memq x q) (push x ret)))))
 
 (defun file-dependents (file)
   "Return the list of loaded libraries that depend on FILE.
@@ -107,9 +99,8 @@ A library name is equivalent to the file name that `load-library' would load."
   (let ((provides (file-provides file))
        (dependents nil))
     (dolist (x load-history dependents)
-      (if (file-set-intersect provides (file-requires (car x)))
-         (setq dependents (cons (car x) dependents))))
-    dependents))
+      (when (file-set-intersect provides (file-requires (car x)))
+       (push (car x) dependents)))))
 
 (defun read-feature (prompt &optional loaded-p)
   "Read feature name from the minibuffer, prompting with string PROMPT.
@@ -126,15 +117,19 @@ from a file."
 
 (defvaralias 'loadhist-hook-functions 'unload-feature-special-hooks)
 (defvar unload-feature-special-hooks
-  '(after-change-functions
-    after-insert-file-functions auto-fill-function
-    before-change-functions blink-paren-function
-    buffer-access-fontify-functions command-line-functions
-    comment-indent-function kill-buffer-query-functions
-    kill-emacs-query-functions lisp-indent-function
-    mouse-position-function
+  '(after-change-functions after-insert-file-functions
+    after-make-frame-functions auto-fill-function before-change-functions
+    blink-paren-function buffer-access-fontify-functions command-line-functions
+    comment-indent-function compilation-finish-functions
+    disabled-command-function find-file-not-found-functions
+    font-lock-beginning-of-syntax-function font-lock-fontify-buffer-function
+    font-lock-fontify-region-function font-lock-mark-block-function
+    font-lock-syntactic-face-function font-lock-unfontify-buffer-function
+    font-lock-unfontify-region-function kill-buffer-query-functions
+    kill-emacs-query-functions lisp-indent-function mouse-position-function
     redisplay-end-trigger-functions temp-buffer-show-function
     window-scroll-functions window-size-change-functions
+    write-contents-functions write-file-functions
     write-region-annotate-functions)
   "A list of special hooks from Info node `(elisp)Standard Hooks'.
 
index 07977910a2213acca65f5a406b3c92b296765f08..c820150c27a2ecf8f75c25844da99741659721fc 100644 (file)
@@ -55,7 +55,11 @@ when the file is saved to disk."
   "Non-nil means wrapping and filling happen at the edge of the window.
 Otherwise, `fill-column' is used, regardless of the window size.  This
 does not work well when the buffer is displayed in multiple windows
-with differing widths."
+with differing widths.
+
+If the value is an integer, that specifies the distance from the
+right edge of the window at which wrapping occurs.  For any other
+non-nil value, wrapping occurs 2 characters from the right edge."
   :group 'longlines
   :type 'boolean)
 
@@ -117,8 +121,14 @@ are indicated with a symbol."
             'longlines-search-function)
         (add-to-list 'buffer-substring-filters 'longlines-encode-string)
         (when longlines-wrap-follows-window-size
-          (set (make-local-variable 'fill-column)
-               (- (window-width) window-min-width))
+         (let ((dw (if (and (integerp longlines-wrap-follows-window-size)
+                            (>= longlines-wrap-follows-window-size 0)
+                            (< longlines-wrap-follows-window-size
+                               (window-width)))
+                       longlines-wrap-follows-window-size
+                     2)))
+           (set (make-local-variable 'fill-column)
+                (- (window-width) dw)))
           (add-hook 'window-configuration-change-hook
                     'longlines-window-change-function nil t))
         (let ((buffer-undo-list t)
@@ -415,9 +425,14 @@ This is called by `post-command-hook' after each command."
 (defun longlines-window-change-function ()
   "Re-wrap the buffer if the window width has changed.
 This is called by `window-configuration-change-hook'."
-  (when (/= fill-column (- (window-width) window-min-width))
-    (setq fill-column (- (window-width) window-min-width))
-    (longlines-wrap-region (point-min) (point-max))))
+  (let ((dw (if (and (integerp longlines-wrap-follows-window-size)
+                    (>= longlines-wrap-follows-window-size 0)
+                    (< longlines-wrap-follows-window-size (window-width)))
+               longlines-wrap-follows-window-size
+             2)))
+    (when (/= fill-column (- (window-width) dw))
+      (setq fill-column (- (window-width) dw))
+      (longlines-wrap-region (point-min) (point-max)))))
 
 ;; Isearch
 
index 34a0aa0ad821999b1cf7c96309d0eb671db6a0ff..e8d896be2464c1d6fa54b8d8118bb6b96cbd5c1d 100644 (file)
@@ -991,6 +991,19 @@ See also the function `select-message-coding-system'.")
           nil)
          (t (error "Invalid value for `mail-from-style'")))))
 
+;; Normally you will not need to modify these options unless you are
+;; using some non-genuine substitute for sendmail which does not
+;; implement each and every option that the original supports.
+;; E.g., ssmtp does not support "-odb", so, if your site uses it,
+;; you will need to modify `sendmail-error-reporting-non-interactive'
+;; in your site-init.el.
+(defvar sendmail-error-reporting-interactive
+  ;; These mean "report errors to terminal" and "deliver interactively"
+  '("-oep" "-odi"))
+(defvar sendmail-error-reporting-non-interactive
+  ;; These mean "report errors by mail" and "deliver in background".
+  '("-oem" "-odb"))
+
 (defun sendmail-send-it ()
   "Send the current mail buffer using the Sendmail package.
 This is a suitable value for `send-mail-function'.  It sends using the
@@ -1135,12 +1148,8 @@ external program defined by `sendmail-program'."
                              (and mail-alias-file
                                   (list (concat "-oA" mail-alias-file)))
                              (if mail-interactive
-                                 ;; These mean "report errors to terminal"
-                                 ;; and "deliver interactively"
-                                 '("-oep" "-odi")
-                               ;; These mean "report errors by mail"
-                               ;; and "deliver in background".
-                               '("-oem" "-odb"))
+                                  sendmail-error-reporting-interactive
+                                  sendmail-error-reporting-non-interactive)
                              ;; Get the addresses from the message
                              ;; unless this is a resend.
                              ;; We must not do that for a resend
index c8b2a72aad0fb847e2597ca0b77500d088d1b68e..0af9c457995ffa08c7b6c6ea7e1fcc87d1bcba0f 100644 (file)
@@ -2092,12 +2092,13 @@ been set up by `rfn-eshadow-setup-minibuffer'."
                          (symbol-value 'rfn-eshadow-overlay))
                 (funcall (symbol-function 'minibuffer-prompt-end)))))
     (when (file-remote-p (buffer-substring-no-properties end (point-max)))
-      (narrow-to-region
-       (1+ (or (string-match "/" (buffer-string) end) end)) (point-max))
-      (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay)
-           (rfn-eshadow-update-overlay-hook nil))
-       (funcall (symbol-function 'rfn-eshadow-update-overlay)))
-      (widen))))
+      (save-excursion
+       (save-restriction
+         (narrow-to-region
+          (1+ (or (string-match "/" (buffer-string) end) end)) (point-max))
+         (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay)
+               (rfn-eshadow-update-overlay-hook nil))
+           (funcall (symbol-function 'rfn-eshadow-update-overlay))))))))
 
 (when (boundp 'rfn-eshadow-update-overlay-hook)
   (add-hook 'rfn-eshadow-update-overlay-hook
index 95359689b9f0f4839e8ac7ee756424aeb6bb4314..eced014d4e6eba0b94dc9be63ae31dea59ba4a9e 100644 (file)
@@ -106,7 +106,9 @@ A sample value might look like: `\\(_P\\|_PROTO\\)'.")
     (nil
      ,(concat
        "^\\<"                                 ; line MUST start with word char
-       "[^()]*"                               ; no parentheses before
+       ;; \n added to prevent overflow in regexp matcher.
+       ;; http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-02/msg00021.html
+       "[^()\n]*"                             ; no parentheses before
        "[^" c-alnum "_:<>~]"                  ; match any non-identifier char
        "\\([" c-alpha "_][" c-alnum "_:<>~]*\\)" ; match function name
        "\\([ \t\n]\\|\\\\\n\\)*("            ; see above, BUT the arg list
index 9ed7ba09de9fac15d1dcd3cb6d4ba7254b6b7852..482cfee1b9bce01f22cf15f7d185f00639543ac9 100644 (file)
@@ -1658,10 +1658,15 @@ This is the value of `next-error-function' in Compilation buffers."
     ;;  in the same process and buffer).
     ;; So, recalculate all markers for that file.
     (unless (and (nth 3 loc) (marker-buffer (nth 3 loc))
-                 (equal (nth 4 loc)
-                        (setq timestamp
-                              (with-current-buffer (marker-buffer (nth 3 loc))
-                                (visited-file-modtime)))))
+                 ;; There may be no timestamp info if the loc is a `fake-loc'.
+                 ;; So we skip the time-check here, although we should maybe
+                 ;; change `compilation-fake-loc' to add timestamp info.
+                 (or (null (nth 4 loc))
+                     (equal (nth 4 loc)
+                            (setq timestamp
+                                  (with-current-buffer
+                                      (marker-buffer (nth 3 loc))
+                                    (visited-file-modtime))))))
       (with-current-buffer (compilation-find-file marker (caar (nth 2 loc))
                                                  (cadr (car (nth 2 loc))))
        (save-restriction
@@ -1711,7 +1716,7 @@ region and the first line of the next region."
   (or (consp file) (setq file (list file)))
   (setq file (compilation-get-file-structure file))
   ;; Between the current call to compilation-fake-loc and the first occurrence
-  ;; of an error message referring to `file', the data is only kept is the
+  ;; of an error message referring to `file', the data is only kept in the
   ;; weak hash-table compilation-locs, so we need to prevent this entry
   ;; in compilation-locs from being GC'd away.  --Stef
   (push file compilation-gcpro)
index 6cbef6f426df96bff5debd222f0845b763bc3425..7c2417fde1a368f5b4d29c46af682beb3c5fbff3 100644 (file)
@@ -1642,7 +1642,7 @@ before the indent, the point is moved to the indent."
   (when delphi-newline-always-indents
     ;; Indent both the (now) previous and current line first.
     (save-excursion
-      (previous-line 1)
+      (forward-line -1)
       (delphi-indent-line))
     (delphi-indent-line)))
 
index 22b947ea9f8bbb6cf415af6a53827c2c9e6c40ef..70d2283b0ebc3ce448aca5013afd4f44c4061f75 100644 (file)
@@ -325,7 +325,10 @@ message."
 
 (defun server-select-display (display)
   ;; If the current frame is on `display' we're all set.
-  (unless (equal (frame-parameter (selected-frame) 'display) display)
+  ;; Similarly if we are unable to open a frames on other displays, there's
+  ;; nothing more we can do.
+  (unless (or (not (fboundp 'make-frame-on-display))
+              (equal (frame-parameter (selected-frame) 'display) display))
     ;; Otherwise, look for an existing frame there and select it.
     (dolist (frame (frame-list))
       (when (equal (frame-parameter frame 'display) display)
@@ -505,11 +508,11 @@ kill any existing server communications subprocess."
          (when server-use-tcp
            (let ((auth-key
                   (loop
-                   ;; The auth key is a 64-byte string of random chars in the
-                   ;; range `!'..`~'.
-                   for i below 64
-                   collect (+ 33 (random 94)) into auth
-                   finally return (concat auth))))
+                     ;; The auth key is a 64-byte string of random chars in the
+                     ;; range `!'..`~'.
+                     for i below 64
+                     collect (+ 33 (random 94)) into auth
+                     finally return (concat auth))))
              (process-put server-process :auth-key auth-key)
              (with-temp-file server-file
                (set-buffer-multibyte nil)
@@ -831,8 +834,8 @@ The following commands are accepted by the client:
                 ;; Open X frames on the given display instead of the default.
                 ((and (equal "-display" arg)
                        (string-match "\\([^ ]*\\) " request))
-                 (setq display (match-string 1 request)
-                       request (substring request (match-end 0))))
+                  (setq display (match-string 1 request))
+                 (setq request (substring request (match-end 0))))
 
                 ;; -window-system:  Open a new X frame.
                 ((equal "-window-system" arg)
index f2055faf385801a75435b673a13b07b89b3a154e..5c3b55edd7bb5ea77153c0d09ab586bfd4ff3cb2 100644 (file)
@@ -1,7 +1,8 @@
 ;;; simple.el --- basic editing commands for Emacs
 
 ;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-;;   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: internal
@@ -632,7 +633,9 @@ column specified by the function `current-left-margin'."
     (newline)
     (save-excursion
       (goto-char pos)
-      (indent-according-to-mode)
+      ;; Usually indent-according-to-mode should "preserve" point, but it is
+      ;; not guaranteed; e.g. indent-to-left-margin doesn't.
+      (save-excursion (indent-according-to-mode))
       (delete-horizontal-space t))
     (indent-according-to-mode)))
 
@@ -2561,6 +2564,11 @@ of the Emacs kill ring should be used.  If the function returns a
 string, then the caller of the function \(usually `current-kill')
 should put this string in the kill ring as the latest kill.
 
+This function may also return a list of strings if the window
+system supports multiple selections. The first string will be
+used as the pasted text, but the other will be placed in the
+kill ring for easy access via `yank-pop'.
+
 Note that the function should return a string only if a program other
 than Emacs has provided a string for pasting; if Emacs provided the
 most recent string, the function should return nil.  If it is
@@ -2644,11 +2652,11 @@ If `interprogram-cut-function' is set, pass the resulting kill to it."
 
 (defun current-kill (n &optional do-not-move)
   "Rotate the yanking point by N places, and then return that kill.
-If N is zero, `interprogram-paste-function' is set, and calling it
-returns a string, then that string is added to the front of the
-kill ring and returned as the latest kill.
-If optional arg DO-NOT-MOVE is non-nil, then don't actually move the
-yanking point; just return the Nth kill forward."
+If N is zero, `interprogram-paste-function' is set, and calling it returns a
+string or list of strings, then that string (or list) is added to the front
+of the kill ring and the string (or first string in the list) is returned as
+the latest kill.  If optional arg DO-NOT-MOVE is non-nil, then don't
+actually move the yanking point; just return the Nth kill forward."
   (let ((interprogram-paste (and (= n 0)
                                 interprogram-paste-function
                                 (funcall interprogram-paste-function))))
@@ -2658,8 +2666,10 @@ yanking point; just return the Nth kill forward."
          ;; text to the kill ring, so Emacs doesn't try to own the
          ;; selection, with identical text.
          (let ((interprogram-cut-function nil))
-           (kill-new interprogram-paste))
-         interprogram-paste)
+           (if (listp interprogram-paste)
+             (mapc 'kill-new (nreverse interprogram-paste))
+             (kill-new interprogram-paste)))
+         (car kill-ring))
       (or kill-ring (error "Kill ring is empty"))
       (let ((ARGth-kill-element
             (nthcdr (mod (- n (length kill-ring-yank-pointer))
@@ -4657,6 +4667,8 @@ it skips the contents of comments that end before point."
                                 (point))))))
     (let* ((oldpos (point))
           (message-log-max nil)  ; Don't log messages about paren matching.
+          (atdollar (eq (syntax-class (syntax-after (1- oldpos))) 8))
+          (isdollar)
           (blinkpos
             (save-excursion
               (save-restriction
@@ -4674,20 +4686,28 @@ it skips the contents of comments that end before point."
           (matching-paren
             (and blinkpos
                  ;; Not syntax '$'.
-                 (not (eq (syntax-class (syntax-after blinkpos)) 8))
+                 (not (setq isdollar
+                            (eq (syntax-class (syntax-after blinkpos)) 8)))
                  (let ((syntax (syntax-after blinkpos)))
                    (and (consp syntax)
                         (eq (syntax-class syntax) 4)
                         (cdr syntax))))))
       (cond
-       ((not (or (eq matching-paren (char-before oldpos))
+       ;; isdollar is for:
+       ;; http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00871.html
+       ((not (or (and isdollar blinkpos)
+                 (and atdollar (not blinkpos)) ; see below
+                 (eq matching-paren (char-before oldpos))
                  ;; The cdr might hold a new paren-class info rather than
                  ;; a matching-char info, in which case the two CDRs
                  ;; should match.
                  (eq matching-paren (cdr (syntax-after (1- oldpos))))))
         (message "Mismatched parentheses"))
        ((not blinkpos)
-        (if (not blink-matching-paren-distance)
+        (or blink-matching-paren-distance
+            ;; Don't complain when `$' with no blinkpos, because it
+            ;; could just be the first one typed in the buffer.
+            atdollar
             (message "Unmatched parenthesis")))
        ((pos-visible-in-window-p blinkpos)
         ;; Matching open within window, temporarily move to blinkpos but only
index 1c4b60706aa05c9fc329d7d66fbeb7486b633580..a60aa90255f90363f9179f15366f7ff1b868abc9 100644 (file)
@@ -27,8 +27,6 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'xt-mouse))
-
 (defvar xterm-function-map
   (let ((map (make-sparse-keymap)))
 
     ;; This recomputes all the default faces given the colors we've just set up.
     (tty-set-up-initial-frame-faces)
     
-    (when xterm-mouse-mode
-      (turn-on-xterm-mouse-tracking-on-terminal 
-       (frame-terminal (selected-frame))))
-    
     ;; Try to turn on the modifyOtherKeys feature on modern xterms.
-    ;; When it is turned on much more key bindings work: things like
+    ;; When it is turned on many more key bindings work: things like
     ;; C-. C-, etc.
     ;; To do that we need to find out if the current terminal supports
     ;; modifyOtherKeys. At this time only xterm does.
              ;; need to deal with modify-other-keys.
              (push (frame-terminal (selected-frame))
                    xterm-modify-other-keys-terminal-list)
-             (xterm-turn-on-modify-other-keys)))))))
+             (xterm-turn-on-modify-other-keys))))))
+
+    (run-hooks 'terminal-init-xterm-hook))
 
 ;; Set up colors, for those versions of xterm that support it.
 (defvar xterm-standard-colors
index bc0434e151ac9c360fdd0b9e98d3e52e16ec7efc..f0442904185c89bd785cda9d61b4f21075da6f5c 100644 (file)
@@ -4383,13 +4383,10 @@ With non-nil ARG, set the last point."
 If N is negative, move cursor down."
   (interactive "p")
   (let ((col (artist-current-column)))
-    (if (not artist-key-is-drawing)
-       (progn
-         (previous-line n)
-         (move-to-column col t))
-      (previous-line n)
-      (move-to-column col t)
-      (artist-key-do-continously-common))))
+    (forward-line (- n))
+    (move-to-column col t))
+  (when artist-key-is-drawing
+    (artist-key-do-continously-common)))
 
 
 (defun artist-next-line (&optional n)
@@ -4397,13 +4394,10 @@ If N is negative, move cursor down."
 If N is negative, move cursor up."
   (interactive "p")
   (let ((col (artist-current-column)))
-    (if (not artist-key-is-drawing)
-       (progn
-         (next-line n)
-         (move-to-column col t))
-      (next-line n)
-      (move-to-column col t)
-      (artist-key-do-continously-common))))
+    (forward-line n)
+    (move-to-column col t))
+  (when artist-key-is-drawing
+    (artist-key-do-continously-common)))
 
 (defun artist-backward-char (&optional n)
   "Move cursor backward optional N chars (default is 1), updating curr shape.
index e0f80b1b11822a40a6b74a525684b252e5bf8557..9cbdca0de87d2fa23db1cfccce6a014558bde1d8 100644 (file)
@@ -117,8 +117,8 @@ if it would act as a paragraph-starter on the second line."
   :group 'fill)
 
 (defcustom adaptive-fill-function nil
-  "*Function to call to choose a fill prefix for a paragraph, or nil.
-nil means the function has not determined the fill prefix."
+  "Function to call to choose a fill prefix for a paragraph, or nil.
+A nil value means the function has not determined the fill prefix."
   :type '(choice (const nil) function)
   :group 'fill)
 
@@ -757,10 +757,10 @@ space does not end a sentence, so don't break a line there."
     (narrow-to-region (minibuffer-prompt-end) (point-max))
     (fill-paragraph arg)))
 
-(defun fill-paragraph (arg)
+(defun fill-paragraph (&optional justify region)
   "Fill paragraph at or after point.
 
-If ARG is non-nil (interactively, with prefix argument), justify as well.
+If JUSTIFY is non-nil (interactively, with prefix argument), justify as well.
 If `sentence-end-double-space' is non-nil, then period followed by one
 space does not end a sentence, so don't break a line there.
 the variable `fill-column' controls the width for filling.
@@ -768,64 +768,73 @@ the variable `fill-column' controls the width for filling.
 If `fill-paragraph-function' is non-nil, we call it (passing our
 argument to it), and if it returns non-nil, we simply return its value.
 
-If `fill-paragraph-function' is nil, return the `fill-prefix' used for filling."
+If `fill-paragraph-function' is nil, return the `fill-prefix' used for filling.
+
+Interactively (when `region' is non-nil) in Transient Mark mode when
+the mark is active, call `fill-region' to fill each of the paragraphs
+in the active region."
   (interactive (progn
                 (barf-if-buffer-read-only)
-                (list (if current-prefix-arg 'full))))
-  ;; First try fill-paragraph-function.
-  (or (and (not (eq fill-paragraph-function t))
-          (or fill-paragraph-function
-              (and (minibufferp (current-buffer))
-                   (= 1 (point-min))))
-          (let ((function (or fill-paragraph-function
-                              ;; In the minibuffer, don't count the width
-                              ;; of the prompt.
-                              'fill-minibuffer-function))
-                ;; If fill-paragraph-function is set, it probably takes care
-                ;; of comments and stuff.  If not, it will have to set
-                ;; fill-paragraph-handle-comment back to t explicitly or
-                ;; return nil.
-                (fill-paragraph-handle-comment nil)
-                (fill-paragraph-function t))
-            (funcall function arg)))
-      ;; Then try our syntax-aware filling code.
-      (and fill-paragraph-handle-comment
-          ;; Our code only handles \n-terminated comments right now.
-          comment-start (equal comment-end "")
-          (let ((fill-paragraph-handle-comment nil))
-            (fill-comment-paragraph arg)))
-      ;; If it all fails, default to the good ol' text paragraph filling.
-      (let ((before (point))
-           (paragraph-start paragraph-start)
-           ;; Fill prefix used for filling the paragraph.
-           fill-pfx)
-       ;; Try to prevent code sections and comment sections from being
-       ;; filled together.
-       (when (and fill-paragraph-handle-comment comment-start-skip)
-         (setq paragraph-start
-               (concat paragraph-start "\\|[ \t]*\\(?:"
-                       comment-start-skip "\\)")))
-       (save-excursion
-         ;; To make sure the return value of forward-paragraph is meaningful,
-         ;; we have to start from the beginning of line, otherwise skipping
-         ;; past the last few chars of a paragraph-separator would count as
-         ;; a paragraph (and not skipping any chars at EOB would not count
-         ;; as a paragraph even if it is).
-         (move-to-left-margin)
-         (if (not (zerop (forward-paragraph)))
-             ;; There's no paragraph at or after point: give up.
-             (setq fill-pfx "")
-           (let ((end (point))
-                 (beg (progn (backward-paragraph) (point))))
-             (goto-char before)
-             (setq fill-pfx
-                   (if use-hard-newlines
-                       ;; Can't use fill-region-as-paragraph, since this
-                       ;; paragraph may still contain hard newlines.  See
-                       ;; fill-region.
-                       (fill-region beg end arg)
-                     (fill-region-as-paragraph beg end arg))))))
-       fill-pfx)))
+                (list (if current-prefix-arg 'full) t)))
+  (or
+   ;; 1. Fill the region if it is active when called interactively.
+   (and region transient-mark-mode mark-active
+       (not (eq (region-beginning) (region-end)))
+       (fill-region (region-beginning) (region-end) justify))
+   ;; 2. Try fill-paragraph-function.
+   (and (not (eq fill-paragraph-function t))
+       (or fill-paragraph-function
+           (and (minibufferp (current-buffer))
+                (= 1 (point-min))))
+       (let ((function (or fill-paragraph-function
+                           ;; In the minibuffer, don't count the width
+                           ;; of the prompt.
+                           'fill-minibuffer-function))
+             ;; If fill-paragraph-function is set, it probably takes care
+             ;; of comments and stuff.  If not, it will have to set
+             ;; fill-paragraph-handle-comment back to t explicitly or
+             ;; return nil.
+             (fill-paragraph-handle-comment nil)
+             (fill-paragraph-function t))
+         (funcall function justify)))
+   ;; 3. Try our syntax-aware filling code.
+   (and fill-paragraph-handle-comment
+       ;; Our code only handles \n-terminated comments right now.
+       comment-start (equal comment-end "")
+       (let ((fill-paragraph-handle-comment nil))
+         (fill-comment-paragraph justify)))
+   ;; 4. If it all fails, default to the good ol' text paragraph filling.
+   (let ((before (point))
+        (paragraph-start paragraph-start)
+        ;; Fill prefix used for filling the paragraph.
+        fill-pfx)
+     ;; Try to prevent code sections and comment sections from being
+     ;; filled together.
+     (when (and fill-paragraph-handle-comment comment-start-skip)
+       (setq paragraph-start
+            (concat paragraph-start "\\|[ \t]*\\(?:"
+                    comment-start-skip "\\)")))
+     (save-excursion
+       ;; To make sure the return value of forward-paragraph is meaningful,
+       ;; we have to start from the beginning of line, otherwise skipping
+       ;; past the last few chars of a paragraph-separator would count as
+       ;; a paragraph (and not skipping any chars at EOB would not count
+       ;; as a paragraph even if it is).
+       (move-to-left-margin)
+       (if (not (zerop (forward-paragraph)))
+          ;; There's no paragraph at or after point: give up.
+          (setq fill-pfx "")
+        (let ((end (point))
+              (beg (progn (backward-paragraph) (point))))
+          (goto-char before)
+          (setq fill-pfx
+                (if use-hard-newlines
+                    ;; Can't use fill-region-as-paragraph, since this
+                    ;; paragraph may still contain hard newlines.  See
+                    ;; fill-region.
+                    (fill-region beg end justify)
+                  (fill-region-as-paragraph beg end justify))))))
+     fill-pfx)))
 
 (defun fill-comment-paragraph (&optional justify)
   "Fill current comment.
@@ -1012,18 +1021,6 @@ space does not end a sentence, so don't break a line there."
          (goto-char end))))
     fill-pfx))
 
-(defun fill-paragraph-or-region (arg)
-  "Fill the active region or current paragraph.
-In Transient Mark mode, when the mark is active, it calls `fill-region'
-on the active region.  Otherwise, it calls `fill-paragraph'."
-  (interactive (progn
-                (barf-if-buffer-read-only)
-                (list (if current-prefix-arg 'full))))
-  (if (and transient-mark-mode mark-active
-          (not (eq (region-beginning) (region-end))))
-      (fill-region (region-beginning) (region-end) arg)
-    (fill-paragraph arg)))
-
 \f
 (defcustom default-justification 'left
   "*Method of justifying text not otherwise specified.
@@ -1367,8 +1364,8 @@ These lines are filled together.
 When calling from a program, pass the range to fill
 as the first two arguments.
 
-Optional third and fourth arguments JUSTIFY and MAIL-FLAG:
-JUSTIFY to justify paragraphs (prefix arg),
+Optional third and fourth arguments JUSTIFY and CITATION-REGEXP:
+JUSTIFY to justify paragraphs (prefix arg).
 When filling a mail message, pass a regexp for CITATION-REGEXP
 which will match the prefix of a line which is a citation marker
 plus whitespace, but no other kind of prefix.
@@ -1456,6 +1453,7 @@ Also, if CITATION-REGEXP is non-nil, don't fill header lines."
            (fill-region-as-paragraph start (point) justify)
            (if (and (bolp) (not had-newline))
                (delete-char -1))))))))
+
 (defun fill-individual-paragraphs-prefix (citation-regexp)
   (let* ((adaptive-fill-first-line-regexp ".*")
         (just-one-line-prefix
index 253c29f408e874fb5c87577d8a0e79a8722e294a..926e0debda15a09a2943f520ffec9f0cf4f142f7 100644 (file)
@@ -1536,7 +1536,7 @@ This allows it to improve the suggestion list based on actual mispellings."
        (translate-region pos (point) translation-table-for-input))))
 
 ;;;###autoload
-(defun ispell-word (&optional following quietly continue)
+(defun ispell-word (&optional following quietly continue region)
   "Check spelling of word under or before the cursor.
 If the word is not found in dictionary, display possible corrections
 in a window allowing you to choose one.
@@ -1550,6 +1550,9 @@ when called interactively, non-corrective messages are suppressed.
 With a prefix argument (or if CONTINUE is non-nil),
 resume interrupted spell-checking of a buffer or region.
 
+Interactively, in Transient Mark mode when the mark is active, call
+`ispell-region' to check the active region for spelling errors.
+
 Word syntax is controlled by the definition of the chosen dictionary,
 which is in `ispell-local-dictionary-alist' or `ispell-dictionary-alist'.
 
@@ -1562,10 +1565,9 @@ nil           word is correct or spelling is accepted.
 \"word\"        word corrected from word list.
 \(\"word\" arg\)  word is hand entered.
 quit          spell session exited."
-
-  (interactive (list ispell-following-word ispell-quietly current-prefix-arg))
+  (interactive (list ispell-following-word ispell-quietly current-prefix-arg t))
   (cond
-   ((and transient-mark-mode mark-active
+   ((and region transient-mark-mode mark-active
         (not (eq (region-beginning) (region-end))))
     (ispell-region (region-beginning) (region-end)))
    (continue (ispell-continue))
index 6c48c47d3adcf1f7c4f9fbcde0a0032775fce92d..5487609343b6bc051a2a0e151952fe1efb0f7fdd 100644 (file)
         (progn
           (if pc-mode (partial-completion-mode -1))
           ,@body)
-       (if pc-mode (partial-completion-mode 1)))))  
+       (if pc-mode (partial-completion-mode 1)))))
 
 ;;; The custom variables
 
@@ -1399,7 +1399,7 @@ When this variable is nil, `C-c C-c' give you the prompts, and
 `C-u C-c C-c' trigger the fasttrack."
   :group 'org-remember
   :type 'boolean)
-  
+
 (defcustom org-remember-default-headline ""
   "The headline that should be the default location in the notes file.
 When filing remember notes, the cursor will start at that position.
@@ -2702,7 +2702,7 @@ directory where the exported Org-mode files lives."
          (repeat
           (cons
            (choice :tag "Type"
-                   (const :html) (const :LaTeX) 
+                   (const :html) (const :LaTeX)
                    (const :ascii) (const :ical) (const :xoxo))
            (directory)))))
 
@@ -3516,7 +3516,7 @@ color of the frame."
   ;; Make sure that a fixed-width face is used when we have a column table.
   (set-face-attribute 'org-column nil
                      :height (face-attribute 'default :height)
-                     :family (face-attribute 'default :family)))  
+                     :family (face-attribute 'default :family)))
 
 (defface org-warning
   (org-compatible-face
@@ -5544,7 +5544,7 @@ Works for outline headings and for plain lists alike."
   (cond
    ((org-on-heading-p) (org-do-demote))
    ((org-at-item-p) (org-indent-item 1))))
-  
+
 ;;; Promotion and Demotion
 
 (defun org-promote-subtree ()
@@ -6064,7 +6064,7 @@ If WITH-CASE is non-nil, the sorting will be case-sensitive."
              (if (string-match org-priority-regexp x)
                  (string-to-char (match-string 2 x))
                org-default-priority))
-           comparefun (if (= dcst sorting-type) '< '>)))                 
+           comparefun (if (= dcst sorting-type) '< '>)))
      (t (error "Invalid sorting type `%c'" sorting-type)))
 
     (sort (mapcar (lambda (x) (cons (funcall extractfun (car x)) (cdr x)))
@@ -6778,7 +6778,7 @@ off orgstruct-mode will *not* remove these additonal settings."
                (orgstruct-make-binding 'org-cycle 102 [(tab)] "\C-i"))
     (org-defkey orgstruct-mode-map "\C-i"
                (orgstruct-make-binding 'org-cycle 103 "\C-i" [(tab)]))
-    
+
     (org-defkey orgstruct-mode-map "\M-\C-m"
                (orgstruct-make-binding 'org-insert-heading 105
                                     "\M-\C-m" [(meta return)]))
@@ -6789,10 +6789,10 @@ off orgstruct-mode will *not* remove these additonal settings."
     (org-defkey orgstruct-mode-map [(shift meta return)]
                (orgstruct-make-binding 'org-insert-todo-heading 107
                                     [(meta return)] "\M-\C-m"))
-    
+
     (unless org-local-vars
       (setq org-local-vars (org-get-local-variables)))
-    
+
     t))
 
 (defun orgstruct-make-binding (fun n &rest keys)
@@ -6843,7 +6843,7 @@ Possible values in the list of contexts are `table', `headline', and `item'."
     (kill-buffer "*Org tmp*")
     (delq nil
          (mapcar
-          (lambda (x) 
+          (lambda (x)
             (setq x
                   (if (symbolp x)
                       (list x)
@@ -11258,12 +11258,12 @@ according to FMT (default from `org-email-link-description-format')."
          (if description (concat "[" description "]") "")
          "]"))
 
-(defconst org-link-escape-chars 
+(defconst org-link-escape-chars
   '((" " . "%20")
     ("[" . "%5B")
     ("]" . "%5d")
     ("\340" . "%E0")  ; `a
-    ("\342" . "%E2")  ; ^a  
+    ("\342" . "%E2")  ; ^a
     ("\347" . "%E7")  ; ,c
     ("\350" . "%E8")  ; `e
     ("\351" . "%E9")  ; 'e
@@ -11280,7 +11280,7 @@ according to FMT (default from `org-email-link-description-format')."
   "Association list of escapes for some characters problematic in links.
 This is the list that is used for internal purposes.")
 
-(defconst org-link-escape-chars-browser 
+(defconst org-link-escape-chars-browser
   '((" " . "%20"))
   "Association list of escapes for some characters problematic in links.
 This is the list that is used before handing over to the browser.")
@@ -11459,7 +11459,7 @@ With three \\[universal-argument] prefixes, negate the meaning of
          (setq org-stored-links (delq (assoc link org-stored-links)
                                       org-stored-links)))
       (setq desc (or desc (nth 1 entry)))))
-    
+
     (if (string-match org-plain-link-re link)
        ;; URL-like link, normalize the use of angular brackets.
        (setq link (org-make-link (org-remove-angle-brackets link))))
@@ -12537,7 +12537,7 @@ to be run from that hook to fucntion properly."
              (when (string-match "\\S-" ins)
                (or (equal (char-before) ?:) (insert ":"))
                (insert ins)
-               (or (equal (char-after) ?:) (insert ":")))))            
+               (or (equal (char-after) ?:) (insert ":")))))
           (char
            (setq org-time-was-given (equal (upcase char) char))
            (setq time (org-read-date (equal (upcase char) "U") t nil
@@ -12710,7 +12710,7 @@ See also the variable `org-reverse-note-order'."
                     (org-end-of-subtree t)
                     (org-paste-subtree level txt))
                    (t (error "This should not happen"))))
-                 
+
                  ((and (bobp) (not reversed))
                   ;; Put it at the end, one level below level 1
                   (save-restriction
@@ -12718,7 +12718,7 @@ See also the variable `org-reverse-note-order'."
                     (goto-char (point-max))
                     (if (not (bolp)) (newline))
                     (org-paste-subtree (org-get-legal-level 1 1) txt)))
-                 
+
                  ((and (bobp) reversed)
                   ;; Put it at the start, as level 1
                   (save-restriction
@@ -13834,7 +13834,7 @@ also TODO lines."
       (setq match (completing-read
                   "Match: " 'org-tags-completion-function nil nil nil
                   'org-tags-history))))
-  
+
   ;; Parse the string and create a lisp form
   (let ((match0 match)
        (re (org-re "^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL=\\([0-9]+\\)\\|\\([[:alnum:]]+\\)=\\({[^}]+}\\|\"[^\"]+\"\\)\\|[[:alnum:]_@]+\\)"))
@@ -13997,12 +13997,12 @@ With prefix ARG, realign all tags in headings in the current buffer."
        (while (string-match "[-+&]+" tags)
          ;; No boolean logic, just a list
          (setq tags (replace-match ":" t t tags))))
-      
+
       (if (string-match "\\`[\t ]*\\'" tags)
           (setq tags "")
        (unless (string-match ":$" tags) (setq tags (concat tags ":")))
        (unless (string-match "^:" tags) (setq tags (concat ":" tags))))
-      
+
       ;; Insert new tags at the correct column
       (beginning-of-line 1)
       (cond
@@ -14321,7 +14321,7 @@ Returns the new tags string, or nil to not change the current settings."
   (let (tags)
     (save-excursion
       (goto-char (point-min))
-      (while (re-search-forward 
+      (while (re-search-forward
              (org-re "[ \t]:\\([[:alnum:]_@:]+\\):[ \t\r\n]") nil t)
        (when (equal (char-after (point-at-bol 0)) ?*)
          (mapc (lambda (x) (add-to-list 'tags x))
@@ -14469,7 +14469,7 @@ If WHICH is nil or `all', get all properties.  If WHICH is
                (unless (member key excluded)
                  (push (cons key (or value "")) props)))))
          (append sum-props (nreverse props)))))))
-  
+
 (defun org-entry-get (pom property &optional inherit)
   "Get value of PROPERTY for entry at point-or-marker POM.
 If INHERIT is non-nil and the entry does not have the property,
@@ -14636,7 +14636,7 @@ internally: ARCHIVE, CATEGORY, SUMMARY, DESCRIPTION, LOCATION, and LOGGING."
 (defun org-set-property (property value)
   "In the current entry, set PROPERTY to VALUE."
   (interactive
-   (let* ((prop        (completing-read "Property: " 
+   (let* ((prop        (completing-read "Property: "
                                 (mapcar 'list (org-buffer-property-keys))))
          (cur (org-entry-get nil prop))
          (allowed (org-property-get-allowed-values nil prop 'table))
@@ -14657,7 +14657,7 @@ internally: ARCHIVE, CATEGORY, SUMMARY, DESCRIPTION, LOCATION, and LOGGING."
    (let* ((prop (completing-read
                 "Property: " (org-entry-properties nil 'standard))))
      (list prop)))
-  (message (concat "Property " property 
+  (message (concat "Property " property
                   (if (org-entry-delete nil property)
                       " deleted"
                     " was not present in the entry"))))
@@ -14666,7 +14666,7 @@ internally: ARCHIVE, CATEGORY, SUMMARY, DESCRIPTION, LOCATION, and LOGGING."
   "Remove PROPERTY globally, from all entries."
   (interactive
    (let* ((prop (completing-read
-                "Globally remove property: " 
+                "Globally remove property: "
                 (mapcar 'list (org-buffer-property-keys)))))
      (list prop)))
   (save-excursion
@@ -14703,7 +14703,7 @@ completion."
   (let (vals)
     (cond
      ((equal property "TODO")
-      (setq vals (org-with-point-at pom 
+      (setq vals (org-with-point-at pom
                   (append org-todo-keywords-1 '("")))))
      ((equal property "PRIORITY")
       (let ((n org-lowest-priority))
@@ -14713,7 +14713,7 @@ completion."
      ((member property org-special-properties))
      (t
       (setq vals (org-entry-get pom (concat property "_ALL") 'inherit))
-           
+
       (when (and vals (string-match "\\S-" vals))
        (setq vals (car (read-from-string (concat "(" vals ")"))))
        (setq vals (mapcar (lambda (x)
@@ -14843,7 +14843,7 @@ This is the compiled version of the format.")
                       (beginning-of-line 1)
                       (and (looking-at "\\(\\**\\)\\(\\* \\)")
                            (org-get-level-face 2))))
-        (color (list :foreground 
+        (color (list :foreground
                      (face-attribute (or level-face 'default) :foreground)))
         props pom property ass width f string ov column)
     ;; Check if the entry is in another buffer.
@@ -14988,7 +14988,7 @@ Where possible, use the standard interface for changing this line."
         nval eval allowed)
     (when (equal key "ITEM")
       (error "Cannot edit item headline from here"))
-    
+
     (cond
      ((equal key "TODO")
       (setq eval '(org-with-point-at pom
@@ -15021,7 +15021,7 @@ Where possible, use the standard interface for changing this line."
        (remove-text-properties (1- bol) eol '(read-only t))
        (unwind-protect
            (progn
-             (setq org-columns-overlays 
+             (setq org-columns-overlays
                    (org-delete-all line-overlays org-columns-overlays))
              (mapc 'org-delete-overlay line-overlays)
              (org-columns-eval eval))
@@ -15040,7 +15040,7 @@ Where possible, use the standard interface for changing this line."
         (allowed (org-entry-get (point) key1 t))
         nval)
     (setq nval (read-string "Allowed: " allowed))
-    (org-entry-put 
+    (org-entry-put
      (cond ((marker-position org-entry-property-inherited-from)
            org-entry-property-inherited-from)
           ((marker-position org-columns-top-level-marker)
@@ -15050,8 +15050,7 @@ Where possible, use the standard interface for changing this line."
 (defun org-columns-eval (form)
   (let (hidep)
     (save-excursion
-      (beginning-of-line 1)
-      (next-line 1)
+      (forward-line 1)
       (setq hidep (org-on-heading-p 1)))
     (eval form)
     (and hidep (hide-entry))))
@@ -15099,7 +15098,7 @@ Where possible, use the standard interface for changing this line."
       (remove-text-properties (1- bol) eol '(read-only t))
       (unwind-protect
          (progn
-           (setq org-columns-overlays 
+           (setq org-columns-overlays
                  (org-delete-all line-overlays org-columns-overlays))
            (mapc 'org-delete-overlay line-overlays)
            (org-columns-eval '(org-entry-put pom key nval)))
@@ -15250,7 +15249,7 @@ Where possible, use the standard interface for changing this line."
       (error "Cannot shift this column further to the left"))
     (backward-char 1)
     (org-columns-move-right)
-    (backward-char 1)))    
+    (backward-char 1)))
 
 (defun org-columns-store-format ()
   "Store the text version of the current columns format in appropriate place.
@@ -15348,7 +15347,7 @@ display, or in the #+COLUMNS line of the current buffer."
                (setq pos (org-overlay-start ov))
                (goto-char pos)
                (when (setq val (cdr (assoc property
-                                           (get-text-property 
+                                           (get-text-property
                                             (point-at-bol) 'org-summaries))))
                  (setq fmt (org-overlay-get ov 'org-columns-format))
                  (org-overlay-put ov 'org-columns-value val)
@@ -15404,7 +15403,7 @@ display, or in the #+COLUMNS line of the current buffer."
                                              (if flag str val) format))))
            (aset lflag level t))
          ;; clear accumulators for deeper levels
-         (loop for l from (1+ level) to (1- lmax) do 
+         (loop for l from (1+ level) to (1- lmax) do
                (aset lsum l 0)
                (aset lflag l nil)))
         ((>= level last-level)
@@ -15720,7 +15719,7 @@ user."
                  minute (if (match-end 3)
                             (string-to-number (match-string 3 ans))
                           0)
-                 pm (equal ?p 
+                 pm (equal ?p
                            (string-to-char (downcase (match-string 4 ans)))))
            (if (and (= hour 12) (not pm))
                (setq hour 0)
@@ -16354,7 +16353,7 @@ in the timestamp determines what will be changed."
        (setq ng 6 new (car (rassoc (+ n (cdr (assoc (match-string 6 s) idx))) idx))))
        ((org-pos-in-match-range pos 5)
        (setq ng 5 new (format "%d" (max 1 (+ n (string-to-number (match-string 5 s))))))))
-       
+
       (when ng
        (setq s (concat
                 (substring s 0 (match-beginning ng))
@@ -16421,28 +16420,28 @@ belonging to the category \"Work\"."
   (require 'org)
   (if (equal filter '(4))
       (setq filter (read-from-minibuffer "Regexp filter: ")))
-  (let* ((today (org-date-to-gregorian 
+  (let* ((today (org-date-to-gregorian
                 (time-to-days (current-time))))
         (files org-agenda-files) entries file)
     (while (setq file (pop files))
       (setq entries (append entries (org-agenda-get-day-entries
                                     file today :timestamp))))
     (setq entries (delq nil entries))
-    (mapc 
+    (mapc
      (lambda(x)
        (let* ((evt (org-trim (get-text-property 1 'txt x)))
              (cat (get-text-property 1 'org-category x))
              (tod (get-text-property 1 'time-of-day x))
              (ok (or (and (stringp filter) (string-match filter evt))
                      (and (not (null filter)) (listp filter)
-                          (or (string-match 
+                          (or (string-match
                                (cadr (assoc 'category filter)) cat)
-                              (string-match 
+                              (string-match
                                (cadr (assoc 'headline filter)) evt))))))
              ;; (setq evt (set-text-properties 0 (length event) nil evt))
         (when (and ok tod)
           (setq tod (number-to-string tod)
-                tod (when (string-match 
+                tod (when (string-match
                            "\\([0-9]\\{1,2\\}\\)\\([0-9]\\{2\\}\\)" tod)
                       (concat (match-string 1 tod) ":"
                               (match-string 2 tod))))
@@ -16923,7 +16922,7 @@ the returned times will be formatted strings."
              (setq total-time (+ (or total-time 0)
                                  org-clock-file-total-minutes)))))))
       (goto-char pos)
-      
+
       (unless (eq scope 'agenda)
        (org-clock-sum ts te)
        (goto-char (point-min))
@@ -16968,7 +16967,7 @@ the returned times will be formatted strings."
        (insert-before-markers
         "|-\n|"
         (if (eq scope 'agenda) "|" "")
-        "|" 
+        "|"
         "*Total time*| "
         (format "*%d:%02d*" h m)
         "|\n|-\n")
@@ -19766,7 +19765,7 @@ With prefix ARG, go forward that many times the current span."
           (list (car org-agenda-last-arguments) sd nd t)))
     (org-agenda-redo)
     (org-agenda-find-today-or-agenda))))
+
 (defun org-agenda-earlier (arg)
   "Go backward in time by the current span.
 With prefix ARG, go backward that many times the current span."
@@ -20480,7 +20479,7 @@ be used to request time specification in the time stamp."
   (save-excursion
     (org-back-to-heading t)
     (if (looking-at
-        (if no-tags 
+        (if no-tags
             (org-re "\\*+[ \t]+\\([^\n\r]*?\\)\\([ \t]+:[[:alnum:]:_@]+:[ \t]*\\)?$")
           "\\*+[ \t]+\\([^\r\n]*\\)"))
        (match-string 1) "")))
@@ -21530,7 +21529,7 @@ translations.  There is currently no way for users to extend this.")
          (setq fmt (pop formatters))
          (when (car fmt)
            (goto-char (point-min))
-           (while (re-search-forward (concat "^#\\+" (cadr fmt) 
+           (while (re-search-forward (concat "^#\\+" (cadr fmt)
                                              ":[ \t]*\\(.*\\)") nil t)
              (replace-match "\\1" t)
              (add-text-properties
@@ -21538,7 +21537,7 @@ translations.  There is currently no way for users to extend this.")
               '(org-protected t))))
          (goto-char (point-min))
          (while (re-search-forward
-                 (concat "^#\\+" 
+                 (concat "^#\\+"
                          (caddr fmt) "\\>.*\\(\\(\n.*\\)*?\n\\)#\\+"
                          (cadddr fmt) "\\>.*\n?") nil t)
            (if (car fmt)
@@ -21689,7 +21688,7 @@ translations.  There is currently no way for users to extend this.")
         (add-text-properties (point) (1+ (point-at-eol))
                              (list :org-license-to-kill t)))))
     title))
-        
+
 (defun org-solidify-link-text (s &optional alist)
   "Take link text and make a safe target out of it."
   (save-match-data
@@ -22778,7 +22777,7 @@ lang=\"%s\" xml:lang=\"%s\">
          (if (and (string-match org-todo-line-regexp line)
                   (match-beginning 2))
 
-              (setq line 
+              (setq line
                     (concat (substring line 0 (match-beginning 2))
                             "<span class=\""
                             (if (member (match-string 2 line)
@@ -23112,14 +23111,14 @@ lang=\"%s\" xml:lang=\"%s\">
             (lambda (x)
               (setq gr (pop org-table-colgroup-info))
               (format "%s<COL align=\"%s\"></COL>%s"
-                      (if (memq gr '(:start :startend)) 
+                      (if (memq gr '(:start :startend))
                           (prog1
                               (if colgropen "</colgroup>\n<colgroup>" "<colgroup>")
                             (setq colgropen t))
                         "")
                       (if (> (/ (float x) nlines) org-table-number-fraction)
                           "right" "left")
-                      (if (memq gr '(:end :startend)) 
+                      (if (memq gr '(:end :startend))
                           (progn (setq colgropen nil) "</colgroup>")
                         "")))
             fnum "")
index 8bc14974315917686179fe34efc39e8bf5ec34b7..4d94fb7aeb3c034b6bd42ee8f3ab78f4e3ae883b 100644 (file)
@@ -127,7 +127,7 @@ LABEL is a string to display to label that zone's time."
   :type '(repeat (list string string))
   :version "23.1")
 
-(defcustom display-time-world-time-format "%A %m %B %R %Z"
+(defcustom display-time-world-time-format "%A %d %B %R %Z"
   "Format of the time displayed, see `format-time-string'."
   :group 'display-time
   :type 'string
index 26fb0e503f787b17670d8a9617049343f91988ad..336593891ab6151ec4b8316ca636a4693e076c5e 100644 (file)
@@ -291,7 +291,7 @@ LEFT and RIGHT are the elements to compare."
              ;; * MODE LINE
              (describe-mode [?\C-h ?m])
              (set-fill-column [?\C-x ?f])
-             (fill-paragraph-or-region [?\M-q])
+             (fill-paragraph [?\M-q])
 
              ;; * SEARCHING
              (isearch-forward [?\C-s])
@@ -665,7 +665,8 @@ position where the display of changed bindings was inserted."
   ;; This runs in a hook so protect it:
   (condition-case err
       (if (y-or-n-p "Save your position in the tutorial? ")
-         (tutorial--save-tutorial-to (tutorial--saved-file)))
+         (tutorial--save-tutorial-to (tutorial--saved-file))
+       (message "Tutorial position not saved"))
     (error (message "Error saving tutorial state: %s"
                    (error-message-string err)))))
 
index 92c6c7344836c2d80ac861046852c1e111940b4b..e28a01d35e6f4a07e392b88fd4f77db16be3df8e 100644 (file)
@@ -556,6 +556,13 @@ If FILE is not registered, this function always returns nil."
       (if (vc-backend file)
           (vc-file-setprop file 'vc-working-revision
                            (vc-call working-revision file)))))
+;; Backward compatibility.
+(define-obsolete-function-alias
+  'vc-workfile-version 'vc-working-revision "23.1")
+(defun vc-default-working-revision (backend file)
+  (message
+   "`working-revision' not found: using the old `workfile-version' instead")
+  (vc-call-backend backend 'workfile-version file))
 
 (defun vc-default-registered (backend file)
   "Check if FILE is registered in BACKEND using vc-BACKEND-master-templates."
index a0db56ce6d770d2e6c3fe26b992547af2486049e..0cf800c2ddd50c9d0a9a784d7b21fd646dd42f06 100644 (file)
@@ -1873,24 +1873,17 @@ The meaning of REV1 and REV2 is the same as for `vc-revision-diff'."
 (make-obsolete 'vc-diff-switches-list 'vc-switches "22.1")
 
 (defun vc-diff-sentinel (verbose rev1-name rev2-name)
-  ;; Did changes get generated into the buffer?
-  (if (not (zerop (buffer-size (get-buffer "*vc-diff*"))))
-      (progn
-       (pop-to-buffer "*vc-diff*")
-       ;; Gnus-5.8.5 sets up an autoload for diff-mode, even if it's
-       ;; not available.  Work around that.
-       (if (require 'diff-mode nil t) (diff-mode))
-       (when verbose
-         (let (buffer-read-only)
-           (goto-char (point-max))
-           (insert (format "\n\nDiffs between %s and %s end here." rev1-name rev2-name))
-           (goto-char (point-min))
-           (insert (format "Diffs between %s and %s:\n\n" rev1-name rev2-name))))
-       (shrink-window-if-larger-than-buffer)
-       t)
-    (progn
-      (message "No changes between %s and %s" rev1-name rev2-name)
-      nil)))
+  ;; The empty sync output case has already been handled, so the only
+  ;; possibility of an empty output is for an async process, in which case
+  ;; it's important to insert the "diffs end here" message in the buffer
+  ;; since the user may miss a message in the echo area.
+  (when verbose
+    (let ((inhibit-read-only t))
+      (if (eq (buffer-size) 0)
+          (insert "No differences found.\n")
+        (insert (format "\n\nDiffs between %s and %s end here." rev1-name rev2-name)))))
+  (goto-char (point-min))
+  (shrink-window-if-larger-than-buffer))
 
 (defun vc-diff-internal (backend async files rev1 rev2 &optional verbose)
   "Report diffs between two revisions of a fileset.
@@ -1927,12 +1920,20 @@ returns t if the buffer had changes, nil otherwise."
       (let ((vc-disable-async-diff (not async)))
        (vc-call-backend backend 'diff filtered rev1 rev2 "*vc-diff*")))
     (set-buffer "*vc-diff*")
-    ;; This odd-looking code is because in the non-async case we 
-    ;; actually want to pass the return value from vc-diff-sentinel
-    ;; back to the caller.
-    (if async
-       (vc-exec-after `(vc-diff-sentinel ,verbose ,rev1-name ,rev2-name))
-     (vc-diff-sentinel verbose rev1-name rev2-name))))
+    (if (and (zerop (buffer-size))
+             (not (get-buffer-process (current-buffer))))
+        ;; Treat this case specially so as not to pop the buffer.
+        (progn
+          (message "No changes between %s and %s" rev1-name rev2-name)
+          nil)
+      (pop-to-buffer (current-buffer))
+      ;; Gnus-5.8.5 sets up an autoload for diff-mode, even if it's
+      ;; not available.  Work around that.
+      (if (require 'diff-mode nil t) (diff-mode))
+      (vc-exec-after `(vc-diff-sentinel ,verbose ,rev1-name ,rev2-name))
+      ;; In the async case, we return t even if there are no differences
+      ;; because we don't know that yet.
+      t)))
 
 ;;;###autoload
 (defun vc-history-diff (backend files rev1 rev2)
@@ -3031,10 +3032,7 @@ to provide the `find-revision' operation instead."
     (vc-register)))
 
 (defalias 'vc-default-logentry-check 'ignore)
-
-(defun vc-default-check-headers (backend)
-  "Default implementation of check-headers; always returns nil."
-  nil)
+(defalias 'vc-default-check-headers 'ignore)
 
 (defun vc-default-log-view-mode (backend) (log-view-mode))
 
@@ -3116,7 +3114,7 @@ to provide the `find-revision' operation instead."
               (and (not vc-make-backup-files) (delete-file backup-name))))))
       (message "Checking out %s...done" file))))
 
-(defun vc-default-revision-completion-table (backend file) nil)
+(defalias 'vc-default-revision-completion-table 'ignore)
 
 (defun vc-check-headers ()
   "Check if the current file has any headers in it."
index 15aebb08ab262bf78b4f6f7b7d014879bce35b2b..adb6f08943c445cc7ed1bdc695b62d6980471b27 100644 (file)
@@ -45,9 +45,6 @@
 
 (defvar xterm-mouse-debug-buffer nil)
 
-;; XXX Perhaps this should be terminal-local instead. --lorentey
-(define-key function-key-map "\e[M" 'xterm-mouse-translate)
-
 (defvar xterm-mouse-last)
 
 ;; Mouse events symbols must have an 'event-kind property with
@@ -78,7 +75,7 @@
            (error "Unexpected escape sequence from XTerm")))
 
        (let* ((click (if is-click down (xterm-mouse-event)))
-              (click-command (nth 0 click))
+              ;; (click-command (nth 0 click))
               (click-data (nth 1 click))
               (click-where (nth 1 click-data)))
          (if (memq down-binding '(nil ignore))
@@ -209,14 +206,15 @@ down the SHIFT key while pressing the mouse button."
       ;; Turn it on
       (progn
        ;; Frame creation and deletion.
-       (add-hook 'after-make-frame-functions 
-                 'turn-on-xterm-mouse-tracking-on-terminal)
+        (add-hook 'terminal-init-xterm-hook
+                  'turn-on-xterm-mouse-tracking-on-terminal)
+
        (add-hook 'delete-frame-functions 'xterm-mouse-handle-delete-frame)
        
        ;; Restore normal mouse behaviour outside Emacs.
         (add-hook 'suspend-tty-functions
                  'turn-off-xterm-mouse-tracking-on-terminal)
-       (add-hook 'resume-tty-functions 
+       (add-hook 'resume-tty-functions
                  'turn-on-xterm-mouse-tracking-on-terminal)
        (add-hook 'suspend-hook 'turn-off-xterm-mouse-tracking)
        (add-hook 'suspend-resume-hook 'turn-on-xterm-mouse-tracking)
@@ -224,8 +222,6 @@ down the SHIFT key while pressing the mouse button."
        (setq mouse-position-function #'xterm-mouse-position-function)
        (turn-on-xterm-mouse-tracking))
     ;; Turn it off
-    (remove-hook 'after-make-frame-functions 
-                'turn-on-xterm-mouse-tracking-on-terminal)
     (remove-hook 'delete-frame-functions 'xterm-mouse-handle-delete-frame)
     (remove-hook 'suspend-tty-functions 
                 'turn-off-xterm-mouse-tracking-on-terminal)
@@ -239,28 +235,35 @@ down the SHIFT key while pressing the mouse button."
 
 (defun turn-on-xterm-mouse-tracking ()
   "Enable Emacs mouse tracking in xterm."
-  (dolist (f (frame-list))
-    (when (eq t (frame-live-p f))
-      (with-selected-frame f
-       (when xterm-mouse-mode
-         (send-string-to-terminal "\e[?1000h"))))))
+  (dolist (terminal (delete-dups (mapcar 'frame-terminal (frame-list))))
+    (turn-on-xterm-mouse-tracking-on-terminal terminal)))
 
 (defun turn-off-xterm-mouse-tracking (&optional force)
   "Disable Emacs mouse tracking in xterm."
-  (dolist (f (frame-list))
-    (when (eq t (frame-live-p f))
-      (with-selected-frame f
-       (when (or force xterm-mouse-mode)
-         (send-string-to-terminal "\e[?1000l"))))))
+  (dolist (terminal (delete-dups (mapcar 'frame-terminal (frame-list))))
+    (turn-off-xterm-mouse-tracking-on-terminal terminal)))
 
-(defun turn-on-xterm-mouse-tracking-on-terminal (terminal)
+(defun turn-on-xterm-mouse-tracking-on-terminal (&optional terminal)
   "Enable xterm mouse tracking on TERMINAL."
   (when (and xterm-mouse-mode (eq t (terminal-live-p terminal)))
+    (unless (terminal-parameter terminal 'xterm-mouse-mode)
+      ;; Simulate selecting a terminal by selecting one of its frames ;-(
+      (with-selected-frame (car (frames-on-display-list terminal))
+        (define-key input-decode-map "\e[M" 'xterm-mouse-translate))
+      (set-terminal-parameter terminal 'xterm-mouse-mode t))
     (send-string-to-terminal "\e[?1000h" terminal)))
 
 (defun turn-off-xterm-mouse-tracking-on-terminal (terminal)
   "Disable xterm mouse tracking on TERMINAL."
-  (when (and xterm-mouse-mode (eq t (terminal-live-p terminal)))
+  ;; Only send the disable command to those terminals to which we've already
+  ;; sent the enable command.
+  (when (and (terminal-parameter terminal 'xterm-mouse-mode)
+             (eq t (terminal-live-p terminal)))
+    ;; We could remove the key-binding and unset the `xterm-mouse-mode'
+    ;; terminal parameter, but it seems less harmful to send this escape
+    ;; command too many times (or to catch an unintended key sequence), than
+    ;; to send it too few times (or to fail to let xterm-mouse events
+    ;; pass by untranslated).
     (send-string-to-terminal "\e[?1000l" terminal)))
 
 (defun xterm-mouse-handle-delete-frame (frame)
index 4a8f353782b39d3ffe28abe5d5f9f17cbe92193b..c0d8d7a505005b5f52ffec4f764ec6446c6b2bfb 100644 (file)
@@ -1,3 +1,7 @@
+2007-10-18  Jason Rumney  <jasonr@gnu.org>
+
+       * makefile.w32-in (install): Install COPYING in top-level and bin dirs.
+
 2007-09-27  Jason Rumney  <jasonr@gnu.org>
 
        * gmake.defs (COMCTL32): New system library.
index 155f201aa1e72fb7fb5b4700dd617c70ad5f3dd0..5cb13a79e9abcc09e040d9497211378fa42d3d3f 100644 (file)
@@ -211,6 +211,8 @@ install: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE)
        $(IFNOTSAMEDIR) $(CP_DIR) ../etc $(INSTALL_DIR) $(ENDIF)\r
        - $(CP_DIR) icons $(INSTALL_DIR)/etc\r
        $(IFNOTSAMEDIR) $(CP_DIR) ../info $(INSTALL_DIR) $(ENDIF)\r
+       $(IFNOTSAMEDIR) $(CP) ../COPYING $(INSTALL_DIR) $(ENDIF)\r
+       - $(CP) ../COPYING $(INSTALL_DIR)/bin\r
        - $(DEL) ../same-dir.tst\r
        - $(DEL) $(INSTALL_DIR)/same-dir.tst\r
 \r
index 4ba46df0f2306ffb24ad588bc7c4d7397cce865d..c50b6286407df5c2e2a46a5dede1ffbb4e31304d 100644 (file)
@@ -1,3 +1,103 @@
+2007-10-18  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * keyboard.c (read_key_sequence): Undo a change introduced by multi-tty
+       which caused key-translation-map to applied repeatedly (thus breaking
+       double-mode).
+
+2007-10-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * xselect.c (x_own_selection, x_handle_selection_clear)
+       (x_clear_frame_selections):
+       * w32menu.c (list_of_panes, list_of_items):
+       * w32fns.c (w32_color_map_lookup, Fx_create_frame, Fx_display_list):
+       * textprop.c (validate_plist, interval_has_all_properties)
+       (interval_has_some_properties, interval_has_some_properties_list)
+       (add_properties, text_property_list):
+       * process.c (Fget_buffer_process, list_processes_1, status_notify):
+       * minibuf.c (Fassoc_string):
+       * macselect.c (x_own_selection, x_clear_frame_selections)
+       (Fx_disown_selection_internal):
+       * keymap.c (Fcommand_remapping, where_is_internal, describe_map_tree):
+       Use CONSP rather than !NILP and XC[AD]R rather than Fc[ad]r.
+
+2007-10-17  Chong Yidong  <cyd@stupidchicken.com>
+
+       * process.c: Link to libs for calling res_init() if available.
+       (Fmake_network_process): Call res_init() before getaddrinfo or
+       gethostbyname, if possible.
+
+2007-10-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * lread.c (read1): Set pvectype for char_tables.
+
+       * lisp.h (XMISCANY, XMARKER, XINTFWD, XBOOLFWD, XOBJFWD, XOVERLAY)
+       (XBUFFER_OBJFWD, XBUFFER_LOCAL_VALUE, XKBOARD_OBJFWD, XSAVE_VALUE):
+       Add type checks.
+       (SOME_BUFFER_LOCAL_VALUEP, GC_SOME_BUFFER_LOCAL_VALUEP): Remove.
+
+       * alloc.c (free_misc): Use XMISCTYPE.
+       (live_misc_p, gc_sweep): Use Lisp_Misc_Any.
+
+2007-10-17  Glenn Morris  <rgm@gnu.org>
+
+       * minibuf.c (Qcompletion_ignore_case): New Lisp_Object.
+       (syms_of_minibuf): Add Qcompletion_ignore_case.
+       * dired.c (Qcompletion_ignore_case): Change to external.
+       (syms_of_dired) [VMS]: Remove Qcompletion_ignore_case.
+       * fileio.c (Qcompletion_ignore_case): New external Lisp_Object.
+       (Fread_file_name): Use it rather than intern'ing.
+
+       * coding.c (Qcompletion_ignore_case): New external Lisp_Object.
+       (Fread_coding_system): Ignore case of user input.
+
+2007-10-16  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * xdisp.c (handle_display_prop): Ignore display specs after
+       replacing one when string text is being replaced.
+       (handle_single_display_spec): Pretend as if characters with display
+       property haven't been consumed only when buffer text is being replaced.
+
+2007-10-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * xfns.c (Fx_create_frame, Fx_display_list):
+       * window.c (window_fixed_size_p, enlarge_window)
+       (shrink_window_lowest_first):
+       * macterm.c (init_font_name_table):
+       * macfns.c (Fx_create_frame, Fx_display_list):
+       * lread.c (close_load_descs):
+       * keyboard.c (read_char_x_menu_prompt):
+       * fns.c (Fmember, Fmemql, Fdelete, Fset_char_table_parent):
+       * coding.c (code_convert_region_unwind): Test the type of an object
+       rather than just !NILP before extracting data from it.
+
+       * alloc.c (Fpurecopy): Set the pvec tag on pseudo vectors.
+
+       * lisp.h (enum Lisp_Misc_Type): Del Lisp_Misc_Some_Buffer_Local_Value.
+       (XMISCANY): New macro.
+       (XMISCTYPE): Use it.
+       (struct Lisp_Misc_Any): New type.
+       (union Lisp_Misc): Use it.
+       (struct Lisp_Buffer_Local_Value): Add `local_if_set' bit.
+       * data.c (Fboundp, store_symval_forwarding, swap_in_global_binding)
+       (find_symbol_value, set_internal, default_value, Fset_default)
+       (Fmake_variable_buffer_local, Fmake_local_variable)
+       (Fkill_local_variable, Fmake_variable_frame_local, Flocal_variable_p)
+       (Flocal_variable_if_set_p, Fvariable_binding_locus):
+       The SOME_BUFFER_LOCAL_VALUEP distinction is replaced by local_if_set.
+       * alloc.c (allocate_buffer): Set the size and tag.
+       (allocate_misc, mark_maybe_object, mark_object, survives_gc_p):
+       Use XMISCANY.
+       (die): Follow the GNU convention for error messages.
+       * print.c (print_object): SOME_BUFFER_LOCAL_VALUEP -> local_if_set.
+       * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Don't set the
+       tag any more.
+       (set_buffer_internal_1):
+       * frame.c (store_frame_param):
+       * eval.c (specbind):
+       * xdisp.c (select_frame_for_redisplay): Drop SOME_BUFFER_LOCAL_VALUEP.
+
+       * doc.c (Fsnarf_documentation): Simplify.
+
 2007-10-14  Juanma Barranquero  <lekktu@gmail.com>
 
        * w32term.c (w32_font_is_double_byte, my_create_scrollbar): Make static.
 
        * puresize.h (BASE_PURESIZE): Increase to 1170000.
 
+2007-10-09  Richard Stallman  <rms@gnu.org>
+
+       * xdisp.c (handle_invisible_prop): After setting up an ellipsis,
+       return HANDLED_RETURN.
+
 2007-10-08  Martin Rudalics  <rudalics@gmx.at>
 
        * keyboard.c (kbd_buffer_get_event): Break loop waiting for input
index ed003af3ea849c75c5480f2bbfea928ec5ff3b0c..295da59d026cb4fe18fdaac626feff0af37f1fbd 100644 (file)
@@ -1153,6 +1153,8 @@ allocate_buffer ()
   struct buffer *b
     = (struct buffer *) lisp_malloc (sizeof (struct buffer),
                                     MEM_TYPE_BUFFER);
+  b->size = sizeof (struct buffer) / sizeof (EMACS_INT);
+  XSETPVECTYPE (b, PVEC_BUFFER);
   return b;
 }
 
@@ -3307,7 +3309,7 @@ allocate_misc ()
   --total_free_markers;
   consing_since_gc += sizeof (union Lisp_Misc);
   misc_objects_consed++;
-  XMARKER (val)->gcmarkbit = 0;
+  XMISCANY (val)->gcmarkbit = 0;
   return val;
 }
 
@@ -3317,7 +3319,7 @@ void
 free_misc (misc)
      Lisp_Object misc;
 {
-  XMISC (misc)->u_marker.type = Lisp_Misc_Free;
+  XMISCTYPE (misc) = Lisp_Misc_Free;
   XMISC (misc)->u_free.chain = marker_free_list;
   marker_free_list = XMISC (misc);
 
@@ -4033,7 +4035,7 @@ live_misc_p (m, p)
              && offset < (MARKER_BLOCK_SIZE * sizeof b->markers[0])
              && (b != marker_block
                  || offset / sizeof b->markers[0] < marker_block_index)
-             && ((union Lisp_Misc *) p)->u_marker.type != Lisp_Misc_Free);
+             && ((union Lisp_Misc *) p)->u_any.type != Lisp_Misc_Free);
     }
   else
     return 0;
@@ -4164,7 +4166,7 @@ mark_maybe_object (obj)
          break;
 
        case Lisp_Misc:
-         mark_p = (live_misc_p (m, po) && !XMARKER (obj)->gcmarkbit);
+         mark_p = (live_misc_p (m, po) && !XMISCANY (obj)->gcmarkbit);
          break;
 
        case Lisp_Int:
@@ -5613,14 +5615,13 @@ mark_object (arg)
 
     case Lisp_Misc:
       CHECK_ALLOCATED_AND_LIVE (live_misc_p);
-      if (XMARKER (obj)->gcmarkbit)
+      if (XMISCANY (obj)->gcmarkbit)
        break;
-      XMARKER (obj)->gcmarkbit = 1;
+      XMISCANY (obj)->gcmarkbit = 1;
 
       switch (XMISCTYPE (obj))
        {
        case Lisp_Misc_Buffer_Local_Value:
-       case Lisp_Misc_Some_Buffer_Local_Value:
          {
            register struct Lisp_Buffer_Local_Value *ptr
              = XBUFFER_LOCAL_VALUE (obj);
@@ -5806,7 +5807,7 @@ survives_gc_p (obj)
       break;
 
     case Lisp_Misc:
-      survives_p = XMARKER (obj)->gcmarkbit;
+      survives_p = XMISCANY (obj)->gcmarkbit;
       break;
 
     case Lisp_String:
@@ -6103,9 +6104,9 @@ gc_sweep ()
 
        for (i = 0; i < lim; i++)
          {
-           if (!mblk->markers[i].u_marker.gcmarkbit)
+           if (!mblk->markers[i].u_any.gcmarkbit)
              {
-               if (mblk->markers[i].u_marker.type == Lisp_Misc_Marker)
+               if (mblk->markers[i].u_any.type == Lisp_Misc_Marker)
                  unchain_marker (&mblk->markers[i].u_marker);
                /* Set the type of the freed object to Lisp_Misc_Free.
                   We could leave the type alone, since nobody checks it,
@@ -6118,7 +6119,7 @@ gc_sweep ()
            else
              {
                num_used++;
-               mblk->markers[i].u_marker.gcmarkbit = 0;
+               mblk->markers[i].u_any.gcmarkbit = 0;
              }
          }
        lim = MARKER_BLOCK_SIZE;
@@ -6256,7 +6257,7 @@ die (msg, file, line)
      const char *file;
      int line;
 {
-  fprintf (stderr, "\r\nEmacs fatal error: %s:%d: %s\r\n",
+  fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n",
           file, line, msg);
   abort ();
 }
index d5f9541301d2168590cbc2239df44ae40f8b6587..416ff7e370232f815c95f392370f89604983ef3d 100644 (file)
@@ -362,8 +362,6 @@ The value is never nil.  */)
 
   b = (struct buffer *) allocate_buffer ();
 
-  b->size = sizeof (struct buffer) / sizeof (EMACS_INT);
-
   /* An ordinary buffer uses its own struct buffer_text.  */
   b->text = &b->own_text;
   b->base_buffer = 0;
@@ -417,10 +415,7 @@ The value is never nil.  */)
   STRING_SET_INTERVALS (name, NULL_INTERVAL);
   b->name = name;
 
-  if (SREF (name, 0) != ' ')
-    b->undo_list = Qnil;
-  else
-    b->undo_list = Qt;
+  b->undo_list = (SREF (name, 0) != ' ') ? Qnil : Qt;
 
   reset_buffer (b);
   reset_buffer_local_variables (b, 1);
@@ -430,7 +425,6 @@ The value is never nil.  */)
   b->name = name;
 
   /* Put this in the alist of all live buffers.  */
-  XSETPVECTYPE (b, PVEC_BUFFER);
   XSETBUFFER (buf, b);
   Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil));
 
@@ -568,13 +562,10 @@ CLONE nil means the indirect buffer's state is reset to default values.  */)
     error ("Empty string for buffer name is not allowed");
 
   b = (struct buffer *) allocate_buffer ();
-  b->size = sizeof (struct buffer) / sizeof (EMACS_INT);
-  XSETPVECTYPE (b, PVEC_BUFFER);
 
-  if (XBUFFER (base_buffer)->base_buffer)
-    b->base_buffer = XBUFFER (base_buffer)->base_buffer;
-  else
-    b->base_buffer = XBUFFER (base_buffer);
+  b->base_buffer = (XBUFFER (base_buffer)->base_buffer
+                   ? XBUFFER (base_buffer)->base_buffer
+                   : XBUFFER (base_buffer));
 
   /* Use the base buffer's text object.  */
   b->text = b->base_buffer->text;
@@ -1919,8 +1910,7 @@ set_buffer_internal_1 (b)
   for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail))
     {
       valcontents = SYMBOL_VALUE (XCAR (XCAR (tail)));
-      if ((BUFFER_LOCAL_VALUEP (valcontents)
-          || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+      if ((BUFFER_LOCAL_VALUEP (valcontents))
          && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue,
              (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem))))
        /* Just reference the variable
@@ -1934,8 +1924,7 @@ set_buffer_internal_1 (b)
     for (tail = old_buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
       {
        valcontents = SYMBOL_VALUE (XCAR (XCAR (tail)));
-       if ((BUFFER_LOCAL_VALUEP (valcontents)
-            || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+       if ((BUFFER_LOCAL_VALUEP (valcontents))
            && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue,
                (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem))))
          /* Just reference the variable
@@ -2509,7 +2498,7 @@ the normal hook `change-major-mode-hook'.  */)
   /* Any which are supposed to be permanent,
      make local again, with the same values they had.  */
 
-  for (alist = oalist; !NILP (alist); alist = XCDR (alist))
+  for (alist = oalist; CONSP (alist); alist = XCDR (alist))
     {
       sym = XCAR (XCAR (alist));
       tem = Fget (sym, Qpermanent_local);
@@ -2539,7 +2528,7 @@ swap_out_buffer_local_variables (b)
   XSETBUFFER (buffer, b);
   oalist = b->local_var_alist;
 
-  for (alist = oalist; !NILP (alist); alist = XCDR (alist))
+  for (alist = oalist; CONSP (alist); alist = XCDR (alist))
     {
       sym = XCAR (XCAR (alist));
 
index 2b518b903a425610689585ba16b8645bfa21c70d..c77aa338a1e75406df9a19dae73fe0ef71390818 100644 (file)
@@ -329,6 +329,8 @@ Lisp_Object Qtarget_idx;
 Lisp_Object Qinsufficient_source, Qinconsistent_eol, Qinvalid_source;
 Lisp_Object Qinterrupted, Qinsufficient_memory;
 
+extern Lisp_Object Qcompletion_ignore_case;
+
 /* If a symbol has this property, evaluate the value to define the
    symbol as a coding system.  */
 static Lisp_Object Qcoding_system_define_form;
@@ -7194,16 +7196,22 @@ DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system,
 
 DEFUN ("read-coding-system", Fread_coding_system, Sread_coding_system, 1, 2, 0,
        doc: /* Read a coding system from the minibuffer, prompting with string PROMPT.
-If the user enters null input, return second argument DEFAULT-CODING-SYSTEM.  */)
+If the user enters null input, return second argument DEFAULT-CODING-SYSTEM.
+Ignores case when completing coding systems (all Emacs coding systems
+are lower-case).  */)
      (prompt, default_coding_system)
      Lisp_Object prompt, default_coding_system;
 {
   Lisp_Object val;
+  int count = SPECPDL_INDEX ();
+
   if (SYMBOLP (default_coding_system))
-    XSETSTRING (default_coding_system, XPNTR (SYMBOL_NAME (default_coding_system)));
+    default_coding_system = SYMBOL_NAME (default_coding_system);
+  specbind (Qcompletion_ignore_case, Qt);
   val = Fcompleting_read (prompt, Vcoding_system_alist, Qnil,
                          Qt, Qnil, Qcoding_system_history,
                          default_coding_system, Qnil);
+  unbind_to (count, Qnil);
   return (SCHARS (val) == 0 ? Qnil : Fintern (val, Qnil));
 }
 
index 60be3c2200384f8f936543a3a00ccc58d587e4ea..c23ec13ac884019d62c01c24917895a2f6fbce67 100644 (file)
@@ -492,7 +492,7 @@ Boston, MA 02110-1301, USA.  */
 /* Define to 1 if you have the `rename' function. */
 #undef HAVE_RENAME
 
-/* Define to 1 if you have the `res_init' function. */
+/* Define to 1 if res_init is available. */
 #undef HAVE_RES_INIT
 
 /* Define to 1 if you have the `rindex' function. */
index 81cffcb38deee72dda7f45700c203a549ac9a79b..3139af1e001aff8cc7cf4f5146154df4eeb0f1ee 100644 (file)
@@ -584,8 +584,7 @@ DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0,
 
   valcontents = SYMBOL_VALUE (symbol);
 
-  if (BUFFER_LOCAL_VALUEP (valcontents)
-      || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (BUFFER_LOCAL_VALUEP (valcontents))
     valcontents = swap_in_symval_forwarding (symbol, valcontents);
 
   return (EQ (valcontents, Qunbound) ? Qnil : Qt);
@@ -998,8 +997,7 @@ store_symval_forwarding (symbol, valcontents, newval, buf)
     default:
     def:
       valcontents = SYMBOL_VALUE (symbol);
-      if (BUFFER_LOCAL_VALUEP (valcontents)
-         || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+      if (BUFFER_LOCAL_VALUEP (valcontents))
        XBUFFER_LOCAL_VALUE (valcontents)->realvalue = newval;
       else
        SET_SYMBOL_VALUE (symbol, newval);
@@ -1016,8 +1014,7 @@ swap_in_global_binding (symbol)
   Lisp_Object valcontents, cdr;
 
   valcontents = SYMBOL_VALUE (symbol);
-  if (!BUFFER_LOCAL_VALUEP (valcontents)
-      && !SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (!BUFFER_LOCAL_VALUEP (valcontents))
     abort ();
   cdr = XBUFFER_LOCAL_VALUE (valcontents)->cdr;
 
@@ -1106,8 +1103,7 @@ find_symbol_value (symbol)
   CHECK_SYMBOL (symbol);
   valcontents = SYMBOL_VALUE (symbol);
 
-  if (BUFFER_LOCAL_VALUEP (valcontents)
-      || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (BUFFER_LOCAL_VALUEP (valcontents))
     valcontents = swap_in_symval_forwarding (symbol, valcontents);
 
   if (MISCP (valcontents))
@@ -1225,8 +1221,7 @@ set_internal (symbol, newval, buf, bindflag)
          && !let_shadows_buffer_binding_p (symbol))
        SET_PER_BUFFER_VALUE_P (buf, idx, 1);
     }
-  else if (BUFFER_LOCAL_VALUEP (valcontents)
-          || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  else if (BUFFER_LOCAL_VALUEP (valcontents))
     {
       /* valcontents is a struct Lisp_Buffer_Local_Value.   */
       if (XSYMBOL (symbol)->indirect_variable)
@@ -1271,7 +1266,7 @@ set_internal (symbol, newval, buf, bindflag)
                 indicating that we're seeing the default value.
                 Likewise if the variable has been let-bound
                 in the current buffer.  */
-             if (bindflag || SOME_BUFFER_LOCAL_VALUEP (valcontents)
+             if (bindflag || !XBUFFER_LOCAL_VALUE (valcontents)->local_if_set
                  || let_shadows_buffer_binding_p (symbol))
                {
                  XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 0;
@@ -1299,8 +1294,7 @@ set_internal (symbol, newval, buf, bindflag)
            }
 
          /* Record which binding is now loaded.  */
-         XSETCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr,
-                  tem1);
+         XSETCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr, tem1);
 
          /* Set `buffer' and `frame' slots for the binding now loaded.  */
          XSETBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer, buf);
@@ -1319,8 +1313,7 @@ set_internal (symbol, newval, buf, bindflag)
   /* If we just set a variable whose current binding is frame-local,
      store the new value in the frame parameter too.  */
 
-  if (BUFFER_LOCAL_VALUEP (valcontents)
-      || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (BUFFER_LOCAL_VALUEP (valcontents))
     {
       /* What binding is loaded right now?  */
       current_alist_element
@@ -1362,8 +1355,7 @@ default_value (symbol)
     }
 
   /* Handle user-created local variables.  */
-  if (BUFFER_LOCAL_VALUEP (valcontents)
-      || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (BUFFER_LOCAL_VALUEP (valcontents))
     {
       /* If var is set up for a buffer that lacks a local value for it,
         the current value is nominally the default value.
@@ -1447,8 +1439,7 @@ for this variable.  */)
       return value;
     }
 
-  if (!BUFFER_LOCAL_VALUEP (valcontents)
-      && !SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (!BUFFER_LOCAL_VALUEP (valcontents))
     return Fset (symbol, value);
 
   /* Store new value into the DEFAULT-VALUE slot.  */
@@ -1533,27 +1524,28 @@ The function `default-value' gets the default value and `set-default' sets it.
   if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents))
     error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable)));
 
-  if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents))
+  if (BUFFER_OBJFWDP (valcontents))
     return variable;
-  if (SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  else if (BUFFER_LOCAL_VALUEP (valcontents))
+    newval = valcontents;
+  else
     {
-      XMISCTYPE (SYMBOL_VALUE (variable)) = Lisp_Misc_Buffer_Local_Value;
-      return variable;
+      if (EQ (valcontents, Qunbound))
+       SET_SYMBOL_VALUE (variable, Qnil);
+      tem = Fcons (Qnil, Fsymbol_value (variable));
+      XSETCAR (tem, tem);
+      newval = allocate_misc ();
+      XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value;
+      XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable);
+      XBUFFER_LOCAL_VALUE (newval)->buffer = Fcurrent_buffer ();
+      XBUFFER_LOCAL_VALUE (newval)->frame = Qnil;
+      XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0;
+      XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0;
+      XBUFFER_LOCAL_VALUE (newval)->check_frame = 0;
+      XBUFFER_LOCAL_VALUE (newval)->cdr = tem;
+      SET_SYMBOL_VALUE (variable, newval);
     }
-  if (EQ (valcontents, Qunbound))
-    SET_SYMBOL_VALUE (variable, Qnil);
-  tem = Fcons (Qnil, Fsymbol_value (variable));
-  XSETCAR (tem, tem);
-  newval = allocate_misc ();
-  XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value;
-  XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable);
-  XBUFFER_LOCAL_VALUE (newval)->buffer = Fcurrent_buffer ();
-  XBUFFER_LOCAL_VALUE (newval)->frame = Qnil;
-  XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0;
-  XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0;
-  XBUFFER_LOCAL_VALUE (newval)->check_frame = 0;
-  XBUFFER_LOCAL_VALUE (newval)->cdr = tem;
-  SET_SYMBOL_VALUE (variable, newval);
+  XBUFFER_LOCAL_VALUE (newval)->local_if_set = 1;
   return variable;
 }
 
@@ -1589,7 +1581,9 @@ Instead, use `add-hook' and specify t for the LOCAL argument.  */)
   if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents))
     error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable)));
 
-  if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents))
+  if ((BUFFER_LOCAL_VALUEP (valcontents)
+       && XBUFFER_LOCAL_VALUE (valcontents)->local_if_set)
+      || BUFFER_OBJFWDP (valcontents))
     {
       tem = Fboundp (variable);
 
@@ -1599,16 +1593,17 @@ Instead, use `add-hook' and specify t for the LOCAL argument.  */)
       return variable;
     }
   /* Make sure symbol is set up to hold per-buffer values.  */
-  if (!SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (!BUFFER_LOCAL_VALUEP (valcontents))
     {
       Lisp_Object newval;
       tem = Fcons (Qnil, do_symval_forwarding (valcontents));
       XSETCAR (tem, tem);
       newval = allocate_misc ();
-      XMISCTYPE (newval) = Lisp_Misc_Some_Buffer_Local_Value;
+      XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value;
       XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable);
       XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil;
       XBUFFER_LOCAL_VALUE (newval)->frame = Qnil;
+      XBUFFER_LOCAL_VALUE (newval)->local_if_set = 0;
       XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0;
       XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0;
       XBUFFER_LOCAL_VALUE (newval)->check_frame = 0;
@@ -1681,8 +1676,7 @@ From now on the default value will apply in this buffer.  Return VARIABLE.  */)
       return variable;
     }
 
-  if (!BUFFER_LOCAL_VALUEP (valcontents)
-      && !SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (!BUFFER_LOCAL_VALUEP (valcontents))
     return variable;
 
   /* Get rid of this buffer's alist element, if any.  */
@@ -1743,8 +1737,7 @@ Buffer-local bindings take precedence over frame-local bindings.  */)
       || BUFFER_OBJFWDP (valcontents))
     error ("Symbol %s may not be frame-local", SDATA (SYMBOL_NAME (variable)));
 
-  if (BUFFER_LOCAL_VALUEP (valcontents)
-      || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (BUFFER_LOCAL_VALUEP (valcontents))
     {
       XBUFFER_LOCAL_VALUE (valcontents)->check_frame = 1;
       return variable;
@@ -1755,10 +1748,11 @@ Buffer-local bindings take precedence over frame-local bindings.  */)
   tem = Fcons (Qnil, Fsymbol_value (variable));
   XSETCAR (tem, tem);
   newval = allocate_misc ();
-  XMISCTYPE (newval) = Lisp_Misc_Some_Buffer_Local_Value;
+  XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value;
   XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable);
   XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil;
   XBUFFER_LOCAL_VALUE (newval)->frame = Qnil;
+  XBUFFER_LOCAL_VALUE (newval)->local_if_set = 0;
   XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0;
   XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0;
   XBUFFER_LOCAL_VALUE (newval)->check_frame = 1;
@@ -1789,8 +1783,7 @@ BUFFER defaults to the current buffer.  */)
   variable = indirect_variable (variable);
 
   valcontents = SYMBOL_VALUE (variable);
-  if (BUFFER_LOCAL_VALUEP (valcontents)
-      || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  if (BUFFER_LOCAL_VALUEP (valcontents))
     {
       Lisp_Object tail, elt;
 
@@ -1838,15 +1831,14 @@ BUFFER defaults to the current buffer.  */)
 
   valcontents = SYMBOL_VALUE (variable);
 
-  /* This means that make-variable-buffer-local was done.  */
-  if (BUFFER_LOCAL_VALUEP (valcontents))
-    return Qt;
-  /* All these slots become local if they are set.  */
   if (BUFFER_OBJFWDP (valcontents))
+    /* All these slots become local if they are set.  */
     return Qt;
-  if (SOME_BUFFER_LOCAL_VALUEP (valcontents))
+  else if (BUFFER_LOCAL_VALUEP (valcontents))
     {
       Lisp_Object tail, elt;
+      if (XBUFFER_LOCAL_VALUE (valcontents)->local_if_set)
+       return Qt;
       for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
        {
          elt = XCAR (tail);
@@ -1877,14 +1869,13 @@ If the current binding is global (the default), the value is nil.  */)
   valcontents = XSYMBOL (variable)->value;
 
   if (BUFFER_LOCAL_VALUEP (valcontents)
-      || SOME_BUFFER_LOCAL_VALUEP (valcontents)
       || BUFFER_OBJFWDP (valcontents))
     {
       /* For a local variable, record both the symbol and which
         buffer's or frame's value we are saving.  */
       if (!NILP (Flocal_variable_p (variable, Qnil)))
        return Fcurrent_buffer ();
-      else if (!BUFFER_OBJFWDP (valcontents)
+      else if (BUFFER_LOCAL_VALUEP (valcontents)
               && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame)
        return XBUFFER_LOCAL_VALUE (valcontents)->frame;
     }
index b362eec62b5274dd1167f5b5f2a62c04bfbd85e5..ccd27dbb713ca5f464cf77b312bc2728623f85e8 100644 (file)
@@ -116,10 +116,10 @@ extern void filemodestring P_ ((struct stat *, char *));
 #endif
 
 extern int completion_ignore_case;
+extern Lisp_Object Qcompletion_ignore_case;
 extern Lisp_Object Vcompletion_regexp_list;
 
 Lisp_Object Vcompletion_ignored_extensions;
-Lisp_Object Qcompletion_ignore_case;
 Lisp_Object Qdirectory_files;
 Lisp_Object Qdirectory_files_and_attributes;
 Lisp_Object Qfile_name_completion;
@@ -1078,11 +1078,6 @@ syms_of_dired ()
   defsubr (&Sfile_attributes);
   defsubr (&Sfile_attributes_lessp);
 
-#ifdef VMS
-  Qcompletion_ignore_case = intern ("completion-ignore-case");
-  staticpro (&Qcompletion_ignore_case);
-#endif /* VMS */
-
   DEFVAR_LISP ("completion-ignored-extensions", &Vcompletion_ignored_extensions,
               doc: /* Completion ignores file names ending in any string in this list.
 It does not ignore them if all possible completions end in one of
index 3b335127a75124fe030f51818c58d484b2f8a1ad..f491661a61658a5b9cf833f3155cf4c02d1fde11 100644 (file)
--- a/src/doc.c
+++ b/src/doc.c
@@ -693,15 +693,17 @@ the same file name is found in the `doc-directory'.  */)
               if (fromfile[len-1] == 'c')
                 fromfile[len-1] = 'o';
 
-              if (EQ (Fmember (build_string (fromfile), Vbuild_files), Qnil))
-                skip_file = 1;
-              else
-                skip_file = 0;
+             skip_file = NILP (Fmember (build_string (fromfile),
+                                        Vbuild_files));
             }
 
          sym = oblookup (Vobarray, p + 2,
                          multibyte_chars_in_text (p + 2, end - p - 2),
                          end - p - 2);
+         /* Check skip_file so that when a function is defined several
+            times in different files (typically, once in xterm, once in
+            w32term, ...), we only pay attention to the one that
+            matters.  */
          if (! skip_file && SYMBOLP (sym))
            {
              /* Attach a docstring to a variable?  */
index b69eea44c75c2ecb7d23c9a4f2fa8f03a0be8be4..eaa1a6855f6bc38a3d056d7fb82305924c5f40c4 100644 (file)
@@ -468,7 +468,7 @@ usage: (prog1 FIRST BODY...)  */)
   struct gcpro gcpro1, gcpro2;
   register int argnum = 0;
 
-  if (NILP(args))
+  if (NILP (args))
     return Qnil;
 
   args_left = args;
@@ -1043,10 +1043,10 @@ usage: (let VARLIST BODY...)  */)
   GCPRO2 (args, *temps);
   gcpro2.nvars = 0;
 
-  for (argnum = 0; !NILP (varlist); varlist = Fcdr (varlist))
+  for (argnum = 0; CONSP (varlist); varlist = XCDR (varlist))
     {
       QUIT;
-      elt = Fcar (varlist);
+      elt = XCAR (varlist);
       if (SYMBOLP (elt))
        temps [argnum++] = Qnil;
       else if (! NILP (Fcdr (Fcdr (elt))))
@@ -1058,9 +1058,9 @@ usage: (let VARLIST BODY...)  */)
   UNGCPRO;
 
   varlist = Fcar (args);
-  for (argnum = 0; !NILP (varlist); varlist = Fcdr (varlist))
+  for (argnum = 0; CONSP (varlist); varlist = XCDR (varlist))
     {
-      elt = Fcar (varlist);
+      elt = XCAR (varlist);
       tem = temps[argnum++];
       if (SYMBOLP (elt))
        specbind (elt, tem);
@@ -3285,7 +3285,6 @@ specbind (symbol, value)
       valcontents = XSYMBOL (symbol)->value;
 
       if (BUFFER_LOCAL_VALUEP (valcontents)
-         || SOME_BUFFER_LOCAL_VALUEP (valcontents)
          || BUFFER_OBJFWDP (valcontents))
        {
          Lisp_Object where, current_buffer;
@@ -3296,7 +3295,7 @@ specbind (symbol, value)
             buffer's or frame's value we are saving.  */
          if (!NILP (Flocal_variable_p (symbol, Qnil)))
            where = current_buffer;
-         else if (!BUFFER_OBJFWDP (valcontents)
+         else if (BUFFER_LOCAL_VALUEP (valcontents)
                   && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame)
            where = XBUFFER_LOCAL_VALUE (valcontents)->frame;
          else
index c9b6462e4a0947c44ed89c002d44288c0923063b..8b6f5ef1a84f4e53dc692fc9f80f121db51b59af 100644 (file)
@@ -6079,6 +6079,7 @@ then any auto-save counts as "recent".  */)
 \f
 /* Reading and completing file names */
 extern Lisp_Object Ffile_name_completion (), Ffile_name_all_completions ();
+extern Lisp_Object Qcompletion_ignore_case;
 
 /* In the string VAL, change each $ to $$ and return the result.  */
 
@@ -6384,7 +6385,7 @@ and `read-file-name-function'.  */)
     }
 
   count = SPECPDL_INDEX ();
-  specbind (intern ("completion-ignore-case"),
+  specbind (Qcompletion_ignore_case,
            read_file_name_completion_ignore_case ? Qt : Qnil);
   specbind (intern ("minibuffer-completing-file-name"), Qt);
   specbind (intern ("read-file-name-predicate"),
index 9f7e422d7571a27e1b0833c6cc905a1fdbab5f0c..82f9501f7aae87a92285f7114b177d0dc416ec8c 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -1370,7 +1370,7 @@ The value is actually the tail of LIST whose car is ELT.  */)
      Lisp_Object list;
 {
   register Lisp_Object tail;
-  for (tail = list; !NILP (tail); tail = XCDR (tail))
+  for (tail = list; CONSP (tail); tail = XCDR (tail))
     {
       register Lisp_Object tem;
       CHECK_LIST_CONS (tail, list);
@@ -1421,7 +1421,7 @@ The value is actually the tail of LIST whose car is ELT.  */)
   if (!FLOATP (elt))
     return Fmemq (elt, list);
 
-  for (tail = list; !NILP (tail); tail = XCDR (tail))
+  for (tail = list; CONSP (tail); tail = XCDR (tail))
     {
       register Lisp_Object tem;
       CHECK_LIST_CONS (tail, list);
@@ -1741,7 +1741,7 @@ to be sure of changing the value of `foo'.  */)
     {
       Lisp_Object tail, prev;
 
-      for (tail = seq, prev = Qnil; !NILP (tail); tail = XCDR (tail))
+      for (tail = seq, prev = Qnil; CONSP (tail); tail = XCDR (tail))
        {
          CHECK_LIST_CONS (tail, seq);
 
index 389a94ae3e842afe7688e08176f529c6ab957ac9..5c89c96a239d46c1dea3fd0bbfa05ea03cf9741b 100644 (file)
@@ -2299,8 +2299,7 @@ store_frame_param (f, prop, val)
     {
       Lisp_Object valcontents;
       valcontents = SYMBOL_VALUE (prop);
-      if ((BUFFER_LOCAL_VALUEP (valcontents)
-          || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+      if ((BUFFER_LOCAL_VALUEP (valcontents))
          && XBUFFER_LOCAL_VALUE (valcontents)->check_frame
          && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame
          && XFRAME (XBUFFER_LOCAL_VALUE (valcontents)->frame) == f)
index 6d6ba6e0cc0e67d19920106d931ca3c2616bced1..2002aded95d57fe83849057813a30d6e699a21b1 100644 (file)
@@ -8538,7 +8538,7 @@ read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu)
             to indicate that they came from a mouse menu,
             so that when present in last_nonmenu_event
             they won't confuse things.  */
-         for (tem = XCDR (value); !NILP (tem); tem = XCDR (tem))
+         for (tem = XCDR (value); CONSP (tem); tem = XCDR (tem))
            {
              record_menu_key (XCAR (tem));
              if (SYMBOLP (XCAR (tem))
@@ -9185,13 +9185,16 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
   orig_keymap = get_local_map (PT, current_buffer, Qkeymap);
   from_string = Qnil;
 
-  /* We jump here when the key sequence has been thoroughly changed, and
-     we need to rescan it starting from the beginning.  When we jump here,
-     keybuf[0..mock_input] holds the sequence we should reread.  */
- replay_sequence:
-
-  /* We may switch keyboards between rescans, so we need to
-     reinitialize fkey and keytran before each replay.  */
+  /* The multi-tty merge moved the code below to right after
+   `replay_sequence' which caused alll these translation maps to be applied
+   repeatedly, even tho their doc says very clearly they are not applied to
+   their own output.
+   The reason for this move was: "We may switch keyboards between rescans,
+   so we need to reinitialize fkey and keytran before each replay".
+   This move was wrong (even if we switch keyboards, keybuf still holds the
+   keys we've read already from the original keyboard and some of those keys
+   may have already been translated).  So there may still be a bug out there
+   lurking.  */
   indec.map = indec.parent = current_kboard->Vinput_decode_map;
   fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map;
   keytran.map = keytran.parent = Vkey_translation_map;
@@ -9199,6 +9202,11 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
   fkey.start = fkey.end = 0;
   keytran.start = keytran.end = 0;
 
+  /* We jump here when the key sequence has been thoroughly changed, and
+     we need to rescan it starting from the beginning.  When we jump here,
+     keybuf[0..mock_input] holds the sequence we should reread.  */
+ replay_sequence:
+
   starting_buffer = current_buffer;
   first_unbound = bufsize + 1;
 
index b6243594beb9755499bba37a46d2b971c6e93a41..b5abb194e1ffeb1ff3f8bfe19c2b642cc78c2eac 100644 (file)
@@ -1280,9 +1280,9 @@ remapping in all currently active keymaps.  */)
     {
       Lisp_Object maps, binding;
 
-      for (maps = keymaps; !NILP (maps); maps = Fcdr (maps))
+      for (maps = keymaps; CONSP (maps); maps = XCDR (maps))
        {
-         binding = Flookup_key (Fcar (maps), command_remapping_vector, Qnil);
+         binding = Flookup_key (XCAR (maps), command_remapping_vector, Qnil);
          if (!NILP (binding) && !INTEGERP (binding))
            return binding;
        }
@@ -2653,7 +2653,7 @@ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap)
       && !NILP (Fcommand_remapping (definition, Qnil, keymaps)))
     RETURN_UNGCPRO (Qnil);
 
-  for (; !NILP (maps); maps = Fcdr (maps))
+  for (; CONSP (maps); maps = XCDR (maps))
     {
       /* Key sequence to reach map, and the map that it reaches */
       register Lisp_Object this, map, tem;
@@ -2665,8 +2665,8 @@ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap)
       Lisp_Object last;
       int last_is_meta;
 
-      this = Fcar (Fcar (maps));
-      map  = Fcdr (Fcar (maps));
+      this = Fcar (XCAR (maps));
+      map  = Fcdr (XCAR (maps));
       last = make_number (XINT (Flength (this)) - 1);
       last_is_meta = (XINT (last) >= 0
                      && EQ (Faref (this, last), meta_prefix_char));
@@ -3155,11 +3155,11 @@ key             binding\n\
       Lisp_Object list;
 
       /* Delete from MAPS each element that is for the menu bar.  */
-      for (list = maps; !NILP (list); list = XCDR (list))
+      for (list = maps; CONSP (list); list = XCDR (list))
        {
          Lisp_Object elt, prefix, tem;
 
-         elt = Fcar (list);
+         elt = XCAR (list);
          prefix = Fcar (elt);
          if (XVECTOR (prefix)->size >= 1)
            {
@@ -3186,11 +3186,11 @@ key             binding\n\
       something = 1;
     }
 
-  for (; !NILP (maps); maps = Fcdr (maps))
+  for (; CONSP (maps); maps = XCDR (maps))
     {
       register Lisp_Object elt, prefix, tail;
 
-      elt = Fcar (maps);
+      elt = XCAR (maps);
       prefix = Fcar (elt);
 
       sub_shadows = Qnil;
index 231cfcc73790839bcef525a5f5828e600466d49b..9ce5b3429e748d68fcc9429e0a795a01eef62936 100644 (file)
@@ -214,7 +214,6 @@ enum Lisp_Misc_Type
     Lisp_Misc_Objfwd,
     Lisp_Misc_Buffer_Objfwd,
     Lisp_Misc_Buffer_Local_Value,
-    Lisp_Misc_Some_Buffer_Local_Value,
     Lisp_Misc_Overlay,
     Lisp_Misc_Kboard_Objfwd,
     Lisp_Misc_Save_Value,
@@ -512,16 +511,20 @@ extern size_t pure_size;
 /* Misc types.  */
 
 #define XMISC(a)   ((union Lisp_Misc *) XPNTR(a))
-#define XMISCTYPE(a)   (XMARKER (a)->type)
-#define XMARKER(a) (&(XMISC(a)->u_marker))
-#define XINTFWD(a) (&(XMISC(a)->u_intfwd))
-#define XBOOLFWD(a) (&(XMISC(a)->u_boolfwd))
-#define XOBJFWD(a) (&(XMISC(a)->u_objfwd))
-#define XBUFFER_OBJFWD(a) (&(XMISC(a)->u_buffer_objfwd))
-#define XBUFFER_LOCAL_VALUE(a) (&(XMISC(a)->u_buffer_local_value))
-#define XOVERLAY(a) (&(XMISC(a)->u_overlay))
-#define XKBOARD_OBJFWD(a) (&(XMISC(a)->u_kboard_objfwd))
-#define XSAVE_VALUE(a) (&(XMISC(a)->u_save_value))
+#define XMISCANY(a)    (eassert (MISCP (a)), &(XMISC(a)->u_any))
+#define XMISCTYPE(a)   (XMISCANY (a)->type)
+#define XMARKER(a)     (eassert (MARKERP (a)), &(XMISC(a)->u_marker))
+#define XINTFWD(a)     (eassert (INTFWDP (a)), &(XMISC(a)->u_intfwd))
+#define XBOOLFWD(a)    (eassert (BOOLFWDP (a)), &(XMISC(a)->u_boolfwd))
+#define XOBJFWD(a)     (eassert (OBJFWDP (a)), &(XMISC(a)->u_objfwd))
+#define XOVERLAY(a)    (eassert (OVERLAYP (a)), &(XMISC(a)->u_overlay))
+#define XSAVE_VALUE(a) (eassert (SAVE_VALUEP (a)), &(XMISC(a)->u_save_value))
+#define XBUFFER_OBJFWD(a) \
+  (eassert (BUFFER_OBJFWDP (a)), &(XMISC(a)->u_buffer_objfwd))
+#define XBUFFER_LOCAL_VALUE(a) \
+  (eassert (BUFFER_LOCAL_VALUEP (a)), &(XMISC(a)->u_buffer_local_value))
+#define XKBOARD_OBJFWD(a) \
+  (eassert (KBOARD_OBJFWDP (a)), &(XMISC(a)->u_kboard_objfwd))
 
 /* Pseudovector types.  */
 
@@ -1108,6 +1111,13 @@ struct Lisp_Hash_Table
 \f
 /* These structures are used for various misc types.  */
 
+struct Lisp_Misc_Any           /* Supertype of all Misc types.  */
+{
+  int type : 16;               /* = Lisp_Misc_Marker */
+  unsigned gcmarkbit : 1;
+  int spacer : 15;
+};
+
 struct Lisp_Marker
 {
   int type : 16;               /* = Lisp_Misc_Marker */
@@ -1208,19 +1218,19 @@ struct Lisp_Buffer_Objfwd
    binding into `realvalue' (or through it).  Also update
    LOADED-BINDING to point to the newly loaded binding.
 
-   Lisp_Misc_Buffer_Local_Value and Lisp_Misc_Some_Buffer_Local_Value
-   both use this kind of structure.  With the former, merely setting
-   the variable creates a local binding for the current buffer.  With
-   the latter, setting the variable does not do that; only
-   make-local-variable does that.  */
+   `local_if_set' indicates that merely setting the variable creates a local
+   binding for the current buffer.  Otherwise the latter, setting the
+   variable does not do that; only make-local-variable does that.  */
 
 struct Lisp_Buffer_Local_Value
   {
-    int type : 16;      /* = Lisp_Misc_Buffer_Local_Value
-                          or Lisp_Misc_Some_Buffer_Local_Value */
+    int type : 16;      /* = Lisp_Misc_Buffer_Local_Value  */
     unsigned gcmarkbit : 1;
-    int spacer : 12;
+    int spacer : 11;
 
+    /* 1 means that merely setting the variable creates a local
+       binding for the current buffer */
+    unsigned int local_if_set : 1;
     /* 1 means this variable is allowed to have frame-local bindings,
        so check for them when looking for the proper binding.  */
     unsigned int check_frame : 1;
@@ -1310,7 +1320,8 @@ struct Lisp_Free
 
 union Lisp_Misc
   {
-    struct Lisp_Free u_free;
+    struct Lisp_Misc_Any u_any;           /* Supertype of all Misc types.  */
+    struct Lisp_Free u_free;      /* Includes padding to force alignment.  */
     struct Lisp_Marker u_marker;
     struct Lisp_Intfwd u_intfwd;
     struct Lisp_Boolfwd u_boolfwd;
@@ -1452,8 +1463,17 @@ typedef unsigned char UCHAR;
 #define OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Objfwd)
 #define BUFFER_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Objfwd)
 #define BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value)
+<<<<<<< TREE
 #define SOME_BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Some_Buffer_Local_Value)
+=======
+#define GC_BUFFER_LOCAL_VALUEP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value)
+>>>>>>> MERGE-SOURCE
 #define KBOARD_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd)
+<<<<<<< TREE
+=======
+#define GC_KBOARD_OBJFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd)
+#define SAVE_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value)
+>>>>>>> MERGE-SOURCE
 
 
 /* True if object X is a pseudovector whose code is CODE.  */
index 1bcad4672f037274d2e98a36d510921999dd8a1a..a75e615acda2353cc98030b4578f9bb93d39d4cf 100644 (file)
@@ -1299,7 +1299,7 @@ close_load_descs ()
 {
 #ifndef WINDOWSNT
   Lisp_Object tail;
-  for (tail = load_descriptor_list; !NILP (tail); tail = XCDR (tail))
+  for (tail = load_descriptor_list; CONSP (tail); tail = XCDR (tail))
     emacs_close (XFASTINT (XCAR (tail)));
 #endif
 }
index 9a9eb69fa6354f805ce9794ca148863fa56e050c..708fe576f17fd6174aaef1e52b9fb51059b342a7 100644 (file)
@@ -2826,7 +2826,7 @@ This function is an internal primitive--use `make-frame' instead.  */)
 
   /* All remaining specified parameters, which have not been "used"
      by x_get_arg and friends, now go in the misc. alist of the frame.  */
-  for (tem = parameters; !NILP (tem); tem = XCDR (tem))
+  for (tem = parameters; CONSP (tem); tem = XCDR (tem))
     if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
       f->param_alist = Fcons (XCAR (tem), f->param_alist);
 
@@ -3402,7 +3402,7 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
   Lisp_Object tail, result;
 
   result = Qnil;
-  for (tail = x_display_name_list; ! NILP (tail); tail = XCDR (tail))
+  for (tail = x_display_name_list; CONSP (tail); tail = XCDR (tail))
     result = Fcons (XCAR (XCAR (tail)), result);
 
   return result;
index 9515a5774ec38428cf23239df5171406a724cb1b..f8038effd8bcd8004484affd576a957339982744 100644 (file)
@@ -487,7 +487,7 @@ x_own_selection (selection_name, selection_value)
     if (!NILP (prev_value))
       {
        Lisp_Object rest;       /* we know it's not the CAR, so it's easy.  */
-       for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
+       for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
          if (EQ (prev_value, Fcar (XCDR (rest))))
            {
              XSETCDR (rest, Fcdr (XCDR (rest)));
@@ -619,7 +619,7 @@ x_clear_frame_selections (f)
     }
 
   /* Delete elements after the beginning of Vselection_alist.  */
-  for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
+  for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
     if (EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (XCDR (rest))))))))
       {
        /* Let random Lisp code notice that the selection has been stolen.  */
@@ -762,7 +762,7 @@ Disowning it means there is no such selection.  */)
   else
     {
       Lisp_Object rest;
-      for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
+      for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
        if (EQ (local_selection_data, Fcar (XCDR (rest))))
          {
            XSETCDR (rest, Fcdr (XCDR (rest)));
index a15f0b0fcfc882a0ae9914b1870c9c42b50d62a6..3c01a6618a2fa81330a540fcbf0656c4a1208706 100644 (file)
@@ -8300,7 +8300,7 @@ init_font_name_table ()
          Lisp_Object rest = XCDR (XCDR (text_encoding_info));
 
          if (size > 0 || style == normal)
-           for (; !NILP (rest); rest = XCDR (rest))
+           for (; CONSP (rest); rest = XCDR (rest))
              add_mac_font_name (name, size, style, SDATA (XCAR (rest)));
        }
     }
@@ -8375,7 +8375,7 @@ init_font_name_table ()
                {
                  Lisp_Object rest = XCDR (XCDR (text_encoding_info));
 
-                 for (; !NILP (rest); rest = XCDR (rest))
+                 for (; CONSP (rest); rest = XCDR (rest))
                    add_mac_font_name (name, assc_entry->fontSize,
                                       assc_entry->fontStyle,
                                       SDATA (XCAR (rest)));
index 39d2f8e17beb870bf04e584fae6f46e691b59fb4..340f6dae3193d7128bbea3af4efa7428c1dae3cf 100644 (file)
@@ -118,6 +118,7 @@ Lisp_Object Vread_buffer_function;
 /* Nonzero means completion ignores case.  */
 
 int completion_ignore_case;
+Lisp_Object Qcompletion_ignore_case;
 
 /* List of regexps that should restrict possible completions.  */
 
@@ -2109,10 +2110,10 @@ string rather than a cons cell whose car is a string.  */)
   if (SYMBOLP (key))
     key = Fsymbol_name (key);
 
-  for (tail = list; !NILP (tail); tail = Fcdr (tail))
+  for (tail = list; CONSP (tail); tail = XCDR (tail))
     {
       register Lisp_Object elt, tem, thiscar;
-      elt = Fcar (tail);
+      elt = XCAR (tail);
       thiscar = CONSP (elt) ? XCAR (elt) : elt;
       if (SYMBOLP (thiscar))
        thiscar = Fsymbol_name (thiscar);
@@ -2822,6 +2823,9 @@ syms_of_minibuf ()
   minibuf_save_list = Qnil;
   staticpro (&minibuf_save_list);
 
+  Qcompletion_ignore_case = intern ("completion-ignore-case");
+  staticpro (&Qcompletion_ignore_case);
+
   Qread_file_name_internal = intern ("read-file-name-internal");
   staticpro (&Qread_file_name_internal);
 
index edd22abc038f165caea0dfeaa4d67d64b4b691cd..c23e020eb8dbe7e35388a507f4b43a094ba44662 100644 (file)
@@ -2243,10 +2243,8 @@ print_object (obj, printcharfun, escapeflag)
 
        case Lisp_Misc_Buffer_Local_Value:
          strout ("#<buffer_local_value ", -1, -1, printcharfun, 0);
-         goto do_buffer_local;
-       case Lisp_Misc_Some_Buffer_Local_Value:
-         strout ("#<some_buffer_local_value ", -1, -1, printcharfun, 0);
-       do_buffer_local:
+         if (XBUFFER_LOCAL_VALUE (obj)->local_if_set)
+           strout ("[local-if-set] ", -1, -1, printcharfun, 0);
          strout ("[realvalue] ", -1, -1, printcharfun, 0);
          print_object (XBUFFER_LOCAL_VALUE (obj)->realvalue,
                        printcharfun, escapeflag);
index d94e6d13866d690d1ef18c8686becffdf65a9752..6bcaef633031a147820d785a258bf139816c87d3 100644 (file)
@@ -121,6 +121,12 @@ Boston, MA 02110-1301, USA.  */
 #include <sys/wait.h>
 #endif
 
+#ifdef HAVE_RES_INIT
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+#endif
+
 #include "lisp.h"
 #include "systime.h"
 #include "systty.h"
@@ -732,9 +738,9 @@ BUFFER may be a buffer or the name of one.  */)
   buf = Fget_buffer (buffer);
   if (NILP (buf)) return Qnil;
 
-  for (tail = Vprocess_alist; !NILP (tail); tail = Fcdr (tail))
+  for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
     {
-      proc = Fcdr (Fcar (tail));
+      proc = Fcdr (XCAR (tail));
       if (PROCESSP (proc) && EQ (XPROCESS (proc)->buffer, buf))
        return proc;
     }
@@ -1338,11 +1344,11 @@ list_processes_1 (query_only)
   w_buffer = 6;  /* Buffer */
   w_tty = 0;     /* Omit if no ttys */
 
-  for (tail = Vprocess_alist; !NILP (tail); tail = Fcdr (tail))
+  for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
     {
       int i;
 
-      proc = Fcdr (Fcar (tail));
+      proc = Fcdr (XCAR (tail));
       p = XPROCESS (proc);
       if (NILP (p->childp))
        continue;
@@ -1401,11 +1407,11 @@ list_processes_1 (query_only)
   Findent_to (i_command, minspace); write_string ("-------", -1);
   write_string ("\n", -1);
 
-  for (tail = Vprocess_alist; !NILP (tail); tail = Fcdr (tail))
+  for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
     {
       Lisp_Object symbol;
 
-      proc = Fcdr (Fcar (tail));
+      proc = Fcdr (XCAR (tail));
       p = XPROCESS (proc);
       if (NILP (p->childp))
        continue;
@@ -3082,6 +3088,11 @@ usage: (make-network-process &rest ARGS)  */)
       hints.ai_family = family;
       hints.ai_socktype = socktype;
       hints.ai_protocol = 0;
+
+#ifdef HAVE_RES_INIT
+      res_init ();
+#endif
+
       ret = getaddrinfo (SDATA (host), portstring, &hints, &res);
       if (ret)
 #ifdef HAVE_GAI_STRERROR
@@ -3127,6 +3138,11 @@ usage: (make-network-process &rest ARGS)  */)
         as it may `hang' Emacs for a very long time.  */
       immediate_quit = 1;
       QUIT;
+
+#ifdef HAVE_RES_INIT
+      res_init ();
+#endif
+
       host_info_ptr = gethostbyname (SDATA (host));
       immediate_quit = 0;
 
@@ -6689,12 +6705,12 @@ status_notify (deleting_process)
      that we run, we get called again to handle their status changes.  */
   update_tick = process_tick;
 
-  for (tail = Vprocess_alist; !NILP (tail); tail = Fcdr (tail))
+  for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
     {
       Lisp_Object symbol;
       register struct Lisp_Process *p;
 
-      proc = Fcdr (Fcar (tail));
+      proc = Fcdr (XCAR (tail));
       p = XPROCESS (proc);
 
       if (p->tick != p->update_tick)
index 8ce5656e5a28fe73d4ba172429587488569cd33d..e8ba1d87afc8e91d08743b2523704ad48c8daf78 100644 (file)
@@ -201,9 +201,9 @@ validate_plist (list)
     {
       register int i;
       register Lisp_Object tail;
-      for (i = 0, tail = list; !NILP (tail); i++)
+      for (i = 0, tail = list; CONSP (tail); i++)
        {
-         tail = Fcdr (tail);
+         tail = XCDR (tail);
          QUIT;
        }
       if (i & 1)
@@ -226,18 +226,18 @@ interval_has_all_properties (plist, i)
   register int found;
 
   /* Go through each element of PLIST.  */
-  for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1)))
+  for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
     {
-      sym1 = Fcar (tail1);
+      sym1 = XCAR (tail1);
       found = 0;
 
       /* Go through I's plist, looking for sym1 */
-      for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2)))
-       if (EQ (sym1, Fcar (tail2)))
+      for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2)))
+       if (EQ (sym1, XCAR (tail2)))
          {
            /* Found the same property on both lists.  If the
               values are unequal, return zero.  */
-           if (! EQ (Fcar (Fcdr (tail1)), Fcar (Fcdr (tail2))))
+           if (! EQ (Fcar (XCDR (tail1)), Fcar (XCDR (tail2))))
              return 0;
 
            /* Property has same value on both lists;  go to next one.  */
@@ -263,13 +263,13 @@ interval_has_some_properties (plist, i)
   register Lisp_Object tail1, tail2, sym;
 
   /* Go through each element of PLIST.  */
-  for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1)))
+  for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
     {
-      sym = Fcar (tail1);
+      sym = XCAR (tail1);
 
       /* Go through i's plist, looking for tail1 */
-      for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2)))
-       if (EQ (sym, Fcar (tail2)))
+      for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2)))
+       if (EQ (sym, XCAR (tail2)))
          return 1;
     }
 
@@ -287,12 +287,12 @@ interval_has_some_properties_list (list, i)
   register Lisp_Object tail1, tail2, sym;
 
   /* Go through each element of LIST.  */
-  for (tail1 = list; ! NILP (tail1); tail1 = XCDR (tail1))
+  for (tail1 = list; CONSP (tail1); tail1 = XCDR (tail1))
     {
       sym = Fcar (tail1);
 
       /* Go through i's plist, looking for tail1 */
-      for (tail2 = i->plist; ! NILP (tail2); tail2 = XCDR (XCDR (tail2)))
+      for (tail2 = i->plist; CONSP (tail2); tail2 = XCDR (XCDR (tail2)))
        if (EQ (sym, XCAR (tail2)))
          return 1;
     }
@@ -391,21 +391,21 @@ add_properties (plist, i, object)
   GCPRO3 (tail1, sym1, val1);
 
   /* Go through each element of PLIST.  */
-  for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1)))
+  for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
     {
-      sym1 = Fcar (tail1);
-      val1 = Fcar (Fcdr (tail1));
+      sym1 = XCAR (tail1);
+      val1 = Fcar (XCDR (tail1));
       found = 0;
 
       /* Go through I's plist, looking for sym1 */
-      for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2)))
-       if (EQ (sym1, Fcar (tail2)))
+      for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2)))
+       if (EQ (sym1, XCAR (tail2)))
          {
            /* No need to gcpro, because tail2 protects this
               and it must be a cons cell (we get an error otherwise).  */
            register Lisp_Object this_cdr;
 
-           this_cdr = Fcdr (tail2);
+           this_cdr = XCDR (tail2);
            /* Found the property.  Now check its value.  */
            found = 1;
 
@@ -1965,10 +1965,10 @@ text_property_list (object, start, end, prop)
          plist = i->plist;
 
          if (!NILP (prop))
-           for (; !NILP (plist); plist = Fcdr (Fcdr (plist)))
-             if (EQ (Fcar (plist), prop))
+           for (; CONSP (plist); plist = Fcdr (XCDR (plist)))
+             if (EQ (XCAR (plist), prop))
                {
-                 plist = Fcons (prop, Fcons (Fcar (Fcdr (plist)), Qnil));
+                 plist = Fcons (prop, Fcons (Fcar (XCDR (plist)), Qnil));
                  break;
                }
 
index 74b2a0ed655dd813144950c3cdbe99f4c63ddccd..de5b6db3d775fb7e0f9bb09f9e43293ff5e50335 100644 (file)
@@ -850,11 +850,11 @@ w32_color_map_lookup (colorname)
 
   BLOCK_INPUT;
 
-  for (tail = Vw32_color_map; !NILP (tail); tail = Fcdr (tail))
+  for (tail = Vw32_color_map; CONSP (tail); tail = XCDR (tail))
     {
       register Lisp_Object elt, tem;
 
-      elt = Fcar (tail);
+      elt = XCAR (tail);
       if (!CONSP (elt)) continue;
 
       tem = Fcar (elt);
@@ -4506,7 +4506,7 @@ This function is an internal primitive--use `make-frame' instead.  */)
 
   /* All remaining specified parameters, which have not been "used"
      by x_get_arg and friends, now go in the misc. alist of the frame.  */
-  for (tem = parameters; !NILP (tem); tem = XCDR (tem))
+  for (tem = parameters; CONSP (tem); tem = XCDR (tem))
     if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
       f->param_alist = Fcons (XCAR (tem), f->param_alist);
 
@@ -6958,7 +6958,7 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
   Lisp_Object tail, result;
 
   result = Qnil;
-  for (tail = w32_display_name_list; ! NILP (tail); tail = XCDR (tail))
+  for (tail = w32_display_name_list; CONSP (tail); tail = XCDR (tail))
     result = Fcons (XCAR (XCAR (tail)), result);
 
   return result;
index 986832b3e7c14bf42bf1afc5bd3344c4c6fd0b3d..c570385c3bb33f6b5ab577c0fe2bf367b61db8e2 100644 (file)
@@ -568,10 +568,10 @@ list_of_panes (menu)
 
   init_menu_items ();
 
-  for (tail = menu; !NILP (tail); tail = Fcdr (tail))
+  for (tail = menu; CONSP (tail); tail = XCDR (tail))
     {
       Lisp_Object elt, pane_name, pane_data;
-      elt = Fcar (tail);
+      elt = XCAR (tail);
       pane_name = Fcar (elt);
       CHECK_STRING (pane_name);
       push_menu_pane (pane_name, Qnil);
@@ -591,9 +591,9 @@ list_of_items (pane)
 {
   Lisp_Object tail, item, item1;
 
-  for (tail = pane; !NILP (tail); tail = Fcdr (tail))
+  for (tail = pane; CONSP (tail); tail = XCDR (tail))
     {
-      item = Fcar (tail);
+      item = XCAR (tail);
       if (STRINGP (item))
        push_menu_item (item, Qnil, Qnil, Qt, Qnil, Qnil, Qnil, Qnil);
       else if (NILP (item))
index 2fd4d286eba64334cfe8e595f63af2133589f01d..766c291820f3fca1b81cbf8d0ff58bfd41bbb89d 100644 (file)
@@ -2670,12 +2670,12 @@ window_fixed_size_p (w, width_p, check_siblings_p)
        {
          Lisp_Object child;
 
-         for (child = w->prev; !NILP (child); child = XWINDOW (child)->prev)
+         for (child = w->prev; WINDOWP (child); child = XWINDOW (child)->prev)
            if (!window_fixed_size_p (XWINDOW (child), width_p, 0))
              break;
 
          if (NILP (child))
-           for (child = w->next; !NILP (child); child = XWINDOW (child)->next)
+           for (child = w->next; WINDOWP (child); child = XWINDOW (child)->next)
              if (!window_fixed_size_p (XWINDOW (child), width_p, 0))
                break;
 
@@ -4291,10 +4291,10 @@ enlarge_window (window, delta, horiz_flag)
 
   /* Find the total we can get from other siblings without deleting them.  */
   maximum = 0;
-  for (next = p->next; ! NILP (next); next = XWINDOW (next)->next)
+  for (next = p->next; WINDOWP (next); next = XWINDOW (next)->next)
     maximum += (*sizefun) (next) - window_min_size (XWINDOW (next),
                                                    horiz_flag, 0, 0);
-  for (prev = p->prev; ! NILP (prev); prev = XWINDOW (prev)->prev)
+  for (prev = p->prev; WINDOWP (prev); prev = XWINDOW (prev)->prev)
     maximum += (*sizefun) (prev) - window_min_size (XWINDOW (prev),
                                                    horiz_flag, 0, 0);
 
@@ -4442,10 +4442,10 @@ enlarge_window (window, delta, horiz_flag)
          Lisp_Object s;
          int n = 1;
 
-         for (s = w->next; !NILP (s); s = XWINDOW (s)->next)
+         for (s = w->next; WINDOWP (s); s = XWINDOW (s)->next)
            if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0))
              ++n;
-         for (s = w->prev; !NILP (s); s = XWINDOW (s)->prev)
+         for (s = w->prev; WINDOWP (s); s = XWINDOW (s)->prev)
            if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0))
              ++n;
 
@@ -4701,7 +4701,7 @@ shrink_window_lowest_first (w, height)
       /* Find the last child.  We are taking space from lowest windows
         first, so we iterate over children from the last child
         backwards.  */
-      for (child = w->vchild; !NILP (child); child = XWINDOW (child)->next)
+      for (child = w->vchild; WINDOWP (child); child = XWINDOW (child)->next)
        last_child = child;
 
       /* Assign new heights.  We leave only MIN_SAFE_WINDOW_HEIGHT.  */
index fef50689ab536e03a582cb1b533d57696e2964c8..a83ee8983dc29cf089c33e080902cb02f8a942bc 100644 (file)
@@ -3844,7 +3844,13 @@ handle_display_prop (it)
        {
          if (handle_single_display_spec (it, XCAR (prop), object,
                                          position, display_replaced_p))
-           display_replaced_p = 1;
+           {
+             display_replaced_p = 1;
+             /* If some text in a string is replaced, `position' no
+                longer points to the position of `object'.  */
+             if (STRINGP (object))
+               break;
+           }
        }
     }
   else if (VECTORP (prop))
@@ -3853,7 +3859,13 @@ handle_display_prop (it)
       for (i = 0; i < ASIZE (prop); ++i)
        if (handle_single_display_spec (it, AREF (prop, i), object,
                                        position, display_replaced_p))
-         display_replaced_p = 1;
+         {
+           display_replaced_p = 1;
+           /* If some text in a string is replaced, `position' no
+              longer points to the position of `object'.  */
+           if (STRINGP (object))
+             break;
+         }
     }
   else
     {
@@ -4242,13 +4254,16 @@ handle_single_display_spec (it, spec, object, position,
          /* Say that we haven't consumed the characters with
             `display' property yet.  The call to pop_it in
             set_iterator_to_next will clean this up.  */
-         *position = start_pos;
+         if (BUFFERP (object))
+           it->current.pos = start_pos;
        }
       else if (CONSP (value) && EQ (XCAR (value), Qspace))
        {
          it->method = GET_FROM_STRETCH;
          it->object = value;
-         *position = it->position = start_pos;
+         it->position = start_pos;
+         if (BUFFERP (object))
+           it->current.pos = start_pos;
        }
 #ifdef HAVE_WINDOW_SYSTEM
       else
@@ -4262,7 +4277,8 @@ handle_single_display_spec (it, spec, object, position,
          /* Say that we haven't consumed the characters with
             `display' property yet.  The call to pop_it in
             set_iterator_to_next will clean this up.  */
-         *position = start_pos;
+         if (BUFFERP (object))
+           it->current.pos = start_pos;
        }
 #endif /* HAVE_WINDOW_SYSTEM */
 
@@ -10972,8 +10988,7 @@ select_frame_for_redisplay (frame)
            SYMBOLP (sym))
        && (sym = indirect_variable (sym),
            val = SYMBOL_VALUE (sym),
-           (BUFFER_LOCAL_VALUEP (val)
-            || SOME_BUFFER_LOCAL_VALUEP (val)))
+           (BUFFER_LOCAL_VALUEP (val)))
        && XBUFFER_LOCAL_VALUE (val)->check_frame)
       /* Use find_symbol_value rather than Fsymbol_value
         to avoid an error if it is void.  */
@@ -10985,8 +11000,7 @@ select_frame_for_redisplay (frame)
            SYMBOLP (sym))
        && (sym = indirect_variable (sym),
            val = SYMBOL_VALUE (sym),
-           (BUFFER_LOCAL_VALUEP (val)
-            || SOME_BUFFER_LOCAL_VALUEP (val)))
+           (BUFFER_LOCAL_VALUEP (val)))
        && XBUFFER_LOCAL_VALUE (val)->check_frame)
       find_symbol_value (sym);
 }
index 8d21a69461a45005a7a3bf2ac40b40caf25930d2..fce3316b235781ea73861a0b283162dc61c78129 100644 (file)
@@ -3675,7 +3675,7 @@ else
 
   /* All remaining specified parameters, which have not been "used"
      by x_get_arg and friends, now go in the misc. alist of the frame.  */
-  for (tem = parms; !NILP (tem); tem = XCDR (tem))
+  for (tem = parms; CONSP (tem); tem = XCDR (tem))
     if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
       f->param_alist = Fcons (XCAR (tem), f->param_alist);
 
@@ -4363,7 +4363,7 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
   Lisp_Object tail, result;
 
   result = Qnil;
-  for (tail = x_display_name_list; ! NILP (tail); tail = XCDR (tail))
+  for (tail = x_display_name_list; CONSP (tail); tail = XCDR (tail))
     result = Fcons (XCAR (XCAR (tail)), result);
 
   return result;
index d71ac42aa7c6b5d15d10232aaee77d10e6145807..0db5ef57767faa788bc11c4daf108f183b236462 100644 (file)
@@ -442,7 +442,7 @@ x_own_selection (selection_name, selection_value)
     if (!NILP (prev_value))
       {
        Lisp_Object rest;       /* we know it's not the CAR, so it's easy.  */
-       for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
+       for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
          if (EQ (prev_value, Fcar (XCDR (rest))))
            {
              XSETCDR (rest, Fcdr (XCDR (rest)));
@@ -1072,7 +1072,7 @@ x_handle_selection_clear (event)
   else
     {
       Lisp_Object rest;
-      for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
+      for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
        if (EQ (local_selection_data, Fcar (XCDR (rest))))
          {
            XSETCDR (rest, Fcdr (XCDR (rest)));
@@ -1153,7 +1153,7 @@ x_clear_frame_selections (f)
     }
 
   /* Delete elements after the beginning of Vselection_alist.  */
-  for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
+  for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
     if (EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (XCDR (rest))))))))
       {
        /* Let random Lisp code notice that the selection has been stolen.  */