aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-07-10 23:05:57 -0700
committerPaul Eggert2011-07-10 23:05:57 -0700
commitda85a02af7585384008d3ebec836a7b8571f175d (patch)
treee6d4f34119ea1c45985eaed207ef6b47f650ea93
parent7f5515125fbc9b46454e1f84b7e3052a0a5326f0 (diff)
parent4d45a8b7a237e1d33d0ae71d95a0ed7165ea6cda (diff)
downloademacs-da85a02af7585384008d3ebec836a7b8571f175d.tar.gz
emacs-da85a02af7585384008d3ebec836a7b8571f175d.zip
Merge from trunk.
-rw-r--r--ChangeLog13
-rw-r--r--autogen/Makefile.in90
-rw-r--r--autogen/aclocal.m45
-rw-r--r--autogen/config.in20
-rwxr-xr-xautogen/configure4174
-rw-r--r--doc/emacs/ChangeLog51
-rw-r--r--doc/emacs/Makefile.in2
-rw-r--r--doc/emacs/ack.texi18
-rw-r--r--doc/emacs/cmdargs.texi9
-rw-r--r--doc/emacs/custom.texi183
-rw-r--r--doc/emacs/emacs.texi53
-rw-r--r--doc/emacs/frames.texi181
-rw-r--r--doc/emacs/glossary.texi5
-rw-r--r--doc/emacs/help.texi10
-rw-r--r--doc/emacs/indent.texi2
-rw-r--r--doc/emacs/killing.texi339
-rw-r--r--doc/emacs/major.texi237
-rw-r--r--doc/emacs/makefile.w32-in2
-rw-r--r--doc/emacs/misc.texi4
-rw-r--r--doc/emacs/modes.texi410
-rw-r--r--doc/emacs/mule.texi2
-rw-r--r--doc/emacs/programs.texi5
-rw-r--r--doc/emacs/screen.texi2
-rw-r--r--doc/emacs/search.texi13
-rw-r--r--doc/emacs/text.texi95
-rw-r--r--doc/lispref/ChangeLog8
-rw-r--r--doc/lispref/modes.texi9
-rw-r--r--doc/lispref/text.texi15
-rw-r--r--etc/ChangeLog6
-rw-r--r--etc/MH-E-NEWS19
-rw-r--r--etc/NEWS4
-rw-r--r--lib-src/ChangeLog6
-rw-r--r--lib-src/update-game-score.c5
-rw-r--r--lib/stdint.in.h96
-rw-r--r--lisp/ChangeLog58
-rw-r--r--lisp/emulation/viper-cmd.el5
-rw-r--r--lisp/faces.el2
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/gnus-group.el8
-rw-r--r--lisp/mh-e/ChangeLog30
-rw-r--r--lisp/mh-e/mh-comp.el2
-rw-r--r--lisp/mh-e/mh-e.el6
-rw-r--r--lisp/mh-e/mh-folder.el8
-rw-r--r--lisp/mh-e/mh-funcs.el2
-rw-r--r--lisp/mh-e/mh-mime.el2
-rw-r--r--lisp/mh-e/mh-search.el4
-rw-r--r--lisp/mh-e/mh-speed.el8
-rw-r--r--lisp/mh-e/mh-utils.el1
-rw-r--r--lisp/mh-e/mh-xface.el9
-rw-r--r--lisp/startup.el183
-rw-r--r--lisp/tool-bar.el3
-rw-r--r--lisp/vc/vc.el7
-rw-r--r--lisp/window.el496
-rw-r--r--m4/pthread_sigmask.m452
-rw-r--r--src/ChangeLog68
-rw-r--r--src/alloc.c2
-rw-r--r--src/buffer.c115
-rw-r--r--src/chartab.c8
-rw-r--r--src/cm.c3
-rw-r--r--src/composite.c1
-rw-r--r--src/data.c3
-rw-r--r--src/dispnew.c3
-rw-r--r--src/emacs.c3
-rw-r--r--src/floatfns.c3
-rw-r--r--src/font.c29
-rw-r--r--src/gtkutil.c1
-rw-r--r--src/image.c4
-rw-r--r--src/indent.c3
-rw-r--r--src/intervals.c24
-rw-r--r--src/lread.c4
-rw-r--r--src/ralloc.c2
-rw-r--r--src/regex.c17
-rw-r--r--src/sysdep.c3
-rw-r--r--src/termcap.c50
-rw-r--r--src/tparam.c5
-rw-r--r--src/unexhp9k800.c172
-rw-r--r--src/w32.c8
-rw-r--r--src/widget.c6
-rw-r--r--src/xdisp.c5
-rw-r--r--src/xfaces.c10
-rw-r--r--src/xfns.c7
-rw-r--r--src/xmenu.c11
-rw-r--r--src/xrdb.c23
83 files changed, 4085 insertions, 3492 deletions
diff --git a/ChangeLog b/ChangeLog
index 09d1f9873dc..616c345d7d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
12011-07-09 Paul Eggert <eggert@cs.ucla.edu> 12011-07-11 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Assume freestanding C89 headers, string.h, stdlib.h. 3 Assume freestanding C89 headers, string.h, stdlib.h.
4 Again, this simplifies the code, and all current platforms have these. 4 Again, this simplifies the code, and all current platforms have these.
@@ -15,6 +15,17 @@
15 15
162011-07-09 Paul Eggert <eggert@cs.ucla.edu> 162011-07-09 Paul Eggert <eggert@cs.ucla.edu>
17 17
18 * lib/stdint.in.h: Merge from gnulib (Bug#9025).
19 This fixes a build problem on older Mac OS X hosts.
20
21 * m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK): Omit gl_THREADLIB
22 test, which runs afoul of Automake installations where, for example,
23 /usr/share/aclocal contains a copy of gl_THREADLIB.
24 Problem reported by Sven Joachim in
25 <http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00529.html>.
26 This is just a quick temporary fix, specific to Emacs; I'll work
27 with the other gnulib maintainers to get a more-permanent fix.
28
18 Add gnulib's strtoimax module, needed on Solaris 8. 29 Add gnulib's strtoimax module, needed on Solaris 8.
19 * Makefile.in (GNULIB_MODULES): Add strtoimax. 30 * Makefile.in (GNULIB_MODULES): Add strtoimax.
20 * lib/strtoll.c, m4/strtoimax.m4, m4/strtoll.m4: New files, 31 * lib/strtoll.c, m4/strtoimax.m4, m4/strtoll.m4: New files,
diff --git a/autogen/Makefile.in b/autogen/Makefile.in
index fd93b0146a6..3348d3a4c02 100644
--- a/autogen/Makefile.in
+++ b/autogen/Makefile.in
@@ -24,7 +24,7 @@
24# the same distribution terms as the rest of that program. 24# the same distribution terms as the rest of that program.
25# 25#
26# Generated by gnulib-tool. 26# Generated by gnulib-tool.
27# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dup2 filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen stdarg stdio strftime strtoumax symlink sys_stat 27# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dup2 filemode getloadavg getopt-gnu ignore-value intprops lstat mktime pthread_sigmask readlink socklen stdarg stdio strftime strtoimax strtoumax symlink sys_stat
28 28
29VPATH = @srcdir@ 29VPATH = @srcdir@
30pkgdatadir = $(datadir)/@PACKAGE@ 30pkgdatadir = $(datadir)/@PACKAGE@
@@ -59,14 +59,18 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
59 $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inttypes.m4 \ 59 $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inttypes.m4 \
60 $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \ 60 $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \
61 $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/mktime.m4 \ 61 $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/mktime.m4 \
62 $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/readlink.m4 \ 62 $(top_srcdir)/m4/multiarch.m4 \
63 $(top_srcdir)/m4/sha1.m4 $(top_srcdir)/m4/sha256.m4 \ 63 $(top_srcdir)/m4/pthread_sigmask.m4 \
64 $(top_srcdir)/m4/sha512.m4 $(top_srcdir)/m4/socklen.m4 \ 64 $(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/sha1.m4 \
65 $(top_srcdir)/m4/sha256.m4 $(top_srcdir)/m4/sha512.m4 \
66 $(top_srcdir)/m4/signal_h.m4 \
67 $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/socklen.m4 \
65 $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/st_dm_mode.m4 \ 68 $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/st_dm_mode.m4 \
66 $(top_srcdir)/m4/stat.m4 $(top_srcdir)/m4/stdarg.m4 \ 69 $(top_srcdir)/m4/stat.m4 $(top_srcdir)/m4/stdarg.m4 \
67 $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \ 70 $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
68 $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdio_h.m4 \ 71 $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdio_h.m4 \
69 $(top_srcdir)/m4/stdlib_h.m4 $(top_srcdir)/m4/strftime.m4 \ 72 $(top_srcdir)/m4/stdlib_h.m4 $(top_srcdir)/m4/strftime.m4 \
73 $(top_srcdir)/m4/strtoimax.m4 $(top_srcdir)/m4/strtoll.m4 \
70 $(top_srcdir)/m4/strtoull.m4 $(top_srcdir)/m4/strtoumax.m4 \ 74 $(top_srcdir)/m4/strtoull.m4 $(top_srcdir)/m4/strtoumax.m4 \
71 $(top_srcdir)/m4/symlink.m4 $(top_srcdir)/m4/sys_stat_h.m4 \ 75 $(top_srcdir)/m4/symlink.m4 $(top_srcdir)/m4/sys_stat_h.m4 \
72 $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \ 76 $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \
@@ -244,6 +248,7 @@ GNULIB_POPEN = @GNULIB_POPEN@
244GNULIB_PREAD = @GNULIB_PREAD@ 248GNULIB_PREAD = @GNULIB_PREAD@
245GNULIB_PRINTF = @GNULIB_PRINTF@ 249GNULIB_PRINTF = @GNULIB_PRINTF@
246GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ 250GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
251GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
247GNULIB_PTSNAME = @GNULIB_PTSNAME@ 252GNULIB_PTSNAME = @GNULIB_PTSNAME@
248GNULIB_PUTC = @GNULIB_PUTC@ 253GNULIB_PUTC = @GNULIB_PUTC@
249GNULIB_PUTCHAR = @GNULIB_PUTCHAR@ 254GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
@@ -263,6 +268,9 @@ GNULIB_RMDIR = @GNULIB_RMDIR@
263GNULIB_RPMATCH = @GNULIB_RPMATCH@ 268GNULIB_RPMATCH = @GNULIB_RPMATCH@
264GNULIB_SCANF = @GNULIB_SCANF@ 269GNULIB_SCANF = @GNULIB_SCANF@
265GNULIB_SETENV = @GNULIB_SETENV@ 270GNULIB_SETENV = @GNULIB_SETENV@
271GNULIB_SIGACTION = @GNULIB_SIGACTION@
272GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
273GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
266GNULIB_SLEEP = @GNULIB_SLEEP@ 274GNULIB_SLEEP = @GNULIB_SLEEP@
267GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ 275GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
268GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ 276GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
@@ -384,7 +392,9 @@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
384HAVE_OS_H = @HAVE_OS_H@ 392HAVE_OS_H = @HAVE_OS_H@
385HAVE_PIPE = @HAVE_PIPE@ 393HAVE_PIPE = @HAVE_PIPE@
386HAVE_PIPE2 = @HAVE_PIPE2@ 394HAVE_PIPE2 = @HAVE_PIPE2@
395HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
387HAVE_PREAD = @HAVE_PREAD@ 396HAVE_PREAD = @HAVE_PREAD@
397HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@
388HAVE_PTSNAME = @HAVE_PTSNAME@ 398HAVE_PTSNAME = @HAVE_PTSNAME@
389HAVE_PWRITE = @HAVE_PWRITE@ 399HAVE_PWRITE = @HAVE_PWRITE@
390HAVE_RANDOM_H = @HAVE_RANDOM_H@ 400HAVE_RANDOM_H = @HAVE_RANDOM_H@
@@ -395,9 +405,13 @@ HAVE_REALPATH = @HAVE_REALPATH@
395HAVE_RENAMEAT = @HAVE_RENAMEAT@ 405HAVE_RENAMEAT = @HAVE_RENAMEAT@
396HAVE_RPMATCH = @HAVE_RPMATCH@ 406HAVE_RPMATCH = @HAVE_RPMATCH@
397HAVE_SETENV = @HAVE_SETENV@ 407HAVE_SETENV = @HAVE_SETENV@
408HAVE_SIGACTION = @HAVE_SIGACTION@
409HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@
410HAVE_SIGINFO_T = @HAVE_SIGINFO_T@
398HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ 411HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
399HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ 412HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
400HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ 413HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
414HAVE_SIGSET_T = @HAVE_SIGSET_T@
401HAVE_SLEEP = @HAVE_SLEEP@ 415HAVE_SLEEP = @HAVE_SLEEP@
402HAVE_STDINT_H = @HAVE_STDINT_H@ 416HAVE_STDINT_H = @HAVE_STDINT_H@
403HAVE_STRPTIME = @HAVE_STRPTIME@ 417HAVE_STRPTIME = @HAVE_STRPTIME@
@@ -405,6 +419,7 @@ HAVE_STRTOD = @HAVE_STRTOD@
405HAVE_STRTOLL = @HAVE_STRTOLL@ 419HAVE_STRTOLL = @HAVE_STRTOLL@
406HAVE_STRTOULL = @HAVE_STRTOULL@ 420HAVE_STRTOULL = @HAVE_STRTOULL@
407HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ 421HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
422HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
408HAVE_SYMLINK = @HAVE_SYMLINK@ 423HAVE_SYMLINK = @HAVE_SYMLINK@
409HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ 424HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
410HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ 425HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
@@ -413,6 +428,7 @@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
413HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ 428HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
414HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ 429HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
415HAVE_TIMEGM = @HAVE_TIMEGM@ 430HAVE_TIMEGM = @HAVE_TIMEGM@
431HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
416HAVE_UNISTD_H = @HAVE_UNISTD_H@ 432HAVE_UNISTD_H = @HAVE_UNISTD_H@
417HAVE_UNLINKAT = @HAVE_UNLINKAT@ 433HAVE_UNLINKAT = @HAVE_UNLINKAT@
418HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ 434HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
@@ -479,6 +495,7 @@ LIBXT_OTHER = @LIBXT_OTHER@
479LIBX_OTHER = @LIBX_OTHER@ 495LIBX_OTHER = @LIBX_OTHER@
480LIB_GCC = @LIB_GCC@ 496LIB_GCC = @LIB_GCC@
481LIB_MATH = @LIB_MATH@ 497LIB_MATH = @LIB_MATH@
498LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
482LIB_STANDARD = @LIB_STANDARD@ 499LIB_STANDARD = @LIB_STANDARD@
483LTLIBINTL = @LTLIBINTL@ 500LTLIBINTL = @LTLIBINTL@
484LTLIBOBJS = @LTLIBOBJS@ 501LTLIBOBJS = @LTLIBOBJS@
@@ -491,6 +508,7 @@ MKDIR_P = @MKDIR_P@
491M_FILE = @M_FILE@ 508M_FILE = @M_FILE@
492NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ 509NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
493NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ 510NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
511NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@
494NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ 512NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@
495NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ 513NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
496NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ 514NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
@@ -501,6 +519,7 @@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
501NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ 519NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
502NEXT_GETOPT_H = @NEXT_GETOPT_H@ 520NEXT_GETOPT_H = @NEXT_GETOPT_H@
503NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ 521NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
522NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
504NEXT_STDARG_H = @NEXT_STDARG_H@ 523NEXT_STDARG_H = @NEXT_STDARG_H@
505NEXT_STDDEF_H = @NEXT_STDDEF_H@ 524NEXT_STDDEF_H = @NEXT_STDDEF_H@
506NEXT_STDINT_H = @NEXT_STDINT_H@ 525NEXT_STDINT_H = @NEXT_STDINT_H@
@@ -584,6 +603,7 @@ REPLACE_PERROR = @REPLACE_PERROR@
584REPLACE_POPEN = @REPLACE_POPEN@ 603REPLACE_POPEN = @REPLACE_POPEN@
585REPLACE_PREAD = @REPLACE_PREAD@ 604REPLACE_PREAD = @REPLACE_PREAD@
586REPLACE_PRINTF = @REPLACE_PRINTF@ 605REPLACE_PRINTF = @REPLACE_PRINTF@
606REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@
587REPLACE_PUTENV = @REPLACE_PUTENV@ 607REPLACE_PUTENV = @REPLACE_PUTENV@
588REPLACE_PWRITE = @REPLACE_PWRITE@ 608REPLACE_PWRITE = @REPLACE_PWRITE@
589REPLACE_READ = @REPLACE_READ@ 609REPLACE_READ = @REPLACE_READ@
@@ -739,25 +759,29 @@ x_default_search_path = @x_default_search_path@
739# present in all Makefile.am that need it. This is ensured by the applicability 759# present in all Makefile.am that need it. This is ensured by the applicability
740# 'all' defined above. 760# 'all' defined above.
741BUILT_SOURCES = $(ALLOCA_H) arg-nonnull.h c++defs.h $(GETOPT_H) \ 761BUILT_SOURCES = $(ALLOCA_H) arg-nonnull.h c++defs.h $(GETOPT_H) \
742 inttypes.h $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) \ 762 inttypes.h signal.h $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) \
743 stdio.h stdlib.h sys/stat.h time.h unistd.h warn-on-use.h 763 $(STDINT_H) stdio.h stdlib.h sys/stat.h time.h unistd.h \
764 warn-on-use.h
744EXTRA_DIST = alloca.in.h allocator.h $(top_srcdir)/./arg-nonnull.h \ 765EXTRA_DIST = alloca.in.h allocator.h $(top_srcdir)/./arg-nonnull.h \
745 $(top_srcdir)/./c++defs.h careadlinkat.h md5.h sha1.h sha256.h \ 766 $(top_srcdir)/./c++defs.h careadlinkat.h md5.h sha1.h sha256.h \
746 sha512.h dosname.h ftoastr.c ftoastr.h dup2.c filemode.h \ 767 sha512.h dosname.h ftoastr.c ftoastr.h dup2.c filemode.h \
747 getloadavg.c getopt.c getopt.in.h getopt1.c getopt_int.h \ 768 getloadavg.c getopt.c getopt.in.h getopt1.c getopt_int.h \
748 ignore-value.h intprops.h inttypes.in.h lstat.c \ 769 ignore-value.h intprops.h inttypes.in.h lstat.c \
749 mktime-internal.h mktime.c readlink.c stat.c stdarg.in.h \ 770 mktime-internal.h mktime.c pthread_sigmask.c readlink.c \
750 stdbool.in.h stddef.in.h stdint.in.h stdio.in.h stdlib.in.h \ 771 signal.in.h sigprocmask.c stat.c stdarg.in.h stdbool.in.h \
751 strftime.h strtol.c strtoul.c strtoull.c strtoimax.c \ 772 stddef.in.h stdint.in.h stdio.in.h stdlib.in.h strftime.h \
752 strtoumax.c symlink.c sys_stat.in.h time.in.h time_r.c u64.h \ 773 strtoimax.c strtol.c strtoll.c strtol.c strtoul.c strtoull.c \
753 unistd.in.h verify.h $(top_srcdir)/./warn-on-use.h 774 strtoimax.c strtoumax.c symlink.c sys_stat.in.h time.in.h \
775 time_r.c u64.h unistd.in.h verify.h \
776 $(top_srcdir)/./warn-on-use.h
754MOSTLYCLEANDIRS = sys 777MOSTLYCLEANDIRS = sys
755MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arg-nonnull.h \ 778MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arg-nonnull.h \
756 arg-nonnull.h-t c++defs.h c++defs.h-t getopt.h getopt.h-t \ 779 arg-nonnull.h-t c++defs.h c++defs.h-t getopt.h getopt.h-t \
757 inttypes.h inttypes.h-t stdarg.h stdarg.h-t stdbool.h \ 780 inttypes.h inttypes.h-t signal.h signal.h-t stdarg.h \
758 stdbool.h-t stddef.h stddef.h-t stdint.h stdint.h-t stdio.h \ 781 stdarg.h-t stdbool.h stdbool.h-t stddef.h stddef.h-t stdint.h \
759 stdio.h-t stdlib.h stdlib.h-t sys/stat.h sys/stat.h-t time.h \ 782 stdint.h-t stdio.h stdio.h-t stdlib.h stdlib.h-t sys/stat.h \
760 time.h-t unistd.h unistd.h-t warn-on-use.h warn-on-use.h-t 783 sys/stat.h-t time.h time.h-t unistd.h unistd.h-t warn-on-use.h \
784 warn-on-use.h-t
761noinst_LIBRARIES = libgnu.a 785noinst_LIBRARIES = libgnu.a
762DEFAULT_INCLUDES = -I. -I../src -I$(top_srcdir)/src 786DEFAULT_INCLUDES = -I. -I../src -I$(top_srcdir)/src
763libgnu_a_SOURCES = allocator.c careadlinkat.c md5.c sha1.c sha256.c \ 787libgnu_a_SOURCES = allocator.c careadlinkat.c md5.c sha1.c sha256.c \
@@ -765,7 +789,8 @@ libgnu_a_SOURCES = allocator.c careadlinkat.c md5.c sha1.c sha256.c \
765libgnu_a_LIBADD = $(gl_LIBOBJS) 789libgnu_a_LIBADD = $(gl_LIBOBJS)
766libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) 790libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
767EXTRA_libgnu_a_SOURCES = ftoastr.c dup2.c getloadavg.c getopt.c \ 791EXTRA_libgnu_a_SOURCES = ftoastr.c dup2.c getloadavg.c getopt.c \
768 getopt1.c lstat.c mktime.c readlink.c stat.c strtol.c \ 792 getopt1.c lstat.c mktime.c pthread_sigmask.c readlink.c \
793 sigprocmask.c stat.c strtoimax.c strtol.c strtoll.c strtol.c \
769 strtoul.c strtoull.c strtoimax.c strtoumax.c symlink.c \ 794 strtoul.c strtoull.c strtoimax.c strtoumax.c symlink.c \
770 time_r.c 795 time_r.c
771ARG_NONNULL_H = arg-nonnull.h 796ARG_NONNULL_H = arg-nonnull.h
@@ -832,14 +857,17 @@ distclean-compile:
832@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ 857@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@
833@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@ 858@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@
834@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktime.Po@am__quote@ 859@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mktime.Po@am__quote@
860@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_sigmask.Po@am__quote@
835@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ 861@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@
836@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Po@am__quote@ 862@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Po@am__quote@
837@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha256.Po@am__quote@ 863@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha256.Po@am__quote@
838@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha512.Po@am__quote@ 864@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha512.Po@am__quote@
865@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigprocmask.Po@am__quote@
839@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ 866@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@
840@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strftime.Po@am__quote@ 867@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strftime.Po@am__quote@
841@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoimax.Po@am__quote@ 868@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoimax.Po@am__quote@
842@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtol.Po@am__quote@ 869@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtol.Po@am__quote@
870@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoll.Po@am__quote@
843@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoul.Po@am__quote@ 871@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoul.Po@am__quote@
844@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoull.Po@am__quote@ 872@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoull.Po@am__quote@
845@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoumax.Po@am__quote@ 873@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtoumax.Po@am__quote@
@@ -1137,6 +1165,36 @@ inttypes.h: inttypes.in.h $(top_builddir)/config.status $(WARN_ON_USE_H) $(ARG_N
1137 } > $@-t && \ 1165 } > $@-t && \
1138 mv $@-t $@ 1166 mv $@-t $@
1139 1167
1168# We need the following in order to create <signal.h> when the system
1169# doesn't have a complete one.
1170signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
1171 $(AM_V_GEN)rm -f $@-t $@ && \
1172 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
1173 sed -e 's|@''GUARD_PREFIX''@|GL|g' \
1174 -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
1175 -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
1176 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
1177 -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \
1178 -e 's|@''GNULIB_PTHREAD_SIGMASK''@|$(GNULIB_PTHREAD_SIGMASK)|g' \
1179 -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \
1180 -e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \
1181 -e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \
1182 -e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \
1183 -e 's|@''HAVE_PTHREAD_SIGMASK''@|$(HAVE_PTHREAD_SIGMASK)|g' \
1184 -e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \
1185 -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \
1186 -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \
1187 -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \
1188 -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \
1189 -e 's|@''HAVE_SIGHANDLER_T''@|$(HAVE_SIGHANDLER_T)|g' \
1190 -e 's|@''REPLACE_PTHREAD_SIGMASK''@|$(REPLACE_PTHREAD_SIGMASK)|g' \
1191 -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
1192 -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
1193 -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
1194 < $(srcdir)/signal.in.h; \
1195 } > $@-t && \
1196 mv $@-t $@
1197
1140# We need the following in order to create <stdarg.h> when the system 1198# We need the following in order to create <stdarg.h> when the system
1141# doesn't have one that works with the given compiler. 1199# doesn't have one that works with the given compiler.
1142@GL_GENERATE_STDARG_H_TRUE@stdarg.h: stdarg.in.h $(top_builddir)/config.status 1200@GL_GENERATE_STDARG_H_TRUE@stdarg.h: stdarg.in.h $(top_builddir)/config.status
diff --git a/autogen/aclocal.m4 b/autogen/aclocal.m4
index 8c0a25eba14..90ed7c0a99f 100644
--- a/autogen/aclocal.m4
+++ b/autogen/aclocal.m4
@@ -1001,10 +1001,13 @@ m4_include([m4/lstat.m4])
1001m4_include([m4/md5.m4]) 1001m4_include([m4/md5.m4])
1002m4_include([m4/mktime.m4]) 1002m4_include([m4/mktime.m4])
1003m4_include([m4/multiarch.m4]) 1003m4_include([m4/multiarch.m4])
1004m4_include([m4/pthread_sigmask.m4])
1004m4_include([m4/readlink.m4]) 1005m4_include([m4/readlink.m4])
1005m4_include([m4/sha1.m4]) 1006m4_include([m4/sha1.m4])
1006m4_include([m4/sha256.m4]) 1007m4_include([m4/sha256.m4])
1007m4_include([m4/sha512.m4]) 1008m4_include([m4/sha512.m4])
1009m4_include([m4/signal_h.m4])
1010m4_include([m4/signalblocking.m4])
1008m4_include([m4/socklen.m4]) 1011m4_include([m4/socklen.m4])
1009m4_include([m4/ssize_t.m4]) 1012m4_include([m4/ssize_t.m4])
1010m4_include([m4/st_dm_mode.m4]) 1013m4_include([m4/st_dm_mode.m4])
@@ -1016,6 +1019,8 @@ m4_include([m4/stdint.m4])
1016m4_include([m4/stdio_h.m4]) 1019m4_include([m4/stdio_h.m4])
1017m4_include([m4/stdlib_h.m4]) 1020m4_include([m4/stdlib_h.m4])
1018m4_include([m4/strftime.m4]) 1021m4_include([m4/strftime.m4])
1022m4_include([m4/strtoimax.m4])
1023m4_include([m4/strtoll.m4])
1019m4_include([m4/strtoull.m4]) 1024m4_include([m4/strtoull.m4])
1020m4_include([m4/strtoumax.m4]) 1025m4_include([m4/strtoumax.m4])
1021m4_include([m4/symlink.m4]) 1026m4_include([m4/symlink.m4])
diff --git a/autogen/config.in b/autogen/config.in
index 051c0ea26ea..e7764e1ae24 100644
--- a/autogen/config.in
+++ b/autogen/config.in
@@ -160,6 +160,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
160 don't. */ 160 don't. */
161#undef HAVE_DECL_STRMODE 161#undef HAVE_DECL_STRMODE
162 162
163/* Define to 1 if you have the declaration of `strtoimax', and to 0 if you
164 don't. */
165#undef HAVE_DECL_STRTOIMAX
166
167/* Define to 1 if you have the declaration of `strtoll', and to 0 if you
168 don't. */
169#undef HAVE_DECL_STRTOLL
170
163/* Define to 1 if you have the declaration of `strtoull', and to 0 if you 171/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
164 don't. */ 172 don't. */
165#undef HAVE_DECL_STRTOULL 173#undef HAVE_DECL_STRTOULL
@@ -592,6 +600,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
592/* Define to 1 if you have the <pthread.h> header file. */ 600/* Define to 1 if you have the <pthread.h> header file. */
593#undef HAVE_PTHREAD_H 601#undef HAVE_PTHREAD_H
594 602
603/* Define to 1 if you have the `pthread_sigmask' function. */
604#undef HAVE_PTHREAD_SIGMASK
605
595/* Define to 1 if you have the <pty.h> header file. */ 606/* Define to 1 if you have the <pty.h> header file. */
596#undef HAVE_PTY_H 607#undef HAVE_PTY_H
597 608
@@ -661,6 +672,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
661/* Define to 1 if 'wint_t' is a signed integer type. */ 672/* Define to 1 if 'wint_t' is a signed integer type. */
662#undef HAVE_SIGNED_WINT_T 673#undef HAVE_SIGNED_WINT_T
663 674
675/* Define to 1 if the system has the type `sigset_t'. */
676#undef HAVE_SIGSET_T
677
664/* Define to 1 if you have sound support. */ 678/* Define to 1 if you have sound support. */
665#undef HAVE_SOUND 679#undef HAVE_SOUND
666 680
@@ -697,6 +711,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
697/* Define to 1 if you have the `strsignal' function. */ 711/* Define to 1 if you have the `strsignal' function. */
698#undef HAVE_STRSIGNAL 712#undef HAVE_STRSIGNAL
699 713
714/* Define to 1 if you have the `strtoimax' function. */
715#undef HAVE_STRTOIMAX
716
717/* Define to 1 if you have the `strtoll' function. */
718#undef HAVE_STRTOLL
719
700/* Define to 1 if you have the `strtoull' function. */ 720/* Define to 1 if you have the `strtoull' function. */
701#undef HAVE_STRTOULL 721#undef HAVE_STRTOULL
702 722
diff --git a/autogen/configure b/autogen/configure
index 10bdf24c3a9..60ef873e39d 100755
--- a/autogen/configure
+++ b/autogen/configure
@@ -607,55 +607,6 @@ SUBDIR_MAKEFILES_IN
607LIB_GCC 607LIB_GCC
608LD_FIRSTFLAG 608LD_FIRSTFLAG
609LD_SWITCH_SYSTEM_TEMACS 609LD_SWITCH_SYSTEM_TEMACS
610POST_ALLOC_OBJ
611PRE_ALLOC_OBJ
612CYGWIN_OBJ
613RALLOC_OBJ
614OLDXMENU_DEPS
615LIBX_OTHER
616LIBXMENU
617OLDXMENU
618OLDXMENU_TARGET
619LIBXT_OTHER
620TOOLKIT_LIBW
621WIDGET_OBJ
622XOBJ
623XMENU_OBJ
624FONT_OBJ
625OTHER_FILES
626GNU_OBJC_CFLAGS
627ns_appsrc
628ns_appresdir
629ns_appbindir
630ns_appdir
631S_FILE
632M_FILE
633X_TOOLKIT_TYPE
634C_SWITCH_X_SYSTEM
635C_SWITCH_X_SITE
636LD_SWITCH_X_SITE
637gameuser
638gamedir
639bitmapdir
640archlibdir
641etcdir
642x_default_search_path
643lisppath
644locallisppath
645lispdir
646srcdir
647canonical
648configuration
649version
650KRB4LIB
651DESLIB
652KRB5LIB
653CRYPTOLIB
654COM_ERRLIB
655LIBRESOLV
656LIBHESIOD
657TERMCAP_OBJ
658LIBS_TERMCAP
659LIBGNU_LTLIBDEPS 610LIBGNU_LTLIBDEPS
660LIBGNU_LIBDEPS 611LIBGNU_LIBDEPS
661gltests_WITNESS 612gltests_WITNESS
@@ -663,8 +614,12 @@ gl_GNULIB_ENABLED_verify_FALSE
663gl_GNULIB_ENABLED_verify_TRUE 614gl_GNULIB_ENABLED_verify_TRUE
664gl_GNULIB_ENABLED_strtoull_FALSE 615gl_GNULIB_ENABLED_strtoull_FALSE
665gl_GNULIB_ENABLED_strtoull_TRUE 616gl_GNULIB_ENABLED_strtoull_TRUE
617gl_GNULIB_ENABLED_strtoll_FALSE
618gl_GNULIB_ENABLED_strtoll_TRUE
666gl_GNULIB_ENABLED_stat_FALSE 619gl_GNULIB_ENABLED_stat_FALSE
667gl_GNULIB_ENABLED_stat_TRUE 620gl_GNULIB_ENABLED_stat_TRUE
621gl_GNULIB_ENABLED_sigprocmask_FALSE
622gl_GNULIB_ENABLED_sigprocmask_TRUE
668gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_FALSE 623gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_FALSE
669gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_TRUE 624gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_TRUE
670gl_GNULIB_ENABLED_dosname_FALSE 625gl_GNULIB_ENABLED_dosname_FALSE
@@ -798,6 +753,22 @@ GL_GENERATE_STDARG_H_TRUE
798STDARG_H 753STDARG_H
799NEXT_AS_FIRST_DIRECTIVE_STDARG_H 754NEXT_AS_FIRST_DIRECTIVE_STDARG_H
800NEXT_STDARG_H 755NEXT_STDARG_H
756NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H
757NEXT_SIGNAL_H
758REPLACE_PTHREAD_SIGMASK
759HAVE_SIGHANDLER_T
760HAVE_TYPE_VOLATILE_SIG_ATOMIC_T
761HAVE_STRUCT_SIGACTION_SA_SIGACTION
762HAVE_SIGACTION
763HAVE_SIGINFO_T
764HAVE_SIGSET_T
765HAVE_PTHREAD_SIGMASK
766HAVE_POSIX_SIGNALBLOCKING
767GNULIB_SIGACTION
768GNULIB_SIGPROCMASK
769GNULIB_SIGNAL_H_SIGPIPE
770GNULIB_PTHREAD_SIGMASK
771LIB_PTHREAD_SIGMASK
801REPLACE_TIMEGM 772REPLACE_TIMEGM
802REPLACE_NANOSLEEP 773REPLACE_NANOSLEEP
803REPLACE_MKTIME 774REPLACE_MKTIME
@@ -1076,6 +1047,55 @@ ALLOCA_H
1076ALLOCA 1047ALLOCA
1077GL_COND_LIBTOOL_FALSE 1048GL_COND_LIBTOOL_FALSE
1078GL_COND_LIBTOOL_TRUE 1049GL_COND_LIBTOOL_TRUE
1050POST_ALLOC_OBJ
1051PRE_ALLOC_OBJ
1052CYGWIN_OBJ
1053RALLOC_OBJ
1054OLDXMENU_DEPS
1055LIBX_OTHER
1056LIBXMENU
1057OLDXMENU
1058OLDXMENU_TARGET
1059LIBXT_OTHER
1060TOOLKIT_LIBW
1061WIDGET_OBJ
1062XOBJ
1063XMENU_OBJ
1064FONT_OBJ
1065OTHER_FILES
1066GNU_OBJC_CFLAGS
1067ns_appsrc
1068ns_appresdir
1069ns_appbindir
1070ns_appdir
1071S_FILE
1072M_FILE
1073X_TOOLKIT_TYPE
1074C_SWITCH_X_SYSTEM
1075C_SWITCH_X_SITE
1076LD_SWITCH_X_SITE
1077gameuser
1078gamedir
1079bitmapdir
1080archlibdir
1081etcdir
1082x_default_search_path
1083lisppath
1084locallisppath
1085lispdir
1086srcdir
1087canonical
1088configuration
1089version
1090KRB4LIB
1091DESLIB
1092KRB5LIB
1093CRYPTOLIB
1094COM_ERRLIB
1095LIBRESOLV
1096LIBHESIOD
1097TERMCAP_OBJ
1098LIBS_TERMCAP
1079BLESSMAIL_TARGET 1099BLESSMAIL_TARGET
1080LIBS_MAIL 1100LIBS_MAIL
1081liblockfile 1101liblockfile
@@ -2571,6 +2591,60 @@ $as_echo "$ac_res" >&6; }
2571 2591
2572} # ac_fn_c_check_func 2592} # ac_fn_c_check_func
2573 2593
2594# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
2595# -------------------------------------------
2596# Tests whether TYPE exists after having included INCLUDES, setting cache
2597# variable VAR accordingly.
2598ac_fn_c_check_type ()
2599{
2600 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2601 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2602$as_echo_n "checking for $2... " >&6; }
2603if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
2604 $as_echo_n "(cached) " >&6
2605else
2606 eval "$3=no"
2607 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2608/* end confdefs.h. */
2609$4
2610int
2611main ()
2612{
2613if (sizeof ($2))
2614 return 0;
2615 ;
2616 return 0;
2617}
2618_ACEOF
2619if ac_fn_c_try_compile "$LINENO"; then :
2620 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2621/* end confdefs.h. */
2622$4
2623int
2624main ()
2625{
2626if (sizeof (($2)))
2627 return 0;
2628 ;
2629 return 0;
2630}
2631_ACEOF
2632if ac_fn_c_try_compile "$LINENO"; then :
2633
2634else
2635 eval "$3=yes"
2636fi
2637rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2638fi
2639rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2640fi
2641eval ac_res=\$$3
2642 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2643$as_echo "$ac_res" >&6; }
2644 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
2645
2646} # ac_fn_c_check_type
2647
2574# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES 2648# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
2575# -------------------------------------------- 2649# --------------------------------------------
2576# Tries to find the compile-time value of EXPR in a program that includes 2650# Tries to find the compile-time value of EXPR in a program that includes
@@ -2748,60 +2822,6 @@ rm -f conftest.val
2748 as_fn_set_status $ac_retval 2822 as_fn_set_status $ac_retval
2749 2823
2750} # ac_fn_c_compute_int 2824} # ac_fn_c_compute_int
2751
2752# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
2753# -------------------------------------------
2754# Tests whether TYPE exists after having included INCLUDES, setting cache
2755# variable VAR accordingly.
2756ac_fn_c_check_type ()
2757{
2758 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2759 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2760$as_echo_n "checking for $2... " >&6; }
2761if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
2762 $as_echo_n "(cached) " >&6
2763else
2764 eval "$3=no"
2765 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2766/* end confdefs.h. */
2767$4
2768int
2769main ()
2770{
2771if (sizeof ($2))
2772 return 0;
2773 ;
2774 return 0;
2775}
2776_ACEOF
2777if ac_fn_c_try_compile "$LINENO"; then :
2778 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2779/* end confdefs.h. */
2780$4
2781int
2782main ()
2783{
2784if (sizeof (($2)))
2785 return 0;
2786 ;
2787 return 0;
2788}
2789_ACEOF
2790if ac_fn_c_try_compile "$LINENO"; then :
2791
2792else
2793 eval "$3=yes"
2794fi
2795rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2796fi
2797rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2798fi
2799eval ac_res=\$$3
2800 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2801$as_echo "$ac_res" >&6; }
2802 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
2803
2804} # ac_fn_c_check_type
2805cat >config.log <<_ACEOF 2825cat >config.log <<_ACEOF
2806This file contains any messages produced by compilers while 2826This file contains any messages produced by compilers while
2807running configure, to aid debugging if configure makes a mistake. 2827running configure, to aid debugging if configure makes a mistake.
@@ -3097,6 +3117,7 @@ as_fn_append ac_header_list " stdint.h"
3097as_fn_append ac_header_list " inttypes.h" 3117as_fn_append ac_header_list " inttypes.h"
3098as_fn_append ac_func_list " lstat" 3118as_fn_append ac_func_list " lstat"
3099as_fn_append ac_func_list " alarm" 3119as_fn_append ac_func_list " alarm"
3120as_fn_append ac_func_list " pthread_sigmask"
3100as_fn_append ac_func_list " readlink" 3121as_fn_append ac_func_list " readlink"
3101as_fn_append ac_header_list " sys/socket.h" 3122as_fn_append ac_header_list " sys/socket.h"
3102as_fn_append ac_func_list " tzset" 3123as_fn_append ac_func_list " tzset"
@@ -6579,7 +6600,10 @@ esac
6579 # Code from module lstat: 6600 # Code from module lstat:
6580 # Code from module mktime: 6601 # Code from module mktime:
6581 # Code from module multiarch: 6602 # Code from module multiarch:
6603 # Code from module pthread_sigmask:
6582 # Code from module readlink: 6604 # Code from module readlink:
6605 # Code from module signal:
6606 # Code from module sigprocmask:
6583 # Code from module socklen: 6607 # Code from module socklen:
6584 # Code from module ssize_t: 6608 # Code from module ssize_t:
6585 # Code from module stat: 6609 # Code from module stat:
@@ -6591,6 +6615,8 @@ esac
6591 # Code from module stdio: 6615 # Code from module stdio:
6592 # Code from module stdlib: 6616 # Code from module stdlib:
6593 # Code from module strftime: 6617 # Code from module strftime:
6618 # Code from module strtoimax:
6619 # Code from module strtoll:
6594 # Code from module strtoull: 6620 # Code from module strtoull:
6595 # Code from module strtoumax: 6621 # Code from module strtoumax:
6596 # Code from module symlink: 6622 # Code from module symlink:
@@ -7455,6 +7481,8 @@ fi
7455 7481
7456# Suppress obsolescent Autoconf test for size_t; Emacs assumes C89 or better. 7482# Suppress obsolescent Autoconf test for size_t; Emacs assumes C89 or better.
7457 7483
7484# Likewise for obsolescent test for uid_t, gid_t; Emacs assumes them.
7485
7458 7486
7459# Check whether --enable-largefile was given. 7487# Check whether --enable-largefile was given.
7460if test "${enable_largefile+set}" = set; then : 7488if test "${enable_largefile+set}" = set; then :
@@ -13915,7 +13943,1766 @@ $as_echo "#define GETPGRP_VOID 1" >>confdefs.h
13915fi 13943fi
13916 13944
13917 13945
13918# Configure gnulib. 13946# UNIX98 PTYs.
13947for ac_func in grantpt
13948do :
13949 ac_fn_c_check_func "$LINENO" "grantpt" "ac_cv_func_grantpt"
13950if test "x$ac_cv_func_grantpt" = x""yes; then :
13951 cat >>confdefs.h <<_ACEOF
13952#define HAVE_GRANTPT 1
13953_ACEOF
13954
13955fi
13956done
13957
13958
13959# PTY-related GNU extensions.
13960for ac_func in getpt
13961do :
13962 ac_fn_c_check_func "$LINENO" "getpt" "ac_cv_func_getpt"
13963if test "x$ac_cv_func_getpt" = x""yes; then :
13964 cat >>confdefs.h <<_ACEOF
13965#define HAVE_GETPT 1
13966_ACEOF
13967
13968fi
13969done
13970
13971
13972# Check this now, so that we will NOT find the above functions in ncurses.
13973# That is because we have not set up to link ncurses in lib-src.
13974# It's better to believe a function is not available
13975# than to expect to find it in ncurses.
13976# Also we need tputs and friends to be able to build at all.
13977have_tputs_et_al=true
13978{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tputs" >&5
13979$as_echo_n "checking for library containing tputs... " >&6; }
13980if test "${ac_cv_search_tputs+set}" = set; then :
13981 $as_echo_n "(cached) " >&6
13982else
13983 ac_func_search_save_LIBS=$LIBS
13984cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13985/* end confdefs.h. */
13986
13987/* Override any GCC internal prototype to avoid an error.
13988 Use char because int might match the return type of a GCC
13989 builtin and then its argument prototype would still apply. */
13990#ifdef __cplusplus
13991extern "C"
13992#endif
13993char tputs ();
13994int
13995main ()
13996{
13997return tputs ();
13998 ;
13999 return 0;
14000}
14001_ACEOF
14002for ac_lib in '' ncurses terminfo termcap; do
14003 if test -z "$ac_lib"; then
14004 ac_res="none required"
14005 else
14006 ac_res=-l$ac_lib
14007 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
14008 fi
14009 if ac_fn_c_try_link "$LINENO"; then :
14010 ac_cv_search_tputs=$ac_res
14011fi
14012rm -f core conftest.err conftest.$ac_objext \
14013 conftest$ac_exeext
14014 if test "${ac_cv_search_tputs+set}" = set; then :
14015 break
14016fi
14017done
14018if test "${ac_cv_search_tputs+set}" = set; then :
14019
14020else
14021 ac_cv_search_tputs=no
14022fi
14023rm conftest.$ac_ext
14024LIBS=$ac_func_search_save_LIBS
14025fi
14026{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tputs" >&5
14027$as_echo "$ac_cv_search_tputs" >&6; }
14028ac_res=$ac_cv_search_tputs
14029if test "$ac_res" != no; then :
14030 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
14031
14032else
14033 have_tputs_et_al=false
14034fi
14035
14036if test "$have_tputs_et_al" != true; then
14037 as_fn_error "I couldn't find termcap functions (tputs and friends).
14038Maybe some development libraries/packages are missing? Try installing
14039libncurses-dev(el), libterminfo-dev(el) or similar." "$LINENO" 5
14040fi
14041# Must define this when any termcap library is found.
14042
14043$as_echo "#define HAVE_LIBNCURSES 1" >>confdefs.h
14044
14045## FIXME This was the cpp logic, but I am not sure it is right.
14046## The above test has not necessarily found libncurses.
14047HAVE_LIBNCURSES=yes
14048
14049## Use terminfo instead of termcap?
14050## Note only system files NOT using terminfo are:
14051## freebsd < 40000, ms-w32, msdos, netbsd < 599002500, and
14052## darwin|gnu without ncurses.
14053TERMINFO=no
14054LIBS_TERMCAP=
14055case "$opsys" in
14056 ## cygwin: Fewer environment variables to go wrong, more terminal types.
14057 ## hpux10-20: Use the system provided termcap(3) library.
14058 ## openbsd: David Mazieres <dm@reeducation-labor.lcs.mit.edu> says this
14059 ## is necessary. Otherwise Emacs dumps core when run -nw.
14060 aix4-2|cygwin|hpux*|irix6-5|openbsd|sol2*|unixware) TERMINFO=yes ;;
14061
14062 ## darwin: Prevents crashes when running Emacs in Terminal.app under 10.2.
14063 ## The ncurses library has been moved out of the System framework in
14064 ## Mac OS X 10.2. So if configure detects it, set the command-line
14065 ## option to use it.
14066 darwin|gnu*)
14067 ## (HAVE_LIBNCURSES was not always true, but is since 2010-03-18.)
14068 if test "x$HAVE_LIBNCURSES" = "xyes"; then
14069 TERMINFO=yes
14070 LIBS_TERMCAP="-lncurses"
14071 fi
14072 ;;
14073
14074 freebsd)
14075 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether FreeBSD is new enough to use terminfo" >&5
14076$as_echo_n "checking whether FreeBSD is new enough to use terminfo... " >&6; }
14077 if test "${emacs_cv_freebsd_terminfo+set}" = set; then :
14078 $as_echo_n "(cached) " >&6
14079else
14080 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14081/* end confdefs.h. */
14082#include <osreldate.h>
14083int
14084main ()
14085{
14086#if __FreeBSD_version < 400000
14087fail;
14088#endif
14089
14090 ;
14091 return 0;
14092}
14093_ACEOF
14094if ac_fn_c_try_link "$LINENO"; then :
14095 emacs_cv_freebsd_terminfo=yes
14096else
14097 emacs_cv_freebsd_terminfo=no
14098fi
14099rm -f core conftest.err conftest.$ac_objext \
14100 conftest$ac_exeext conftest.$ac_ext
14101fi
14102
14103
14104 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_freebsd_terminfo" >&5
14105$as_echo "$emacs_cv_freebsd_terminfo" >&6; }
14106
14107 if test $emacs_cv_freebsd_terminfo = yes; then
14108 TERMINFO=yes
14109 LIBS_TERMCAP="-lncurses"
14110 else
14111 LIBS_TERMCAP="-ltermcap"
14112 fi
14113 ;;
14114
14115 netbsd)
14116 if test $ac_cv_search_tputs = -lterminfo; then
14117 TERMINFO=yes
14118 LIBS_TERMCAP="-lterminfo"
14119 else
14120 LIBS_TERMCAP="-ltermcap"
14121 fi
14122 ;;
14123
14124esac
14125
14126case "$opsys" in
14127 ## hpux: Make sure we get select from libc rather than from libcurses
14128 ## because libcurses on HPUX 10.10 has a broken version of select.
14129 ## We used to use -lc -lcurses, but this may be cleaner.
14130 hpux*) LIBS_TERMCAP="-ltermcap" ;;
14131
14132 openbsd) LIBS_TERMCAP="-lncurses" ;;
14133
14134 ## Must use system termcap, if we use any termcap. It does special things.
14135 sol2*) test "$TERMINFO" != yes && LIBS_TERMCAP="-ltermcap" ;;
14136esac
14137
14138TERMCAP_OBJ=tparam.o
14139if test $TERMINFO = yes; then
14140
14141$as_echo "#define TERMINFO 1" >>confdefs.h
14142
14143
14144 ## Default used to be -ltermcap. Add a case above if need something else.
14145 test "x$LIBS_TERMCAP" = "x" && LIBS_TERMCAP="-lcurses"
14146
14147 TERMCAP_OBJ=terminfo.o
14148fi
14149
14150
14151
14152
14153# Do we have res_init, for detecting changes in /etc/resolv.conf?
14154resolv=no
14155cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14156/* end confdefs.h. */
14157#include <netinet/in.h>
14158#include <arpa/nameser.h>
14159#include <resolv.h>
14160int
14161main ()
14162{
14163return res_init();
14164 ;
14165 return 0;
14166}
14167_ACEOF
14168if ac_fn_c_try_link "$LINENO"; then :
14169 have_res_init=yes
14170else
14171 have_res_init=no
14172fi
14173rm -f core conftest.err conftest.$ac_objext \
14174 conftest$ac_exeext conftest.$ac_ext
14175if test "$have_res_init" = no; then
14176 OLIBS="$LIBS"
14177 LIBS="$LIBS -lresolv"
14178 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_init with -lresolv" >&5
14179$as_echo_n "checking for res_init with -lresolv... " >&6; }
14180 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14181/* end confdefs.h. */
14182#include <netinet/in.h>
14183#include <arpa/nameser.h>
14184#include <resolv.h>
14185int
14186main ()
14187{
14188return res_init();
14189 ;
14190 return 0;
14191}
14192_ACEOF
14193if ac_fn_c_try_link "$LINENO"; then :
14194 have_res_init=yes
14195else
14196 have_res_init=no
14197fi
14198rm -f core conftest.err conftest.$ac_objext \
14199 conftest$ac_exeext conftest.$ac_ext
14200 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_res_init" >&5
14201$as_echo "$have_res_init" >&6; }
14202 if test "$have_res_init" = yes ; then
14203 resolv=yes
14204 fi
14205 LIBS="$OLIBS"
14206fi
14207
14208if test "$have_res_init" = yes; then
14209
14210$as_echo "#define HAVE_RES_INIT 1" >>confdefs.h
14211
14212fi
14213
14214# Do we need the Hesiod library to provide the support routines?
14215LIBHESIOD=
14216if test "$with_hesiod" != no ; then
14217 # Don't set $LIBS here -- see comments above. FIXME which comments?
14218 ac_fn_c_check_func "$LINENO" "res_send" "ac_cv_func_res_send"
14219if test "x$ac_cv_func_res_send" = x""yes; then :
14220
14221else
14222 ac_fn_c_check_func "$LINENO" "__res_send" "ac_cv_func___res_send"
14223if test "x$ac_cv_func___res_send" = x""yes; then :
14224
14225else
14226 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_send in -lresolv" >&5
14227$as_echo_n "checking for res_send in -lresolv... " >&6; }
14228if test "${ac_cv_lib_resolv_res_send+set}" = set; then :
14229 $as_echo_n "(cached) " >&6
14230else
14231 ac_check_lib_save_LIBS=$LIBS
14232LIBS="-lresolv $LIBS"
14233cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14234/* end confdefs.h. */
14235
14236/* Override any GCC internal prototype to avoid an error.
14237 Use char because int might match the return type of a GCC
14238 builtin and then its argument prototype would still apply. */
14239#ifdef __cplusplus
14240extern "C"
14241#endif
14242char res_send ();
14243int
14244main ()
14245{
14246return res_send ();
14247 ;
14248 return 0;
14249}
14250_ACEOF
14251if ac_fn_c_try_link "$LINENO"; then :
14252 ac_cv_lib_resolv_res_send=yes
14253else
14254 ac_cv_lib_resolv_res_send=no
14255fi
14256rm -f core conftest.err conftest.$ac_objext \
14257 conftest$ac_exeext conftest.$ac_ext
14258LIBS=$ac_check_lib_save_LIBS
14259fi
14260{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_send" >&5
14261$as_echo "$ac_cv_lib_resolv_res_send" >&6; }
14262if test "x$ac_cv_lib_resolv_res_send" = x""yes; then :
14263 resolv=yes
14264else
14265 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __res_send in -lresolv" >&5
14266$as_echo_n "checking for __res_send in -lresolv... " >&6; }
14267if test "${ac_cv_lib_resolv___res_send+set}" = set; then :
14268 $as_echo_n "(cached) " >&6
14269else
14270 ac_check_lib_save_LIBS=$LIBS
14271LIBS="-lresolv $LIBS"
14272cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14273/* end confdefs.h. */
14274
14275/* Override any GCC internal prototype to avoid an error.
14276 Use char because int might match the return type of a GCC
14277 builtin and then its argument prototype would still apply. */
14278#ifdef __cplusplus
14279extern "C"
14280#endif
14281char __res_send ();
14282int
14283main ()
14284{
14285return __res_send ();
14286 ;
14287 return 0;
14288}
14289_ACEOF
14290if ac_fn_c_try_link "$LINENO"; then :
14291 ac_cv_lib_resolv___res_send=yes
14292else
14293 ac_cv_lib_resolv___res_send=no
14294fi
14295rm -f core conftest.err conftest.$ac_objext \
14296 conftest$ac_exeext conftest.$ac_ext
14297LIBS=$ac_check_lib_save_LIBS
14298fi
14299{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv___res_send" >&5
14300$as_echo "$ac_cv_lib_resolv___res_send" >&6; }
14301if test "x$ac_cv_lib_resolv___res_send" = x""yes; then :
14302 resolv=yes
14303fi
14304
14305fi
14306
14307fi
14308
14309fi
14310
14311 if test "$resolv" = yes ; then
14312 RESOLVLIB=-lresolv
14313 else
14314 RESOLVLIB=
14315 fi
14316 ac_fn_c_check_func "$LINENO" "hes_getmailhost" "ac_cv_func_hes_getmailhost"
14317if test "x$ac_cv_func_hes_getmailhost" = x""yes; then :
14318
14319else
14320 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hes_getmailhost in -lhesiod" >&5
14321$as_echo_n "checking for hes_getmailhost in -lhesiod... " >&6; }
14322if test "${ac_cv_lib_hesiod_hes_getmailhost+set}" = set; then :
14323 $as_echo_n "(cached) " >&6
14324else
14325 ac_check_lib_save_LIBS=$LIBS
14326LIBS="-lhesiod $RESOLVLIB $LIBS"
14327cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14328/* end confdefs.h. */
14329
14330/* Override any GCC internal prototype to avoid an error.
14331 Use char because int might match the return type of a GCC
14332 builtin and then its argument prototype would still apply. */
14333#ifdef __cplusplus
14334extern "C"
14335#endif
14336char hes_getmailhost ();
14337int
14338main ()
14339{
14340return hes_getmailhost ();
14341 ;
14342 return 0;
14343}
14344_ACEOF
14345if ac_fn_c_try_link "$LINENO"; then :
14346 ac_cv_lib_hesiod_hes_getmailhost=yes
14347else
14348 ac_cv_lib_hesiod_hes_getmailhost=no
14349fi
14350rm -f core conftest.err conftest.$ac_objext \
14351 conftest$ac_exeext conftest.$ac_ext
14352LIBS=$ac_check_lib_save_LIBS
14353fi
14354{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hesiod_hes_getmailhost" >&5
14355$as_echo "$ac_cv_lib_hesiod_hes_getmailhost" >&6; }
14356if test "x$ac_cv_lib_hesiod_hes_getmailhost" = x""yes; then :
14357 hesiod=yes
14358else
14359 :
14360fi
14361
14362fi
14363
14364
14365 if test x"$hesiod" = xyes; then
14366
14367$as_echo "#define HAVE_LIBHESIOD 1" >>confdefs.h
14368
14369 LIBHESIOD=-lhesiod
14370 fi
14371fi
14372
14373
14374# Do we need libresolv (due to res_init or Hesiod)?
14375if test "$resolv" = yes ; then
14376
14377$as_echo "#define HAVE_LIBRESOLV 1" >>confdefs.h
14378
14379 LIBRESOLV=-lresolv
14380else
14381 LIBRESOLV=
14382fi
14383
14384
14385# These tell us which Kerberos-related libraries to use.
14386COM_ERRLIB=
14387CRYPTOLIB=
14388KRB5LIB=
14389DESLIB=
14390KRB4LIB=
14391
14392if test "${with_kerberos}" != no; then
14393 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for com_err in -lcom_err" >&5
14394$as_echo_n "checking for com_err in -lcom_err... " >&6; }
14395if test "${ac_cv_lib_com_err_com_err+set}" = set; then :
14396 $as_echo_n "(cached) " >&6
14397else
14398 ac_check_lib_save_LIBS=$LIBS
14399LIBS="-lcom_err $LIBS"
14400cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14401/* end confdefs.h. */
14402
14403/* Override any GCC internal prototype to avoid an error.
14404 Use char because int might match the return type of a GCC
14405 builtin and then its argument prototype would still apply. */
14406#ifdef __cplusplus
14407extern "C"
14408#endif
14409char com_err ();
14410int
14411main ()
14412{
14413return com_err ();
14414 ;
14415 return 0;
14416}
14417_ACEOF
14418if ac_fn_c_try_link "$LINENO"; then :
14419 ac_cv_lib_com_err_com_err=yes
14420else
14421 ac_cv_lib_com_err_com_err=no
14422fi
14423rm -f core conftest.err conftest.$ac_objext \
14424 conftest$ac_exeext conftest.$ac_ext
14425LIBS=$ac_check_lib_save_LIBS
14426fi
14427{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_com_err_com_err" >&5
14428$as_echo "$ac_cv_lib_com_err_com_err" >&6; }
14429if test "x$ac_cv_lib_com_err_com_err" = x""yes; then :
14430 have_com_err=yes
14431else
14432 have_com_err=no
14433fi
14434
14435 if test $have_com_err = yes; then
14436 COM_ERRLIB=-lcom_err
14437 LIBS="$COM_ERRLIB $LIBS"
14438
14439$as_echo "#define HAVE_LIBCOM_ERR 1" >>confdefs.h
14440
14441 fi
14442 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mit_des_cbc_encrypt in -lcrypto" >&5
14443$as_echo_n "checking for mit_des_cbc_encrypt in -lcrypto... " >&6; }
14444if test "${ac_cv_lib_crypto_mit_des_cbc_encrypt+set}" = set; then :
14445 $as_echo_n "(cached) " >&6
14446else
14447 ac_check_lib_save_LIBS=$LIBS
14448LIBS="-lcrypto $LIBS"
14449cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14450/* end confdefs.h. */
14451
14452/* Override any GCC internal prototype to avoid an error.
14453 Use char because int might match the return type of a GCC
14454 builtin and then its argument prototype would still apply. */
14455#ifdef __cplusplus
14456extern "C"
14457#endif
14458char mit_des_cbc_encrypt ();
14459int
14460main ()
14461{
14462return mit_des_cbc_encrypt ();
14463 ;
14464 return 0;
14465}
14466_ACEOF
14467if ac_fn_c_try_link "$LINENO"; then :
14468 ac_cv_lib_crypto_mit_des_cbc_encrypt=yes
14469else
14470 ac_cv_lib_crypto_mit_des_cbc_encrypt=no
14471fi
14472rm -f core conftest.err conftest.$ac_objext \
14473 conftest$ac_exeext conftest.$ac_ext
14474LIBS=$ac_check_lib_save_LIBS
14475fi
14476{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_mit_des_cbc_encrypt" >&5
14477$as_echo "$ac_cv_lib_crypto_mit_des_cbc_encrypt" >&6; }
14478if test "x$ac_cv_lib_crypto_mit_des_cbc_encrypt" = x""yes; then :
14479 have_crypto=yes
14480else
14481 have_crypto=no
14482fi
14483
14484 if test $have_crypto = yes; then
14485 CRYPTOLIB=-lcrypto
14486 LIBS="$CRYPTOLIB $LIBS"
14487
14488$as_echo "#define HAVE_LIBCRYPTO 1" >>confdefs.h
14489
14490 fi
14491 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mit_des_cbc_encrypt in -lk5crypto" >&5
14492$as_echo_n "checking for mit_des_cbc_encrypt in -lk5crypto... " >&6; }
14493if test "${ac_cv_lib_k5crypto_mit_des_cbc_encrypt+set}" = set; then :
14494 $as_echo_n "(cached) " >&6
14495else
14496 ac_check_lib_save_LIBS=$LIBS
14497LIBS="-lk5crypto $LIBS"
14498cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14499/* end confdefs.h. */
14500
14501/* Override any GCC internal prototype to avoid an error.
14502 Use char because int might match the return type of a GCC
14503 builtin and then its argument prototype would still apply. */
14504#ifdef __cplusplus
14505extern "C"
14506#endif
14507char mit_des_cbc_encrypt ();
14508int
14509main ()
14510{
14511return mit_des_cbc_encrypt ();
14512 ;
14513 return 0;
14514}
14515_ACEOF
14516if ac_fn_c_try_link "$LINENO"; then :
14517 ac_cv_lib_k5crypto_mit_des_cbc_encrypt=yes
14518else
14519 ac_cv_lib_k5crypto_mit_des_cbc_encrypt=no
14520fi
14521rm -f core conftest.err conftest.$ac_objext \
14522 conftest$ac_exeext conftest.$ac_ext
14523LIBS=$ac_check_lib_save_LIBS
14524fi
14525{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&5
14526$as_echo "$ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&6; }
14527if test "x$ac_cv_lib_k5crypto_mit_des_cbc_encrypt" = x""yes; then :
14528 have_k5crypto=yes
14529else
14530 have_k5crypto=no
14531fi
14532
14533 if test $have_k5crypto = yes; then
14534 CRYPTOLIB=-lk5crypto
14535 LIBS="$CRYPTOLIB $LIBS"
14536
14537$as_echo "#define HAVE_LIBK5CRYPTO 1" >>confdefs.h
14538
14539 fi
14540 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_init_context in -lkrb5" >&5
14541$as_echo_n "checking for krb5_init_context in -lkrb5... " >&6; }
14542if test "${ac_cv_lib_krb5_krb5_init_context+set}" = set; then :
14543 $as_echo_n "(cached) " >&6
14544else
14545 ac_check_lib_save_LIBS=$LIBS
14546LIBS="-lkrb5 $LIBS"
14547cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14548/* end confdefs.h. */
14549
14550/* Override any GCC internal prototype to avoid an error.
14551 Use char because int might match the return type of a GCC
14552 builtin and then its argument prototype would still apply. */
14553#ifdef __cplusplus
14554extern "C"
14555#endif
14556char krb5_init_context ();
14557int
14558main ()
14559{
14560return krb5_init_context ();
14561 ;
14562 return 0;
14563}
14564_ACEOF
14565if ac_fn_c_try_link "$LINENO"; then :
14566 ac_cv_lib_krb5_krb5_init_context=yes
14567else
14568 ac_cv_lib_krb5_krb5_init_context=no
14569fi
14570rm -f core conftest.err conftest.$ac_objext \
14571 conftest$ac_exeext conftest.$ac_ext
14572LIBS=$ac_check_lib_save_LIBS
14573fi
14574{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb5_krb5_init_context" >&5
14575$as_echo "$ac_cv_lib_krb5_krb5_init_context" >&6; }
14576if test "x$ac_cv_lib_krb5_krb5_init_context" = x""yes; then :
14577 have_krb5=yes
14578else
14579 have_krb5=no
14580fi
14581
14582 if test $have_krb5=yes; then
14583 KRB5LIB=-lkrb5
14584 LIBS="$KRB5LIB $LIBS"
14585
14586$as_echo "#define HAVE_LIBKRB5 1" >>confdefs.h
14587
14588 fi
14589 if test "${with_kerberos5}" = no; then
14590 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for des_cbc_encrypt in -ldes425" >&5
14591$as_echo_n "checking for des_cbc_encrypt in -ldes425... " >&6; }
14592if test "${ac_cv_lib_des425_des_cbc_encrypt+set}" = set; then :
14593 $as_echo_n "(cached) " >&6
14594else
14595 ac_check_lib_save_LIBS=$LIBS
14596LIBS="-ldes425 $LIBS"
14597cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14598/* end confdefs.h. */
14599
14600/* Override any GCC internal prototype to avoid an error.
14601 Use char because int might match the return type of a GCC
14602 builtin and then its argument prototype would still apply. */
14603#ifdef __cplusplus
14604extern "C"
14605#endif
14606char des_cbc_encrypt ();
14607int
14608main ()
14609{
14610return des_cbc_encrypt ();
14611 ;
14612 return 0;
14613}
14614_ACEOF
14615if ac_fn_c_try_link "$LINENO"; then :
14616 ac_cv_lib_des425_des_cbc_encrypt=yes
14617else
14618 ac_cv_lib_des425_des_cbc_encrypt=no
14619fi
14620rm -f core conftest.err conftest.$ac_objext \
14621 conftest$ac_exeext conftest.$ac_ext
14622LIBS=$ac_check_lib_save_LIBS
14623fi
14624{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_des425_des_cbc_encrypt" >&5
14625$as_echo "$ac_cv_lib_des425_des_cbc_encrypt" >&6; }
14626if test "x$ac_cv_lib_des425_des_cbc_encrypt" = x""yes; then :
14627 have_des425=yes
14628else
14629 have_des425=no
14630fi
14631
14632 if test $have_des425 = yes; then
14633 DESLIB=-ldes425
14634 LIBS="$DESLIB $LIBS"
14635
14636$as_echo "#define HAVE_LIBDES425 1" >>confdefs.h
14637
14638 else
14639 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for des_cbc_encrypt in -ldes" >&5
14640$as_echo_n "checking for des_cbc_encrypt in -ldes... " >&6; }
14641if test "${ac_cv_lib_des_des_cbc_encrypt+set}" = set; then :
14642 $as_echo_n "(cached) " >&6
14643else
14644 ac_check_lib_save_LIBS=$LIBS
14645LIBS="-ldes $LIBS"
14646cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14647/* end confdefs.h. */
14648
14649/* Override any GCC internal prototype to avoid an error.
14650 Use char because int might match the return type of a GCC
14651 builtin and then its argument prototype would still apply. */
14652#ifdef __cplusplus
14653extern "C"
14654#endif
14655char des_cbc_encrypt ();
14656int
14657main ()
14658{
14659return des_cbc_encrypt ();
14660 ;
14661 return 0;
14662}
14663_ACEOF
14664if ac_fn_c_try_link "$LINENO"; then :
14665 ac_cv_lib_des_des_cbc_encrypt=yes
14666else
14667 ac_cv_lib_des_des_cbc_encrypt=no
14668fi
14669rm -f core conftest.err conftest.$ac_objext \
14670 conftest$ac_exeext conftest.$ac_ext
14671LIBS=$ac_check_lib_save_LIBS
14672fi
14673{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_des_des_cbc_encrypt" >&5
14674$as_echo "$ac_cv_lib_des_des_cbc_encrypt" >&6; }
14675if test "x$ac_cv_lib_des_des_cbc_encrypt" = x""yes; then :
14676 have_des=yes
14677else
14678 have_des=no
14679fi
14680
14681 if test $have_des = yes; then
14682 DESLIB=-ldes
14683 LIBS="$DESLIB $LIBS"
14684
14685$as_echo "#define HAVE_LIBDES 1" >>confdefs.h
14686
14687 fi
14688 fi
14689 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb_get_cred in -lkrb4" >&5
14690$as_echo_n "checking for krb_get_cred in -lkrb4... " >&6; }
14691if test "${ac_cv_lib_krb4_krb_get_cred+set}" = set; then :
14692 $as_echo_n "(cached) " >&6
14693else
14694 ac_check_lib_save_LIBS=$LIBS
14695LIBS="-lkrb4 $LIBS"
14696cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14697/* end confdefs.h. */
14698
14699/* Override any GCC internal prototype to avoid an error.
14700 Use char because int might match the return type of a GCC
14701 builtin and then its argument prototype would still apply. */
14702#ifdef __cplusplus
14703extern "C"
14704#endif
14705char krb_get_cred ();
14706int
14707main ()
14708{
14709return krb_get_cred ();
14710 ;
14711 return 0;
14712}
14713_ACEOF
14714if ac_fn_c_try_link "$LINENO"; then :
14715 ac_cv_lib_krb4_krb_get_cred=yes
14716else
14717 ac_cv_lib_krb4_krb_get_cred=no
14718fi
14719rm -f core conftest.err conftest.$ac_objext \
14720 conftest$ac_exeext conftest.$ac_ext
14721LIBS=$ac_check_lib_save_LIBS
14722fi
14723{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb4_krb_get_cred" >&5
14724$as_echo "$ac_cv_lib_krb4_krb_get_cred" >&6; }
14725if test "x$ac_cv_lib_krb4_krb_get_cred" = x""yes; then :
14726 have_krb4=yes
14727else
14728 have_krb4=no
14729fi
14730
14731 if test $have_krb4 = yes; then
14732 KRB4LIB=-lkrb4
14733 LIBS="$KRB4LIB $LIBS"
14734
14735$as_echo "#define HAVE_LIBKRB4 1" >>confdefs.h
14736
14737 else
14738 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb_get_cred in -lkrb" >&5
14739$as_echo_n "checking for krb_get_cred in -lkrb... " >&6; }
14740if test "${ac_cv_lib_krb_krb_get_cred+set}" = set; then :
14741 $as_echo_n "(cached) " >&6
14742else
14743 ac_check_lib_save_LIBS=$LIBS
14744LIBS="-lkrb $LIBS"
14745cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14746/* end confdefs.h. */
14747
14748/* Override any GCC internal prototype to avoid an error.
14749 Use char because int might match the return type of a GCC
14750 builtin and then its argument prototype would still apply. */
14751#ifdef __cplusplus
14752extern "C"
14753#endif
14754char krb_get_cred ();
14755int
14756main ()
14757{
14758return krb_get_cred ();
14759 ;
14760 return 0;
14761}
14762_ACEOF
14763if ac_fn_c_try_link "$LINENO"; then :
14764 ac_cv_lib_krb_krb_get_cred=yes
14765else
14766 ac_cv_lib_krb_krb_get_cred=no
14767fi
14768rm -f core conftest.err conftest.$ac_objext \
14769 conftest$ac_exeext conftest.$ac_ext
14770LIBS=$ac_check_lib_save_LIBS
14771fi
14772{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb_krb_get_cred" >&5
14773$as_echo "$ac_cv_lib_krb_krb_get_cred" >&6; }
14774if test "x$ac_cv_lib_krb_krb_get_cred" = x""yes; then :
14775 have_krb=yes
14776else
14777 have_krb=no
14778fi
14779
14780 if test $have_krb = yes; then
14781 KRB4LIB=-lkrb
14782 LIBS="$KRB4LIB $LIBS"
14783
14784$as_echo "#define HAVE_LIBKRB 1" >>confdefs.h
14785
14786 fi
14787 fi
14788 fi
14789
14790 if test "${with_kerberos5}" != no; then
14791 for ac_header in krb5.h
14792do :
14793 ac_fn_c_check_header_mongrel "$LINENO" "krb5.h" "ac_cv_header_krb5_h" "$ac_includes_default"
14794if test "x$ac_cv_header_krb5_h" = x""yes; then :
14795 cat >>confdefs.h <<_ACEOF
14796#define HAVE_KRB5_H 1
14797_ACEOF
14798 ac_fn_c_check_member "$LINENO" "krb5_error" "text" "ac_cv_member_krb5_error_text" "#include <krb5.h>
14799"
14800if test "x$ac_cv_member_krb5_error_text" = x""yes; then :
14801
14802cat >>confdefs.h <<_ACEOF
14803#define HAVE_KRB5_ERROR_TEXT 1
14804_ACEOF
14805
14806
14807fi
14808ac_fn_c_check_member "$LINENO" "krb5_error" "e_text" "ac_cv_member_krb5_error_e_text" "#include <krb5.h>
14809"
14810if test "x$ac_cv_member_krb5_error_e_text" = x""yes; then :
14811
14812cat >>confdefs.h <<_ACEOF
14813#define HAVE_KRB5_ERROR_E_TEXT 1
14814_ACEOF
14815
14816
14817fi
14818
14819fi
14820
14821done
14822
14823 else
14824 for ac_header in des.h
14825do :
14826 ac_fn_c_check_header_mongrel "$LINENO" "des.h" "ac_cv_header_des_h" "$ac_includes_default"
14827if test "x$ac_cv_header_des_h" = x""yes; then :
14828 cat >>confdefs.h <<_ACEOF
14829#define HAVE_DES_H 1
14830_ACEOF
14831
14832else
14833 for ac_header in kerberosIV/des.h
14834do :
14835 ac_fn_c_check_header_mongrel "$LINENO" "kerberosIV/des.h" "ac_cv_header_kerberosIV_des_h" "$ac_includes_default"
14836if test "x$ac_cv_header_kerberosIV_des_h" = x""yes; then :
14837 cat >>confdefs.h <<_ACEOF
14838#define HAVE_KERBEROSIV_DES_H 1
14839_ACEOF
14840
14841else
14842 for ac_header in kerberos/des.h
14843do :
14844 ac_fn_c_check_header_mongrel "$LINENO" "kerberos/des.h" "ac_cv_header_kerberos_des_h" "$ac_includes_default"
14845if test "x$ac_cv_header_kerberos_des_h" = x""yes; then :
14846 cat >>confdefs.h <<_ACEOF
14847#define HAVE_KERBEROS_DES_H 1
14848_ACEOF
14849
14850fi
14851
14852done
14853
14854fi
14855
14856done
14857
14858fi
14859
14860done
14861
14862 for ac_header in krb.h
14863do :
14864 ac_fn_c_check_header_mongrel "$LINENO" "krb.h" "ac_cv_header_krb_h" "$ac_includes_default"
14865if test "x$ac_cv_header_krb_h" = x""yes; then :
14866 cat >>confdefs.h <<_ACEOF
14867#define HAVE_KRB_H 1
14868_ACEOF
14869
14870else
14871 for ac_header in kerberosIV/krb.h
14872do :
14873 ac_fn_c_check_header_mongrel "$LINENO" "kerberosIV/krb.h" "ac_cv_header_kerberosIV_krb_h" "$ac_includes_default"
14874if test "x$ac_cv_header_kerberosIV_krb_h" = x""yes; then :
14875 cat >>confdefs.h <<_ACEOF
14876#define HAVE_KERBEROSIV_KRB_H 1
14877_ACEOF
14878
14879else
14880 for ac_header in kerberos/krb.h
14881do :
14882 ac_fn_c_check_header_mongrel "$LINENO" "kerberos/krb.h" "ac_cv_header_kerberos_krb_h" "$ac_includes_default"
14883if test "x$ac_cv_header_kerberos_krb_h" = x""yes; then :
14884 cat >>confdefs.h <<_ACEOF
14885#define HAVE_KERBEROS_KRB_H 1
14886_ACEOF
14887
14888fi
14889
14890done
14891
14892fi
14893
14894done
14895
14896fi
14897
14898done
14899
14900 fi
14901 for ac_header in com_err.h
14902do :
14903 ac_fn_c_check_header_mongrel "$LINENO" "com_err.h" "ac_cv_header_com_err_h" "$ac_includes_default"
14904if test "x$ac_cv_header_com_err_h" = x""yes; then :
14905 cat >>confdefs.h <<_ACEOF
14906#define HAVE_COM_ERR_H 1
14907_ACEOF
14908
14909fi
14910
14911done
14912
14913fi
14914
14915
14916
14917
14918
14919
14920
14921# Solaris requires -lintl if you want strerror (which calls dgettext)
14922# to return localized messages.
14923{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5
14924$as_echo_n "checking for dgettext in -lintl... " >&6; }
14925if test "${ac_cv_lib_intl_dgettext+set}" = set; then :
14926 $as_echo_n "(cached) " >&6
14927else
14928 ac_check_lib_save_LIBS=$LIBS
14929LIBS="-lintl $LIBS"
14930cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14931/* end confdefs.h. */
14932
14933/* Override any GCC internal prototype to avoid an error.
14934 Use char because int might match the return type of a GCC
14935 builtin and then its argument prototype would still apply. */
14936#ifdef __cplusplus
14937extern "C"
14938#endif
14939char dgettext ();
14940int
14941main ()
14942{
14943return dgettext ();
14944 ;
14945 return 0;
14946}
14947_ACEOF
14948if ac_fn_c_try_link "$LINENO"; then :
14949 ac_cv_lib_intl_dgettext=yes
14950else
14951 ac_cv_lib_intl_dgettext=no
14952fi
14953rm -f core conftest.err conftest.$ac_objext \
14954 conftest$ac_exeext conftest.$ac_ext
14955LIBS=$ac_check_lib_save_LIBS
14956fi
14957{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5
14958$as_echo "$ac_cv_lib_intl_dgettext" >&6; }
14959if test "x$ac_cv_lib_intl_dgettext" = x""yes; then :
14960 cat >>confdefs.h <<_ACEOF
14961#define HAVE_LIBINTL 1
14962_ACEOF
14963
14964 LIBS="-lintl $LIBS"
14965
14966fi
14967
14968
14969{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime caches TZ" >&5
14970$as_echo_n "checking whether localtime caches TZ... " >&6; }
14971if test "${emacs_cv_localtime_cache+set}" = set; then :
14972 $as_echo_n "(cached) " >&6
14973else
14974 if test x$ac_cv_func_tzset = xyes; then
14975if test "$cross_compiling" = yes; then :
14976 # If we have tzset, assume the worst when cross-compiling.
14977emacs_cv_localtime_cache=yes
14978else
14979 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14980/* end confdefs.h. */
14981#include <time.h>
14982char TZ_GMT0[] = "TZ=GMT0";
14983char TZ_PST8[] = "TZ=PST8";
14984main()
14985{
14986 time_t now = time ((time_t *) 0);
14987 int hour_GMT0, hour_unset;
14988 if (putenv (TZ_GMT0) != 0)
14989 exit (1);
14990 hour_GMT0 = localtime (&now)->tm_hour;
14991 unsetenv("TZ");
14992 hour_unset = localtime (&now)->tm_hour;
14993 if (putenv (TZ_PST8) != 0)
14994 exit (1);
14995 if (localtime (&now)->tm_hour == hour_GMT0)
14996 exit (1);
14997 unsetenv("TZ");
14998 if (localtime (&now)->tm_hour != hour_unset)
14999 exit (1);
15000 exit (0);
15001}
15002_ACEOF
15003if ac_fn_c_try_run "$LINENO"; then :
15004 emacs_cv_localtime_cache=no
15005else
15006 emacs_cv_localtime_cache=yes
15007fi
15008rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15009 conftest.$ac_objext conftest.beam conftest.$ac_ext
15010fi
15011
15012else
15013 # If we lack tzset, report that localtime does not cache TZ,
15014 # since we can't invalidate the cache if we don't have tzset.
15015 emacs_cv_localtime_cache=no
15016fi
15017fi
15018{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_localtime_cache" >&5
15019$as_echo "$emacs_cv_localtime_cache" >&6; }
15020if test $emacs_cv_localtime_cache = yes; then
15021
15022$as_echo "#define LOCALTIME_CACHE 1" >>confdefs.h
15023
15024fi
15025
15026if test "x$HAVE_TIMEVAL" = xyes; then
15027 for ac_func in gettimeofday
15028do :
15029 ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday"
15030if test "x$ac_cv_func_gettimeofday" = x""yes; then :
15031 cat >>confdefs.h <<_ACEOF
15032#define HAVE_GETTIMEOFDAY 1
15033_ACEOF
15034
15035fi
15036done
15037
15038 if test $ac_cv_func_gettimeofday = yes; then
15039 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday can accept two arguments" >&5
15040$as_echo_n "checking whether gettimeofday can accept two arguments... " >&6; }
15041if test "${emacs_cv_gettimeofday_two_arguments+set}" = set; then :
15042 $as_echo_n "(cached) " >&6
15043else
15044 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15045/* end confdefs.h. */
15046
15047#ifdef TIME_WITH_SYS_TIME
15048#include <sys/time.h>
15049#include <time.h>
15050#else
15051#ifdef HAVE_SYS_TIME_H
15052#include <sys/time.h>
15053#else
15054#include <time.h>
15055#endif
15056#endif
15057int
15058main ()
15059{
15060struct timeval time;
15061 gettimeofday (&time, 0);
15062 ;
15063 return 0;
15064}
15065_ACEOF
15066if ac_fn_c_try_compile "$LINENO"; then :
15067 emacs_cv_gettimeofday_two_arguments=yes
15068else
15069 emacs_cv_gettimeofday_two_arguments=no
15070fi
15071rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15072fi
15073{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_gettimeofday_two_arguments" >&5
15074$as_echo "$emacs_cv_gettimeofday_two_arguments" >&6; }
15075 if test $emacs_cv_gettimeofday_two_arguments = no; then
15076
15077$as_echo "#define GETTIMEOFDAY_ONE_ARGUMENT 1" >>confdefs.h
15078
15079 fi
15080 fi
15081fi
15082
15083ok_so_far=yes
15084ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket"
15085if test "x$ac_cv_func_socket" = x""yes; then :
15086
15087else
15088 ok_so_far=no
15089fi
15090
15091if test $ok_so_far = yes; then
15092 ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
15093if test "x$ac_cv_header_netinet_in_h" = x""yes; then :
15094
15095else
15096 ok_so_far=no
15097fi
15098
15099
15100fi
15101if test $ok_so_far = yes; then
15102 ac_fn_c_check_header_mongrel "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default"
15103if test "x$ac_cv_header_arpa_inet_h" = x""yes; then :
15104
15105else
15106 ok_so_far=no
15107fi
15108
15109
15110fi
15111if test $ok_so_far = yes; then
15112
15113$as_echo "#define HAVE_INET_SOCKETS 1" >>confdefs.h
15114
15115fi
15116
15117if test -f /usr/lpp/X11/bin/smt.exp; then
15118
15119$as_echo "#define HAVE_AIX_SMT_EXP 1" >>confdefs.h
15120
15121fi
15122
15123{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system supports dynamic ptys" >&5
15124$as_echo_n "checking whether system supports dynamic ptys... " >&6; }
15125if test -d /dev/pts && ls -d /dev/ptmx > /dev/null 2>&1 ; then
15126 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15127$as_echo "yes" >&6; }
15128
15129$as_echo "#define HAVE_DEV_PTMX 1" >>confdefs.h
15130
15131else
15132 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15133$as_echo "no" >&6; }
15134fi
15135
15136ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
15137if test "x$ac_cv_type_pid_t" = x""yes; then :
15138
15139else
15140
15141cat >>confdefs.h <<_ACEOF
15142#define pid_t int
15143_ACEOF
15144
15145fi
15146
15147for ac_header in vfork.h
15148do :
15149 ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
15150if test "x$ac_cv_header_vfork_h" = x""yes; then :
15151 cat >>confdefs.h <<_ACEOF
15152#define HAVE_VFORK_H 1
15153_ACEOF
15154
15155fi
15156
15157done
15158
15159for ac_func in fork vfork
15160do :
15161 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
15162ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
15163eval as_val=\$$as_ac_var
15164 if test "x$as_val" = x""yes; then :
15165 cat >>confdefs.h <<_ACEOF
15166#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
15167_ACEOF
15168
15169fi
15170done
15171
15172if test "x$ac_cv_func_fork" = xyes; then
15173 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
15174$as_echo_n "checking for working fork... " >&6; }
15175if test "${ac_cv_func_fork_works+set}" = set; then :
15176 $as_echo_n "(cached) " >&6
15177else
15178 if test "$cross_compiling" = yes; then :
15179 ac_cv_func_fork_works=cross
15180else
15181 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15182/* end confdefs.h. */
15183$ac_includes_default
15184int
15185main ()
15186{
15187
15188 /* By Ruediger Kuhlmann. */
15189 return fork () < 0;
15190
15191 ;
15192 return 0;
15193}
15194_ACEOF
15195if ac_fn_c_try_run "$LINENO"; then :
15196 ac_cv_func_fork_works=yes
15197else
15198 ac_cv_func_fork_works=no
15199fi
15200rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15201 conftest.$ac_objext conftest.beam conftest.$ac_ext
15202fi
15203
15204fi
15205{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5
15206$as_echo "$ac_cv_func_fork_works" >&6; }
15207
15208else
15209 ac_cv_func_fork_works=$ac_cv_func_fork
15210fi
15211if test "x$ac_cv_func_fork_works" = xcross; then
15212 case $host in
15213 *-*-amigaos* | *-*-msdosdjgpp*)
15214 # Override, as these systems have only a dummy fork() stub
15215 ac_cv_func_fork_works=no
15216 ;;
15217 *)
15218 ac_cv_func_fork_works=yes
15219 ;;
15220 esac
15221 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
15222$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
15223fi
15224ac_cv_func_vfork_works=$ac_cv_func_vfork
15225if test "x$ac_cv_func_vfork" = xyes; then
15226 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
15227$as_echo_n "checking for working vfork... " >&6; }
15228if test "${ac_cv_func_vfork_works+set}" = set; then :
15229 $as_echo_n "(cached) " >&6
15230else
15231 if test "$cross_compiling" = yes; then :
15232 ac_cv_func_vfork_works=cross
15233else
15234 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15235/* end confdefs.h. */
15236/* Thanks to Paul Eggert for this test. */
15237$ac_includes_default
15238#include <sys/wait.h>
15239#ifdef HAVE_VFORK_H
15240# include <vfork.h>
15241#endif
15242/* On some sparc systems, changes by the child to local and incoming
15243 argument registers are propagated back to the parent. The compiler
15244 is told about this with #include <vfork.h>, but some compilers
15245 (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a
15246 static variable whose address is put into a register that is
15247 clobbered by the vfork. */
15248static void
15249#ifdef __cplusplus
15250sparc_address_test (int arg)
15251# else
15252sparc_address_test (arg) int arg;
15253#endif
15254{
15255 static pid_t child;
15256 if (!child) {
15257 child = vfork ();
15258 if (child < 0) {
15259 perror ("vfork");
15260 _exit(2);
15261 }
15262 if (!child) {
15263 arg = getpid();
15264 write(-1, "", 0);
15265 _exit (arg);
15266 }
15267 }
15268}
15269
15270int
15271main ()
15272{
15273 pid_t parent = getpid ();
15274 pid_t child;
15275
15276 sparc_address_test (0);
15277
15278 child = vfork ();
15279
15280 if (child == 0) {
15281 /* Here is another test for sparc vfork register problems. This
15282 test uses lots of local variables, at least as many local
15283 variables as main has allocated so far including compiler
15284 temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris
15285 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should
15286 reuse the register of parent for one of the local variables,
15287 since it will think that parent can't possibly be used any more
15288 in this routine. Assigning to the local variable will thus
15289 munge parent in the parent process. */
15290 pid_t
15291 p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
15292 p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
15293 /* Convince the compiler that p..p7 are live; otherwise, it might
15294 use the same hardware register for all 8 local variables. */
15295 if (p != p1 || p != p2 || p != p3 || p != p4
15296 || p != p5 || p != p6 || p != p7)
15297 _exit(1);
15298
15299 /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
15300 from child file descriptors. If the child closes a descriptor
15301 before it execs or exits, this munges the parent's descriptor
15302 as well. Test for this by closing stdout in the child. */
15303 _exit(close(fileno(stdout)) != 0);
15304 } else {
15305 int status;
15306 struct stat st;
15307
15308 while (wait(&status) != child)
15309 ;
15310 return (
15311 /* Was there some problem with vforking? */
15312 child < 0
15313
15314 /* Did the child fail? (This shouldn't happen.) */
15315 || status
15316
15317 /* Did the vfork/compiler bug occur? */
15318 || parent != getpid()
15319
15320 /* Did the file descriptor bug occur? */
15321 || fstat(fileno(stdout), &st) != 0
15322 );
15323 }
15324}
15325_ACEOF
15326if ac_fn_c_try_run "$LINENO"; then :
15327 ac_cv_func_vfork_works=yes
15328else
15329 ac_cv_func_vfork_works=no
15330fi
15331rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15332 conftest.$ac_objext conftest.beam conftest.$ac_ext
15333fi
15334
15335fi
15336{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5
15337$as_echo "$ac_cv_func_vfork_works" >&6; }
15338
15339fi;
15340if test "x$ac_cv_func_fork_works" = xcross; then
15341 ac_cv_func_vfork_works=$ac_cv_func_vfork
15342 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
15343$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
15344fi
15345
15346if test "x$ac_cv_func_vfork_works" = xyes; then
15347
15348$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h
15349
15350else
15351
15352$as_echo "#define vfork fork" >>confdefs.h
15353
15354fi
15355if test "x$ac_cv_func_fork_works" = xyes; then
15356
15357$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
15358
15359fi
15360
15361
15362{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
15363$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
15364if test "${emacs_cv_langinfo_codeset+set}" = set; then :
15365 $as_echo_n "(cached) " >&6
15366else
15367 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15368/* end confdefs.h. */
15369#include <langinfo.h>
15370int
15371main ()
15372{
15373char* cs = nl_langinfo(CODESET);
15374 ;
15375 return 0;
15376}
15377_ACEOF
15378if ac_fn_c_try_link "$LINENO"; then :
15379 emacs_cv_langinfo_codeset=yes
15380else
15381 emacs_cv_langinfo_codeset=no
15382fi
15383rm -f core conftest.err conftest.$ac_objext \
15384 conftest$ac_exeext conftest.$ac_ext
15385
15386fi
15387{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_langinfo_codeset" >&5
15388$as_echo "$emacs_cv_langinfo_codeset" >&6; }
15389if test $emacs_cv_langinfo_codeset = yes; then
15390
15391$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
15392
15393fi
15394
15395{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
15396$as_echo_n "checking for mbstate_t... " >&6; }
15397if test "${ac_cv_type_mbstate_t+set}" = set; then :
15398 $as_echo_n "(cached) " >&6
15399else
15400 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15401/* end confdefs.h. */
15402$ac_includes_default
15403# include <wchar.h>
15404int
15405main ()
15406{
15407mbstate_t x; return sizeof x;
15408 ;
15409 return 0;
15410}
15411_ACEOF
15412if ac_fn_c_try_compile "$LINENO"; then :
15413 ac_cv_type_mbstate_t=yes
15414else
15415 ac_cv_type_mbstate_t=no
15416fi
15417rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15418fi
15419{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5
15420$as_echo "$ac_cv_type_mbstate_t" >&6; }
15421 if test $ac_cv_type_mbstate_t = yes; then
15422
15423$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h
15424
15425 else
15426
15427$as_echo "#define mbstate_t int" >>confdefs.h
15428
15429 fi
15430
15431{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C restricted array declarations" >&5
15432$as_echo_n "checking for C restricted array declarations... " >&6; }
15433if test "${emacs_cv_c_restrict_arr+set}" = set; then :
15434 $as_echo_n "(cached) " >&6
15435else
15436 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15437/* end confdefs.h. */
15438void fred (int x[__restrict]);
15439int
15440main ()
15441{
15442
15443 ;
15444 return 0;
15445}
15446_ACEOF
15447if ac_fn_c_try_compile "$LINENO"; then :
15448 emacs_cv_c_restrict_arr=yes
15449else
15450 emacs_cv_c_restrict_arr=no
15451fi
15452rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15453fi
15454{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_c_restrict_arr" >&5
15455$as_echo "$emacs_cv_c_restrict_arr" >&6; }
15456if test "$emacs_cv_c_restrict_arr" = yes; then
15457
15458$as_echo "#define __restrict_arr __restrict" >>confdefs.h
15459
15460fi
15461
15462
15463
15464# Set up the CFLAGS for real compilation, so we can substitute it.
15465CFLAGS="$REAL_CFLAGS"
15466CPPFLAGS="$REAL_CPPFLAGS"
15467
15468## Hack to detect a buggy GCC version.
15469if test "x$GCC" = xyes \
15470 && test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \
15471 && test x"`echo $CFLAGS | grep '\-O[23]'`" != x \
15472 && test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then
15473 as_fn_error "GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." "$LINENO" 5
15474fi
15475
15476version=$PACKAGE_VERSION
15477
15478### Specify what sort of things we'll be editing into Makefile and config.h.
15479### Use configuration here uncanonicalized to avoid exceeding size limits.
15480
15481
15482## Unused?
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503## FIXME? Nothing uses @LD_SWITCH_X_SITE@.
15504## src/Makefile.in did add LD_SWITCH_X_SITE (as a cpp define) to the
15505## end of LIBX_BASE, but nothing ever set it.
15506
15507
15508
15509
15510## Used in lwlib/Makefile.in.
15511
15512if test -n "${machfile}"; then
15513 M_FILE="\$(srcdir)/${machfile}"
15514else
15515 M_FILE=
15516fi
15517S_FILE="\$(srcdir)/${opsysfile}"
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528cat >>confdefs.h <<_ACEOF
15529#define EMACS_CONFIGURATION "${canonical}"
15530_ACEOF
15531
15532
15533cat >>confdefs.h <<_ACEOF
15534#define EMACS_CONFIG_OPTIONS "${ac_configure_args}"
15535_ACEOF
15536
15537if test -n "$machfile"; then
15538
15539cat >>confdefs.h <<_ACEOF
15540#define config_machfile "${machfile}"
15541_ACEOF
15542
15543fi
15544
15545cat >>confdefs.h <<_ACEOF
15546#define config_opsysfile "${opsysfile}"
15547_ACEOF
15548
15549
15550XMENU_OBJ=
15551XOBJ=
15552FONT_OBJ=
15553if test "${HAVE_X_WINDOWS}" = "yes" ; then
15554
15555$as_echo "#define HAVE_X_WINDOWS 1" >>confdefs.h
15556
15557 XMENU_OBJ=xmenu.o
15558 XOBJ="xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o xsettings.o xgselect.o"
15559 FONT_OBJ=xfont.o
15560 if test "$HAVE_XFT" = "yes"; then
15561 FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
15562 elif test "$HAVE_FREETYPE" = "yes"; then
15563 FONT_OBJ="$FONT_OBJ ftfont.o ftxfont.o"
15564 fi
15565
15566fi
15567
15568
15569
15570
15571WIDGET_OBJ=
15572MOTIF_LIBW=
15573if test "${USE_X_TOOLKIT}" != "none" ; then
15574 WIDGET_OBJ=widget.o
15575
15576$as_echo "#define USE_X_TOOLKIT 1" >>confdefs.h
15577
15578 if test "${USE_X_TOOLKIT}" = "LUCID"; then
15579
15580$as_echo "#define USE_LUCID 1" >>confdefs.h
15581
15582 elif test "${USE_X_TOOLKIT}" = "MOTIF"; then
15583
15584$as_echo "#define USE_MOTIF 1" >>confdefs.h
15585
15586 MOTIF_LIBW=-lXm
15587 case "$opsys" in
15588 gnu-linux)
15589 ## Paul Abrahams <abrahams at equinox.shaysnet.com> says this is needed.
15590 MOTIF_LIBW="$MOTIF_LIBW -lXpm"
15591 ;;
15592
15593 unixware)
15594 ## Richard Anthony Ryan <ryanr at ellingtn.ftc.nrcs.usda.gov>
15595 ## says -lXimp is needed in UNIX_SV ... 4.2 1.1.2.
15596 MOTIF_LIBW="MOTIF_LIBW -lXimp"
15597 ;;
15598
15599 aix4-2)
15600 ## olson@mcs.anl.gov says -li18n is needed by -lXm.
15601 MOTIF_LIBW="$MOTIF_LIBW -li18n"
15602 ;;
15603 esac
15604 MOTIF_LIBW="$MOTIF_LIBW $LIBXP"
15605 fi
15606fi
15607
15608
15609TOOLKIT_LIBW=
15610case "$USE_X_TOOLKIT" in
15611 MOTIF) TOOLKIT_LIBW="$MOTIF_LIBW" ;;
15612 LUCID) TOOLKIT_LIBW="$LUCID_LIBW" ;;
15613 none) test "x$HAVE_GTK" = "xyes" && TOOLKIT_LIBW="$GTK_LIBS" ;;
15614esac
15615
15616
15617if test "$USE_X_TOOLKIT" = "none"; then
15618 LIBXT_OTHER="\$(LIBXSM)"
15619 OLDXMENU_TARGET="really-oldXMenu"
15620else
15621 LIBXT_OTHER="\$(LIBXMU) -lXt \$(LIBXTR6) -lXext"
15622 OLDXMENU_TARGET="really-lwlib"
15623fi
15624
15625
15626## The X Menu stuff is present in the X10 distribution, but missing
15627## from X11. If we have X10, just use the installed library;
15628## otherwise, use our own copy.
15629if test "${HAVE_X11}" = "yes" ; then
15630
15631$as_echo "#define HAVE_X11 1" >>confdefs.h
15632
15633
15634 if test "$USE_X_TOOLKIT" = "none"; then
15635 OLDXMENU="\${oldXMenudir}/libXMenu11.a"
15636 else
15637 OLDXMENU="\${lwlibdir}/liblw.a"
15638 fi
15639 LIBXMENU="\$(OLDXMENU)"
15640 LIBX_OTHER="\$(LIBXT) \$(LIBX_EXTRA)"
15641 OLDXMENU_DEPS="\${OLDXMENU} ../src/\${OLDXMENU}"
15642else
15643 ## For a syntactically valid Makefile; not actually used for anything.
15644 ## See comments in src/Makefile.in.
15645 OLDXMENU=nothing
15646 ## FIXME This case (!HAVE_X11 && HAVE_X_WINDOWS) is no longer possible(?).
15647 if test "${HAVE_X_WINDOWS}" = "yes"; then
15648 LIBXMENU="-lXMenu"
15649 else
15650 LIBXMENU=
15651 fi
15652 LIBX_OTHER=
15653 OLDXMENU_DEPS=
15654fi
15655
15656if test "$HAVE_GTK" = "yes" || test "$HAVE_MENUS" != "yes"; then
15657 OLDXMENU_TARGET=
15658 OLDXMENU=nothing
15659 LIBXMENU=
15660 OLDXMENU_DEPS=
15661fi
15662
15663
15664
15665
15666
15667
15668
15669if test "${HAVE_MENUS}" = "yes" ; then
15670
15671$as_echo "#define HAVE_MENUS 1" >>confdefs.h
15672
15673fi
15674
15675if test "${GNU_MALLOC}" = "yes" ; then
15676
15677$as_echo "#define GNU_MALLOC 1" >>confdefs.h
15678
15679fi
15680
15681RALLOC_OBJ=
15682if test "${REL_ALLOC}" = "yes" ; then
15683
15684$as_echo "#define REL_ALLOC 1" >>confdefs.h
15685
15686
15687 test "$system_malloc" != "yes" && RALLOC_OBJ=ralloc.o
15688fi
15689
15690
15691if test "$opsys" = "cygwin"; then
15692 CYGWIN_OBJ="sheap.o"
15693 ## Cygwin differs because of its unexec().
15694 PRE_ALLOC_OBJ=
15695 POST_ALLOC_OBJ=lastfile.o
15696else
15697 CYGWIN_OBJ=
15698 PRE_ALLOC_OBJ=lastfile.o
15699 POST_ALLOC_OBJ=
15700fi
15701
15702
15703
15704
15705# Configure gnulib here, now that we know LIBS.
13919 15706
13920 15707
13921 15708
@@ -16308,6 +18095,48 @@ _ACEOF
16308 18095
16309 18096
16310 18097
18098 GNULIB_PTHREAD_SIGMASK=0;
18099 GNULIB_SIGNAL_H_SIGPIPE=0;
18100 GNULIB_SIGPROCMASK=0;
18101 GNULIB_SIGACTION=0;
18102 HAVE_POSIX_SIGNALBLOCKING=1;
18103 HAVE_PTHREAD_SIGMASK=1;
18104 HAVE_SIGSET_T=1;
18105 HAVE_SIGINFO_T=1;
18106 HAVE_SIGACTION=1;
18107 HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
18108
18109 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
18110
18111 HAVE_SIGHANDLER_T=1;
18112 REPLACE_PTHREAD_SIGMASK=0;
18113
18114
18115
18116
18117 ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "
18118 #include <signal.h>
18119 /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
18120 #include <sys/types.h>
18121
18122"
18123if test "x$ac_cv_type_sigset_t" = x""yes; then :
18124
18125cat >>confdefs.h <<_ACEOF
18126#define HAVE_SIGSET_T 1
18127_ACEOF
18128
18129gl_cv_type_sigset_t=yes
18130else
18131 gl_cv_type_sigset_t=no
18132fi
18133
18134 if test $gl_cv_type_sigset_t != yes; then
18135 HAVE_SIGSET_T=0
18136 fi
18137
18138
18139
16311 18140
16312 18141
16313 if test $ac_cv_header_sys_socket_h = no; then 18142 if test $ac_cv_header_sys_socket_h = no; then
@@ -16560,6 +18389,17 @@ fi
16560 18389
16561 18390
16562 18391
18392ac_fn_c_check_decl "$LINENO" "strtoimax" "ac_cv_have_decl_strtoimax" "$ac_includes_default"
18393if test "x$ac_cv_have_decl_strtoimax" = x""yes; then :
18394 ac_have_decl=1
18395else
18396 ac_have_decl=0
18397fi
18398
18399cat >>confdefs.h <<_ACEOF
18400#define HAVE_DECL_STRTOIMAX $ac_have_decl
18401_ACEOF
18402
16563ac_fn_c_check_decl "$LINENO" "strtoumax" "ac_cv_have_decl_strtoumax" "$ac_includes_default" 18403ac_fn_c_check_decl "$LINENO" "strtoumax" "ac_cv_have_decl_strtoumax" "$ac_includes_default"
16564if test "x$ac_cv_have_decl_strtoumax" = x""yes; then : 18404if test "x$ac_cv_have_decl_strtoumax" = x""yes; then :
16565 ac_have_decl=1 18405 ac_have_decl=1
@@ -17963,6 +19803,99 @@ fi
17963 19803
17964 19804
17965 19805
19806 LIB_PTHREAD_SIGMASK=
19807 if test $ac_cv_func_pthread_sigmask != yes; then
19808 gl_save_LIBS=$LIBS
19809 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_sigmask" >&5
19810$as_echo_n "checking for library containing pthread_sigmask... " >&6; }
19811if test "${ac_cv_search_pthread_sigmask+set}" = set; then :
19812 $as_echo_n "(cached) " >&6
19813else
19814 ac_func_search_save_LIBS=$LIBS
19815cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19816/* end confdefs.h. */
19817
19818/* Override any GCC internal prototype to avoid an error.
19819 Use char because int might match the return type of a GCC
19820 builtin and then its argument prototype would still apply. */
19821#ifdef __cplusplus
19822extern "C"
19823#endif
19824char pthread_sigmask ();
19825int
19826main ()
19827{
19828return pthread_sigmask ();
19829 ;
19830 return 0;
19831}
19832_ACEOF
19833for ac_lib in '' pthread c_r; do
19834 if test -z "$ac_lib"; then
19835 ac_res="none required"
19836 else
19837 ac_res=-l$ac_lib
19838 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
19839 fi
19840 if ac_fn_c_try_link "$LINENO"; then :
19841 ac_cv_search_pthread_sigmask=$ac_res
19842fi
19843rm -f core conftest.err conftest.$ac_objext \
19844 conftest$ac_exeext
19845 if test "${ac_cv_search_pthread_sigmask+set}" = set; then :
19846 break
19847fi
19848done
19849if test "${ac_cv_search_pthread_sigmask+set}" = set; then :
19850
19851else
19852 ac_cv_search_pthread_sigmask=no
19853fi
19854rm conftest.$ac_ext
19855LIBS=$ac_func_search_save_LIBS
19856fi
19857{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_sigmask" >&5
19858$as_echo "$ac_cv_search_pthread_sigmask" >&6; }
19859ac_res=$ac_cv_search_pthread_sigmask
19860if test "$ac_res" != no; then :
19861 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
19862
19863fi
19864
19865 LIBS=$gl_save_LIBS
19866 if test "$ac_cv_search_pthread_sigmask" = no; then
19867 HAVE_PTHREAD_SIGMASK=0
19868 elif test "$ac_cv_search_pthread_sigmask" != 'none required'; then
19869 LIB_PTHREAD_SIGMASK=$ac_cv_search_pthread_sigmask
19870 fi
19871 fi
19872
19873
19874if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then
19875
19876
19877
19878
19879
19880
19881
19882
19883 gl_LIBOBJS="$gl_LIBOBJS pthread_sigmask.$ac_objext"
19884
19885fi
19886
19887
19888
19889
19890
19891 GNULIB_PTHREAD_SIGMASK=1
19892
19893
19894
19895
19896
19897
19898
17966 19899
17967 if test $ac_cv_func_readlink = no; then 19900 if test $ac_cv_func_readlink = no; then
17968 HAVE_READLINK=0 19901 HAVE_READLINK=0
@@ -18067,6 +20000,92 @@ fi
18067 20000
18068 20001
18069 20002
20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014 if test $gl_cv_have_include_next = yes; then
20015 gl_cv_next_signal_h='<'signal.h'>'
20016 else
20017 { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5
20018$as_echo_n "checking absolute name of <signal.h>... " >&6; }
20019if test "${gl_cv_next_signal_h+set}" = set; then :
20020 $as_echo_n "(cached) " >&6
20021else
20022
20023 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20024/* end confdefs.h. */
20025#include <signal.h>
20026
20027_ACEOF
20028 case "$host_os" in
20029 aix*) gl_absname_cpp="$ac_cpp -C" ;;
20030 *) gl_absname_cpp="$ac_cpp" ;;
20031 esac
20032 gl_cv_next_signal_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
20033 sed -n '\#/signal.h#{
20034 s#.*"\(.*/signal.h\)".*#\1#
20035 s#^/[^/]#//&#
20036 p
20037 q
20038 }'`'"'
20039
20040
20041fi
20042{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5
20043$as_echo "$gl_cv_next_signal_h" >&6; }
20044 fi
20045 NEXT_SIGNAL_H=$gl_cv_next_signal_h
20046
20047 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
20048 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
20049 gl_next_as_first_directive='<'signal.h'>'
20050 else
20051 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
20052 gl_next_as_first_directive=$gl_cv_next_signal_h
20053 fi
20054 NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive
20055
20056
20057
20058
20059
20060# AIX declares sig_atomic_t to already include volatile, and C89 compilers
20061# then choke on 'volatile sig_atomic_t'. C99 requires that it compile.
20062 ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" "
20063#include <signal.h>
20064
20065"
20066if test "x$ac_cv_type_volatile_sig_atomic_t" = x""yes; then :
20067
20068else
20069 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0
20070fi
20071
20072
20073
20074
20075
20076 ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" "
20077#include <signal.h>
20078
20079"
20080if test "x$ac_cv_type_sighandler_t" = x""yes; then :
20081
20082else
20083 HAVE_SIGHANDLER_T=0
20084fi
20085
20086
20087
20088
18070 ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " 20089 ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
18071/* <sys/types.h> is not needed according to POSIX, but the 20090/* <sys/types.h> is not needed according to POSIX, but the
18072 <sys/socket.h> in i386-unknown-freebsd4.10 and 20091 <sys/socket.h> in i386-unknown-freebsd4.10 and
@@ -18618,6 +20637,62 @@ $as_echo "#define my_strftime nstrftime" >>confdefs.h
18618 20637
18619 20638
18620 20639
20640 if test "$ac_cv_have_decl_strtoimax" != yes; then
20641 HAVE_DECL_STRTOIMAX=0
20642
20643 for ac_func in strtoimax
20644do :
20645 ac_fn_c_check_func "$LINENO" "strtoimax" "ac_cv_func_strtoimax"
20646if test "x$ac_cv_func_strtoimax" = x""yes; then :
20647 cat >>confdefs.h <<_ACEOF
20648#define HAVE_STRTOIMAX 1
20649_ACEOF
20650
20651fi
20652done
20653
20654 fi
20655
20656if test "$ac_cv_have_decl_strtoimax" != yes && test $ac_cv_func_strtoimax = no; then
20657
20658
20659
20660
20661
20662
20663
20664
20665 gl_LIBOBJS="$gl_LIBOBJS strtoimax.$ac_objext"
20666
20667
20668 ac_fn_c_check_decl "$LINENO" "strtoll" "ac_cv_have_decl_strtoll" "$ac_includes_default"
20669if test "x$ac_cv_have_decl_strtoll" = x""yes; then :
20670 ac_have_decl=1
20671else
20672 ac_have_decl=0
20673fi
20674
20675cat >>confdefs.h <<_ACEOF
20676#define HAVE_DECL_STRTOLL $ac_have_decl
20677_ACEOF
20678
20679
20680
20681fi
20682
20683
20684
20685
20686
20687 GNULIB_STRTOIMAX=1
20688
20689
20690
20691
20692
20693
20694
20695
18621 if test "$ac_cv_have_decl_strtoumax" != yes; then 20696 if test "$ac_cv_have_decl_strtoumax" != yes; then
18622 HAVE_DECL_STRTOUMAX=0 20697 HAVE_DECL_STRTOUMAX=0
18623 20698
@@ -18990,7 +21065,9 @@ $as_echo "$gl_cv_next_unistd_h" >&6; }
18990 21065
18991 gl_gnulib_enabled_dosname=false 21066 gl_gnulib_enabled_dosname=false
18992 gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false 21067 gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false
21068 gl_gnulib_enabled_sigprocmask=false
18993 gl_gnulib_enabled_stat=false 21069 gl_gnulib_enabled_stat=false
21070 gl_gnulib_enabled_strtoll=false
18994 gl_gnulib_enabled_strtoull=false 21071 gl_gnulib_enabled_strtoull=false
18995 gl_gnulib_enabled_verify=false 21072 gl_gnulib_enabled_verify=false
18996 func_gl_gnulib_m4code_dosname () 21073 func_gl_gnulib_m4code_dosname ()
@@ -19007,6 +21084,50 @@ $as_echo "$gl_cv_next_unistd_h" >&6; }
19007 gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true 21084 gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true
19008 fi 21085 fi
19009 } 21086 }
21087 func_gl_gnulib_m4code_sigprocmask ()
21088 {
21089 if ! $gl_gnulib_enabled_sigprocmask; then
21090
21091
21092
21093 if test $gl_cv_type_sigset_t = yes; then
21094 ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask"
21095if test "x$ac_cv_func_sigprocmask" = x""yes; then :
21096 gl_cv_func_sigprocmask=1
21097fi
21098
21099 fi
21100 if test -z "$gl_cv_func_sigprocmask"; then
21101 HAVE_POSIX_SIGNALBLOCKING=0
21102 fi
21103
21104if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
21105
21106
21107
21108
21109
21110
21111
21112
21113 gl_LIBOBJS="$gl_LIBOBJS sigprocmask.$ac_objext"
21114
21115 :
21116fi
21117
21118
21119
21120
21121
21122 GNULIB_SIGPROCMASK=1
21123
21124
21125
21126
21127
21128 gl_gnulib_enabled_sigprocmask=true
21129 fi
21130 }
19010 func_gl_gnulib_m4code_stat () 21131 func_gl_gnulib_m4code_stat ()
19011 { 21132 {
19012 if ! $gl_gnulib_enabled_stat; then 21133 if ! $gl_gnulib_enabled_stat; then
@@ -19144,6 +21265,58 @@ fi
19144 fi 21265 fi
19145 fi 21266 fi
19146 } 21267 }
21268 func_gl_gnulib_m4code_strtoll ()
21269 {
21270 if ! $gl_gnulib_enabled_strtoll; then
21271
21272
21273
21274 if test "$ac_cv_type_long_long_int" = yes; then
21275 for ac_func in strtoll
21276do :
21277 ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll"
21278if test "x$ac_cv_func_strtoll" = x""yes; then :
21279 cat >>confdefs.h <<_ACEOF
21280#define HAVE_STRTOLL 1
21281_ACEOF
21282
21283fi
21284done
21285
21286 if test $ac_cv_func_strtoll = no; then
21287 HAVE_STRTOLL=0
21288 fi
21289 fi
21290
21291if test $HAVE_STRTOLL = 0; then
21292
21293
21294
21295
21296
21297
21298
21299
21300 gl_LIBOBJS="$gl_LIBOBJS strtoll.$ac_objext"
21301
21302
21303 :
21304
21305fi
21306
21307
21308
21309
21310
21311 GNULIB_STRTOLL=1
21312
21313
21314
21315
21316
21317 gl_gnulib_enabled_strtoll=true
21318 fi
21319 }
19147 func_gl_gnulib_m4code_strtoull () 21320 func_gl_gnulib_m4code_strtoull ()
19148 { 21321 {
19149 if ! $gl_gnulib_enabled_strtoull; then 21322 if ! $gl_gnulib_enabled_strtoull; then
@@ -19211,9 +21384,18 @@ fi
19211 if test $REPLACE_LSTAT = 1; then 21384 if test $REPLACE_LSTAT = 1; then
19212 func_gl_gnulib_m4code_stat 21385 func_gl_gnulib_m4code_stat
19213 fi 21386 fi
21387 if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then
21388 func_gl_gnulib_m4code_sigprocmask
21389 fi
19214 if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then 21390 if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
19215 func_gl_gnulib_m4code_stat 21391 func_gl_gnulib_m4code_stat
19216 fi 21392 fi
21393 if test "$ac_cv_have_decl_strtoimax" != yes && test $ac_cv_func_strtoimax = no; then
21394 func_gl_gnulib_m4code_verify
21395 fi
21396 if test "$ac_cv_have_decl_strtoimax" != yes && test $ac_cv_func_strtoimax = no && test $ac_cv_type_long_long_int = yes; then
21397 func_gl_gnulib_m4code_strtoll
21398 fi
19217 if test "$ac_cv_have_decl_strtoumax" != yes && test $ac_cv_func_strtoumax = no; then 21399 if test "$ac_cv_have_decl_strtoumax" != yes && test $ac_cv_func_strtoumax = no; then
19218 func_gl_gnulib_m4code_verify 21400 func_gl_gnulib_m4code_verify
19219 fi 21401 fi
@@ -19237,6 +21419,14 @@ else
19237 gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_FALSE= 21419 gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_FALSE=
19238fi 21420fi
19239 21421
21422 if $gl_gnulib_enabled_sigprocmask; then
21423 gl_GNULIB_ENABLED_sigprocmask_TRUE=
21424 gl_GNULIB_ENABLED_sigprocmask_FALSE='#'
21425else
21426 gl_GNULIB_ENABLED_sigprocmask_TRUE='#'
21427 gl_GNULIB_ENABLED_sigprocmask_FALSE=
21428fi
21429
19240 if $gl_gnulib_enabled_stat; then 21430 if $gl_gnulib_enabled_stat; then
19241 gl_GNULIB_ENABLED_stat_TRUE= 21431 gl_GNULIB_ENABLED_stat_TRUE=
19242 gl_GNULIB_ENABLED_stat_FALSE='#' 21432 gl_GNULIB_ENABLED_stat_FALSE='#'
@@ -19245,6 +21435,14 @@ else
19245 gl_GNULIB_ENABLED_stat_FALSE= 21435 gl_GNULIB_ENABLED_stat_FALSE=
19246fi 21436fi
19247 21437
21438 if $gl_gnulib_enabled_strtoll; then
21439 gl_GNULIB_ENABLED_strtoll_TRUE=
21440 gl_GNULIB_ENABLED_strtoll_FALSE='#'
21441else
21442 gl_GNULIB_ENABLED_strtoll_TRUE='#'
21443 gl_GNULIB_ENABLED_strtoll_FALSE=
21444fi
21445
19248 if $gl_gnulib_enabled_strtoull; then 21446 if $gl_gnulib_enabled_strtoull; then
19249 gl_GNULIB_ENABLED_strtoull_TRUE= 21447 gl_GNULIB_ENABLED_strtoull_TRUE=
19250 gl_GNULIB_ENABLED_strtoull_FALSE='#' 21448 gl_GNULIB_ENABLED_strtoull_FALSE='#'
@@ -19302,1766 +21500,6 @@ fi
19302 21500
19303 21501
19304 21502
19305# UNIX98 PTYs.
19306for ac_func in grantpt
19307do :
19308 ac_fn_c_check_func "$LINENO" "grantpt" "ac_cv_func_grantpt"
19309if test "x$ac_cv_func_grantpt" = x""yes; then :
19310 cat >>confdefs.h <<_ACEOF
19311#define HAVE_GRANTPT 1
19312_ACEOF
19313
19314fi
19315done
19316
19317
19318# PTY-related GNU extensions.
19319for ac_func in getpt
19320do :
19321 ac_fn_c_check_func "$LINENO" "getpt" "ac_cv_func_getpt"
19322if test "x$ac_cv_func_getpt" = x""yes; then :
19323 cat >>confdefs.h <<_ACEOF
19324#define HAVE_GETPT 1
19325_ACEOF
19326
19327fi
19328done
19329
19330
19331# Check this now, so that we will NOT find the above functions in ncurses.
19332# That is because we have not set up to link ncurses in lib-src.
19333# It's better to believe a function is not available
19334# than to expect to find it in ncurses.
19335# Also we need tputs and friends to be able to build at all.
19336have_tputs_et_al=true
19337{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tputs" >&5
19338$as_echo_n "checking for library containing tputs... " >&6; }
19339if test "${ac_cv_search_tputs+set}" = set; then :
19340 $as_echo_n "(cached) " >&6
19341else
19342 ac_func_search_save_LIBS=$LIBS
19343cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19344/* end confdefs.h. */
19345
19346/* Override any GCC internal prototype to avoid an error.
19347 Use char because int might match the return type of a GCC
19348 builtin and then its argument prototype would still apply. */
19349#ifdef __cplusplus
19350extern "C"
19351#endif
19352char tputs ();
19353int
19354main ()
19355{
19356return tputs ();
19357 ;
19358 return 0;
19359}
19360_ACEOF
19361for ac_lib in '' ncurses terminfo termcap; do
19362 if test -z "$ac_lib"; then
19363 ac_res="none required"
19364 else
19365 ac_res=-l$ac_lib
19366 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
19367 fi
19368 if ac_fn_c_try_link "$LINENO"; then :
19369 ac_cv_search_tputs=$ac_res
19370fi
19371rm -f core conftest.err conftest.$ac_objext \
19372 conftest$ac_exeext
19373 if test "${ac_cv_search_tputs+set}" = set; then :
19374 break
19375fi
19376done
19377if test "${ac_cv_search_tputs+set}" = set; then :
19378
19379else
19380 ac_cv_search_tputs=no
19381fi
19382rm conftest.$ac_ext
19383LIBS=$ac_func_search_save_LIBS
19384fi
19385{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tputs" >&5
19386$as_echo "$ac_cv_search_tputs" >&6; }
19387ac_res=$ac_cv_search_tputs
19388if test "$ac_res" != no; then :
19389 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
19390
19391else
19392 have_tputs_et_al=false
19393fi
19394
19395if test "$have_tputs_et_al" != true; then
19396 as_fn_error "I couldn't find termcap functions (tputs and friends).
19397Maybe some development libraries/packages are missing? Try installing
19398libncurses-dev(el), libterminfo-dev(el) or similar." "$LINENO" 5
19399fi
19400# Must define this when any termcap library is found.
19401
19402$as_echo "#define HAVE_LIBNCURSES 1" >>confdefs.h
19403
19404## FIXME This was the cpp logic, but I am not sure it is right.
19405## The above test has not necessarily found libncurses.
19406HAVE_LIBNCURSES=yes
19407
19408## Use terminfo instead of termcap?
19409## Note only system files NOT using terminfo are:
19410## freebsd < 40000, ms-w32, msdos, netbsd < 599002500, and
19411## darwin|gnu without ncurses.
19412TERMINFO=no
19413LIBS_TERMCAP=
19414case "$opsys" in
19415 ## cygwin: Fewer environment variables to go wrong, more terminal types.
19416 ## hpux10-20: Use the system provided termcap(3) library.
19417 ## openbsd: David Mazieres <dm@reeducation-labor.lcs.mit.edu> says this
19418 ## is necessary. Otherwise Emacs dumps core when run -nw.
19419 aix4-2|cygwin|hpux*|irix6-5|openbsd|sol2*|unixware) TERMINFO=yes ;;
19420
19421 ## darwin: Prevents crashes when running Emacs in Terminal.app under 10.2.
19422 ## The ncurses library has been moved out of the System framework in
19423 ## Mac OS X 10.2. So if configure detects it, set the command-line
19424 ## option to use it.
19425 darwin|gnu*)
19426 ## (HAVE_LIBNCURSES was not always true, but is since 2010-03-18.)
19427 if test "x$HAVE_LIBNCURSES" = "xyes"; then
19428 TERMINFO=yes
19429 LIBS_TERMCAP="-lncurses"
19430 fi
19431 ;;
19432
19433 freebsd)
19434 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether FreeBSD is new enough to use terminfo" >&5
19435$as_echo_n "checking whether FreeBSD is new enough to use terminfo... " >&6; }
19436 if test "${emacs_cv_freebsd_terminfo+set}" = set; then :
19437 $as_echo_n "(cached) " >&6
19438else
19439 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19440/* end confdefs.h. */
19441#include <osreldate.h>
19442int
19443main ()
19444{
19445#if __FreeBSD_version < 400000
19446fail;
19447#endif
19448
19449 ;
19450 return 0;
19451}
19452_ACEOF
19453if ac_fn_c_try_link "$LINENO"; then :
19454 emacs_cv_freebsd_terminfo=yes
19455else
19456 emacs_cv_freebsd_terminfo=no
19457fi
19458rm -f core conftest.err conftest.$ac_objext \
19459 conftest$ac_exeext conftest.$ac_ext
19460fi
19461
19462
19463 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_freebsd_terminfo" >&5
19464$as_echo "$emacs_cv_freebsd_terminfo" >&6; }
19465
19466 if test $emacs_cv_freebsd_terminfo = yes; then
19467 TERMINFO=yes
19468 LIBS_TERMCAP="-lncurses"
19469 else
19470 LIBS_TERMCAP="-ltermcap"
19471 fi
19472 ;;
19473
19474 netbsd)
19475 if test $ac_cv_search_tputs = -lterminfo; then
19476 TERMINFO=yes
19477 LIBS_TERMCAP="-lterminfo"
19478 else
19479 LIBS_TERMCAP="-ltermcap"
19480 fi
19481 ;;
19482
19483esac
19484
19485case "$opsys" in
19486 ## hpux: Make sure we get select from libc rather than from libcurses
19487 ## because libcurses on HPUX 10.10 has a broken version of select.
19488 ## We used to use -lc -lcurses, but this may be cleaner.
19489 hpux*) LIBS_TERMCAP="-ltermcap" ;;
19490
19491 openbsd) LIBS_TERMCAP="-lncurses" ;;
19492
19493 ## Must use system termcap, if we use any termcap. It does special things.
19494 sol2*) test "$TERMINFO" != yes && LIBS_TERMCAP="-ltermcap" ;;
19495esac
19496
19497TERMCAP_OBJ=tparam.o
19498if test $TERMINFO = yes; then
19499
19500$as_echo "#define TERMINFO 1" >>confdefs.h
19501
19502
19503 ## Default used to be -ltermcap. Add a case above if need something else.
19504 test "x$LIBS_TERMCAP" = "x" && LIBS_TERMCAP="-lcurses"
19505
19506 TERMCAP_OBJ=terminfo.o
19507fi
19508
19509
19510
19511
19512# Do we have res_init, for detecting changes in /etc/resolv.conf?
19513resolv=no
19514cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19515/* end confdefs.h. */
19516#include <netinet/in.h>
19517#include <arpa/nameser.h>
19518#include <resolv.h>
19519int
19520main ()
19521{
19522return res_init();
19523 ;
19524 return 0;
19525}
19526_ACEOF
19527if ac_fn_c_try_link "$LINENO"; then :
19528 have_res_init=yes
19529else
19530 have_res_init=no
19531fi
19532rm -f core conftest.err conftest.$ac_objext \
19533 conftest$ac_exeext conftest.$ac_ext
19534if test "$have_res_init" = no; then
19535 OLIBS="$LIBS"
19536 LIBS="$LIBS -lresolv"
19537 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_init with -lresolv" >&5
19538$as_echo_n "checking for res_init with -lresolv... " >&6; }
19539 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19540/* end confdefs.h. */
19541#include <netinet/in.h>
19542#include <arpa/nameser.h>
19543#include <resolv.h>
19544int
19545main ()
19546{
19547return res_init();
19548 ;
19549 return 0;
19550}
19551_ACEOF
19552if ac_fn_c_try_link "$LINENO"; then :
19553 have_res_init=yes
19554else
19555 have_res_init=no
19556fi
19557rm -f core conftest.err conftest.$ac_objext \
19558 conftest$ac_exeext conftest.$ac_ext
19559 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_res_init" >&5
19560$as_echo "$have_res_init" >&6; }
19561 if test "$have_res_init" = yes ; then
19562 resolv=yes
19563 fi
19564 LIBS="$OLIBS"
19565fi
19566
19567if test "$have_res_init" = yes; then
19568
19569$as_echo "#define HAVE_RES_INIT 1" >>confdefs.h
19570
19571fi
19572
19573# Do we need the Hesiod library to provide the support routines?
19574LIBHESIOD=
19575if test "$with_hesiod" != no ; then
19576 # Don't set $LIBS here -- see comments above. FIXME which comments?
19577 ac_fn_c_check_func "$LINENO" "res_send" "ac_cv_func_res_send"
19578if test "x$ac_cv_func_res_send" = x""yes; then :
19579
19580else
19581 ac_fn_c_check_func "$LINENO" "__res_send" "ac_cv_func___res_send"
19582if test "x$ac_cv_func___res_send" = x""yes; then :
19583
19584else
19585 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_send in -lresolv" >&5
19586$as_echo_n "checking for res_send in -lresolv... " >&6; }
19587if test "${ac_cv_lib_resolv_res_send+set}" = set; then :
19588 $as_echo_n "(cached) " >&6
19589else
19590 ac_check_lib_save_LIBS=$LIBS
19591LIBS="-lresolv $LIBS"
19592cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19593/* end confdefs.h. */
19594
19595/* Override any GCC internal prototype to avoid an error.
19596 Use char because int might match the return type of a GCC
19597 builtin and then its argument prototype would still apply. */
19598#ifdef __cplusplus
19599extern "C"
19600#endif
19601char res_send ();
19602int
19603main ()
19604{
19605return res_send ();
19606 ;
19607 return 0;
19608}
19609_ACEOF
19610if ac_fn_c_try_link "$LINENO"; then :
19611 ac_cv_lib_resolv_res_send=yes
19612else
19613 ac_cv_lib_resolv_res_send=no
19614fi
19615rm -f core conftest.err conftest.$ac_objext \
19616 conftest$ac_exeext conftest.$ac_ext
19617LIBS=$ac_check_lib_save_LIBS
19618fi
19619{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_send" >&5
19620$as_echo "$ac_cv_lib_resolv_res_send" >&6; }
19621if test "x$ac_cv_lib_resolv_res_send" = x""yes; then :
19622 resolv=yes
19623else
19624 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __res_send in -lresolv" >&5
19625$as_echo_n "checking for __res_send in -lresolv... " >&6; }
19626if test "${ac_cv_lib_resolv___res_send+set}" = set; then :
19627 $as_echo_n "(cached) " >&6
19628else
19629 ac_check_lib_save_LIBS=$LIBS
19630LIBS="-lresolv $LIBS"
19631cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19632/* end confdefs.h. */
19633
19634/* Override any GCC internal prototype to avoid an error.
19635 Use char because int might match the return type of a GCC
19636 builtin and then its argument prototype would still apply. */
19637#ifdef __cplusplus
19638extern "C"
19639#endif
19640char __res_send ();
19641int
19642main ()
19643{
19644return __res_send ();
19645 ;
19646 return 0;
19647}
19648_ACEOF
19649if ac_fn_c_try_link "$LINENO"; then :
19650 ac_cv_lib_resolv___res_send=yes
19651else
19652 ac_cv_lib_resolv___res_send=no
19653fi
19654rm -f core conftest.err conftest.$ac_objext \
19655 conftest$ac_exeext conftest.$ac_ext
19656LIBS=$ac_check_lib_save_LIBS
19657fi
19658{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv___res_send" >&5
19659$as_echo "$ac_cv_lib_resolv___res_send" >&6; }
19660if test "x$ac_cv_lib_resolv___res_send" = x""yes; then :
19661 resolv=yes
19662fi
19663
19664fi
19665
19666fi
19667
19668fi
19669
19670 if test "$resolv" = yes ; then
19671 RESOLVLIB=-lresolv
19672 else
19673 RESOLVLIB=
19674 fi
19675 ac_fn_c_check_func "$LINENO" "hes_getmailhost" "ac_cv_func_hes_getmailhost"
19676if test "x$ac_cv_func_hes_getmailhost" = x""yes; then :
19677
19678else
19679 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hes_getmailhost in -lhesiod" >&5
19680$as_echo_n "checking for hes_getmailhost in -lhesiod... " >&6; }
19681if test "${ac_cv_lib_hesiod_hes_getmailhost+set}" = set; then :
19682 $as_echo_n "(cached) " >&6
19683else
19684 ac_check_lib_save_LIBS=$LIBS
19685LIBS="-lhesiod $RESOLVLIB $LIBS"
19686cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19687/* end confdefs.h. */
19688
19689/* Override any GCC internal prototype to avoid an error.
19690 Use char because int might match the return type of a GCC
19691 builtin and then its argument prototype would still apply. */
19692#ifdef __cplusplus
19693extern "C"
19694#endif
19695char hes_getmailhost ();
19696int
19697main ()
19698{
19699return hes_getmailhost ();
19700 ;
19701 return 0;
19702}
19703_ACEOF
19704if ac_fn_c_try_link "$LINENO"; then :
19705 ac_cv_lib_hesiod_hes_getmailhost=yes
19706else
19707 ac_cv_lib_hesiod_hes_getmailhost=no
19708fi
19709rm -f core conftest.err conftest.$ac_objext \
19710 conftest$ac_exeext conftest.$ac_ext
19711LIBS=$ac_check_lib_save_LIBS
19712fi
19713{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hesiod_hes_getmailhost" >&5
19714$as_echo "$ac_cv_lib_hesiod_hes_getmailhost" >&6; }
19715if test "x$ac_cv_lib_hesiod_hes_getmailhost" = x""yes; then :
19716 hesiod=yes
19717else
19718 :
19719fi
19720
19721fi
19722
19723
19724 if test x"$hesiod" = xyes; then
19725
19726$as_echo "#define HAVE_LIBHESIOD 1" >>confdefs.h
19727
19728 LIBHESIOD=-lhesiod
19729 fi
19730fi
19731
19732
19733# Do we need libresolv (due to res_init or Hesiod)?
19734if test "$resolv" = yes ; then
19735
19736$as_echo "#define HAVE_LIBRESOLV 1" >>confdefs.h
19737
19738 LIBRESOLV=-lresolv
19739else
19740 LIBRESOLV=
19741fi
19742
19743
19744# These tell us which Kerberos-related libraries to use.
19745COM_ERRLIB=
19746CRYPTOLIB=
19747KRB5LIB=
19748DESLIB=
19749KRB4LIB=
19750
19751if test "${with_kerberos}" != no; then
19752 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for com_err in -lcom_err" >&5
19753$as_echo_n "checking for com_err in -lcom_err... " >&6; }
19754if test "${ac_cv_lib_com_err_com_err+set}" = set; then :
19755 $as_echo_n "(cached) " >&6
19756else
19757 ac_check_lib_save_LIBS=$LIBS
19758LIBS="-lcom_err $LIBS"
19759cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19760/* end confdefs.h. */
19761
19762/* Override any GCC internal prototype to avoid an error.
19763 Use char because int might match the return type of a GCC
19764 builtin and then its argument prototype would still apply. */
19765#ifdef __cplusplus
19766extern "C"
19767#endif
19768char com_err ();
19769int
19770main ()
19771{
19772return com_err ();
19773 ;
19774 return 0;
19775}
19776_ACEOF
19777if ac_fn_c_try_link "$LINENO"; then :
19778 ac_cv_lib_com_err_com_err=yes
19779else
19780 ac_cv_lib_com_err_com_err=no
19781fi
19782rm -f core conftest.err conftest.$ac_objext \
19783 conftest$ac_exeext conftest.$ac_ext
19784LIBS=$ac_check_lib_save_LIBS
19785fi
19786{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_com_err_com_err" >&5
19787$as_echo "$ac_cv_lib_com_err_com_err" >&6; }
19788if test "x$ac_cv_lib_com_err_com_err" = x""yes; then :
19789 have_com_err=yes
19790else
19791 have_com_err=no
19792fi
19793
19794 if test $have_com_err = yes; then
19795 COM_ERRLIB=-lcom_err
19796 LIBS="$COM_ERRLIB $LIBS"
19797
19798$as_echo "#define HAVE_LIBCOM_ERR 1" >>confdefs.h
19799
19800 fi
19801 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mit_des_cbc_encrypt in -lcrypto" >&5
19802$as_echo_n "checking for mit_des_cbc_encrypt in -lcrypto... " >&6; }
19803if test "${ac_cv_lib_crypto_mit_des_cbc_encrypt+set}" = set; then :
19804 $as_echo_n "(cached) " >&6
19805else
19806 ac_check_lib_save_LIBS=$LIBS
19807LIBS="-lcrypto $LIBS"
19808cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19809/* end confdefs.h. */
19810
19811/* Override any GCC internal prototype to avoid an error.
19812 Use char because int might match the return type of a GCC
19813 builtin and then its argument prototype would still apply. */
19814#ifdef __cplusplus
19815extern "C"
19816#endif
19817char mit_des_cbc_encrypt ();
19818int
19819main ()
19820{
19821return mit_des_cbc_encrypt ();
19822 ;
19823 return 0;
19824}
19825_ACEOF
19826if ac_fn_c_try_link "$LINENO"; then :
19827 ac_cv_lib_crypto_mit_des_cbc_encrypt=yes
19828else
19829 ac_cv_lib_crypto_mit_des_cbc_encrypt=no
19830fi
19831rm -f core conftest.err conftest.$ac_objext \
19832 conftest$ac_exeext conftest.$ac_ext
19833LIBS=$ac_check_lib_save_LIBS
19834fi
19835{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_mit_des_cbc_encrypt" >&5
19836$as_echo "$ac_cv_lib_crypto_mit_des_cbc_encrypt" >&6; }
19837if test "x$ac_cv_lib_crypto_mit_des_cbc_encrypt" = x""yes; then :
19838 have_crypto=yes
19839else
19840 have_crypto=no
19841fi
19842
19843 if test $have_crypto = yes; then
19844 CRYPTOLIB=-lcrypto
19845 LIBS="$CRYPTOLIB $LIBS"
19846
19847$as_echo "#define HAVE_LIBCRYPTO 1" >>confdefs.h
19848
19849 fi
19850 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mit_des_cbc_encrypt in -lk5crypto" >&5
19851$as_echo_n "checking for mit_des_cbc_encrypt in -lk5crypto... " >&6; }
19852if test "${ac_cv_lib_k5crypto_mit_des_cbc_encrypt+set}" = set; then :
19853 $as_echo_n "(cached) " >&6
19854else
19855 ac_check_lib_save_LIBS=$LIBS
19856LIBS="-lk5crypto $LIBS"
19857cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19858/* end confdefs.h. */
19859
19860/* Override any GCC internal prototype to avoid an error.
19861 Use char because int might match the return type of a GCC
19862 builtin and then its argument prototype would still apply. */
19863#ifdef __cplusplus
19864extern "C"
19865#endif
19866char mit_des_cbc_encrypt ();
19867int
19868main ()
19869{
19870return mit_des_cbc_encrypt ();
19871 ;
19872 return 0;
19873}
19874_ACEOF
19875if ac_fn_c_try_link "$LINENO"; then :
19876 ac_cv_lib_k5crypto_mit_des_cbc_encrypt=yes
19877else
19878 ac_cv_lib_k5crypto_mit_des_cbc_encrypt=no
19879fi
19880rm -f core conftest.err conftest.$ac_objext \
19881 conftest$ac_exeext conftest.$ac_ext
19882LIBS=$ac_check_lib_save_LIBS
19883fi
19884{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&5
19885$as_echo "$ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&6; }
19886if test "x$ac_cv_lib_k5crypto_mit_des_cbc_encrypt" = x""yes; then :
19887 have_k5crypto=yes
19888else
19889 have_k5crypto=no
19890fi
19891
19892 if test $have_k5crypto = yes; then
19893 CRYPTOLIB=-lk5crypto
19894 LIBS="$CRYPTOLIB $LIBS"
19895
19896$as_echo "#define HAVE_LIBK5CRYPTO 1" >>confdefs.h
19897
19898 fi
19899 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_init_context in -lkrb5" >&5
19900$as_echo_n "checking for krb5_init_context in -lkrb5... " >&6; }
19901if test "${ac_cv_lib_krb5_krb5_init_context+set}" = set; then :
19902 $as_echo_n "(cached) " >&6
19903else
19904 ac_check_lib_save_LIBS=$LIBS
19905LIBS="-lkrb5 $LIBS"
19906cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19907/* end confdefs.h. */
19908
19909/* Override any GCC internal prototype to avoid an error.
19910 Use char because int might match the return type of a GCC
19911 builtin and then its argument prototype would still apply. */
19912#ifdef __cplusplus
19913extern "C"
19914#endif
19915char krb5_init_context ();
19916int
19917main ()
19918{
19919return krb5_init_context ();
19920 ;
19921 return 0;
19922}
19923_ACEOF
19924if ac_fn_c_try_link "$LINENO"; then :
19925 ac_cv_lib_krb5_krb5_init_context=yes
19926else
19927 ac_cv_lib_krb5_krb5_init_context=no
19928fi
19929rm -f core conftest.err conftest.$ac_objext \
19930 conftest$ac_exeext conftest.$ac_ext
19931LIBS=$ac_check_lib_save_LIBS
19932fi
19933{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb5_krb5_init_context" >&5
19934$as_echo "$ac_cv_lib_krb5_krb5_init_context" >&6; }
19935if test "x$ac_cv_lib_krb5_krb5_init_context" = x""yes; then :
19936 have_krb5=yes
19937else
19938 have_krb5=no
19939fi
19940
19941 if test $have_krb5=yes; then
19942 KRB5LIB=-lkrb5
19943 LIBS="$KRB5LIB $LIBS"
19944
19945$as_echo "#define HAVE_LIBKRB5 1" >>confdefs.h
19946
19947 fi
19948 if test "${with_kerberos5}" = no; then
19949 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for des_cbc_encrypt in -ldes425" >&5
19950$as_echo_n "checking for des_cbc_encrypt in -ldes425... " >&6; }
19951if test "${ac_cv_lib_des425_des_cbc_encrypt+set}" = set; then :
19952 $as_echo_n "(cached) " >&6
19953else
19954 ac_check_lib_save_LIBS=$LIBS
19955LIBS="-ldes425 $LIBS"
19956cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19957/* end confdefs.h. */
19958
19959/* Override any GCC internal prototype to avoid an error.
19960 Use char because int might match the return type of a GCC
19961 builtin and then its argument prototype would still apply. */
19962#ifdef __cplusplus
19963extern "C"
19964#endif
19965char des_cbc_encrypt ();
19966int
19967main ()
19968{
19969return des_cbc_encrypt ();
19970 ;
19971 return 0;
19972}
19973_ACEOF
19974if ac_fn_c_try_link "$LINENO"; then :
19975 ac_cv_lib_des425_des_cbc_encrypt=yes
19976else
19977 ac_cv_lib_des425_des_cbc_encrypt=no
19978fi
19979rm -f core conftest.err conftest.$ac_objext \
19980 conftest$ac_exeext conftest.$ac_ext
19981LIBS=$ac_check_lib_save_LIBS
19982fi
19983{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_des425_des_cbc_encrypt" >&5
19984$as_echo "$ac_cv_lib_des425_des_cbc_encrypt" >&6; }
19985if test "x$ac_cv_lib_des425_des_cbc_encrypt" = x""yes; then :
19986 have_des425=yes
19987else
19988 have_des425=no
19989fi
19990
19991 if test $have_des425 = yes; then
19992 DESLIB=-ldes425
19993 LIBS="$DESLIB $LIBS"
19994
19995$as_echo "#define HAVE_LIBDES425 1" >>confdefs.h
19996
19997 else
19998 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for des_cbc_encrypt in -ldes" >&5
19999$as_echo_n "checking for des_cbc_encrypt in -ldes... " >&6; }
20000if test "${ac_cv_lib_des_des_cbc_encrypt+set}" = set; then :
20001 $as_echo_n "(cached) " >&6
20002else
20003 ac_check_lib_save_LIBS=$LIBS
20004LIBS="-ldes $LIBS"
20005cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20006/* end confdefs.h. */
20007
20008/* Override any GCC internal prototype to avoid an error.
20009 Use char because int might match the return type of a GCC
20010 builtin and then its argument prototype would still apply. */
20011#ifdef __cplusplus
20012extern "C"
20013#endif
20014char des_cbc_encrypt ();
20015int
20016main ()
20017{
20018return des_cbc_encrypt ();
20019 ;
20020 return 0;
20021}
20022_ACEOF
20023if ac_fn_c_try_link "$LINENO"; then :
20024 ac_cv_lib_des_des_cbc_encrypt=yes
20025else
20026 ac_cv_lib_des_des_cbc_encrypt=no
20027fi
20028rm -f core conftest.err conftest.$ac_objext \
20029 conftest$ac_exeext conftest.$ac_ext
20030LIBS=$ac_check_lib_save_LIBS
20031fi
20032{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_des_des_cbc_encrypt" >&5
20033$as_echo "$ac_cv_lib_des_des_cbc_encrypt" >&6; }
20034if test "x$ac_cv_lib_des_des_cbc_encrypt" = x""yes; then :
20035 have_des=yes
20036else
20037 have_des=no
20038fi
20039
20040 if test $have_des = yes; then
20041 DESLIB=-ldes
20042 LIBS="$DESLIB $LIBS"
20043
20044$as_echo "#define HAVE_LIBDES 1" >>confdefs.h
20045
20046 fi
20047 fi
20048 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb_get_cred in -lkrb4" >&5
20049$as_echo_n "checking for krb_get_cred in -lkrb4... " >&6; }
20050if test "${ac_cv_lib_krb4_krb_get_cred+set}" = set; then :
20051 $as_echo_n "(cached) " >&6
20052else
20053 ac_check_lib_save_LIBS=$LIBS
20054LIBS="-lkrb4 $LIBS"
20055cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20056/* end confdefs.h. */
20057
20058/* Override any GCC internal prototype to avoid an error.
20059 Use char because int might match the return type of a GCC
20060 builtin and then its argument prototype would still apply. */
20061#ifdef __cplusplus
20062extern "C"
20063#endif
20064char krb_get_cred ();
20065int
20066main ()
20067{
20068return krb_get_cred ();
20069 ;
20070 return 0;
20071}
20072_ACEOF
20073if ac_fn_c_try_link "$LINENO"; then :
20074 ac_cv_lib_krb4_krb_get_cred=yes
20075else
20076 ac_cv_lib_krb4_krb_get_cred=no
20077fi
20078rm -f core conftest.err conftest.$ac_objext \
20079 conftest$ac_exeext conftest.$ac_ext
20080LIBS=$ac_check_lib_save_LIBS
20081fi
20082{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb4_krb_get_cred" >&5
20083$as_echo "$ac_cv_lib_krb4_krb_get_cred" >&6; }
20084if test "x$ac_cv_lib_krb4_krb_get_cred" = x""yes; then :
20085 have_krb4=yes
20086else
20087 have_krb4=no
20088fi
20089
20090 if test $have_krb4 = yes; then
20091 KRB4LIB=-lkrb4
20092 LIBS="$KRB4LIB $LIBS"
20093
20094$as_echo "#define HAVE_LIBKRB4 1" >>confdefs.h
20095
20096 else
20097 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb_get_cred in -lkrb" >&5
20098$as_echo_n "checking for krb_get_cred in -lkrb... " >&6; }
20099if test "${ac_cv_lib_krb_krb_get_cred+set}" = set; then :
20100 $as_echo_n "(cached) " >&6
20101else
20102 ac_check_lib_save_LIBS=$LIBS
20103LIBS="-lkrb $LIBS"
20104cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20105/* end confdefs.h. */
20106
20107/* Override any GCC internal prototype to avoid an error.
20108 Use char because int might match the return type of a GCC
20109 builtin and then its argument prototype would still apply. */
20110#ifdef __cplusplus
20111extern "C"
20112#endif
20113char krb_get_cred ();
20114int
20115main ()
20116{
20117return krb_get_cred ();
20118 ;
20119 return 0;
20120}
20121_ACEOF
20122if ac_fn_c_try_link "$LINENO"; then :
20123 ac_cv_lib_krb_krb_get_cred=yes
20124else
20125 ac_cv_lib_krb_krb_get_cred=no
20126fi
20127rm -f core conftest.err conftest.$ac_objext \
20128 conftest$ac_exeext conftest.$ac_ext
20129LIBS=$ac_check_lib_save_LIBS
20130fi
20131{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb_krb_get_cred" >&5
20132$as_echo "$ac_cv_lib_krb_krb_get_cred" >&6; }
20133if test "x$ac_cv_lib_krb_krb_get_cred" = x""yes; then :
20134 have_krb=yes
20135else
20136 have_krb=no
20137fi
20138
20139 if test $have_krb = yes; then
20140 KRB4LIB=-lkrb
20141 LIBS="$KRB4LIB $LIBS"
20142
20143$as_echo "#define HAVE_LIBKRB 1" >>confdefs.h
20144
20145 fi
20146 fi
20147 fi
20148
20149 if test "${with_kerberos5}" != no; then
20150 for ac_header in krb5.h
20151do :
20152 ac_fn_c_check_header_mongrel "$LINENO" "krb5.h" "ac_cv_header_krb5_h" "$ac_includes_default"
20153if test "x$ac_cv_header_krb5_h" = x""yes; then :
20154 cat >>confdefs.h <<_ACEOF
20155#define HAVE_KRB5_H 1
20156_ACEOF
20157 ac_fn_c_check_member "$LINENO" "krb5_error" "text" "ac_cv_member_krb5_error_text" "#include <krb5.h>
20158"
20159if test "x$ac_cv_member_krb5_error_text" = x""yes; then :
20160
20161cat >>confdefs.h <<_ACEOF
20162#define HAVE_KRB5_ERROR_TEXT 1
20163_ACEOF
20164
20165
20166fi
20167ac_fn_c_check_member "$LINENO" "krb5_error" "e_text" "ac_cv_member_krb5_error_e_text" "#include <krb5.h>
20168"
20169if test "x$ac_cv_member_krb5_error_e_text" = x""yes; then :
20170
20171cat >>confdefs.h <<_ACEOF
20172#define HAVE_KRB5_ERROR_E_TEXT 1
20173_ACEOF
20174
20175
20176fi
20177
20178fi
20179
20180done
20181
20182 else
20183 for ac_header in des.h
20184do :
20185 ac_fn_c_check_header_mongrel "$LINENO" "des.h" "ac_cv_header_des_h" "$ac_includes_default"
20186if test "x$ac_cv_header_des_h" = x""yes; then :
20187 cat >>confdefs.h <<_ACEOF
20188#define HAVE_DES_H 1
20189_ACEOF
20190
20191else
20192 for ac_header in kerberosIV/des.h
20193do :
20194 ac_fn_c_check_header_mongrel "$LINENO" "kerberosIV/des.h" "ac_cv_header_kerberosIV_des_h" "$ac_includes_default"
20195if test "x$ac_cv_header_kerberosIV_des_h" = x""yes; then :
20196 cat >>confdefs.h <<_ACEOF
20197#define HAVE_KERBEROSIV_DES_H 1
20198_ACEOF
20199
20200else
20201 for ac_header in kerberos/des.h
20202do :
20203 ac_fn_c_check_header_mongrel "$LINENO" "kerberos/des.h" "ac_cv_header_kerberos_des_h" "$ac_includes_default"
20204if test "x$ac_cv_header_kerberos_des_h" = x""yes; then :
20205 cat >>confdefs.h <<_ACEOF
20206#define HAVE_KERBEROS_DES_H 1
20207_ACEOF
20208
20209fi
20210
20211done
20212
20213fi
20214
20215done
20216
20217fi
20218
20219done
20220
20221 for ac_header in krb.h
20222do :
20223 ac_fn_c_check_header_mongrel "$LINENO" "krb.h" "ac_cv_header_krb_h" "$ac_includes_default"
20224if test "x$ac_cv_header_krb_h" = x""yes; then :
20225 cat >>confdefs.h <<_ACEOF
20226#define HAVE_KRB_H 1
20227_ACEOF
20228
20229else
20230 for ac_header in kerberosIV/krb.h
20231do :
20232 ac_fn_c_check_header_mongrel "$LINENO" "kerberosIV/krb.h" "ac_cv_header_kerberosIV_krb_h" "$ac_includes_default"
20233if test "x$ac_cv_header_kerberosIV_krb_h" = x""yes; then :
20234 cat >>confdefs.h <<_ACEOF
20235#define HAVE_KERBEROSIV_KRB_H 1
20236_ACEOF
20237
20238else
20239 for ac_header in kerberos/krb.h
20240do :
20241 ac_fn_c_check_header_mongrel "$LINENO" "kerberos/krb.h" "ac_cv_header_kerberos_krb_h" "$ac_includes_default"
20242if test "x$ac_cv_header_kerberos_krb_h" = x""yes; then :
20243 cat >>confdefs.h <<_ACEOF
20244#define HAVE_KERBEROS_KRB_H 1
20245_ACEOF
20246
20247fi
20248
20249done
20250
20251fi
20252
20253done
20254
20255fi
20256
20257done
20258
20259 fi
20260 for ac_header in com_err.h
20261do :
20262 ac_fn_c_check_header_mongrel "$LINENO" "com_err.h" "ac_cv_header_com_err_h" "$ac_includes_default"
20263if test "x$ac_cv_header_com_err_h" = x""yes; then :
20264 cat >>confdefs.h <<_ACEOF
20265#define HAVE_COM_ERR_H 1
20266_ACEOF
20267
20268fi
20269
20270done
20271
20272fi
20273
20274
20275
20276
20277
20278
20279
20280# Solaris requires -lintl if you want strerror (which calls dgettext)
20281# to return localized messages.
20282{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5
20283$as_echo_n "checking for dgettext in -lintl... " >&6; }
20284if test "${ac_cv_lib_intl_dgettext+set}" = set; then :
20285 $as_echo_n "(cached) " >&6
20286else
20287 ac_check_lib_save_LIBS=$LIBS
20288LIBS="-lintl $LIBS"
20289cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20290/* end confdefs.h. */
20291
20292/* Override any GCC internal prototype to avoid an error.
20293 Use char because int might match the return type of a GCC
20294 builtin and then its argument prototype would still apply. */
20295#ifdef __cplusplus
20296extern "C"
20297#endif
20298char dgettext ();
20299int
20300main ()
20301{
20302return dgettext ();
20303 ;
20304 return 0;
20305}
20306_ACEOF
20307if ac_fn_c_try_link "$LINENO"; then :
20308 ac_cv_lib_intl_dgettext=yes
20309else
20310 ac_cv_lib_intl_dgettext=no
20311fi
20312rm -f core conftest.err conftest.$ac_objext \
20313 conftest$ac_exeext conftest.$ac_ext
20314LIBS=$ac_check_lib_save_LIBS
20315fi
20316{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5
20317$as_echo "$ac_cv_lib_intl_dgettext" >&6; }
20318if test "x$ac_cv_lib_intl_dgettext" = x""yes; then :
20319 cat >>confdefs.h <<_ACEOF
20320#define HAVE_LIBINTL 1
20321_ACEOF
20322
20323 LIBS="-lintl $LIBS"
20324
20325fi
20326
20327
20328{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime caches TZ" >&5
20329$as_echo_n "checking whether localtime caches TZ... " >&6; }
20330if test "${emacs_cv_localtime_cache+set}" = set; then :
20331 $as_echo_n "(cached) " >&6
20332else
20333 if test x$ac_cv_func_tzset = xyes; then
20334if test "$cross_compiling" = yes; then :
20335 # If we have tzset, assume the worst when cross-compiling.
20336emacs_cv_localtime_cache=yes
20337else
20338 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20339/* end confdefs.h. */
20340#include <time.h>
20341char TZ_GMT0[] = "TZ=GMT0";
20342char TZ_PST8[] = "TZ=PST8";
20343main()
20344{
20345 time_t now = time ((time_t *) 0);
20346 int hour_GMT0, hour_unset;
20347 if (putenv (TZ_GMT0) != 0)
20348 exit (1);
20349 hour_GMT0 = localtime (&now)->tm_hour;
20350 unsetenv("TZ");
20351 hour_unset = localtime (&now)->tm_hour;
20352 if (putenv (TZ_PST8) != 0)
20353 exit (1);
20354 if (localtime (&now)->tm_hour == hour_GMT0)
20355 exit (1);
20356 unsetenv("TZ");
20357 if (localtime (&now)->tm_hour != hour_unset)
20358 exit (1);
20359 exit (0);
20360}
20361_ACEOF
20362if ac_fn_c_try_run "$LINENO"; then :
20363 emacs_cv_localtime_cache=no
20364else
20365 emacs_cv_localtime_cache=yes
20366fi
20367rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20368 conftest.$ac_objext conftest.beam conftest.$ac_ext
20369fi
20370
20371else
20372 # If we lack tzset, report that localtime does not cache TZ,
20373 # since we can't invalidate the cache if we don't have tzset.
20374 emacs_cv_localtime_cache=no
20375fi
20376fi
20377{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_localtime_cache" >&5
20378$as_echo "$emacs_cv_localtime_cache" >&6; }
20379if test $emacs_cv_localtime_cache = yes; then
20380
20381$as_echo "#define LOCALTIME_CACHE 1" >>confdefs.h
20382
20383fi
20384
20385if test "x$HAVE_TIMEVAL" = xyes; then
20386 for ac_func in gettimeofday
20387do :
20388 ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday"
20389if test "x$ac_cv_func_gettimeofday" = x""yes; then :
20390 cat >>confdefs.h <<_ACEOF
20391#define HAVE_GETTIMEOFDAY 1
20392_ACEOF
20393
20394fi
20395done
20396
20397 if test $ac_cv_func_gettimeofday = yes; then
20398 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday can accept two arguments" >&5
20399$as_echo_n "checking whether gettimeofday can accept two arguments... " >&6; }
20400if test "${emacs_cv_gettimeofday_two_arguments+set}" = set; then :
20401 $as_echo_n "(cached) " >&6
20402else
20403 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20404/* end confdefs.h. */
20405
20406#ifdef TIME_WITH_SYS_TIME
20407#include <sys/time.h>
20408#include <time.h>
20409#else
20410#ifdef HAVE_SYS_TIME_H
20411#include <sys/time.h>
20412#else
20413#include <time.h>
20414#endif
20415#endif
20416int
20417main ()
20418{
20419struct timeval time;
20420 gettimeofday (&time, 0);
20421 ;
20422 return 0;
20423}
20424_ACEOF
20425if ac_fn_c_try_compile "$LINENO"; then :
20426 emacs_cv_gettimeofday_two_arguments=yes
20427else
20428 emacs_cv_gettimeofday_two_arguments=no
20429fi
20430rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20431fi
20432{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_gettimeofday_two_arguments" >&5
20433$as_echo "$emacs_cv_gettimeofday_two_arguments" >&6; }
20434 if test $emacs_cv_gettimeofday_two_arguments = no; then
20435
20436$as_echo "#define GETTIMEOFDAY_ONE_ARGUMENT 1" >>confdefs.h
20437
20438 fi
20439 fi
20440fi
20441
20442ok_so_far=yes
20443ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket"
20444if test "x$ac_cv_func_socket" = x""yes; then :
20445
20446else
20447 ok_so_far=no
20448fi
20449
20450if test $ok_so_far = yes; then
20451 ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
20452if test "x$ac_cv_header_netinet_in_h" = x""yes; then :
20453
20454else
20455 ok_so_far=no
20456fi
20457
20458
20459fi
20460if test $ok_so_far = yes; then
20461 ac_fn_c_check_header_mongrel "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default"
20462if test "x$ac_cv_header_arpa_inet_h" = x""yes; then :
20463
20464else
20465 ok_so_far=no
20466fi
20467
20468
20469fi
20470if test $ok_so_far = yes; then
20471
20472$as_echo "#define HAVE_INET_SOCKETS 1" >>confdefs.h
20473
20474fi
20475
20476if test -f /usr/lpp/X11/bin/smt.exp; then
20477
20478$as_echo "#define HAVE_AIX_SMT_EXP 1" >>confdefs.h
20479
20480fi
20481
20482{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system supports dynamic ptys" >&5
20483$as_echo_n "checking whether system supports dynamic ptys... " >&6; }
20484if test -d /dev/pts && ls -d /dev/ptmx > /dev/null 2>&1 ; then
20485 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
20486$as_echo "yes" >&6; }
20487
20488$as_echo "#define HAVE_DEV_PTMX 1" >>confdefs.h
20489
20490else
20491 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20492$as_echo "no" >&6; }
20493fi
20494
20495ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
20496if test "x$ac_cv_type_pid_t" = x""yes; then :
20497
20498else
20499
20500cat >>confdefs.h <<_ACEOF
20501#define pid_t int
20502_ACEOF
20503
20504fi
20505
20506for ac_header in vfork.h
20507do :
20508 ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
20509if test "x$ac_cv_header_vfork_h" = x""yes; then :
20510 cat >>confdefs.h <<_ACEOF
20511#define HAVE_VFORK_H 1
20512_ACEOF
20513
20514fi
20515
20516done
20517
20518for ac_func in fork vfork
20519do :
20520 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
20521ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
20522eval as_val=\$$as_ac_var
20523 if test "x$as_val" = x""yes; then :
20524 cat >>confdefs.h <<_ACEOF
20525#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
20526_ACEOF
20527
20528fi
20529done
20530
20531if test "x$ac_cv_func_fork" = xyes; then
20532 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
20533$as_echo_n "checking for working fork... " >&6; }
20534if test "${ac_cv_func_fork_works+set}" = set; then :
20535 $as_echo_n "(cached) " >&6
20536else
20537 if test "$cross_compiling" = yes; then :
20538 ac_cv_func_fork_works=cross
20539else
20540 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20541/* end confdefs.h. */
20542$ac_includes_default
20543int
20544main ()
20545{
20546
20547 /* By Ruediger Kuhlmann. */
20548 return fork () < 0;
20549
20550 ;
20551 return 0;
20552}
20553_ACEOF
20554if ac_fn_c_try_run "$LINENO"; then :
20555 ac_cv_func_fork_works=yes
20556else
20557 ac_cv_func_fork_works=no
20558fi
20559rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20560 conftest.$ac_objext conftest.beam conftest.$ac_ext
20561fi
20562
20563fi
20564{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5
20565$as_echo "$ac_cv_func_fork_works" >&6; }
20566
20567else
20568 ac_cv_func_fork_works=$ac_cv_func_fork
20569fi
20570if test "x$ac_cv_func_fork_works" = xcross; then
20571 case $host in
20572 *-*-amigaos* | *-*-msdosdjgpp*)
20573 # Override, as these systems have only a dummy fork() stub
20574 ac_cv_func_fork_works=no
20575 ;;
20576 *)
20577 ac_cv_func_fork_works=yes
20578 ;;
20579 esac
20580 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
20581$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
20582fi
20583ac_cv_func_vfork_works=$ac_cv_func_vfork
20584if test "x$ac_cv_func_vfork" = xyes; then
20585 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
20586$as_echo_n "checking for working vfork... " >&6; }
20587if test "${ac_cv_func_vfork_works+set}" = set; then :
20588 $as_echo_n "(cached) " >&6
20589else
20590 if test "$cross_compiling" = yes; then :
20591 ac_cv_func_vfork_works=cross
20592else
20593 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20594/* end confdefs.h. */
20595/* Thanks to Paul Eggert for this test. */
20596$ac_includes_default
20597#include <sys/wait.h>
20598#ifdef HAVE_VFORK_H
20599# include <vfork.h>
20600#endif
20601/* On some sparc systems, changes by the child to local and incoming
20602 argument registers are propagated back to the parent. The compiler
20603 is told about this with #include <vfork.h>, but some compilers
20604 (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a
20605 static variable whose address is put into a register that is
20606 clobbered by the vfork. */
20607static void
20608#ifdef __cplusplus
20609sparc_address_test (int arg)
20610# else
20611sparc_address_test (arg) int arg;
20612#endif
20613{
20614 static pid_t child;
20615 if (!child) {
20616 child = vfork ();
20617 if (child < 0) {
20618 perror ("vfork");
20619 _exit(2);
20620 }
20621 if (!child) {
20622 arg = getpid();
20623 write(-1, "", 0);
20624 _exit (arg);
20625 }
20626 }
20627}
20628
20629int
20630main ()
20631{
20632 pid_t parent = getpid ();
20633 pid_t child;
20634
20635 sparc_address_test (0);
20636
20637 child = vfork ();
20638
20639 if (child == 0) {
20640 /* Here is another test for sparc vfork register problems. This
20641 test uses lots of local variables, at least as many local
20642 variables as main has allocated so far including compiler
20643 temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris
20644 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should
20645 reuse the register of parent for one of the local variables,
20646 since it will think that parent can't possibly be used any more
20647 in this routine. Assigning to the local variable will thus
20648 munge parent in the parent process. */
20649 pid_t
20650 p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
20651 p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
20652 /* Convince the compiler that p..p7 are live; otherwise, it might
20653 use the same hardware register for all 8 local variables. */
20654 if (p != p1 || p != p2 || p != p3 || p != p4
20655 || p != p5 || p != p6 || p != p7)
20656 _exit(1);
20657
20658 /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
20659 from child file descriptors. If the child closes a descriptor
20660 before it execs or exits, this munges the parent's descriptor
20661 as well. Test for this by closing stdout in the child. */
20662 _exit(close(fileno(stdout)) != 0);
20663 } else {
20664 int status;
20665 struct stat st;
20666
20667 while (wait(&status) != child)
20668 ;
20669 return (
20670 /* Was there some problem with vforking? */
20671 child < 0
20672
20673 /* Did the child fail? (This shouldn't happen.) */
20674 || status
20675
20676 /* Did the vfork/compiler bug occur? */
20677 || parent != getpid()
20678
20679 /* Did the file descriptor bug occur? */
20680 || fstat(fileno(stdout), &st) != 0
20681 );
20682 }
20683}
20684_ACEOF
20685if ac_fn_c_try_run "$LINENO"; then :
20686 ac_cv_func_vfork_works=yes
20687else
20688 ac_cv_func_vfork_works=no
20689fi
20690rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
20691 conftest.$ac_objext conftest.beam conftest.$ac_ext
20692fi
20693
20694fi
20695{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5
20696$as_echo "$ac_cv_func_vfork_works" >&6; }
20697
20698fi;
20699if test "x$ac_cv_func_fork_works" = xcross; then
20700 ac_cv_func_vfork_works=$ac_cv_func_vfork
20701 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
20702$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
20703fi
20704
20705if test "x$ac_cv_func_vfork_works" = xyes; then
20706
20707$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h
20708
20709else
20710
20711$as_echo "#define vfork fork" >>confdefs.h
20712
20713fi
20714if test "x$ac_cv_func_fork_works" = xyes; then
20715
20716$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
20717
20718fi
20719
20720
20721{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
20722$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
20723if test "${emacs_cv_langinfo_codeset+set}" = set; then :
20724 $as_echo_n "(cached) " >&6
20725else
20726 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20727/* end confdefs.h. */
20728#include <langinfo.h>
20729int
20730main ()
20731{
20732char* cs = nl_langinfo(CODESET);
20733 ;
20734 return 0;
20735}
20736_ACEOF
20737if ac_fn_c_try_link "$LINENO"; then :
20738 emacs_cv_langinfo_codeset=yes
20739else
20740 emacs_cv_langinfo_codeset=no
20741fi
20742rm -f core conftest.err conftest.$ac_objext \
20743 conftest$ac_exeext conftest.$ac_ext
20744
20745fi
20746{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_langinfo_codeset" >&5
20747$as_echo "$emacs_cv_langinfo_codeset" >&6; }
20748if test $emacs_cv_langinfo_codeset = yes; then
20749
20750$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
20751
20752fi
20753
20754{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
20755$as_echo_n "checking for mbstate_t... " >&6; }
20756if test "${ac_cv_type_mbstate_t+set}" = set; then :
20757 $as_echo_n "(cached) " >&6
20758else
20759 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20760/* end confdefs.h. */
20761$ac_includes_default
20762# include <wchar.h>
20763int
20764main ()
20765{
20766mbstate_t x; return sizeof x;
20767 ;
20768 return 0;
20769}
20770_ACEOF
20771if ac_fn_c_try_compile "$LINENO"; then :
20772 ac_cv_type_mbstate_t=yes
20773else
20774 ac_cv_type_mbstate_t=no
20775fi
20776rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20777fi
20778{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5
20779$as_echo "$ac_cv_type_mbstate_t" >&6; }
20780 if test $ac_cv_type_mbstate_t = yes; then
20781
20782$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h
20783
20784 else
20785
20786$as_echo "#define mbstate_t int" >>confdefs.h
20787
20788 fi
20789
20790{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C restricted array declarations" >&5
20791$as_echo_n "checking for C restricted array declarations... " >&6; }
20792if test "${emacs_cv_c_restrict_arr+set}" = set; then :
20793 $as_echo_n "(cached) " >&6
20794else
20795 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20796/* end confdefs.h. */
20797void fred (int x[__restrict]);
20798int
20799main ()
20800{
20801
20802 ;
20803 return 0;
20804}
20805_ACEOF
20806if ac_fn_c_try_compile "$LINENO"; then :
20807 emacs_cv_c_restrict_arr=yes
20808else
20809 emacs_cv_c_restrict_arr=no
20810fi
20811rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20812fi
20813{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_c_restrict_arr" >&5
20814$as_echo "$emacs_cv_c_restrict_arr" >&6; }
20815if test "$emacs_cv_c_restrict_arr" = yes; then
20816
20817$as_echo "#define __restrict_arr __restrict" >>confdefs.h
20818
20819fi
20820
20821
20822
20823# Set up the CFLAGS for real compilation, so we can substitute it.
20824CFLAGS="$REAL_CFLAGS"
20825CPPFLAGS="$REAL_CPPFLAGS"
20826
20827## Hack to detect a buggy GCC version.
20828if test "x$GCC" = xyes \
20829 && test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \
20830 && test x"`echo $CFLAGS | grep '\-O[23]'`" != x \
20831 && test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then
20832 as_fn_error "GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." "$LINENO" 5
20833fi
20834
20835version=$PACKAGE_VERSION
20836
20837### Specify what sort of things we'll be editing into Makefile and config.h.
20838### Use configuration here uncanonicalized to avoid exceeding size limits.
20839
20840
20841## Unused?
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862## FIXME? Nothing uses @LD_SWITCH_X_SITE@.
20863## src/Makefile.in did add LD_SWITCH_X_SITE (as a cpp define) to the
20864## end of LIBX_BASE, but nothing ever set it.
20865
20866
20867
20868
20869## Used in lwlib/Makefile.in.
20870
20871if test -n "${machfile}"; then
20872 M_FILE="\$(srcdir)/${machfile}"
20873else
20874 M_FILE=
20875fi
20876S_FILE="\$(srcdir)/${opsysfile}"
20877
20878
20879
20880
20881
20882
20883
20884
20885
20886
20887cat >>confdefs.h <<_ACEOF
20888#define EMACS_CONFIGURATION "${canonical}"
20889_ACEOF
20890
20891
20892cat >>confdefs.h <<_ACEOF
20893#define EMACS_CONFIG_OPTIONS "${ac_configure_args}"
20894_ACEOF
20895
20896if test -n "$machfile"; then
20897
20898cat >>confdefs.h <<_ACEOF
20899#define config_machfile "${machfile}"
20900_ACEOF
20901
20902fi
20903
20904cat >>confdefs.h <<_ACEOF
20905#define config_opsysfile "${opsysfile}"
20906_ACEOF
20907
20908
20909XMENU_OBJ=
20910XOBJ=
20911FONT_OBJ=
20912if test "${HAVE_X_WINDOWS}" = "yes" ; then
20913
20914$as_echo "#define HAVE_X_WINDOWS 1" >>confdefs.h
20915
20916 XMENU_OBJ=xmenu.o
20917 XOBJ="xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o xsettings.o xgselect.o"
20918 FONT_OBJ=xfont.o
20919 if test "$HAVE_XFT" = "yes"; then
20920 FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
20921 elif test "$HAVE_FREETYPE" = "yes"; then
20922 FONT_OBJ="$FONT_OBJ ftfont.o ftxfont.o"
20923 fi
20924
20925fi
20926
20927
20928
20929
20930WIDGET_OBJ=
20931MOTIF_LIBW=
20932if test "${USE_X_TOOLKIT}" != "none" ; then
20933 WIDGET_OBJ=widget.o
20934
20935$as_echo "#define USE_X_TOOLKIT 1" >>confdefs.h
20936
20937 if test "${USE_X_TOOLKIT}" = "LUCID"; then
20938
20939$as_echo "#define USE_LUCID 1" >>confdefs.h
20940
20941 elif test "${USE_X_TOOLKIT}" = "MOTIF"; then
20942
20943$as_echo "#define USE_MOTIF 1" >>confdefs.h
20944
20945 MOTIF_LIBW=-lXm
20946 case "$opsys" in
20947 gnu-linux)
20948 ## Paul Abrahams <abrahams at equinox.shaysnet.com> says this is needed.
20949 MOTIF_LIBW="$MOTIF_LIBW -lXpm"
20950 ;;
20951
20952 unixware)
20953 ## Richard Anthony Ryan <ryanr at ellingtn.ftc.nrcs.usda.gov>
20954 ## says -lXimp is needed in UNIX_SV ... 4.2 1.1.2.
20955 MOTIF_LIBW="MOTIF_LIBW -lXimp"
20956 ;;
20957
20958 aix4-2)
20959 ## olson@mcs.anl.gov says -li18n is needed by -lXm.
20960 MOTIF_LIBW="$MOTIF_LIBW -li18n"
20961 ;;
20962 esac
20963 MOTIF_LIBW="$MOTIF_LIBW $LIBXP"
20964 fi
20965fi
20966
20967
20968TOOLKIT_LIBW=
20969case "$USE_X_TOOLKIT" in
20970 MOTIF) TOOLKIT_LIBW="$MOTIF_LIBW" ;;
20971 LUCID) TOOLKIT_LIBW="$LUCID_LIBW" ;;
20972 none) test "x$HAVE_GTK" = "xyes" && TOOLKIT_LIBW="$GTK_LIBS" ;;
20973esac
20974
20975
20976if test "$USE_X_TOOLKIT" = "none"; then
20977 LIBXT_OTHER="\$(LIBXSM)"
20978 OLDXMENU_TARGET="really-oldXMenu"
20979else
20980 LIBXT_OTHER="\$(LIBXMU) -lXt \$(LIBXTR6) -lXext"
20981 OLDXMENU_TARGET="really-lwlib"
20982fi
20983
20984
20985## The X Menu stuff is present in the X10 distribution, but missing
20986## from X11. If we have X10, just use the installed library;
20987## otherwise, use our own copy.
20988if test "${HAVE_X11}" = "yes" ; then
20989
20990$as_echo "#define HAVE_X11 1" >>confdefs.h
20991
20992
20993 if test "$USE_X_TOOLKIT" = "none"; then
20994 OLDXMENU="\${oldXMenudir}/libXMenu11.a"
20995 else
20996 OLDXMENU="\${lwlibdir}/liblw.a"
20997 fi
20998 LIBXMENU="\$(OLDXMENU)"
20999 LIBX_OTHER="\$(LIBXT) \$(LIBX_EXTRA)"
21000 OLDXMENU_DEPS="\${OLDXMENU} ../src/\${OLDXMENU}"
21001else
21002 ## For a syntactically valid Makefile; not actually used for anything.
21003 ## See comments in src/Makefile.in.
21004 OLDXMENU=nothing
21005 ## FIXME This case (!HAVE_X11 && HAVE_X_WINDOWS) is no longer possible(?).
21006 if test "${HAVE_X_WINDOWS}" = "yes"; then
21007 LIBXMENU="-lXMenu"
21008 else
21009 LIBXMENU=
21010 fi
21011 LIBX_OTHER=
21012 OLDXMENU_DEPS=
21013fi
21014
21015if test "$HAVE_GTK" = "yes" || test "$HAVE_MENUS" != "yes"; then
21016 OLDXMENU_TARGET=
21017 OLDXMENU=nothing
21018 LIBXMENU=
21019 OLDXMENU_DEPS=
21020fi
21021
21022
21023
21024
21025
21026
21027
21028if test "${HAVE_MENUS}" = "yes" ; then
21029
21030$as_echo "#define HAVE_MENUS 1" >>confdefs.h
21031
21032fi
21033
21034if test "${GNU_MALLOC}" = "yes" ; then
21035
21036$as_echo "#define GNU_MALLOC 1" >>confdefs.h
21037
21038fi
21039
21040RALLOC_OBJ=
21041if test "${REL_ALLOC}" = "yes" ; then
21042
21043$as_echo "#define REL_ALLOC 1" >>confdefs.h
21044
21045
21046 test "$system_malloc" != "yes" && RALLOC_OBJ=ralloc.o
21047fi
21048
21049
21050if test "$opsys" = "cygwin"; then
21051 CYGWIN_OBJ="sheap.o"
21052 ## Cygwin differs because of its unexec().
21053 PRE_ALLOC_OBJ=
21054 POST_ALLOC_OBJ=lastfile.o
21055else
21056 CYGWIN_OBJ=
21057 PRE_ALLOC_OBJ=lastfile.o
21058 POST_ALLOC_OBJ=
21059fi
21060
21061
21062
21063
21064
21065case "$opsys" in 21503case "$opsys" in
21066 aix4-2) LD_SWITCH_SYSTEM_TEMACS="-Wl,-bnodelcsect" ;; 21504 aix4-2) LD_SWITCH_SYSTEM_TEMACS="-Wl,-bnodelcsect" ;;
21067 21505
@@ -21472,10 +21910,18 @@ if test -z "${gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_TRUE}" && test
21472 as_fn_error "conditional \"gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36\" was never defined. 21910 as_fn_error "conditional \"gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36\" was never defined.
21473Usually this means the macro was only invoked conditionally." "$LINENO" 5 21911Usually this means the macro was only invoked conditionally." "$LINENO" 5
21474fi 21912fi
21913if test -z "${gl_GNULIB_ENABLED_sigprocmask_TRUE}" && test -z "${gl_GNULIB_ENABLED_sigprocmask_FALSE}"; then
21914 as_fn_error "conditional \"gl_GNULIB_ENABLED_sigprocmask\" was never defined.
21915Usually this means the macro was only invoked conditionally." "$LINENO" 5
21916fi
21475if test -z "${gl_GNULIB_ENABLED_stat_TRUE}" && test -z "${gl_GNULIB_ENABLED_stat_FALSE}"; then 21917if test -z "${gl_GNULIB_ENABLED_stat_TRUE}" && test -z "${gl_GNULIB_ENABLED_stat_FALSE}"; then
21476 as_fn_error "conditional \"gl_GNULIB_ENABLED_stat\" was never defined. 21918 as_fn_error "conditional \"gl_GNULIB_ENABLED_stat\" was never defined.
21477Usually this means the macro was only invoked conditionally." "$LINENO" 5 21919Usually this means the macro was only invoked conditionally." "$LINENO" 5
21478fi 21920fi
21921if test -z "${gl_GNULIB_ENABLED_strtoll_TRUE}" && test -z "${gl_GNULIB_ENABLED_strtoll_FALSE}"; then
21922 as_fn_error "conditional \"gl_GNULIB_ENABLED_strtoll\" was never defined.
21923Usually this means the macro was only invoked conditionally." "$LINENO" 5
21924fi
21479if test -z "${gl_GNULIB_ENABLED_strtoull_TRUE}" && test -z "${gl_GNULIB_ENABLED_strtoull_FALSE}"; then 21925if test -z "${gl_GNULIB_ENABLED_strtoull_TRUE}" && test -z "${gl_GNULIB_ENABLED_strtoull_FALSE}"; then
21480 as_fn_error "conditional \"gl_GNULIB_ENABLED_strtoull\" was never defined. 21926 as_fn_error "conditional \"gl_GNULIB_ENABLED_strtoull\" was never defined.
21481Usually this means the macro was only invoked conditionally." "$LINENO" 5 21927Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 87d1211587f..ae732a7db0f 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,54 @@
12011-07-11 Chong Yidong <cyd@stupidchicken.com>
2
3 * killing.texi (Killing, Deletion and Killing, Killing by Lines)
4 (Other Kill Commands, Kill Options): Copyedits.
5 (Deletion and Killing, Kill Ring): Kill/yank now use clipboard.
6 (Yanking): Move yank-excluded properties discussion here.
7 (Cut and Paste): Move from frames.texi. Update subnodes to
8 describe x-select-enable-clipboard case.
9
10 * frames.texi: Move Cut and Paste node and subnodes into
11 killing.texi, except Mouse Commands and Word and Line Mouse.
12
132011-07-10 Andy Moreton <andrewjmoreton@gmail.com> (tiny change)
14
15 * makefile.w32-in (EMACSSOURCES): Replace major.texi with modes.texi.
16
172011-07-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
18
19 * screen.texi (Mode Line): Clarify that coding systems are
20 characters, not letters (bug#1749).
21
22 * cmdargs.texi (Environment): Mention removing variables
23 (bug#1615). Text suggested by Kevin Rodgers.
24
252011-07-10 Chong Yidong <cyd@stupidchicken.com>
26
27 * misc.texi (Amusements): Don't mention Yow; it's crippled.
28
29 * modes.texi: Rename from major.texi.
30 (Modes): New node. Make Major Modes and Minor Modes subsections
31 of this. All callers changed.
32
33 * custom.texi (Minor Modes): Move to modes.texi.
34
352011-07-10 Chong Yidong <cyd@stupidchicken.com>
36
37 * custom.texi (Syntax): Node deleted.
38
39 * help.texi (Help Summary):
40 * major.texi (Major Modes):
41 * programs.texi (Parentheses):
42 * search.texi (Regexp Backslash, Regexp Backslash)
43 (Regexp Backslash):
44 * text.texi (Words): Callers changed.
45
46 * text.texi (Refill, Longlines): Delete nodes.
47
48 * ack.texi (Acknowledgments): Longlines removed from manual.
49
50 * emacs.texi (Top): Update node listing.
51
12011-07-09 Glenn Morris <rgm@gnu.org> 522011-07-09 Glenn Morris <rgm@gnu.org>
2 53
3 * fortran-xtra.texi (Fortran): Update handled extensions. 54 * fortran-xtra.texi (Fortran): Update handled extensions.
diff --git a/doc/emacs/Makefile.in b/doc/emacs/Makefile.in
index aca17ce817d..9465c726eba 100644
--- a/doc/emacs/Makefile.in
+++ b/doc/emacs/Makefile.in
@@ -84,7 +84,7 @@ EMACSSOURCES= \
84 ${srcdir}/windows.texi \ 84 ${srcdir}/windows.texi \
85 ${srcdir}/frames.texi \ 85 ${srcdir}/frames.texi \
86 ${srcdir}/mule.texi \ 86 ${srcdir}/mule.texi \
87 ${srcdir}/major.texi \ 87 ${srcdir}/modes.texi \
88 ${srcdir}/indent.texi \ 88 ${srcdir}/indent.texi \
89 ${srcdir}/text.texi \ 89 ${srcdir}/text.texi \
90 ${srcdir}/programs.texi \ 90 ${srcdir}/programs.texi \
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi
index e554c71703f..1cfb3d9ffe9 100644
--- a/doc/emacs/ack.texi
+++ b/doc/emacs/ack.texi
@@ -190,9 +190,7 @@ prior to Emacs 23 for Mac OS.
190 190
191@item 191@item
192Chong Yidong was the Emacs co-maintainer for Emacs 23. He made many 192Chong Yidong was the Emacs co-maintainer for Emacs 23. He made many
193improvements to the Emacs display engine; and, together with Kai 193improvements to the Emacs display engine.
194Großjohann and Alex Schroeder, wrote @file{longlines.el}, a minor
195mode for wrapping long lines.
196 194
197@item 195@item
198James Clark wrote SGML mode, a mode for editing SGML documents; and 196James Clark wrote SGML mode, a mode for editing SGML documents; and
@@ -689,14 +687,12 @@ the current window on which point is; @file{cap-words.el}, a minor mode
689for motion in ``CapitalizedWordIdentifiers''; @file{latin1-disp.el}, a 687for motion in ``CapitalizedWordIdentifiers''; @file{latin1-disp.el}, a
690package that lets you display ISO 8859 characters on Latin-1 terminals 688package that lets you display ISO 8859 characters on Latin-1 terminals
691by setting up appropriate display tables; @file{python.el}, a major mode 689by setting up appropriate display tables; @file{python.el}, a major mode
692for the Python programming language; @file{refill.el}, a mode for 690for the Python programming language; @file{smiley.el}, a facility for
693automatic paragraph refilling, akin to typical word processors; 691displaying smiley faces; @file{sym-comp.el}, a library for performing
694@file{smiley.el}, a facility for displaying smiley faces; 692mode-dependent symbol completion; @file{benchmark.el} for timing code
695@file{sym-comp.el}, a library for performing mode-dependent symbol 693execution; and @file{tool-bar.el}, a mode to control the display of
696completion; @file{benchmark.el} for timing code execution; and 694the Emacs tool bar. With Riccardo Murri he wrote @file{vc-bzr.el},
697@file{tool-bar.el}, a mode to control the display of the Emacs tool bar. 695support for the Bazaar version control system.
698With Riccardo Murri he wrote @file{vc-bzr.el}, support for the Bazaar
699version control system.
700 696
701@item 697@item
702Eric Ludlam wrote the Speedbar package; @file{checkdoc.el}, for checking 698Eric Ludlam wrote the Speedbar package; @file{checkdoc.el}, for checking
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi
index 1c3b85559d2..af493ade2f2 100644
--- a/doc/emacs/cmdargs.texi
+++ b/doc/emacs/cmdargs.texi
@@ -427,10 +427,11 @@ software) inherit the environment from Emacs, too.
427@vindex initial-environment 427@vindex initial-environment
428 Inside Emacs, the command @kbd{M-x getenv} gets the value of an 428 Inside Emacs, the command @kbd{M-x getenv} gets the value of an
429environment variable. @kbd{M-x setenv} sets a variable in the Emacs 429environment variable. @kbd{M-x setenv} sets a variable in the Emacs
430environment. (Environment variable substitutions with @samp{$} work 430environment, and @kbd{C-u M-x setenv} removes a variable.
431in the value just as in file names; see @ref{File Names with $}.) The 431(Environment variable substitutions with @samp{$} work in the value
432variable @code{initial-environment} stores the initial environment 432just as in file names; see @ref{File Names with $}.) The variable
433inherited by Emacs. 433@code{initial-environment} stores the initial environment inherited by
434Emacs.
434 435
435 The way to set environment variables outside of Emacs depends on the 436 The way to set environment variables outside of Emacs depends on the
436operating system, and especially the shell that you are using. For 437operating system, and especially the shell that you are using. For
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index 434c574ac42..8465dd93519 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -23,169 +23,16 @@ Reference Manual}.
23@end ifnottex 23@end ifnottex
24 24
25@menu 25@menu
26* Minor Modes:: Each minor mode is a feature you can turn on
27 independently of any others.
28* Easy Customization:: Convenient way to browse and change settings. 26* Easy Customization:: Convenient way to browse and change settings.
29* Variables:: Many Emacs commands examine Emacs variables 27* Variables:: Many Emacs commands examine Emacs variables
30 to decide what to do; by setting variables, 28 to decide what to do; by setting variables,
31 you can control their functioning. 29 you can control their functioning.
32* Key Bindings:: The keymaps say what command each key runs. 30* Key Bindings:: The keymaps say what command each key runs.
33 By changing them, you can "redefine keys". 31 By changing them, you can "redefine keys".
34* Syntax:: The syntax table controls how words and
35 expressions are parsed.
36* Init File:: How to write common customizations in the 32* Init File:: How to write common customizations in the
37 @file{.emacs} file. 33 @file{.emacs} file.
38@end menu 34@end menu
39 35
40@node Minor Modes
41@section Minor Modes
42@cindex minor modes
43@cindex mode, minor
44
45 Minor modes are optional features which you can turn on or off. For
46example, Auto Fill mode is a minor mode in which @key{SPC} breaks
47lines between words as you type. Minor modes are independent of one
48another and of the selected major mode. Most minor modes say in the
49mode line when they are enabled; for example, @samp{Fill} in the mode
50line means that Auto Fill mode is enabled.
51
52 Each minor mode is associated with a command, called the @dfn{mode
53command}, which turns it on or off. The name of this command consists
54of the name of the minor mode, followed by @samp{-mode}; for instance,
55the mode command for Auto Fill mode is @code{auto-fill-mode}. Calling
56the minor mode command with no prefix argument @dfn{toggles} the mode,
57turning it on if it was off, and off if it was on. A positive
58argument always turns the mode on, and a zero or negative argument
59always turns it off. Mode commands are usually invoked with
60@kbd{M-x}, but you can bind keys to them if you wish (@pxref{Key
61Bindings}).
62
63 Most minor modes also have a @dfn{mode variable}, with the same name
64as the mode command. Its value is non-@code{nil} if the mode is
65enabled, and @code{nil} if it is disabled. In some minor modes---but
66not all---the value of the variable alone determines whether the mode
67is active: the mode command works simply by setting the variable, and
68changing the value of the variable has the same effect as calling the
69mode command. Because not all minor modes work this way, we recommend
70that you avoid changing the mode variables directly; use the mode
71commands instead.
72
73 Some minor modes are @dfn{buffer-local}: they apply only to the
74current buffer, so you can enable the mode in certain buffers and not
75others. Other minor modes are @dfn{global}: while enabled, they
76affect everything you do in the Emacs session, in all buffers. Some
77global minor modes are enabled by default.
78
79 The following is a list of some buffer-local minor modes:
80
81@itemize @bullet
82@item
83Abbrev mode automatically expands text based on pre-defined
84abbreviation definitions. @xref{Abbrevs}.
85
86@item
87Auto Fill mode inserts newlines as you type to prevent lines from
88becoming too long. @xref{Filling}.
89
90@item
91Auto Save mode saves the buffer contents periodically to reduce the
92amount of work you can lose in case of a crash. @xref{Auto Save}.
93
94@item
95Enriched mode enables editing and saving of formatted text.
96@xref{Formatted Text}.
97
98@item
99Flyspell mode automatically highlights misspelled words.
100@xref{Spelling}.
101
102@item
103Font-Lock mode automatically highlights certain textual units found in
104programs. It is enabled globally by default, but you can disable it
105in individual buffers. @xref{Faces}.
106
107@findex linum-mode
108@cindex Linum mode
109@item
110Linum mode displays each line's line number in the window's left
111margin. Its mode command is @code{linum-mode}.
112
113@item
114Outline minor mode provides similar facilities to the major mode
115called Outline mode. @xref{Outline Mode}.
116
117@cindex Overwrite mode
118@cindex mode, Overwrite
119@findex overwrite-mode
120@kindex INSERT
121@item
122Overwrite mode causes ordinary printing characters to replace existing
123text instead of shoving it to the right. For example, if point is in
124front of the @samp{B} in @samp{FOOBAR}, then in Overwrite mode typing
125a @kbd{G} changes it to @samp{FOOGAR}, instead of producing
126@samp{FOOGBAR} as usual. In Overwrite mode, the command @kbd{C-q}
127inserts the next character whatever it may be, even if it is a
128digit---this gives you a way to insert a character instead of
129replacing an existing character. The mode command,
130@code{overwrite-mode}, is bound to the @key{Insert} key.
131
132@findex binary-overwrite-mode
133@item
134Binary Overwrite mode is a variant of Overwrite mode for editing
135binary files; it treats newlines and tabs like other characters, so
136that they overwrite other characters and can be overwritten by them.
137In Binary Overwrite mode, digits after @kbd{C-q} specify an octal
138character code, as usual.
139
140@item
141Visual Line mode performs ``word wrapping'', causing long lines to be
142wrapped at word boundaries. @xref{Visual Line Mode}.
143@end itemize
144
145 Here are some useful global minor modes. Since Line Number mode and
146Transient Mark mode can be enabled or disabled just by setting the
147value of the minor mode variable, you @emph{can} set them differently
148for particular buffers, by explicitly making the corresponding
149variable local in those buffers. @xref{Locals}.
150
151@itemize @bullet
152@item
153Column Number mode enables display of the current column number in the
154mode line. @xref{Mode Line}.
155
156@item
157Delete Selection mode causes text insertion to first delete the text
158in the region, if the region is active. @xref{Using Region}.
159
160@item
161Icomplete mode displays an indication of available completions when
162you are in the minibuffer and completion is active. @xref{Completion
163Options}.
164
165@item
166Line Number mode enables display of the current line number in the
167mode line. It is enabled by default. @xref{Mode Line}.
168
169@item
170Menu Bar mode gives each frame a menu bar. It is enabled by default.
171@xref{Menu Bars}.
172
173@item
174Scroll Bar mode gives each window a scroll bar. It is enabled by
175default, but the scroll bar is only displayed on graphical terminals.
176@xref{Scroll Bars}.
177
178@item
179Tool Bar mode gives each frame a tool bar. It is enabled by default,
180but the tool bar is only displayed on graphical terminals. @xref{Tool
181Bars}.
182
183@item
184Transient Mark mode highlights the region, and makes many Emacs
185commands operate on the region when the mark is active. It is enabled
186by default. @xref{Mark}.
187@end itemize
188
189@node Easy Customization 36@node Easy Customization
190@section Easy Customization Interface 37@section Easy Customization Interface
191 38
@@ -2085,36 +1932,6 @@ invoke it; disabling also applies if the command is invoked using
2085@kbd{M-x}. However, disabling a command has no effect on calling it 1932@kbd{M-x}. However, disabling a command has no effect on calling it
2086as a function from Lisp programs. 1933as a function from Lisp programs.
2087 1934
2088@node Syntax
2089@section The Syntax Table
2090@cindex syntax table
2091
2092 All the Emacs commands which parse words or balance parentheses are
2093controlled by the @dfn{syntax table}. The syntax table says which
2094characters are opening delimiters, which are parts of words, which are
2095string quotes, and so on. It does this by assigning each character to
2096one of fifteen-odd @dfn{syntax classes}. In some cases it specifies
2097some additional information also.
2098
2099 Each major mode has its own syntax table (though related major modes
2100sometimes share one syntax table), which it installs in each buffer
2101that uses the mode. The syntax table installed in the current buffer
2102is the one that all commands use, so we call it ``the'' syntax table.
2103
2104@kindex C-h s
2105@findex describe-syntax
2106 To display a description of the contents of the current syntax
2107table, type @kbd{C-h s} (@code{describe-syntax}). The description of
2108each character includes the string you would have to give to
2109@code{modify-syntax-entry} to set up that character's current syntax,
2110starting with the character which designates its syntax class, plus
2111some English text to explain its meaning.
2112
2113 A syntax table is actually a Lisp object, a char-table, whose
2114elements are cons cells. For full information on the syntax table,
2115see @ref{Syntax Tables,, Syntax Tables, elisp, The Emacs Lisp
2116Reference Manual}.
2117
2118@node Init File 1935@node Init File
2119@section The Init File, @file{~/.emacs} 1936@section The Init File, @file{~/.emacs}
2120@cindex init file 1937@cindex init file
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index ed7d48877e5..a35736f4fe7 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -167,16 +167,15 @@ Important Text-Changing Commands
167* Mark:: The mark: how to delimit a ``region'' of text. 167* Mark:: The mark: how to delimit a ``region'' of text.
168* Killing:: Killing (cutting) text. 168* Killing:: Killing (cutting) text.
169* Yanking:: Recovering killed text. Moving text. (Pasting.) 169* Yanking:: Recovering killed text. Moving text. (Pasting.)
170* Cut and Paste:: Clipboard and selections on graphical displays.
170* Accumulating Text:: Other ways of copying text. 171* Accumulating Text:: Other ways of copying text.
171* Rectangles:: Operating on the text inside a rectangle on the screen. 172* Rectangles:: Operating on text in rectangular areas.
172* CUA Bindings:: Using @kbd{C-x}, @kbd{C-c}, @kbd{C-v} for copy 173* CUA Bindings:: Using @kbd{C-x}, @kbd{C-c}, @kbd{C-v} to kill and yank.
173 and paste, with enhanced rectangle support.
174* Registers:: Saving a text string or a location in the buffer. 174* Registers:: Saving a text string or a location in the buffer.
175* Display:: Controlling what text is displayed. 175* Display:: Controlling what text is displayed.
176* Search:: Finding or replacing occurrences of a string. 176* Search:: Finding or replacing occurrences of a string.
177* Fixit:: Commands especially useful for fixing typos. 177* Fixit:: Commands especially useful for fixing typos.
178* Keyboard Macros:: A keyboard macro records a sequence of 178* Keyboard Macros:: Recording a sequence of keystrokes to be replayed.
179 keystrokes to be replayed with a single command.
180 179
181Major Structures of Emacs 180Major Structures of Emacs
182* Files:: All about handling files. 181* Files:: All about handling files.
@@ -186,13 +185,13 @@ Major Structures of Emacs
186* International:: Using non-@acronym{ASCII} character sets. 185* International:: Using non-@acronym{ASCII} character sets.
187 186
188Advanced Features 187Advanced Features
189* Major Modes:: Text mode vs. Lisp mode vs. C mode... 188* Modes:: Major and minor modes alter Emacs' basic behavior.
190* Indentation:: Editing the white space at the beginnings of lines. 189* Indentation:: Editing the white space at the beginnings of lines.
191* Text:: Commands and modes for editing English. 190* Text:: Commands and modes for editing English.
192* Programs:: Commands and modes for editing programs. 191* Programs:: Commands and modes for editing programs.
193* Building:: Compiling, running and debugging programs. 192* Building:: Compiling, running and debugging programs.
194* Maintaining:: Features for maintaining large programs. 193* Maintaining:: Features for maintaining large programs.
195* Abbrevs:: How to define text abbreviations to reduce 194* Abbrevs:: Defining text abbreviations to reduce
196 the number of characters you must type. 195 the number of characters you must type.
197@c AFAICS, the tex stuff generates its own index and does not use this one. 196@c AFAICS, the tex stuff generates its own index and does not use this one.
198@ifnottex 197@ifnottex
@@ -204,9 +203,9 @@ Advanced Features
204* Dired:: You can ``edit'' a directory to manage files in it. 203* Dired:: You can ``edit'' a directory to manage files in it.
205* Calendar/Diary:: The calendar and diary facilities. 204* Calendar/Diary:: The calendar and diary facilities.
206* Document View:: Viewing PDF, PS and DVI files. 205* Document View:: Viewing PDF, PS and DVI files.
207* Gnus:: How to read netnews with Emacs. 206* Gnus:: A flexible mail and news reader.
208* Shell:: Executing shell commands from Emacs. 207* Shell:: Executing shell commands from Emacs.
209* Emacs Server:: Using Emacs as an editing server for @code{mail}, etc. 208* Emacs Server:: Using Emacs as an editing server.
210* Printing:: Printing hardcopies of buffers or regions. 209* Printing:: Printing hardcopies of buffers or regions.
211* Sorting:: Sorting lines, paragraphs or pages within Emacs. 210* Sorting:: Sorting lines, paragraphs or pages within Emacs.
212* Narrowing:: Restricting display and editing to a portion 211* Narrowing:: Restricting display and editing to a portion
@@ -331,6 +330,12 @@ Yanking
331* Appending Kills:: Several kills in a row all yank together. 330* Appending Kills:: Several kills in a row all yank together.
332* Earlier Kills:: Yanking something killed some time ago. 331* Earlier Kills:: Yanking something killed some time ago.
333 332
333Killing and Yanking on Graphical Displays
334
335* Clipboard:: How Emacs interacts with the system clipboard.
336* Primary Selection:: The temporarily selected text selection.
337* Secondary Selection:: Cutting without altering point and mark.
338
334Registers 339Registers
335 340
336* RegPos:: Saving positions in registers. 341* RegPos:: Saving positions in registers.
@@ -495,7 +500,8 @@ Multiple Windows
495 500
496Frames and Graphical Displays 501Frames and Graphical Displays
497 502
498* Cut and Paste:: Mouse commands for cut and paste. 503* Mouse Commands:: Moving, cutting, and pasting, with the mouse.
504* Word and Line Mouse:: Mouse commands for selecting whole words or lines.
499* Mouse References:: Using the mouse to select an item from a list. 505* Mouse References:: Using the mouse to select an item from a list.
500* Menu Mouse Clicks:: Mouse clicks that bring up menus. 506* Menu Mouse Clicks:: Mouse clicks that bring up menus.
501* Mode Line Mouse:: Mouse clicks on the mode line. 507* Mode Line Mouse:: Mouse clicks on the mode line.
@@ -517,14 +523,6 @@ Frames and Graphical Displays
517* Non-Window Terminals:: Multiple frames on terminals that show only one. 523* Non-Window Terminals:: Multiple frames on terminals that show only one.
518* Text-Only Mouse:: Using the mouse in text-only terminals. 524* Text-Only Mouse:: Using the mouse in text-only terminals.
519 525
520Killing and Yanking on Graphical Displays
521
522* Mouse Commands:: Moving, cutting, and pasting, with the mouse.
523* Word and Line Mouse:: Mouse commands for selecting whole words or lines.
524* Cut/Paste Other App:: Transfering text between Emacs and other apps.
525* Secondary Selection:: Cutting without altering point and mark.
526* Clipboard:: Using the clipboard for selections.
527
528International Character Set Support 526International Character Set Support
529 527
530* International Chars:: Basic concepts of multibyte characters. 528* International Chars:: Basic concepts of multibyte characters.
@@ -551,9 +549,12 @@ International Character Set Support
551 to use without multibyte characters. 549 to use without multibyte characters.
552* Charsets:: How Emacs groups its internal character codes. 550* Charsets:: How Emacs groups its internal character codes.
553 551
554Major Modes 552Modes
555 553
556* Choosing Modes:: How major modes are specified or chosen. 554* Major Modes:: Text mode vs. Lisp mode vs. C mode...
555* Minor Modes:: Each minor mode is a feature you can turn on
556 independently of any others.
557* Choosing Modes:: How modes are chosen when visiting files.
557 558
558Indentation 559Indentation
559 560
@@ -585,8 +586,6 @@ Filling Text
585* Fill Prefix:: Filling paragraphs that are indented 586* Fill Prefix:: Filling paragraphs that are indented
586 or in a comment, etc. 587 or in a comment, etc.
587* Adaptive Fill:: How Emacs can determine the fill prefix automatically. 588* Adaptive Fill:: How Emacs can determine the fill prefix automatically.
588* Refill:: Keeping paragraphs filled.
589* Longlines:: Editing text with very long lines.
590 589
591Outline Mode 590Outline Mode
592 591
@@ -1062,16 +1061,12 @@ Hyperlinking and Navigation Features
1062 1061
1063Customization 1062Customization
1064 1063
1065* Minor Modes:: Each minor mode is a feature you can turn on
1066 independently of any others.
1067* Easy Customization:: Convenient way to browse and change settings. 1064* Easy Customization:: Convenient way to browse and change settings.
1068* Variables:: Many Emacs commands examine Emacs variables 1065* Variables:: Many Emacs commands examine Emacs variables
1069 to decide what to do; by setting variables, 1066 to decide what to do; by setting variables,
1070 you can control their functioning. 1067 you can control their functioning.
1071* Key Bindings:: The keymaps say what command each key runs. 1068* Key Bindings:: Keymaps say what command each key runs.
1072 By changing them, you can "redefine keys". 1069 By changing them, you can ``redefine'' keys.
1073* Syntax:: The syntax table controls how words and
1074 expressions are parsed.
1075* Init File:: How to write common customizations in the 1070* Init File:: How to write common customizations in the
1076 @file{.emacs} file. 1071 @file{.emacs} file.
1077 1072
@@ -1491,7 +1486,7 @@ Lisp programming.
1491@include windows.texi 1486@include windows.texi
1492@include frames.texi 1487@include frames.texi
1493@include mule.texi 1488@include mule.texi
1494@include major.texi 1489@include modes.texi
1495@include indent.texi 1490@include indent.texi
1496@include text.texi 1491@include text.texi
1497@c Includes fortran-xtra. 1492@c Includes fortran-xtra.
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index 633b65251e4..0fc4dfa427d 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -33,7 +33,8 @@ so that you can use many of the features described in this chapter.
33@end ifnottex 33@end ifnottex
34 34
35@menu 35@menu
36* Cut and Paste:: Mouse commands for cut and paste. 36* Mouse Commands:: Moving, cutting, and pasting, with the mouse.
37* Word and Line Mouse:: Mouse commands for selecting whole words or lines.
37* Mouse References:: Using the mouse to select an item from a list. 38* Mouse References:: Using the mouse to select an item from a list.
38* Menu Mouse Clicks:: Mouse clicks that bring up menus. 39* Menu Mouse Clicks:: Mouse clicks that bring up menus.
39* Mode Line Mouse:: Mouse clicks on the mode line. 40* Mode Line Mouse:: Mouse clicks on the mode line.
@@ -56,22 +57,8 @@ so that you can use many of the features described in this chapter.
56* Text-Only Mouse:: Using the mouse in text-only terminals. 57* Text-Only Mouse:: Using the mouse in text-only terminals.
57@end menu 58@end menu
58 59
59@node Cut and Paste
60@section Cutting and Pasting on Graphical Displays
61
62 This section describes commands for selecting a region, cutting, and
63pasting using the mouse.
64
65@menu
66* Mouse Commands:: Moving, cutting, and pasting, with the mouse.
67* Word and Line Mouse:: Mouse commands for selecting whole words or lines.
68* Cut/Paste Other App:: Transfering text between Emacs and other apps.
69* Secondary Selection:: Cutting without altering point and mark.
70* Clipboard:: Using the clipboard for selections.
71@end menu
72
73@node Mouse Commands 60@node Mouse Commands
74@subsection Mouse Commands for Editing 61@section Mouse Commands for Editing
75@cindex mouse buttons (what they do) 62@cindex mouse buttons (what they do)
76 63
77@kindex Mouse-1 64@kindex Mouse-1
@@ -141,7 +128,7 @@ variable @code{mouse-yank-at-point} to a non-@code{nil} value,
141@kbd{Mouse-2} does not move point. Then it does not matter where you 128@kbd{Mouse-2} does not move point. Then it does not matter where you
142click, or even which of the frame's windows you click on; the yank 129click, or even which of the frame's windows you click on; the yank
143occurs at the existing point. This variable also affects yanking the 130occurs at the existing point. This variable also affects yanking the
144primary and secondary selections (@pxref{Cut/Paste Other App}). 131primary and secondary selections (@pxref{Primary Selection}).
145 132
146@findex mouse-save-then-kill 133@findex mouse-save-then-kill
147 Clicking with the right mouse button, @kbd{Mouse-3}, runs the 134 Clicking with the right mouse button, @kbd{Mouse-3}, runs the
@@ -195,7 +182,7 @@ make Emacs behave this way by enabling Delete Selection mode.
195@xref{Using Region}. 182@xref{Using Region}.
196 183
197@node Word and Line Mouse 184@node Word and Line Mouse
198@subsection Mouse Commands for Words and Lines 185@section Mouse Commands for Words and Lines
199 186
200 These variants of @kbd{Mouse-1} select entire words or lines at a 187 These variants of @kbd{Mouse-1} select entire words or lines at a
201time. Emacs activates the region around the selected text, which is 188time. Emacs activates the region around the selected text, which is
@@ -224,164 +211,6 @@ Select the line you click on.
224Select the text you drag across, in the form of whole lines. 211Select the text you drag across, in the form of whole lines.
225@end table 212@end table
226 213
227@node Cut/Paste Other App
228@subsection Cut and Paste with Other Window Applications
229
230@cindex X cutting and pasting
231@cindex X selection
232@cindex primary selection
233@cindex selection, primary
234 When running Emacs under the X window system, you can easily
235transfer text between Emacs and other X applications using the
236@dfn{primary selection} (also called the @dfn{X selection}). This is
237@emph{not} the same thing as the @dfn{clipboard}, which is a separate
238facility used on desktop environments such as Gnome, and on operating
239systems such as Microsoft Windows (@pxref{Clipboard}).
240
241 Under X, whenever you select some text in Emacs by dragging or
242clicking the mouse (@pxref{Mouse Commands}), it is also saved in the
243primary selection. You can then @dfn{paste} that text into any other
244X application, usually by clicking @kbd{Mouse-2} in that application.
245Unlike the Emacs kill ring (@pxref{Kill Ring}), the primary selection
246has no ``memory'': each time you save something in the primary
247selection, either in Emacs or in another X application, the previous
248contents of the primary selection are lost.
249
250@cindex MS-Windows, and primary selection
251 MS-Windows provides no primary selection, but Emacs emulates it
252within a single Emacs session, by storing the selected text
253internally. Therefore, all the features and commands related to the
254primary selection work on Windows as they do on X, for cutting and
255pasting within the same session, but not across Emacs sessions or with
256other applications.
257
258 Whenever you kill some text using a command such as @kbd{C-w}
259(@code{kill-region}), or copy it into the kill ring using a command
260such as @kbd{M-w} (@code{kill-ring-save}), that text is also saved in
261the primary selection. @xref{Killing}.
262
263@vindex select-active-regions
264 If you set the region using the keyboard---for instance, by typing
265@kbd{C-@key{SPC}} and moving point away from the mark---the text in
266the region is not normally saved to the primary selection. However,
267if you change the variable @code{select-active-regions} to @code{t},
268the region is saved to the primary selection whenever you activate the
269mark. Each change to the region also updates the primary selection.
270
271@vindex yank-pop-change-selection
272 If you change @code{yank-pop-change-selection} to @code{t}, rotating
273the kill ring with @kbd{M-y} (@code{yank-pop}) also saves the new yank
274to the primary selection (@pxref{Yanking}).
275
276@vindex save-interprogram-paste-before-kill
277 If you change @code{save-interprogram-paste-before-kill} to
278@code{t}, each kill command first saves the existing selection onto
279the kill ring. This prevents you from losing the existing selection,
280at the risk of large memory consumption if other applications generate
281large selections.
282
283 You can yank the primary selection into Emacs using the usual yank
284commands, such as @kbd{C-y} (@code{yank}) and @kbd{Mouse-2}
285(@code{mouse-yank-at-click}). These commands actually check the
286primary selection before referring to the kill ring; if no primary
287selection is available, the kill ring contents are used. To prevent
288yank commands from accessing the primary selection, set the variable
289@code{x-select-enable-primary} to @code{nil}.
290
291 The standard coding system for the primary selection is
292@code{compound-text-with-extensions}. You may find that the pasted
293text is not what you expected. In such a case, you can specify
294another coding system for the selection by typing @kbd{C-x @key{RET}
295x} or @kbd{C-x @key{RET} X}. Alternatively, you can request a
296different data type by modifying the variable
297@code{x-select-request-type}. @xref{Communication Coding}.
298
299@node Secondary Selection
300@subsection Secondary Selection
301@cindex secondary selection
302
303 In addition to the primary selection, the X Window System provides a
304second similar facility known as the @dfn{secondary selection}.
305Nowadays, few X applications make use of the secondary selection, but
306you can access it using the following Emacs commands:
307
308@table @kbd
309@findex mouse-set-secondary
310@kindex M-Drag-Mouse-1
311@item M-Drag-Mouse-1
312Set the secondary selection, with one end at the place where you press
313down the button, and the other end at the place where you release it
314(@code{mouse-set-secondary}). The selected text is highlighted, using
315the @code{secondary-selection} face, as you drag. The window scrolls
316automatically if you drag the mouse off the top or bottom of the
317window, just like @code{mouse-set-region} (@pxref{Mouse Commands}).
318
319This command does not alter the kill ring.
320
321@findex mouse-start-secondary
322@kindex M-Mouse-1
323@item M-Mouse-1
324Set one endpoint for the @dfn{secondary selection}
325(@code{mouse-start-secondary}).
326
327@findex mouse-secondary-save-then-kill
328@kindex M-Mouse-3
329@item M-Mouse-3
330Set the secondary selection, with one end at the position clicked and
331the other at the position specified with @kbd{M-Mouse-1}
332(@code{mouse-secondary-save-then-kill}). This also puts the selected
333text in the kill ring. A second @kbd{M-Mouse-3} at the same place
334kills the secondary selection just made.
335
336@findex mouse-yank-secondary
337@kindex M-Mouse-2
338@item M-Mouse-2
339Insert the secondary selection where you click, placing point at the
340end of the yanked text (@code{mouse-yank-secondary}).
341@end table
342
343Double or triple clicking of @kbd{M-Mouse-1} operates on words and
344lines, much like @kbd{Mouse-1}.
345
346If @code{mouse-yank-at-point} is non-@code{nil}, @kbd{M-Mouse-2} yanks
347at point. Then it does not matter precisely where you click, or even
348which of the frame's windows you click on. @xref{Mouse Commands}.
349
350@node Clipboard
351@subsection Using the Clipboard
352@cindex clipboard
353
354 In desktop environments such as Gnome, and operating systems such as
355Microsoft Windows and Mac OS X, you can transfer data (usually text)
356between different applications using the @dfn{clipboard}. The
357clipboard is distinct from the primary selection and secondary
358selection discussed earlier. You can access the clipboard through the
359@samp{Edit} menu of the menu bar (@pxref{Menu Bar}).
360
361@cindex cut
362@findex clipboard-kill-region
363 The command @code{clipboard-kill-region}, which is bound to the
364@code{Cut} menu item, kills the region and saves it in the clipboard.
365
366@cindex copy
367@findex clipboard-kill-ring-save
368 The command @code{clipboard-kill-ring-save}, which is bound to the
369@code{Copy} menu item, copies the region to the kill ring and saves it
370in the clipboard.
371
372@findex clipboard-yank
373@cindex paste
374 The @code{Paste} menu item in the Edit menu yanks the contents of
375the clipboard at point (@code{clipboard-yank}).
376
377@vindex x-select-enable-clipboard
378 You can customize the variable @code{x-select-enable-clipboard} to
379make the Emacs yank functions consult the clipboard before the primary
380selection, and to make the kill functions to store in the clipboard as
381well as the primary selection. Otherwise, these commands do not
382access the clipboard at all. Using the clipboard is the default on
383MS-Windows and Mac OS, but not on other systems.
384
385@node Mouse References 214@node Mouse References
386@section Following References with the Mouse 215@section Following References with the Mouse
387@kindex Mouse-1 @r{(selection)} 216@kindex Mouse-1 @r{(selection)}
diff --git a/doc/emacs/glossary.texi b/doc/emacs/glossary.texi
index 3cf1cc522bf..e37e80bfab8 100644
--- a/doc/emacs/glossary.texi
+++ b/doc/emacs/glossary.texi
@@ -962,7 +962,7 @@ special Emacs commands for moving over and operating on paragraphs.
962@item Parsing 962@item Parsing
963We say that certain Emacs commands parse words or expressions in the 963We say that certain Emacs commands parse words or expressions in the
964text being edited. Really, all they know how to do is find the other 964text being edited. Really, all they know how to do is find the other
965end of a word or expression. @xref{Syntax}. 965end of a word or expression.
966 966
967@item Point 967@item Point
968Point is the place in the buffer at which insertion and deletion 968Point is the place in the buffer at which insertion and deletion
@@ -1212,7 +1212,8 @@ See `font lock.'
1212@item Syntax Table 1212@item Syntax Table
1213The syntax table tells Emacs which characters are part of a word, 1213The syntax table tells Emacs which characters are part of a word,
1214which characters balance each other like parentheses, etc. 1214which characters balance each other like parentheses, etc.
1215@xref{Syntax}. 1215@xref{Syntax Tables,, Syntax Tables, elisp, The Emacs Lisp Reference
1216Manual}.
1216 1217
1217@item Super 1218@item Super
1218Super is the name of a modifier bit that a keyboard input character may 1219Super is the name of a modifier bit that a keyboard input character may
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi
index e00f8b9115a..76a9f2413b1 100644
--- a/doc/emacs/help.texi
+++ b/doc/emacs/help.texi
@@ -139,8 +139,11 @@ command.
139@item C-h r 139@item C-h r
140Display the Emacs manual in Info (@code{info-emacs-manual}). 140Display the Emacs manual in Info (@code{info-emacs-manual}).
141@item C-h s 141@item C-h s
142Display the current contents of the syntax table, with an explanation of 142Display the current contents of the @dfn{syntax table}, with an
143what they mean (@code{describe-syntax}). @xref{Syntax}. 143explanation of what they mean (@code{describe-syntax}). The syntax
144table says which characters are opening delimiters, which are parts of
145words, which are string quotes, and so on. @xref{Syntax Tables,,
146Syntax Tables, elisp, The Emacs Lisp Reference Manual}, for details.
144@item C-h t 147@item C-h t
145Enter the Emacs interactive tutorial (@code{help-with-tutorial}). 148Enter the Emacs interactive tutorial (@code{help-with-tutorial}).
146@item C-h v @var{var} @key{RET} 149@item C-h v @var{var} @key{RET}
@@ -583,7 +586,8 @@ bindings now in effect: first the local bindings of the current minor
583modes, then the local bindings defined by the current major mode, and 586modes, then the local bindings defined by the current major mode, and
584finally the global bindings (@pxref{Key Bindings}). @kbd{C-h s} 587finally the global bindings (@pxref{Key Bindings}). @kbd{C-h s}
585displays the contents of the syntax table, with explanations of each 588displays the contents of the syntax table, with explanations of each
586character's syntax (@pxref{Syntax}). 589character's syntax (@pxref{Syntax Tables,, Syntax Tables, elisp, The
590Emacs Lisp Reference Manual}).
587 591
588 You can get a list of subcommands for a particular prefix key by 592 You can get a list of subcommands for a particular prefix key by
589typing @kbd{C-h} after the prefix key. (There are a few prefix keys 593typing @kbd{C-h} after the prefix key. (There are a few prefix keys
diff --git a/doc/emacs/indent.texi b/doc/emacs/indent.texi
index c4ef4781aaf..e13b2808f09 100644
--- a/doc/emacs/indent.texi
+++ b/doc/emacs/indent.texi
@@ -2,7 +2,7 @@
2@c Copyright (C) 1985-1987, 1993-1995, 1997, 2001-2011 2@c Copyright (C) 1985-1987, 1993-1995, 1997, 2001-2011
3@c Free Software Foundation, Inc. 3@c Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions. 4@c See file emacs.texi for copying conditions.
5@node Indentation, Text, Major Modes, Top 5@node Indentation, Text, Modes, Top
6@chapter Indentation 6@chapter Indentation
7@cindex indentation 7@cindex indentation
8@cindex tabs 8@cindex tabs
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi
index 41262e9c2d8..38124fc315a 100644
--- a/doc/emacs/killing.texi
+++ b/doc/emacs/killing.texi
@@ -6,20 +6,24 @@
6@node Killing, Registers, Mark, Top 6@node Killing, Registers, Mark, Top
7@chapter Killing and Moving Text 7@chapter Killing and Moving Text
8 8
9 @dfn{Killing} means erasing text and copying it into the @dfn{kill 9 In Emacs, @dfn{killing} means erasing text and copying it into the
10ring}, from which you can bring it back into the buffer by 10@dfn{kill ring}. @dfn{Yanking} means bringing text from the kill ring
11@dfn{yanking} it. (Some applications use the terms ``cutting'' and 11back into the buffer. (Some applications use the terms ``cutting''
12``pasting'' for similar operations.) This is the most common way of 12and ``pasting'' for similar operations.) The kill ring is so-named
13moving or copying text within Emacs. It is very versatile, because 13because it can be visualized as a set of blocks of text arranged in a
14there are commands for killing many different types of syntactic 14ring, which you can access in cyclic order. @xref{Kill Ring}.
15units. 15
16 Killing and yanking are the most common way to move or copy text
17within Emacs. It is very versatile, because there are commands for
18killing many different types of syntactic units.
16 19
17@menu 20@menu
18* Deletion and Killing:: Commands that remove text. 21* Deletion and Killing:: Commands that remove text.
19* Yanking:: Commands that insert text. 22* Yanking:: Commands that insert text.
23* Cut and Paste:: Clipboard and selections on graphical displays.
20* Accumulating Text:: Other methods to add text to the buffer. 24* Accumulating Text:: Other methods to add text to the buffer.
21* Rectangles:: Operating on text in rectangular areas. 25* Rectangles:: Operating on text in rectangular areas.
22* CUA Bindings:: Using C-x/C-c/C-v to kill and yank. 26* CUA Bindings:: Using @kbd{C-x}/@kbd{C-c}/@kbd{C-v} to kill and yank.
23@end menu 27@end menu
24 28
25@node Deletion and Killing 29@node Deletion and Killing
@@ -29,25 +33,28 @@ units.
29@cindex cutting text 33@cindex cutting text
30@cindex deletion 34@cindex deletion
31 Most commands which erase text from the buffer save it in the kill 35 Most commands which erase text from the buffer save it in the kill
32ring. These are known as @dfn{kill} commands. The kill ring stores 36ring. These are known as @dfn{kill} commands, and their names
33several recent kills, not just the last one, so killing is a very safe 37normally contain the word @samp{kill} (e.g. @code{kill-line}). The
34operation: when you make a new kill, you don't have to worry much 38kill ring stores several recent kills, not just the last one, so
35about losing text that you previously killed. 39killing is a very safe operation: you don't have to worry much about
40losing text that you previously killed. The kill ring is shared by
41all buffers, so text that is killed in one buffer can be yanked into
42another buffer.
43
44 When you use @kbd{C-/} (@code{undo}) to undo a kill command
45(@pxref{Undo}), that brings the killed text back into the buffer, but
46does not remove it from the kill ring.
36 47
37 You can yank text from the kill ring into any position in a buffer, 48 On graphical displays, killing text also copies it to the system
38including a position in a different buffer; the kill ring is shared by 49clipboard. @xref{Cut and Paste}.
39all buffers. The @kbd{C-/} (@code{undo}) command can undo both kill
40and delete commands (@pxref{Undo}); the importance of the kill ring is
41that you can yank the text in a different place.
42 50
43 Commands that erase text but do not save it in the kill ring are 51 Commands that erase text but do not save it in the kill ring are
44known as @dfn{delete} commands. These include @kbd{C-d} 52known as @dfn{delete} commands; their names usually contain the word
45(@code{delete-char}) and @key{DEL} (@code{delete-backward-char}), 53@samp{delete}. These include @kbd{C-d} (@code{delete-char}) and
46which delete only one character at a time, and those commands that 54@key{DEL} (@code{delete-backward-char}), which delete only one
47delete only spaces or newlines. Commands that can erase significant 55character at a time, and those commands that delete only spaces or
48amounts of nontrivial data generally do a kill operation instead. The 56newlines. Commands that can erase significant amounts of nontrivial
49commands' names and individual descriptions use the words @samp{kill} 57data generally do a kill operation instead.
50and @samp{delete} to say which kind of operation they perform.
51 58
52 You can also use the mouse to kill and yank. @xref{Cut and Paste}. 59 You can also use the mouse to kill and yank. @xref{Cut and Paste}.
53 60
@@ -127,21 +134,22 @@ Kill an entire line at once (@code{kill-whole-line})
127 134
128@kindex C-k 135@kindex C-k
129@findex kill-line 136@findex kill-line
130 The simplest kill command is @kbd{C-k}. If given at the beginning 137 The simplest kill command is @kbd{C-k} (@code{kill-line}). If used
131of a line, it kills all the text on the line@footnote{Here, ``line'' 138at the end of a line, it kills the line-ending newline character,
132means a logical text line, not a screen line. @xref{Continuation 139merging the next line into the current one (thus, a blank line is
133Lines}.}, leaving it blank. When used on a blank line, it kills the 140entirely removed). Otherwise, @kbd{C-k} kills all the text from point
134whole line including its newline. 141up to the end of the line; if point was originally at the beginning of
135 142the line, this leaves the line blank.
136 More precisely, @kbd{C-k} kills from point up to the end of the 143
137line, unless it is at the end of a line. In that case it kills the 144 Spaces and tabs at the end of the line are ignored when deciding
138newline following point, thus merging the next line into the current 145which case applies. As long as point is after the last visible
139one. Spaces and tabs at the end of the line are ignored when deciding
140which case applies, so as long as point is after the last visible
141character in the line, you can be sure that @kbd{C-k} will kill the 146character in the line, you can be sure that @kbd{C-k} will kill the
142newline. To kill an entire non-blank line, go to the beginning and 147newline. To kill an entire non-blank line, go to the beginning and
143type @kbd{C-k} twice. 148type @kbd{C-k} twice.
144 149
150 In this context, ``line'' means a logical text line, not a screen
151line (@pxref{Continuation Lines}).
152
145 When @kbd{C-k} is given a positive argument @var{n}, it kills 153 When @kbd{C-k} is given a positive argument @var{n}, it kills
146@var{n} lines and the newlines that follow them (text on the current 154@var{n} lines and the newlines that follow them (text on the current
147line before point is not killed). With a negative argument 155line before point is not killed). With a negative argument
@@ -157,10 +165,10 @@ following newline. This variable is normally @code{nil}.
157 165
158@kindex C-S-backspace 166@kindex C-S-backspace
159@findex kill-whole-line 167@findex kill-whole-line
160 @kbd{C-S-backspace} (@code{kill-whole-line}) will kill a whole line 168 @kbd{C-S-backspace} (@code{kill-whole-line}) kills a whole line
161including its newline regardless of the position of point within the 169including its newline, regardless of the position of point within the
162line. Note that many character terminals will prevent you from typing 170line. Note that many text terminals will prevent you from typing the
163the key sequence @kbd{C-S-backspace}. 171key sequence @kbd{C-S-backspace}.
164 172
165@node Other Kill Commands 173@node Other Kill Commands
166@subsection Other Kill Commands 174@subsection Other Kill Commands
@@ -196,10 +204,8 @@ last set. The mark is deactivated at the end of the command.
196 204
197@kindex M-w 205@kindex M-w
198@findex kill-ring-save 206@findex kill-ring-save
199 The command @kbd{M-w} (@code{kill-ring-save}) copies the region into 207 @kbd{M-w} (@code{kill-ring-save}) copies the region into the kill
200the kill ring without removing it from the buffer. This is 208ring without removing it from the buffer.
201approximately equivalent to @kbd{C-w} followed by @kbd{C-/}, except
202that @kbd{M-w} does not alter the undo history.
203 209
204 Emacs also provides commands to kill specific syntactic units: 210 Emacs also provides commands to kill specific syntactic units:
205words, with @kbd{M-@key{DEL}} and @kbd{M-d} (@pxref{Words}); balanced 211words, with @kbd{M-@key{DEL}} and @kbd{M-d} (@pxref{Words}); balanced
@@ -220,12 +226,10 @@ search backward and kill text before point.
220@vindex kill-read-only-ok 226@vindex kill-read-only-ok
221@cindex read-only text, killing 227@cindex read-only text, killing
222 Some specialized buffers contain @dfn{read-only text}, which cannot 228 Some specialized buffers contain @dfn{read-only text}, which cannot
223be modified and therefore cannot be killed. But some users like to 229be modified and therefore cannot be killed. The kill commands work
224use the kill commands to copy read-only text into the kill ring, 230specially in a read-only buffer: they move over text and copy it to
225without actually changing it. Therefore, the kill commands work
226specially in a read-only buffer: they move over text, and copy it to
227the kill ring, without actually deleting it from the buffer. 231the kill ring, without actually deleting it from the buffer.
228Normally, kill commands beep and display an error message when this 232Normally, they also beep and display an error message when this
229happens. But if you set the variable @code{kill-read-only-ok} to a 233happens. But if you set the variable @code{kill-read-only-ok} to a
230non-@code{nil} value, they just print a message in the echo area to 234non-@code{nil} value, they just print a message in the echo area to
231explain why the text has not been erased. 235explain why the text has not been erased.
@@ -257,10 +261,16 @@ Replace text just yanked with an earlier batch of killed text
257Append next kill to last batch of killed text (@code{append-next-kill}). 261Append next kill to last batch of killed text (@code{append-next-kill}).
258@end table 262@end table
259 263
260 On graphical displays with window systems, if there is a current 264@cindex yanking and text properties
261selection in some other application, and you selected it more recently 265@vindex yank-excluded-properties
262than you killed any text in Emacs, @kbd{C-y} copies the selection 266 The yank commands discard certain properties from the yanked text.
263instead of text killed within Emacs. 267These are properties that might lead to annoying results, such as
268causing the text to respond to the mouse or specifying key bindings.
269The list of properties to discard is stored in the variable
270@code{yank-excluded-properties}. These properties are also discarded
271when yanking register contents and rectangles. @xref{Text
272Properties,,, elisp, the Emacs Lisp Reference Manual}, for more
273information about text properties.
264 274
265@menu 275@menu
266* Kill Ring:: Where killed text is stored. Basic yanking. 276* Kill Ring:: Where killed text is stored. Basic yanking.
@@ -271,38 +281,34 @@ instead of text killed within Emacs.
271@node Kill Ring 281@node Kill Ring
272@subsection The Kill Ring 282@subsection The Kill Ring
273 283
274 All killed text is recorded in the @dfn{kill ring}, a list of blocks 284 The @dfn{kill ring} is a list of blocks of text that were previously
275of text that have been killed. There is only one kill ring, shared by 285killed. There is only one kill ring, shared by all buffers, so you
276all buffers, so you can kill text in one buffer and yank it in another 286can kill text in one buffer and yank it in another buffer. This is
277buffer. This is the usual way to move text from one file to another. 287the usual way to move text from one file to another. (There are
278(There are several other methods: for instance, you could store the 288several other methods: for instance, you could store the text in a
279text in a register. @xref{Registers}, for information about 289register; see @ref{Registers}. @xref{Accumulating Text}, for some
280registers. @xref{Accumulating Text}, for some other ways to move text 290other ways to move text around.)
281around.)
282 291
283@kindex C-y 292@kindex C-y
284@findex yank 293@findex yank
285 The command @kbd{C-y} (@code{yank}) reinserts the text of the most 294 @kbd{C-y} (@code{yank}) reinserts the text of the most recent kill,
286recent kill, leaving the cursor at the end of the text. It also adds 295leaving the cursor at the end of the text. It also adds the position
287the position of the beginning of the text to the mark ring, without 296of the beginning of the text to the mark ring, without activating the
288activating the mark; this allows you to jump easily to that position 297mark; this allows you to jump easily to that position with @kbd{C-x
289with @kbd{C-x C-x} (@pxref{Setting Mark}). With a plain prefix 298C-x} (@pxref{Setting Mark}).
290argument (@kbd{C-u C-y}), it instead leaves the cursor in front of the 299
291text, and adds the position of the end of the text to the mark ring. 300 On graphical displays, @kbd{C-y} first checks if another application
292Using other sort of prefix argument specifies an earlier kill; for 301has placed any text in the system clipboard more recently than the
293example, @kbd{C-u 4 C-y} reinserts the fourth most recent kill. 302last Emacs kill. If so, it inserts from the clipboard instead of the
294@xref{Earlier Kills}. 303kill ring. Conceptually, you can think of the clipboard as an
295 304``extra'' entry in the kill ring, which is present if you recently cut
296@cindex yanking and text properties 305or copied some text in another application. @xref{Cut and Paste}.
297@vindex yank-excluded-properties 306
298 The yank commands discard certain properties from the yanked text. 307 With a plain prefix argument (@kbd{C-u C-y}), the @code{yank}
299These are properties that might lead to annoying results, such as 308command instead leaves the cursor in front of the text, and adds the
300causing the text to respond to the mouse or specifying key bindings. 309position of the end of the text to the mark ring. Using any other
301The list of properties to discard is stored in the variable 310prefix argument specifies an earlier kill; for example, @kbd{C-u 4
302@code{yank-excluded-properties}. Yanking of register contents and 311C-y} reinserts the fourth most recent kill. @xref{Earlier Kills}.
303rectangles also discard these properties. @xref{Text Properties,,,
304elisp, the Emacs Lisp Reference Manual}, for more information about
305text properties.
306 312
307@node Appending Kills 313@node Appending Kills
308@subsection Appending Kills 314@subsection Appending Kills
@@ -418,6 +424,177 @@ saved.
418@code{kill-ring}; you can view the entire contents of the kill ring with 424@code{kill-ring}; you can view the entire contents of the kill ring with
419the command @kbd{C-h v kill-ring}. 425the command @kbd{C-h v kill-ring}.
420 426
427@node Cut and Paste
428@section ``Cut and Paste'' Operations on Graphical Displays
429@cindex cut
430@cindex copy
431@cindex paste
432
433 In most graphical desktop environments, you can transfer data
434(usually text) between different applications using a system facility
435called the @dfn{clipboard}. On X, two other similar facilities are
436available: the primary selection and the secondary selection. When
437Emacs is run on a graphical display, its kill and yank commands
438integrate with these facilities, so that you can easily transfer text
439between Emacs and other graphical applications.
440
441 By default, Emacs uses UTF-8 as the coding system for inter-program
442text transfers. If you find that the pasted text is not what you
443expected, you can specify another coding system by typing @kbd{C-x
444@key{RET} x} or @kbd{C-x @key{RET} X}. You can also request a
445different data type by customizing @code{x-select-request-type}.
446@xref{Communication Coding}.
447
448@menu
449* Clipboard:: How Emacs uses the system clipboard.
450* Primary Selection:: The temporarily selected text selection.
451* Secondary Selection:: Cutting without altering point and mark.
452@end menu
453
454@node Clipboard
455@subsection Using the Clipboard
456@cindex clipboard
457
458 The @dfn{clipboard} is the facility that most graphical applications
459use for ``cutting and pasting''. When the clipboard exists, the kill
460and yank commands in Emacs make use of it.
461
462 When you kill some text with a command such as @kbd{C-w}
463(@code{kill-region}), or copy it to the kill ring with a command such
464as @kbd{M-w} (@code{kill-ring-save}), that text is also put in the
465clipboard. @xref{Killing}.
466
467@vindex save-interprogram-paste-before-kill
468 When an Emacs kill command puts text in the clipboard, the existing
469clipboard contents are normally lost. Optionally, you can change
470@code{save-interprogram-paste-before-kill} to @code{t}. Then Emacs
471will first save the clipboard to its kill ring, preventing you from
472losing the old clipboard data---at the risk of high memory consumption
473if that data turns out to be large.
474
475 The usual yank commands, such as @kbd{C-y} (@code{yank}), also use
476the clipboard. If another application ``owns'' the clipboard---i.e.,
477if you cut or copied text there more recently than your last kill
478command in Emacs---then Emacs yanks from the clipboard instead of the
479kill ring. Otherwise, it yanks from the kill ring, as described in
480@ref{Yanking}.
481
482@vindex yank-pop-change-selection
483 Normally, rotating the kill ring with @kbd{M-y} (@code{yank-pop})
484does not alter the clipboard. However, if you change
485@code{yank-pop-change-selection} to @code{t}, then @kbd{M-y} saves the
486new yank to the clipboard.
487
488@vindex x-select-enable-clipboard
489 To prevent kill and yank commands from accessing the clipboard,
490change the variable @code{x-select-enable-clipboard} to @code{nil}.
491
492@vindex x-select-enable-primary
493@findex clipboard-kill-region
494@findex clipboard-kill-ring-save
495@findex clipboard-yank
496 Prior to Emacs 24, the kill and yank commands used the primary
497selection (@pxref{Primary Selection}), not the clipboard. If you
498prefer this behavior, change @code{x-select-enable-clipboard} to
499@code{nil}, @code{x-select-enable-primary} to @code{t}, and
500@code{mouse-drag-copy-region} to @code{t}. In this case, you can use
501the following commands to act explicitly on the clipboard:
502@code{clipboard-kill-region} kills the region and saves it to the
503clipboard; @code{clipboard-kill-ring-save} copies the region to the
504kill ring and saves it to the clipboard; and @code{clipboard-yank}
505yanks the contents of the clipboard at point.
506
507@node Primary Selection
508@subsection Cut and Paste with Other Window Applications
509@cindex X cutting and pasting
510@cindex X selection
511@cindex primary selection
512@cindex selection, primary
513
514 Under the X window system, there exists a @dfn{primary selection}
515containing the last stretch of text selected in an X application
516(usually by dragging the mouse). Typically, this text can be inserted
517into other X applications by @kbd{mouse-2} clicks. The primary
518selection is separate from the clipboard (@pxref{Clipboard}). Its
519contents are more ``fragile''; they are overwritten by any mouse
520selection, whereas the clipboard is only overwritten by explicit
521``cut'' or ``copy'' commands.
522
523 Under X, whenever you select some text in Emacs by dragging or
524clicking the mouse (@pxref{Mouse Commands}), it is also saved to the
525primary selection.
526
527@vindex select-active-regions
528 If you set the region using the keyboard---for instance, by typing
529@kbd{C-@key{SPC}} and moving point away from the mark---the text in
530the region is also saved to the primary selection. (The updating of
531the primary selection is done at the end of each command, as long as
532the region is active and non-empty.) To disable this behavior, change
533the variable @code{select-active-regions} to @code{nil}.
534
535 To insert the primary selection into an Emacs buffer, click
536@kbd{mouse-2} (@code{mouse-yank-primary}) where you want to insert it.
537@xref{Mouse Commands}.
538
539@cindex MS-Windows, and primary selection
540 MS-Windows provides no primary selection, but Emacs emulates it
541within a single Emacs session by storing the selected text internally.
542Therefore, all the features and commands related to the primary
543selection work on Windows as they do on X, for cutting and pasting
544within the same session, but not across Emacs sessions or with other
545applications.
546
547@node Secondary Selection
548@subsection Secondary Selection
549@cindex secondary selection
550
551 In addition to the primary selection, the X Window System provides a
552second similar facility known as the @dfn{secondary selection}.
553Nowadays, few X applications make use of the secondary selection, but
554you can access it using the following Emacs commands:
555
556@table @kbd
557@findex mouse-set-secondary
558@kindex M-Drag-Mouse-1
559@item M-Drag-Mouse-1
560Set the secondary selection, with one end at the place where you press
561down the button, and the other end at the place where you release it
562(@code{mouse-set-secondary}). The selected text is highlighted, using
563the @code{secondary-selection} face, as you drag. The window scrolls
564automatically if you drag the mouse off the top or bottom of the
565window, just like @code{mouse-set-region} (@pxref{Mouse Commands}).
566
567This command does not alter the kill ring.
568
569@findex mouse-start-secondary
570@kindex M-Mouse-1
571@item M-Mouse-1
572Set one endpoint for the @dfn{secondary selection}
573(@code{mouse-start-secondary}).
574
575@findex mouse-secondary-save-then-kill
576@kindex M-Mouse-3
577@item M-Mouse-3
578Set the secondary selection, with one end at the position clicked and
579the other at the position specified with @kbd{M-Mouse-1}
580(@code{mouse-secondary-save-then-kill}). This also puts the selected
581text in the kill ring. A second @kbd{M-Mouse-3} at the same place
582kills the secondary selection just made.
583
584@findex mouse-yank-secondary
585@kindex M-Mouse-2
586@item M-Mouse-2
587Insert the secondary selection where you click, placing point at the
588end of the yanked text (@code{mouse-yank-secondary}).
589@end table
590
591Double or triple clicking of @kbd{M-Mouse-1} operates on words and
592lines, much like @kbd{Mouse-1}.
593
594If @code{mouse-yank-at-point} is non-@code{nil}, @kbd{M-Mouse-2} yanks
595at point. Then it does not matter precisely where you click, or even
596which of the frame's windows you click on. @xref{Mouse Commands}.
597
421@node Accumulating Text 598@node Accumulating Text
422@section Accumulating Text 599@section Accumulating Text
423@findex append-to-buffer 600@findex append-to-buffer
diff --git a/doc/emacs/major.texi b/doc/emacs/major.texi
deleted file mode 100644
index 9256c712f02..00000000000
--- a/doc/emacs/major.texi
+++ /dev/null
@@ -1,237 +0,0 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2011
3@c Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Major Modes, Indentation, International, Top
6@chapter Major Modes
7@cindex major modes
8@cindex mode, major
9@kindex TAB @r{(and major modes)}
10@kindex DEL @r{(and major modes)}
11@kindex C-j @r{(and major modes)}
12
13 Emacs provides many alternative @dfn{major modes}, each of which
14customizes Emacs for editing text of a particular sort. The major modes
15are mutually exclusive, and each buffer has one major mode at any time.
16The mode line normally shows the name of the current major mode, in
17parentheses (@pxref{Mode Line}).
18
19 The least specialized major mode is called @dfn{Fundamental mode}.
20This mode has no mode-specific redefinitions or variable settings, so
21that each Emacs command behaves in its most general manner, and each
22user option variable is in its default state. For editing text of a
23specific type that Emacs knows about, such as Lisp code or English
24text, you should switch to the appropriate major mode, such as Lisp
25mode or Text mode.
26
27 Selecting a major mode changes the meanings of a few keys to become
28more specifically adapted to the language being edited. The ones that
29are changed frequently are @key{TAB}, @key{DEL}, and @kbd{C-j}. The
30prefix key @kbd{C-c} normally contains mode-specific commands. In
31addition, the commands which handle comments use the mode to determine
32how comments are to be delimited. Many major modes redefine the
33syntactical properties of characters appearing in the buffer.
34@xref{Syntax}.
35
36 The major modes fall into three major groups. The first group
37contains modes for normal text, either plain or with mark-up. It
38includes Text mode, HTML mode, SGML mode, @TeX{} mode and Outline
39mode. The second group contains modes for specific programming
40languages. These include Lisp mode (which has several variants), C
41mode, Fortran mode, and others. The remaining major modes are not
42intended for use on users' files; they are used in buffers created for
43specific purposes by Emacs, such as Dired mode for buffers made by
44Dired (@pxref{Dired}), Message mode for buffers made by @kbd{C-x m}
45(@pxref{Sending Mail}), and Shell mode for buffers used for
46communicating with an inferior shell process (@pxref{Interactive
47Shell}).
48
49 Most programming-language major modes specify that only blank lines
50separate paragraphs. This is to make the paragraph commands useful.
51(@xref{Paragraphs}.) They also cause Auto Fill mode to use the
52definition of @key{TAB} to indent the new lines it creates. This is
53because most lines in a program are usually indented
54(@pxref{Indentation}).
55
56@menu
57* Choosing Modes:: How major modes are specified or chosen.
58@end menu
59
60@node Choosing Modes,,Major Modes,Major Modes
61@section How Major Modes are Chosen
62
63@cindex choosing a major mode
64 You can select a major mode explicitly for the current buffer, but
65most of the time Emacs determines which mode to use based on the file
66name or on special text in the file.
67
68 To explicitly select a new major, you use an @kbd{M-x} command.
69Take the name of a major mode and add @code{-mode} to get the name of
70the command to select that mode. Thus, you can enter Lisp mode by
71executing @kbd{M-x lisp-mode}.
72
73@vindex auto-mode-alist
74 When you visit a file, Emacs usually chooses the right major mode
75automatically. Normally, it makes the choice based on the file
76name---for example, files whose names end in @samp{.c} are normally
77edited in C mode---but sometimes it chooses the major mode based on
78the contents of the file. Here is the exact procedure:
79
80 First, Emacs checks whether the file contains a file-local variable
81that specifies the major mode. If so, it uses that major mode,
82ignoring all other criteria. @xref{File Variables}. There are
83several methods to specify a major mode using a file-local variable;
84the simplest is to put the mode name in the first nonblank line,
85preceded and followed by @samp{-*-}. Other text may appear on the
86line as well. For example,
87
88@example
89; -*-Lisp-*-
90@end example
91
92@noindent
93tells Emacs to use Lisp mode. Note how the semicolon is used to make
94Lisp treat this line as a comment. Alternatively, you could write
95
96@example
97; -*- mode: Lisp;-*-
98@end example
99
100@noindent
101The latter format allows you to specify local variables as well, like
102this:
103
104@example
105; -*- mode: Lisp; tab-width: 4; -*-
106@end example
107
108@vindex interpreter-mode-alist
109 Second, Emacs checks whether the file's contents begin with
110@samp{#!}. If so, that indicates that the file can serve as an
111executable shell command, which works by running an interpreter named
112on the file's first line (the rest of the file is used as input to the
113interpreter). Therefore, Emacs tries to use the interpreter name to
114choose a mode. For instance, a file that begins with
115@samp{#!/usr/bin/perl} is opened in Perl mode. The variable
116@code{interpreter-mode-alist} specifies the correspondence between
117interpreter program names and major modes.
118
119 When the first line starts with @samp{#!}, you usually cannot use
120the @samp{-*-} feature on the first line, because the system would get
121confused when running the interpreter. So Emacs looks for @samp{-*-}
122on the second line in such files as well as on the first line. The
123same is true for man pages which start with the magic string
124@samp{'\"} to specify a list of troff preprocessors.
125
126@vindex magic-mode-alist
127 Third, Emacs tries to determine the major mode by looking at the
128text at the start of the buffer, based on the variable
129@code{magic-mode-alist}. By default, this variable is @code{nil} (an
130empty list), so Emacs skips this step; however, you can customize it
131in your init file (@pxref{Init File}). The value should be a list of
132elements of the form
133
134@example
135(@var{regexp} . @var{mode-function})
136@end example
137
138@noindent
139where @var{regexp} is a regular expression (@pxref{Regexps}), and
140@var{mode-function} is a Lisp function that toggles a major mode. If
141the text at the beginning of the file matches @var{regexp}, Emacs
142chooses the major mode specified by @var{mode-function}.
143
144Alternatively, an element of @code{magic-mode-alist} may have the form
145
146@example
147(@var{match-function} . @var{mode-function})
148@end example
149
150@noindent
151where @var{match-function} is a Lisp function that is called at the
152beginning of the buffer; if the function returns non-@code{nil}, Emacs
153set the major mode wit @var{mode-function}.
154
155 Fourth---if Emacs still hasn't found a suitable major mode---it
156looks at the file's name. The correspondence between file names and
157major modes is controlled by the variable @code{auto-mode-alist}. Its
158value is a list in which each element has this form,
159
160@example
161(@var{regexp} . @var{mode-function})
162@end example
163
164@noindent
165or this form,
166
167@example
168(@var{regexp} @var{mode-function} @var{flag})
169@end example
170
171@noindent
172For example, one element normally found in the list has the form
173@code{(@t{"\\.c\\'"} . c-mode)}, and it is responsible for selecting C
174mode for files whose names end in @file{.c}. (Note that @samp{\\} is
175needed in Lisp syntax to include a @samp{\} in the string, which must
176be used to suppress the special meaning of @samp{.} in regexps.) If
177the element has the form @code{(@var{regexp} @var{mode-function}
178@var{flag})} and @var{flag} is non-@code{nil}, then after calling
179@var{mode-function}, Emacs discards the suffix that matched
180@var{regexp} and searches the list again for another match.
181
182@vindex auto-mode-case-fold
183 On systems with case-insensitive file names, such as Microsoft
184Windows, Emacs performs a single case-insensitive search through
185@code{auto-mode-alist}. On other systems, Emacs normally performs a
186single case-sensitive search through the alist. However, if you
187change the variable @code{auto-mode-case-fold} to @code{t}, Emacs
188performs a second case-insensitive search if the first search fails.
189
190@vindex magic-fallback-mode-alist
191 Finally, if Emacs @emph{still} hasn't found a major mode to use, it
192compares the text at the start of the buffer to the variable
193@code{magic-fallback-mode-alist}. This variable works like
194@code{magic-mode-alist}, described above, except that is consulted
195only after @code{auto-mode-alist}. By default,
196@code{magic-fallback-mode-alist} contains forms that check for image
197files, HTML/XML/SGML files, and Postscript files.
198
199@vindex major-mode
200 Once a major mode is chosen, Emacs sets the value of the variable
201@code{major-mode} to the symbol for that major mode (e.g.,
202@code{text-mode} for Text mode). This is a per-buffer variable
203(@pxref{Locals}); its buffer-local value is set automatically, and you
204should not change it yourself.
205
206 The default value of @code{major-mode} determines the major mode to
207use for files that do not specify a major mode, and for new buffers
208created with @kbd{C-x b}. Normally, this default value is the symbol
209@code{fundamental-mode}, which specifies Fundamental mode. You can
210change it via the Customization interface (@pxref{Easy
211Customization}), or by adding a line like this to your init file
212(@pxref{Init File}):
213
214@smallexample
215(setq-default major-mode 'text-mode)
216@end smallexample
217
218@noindent
219If the default value of @code{major-mode} is @code{nil}, the major
220mode is taken from the previously current buffer.
221
222@findex normal-mode
223 If you have changed the major mode of a buffer, you can return to
224the major mode Emacs would have chosen automatically, by typing
225@kbd{M-x normal-mode}. This is the same function that
226@code{find-file} calls to choose the major mode. It also processes
227the file's @samp{-*-} line or local variables list (if any).
228@xref{File Variables}.
229
230@vindex change-major-mode-with-file-name
231 The commands @kbd{C-x C-w} and @code{set-visited-file-name} change to
232a new major mode if the new file name implies a mode (@pxref{Saving}).
233(@kbd{C-x C-s} does this too, if the buffer wasn't visiting a file.)
234However, this does not happen if the buffer contents specify a major
235mode, and certain ``special'' major modes do not allow the mode to
236change. You can turn off this mode-changing feature by setting
237@code{change-major-mode-with-file-name} to @code{nil}.
diff --git a/doc/emacs/makefile.w32-in b/doc/emacs/makefile.w32-in
index ad976468be9..4064f4ef6a3 100644
--- a/doc/emacs/makefile.w32-in
+++ b/doc/emacs/makefile.w32-in
@@ -76,7 +76,7 @@ EMACSSOURCES= \
76 $(srcdir)/windows.texi \ 76 $(srcdir)/windows.texi \
77 $(srcdir)/frames.texi \ 77 $(srcdir)/frames.texi \
78 $(srcdir)/mule.texi \ 78 $(srcdir)/mule.texi \
79 $(srcdir)/major.texi \ 79 $(srcdir)/modes.texi \
80 $(srcdir)/indent.texi \ 80 $(srcdir)/indent.texi \
81 $(srcdir)/text.texi \ 81 $(srcdir)/text.texi \
82 $(srcdir)/programs.texi \ 82 $(srcdir)/programs.texi \
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index f83ac38469a..b7b634af8b1 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -2794,7 +2794,6 @@ userenced and properbose. Have fun. Your buggestions are welcome.
2794@section Other Amusements 2794@section Other Amusements
2795@cindex boredom 2795@cindex boredom
2796@findex hanoi 2796@findex hanoi
2797@findex yow
2798@findex gomoku 2797@findex gomoku
2799@cindex tower of Hanoi 2798@cindex tower of Hanoi
2800 2799
@@ -2882,9 +2881,6 @@ Likewise, @kbd{M-x snake} provides an implementation of Snake.
2882 When you are frustrated, try the famous Eliza program. Just do 2881 When you are frustrated, try the famous Eliza program. Just do
2883@kbd{M-x doctor}. End each input by typing @key{RET} twice. 2882@kbd{M-x doctor}. End each input by typing @key{RET} twice.
2884 2883
2885@cindex Zippy
2886 When you are feeling strange, type @kbd{M-x yow}.
2887
2888@findex zone 2884@findex zone
2889The command @kbd{M-x zone} plays games with the display when Emacs is 2885The command @kbd{M-x zone} plays games with the display when Emacs is
2890idle. 2886idle.
diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi
new file mode 100644
index 00000000000..314d5d4347e
--- /dev/null
+++ b/doc/emacs/modes.texi
@@ -0,0 +1,410 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2011
3@c Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Modes, Indentation, International, Top
6@chapter Editing Modes
7
8 Emacs contains many @dfn{editing modes}, each of which alters its
9basic behavior in useful ways. These are divided into @dfn{major
10modes} and @dfn{minor modes}.
11
12 Major modes provide specialized facilities for working on a
13particular file type, such as a C source file (@pxref{Programs}), or a
14particular type of non-file buffer, such as a shell buffer
15(@pxref{Shell}). Major modes are mutually exclusive; each buffer has
16one and only one major mode at any time.
17
18 Minor modes are optional features which you can turn on or off, not
19necessarily specific to a type of file or buffer. For example, Auto
20Fill mode is a minor mode in which @key{SPC} breaks lines between
21words as you type (@pxref{Auto Fill}). Minor modes are independent of
22one another, and of the selected major mode.
23
24@menu
25* Major Modes:: Text mode vs. Lisp mode vs. C mode...
26* Minor Modes:: Each minor mode is a feature you can turn on
27 independently of any others.
28* Choosing Modes:: How modes are chosen when visiting files.
29@end menu
30
31@node Major Modes
32@section Major Modes
33@cindex major modes
34@cindex mode, major
35@kindex TAB @r{(and major modes)}
36@kindex DEL @r{(and major modes)}
37@kindex C-j @r{(and major modes)}
38
39 Every buffer possesses a major mode, which determines the editing
40behavior of Emacs while that buffer is current. The mode line
41normally shows the name of the current major mode, in parentheses.
42@xref{Mode Line}.
43
44 Usually, the major mode is automatically set by Emacs, when you
45first visit a file or create a buffer. @xref{Choosing Modes}. You
46can explicitly select a new major mode by using an @kbd{M-x} command.
47Take the name of the mode and add @code{-mode} to get the name of the
48command to select that mode. Thus, you can enter Lisp mode with
49@kbd{M-x lisp-mode}.
50
51 The least specialized major mode is called @dfn{Fundamental mode}.
52This mode has no mode-specific redefinitions or variable settings, so
53that each Emacs command behaves in its most general manner, and each
54user option variable is in its default state.
55
56 For editing text of a specific type that Emacs knows about, such as
57Lisp code or English text, you typically use a more specialized major
58mode, such as Lisp mode or Text mode. Such major modes change the
59meanings of some keys to become more specifically adapted to the
60language being edited. The ones that are commonly changed are
61@key{TAB}, @key{DEL}, and @kbd{C-j}. The prefix key @kbd{C-c}
62normally contains mode-specific commands. In addition, the commands
63which handle comments use the mode to determine how comments are to be
64delimited. Many major modes redefine the syntactical properties of
65characters appearing in the buffer.
66
67 The major modes fall into three major groups. The first group
68contains modes for normal text, either plain or with mark-up. It
69includes Text mode, HTML mode, SGML mode, @TeX{} mode and Outline
70mode. The second group contains modes for specific programming
71languages. These include Lisp mode (which has several variants), C
72mode, Fortran mode, and others. The remaining major modes are not
73intended for use on users' files; they are used in buffers created for
74specific purposes by Emacs, such as Dired mode for buffers made by
75Dired (@pxref{Dired}), Message mode for buffers made by @kbd{C-x m}
76(@pxref{Sending Mail}), and Shell mode for buffers used for
77communicating with an inferior shell process (@pxref{Interactive
78Shell}).
79
80 Most programming-language major modes specify that only blank lines
81separate paragraphs. This is to make the paragraph commands useful.
82(@xref{Paragraphs}.) They also cause Auto Fill mode to use the
83definition of @key{TAB} to indent the new lines it creates. This is
84because most lines in a program are usually indented
85(@pxref{Indentation}).
86
87@node Minor Modes
88@section Minor Modes
89@cindex minor modes
90@cindex mode, minor
91
92 A minor mode is an optional editing modes that alters the behavior
93of Emacs in some well-defined way. Unlike major modes, any number of
94minor modes can be in effect at any time. Some minor modes are
95@dfn{buffer-local}: they apply only to the current buffer, so you can
96enable the mode in certain buffers and not others. Other minor modes
97are @dfn{global}: while enabled, they affect everything you do in the
98Emacs session, in all buffers. Some global minor modes are enabled by
99default.
100
101 Most minor modes say in the mode line when they are enabled, just
102after the major mode indicator. For example, @samp{Fill} in the mode
103line means that Auto Fill mode is enabled. @xref{Mode Line}.
104
105 Each minor mode is associated with a command, called the @dfn{mode
106command}, which turns it on or off. The name of this command consists
107of the name of the minor mode, followed by @samp{-mode}; for instance,
108the mode command for Auto Fill mode is @code{auto-fill-mode}. Calling
109the minor mode command with no prefix argument @dfn{toggles} the mode,
110turning it on if it was off, and off if it was on. A positive
111argument always turns the mode on, and a zero or negative argument
112always turns it off. Mode commands are usually invoked with
113@kbd{M-x}, but you can bind keys to them if you wish (@pxref{Key
114Bindings}).
115
116 Most minor modes also have a @dfn{mode variable}, with the same name
117as the mode command. Its value is non-@code{nil} if the mode is
118enabled, and @code{nil} if it is disabled. In some minor modes---but
119not all---the value of the variable alone determines whether the mode
120is active: the mode command works simply by setting the variable, and
121changing the value of the variable has the same effect as calling the
122mode command. Because not all minor modes work this way, we recommend
123that you avoid changing the mode variables directly; use the mode
124commands instead.
125
126 The following is a list of some buffer-local minor modes:
127
128@itemize @bullet
129@item
130Abbrev mode automatically expands text based on pre-defined
131abbreviation definitions. @xref{Abbrevs}.
132
133@item
134Auto Fill mode inserts newlines as you type to prevent lines from
135becoming too long. @xref{Filling}.
136
137@item
138Auto Save mode saves the buffer contents periodically to reduce the
139amount of work you can lose in case of a crash. @xref{Auto Save}.
140
141@item
142Enriched mode enables editing and saving of formatted text.
143@xref{Formatted Text}.
144
145@item
146Flyspell mode automatically highlights misspelled words.
147@xref{Spelling}.
148
149@item
150Font-Lock mode automatically highlights certain textual units found in
151programs. It is enabled globally by default, but you can disable it
152in individual buffers. @xref{Faces}.
153
154@findex linum-mode
155@cindex Linum mode
156@item
157Linum mode displays each line's line number in the window's left
158margin. Its mode command is @code{linum-mode}.
159
160@item
161Outline minor mode provides similar facilities to the major mode
162called Outline mode. @xref{Outline Mode}.
163
164@cindex Overwrite mode
165@cindex mode, Overwrite
166@findex overwrite-mode
167@kindex INSERT
168@item
169Overwrite mode causes ordinary printing characters to replace existing
170text instead of shoving it to the right. For example, if point is in
171front of the @samp{B} in @samp{FOOBAR}, then in Overwrite mode typing
172a @kbd{G} changes it to @samp{FOOGAR}, instead of producing
173@samp{FOOGBAR} as usual. In Overwrite mode, the command @kbd{C-q}
174inserts the next character whatever it may be, even if it is a
175digit---this gives you a way to insert a character instead of
176replacing an existing character. The mode command,
177@code{overwrite-mode}, is bound to the @key{Insert} key.
178
179@findex binary-overwrite-mode
180@item
181Binary Overwrite mode is a variant of Overwrite mode for editing
182binary files; it treats newlines and tabs like other characters, so
183that they overwrite other characters and can be overwritten by them.
184In Binary Overwrite mode, digits after @kbd{C-q} specify an octal
185character code, as usual.
186
187@item
188Visual Line mode performs ``word wrapping'', causing long lines to be
189wrapped at word boundaries. @xref{Visual Line Mode}.
190@end itemize
191
192 Here are some useful global minor modes. Since Line Number mode and
193Transient Mark mode can be enabled or disabled just by setting the
194value of the minor mode variable, you @emph{can} set them differently
195for particular buffers, by explicitly making the corresponding
196variable local in those buffers. @xref{Locals}.
197
198@itemize @bullet
199@item
200Column Number mode enables display of the current column number in the
201mode line. @xref{Mode Line}.
202
203@item
204Delete Selection mode causes text insertion to first delete the text
205in the region, if the region is active. @xref{Using Region}.
206
207@item
208Icomplete mode displays an indication of available completions when
209you are in the minibuffer and completion is active. @xref{Completion
210Options}.
211
212@item
213Line Number mode enables display of the current line number in the
214mode line. It is enabled by default. @xref{Mode Line}.
215
216@item
217Menu Bar mode gives each frame a menu bar. It is enabled by default.
218@xref{Menu Bars}.
219
220@item
221Scroll Bar mode gives each window a scroll bar. It is enabled by
222default, but the scroll bar is only displayed on graphical terminals.
223@xref{Scroll Bars}.
224
225@item
226Tool Bar mode gives each frame a tool bar. It is enabled by default,
227but the tool bar is only displayed on graphical terminals. @xref{Tool
228Bars}.
229
230@item
231Transient Mark mode highlights the region, and makes many Emacs
232commands operate on the region when the mark is active. It is enabled
233by default. @xref{Mark}.
234@end itemize
235
236@node Choosing Modes
237@section Choosing File Modes
238
239@cindex choosing a major mode
240@cindex choosing a minor mode
241@vindex auto-mode-alist
242 When you visit a file, Emacs chooses a major mode automatically.
243Normally, it makes the choice based on the file name---for example,
244files whose names end in @samp{.c} are normally edited in C mode---but
245sometimes it chooses the major mode based on special text in the file.
246This special text can also be used to enable buffer-local minor modes.
247
248 Here is the exact procedure:
249
250 First, Emacs checks whether the file contains file-local mode
251variables. @xref{File Variables}. If there is a file-local variable
252that specifies a major mode, then Emacs uses that major mode, ignoring
253all other criteria. There are several methods to specify a major mode
254using a file-local variable; the simplest is to put the mode name in
255the first nonblank line, preceded and followed by @samp{-*-}. Other
256text may appear on the line as well. For example,
257
258@example
259; -*-Lisp-*-
260@end example
261
262@noindent
263tells Emacs to use Lisp mode. Note how the semicolon is used to make
264Lisp treat this line as a comment. Alternatively, you could write
265
266@example
267; -*- mode: Lisp;-*-
268@end example
269
270@noindent
271The latter format allows you to specify local variables as well, like
272this:
273
274@example
275; -*- mode: Lisp; tab-width: 4; -*-
276@end example
277
278 If a file variable specifies a buffer-local minor mode, Emacs
279enables that minor mode in the buffer.
280
281@vindex interpreter-mode-alist
282 Second, if there is no file variable specifying a major mode, Emacs
283checks whether the file's contents begin with @samp{#!}. If so, that
284indicates that the file can serve as an executable shell command,
285which works by running an interpreter named on the file's first line
286(the rest of the file is used as input to the interpreter).
287Therefore, Emacs tries to use the interpreter name to choose a mode.
288For instance, a file that begins with @samp{#!/usr/bin/perl} is opened
289in Perl mode. The variable @code{interpreter-mode-alist} specifies
290the correspondence between interpreter program names and major modes.
291
292 When the first line starts with @samp{#!}, you usually cannot use
293the @samp{-*-} feature on the first line, because the system would get
294confused when running the interpreter. So Emacs looks for @samp{-*-}
295on the second line in such files as well as on the first line. The
296same is true for man pages which start with the magic string
297@samp{'\"} to specify a list of troff preprocessors.
298
299@vindex magic-mode-alist
300 Third, Emacs tries to determine the major mode by looking at the
301text at the start of the buffer, based on the variable
302@code{magic-mode-alist}. By default, this variable is @code{nil} (an
303empty list), so Emacs skips this step; however, you can customize it
304in your init file (@pxref{Init File}). The value should be a list of
305elements of the form
306
307@example
308(@var{regexp} . @var{mode-function})
309@end example
310
311@noindent
312where @var{regexp} is a regular expression (@pxref{Regexps}), and
313@var{mode-function} is a Lisp function that toggles a major mode. If
314the text at the beginning of the file matches @var{regexp}, Emacs
315chooses the major mode specified by @var{mode-function}.
316
317Alternatively, an element of @code{magic-mode-alist} may have the form
318
319@example
320(@var{match-function} . @var{mode-function})
321@end example
322
323@noindent
324where @var{match-function} is a Lisp function that is called at the
325beginning of the buffer; if the function returns non-@code{nil}, Emacs
326set the major mode wit @var{mode-function}.
327
328 Fourth---if Emacs still hasn't found a suitable major mode---it
329looks at the file's name. The correspondence between file names and
330major modes is controlled by the variable @code{auto-mode-alist}. Its
331value is a list in which each element has this form,
332
333@example
334(@var{regexp} . @var{mode-function})
335@end example
336
337@noindent
338or this form,
339
340@example
341(@var{regexp} @var{mode-function} @var{flag})
342@end example
343
344@noindent
345For example, one element normally found in the list has the form
346@code{(@t{"\\.c\\'"} . c-mode)}, and it is responsible for selecting C
347mode for files whose names end in @file{.c}. (Note that @samp{\\} is
348needed in Lisp syntax to include a @samp{\} in the string, which must
349be used to suppress the special meaning of @samp{.} in regexps.) If
350the element has the form @code{(@var{regexp} @var{mode-function}
351@var{flag})} and @var{flag} is non-@code{nil}, then after calling
352@var{mode-function}, Emacs discards the suffix that matched
353@var{regexp} and searches the list again for another match.
354
355@vindex auto-mode-case-fold
356 On systems with case-insensitive file names, such as Microsoft
357Windows, Emacs performs a single case-insensitive search through
358@code{auto-mode-alist}. On other systems, Emacs normally performs a
359single case-sensitive search through the alist. However, if you
360change the variable @code{auto-mode-case-fold} to @code{t}, Emacs
361performs a second case-insensitive search if the first search fails.
362
363@vindex magic-fallback-mode-alist
364 Finally, if Emacs @emph{still} hasn't found a major mode to use, it
365compares the text at the start of the buffer to the variable
366@code{magic-fallback-mode-alist}. This variable works like
367@code{magic-mode-alist}, described above, except that is consulted
368only after @code{auto-mode-alist}. By default,
369@code{magic-fallback-mode-alist} contains forms that check for image
370files, HTML/XML/SGML files, and Postscript files.
371
372@vindex major-mode
373 Once a major mode is chosen, Emacs sets the value of the variable
374@code{major-mode} to the symbol for that major mode (e.g.,
375@code{text-mode} for Text mode). This is a per-buffer variable
376(@pxref{Locals}); its buffer-local value is set automatically, and you
377should not change it yourself.
378
379 The default value of @code{major-mode} determines the major mode to
380use for files that do not specify a major mode, and for new buffers
381created with @kbd{C-x b}. Normally, this default value is the symbol
382@code{fundamental-mode}, which specifies Fundamental mode. You can
383change it via the Customization interface (@pxref{Easy
384Customization}), or by adding a line like this to your init file
385(@pxref{Init File}):
386
387@smallexample
388(setq-default major-mode 'text-mode)
389@end smallexample
390
391@noindent
392If the default value of @code{major-mode} is @code{nil}, the major
393mode is taken from the previously current buffer.
394
395@findex normal-mode
396 If you have changed the major mode of a buffer, you can return to
397the major mode Emacs would have chosen automatically, by typing
398@kbd{M-x normal-mode}. This is the same function that
399@code{find-file} calls to choose the major mode. It also processes
400the file's @samp{-*-} line or local variables list (if any).
401@xref{File Variables}.
402
403@vindex change-major-mode-with-file-name
404 The commands @kbd{C-x C-w} and @code{set-visited-file-name} change to
405a new major mode if the new file name implies a mode (@pxref{Saving}).
406(@kbd{C-x C-s} does this too, if the buffer wasn't visiting a file.)
407However, this does not happen if the buffer contents specify a major
408mode, and certain ``special'' major modes do not allow the mode to
409change. You can turn off this mode-changing feature by setting
410@code{change-major-mode-with-file-name} to @code{nil}.
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index 3f3da503769..3c970ecb12c 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -1,7 +1,7 @@
1@c This is part of the Emacs manual. 1@c This is part of the Emacs manual.
2@c Copyright (C) 1997, 1999-2011 Free Software Foundation, Inc. 2@c Copyright (C) 1997, 1999-2011 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions. 3@c See file emacs.texi for copying conditions.
4@node International, Major Modes, Frames, Top 4@node International, Modes, Frames, Top
5@chapter International Character Set Support 5@chapter International Character Set Support
6@c This node is referenced in the tutorial. When renaming or deleting 6@c This node is referenced in the tutorial. When renaming or deleting
7@c it, the tutorial needs to be adjusted. (TUTORIAL.de) 7@c it, the tutorial needs to be adjusted. (TUTORIAL.de)
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 803f6b6ce49..870986d421a 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -643,8 +643,9 @@ balanced.
643 When talking about these facilities, the term ``parenthesis'' also 643 When talking about these facilities, the term ``parenthesis'' also
644includes braces, brackets, or whatever delimiters are defined to match 644includes braces, brackets, or whatever delimiters are defined to match
645in pairs. The major mode controls which delimiters are significant, 645in pairs. The major mode controls which delimiters are significant,
646through the syntax table (@pxref{Syntax}). In Lisp, only parentheses 646through the syntax table (@pxref{Syntax Tables,, Syntax Tables, elisp,
647count; in C, these commands apply to braces and brackets too. 647The Emacs Lisp Reference Manual}). In Lisp, only parentheses count;
648in C, these commands apply to braces and brackets too.
648 649
649 You can use @kbd{M-x check-parens} to find any unbalanced 650 You can use @kbd{M-x check-parens} to find any unbalanced
650parentheses and unbalanced string quotes in the buffer. 651parentheses and unbalanced string quotes in the buffer.
diff --git a/doc/emacs/screen.texi b/doc/emacs/screen.texi
index 0bc3ce3db8c..145687270ca 100644
--- a/doc/emacs/screen.texi
+++ b/doc/emacs/screen.texi
@@ -190,7 +190,7 @@ sometimes useful to have this information.
190Systems}). If it is a dash (@samp{-}), that indicates the default 190Systems}). If it is a dash (@samp{-}), that indicates the default
191state of affairs: no special character set handling, except for the 191state of affairs: no special character set handling, except for the
192end-of-line translations described in the next paragraph. @samp{=} 192end-of-line translations described in the next paragraph. @samp{=}
193means no conversion whatsoever. Letters represent various nontrivial 193means no conversion whatsoever. Characters represent various nontrivial
194@dfn{coding systems}---for example, @samp{1} represents ISO Latin-1. 194@dfn{coding systems}---for example, @samp{1} represents ISO Latin-1.
195On a text-only terminal, @var{cs} is preceded by two additional 195On a text-only terminal, @var{cs} is preceded by two additional
196characters that describe the coding system for keyboard input and the 196characters that describe the coding system for keyboard input and the
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index b5d426210aa..015f9529b73 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -870,8 +870,9 @@ matches at the end of the buffer only if the contents end with a
870word-constituent character. 870word-constituent character.
871 871
872@item \w 872@item \w
873matches any word-constituent character. The syntax table 873matches any word-constituent character. The syntax table determines
874determines which characters these are. @xref{Syntax}. 874which characters these are. @xref{Syntax Tables,, Syntax Tables,
875elisp, The Emacs Lisp Reference Manual}.
875 876
876@item \W 877@item \W
877matches any character that is not a word-constituent. 878matches any character that is not a word-constituent.
@@ -892,7 +893,8 @@ symbol-constituent character.
892matches any character whose syntax is @var{c}. Here @var{c} is a 893matches any character whose syntax is @var{c}. Here @var{c} is a
893character that designates a particular syntax class: thus, @samp{w} 894character that designates a particular syntax class: thus, @samp{w}
894for word constituent, @samp{-} or @samp{ } for whitespace, @samp{.} 895for word constituent, @samp{-} or @samp{ } for whitespace, @samp{.}
895for ordinary punctuation, etc. @xref{Syntax}. 896for ordinary punctuation, etc. @xref{Syntax Tables,, Syntax Tables,
897elisp, The Emacs Lisp Reference Manual}.
896 898
897@item \S@var{c} 899@item \S@var{c}
898matches any character whose syntax is not @var{c}. 900matches any character whose syntax is not @var{c}.
@@ -911,8 +913,9 @@ matches any character that does @emph{not} belong to category
911@var{c}. 913@var{c}.
912@end table 914@end table
913 915
914 The constructs that pertain to words and syntax are controlled by the 916 The constructs that pertain to words and syntax are controlled by
915setting of the syntax table (@pxref{Syntax}). 917the setting of the syntax table. @xref{Syntax Tables,, Syntax Tables,
918elisp, The Emacs Lisp Reference Manual}.
916 919
917@node Regexp Example 920@node Regexp Example
918@section Regular Expression Example 921@section Regular Expression Example
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi
index c0139c60557..dbda771e6a3 100644
--- a/doc/emacs/text.texi
+++ b/doc/emacs/text.texi
@@ -154,9 +154,10 @@ the mark by one additional word. @kbd{M-@@} also accepts a numeric
154argument that says how many words to scan for the place to put the 154argument that says how many words to scan for the place to put the
155mark. 155mark.
156 156
157 The word commands' understanding of word boundaries is controlled 157 The word commands' understanding of word boundaries is controlled by
158by the syntax table. Any character can, for example, be declared to 158the syntax table. Any character can, for example, be declared to be a
159be a word delimiter. @xref{Syntax}. 159word delimiter. @xref{Syntax Tables,, Syntax Tables, elisp, The Emacs
160Lisp Reference Manual}.
160 161
161@node Sentences 162@node Sentences
162@section Sentences 163@section Sentences
@@ -406,8 +407,6 @@ Text}).
406* Fill Commands:: Commands to refill paragraphs and center lines. 407* Fill Commands:: Commands to refill paragraphs and center lines.
407* Fill Prefix:: Filling paragraphs that are indented or in a comment, etc. 408* Fill Prefix:: Filling paragraphs that are indented or in a comment, etc.
408* Adaptive Fill:: How Emacs can determine the fill prefix automatically. 409* Adaptive Fill:: How Emacs can determine the fill prefix automatically.
409* Refill:: Keeping paragraphs filled.
410* Longlines:: Editing text with very long lines.
411@end menu 410@end menu
412 411
413@node Auto Fill 412@node Auto Fill
@@ -722,92 +721,6 @@ line, and it should return the appropriate fill prefix based on that
722line. If it returns @code{nil}, @code{adaptive-fill-regexp} gets 721line. If it returns @code{nil}, @code{adaptive-fill-regexp} gets
723a chance to find a prefix. 722a chance to find a prefix.
724 723
725@node Refill
726@subsection Refill Mode
727@cindex refilling text, word processor style
728@cindex modes, Refill
729@cindex Refill minor mode
730
731 Refill minor mode provides support for keeping paragraphs filled as
732you type or modify them in other ways. It provides an effect similar
733to typical word processor behavior. This works by running a
734paragraph-filling command at suitable times.
735
736 To toggle the use of Refill mode in the current buffer, type
737@kbd{M-x refill-mode}. When you are typing text, only characters
738which normally trigger auto filling, like the space character, will
739trigger refilling. This is to avoid making it too slow. Apart from
740self-inserting characters, other commands which modify the text cause
741refilling.
742
743 The current implementation is preliminary and not robust. You can
744get better ``line wrapping'' behavior using Longlines mode.
745@xref{Longlines}. However, Longlines mode has an important
746side-effect: the newlines that it inserts for you are not saved to
747disk, so the files that you make with Longlines mode will appear to be
748completely unfilled if you edit them without Longlines mode.
749
750@node Longlines
751@subsection Long Lines Mode
752@cindex refilling text, word processor style
753@cindex modes, Long Lines
754@cindex word wrap
755@cindex Long Lines minor mode
756
757 Sometimes, you may come across ``unfilled'' text files, which Emacs
758normally displays as a bunch of extremely long lines. Comfortably
759reading and editing such files normally requires ``word wrap'', a
760feature that breaks up each long text line into multiple screen lines
761in a readable manner---by putting the breaks at word boundaries. Many
762text editors, such as those built into many web browsers, perform word
763wrapping by default.
764
765 There are two different minor modes in Emacs that perform word
766wrapping. The first is Visual Line mode, which does it by altering
767the behavior of screen line continuation. @xref{Visual Line Mode},
768for information about Visual Line mode.
769
770@findex longlines-mode
771 Instead of using Visual Line mode, you can use a minor mode called
772Long Lines mode. Long Lines mode wraps lines by inserting or deleting
773@dfn{soft newlines} as you type (@pxref{Hard and Soft Newlines}).
774These soft newlines won't show up when you save the buffer into a
775file, or when you copy the text into the kill ring, clipboard, or a
776register. Unlike Visual Line mode, Lone Lines mode breaks long lines
777at the fill column (@pxref{Fill Commands}), rather than the right
778window edge. To enable Long Lines mode, type @kbd{M-x
779longlines-mode}. If the text is full of long lines, this also
780immediately ``wraps'' them all.
781
782@findex longlines-auto-wrap
783 The word wrap performed by Long Lines mode is @emph{not} the same as
784ordinary filling (@pxref{Fill Commands}). It does not contract
785multiple spaces into a single space, recognize fill prefixes
786(@pxref{Fill Prefix}), or perform adaptive filling (@pxref{Adaptive
787Fill}). The reason for this is that a wrapped line is still,
788conceptually, a single line. Each soft newline is equivalent to
789exactly one space in that long line, and vice versa. However, you can
790still call filling functions such as @kbd{M-q}, and these will work as
791expected, inserting soft newlines that won't show up on disk or when
792the text is copied. You can even rely entirely on the normal fill
793commands by turning off automatic line wrapping, with @kbd{C-u M-x
794longlines-auto-wrap}. To turn automatic line wrapping back on, type
795@kbd{M-x longlines-auto-wrap}.
796
797@findex longlines-show-hard-newlines
798 Type @kbd{RET} to insert a hard newline, one which automatic
799refilling will not remove. If you want to see where all the hard
800newlines are, type @kbd{M-x longlines-show-hard-newlines}. This will
801mark each hard newline with a special symbol. The same command with a
802prefix argument turns this display off.
803
804 Long Lines mode does not change normal text files that are already
805filled, since the existing newlines are considered hard newlines.
806Before Long Lines can do anything, you need to transform each
807paragraph into a long line. One way is to set @code{fill-column} to a
808large number (e.g., @kbd{C-u 9999 C-x f}), re-fill all the paragraphs,
809and then set @code{fill-column} back to its original value.
810
811@node Case 724@node Case
812@section Case Conversion Commands 725@section Case Conversion Commands
813@cindex case conversion 726@cindex case conversion
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 7e8dac0cb27..c265b9e878d 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,11 @@
12011-07-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * modes.texi (Mode Line Variables): Document `mode-line-remote'
4 and `mode-line-client' (bug#2974).
5
6 * text.texi (Insertion): Clarify marker movements (bug#1651).
7 Text from Drew Adams.
8
12011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org> 92011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 10
3 * text.texi (Special Properties): Clarify the format of `face' 11 * text.texi (Special Properties): Clarify the format of `face'
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 562cc76c3f0..a8a10f750cc 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -1866,6 +1866,15 @@ default value also displays the recursive editing level, information
1866on the process status, and whether narrowing is in effect. 1866on the process status, and whether narrowing is in effect.
1867@end defopt 1867@end defopt
1868 1868
1869@defopt mode-line-remote
1870This variable is used to show whether @code{default-directory} for the
1871current buffer is remote.
1872@end defopt
1873
1874@defopt mode-line-client
1875This variable is used to identify @code{emacsclient} frames.
1876@end defopt
1877
1869 The following three variables are used in @code{mode-line-modes}: 1878 The following three variables are used in @code{mode-line-modes}:
1870 1879
1871@defvar mode-name 1880@defvar mode-name
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 2d487352243..b91afb044f0 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -364,14 +364,13 @@ after point. Some insertion functions leave point before the inserted
364text, while other functions leave it after. We call the former 364text, while other functions leave it after. We call the former
365insertion @dfn{after point} and the latter insertion @dfn{before point}. 365insertion @dfn{after point} and the latter insertion @dfn{before point}.
366 366
367 Insertion relocates markers that point at positions after the 367 Insertion moves markers located at positions after the insertion
368insertion point, so that they stay with the surrounding text 368point, so that they stay with the surrounding text (@pxref{Markers}).
369(@pxref{Markers}). When a marker points at the place of insertion, 369When a marker points at the place of insertion, insertion may or may
370insertion may or may not relocate the marker, depending on the marker's 370not relocate the marker, depending on the marker's insertion type
371insertion type (@pxref{Marker Insertion Types}). Certain special 371(@pxref{Marker Insertion Types}). Certain special functions such as
372functions such as @code{insert-before-markers} relocate all such markers 372@code{insert-before-markers} relocate all such markers to point after
373to point after the inserted text, regardless of the markers' insertion 373the inserted text, regardless of the markers' insertion type.
374type.
375 374
376 Insertion functions signal an error if the current buffer is 375 Insertion functions signal an error if the current buffer is
377read-only or if they insert within read-only text. 376read-only or if they insert within read-only text.
diff --git a/etc/ChangeLog b/etc/ChangeLog
index f7ecbb5d777..1a9771a960a 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,9 @@
12011-07-10 Bill Wohler <wohler@newt.com>
2
3 Release MH-E version 8.2.90.
4
5 * NEWS, MH-E-NEWS: Update for MH-E release 8.2.90.
6
12011-07-07 Tassilo Horn <tassilo@member.fsf.org> 72011-07-07 Tassilo Horn <tassilo@member.fsf.org>
2 8
3 * themes/tsdh-light-theme.el: 9 * themes/tsdh-light-theme.el:
diff --git a/etc/MH-E-NEWS b/etc/MH-E-NEWS
index aaafe76990b..0db76bb1237 100644
--- a/etc/MH-E-NEWS
+++ b/etc/MH-E-NEWS
@@ -4,6 +4,25 @@ Copyright (C) 2001-2011 Free Software Foundation, Inc.
4See the end of the file for license conditions. 4See the end of the file for license conditions.
5 5
6 6
7* Changes in MH-E 8.2.90
8
9In 2010, the version control system (VCS) of Emacs was upgraded from
10CVS to Bazaar. In 2011, the MH-E team followed suit and upgraded the
11MH-E repository at SourceForge from CVS to Bazaar as well. The result
12is version 8.2.90 of MH-E, which includes needed changes to the build
13scripts.
14
15Otherwise, this is a small release that includes mostly internal
16changes from the Emacs team. One of these changes manifests itself in
17the user interface--you can now complete folders with abbreviations,
18meaning that `+f/b/b TAB' can complete to `+foo/bar/baz'. This version
19of MH-E is packaged with GNU Emacs 24.1
20
21Also, RFC 2047-encoded Subject header fields in replies are now
22decoded.
23
24
25
7* Changes in MH-E 8.2 26* Changes in MH-E 8.2
8 27
9Version 8.2 of MH-E appeared in GNU Emacs 23.1. This is a small 28Version 8.2 of MH-E appeared in GNU Emacs 23.1. This is a small
diff --git a/etc/NEWS b/etc/NEWS
index 8a06c9f2bc6..c32159f6540 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -473,6 +473,10 @@ $ESHELL nor variable `explicit-shell-file-name' is set.
473 473
474* Changes in Specialized Modes and Packages in Emacs 24.1 474* Changes in Specialized Modes and Packages in Emacs 24.1
475 475
476** MH-E
477
478*** Upgraded to MH-E version 8.2.90. See MH-E-NEWS for details.
479
476** comint and modes derived from it use the generic completion code. 480** comint and modes derived from it use the generic completion code.
477 481
478** Compilation mode 482** Compilation mode
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 5d95ec74277..04d0828a8ab 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,4 +1,4 @@
12011-07-06 Paul Eggert <eggert@cs.ucla.edu> 12011-07-11 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Assume freestanding C89 headers, string.h, stdlib.h. 3 Assume freestanding C89 headers, string.h, stdlib.h.
4 * ebrowse.c: Include stdlib.h unconditionally. 4 * ebrowse.c: Include stdlib.h unconditionally.
@@ -11,6 +11,10 @@
11 Assume support for memcmp, memcpy, memmove, memset. 11 Assume support for memcmp, memcpy, memmove, memset.
12 * etags.c (absolute_filename): Assume memmove exists. 12 * etags.c (absolute_filename): Assume memmove exists.
13 13
142011-07-09 Andreas Schwab <schwab@linux-m68k.org>
15
16 * update-game-score.c (usage): Update usage line.
17
142011-07-02 Jason Rumney <jasonr@gnu.org> 182011-07-02 Jason Rumney <jasonr@gnu.org>
15 19
16 * emacsclient.c (decode_options) [WINDOWSNT]: Avoid tty mode on 20 * emacsclient.c (decode_options) [WINDOWSNT]: Avoid tty mode on
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c
index 284beafb9d9..2a89379aefe 100644
--- a/lib-src/update-game-score.c
+++ b/lib-src/update-game-score.c
@@ -64,7 +64,7 @@ static int usage (int err) NO_RETURN;
64static int 64static int
65usage (int err) 65usage (int err)
66{ 66{
67 fprintf (stdout, "Usage: update-game-score [-m MAX ] [ -r ] game/scorefile SCORE DATA\n"); 67 fprintf (stdout, "Usage: update-game-score [-m MAX] [-r] [-d DIR] game/scorefile SCORE DATA\n");
68 fprintf (stdout, " update-game-score -h\n"); 68 fprintf (stdout, " update-game-score -h\n");
69 fprintf (stdout, " -h\t\tDisplay this help.\n"); 69 fprintf (stdout, " -h\t\tDisplay this help.\n");
70 fprintf (stdout, " -m MAX\t\tLimit the maximum number of scores to MAX.\n"); 70 fprintf (stdout, " -m MAX\t\tLimit the maximum number of scores to MAX.\n");
@@ -106,8 +106,7 @@ static void lose_syserr (const char *msg) NO_RETURN;
106#ifndef HAVE_STRERROR 106#ifndef HAVE_STRERROR
107#ifndef WINDOWSNT 107#ifndef WINDOWSNT
108char * 108char *
109strerror (errnum) 109strerror (int errnum)
110 int errnum;
111{ 110{
112 extern char *sys_errlist[]; 111 extern char *sys_errlist[];
113 extern int sys_nerr; 112 extern int sys_nerr;
diff --git a/lib/stdint.in.h b/lib/stdint.in.h
index 09ac138b851..b6d08c754ae 100644
--- a/lib/stdint.in.h
+++ b/lib/stdint.in.h
@@ -270,26 +270,36 @@ typedef unsigned long int gl_uintptr_t;
270/* Note: These types are compiler dependent. It may be unwise to use them in 270/* Note: These types are compiler dependent. It may be unwise to use them in
271 public header files. */ 271 public header files. */
272 272
273#undef intmax_t 273/* If the system defines INTMAX_MAX, assume that intmax_t works, and
274#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 274 similarly for UINTMAX_MAX and uintmax_t. This avoids problems with
275 assuming one type where another is used by the system. */
276
277#ifndef INTMAX_MAX
278# undef INTMAX_C
279# undef intmax_t
280# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
275typedef long long int gl_intmax_t; 281typedef long long int gl_intmax_t;
276# define intmax_t gl_intmax_t 282# define intmax_t gl_intmax_t
277#elif defined GL_INT64_T 283# elif defined GL_INT64_T
278# define intmax_t int64_t 284# define intmax_t int64_t
279#else 285# else
280typedef long int gl_intmax_t; 286typedef long int gl_intmax_t;
281# define intmax_t gl_intmax_t 287# define intmax_t gl_intmax_t
288# endif
282#endif 289#endif
283 290
284#undef uintmax_t 291#ifndef UINTMAX_MAX
285#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 292# undef UINTMAX_C
293# undef uintmax_t
294# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
286typedef unsigned long long int gl_uintmax_t; 295typedef unsigned long long int gl_uintmax_t;
287# define uintmax_t gl_uintmax_t 296# define uintmax_t gl_uintmax_t
288#elif defined GL_UINT64_T 297# elif defined GL_UINT64_T
289# define uintmax_t uint64_t 298# define uintmax_t uint64_t
290#else 299# else
291typedef unsigned long int gl_uintmax_t; 300typedef unsigned long int gl_uintmax_t;
292# define uintmax_t gl_uintmax_t 301# define uintmax_t gl_uintmax_t
302# endif
293#endif 303#endif
294 304
295/* Verify that intmax_t and uintmax_t have the same size. Too much code 305/* Verify that intmax_t and uintmax_t have the same size. Too much code
@@ -431,21 +441,23 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
431 441
432/* 7.18.2.5. Limits of greatest-width integer types */ 442/* 7.18.2.5. Limits of greatest-width integer types */
433 443
434#undef INTMAX_MIN 444#ifndef INTMAX_MAX
435#undef INTMAX_MAX 445# undef INTMAX_MIN
436#ifdef INT64_MAX 446# ifdef INT64_MAX
437# define INTMAX_MIN INT64_MIN 447# define INTMAX_MIN INT64_MIN
438# define INTMAX_MAX INT64_MAX 448# define INTMAX_MAX INT64_MAX
439#else 449# else
440# define INTMAX_MIN INT32_MIN 450# define INTMAX_MIN INT32_MIN
441# define INTMAX_MAX INT32_MAX 451# define INTMAX_MAX INT32_MAX
452# endif
442#endif 453#endif
443 454
444#undef UINTMAX_MAX 455#ifndef UINTMAX_MAX
445#ifdef UINT64_MAX 456# ifdef UINT64_MAX
446# define UINTMAX_MAX UINT64_MAX 457# define UINTMAX_MAX UINT64_MAX
447#else 458# else
448# define UINTMAX_MAX UINT32_MAX 459# define UINTMAX_MAX UINT32_MAX
460# endif
449#endif 461#endif
450 462
451/* 7.18.3. Limits of other integer types */ 463/* 7.18.3. Limits of other integer types */
@@ -568,22 +580,24 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
568 580
569/* 7.18.4.2. Macros for greatest-width integer constants */ 581/* 7.18.4.2. Macros for greatest-width integer constants */
570 582
571#undef INTMAX_C 583#ifndef INTMAX_C
572#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 584# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
573# define INTMAX_C(x) x##LL 585# define INTMAX_C(x) x##LL
574#elif defined GL_INT64_T 586# elif defined GL_INT64_T
575# define INTMAX_C(x) INT64_C(x) 587# define INTMAX_C(x) INT64_C(x)
576#else 588# else
577# define INTMAX_C(x) x##L 589# define INTMAX_C(x) x##L
590# endif
578#endif 591#endif
579 592
580#undef UINTMAX_C 593#ifndef UINTMAX_C
581#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 594# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
582# define UINTMAX_C(x) x##ULL 595# define UINTMAX_C(x) x##ULL
583#elif defined GL_UINT64_T 596# elif defined GL_UINT64_T
584# define UINTMAX_C(x) UINT64_C(x) 597# define UINTMAX_C(x) UINT64_C(x)
585#else 598# else
586# define UINTMAX_C(x) x##UL 599# define UINTMAX_C(x) x##UL
600# endif
587#endif 601#endif
588 602
589#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */ 603#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 67615431b8f..a3faab15c35 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,61 @@
12011-07-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * tool-bar.el (tool-bar-mode): Clarify positive/negative arguments
4 (bug#1526).
5
62011-07-10 Martin Rudalics <rudalics@gmx.at>
7
8 * window.el (display-buffer-normalize-default): Don't invert
9 meaning of even-window-heights. Reported by Eli Zaretskii
10 <eliz@gnu.org>.
11
122011-07-10 Bob Rogers <rogers@rgrjr.dyndns.org>
13
14 * vc/vc.el (vc-diff-internal): Fix race condition (Bug#1256).
15
162011-07-10 Chong Yidong <cyd@stupidchicken.com>
17
18 * window.el (display-buffer): Fix arguments to
19 display-buffer-reuse-window in last change.
20
21 * faces.el (link): Use a less saturated blue on light backgrounds.
22
23 * startup.el (fancy-startup-text, fancy-about-text)
24 (fancy-startup-tail): Use font-lock faces, for background safety.
25
262011-07-09 Bob Nnamtrop <bobnnamtrop@gmail.com> (tiny change)
27
28 * emulation/viper-cmd.el (viper-change-state-to-vi): Limit
29 triggering of abbrev expansion (Bug#9038).
30
312011-07-09 Martin Rudalics <rudalics@gmx.at>
32
33 * window.el (display-buffer-default-specifiers): Remove.
34 (display-buffer-macro-specifiers): Remove default specifiers.
35 (display-buffer-alist): Default to nil.
36 (display-buffer-reuse-window): New optional argument
37 other-window.
38 (display-buffer-pop-up-window): Allow splitting internal
39 windows. Check whether a live window was created.
40 (display-buffer-other-window-means-other-frame)
41 (display-buffer-normalize-arguments): Rename to
42 display-buffer-normalize-argument and rewrite. Set the
43 other-window specifier.
44 (display-buffer-normalize-special): New function.
45 (display-buffer-normalize-options): Rename to
46 display-buffer-normalize-default and rewrite.
47 (display-buffer-normalize-options-inhibit): Remove.
48 (display-buffer-normalize-specifiers): Rewrite.
49 (display-buffer): Process other-window specifier and call
50 display-buffer-reuse-window with it. Emulate Emacs 23 behavior
51 more faithfully.
52 (pop-up-windows, even-window-heights): Restore Emacs 23 default
53 values.
54 (display-buffer-alist-set): Don't handle 'unset default values.
55 (display-buffer-in-window, display-buffer-alist-set): Replace
56 symbol "dedicated" by "dedicate". Reported by Tassilo Horn
57 <tassilo@member.fsf.org>.
58
12011-07-09 Leo Liu <sdl.web@gmail.com> 592011-07-09 Leo Liu <sdl.web@gmail.com>
2 60
3 * register.el (insert-register): Restore accidental change on 61 * register.el (insert-register): Restore accidental change on
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index f06428d81eb..9d0eb6c0d14 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -617,7 +617,10 @@
617 (or (viper-overlay-p viper-replace-overlay) 617 (or (viper-overlay-p viper-replace-overlay)
618 (viper-set-replace-overlay (point-min) (point-min))) 618 (viper-set-replace-overlay (point-min) (point-min)))
619 (viper-hide-replace-overlay) 619 (viper-hide-replace-overlay)
620 (if abbrev-mode (expand-abbrev)) 620 ;; Expand abbrevs iff the previous character has word syntax.
621 (and abbrev-mode
622 (eq (char-syntax (preceding-char)) ?w)
623 (expand-abbrev))
621 (if (and auto-fill-function (> (current-column) fill-column)) 624 (if (and auto-fill-function (> (current-column) fill-column))
622 (funcall auto-fill-function)) 625 (funcall auto-fill-function))
623 ;; don't leave whitespace lines around 626 ;; don't leave whitespace lines around
diff --git a/lisp/faces.el b/lisp/faces.el
index 34e154314b5..302f8af35ac 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2109,7 +2109,7 @@ terminal type to a different value."
2109 2109
2110(defface link 2110(defface link
2111 '((((class color) (min-colors 88) (background light)) 2111 '((((class color) (min-colors 88) (background light))
2112 :foreground "blue1" :underline t) 2112 :foreground "RoyalBlue3" :underline t)
2113 (((class color) (background light)) 2113 (((class color) (background light))
2114 :foreground "blue" :underline t) 2114 :foreground "blue" :underline t)
2115 (((class color) (min-colors 88) (background dark)) 2115 (((class color) (min-colors 88) (background dark))
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index a0f2d5809a6..f780cf7b9f0 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12011-07-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * gnus-group.el (gnus-read-ephemeral-emacs-bug-group): `debbugs-*'
4 renamed to `debbugs-gnu-*'.
5
12011-07-08 Daiki Ueno <ueno@unixuser.org> 62011-07-08 Daiki Ueno <ueno@unixuser.org>
2 7
3 * plstore.el: Revert the editing feature since it is not urgent. 8 * plstore.el: Revert the editing feature since it is not urgent.
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index da925700bd2..2ea2a5c9bc7 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -2469,7 +2469,7 @@ the bug number, and browsing the URL must return mbox output."
2469 number 2469 number
2470 (cdr (assoc 'debian gnus-bug-group-download-format-alist)))) 2470 (cdr (assoc 'debian gnus-bug-group-download-format-alist))))
2471 2471
2472(defvar debbugs-bug-number) ; debbugs-gnu 2472(defvar debbugs-gnu-bug-number) ; debbugs-gnu
2473 2473
2474(defun gnus-read-ephemeral-emacs-bug-group (ids &optional window-conf) 2474(defun gnus-read-ephemeral-emacs-bug-group (ids &optional window-conf)
2475 "Browse Emacs bugs IDS as an ephemeral group." 2475 "Browse Emacs bugs IDS as an ephemeral group."
@@ -2482,10 +2482,10 @@ the bug number, and browsing the URL must return mbox output."
2482 ids 2482 ids
2483 (cdr (assoc 'emacs gnus-bug-group-download-format-alist)) 2483 (cdr (assoc 'emacs gnus-bug-group-download-format-alist))
2484 window-conf) 2484 window-conf)
2485 (when (fboundp 'debbugs-summary-mode) 2485 (when (fboundp 'debbugs-gnu-summary-mode)
2486 (with-current-buffer (window-buffer (selected-window)) 2486 (with-current-buffer (window-buffer (selected-window))
2487 (debbugs-summary-mode 1) 2487 (debbugs-gnu-summary-mode 1)
2488 (set (make-local-variable 'debbugs-bug-number) (car ids))))) 2488 (set (make-local-variable 'debbugs-gnu-bug-number) (car ids)))))
2489 2489
2490(defun gnus-group-jump-to-group (group &optional prompt) 2490(defun gnus-group-jump-to-group (group &optional prompt)
2491 "Jump to newsgroup GROUP. 2491 "Jump to newsgroup GROUP.
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 365c444d591..197c87a26ab 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,33 @@
12011-07-10 Bill Wohler <wohler@newt.com>
2
3 Release MH-E version 8.9.90.
4
5 * mh-e.el (Version, mh-version): Update for release 8.2.90.
6
7 * mh-utils.el (mh-sub-folders-actual): Remove FIXME question.
8
9 * mh-mime.el (mh-decode-message-subject): Fix case of Subject.
10
11 * mh-folder.el (mh-inc-folder, mh-modify, mh-scan-folder)
12 (mh-make-folder): Replace calls to switch-to-buffer with of
13 pop-to-buffer. The former is intended for interactive use only and
14 generates warnings in Emacs 24.
15
162011-07-09 Bill Wohler <wohler@newt.com>
17
18 * mh-speed.el (mh-speed-toggle,mh-speed-view): Document "ignored"
19 arguments to keep checkdoc happy.
20
21 * mh-search.el (mh-flists-execute): Ditto.
22
23 * mh-funcs.el (mh-undo-folder): Ditto.
24
25 * mh-comp.el (mh-user-agent-compose): Ditto.
26
27 * mh-xface.el (mh-face-to-png, mh-uncompface)
28 (mh-picon-file-contents): Only call set-buffer-multibyte if it
29 exists, which it doesn't in XEmacs.
30
12011-07-04 Bill Wohler <wohler@newt.com> 312011-07-04 Bill Wohler <wohler@newt.com>
2 32
3 * mh-e.el: Just require mh-loaddefs since loading it in an 33 * mh-e.el: Just require mh-loaddefs since loading it in an
diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el
index 1aa57316f50..882a8771e28 100644
--- a/lisp/mh-e/mh-comp.el
+++ b/lisp/mh-e/mh-comp.el
@@ -213,7 +213,7 @@ Elements look like (HEADER . VALUE) where both HEADER and VALUE
213are strings. 213are strings.
214 214
215CONTINUE, SWITCH-FUNCTION, YANK-ACTION, SEND-ACTIONS, and 215CONTINUE, SWITCH-FUNCTION, YANK-ACTION, SEND-ACTIONS, and
216RETURN-ACTION are ignored." 216RETURN-ACTION and any additional arguments are IGNORED."
217 (mh-find-path) 217 (mh-find-path)
218 (let ((mh-error-if-no-draft t)) 218 (let ((mh-error-if-no-draft t))
219 (mh-send to "" subject) 219 (mh-send to "" subject)
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 87272b1c83b..70d0cb5fcd5 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -5,7 +5,7 @@
5 5
6;; Author: Bill Wohler <wohler@newt.com> 6;; Author: Bill Wohler <wohler@newt.com>
7;; Maintainer: Bill Wohler <wohler@newt.com> 7;; Maintainer: Bill Wohler <wohler@newt.com>
8;; Version: 8.2 8;; Version: 8.2.90
9;; Keywords: mail 9;; Keywords: mail
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
@@ -27,7 +27,7 @@
27 27
28;; MH-E is an Emacs interface to the MH mail system. 28;; MH-E is an Emacs interface to the MH mail system.
29 29
30;; MH-E is supported in GNU Emacs 21 and 22, as well as XEmacs 21 30;; MH-E is supported in GNU Emacs 21 and higher, as well as XEmacs 21
31;; (except for versions 21.5.9-21.5.16). It is compatible with MH 31;; (except for versions 21.5.9-21.5.16). It is compatible with MH
32;; versions 6.8.4 and higher, all versions of nmh, and GNU mailutils 32;; versions 6.8.4 and higher, all versions of nmh, and GNU mailutils
33;; 1.0 and higher. Gnus is also required; version 5.10 or higher is 33;; 1.0 and higher. Gnus is also required; version 5.10 or higher is
@@ -127,7 +127,7 @@
127;; Try to keep variables local to a single file. Provide accessors if 127;; Try to keep variables local to a single file. Provide accessors if
128;; variables are shared. Use this section as a last resort. 128;; variables are shared. Use this section as a last resort.
129 129
130(defconst mh-version "8.2" "Version number of MH-E.") 130(defconst mh-version "8.2.90" "Version number of MH-E.")
131 131
132;; Variants 132;; Variants
133 133
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el
index 40febd641de..2248221664b 100644
--- a/lisp/mh-e/mh-folder.el
+++ b/lisp/mh-e/mh-folder.el
@@ -795,7 +795,7 @@ instead."
795 (setq threading-needed-flag mh-show-threads-flag) 795 (setq threading-needed-flag mh-show-threads-flag)
796 (setq mh-previous-window-config config)) 796 (setq mh-previous-window-config config))
797 ((not (eq (current-buffer) (get-buffer folder))) 797 ((not (eq (current-buffer) (get-buffer folder)))
798 (switch-to-buffer folder) 798 (pop-to-buffer folder)
799 (setq mh-previous-window-config config)))) 799 (setq mh-previous-window-config config))))
800 (mh-get-new-mail file) 800 (mh-get-new-mail file)
801 (when (and threading-needed-flag 801 (when (and threading-needed-flag
@@ -855,7 +855,7 @@ From a program, edit MESSAGE; nil means edit current message."
855 855
856 ;; Just show the edit buffer... 856 ;; Just show the edit buffer...
857 (delete-other-windows) 857 (delete-other-windows)
858 (switch-to-buffer edit-buffer))) 858 (pop-to-buffer edit-buffer)))
859 859
860;;;###mh-autoload 860;;;###mh-autoload
861(defun mh-next-button (&optional backward-flag) 861(defun mh-next-button (&optional backward-flag)
@@ -1705,7 +1705,7 @@ DONT-EXEC-PENDING is non-nil."
1705 (unless dont-exec-pending 1705 (unless dont-exec-pending
1706 (mh-process-or-undo-commands folder) 1706 (mh-process-or-undo-commands folder)
1707 (mh-reset-threads-and-narrowing)) 1707 (mh-reset-threads-and-narrowing))
1708 (switch-to-buffer folder))) 1708 (pop-to-buffer folder)))
1709 (mh-regenerate-headers range) 1709 (mh-regenerate-headers range)
1710 (if (zerop (buffer-size)) 1710 (if (zerop (buffer-size))
1711 (if (equal range "all") 1711 (if (equal range "all")
@@ -1786,7 +1786,7 @@ Also removes all content from the folder buffer."
1786(defun mh-make-folder (name) 1786(defun mh-make-folder (name)
1787 "Create a new mail folder called NAME. 1787 "Create a new mail folder called NAME.
1788Make it the current folder." 1788Make it the current folder."
1789 (switch-to-buffer name) 1789 (pop-to-buffer name)
1790 (setq buffer-read-only nil) 1790 (setq buffer-read-only nil)
1791 (erase-buffer) 1791 (erase-buffer)
1792 (if mh-adaptive-cmd-note-flag 1792 (if mh-adaptive-cmd-note-flag
diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el
index dfac684ed50..46a04c38845 100644
--- a/lisp/mh-e/mh-funcs.el
+++ b/lisp/mh-e/mh-funcs.el
@@ -349,7 +349,7 @@ See `mh-store-msg' for a description of DIRECTORY."
349 (error "Error occurred during execution of %s" command))))) 349 (error "Error occurred during execution of %s" command)))))
350 350
351;;;###mh-autoload 351;;;###mh-autoload
352(defun mh-undo-folder (&rest _ignored) 352(defun mh-undo-folder (&rest ignored)
353 "Undo all refiles and deletes in the current folder. 353 "Undo all refiles and deletes in the current folder.
354Arguments are IGNORED (for `revert-buffer')." 354Arguments are IGNORED (for `revert-buffer')."
355 (interactive) 355 (interactive)
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index 25554b7822e..bc5080a5d30 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -511,7 +511,7 @@ decoding the same message multiple times."
511 (when mh-decode-mime-flag 511 (when mh-decode-mime-flag
512 (save-excursion 512 (save-excursion
513 (let ((buffer-read-only nil)) 513 (let ((buffer-read-only nil))
514 (rfc2047-decode-region (progn (mh-goto-header-field "subject:") (point)) 514 (rfc2047-decode-region (progn (mh-goto-header-field "Subject:") (point))
515 (progn (mh-header-field-end) (point))))))) 515 (progn (mh-header-field-end) (point)))))))
516 516
517;;;###mh-autoload 517;;;###mh-autoload
diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el
index 1e764291f5d..a547dd8d80a 100644
--- a/lisp/mh-e/mh-search.el
+++ b/lisp/mh-e/mh-search.el
@@ -454,12 +454,12 @@ search all folders."
454 454
455(defvar mh-flists-search-folders) 455(defvar mh-flists-search-folders)
456 456
457(defun mh-flists-execute (&rest args) 457(defun mh-flists-execute (&rest ignored)
458 "Execute flists. 458 "Execute flists.
459Search for messages belonging to `mh-flists-sequence' in the 459Search for messages belonging to `mh-flists-sequence' in the
460folders specified by `mh-flists-search-folders'. If 460folders specified by `mh-flists-search-folders'. If
461`mh-recursive-folders-flag' is t, then the folders are searched 461`mh-recursive-folders-flag' is t, then the folders are searched
462recursively. All parameters ARGS are ignored." 462recursively. All arguments are IGNORED."
463 (set-buffer (get-buffer-create mh-temp-index-buffer)) 463 (set-buffer (get-buffer-create mh-temp-index-buffer))
464 (erase-buffer) 464 (erase-buffer)
465 (unless (executable-find "sh") 465 (unless (executable-find "sh")
diff --git a/lisp/mh-e/mh-speed.el b/lisp/mh-e/mh-speed.el
index b782081c85c..5c3679e8ce6 100644
--- a/lisp/mh-e/mh-speed.el
+++ b/lisp/mh-e/mh-speed.el
@@ -126,9 +126,9 @@ With non-nil FORCE, the update is always carried out."
126 ;; Otherwise on to your regular programming 126 ;; Otherwise on to your regular programming
127 (t t))) 127 (t t)))
128 128
129(defun mh-speed-toggle (&rest args) 129(defun mh-speed-toggle (&rest ignored)
130 "Toggle the display of child folders in the speedbar. 130 "Toggle the display of child folders in the speedbar.
131The optional ARGS from speedbar are ignored." 131The optional arguments from speedbar are IGNORED."
132 (interactive) 132 (interactive)
133 (declare (ignore args)) 133 (declare (ignore args))
134 (beginning-of-line) 134 (beginning-of-line)
@@ -165,9 +165,9 @@ The optional ARGS from speedbar are ignored."
165 (mh-line-beginning-position) (1+ (line-beginning-position)) 165 (mh-line-beginning-position) (1+ (line-beginning-position))
166 `(mh-expanded t))))))) 166 `(mh-expanded t)))))))
167 167
168(defun mh-speed-view (&rest args) 168(defun mh-speed-view (&rest ignored)
169 "Visits the selected folder just as if you had used \\<mh-folder-mode-map>\\[mh-visit-folder]. 169 "Visits the selected folder just as if you had used \\<mh-folder-mode-map>\\[mh-visit-folder].
170The optional ARGS from speedbar are ignored." 170The optional arguments from speedbar are IGNORED."
171 (interactive) 171 (interactive)
172 (declare (ignore args)) 172 (declare (ignore args))
173 (let* ((folder (get-text-property (mh-line-beginning-position) 'mh-folder)) 173 (let* ((folder (get-text-property (mh-line-beginning-position) 'mh-folder))
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index a77633cd4bd..6132af17dab 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -596,7 +596,6 @@ Expects FOLDER to have already been normalized with
596 (setq name (substring name 0 (1- (length name))))) 596 (setq name (substring name 0 (1- (length name)))))
597 (push 597 (push
598 (cons name 598 (cons name
599 ;; FIXME: what is this used for? --Stef
600 (search-forward "(others)" (mh-line-end-position) t)) 599 (search-forward "(others)" (mh-line-end-position) t))
601 results)))) 600 results))))
602 (forward-line 1)))) 601 (forward-line 1))))
diff --git a/lisp/mh-e/mh-xface.el b/lisp/mh-e/mh-xface.el
index 027d79a948a..1c7531b59d1 100644
--- a/lisp/mh-e/mh-xface.el
+++ b/lisp/mh-e/mh-xface.el
@@ -125,7 +125,8 @@ in this order is used."
125(defun mh-face-to-png (data) 125(defun mh-face-to-png (data)
126 "Convert base64 encoded DATA to png image." 126 "Convert base64 encoded DATA to png image."
127 (with-temp-buffer 127 (with-temp-buffer
128 (set-buffer-multibyte nil) 128 (if (fboundp 'set-buffer-multibyte)
129 (set-buffer-multibyte nil))
129 (insert data) 130 (insert data)
130 (ignore-errors (base64-decode-region (point-min) (point-max))) 131 (ignore-errors (base64-decode-region (point-min) (point-max)))
131 (buffer-string))) 132 (buffer-string)))
@@ -133,7 +134,8 @@ in this order is used."
133(defun mh-uncompface (data) 134(defun mh-uncompface (data)
134 "Run DATA through `uncompface' to generate bitmap." 135 "Run DATA through `uncompface' to generate bitmap."
135 (with-temp-buffer 136 (with-temp-buffer
136 (set-buffer-multibyte nil) 137 (if (fboundp 'set-buffer-multibyte)
138 (set-buffer-multibyte nil))
137 (insert data) 139 (insert data)
138 (when (and mh-uncompface-executable 140 (when (and mh-uncompface-executable
139 (equal (call-process-region (point-min) (point-max) 141 (equal (call-process-region (point-min) (point-max)
@@ -271,7 +273,8 @@ file contents as a string is returned. If FILE is nil, then both
271elements of the list are nil." 273elements of the list are nil."
272 (if (stringp file) 274 (if (stringp file)
273 (with-temp-buffer 275 (with-temp-buffer
274 (set-buffer-multibyte nil) 276 (if (fboundp 'set-buffer-multibyte)
277 (set-buffer-multibyte nil))
275 (let ((type (and (string-match ".*\\.\\(...\\)$" file) 278 (let ((type (and (string-match ".*\\.\\(...\\)$" file)
276 (intern (match-string 1 file))))) 279 (intern (match-string 1 file)))))
277 (insert-file-contents-literally file) 280 (insert-file-contents-literally file)
diff --git a/lisp/startup.el b/lisp/startup.el
index 26c5a469330..c6f3063ca90 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1293,7 +1293,7 @@ If this is nil, no message will be displayed."
1293;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1293;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1294 1294
1295(defconst fancy-startup-text 1295(defconst fancy-startup-text
1296 `((:face (variable-pitch (:foreground "red")) 1296 `((:face (variable-pitch font-lock-comment-face)
1297 "Welcome to " 1297 "Welcome to "
1298 :link ("GNU Emacs" 1298 :link ("GNU Emacs"
1299 ,(lambda (_button) (browse-url "http://www.gnu.org/software/emacs/")) 1299 ,(lambda (_button) (browse-url "http://www.gnu.org/software/emacs/"))
@@ -1350,7 +1350,7 @@ Each element in the list should be a list of strings or pairs
1350`:face FACE', like `fancy-splash-insert' accepts them.") 1350`:face FACE', like `fancy-splash-insert' accepts them.")
1351 1351
1352(defconst fancy-about-text 1352(defconst fancy-about-text
1353 `((:face (variable-pitch (:foreground "red")) 1353 `((:face (variable-pitch font-lock-comment-face)
1354 "This is " 1354 "This is "
1355 :link ("GNU Emacs" 1355 :link ("GNU Emacs"
1356 ,(lambda (_button) (browse-url "http://www.gnu.org/software/emacs/")) 1356 ,(lambda (_button) (browse-url "http://www.gnu.org/software/emacs/"))
@@ -1366,11 +1366,7 @@ Each element in the list should be a list of strings or pairs
1366 `("GNU" ,(lambda (_button) (describe-gnu-project)) 1366 `("GNU" ,(lambda (_button) (describe-gnu-project))
1367 "Display info on the GNU project."))) 1367 "Display info on the GNU project.")))
1368 " operating system.\n" 1368 " operating system.\n"
1369 :face ,(lambda () 1369 :face (variable-pitch font-lock-builtin-face)
1370 (list 'variable-pitch
1371 (list :foreground
1372 (if (eq (frame-parameter nil 'background-mode) 'dark)
1373 "cyan" "darkblue"))))
1374 "\n" 1370 "\n"
1375 ,(lambda () (emacs-version)) 1371 ,(lambda () (emacs-version))
1376 "\n" 1372 "\n"
@@ -1426,8 +1422,7 @@ Each element in the list should be a list of strings or pairs
1426 ,(lambda (_button) 1422 ,(lambda (_button)
1427 (browse-url "http://www.gnu.org/software/emacs/tour/")) 1423 (browse-url "http://www.gnu.org/software/emacs/tour/"))
1428 "Browse http://www.gnu.org/software/emacs/tour/") 1424 "Browse http://www.gnu.org/software/emacs/tour/")
1429 "\tSee an overview of Emacs features at gnu.org" 1425 "\tSee an overview of Emacs features at gnu.org"))
1430 ))
1431 "A list of texts to show in the middle part of the About screen. 1426 "A list of texts to show in the middle part of the About screen.
1432Each element in the list should be a list of strings or pairs 1427Each element in the list should be a list of strings or pairs
1433`:face FACE', like `fancy-splash-insert' accepts them.") 1428`:face FACE', like `fancy-splash-insert' accepts them.")
@@ -1537,93 +1532,91 @@ a face or button specification."
1537 1532
1538(defun fancy-startup-tail (&optional concise) 1533(defun fancy-startup-tail (&optional concise)
1539 "Insert the tail part of the splash screen into the current buffer." 1534 "Insert the tail part of the splash screen into the current buffer."
1540 (let ((fg (if (eq (frame-parameter nil 'background-mode) 'dark) 1535 (unless concise
1541 "cyan" "darkblue")))
1542 (unless concise
1543 (fancy-splash-insert
1544 :face 'variable-pitch
1545 "\nTo start... "
1546 :link `("Open a File"
1547 ,(lambda (_button) (call-interactively 'find-file))
1548 "Specify a new file's name, to edit the file")
1549 " "
1550 :link `("Open Home Directory"
1551 ,(lambda (_button) (dired "~"))
1552 "Open your home directory, to operate on its files")
1553 " "
1554 :link `("Customize Startup"
1555 ,(lambda (_button) (customize-group 'initialization))
1556 "Change initialization settings including this screen")
1557 "\n"))
1558 (fancy-splash-insert 1536 (fancy-splash-insert
1559 :face 'variable-pitch "To quit a partially entered command, type " 1537 :face 'variable-pitch
1560 :face 'default "Control-g" 1538 "\nTo start... "
1561 :face 'variable-pitch ".\n") 1539 :link `("Open a File"
1562 (fancy-splash-insert :face `(variable-pitch (:foreground ,fg)) 1540 ,(lambda (_button) (call-interactively 'find-file))
1563 "\nThis is " 1541 "Specify a new file's name, to edit the file")
1564 (emacs-version) 1542 " "
1565 "\n" 1543 :link `("Open Home Directory"
1566 :face '(variable-pitch (:height 0.8)) 1544 ,(lambda (_button) (dired "~"))
1567 emacs-copyright 1545 "Open your home directory, to operate on its files")
1568 "\n") 1546 " "
1569 (and auto-save-list-file-prefix 1547 :link `("Customize Startup"
1570 ;; Don't signal an error if the 1548 ,(lambda (_button) (customize-group 'initialization))
1571 ;; directory for auto-save-list files 1549 "Change initialization settings including this screen")
1572 ;; does not yet exist. 1550 "\n"))
1573 (file-directory-p (file-name-directory 1551 (fancy-splash-insert
1574 auto-save-list-file-prefix)) 1552 :face 'variable-pitch "To quit a partially entered command, type "
1575 (directory-files 1553 :face 'default "Control-g"
1576 (file-name-directory auto-save-list-file-prefix) 1554 :face 'variable-pitch ".\n")
1577 nil 1555 (fancy-splash-insert :face `(variable-pitch font-lock-builtin-face)
1578 (concat "\\`" 1556 "\nThis is "
1579 (regexp-quote (file-name-nondirectory 1557 (emacs-version)
1580 auto-save-list-file-prefix))) 1558 "\n"
1581 t) 1559 :face '(variable-pitch (:height 0.8))
1582 (fancy-splash-insert :face '(variable-pitch (:foreground "red")) 1560 emacs-copyright
1583 "\nIf an Emacs session crashed recently, " 1561 "\n")
1584 "type " 1562 (and auto-save-list-file-prefix
1585 :face '(fixed-pitch :foreground "red") 1563 ;; Don't signal an error if the
1586 "Meta-x recover-session RET" 1564 ;; directory for auto-save-list files
1587 :face '(variable-pitch (:foreground "red")) 1565 ;; does not yet exist.
1588 "\nto recover" 1566 (file-directory-p (file-name-directory
1589 " the files you were editing.")) 1567 auto-save-list-file-prefix))
1590 1568 (directory-files
1591 (when concise 1569 (file-name-directory auto-save-list-file-prefix)
1592 (fancy-splash-insert 1570 nil
1593 :face 'variable-pitch "\n" 1571 (concat "\\`"
1594 :link `("Dismiss this startup screen" 1572 (regexp-quote (file-name-nondirectory
1595 ,(lambda (_button) 1573 auto-save-list-file-prefix)))
1596 (when startup-screen-inhibit-startup-screen 1574 t)
1597 (customize-set-variable 'inhibit-startup-screen t) 1575 (fancy-splash-insert :face '(variable-pitch font-lock-comment-face)
1598 (customize-mark-to-save 'inhibit-startup-screen) 1576 "\nIf an Emacs session crashed recently, "
1599 (custom-save-all)) 1577 "type "
1600 (let ((w (get-buffer-window "*GNU Emacs*"))) 1578 :face '(fixed-pitch font-lock-comment-face)
1601 (and w (not (one-window-p)) (delete-window w))) 1579 "Meta-x recover-session RET"
1602 (kill-buffer "*GNU Emacs*"))) 1580 :face '(variable-pitch font-lock-comment-face)
1603 " ") 1581 "\nto recover"
1604 (when (or user-init-file custom-file) 1582 " the files you were editing."))
1605 (let ((checked (create-image "checked.xpm" 1583
1606 nil nil :ascent 'center)) 1584 (when concise
1607 (unchecked (create-image "unchecked.xpm" 1585 (fancy-splash-insert
1608 nil nil :ascent 'center))) 1586 :face 'variable-pitch "\n"
1609 (insert-button 1587 :link `("Dismiss this startup screen"
1610 " " 1588 ,(lambda (_button)
1611 :on-glyph checked 1589 (when startup-screen-inhibit-startup-screen
1612 :off-glyph unchecked 1590 (customize-set-variable 'inhibit-startup-screen t)
1613 'checked nil 'display unchecked 'follow-link t 1591 (customize-mark-to-save 'inhibit-startup-screen)
1614 'action (lambda (button) 1592 (custom-save-all))
1615 (if (overlay-get button 'checked) 1593 (let ((w (get-buffer-window "*GNU Emacs*")))
1616 (progn (overlay-put button 'checked nil) 1594 (and w (not (one-window-p)) (delete-window w)))
1617 (overlay-put button 'display 1595 (kill-buffer "*GNU Emacs*")))
1618 (overlay-get button :off-glyph)) 1596 " ")
1619 (setq startup-screen-inhibit-startup-screen 1597 (when (or user-init-file custom-file)
1620 nil)) 1598 (let ((checked (create-image "checked.xpm"
1621 (overlay-put button 'checked t) 1599 nil nil :ascent 'center))
1622 (overlay-put button 'display 1600 (unchecked (create-image "unchecked.xpm"
1623 (overlay-get button :on-glyph)) 1601 nil nil :ascent 'center)))
1624 (setq startup-screen-inhibit-startup-screen t))))) 1602 (insert-button
1625 (fancy-splash-insert :face '(variable-pitch (:height 0.9)) 1603 " "
1626 " Never show it again."))))) 1604 :on-glyph checked
1605 :off-glyph unchecked
1606 'checked nil 'display unchecked 'follow-link t
1607 'action (lambda (button)
1608 (if (overlay-get button 'checked)
1609 (progn (overlay-put button 'checked nil)
1610 (overlay-put button 'display
1611 (overlay-get button :off-glyph))
1612 (setq startup-screen-inhibit-startup-screen
1613 nil))
1614 (overlay-put button 'checked t)
1615 (overlay-put button 'display
1616 (overlay-get button :on-glyph))
1617 (setq startup-screen-inhibit-startup-screen t)))))
1618 (fancy-splash-insert :face '(variable-pitch (:height 0.9))
1619 " Never show it again."))))
1627 1620
1628(defun exit-splash-screen () 1621(defun exit-splash-screen ()
1629 "Stop displaying the splash screen buffer." 1622 "Stop displaying the splash screen buffer."
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index 8fdce17df86..05208abb720 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -44,7 +44,8 @@
44;; when you are on a tty. I hope that won't cause too much trouble -- rms. 44;; when you are on a tty. I hope that won't cause too much trouble -- rms.
45(define-minor-mode tool-bar-mode 45(define-minor-mode tool-bar-mode
46 "Toggle use of the tool bar. 46 "Toggle use of the tool bar.
47With numeric ARG, display the tool bar if and only if ARG is positive. 47With a numeric argument, if the argument is positive, turn on the
48tool bar; otherwise, turn off the tool bar.
48 49
49See `tool-bar-add-item' and `tool-bar-add-item-from-menu' for 50See `tool-bar-add-item' and `tool-bar-add-item-from-menu' for
50conveniently adding tool bar items." 51conveniently adding tool bar items."
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index e3f3c153043..796311f8f66 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1605,10 +1605,13 @@ Return t if the buffer had changes, nil otherwise."
1605 ;; bindings are nicer for read only buffers. pcl-cvs does the 1605 ;; bindings are nicer for read only buffers. pcl-cvs does the
1606 ;; same thing. 1606 ;; same thing.
1607 (setq buffer-read-only t) 1607 (setq buffer-read-only t)
1608 (vc-exec-after `(vc-diff-finish ,(current-buffer) ',(when verbose
1609 messages)))
1610 ;; Display the buffer, but at the end because it can change point. 1608 ;; Display the buffer, but at the end because it can change point.
1611 (pop-to-buffer (current-buffer)) 1609 (pop-to-buffer (current-buffer))
1610 ;; The diff process may finish early, so call `vc-diff-finish'
1611 ;; after `pop-to-buffer'; the former assumes the diff buffer is
1612 ;; shown in some window.
1613 (vc-exec-after `(vc-diff-finish ,(current-buffer)
1614 ',(when verbose messages)))
1612 ;; In the async case, we return t even if there are no differences 1615 ;; In the async case, we return t even if there are no differences
1613 ;; because we don't know that yet. 1616 ;; because we don't know that yet.
1614 t))) 1617 t)))
diff --git a/lisp/window.el b/lisp/window.el
index 2c4bf0dcb23..999e408bdb1 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -3829,22 +3829,6 @@ subwindows can get as small as `window-safe-min-height' and
3829 (window-state-put-2 ignore)) 3829 (window-state-put-2 ignore))
3830 (window-check frame)))) 3830 (window-check frame))))
3831 3831
3832;;; Displaying buffers.
3833(defconst display-buffer-default-specifiers
3834 '((reuse-window nil same visible)
3835 (pop-up-window (largest . nil) (lru . nil))
3836 (pop-up-window-min-height . 40)
3837 (pop-up-window-min-width . 80)
3838 (reuse-window other nil nil)
3839 (reuse-window nil other visible)
3840 (reuse-window nil nil t)
3841 (reuse-window-even-sizes . t))
3842 "Buffer display default specifiers.
3843The value specified here is used when no other specifiers have
3844been specified by the user or the application. Consult the
3845documentation of `display-buffer-alist' for a description of
3846buffer display specifiers.")
3847
3848(defconst display-buffer-macro-specifiers 3832(defconst display-buffer-macro-specifiers
3849 '((same-window 3833 '((same-window
3850 ;; Use the same window. 3834 ;; Use the same window.
@@ -3854,11 +3838,6 @@ buffer display specifiers.")
3854 (reuse-window nil same nil) 3838 (reuse-window nil same nil)
3855 (pop-up-window (largest . nil) (lru . nil)) 3839 (pop-up-window (largest . nil) (lru . nil))
3856 (reuse-window nil other nil)) 3840 (reuse-window nil other nil))
3857 ;; (other-window
3858 ;; ;; Avoid selected window.
3859 ;; (reuse-window other same visible)
3860 ;; (pop-up-window (largest . nil) (lru . nil))
3861 ;; (reuse-window other other visible))
3862 (same-frame-other-window 3841 (same-frame-other-window
3863 ;; Avoid other frames and selected window. 3842 ;; Avoid other frames and selected window.
3864 (reuse-window other same nil) 3843 (reuse-window other same nil)
@@ -3868,25 +3847,10 @@ buffer display specifiers.")
3868 ;; Avoid selected frame. 3847 ;; Avoid selected frame.
3869 (reuse-window nil same other) 3848 (reuse-window nil same other)
3870 (pop-up-frame) 3849 (pop-up-frame)
3871 (reuse-window nil other other)) 3850 (reuse-window nil other other)))
3872 (default
3873 ;; The default specifiers.
3874 display-buffer-default-specifiers))
3875 "Buffer display macro specifiers.") 3851 "Buffer display macro specifiers.")
3876 3852
3877(defcustom display-buffer-alist 3853(defcustom display-buffer-alist nil
3878 '((((regexp . ".*"))
3879 ;; Reuse window showing same buffer on same frame.
3880 reuse-window (reuse-window nil same nil)
3881 ;; Pop up window.
3882 pop-up-window
3883 ;; Split largest or lru window.
3884 (pop-up-window (largest . nil) (lru . nil))
3885 (pop-up-window-min-height . 40) ; split-height-threshold / 2
3886 (pop-up-window-min-width . 80) ; split-width-threshold / 2
3887 ;; Reuse any but selected window on same frame.
3888 reuse-window (reuse-window other nil nil)
3889 (reuse-window-even-sizes . t)))
3890 "List associating buffer identifiers with display specifiers. 3854 "List associating buffer identifiers with display specifiers.
3891The car of each element of this list is built from a set of cons 3855The car of each element of this list is built from a set of cons
3892cells called buffer identifiers. `display-buffer' shows a buffer 3856cells called buffer identifiers. `display-buffer' shows a buffer
@@ -4751,15 +4715,15 @@ documentation of `display-buffer-alist' for a description."
4751 (setq window (window-normalize-live-window window)) 4715 (setq window (window-normalize-live-window window))
4752 (let* ((old-frame (selected-frame)) 4716 (let* ((old-frame (selected-frame))
4753 (new-frame (window-frame window)) 4717 (new-frame (window-frame window))
4754 (dedicated (cdr (assq 'dedicated specifiers))) 4718 (dedicate (cdr (assq 'dedicate specifiers)))
4755 (no-other-window (cdr (assq 'no-other-window specifiers)))) 4719 (no-other-window (cdr (assq 'no-other-window specifiers))))
4756 ;; Show BUFFER in WINDOW. 4720 ;; Show BUFFER in WINDOW.
4757 (unless (eq buffer (window-buffer window)) 4721 (unless (eq buffer (window-buffer window))
4758 ;; If we show another buffer in WINDOW, undedicate it first. 4722 ;; If we show another buffer in WINDOW, undedicate it first.
4759 (set-window-dedicated-p window nil)) 4723 (set-window-dedicated-p window nil))
4760 (set-window-buffer window buffer) 4724 (set-window-buffer window buffer)
4761 (when dedicated 4725 (when dedicate
4762 (set-window-dedicated-p window dedicated)) 4726 (set-window-dedicated-p window dedicate))
4763 (when no-other-window 4727 (when no-other-window
4764 (set-window-parameter window 'no-other-window t)) 4728 (set-window-parameter window 'no-other-window t))
4765 (unless (or (eq old-frame new-frame) 4729 (unless (or (eq old-frame new-frame)
@@ -4775,7 +4739,7 @@ documentation of `display-buffer-alist' for a description."
4775 ;; Return window. 4739 ;; Return window.
4776 window)) 4740 window))
4777 4741
4778(defun display-buffer-reuse-window (buffer method &optional specifiers) 4742(defun display-buffer-reuse-window (buffer method &optional specifiers other-window)
4779 "Display BUFFER in an existing window. 4743 "Display BUFFER in an existing window.
4780METHOD must be a list in the form of the cdr of a `reuse-window' 4744METHOD must be a list in the form of the cdr of a `reuse-window'
4781buffer display specifier, see `display-buffer-alist' for an 4745buffer display specifier, see `display-buffer-alist' for an
@@ -4787,8 +4751,9 @@ frame to use - either nil, 0, `visible', `other', t, or a live
4787frame. 4751frame.
4788 4752
4789Optional argument SPECIFIERS must be a list of valid display 4753Optional argument SPECIFIERS must be a list of valid display
4790specifiers. Return the window chosen to display BUFFER, nil if 4754specifiers. Optional argument OTHER-WINDOW, if non-nil, means do
4791none was found." 4755not use the selected window. Return the window chosen to display
4756BUFFER, nil if none was found."
4792 (let* ((method-window (nth 0 method)) 4757 (let* ((method-window (nth 0 method))
4793 (method-buffer (nth 1 method)) 4758 (method-buffer (nth 1 method))
4794 (method-frame (nth 2 method)) 4759 (method-frame (nth 2 method))
@@ -4806,6 +4771,7 @@ none was found."
4806 (eq window-buffer buffer)) 4771 (eq window-buffer buffer))
4807 (or (not method-window) 4772 (or (not method-window)
4808 (and (eq method-window 'same) 4773 (and (eq method-window 'same)
4774 (not other-window)
4809 (eq window (selected-window))) 4775 (eq window (selected-window)))
4810 (and (eq method-window 'other) 4776 (and (eq method-window 'other)
4811 (not (eq window (selected-window)))) 4777 (not (eq window (selected-window))))
@@ -5064,7 +5030,7 @@ description."
5064 ;; A window, directly specified. 5030 ;; A window, directly specified.
5065 cand))) 5031 cand)))
5066 5032
5067 (when (and (window-live-p window) 5033 (when (and (window-any-p window)
5068 ;; The window must be on the correct frame, 5034 ;; The window must be on the correct frame,
5069 (eq (window-frame window) frame) 5035 (eq (window-frame window) frame)
5070 ;; and must be neither a minibuffer window 5036 ;; and must be neither a minibuffer window
@@ -5084,7 +5050,7 @@ description."
5084 ;; Don't pass any specifiers to this function. 5050 ;; Don't pass any specifiers to this function.
5085 (funcall side window))))) 5051 (funcall side window)))))
5086 5052
5087 (when window 5053 (when (window-live-p window)
5088 ;; Adjust sizes if asked for. 5054 ;; Adjust sizes if asked for.
5089 (display-buffer-set-height window specifiers) 5055 (display-buffer-set-height window specifiers)
5090 (display-buffer-set-width window specifiers) 5056 (display-buffer-set-width window specifiers)
@@ -5324,201 +5290,225 @@ Optional argument LABEL is like the same argument of
5324 5290
5325The calculation of the return value is exclusively based on the 5291The calculation of the return value is exclusively based on the
5326user preferences expressed in `display-buffer-alist'." 5292user preferences expressed in `display-buffer-alist'."
5327 (let* ((buffer (window-normalize-buffer buffer-or-name)) 5293 (let* ((buffer-name
5328 (list (display-buffer-normalize-alist (buffer-name buffer) label)) 5294 (buffer-name (window-normalize-buffer buffer-or-name)))
5329 (value (assq 'other-window-means-other-frame 5295 (default (display-buffer-normalize-default buffer-name))
5330 (or (car list) (cdr list))))) 5296 (alist (display-buffer-normalize-alist buffer-name label)))
5331 (when value (cdr value)))) 5297 (or (cdr (assq 'other-window-means-other-frame default))
5332 5298 (cdr (assq 'other-window-means-other-frame (cdr alist))))))
5333(defun display-buffer-normalize-arguments (buffer-name specifiers label other-frame) 5299
5334 "Normalize second and third argument of `display-buffer'. 5300(defun display-buffer-normalize-special (&optional args)
5335BUFFER-NAME is the name of the buffer that shall be displayed, 5301 "Return buffer display specifiers for `special-display-frame-alist'."
5336SPECIFIERS is the second argument of `display-buffer'. LABEL is 5302 (progn ;; <-- reserved for with-no-warnings
5337the same argument of `display-buffer'. OTHER-FRAME non-nil means 5303 (if (and (listp args) (symbolp (car args)))
5338use other-frame for other-window." 5304 ;; Note: `display-buffer' funcalls this so take "(nth 1 args)"
5339 (let (normalized entry specifier pars) 5305 ;; where `special-display-popup-frame' (which uses apply) takes
5340 (setq specifier 5306 ;; "(cdr args)".
5341 (cond 5307 `((function ,(car args) ,(nth 1 args)))
5342 ((not specifiers) 5308 (append
5343 nil) 5309 '((reuse-window nil same 0))
5344 ((listp specifiers) 5310 (when (and (listp args) (cdr (assq 'same-window args)))
5345 ;; If SPECIFIERS is a list, we assume it is a list of specifiers. 5311 '((reuse-window same nil nil) (reuse-dedicated . weak)))
5346 (dolist (specifier specifiers) 5312 (when (and (listp args)
5347 (cond 5313 (or (cdr (assq 'same-frame args))
5348 ((consp specifier) 5314 (cdr (assq 'same-window args))))
5349 (setq normalized (cons specifier normalized))) 5315 '((pop-up-window (largest . nil) (lru . nil))
5350 ((eq specifier 'other-window) 5316 (reuse-window nil nil nil)))
5351 ;; `other-window' must be treated separately. 5317 (unless display-buffer-mark-dedicated
5352 (let ((entry (assq (if other-frame 5318 ;; Don't make anything created above dedicated unless requested.
5353 'other-frame 5319 ;; Otherwise the dedication request below gets in our way.
5354 'same-frame-other-window) 5320 '((dedicated . nil)))
5355 display-buffer-macro-specifiers))) 5321 `((pop-up-frame t)
5356 (dolist (item (cdr entry)) 5322 ,(append '(pop-up-frame-alist)
5357 (setq normalized (cons item normalized))))) 5323 (when (listp args) args)
5358 ((symbolp specifier) 5324 special-display-frame-alist)
5359 ;; Might be a macro specifier, try to expand it (the cdr is a 5325 (dedicated . t))))))
5360 ;; list and we have to reverse it later, so do it one at a 5326
5361 ;; time). 5327(defun display-buffer-normalize-default (buffer-or-name)
5362 (let ((entry (assq specifier display-buffer-macro-specifiers)))
5363 (dolist (item (cdr entry))
5364 (setq normalized (cons item normalized)))))))
5365 ;; Reverse list.
5366 (nreverse normalized))
5367 ((setq entry (assq specifiers display-buffer-macro-specifiers))
5368 ;; A macro specifier.
5369 (cdr entry))
5370 ((or other-frame (with-no-warnings pop-up-frames))
5371 ;; `special-display-p' group.
5372 (if (and (with-no-warnings special-display-function)
5373 ;; `special-display-p' returns either t or a list
5374 ;; of frame parameters to pass to
5375 ;; `special-display-function'.
5376 (setq pars (with-no-warnings
5377 (special-display-p buffer-name))))
5378 (list (list 'function
5379 (with-no-warnings special-display-function)
5380 (when (listp pars) pars)))
5381 ;; Pop up another frame.
5382 (cddr (assq 'other-frame display-buffer-macro-specifiers))))
5383 (t
5384 ;; In any other case pop up a new window.
5385 (cdr (assq 'same-frame-other-window
5386 display-buffer-macro-specifiers)))))
5387
5388 ;; Handle the old meaning of the LABEL argument of `display-buffer'.
5389 (cond
5390 ((or (memq label '(visible 0 t)) (frame-live-p label))
5391 ;; LABEL must be one of visible (and visible frame), 0 (any
5392 ;; visible or iconfied frame), t (any frame), or a live frame.
5393 (cons `(reuse-window nil same ,label) specifier))
5394 ((or other-frame
5395 (with-no-warnings pop-up-frames)
5396 (with-no-warnings display-buffer-reuse-frames))
5397 (cons '(reuse-window nil same 0) specifier))
5398 (t
5399 specifier))))
5400
5401(defun display-buffer-normalize-options (buffer-or-name)
5402 "Subroutine of `display-buffer-normalize-specifiers'. 5328 "Subroutine of `display-buffer-normalize-specifiers'.
5403BUFFER-OR-NAME is the buffer to display. This routine provides a 5329BUFFER-OR-NAME is the buffer to display.
5404compatibility layer for the now obsolete Emacs 23 buffer display 5330
5405options." 5331This routine provides a compatibility layer for the obsolete
5406 (with-no-warnings 5332Emacs 23 buffer display options to set up the corresponding
5333buffer display specifiers."
5334 (progn ;; <-- reserved for with-no-warnings
5407 (let* ((buffer (window-normalize-buffer buffer-or-name)) 5335 (let* ((buffer (window-normalize-buffer buffer-or-name))
5408 (buffer-name (buffer-name buffer)) 5336 (buffer-name (buffer-name buffer))
5409 (use-pop-up-frames 5337 (pop-up-frames
5410 (or (and (eq pop-up-frames 'graphic-only) 5338 (and (boundp 'pop-up-frames)
5411 (display-graphic-p)) 5339 (or (and (eq pop-up-frames 'graphic-only)
5412 pop-up-frames)) 5340 (display-graphic-p))
5413 specifiers) 5341 pop-up-frames)))
5414 ;; `even-window-heights', unless nil or unset. 5342 specifiers args)
5415 (unless (memq even-window-heights '(nil unset)) 5343 ;; `other-window-means-other-frame'
5344 (when pop-up-frames
5345 (setq specifiers
5346 (cons (cons 'other-window-means-other-frame t) specifiers)))
5347
5348 ;; `even-window-heights'
5349 (unless (and (boundp 'even-window-heights)
5350 (not even-window-heights))
5416 (setq specifiers 5351 (setq specifiers
5417 (cons (cons 'reuse-window-even-sizes t) specifiers))) 5352 (cons (cons 'reuse-window-even-sizes t) specifiers)))
5418 5353
5419 ;; `display-buffer-mark-dedicated' 5354 ;; `display-buffer-mark-dedicated'
5420 (when display-buffer-mark-dedicated 5355 (when (and (boundp 'display-buffer-mark-dedicated)
5356 display-buffer-mark-dedicated)
5421 (setq specifiers 5357 (setq specifiers
5422 (cons (cons 'dedicate display-buffer-mark-dedicated) 5358 (cons (cons 'dedicate display-buffer-mark-dedicated)
5423 specifiers))) 5359 specifiers)))
5424 5360
5425 ;; `pop-up-window' group. Anything is added here iff 5361 ;; `pop-up-window-min-height'
5426 ;; `pop-up-windows' is neither nil nor unset. 5362 (let ((min-height
5427 (let ((pop-up-window (not (memq pop-up-windows '(nil unset)))) 5363 (if (boundp 'split-height-threshold)
5428 (fun (unless (eq split-window-preferred-function 5364 (if (numberp split-height-threshold)
5429 'split-window-sensibly) 5365 (/ split-height-threshold 2)
5430 split-window-preferred-function)) 5366 1.0)
5431 (min-height (if (numberp split-height-threshold) 5367 40)))
5432 (/ split-height-threshold 2) 5368 (setq specifiers
5433 1.0)) 5369 (cons (cons 'pop-up-window-min-height min-height)
5434 (min-width (if (numberp split-width-threshold) 5370 specifiers)))
5435 (/ split-width-threshold 2) 5371
5436 1.0))) 5372 ;; `pop-up-window-min-width'
5437 ;; Create an entry only if a default value was changed. 5373 (let ((min-width
5438 (when (or pop-up-window 5374 (if (boundp 'split-width-threshold)
5439 (not (equal split-height-threshold 80)) 5375 (if (numberp split-width-threshold)
5440 (not (equal split-width-threshold 160))) 5376 (/ split-width-threshold 2)
5441 ;; `reuse-window' (needed as fallback when popping up the new 5377 1.0)
5442 ;; window fails). 5378 80)))
5443 (setq specifiers 5379 (setq specifiers
5444 (cons (list 'reuse-window 'other nil nil) 5380 (cons (cons 'pop-up-window-min-width min-width)
5445 specifiers)) 5381 specifiers)))
5446 ;; `split-width-threshold' 5382
5447 (setq specifiers 5383 ;; `pop-up-window'
5448 (cons (cons 'pop-up-window-min-width min-width) 5384 (unless (and (boundp 'pop-up-windows) (not pop-up-windows))
5449 specifiers)) 5385 (let ((fun (when (and (boundp 'split-window-preferred-function)
5450 ;; `split-height-threshold' 5386 (not (eq split-window-preferred-function
5451 (setq specifiers 5387 'split-window-sensibly)))
5452 (cons (cons 'pop-up-window-min-height min-height) 5388 split-window-preferred-function)))
5453 specifiers))
5454 ;; `pop-up-window' 5389 ;; `pop-up-window'
5455 (setq specifiers 5390 (setq specifiers
5456 (cons (list 'pop-up-window 5391 (cons
5457 (cons 'largest fun) (cons 'lru fun)) 5392 (list 'pop-up-window (cons 'largest fun) (cons 'lru fun))
5458 specifiers)))) 5393 specifiers))))
5394
5395 ;; `pop-up-frame-function'
5396 (when (and (boundp 'pop-up-frame-function)
5397 (not (equal pop-up-frame-function
5398 '(lambda nil
5399 (make-frame pop-up-frame-alist)))))
5400 (setq specifiers
5401 (cons (cons 'pop-up-frame-function pop-up-frame-function)
5402 specifiers)))
5459 5403
5460 ;; `pop-up-frame' group. 5404 ;; `pop-up-frame-alist'
5461 (when use-pop-up-frames 5405 (when pop-up-frame-alist
5406 (setq specifiers
5407 (cons (cons 'pop-up-frame-alist pop-up-frame-alist)
5408 specifiers)))
5409
5410 ;; `pop-up-frame'
5411 (when pop-up-frames
5462 ;; `pop-up-frame-function'. If `pop-up-frame-function' uses the 5412 ;; `pop-up-frame-function'. If `pop-up-frame-function' uses the
5463 ;; now obsolete `pop-up-frame-alist' it will continue to do so. 5413 ;; now obsolete `pop-up-frame-alist' it will continue to do so.
5464 (setq specifiers
5465 (cons (cons 'pop-up-frame-function pop-up-frame-function)
5466 specifiers))
5467 ;; `pop-up-frame' 5414 ;; `pop-up-frame'
5468 (setq specifiers 5415 (setq specifiers
5416 ;; Maybe we should merge graphic-only into the following?
5469 (cons (list 'pop-up-frame t) specifiers))) 5417 (cons (list 'pop-up-frame t) specifiers)))
5470 5418
5471 ;; `pop-up-windows' and `use-pop-up-frames' both nil means means 5419 ;; `special-display'
5472 ;; we are supposed to reuse any window on the same frame (unless 5420 (when (and (boundp 'special-display-function)
5473 ;; we find one showing the same buffer already). 5421 special-display-function
5474 (unless (or pop-up-windows use-pop-up-frames) 5422 (fboundp 'special-display-p)
5475 ;; `reuse-window' showing any buffer on same frame. 5423 (setq args (special-display-p buffer-name)))
5476 (setq specifiers 5424 ;; `special-display-p' returns either t or a list of arguments
5477 (cons (list 'reuse-window nil nil nil) 5425 ;; to pass to `special-display-function'.
5478 specifiers))) 5426 (if (eq special-display-function 'special-display-popup-frame)
5479
5480 ;; `special-display-p' group.
5481 (when special-display-function
5482 ;; `special-display-p' returns either t or a list of frame
5483 ;; parameters to pass to `special-display-function'.
5484 (let ((pars (special-display-p buffer-name)))
5485 (when pars
5486 (setq specifiers 5427 (setq specifiers
5487 (cons (list 'function special-display-function 5428 (append (display-buffer-normalize-special args)
5488 (when (listp pars) pars)) 5429 specifiers))
5489 specifiers))))) 5430 (setq specifiers
5431 (cons
5432 `(function ,special-display-function ,(when (listp args) args))
5433 specifiers))))
5490 5434
5435 ;; Reuse window showing same buffer on visible or iconified frame.
5491 ;; `pop-up-frames', `display-buffer-reuse-frames' means search for 5436 ;; `pop-up-frames', `display-buffer-reuse-frames' means search for
5492 ;; a window showing the buffer on some visible or iconfied frame. 5437 ;; a window showing the buffer on some visible or iconfied frame.
5493 ;; `last-nonminibuffer-frame' set and not the same frame means 5438 ;; `last-nonminibuffer-frame' non-nil means search that frame.
5494 ;; search that frame. 5439 (let ((frames (or (and (or pop-up-frames
5495 (let ((frames (or (and (or use-pop-up-frames 5440 (and (boundp 'display-buffer-reuse-frames)
5496 display-buffer-reuse-frames 5441 display-buffer-reuse-frames)
5497 (not (last-nonminibuffer-frame))) 5442 (not (last-nonminibuffer-frame)))
5498 ;; All visible or iconfied frames. 5443 ;; All visible or iconfied frames.
5499 0) 5444 0)
5500 ;; Same frame. 5445 ;; The following usually returns the same frame
5446 ;; so we implicitly search for a window showing
5447 ;; the buffer on the same frame already.
5501 (last-nonminibuffer-frame)))) 5448 (last-nonminibuffer-frame))))
5502 (when frames 5449 (when frames
5503 (setq specifiers 5450 (setq specifiers
5504 (cons (list 'reuse-window 'other 'same frames) 5451 (cons (list 'reuse-window 'other 'same frames)
5505 specifiers)))) 5452 specifiers))))
5506 5453
5507 ;; `same-window-p' group. 5454 ;; `same-window'
5508 (when (same-window-p buffer-name) 5455 (when (and (fboundp 'same-window-p) (same-window-p buffer-name))
5509 ;; Try to reuse the same (selected) window. 5456 ;; Try to reuse the same (selected) window.
5510 (setq specifiers 5457 (setq specifiers
5511 (cons (list 'reuse-window 'same nil nil) 5458 (cons (list 'reuse-window 'same nil nil) specifiers)))
5512 specifiers)))
5513 5459
5514 ;; Prepend "reuse window on same frame if showing the buffer 5460 ;; Same window if showing this buffer already. Can be overridden
5515 ;; already" specifier. It will be overriden by the application 5461 ;; by `other-window' argument if the buffer is already shown in
5516 ;; supplied 'other-window specifier. 5462 ;; the same window.
5517 (setq specifiers (cons (list 'reuse-window nil 'same nil) 5463 (setq specifiers
5518 specifiers)) 5464 (cons (list 'reuse-window 'same 'same nil) specifiers))
5519 5465
5520 specifiers))) 5466 specifiers)))
5521 5467
5468(defun display-buffer-normalize-argument (buffer-name specifiers other-window-means-other-frame)
5469 "Normalize second argument of `display-buffer'.
5470BUFFER-NAME is the name of the buffer that shall be displayed,
5471SPECIFIERS is the second argument of `display-buffer'.
5472OTHER-WINDOW-MEANS-OTHER-FRAME non-nil means use other-frame for
5473other-window."
5474 (progn ;; <-- reserved for with-no-warnings
5475 (let (normalized entry specifier pars)
5476 (cond
5477 ((not specifiers)
5478 nil)
5479 ((listp specifiers)
5480 ;; If SPECIFIERS is a list, we assume it is a list of valid
5481 ;; specifiers.
5482 (dolist (specifier specifiers)
5483 (cond
5484 ((consp specifier)
5485 (setq normalized (cons specifier normalized)))
5486 ((eq specifier 'other-window)
5487 ;; `other-window' must be treated separately.
5488 (let ((entry (assq (if other-window-means-other-frame
5489 'other-frame
5490 'same-frame-other-window)
5491 display-buffer-macro-specifiers)))
5492 (dolist (item (cdr entry))
5493 (setq normalized (cons item normalized)))))
5494 ((symbolp specifier)
5495 ;; Might be a macro specifier, try to expand it (the cdr is a
5496 ;; list and we have to reverse it later, so do it one at a
5497 ;; time).
5498 (let ((entry (assq specifier display-buffer-macro-specifiers)))
5499 (dolist (item (cdr entry))
5500 (setq normalized (cons item normalized)))))))
5501 ;; Reverse list.
5502 (nreverse normalized))
5503 ((setq entry (assq specifiers display-buffer-macro-specifiers))
5504 ;; A macro specifier.
5505 (cdr entry))
5506 (t
5507 ;; Anything else means use another window according to the
5508 ;; non-overriding specifiers of `display-buffer-alist' and the
5509 ;; specifiers produced by `display-buffer-normalize-default'.
5510 '((other-window . t)))))))
5511
5522(defun display-buffer-normalize-alist-1 (specifiers label) 5512(defun display-buffer-normalize-alist-1 (specifiers label)
5523 "Subroutine of `display-buffer-normalize-alist'. 5513 "Subroutine of `display-buffer-normalize-alist'.
5524SPECIFIERS is a list of buffer display specfiers. LABEL is the 5514SPECIFIERS is a list of buffer display specfiers. LABEL is the
@@ -5579,9 +5569,6 @@ LABEL the corresponding argument of `display-buffer'."
5579 5569
5580 (cons list-1 list-2))) 5570 (cons list-1 list-2)))
5581 5571
5582(defvar display-buffer-normalize-options-inhibit nil
5583 "If non-nil, `display-buffer' doesn't process obsolete options.")
5584
5585(defun display-buffer-normalize-specifiers (buffer-name specifiers label) 5572(defun display-buffer-normalize-specifiers (buffer-name specifiers label)
5586 "Return normalized specifiers for a buffer matching BUFFER-NAME or LABEL. 5573 "Return normalized specifiers for a buffer matching BUFFER-NAME or LABEL.
5587BUFFER-NAME must be a string specifying a valid buffer name. 5574BUFFER-NAME must be a string specifying a valid buffer name.
@@ -5600,25 +5587,33 @@ specifiers:
5600 5587
5601- The specifiers in `display-buffer-alist' whose buffer 5588- The specifiers in `display-buffer-alist' whose buffer
5602 identifier matches BUFFER-NAME or LABEL and whose 'override 5589 identifier matches BUFFER-NAME or LABEL and whose 'override
5603 component is not set. 5590 component is not set."
5604 5591 (let* ((default (display-buffer-normalize-default buffer-name))
5605- `display-buffer-default-specifiers'." 5592 (alist (display-buffer-normalize-alist buffer-name label))
5606 (let* ((list (display-buffer-normalize-alist buffer-name label)) 5593 (other-window-means-other-frame
5607 (other-frame (cdr (assq 'other-window-means-other-frame 5594 (or (cdr (assq 'other-window-means-other-frame default))
5608 (or (car list) (cdr list)))))) 5595 (cdr (assq 'other-window-means-other-frame (cdr alist)))))
5596 (arg2 (display-buffer-normalize-argument
5597 buffer-name specifiers other-window-means-other-frame))
5598 (arg3
5599 ;; Handle special meaning of the LABEL argument of
5600 ;; `display-buffer'.
5601 (when (or (memq label '(visible 0 t)) (frame-live-p label))
5602 ;; LABEL must be one of visible (any visible frame), 0 (any
5603 ;; visible or iconfied frame), t (any frame), or a live
5604 ;; frame.
5605 `((reuse-window nil same ,label)))))
5609 (append 5606 (append
5610 ;; Overriding user specifiers. 5607 ;; Overriding user specifiers.
5611 (car list) 5608 (car alist)
5612 ;; Application specifiers. 5609 ;; Special value of third argument of display-buffer.
5613 (display-buffer-normalize-arguments 5610 arg3
5614 buffer-name specifiers label other-frame) 5611 ;; Second argument of display-buffer.
5615 ;; Emacs 23 compatibility specifiers. 5612 arg2
5616 (unless display-buffer-normalize-options-inhibit
5617 (display-buffer-normalize-options buffer-name))
5618 ;; Non-overriding user specifiers. 5613 ;; Non-overriding user specifiers.
5619 (cdr list) 5614 (cdr alist)
5620 ;; Default specifiers. 5615 ;; Default specifiers.
5621 display-buffer-default-specifiers))) 5616 default)))
5622 5617
5623;; Minibuffer-only frames should be documented better. They really 5618;; Minibuffer-only frames should be documented better. They really
5624;; deserve a separate section in the manual. Also 5619;; deserve a separate section in the manual. Also
@@ -5653,9 +5648,8 @@ For convenience, SPECIFIERS may also consist of a single buffer
5653display location specifier or t, where the latter means to 5648display location specifier or t, where the latter means to
5654display the buffer in any but the selected window. If SPECIFIERS 5649display the buffer in any but the selected window. If SPECIFIERS
5655is nil or omitted, this means to exclusively use the specifiers 5650is nil or omitted, this means to exclusively use the specifiers
5656provided by `display-buffer-alist'. If the value of the latter 5651provided by the variable `display-buffer-alist' and the function
5657is nil too, all specifiers are provided by the constant 5652`display-buffer-normalize-default'.
5658`display-buffer-default-specifiers'.
5659 5653
5660As a special case, the `reuse-window' specifier allows to specify 5654As a special case, the `reuse-window' specifier allows to specify
5661as second element an arbitrary window, as third element an 5655as second element an arbitrary window, as third element an
@@ -5707,7 +5701,7 @@ this list as arguments."
5707 ;; Don't use a minibuffer frame. 5701 ;; Don't use a minibuffer frame.
5708 (frame (display-buffer-frame)) 5702 (frame (display-buffer-frame))
5709 ;; `window' is the window we use for showing `buffer'. 5703 ;; `window' is the window we use for showing `buffer'.
5710 window specifier method) 5704 window specifier method other-window)
5711 ;; Reset this. 5705 ;; Reset this.
5712 (setq display-buffer-window nil) 5706 (setq display-buffer-window nil)
5713 (if display-buffer-function 5707 (if display-buffer-function
@@ -5723,7 +5717,7 @@ this list as arguments."
5723 (cond 5717 (cond
5724 ((eq method 'reuse-window) 5718 ((eq method 'reuse-window)
5725 (display-buffer-reuse-window 5719 (display-buffer-reuse-window
5726 buffer (cdr specifier) normalized)) 5720 buffer (cdr specifier) normalized other-window))
5727 ((eq method 'pop-up-window) 5721 ((eq method 'pop-up-window)
5728 (display-buffer-pop-up-window 5722 (display-buffer-pop-up-window
5729 buffer (cdr specifier) normalized)) 5723 buffer (cdr specifier) normalized))
@@ -5734,25 +5728,31 @@ this list as arguments."
5734 (display-buffer-in-side-window 5728 (display-buffer-in-side-window
5735 buffer (nth 1 specifier) (nth 2 specifier) normalized)) 5729 buffer (nth 1 specifier) (nth 2 specifier) normalized))
5736 ((eq method 'function) 5730 ((eq method 'function)
5737 (funcall (nth 1 specifier) buffer (nth 2 specifier)))))) 5731 (funcall (nth 1 specifier) buffer (nth 2 specifier)))
5732 ((eq method 'other-window)
5733 (setq other-window t)))))
5738 5734
5739 ;; If we don't have a window yet, try a fallback method. All 5735 ;; If we don't have a window yet, try a fallback method. All
5740 ;; specifiers have been used up by now. 5736 ;; specifiers have been used up by now. Try reusing a window
5741 (or (and (window-live-p window) window) 5737 (or (and (window-live-p window) window)
5742 ;; Try reusing a window showing BUFFER on any visible or 5738 ;; on the selected frame,
5743 ;; iconfied frame. 5739 (display-buffer-reuse-window
5744 (display-buffer-reuse-window buffer `(nil ,buffer 0)) 5740 buffer '(nil nil nil) nil other-window)
5745 ;; Try reusing a window not showing BUFFER on any visible or 5741 ;; showing BUFFER on any visible frame,
5746 ;; iconified frame. 5742 (display-buffer-reuse-window
5747 (display-buffer-reuse-window buffer '(nil other 0)) 5743 buffer '(nil same visible) nil other-window)
5748 ;; Eli says it's better to never try making a new frame. 5744 ;; not showing BUFFER on any visible frame,
5749 ;; (display-buffer-pop-up-frame buffer)
5750 ;; Try using a weakly dedicated window.
5751 (display-buffer-reuse-window 5745 (display-buffer-reuse-window
5752 buffer '(nil nil t) '((reuse-window-dedicated . weak))) 5746 buffer '(nil other visible) nil other-window)
5753 ;; Try using a strongly dedicated window. 5747 ;; showing BUFFER on any visible or iconified frame,
5754 (display-buffer-reuse-window 5748 (display-buffer-reuse-window
5755 buffer '(nil nil t) '((reuse-window-dedicated . t))))))) 5749 buffer '(nil same 0) nil other-window)
5750 ;; not showing BUFFER on any visible or iconified frame.
5751 (display-buffer-reuse-window
5752 buffer '(nil other 0) nil other-window)
5753 ;; If everything failed so far, try popping up a new frame
5754 ;; regardless of graphic-only restrictions.
5755 (display-buffer-pop-up-frame buffer)))))
5756 5756
5757(defsubst display-buffer-same-window (&optional buffer-or-name label) 5757(defsubst display-buffer-same-window (&optional buffer-or-name label)
5758 "Display buffer specified by BUFFER-OR-NAME in the selected window. 5758 "Display buffer specified by BUFFER-OR-NAME in the selected window.
@@ -6395,10 +6395,9 @@ that frame."
6395 ;; 'display-buffer-reuse-frames 6395 ;; 'display-buffer-reuse-frames
6396 ;; "use 2nd arg of `display-buffer' instead." "24.1") 6396 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6397 6397
6398(defcustom pop-up-windows 'unset ; t 6398(defcustom pop-up-windows t
6399 "Set and non-nil means `display-buffer' should make a new window." 6399 "Non-nil means `display-buffer' should make a new window."
6400 :type 'boolean 6400 :type 'boolean
6401 :version "24.1"
6402 :group 'windows) 6401 :group 'windows)
6403;; (make-obsolete-variable 6402;; (make-obsolete-variable
6404 ;; 'pop-up-windows 6403 ;; 'pop-up-windows
@@ -6459,13 +6458,12 @@ is nil, `display-buffer' cannot split windows horizontally."
6459 ;; 'split-width-threshold 6458 ;; 'split-width-threshold
6460 ;; "use 2nd arg of `display-buffer' instead." "24.1") 6459 ;; "use 2nd arg of `display-buffer' instead." "24.1")
6461 6460
6462(defcustom even-window-heights 'unset ; t 6461(defcustom even-window-heights t
6463 "If set and non-nil `display-buffer' will try to even window heights. 6462 "If non-nil `display-buffer' will try to even window heights.
6464Otherwise `display-buffer' will leave the window configuration 6463Otherwise `display-buffer' will leave the window configuration
6465alone. Heights are evened only when `display-buffer' reuses a 6464alone. Heights are evened only when `display-buffer' chooses a
6466window that appears above or below the selected window." 6465window that appears above or below the selected window."
6467 :type 'boolean 6466 :type 'boolean
6468 :version "24.1"
6469 :group 'windows) 6467 :group 'windows)
6470;; (make-obsolete-variable 6468;; (make-obsolete-variable
6471 ;; 'even-window-heights 6469 ;; 'even-window-heights
@@ -6635,7 +6633,7 @@ value of `display-buffer-alist'."
6635 1.0))) 6633 1.0)))
6636 (list 6634 (list
6637 'pop-up-window 6635 'pop-up-window
6638 (when pop-up-windows ; unset qualifies as t 6636 (when pop-up-windows
6639 (list 6637 (list
6640 'pop-up-window 6638 'pop-up-window
6641 (cons 'largest fun) 6639 (cons 'largest fun)
@@ -6789,7 +6787,7 @@ value of `display-buffer-alist'."
6789 ;; "0" (all visible and iconified frames) is hardcoded in 6787 ;; "0" (all visible and iconified frames) is hardcoded in
6790 ;; Emacs 23. 6788 ;; Emacs 23.
6791 0)) 6789 0))
6792 (unless (memq even-window-heights '(nil unset)) 6790 (when even-window-heights
6793 (cons 'reuse-window-even-sizes t))) 6791 (cons 'reuse-window-even-sizes t)))
6794 no-custom) 6792 no-custom)
6795 6793
@@ -6798,7 +6796,7 @@ value of `display-buffer-alist'."
6798 (display-buffer-alist-add 6796 (display-buffer-alist-add
6799 nil 6797 nil
6800 (list 6798 (list
6801 (cons 'dedicated display-buffer-mark-dedicated)) 6799 (cons 'dedicate display-buffer-mark-dedicated))
6802 no-custom))) 6800 no-custom)))
6803 6801
6804 display-buffer-alist) 6802 display-buffer-alist)
diff --git a/m4/pthread_sigmask.m4 b/m4/pthread_sigmask.m4
index dfa0f660a75..e98d8e0f4ea 100644
--- a/m4/pthread_sigmask.m4
+++ b/m4/pthread_sigmask.m4
@@ -1,4 +1,4 @@
1# pthread_sigmask.m4 serial 7 1# pthread_sigmask.m4 serial 7-emacs1
2dnl Copyright (C) 2011 Free Software Foundation, Inc. 2dnl Copyright (C) 2011 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -8,55 +8,6 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
8[ 8[
9 AC_CHECK_FUNCS_ONCE([pthread_sigmask]) 9 AC_CHECK_FUNCS_ONCE([pthread_sigmask])
10 LIB_PTHREAD_SIGMASK= 10 LIB_PTHREAD_SIGMASK=
11 m4_ifdef([gl_THREADLIB], [
12 AC_REQUIRE([gl_THREADLIB])
13 if test "$gl_threads_api" = posix; then
14 if test $ac_cv_func_pthread_sigmask = yes; then
15 dnl pthread_sigmask is available without -lpthread.
16 :
17 else
18 if test -n "$LIBMULTITHREAD"; then
19 AC_CACHE_CHECK([for pthread_sigmask in $LIBMULTITHREAD],
20 [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD],
21 [gl_save_LIBS="$LIBS"
22 LIBS="$LIBS $LIBMULTITHREAD"
23 AC_LINK_IFELSE(
24 [AC_LANG_PROGRAM(
25 [[#include <pthread.h>
26 #include <signal.h>
27 ]],
28 [[return pthread_sigmask (0, (sigset_t *) 0, (sigset_t *) 0);]])
29 ],
30 [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=yes],
31 [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no])
32 LIBS="$gl_save_LIBS"
33 ])
34 if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then
35 dnl pthread_sigmask is available with -lpthread.
36 LIB_PTHREAD_SIGMASK="$LIBMULTITHREAD"
37 else
38 dnl pthread_sigmask is not available at all.
39 HAVE_PTHREAD_SIGMASK=0
40 fi
41 else
42 dnl pthread_sigmask is not available at all.
43 HAVE_PTHREAD_SIGMASK=0
44 fi
45 fi
46 else
47 dnl pthread_sigmask may exist but does not interoperate with the chosen
48 dnl multithreading facility.
49 dnl If "$gl_threads_api" = pth, we could use the function pth_sigmask,
50 dnl but it is equivalent to sigprocmask, so we choose to emulate
51 dnl pthread_sigmask with sigprocmask also in this case. This yields fewer
52 dnl link dependencies.
53 if test $ac_cv_func_pthread_sigmask = yes; then
54 REPLACE_PTHREAD_SIGMASK=1
55 else
56 HAVE_PTHREAD_SIGMASK=0
57 fi
58 fi
59 ] ,[
60 dnl gl_THREADLIB is not in use. Assume the application wants 11 dnl gl_THREADLIB is not in use. Assume the application wants
61 dnl POSIX semantics. 12 dnl POSIX semantics.
62 if test $ac_cv_func_pthread_sigmask != yes; then 13 if test $ac_cv_func_pthread_sigmask != yes; then
@@ -69,7 +20,6 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
69 LIB_PTHREAD_SIGMASK=$ac_cv_search_pthread_sigmask 20 LIB_PTHREAD_SIGMASK=$ac_cv_search_pthread_sigmask
70 fi 21 fi
71 fi 22 fi
72 ])
73 AC_SUBST([LIB_PTHREAD_SIGMASK]) 23 AC_SUBST([LIB_PTHREAD_SIGMASK])
74 dnl We don't need a variable LTLIB_PTHREAD_SIGMASK, because when 24 dnl We don't need a variable LTLIB_PTHREAD_SIGMASK, because when
75 dnl "$gl_threads_api" = posix, $LTLIBMULTITHREAD and $LIBMULTITHREAD are the 25 dnl "$gl_threads_api" = posix, $LTLIBMULTITHREAD and $LIBMULTITHREAD are the
diff --git a/src/ChangeLog b/src/ChangeLog
index e4f3401eb4d..4e69399154d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,4 +1,4 @@
12011-07-09 Paul Eggert <eggert@cs.ucla.edu> 12011-07-11 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * image.c: Integer signedness and overflow and related fixes. 3 * image.c: Integer signedness and overflow and related fixes.
4 This is not an exhaustive set of fixes, but it's time to 4 This is not an exhaustive set of fixes, but it's time to
@@ -151,6 +151,72 @@
151 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally 151 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
152 well either way, and we prefer signed to unsigned. 152 well either way, and we prefer signed to unsigned.
153 153
1542011-07-10 Johan Bockgård <bojohan@gnu.org>
155
156 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
157
1582011-07-10 Jan Djärv <jan.h.d@swipnet.se>
159
160 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
161 for non-popups (Bug#3642).
162
1632011-07-10 Andreas Schwab <schwab@linux-m68k.org>
164
165 * alloc.c (reset_malloc_hooks): Protoize.
166 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
167 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
168 * cm.c (losecursor): Likewise.
169 * data.c (fmod): Likewise.
170 * dispnew.c (swap_glyphs_in_rows): Likewise.
171 * emacs.c (memory_warning_signal): Likewise.
172 * floatfns.c (float_error): Likewise.
173 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
174 (otf_open, font_otf_capability, generate_otf_features)
175 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
176 Likewise.
177 * image.c (pbm_read_file): Likewise.
178 * indent.c (string_display_width): Likewise.
179 * intervals.c (check_for_interval, search_for_interval)
180 (inc_interval_count, count_intervals, root_interval)
181 (adjust_intervals_for_insertion, make_new_interval): Likewise.
182 * lread.c (defalias): Likewise.
183 * ralloc.c (r_alloc_check): Likewise.
184 * regex.c (set_image_of_range_1, set_image_of_range)
185 (regex_grow_registers): Likewise.
186 * sysdep.c (strerror): Likewise.
187 * termcap.c (valid_filename_p, tprint, main): Likewise.
188 * tparam.c (main): Likewise.
189 * unexhp9k800.c (run_time_remap, save_data_space)
190 (update_file_ptrs, read_header, write_header, calculate_checksum)
191 (copy_file, copy_rest, display_header): Likewise.
192 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
193 Likewise.
194 * xdisp.c (check_it): Likewise.
195 * xfaces.c (register_color, unregister_color, unregister_colors):
196 Likewise.
197 * xfns.c (print_fontset_result): Likewise.
198 * xrdb.c (member, fatal, main): Likewise.
199
2002011-07-10 Paul Eggert <eggert@cs.ucla.edu>
201
202 Fix minor problems found by static checking (Bug#9031).
203 * chartab.c (char_table_set_range, map_sub_char_table):
204 Remove unused locals.
205 (uniprop_table): Now static.
206 * composite.c (_work_char): Remove unused static var.
207
2082011-07-09 Juanma Barranquero <lekktu@gmail.com>
209
210 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
211
2122011-07-09 Jan Djärv <jan.h.d@swipnet.se>
213
214 * gtkutil.c (qttip_cb): Remove code without function.
215
2162011-07-09 Eli Zaretskii <eliz@gnu.org>
217
218 * w32.c (pthread_sigmask): New stub.
219
1542011-07-08 Paul Eggert <eggert@cs.ucla.edu> 2202011-07-08 Paul Eggert <eggert@cs.ucla.edu>
155 221
156 Use pthread_sigmask, not sigprocmask (Bug#9010). 222 Use pthread_sigmask, not sigprocmask (Bug#9010).
diff --git a/src/alloc.c b/src/alloc.c
index 5cdd5af9ecf..f325b6ed449 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1277,7 +1277,7 @@ emacs_blocked_realloc (void *ptr, size_t size, const void *ptr2)
1277 calls malloc because it is the first call, and we have an endless loop. */ 1277 calls malloc because it is the first call, and we have an endless loop. */
1278 1278
1279void 1279void
1280reset_malloc_hooks () 1280reset_malloc_hooks (void)
1281{ 1281{
1282 __free_hook = old_free_hook; 1282 __free_hook = old_free_hook;
1283 __malloc_hook = old_malloc_hook; 1283 __malloc_hook = old_malloc_hook;
diff --git a/src/buffer.c b/src/buffer.c
index 48dde18b02c..05e96e85112 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4466,24 +4466,40 @@ static int mmap_initialized_p;
4466#define MMAP_ALLOCATED_P(start, end) 1 4466#define MMAP_ALLOCATED_P(start, end) 1
4467#endif 4467#endif
4468 4468
4469/* Function prototypes. */ 4469/* Perform necessary intializations for the use of mmap. */
4470 4470
4471static int mmap_free_1 (struct mmap_region *); 4471static void
4472static int mmap_enlarge (struct mmap_region *, int); 4472mmap_init (void)
4473static struct mmap_region *mmap_find (POINTER_TYPE *, POINTER_TYPE *); 4473{
4474static POINTER_TYPE *mmap_alloc (POINTER_TYPE **, size_t); 4474#if MAP_ANON == 0
4475static POINTER_TYPE *mmap_realloc (POINTER_TYPE **, size_t); 4475 /* The value of mmap_fd is initially 0 in temacs, and -1
4476static void mmap_free (POINTER_TYPE **ptr); 4476 in a dumped Emacs. */
4477static void mmap_init (void); 4477 if (mmap_fd <= 0)
4478 {
4479 /* No anonymous mmap -- we need the file descriptor. */
4480 mmap_fd = open ("/dev/zero", O_RDONLY);
4481 if (mmap_fd == -1)
4482 fatal ("Cannot open /dev/zero: %s", emacs_strerror (errno));
4483 }
4484#endif /* MAP_ANON == 0 */
4485
4486 if (mmap_initialized_p)
4487 return;
4488 mmap_initialized_p = 1;
4478 4489
4490#if MAP_ANON != 0
4491 mmap_fd = -1;
4492#endif
4493
4494 mmap_page_size = getpagesize ();
4495}
4479 4496
4480/* Return a region overlapping address range START...END, or null if 4497/* Return a region overlapping address range START...END, or null if
4481 none. END is not including, i.e. the last byte in the range 4498 none. END is not including, i.e. the last byte in the range
4482 is at END - 1. */ 4499 is at END - 1. */
4483 4500
4484static struct mmap_region * 4501static struct mmap_region *
4485mmap_find (start, end) 4502mmap_find (POINTER_TYPE *start, POINTER_TYPE *end);
4486 POINTER_TYPE *start, *end;
4487{ 4503{
4488 struct mmap_region *r; 4504 struct mmap_region *r;
4489 char *s = (char *) start, *e = (char *) end; 4505 char *s = (char *) start, *e = (char *) end;
@@ -4512,8 +4528,7 @@ mmap_find (start, end)
4512 the region. Value is non-zero if successful. */ 4528 the region. Value is non-zero if successful. */
4513 4529
4514static int 4530static int
4515mmap_free_1 (r) 4531mmap_free_1 (struct mmap_region *r)
4516 struct mmap_region *r;
4517{ 4532{
4518 if (r->next) 4533 if (r->next)
4519 r->next->prev = r->prev; 4534 r->next->prev = r->prev;
@@ -4536,9 +4551,7 @@ mmap_free_1 (r)
4536 Value is non-zero if successful. */ 4551 Value is non-zero if successful. */
4537 4552
4538static int 4553static int
4539mmap_enlarge (r, npages) 4554mmap_enlarge (struct mmap_region *r, int npages)
4540 struct mmap_region *r;
4541 int npages;
4542{ 4555{
4543 char *region_end = (char *) r + r->nbytes_mapped; 4556 char *region_end = (char *) r + r->nbytes_mapped;
4544 size_t nbytes; 4557 size_t nbytes;
@@ -4602,8 +4615,7 @@ mmap_enlarge (r, npages)
4602 when Emacs starts. */ 4615 when Emacs starts. */
4603 4616
4604void 4617void
4605mmap_set_vars (restore_p) 4618mmap_set_vars (int restore_p)
4606 int restore_p;
4607{ 4619{
4608 struct mmap_region *r; 4620 struct mmap_region *r;
4609 4621
@@ -4636,9 +4648,7 @@ mmap_set_vars (restore_p)
4636 return null. */ 4648 return null. */
4637 4649
4638static POINTER_TYPE * 4650static POINTER_TYPE *
4639mmap_alloc (var, nbytes) 4651mmap_alloc (POINTER_TYPE **var, size_t nbytes)
4640 POINTER_TYPE **var;
4641 size_t nbytes;
4642{ 4652{
4643 void *p; 4653 void *p;
4644 size_t map; 4654 size_t map;
@@ -4675,15 +4685,29 @@ mmap_alloc (var, nbytes)
4675} 4685}
4676 4686
4677 4687
4688/* Free a block of relocatable storage whose data is pointed to by
4689 PTR. Store 0 in *PTR to show there's no block allocated. */
4690
4691static void
4692mmap_free (POINTER_TYPE **var)
4693{
4694 mmap_init ();
4695
4696 if (*var)
4697 {
4698 mmap_free_1 (MMAP_REGION (*var));
4699 *var = NULL;
4700 }
4701}
4702
4703
4678/* Given a pointer at address VAR to data allocated with mmap_alloc, 4704/* Given a pointer at address VAR to data allocated with mmap_alloc,
4679 resize it to size NBYTES. Change *VAR to reflect the new block, 4705 resize it to size NBYTES. Change *VAR to reflect the new block,
4680 and return this value. If more memory cannot be allocated, then 4706 and return this value. If more memory cannot be allocated, then
4681 leave *VAR unchanged, and return null. */ 4707 leave *VAR unchanged, and return null. */
4682 4708
4683static POINTER_TYPE * 4709static POINTER_TYPE *
4684mmap_realloc (var, nbytes) 4710mmap_realloc (POINTER_TYPE **var, size_t nbytes)
4685 POINTER_TYPE **var;
4686 size_t nbytes;
4687{ 4711{
4688 POINTER_TYPE *result; 4712 POINTER_TYPE *result;
4689 4713
@@ -4753,51 +4777,6 @@ mmap_realloc (var, nbytes)
4753} 4777}
4754 4778
4755 4779
4756/* Free a block of relocatable storage whose data is pointed to by
4757 PTR. Store 0 in *PTR to show there's no block allocated. */
4758
4759static void
4760mmap_free (var)
4761 POINTER_TYPE **var;
4762{
4763 mmap_init ();
4764
4765 if (*var)
4766 {
4767 mmap_free_1 (MMAP_REGION (*var));
4768 *var = NULL;
4769 }
4770}
4771
4772
4773/* Perform necessary intializations for the use of mmap. */
4774
4775static void
4776mmap_init ()
4777{
4778#if MAP_ANON == 0
4779 /* The value of mmap_fd is initially 0 in temacs, and -1
4780 in a dumped Emacs. */
4781 if (mmap_fd <= 0)
4782 {
4783 /* No anonymous mmap -- we need the file descriptor. */
4784 mmap_fd = open ("/dev/zero", O_RDONLY);
4785 if (mmap_fd == -1)
4786 fatal ("Cannot open /dev/zero: %s", emacs_strerror (errno));
4787 }
4788#endif /* MAP_ANON == 0 */
4789
4790 if (mmap_initialized_p)
4791 return;
4792 mmap_initialized_p = 1;
4793
4794#if MAP_ANON != 0
4795 mmap_fd = -1;
4796#endif
4797
4798 mmap_page_size = getpagesize ();
4799}
4800
4801#endif /* USE_MMAP_FOR_BUFFERS */ 4780#endif /* USE_MMAP_FOR_BUFFERS */
4802 4781
4803 4782
diff --git a/src/chartab.c b/src/chartab.c
index e900a3ae71f..efe23eca83f 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -485,7 +485,6 @@ Lisp_Object
485char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val) 485char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val)
486{ 486{
487 struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); 487 struct Lisp_Char_Table *tbl = XCHAR_TABLE (table);
488 Lisp_Object *contents = tbl->contents;
489 488
490 if (from == to) 489 if (from == to)
491 char_table_set (table, from, val); 490 char_table_set (table, from, val);
@@ -759,8 +758,6 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object),
759 Lisp_Object function, Lisp_Object table, Lisp_Object arg, Lisp_Object val, 758 Lisp_Object function, Lisp_Object table, Lisp_Object arg, Lisp_Object val,
760 Lisp_Object range, Lisp_Object top) 759 Lisp_Object range, Lisp_Object top)
761{ 760{
762 /* Pointer to the elements of TABLE. */
763 Lisp_Object *contents;
764 /* Depth of TABLE. */ 761 /* Depth of TABLE. */
765 int depth; 762 int depth;
766 /* Minimum and maxinum characters covered by TABLE. */ 763 /* Minimum and maxinum characters covered by TABLE. */
@@ -777,14 +774,12 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object),
777 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); 774 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
778 775
779 depth = XINT (tbl->depth); 776 depth = XINT (tbl->depth);
780 contents = tbl->contents;
781 min_char = XINT (tbl->min_char); 777 min_char = XINT (tbl->min_char);
782 max_char = min_char + chartab_chars[depth - 1] - 1; 778 max_char = min_char + chartab_chars[depth - 1] - 1;
783 } 779 }
784 else 780 else
785 { 781 {
786 depth = 0; 782 depth = 0;
787 contents = XCHAR_TABLE (table)->contents;
788 min_char = 0; 783 min_char = 0;
789 max_char = MAX_CHAR; 784 max_char = MAX_CHAR;
790 } 785 }
@@ -1143,7 +1138,6 @@ uniprop_table_uncompress (Lisp_Object table, int idx)
1143 Lisp_Object sub = make_sub_char_table (3, min_char, Qnil); 1138 Lisp_Object sub = make_sub_char_table (3, min_char, Qnil);
1144 struct Lisp_Sub_Char_Table *subtbl = XSUB_CHAR_TABLE (sub); 1139 struct Lisp_Sub_Char_Table *subtbl = XSUB_CHAR_TABLE (sub);
1145 const unsigned char *p, *pend; 1140 const unsigned char *p, *pend;
1146 int i;
1147 1141
1148 XSUB_CHAR_TABLE (table)->contents[idx] = sub; 1142 XSUB_CHAR_TABLE (table)->contents[idx] = sub;
1149 p = SDATA (val), pend = p + SBYTES (val); 1143 p = SDATA (val), pend = p + SBYTES (val);
@@ -1316,7 +1310,7 @@ uniprop_get_encoder (Lisp_Object table)
1316 function may load a Lisp file and thus may cause 1310 function may load a Lisp file and thus may cause
1317 garbage-collection. */ 1311 garbage-collection. */
1318 1312
1319Lisp_Object 1313static Lisp_Object
1320uniprop_table (Lisp_Object prop) 1314uniprop_table (Lisp_Object prop)
1321{ 1315{
1322 Lisp_Object val, table, result; 1316 Lisp_Object val, table, result;
diff --git a/src/cm.c b/src/cm.c
index 42f855f1694..609632eba11 100644
--- a/src/cm.c
+++ b/src/cm.c
@@ -305,7 +305,8 @@ done:
305} 305}
306 306
307#if 0 307#if 0
308losecursor () 308void
309losecursor (void)
309{ 310{
310 curY = -1; 311 curY = -1;
311} 312}
diff --git a/src/composite.c b/src/composite.c
index cf1e053f027..d402d5ad0c4 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -967,7 +967,6 @@ autocmp_chars (Lisp_Object rule, EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT
967} 967}
968 968
969static Lisp_Object _work_val; 969static Lisp_Object _work_val;
970static int _work_char;
971 970
972/* 1 iff the character C is composable. Characters of general 971/* 1 iff the character C is composable. Characters of general
973 category Z? or C? are not composable except for ZWNJ and ZWJ. */ 972 category Z? or C? are not composable except for ZWNJ and ZWJ. */
diff --git a/src/data.c b/src/data.c
index eb3f870b97c..76a54547a5d 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2733,8 +2733,7 @@ Both must be integers or markers. */)
2733 2733
2734#ifndef HAVE_FMOD 2734#ifndef HAVE_FMOD
2735double 2735double
2736fmod (f1, f2) 2736fmod (double f1, double f2)
2737 double f1, f2;
2738{ 2737{
2739 double r = f1; 2738 double r = f1;
2740 2739
diff --git a/src/dispnew.c b/src/dispnew.c
index c95404b5c52..15d80367701 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -1029,8 +1029,7 @@ increment_row_positions (struct glyph_row *row,
1029 B without changing glyph pointers in A and B. */ 1029 B without changing glyph pointers in A and B. */
1030 1030
1031static void 1031static void
1032swap_glyphs_in_rows (a, b) 1032swap_glyphs_in_rows (struct glyph_row *a, struct glyph_row *b)
1033 struct glyph_row *a, *b;
1034{ 1033{
1035 int area; 1034 int area;
1036 1035
diff --git a/src/emacs.c b/src/emacs.c
index a055d89d35f..39870ec0079 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -356,8 +356,7 @@ fatal_error_signal (int sig)
356 356
357/* Handler for SIGDANGER. */ 357/* Handler for SIGDANGER. */
358void 358void
359memory_warning_signal (sig) 359memory_warning_signal (int sig)
360 int sig;
361{ 360{
362 signal (sig, memory_warning_signal); 361 signal (sig, memory_warning_signal);
363 SIGNAL_THREAD_CHECK (sig); 362 SIGNAL_THREAD_CHECK (sig);
diff --git a/src/floatfns.c b/src/floatfns.c
index 850eb9f1bcc..89aa052e8b1 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -958,8 +958,7 @@ Rounds the value toward zero. */)
958 958
959#ifdef FLOAT_CATCH_SIGILL 959#ifdef FLOAT_CATCH_SIGILL
960static void 960static void
961float_error (signo) 961float_error (int signo)
962 int signo;
963{ 962{
964 if (! in_float) 963 if (! in_float)
965 fatal_error_signal (signo); 964 fatal_error_signal (signo);
diff --git a/src/font.c b/src/font.c
index 5aff20b1346..5f8d22157d6 100644
--- a/src/font.c
+++ b/src/font.c
@@ -1738,8 +1738,7 @@ font_parse_family_registry (Lisp_Object family, Lisp_Object registry, Lisp_Objec
1738#define LGSTRING_GLYPH_SIZE 8 1738#define LGSTRING_GLYPH_SIZE 8
1739 1739
1740static int 1740static int
1741check_gstring (gstring) 1741check_gstring (Lisp_Object gstring)
1742 Lisp_Object gstring;
1743{ 1742{
1744 Lisp_Object val; 1743 Lisp_Object val;
1745 int i, j; 1744 int i, j;
@@ -1793,8 +1792,7 @@ check_gstring (gstring)
1793} 1792}
1794 1793
1795static void 1794static void
1796check_otf_features (otf_features) 1795check_otf_features (Lisp_Object otf_features)
1797 Lisp_Object otf_features;
1798{ 1796{
1799 Lisp_Object val; 1797 Lisp_Object val;
1800 1798
@@ -1827,8 +1825,7 @@ check_otf_features (otf_features)
1827Lisp_Object otf_list; 1825Lisp_Object otf_list;
1828 1826
1829static Lisp_Object 1827static Lisp_Object
1830otf_tag_symbol (tag) 1828otf_tag_symbol (OTF_Tag tag)
1831 OTF_Tag tag;
1832{ 1829{
1833 char name[5]; 1830 char name[5];
1834 1831
@@ -1837,8 +1834,7 @@ otf_tag_symbol (tag)
1837} 1834}
1838 1835
1839static OTF * 1836static OTF *
1840otf_open (file) 1837otf_open (Lisp_Object file)
1841 Lisp_Object file;
1842{ 1838{
1843 Lisp_Object val = Fassoc (file, otf_list); 1839 Lisp_Object val = Fassoc (file, otf_list);
1844 OTF *otf; 1840 OTF *otf;
@@ -1860,8 +1856,7 @@ otf_open (file)
1860 (struct font_driver).otf_capability. */ 1856 (struct font_driver).otf_capability. */
1861 1857
1862Lisp_Object 1858Lisp_Object
1863font_otf_capability (font) 1859font_otf_capability (struct font *font)
1864 struct font *font;
1865{ 1860{
1866 OTF *otf; 1861 OTF *otf;
1867 Lisp_Object capability = Fcons (Qnil, Qnil); 1862 Lisp_Object capability = Fcons (Qnil, Qnil);
@@ -1935,9 +1930,7 @@ font_otf_capability (font)
1935 FEATURES. */ 1930 FEATURES. */
1936 1931
1937static void 1932static void
1938generate_otf_features (spec, features) 1933generate_otf_features (Lisp_Object spec, char *features)
1939 Lisp_Object spec;
1940 char *features;
1941{ 1934{
1942 Lisp_Object val; 1935 Lisp_Object val;
1943 char *p; 1936 char *p;
@@ -1972,8 +1965,7 @@ generate_otf_features (spec, features)
1972} 1965}
1973 1966
1974Lisp_Object 1967Lisp_Object
1975font_otf_DeviceTable (device_table) 1968font_otf_DeviceTable (OTF_DeviceTable *device_table)
1976 OTF_DeviceTable *device_table;
1977{ 1969{
1978 int len = device_table->StartSize - device_table->EndSize + 1; 1970 int len = device_table->StartSize - device_table->EndSize + 1;
1979 1971
@@ -1982,9 +1974,7 @@ font_otf_DeviceTable (device_table)
1982} 1974}
1983 1975
1984Lisp_Object 1976Lisp_Object
1985font_otf_ValueRecord (value_format, value_record) 1977font_otf_ValueRecord (int value_format, OTF_ValueRecord *value_record)
1986 int value_format;
1987 OTF_ValueRecord *value_record;
1988{ 1978{
1989 Lisp_Object val = Fmake_vector (make_number (8), Qnil); 1979 Lisp_Object val = Fmake_vector (make_number (8), Qnil);
1990 1980
@@ -2008,8 +1998,7 @@ font_otf_ValueRecord (value_format, value_record)
2008} 1998}
2009 1999
2010Lisp_Object 2000Lisp_Object
2011font_otf_Anchor (anchor) 2001font_otf_Anchor (OTF_Anchor *anchor)
2012 OTF_Anchor *anchor;
2013{ 2002{
2014 Lisp_Object val; 2003 Lisp_Object val;
2015 2004
diff --git a/src/gtkutil.c b/src/gtkutil.c
index dfc5b63f375..35b366222de 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -647,7 +647,6 @@ qttip_cb (GtkWidget *widget,
647 /* Change stupid Gtk+ default line wrapping. */ 647 /* Change stupid Gtk+ default line wrapping. */
648 p = gtk_widget_get_parent (x->ttip_lbl); 648 p = gtk_widget_get_parent (x->ttip_lbl);
649 list = gtk_container_get_children (GTK_CONTAINER (p)); 649 list = gtk_container_get_children (GTK_CONTAINER (p));
650 iter;
651 for (iter = list; iter; iter = g_list_next (iter)) 650 for (iter = list; iter; iter = g_list_next (iter))
652 { 651 {
653 GtkWidget *w = GTK_WIDGET (iter->data); 652 GtkWidget *w = GTK_WIDGET (iter->data);
diff --git a/src/image.c b/src/image.c
index a09fc7a8979..f6626f61c83 100644
--- a/src/image.c
+++ b/src/image.c
@@ -5002,9 +5002,7 @@ pbm_scan_number (unsigned char **s, unsigned char *end)
5002 occurred. *SIZE is set to the size of the file. */ 5002 occurred. *SIZE is set to the size of the file. */
5003 5003
5004static char * 5004static char *
5005pbm_read_file (file, size) 5005pbm_read_file (Lisp_Object file, int *size)
5006 Lisp_Object file;
5007 int *size;
5008{ 5006{
5009 FILE *fp = NULL; 5007 FILE *fp = NULL;
5010 char *buf = NULL; 5008 char *buf = NULL;
diff --git a/src/indent.c b/src/indent.c
index 02d99d14ded..5c5966175aa 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -725,8 +725,7 @@ current_column_1 (void)
725 If END is nil, that stands for the end of STRING. */ 725 If END is nil, that stands for the end of STRING. */
726 726
727static double 727static double
728string_display_width (string, beg, end) 728string_display_width (Lisp_Object string, Lisp_Object beg, Lisp_Object end)
729 Lisp_Object string, beg, end;
730{ 729{
731 register int col; 730 register int col;
732 register unsigned char *ptr, *stop; 731 register unsigned char *ptr, *stop;
diff --git a/src/intervals.c b/src/intervals.c
index 4de001f2ffc..2063655cdb9 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -247,8 +247,7 @@ static int zero_length;
247INTERVAL search_interval, found_interval; 247INTERVAL search_interval, found_interval;
248 248
249void 249void
250check_for_interval (i) 250check_for_interval (INTERVAL i)
251 register INTERVAL i;
252{ 251{
253 if (i == search_interval) 252 if (i == search_interval)
254 { 253 {
@@ -258,8 +257,7 @@ check_for_interval (i)
258} 257}
259 258
260INTERVAL 259INTERVAL
261search_for_interval (i, tree) 260search_for_interval (INTERVAL i, INTERVAL tree)
262 register INTERVAL i, tree;
263{ 261{
264 icount = 0; 262 icount = 0;
265 search_interval = i; 263 search_interval = i;
@@ -269,8 +267,7 @@ search_for_interval (i, tree)
269} 267}
270 268
271static void 269static void
272inc_interval_count (i) 270inc_interval_count (INTERVAL i)
273 INTERVAL i;
274{ 271{
275 icount++; 272 icount++;
276 if (LENGTH (i) == 0) 273 if (LENGTH (i) == 0)
@@ -280,8 +277,7 @@ inc_interval_count (i)
280} 277}
281 278
282int 279int
283count_intervals (i) 280count_intervals (INTERVAL i)
284 register INTERVAL i;
285{ 281{
286 icount = 0; 282 icount = 0;
287 idepth = 0; 283 idepth = 0;
@@ -292,8 +288,7 @@ count_intervals (i)
292} 288}
293 289
294static INTERVAL 290static INTERVAL
295root_interval (interval) 291root_interval (INTERVAL interval)
296 INTERVAL interval;
297{ 292{
298 register INTERVAL i = interval; 293 register INTERVAL i = interval;
299 294
@@ -804,9 +799,8 @@ update_interval (register INTERVAL i, EMACS_INT pos)
804 to the root. */ 799 to the root. */
805 800
806static INTERVAL 801static INTERVAL
807adjust_intervals_for_insertion (tree, position, length) 802adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position,
808 INTERVAL tree; 803 EMACS_INT length)
809 EMACS_INT position, length;
810{ 804{
811 register EMACS_INT relative_position; 805 register EMACS_INT relative_position;
812 register INTERVAL this; 806 register INTERVAL this;
@@ -1615,9 +1609,7 @@ reproduce_tree_obj (INTERVAL source, Lisp_Object parent)
1615 interval. */ 1609 interval. */
1616 1610
1617static INTERVAL 1611static INTERVAL
1618make_new_interval (intervals, start, length) 1612make_new_interval (INTERVAL intervals, EMACS_INT start, EMACS_INT length)
1619 INTERVAL intervals;
1620 EMACS_INT start, length;
1621{ 1613{
1622 INTERVAL slot; 1614 INTERVAL slot;
1623 1615
diff --git a/src/lread.c b/src/lread.c
index 6a97be2be42..bef1cc8e591 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3981,9 +3981,7 @@ defsubr (struct Lisp_Subr *sname)
3981 3981
3982#ifdef NOTDEF /* use fset in subr.el now */ 3982#ifdef NOTDEF /* use fset in subr.el now */
3983void 3983void
3984defalias (sname, string) 3984defalias (struct Lisp_Subr *sname, char *string)
3985 struct Lisp_Subr *sname;
3986 char *string;
3987{ 3985{
3988 Lisp_Object sym; 3986 Lisp_Object sym;
3989 sym = intern (string); 3987 sym = intern (string);
diff --git a/src/ralloc.c b/src/ralloc.c
index 9c601a0ac24..64a47416202 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -1079,7 +1079,7 @@ r_alloc_reinit (void)
1079#include <assert.h> 1079#include <assert.h>
1080 1080
1081void 1081void
1082r_alloc_check () 1082r_alloc_check (void)
1083{ 1083{
1084 int found = 0; 1084 int found = 0;
1085 heap_ptr h, ph = 0; 1085 heap_ptr h, ph = 0;
diff --git a/src/regex.c b/src/regex.c
index d347d274819..190d1d0fe21 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -2169,10 +2169,9 @@ extend_range_table_work_area (struct range_table_work_area *work_area)
2169 Returns -1 if successful, REG_ESPACE if ran out of space. */ 2169 Returns -1 if successful, REG_ESPACE if ran out of space. */
2170 2170
2171static int 2171static int
2172set_image_of_range_1 (work_area, start, end, translate) 2172set_image_of_range_1 (struct range_table_work_area *work_area,
2173 RE_TRANSLATE_TYPE translate; 2173 re_wchar_t start, re_wchar_t end,
2174 struct range_table_work_area *work_area; 2174 RE_TRANSLATE_TYPE translate)
2175 re_wchar_t start, end;
2176{ 2175{
2177 /* `one_case' indicates a character, or a run of characters, 2176 /* `one_case' indicates a character, or a run of characters,
2178 each of which is an isolate (no case-equivalents). 2177 each of which is an isolate (no case-equivalents).
@@ -2322,10 +2321,9 @@ set_image_of_range_1 (work_area, start, end, translate)
2322 Returns -1 if successful, REG_ESPACE if ran out of space. */ 2321 Returns -1 if successful, REG_ESPACE if ran out of space. */
2323 2322
2324static int 2323static int
2325set_image_of_range (work_area, start, end, translate) 2324set_image_of_range (struct range_table_work_area *work_area,
2326 RE_TRANSLATE_TYPE translate; 2325 re_wchar_t start, re_wchar_t end,
2327 struct range_table_work_area *work_area; 2326 RE_TRANSLATE_TYPE translate)
2328 re_wchar_t start, end;
2329{ 2327{
2330 re_wchar_t cmin, cmax; 2328 re_wchar_t cmin, cmax;
2331 2329
@@ -2412,8 +2410,7 @@ static re_char **best_regstart, **best_regend;
2412 but don't make them smaller. */ 2410 but don't make them smaller. */
2413 2411
2414static 2412static
2415regex_grow_registers (num_regs) 2413regex_grow_registers (int num_regs)
2416 int num_regs;
2417{ 2414{
2418 if (num_regs > regs_allocated_size) 2415 if (num_regs > regs_allocated_size)
2419 { 2416 {
diff --git a/src/sysdep.c b/src/sysdep.c
index 077d4405593..4bd1f54b9e6 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1800,8 +1800,7 @@ get_random (void)
1800#ifndef HAVE_STRERROR 1800#ifndef HAVE_STRERROR
1801#ifndef WINDOWSNT 1801#ifndef WINDOWSNT
1802char * 1802char *
1803strerror (errnum) 1803strerror (int errnum)
1804 int errnum;
1805{ 1804{
1806 extern char *sys_errlist[]; 1805 extern char *sys_errlist[];
1807 extern int sys_nerr; 1806 extern int sys_nerr;
diff --git a/src/termcap.c b/src/termcap.c
index e191f6b3af3..96b9303d62d 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -338,8 +338,7 @@ static int name_match (char *line, char *name);
338 338
339#ifdef MSDOS /* MW, May 1993 */ 339#ifdef MSDOS /* MW, May 1993 */
340static int 340static int
341valid_filename_p (fn) 341valid_filename_p (char *fn)
342 char *fn;
343{ 342{
344 return *fn == '/' || fn[1] == ':'; 343 return *fn == '/' || fn[1] == ':';
345} 344}
@@ -669,9 +668,29 @@ gobble_line (int fd, register struct termcap_buffer *bufp, char *append_end)
669 668
670#include <stdio.h> 669#include <stdio.h>
671 670
672main (argc, argv) 671static void
673 int argc; 672tprint (char *cap)
674 char **argv; 673{
674 char *x = tgetstr (cap, 0);
675 register char *y;
676
677 printf ("%s: ", cap);
678 if (x)
679 {
680 for (y = x; *y; y++)
681 if (*y <= ' ' || *y == 0177)
682 printf ("\\%0o", *y);
683 else
684 putchar (*y);
685 free (x);
686 }
687 else
688 printf ("none");
689 putchar ('\n');
690}
691
692int
693main (int argc, char **argv)
675{ 694{
676 char *term; 695 char *term;
677 char *buf; 696 char *buf;
@@ -693,27 +712,8 @@ main (argc, argv)
693 712
694 printf ("co: %d\n", tgetnum ("co")); 713 printf ("co: %d\n", tgetnum ("co"));
695 printf ("am: %d\n", tgetflag ("am")); 714 printf ("am: %d\n", tgetflag ("am"));
696}
697
698tprint (cap)
699 char *cap;
700{
701 char *x = tgetstr (cap, 0);
702 register char *y;
703 715
704 printf ("%s: ", cap); 716 return 0;
705 if (x)
706 {
707 for (y = x; *y; y++)
708 if (*y <= ' ' || *y == 0177)
709 printf ("\\%0o", *y);
710 else
711 putchar (*y);
712 free (x);
713 }
714 else
715 printf ("none");
716 putchar ('\n');
717} 717}
718 718
719#endif /* TEST */ 719#endif /* TEST */
diff --git a/src/tparam.c b/src/tparam.c
index 6aae0b97db9..ed28cd7397f 100644
--- a/src/tparam.c
+++ b/src/tparam.c
@@ -265,9 +265,8 @@ tparam1 (const char *string, char *outstring, int len,
265 265
266#ifdef DEBUG 266#ifdef DEBUG
267 267
268main (argc, argv) 268int
269 int argc; 269main (int argc, char **argv)
270 char **argv;
271{ 270{
272 char buf[50]; 271 char buf[50];
273 int args[3]; 272 int args[3];
diff --git a/src/unexhp9k800.c b/src/unexhp9k800.c
index f27415a252c..ce65faffd4e 100644
--- a/src/unexhp9k800.c
+++ b/src/unexhp9k800.c
@@ -64,8 +64,7 @@ static long brk_on_dump = 0;
64 64
65/* Called from main, if we use shared libraries. */ 65/* Called from main, if we use shared libraries. */
66int 66int
67run_time_remap (ignored) 67run_time_remap (char *ignored)
68 char *ignored;
69{ 68{
70 brk ((char *) brk_on_dump); 69 brk ((char *) brk_on_dump);
71} 70}
@@ -74,74 +73,11 @@ run_time_remap (ignored)
74#define roundup(x,n) (((x) + ((n) - 1)) & ~((n) - 1)) /* n is power of 2 */ 73#define roundup(x,n) (((x) + ((n) - 1)) & ~((n) - 1)) /* n is power of 2 */
75#define min(x,y) (((x) < (y)) ? (x) : (y)) 74#define min(x,y) (((x) < (y)) ? (x) : (y))
76 75
77
78/* Create a new a.out file, same as old but with current data space */
79void
80unexec (const char *new_name, /* name of the new a.out file to be created */
81 const char *old_name) /* name of the old a.out file */
82{
83 int old, new;
84 int old_size, new_size;
85 struct header hdr;
86 struct som_exec_auxhdr auxhdr;
87 long i;
88
89 /* For the greatest flexibility, should create a temporary file in
90 the same directory as the new file. When everything is complete,
91 rename the temp file to the new name.
92 This way, a program could update its own a.out file even while
93 it is still executing. If problems occur, everything is still
94 intact. NOT implemented. */
95
96 /* Open the input and output a.out files */
97 old = open (old_name, O_RDONLY);
98 if (old < 0)
99 { perror (old_name); exit (1); }
100 new = open (new_name, O_CREAT|O_RDWR|O_TRUNC, 0777);
101 if (new < 0)
102 { perror (new_name); exit (1); }
103
104 /* Read the old headers */
105 read_header (old, &hdr, &auxhdr);
106
107 brk_on_dump = (long) sbrk (0);
108
109 /* Decide how large the new and old data areas are */
110 old_size = auxhdr.exec_dsize;
111 /* I suspect these two statements are separate
112 to avoid a compiler bug in hpux version 8. */
113 i = (long) sbrk (0);
114 new_size = i - auxhdr.exec_dmem;
115
116 /* Copy the old file to the new, up to the data space */
117 lseek (old, 0, 0);
118 copy_file (old, new, auxhdr.exec_dfile);
119
120 /* Skip the old data segment and write a new one */
121 lseek (old, old_size, 1);
122 save_data_space (new, &hdr, &auxhdr, new_size);
123
124 /* Copy the rest of the file */
125 copy_rest (old, new);
126
127 /* Update file pointers since we probably changed size of data area */
128 update_file_ptrs (new, &hdr, &auxhdr, auxhdr.exec_dfile, new_size-old_size);
129
130 /* Save the modified header */
131 write_header (new, &hdr, &auxhdr);
132
133 /* Close the binary file */
134 close (old);
135 close (new);
136}
137
138/* Save current data space in the file, update header. */ 76/* Save current data space in the file, update header. */
139 77
140save_data_space (file, hdr, auxhdr, size) 78static void
141 int file; 79save_data_space (int file, struct header *hdr, struct som_exec_auxhdr *auxhdr,
142 struct header *hdr; 80 int size)
143 struct som_exec_auxhdr *auxhdr;
144 int size;
145{ 81{
146 /* Write the entire data space out to the file */ 82 /* Write the entire data space out to the file */
147 if (write (file, auxhdr->exec_dmem, size) != size) 83 if (write (file, auxhdr->exec_dmem, size) != size)
@@ -154,12 +90,9 @@ save_data_space (file, hdr, auxhdr, size)
154 90
155/* Update the values of file pointers when something is inserted. */ 91/* Update the values of file pointers when something is inserted. */
156 92
157update_file_ptrs (file, hdr, auxhdr, location, offset) 93static void
158 int file; 94update_file_ptrs (int file, struct header *hdr, struct som_exec_auxhdr *auxhdr,
159 struct header *hdr; 95 unsigned int location, int offset)
160 struct som_exec_auxhdr *auxhdr;
161 unsigned int location;
162 int offset;
163{ 96{
164 struct subspace_dictionary_record subspace; 97 struct subspace_dictionary_record subspace;
165 int i; 98 int i;
@@ -205,10 +138,8 @@ update_file_ptrs (file, hdr, auxhdr, location, offset)
205 138
206/* Read in the header records from an a.out file. */ 139/* Read in the header records from an a.out file. */
207 140
208read_header (file, hdr, auxhdr) 141static void
209 int file; 142read_header (int file, struct header *hdr, struct som_exec_auxhdr *auxhdr)
210 struct header *hdr;
211 struct som_exec_auxhdr *auxhdr;
212{ 143{
213 144
214 /* Read the header in */ 145 /* Read the header in */
@@ -233,10 +164,8 @@ read_header (file, hdr, auxhdr)
233 164
234/* Write out the header records into an a.out file. */ 165/* Write out the header records into an a.out file. */
235 166
236write_header (file, hdr, auxhdr) 167static void
237 int file; 168write_header (int file, struct header *hdr, struct som_exec_auxhdr *auxhdr)
238 struct header *hdr;
239 struct som_exec_auxhdr *auxhdr;
240{ 169{
241 /* Update the checksum */ 170 /* Update the checksum */
242 hdr->checksum = calculate_checksum (hdr); 171 hdr->checksum = calculate_checksum (hdr);
@@ -252,8 +181,8 @@ write_header (file, hdr, auxhdr)
252 181
253/* Calculate the checksum of a SOM header record. */ 182/* Calculate the checksum of a SOM header record. */
254 183
255calculate_checksum (hdr) 184static int
256 struct header *hdr; 185calculate_checksum (struct header *hdr)
257{ 186{
258 int checksum, i, *ptr; 187 int checksum, i, *ptr;
259 188
@@ -267,9 +196,8 @@ calculate_checksum (hdr)
267 196
268/* Copy size bytes from the old file to the new one. */ 197/* Copy size bytes from the old file to the new one. */
269 198
270copy_file (old, new, size) 199static void
271 int new, old; 200copy_file (int old, int new, int size)
272 int size;
273{ 201{
274 int len; 202 int len;
275 int buffer[8192]; /* word aligned will be faster */ 203 int buffer[8192]; /* word aligned will be faster */
@@ -286,8 +214,8 @@ copy_file (old, new, size)
286 214
287/* Copy the rest of the file, up to EOF. */ 215/* Copy the rest of the file, up to EOF. */
288 216
289copy_rest (old, new) 217static void
290 int new, old; 218copy_rest (int old, int new)
291{ 219{
292 int buffer[4096]; 220 int buffer[4096];
293 int len; 221 int len;
@@ -301,9 +229,8 @@ copy_rest (old, new)
301} 229}
302 230
303#ifdef DEBUG 231#ifdef DEBUG
304display_header (hdr, auxhdr) 232static void
305 struct header *hdr; 233display_header (struct header *hdr, struct som_exec_auxhdr *auxhdr)
306 struct som_exec_auxhdr *auxhdr;
307{ 234{
308 /* Display the header information (debug) */ 235 /* Display the header information (debug) */
309 printf ("\n\nFILE HEADER\n"); 236 printf ("\n\nFILE HEADER\n");
@@ -320,3 +247,64 @@ display_header (hdr, auxhdr)
320 hdr->unloadable_sp_location, hdr->unloadable_sp_size); 247 hdr->unloadable_sp_location, hdr->unloadable_sp_size);
321} 248}
322#endif /* DEBUG */ 249#endif /* DEBUG */
250
251
252/* Create a new a.out file, same as old but with current data space */
253void
254unexec (const char *new_name, /* name of the new a.out file to be created */
255 const char *old_name) /* name of the old a.out file */
256{
257 int old, new;
258 int old_size, new_size;
259 struct header hdr;
260 struct som_exec_auxhdr auxhdr;
261 long i;
262
263 /* For the greatest flexibility, should create a temporary file in
264 the same directory as the new file. When everything is complete,
265 rename the temp file to the new name.
266 This way, a program could update its own a.out file even while
267 it is still executing. If problems occur, everything is still
268 intact. NOT implemented. */
269
270 /* Open the input and output a.out files */
271 old = open (old_name, O_RDONLY);
272 if (old < 0)
273 { perror (old_name); exit (1); }
274 new = open (new_name, O_CREAT|O_RDWR|O_TRUNC, 0777);
275 if (new < 0)
276 { perror (new_name); exit (1); }
277
278 /* Read the old headers */
279 read_header (old, &hdr, &auxhdr);
280
281 brk_on_dump = (long) sbrk (0);
282
283 /* Decide how large the new and old data areas are */
284 old_size = auxhdr.exec_dsize;
285 /* I suspect these two statements are separate
286 to avoid a compiler bug in hpux version 8. */
287 i = (long) sbrk (0);
288 new_size = i - auxhdr.exec_dmem;
289
290 /* Copy the old file to the new, up to the data space */
291 lseek (old, 0, 0);
292 copy_file (old, new, auxhdr.exec_dfile);
293
294 /* Skip the old data segment and write a new one */
295 lseek (old, old_size, 1);
296 save_data_space (new, &hdr, &auxhdr, new_size);
297
298 /* Copy the rest of the file */
299 copy_rest (old, new);
300
301 /* Update file pointers since we probably changed size of data area */
302 update_file_ptrs (new, &hdr, &auxhdr, auxhdr.exec_dfile, new_size-old_size);
303
304 /* Save the modified header */
305 write_header (new, &hdr, &auxhdr);
306
307 /* Close the binary file */
308 close (old);
309 close (new);
310}
diff --git a/src/w32.c b/src/w32.c
index 53bf2e811e2..de72e180c62 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -1452,6 +1452,14 @@ sigprocmask (int how, const sigset_t *set, sigset_t *oset)
1452} 1452}
1453 1453
1454int 1454int
1455pthread_sigmask (int how, const sigset_t *set, sigset_t *oset)
1456{
1457 if (sigprocmask (how, set, oset) == -1)
1458 return EINVAL;
1459 return 0;
1460}
1461
1462int
1455setpgrp (int pid, int gid) 1463setpgrp (int pid, int gid)
1456{ 1464{
1457 return 0; 1465 return 0;
diff --git a/src/widget.c b/src/widget.c
index 6d871ad7cb2..a09ec2631ad 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -224,8 +224,7 @@ get_wm_shell (Widget w)
224#if 0 /* Currently not used. */ 224#if 0 /* Currently not used. */
225 225
226static void 226static void
227mark_shell_size_user_specified (wmshell) 227mark_shell_size_user_specified (Widget wmshell)
228 Widget wmshell;
229{ 228{
230 if (! XtIsWMShell (wmshell)) abort (); 229 if (! XtIsWMShell (wmshell)) abort ();
231 /* This is kind of sleazy, but I can't see how else to tell it to make it 230 /* This is kind of sleazy, but I can't see how else to tell it to make it
@@ -510,8 +509,7 @@ update_wm_hints (EmacsFrame ew)
510#if 0 509#if 0
511 510
512static void 511static void
513create_frame_gcs (ew) 512create_frame_gcs (EmacsFrame ew)
514 EmacsFrame ew;
515{ 513{
516 struct frame *s = ew->emacs_frame.frame; 514 struct frame *s = ew->emacs_frame.frame;
517 515
diff --git a/src/xdisp.c b/src/xdisp.c
index dfaa9cdeac3..a4a9e236a9e 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2209,8 +2209,7 @@ safe_call2 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2)
2209 This is for debugging. It is too slow to do unconditionally. */ 2209 This is for debugging. It is too slow to do unconditionally. */
2210 2210
2211static void 2211static void
2212check_it (it) 2212check_it (struct it *it)
2213 struct it *it;
2214{ 2213{
2215 if (it->method == GET_FROM_STRING) 2214 if (it->method == GET_FROM_STRING)
2216 { 2215 {
@@ -10510,7 +10509,7 @@ DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed,
10510 f = XFRAME (frame); 10509 f = XFRAME (frame);
10511 10510
10512 if (WINDOWP (f->tool_bar_window) 10511 if (WINDOWP (f->tool_bar_window)
10513 || (w = XWINDOW (f->tool_bar_window), 10512 && (w = XWINDOW (f->tool_bar_window),
10514 WINDOW_TOTAL_LINES (w) > 0)) 10513 WINDOW_TOTAL_LINES (w) > 0))
10515 { 10514 {
10516 update_tool_bar (f, 1); 10515 update_tool_bar (f, 1);
diff --git a/src/xfaces.c b/src/xfaces.c
index 91f4b133466..c1e75ab3e59 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -536,8 +536,7 @@ int color_count[256];
536/* Register color PIXEL as allocated. */ 536/* Register color PIXEL as allocated. */
537 537
538void 538void
539register_color (pixel) 539register_color (unsigned long pixel)
540 unsigned long pixel;
541{ 540{
542 xassert (pixel < 256); 541 xassert (pixel < 256);
543 ++color_count[pixel]; 542 ++color_count[pixel];
@@ -547,8 +546,7 @@ register_color (pixel)
547/* Register color PIXEL as deallocated. */ 546/* Register color PIXEL as deallocated. */
548 547
549void 548void
550unregister_color (pixel) 549unregister_color (unsigned long pixel)
551 unsigned long pixel;
552{ 550{
553 xassert (pixel < 256); 551 xassert (pixel < 256);
554 if (color_count[pixel] > 0) 552 if (color_count[pixel] > 0)
@@ -561,9 +559,7 @@ unregister_color (pixel)
561/* Register N colors from PIXELS as deallocated. */ 559/* Register N colors from PIXELS as deallocated. */
562 560
563void 561void
564unregister_colors (pixels, n) 562unregister_colors (unsigned long *pixels, int n)
565 unsigned long *pixels;
566 int n;
567{ 563{
568 int i; 564 int i;
569 for (i = 0; i < n; ++i) 565 for (i = 0; i < n; ++i)
diff --git a/src/xfns.c b/src/xfns.c
index c70f4bb9a82..0d1e4a1bb5e 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -2001,11 +2001,8 @@ xic_create_fontsetname (const char *base_fontname, int motif)
2001 2001
2002#ifdef DEBUG_XIC_FONTSET 2002#ifdef DEBUG_XIC_FONTSET
2003static void 2003static void
2004print_fontset_result (xfs, name, missing_list, missing_count) 2004print_fontset_result (XFontSet xfs, char *name, char **missing_list,
2005 XFontSet xfs; 2005 int missing_count)
2006 char *name;
2007 char **missing_list;
2008 int missing_count;
2009{ 2006{
2010 if (xfs) 2007 if (xfs)
2011 fprintf (stderr, "XIC Fontset created: %s\n", name); 2008 fprintf (stderr, "XIC Fontset created: %s\n", name);
diff --git a/src/xmenu.c b/src/xmenu.c
index fc629b35104..b4338c1d653 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -740,10 +740,13 @@ menu_highlight_callback (GtkWidget *widget, gpointer call_data)
740 help = call_data ? cb_data->help : Qnil; 740 help = call_data ? cb_data->help : Qnil;
741 741
742 /* If popup_activated_flag is greater than 1 we are in a popup menu. 742 /* If popup_activated_flag is greater than 1 we are in a popup menu.
743 Don't show help for them, they won't appear before the 743 Don't pass the frame to show_help_event for those.
744 popup is popped down. */ 744 Passing frame creates an Emacs event. As we are looping in
745 if (popup_activated_flag <= 1) 745 popup_widget_loop, it won't be handeled. Passing NULL shows the tip
746 show_help_event (cb_data->cl_data->f, widget, help); 746 directly without using an Emacs event. This is what the Lucid code
747 does below. */
748 show_help_event (popup_activated_flag <= 1 ? cb_data->cl_data->f : NULL,
749 widget, help);
747} 750}
748#else 751#else
749static void 752static void
diff --git a/src/xrdb.c b/src/xrdb.c
index e18ff65f799..6a16e3260bd 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -651,9 +651,7 @@ typedef char **List;
651#define free_arglist(list) 651#define free_arglist(list)
652 652
653static List 653static List
654member (elt, list) 654member (char *elt, List list)
655 char *elt;
656 List list;
657{ 655{
658 List p; 656 List p;
659 657
@@ -665,20 +663,17 @@ member (elt, list)
665} 663}
666 664
667static void 665static void
668fatal (msg, prog, x1, x2, x3, x4, x5) 666fatal (char *msg, char *prog)
669 char *msg, *prog;
670 int x1, x2, x3, x4, x5;
671{ 667{
672 if (errno) 668 if (errno)
673 perror (prog); 669 perror (prog);
674 670
675 (void) fprintf (stderr, msg, prog, x1, x2, x3, x4, x5); 671 (void) fprintf (stderr, msg, prog);
676 exit (1); 672 exit (1);
677} 673}
678 674
679main (argc, argv) 675int
680 int argc; 676main (int argc, char **argv)
681 char **argv;
682{ 677{
683 Display *display; 678 Display *display;
684 char *displayname, *resource_string, *class, *name; 679 char *displayname, *resource_string, *class, *name;
@@ -749,5 +744,7 @@ main (argc, argv)
749 printf ("\tExit.\n\n"); 744 printf ("\tExit.\n\n");
750 745
751 XCloseDisplay (display); 746 XCloseDisplay (display);
747
748 return 0;
752} 749}
753#endif /* TESTRM */ 750#endif /* TESTRM */