summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--FTP6
-rw-r--r--admin/ChangeLog16
-rwxr-xr-xadmin/make-emacs2
-rwxr-xr-xadmin/nt/makedist.bat8
-rwxr-xr-xconfigure186
-rw-r--r--configure.in35
-rw-r--r--doc/emacs/ChangeLog45
-rw-r--r--doc/emacs/basic.texi2
-rw-r--r--doc/emacs/building.texi2
-rw-r--r--doc/emacs/calendar.texi11
-rw-r--r--doc/emacs/custom.texi2
-rw-r--r--doc/emacs/fixit.texi4
-rw-r--r--doc/emacs/frames.texi4
-rw-r--r--doc/emacs/glossary.texi2
-rw-r--r--doc/emacs/text.texi44
-rw-r--r--doc/emacs/trouble.texi2
-rw-r--r--doc/lispref/ChangeLog6
-rw-r--r--doc/lispref/text.texi11
-rw-r--r--etc/NEWS10
-rw-r--r--etc/NEWS.222
-rw-r--r--etc/PROBLEMS7
-rw-r--r--lisp/ChangeLog277
-rw-r--r--lisp/bindings.el29
-rw-r--r--lisp/bs.el283
-rw-r--r--lisp/dired.el4
-rw-r--r--lisp/doc-view.el425
-rw-r--r--lisp/emacs-lisp/advice.el15
-rw-r--r--lisp/emacs-lisp/find-func.el2
-rw-r--r--lisp/emerge.el6
-rw-r--r--lisp/eshell/esh-cmd.el2
-rw-r--r--lisp/faces.el11
-rw-r--r--lisp/files.el1
-rw-r--r--lisp/filesets.el41
-rw-r--r--lisp/gnus/ChangeLog12
-rw-r--r--lisp/gnus/gnus-sum.el4
-rw-r--r--lisp/gnus/gnus-util.el9
-rw-r--r--lisp/gnus/gnus-win.el3
-rw-r--r--lisp/help-fns.el2
-rw-r--r--lisp/ibuf-ext.el4
-rw-r--r--lisp/indent.el4
-rw-r--r--lisp/international/encoded-kb.el89
-rw-r--r--lisp/loadhist.el61
-rw-r--r--lisp/longlines.el27
-rw-r--r--lisp/mail/sendmail.el21
-rw-r--r--lisp/net/tramp.el13
-rw-r--r--lisp/progmodes/cc-menus.el4
-rw-r--r--lisp/progmodes/compile.el15
-rw-r--r--lisp/progmodes/delphi.el2
-rw-r--r--lisp/server.el19
-rw-r--r--lisp/simple.el44
-rw-r--r--lisp/term/xterm.el12
-rw-r--r--lisp/textmodes/artist.el22
-rw-r--r--lisp/textmodes/fill.el146
-rw-r--r--lisp/textmodes/ispell.el10
-rw-r--r--lisp/textmodes/org.el107
-rw-r--r--lisp/time.el2
-rw-r--r--lisp/tutorial.el5
-rw-r--r--lisp/vc-hooks.el7
-rw-r--r--lisp/vc.el56
-rw-r--r--lisp/xt-mouse.el45
-rw-r--r--nt/ChangeLog4
-rw-r--r--nt/makefile.w32-in2
-rw-r--r--src/ChangeLog105
-rw-r--r--src/alloc.c25
-rw-r--r--src/buffer.c27
-rw-r--r--src/coding.c12
-rw-r--r--src/config.in2
-rw-r--r--src/data.c99
-rw-r--r--src/dired.c7
-rw-r--r--src/doc.c10
-rw-r--r--src/eval.c13
-rw-r--r--src/fileio.c3
-rw-r--r--src/fns.c6
-rw-r--r--src/frame.c3
-rw-r--r--src/keyboard.c24
-rw-r--r--src/keymap.c18
-rw-r--r--src/lisp.h60
-rw-r--r--src/lread.c2
-rw-r--r--src/macfns.c4
-rw-r--r--src/macselect.c6
-rw-r--r--src/macterm.c4
-rw-r--r--src/minibuf.c8
-rw-r--r--src/print.c6
-rw-r--r--src/process.c32
-rw-r--r--src/textprop.c44
-rw-r--r--src/w32fns.c8
-rw-r--r--src/w32menu.c8
-rw-r--r--src/window.c14
-rw-r--r--src/xdisp.c32
-rw-r--r--src/xfns.c4
-rw-r--r--src/xselect.c6
92 files changed, 1843 insertions, 1012 deletions
diff --git a/ChangeLog b/ChangeLog
index f771639cb3d..387fcfc73f6 100644
--- 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
index 0337d464c30..00000000000
--- 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/>.
-
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 10cec99a09b..e73eb21327c 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -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.
@@ -167,7 +171,7 @@
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>
@@ -213,11 +217,11 @@
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>
diff --git a/admin/make-emacs b/admin/make-emacs
index 23b4e1c6374..94bf2092a8b 100755
--- a/admin/make-emacs
+++ b/admin/make-emacs
@@ -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
diff --git a/admin/nt/makedist.bat b/admin/nt/makedist.bat
index 5afef00e9b3..db9446db36e 100755
--- a/admin/nt/makedist.bat
+++ b/admin/nt/makedist.bat
@@ -35,8 +35,8 @@ copy %3\README.W32 emacs-%1\README.W32
rem Info-ZIP zip seems to be broken on Windows.
rem It always writes to zip.zip and treats the zipfile argument as one
rem of the files to go in it.
-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
-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
+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
+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
del emacs-%1\README.W32
if not (%4) == () goto end
@@ -49,8 +49,8 @@ copy %3\dump.bat emacs-%1\bin\dump.bat
rem Info-ZIP zip seems to be broken on Windows.
rem It always writes to zip.zip and treats the zipfile argument as one
rem of the files to go in it.
-rem zip -9 -r %2-barebin-i386.zip emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc/DOC-X
-7z a -tZIP -mx=9 %2-barebin-i386.zip emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc/DOC-X
+rem zip -9 -r %2-barebin-i386.zip emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc/DOC-X emacs-%1/COPYING
+7z a -tZIP -mx=9 %2-barebin-i386.zip emacs-%1/README.W32 emacs-%1/bin emacs-%1/etc/DOC-X emacs-%1/COPYING
del emacs-%1\README.W32
if not (%4) == () goto end
diff --git a/configure b/configure
index a52e4dab258..ae2dc481843 100755
--- a/configure
+++ b/configure
@@ -16312,10 +16312,9 @@ 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
@@ -20312,11 +20462,6 @@ fi
if test "$resolv" = yes ; then
RESOLVLIB=-lresolv
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBRESOLV 1
-_ACEOF
-
else
RESOLVLIB=
fi
@@ -20479,6 +20624,15 @@ 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
diff --git a/configure.in b/configure.in
index d1b8f492a41..489d9f1a7a0 100644
--- a/configure.in
+++ b/configure.in
@@ -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)
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 9d5e6158f3f..68c150a67c9 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -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>
@@ -173,7 +208,7 @@
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>
diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi
index 418d54f677b..333985e4a4a 100644
--- a/doc/emacs/basic.texi
+++ b/doc/emacs/basic.texi
@@ -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.
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
index 5689bf1fe34..45210118f77 100644
--- a/doc/emacs/building.texi
+++ b/doc/emacs/building.texi
@@ -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
diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi
index 1357784b920..6b285094735 100644
--- a/doc/emacs/calendar.texi
+++ b/doc/emacs/calendar.texi
@@ -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
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index 1276c45af70..29d1c902b7c 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -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
diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi
index d1577e2f528..2d827f5a1a2 100644
--- a/doc/emacs/fixit.texi
+++ b/doc/emacs/fixit.texi
@@ -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
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index a45b582b455..e1207738cfa 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -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.
diff --git a/doc/emacs/glossary.texi b/doc/emacs/glossary.texi
index f289c2ca1cb..a9109de667b 100644
--- a/doc/emacs/glossary.texi
+++ b/doc/emacs/glossary.texi
@@ -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
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi
index 9cfd4ffe922..c151c75e8bb 100644
--- a/doc/emacs/text.texi
+++ b/doc/emacs/text.texi
@@ -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
diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi
index ea494445a4e..494637c8eeb 100644
--- a/doc/emacs/trouble.texi
+++ b/doc/emacs/trouble.texi
@@ -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.
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index d95597e940b..e0d9db962f9 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -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,
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index daaaf6c9b9d..5b935bc6e23 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -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
diff --git a/etc/NEWS b/etc/NEWS
index 21cb6b3ffff..62258f67ff4 100644
--- 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.
diff --git a/etc/NEWS.22 b/etc/NEWS.22
index 2b7c82dd7b6..867c58c47a4 100644
--- a/etc/NEWS.22
+++ b/etc/NEWS.22
@@ -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
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 7ebf7ae8edd..d098fcc2c11 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -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
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d3fde16c4fa..4fe538b3bd4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,269 @@
+2007-10-18 Johan Bockg,Ae(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)
@@ -99,8 +365,8 @@
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.
@@ -148,7 +414,7 @@
(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>
@@ -170,9 +436,8 @@
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>
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 0e7bd15a494..19819c15d60 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -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)
(define-key esc-map "{" 'backward-paragraph)
diff --git a/lisp/bs.el b/lisp/bs.el
index 6390bd2dd81..bb2dbae83c0 100644
--- a/lisp/bs.el
+++ b/lisp/bs.el
@@ -158,7 +158,7 @@
("" 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)))
diff --git a/lisp/dired.el b/lisp/dired.el
index 7bdb195543a..16b53acb6da 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -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)
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index d7d2bb47abb..d93a8ca316d 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -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:
@@ -37,16 +36,19 @@
;; 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
@@ -80,17 +80,16 @@
;; 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
@@ -102,6 +101,7 @@
;;; Code:
(require 'dired)
+(require 'image-mode)
(eval-when-compile (require 'cl))
;;;; Customization Options
@@ -114,50 +114,51 @@
: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')."
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index cabd0dd391e..4a5c9149a43 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -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:
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 6a259ffd4f7..20b91b10547 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -46,8 +46,6 @@
;;; Code:
-(require 'loadhist)
-
;;; User variables:
(defgroup find-function nil
diff --git a/lisp/emerge.el b/lisp/emerge.el
index 0c1b3b170cd..fd002409a7f 100644
--- a/lisp/emerge.el
+++ b/lisp/emerge.el
@@ -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))
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index d3194f3625a..f999bdcdf6d 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -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.
diff --git a/lisp/faces.el b/lisp/faces.el
index 8a0ba7d221f..1ced221692d 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -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.
diff --git a/lisp/files.el b/lisp/files.el
index be28dec4c40..6d03ad24dbe 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -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)
diff --git a/lisp/filesets.el b/lisp/filesets.el
index e5dde847853..d7a7dc9efa0 100644
--- a/lisp/filesets.el
+++ b/lisp/filesets.el
@@ -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
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 89d9d75c60e..59a32921dc5 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -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.
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 36e93796a63..8fb18d3a990 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -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)))))
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 74aacdd2860..3d3e4148c2d 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -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)
diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el
index 5c57aaa1886..7e1609cc196 100644
--- a/lisp/gnus/gnus-win.el
+++ b/lisp/gnus/gnus-win.el
@@ -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."
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index bf8d5f9a209..befd83c76ef 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -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
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index 7847bed6f2d..2c39b736097 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -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)
diff --git a/lisp/indent.el b/lisp/indent.el
index db8958bd1ca..77354444cfa 100644
--- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -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,
diff --git a/lisp/international/encoded-kb.el b/lisp/international/encoded-kb.el
index 1ebdcd5cabd..d482b465250 100644
--- a/lisp/international/encoded-kb.el
+++ b/lisp/international/encoded-kb.el
@@ -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)
diff --git a/lisp/loadhist.el b/lisp/loadhist.el
index 4e9ee480d65..95de0d822a3 100644
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -38,12 +38,11 @@
"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'.
diff --git a/lisp/longlines.el b/lisp/longlines.el
index 07977910a22..c820150c27a 100644
--- a/lisp/longlines.el
+++ b/lisp/longlines.el
@@ -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
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 34a0aa0ad82..e8d896be246 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -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
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index c8b2a72aad0..0af9c457995 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -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
diff --git a/lisp/progmodes/cc-menus.el b/lisp/progmodes/cc-menus.el
index 95359689b9f..eced014d4e6 100644
--- a/lisp/progmodes/cc-menus.el
+++ b/lisp/progmodes/cc-menus.el
@@ -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
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 9ed7ba09de9..482cfee1b9b 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -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)
diff --git a/lisp/progmodes/delphi.el b/lisp/progmodes/delphi.el
index 6cbef6f426d..7c2417fde1a 100644
--- a/lisp/progmodes/delphi.el
+++ b/lisp/progmodes/delphi.el
@@ -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)))
diff --git a/lisp/server.el b/lisp/server.el
index 22b947ea9f8..70d2283b0eb 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -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)
diff --git a/lisp/simple.el b/lisp/simple.el
index f2055faf385..5c3b55edd7b 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -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
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 1c4b60706aa..a60aa90255f 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -27,8 +27,6 @@
;;; Code:
-(eval-when-compile (require 'xt-mouse))
-
(defvar xterm-function-map
(let ((map (make-sparse-keymap)))
@@ -469,12 +467,8 @@
;; 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.
@@ -506,7 +500,9 @@
;; 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
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index bc0434e151a..f0442904185 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -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.
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index e0f80b1b118..9cbdca0de87 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -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)))
-
(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
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 253c29f408e..926e0debda1 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -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))
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index 6c48c47d3ad..5487609343b 100644
--- a/lisp/textmodes/org.el
+++ b/lisp/textmodes/org.el
@@ -129,7 +129,7 @@
(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 "")
diff --git a/lisp/time.el b/lisp/time.el
index 8bc14974315..4d94fb7aeb3 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -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
diff --git a/lisp/tutorial.el b/lisp/tutorial.el
index 26fb0e503f7..336593891ab 100644
--- a/lisp/tutorial.el
+++ b/lisp/tutorial.el
@@ -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)))))
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index 92c6c734483..e28a01d35e6 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -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."
diff --git a/lisp/vc.el b/lisp/vc.el
index a0db56ce6d7..0cf800c2ddd 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -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."
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index 15aebb08ab2..adb6f08943c 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -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)
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 4a8f353782b..c0d8d7a5050 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -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.
diff --git a/nt/makefile.w32-in b/nt/makefile.w32-in
index 155f201aa1e..5cb13a79e9a 100644
--- a/nt/makefile.w32-in
+++ b/nt/makefile.w32-in
@@ -211,6 +211,8 @@ install: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE)
$(IFNOTSAMEDIR) $(CP_DIR) ../etc $(INSTALL_DIR) $(ENDIF)
- $(CP_DIR) icons $(INSTALL_DIR)/etc
$(IFNOTSAMEDIR) $(CP_DIR) ../info $(INSTALL_DIR) $(ENDIF)
+ $(IFNOTSAMEDIR) $(CP) ../COPYING $(INSTALL_DIR) $(ENDIF)
+ - $(CP) ../COPYING $(INSTALL_DIR)/bin
- $(DEL) ../same-dir.tst
- $(DEL) $(INSTALL_DIR)/same-dir.tst
diff --git a/src/ChangeLog b/src/ChangeLog
index 4ba46df0f23..c50b6286407 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -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.
@@ -68,6 +168,11 @@
* 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
diff --git a/src/alloc.c b/src/alloc.c
index ed003af3ea8..295da59d026 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -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 ();
}
diff --git a/src/buffer.c b/src/buffer.c
index d5f9541301d..416ff7e3702 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -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));
diff --git a/src/coding.c b/src/coding.c
index 2b518b903a4..c77aa338a1e 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -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));
}
diff --git a/src/config.in b/src/config.in
index 60be3c22003..c23ec13ac88 100644
--- a/src/config.in
+++ b/src/config.in
@@ -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. */
diff --git a/src/data.c b/src/data.c
index 81cffcb38de..3139af1e001 100644
--- a/src/data.c
+++ b/src/data.c
@@ -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;
}
diff --git a/src/dired.c b/src/dired.c
index b362eec62b5..ccd27dbb713 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -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
diff --git a/src/doc.c b/src/doc.c
index 3b335127a75..f491661a616 100644
--- 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? */
diff --git a/src/eval.c b/src/eval.c
index b69eea44c75..eaa1a6855f6 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -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
diff --git a/src/fileio.c b/src/fileio.c
index c9b6462e4a0..8b6f5ef1a84 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -6079,6 +6079,7 @@ then any auto-save counts as "recent". */)
/* 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"),
diff --git a/src/fns.c b/src/fns.c
index 9f7e422d757..82f9501f7aa 100644
--- 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);
diff --git a/src/frame.c b/src/frame.c
index 389a94ae3e8..5c89c96a239 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -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)
diff --git a/src/keyboard.c b/src/keyboard.c
index 6d6ba6e0cc0..2002aded95d 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -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;
diff --git a/src/keymap.c b/src/keymap.c
index b6243594beb..b5abb194e1f 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -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;
diff --git a/src/lisp.h b/src/lisp.h
index 231cfcc7379..9ce5b3429e7 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -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
/* 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. */
diff --git a/src/lread.c b/src/lread.c
index 1bcad4672f0..a75e615acda 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -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
}
diff --git a/src/macfns.c b/src/macfns.c
index 9a9eb69fa63..708fe576f17 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -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;
diff --git a/src/macselect.c b/src/macselect.c
index 9515a5774ec..f8038effd8b 100644
--- a/src/macselect.c
+++ b/src/macselect.c
@@ -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)));
diff --git a/src/macterm.c b/src/macterm.c
index a15f0b0fcfc..3c01a6618a2 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -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)));
diff --git a/src/minibuf.c b/src/minibuf.c
index 39d2f8e17be..340f6dae319 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -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);
diff --git a/src/print.c b/src/print.c
index edd22abc038..c23e020eb8d 100644
--- a/src/print.c
+++ b/src/print.c
@@ -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);
diff --git a/src/process.c b/src/process.c
index d94e6d13866..6bcaef63303 100644
--- a/src/process.c
+++ b/src/process.c
@@ -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)
diff --git a/src/textprop.c b/src/textprop.c
index 8ce5656e5a2..e8ba1d87afc 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -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;
}
diff --git a/src/w32fns.c b/src/w32fns.c
index 74b2a0ed655..de5b6db3d77 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -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;
diff --git a/src/w32menu.c b/src/w32menu.c
index 986832b3e7c..c570385c3bb 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -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))
diff --git a/src/window.c b/src/window.c
index 2fd4d286eba..766c291820f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -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. */
diff --git a/src/xdisp.c b/src/xdisp.c
index fef50689ab5..a83ee8983dc 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -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);
}
diff --git a/src/xfns.c b/src/xfns.c
index 8d21a69461a..fce3316b235 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -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;
diff --git a/src/xselect.c b/src/xselect.c
index d71ac42aa7c..0db5ef57767 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -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. */